@realsee/dnalogel 2.17.0-alpha.5 → 2.17.0-alpha.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 +5 -4
- package/dist/index.umd.js +4 -4
- package/docs/classes/CSS3DRender.html +31 -31
- package/docs/classes/CruisePluginController.html +25 -25
- package/docs/classes/Magnifier.html +20 -20
- package/docs/classes/ModelRoomLabelController.html +11 -11
- package/docs/classes/Object3DHelperController.html +24 -24
- package/docs/classes/PaintBrush.html +15 -15
- package/docs/classes/PanoMeasurePluginLine.html +23 -23
- package/docs/classes/PanoMeasurePluginModel.html +22 -22
- package/docs/classes/PanoMeasurePluginPoint.html +14 -14
- package/docs/classes/PanoMeasurePluginPolyline.html +26 -26
- package/docs/classes/PanoTagPluginController.html +45 -45
- package/docs/classes/Util.BetterTween.html +8 -8
- package/docs/classes/Util.FivePointSelector.html +12 -12
- package/docs/classes/Util.Interval.html +12 -12
- package/docs/classes/Util.Magnifier.html +17 -17
- package/docs/classes/Util.PointDomHelper.html +11 -11
- package/docs/classes/Util.PointHelper.html +11 -11
- package/docs/classes/Util.Rectangle.html +13 -13
- package/docs/enums/CameraMovementEffect.html +7 -7
- package/docs/enums/ContentType.html +19 -19
- package/docs/enums/DIRECTION.html +9 -9
- package/docs/enums/DISPLAY_STRATEGY_TYPE.html +9 -9
- package/docs/enums/DimensionType.html +7 -7
- package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +8 -8
- package/docs/enums/ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.html +9 -9
- package/docs/enums/PaintBrushTypeEnum.html +8 -8
- package/docs/enums/Rotation.html +8 -8
- package/docs/functions/CSS3DRenderPlugin.html +4 -4
- package/docs/functions/CameraMovementPlugin.html +4 -4
- package/docs/functions/CruisePlugin.html +4 -4
- package/docs/functions/GuideLinePlugin.html +5 -5
- package/docs/functions/ItemLabelPlugin.html +4 -4
- package/docs/functions/MapviewFloorplanPlugin.html +4 -4
- package/docs/functions/ModelChassisCompassPlugin.html +4 -4
- package/docs/functions/ModelEntryDoorGuidePlugin.html +4 -4
- package/docs/functions/ModelFloorplanPlugin.html +4 -4
- package/docs/functions/ModelItemLabelPlugin.html +4 -4
- package/docs/functions/ModelRoomLabelPlugin.html +4 -4
- package/docs/functions/ModelTVVideoPlugin.html +4 -4
- package/docs/functions/ModelViewPlugin.html +4 -4
- package/docs/functions/Object3DHelperPlugin.html +4 -4
- package/docs/functions/PanoCompassPlugin.html +4 -4
- package/docs/functions/PanoCursorRaycasterPlugin.html +4 -4
- package/docs/functions/PanoDoorLabelPlugin.html +4 -4
- package/docs/functions/PanoFloorplanRadarPlugin.html +4 -4
- package/docs/functions/PanoMeasurePlugin.html +4 -4
- package/docs/functions/PanoRulerPlugin.html +4 -4
- package/docs/functions/PanoRulerProPlugin.html +4 -4
- package/docs/functions/PanoSpatialTagPlugin.html +4 -4
- package/docs/functions/PanoTagPlugin.html +4 -4
- package/docs/functions/PanoVideoPlugin.html +4 -4
- package/docs/functions/TopviewFloorplanPlugin.html +4 -4
- package/docs/functions/Util.getCoordsFromClient.html +5 -5
- package/docs/functions/Util.getCoordsFromElement.html +5 -5
- package/docs/functions/Util.getFrameTime.html +5 -5
- package/docs/functions/Util.getIntersectFromRelativePosition.html +5 -5
- package/docs/functions/Util.getRaycasterFromFivePointer.html +5 -5
- package/docs/functions/Util.isNil.html +5 -5
- package/docs/functions/Util.nextFrame.html +5 -5
- package/docs/functions/Util.notNil.html +5 -5
- package/docs/functions/Util.requestAnimationFrameInterval.html +5 -5
- package/docs/functions/Util.tweenProgress.html +5 -5
- package/docs/functions/pluginFlag.html +5 -5
- package/docs/index.html +4 -4
- package/docs/interfaces/AddTagConfig.html +6 -6
- package/docs/interfaces/CSS3DRenderPluginEventMap.html +11 -11
- package/docs/interfaces/CSS3DRenderPluginState.html +8 -8
- package/docs/interfaces/CameraMovementPluginExportType.html +7 -7
- package/docs/interfaces/EventMap.html +15 -15
- package/docs/interfaces/FloorplanBounding.html +8 -8
- package/docs/interfaces/FloorplanData.html +10 -10
- package/docs/interfaces/FloorplanEntrance.html +11 -11
- package/docs/interfaces/FloorplanExtraObject.html +10 -10
- package/docs/interfaces/FloorplanExtraObject3D.html +8 -8
- package/docs/interfaces/FloorplanFloorData.html +9 -9
- package/docs/interfaces/FloorplanImagePosition.html +7 -7
- package/docs/interfaces/FloorplanObserver.html +9 -9
- package/docs/interfaces/FloorplanOutlineItem.html +9 -9
- package/docs/interfaces/FloorplanPosition.html +7 -7
- package/docs/interfaces/FloorplanRoomItem.html +13 -13
- package/docs/interfaces/FloorplanRoomLabelItem.html +7 -7
- package/docs/interfaces/FloorplanServerBounding.html +8 -8
- package/docs/interfaces/FloorplanServerComputedData.html +10 -10
- package/docs/interfaces/FloorplanServerData.html +7 -7
- package/docs/interfaces/FloorplanServerDoorItem.html +10 -10
- package/docs/interfaces/FloorplanServerDoorPosition.html +8 -8
- package/docs/interfaces/FloorplanServerEntrance.html +11 -11
- package/docs/interfaces/FloorplanServerFloorData.html +9 -9
- package/docs/interfaces/FloorplanServerImagePosition.html +7 -7
- package/docs/interfaces/FloorplanServerObserver.html +9 -9
- package/docs/interfaces/FloorplanServerOutlineItem.html +9 -9
- package/docs/interfaces/FloorplanServerPosition.html +7 -7
- package/docs/interfaces/FloorplanServerRoomItem.html +14 -14
- package/docs/interfaces/FloorplanServerRoomLabelItem.html +7 -7
- package/docs/interfaces/HelperOffset.html +8 -8
- package/docs/interfaces/ImagePlaneGroup.html +6 -6
- package/docs/interfaces/ItemLabelPluginData.html +6 -6
- package/docs/interfaces/ItemLabelPluginExportReturnsType.html +11 -11
- package/docs/interfaces/ItemLabelPluginParametersType.html +9 -9
- package/docs/interfaces/MinMax.html +7 -7
- package/docs/interfaces/ModelChassisCompassPluginData.html +7 -7
- package/docs/interfaces/ModelChassisCompassPluginExportType.html +8 -8
- package/docs/interfaces/ModelChassisCompassPluginParameterType.html +7 -7
- package/docs/interfaces/ModelEntryDoorGuidePluginData.html +8 -8
- package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +8 -8
- package/docs/interfaces/ModelItemLabelPluginData.html +6 -6
- package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +11 -11
- package/docs/interfaces/ModelItemLabelPluginParametersType.html +7 -7
- package/docs/interfaces/ModelRoomLabelPluginData.html +6 -6
- package/docs/interfaces/ModelTVVideoPluginData.html +9 -9
- package/docs/interfaces/ModelTVVideoPluginExportType.html +8 -8
- package/docs/interfaces/ModelTVVideoPluginParameterType.html +6 -6
- package/docs/interfaces/ModelViewPluginExportType.html +11 -11
- package/docs/interfaces/Object3DHelperState.html +8 -8
- package/docs/interfaces/ObjectHelperControllers.html +9 -9
- package/docs/interfaces/PaintBrushAction.html +12 -12
- package/docs/interfaces/PaintBrushConfigs.html +12 -12
- package/docs/interfaces/PaintBrushState.html +10 -10
- package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +10 -10
- package/docs/interfaces/PanoCursorRaycasterPluginParameterType.html +5 -5
- package/docs/interfaces/PanoMeasureParameterType.html +14 -14
- package/docs/interfaces/PanoMeasurePluginLineJson.html +8 -8
- package/docs/interfaces/PanoMeasurePluginOpenParameter.html +7 -7
- package/docs/interfaces/PanoMeasurePluginPointJson.html +7 -7
- package/docs/interfaces/PanoMeasurePluginPolylineJson.html +8 -8
- package/docs/interfaces/PanoRulerPluginExportType.html +10 -10
- package/docs/interfaces/PanoRulerPluginOptions.html +7 -7
- package/docs/interfaces/PanoRulerPluginParameterType.html +8 -8
- package/docs/interfaces/PanoRulerProPluginExportType.html +9 -9
- package/docs/interfaces/PanoRulerProPluginOptions.html +7 -7
- package/docs/interfaces/PanoRulerProPluginParameterType.html +7 -7
- package/docs/interfaces/PanoRulerProPluginState.html +8 -8
- package/docs/interfaces/PanoSpatialTagPluginContentEvent.html +5 -5
- package/docs/interfaces/PanoSpatialTagPluginContentReplacement.html +5 -5
- package/docs/interfaces/PanoSpatialTagPluginData.html +11 -11
- package/docs/interfaces/PanoSpatialTagPluginDataElement.html +10 -10
- package/docs/interfaces/PanoSpatialTagPluginExportType.html +13 -13
- package/docs/interfaces/PanoSpatialTagPluginOriginElement.html +10 -10
- package/docs/interfaces/PanoSpatialTagPluginParameterType.html +13 -13
- package/docs/interfaces/PanoSpatialTagPluginPointElement.html +11 -11
- package/docs/interfaces/PanoSpatialTagPluginTagElement.html +10 -10
- package/docs/interfaces/PanoVideoPluginType.LoadParams.html +6 -6
- package/docs/interfaces/PanoVideoPluginType.PanoVideoItem.html +8 -8
- package/docs/interfaces/PanoVideoPluginType.PluginData.html +6 -6
- package/docs/interfaces/PanoVideoPluginType.PluginEventMap.html +9 -9
- package/docs/interfaces/PanoVideoPluginType.PluginState.html +6 -6
- package/docs/interfaces/PanoVideoPluginType.VideoItem.html +8 -8
- package/docs/interfaces/PanoVideoPluginType.VideoMeshParams.html +10 -10
- package/docs/interfaces/Point.html +8 -8
- package/docs/interfaces/Room.html +9 -9
- package/docs/interfaces/RoomInfo.html +7 -7
- package/docs/interfaces/RoomLabel.html +14 -14
- package/docs/interfaces/RoomRules.html +5 -5
- package/docs/interfaces/Rooms.html +5 -5
- package/docs/interfaces/Scissor.html +9 -9
- package/docs/interfaces/State.html +8 -8
- package/docs/interfaces/TagCacheInterface.html +12 -12
- package/docs/interfaces/TagConfig.html +12 -12
- package/docs/interfaces/TagGLTFObjectGroup.html +6 -6
- package/docs/interfaces/TagIconUrl.html +11 -11
- package/docs/interfaces/TagObjectGroup.html +6 -6
- package/docs/interfaces/TagStyle.html +6 -6
- package/docs/interfaces/Tags.html +9 -9
- package/docs/interfaces/TemporaryState.html +6 -6
- package/docs/interfaces/Util.MagnifierParameter.html +11 -11
- package/docs/interfaces/Util.MouseGroupParameter.html +8 -8
- package/docs/modules/PanoVideoPluginType.html +5 -5
- package/docs/modules/Util.html +5 -5
- package/docs/modules.html +4 -4
- package/docs/types/ArrayPosition.html +5 -5
- package/docs/types/AudioAppearance.html +5 -5
- package/docs/types/AudioTagTypeConfigKey.html +5 -5
- package/docs/types/CSS3DRenderExportType.html +5 -5
- package/docs/types/CSS3DRenderPluginExportType.html +5 -5
- package/docs/types/CSS3DRenderPluginParameterType.html +5 -5
- package/docs/types/ClassFunctionParameters.html +5 -5
- package/docs/types/Color.html +5 -5
- package/docs/types/ContentTypeConfigKey.html +5 -5
- package/docs/types/ContentTypeConfigKeySplit.html +5 -5
- package/docs/types/ContentTypeMap.html +5 -5
- package/docs/types/Create3DDomContainerReturnType.html +5 -5
- package/docs/types/Create3DElementReturnType.html +5 -5
- package/docs/types/CruisePluginExportType.html +5 -5
- package/docs/types/Direction-1.html +5 -5
- package/docs/types/Direction4.html +5 -5
- package/docs/types/ElementRenderer.html +5 -5
- package/docs/types/FloorplanRuleLabels.html +5 -5
- package/docs/types/FloorplanServerRuleLabels.html +5 -5
- package/docs/types/GuideLinePluginExportType.html +5 -5
- package/docs/types/HelperEventMap.html +5 -5
- package/docs/types/LoadTagConfig.html +5 -5
- package/docs/types/MapviewFloorplanPluginParameterType.html +5 -5
- package/docs/types/MapviewFloorplanPluginReturnType.html +5 -5
- package/docs/types/MediaData.html +5 -5
- package/docs/types/MediaStore.html +5 -5
- package/docs/types/ModelElement.html +5 -5
- package/docs/types/ModelEntryDoorGuidePluginParameterType.html +5 -5
- package/docs/types/ModelFloorplanPluginParameterType.html +5 -5
- package/docs/types/ModelFloorplanPluginReturnType.html +5 -5
- package/docs/types/ModelRoomLabelPluginParameters.html +5 -5
- package/docs/types/ModelRoomLabelPluginReturnType.html +5 -5
- package/docs/types/MoveArgs.html +5 -5
- package/docs/types/MoveOpts.html +5 -5
- package/docs/types/Object3DHelperEventMap.html +5 -5
- package/docs/types/ObjectFit.html +5 -5
- package/docs/types/PaintBrushEventMap.html +5 -5
- package/docs/types/PanoCompassPluginData.html +5 -5
- package/docs/types/PanoCompassPluginExportType.html +5 -5
- package/docs/types/PanoCompassPluginParameterType.html +5 -5
- package/docs/types/PanoFloorplanRadarPluginParameterType.html +5 -5
- package/docs/types/PanoFloorplanRadarPluginReturnType.html +5 -5
- package/docs/types/PanoIndex.html +5 -5
- package/docs/types/PanoMeasurePluginEvent.html +5 -5
- package/docs/types/PanoMeasureReturnType.html +5 -5
- package/docs/types/PanoSpatialTagPluginId.html +5 -5
- package/docs/types/PanoTagPluginExportInterface.html +5 -5
- package/docs/types/PanoTagPluginParamsInterface.html +5 -5
- package/docs/types/PanoVideoPluginParameterType.html +5 -5
- package/docs/types/PanoVideoPluginReturnType.html +5 -5
- package/docs/types/PickTagContentTypeInContentTypeConfigKey.html +5 -5
- package/docs/types/PlaneTag.html +5 -5
- package/docs/types/PlaneTagElement.html +5 -5
- package/docs/types/Point2DElement.html +5 -5
- package/docs/types/Point2DTag.html +5 -5
- package/docs/types/Point3DElement.html +5 -5
- package/docs/types/Point3DTag.html +5 -5
- package/docs/types/PointTag.html +5 -5
- package/docs/types/PointTagElement.html +5 -5
- package/docs/types/Position.html +5 -5
- package/docs/types/RotateArgs.html +5 -5
- package/docs/types/RotateOpts.html +5 -5
- package/docs/types/RuleLabelsKey.html +5 -5
- package/docs/types/RuleLabelsValue.html +5 -5
- package/docs/types/StickType.html +5 -5
- package/docs/types/Tag.html +5 -5
- package/docs/types/Tag2D.html +5 -5
- package/docs/types/Tag3D.html +5 -5
- package/docs/types/TagContentType.html +5 -5
- package/docs/types/TagDimensionType.html +5 -5
- package/docs/types/TagElement.html +5 -5
- package/docs/types/TagEvents.html +5 -5
- package/docs/types/TagGLTFObject.html +5 -5
- package/docs/types/TagHooks.html +5 -5
- package/docs/types/TagIconSize.html +5 -5
- package/docs/types/TagId.html +5 -5
- package/docs/types/TopviewFloorplanPluginParameterType.html +5 -5
- package/docs/types/TopviewFloorplanPluginReturnType.html +5 -5
- package/docs/types/WorkCode.html +5 -5
- package/docs/variables/FLOOR_TYPE_MAP.html +5 -5
- package/docs/variables/PLUGIN.html +5 -5
- package/docs/variables/ROOM_FETILE_TYPE_MAP.html +5 -5
- package/docs/variables/ROOM_TYPE_MAP.html +5 -5
- package/docs/variables/itemLabelPluginServerParams.html +5 -5
- package/docs/variables/modelItemLabelPluginServerParams.html +5 -5
- package/docs/variables/modelRoomLabelPluginServerParams.html +5 -5
- package/libs/PanoTagPlugin/controller/TagRender.js +95 -94
- package/libs/base/BasePlugin.js +1 -1
- package/libs/shared-utils/logger.js +1 -1
- package/libs/shared-utils/three/getPositionsByObjectFit.js +15 -15
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var hc=Object.defineProperty,fc=Object.defineProperties;var mc=Object.getOwnPropertyDescriptors;var jo=Object.getOwnPropertySymbols;var pc=Object.prototype.hasOwnProperty,gc=Object.prototype.propertyIsEnumerable;var Mi=(i,t,e)=>t in i?hc(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e,Q=(i,t)=>{for(var e in t||(t={}))pc.call(t,e)&&Mi(i,e,t[e]);if(jo)for(var e of jo(t))gc.call(t,e)&&Mi(i,e,t[e]);return i},fe=(i,t)=>fc(i,mc(t));var f=(i,t,e)=>(Mi(i,typeof t!="symbol"?t+"":t,e),e);var H=(i,t,e)=>new Promise((n,o)=>{var s=l=>{try{a(e.next(l))}catch(c){o(c)}},r=l=>{try{a(e.throw(l))}catch(c){o(c)}},a=l=>l.done?n(l.value):Promise.resolve(l.value).then(s,r);a((e=e.apply(i,t)).next())});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const ei=require("@tweenjs/tween.js"),Ee=require("@realsee/five"),j=require("three"),ti=require("three/examples/jsm/renderers/CSS3DRenderer"),ba=require("@realsee/five/line"),ya=require("three/examples/jsm/loaders/FBXLoader"),vc=require("hammerjs"),Ac=require("classnames"),bc=require("polyline-normals"),yc=require("object-assign-deep"),wc=require("@realsee/five/gltf-loader"),Ec=require("animejs"),Pc=require("lodash.get"),Cc=require("lodash.clonedeep"),Ic=require("lodash.isequal"),dt=i=>i&&typeof i=="object"&&"default"in i?i:{default:i};function wa(i){if(i&&i.__esModule)return 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 En=dt(ei),gi=wa(ei),E=wa(j),xn=dt(vc),Oe=dt(Ac),kc=dt(bc),tt=dt(yc),Oo=dt(Ec),Tn=dt(Pc),xc=dt(Cc),Dc=dt(Ic);function Lc(){console.info("%c %c@realsee/dnalogel %cv2.17.0-alpha.
|
|
1
|
+
"use strict";var hc=Object.defineProperty,fc=Object.defineProperties;var mc=Object.getOwnPropertyDescriptors;var jo=Object.getOwnPropertySymbols;var pc=Object.prototype.hasOwnProperty,gc=Object.prototype.propertyIsEnumerable;var Mi=(i,t,e)=>t in i?hc(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e,Q=(i,t)=>{for(var e in t||(t={}))pc.call(t,e)&&Mi(i,e,t[e]);if(jo)for(var e of jo(t))gc.call(t,e)&&Mi(i,e,t[e]);return i},fe=(i,t)=>fc(i,mc(t));var f=(i,t,e)=>(Mi(i,typeof t!="symbol"?t+"":t,e),e);var H=(i,t,e)=>new Promise((n,o)=>{var s=l=>{try{a(e.next(l))}catch(c){o(c)}},r=l=>{try{a(e.throw(l))}catch(c){o(c)}},a=l=>l.done?n(l.value):Promise.resolve(l.value).then(s,r);a((e=e.apply(i,t)).next())});Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const ei=require("@tweenjs/tween.js"),Ee=require("@realsee/five"),j=require("three"),ti=require("three/examples/jsm/renderers/CSS3DRenderer"),ba=require("@realsee/five/line"),ya=require("three/examples/jsm/loaders/FBXLoader"),vc=require("hammerjs"),Ac=require("classnames"),bc=require("polyline-normals"),yc=require("object-assign-deep"),wc=require("@realsee/five/gltf-loader"),Ec=require("animejs"),Pc=require("lodash.get"),Cc=require("lodash.clonedeep"),Ic=require("lodash.isequal"),dt=i=>i&&typeof i=="object"&&"default"in i?i:{default:i};function wa(i){if(i&&i.__esModule)return 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 En=dt(ei),gi=wa(ei),E=wa(j),xn=dt(vc),Oe=dt(Ac),kc=dt(bc),tt=dt(yc),Oo=dt(Ec),Tn=dt(Pc),xc=dt(Cc),Dc=dt(Ic);function Lc(){console.info("%c %c@realsee/dnalogel %cv2.17.0-alpha.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 Mc(){const i=typeof OffscreenCanvas!="undefined",t=i&&new OffscreenCanvas(1,1).getContext("webgl")!==null;i&&!t&&Object.assign(window,{OffscreenCanvas:function(e,n){const o=document.createElement("canvas");return o.width=e,o.height=n,o}})}function Ea(){}const Ro=()=>Promise.resolve(),Qo={__queue:Promise.resolve()};function Sc(i=Ro){Qo.__queue=Qo.__queue.then(i).catch(Ro)}function zn(i,t,e){const n=i.x,o=i.y,s=Math.floor(n/t*1e4)/1e4,r=Math.floor(o/e*1e4)/1e4;return{x:s,y:r}}function Si(i,t,e){const{x:n,y:o}=i,s=n*t,r=o*e;return{x:s,y:r}}function Bn(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 Tc(i,t,e=Ea){new Promise(n=>{setTimeout(()=>{e(),n(!0)},t*i)})}const zc=window,Fo=window.requestAnimationFrame||zc.webkitRequestAnimationFrame||(i=>setTimeout(i,16));function Jn(i,t=0){t<=0?Fo(i):Fo(()=>Jn(i,t-1))}function Bc(i,t,e,n=ei.Easing.Linear.None){const o=new ei.Tween(i).to(t,e).easing(n).start();function s(r){!o.update(r)||requestAnimationFrame(s)}return requestAnimationFrame(s),o}var at=(i=>(i.Drawline="Drawline",i.Undo="Undo",i.Exit="Exit",i))(at||{});const An=Symbol("$$PAINT_BRUSH_EVENT$$");function Vn(i){return i[An]||(i[An]={}),i[An]}function Vc(i){i[An]||delete i[An]}class jc{hasListener(t){const e=Vn(this);return e&&e[t]&&e[t].length>0}on(t,e,n){const o=Vn(this);return o[t]||(o[t]=[]),o[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){Vc(this);return}const n=Vn(this);if(n[t]||(n[t]=[]),e===void 0){n[t].length=0;return}let o=0;for(;o<n[t].length&&n[t][o][0]!==e;o++);o<n[t].length&&n[t].splice(o,1)}emit(t,...e){let n=!1;const s=Vn(this)[t]||[];for(let r of s.slice()){const[a,l=!1]=r,c=a(...e);l&&this.off(t,a),c===!1&&(n=!0)}return n}}function ht(){return((1+Math.random())*65536|0).toString(16).substring(1)}function Ge(){return(ht()+ht()+"-"+ht()+"-4"+ht().substr(0,3)+"-"+ht()+"-"+ht()+ht()+ht()).toLowerCase()}const Oc=`
|
|
2
2
|
<style type="text/css">
|
|
3
3
|
|
|
4
4
|
#_gl_paintBrush {
|
|
@@ -112,7 +112,7 @@ transition: all 500ms;
|
|
|
112
112
|
svg [type='lineItemGroup'] g g g g {
|
|
113
113
|
stroke: #ffffff;
|
|
114
114
|
}</style>
|
|
115
|
-
`;return i.$$set=s=>{"content"in s&&e(0,n=s.content)},[n,o]}class vd extends oe{constructor(t){super(),ie(this,t,gd,pd,ne,{content:0},md)}}function Ad(i){le(i,"svelte-ozpg4a",".floorplan-plugin__base-image.svelte-ozpg4a{position:absolute;z-index:10;width:100%;height:100%;pointer-events:none}")}function bd(i){let t,e;return t=new fd({props:{url:i[1].url}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.url=n[1].url),t.$set(s)},i(n){e||(C(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function yd(i){let t,e;return t=new vd({props:{content:i[0]}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.content=n[0]),t.$set(s)},i(n){e||(C(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function wd(i){let t,e,n,o;const s=[yd,bd],r=[];function a(l,c){return l[0]?0:l[1]?1:-1}return~(e=a(i))&&(n=r[e]=s[e](i)),{c(){t=B("div"),n&&n.c(),y(t,"class","floorplan-plugin__base-image svelte-ozpg4a")},m(l,c){T(l,t,c),~e&&r[e].m(t,null),o=!0},p(l,[c]){let u=e;e=a(l),e===u?~e&&r[e].p(l,c):(n&&(se(),D(r[u],1,1,()=>{r[u]=null}),re()),~e?(n=r[e],n?n.p(l,c):(n=r[e]=s[e](l),n.c()),C(n,1),n.m(t,null)):n=null)},i(l){o||(C(n),o=!0)},o(l){D(n),o=!1},d(l){l&&M(t),~e&&r[e].d()}}}function Ed(i,t,e){let n,o,{floorIndex:s}=t,{floorplanData:r}=t;return i.$$set=a=>{"floorIndex"in a&&e(2,s=a.floorIndex),"floorplanData"in a&&e(3,r=a.floorplanData)},i.$$.update=()=>{var a,l;i.$$.dirty&12&&e(1,n=r.outlines[s]),i.$$.dirty&12&&e(0,o=(l=(a=r.outlines)==null?void 0:a[s])==null?void 0:l.svgContent)},[o,n,s,r]}class tl extends oe{constructor(t){super(),ie(this,t,Ed,wd,ne,{floorIndex:2,floorplanData:3},Ad)}}function Pd(i){le(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 Cd(i){let t,e=i[8].outerHTML+"",n;return{c(){t=new ii(!1),n=pe(),t.a=n},m(o,s){t.m(e,o,s),T(o,n,s)},p(o,s){s&256&&e!==(e=o[8].outerHTML+"")&&t.p(e)},d(o){o&&M(n),o&&t.d()}}}function Id(i){let t,e,n=i[1]&&qo(i),o=i[0]&&Jo(i);return{c(){n&&n.c(),t=$(),o&&o.c(),e=pe()},m(s,r){n&&n.m(s,r),T(s,t,r),o&&o.m(s,r),T(s,e,r)},p(s,r){s[1]?n?n.p(s,r):(n=qo(s),n.c(),n.m(t.parentNode,t)):n&&(n.d(1),n=null),s[0]?o?o.p(s,r):(o=Jo(s),o.c(),o.m(e.parentNode,e)):o&&(o.d(1),o=null)},d(s){n&&n.d(s),s&&M(t),o&&o.d(s),s&&M(e)}}}function qo(i){let t,e=i[2].name+"",n;return{c(){t=B("span"),n=xe(e),y(t,"class","floorplan-plugin__room-name")},m(o,s){T(o,t,s),V(t,n)},p(o,s){s&4&&e!==(e=o[2].name+"")&&Se(n,e)},d(o){o&&M(t)}}}function Jo(i){let t,e;return{c(){t=B("span"),e=xe(i[7]),y(t,"class","floorplan-plugin__room-size svelte-12pzct5")},m(n,o){T(n,t,o),V(t,e)},p(n,o){o&128&&Se(e,n[7])},d(n){n&&M(t)}}}function kd(i){let t,e,n;function o(a,l){if(a[3]===void 0)return Id;if(a[8])return Cd}let s=o(i),r=s&&s(i);return{c(){t=B("div"),r&&r.c(),y(t,"class","floorplan-plugin__room-label-item svelte-12pzct5"),z(t,"left",i[9]),z(t,"top",i[10]),z(t,"font-size",i[11]),z(t,"opacity",i[6]?"1":"0")},m(a,l){T(a,t,l),r&&r.m(t,null),e||(n=[ct(ln.call(null,t)),me(t,"clientWidth",i[19]),me(t,"clientHeight",i[20])],e=!0)},p(a,[l]){s===(s=o(a))&&r?r.p(a,l):(r&&r.d(1),r=s&&s(a),r&&(r.c(),r.m(t,null))),l&64&&z(t,"opacity",a[6]?"1":"0")},i:X,o:X,d(a){a&&M(t),r&&r.d(),e=!1,He(n)}}}function xd(i,t){const e=i[0],n=i[1];let o=!1;for(let s=0,r=t.length-1;s<t.length;r=s++){const a=t[s][0],l=t[s][1],c=t[r][0],u=t[r][1];l>n!=u>n&&e<(c-a)*(n-l)/(u-l)+a&&(o=!o)}return o}function Dd(i,t,e){let n,o,s,r,a,{pxmm:l}=t,{roomAreaEnable:c}=t,{roomNameEnable:u}=t,{room:h}=t,{hoveredRoom:d}=t,{getRoomAreaText:m}=t,{getLabelElement:g}=t,{adaptiveRoomLabelVisibleEnable:p}=t;function A(S,O){if(O.width===0||O.height===0)return()=>!1;const G=S.path.map(({x:de,y:ge})=>[de,ge]),W=S.roomLabel.position,{x:Y,y:_}=W,{width:ee,height:U}=O,ae=ee/2,he=U/2;return function(ge){const Ce=Y*ge,ke=_*ge,Te=G.map(([ve,Pe])=>[ve*ge,Pe*ge]);return[[Ce+ae,ke-he],[Ce-ae,ke-he],[Ce-ae,ke+he],[Ce+ae,ke+he]].every(ve=>xd(ve,Te))}}const v=document.body.clientWidth,b=document.body.clientHeight,w=h.roomLabel,k=w.positionInImage.x*100+"%",I=w.positionInImage.y*100+"%",P=(v<500||b<500?10:14)+"px";let L=0,x=0,F=!1;d.subscribe(function(O){e(16,F=!!O&&O.id===h.id)});const N=S=>{e(4,L=S.detail)},R=S=>{e(5,x=S.detail)};return i.$$set=S=>{"pxmm"in S&&e(12,l=S.pxmm),"roomAreaEnable"in S&&e(0,c=S.roomAreaEnable),"roomNameEnable"in S&&e(1,u=S.roomNameEnable),"room"in S&&e(2,h=S.room),"hoveredRoom"in S&&e(13,d=S.hoveredRoom),"getRoomAreaText"in S&&e(14,m=S.getRoomAreaText),"getLabelElement"in S&&e(3,g=S.getLabelElement),"adaptiveRoomLabelVisibleEnable"in S&&e(15,p=S.adaptiveRoomLabelVisibleEnable)},i.$$.update=()=>{i.$$.dirty&12&&e(8,n=g==null?void 0:g(h)),i.$$.dirty&16388&&e(7,o=h.size?m(h.size):""),i.$$.dirty&48&&e(18,s={width:L,height:x}),i.$$.dirty&262148&&e(17,r=s?A(h,s):void 0),i.$$.dirty&233472&&e(6,a=p?F?!0:!!(r!=null&&r(l)):!0)},[c,u,h,g,L,x,a,o,n,k,I,P,l,d,m,p,F,r,s,N,R]}class Ld extends oe{constructor(t){super(),ie(this,t,Dd,kd,ne,{pxmm:12,roomAreaEnable:0,roomNameEnable:1,room:2,hoveredRoom:13,getRoomAreaText:14,getLabelElement:3,adaptiveRoomLabelVisibleEnable:15},Pd)}}function Md(i){le(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 Zo(i,t,e){const n=i.slice();return n[12]=t[e],n}function Ko(i){let t,e=[],n=new Map,o,s,r,a=i[8];const l=c=>c[12].id;for(let c=0;c<a.length;c+=1){let u=Zo(i,a,c),h=l(u);n.set(h,e[c]=$o(h,u))}return{c(){t=B("div");for(let c=0;c<e.length;c+=1)e[c].c();y(t,"class","floorplan-plugin__room-labels svelte-13xux0b")},m(c,u){T(c,t,u);for(let h=0;h<e.length;h+=1)e[h].m(t,null);o=!0,s||(r=[ct(ln.call(null,t)),me(t,"clientWidth",i[11])],s=!0)},p(c,u){u&447&&(a=c[8],se(),e=Ke(e,u,l,1,c,a,n,t,It,$o,null,Zo),re())},i(c){if(!o){for(let u=0;u<a.length;u+=1)C(e[u]);o=!0}},o(c){for(let u=0;u<e.length;u+=1)D(e[u]);o=!1},d(c){c&&M(t);for(let u=0;u<e.length;u+=1)e[u].d();s=!1,He(r)}}}function $o(i,t){let e,n,o;const s=[{pxmm:t[7],room:t[12],hoveredRoom:t[2],roomAreaEnable:t[0],roomNameEnable:t[1],getLabelElement:t[4],getRoomAreaText:t[3],adaptiveRoomLabelVisibleEnable:t[5]}];let r={};for(let a=0;a<s.length;a+=1)r=Be(r,s[a]);return n=new Ld({props:r}),{key:i,first:null,c(){e=pe(),K(n.$$.fragment),this.first=e},m(a,l){T(a,e,l),J(n,a,l),o=!0},p(a,l){t=a;const c=l&447?Qe(s,[{pxmm:t[7],room:t[12],hoveredRoom:t[2],roomAreaEnable:t[0],roomNameEnable:t[1],getLabelElement:t[4],getRoomAreaText:t[3],adaptiveRoomLabelVisibleEnable:t[5]}]):{};n.$set(c)},i(a){o||(C(n.$$.fragment,a),o=!0)},o(a){D(n.$$.fragment,a),o=!1},d(a){a&&M(e),Z(n,a)}}}function Sd(i){let t,e,n=i[8]&&Ko(i);return{c(){n&&n.c(),t=pe()},m(o,s){n&&n.m(o,s),T(o,t,s),e=!0},p(o,[s]){o[8]?n?(n.p(o,s),s&256&&C(n,1)):(n=Ko(o),n.c(),C(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(C(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function Td(i,t,e){let n,{floorIndex:o}=t,{roomAreaEnable:s}=t,{roomNameEnable:r}=t,{floorplanData:a}=t,{hoveredRoom:l}=t,{getRoomAreaText:c}=t,{getLabelElement:u}=t,{adaptiveRoomLabelVisibleEnable:h}=t,d=0,m=0;const g=p=>{e(6,d=p.detail)};return i.$$set=p=>{"floorIndex"in p&&e(9,o=p.floorIndex),"roomAreaEnable"in p&&e(0,s=p.roomAreaEnable),"roomNameEnable"in p&&e(1,r=p.roomNameEnable),"floorplanData"in p&&e(10,a=p.floorplanData),"hoveredRoom"in p&&e(2,l=p.hoveredRoom),"getRoomAreaText"in p&&e(3,c=p.getRoomAreaText),"getLabelElement"in p&&e(4,u=p.getLabelElement),"adaptiveRoomLabelVisibleEnable"in p&&e(5,h=p.adaptiveRoomLabelVisibleEnable)},i.$$.update=()=>{if(i.$$.dirty&1536&&e(8,n=a.floorDatas[o].rooms),i.$$.dirty&1088){const{max:p,min:A}=a.bounding,v=p.x-A.x;e(7,m=d/v)}},[s,r,l,c,u,h,d,m,n,o,a,g]}class zd extends oe{constructor(t){super(),ie(this,t,Td,Sd,ne,{floorIndex:9,roomAreaEnable:0,roomNameEnable:1,floorplanData:10,hoveredRoom:2,getRoomAreaText:3,getLabelElement:4,adaptiveRoomLabelVisibleEnable:5},Md)}}function Bd(i){le(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 es(i,t,e){const n=i.slice();return n[11]=t[e],n[13]=e,n}function ts(i,t,e){const n=i.slice();return n[14]=t[e],n}function ns(i){let t;return{c(){t=B("div"),y(t,"class","floorplan-plugin__rule-scale svelte-djlmk4"),z(t,"left",i[14].left*100+"%"),z(t,"bottom",i[14].bottom*100+"%")},m(e,n){T(e,t,n)},p:X,d(e){e&&M(t)}}}function is(i,t){let e,n,o=t[1](t[11].distance)+"",s,r;return{key:i,first:null,c(){e=B("div"),n=B("div"),s=xe(o),r=$(),y(n,"class","floorplan-plugin__rule-text svelte-djlmk4"),q(n,"is-row",t[2]),y(e,"class","floorplan-plugin__rule-text-item svelte-djlmk4"),z(e,"left",t[11].left*100+"%"),z(e,"bottom",t[11].bottom*100+"%"),this.first=e},m(a,l){T(a,e,l),V(e,n),V(n,s),V(e,r)},p(a,l){t=a,l&2&&o!==(o=t[1](t[11].distance)+"")&&Se(s,o)},d(a){a&&M(e)}}}function Vd(i){let t,e,n,o,s,r,a=[],l=new Map,c,u=i[3],h=[];for(let g=0;g<u.length;g+=1)h[g]=ns(ts(i,u,g));let d=i[4];const m=g=>g[13];for(let g=0;g<d.length;g+=1){let p=es(i,d,g),A=m(p);l.set(A,a[g]=is(A,p))}return{c(){t=B("div"),e=B("div"),n=$(),o=B("div");for(let g=0;g<h.length;g+=1)h[g].c();s=$(),r=B("div");for(let g=0;g<a.length;g+=1)a[g].c();y(e,"class","floorplan-plugin__rule-line svelte-djlmk4"),y(o,"class","floorplan-plugin__rule-scale-wrapper svelte-djlmk4"),q(o,"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"),q(t,"is-row",i[2]),z(t,"width",i[2]?"100%":1/16+"rem"),z(t,"height",i[2]?1/16+"rem":"100%")},m(g,p){T(g,t,p),V(t,e),V(t,n),V(t,o);for(let A=0;A<h.length;A+=1)h[A].m(o,null);V(t,s),V(t,r);for(let A=0;A<a.length;A+=1)a[A].m(r,null)},p(g,[p]){if(p&8){u=g[3];let A;for(A=0;A<u.length;A+=1){const v=ts(g,u,A);h[A]?h[A].p(v,p):(h[A]=ns(v),h[A].c(),h[A].m(o,null))}for(;A<h.length;A+=1)h[A].d(1);h.length=u.length}p&22&&(d=g[4],a=Ke(a,p,m,1,g,d,l,r,Ao,is,null,es)),p&1&&c!==(c="floorplan-plugin__rule-labels floorplan-plugin__rule-labels--"+g[0]+" svelte-djlmk4")&&y(t,"class",c),p&5&&q(t,"is-row",g[2])},i:X,o:X,d(g){g&&M(t),ut(h,g);for(let p=0;p<a.length;p+=1)a[p].d()}}}const Qt=1e3,Ft=180;function jd(i,t,e){let{type:n}=t,{data:o}=t,{bounding:s}=t,{getRuleDistanceText:r}=t;const a=n==="top"||n==="bottom",l=s.max.x-s.min.x-(Qt-Ft)*2,c=s.max.y-s.min.y-(Qt-Ft)*2,u=o.map(([g,p])=>a?[g.x,p.x]:[g.y,p.y]).flat().sort().filter((g,p,A)=>p===0?!0:g!==A[p-1]),h=u.map(g=>{const p=a?(g-s.min.x-Qt+Ft)/l:0,A=a?0:(g-s.min.y-Qt+Ft)/c;return{left:p,bottom:A}});h.unshift({left:0,bottom:0}),h.push(a?{left:1,bottom:0}:{left:0,bottom:1});const d=u[u.length-1]-u[0],m=u.map((g,p,A)=>{const v=p===0?0:g-A[p-1],b=p===0?0:(g+A[p-1])/2,w=a?(b-s.min.x-Qt+Ft)/l:0,k=a?0:(b-s.min.y-Qt+Ft)/c;return{left:w,bottom:k,distance:v}}).filter(({distance:g})=>g/d>.1);return i.$$set=g=>{"type"in g&&e(0,n=g.type),"data"in g&&e(5,o=g.data),"bounding"in g&&e(6,s=g.bounding),"getRuleDistanceText"in g&&e(1,r=g.getRuleDistanceText)},[n,r,a,h,m,o,s]}class Od extends oe{constructor(t){super(),ie(this,t,jd,Vd,ne,{type:0,data:5,bounding:6,getRuleDistanceText:1},Bd)}}function Rd(i){le(i,"svelte-1mzj9p3",".floorplan-plugin__rule-labels-wrapper.svelte-1mzj9p3{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);pointer-events:none}")}function os(i,t,e){const n=i.slice();return n[13]=t[e][0],n[14]=t[e][1],n}function ss(i,t){let e,n,o;const s=[{type:t[13],data:t[14],bounding:t[1],getRuleDistanceText:t[0]}];let r={};for(let a=0;a<s.length;a+=1)r=Be(r,s[a]);return n=new Od({props:r}),{key:i,first:null,c(){e=pe(),K(n.$$.fragment),this.first=e},m(a,l){T(a,e,l),J(n,a,l),o=!0},p(a,l){t=a;const c=l&19?Qe(s,[{type:t[13],data:t[14],bounding:t[1],getRuleDistanceText:t[0]}]):{};n.$set(c)},i(a){o||(C(n.$$.fragment,a),o=!0)},o(a){D(n.$$.fragment,a),o=!1},d(a){a&&M(e),Z(n,a)}}}function Qd(i){let t,e=[],n=new Map,o,s=i[4];const r=a=>a[13];for(let a=0;a<s.length;a+=1){let l=os(i,s,a),c=r(l);n.set(c,e[a]=ss(c,l))}return{c(){t=B("div");for(let a=0;a<e.length;a+=1)e[a].c();y(t,"class","floorplan-plugin__rule-labels-wrapper svelte-1mzj9p3"),z(t,"width",i[3]),z(t,"height",i[2])},m(a,l){T(a,t,l);for(let c=0;c<e.length;c+=1)e[c].m(t,null);o=!0},p(a,[l]){l&19&&(s=a[4],se(),e=Ke(e,l,r,1,a,s,n,t,It,ss,null,os),re()),l&8&&z(t,"width",a[3]),l&4&&z(t,"height",a[2])},i(a){if(!o){for(let l=0;l<s.length;l+=1)C(e[l]);o=!0}},o(a){for(let l=0;l<e.length;l+=1)D(e[l]);o=!1},d(a){a&&M(t);for(let l=0;l<e.length;l+=1)e[l].d()}}}const rs=1e3,as=180;function Fd(i,t,e){let n,o,s,r,a,l,c,u,h,d,{floorIndex:m}=t,{floorplanData:g}=t,{getRuleDistanceText:p}=t;return i.$$set=A=>{"floorIndex"in A&&e(5,m=A.floorIndex),"floorplanData"in A&&e(6,g=A.floorplanData),"getRuleDistanceText"in A&&e(0,p=A.getRuleDistanceText)},i.$$.update=()=>{i.$$.dirty&64&&e(1,n=g.bounding),i.$$.dirty&96&&e(11,o=g.floorDatas[m].rules),i.$$.dirty&2048&&e(12,s=Object.keys(o)),i.$$.dirty&6144&&e(4,r=s.map(A=>[A,o[A]])),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-(rs-as)*2),i.$$.dirty&2&&e(8,u=n.max.y-n.min.y-(rs-as)*2),i.$$.dirty&1536&&e(3,h=c/a*100+"%"),i.$$.dirty&384&&e(2,d=u/l*100+"%")},[p,n,d,h,r,m,g,l,u,a,c,o,s]}class Hd extends oe{constructor(t){super(),ie(this,t,Fd,Qd,ne,{floorIndex:5,floorplanData:6,getRuleDistanceText:0},Rd)}}function wi(i,t={}){let e="";const{needZ:n,needA:o}=t;return(n?i.slice().concat(i[0]):i.slice()).forEach((r,a)=>{const{x:l,y:c}=t.format?t.format(r):r,u=l+","+c;return a===0?(e+="M"+u,e):o!=null&&o[a]?(e+="A"+o[a]+","+u,e):(e+="L"+u,e)}),e+(n?"Z":"")}function nl({x:i,y:t},e){const{max:n,min:o}=e;return{x:i-o.x,y:n.y-t}}function Gd(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 Wd(i,t){const e=t.bounding,n=e.max.x-e.min.x,o=e.max.y-e.min.y;return{x:(i.x-e.min.x)/n,y:(e.max.y-i.y)/o}}function _d(i,t){return Math.max(...t.work.observers.map(n=>i.z>=n.standingPosition.z?n.floorIndex:0))}function Nd(i){let t;return{c(){t=we("path"),y(t,"d",i[0]),y(t,"fill","#2F313A")},m(e,n){T(e,t,n)},p(e,[n]){n&1&&y(t,"d",e[0])},i:X,o:X,d(e){e&&M(t)}}}function Xd(i,t,e){let n,{path:o}=t;return i.$$set=s=>{"path"in s&&e(1,o=s.path)},i.$$.update=()=>{i.$$.dirty&2&&e(0,n=wi(o,{needZ:!0}))},[n,o]}class Yd extends oe{constructor(t){super(),ie(this,t,Xd,Nd,ne,{path:1})}}function Ud(i){let t,e,n,o,s,r;return{c(){t=we("defs"),e=we("pattern"),n=we("rect"),o=we("path"),s=$(),r=we("path"),y(n,"x","0"),y(n,"y","0"),y(n,"width",i[1]),y(n,"height",i[1]),y(n,"fill","#323747"),y(o,"d",i[2]),y(o,"stroke","#ffffff"),y(o,"stroke-opacity","0.06"),y(o,"stroke-width","0.5"),y(o,"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){T(a,t,l),V(t,e),V(e,n),V(e,o),T(a,s,l),T(a,r,l)},p(a,[l]){l&1&&y(r,"d",a[0])},i:X,o:X,d(a){a&&M(t),a&&M(s),a&&M(r)}}}const ji=6;function qd(i,t,e){let n,{path:o}=t;const s=ji*2,r=`M0 ${ji} h ${s} M${ji} 0 v ${s}`;return i.$$set=a=>{"path"in a&&e(3,o=a.path)},i.$$.update=()=>{i.$$.dirty&8&&e(0,n=wi(o,{needZ:!0}))},[n,s,r,o]}class Jd extends oe{constructor(t){super(),ie(this,t,qd,Ud,ne,{path:3})}}function Zd(i){let t,e,n,o,s,r,a,l,c,u,h;return{c(){t=we("defs"),e=we("pattern"),n=we("rect"),o=we("pattern"),s=we("rect"),r=$(),a=we("path"),l=$(),c=we("path"),u=$(),h=we("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(s,"x","0"),y(s,"y","0"),y(s,"width","6"),y(s,"height","50"),y(s,"fill","none"),y(s,"stroke","#4B4B57"),y(s,"stroke-width","0.5"),y(o,"id","room-material-pattern-2"),y(o,"x","6"),y(o,"y","25"),y(o,"width","12"),y(o,"height","50"),y(o,"patternUnits","userSpaceOnUse"),y(o,"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(d,m){T(d,t,m),V(t,e),V(e,n),V(t,o),V(o,s),T(d,r,m),T(d,a,m),T(d,l,m),T(d,c,m),T(d,u,m),T(d,h,m)},p(d,[m]){m&1&&y(a,"d",d[0]),m&1&&y(c,"d",d[0]),m&1&&y(h,"d",d[0])},i:X,o:X,d(d){d&&M(t),d&&M(r),d&&M(a),d&&M(l),d&&M(c),d&&M(u),d&&M(h)}}}function Kd(i,t,e){let n,{path:o}=t;return i.$$set=s=>{"path"in s&&e(1,o=s.path)},i.$$.update=()=>{i.$$.dirty&2&&e(0,n=wi(o,{needZ:!0}))},[n,o]}class $d extends oe{constructor(t){super(),ie(this,t,Kd,Zd,ne,{path:1})}}function eh(i){le(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 ls(i,t,e){const n=i.slice();return n[5]=t[e],n}function th(i){let t,e;return t=new Jd({props:{path:i[5].path}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.path=n[5].path),t.$set(s)},i(n){e||(C(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function nh(i){let t,e;return t=new $d({props:{path:i[5].path}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.path=n[5].path),t.$set(s)},i(n){e||(C(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function ih(i){let t,e;return t=new Yd({props:{path:i[5].path}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.path=n[5].path),t.$set(s)},i(n){e||(C(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function cs(i){let t,e,n,o;const s=[ih,nh,th],r=[];function a(l,c){return l[5].floorType===1?0:l[5].floorType===0?1:2}return e=a(i),n=r[e]=s[e](i),{c(){t=we("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){T(l,t,c),r[e].m(t,null),o=!0},p(l,c){let u=e;e=a(l),e===u?r[e].p(l,c):(se(),D(r[u],1,1,()=>{r[u]=null}),re(),n=r[e],n?n.p(l,c):(n=r[e]=s[e](l),n.c()),C(n,1),n.m(t,null))},i(l){o||(C(n),o=!0)},o(l){D(n),o=!1},d(l){l&&M(t),r[e].d()}}}function oh(i){let t,e,n=i[0],o=[];for(let r=0;r<n.length;r+=1)o[r]=cs(ls(i,n,r));const s=r=>D(o[r],1,1,()=>{o[r]=null});return{c(){t=B("div");for(let r=0;r<o.length;r+=1)o[r].c();y(t,"class","floorplan-plugin__room-material svelte-1dykexu")},m(r,a){T(r,t,a);for(let l=0;l<o.length;l+=1)o[l].m(t,null);e=!0},p(r,[a]){if(a&7){n=r[0];let l;for(l=0;l<n.length;l+=1){const c=ls(r,n,l);o[l]?(o[l].p(c,a),C(o[l],1)):(o[l]=cs(c),o[l].c(),C(o[l],1),o[l].m(t,null))}for(se(),l=n.length;l<o.length;l+=1)s(l);re()}},i(r){if(!e){for(let a=0;a<n.length;a+=1)C(o[a]);e=!0}},o(r){o=o.filter(Boolean);for(let a=0;a<o.length;a+=1)D(o[a]);e=!1},d(r){r&&M(t),ut(o,r)}}}function sh(i,t,e){let n,{floorIndex:o}=t,{floorplanData:s}=t;const r=s.bounding.max.x-s.bounding.min.x,a=s.bounding.max.y-s.bounding.min.y;return i.$$set=l=>{"floorIndex"in l&&e(3,o=l.floorIndex),"floorplanData"in l&&e(4,s=l.floorplanData)},i.$$.update=()=>{i.$$.dirty&24&&e(0,n=s.floorDatas[o].rooms.map(l=>fe(Q({},l),{path:l.path.map(c=>nl(c,s.bounding))})))},[n,r,a,o,s]}class rh extends oe{constructor(t){super(),ie(this,t,sh,oh,ne,{floorIndex:3,floorplanData:4},eh)}}function ah(i){le(i,"svelte-qq2273","path.svelte-qq2273{--opacity:0;opacity:var(--opacity)}path.svelte-qq2273:hover{opacity:calc(var(--opacity) + 0.1)}")}function lh(i){let t,e,n,o;return{c(){t=we("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(s,r){T(s,t,r),n||(o=[me(t,"mouseenter",i[3]),me(t,"mouseleave",i[4])],n=!0)},p(s,[r]){r&4&&y(t,"style",s[2]),r&3&&e!==(e=`${s[1]}_${s[0].id}`)&&y(t,"id",e)},i:X,o:X,d(s){s&&M(t),n=!1,He(o)}}}function ch(i,t,e){let n,o,{room:s}=t,{floorIndex:r}=t,{floorplanData:a}=t,{hoveredRoom:l}=t,{highlightData:c}=t;function u(){l.set(s)}function h(){l.set(void 0)}const{bounding:d}=a,m=wi(s.path,{needZ:!0,format:g=>nl(g,d)});return i.$$set=g=>{"room"in g&&e(0,s=g.room),"floorIndex"in g&&e(1,r=g.floorIndex),"floorplanData"in g&&e(6,a=g.floorplanData),"hoveredRoom"in g&&e(7,l=g.hoveredRoom),"highlightData"in g&&e(8,c=g.highlightData)},i.$$.update=()=>{i.$$.dirty&259&&e(9,n=c[`${r}_${s.id}`]),i.$$.dirty&512&&e(2,o=n?`fill: ${n.color}; --opacity: ${n.opacity}; pointer-events: ${n.disabled?"none":"auto"}`:null)},[s,r,o,u,h,m,a,l,c,n]}class uh extends oe{constructor(t){super(),ie(this,t,ch,lh,ne,{room:0,floorIndex:1,floorplanData:6,hoveredRoom:7,highlightData:8},ah)}}function dh(i){le(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 us(i,t,e){const n=i.slice();return n[6]=t[e],n}function ds(i,t){let e,n,o;const s=[{room:t[6],floorplanData:t[1],hoveredRoom:t[2],floorIndex:t[0],highlightData:t[3]}];let r={};for(let a=0;a<s.length;a+=1)r=Be(r,s[a]);return n=new uh({props:r}),{key:i,first:null,c(){e=pe(),K(n.$$.fragment),this.first=e},m(a,l){T(a,e,l),J(n,a,l),o=!0},p(a,l){t=a;const c=l&15?Qe(s,[{room:t[6],floorplanData:t[1],hoveredRoom:t[2],floorIndex:t[0],highlightData:t[3]}]):{};n.$set(c)},i(a){o||(C(n.$$.fragment,a),o=!0)},o(a){D(n.$$.fragment,a),o=!1},d(a){a&&M(e),Z(n,a)}}}function hh(i){let t,e,n=[],o=new Map,s,r=i[1].floorDatas[i[0]].rooms;const a=l=>l[6].id;for(let l=0;l<r.length;l+=1){let c=us(i,r,l),u=a(c);o.set(u,n[l]=ds(u,c))}return{c(){t=B("div"),e=we("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){T(l,t,c),V(t,e);for(let u=0;u<n.length;u+=1)n[u].m(e,null);s=!0},p(l,[c]){c&15&&(r=l[1].floorDatas[l[0]].rooms,se(),n=Ke(n,c,a,1,l,r,o,e,It,ds,null,us),re())},i(l){if(!s){for(let c=0;c<r.length;c+=1)C(n[c]);s=!0}},o(l){for(let c=0;c<n.length;c+=1)D(n[c]);s=!1},d(l){l&&M(t);for(let c=0;c<n.length;c+=1)n[c].d()}}}function fh(i,t,e){let{floorIndex:n}=t,{floorplanData:o}=t,{hoveredRoom:s}=t,{highlightData:r}=t;const a=o.bounding.max.x-o.bounding.min.x,l=o.bounding.max.y-o.bounding.min.y;return i.$$set=c=>{"floorIndex"in c&&e(0,n=c.floorIndex),"floorplanData"in c&&e(1,o=c.floorplanData),"hoveredRoom"in c&&e(2,s=c.hoveredRoom),"highlightData"in c&&e(3,r=c.highlightData)},[n,o,s,r,a,l]}class il extends oe{constructor(t){super(),ie(this,t,fh,hh,ne,{floorIndex:0,floorplanData:1,hoveredRoom:2,highlightData:3},dh)}}function mh(i){le(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 hs(i){let t,e;const n=[{floorIndex:i[1],floorplanData:i[8],hoveredRoom:i[14],highlightData:i[13]}];let o={};for(let s=0;s<n.length;s+=1)o=Be(o,n[s]);return t=new il({props:o}),{c(){K(t.$$.fragment)},m(s,r){J(t,s,r),e=!0},p(s,r){const a=r&24834?Qe(n,[{floorIndex:s[1],floorplanData:s[8],hoveredRoom:s[14],highlightData:s[13]}]):{};t.$set(a)},i(s){e||(C(t.$$.fragment,s),e=!0)},o(s){D(t.$$.fragment,s),e=!1},d(s){Z(t,s)}}}function fs(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 o={};for(let s=0;s<n.length;s+=1)o=Be(o,n[s]);return t=new zd({props:o}),{c(){K(t.$$.fragment)},m(s,r){J(t,s,r),e=!0},p(s,r){const a=r&22370?Qe(n,[{floorplanData:s[8],roomAreaEnable:s[5],roomNameEnable:s[6],floorIndex:s[1],getRoomAreaText:s[9],getLabelElement:s[10],hoveredRoom:s[14],adaptiveRoomLabelVisibleEnable:s[12]}]):{};t.$set(a)},i(s){e||(C(t.$$.fragment,s),e=!0)},o(s){D(t.$$.fragment,s),e=!1},d(s){Z(t,s)}}}function ms(i){let t,e;const n=[{floorplanData:i[8],floorIndex:i[1],getRuleDistanceText:i[11]}];let o={};for(let s=0;s<n.length;s+=1)o=Be(o,n[s]);return t=new Hd({props:o}),{c(){K(t.$$.fragment)},m(s,r){J(t,s,r),e=!0},p(s,r){const a=r&2306?Qe(n,[{floorplanData:s[8],floorIndex:s[1],getRuleDistanceText:s[11]}]):{};t.$set(a)},i(s){e||(C(t.$$.fragment,s),e=!0)},o(s){D(t.$$.fragment,s),e=!1},d(s){Z(t,s)}}}function ph(i){let t,e,n,o,s,r,a,l,c;const u=[{floorIndex:i[1],floorplanData:i[8]}];let h={};for(let v=0;v<u.length;v+=1)h=Be(h,u[v]);e=new rh({props:h});let d=(i[2]||i[3])&&hs(i);const m=[{floorplanData:i[8],floorIndex:i[1]}];let g={};for(let v=0;v<m.length;v+=1)g=Be(g,m[v]);s=new tl({props:g});let p=i[4]&&fs(i),A=i[7]&&ms(i);return{c(){t=B("div"),K(e.$$.fragment),n=$(),d&&d.c(),o=$(),K(s.$$.fragment),r=$(),p&&p.c(),a=$(),A&&A.c(),y(t,"class",l=Ie(`floorplan-plugin__floor${i[0]?" floorplan-plugin__floor--is-current":""}`)+" svelte-bl8zrz")},m(v,b){T(v,t,b),J(e,t,null),V(t,n),d&&d.m(t,null),V(t,o),J(s,t,null),V(t,r),p&&p.m(t,null),V(t,a),A&&A.m(t,null),c=!0},p(v,[b]){const w=b&258?Qe(u,[{floorIndex:v[1],floorplanData:v[8]}]):{};e.$set(w),v[2]||v[3]?d?(d.p(v,b),b&12&&C(d,1)):(d=hs(v),d.c(),C(d,1),d.m(t,o)):d&&(se(),D(d,1,1,()=>{d=null}),re());const k=b&258?Qe(m,[{floorplanData:v[8],floorIndex:v[1]}]):{};s.$set(k),v[4]?p?(p.p(v,b),b&16&&C(p,1)):(p=fs(v),p.c(),C(p,1),p.m(t,a)):p&&(se(),D(p,1,1,()=>{p=null}),re()),v[7]?A?(A.p(v,b),b&128&&C(A,1)):(A=ms(v),A.c(),C(A,1),A.m(t,null)):A&&(se(),D(A,1,1,()=>{A=null}),re()),(!c||b&1&&l!==(l=Ie(`floorplan-plugin__floor${v[0]?" floorplan-plugin__floor--is-current":""}`)+" svelte-bl8zrz"))&&y(t,"class",l)},i(v){c||(C(e.$$.fragment,v),C(d),C(s.$$.fragment,v),C(p),C(A),c=!0)},o(v){D(e.$$.fragment,v),D(d),D(s.$$.fragment,v),D(p),D(A),c=!1},d(v){v&&M(t),Z(e),d&&d.d(),Z(s),p&&p.d(),A&&A.d()}}}function gh(i,t,e){let{isCurrent:n}=t,{floorIndex:o}=t,{highlightEnable:s}=t,{hoverEnable:r}=t,{roomLabelsEnable:a}=t,{roomAreaEnable:l}=t,{roomNameEnable:c}=t,{ruleLabelsEnable:u}=t,{floorplanData:h}=t,{getRoomAreaText:d}=t,{getLabelElement:m}=t,{getRuleDistanceText:g}=t,{adaptiveRoomLabelVisibleEnable:p}=t,{highlightData:A}=t;const v=yo(void 0);return i.$$set=b=>{"isCurrent"in b&&e(0,n=b.isCurrent),"floorIndex"in b&&e(1,o=b.floorIndex),"highlightEnable"in b&&e(2,s=b.highlightEnable),"hoverEnable"in b&&e(3,r=b.hoverEnable),"roomLabelsEnable"in b&&e(4,a=b.roomLabelsEnable),"roomAreaEnable"in b&&e(5,l=b.roomAreaEnable),"roomNameEnable"in b&&e(6,c=b.roomNameEnable),"ruleLabelsEnable"in b&&e(7,u=b.ruleLabelsEnable),"floorplanData"in b&&e(8,h=b.floorplanData),"getRoomAreaText"in b&&e(9,d=b.getRoomAreaText),"getLabelElement"in b&&e(10,m=b.getLabelElement),"getRuleDistanceText"in b&&e(11,g=b.getRuleDistanceText),"adaptiveRoomLabelVisibleEnable"in b&&e(12,p=b.adaptiveRoomLabelVisibleEnable),"highlightData"in b&&e(13,A=b.highlightData)},[n,o,s,r,a,l,c,u,h,d,m,g,p,A,v]}class vh extends oe{constructor(t){super(),ie(this,t,gh,ph,ne,{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},mh)}}function Ah(i){le(i,"svelte-86bqav",".floorplan-main.svelte-86bqav{width:100%;height:100%;pointer-events:none}")}function ps(i,t,e){const n=i.slice();return n[21]=t[e],n}function gs(i){let t,e,n,o,s,r=i[13].floorDatas,a=[];for(let h=0;h<r.length;h+=1)a[h]=vs(ps(i,r,h));const l=h=>D(a[h],1,1,()=>{a[h]=null});let c=i[5]&&As(i),u=i[8]&&bs(i);return{c(){t=B("div");for(let h=0;h<a.length;h+=1)a[h].c();e=$(),c&&c.c(),n=$(),u&&u.c(),y(t,"class","floorplan-main svelte-86bqav")},m(h,d){T(h,t,d);for(let m=0;m<a.length;m+=1)a[m].m(t,null);V(t,e),c&&c.m(t,null),V(t,n),u&&u.m(t,null),s=!0},p(h,d){if(i=h,d&2047696){r=i[13].floorDatas;let m;for(m=0;m<r.length;m+=1){const g=ps(i,r,m);a[m]?(a[m].p(g,d),C(a[m],1)):(a[m]=vs(g),a[m].c(),C(a[m],1),a[m].m(t,e))}for(se(),m=r.length;m<a.length;m+=1)l(m);re()}i[5]?c?(c.p(i,d),d&32&&C(c,1)):(c=As(i),c.c(),C(c,1),c.m(t,n)):c&&(se(),D(c,1,1,()=>{c=null}),re()),i[8]?u?(u.p(i,d),d&256&&C(u,1)):(u=bs(i),u.c(),C(u,1),u.m(t,null)):u&&(se(),D(u,1,1,()=>{u=null}),re())},i(h){if(!s){for(let d=0;d<r.length;d+=1)C(a[d]);C(c),C(u),o||Re(()=>{o=zt(t,St,{duration:i[0],easing:vt}),o.start()}),s=!0}},o(h){a=a.filter(Boolean);for(let d=0;d<a.length;d+=1)D(a[d]);D(c),D(u),s=!1},d(h){h&&M(t),ut(a,h),c&&c.d(),u&&u.d()}}}function vs(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 o={};for(let s=0;s<n.length;s+=1)o=Be(o,n[s]);return t=new vh({props:o}),{c(){K(t.$$.fragment)},m(s,r){J(t,s,r),e=!0},p(s,r){const a=r&2047696?Qe(n,[r&2047680&&{hoverEnable:s[6],highlightEnable:s[7],floorplanData:s[13],getRoomAreaText:s[16],getLabelElement:s[17],getRuleDistanceText:s[18],roomLabelsEnable:s[9],roomAreaEnable:s[10],roomNameEnable:s[11],ruleLabelsEnable:s[12],adaptiveRoomLabelVisibleEnable:s[19],highlightData:s[20]},r&8192&&{floorIndex:s[21].floorIndex},r&8208&&{isCurrent:s[21].floorIndex===s[4]}]):{};t.$set(a)},i(s){e||(C(t.$$.fragment,s),e=!0)},o(s){D(t.$$.fragment,s),e=!1},d(s){Z(t,s)}}}function As(i){let t,e;const n=[{panoIndex:i[3],floorplanData:i[13],lastPanoramaLongitude:i[14],cameraImageUrl:i[15]}];let o={};for(let s=0;s<n.length;s+=1)o=Be(o,n[s]);return t=new nd({props:o}),{c(){K(t.$$.fragment)},m(s,r){J(t,s,r),e=!0},p(s,r){const a=r&57352?Qe(n,[{panoIndex:s[3],floorplanData:s[13],lastPanoramaLongitude:s[14],cameraImageUrl:s[15]}]):{};t.$set(a)},i(s){e||(C(t.$$.fragment,s),e=!0)},o(s){D(t.$$.fragment,s),e=!1},d(s){Z(t,s)}}}function bs(i){let t,e;return t=new cd({props:{floorplanData:i[13],northDesc:i[2]}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&8192&&(s.floorplanData=n[13]),o&4&&(s.northDesc=n[2]),t.$set(s)},i(n){e||(C(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function bh(i){let t,e,n=i[1]&&gs(i);return{c(){n&&n.c(),t=pe()},m(o,s){n&&n.m(o,s),T(o,t,s),e=!0},p(o,[s]){o[1]?n?(n.p(o,s),s&2&&C(n,1)):(n=gs(o),n.c(),C(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(C(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function yh(i,t,e){let{duration:n=0}=t,{visible:o}=t,{northDesc:s}=t,{panoIndex:r}=t,{floorIndex:a}=t,{cameraEnable:l}=t,{hoverEnable:c}=t,{highlightEnable:u}=t,{compassEnable:h}=t,{roomLabelsEnable:d}=t,{roomAreaEnable:m}=t,{roomNameEnable:g}=t,{ruleLabelsEnable:p}=t,{floorplanData:A}=t,{lastPanoramaLongitude:v}=t,{cameraImageUrl:b}=t,{getRoomAreaText:w}=t,{getLabelElement:k}=t,{getRuleDistanceText:I}=t,{adaptiveRoomLabelVisibleEnable:P}=t,{highlightData:L}=t;return i.$$set=x=>{"duration"in x&&e(0,n=x.duration),"visible"in x&&e(1,o=x.visible),"northDesc"in x&&e(2,s=x.northDesc),"panoIndex"in x&&e(3,r=x.panoIndex),"floorIndex"in x&&e(4,a=x.floorIndex),"cameraEnable"in x&&e(5,l=x.cameraEnable),"hoverEnable"in x&&e(6,c=x.hoverEnable),"highlightEnable"in x&&e(7,u=x.highlightEnable),"compassEnable"in x&&e(8,h=x.compassEnable),"roomLabelsEnable"in x&&e(9,d=x.roomLabelsEnable),"roomAreaEnable"in x&&e(10,m=x.roomAreaEnable),"roomNameEnable"in x&&e(11,g=x.roomNameEnable),"ruleLabelsEnable"in x&&e(12,p=x.ruleLabelsEnable),"floorplanData"in x&&e(13,A=x.floorplanData),"lastPanoramaLongitude"in x&&e(14,v=x.lastPanoramaLongitude),"cameraImageUrl"in x&&e(15,b=x.cameraImageUrl),"getRoomAreaText"in x&&e(16,w=x.getRoomAreaText),"getLabelElement"in x&&e(17,k=x.getLabelElement),"getRuleDistanceText"in x&&e(18,I=x.getRuleDistanceText),"adaptiveRoomLabelVisibleEnable"in x&&e(19,P=x.adaptiveRoomLabelVisibleEnable),"highlightData"in x&&e(20,L=x.highlightData)},[n,o,s,r,a,l,c,u,h,d,m,g,p,A,v,b,w,k,I,P,L]}class wo extends oe{constructor(t){super(),ie(this,t,yh,bh,ne,{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},Ah)}}const wh="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 Eh(i){return H(this,null,function*(){const t=new Headers({"Content-Type":"text/plain"}),e=function(o){return H(this,null,function*(){const s={index:o.index,url:o.url,svgUrl:o.svg_url};if(o.svg_url){const r=yield fetch(o.svg_url,{headers:t}).then(a=>a.text());s.svgContent=r}return s})};return yield Promise.all(i.map(e))})}function Ph(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 Ch(i){return{floorName:i.floor_name,floorIndex:i.floor_index,rooms:i.rooms.map(Ph),rules:i.rules}}function Ih(i){return{index:i.index,floorIndex:i.floor_index,position:i.position,positionInImage:i.position_in_image}}function kh(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 yt(i){return H(this,null,function*(){const t=yield Eh(i.outlines),e=i.computed_data.bounding,n=i.computed_data.floor_datas.map(Ch),o=i.computed_data.entrance?kh(i.computed_data.entrance):null;return{outlines:t,entrance:o,bounding:e,floorDatas:n,observers:i.computed_data.observers.map(Ih)}})}function xh(i,t,e){return i.map(o=>{const s=o.position,r=o.icon?o.icon:{url:wh,width:45,height:48},a=_d(s,t),l=Gd(s,e),c=Wd(l,e);return{floorIndex:a,icon:r,id:o.id,position:l,positionInImage:c}})}function Dh(i,t){return t(i),i}function Ei(i,t){return Dh({},e=>{for(const n in i)t.indexOf(n)===-1&&(e[n]=i[n])})}function ys(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 Eo(i,t,e=pt.BOUNDING_CENTER){const n=ys(i,t),o=ys(i,t+1);return e===pt.BOUNDING_CENTER?(i.model.bounding.max.y+i.model.bounding.min.y)/2:e===pt.CEILING?o:n}function Po(i,t,e,n){const o=Eo(i,e,n==null?void 0:n.attachedTo),s=new E.Vector3(0,o,0),r=new E.Vector3(1,o,0),a=s.clone().project(i.camera),l=r.clone().project(i.camera);return Math.abs((l.x-a.x)/1e3)*(t.getBoundingClientRect().width/2)}class Dn{constructor(t,e){f(this,"VERSION","2.17.0-alpha.5");f(this,"five");f(this,"hooks",new Kt);f(this,"staticPrefix","//vrlab-static.ljcdn.com");this.five=t,e!=null&&e.staticPrefix&&(this.staticPrefix=e.staticPrefix)}getCurrentState(){return this.state}}class Bt extends Dn{}var _e=(i=>(i.UnknownError="UnknownError",i.DataNotLoaded="DataNotLoaded",i.BreakOffByHide="BreakOffByHide",i.BreakOffByDisable="BreakOffByDisable",i.ModelNotLoaded="ModelNotLoaded",i.ChangeModeError="ChangeModeError",i.UpdateCameraError="UpdateCameraError",i))(_e||{});const ol=500,Lh=80;function oo(i,t,e=4){return Math.floor(i*Math.pow(10,e))===Math.floor(t*Math.pow(10,e))}function sl(i,t){return H(this,null,function*(){yield new Promise((e,n)=>{i.changeMode(...t).catch(o=>n(o)),i.once("initAnimationEnded",()=>{const o=i.getCurrentState(),s=t[0];o.mode!==s&&n(new Error("mode \u4E0E\u9884\u671F\u4E0D\u7B26")),(()=>{const l=t[1];return l?Object.keys(l).every(c=>{const u=o[c];if(u===void 0)return!0;const h=l[c];return typeof u=="number"&&typeof h=="number"?oo(u,h,2):u===h}):!0})()||n(new Error("five pose \u4E0E\u9884\u671F\u4E0D\u7B26")),e()})})})}function Co(i,t){if(i.currentMode!==t.mode)return!1;const{latitude:e,longitude:n,fov:o}=t,{latitude:s,longitude:r}=i.getCurrentState(),a=i.camera.fov;return!(!oo(e,s,2)||!oo(n,r,2)||o!==a)}function rl(i,t,e=!0){return H(this,null,function*(){if(Co(i,t)===!0)return;const o=i.getCurrentState();if(o.mode!==t.mode){const[u]=yield ui(sl(i,[t.mode,t,void 0,e]));if(u)throw new Error(_e.ChangeModeError);return}const{latitude:s,longitude:r,fov:a}=o,l=Math.min(1e3,Math.max(200,Math.abs(s-Math.PI/2)*1e3,(r>Math.PI?2*Math.PI-r:r)*500,Math.abs(a-t.fov)*10)),[c]=yield ui(i.updateCamera(t,l,e));if(c)throw new Error(_e.UpdateCameraError)})}function qt(i,t,e=300){const n=i.getElement();!n||(n.style.opacity=t+"",n.style.transition=e===0?"none":`opacity ${e}ms linear`,e!==0&&Promise.race([new Promise(o=>n.addEventListener("transitionend",o,{once:!0})),new Promise(o=>setTimeout(o,e))]).then(()=>{n.style.transition="none"}))}function Mh(i){const{latitude:t,longitude:e}=i,n=Math.abs(t-Math.PI/2)>5*Math.PI/180,o=e>5*(Math.PI/180)&&e<355*(Math.PI/180);return n||o}function Sh(i){const{latitude:t,longitude:e}=i,n=Math.abs(t-Math.PI/2)<10*Math.PI/180,o=e<30*(Math.PI/180)||e>330*(Math.PI/180);return n&&o}class Th extends Bt{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)=>H(this,[...n],function*(e={}){if(!this.state.enabled||!this.showPromise&&this.state.visible)return;const o=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},o),this._show(e)}));f(this,"hide",(...n)=>H(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||!Co(this.five,this.showState)||!this.container||!this.wrapper)return;const{min:e,max:n}=this.data.bounding,o=n.x-e.x,s=n.y-e.y,r=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,a=Po(this.five,this.wrapper,this.floorIndex,r),l=Math.ceil(o*a),c=Math.ceil(s*a);this.size.width===l&&this.size.height===c||(this.container.style.width=l+"px",this.container.style.height=c+"px",this.size={width:l,height:c})});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 o,s,r;const{userAction:n}=e;this.hooks.emit("disable",{userAction:n}),(o=this.showRejection)==null||o.call(this,_e.BreakOffByDisable),this.showPromise=void 0,(s=this.app)==null||s.$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=>H(this,null,function*(){var r;if(!this.state.enabled)return;if(!((r=this.five.model)!=null&&r.loaded))throw new Error(_e.ModelNotLoaded);if(!this.data)throw new Error(_e.DataNotLoaded);this.isHiddenByHideFunc=!1;const n={floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},o=Q(Q({},n),e),s=()=>H(this,null,function*(){this.hooks.emit("show",{userAction:o.userAction,auto:o.isAutoShow});let a=!1,l;this.showRejection=d=>{a=!0,l=d};const[c]=yield ui(rl(this.five,this.showState,o.userAction));if(c)throw c;if(a)throw l?new Error(l):new Error(_e.UnknownError);this.updateSize(),this.floorIndex=o.floorIndex,this.five.model.show(this.floorIndex);const u=o.modelOpacity,h=o.immediately?0:ol;qt(this.five,u,h),this.render(h)});return this.showPromise=s().then(()=>{this.hooks.emit("showAnimationEnded",{auto:o.isAutoShow,userAction:o.userAction})}).catch(a=>{if(this.updateState({visible:!1},o.userAction),!o.isAutoShow&&a instanceof Error)throw a}).finally(()=>{this.showPromise=void 0,this.showRejection=void 0}),this.showPromise}));f(this,"_hide",e=>{var s;(s=this.showRejection)==null||s.call(this,_e.BreakOffByHide),this.showPromise=void 0;const o=Q(Q({},{userAction:!0,isAutoHide:!1}),e);qt(this.five,1,0),this.hooks.emit("hide",{auto:o.isAutoHide,userAction:o.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("\u4E0D\u6B63\u786E\u7684\u7236\u5BB9\u5668\u9009\u62E9\u5668");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 o=this.five.getCurrentState();o.mode==="Floorplan"&&(this.state.visible||Sh(o)&&(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 o=this.five.getCurrentState();Mh(o)&&(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("\u4E0D\u63A8\u8350\u7EE7\u7EED\u4F7F\u7528 params.selector \u914D\u7F6E\u7236\u5BB9\u5668\uFF0C\u8BF7\u4F7F\u7528 appendTo \u65B9\u6CD5")),this.showState={mode:"Floorplan",longitude:0,latitude:Math.PI/2,fov:Lh/((a=n==null?void 0:n.scale)!=null?a:1)};const o={northDesc:"\u5317",modelOpacity:1,cameraEnable:!0,highlightEnable:!1,hoverEnable:!0,compassEnable:!0,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,adaptiveRoomLabelVisibleEnable:!0,cameraImageUrl:bt,attachedTo:pt.BOUNDING_CENTER,getLabelElement:void 0,getRoomAreaText:l=>(l/1e6).toFixed(1)+"\u33A1",getRuleDistanceText:l=>l.toString()},s=n?Ei(n,["selector","scale"]):{},r=Q(Q({},o),s);this.state={enabled:!0,visible:!1,config:r},this.initContainer(),e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}load(e,n,o=!0){return H(this,null,function*(){function s(u){return Object.prototype.hasOwnProperty.apply(u,["version"])}const r=e;r&&!r.version&&console.warn("\u4F20\u5165 serverData.data \u7684\u65B9\u5F0F\u540E\u7EED\u53EF\u80FD\u4E0D\u518D\u652F\u6301\uFF0C\u8BF7\u628A serverData \u6574\u4F53\u4F20\u5165 load \u51FD\u6570");const a=JSON.parse(JSON.stringify(e)),l=s(a)?a.data:a,c=this.data;this.data=yield yt(l),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,c),n&&this.updateState(n,o),this.render()})}appendTo(e){if(this.wrapper=e,!!this.state.enabled)return e.appendChild(this.container),this.render(),this}enable(e={}){if(this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||n),this._enable({userAction:n})}disable(e={}){if(!this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||n),this._disable({userAction:n})}setState(e,n={}){const o=this.state,s=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,s),e.enabled!==void 0&&o.enabled!==e.enabled&&(e.enabled?this._enable({userAction:s}):this._disable({userAction:s})),e.visible!==void 0&&o.visible!==e.visible){const r={userAction:s};e.visible?this._show(r):this._hide(r)}this.render()}changeConfigs(e,n=!0){this.updateState({config:e},n),this.render()}formatData(e){return H(this,null,function*(){return yield yt(e.data)})}updateState(e,n){const o=this.state,s=e.config?Q(Q({},o.config),e.config):o.config;this.state=fe(Q(Q({},this.state),e),{config:s}),!it(this.state,o,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n})}initContainer(){this.container.classList.add("floorplan-plugin"),Object.assign(this.container.style,{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",zIndex:10,pointerEvents:"none"}),this.five.addExtraElement(this.container)}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;const e=this.five;e.on("modeChange",this.onFiveModeChange),e.on("interiaPan",this.onFiveInteriaPan),e.on("panoArrived",this.onFivePanoArrived),e.on("cameraUpdate",this.onFiveCameraUpdate),e.on("wantsGesture",this.onFiveWantsGesture),e.on("wantsPanGesture",this.onFiveWantsPanGesture),e.on("wantsTapGesture",this.onFiveWantsTapGesture),e.on("wantsChangeMode",this.onFiveWantsChangeMode),e.on("modelShownFloorChange",this.onModelShownFloorChange)}removeEventListener(){const e=this.five;this.hasAddedEventListener=!1,e.off("modelLoaded",this.onFiveModelLoaded),e.off("modeChange",this.onFiveModeChange),e.off("interiaPan",this.onFiveInteriaPan),e.off("panoArrived",this.onFivePanoArrived),e.off("cameraUpdate",this.onFiveCameraUpdate),e.off("wantsGesture",this.onFiveWantsGesture),e.off("wantsPanGesture",this.onFiveWantsPanGesture),e.off("wantsTapGesture",this.onFiveWantsTapGesture),e.off("wantsChangeMode",this.onFiveWantsChangeMode),e.off("modelShownFloorChange",this.onModelShownFloorChange)}render(e){if(!this.state.enabled||!this.container||!this.data||this.size.width===0)return;const n=fe(Q({},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 wo({target:this.container,intro:!0,props:n})}}const zh=(i,t)=>new Th(i,t);function Bh(i){const{latitude:t,longitude:e}=i,n=Math.abs(t-Math.PI/2)>5*Math.PI/180,o=e>5*(Math.PI/180)&&e<355*(Math.PI/180);return n||o}function Vh(i){const{latitude:t,longitude:e}=i,n=Math.abs(t-Math.PI/2)<10*Math.PI/180,o=e<30*(Math.PI/180)||e>330*(Math.PI/180);return n&&o}class jh extends Bt{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)=>H(this,[...n],function*(e={}){if(!this.state.enabled||!this.showPromise&&this.state.visible)return;const o=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},o),this._show(e)}));f(this,"hide",(...n)=>H(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||!Co(this.five,this.showState)||!this.container||!this.wrapper)return;const{min:e,max:n}=this.data.bounding,o=n.x-e.x,s=n.y-e.y,r=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,a=Po(this.five,this.wrapper,this.floorIndex,r),l=Math.ceil(o*a),c=Math.ceil(s*a);this.size.width===l&&this.size.height===c||(this.container.style.width=l+"px",this.container.style.height=c+"px",this.size={width:l,height:c})});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 o,s,r;const{userAction:n}=e;this.hooks.emit("disable",{userAction:n}),(o=this.showRejection)==null||o.call(this,_e.BreakOffByDisable),this.showPromise=void 0,(s=this.app)==null||s.$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=>H(this,null,function*(){var r;if(!this.state.enabled)return;if(!((r=this.five.model)!=null&&r.loaded))throw new Error(_e.ModelNotLoaded);if(!this.data)throw new Error(_e.DataNotLoaded);this.isHiddenByHideFunc=!1;const n={floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},o=Q(Q({},n),e),s=()=>H(this,null,function*(){this.hooks.emit("show",{userAction:o.userAction,auto:o.isAutoShow});let a=!1,l;this.showRejection=d=>{a=!0,l=d};const[c]=yield ui(rl(this.five,this.showState,o.userAction));if(c)throw c;if(a)throw l?new Error(l):new Error(_e.UnknownError);this.updateSize(),this.updatePosition(),this.floorIndex=o.floorIndex,this.five.model.show(this.floorIndex);const u=o.modelOpacity,h=o.immediately?0:ol;qt(this.five,u,h),this.render(h)});return this.showPromise=s().then(()=>{this.hooks.emit("showAnimationEnded",{auto:o.isAutoShow,userAction:o.userAction})}).catch(a=>{if(this.updateState({visible:!1},o.userAction),!o.isAutoShow&&a instanceof Error)throw a}).finally(()=>{this.showPromise=void 0,this.showRejection=void 0}),this.showPromise}));f(this,"_hide",e=>{var s;(s=this.showRejection)==null||s.call(this,_e.BreakOffByHide),this.showPromise=void 0;const o=Q(Q({},{userAction:!0,isAutoHide:!1}),e);qt(this.five,1,0),this.hooks.emit("hide",{auto:o.isAutoHide,userAction:o.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("\u4E0D\u6B63\u786E\u7684\u7236\u5BB9\u5668\u9009\u62E9\u5668");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 o=this.five.getCurrentState();this.updatePosition(),this.updateSize(),Bh(o)&&(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 o=this.five.getCurrentState();return o.mode!==this.showState.mode||this.state.visible?void 0:(Vh(o)&&(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("\u4E0D\u63A8\u8350\u7EE7\u7EED\u4F7F\u7528 params.selector \u914D\u7F6E\u7236\u5BB9\u5668\uFF0C\u8BF7\u4F7F\u7528 appendTo \u65B9\u6CD5")),this.showState={mode:"Mapview",longitude:0,latitude:Math.PI/2,fov:90};const o={northDesc:"\u5317",modelOpacity:1,cameraEnable:!0,highlightEnable:!1,hoverEnable:!0,compassEnable:!0,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,cameraImageUrl:bt,attachedTo:pt.BOUNDING_CENTER,getLabelElement:void 0,adaptiveRoomLabelVisibleEnable:!0,getRoomAreaText:a=>(a/1e6).toFixed(1)+"\u33A1",getRuleDistanceText:a=>a.toString()},s=n?Ei(n,["selector","scale"]):{},r=Q(Q({},o),s);this.state={enabled:!0,visible:!1,config:r},this.initContainer(),e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}load(e,n,o=!0){return H(this,null,function*(){function s(u){return Object.prototype.hasOwnProperty.apply(u,["version"])}const r=e;r&&!r.version&&console.warn("\u4F20\u5165 serverData.data \u7684\u65B9\u5F0F\u540E\u7EED\u53EF\u80FD\u4E0D\u518D\u652F\u6301\uFF0C\u8BF7\u628A serverData \u6574\u4F53\u4F20\u5165 load \u51FD\u6570");const a=JSON.parse(JSON.stringify(e)),l=s(a)?a.data:a,c=this.data;this.data=yield yt(l),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,c),n&&this.updateState(n,o),this.render()})}appendTo(e){if(this.wrapper=e,!!this.state.enabled)return e.appendChild(this.container),this.render(),this}enable(e={}){if(this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||n),this._enable({userAction:n})}disable(e={}){if(!this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||n),this._disable({userAction:n})}setState(e,n={}){const o=this.state,s=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,s),e.enabled!==void 0&&o.enabled!==e.enabled&&(e.enabled?this._enable({userAction:s}):this._disable({userAction:s})),e.visible!==void 0&&o.visible!==e.visible){const r={userAction:s};e.visible?this._show(r):this._hide(r)}}changeConfigs(e,n=!0){this.updateState({config:e},n),this.render()}updatePosition(){var a;const e=Eo(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 o=n.clone().project(this.five.camera),s=(o.x+1)/2,r=-(o.y-1)/2;this.container.style.left=s*100+"%",this.container.style.top=r*100+"%"}formatData(e){return H(this,null,function*(){return yield yt(e.data)})}updateState(e,n){const o=this.state,s=e.config?Q(Q({},o.config),e.config):o.config;this.state=fe(Q(Q({},this.state),e),{config:s}),!it(this.state,o,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n})}initContainer(){this.container.classList.add("floorplan-plugin"),Object.assign(this.container.style,{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",zIndex:10,pointerEvents:"none"}),this.five.addExtraElement(this.container)}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;const e=this.five;e.on("modeChange",this.onFiveModeChange),e.on("panoArrived",this.onFivePanoArrived),e.on("cameraUpdate",this.onFiveCameraUpdate),e.on("wantsPanGesture",this.onFiveWantsPanGesture),e.on("wantsTapGesture",this.onFiveWantsTapGesture),e.on("wantsChangeMode",this.onFiveWantsChangeMode),e.on("modelShownFloorChange",this.onModelShownFloorChange)}removeEventListener(){const e=this.five;this.hasAddedEventListener=!1,e.off("modelLoaded",this.onFiveModelLoaded),e.off("modeChange",this.onFiveModeChange),e.off("panoArrived",this.onFivePanoArrived),e.off("cameraUpdate",this.onFiveCameraUpdate),e.off("wantsPanGesture",this.onFiveWantsPanGesture),e.off("wantsTapGesture",this.onFiveWantsTapGesture),e.off("wantsChangeMode",this.onFiveWantsChangeMode),e.off("modelShownFloorChange",this.onModelShownFloorChange)}render(e){if(!this.state.enabled||!this.container||!this.data||this.size.width===0)return;const n=fe(Q({},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 wo({target:this.container,intro:!0,props:n})}}const Oh=(i,t)=>new jh(i,t);class Rh extends Bt{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,o=n.x-e.x,s=n.y-e.y,r=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,a=Po(this.five,this.wrapper,this.floorIndex,r),l=Math.ceil(o*a),c=Math.ceil(s*a);this.size.width===l&&this.size.height===c||(this.container.style.width=l+"px",this.container.style.height=c+"px",this.size={width:l,height:c})});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 o,s;const{userAction:n}=e;(o=this.app)==null||o.$destroy(),this.app=void 0,(s=this.container)==null||s.remove(),this.removeEventListener(),this.hooks.emit("disable",{userAction:n})});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("\u4E0D\u6B63\u786E\u7684\u7236\u5BB9\u5668\u9009\u62E9\u5668");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("\u4E0D\u63A8\u8350\u7EE7\u7EED\u4F7F\u7528 params.selector \u914D\u7F6E\u7236\u5BB9\u5668\uFF0C\u8BF7\u4F7F\u7528 appendTo \u65B9\u6CD5"));const o={northDesc:"\u5317",modelOpacity:1,cameraEnable:!0,hoverEnable:!0,highlightEnable:!1,compassEnable:!0,gestureEnable:!1,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,cameraImageUrl:bt,attachedTo:pt.BOUNDING_CENTER,getLabelElement:void 0,adaptiveRoomLabelVisibleEnable:!0,getRoomAreaText:a=>(a/1e6).toFixed(1)+"\u33A1",getRuleDistanceText:a=>a.toString()},s=n?Ei(n,["selector","scale"]):{},r=Q(Q({},o),s);this.state={enabled:!0,visible:!1,config:r},this.initContainer(),e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}load(e,n,o=!0){return H(this,null,function*(){function s(u){return Object.prototype.hasOwnProperty.apply(u,["version"])}const r=e;r&&!r.version&&console.warn("\u4F20\u5165 serverData.data \u7684\u65B9\u5F0F\u540E\u7EED\u53EF\u80FD\u4E0D\u518D\u652F\u6301\uFF0C\u8BF7\u628A serverData \u6574\u4F53\u4F20\u5165 load \u51FD\u6570");const a=JSON.parse(JSON.stringify(e)),l=s(a)?a.data:a,c=this.data;this.data=yield yt(l),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,c),n&&this.updateState(n,o),this.render()})}updatePosition(){var a;const e=Eo(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 o=n.clone().project(this.five.camera),s=(o.x+1)/2,r=-(o.y-1)/2;this.container.style.left=s*100+"%",this.container.style.top=r*100+"%"}appendTo(e){if(this.wrapper=e,!!this.state.enabled)return e.appendChild(this.container),this.render(),this}show(){return H(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 H(this,arguments,function*(e={}){if(this.isHiddenByHideFunc=!0,!this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!1},n),this._hide({userAction:n})})}enable(e={}){if(this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||n),this._enable({userAction:n})}disable(e={}){if(!this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||n),this._disable({userAction:n})}setState(e,n={}){const o=this.state,s=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,s),e.enabled!==void 0&&o.enabled!==e.enabled){const r={userAction:s};e.enabled?this._enable(r):this._disable(r)}if(e.visible!==void 0&&o.visible!==e.visible){const r={userAction:s};e.visible?this._show(r):this._hide(r)}}changeConfigs(e,n=!0){this.updateState({config:e},n),this.render()}formatData(e){return H(this,null,function*(){return yield yt(e.data)})}_show(e){return H(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 sl(this.five,["Topview",void 0,void 0,n])),this.five.model.show(this.floorIndex),this.updatePosition(),this.updateSize();const o=500,s=this.state.config.modelOpacity;qt(this.five,s,o),this.hooks.emit("showAnimationEnded",{userAction:n,auto:!1}),this.render()})}_hide(e){return H(this,null,function*(){if(!this.state.enabled)return;const{userAction:n}=e;this.hooks.emit("hide",{userAction:n,auto:!1});const o=1,s=0;qt(this.five,o,s),this.render()})}_enable(e){const{userAction:n}=e;this.addEventListener(),this.wrapper&&this.wrapper.append(this.container),this.hooks.emit("enable",{userAction:n}),this.state.visible&&this._show({userAction:n})}updateState(e,n){const o=this.state,s=e.config?Q(Q({},o.config),e.config):o.config;this.state=fe(Q(Q({},this.state),e),{config:s}),!it(this.state,o,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n})}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;const e=this.five;e.on("modeChange",this.onFiveModeChange),e.on("panoArrived",this.onFivePanoArrived),e.on("cameraUpdate",this.onFiveCameraUpdate),e.on("wantsGesture",this.onFiveWantsGesture),e.on("wantsMoveToPano",this.onFiveWantsMoveToPano),e.on("initAnimationEnded",this.onFiveInitAnimationEnded),e.on("modelShownFloorChange",this.onModelShownFloorChange)}removeEventListener(){const e=this.five;this.hasAddedEventListener=!1,e.off("modeChange",this.onFiveModeChange),e.off("panoArrived",this.onFivePanoArrived),e.off("cameraUpdate",this.onFiveCameraUpdate),e.off("wantsGesture",this.onFiveWantsGesture),e.off("wantsMoveToPano",this.onFiveWantsMoveToPano),e.off("initAnimationEnded",this.onFiveInitAnimationEnded),e.off("modelShownFloorChange",this.onModelShownFloorChange)}initContainer(){this.container.classList.add("floorplan-plugin"),Object.assign(this.container.style,{position:"absolute",left:"50%",top:"50%",transform:"translate3d(-50%, -50%, 10px)",zIndex:10,pointerEvents:"none","will-change":"width, height"}),this.five.addExtraElement(this.container)}render(e){if(!this.state.enabled||!this.container||!this.data||this.size.width===0)return;const n=fe(Q({},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 wo({target:this.container,intro:!0,props:n})}}const Qh=(i,t)=>new Rh(i,t);function Io(i,t=200){let e;return function(...n){e||(i(...n),e=setTimeout(function(){e=null},t))}}function Fh(i){le(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 Hh(i){let t,e,n;return{c(){t=B("div"),e=B("div"),n=B("div"),y(n,"class","plugin-radar__camera-rotate svelte-1nqrlxd"),z(n,"background-image","url("+(i[0]||bt)+")"),z(n,"transform",i[1]),y(e,"class","plugin-radar__camera-position svelte-1nqrlxd"),z(e,"transform",i[2]),y(t,"class","plugin-radar__camera-wrapper svelte-1nqrlxd")},m(o,s){T(o,t,s),V(t,e),V(e,n)},p(o,[s]){s&1&&z(n,"background-image","url("+(o[0]||bt)+")"),s&2&&z(n,"transform",o[1]),s&4&&z(e,"transform",o[2])},i:X,o:X,d(o){o&&M(t)}}}function Gh(i){return`rotate(${Math.floor(i/Math.PI*180)*-1+45}deg)`}function Wh(i,t,e){let n,o,{five:s}=t,{pxmm:r}=t,{floorplanData:a}=t,{cameraImageUrl:l}=t,c=s.getCurrentState().panoIndex,u=s.getCurrentState().longitude;function h(g,p){const A=g.bounding,v=g.observers[p];if(!v)return"";const b=(A.max.x-A.min.x)*r,w=(A.max.y-A.min.y)*r,k=Math.floor(v.positionInImage.x*b),I=Math.floor(v.positionInImage.y*w);return`translate(${k}px, ${I}px)`}function d(g){e(6,c=g)}const m=Io(g=>{e(7,u=g.longitude)},1e3/60);return Ze(()=>(s.on("panoWillArrive",d),s.on("cameraDirectionUpdate",m),function(){s.off("panoWillArrive",d),s.off("cameraDirectionUpdate",m)})),i.$$set=g=>{"five"in g&&e(3,s=g.five),"pxmm"in g&&e(4,r=g.pxmm),"floorplanData"in g&&e(5,a=g.floorplanData),"cameraImageUrl"in g&&e(0,l=g.cameraImageUrl)},i.$$.update=()=>{i.$$.dirty&96&&e(2,n=h(a,c)),i.$$.dirty&128&&e(1,o=Gh(u))},[l,o,n,s,r,a,c,u]}class _h extends oe{constructor(t){super(),ie(this,t,Wh,Hh,ne,{five:3,pxmm:4,floorplanData:5,cameraImageUrl:0},Fh)}}function Nh(i){le(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 ws(i,t,e){const n=i.slice();return n[1]=t[e],n}function Es(i,t){let e,n,o=`${t[1].icon.width/16}rem`,s=`${t[1].icon.height/16}rem`,r,a=`${t[1].positionInImage.y*100}%`,l=`${t[1].positionInImage.x*100}%`;return{key:i,first:null,c(){e=B("div"),n=B("div"),r=$(),y(n,"class","plugin-pano-floorplan__extra-object-item svelte-1i87fz7"),z(n,"background-image",`url(${t[1].icon.url})`),z(n,"width",o),z(n,"height",s),y(e,"class","plugin-pano-floorplan__extra-object-item--position svelte-1i87fz7"),z(e,"top",a),z(e,"left",l),this.first=e},m(c,u){T(c,e,u),V(e,n),V(e,r)},p(c,u){t=c,u&1&&z(n,"background-image",`url(${t[1].icon.url})`),u&1&&o!==(o=`${t[1].icon.width/16}rem`)&&z(n,"width",o),u&1&&s!==(s=`${t[1].icon.height/16}rem`)&&z(n,"height",s),u&1&&a!==(a=`${t[1].positionInImage.y*100}%`)&&z(e,"top",a),u&1&&l!==(l=`${t[1].positionInImage.x*100}%`)&&z(e,"left",l)},d(c){c&&M(e)}}}function Xh(i){let t,e=[],n=new Map,o=i[0];const s=r=>r[1].id;for(let r=0;r<o.length;r+=1){let a=ws(i,o,r),l=s(a);n.set(l,e[r]=Es(l,a))}return{c(){t=B("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){T(r,t,a);for(let l=0;l<e.length;l+=1)e[l].m(t,null)},p(r,[a]){a&1&&(o=r[0],e=Ke(e,a,s,1,r,o,n,t,Ao,Es,null,ws))},i:X,o:X,d(r){r&&M(t);for(let a=0;a<e.length;a+=1)e[a].d()}}}function Yh(i,t,e){let{extraObjects:n=[]}=t;return i.$$set=o=>{"extraObjects"in o&&e(0,n=o.extraObjects)},[n]}class Uh extends oe{constructor(t){super(),ie(this,t,Yh,Xh,ne,{extraObjects:0},Nh)}}function Ps(i){let t,e;const n=[{five:i[0],pxmm:i[1],floorIndex:i[2],floorplanData:i[4],onRoomHeightClick:i[7],highlightData:i[5]}];let o={};for(let s=0;s<n.length;s+=1)o=Be(o,n[s]);return t=new il({props:o}),{c(){K(t.$$.fragment)},m(s,r){J(t,s,r),e=!0},p(s,r){const a=r&183?Qe(n,[{five:s[0],pxmm:s[1],floorIndex:s[2],floorplanData:s[4],onRoomHeightClick:s[7],highlightData:s[5]}]):{};t.$set(a)},i(s){e||(C(t.$$.fragment,s),e=!0)},o(s){D(t.$$.fragment,s),e=!1},d(s){Z(t,s)}}}function qh(i){let t,e,n,o,s,r;const a=[{floorIndex:i[2],floorplanData:i[4]}];let l={};for(let u=0;u<a.length;u+=1)l=Be(l,a[u]);t=new tl({props:l}),n=new Uh({props:{extraObjects:i[6]}});let c=i[3]&&Ps(i);return{c(){K(t.$$.fragment),e=$(),K(n.$$.fragment),o=$(),c&&c.c(),s=pe()},m(u,h){J(t,u,h),T(u,e,h),J(n,u,h),T(u,o,h),c&&c.m(u,h),T(u,s,h),r=!0},p(u,[h]){const d=h&20?Qe(a,[{floorIndex:u[2],floorplanData:u[4]}]):{};t.$set(d);const m={};h&64&&(m.extraObjects=u[6]),n.$set(m),u[3]?c?(c.p(u,h),h&8&&C(c,1)):(c=Ps(u),c.c(),C(c,1),c.m(s.parentNode,s)):c&&(se(),D(c,1,1,()=>{c=null}),re())},i(u){r||(C(t.$$.fragment,u),C(n.$$.fragment,u),C(c),r=!0)},o(u){D(t.$$.fragment,u),D(n.$$.fragment,u),D(c),r=!1},d(u){Z(t,u),u&&M(e),Z(n,u),u&&M(o),c&&c.d(u),u&&M(s)}}}function Jh(i,t,e){let n,{five:o}=t,{pxmm:s}=t,{floorIndex:r}=t,{hoverEnable:a}=t,{floorplanData:l}=t,{extraObjects:c=[]}=t,{highlightData:u}=t;const h=void 0;return i.$$set=d=>{"five"in d&&e(0,o=d.five),"pxmm"in d&&e(1,s=d.pxmm),"floorIndex"in d&&e(2,r=d.floorIndex),"hoverEnable"in d&&e(3,a=d.hoverEnable),"floorplanData"in d&&e(4,l=d.floorplanData),"extraObjects"in d&&e(8,c=d.extraObjects),"highlightData"in d&&e(5,u=d.highlightData)},i.$$.update=()=>{i.$$.dirty&260&&e(6,n=c==null?void 0:c.filter(d=>d.floorIndex===r))},[o,s,r,a,l,u,n,h,c]}class Zh extends oe{constructor(t){super(),ie(this,t,Jh,qh,ne,{five:0,pxmm:1,floorIndex:2,hoverEnable:3,floorplanData:4,extraObjects:8,highlightData:5})}}function Kh(i){le(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 Cs(i){let t,e,n,o,s=i[7]!==0&&Is(i);return{c(){t=B("div"),s&&s.c(),y(t,"class","plugin-floorplan-radar svelte-1mvqyqq")},m(r,a){T(r,t,a),s&&s.m(t,null),e=!0,n||(o=[ct(ln.call(null,t)),me(t,"clientWidth",i[13]),me(t,"clientHeight",i[14])],n=!0)},p(r,a){r[7]!==0?s?(s.p(r,a),a&128&&C(s,1)):(s=Is(r),s.c(),C(s,1),s.m(t,null)):s&&(se(),D(s,1,1,()=>{s=null}),re())},i(r){e||(C(s),e=!0)},o(r){D(s),e=!1},d(r){r&&M(t),s&&s.d(),n=!1,He(o)}}}function Is(i){let t,e,n,o,s=`${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 d=0;d<l.length;d+=1)c=Be(c,l[d]);e=new Zh({props:c});const u=[{pxmm:i[10],five:i[0],floorplanData:i[3],cameraImageUrl:i[4]}];let h={};for(let d=0;d<u.length;d+=1)h=Be(h,u[d]);return o=new _h({props:h}),{c(){t=B("div"),K(e.$$.fragment),n=$(),K(o.$$.fragment),y(t,"class","plugin-floorplan-radar-container svelte-1mvqyqq"),z(t,"width",s),z(t,"height",r)},m(d,m){T(d,t,m),J(e,t,null),V(t,n),J(o,t,null),a=!0},p(d,m){const g=m&3181?Qe(l,[{five:d[0],pxmm:d[10],floorIndex:d[11],floorplanData:d[3],hoverEnable:d[2],extraObjects:d[5],highlightData:d[6]}]):{};e.$set(g);const p=m&1049?Qe(u,[{pxmm:d[10],five:d[0],floorplanData:d[3],cameraImageUrl:d[4]}]):{};o.$set(p),m&512&&s!==(s=`${d[9]}px`)&&z(t,"width",s),m&4096&&r!==(r=`${d[12]}px`)&&z(t,"height",r)},i(d){a||(C(e.$$.fragment,d),C(o.$$.fragment,d),a=!0)},o(d){D(e.$$.fragment,d),D(o.$$.fragment,d),a=!1},d(d){d&&M(t),Z(e),Z(o)}}}function $h(i){let t,e,n=i[1]&&Cs(i);return{c(){n&&n.c(),t=pe()},m(o,s){n&&n.m(o,s),T(o,t,s),e=!0},p(o,[s]){o[1]?n?(n.p(o,s),s&2&&C(n,1)):(n=Cs(o),n.c(),C(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(C(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function ef(i,t,e){var w,k;let{five:n}=t,{visible:o}=t,{hoverEnable:s}=t,{floorplanData:r}=t,{cameraImageUrl:a}=t,{extraObjects:l=[]}=t,{highlightData:c}=t,u=0,h=(k=(w=n.work.observers[n.getCurrentState().panoIndex])==null?void 0:w.floorIndex)!=null?k:0,d=0,m=0,g=0,p=0;function A(I){e(11,h=n.work.observers[I].floorIndex)}Ze(()=>(n.on("panoArrived",A),()=>{n.off("panoArrived",A)}));const v=I=>{e(7,d=I.detail)},b=I=>{e(8,m=I.detail)};return i.$$set=I=>{"five"in I&&e(0,n=I.five),"visible"in I&&e(1,o=I.visible),"hoverEnable"in I&&e(2,s=I.hoverEnable),"floorplanData"in I&&e(3,r=I.floorplanData),"cameraImageUrl"in I&&e(4,a=I.cameraImageUrl),"extraObjects"in I&&e(5,l=I.extraObjects),"highlightData"in I&&e(6,c=I.highlightData)},i.$$.update=()=>{if(i.$$.dirty&904){const I=Math.min(d,m),{max:P,min:L}=r.bounding,x=P.x-L.x,F=P.y-L.y,N=function(){return x>F?[I,I/x*F]:[I/F*x,I]}();e(9,g=N[0]),e(12,p=N[1]),e(10,u=g/x)}},[n,o,s,r,a,l,c,d,m,g,u,h,p,v,b]}class tf extends oe{constructor(t){super(),ie(this,t,ef,$h,ne,{five:0,visible:1,hoverEnable:2,floorplanData:3,cameraImageUrl:4,extraObjects:5,highlightData:6},Kh)}}class nf extends Bt{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 o;const{userAction:n}=e;(o=this.app)==null||o.$destroy(),this.app=void 0,this.hooks.emit("disable",{userAction:n})});this.five=e;const o={hoverEnable:!0,highlightEnable:!0,cameraImageUrl:bt},s=n!=null&&n.configs?n.configs:{},r=Q(Q({},o),s);this.state={enabled:!0,visible:!0,config:r},n!=null&&n.wrapper&&console.warn("\u4E0D\u63A8\u8350\u7EE7\u7EED\u4F7F\u7528 params.selector \u914D\u7F6E\u7236\u5BB9\u5668\uFF0C\u8BF7\u4F7F\u7528 appendTo \u65B9\u6CD5"),typeof(n==null?void 0:n.wrapper)=="string"?this.wrapperSelector=n.wrapper:(n==null?void 0:n.wrapper)instanceof Element&&(this.wrapper=n.wrapper),e.once("dispose",this.dispose)}load(e,n,o=!0){return H(this,null,function*(){function s(c){return Object.prototype.hasOwnProperty.apply(c,["version"])}const r=JSON.parse(JSON.stringify(e)),a=s(r)?r.data:r,l=this.data;this.data=yield yt(a),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,l),n&&this.updateState(n,o),this.render()})}show(){return H(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 H(this,arguments,function*(e={}){if(!this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!1},n),this._hide({userAction:n})})}enable(e={}){if(this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||n),this._enable({userAction:n})}disable(e={}){if(!this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||n),this._disable({userAction:n})}setState(e,n={}){const o=this.state,s=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,s),e.enabled!==void 0&&o.enabled!==e.enabled){const r={userAction:s};e.enabled?this._enable(r):this._disable(r)}if(e.visible!==void 0&&o.visible!==e.visible){const r={userAction:s};e.visible?this._show(r):this._hide(r)}}appendTo(e){this.wrapper=e,this.render()}changeConfigs(e,n=!0){this.setState({config:e},{userAction:n}),this.render()}setExtraObjectsWith3DPositions(e){!this.data||(this.extraObjects=xh(e,this.five,this.data),this.render())}formatData(e){return H(this,null,function*(){return yield yt(e.data)})}_enable(e){const{userAction:n}=e;this.hooks.emit("enable",{userAction:n}),this.state.visible&&this._show({userAction:n})}_show(e){if(this.disposed||!this.state.enabled)return;const{userAction:n}=e;this.hooks.emit("show",{userAction:n}),this.render()}_hide(e){if(this.disposed||!this.state.enabled)return;const{userAction:n}=e;this.hooks.emit("hide",{userAction:n}),this.render()}updateState(e,n){const o=this.state;this.state=Q(Q({},this.state),e),!it(this.state,o,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n})}render(){if(this.disposed||!this.state.enabled)return;if(!this.wrapper&&this.wrapperSelector){const n=document.querySelector(this.wrapperSelector);this.wrapper=n}if(!this.data||!this.wrapper)return;const e=fe(Q({},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 tf({target:this.wrapper,props:e})}}const of=(i,t)=>new nf(i,t),sf=[{type:0,floorType:1,roomType:"100900000012",name:"\u5176\u4ED6"},{type:1,floorType:1,roomType:"100900000002",name:"\u5BA2\u5385"},{type:2,floorType:1,roomType:"100900000002",name:"\u9910\u5385"},{type:3,floorType:0,roomType:"100900000001",name:"\u5367\u5BA4"},{type:4,floorType:0,roomType:"100900000001",name:"\u4E66\u623F"},{type:5,floorType:3,roomType:"100900000004",name:"\u536B\u751F\u95F4"},{type:6,floorType:3,roomType:"100900000004",name:"\u6DCB\u6D74\u95F4"},{type:7,floorType:3,roomType:"100900000004",name:"\u6D17\u624B\u95F4"},{type:8,floorType:3,roomType:"100900000003",name:"\u53A8\u623F"},{type:9,floorType:1,roomType:"100900000003",name:"\u5F00\u653E\u53A8\u623F",onlySubArea:!0},{type:10,floorType:0,roomType:"100900000001",name:"\u591A\u529F\u80FD\u95F4"},{type:11,floorType:0,roomType:"100900000009",name:"\u4FDD\u59C6\u95F4"},{type:12,floorType:4,roomType:"100900000005",name:"\u9633\u53F0"},{type:13,floorType:4,roomType:"100900000006",name:"\u9732\u53F0"},{type:14,floorType:0,roomType:"100900000008",name:"\u50A8\u7269\u95F4"},{type:15,floorType:0,roomType:"100900000013",name:"\u8863\u5E3D\u95F4"},{type:16,floorType:0,roomType:"100900000011",name:"\u9601\u697C"},{type:17,floorType:2,roomType:"100900000007",name:"\u82B1\u56ED"},{type:18,floorType:5,roomType:"100900000010",name:"\u8F66\u5E93"},{type:19,floorType:1,roomType:"100900000012",name:"\u7535\u68AF"},{type:20,floorType:1,roomType:"100900000012",name:"\u5730\u4E0B\u5BA4"},{type:21,floorType:1,roomType:"100900000012",name:"\u5929\u4E95"},{type:22,floorType:1,roomType:"100900000012",name:"\u9633\u5149\u623F"},{type:23,floorType:1,roomType:"100900000012",name:"\u8FC7\u9053"},{type:24,floorType:1,roomType:"100900000012",name:"\u697C\u68AF\u95F4"},{type:25,floorType:1,roomType:"100900000012",name:"\u95E8\u5385"},{type:26,floorType:2,roomType:"100900000012",name:"\u5165\u6237\u82B1\u56ED"},{type:27,floorType:1,roomType:"100900000012",name:"\u7384\u5173"},{type:28,floorType:1,roomType:"100900000012",name:"\u6311\u7A7A"},{type:29,floorType:4,roomType:"100900000012",name:"\u667E\u6652\u533A"},{type:30,floorType:4,roomType:"100900000012",name:"\u6D17\u8863\u623F"},{type:31,floorType:0,roomType:"100900000012",name:"\u5A31\u4E50\u533A"},{type:32,floorType:0,roomType:"100900000012",name:"\u5065\u8EAB\u533A"},{type:33,floorType:0,roomType:"100900000012",name:"\u63A5\u5F85\u533A"},{type:34,floorType:0,roomType:"100900000012",name:"\u5F71\u97F3\u533A"},{type:35,floorType:1,roomType:"100900000012",name:"\u9910\u996E\u533A"},{type:36,floorType:1,roomType:"100900000012",name:"\u5176\u4ED6",onlySubArea:!0},{type:37,floorType:1,roomType:"100900000002",name:"\u8D77\u5C45\u5BA4"},{type:38,floorType:0,roomType:"100900000001",name:"\u4E3B\u5367"},{type:39,floorType:0,roomType:"100900000001",name:"\u6B21\u5367"},{type:40,floorType:0,roomType:"100900000001",name:"\u4F18\u5316\u95F4"},{type:41,floorType:0,roomType:"100900000001",name:"\u529E\u516C\u5BA4"},{type:42,floorType:0,roomType:"100900000001",name:"\u4F1A\u8BAE\u5BA4"},{type:43,floorType:0,roomType:"100900000001",name:"\u6D3D\u8C08\u95F4"},{type:44,floorType:1,roomType:"100900000002",name:"\u5171\u4EAB\u5927\u5385"},{type:45,floorType:1,roomType:"100900000012",name:"\u6C34\u5427"},{type:46,floorType:0,roomType:"100900000015",name:"\u51FA\u5165\u53E3"},{type:47,floorType:0,roomType:"100900000015",name:"\u5927\u5385"},{type:48,floorType:0,roomType:"100900000015",name:"\u5305\u53A2"},{type:49,floorType:0,roomType:"100900000015",name:"\u5176\u4ED6"},{type:50,floorType:0,roomType:"100900000016",name:"\u51FA\u5165\u53E3"},{type:51,floorType:0,roomType:"100900000016",name:"\u529E\u516C\u533A"},{type:52,floorType:0,roomType:"100900000016",name:"\u8001\u677F\u95F4"},{type:53,floorType:0,roomType:"100900000016",name:"\u4F1A\u8BAE\u5BA4"},{type:54,floorType:0,roomType:"100900000016",name:"\u4F11\u606F\u533A/\u6C34\u5427"},{type:55,floorType:0,roomType:"100900000016",name:"\u5176\u4ED6"},{type:56,floorType:2,roomType:"100900000012",name:"\u7A7A\u4E2D\u82B1\u56ED"},{type:57,floorType:0,roomType:"100900000001",name:"\u6D0B\u5BA4"},{type:58,floorType:0,roomType:"100900000001",name:"\u548C\u5BA4"}],rf=[{type:0,description:"\u6728\u8D28\u5730\u677F"},{type:1,description:"\u74F7\u7816\u5730\u9762"},{type:2,description:"\u6237\u5916\u5730\u9762"},{type:3,description:"\u536B\u751F\u95F4\u5730\u9762"},{type:4,description:"\u9633\u53F0\u5730\u9762"},{type:5,description:"\u8F66\u5E93\u5730\u9762"}],af=[{roomType:"100900000001",description:"\u5BA4"},{roomType:"100900000002",description:"\u5385"},{roomType:"100900000003",description:"\u53A8"},{roomType:"100900000004",description:"\u536B"},{roomType:"100900000005",description:"\u9633\u53F0"},{roomType:"100900000006",description:"\u9732\u53F0"},{roomType:"100900000007",description:"\u82B1\u56ED"},{roomType:"100900000008",description:"\u50A8"},{roomType:"100900000009",description:"\u4FDD\u59C6\u95F4"},{roomType:"100900000010",description:"\u8F66\u5E93"},{roomType:"100900000011",description:"\u9601\u697C"},{roomType:"100900000012",description:"\u5176\u4ED6"},{roomType:"100900000013",description:"\u8863"},{roomType:"100900000015",description:"\u5546\u94FA"},{roomType:"100900000016",description:"\u5199\u5B57\u697C"}],Oi=(i,t,e)=>{const n=new E.Matrix4,o=new E.Euler(i,t,e,"YXZ");return n.makeRotationFromEuler(o),n},lf=(i,{scale:t,rotation:e,position:n})=>{if(t&&i.scale.set(t,t,t),e){const[o,s,r]=e;o&&i.applyMatrix4(Oi(o,0,0)),s&&i.applyMatrix4(Oi(0,s,0)),r&&i.applyMatrix4(Oi(0,0,r))}return n&&i.position.set(n.x,n.y,n.z),i};function al(i,t){i.traverse(e=>{var n;if(e.type==="Mesh"){const o=e,s=Q({map:o.material.map||{}},t);o.material=new j.MeshBasicMaterial(s),o.renderOrder=1,((n=e.parent)==null?void 0:n.type)==="Mesh"&&(e.renderOrder=e.parent.renderOrder+1)}})}const cf=(i,t)=>{var u;const e=t.fbx_url||"//vrlab-image4.ljcdn.com/release/web/dipan2.f38a21cc.FBX",n=(u=t.north_rad)!=null?u:void 0,o={},s=h=>H(exports,null,function*(){var S;const d=(h==null?void 0:h.fbx_url)||e,m=(S=h==null?void 0:h.north_rad)!=null?S:n;if(typeof m!="number")throw new Error('"northRad"\u914D\u7F6E\u53C2\u6570\u7F3A\u5931\uFF1A\u672A\u914D\u7F6E\u6307\u5357\u9488\u6307\u5411\uFF01');const g=i.model.bounding,p=g.max.x-g.min.x,A=g.max.z-g.min.z,v=Math.max(p,A),w=yield new ya.FBXLoader().loadAsync(d);al(w,{transparent:!0,side:E.DoubleSide,blending:E.AdditiveBlending});const k=[0,m-Math.PI/2,0],{model:{bounding:{max:{x:I,z:P},min:{x:L,y:x,z:F}}}}=i;o.yBase=x;const N={x:(I+L)/2,y:x-1.6,z:(P+F)/2},R=.0045*v;return lf(w,{position:N,rotation:k,scale:R}),o.object=w,!0}),r=({latitude:h})=>{if(!o.object)return;const d=a(h);d&&(o.object.position.y=d)},a=h=>{if(o.yBase===void 0)return;const d=.6;if(h>=Math.PI/4)return o.yBase-(d+1.6);const m=h*(4/Math.PI);return o.yBase-(d*m+1.6)};return{load:s,disable:()=>{!o.object||(i.scene.remove(o.object),i.needsRender=!0,i.off("cameraDirectionUpdate",r))},enable:()=>{if(!o.object)return;const h=a(i.getPose().latitude);h&&(o.object.position.y=h),i.scene.add(o.object),i.needsRender=!0,i.on("cameraDirectionUpdate",r)}}};function uf(i,t){var c,u,h,d,m;const e=(c=t==null?void 0:t.size)!=null?c:512,n=(u=t==null?void 0:t.fontSize)!=null?u:e*(35/256)*1.2,o=(h=t==null?void 0:t.backgroundColor)!=null?h:"rgba(0,0,0,0)",s=(d=t==null?void 0:t.fontColor)!=null?d:"#fff",r=(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=o,l.fillRect(0,0,e,e),l.font=`${n}px "\u5FAE\u8F6F\u96C5\u9ED1"`,l.textAlign=r,l.fillStyle=s,l.fillText(i,e/2,e*.7),new j.CanvasTexture(a)}const df=({x:i,y:t,z:e})=>new j.Vector3(i,t,e),hf=(i,t)=>{var p,A,v;const e={},n=(p=t.animationEnabled)!=null?p:!0,o=(A=t.position)!=null?A:void 0,s=(v=t.rad)!=null?v:void 0,r=t.fbx_url||"//vrlab-image4.ljcdn.com/release/web/entryDoorMini/Anim_Door1.fbx",a=[],l=b=>H(exports,null,function*(){var N,R,S,O,G,W,Y,_;const w=(N=b==null?void 0:b.position)!=null?N:o;if(!w)return Promise.reject(new Error("ModelEntryDoorGuidePlugin.load(): position is undefined"));const k=df(w),I=(R=b==null?void 0:b.rad)!=null?R:s,P=(S=b==null?void 0:b.fbx_url)!=null?S:r;if(e.rad=I,I===void 0)return Promise.reject(new Error(`ModelEntryDoorGuidePlugin.load(): rad is ${I}`));const L=yield new ya.FBXLoader().loadAsync(P);L.position.copy(k),L.rotation.z=I,L.scale.set(.8,.8,.8),al(L,{transparent:!0,side:E.DoubleSide});const x=(Y=(W=(G=(O=L.children)==null?void 0:O[0])==null?void 0:G.children)==null?void 0:W[3])==null?void 0:Y.clone();if(!x)return Promise.reject(new Error(`ModelEntryDoorGuidePlugin.load(): textMesh is ${x}`));const F=(_=t.name)!=null?_:"\u5165\u6237\u95E8";return x.material=new j.MeshBasicMaterial({transparent:!0,map:uf(F)}),x.renderOrder=3,L.children[0].add(x),e.object=L,!0}),c=()=>{if(e.animation)return;if(!e.object)return console.error("ModelEntryDoorGuidePlugin.initAnimation(): state.object is ",e.object);const b=1,w=new j.AnimationMixer(e.object);a.push(w);const k=w.clipAction(e.object.animations[0]);k.timeScale=b;let I;const P=()=>{let N=0,R=0;const S=1e3/30,O=G=>{N=requestAnimationFrame(O);const W=G-R;W<S||(R=G,a.forEach(Y=>Y.update(W/1e3)),i.needsRender=!0)};return N=requestAnimationFrame(O),()=>{cancelAnimationFrame(N)}},F={play:()=>{I||(k.play(),I=P(),requestAnimationFrame(()=>{e.object&&e.object.rotation.z!==e.rad&&(e.object.rotation.z=e.rad)}))},stop:()=>{k.stop(),I==null||I(),I=void 0}};e.animation=F},u=b=>{var k;if(!e.object)return console.error("ModelEntryDoorGuidePlugin.enable(): object is ",e.object);((k=b==null?void 0:b.animationEnable)!=null?k:n)&&(e.animation||c(),e.animation.play()),i.scene.add(e.object),i.needsRender=!0},h=()=>{!e.object||(e.animation&&e.animation.stop(),i.scene.remove(e.object),i.needsRender=!0)},d=b=>b==="Floorplan"?u():h();return{load:l,enable:b=>(e.enabled||(e.enabled=!0,d(i.currentMode),i.on("modeChange",d),u(b)),!0),disable:()=>(e.enabled&&(e.enabled=!1,h(),i.off("modeChange",d)),!0)}};class ko extends En.default.Tween{constructor(){super(...arguments);f(this,"disposeMethods",[]);f(this,"animationFrameDisposer");f(this,"onDispose",e=>(this.disposeMethods.push(e),this));f(this,"play",()=>(this.start(0),this.animationFrameDisposer=Ln(e=>this.update(e)),this));f(this,"dispose",()=>{var e;this.stop(),(e=this.animationFrameDisposer)==null||e.call(this),this.disposeMethods.forEach(n=>n()),this.disposeMethods=[],En.default.remove(this)})}}function ll(i,t=En.default.Easing.Linear.None){const e=new ko({progress:0}).to({progress:1});return i!==void 0&&e.duration(i),t!==void 0&&e.easing(t),e}const In=window.requestAnimationFrame||(i=>setTimeout(i,16)),ff=window.cancelAnimationFrame||clearTimeout;function Pi(i,t=0){t<=0?In(i):In(()=>Pi(i,t-1))}function Ln(i,t=60){let e=-1,n=0,o=-1;const s=1e3/t;function r(a){o===-1&&(o=a),e=In(r),!(a-n<s)&&(n=a,i&&i(a-o))}return e=In(r),function(){ff(e)}}function mf(){const i=Date.now();return new Promise(t=>{In(()=>{t(Date.now()-i)})})}const pf=gi.Easing;function gf(i,t,e,n=pf.Linear.None){const o=new gi.Tween(i).to(t,e).easing(n);Pi(()=>o.start(0));const s=Ln(a=>{o.update(a)===!1&&s()}),r=[];return o.onDestroy=a=>(r.push(a),o),o.destroy=function(){this.stop(),Object.assign(o,{_onStartCallback:null,_onUpdateCallback:null,_onCompleteCallback:null,_onStopCallbackL:null});let a;for(;a=r.shift();)a();s()},o}function vf(i,t){return gf({progress:0},{progress:1},i,t)}var cl=(i=>(i.Move="Move",i.Rotate="Rotate",i))(cl||{}),nt=(i=>(i.Clockwise="Clockwise",i.Anticlockwise="Anticlockwise",i.Loop="Loop",i))(nt||{});const $n=Math.PI*2;function ks(i){return(i%$n+$n)%$n}function xs(i){return i%$n}function Ri(i,t,e){return i+(t-i)*e}const so=(i,t,e)=>{const n=Math.PI,o=n*2;return i=ks(i),t=ks(t),e===nt.Anticlockwise&&i<t&&(i+=o),e===nt.Clockwise&&t<i&&(t+=o),e===nt.Loop&&t-i>n?so(i,t,nt.Anticlockwise):e===nt.Loop&&i-t>n?so(i,t,nt.Clockwise):{from:i,to:t}},Af=i=>{const t={},e=(l,c,...u)=>H(exports,[l,c,...u],function*(s,r,a={preload:!0}){return t.interruptCallback&&t.interruptCallback(!1),a.asyncStartCallback&&(yield a.asyncStartCallback()),s.mode&&s.mode!==i.currentMode&&(yield i.changeMode(s.mode)),a.preload&&s.panoIndex!==void 0&&s.panoIndex!==i.panoIndex&&(yield i.preloadPano(s.panoIndex)),a.asyncEndCallback&&(yield a.asyncEndCallback()),s.panoIndex===void 0&&s.fov===void 0&&s.latitude===void 0&&s.longitude===void 0?!0:yield new Promise((h,d)=>{const m=s.panoIndex!==void 0?s.panoIndex:i.panoIndex;m!==void 0?i.moveToPano(m,Object.assign({duration:r,moveEndCallback:()=>h(!0),moveCancelCallback:()=>d(!1)},s)):d(!1)})}),n=s=>{const r=i.state,a=xs(r.latitude),l=xs(s.latitude),{from:c,to:u}=so(r.longitude,s.longitude,s.rotation||nt.Loop),h=r.fov,d=s.fov;return{from:{latitude:a,longitude:c,fov:h},to:{latitude:l,longitude:u,fov:d}}};return{move:e,rotate:(l,c,...u)=>H(exports,[l,c,...u],function*(s,r,a={}){t.interruptCallback&&t.interruptCallback(!1),a.asyncStartCallback&&(yield a.asyncStartCallback()),i.currentMode!==Ee.Five.Mode.Panorama&&(yield i.changeMode(Ee.Five.Mode.Panorama)),s.panoIndex!==void 0&&s.panoIndex!==i.panoIndex&&(a.preload&&(yield i.preloadPano(s.panoIndex)),yield new Promise((m,g)=>{if(!s.panoIndex){m(!0);return}i.moveToPano(s.panoIndex,{moveEndCallback:()=>m(!0),moveCancelCallback:()=>g(!1)})})),a.asyncEndCallback&&(yield a.asyncEndCallback());const{from:h,to:d}=n(s);return yield new Promise(m=>{const g=({progress:w})=>{const k={};k.longitude=Ri(h.longitude,d.longitude,w),k.latitude=Ri(h.latitude,d.latitude,w),k.fov=Ri(h.fov,d.fov,w),i.setState(k,!0)},p=()=>{m(!0)},A=()=>{m(!1)},v=s.rotateSpeed?Math.ceil(Math.abs(d.longitude-h.longitude)/s.rotateSpeed*1e3):r,b=vf(v,gi.Easing.Linear.None).onUpdate(g).onComplete(p).onDestroy(A);s.rotation===nt.Loop&&b.repeat(1/0).yoyo(!0),t.interruptCallback=(w=!0)=>{b.destroy(),t.interruptCallback=void 0,t.timeoutId&&(clearTimeout(t.timeoutId),t.timeoutId=void 0),m(w)},t.timeoutId=setTimeout(()=>{t.interruptCallback&&t.interruptCallback(!0)},r)})})}};function Ds(i,t){return i.x===t.x&&i.y===t.y}function ul(i,t){return Math.abs(i)===1/0&&Math.abs(t)===1/0?!0:Math.abs(i-t)<.001}function fi(i,t){return(t.y-i.y)/(t.x-i.x)}function dl(i,t,e){const n=fi(i[1],i[0]),o=fi(t[1],t[0]);if(isNaN(n)||isNaN(o)||ul(n,o))return!1;if(Fn(i[0],t))return i[0];if(Fn(i[1],t))return i[1];if(Fn(t[0],i))return t[0];if(Fn(t[1],i))return t[1];if(e&&!bf(i,t))return!1;const s=i[0],r=t[0];if(Math.abs(n)===1/0)return{x:s.x,y:t[1].y-(t[1].x-s.x)*o};if(Math.abs(o)===1/0)return{x:r.x,y:i[1].y-(i[1].x-r.x)*n};const a=(r.y-s.y+n*s.x-o*r.x)/(n-o),l=n*a-n*s.x+s.y;return{x:a,y:l}}function Fn(i,t){return Ds(i,t[0])||Ds(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&&ul(fi(t[0],i),fi(i,t[1]))}function Hn(i,t,e){return(i.x-e.x)*(t.y-e.y)-(t.x-e.x)*(i.y-e.y)}function bf(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)&&Hn(t[0],i[1],i[0])*Hn(i[1],t[1],i[0])>0&&Hn(i[0],t[1],t[0])*Hn(t[1],i[1],t[0])>0?1:0}function hl(i,t=0){t<=0?requestAnimationFrame(i):requestAnimationFrame(()=>hl(i,t-1))}const yf=`<style type="text/css">
|
|
115
|
+
`;return i.$$set=s=>{"content"in s&&e(0,n=s.content)},[n,o]}class vd extends oe{constructor(t){super(),ie(this,t,gd,pd,ne,{content:0},md)}}function Ad(i){le(i,"svelte-ozpg4a",".floorplan-plugin__base-image.svelte-ozpg4a{position:absolute;z-index:10;width:100%;height:100%;pointer-events:none}")}function bd(i){let t,e;return t=new fd({props:{url:i[1].url}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.url=n[1].url),t.$set(s)},i(n){e||(C(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function yd(i){let t,e;return t=new vd({props:{content:i[0]}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.content=n[0]),t.$set(s)},i(n){e||(C(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function wd(i){let t,e,n,o;const s=[yd,bd],r=[];function a(l,c){return l[0]?0:l[1]?1:-1}return~(e=a(i))&&(n=r[e]=s[e](i)),{c(){t=B("div"),n&&n.c(),y(t,"class","floorplan-plugin__base-image svelte-ozpg4a")},m(l,c){T(l,t,c),~e&&r[e].m(t,null),o=!0},p(l,[c]){let u=e;e=a(l),e===u?~e&&r[e].p(l,c):(n&&(se(),D(r[u],1,1,()=>{r[u]=null}),re()),~e?(n=r[e],n?n.p(l,c):(n=r[e]=s[e](l),n.c()),C(n,1),n.m(t,null)):n=null)},i(l){o||(C(n),o=!0)},o(l){D(n),o=!1},d(l){l&&M(t),~e&&r[e].d()}}}function Ed(i,t,e){let n,o,{floorIndex:s}=t,{floorplanData:r}=t;return i.$$set=a=>{"floorIndex"in a&&e(2,s=a.floorIndex),"floorplanData"in a&&e(3,r=a.floorplanData)},i.$$.update=()=>{var a,l;i.$$.dirty&12&&e(1,n=r.outlines[s]),i.$$.dirty&12&&e(0,o=(l=(a=r.outlines)==null?void 0:a[s])==null?void 0:l.svgContent)},[o,n,s,r]}class tl extends oe{constructor(t){super(),ie(this,t,Ed,wd,ne,{floorIndex:2,floorplanData:3},Ad)}}function Pd(i){le(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 Cd(i){let t,e=i[8].outerHTML+"",n;return{c(){t=new ii(!1),n=pe(),t.a=n},m(o,s){t.m(e,o,s),T(o,n,s)},p(o,s){s&256&&e!==(e=o[8].outerHTML+"")&&t.p(e)},d(o){o&&M(n),o&&t.d()}}}function Id(i){let t,e,n=i[1]&&qo(i),o=i[0]&&Jo(i);return{c(){n&&n.c(),t=$(),o&&o.c(),e=pe()},m(s,r){n&&n.m(s,r),T(s,t,r),o&&o.m(s,r),T(s,e,r)},p(s,r){s[1]?n?n.p(s,r):(n=qo(s),n.c(),n.m(t.parentNode,t)):n&&(n.d(1),n=null),s[0]?o?o.p(s,r):(o=Jo(s),o.c(),o.m(e.parentNode,e)):o&&(o.d(1),o=null)},d(s){n&&n.d(s),s&&M(t),o&&o.d(s),s&&M(e)}}}function qo(i){let t,e=i[2].name+"",n;return{c(){t=B("span"),n=xe(e),y(t,"class","floorplan-plugin__room-name")},m(o,s){T(o,t,s),V(t,n)},p(o,s){s&4&&e!==(e=o[2].name+"")&&Se(n,e)},d(o){o&&M(t)}}}function Jo(i){let t,e;return{c(){t=B("span"),e=xe(i[7]),y(t,"class","floorplan-plugin__room-size svelte-12pzct5")},m(n,o){T(n,t,o),V(t,e)},p(n,o){o&128&&Se(e,n[7])},d(n){n&&M(t)}}}function kd(i){let t,e,n;function o(a,l){if(a[3]===void 0)return Id;if(a[8])return Cd}let s=o(i),r=s&&s(i);return{c(){t=B("div"),r&&r.c(),y(t,"class","floorplan-plugin__room-label-item svelte-12pzct5"),z(t,"left",i[9]),z(t,"top",i[10]),z(t,"font-size",i[11]),z(t,"opacity",i[6]?"1":"0")},m(a,l){T(a,t,l),r&&r.m(t,null),e||(n=[ct(ln.call(null,t)),me(t,"clientWidth",i[19]),me(t,"clientHeight",i[20])],e=!0)},p(a,[l]){s===(s=o(a))&&r?r.p(a,l):(r&&r.d(1),r=s&&s(a),r&&(r.c(),r.m(t,null))),l&64&&z(t,"opacity",a[6]?"1":"0")},i:X,o:X,d(a){a&&M(t),r&&r.d(),e=!1,He(n)}}}function xd(i,t){const e=i[0],n=i[1];let o=!1;for(let s=0,r=t.length-1;s<t.length;r=s++){const a=t[s][0],l=t[s][1],c=t[r][0],u=t[r][1];l>n!=u>n&&e<(c-a)*(n-l)/(u-l)+a&&(o=!o)}return o}function Dd(i,t,e){let n,o,s,r,a,{pxmm:l}=t,{roomAreaEnable:c}=t,{roomNameEnable:u}=t,{room:h}=t,{hoveredRoom:d}=t,{getRoomAreaText:m}=t,{getLabelElement:g}=t,{adaptiveRoomLabelVisibleEnable:p}=t;function A(S,O){if(O.width===0||O.height===0)return()=>!1;const G=S.path.map(({x:de,y:ge})=>[de,ge]),W=S.roomLabel.position,{x:Y,y:_}=W,{width:ee,height:U}=O,ae=ee/2,he=U/2;return function(ge){const Ce=Y*ge,ke=_*ge,Te=G.map(([ve,Pe])=>[ve*ge,Pe*ge]);return[[Ce+ae,ke-he],[Ce-ae,ke-he],[Ce-ae,ke+he],[Ce+ae,ke+he]].every(ve=>xd(ve,Te))}}const v=document.body.clientWidth,b=document.body.clientHeight,w=h.roomLabel,k=w.positionInImage.x*100+"%",I=w.positionInImage.y*100+"%",P=(v<500||b<500?10:14)+"px";let L=0,x=0,F=!1;d.subscribe(function(O){e(16,F=!!O&&O.id===h.id)});const N=S=>{e(4,L=S.detail)},R=S=>{e(5,x=S.detail)};return i.$$set=S=>{"pxmm"in S&&e(12,l=S.pxmm),"roomAreaEnable"in S&&e(0,c=S.roomAreaEnable),"roomNameEnable"in S&&e(1,u=S.roomNameEnable),"room"in S&&e(2,h=S.room),"hoveredRoom"in S&&e(13,d=S.hoveredRoom),"getRoomAreaText"in S&&e(14,m=S.getRoomAreaText),"getLabelElement"in S&&e(3,g=S.getLabelElement),"adaptiveRoomLabelVisibleEnable"in S&&e(15,p=S.adaptiveRoomLabelVisibleEnable)},i.$$.update=()=>{i.$$.dirty&12&&e(8,n=g==null?void 0:g(h)),i.$$.dirty&16388&&e(7,o=h.size?m(h.size):""),i.$$.dirty&48&&e(18,s={width:L,height:x}),i.$$.dirty&262148&&e(17,r=s?A(h,s):void 0),i.$$.dirty&233472&&e(6,a=p?F?!0:!!(r!=null&&r(l)):!0)},[c,u,h,g,L,x,a,o,n,k,I,P,l,d,m,p,F,r,s,N,R]}class Ld extends oe{constructor(t){super(),ie(this,t,Dd,kd,ne,{pxmm:12,roomAreaEnable:0,roomNameEnable:1,room:2,hoveredRoom:13,getRoomAreaText:14,getLabelElement:3,adaptiveRoomLabelVisibleEnable:15},Pd)}}function Md(i){le(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 Zo(i,t,e){const n=i.slice();return n[12]=t[e],n}function Ko(i){let t,e=[],n=new Map,o,s,r,a=i[8];const l=c=>c[12].id;for(let c=0;c<a.length;c+=1){let u=Zo(i,a,c),h=l(u);n.set(h,e[c]=$o(h,u))}return{c(){t=B("div");for(let c=0;c<e.length;c+=1)e[c].c();y(t,"class","floorplan-plugin__room-labels svelte-13xux0b")},m(c,u){T(c,t,u);for(let h=0;h<e.length;h+=1)e[h].m(t,null);o=!0,s||(r=[ct(ln.call(null,t)),me(t,"clientWidth",i[11])],s=!0)},p(c,u){u&447&&(a=c[8],se(),e=Ke(e,u,l,1,c,a,n,t,It,$o,null,Zo),re())},i(c){if(!o){for(let u=0;u<a.length;u+=1)C(e[u]);o=!0}},o(c){for(let u=0;u<e.length;u+=1)D(e[u]);o=!1},d(c){c&&M(t);for(let u=0;u<e.length;u+=1)e[u].d();s=!1,He(r)}}}function $o(i,t){let e,n,o;const s=[{pxmm:t[7],room:t[12],hoveredRoom:t[2],roomAreaEnable:t[0],roomNameEnable:t[1],getLabelElement:t[4],getRoomAreaText:t[3],adaptiveRoomLabelVisibleEnable:t[5]}];let r={};for(let a=0;a<s.length;a+=1)r=Be(r,s[a]);return n=new Ld({props:r}),{key:i,first:null,c(){e=pe(),K(n.$$.fragment),this.first=e},m(a,l){T(a,e,l),J(n,a,l),o=!0},p(a,l){t=a;const c=l&447?Qe(s,[{pxmm:t[7],room:t[12],hoveredRoom:t[2],roomAreaEnable:t[0],roomNameEnable:t[1],getLabelElement:t[4],getRoomAreaText:t[3],adaptiveRoomLabelVisibleEnable:t[5]}]):{};n.$set(c)},i(a){o||(C(n.$$.fragment,a),o=!0)},o(a){D(n.$$.fragment,a),o=!1},d(a){a&&M(e),Z(n,a)}}}function Sd(i){let t,e,n=i[8]&&Ko(i);return{c(){n&&n.c(),t=pe()},m(o,s){n&&n.m(o,s),T(o,t,s),e=!0},p(o,[s]){o[8]?n?(n.p(o,s),s&256&&C(n,1)):(n=Ko(o),n.c(),C(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(C(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function Td(i,t,e){let n,{floorIndex:o}=t,{roomAreaEnable:s}=t,{roomNameEnable:r}=t,{floorplanData:a}=t,{hoveredRoom:l}=t,{getRoomAreaText:c}=t,{getLabelElement:u}=t,{adaptiveRoomLabelVisibleEnable:h}=t,d=0,m=0;const g=p=>{e(6,d=p.detail)};return i.$$set=p=>{"floorIndex"in p&&e(9,o=p.floorIndex),"roomAreaEnable"in p&&e(0,s=p.roomAreaEnable),"roomNameEnable"in p&&e(1,r=p.roomNameEnable),"floorplanData"in p&&e(10,a=p.floorplanData),"hoveredRoom"in p&&e(2,l=p.hoveredRoom),"getRoomAreaText"in p&&e(3,c=p.getRoomAreaText),"getLabelElement"in p&&e(4,u=p.getLabelElement),"adaptiveRoomLabelVisibleEnable"in p&&e(5,h=p.adaptiveRoomLabelVisibleEnable)},i.$$.update=()=>{if(i.$$.dirty&1536&&e(8,n=a.floorDatas[o].rooms),i.$$.dirty&1088){const{max:p,min:A}=a.bounding,v=p.x-A.x;e(7,m=d/v)}},[s,r,l,c,u,h,d,m,n,o,a,g]}class zd extends oe{constructor(t){super(),ie(this,t,Td,Sd,ne,{floorIndex:9,roomAreaEnable:0,roomNameEnable:1,floorplanData:10,hoveredRoom:2,getRoomAreaText:3,getLabelElement:4,adaptiveRoomLabelVisibleEnable:5},Md)}}function Bd(i){le(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 es(i,t,e){const n=i.slice();return n[11]=t[e],n[13]=e,n}function ts(i,t,e){const n=i.slice();return n[14]=t[e],n}function ns(i){let t;return{c(){t=B("div"),y(t,"class","floorplan-plugin__rule-scale svelte-djlmk4"),z(t,"left",i[14].left*100+"%"),z(t,"bottom",i[14].bottom*100+"%")},m(e,n){T(e,t,n)},p:X,d(e){e&&M(t)}}}function is(i,t){let e,n,o=t[1](t[11].distance)+"",s,r;return{key:i,first:null,c(){e=B("div"),n=B("div"),s=xe(o),r=$(),y(n,"class","floorplan-plugin__rule-text svelte-djlmk4"),q(n,"is-row",t[2]),y(e,"class","floorplan-plugin__rule-text-item svelte-djlmk4"),z(e,"left",t[11].left*100+"%"),z(e,"bottom",t[11].bottom*100+"%"),this.first=e},m(a,l){T(a,e,l),V(e,n),V(n,s),V(e,r)},p(a,l){t=a,l&2&&o!==(o=t[1](t[11].distance)+"")&&Se(s,o)},d(a){a&&M(e)}}}function Vd(i){let t,e,n,o,s,r,a=[],l=new Map,c,u=i[3],h=[];for(let g=0;g<u.length;g+=1)h[g]=ns(ts(i,u,g));let d=i[4];const m=g=>g[13];for(let g=0;g<d.length;g+=1){let p=es(i,d,g),A=m(p);l.set(A,a[g]=is(A,p))}return{c(){t=B("div"),e=B("div"),n=$(),o=B("div");for(let g=0;g<h.length;g+=1)h[g].c();s=$(),r=B("div");for(let g=0;g<a.length;g+=1)a[g].c();y(e,"class","floorplan-plugin__rule-line svelte-djlmk4"),y(o,"class","floorplan-plugin__rule-scale-wrapper svelte-djlmk4"),q(o,"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"),q(t,"is-row",i[2]),z(t,"width",i[2]?"100%":1/16+"rem"),z(t,"height",i[2]?1/16+"rem":"100%")},m(g,p){T(g,t,p),V(t,e),V(t,n),V(t,o);for(let A=0;A<h.length;A+=1)h[A].m(o,null);V(t,s),V(t,r);for(let A=0;A<a.length;A+=1)a[A].m(r,null)},p(g,[p]){if(p&8){u=g[3];let A;for(A=0;A<u.length;A+=1){const v=ts(g,u,A);h[A]?h[A].p(v,p):(h[A]=ns(v),h[A].c(),h[A].m(o,null))}for(;A<h.length;A+=1)h[A].d(1);h.length=u.length}p&22&&(d=g[4],a=Ke(a,p,m,1,g,d,l,r,Ao,is,null,es)),p&1&&c!==(c="floorplan-plugin__rule-labels floorplan-plugin__rule-labels--"+g[0]+" svelte-djlmk4")&&y(t,"class",c),p&5&&q(t,"is-row",g[2])},i:X,o:X,d(g){g&&M(t),ut(h,g);for(let p=0;p<a.length;p+=1)a[p].d()}}}const Qt=1e3,Ft=180;function jd(i,t,e){let{type:n}=t,{data:o}=t,{bounding:s}=t,{getRuleDistanceText:r}=t;const a=n==="top"||n==="bottom",l=s.max.x-s.min.x-(Qt-Ft)*2,c=s.max.y-s.min.y-(Qt-Ft)*2,u=o.map(([g,p])=>a?[g.x,p.x]:[g.y,p.y]).flat().sort().filter((g,p,A)=>p===0?!0:g!==A[p-1]),h=u.map(g=>{const p=a?(g-s.min.x-Qt+Ft)/l:0,A=a?0:(g-s.min.y-Qt+Ft)/c;return{left:p,bottom:A}});h.unshift({left:0,bottom:0}),h.push(a?{left:1,bottom:0}:{left:0,bottom:1});const d=u[u.length-1]-u[0],m=u.map((g,p,A)=>{const v=p===0?0:g-A[p-1],b=p===0?0:(g+A[p-1])/2,w=a?(b-s.min.x-Qt+Ft)/l:0,k=a?0:(b-s.min.y-Qt+Ft)/c;return{left:w,bottom:k,distance:v}}).filter(({distance:g})=>g/d>.1);return i.$$set=g=>{"type"in g&&e(0,n=g.type),"data"in g&&e(5,o=g.data),"bounding"in g&&e(6,s=g.bounding),"getRuleDistanceText"in g&&e(1,r=g.getRuleDistanceText)},[n,r,a,h,m,o,s]}class Od extends oe{constructor(t){super(),ie(this,t,jd,Vd,ne,{type:0,data:5,bounding:6,getRuleDistanceText:1},Bd)}}function Rd(i){le(i,"svelte-1mzj9p3",".floorplan-plugin__rule-labels-wrapper.svelte-1mzj9p3{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);pointer-events:none}")}function os(i,t,e){const n=i.slice();return n[13]=t[e][0],n[14]=t[e][1],n}function ss(i,t){let e,n,o;const s=[{type:t[13],data:t[14],bounding:t[1],getRuleDistanceText:t[0]}];let r={};for(let a=0;a<s.length;a+=1)r=Be(r,s[a]);return n=new Od({props:r}),{key:i,first:null,c(){e=pe(),K(n.$$.fragment),this.first=e},m(a,l){T(a,e,l),J(n,a,l),o=!0},p(a,l){t=a;const c=l&19?Qe(s,[{type:t[13],data:t[14],bounding:t[1],getRuleDistanceText:t[0]}]):{};n.$set(c)},i(a){o||(C(n.$$.fragment,a),o=!0)},o(a){D(n.$$.fragment,a),o=!1},d(a){a&&M(e),Z(n,a)}}}function Qd(i){let t,e=[],n=new Map,o,s=i[4];const r=a=>a[13];for(let a=0;a<s.length;a+=1){let l=os(i,s,a),c=r(l);n.set(c,e[a]=ss(c,l))}return{c(){t=B("div");for(let a=0;a<e.length;a+=1)e[a].c();y(t,"class","floorplan-plugin__rule-labels-wrapper svelte-1mzj9p3"),z(t,"width",i[3]),z(t,"height",i[2])},m(a,l){T(a,t,l);for(let c=0;c<e.length;c+=1)e[c].m(t,null);o=!0},p(a,[l]){l&19&&(s=a[4],se(),e=Ke(e,l,r,1,a,s,n,t,It,ss,null,os),re()),l&8&&z(t,"width",a[3]),l&4&&z(t,"height",a[2])},i(a){if(!o){for(let l=0;l<s.length;l+=1)C(e[l]);o=!0}},o(a){for(let l=0;l<e.length;l+=1)D(e[l]);o=!1},d(a){a&&M(t);for(let l=0;l<e.length;l+=1)e[l].d()}}}const rs=1e3,as=180;function Fd(i,t,e){let n,o,s,r,a,l,c,u,h,d,{floorIndex:m}=t,{floorplanData:g}=t,{getRuleDistanceText:p}=t;return i.$$set=A=>{"floorIndex"in A&&e(5,m=A.floorIndex),"floorplanData"in A&&e(6,g=A.floorplanData),"getRuleDistanceText"in A&&e(0,p=A.getRuleDistanceText)},i.$$.update=()=>{i.$$.dirty&64&&e(1,n=g.bounding),i.$$.dirty&96&&e(11,o=g.floorDatas[m].rules),i.$$.dirty&2048&&e(12,s=Object.keys(o)),i.$$.dirty&6144&&e(4,r=s.map(A=>[A,o[A]])),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-(rs-as)*2),i.$$.dirty&2&&e(8,u=n.max.y-n.min.y-(rs-as)*2),i.$$.dirty&1536&&e(3,h=c/a*100+"%"),i.$$.dirty&384&&e(2,d=u/l*100+"%")},[p,n,d,h,r,m,g,l,u,a,c,o,s]}class Hd extends oe{constructor(t){super(),ie(this,t,Fd,Qd,ne,{floorIndex:5,floorplanData:6,getRuleDistanceText:0},Rd)}}function wi(i,t={}){let e="";const{needZ:n,needA:o}=t;return(n?i.slice().concat(i[0]):i.slice()).forEach((r,a)=>{const{x:l,y:c}=t.format?t.format(r):r,u=l+","+c;return a===0?(e+="M"+u,e):o!=null&&o[a]?(e+="A"+o[a]+","+u,e):(e+="L"+u,e)}),e+(n?"Z":"")}function nl({x:i,y:t},e){const{max:n,min:o}=e;return{x:i-o.x,y:n.y-t}}function Gd(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 Wd(i,t){const e=t.bounding,n=e.max.x-e.min.x,o=e.max.y-e.min.y;return{x:(i.x-e.min.x)/n,y:(e.max.y-i.y)/o}}function _d(i,t){return Math.max(...t.work.observers.map(n=>i.z>=n.standingPosition.z?n.floorIndex:0))}function Nd(i){let t;return{c(){t=we("path"),y(t,"d",i[0]),y(t,"fill","#2F313A")},m(e,n){T(e,t,n)},p(e,[n]){n&1&&y(t,"d",e[0])},i:X,o:X,d(e){e&&M(t)}}}function Xd(i,t,e){let n,{path:o}=t;return i.$$set=s=>{"path"in s&&e(1,o=s.path)},i.$$.update=()=>{i.$$.dirty&2&&e(0,n=wi(o,{needZ:!0}))},[n,o]}class Yd extends oe{constructor(t){super(),ie(this,t,Xd,Nd,ne,{path:1})}}function Ud(i){let t,e,n,o,s,r;return{c(){t=we("defs"),e=we("pattern"),n=we("rect"),o=we("path"),s=$(),r=we("path"),y(n,"x","0"),y(n,"y","0"),y(n,"width",i[1]),y(n,"height",i[1]),y(n,"fill","#323747"),y(o,"d",i[2]),y(o,"stroke","#ffffff"),y(o,"stroke-opacity","0.06"),y(o,"stroke-width","0.5"),y(o,"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){T(a,t,l),V(t,e),V(e,n),V(e,o),T(a,s,l),T(a,r,l)},p(a,[l]){l&1&&y(r,"d",a[0])},i:X,o:X,d(a){a&&M(t),a&&M(s),a&&M(r)}}}const ji=6;function qd(i,t,e){let n,{path:o}=t;const s=ji*2,r=`M0 ${ji} h ${s} M${ji} 0 v ${s}`;return i.$$set=a=>{"path"in a&&e(3,o=a.path)},i.$$.update=()=>{i.$$.dirty&8&&e(0,n=wi(o,{needZ:!0}))},[n,s,r,o]}class Jd extends oe{constructor(t){super(),ie(this,t,qd,Ud,ne,{path:3})}}function Zd(i){let t,e,n,o,s,r,a,l,c,u,h;return{c(){t=we("defs"),e=we("pattern"),n=we("rect"),o=we("pattern"),s=we("rect"),r=$(),a=we("path"),l=$(),c=we("path"),u=$(),h=we("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(s,"x","0"),y(s,"y","0"),y(s,"width","6"),y(s,"height","50"),y(s,"fill","none"),y(s,"stroke","#4B4B57"),y(s,"stroke-width","0.5"),y(o,"id","room-material-pattern-2"),y(o,"x","6"),y(o,"y","25"),y(o,"width","12"),y(o,"height","50"),y(o,"patternUnits","userSpaceOnUse"),y(o,"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(d,m){T(d,t,m),V(t,e),V(e,n),V(t,o),V(o,s),T(d,r,m),T(d,a,m),T(d,l,m),T(d,c,m),T(d,u,m),T(d,h,m)},p(d,[m]){m&1&&y(a,"d",d[0]),m&1&&y(c,"d",d[0]),m&1&&y(h,"d",d[0])},i:X,o:X,d(d){d&&M(t),d&&M(r),d&&M(a),d&&M(l),d&&M(c),d&&M(u),d&&M(h)}}}function Kd(i,t,e){let n,{path:o}=t;return i.$$set=s=>{"path"in s&&e(1,o=s.path)},i.$$.update=()=>{i.$$.dirty&2&&e(0,n=wi(o,{needZ:!0}))},[n,o]}class $d extends oe{constructor(t){super(),ie(this,t,Kd,Zd,ne,{path:1})}}function eh(i){le(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 ls(i,t,e){const n=i.slice();return n[5]=t[e],n}function th(i){let t,e;return t=new Jd({props:{path:i[5].path}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.path=n[5].path),t.$set(s)},i(n){e||(C(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function nh(i){let t,e;return t=new $d({props:{path:i[5].path}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.path=n[5].path),t.$set(s)},i(n){e||(C(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function ih(i){let t,e;return t=new Yd({props:{path:i[5].path}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.path=n[5].path),t.$set(s)},i(n){e||(C(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function cs(i){let t,e,n,o;const s=[ih,nh,th],r=[];function a(l,c){return l[5].floorType===1?0:l[5].floorType===0?1:2}return e=a(i),n=r[e]=s[e](i),{c(){t=we("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){T(l,t,c),r[e].m(t,null),o=!0},p(l,c){let u=e;e=a(l),e===u?r[e].p(l,c):(se(),D(r[u],1,1,()=>{r[u]=null}),re(),n=r[e],n?n.p(l,c):(n=r[e]=s[e](l),n.c()),C(n,1),n.m(t,null))},i(l){o||(C(n),o=!0)},o(l){D(n),o=!1},d(l){l&&M(t),r[e].d()}}}function oh(i){let t,e,n=i[0],o=[];for(let r=0;r<n.length;r+=1)o[r]=cs(ls(i,n,r));const s=r=>D(o[r],1,1,()=>{o[r]=null});return{c(){t=B("div");for(let r=0;r<o.length;r+=1)o[r].c();y(t,"class","floorplan-plugin__room-material svelte-1dykexu")},m(r,a){T(r,t,a);for(let l=0;l<o.length;l+=1)o[l].m(t,null);e=!0},p(r,[a]){if(a&7){n=r[0];let l;for(l=0;l<n.length;l+=1){const c=ls(r,n,l);o[l]?(o[l].p(c,a),C(o[l],1)):(o[l]=cs(c),o[l].c(),C(o[l],1),o[l].m(t,null))}for(se(),l=n.length;l<o.length;l+=1)s(l);re()}},i(r){if(!e){for(let a=0;a<n.length;a+=1)C(o[a]);e=!0}},o(r){o=o.filter(Boolean);for(let a=0;a<o.length;a+=1)D(o[a]);e=!1},d(r){r&&M(t),ut(o,r)}}}function sh(i,t,e){let n,{floorIndex:o}=t,{floorplanData:s}=t;const r=s.bounding.max.x-s.bounding.min.x,a=s.bounding.max.y-s.bounding.min.y;return i.$$set=l=>{"floorIndex"in l&&e(3,o=l.floorIndex),"floorplanData"in l&&e(4,s=l.floorplanData)},i.$$.update=()=>{i.$$.dirty&24&&e(0,n=s.floorDatas[o].rooms.map(l=>fe(Q({},l),{path:l.path.map(c=>nl(c,s.bounding))})))},[n,r,a,o,s]}class rh extends oe{constructor(t){super(),ie(this,t,sh,oh,ne,{floorIndex:3,floorplanData:4},eh)}}function ah(i){le(i,"svelte-qq2273","path.svelte-qq2273{--opacity:0;opacity:var(--opacity)}path.svelte-qq2273:hover{opacity:calc(var(--opacity) + 0.1)}")}function lh(i){let t,e,n,o;return{c(){t=we("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(s,r){T(s,t,r),n||(o=[me(t,"mouseenter",i[3]),me(t,"mouseleave",i[4])],n=!0)},p(s,[r]){r&4&&y(t,"style",s[2]),r&3&&e!==(e=`${s[1]}_${s[0].id}`)&&y(t,"id",e)},i:X,o:X,d(s){s&&M(t),n=!1,He(o)}}}function ch(i,t,e){let n,o,{room:s}=t,{floorIndex:r}=t,{floorplanData:a}=t,{hoveredRoom:l}=t,{highlightData:c}=t;function u(){l.set(s)}function h(){l.set(void 0)}const{bounding:d}=a,m=wi(s.path,{needZ:!0,format:g=>nl(g,d)});return i.$$set=g=>{"room"in g&&e(0,s=g.room),"floorIndex"in g&&e(1,r=g.floorIndex),"floorplanData"in g&&e(6,a=g.floorplanData),"hoveredRoom"in g&&e(7,l=g.hoveredRoom),"highlightData"in g&&e(8,c=g.highlightData)},i.$$.update=()=>{i.$$.dirty&259&&e(9,n=c[`${r}_${s.id}`]),i.$$.dirty&512&&e(2,o=n?`fill: ${n.color}; --opacity: ${n.opacity}; pointer-events: ${n.disabled?"none":"auto"}`:null)},[s,r,o,u,h,m,a,l,c,n]}class uh extends oe{constructor(t){super(),ie(this,t,ch,lh,ne,{room:0,floorIndex:1,floorplanData:6,hoveredRoom:7,highlightData:8},ah)}}function dh(i){le(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 us(i,t,e){const n=i.slice();return n[6]=t[e],n}function ds(i,t){let e,n,o;const s=[{room:t[6],floorplanData:t[1],hoveredRoom:t[2],floorIndex:t[0],highlightData:t[3]}];let r={};for(let a=0;a<s.length;a+=1)r=Be(r,s[a]);return n=new uh({props:r}),{key:i,first:null,c(){e=pe(),K(n.$$.fragment),this.first=e},m(a,l){T(a,e,l),J(n,a,l),o=!0},p(a,l){t=a;const c=l&15?Qe(s,[{room:t[6],floorplanData:t[1],hoveredRoom:t[2],floorIndex:t[0],highlightData:t[3]}]):{};n.$set(c)},i(a){o||(C(n.$$.fragment,a),o=!0)},o(a){D(n.$$.fragment,a),o=!1},d(a){a&&M(e),Z(n,a)}}}function hh(i){let t,e,n=[],o=new Map,s,r=i[1].floorDatas[i[0]].rooms;const a=l=>l[6].id;for(let l=0;l<r.length;l+=1){let c=us(i,r,l),u=a(c);o.set(u,n[l]=ds(u,c))}return{c(){t=B("div"),e=we("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){T(l,t,c),V(t,e);for(let u=0;u<n.length;u+=1)n[u].m(e,null);s=!0},p(l,[c]){c&15&&(r=l[1].floorDatas[l[0]].rooms,se(),n=Ke(n,c,a,1,l,r,o,e,It,ds,null,us),re())},i(l){if(!s){for(let c=0;c<r.length;c+=1)C(n[c]);s=!0}},o(l){for(let c=0;c<n.length;c+=1)D(n[c]);s=!1},d(l){l&&M(t);for(let c=0;c<n.length;c+=1)n[c].d()}}}function fh(i,t,e){let{floorIndex:n}=t,{floorplanData:o}=t,{hoveredRoom:s}=t,{highlightData:r}=t;const a=o.bounding.max.x-o.bounding.min.x,l=o.bounding.max.y-o.bounding.min.y;return i.$$set=c=>{"floorIndex"in c&&e(0,n=c.floorIndex),"floorplanData"in c&&e(1,o=c.floorplanData),"hoveredRoom"in c&&e(2,s=c.hoveredRoom),"highlightData"in c&&e(3,r=c.highlightData)},[n,o,s,r,a,l]}class il extends oe{constructor(t){super(),ie(this,t,fh,hh,ne,{floorIndex:0,floorplanData:1,hoveredRoom:2,highlightData:3},dh)}}function mh(i){le(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 hs(i){let t,e;const n=[{floorIndex:i[1],floorplanData:i[8],hoveredRoom:i[14],highlightData:i[13]}];let o={};for(let s=0;s<n.length;s+=1)o=Be(o,n[s]);return t=new il({props:o}),{c(){K(t.$$.fragment)},m(s,r){J(t,s,r),e=!0},p(s,r){const a=r&24834?Qe(n,[{floorIndex:s[1],floorplanData:s[8],hoveredRoom:s[14],highlightData:s[13]}]):{};t.$set(a)},i(s){e||(C(t.$$.fragment,s),e=!0)},o(s){D(t.$$.fragment,s),e=!1},d(s){Z(t,s)}}}function fs(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 o={};for(let s=0;s<n.length;s+=1)o=Be(o,n[s]);return t=new zd({props:o}),{c(){K(t.$$.fragment)},m(s,r){J(t,s,r),e=!0},p(s,r){const a=r&22370?Qe(n,[{floorplanData:s[8],roomAreaEnable:s[5],roomNameEnable:s[6],floorIndex:s[1],getRoomAreaText:s[9],getLabelElement:s[10],hoveredRoom:s[14],adaptiveRoomLabelVisibleEnable:s[12]}]):{};t.$set(a)},i(s){e||(C(t.$$.fragment,s),e=!0)},o(s){D(t.$$.fragment,s),e=!1},d(s){Z(t,s)}}}function ms(i){let t,e;const n=[{floorplanData:i[8],floorIndex:i[1],getRuleDistanceText:i[11]}];let o={};for(let s=0;s<n.length;s+=1)o=Be(o,n[s]);return t=new Hd({props:o}),{c(){K(t.$$.fragment)},m(s,r){J(t,s,r),e=!0},p(s,r){const a=r&2306?Qe(n,[{floorplanData:s[8],floorIndex:s[1],getRuleDistanceText:s[11]}]):{};t.$set(a)},i(s){e||(C(t.$$.fragment,s),e=!0)},o(s){D(t.$$.fragment,s),e=!1},d(s){Z(t,s)}}}function ph(i){let t,e,n,o,s,r,a,l,c;const u=[{floorIndex:i[1],floorplanData:i[8]}];let h={};for(let v=0;v<u.length;v+=1)h=Be(h,u[v]);e=new rh({props:h});let d=(i[2]||i[3])&&hs(i);const m=[{floorplanData:i[8],floorIndex:i[1]}];let g={};for(let v=0;v<m.length;v+=1)g=Be(g,m[v]);s=new tl({props:g});let p=i[4]&&fs(i),A=i[7]&&ms(i);return{c(){t=B("div"),K(e.$$.fragment),n=$(),d&&d.c(),o=$(),K(s.$$.fragment),r=$(),p&&p.c(),a=$(),A&&A.c(),y(t,"class",l=Ie(`floorplan-plugin__floor${i[0]?" floorplan-plugin__floor--is-current":""}`)+" svelte-bl8zrz")},m(v,b){T(v,t,b),J(e,t,null),V(t,n),d&&d.m(t,null),V(t,o),J(s,t,null),V(t,r),p&&p.m(t,null),V(t,a),A&&A.m(t,null),c=!0},p(v,[b]){const w=b&258?Qe(u,[{floorIndex:v[1],floorplanData:v[8]}]):{};e.$set(w),v[2]||v[3]?d?(d.p(v,b),b&12&&C(d,1)):(d=hs(v),d.c(),C(d,1),d.m(t,o)):d&&(se(),D(d,1,1,()=>{d=null}),re());const k=b&258?Qe(m,[{floorplanData:v[8],floorIndex:v[1]}]):{};s.$set(k),v[4]?p?(p.p(v,b),b&16&&C(p,1)):(p=fs(v),p.c(),C(p,1),p.m(t,a)):p&&(se(),D(p,1,1,()=>{p=null}),re()),v[7]?A?(A.p(v,b),b&128&&C(A,1)):(A=ms(v),A.c(),C(A,1),A.m(t,null)):A&&(se(),D(A,1,1,()=>{A=null}),re()),(!c||b&1&&l!==(l=Ie(`floorplan-plugin__floor${v[0]?" floorplan-plugin__floor--is-current":""}`)+" svelte-bl8zrz"))&&y(t,"class",l)},i(v){c||(C(e.$$.fragment,v),C(d),C(s.$$.fragment,v),C(p),C(A),c=!0)},o(v){D(e.$$.fragment,v),D(d),D(s.$$.fragment,v),D(p),D(A),c=!1},d(v){v&&M(t),Z(e),d&&d.d(),Z(s),p&&p.d(),A&&A.d()}}}function gh(i,t,e){let{isCurrent:n}=t,{floorIndex:o}=t,{highlightEnable:s}=t,{hoverEnable:r}=t,{roomLabelsEnable:a}=t,{roomAreaEnable:l}=t,{roomNameEnable:c}=t,{ruleLabelsEnable:u}=t,{floorplanData:h}=t,{getRoomAreaText:d}=t,{getLabelElement:m}=t,{getRuleDistanceText:g}=t,{adaptiveRoomLabelVisibleEnable:p}=t,{highlightData:A}=t;const v=yo(void 0);return i.$$set=b=>{"isCurrent"in b&&e(0,n=b.isCurrent),"floorIndex"in b&&e(1,o=b.floorIndex),"highlightEnable"in b&&e(2,s=b.highlightEnable),"hoverEnable"in b&&e(3,r=b.hoverEnable),"roomLabelsEnable"in b&&e(4,a=b.roomLabelsEnable),"roomAreaEnable"in b&&e(5,l=b.roomAreaEnable),"roomNameEnable"in b&&e(6,c=b.roomNameEnable),"ruleLabelsEnable"in b&&e(7,u=b.ruleLabelsEnable),"floorplanData"in b&&e(8,h=b.floorplanData),"getRoomAreaText"in b&&e(9,d=b.getRoomAreaText),"getLabelElement"in b&&e(10,m=b.getLabelElement),"getRuleDistanceText"in b&&e(11,g=b.getRuleDistanceText),"adaptiveRoomLabelVisibleEnable"in b&&e(12,p=b.adaptiveRoomLabelVisibleEnable),"highlightData"in b&&e(13,A=b.highlightData)},[n,o,s,r,a,l,c,u,h,d,m,g,p,A,v]}class vh extends oe{constructor(t){super(),ie(this,t,gh,ph,ne,{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},mh)}}function Ah(i){le(i,"svelte-86bqav",".floorplan-main.svelte-86bqav{width:100%;height:100%;pointer-events:none}")}function ps(i,t,e){const n=i.slice();return n[21]=t[e],n}function gs(i){let t,e,n,o,s,r=i[13].floorDatas,a=[];for(let h=0;h<r.length;h+=1)a[h]=vs(ps(i,r,h));const l=h=>D(a[h],1,1,()=>{a[h]=null});let c=i[5]&&As(i),u=i[8]&&bs(i);return{c(){t=B("div");for(let h=0;h<a.length;h+=1)a[h].c();e=$(),c&&c.c(),n=$(),u&&u.c(),y(t,"class","floorplan-main svelte-86bqav")},m(h,d){T(h,t,d);for(let m=0;m<a.length;m+=1)a[m].m(t,null);V(t,e),c&&c.m(t,null),V(t,n),u&&u.m(t,null),s=!0},p(h,d){if(i=h,d&2047696){r=i[13].floorDatas;let m;for(m=0;m<r.length;m+=1){const g=ps(i,r,m);a[m]?(a[m].p(g,d),C(a[m],1)):(a[m]=vs(g),a[m].c(),C(a[m],1),a[m].m(t,e))}for(se(),m=r.length;m<a.length;m+=1)l(m);re()}i[5]?c?(c.p(i,d),d&32&&C(c,1)):(c=As(i),c.c(),C(c,1),c.m(t,n)):c&&(se(),D(c,1,1,()=>{c=null}),re()),i[8]?u?(u.p(i,d),d&256&&C(u,1)):(u=bs(i),u.c(),C(u,1),u.m(t,null)):u&&(se(),D(u,1,1,()=>{u=null}),re())},i(h){if(!s){for(let d=0;d<r.length;d+=1)C(a[d]);C(c),C(u),o||Re(()=>{o=zt(t,St,{duration:i[0],easing:vt}),o.start()}),s=!0}},o(h){a=a.filter(Boolean);for(let d=0;d<a.length;d+=1)D(a[d]);D(c),D(u),s=!1},d(h){h&&M(t),ut(a,h),c&&c.d(),u&&u.d()}}}function vs(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 o={};for(let s=0;s<n.length;s+=1)o=Be(o,n[s]);return t=new vh({props:o}),{c(){K(t.$$.fragment)},m(s,r){J(t,s,r),e=!0},p(s,r){const a=r&2047696?Qe(n,[r&2047680&&{hoverEnable:s[6],highlightEnable:s[7],floorplanData:s[13],getRoomAreaText:s[16],getLabelElement:s[17],getRuleDistanceText:s[18],roomLabelsEnable:s[9],roomAreaEnable:s[10],roomNameEnable:s[11],ruleLabelsEnable:s[12],adaptiveRoomLabelVisibleEnable:s[19],highlightData:s[20]},r&8192&&{floorIndex:s[21].floorIndex},r&8208&&{isCurrent:s[21].floorIndex===s[4]}]):{};t.$set(a)},i(s){e||(C(t.$$.fragment,s),e=!0)},o(s){D(t.$$.fragment,s),e=!1},d(s){Z(t,s)}}}function As(i){let t,e;const n=[{panoIndex:i[3],floorplanData:i[13],lastPanoramaLongitude:i[14],cameraImageUrl:i[15]}];let o={};for(let s=0;s<n.length;s+=1)o=Be(o,n[s]);return t=new nd({props:o}),{c(){K(t.$$.fragment)},m(s,r){J(t,s,r),e=!0},p(s,r){const a=r&57352?Qe(n,[{panoIndex:s[3],floorplanData:s[13],lastPanoramaLongitude:s[14],cameraImageUrl:s[15]}]):{};t.$set(a)},i(s){e||(C(t.$$.fragment,s),e=!0)},o(s){D(t.$$.fragment,s),e=!1},d(s){Z(t,s)}}}function bs(i){let t,e;return t=new cd({props:{floorplanData:i[13],northDesc:i[2]}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&8192&&(s.floorplanData=n[13]),o&4&&(s.northDesc=n[2]),t.$set(s)},i(n){e||(C(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function bh(i){let t,e,n=i[1]&&gs(i);return{c(){n&&n.c(),t=pe()},m(o,s){n&&n.m(o,s),T(o,t,s),e=!0},p(o,[s]){o[1]?n?(n.p(o,s),s&2&&C(n,1)):(n=gs(o),n.c(),C(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(C(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function yh(i,t,e){let{duration:n=0}=t,{visible:o}=t,{northDesc:s}=t,{panoIndex:r}=t,{floorIndex:a}=t,{cameraEnable:l}=t,{hoverEnable:c}=t,{highlightEnable:u}=t,{compassEnable:h}=t,{roomLabelsEnable:d}=t,{roomAreaEnable:m}=t,{roomNameEnable:g}=t,{ruleLabelsEnable:p}=t,{floorplanData:A}=t,{lastPanoramaLongitude:v}=t,{cameraImageUrl:b}=t,{getRoomAreaText:w}=t,{getLabelElement:k}=t,{getRuleDistanceText:I}=t,{adaptiveRoomLabelVisibleEnable:P}=t,{highlightData:L}=t;return i.$$set=x=>{"duration"in x&&e(0,n=x.duration),"visible"in x&&e(1,o=x.visible),"northDesc"in x&&e(2,s=x.northDesc),"panoIndex"in x&&e(3,r=x.panoIndex),"floorIndex"in x&&e(4,a=x.floorIndex),"cameraEnable"in x&&e(5,l=x.cameraEnable),"hoverEnable"in x&&e(6,c=x.hoverEnable),"highlightEnable"in x&&e(7,u=x.highlightEnable),"compassEnable"in x&&e(8,h=x.compassEnable),"roomLabelsEnable"in x&&e(9,d=x.roomLabelsEnable),"roomAreaEnable"in x&&e(10,m=x.roomAreaEnable),"roomNameEnable"in x&&e(11,g=x.roomNameEnable),"ruleLabelsEnable"in x&&e(12,p=x.ruleLabelsEnable),"floorplanData"in x&&e(13,A=x.floorplanData),"lastPanoramaLongitude"in x&&e(14,v=x.lastPanoramaLongitude),"cameraImageUrl"in x&&e(15,b=x.cameraImageUrl),"getRoomAreaText"in x&&e(16,w=x.getRoomAreaText),"getLabelElement"in x&&e(17,k=x.getLabelElement),"getRuleDistanceText"in x&&e(18,I=x.getRuleDistanceText),"adaptiveRoomLabelVisibleEnable"in x&&e(19,P=x.adaptiveRoomLabelVisibleEnable),"highlightData"in x&&e(20,L=x.highlightData)},[n,o,s,r,a,l,c,u,h,d,m,g,p,A,v,b,w,k,I,P,L]}class wo extends oe{constructor(t){super(),ie(this,t,yh,bh,ne,{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},Ah)}}const wh="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 Eh(i){return H(this,null,function*(){const t=new Headers({"Content-Type":"text/plain"}),e=function(o){return H(this,null,function*(){const s={index:o.index,url:o.url,svgUrl:o.svg_url};if(o.svg_url){const r=yield fetch(o.svg_url,{headers:t}).then(a=>a.text());s.svgContent=r}return s})};return yield Promise.all(i.map(e))})}function Ph(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 Ch(i){return{floorName:i.floor_name,floorIndex:i.floor_index,rooms:i.rooms.map(Ph),rules:i.rules}}function Ih(i){return{index:i.index,floorIndex:i.floor_index,position:i.position,positionInImage:i.position_in_image}}function kh(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 yt(i){return H(this,null,function*(){const t=yield Eh(i.outlines),e=i.computed_data.bounding,n=i.computed_data.floor_datas.map(Ch),o=i.computed_data.entrance?kh(i.computed_data.entrance):null;return{outlines:t,entrance:o,bounding:e,floorDatas:n,observers:i.computed_data.observers.map(Ih)}})}function xh(i,t,e){return i.map(o=>{const s=o.position,r=o.icon?o.icon:{url:wh,width:45,height:48},a=_d(s,t),l=Gd(s,e),c=Wd(l,e);return{floorIndex:a,icon:r,id:o.id,position:l,positionInImage:c}})}function Dh(i,t){return t(i),i}function Ei(i,t){return Dh({},e=>{for(const n in i)t.indexOf(n)===-1&&(e[n]=i[n])})}function ys(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 Eo(i,t,e=pt.BOUNDING_CENTER){const n=ys(i,t),o=ys(i,t+1);return e===pt.BOUNDING_CENTER?(i.model.bounding.max.y+i.model.bounding.min.y)/2:e===pt.CEILING?o:n}function Po(i,t,e,n){const o=Eo(i,e,n==null?void 0:n.attachedTo),s=new E.Vector3(0,o,0),r=new E.Vector3(1,o,0),a=s.clone().project(i.camera),l=r.clone().project(i.camera);return Math.abs((l.x-a.x)/1e3)*(t.getBoundingClientRect().width/2)}class Dn{constructor(t,e){f(this,"VERSION","2.17.0-alpha.6");f(this,"five");f(this,"hooks",new Kt);f(this,"staticPrefix","//vrlab-static.ljcdn.com");this.five=t,e!=null&&e.staticPrefix&&(this.staticPrefix=e.staticPrefix)}getCurrentState(){return this.state}}class Bt extends Dn{}var _e=(i=>(i.UnknownError="UnknownError",i.DataNotLoaded="DataNotLoaded",i.BreakOffByHide="BreakOffByHide",i.BreakOffByDisable="BreakOffByDisable",i.ModelNotLoaded="ModelNotLoaded",i.ChangeModeError="ChangeModeError",i.UpdateCameraError="UpdateCameraError",i))(_e||{});const ol=500,Lh=80;function oo(i,t,e=4){return Math.floor(i*Math.pow(10,e))===Math.floor(t*Math.pow(10,e))}function sl(i,t){return H(this,null,function*(){yield new Promise((e,n)=>{i.changeMode(...t).catch(o=>n(o)),i.once("initAnimationEnded",()=>{const o=i.getCurrentState(),s=t[0];o.mode!==s&&n(new Error("mode \u4E0E\u9884\u671F\u4E0D\u7B26")),(()=>{const l=t[1];return l?Object.keys(l).every(c=>{const u=o[c];if(u===void 0)return!0;const h=l[c];return typeof u=="number"&&typeof h=="number"?oo(u,h,2):u===h}):!0})()||n(new Error("five pose \u4E0E\u9884\u671F\u4E0D\u7B26")),e()})})})}function Co(i,t){if(i.currentMode!==t.mode)return!1;const{latitude:e,longitude:n,fov:o}=t,{latitude:s,longitude:r}=i.getCurrentState(),a=i.camera.fov;return!(!oo(e,s,2)||!oo(n,r,2)||o!==a)}function rl(i,t,e=!0){return H(this,null,function*(){if(Co(i,t)===!0)return;const o=i.getCurrentState();if(o.mode!==t.mode){const[u]=yield ui(sl(i,[t.mode,t,void 0,e]));if(u)throw new Error(_e.ChangeModeError);return}const{latitude:s,longitude:r,fov:a}=o,l=Math.min(1e3,Math.max(200,Math.abs(s-Math.PI/2)*1e3,(r>Math.PI?2*Math.PI-r:r)*500,Math.abs(a-t.fov)*10)),[c]=yield ui(i.updateCamera(t,l,e));if(c)throw new Error(_e.UpdateCameraError)})}function qt(i,t,e=300){const n=i.getElement();!n||(n.style.opacity=t+"",n.style.transition=e===0?"none":`opacity ${e}ms linear`,e!==0&&Promise.race([new Promise(o=>n.addEventListener("transitionend",o,{once:!0})),new Promise(o=>setTimeout(o,e))]).then(()=>{n.style.transition="none"}))}function Mh(i){const{latitude:t,longitude:e}=i,n=Math.abs(t-Math.PI/2)>5*Math.PI/180,o=e>5*(Math.PI/180)&&e<355*(Math.PI/180);return n||o}function Sh(i){const{latitude:t,longitude:e}=i,n=Math.abs(t-Math.PI/2)<10*Math.PI/180,o=e<30*(Math.PI/180)||e>330*(Math.PI/180);return n&&o}class Th extends Bt{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)=>H(this,[...n],function*(e={}){if(!this.state.enabled||!this.showPromise&&this.state.visible)return;const o=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},o),this._show(e)}));f(this,"hide",(...n)=>H(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||!Co(this.five,this.showState)||!this.container||!this.wrapper)return;const{min:e,max:n}=this.data.bounding,o=n.x-e.x,s=n.y-e.y,r=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,a=Po(this.five,this.wrapper,this.floorIndex,r),l=Math.ceil(o*a),c=Math.ceil(s*a);this.size.width===l&&this.size.height===c||(this.container.style.width=l+"px",this.container.style.height=c+"px",this.size={width:l,height:c})});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 o,s,r;const{userAction:n}=e;this.hooks.emit("disable",{userAction:n}),(o=this.showRejection)==null||o.call(this,_e.BreakOffByDisable),this.showPromise=void 0,(s=this.app)==null||s.$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=>H(this,null,function*(){var r;if(!this.state.enabled)return;if(!((r=this.five.model)!=null&&r.loaded))throw new Error(_e.ModelNotLoaded);if(!this.data)throw new Error(_e.DataNotLoaded);this.isHiddenByHideFunc=!1;const n={floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},o=Q(Q({},n),e),s=()=>H(this,null,function*(){this.hooks.emit("show",{userAction:o.userAction,auto:o.isAutoShow});let a=!1,l;this.showRejection=d=>{a=!0,l=d};const[c]=yield ui(rl(this.five,this.showState,o.userAction));if(c)throw c;if(a)throw l?new Error(l):new Error(_e.UnknownError);this.updateSize(),this.floorIndex=o.floorIndex,this.five.model.show(this.floorIndex);const u=o.modelOpacity,h=o.immediately?0:ol;qt(this.five,u,h),this.render(h)});return this.showPromise=s().then(()=>{this.hooks.emit("showAnimationEnded",{auto:o.isAutoShow,userAction:o.userAction})}).catch(a=>{if(this.updateState({visible:!1},o.userAction),!o.isAutoShow&&a instanceof Error)throw a}).finally(()=>{this.showPromise=void 0,this.showRejection=void 0}),this.showPromise}));f(this,"_hide",e=>{var s;(s=this.showRejection)==null||s.call(this,_e.BreakOffByHide),this.showPromise=void 0;const o=Q(Q({},{userAction:!0,isAutoHide:!1}),e);qt(this.five,1,0),this.hooks.emit("hide",{auto:o.isAutoHide,userAction:o.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("\u4E0D\u6B63\u786E\u7684\u7236\u5BB9\u5668\u9009\u62E9\u5668");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 o=this.five.getCurrentState();o.mode==="Floorplan"&&(this.state.visible||Sh(o)&&(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 o=this.five.getCurrentState();Mh(o)&&(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("\u4E0D\u63A8\u8350\u7EE7\u7EED\u4F7F\u7528 params.selector \u914D\u7F6E\u7236\u5BB9\u5668\uFF0C\u8BF7\u4F7F\u7528 appendTo \u65B9\u6CD5")),this.showState={mode:"Floorplan",longitude:0,latitude:Math.PI/2,fov:Lh/((a=n==null?void 0:n.scale)!=null?a:1)};const o={northDesc:"\u5317",modelOpacity:1,cameraEnable:!0,highlightEnable:!1,hoverEnable:!0,compassEnable:!0,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,adaptiveRoomLabelVisibleEnable:!0,cameraImageUrl:bt,attachedTo:pt.BOUNDING_CENTER,getLabelElement:void 0,getRoomAreaText:l=>(l/1e6).toFixed(1)+"\u33A1",getRuleDistanceText:l=>l.toString()},s=n?Ei(n,["selector","scale"]):{},r=Q(Q({},o),s);this.state={enabled:!0,visible:!1,config:r},this.initContainer(),e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}load(e,n,o=!0){return H(this,null,function*(){function s(u){return Object.prototype.hasOwnProperty.apply(u,["version"])}const r=e;r&&!r.version&&console.warn("\u4F20\u5165 serverData.data \u7684\u65B9\u5F0F\u540E\u7EED\u53EF\u80FD\u4E0D\u518D\u652F\u6301\uFF0C\u8BF7\u628A serverData \u6574\u4F53\u4F20\u5165 load \u51FD\u6570");const a=JSON.parse(JSON.stringify(e)),l=s(a)?a.data:a,c=this.data;this.data=yield yt(l),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,c),n&&this.updateState(n,o),this.render()})}appendTo(e){if(this.wrapper=e,!!this.state.enabled)return e.appendChild(this.container),this.render(),this}enable(e={}){if(this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||n),this._enable({userAction:n})}disable(e={}){if(!this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||n),this._disable({userAction:n})}setState(e,n={}){const o=this.state,s=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,s),e.enabled!==void 0&&o.enabled!==e.enabled&&(e.enabled?this._enable({userAction:s}):this._disable({userAction:s})),e.visible!==void 0&&o.visible!==e.visible){const r={userAction:s};e.visible?this._show(r):this._hide(r)}this.render()}changeConfigs(e,n=!0){this.updateState({config:e},n),this.render()}formatData(e){return H(this,null,function*(){return yield yt(e.data)})}updateState(e,n){const o=this.state,s=e.config?Q(Q({},o.config),e.config):o.config;this.state=fe(Q(Q({},this.state),e),{config:s}),!it(this.state,o,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n})}initContainer(){this.container.classList.add("floorplan-plugin"),Object.assign(this.container.style,{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",zIndex:10,pointerEvents:"none"}),this.five.addExtraElement(this.container)}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;const e=this.five;e.on("modeChange",this.onFiveModeChange),e.on("interiaPan",this.onFiveInteriaPan),e.on("panoArrived",this.onFivePanoArrived),e.on("cameraUpdate",this.onFiveCameraUpdate),e.on("wantsGesture",this.onFiveWantsGesture),e.on("wantsPanGesture",this.onFiveWantsPanGesture),e.on("wantsTapGesture",this.onFiveWantsTapGesture),e.on("wantsChangeMode",this.onFiveWantsChangeMode),e.on("modelShownFloorChange",this.onModelShownFloorChange)}removeEventListener(){const e=this.five;this.hasAddedEventListener=!1,e.off("modelLoaded",this.onFiveModelLoaded),e.off("modeChange",this.onFiveModeChange),e.off("interiaPan",this.onFiveInteriaPan),e.off("panoArrived",this.onFivePanoArrived),e.off("cameraUpdate",this.onFiveCameraUpdate),e.off("wantsGesture",this.onFiveWantsGesture),e.off("wantsPanGesture",this.onFiveWantsPanGesture),e.off("wantsTapGesture",this.onFiveWantsTapGesture),e.off("wantsChangeMode",this.onFiveWantsChangeMode),e.off("modelShownFloorChange",this.onModelShownFloorChange)}render(e){if(!this.state.enabled||!this.container||!this.data||this.size.width===0)return;const n=fe(Q({},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 wo({target:this.container,intro:!0,props:n})}}const zh=(i,t)=>new Th(i,t);function Bh(i){const{latitude:t,longitude:e}=i,n=Math.abs(t-Math.PI/2)>5*Math.PI/180,o=e>5*(Math.PI/180)&&e<355*(Math.PI/180);return n||o}function Vh(i){const{latitude:t,longitude:e}=i,n=Math.abs(t-Math.PI/2)<10*Math.PI/180,o=e<30*(Math.PI/180)||e>330*(Math.PI/180);return n&&o}class jh extends Bt{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)=>H(this,[...n],function*(e={}){if(!this.state.enabled||!this.showPromise&&this.state.visible)return;const o=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},o),this._show(e)}));f(this,"hide",(...n)=>H(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||!Co(this.five,this.showState)||!this.container||!this.wrapper)return;const{min:e,max:n}=this.data.bounding,o=n.x-e.x,s=n.y-e.y,r=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,a=Po(this.five,this.wrapper,this.floorIndex,r),l=Math.ceil(o*a),c=Math.ceil(s*a);this.size.width===l&&this.size.height===c||(this.container.style.width=l+"px",this.container.style.height=c+"px",this.size={width:l,height:c})});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 o,s,r;const{userAction:n}=e;this.hooks.emit("disable",{userAction:n}),(o=this.showRejection)==null||o.call(this,_e.BreakOffByDisable),this.showPromise=void 0,(s=this.app)==null||s.$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=>H(this,null,function*(){var r;if(!this.state.enabled)return;if(!((r=this.five.model)!=null&&r.loaded))throw new Error(_e.ModelNotLoaded);if(!this.data)throw new Error(_e.DataNotLoaded);this.isHiddenByHideFunc=!1;const n={floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},o=Q(Q({},n),e),s=()=>H(this,null,function*(){this.hooks.emit("show",{userAction:o.userAction,auto:o.isAutoShow});let a=!1,l;this.showRejection=d=>{a=!0,l=d};const[c]=yield ui(rl(this.five,this.showState,o.userAction));if(c)throw c;if(a)throw l?new Error(l):new Error(_e.UnknownError);this.updateSize(),this.updatePosition(),this.floorIndex=o.floorIndex,this.five.model.show(this.floorIndex);const u=o.modelOpacity,h=o.immediately?0:ol;qt(this.five,u,h),this.render(h)});return this.showPromise=s().then(()=>{this.hooks.emit("showAnimationEnded",{auto:o.isAutoShow,userAction:o.userAction})}).catch(a=>{if(this.updateState({visible:!1},o.userAction),!o.isAutoShow&&a instanceof Error)throw a}).finally(()=>{this.showPromise=void 0,this.showRejection=void 0}),this.showPromise}));f(this,"_hide",e=>{var s;(s=this.showRejection)==null||s.call(this,_e.BreakOffByHide),this.showPromise=void 0;const o=Q(Q({},{userAction:!0,isAutoHide:!1}),e);qt(this.five,1,0),this.hooks.emit("hide",{auto:o.isAutoHide,userAction:o.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("\u4E0D\u6B63\u786E\u7684\u7236\u5BB9\u5668\u9009\u62E9\u5668");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 o=this.five.getCurrentState();this.updatePosition(),this.updateSize(),Bh(o)&&(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 o=this.five.getCurrentState();return o.mode!==this.showState.mode||this.state.visible?void 0:(Vh(o)&&(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("\u4E0D\u63A8\u8350\u7EE7\u7EED\u4F7F\u7528 params.selector \u914D\u7F6E\u7236\u5BB9\u5668\uFF0C\u8BF7\u4F7F\u7528 appendTo \u65B9\u6CD5")),this.showState={mode:"Mapview",longitude:0,latitude:Math.PI/2,fov:90};const o={northDesc:"\u5317",modelOpacity:1,cameraEnable:!0,highlightEnable:!1,hoverEnable:!0,compassEnable:!0,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,cameraImageUrl:bt,attachedTo:pt.BOUNDING_CENTER,getLabelElement:void 0,adaptiveRoomLabelVisibleEnable:!0,getRoomAreaText:a=>(a/1e6).toFixed(1)+"\u33A1",getRuleDistanceText:a=>a.toString()},s=n?Ei(n,["selector","scale"]):{},r=Q(Q({},o),s);this.state={enabled:!0,visible:!1,config:r},this.initContainer(),e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}load(e,n,o=!0){return H(this,null,function*(){function s(u){return Object.prototype.hasOwnProperty.apply(u,["version"])}const r=e;r&&!r.version&&console.warn("\u4F20\u5165 serverData.data \u7684\u65B9\u5F0F\u540E\u7EED\u53EF\u80FD\u4E0D\u518D\u652F\u6301\uFF0C\u8BF7\u628A serverData \u6574\u4F53\u4F20\u5165 load \u51FD\u6570");const a=JSON.parse(JSON.stringify(e)),l=s(a)?a.data:a,c=this.data;this.data=yield yt(l),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,c),n&&this.updateState(n,o),this.render()})}appendTo(e){if(this.wrapper=e,!!this.state.enabled)return e.appendChild(this.container),this.render(),this}enable(e={}){if(this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||n),this._enable({userAction:n})}disable(e={}){if(!this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||n),this._disable({userAction:n})}setState(e,n={}){const o=this.state,s=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,s),e.enabled!==void 0&&o.enabled!==e.enabled&&(e.enabled?this._enable({userAction:s}):this._disable({userAction:s})),e.visible!==void 0&&o.visible!==e.visible){const r={userAction:s};e.visible?this._show(r):this._hide(r)}}changeConfigs(e,n=!0){this.updateState({config:e},n),this.render()}updatePosition(){var a;const e=Eo(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 o=n.clone().project(this.five.camera),s=(o.x+1)/2,r=-(o.y-1)/2;this.container.style.left=s*100+"%",this.container.style.top=r*100+"%"}formatData(e){return H(this,null,function*(){return yield yt(e.data)})}updateState(e,n){const o=this.state,s=e.config?Q(Q({},o.config),e.config):o.config;this.state=fe(Q(Q({},this.state),e),{config:s}),!it(this.state,o,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n})}initContainer(){this.container.classList.add("floorplan-plugin"),Object.assign(this.container.style,{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",zIndex:10,pointerEvents:"none"}),this.five.addExtraElement(this.container)}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;const e=this.five;e.on("modeChange",this.onFiveModeChange),e.on("panoArrived",this.onFivePanoArrived),e.on("cameraUpdate",this.onFiveCameraUpdate),e.on("wantsPanGesture",this.onFiveWantsPanGesture),e.on("wantsTapGesture",this.onFiveWantsTapGesture),e.on("wantsChangeMode",this.onFiveWantsChangeMode),e.on("modelShownFloorChange",this.onModelShownFloorChange)}removeEventListener(){const e=this.five;this.hasAddedEventListener=!1,e.off("modelLoaded",this.onFiveModelLoaded),e.off("modeChange",this.onFiveModeChange),e.off("panoArrived",this.onFivePanoArrived),e.off("cameraUpdate",this.onFiveCameraUpdate),e.off("wantsPanGesture",this.onFiveWantsPanGesture),e.off("wantsTapGesture",this.onFiveWantsTapGesture),e.off("wantsChangeMode",this.onFiveWantsChangeMode),e.off("modelShownFloorChange",this.onModelShownFloorChange)}render(e){if(!this.state.enabled||!this.container||!this.data||this.size.width===0)return;const n=fe(Q({},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 wo({target:this.container,intro:!0,props:n})}}const Oh=(i,t)=>new jh(i,t);class Rh extends Bt{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,o=n.x-e.x,s=n.y-e.y,r=this.state.config.attachedTo?{attachedTo:this.state.config.attachedTo}:void 0,a=Po(this.five,this.wrapper,this.floorIndex,r),l=Math.ceil(o*a),c=Math.ceil(s*a);this.size.width===l&&this.size.height===c||(this.container.style.width=l+"px",this.container.style.height=c+"px",this.size={width:l,height:c})});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 o,s;const{userAction:n}=e;(o=this.app)==null||o.$destroy(),this.app=void 0,(s=this.container)==null||s.remove(),this.removeEventListener(),this.hooks.emit("disable",{userAction:n})});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("\u4E0D\u6B63\u786E\u7684\u7236\u5BB9\u5668\u9009\u62E9\u5668");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("\u4E0D\u63A8\u8350\u7EE7\u7EED\u4F7F\u7528 params.selector \u914D\u7F6E\u7236\u5BB9\u5668\uFF0C\u8BF7\u4F7F\u7528 appendTo \u65B9\u6CD5"));const o={northDesc:"\u5317",modelOpacity:1,cameraEnable:!0,hoverEnable:!0,highlightEnable:!1,compassEnable:!0,gestureEnable:!1,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,roomAreaEnable:!0,roomNameEnable:!0,cameraImageUrl:bt,attachedTo:pt.BOUNDING_CENTER,getLabelElement:void 0,adaptiveRoomLabelVisibleEnable:!0,getRoomAreaText:a=>(a/1e6).toFixed(1)+"\u33A1",getRuleDistanceText:a=>a.toString()},s=n?Ei(n,["selector","scale"]):{},r=Q(Q({},o),s);this.state={enabled:!0,visible:!1,config:r},this.initContainer(),e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}load(e,n,o=!0){return H(this,null,function*(){function s(u){return Object.prototype.hasOwnProperty.apply(u,["version"])}const r=e;r&&!r.version&&console.warn("\u4F20\u5165 serverData.data \u7684\u65B9\u5F0F\u540E\u7EED\u53EF\u80FD\u4E0D\u518D\u652F\u6301\uFF0C\u8BF7\u628A serverData \u6574\u4F53\u4F20\u5165 load \u51FD\u6570");const a=JSON.parse(JSON.stringify(e)),l=s(a)?a.data:a,c=this.data;this.data=yield yt(l),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,c),n&&this.updateState(n,o),this.render()})}updatePosition(){var a;const e=Eo(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 o=n.clone().project(this.five.camera),s=(o.x+1)/2,r=-(o.y-1)/2;this.container.style.left=s*100+"%",this.container.style.top=r*100+"%"}appendTo(e){if(this.wrapper=e,!!this.state.enabled)return e.appendChild(this.container),this.render(),this}show(){return H(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 H(this,arguments,function*(e={}){if(this.isHiddenByHideFunc=!0,!this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!1},n),this._hide({userAction:n})})}enable(e={}){if(this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||n),this._enable({userAction:n})}disable(e={}){if(!this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||n),this._disable({userAction:n})}setState(e,n={}){const o=this.state,s=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,s),e.enabled!==void 0&&o.enabled!==e.enabled){const r={userAction:s};e.enabled?this._enable(r):this._disable(r)}if(e.visible!==void 0&&o.visible!==e.visible){const r={userAction:s};e.visible?this._show(r):this._hide(r)}}changeConfigs(e,n=!0){this.updateState({config:e},n),this.render()}formatData(e){return H(this,null,function*(){return yield yt(e.data)})}_show(e){return H(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 sl(this.five,["Topview",void 0,void 0,n])),this.five.model.show(this.floorIndex),this.updatePosition(),this.updateSize();const o=500,s=this.state.config.modelOpacity;qt(this.five,s,o),this.hooks.emit("showAnimationEnded",{userAction:n,auto:!1}),this.render()})}_hide(e){return H(this,null,function*(){if(!this.state.enabled)return;const{userAction:n}=e;this.hooks.emit("hide",{userAction:n,auto:!1});const o=1,s=0;qt(this.five,o,s),this.render()})}_enable(e){const{userAction:n}=e;this.addEventListener(),this.wrapper&&this.wrapper.append(this.container),this.hooks.emit("enable",{userAction:n}),this.state.visible&&this._show({userAction:n})}updateState(e,n){const o=this.state,s=e.config?Q(Q({},o.config),e.config):o.config;this.state=fe(Q(Q({},this.state),e),{config:s}),!it(this.state,o,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n})}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;const e=this.five;e.on("modeChange",this.onFiveModeChange),e.on("panoArrived",this.onFivePanoArrived),e.on("cameraUpdate",this.onFiveCameraUpdate),e.on("wantsGesture",this.onFiveWantsGesture),e.on("wantsMoveToPano",this.onFiveWantsMoveToPano),e.on("initAnimationEnded",this.onFiveInitAnimationEnded),e.on("modelShownFloorChange",this.onModelShownFloorChange)}removeEventListener(){const e=this.five;this.hasAddedEventListener=!1,e.off("modeChange",this.onFiveModeChange),e.off("panoArrived",this.onFivePanoArrived),e.off("cameraUpdate",this.onFiveCameraUpdate),e.off("wantsGesture",this.onFiveWantsGesture),e.off("wantsMoveToPano",this.onFiveWantsMoveToPano),e.off("initAnimationEnded",this.onFiveInitAnimationEnded),e.off("modelShownFloorChange",this.onModelShownFloorChange)}initContainer(){this.container.classList.add("floorplan-plugin"),Object.assign(this.container.style,{position:"absolute",left:"50%",top:"50%",transform:"translate3d(-50%, -50%, 10px)",zIndex:10,pointerEvents:"none","will-change":"width, height"}),this.five.addExtraElement(this.container)}render(e){if(!this.state.enabled||!this.container||!this.data||this.size.width===0)return;const n=fe(Q({},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 wo({target:this.container,intro:!0,props:n})}}const Qh=(i,t)=>new Rh(i,t);function Io(i,t=200){let e;return function(...n){e||(i(...n),e=setTimeout(function(){e=null},t))}}function Fh(i){le(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 Hh(i){let t,e,n;return{c(){t=B("div"),e=B("div"),n=B("div"),y(n,"class","plugin-radar__camera-rotate svelte-1nqrlxd"),z(n,"background-image","url("+(i[0]||bt)+")"),z(n,"transform",i[1]),y(e,"class","plugin-radar__camera-position svelte-1nqrlxd"),z(e,"transform",i[2]),y(t,"class","plugin-radar__camera-wrapper svelte-1nqrlxd")},m(o,s){T(o,t,s),V(t,e),V(e,n)},p(o,[s]){s&1&&z(n,"background-image","url("+(o[0]||bt)+")"),s&2&&z(n,"transform",o[1]),s&4&&z(e,"transform",o[2])},i:X,o:X,d(o){o&&M(t)}}}function Gh(i){return`rotate(${Math.floor(i/Math.PI*180)*-1+45}deg)`}function Wh(i,t,e){let n,o,{five:s}=t,{pxmm:r}=t,{floorplanData:a}=t,{cameraImageUrl:l}=t,c=s.getCurrentState().panoIndex,u=s.getCurrentState().longitude;function h(g,p){const A=g.bounding,v=g.observers[p];if(!v)return"";const b=(A.max.x-A.min.x)*r,w=(A.max.y-A.min.y)*r,k=Math.floor(v.positionInImage.x*b),I=Math.floor(v.positionInImage.y*w);return`translate(${k}px, ${I}px)`}function d(g){e(6,c=g)}const m=Io(g=>{e(7,u=g.longitude)},1e3/60);return Ze(()=>(s.on("panoWillArrive",d),s.on("cameraDirectionUpdate",m),function(){s.off("panoWillArrive",d),s.off("cameraDirectionUpdate",m)})),i.$$set=g=>{"five"in g&&e(3,s=g.five),"pxmm"in g&&e(4,r=g.pxmm),"floorplanData"in g&&e(5,a=g.floorplanData),"cameraImageUrl"in g&&e(0,l=g.cameraImageUrl)},i.$$.update=()=>{i.$$.dirty&96&&e(2,n=h(a,c)),i.$$.dirty&128&&e(1,o=Gh(u))},[l,o,n,s,r,a,c,u]}class _h extends oe{constructor(t){super(),ie(this,t,Wh,Hh,ne,{five:3,pxmm:4,floorplanData:5,cameraImageUrl:0},Fh)}}function Nh(i){le(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 ws(i,t,e){const n=i.slice();return n[1]=t[e],n}function Es(i,t){let e,n,o=`${t[1].icon.width/16}rem`,s=`${t[1].icon.height/16}rem`,r,a=`${t[1].positionInImage.y*100}%`,l=`${t[1].positionInImage.x*100}%`;return{key:i,first:null,c(){e=B("div"),n=B("div"),r=$(),y(n,"class","plugin-pano-floorplan__extra-object-item svelte-1i87fz7"),z(n,"background-image",`url(${t[1].icon.url})`),z(n,"width",o),z(n,"height",s),y(e,"class","plugin-pano-floorplan__extra-object-item--position svelte-1i87fz7"),z(e,"top",a),z(e,"left",l),this.first=e},m(c,u){T(c,e,u),V(e,n),V(e,r)},p(c,u){t=c,u&1&&z(n,"background-image",`url(${t[1].icon.url})`),u&1&&o!==(o=`${t[1].icon.width/16}rem`)&&z(n,"width",o),u&1&&s!==(s=`${t[1].icon.height/16}rem`)&&z(n,"height",s),u&1&&a!==(a=`${t[1].positionInImage.y*100}%`)&&z(e,"top",a),u&1&&l!==(l=`${t[1].positionInImage.x*100}%`)&&z(e,"left",l)},d(c){c&&M(e)}}}function Xh(i){let t,e=[],n=new Map,o=i[0];const s=r=>r[1].id;for(let r=0;r<o.length;r+=1){let a=ws(i,o,r),l=s(a);n.set(l,e[r]=Es(l,a))}return{c(){t=B("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){T(r,t,a);for(let l=0;l<e.length;l+=1)e[l].m(t,null)},p(r,[a]){a&1&&(o=r[0],e=Ke(e,a,s,1,r,o,n,t,Ao,Es,null,ws))},i:X,o:X,d(r){r&&M(t);for(let a=0;a<e.length;a+=1)e[a].d()}}}function Yh(i,t,e){let{extraObjects:n=[]}=t;return i.$$set=o=>{"extraObjects"in o&&e(0,n=o.extraObjects)},[n]}class Uh extends oe{constructor(t){super(),ie(this,t,Yh,Xh,ne,{extraObjects:0},Nh)}}function Ps(i){let t,e;const n=[{five:i[0],pxmm:i[1],floorIndex:i[2],floorplanData:i[4],onRoomHeightClick:i[7],highlightData:i[5]}];let o={};for(let s=0;s<n.length;s+=1)o=Be(o,n[s]);return t=new il({props:o}),{c(){K(t.$$.fragment)},m(s,r){J(t,s,r),e=!0},p(s,r){const a=r&183?Qe(n,[{five:s[0],pxmm:s[1],floorIndex:s[2],floorplanData:s[4],onRoomHeightClick:s[7],highlightData:s[5]}]):{};t.$set(a)},i(s){e||(C(t.$$.fragment,s),e=!0)},o(s){D(t.$$.fragment,s),e=!1},d(s){Z(t,s)}}}function qh(i){let t,e,n,o,s,r;const a=[{floorIndex:i[2],floorplanData:i[4]}];let l={};for(let u=0;u<a.length;u+=1)l=Be(l,a[u]);t=new tl({props:l}),n=new Uh({props:{extraObjects:i[6]}});let c=i[3]&&Ps(i);return{c(){K(t.$$.fragment),e=$(),K(n.$$.fragment),o=$(),c&&c.c(),s=pe()},m(u,h){J(t,u,h),T(u,e,h),J(n,u,h),T(u,o,h),c&&c.m(u,h),T(u,s,h),r=!0},p(u,[h]){const d=h&20?Qe(a,[{floorIndex:u[2],floorplanData:u[4]}]):{};t.$set(d);const m={};h&64&&(m.extraObjects=u[6]),n.$set(m),u[3]?c?(c.p(u,h),h&8&&C(c,1)):(c=Ps(u),c.c(),C(c,1),c.m(s.parentNode,s)):c&&(se(),D(c,1,1,()=>{c=null}),re())},i(u){r||(C(t.$$.fragment,u),C(n.$$.fragment,u),C(c),r=!0)},o(u){D(t.$$.fragment,u),D(n.$$.fragment,u),D(c),r=!1},d(u){Z(t,u),u&&M(e),Z(n,u),u&&M(o),c&&c.d(u),u&&M(s)}}}function Jh(i,t,e){let n,{five:o}=t,{pxmm:s}=t,{floorIndex:r}=t,{hoverEnable:a}=t,{floorplanData:l}=t,{extraObjects:c=[]}=t,{highlightData:u}=t;const h=void 0;return i.$$set=d=>{"five"in d&&e(0,o=d.five),"pxmm"in d&&e(1,s=d.pxmm),"floorIndex"in d&&e(2,r=d.floorIndex),"hoverEnable"in d&&e(3,a=d.hoverEnable),"floorplanData"in d&&e(4,l=d.floorplanData),"extraObjects"in d&&e(8,c=d.extraObjects),"highlightData"in d&&e(5,u=d.highlightData)},i.$$.update=()=>{i.$$.dirty&260&&e(6,n=c==null?void 0:c.filter(d=>d.floorIndex===r))},[o,s,r,a,l,u,n,h,c]}class Zh extends oe{constructor(t){super(),ie(this,t,Jh,qh,ne,{five:0,pxmm:1,floorIndex:2,hoverEnable:3,floorplanData:4,extraObjects:8,highlightData:5})}}function Kh(i){le(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 Cs(i){let t,e,n,o,s=i[7]!==0&&Is(i);return{c(){t=B("div"),s&&s.c(),y(t,"class","plugin-floorplan-radar svelte-1mvqyqq")},m(r,a){T(r,t,a),s&&s.m(t,null),e=!0,n||(o=[ct(ln.call(null,t)),me(t,"clientWidth",i[13]),me(t,"clientHeight",i[14])],n=!0)},p(r,a){r[7]!==0?s?(s.p(r,a),a&128&&C(s,1)):(s=Is(r),s.c(),C(s,1),s.m(t,null)):s&&(se(),D(s,1,1,()=>{s=null}),re())},i(r){e||(C(s),e=!0)},o(r){D(s),e=!1},d(r){r&&M(t),s&&s.d(),n=!1,He(o)}}}function Is(i){let t,e,n,o,s=`${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 d=0;d<l.length;d+=1)c=Be(c,l[d]);e=new Zh({props:c});const u=[{pxmm:i[10],five:i[0],floorplanData:i[3],cameraImageUrl:i[4]}];let h={};for(let d=0;d<u.length;d+=1)h=Be(h,u[d]);return o=new _h({props:h}),{c(){t=B("div"),K(e.$$.fragment),n=$(),K(o.$$.fragment),y(t,"class","plugin-floorplan-radar-container svelte-1mvqyqq"),z(t,"width",s),z(t,"height",r)},m(d,m){T(d,t,m),J(e,t,null),V(t,n),J(o,t,null),a=!0},p(d,m){const g=m&3181?Qe(l,[{five:d[0],pxmm:d[10],floorIndex:d[11],floorplanData:d[3],hoverEnable:d[2],extraObjects:d[5],highlightData:d[6]}]):{};e.$set(g);const p=m&1049?Qe(u,[{pxmm:d[10],five:d[0],floorplanData:d[3],cameraImageUrl:d[4]}]):{};o.$set(p),m&512&&s!==(s=`${d[9]}px`)&&z(t,"width",s),m&4096&&r!==(r=`${d[12]}px`)&&z(t,"height",r)},i(d){a||(C(e.$$.fragment,d),C(o.$$.fragment,d),a=!0)},o(d){D(e.$$.fragment,d),D(o.$$.fragment,d),a=!1},d(d){d&&M(t),Z(e),Z(o)}}}function $h(i){let t,e,n=i[1]&&Cs(i);return{c(){n&&n.c(),t=pe()},m(o,s){n&&n.m(o,s),T(o,t,s),e=!0},p(o,[s]){o[1]?n?(n.p(o,s),s&2&&C(n,1)):(n=Cs(o),n.c(),C(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(C(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function ef(i,t,e){var w,k;let{five:n}=t,{visible:o}=t,{hoverEnable:s}=t,{floorplanData:r}=t,{cameraImageUrl:a}=t,{extraObjects:l=[]}=t,{highlightData:c}=t,u=0,h=(k=(w=n.work.observers[n.getCurrentState().panoIndex])==null?void 0:w.floorIndex)!=null?k:0,d=0,m=0,g=0,p=0;function A(I){e(11,h=n.work.observers[I].floorIndex)}Ze(()=>(n.on("panoArrived",A),()=>{n.off("panoArrived",A)}));const v=I=>{e(7,d=I.detail)},b=I=>{e(8,m=I.detail)};return i.$$set=I=>{"five"in I&&e(0,n=I.five),"visible"in I&&e(1,o=I.visible),"hoverEnable"in I&&e(2,s=I.hoverEnable),"floorplanData"in I&&e(3,r=I.floorplanData),"cameraImageUrl"in I&&e(4,a=I.cameraImageUrl),"extraObjects"in I&&e(5,l=I.extraObjects),"highlightData"in I&&e(6,c=I.highlightData)},i.$$.update=()=>{if(i.$$.dirty&904){const I=Math.min(d,m),{max:P,min:L}=r.bounding,x=P.x-L.x,F=P.y-L.y,N=function(){return x>F?[I,I/x*F]:[I/F*x,I]}();e(9,g=N[0]),e(12,p=N[1]),e(10,u=g/x)}},[n,o,s,r,a,l,c,d,m,g,u,h,p,v,b]}class tf extends oe{constructor(t){super(),ie(this,t,ef,$h,ne,{five:0,visible:1,hoverEnable:2,floorplanData:3,cameraImageUrl:4,extraObjects:5,highlightData:6},Kh)}}class nf extends Bt{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 o;const{userAction:n}=e;(o=this.app)==null||o.$destroy(),this.app=void 0,this.hooks.emit("disable",{userAction:n})});this.five=e;const o={hoverEnable:!0,highlightEnable:!0,cameraImageUrl:bt},s=n!=null&&n.configs?n.configs:{},r=Q(Q({},o),s);this.state={enabled:!0,visible:!0,config:r},n!=null&&n.wrapper&&console.warn("\u4E0D\u63A8\u8350\u7EE7\u7EED\u4F7F\u7528 params.selector \u914D\u7F6E\u7236\u5BB9\u5668\uFF0C\u8BF7\u4F7F\u7528 appendTo \u65B9\u6CD5"),typeof(n==null?void 0:n.wrapper)=="string"?this.wrapperSelector=n.wrapper:(n==null?void 0:n.wrapper)instanceof Element&&(this.wrapper=n.wrapper),e.once("dispose",this.dispose)}load(e,n,o=!0){return H(this,null,function*(){function s(c){return Object.prototype.hasOwnProperty.apply(c,["version"])}const r=JSON.parse(JSON.stringify(e)),a=s(r)?r.data:r,l=this.data;this.data=yield yt(a),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,l),n&&this.updateState(n,o),this.render()})}show(){return H(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 H(this,arguments,function*(e={}){if(!this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!1},n),this._hide({userAction:n})})}enable(e={}){if(this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||n),this._enable({userAction:n})}disable(e={}){if(!this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||n),this._disable({userAction:n})}setState(e,n={}){const o=this.state,s=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,s),e.enabled!==void 0&&o.enabled!==e.enabled){const r={userAction:s};e.enabled?this._enable(r):this._disable(r)}if(e.visible!==void 0&&o.visible!==e.visible){const r={userAction:s};e.visible?this._show(r):this._hide(r)}}appendTo(e){this.wrapper=e,this.render()}changeConfigs(e,n=!0){this.setState({config:e},{userAction:n}),this.render()}setExtraObjectsWith3DPositions(e){!this.data||(this.extraObjects=xh(e,this.five,this.data),this.render())}formatData(e){return H(this,null,function*(){return yield yt(e.data)})}_enable(e){const{userAction:n}=e;this.hooks.emit("enable",{userAction:n}),this.state.visible&&this._show({userAction:n})}_show(e){if(this.disposed||!this.state.enabled)return;const{userAction:n}=e;this.hooks.emit("show",{userAction:n}),this.render()}_hide(e){if(this.disposed||!this.state.enabled)return;const{userAction:n}=e;this.hooks.emit("hide",{userAction:n}),this.render()}updateState(e,n){const o=this.state;this.state=Q(Q({},this.state),e),!it(this.state,o,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n})}render(){if(this.disposed||!this.state.enabled)return;if(!this.wrapper&&this.wrapperSelector){const n=document.querySelector(this.wrapperSelector);this.wrapper=n}if(!this.data||!this.wrapper)return;const e=fe(Q({},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 tf({target:this.wrapper,props:e})}}const of=(i,t)=>new nf(i,t),sf=[{type:0,floorType:1,roomType:"100900000012",name:"\u5176\u4ED6"},{type:1,floorType:1,roomType:"100900000002",name:"\u5BA2\u5385"},{type:2,floorType:1,roomType:"100900000002",name:"\u9910\u5385"},{type:3,floorType:0,roomType:"100900000001",name:"\u5367\u5BA4"},{type:4,floorType:0,roomType:"100900000001",name:"\u4E66\u623F"},{type:5,floorType:3,roomType:"100900000004",name:"\u536B\u751F\u95F4"},{type:6,floorType:3,roomType:"100900000004",name:"\u6DCB\u6D74\u95F4"},{type:7,floorType:3,roomType:"100900000004",name:"\u6D17\u624B\u95F4"},{type:8,floorType:3,roomType:"100900000003",name:"\u53A8\u623F"},{type:9,floorType:1,roomType:"100900000003",name:"\u5F00\u653E\u53A8\u623F",onlySubArea:!0},{type:10,floorType:0,roomType:"100900000001",name:"\u591A\u529F\u80FD\u95F4"},{type:11,floorType:0,roomType:"100900000009",name:"\u4FDD\u59C6\u95F4"},{type:12,floorType:4,roomType:"100900000005",name:"\u9633\u53F0"},{type:13,floorType:4,roomType:"100900000006",name:"\u9732\u53F0"},{type:14,floorType:0,roomType:"100900000008",name:"\u50A8\u7269\u95F4"},{type:15,floorType:0,roomType:"100900000013",name:"\u8863\u5E3D\u95F4"},{type:16,floorType:0,roomType:"100900000011",name:"\u9601\u697C"},{type:17,floorType:2,roomType:"100900000007",name:"\u82B1\u56ED"},{type:18,floorType:5,roomType:"100900000010",name:"\u8F66\u5E93"},{type:19,floorType:1,roomType:"100900000012",name:"\u7535\u68AF"},{type:20,floorType:1,roomType:"100900000012",name:"\u5730\u4E0B\u5BA4"},{type:21,floorType:1,roomType:"100900000012",name:"\u5929\u4E95"},{type:22,floorType:1,roomType:"100900000012",name:"\u9633\u5149\u623F"},{type:23,floorType:1,roomType:"100900000012",name:"\u8FC7\u9053"},{type:24,floorType:1,roomType:"100900000012",name:"\u697C\u68AF\u95F4"},{type:25,floorType:1,roomType:"100900000012",name:"\u95E8\u5385"},{type:26,floorType:2,roomType:"100900000012",name:"\u5165\u6237\u82B1\u56ED"},{type:27,floorType:1,roomType:"100900000012",name:"\u7384\u5173"},{type:28,floorType:1,roomType:"100900000012",name:"\u6311\u7A7A"},{type:29,floorType:4,roomType:"100900000012",name:"\u667E\u6652\u533A"},{type:30,floorType:4,roomType:"100900000012",name:"\u6D17\u8863\u623F"},{type:31,floorType:0,roomType:"100900000012",name:"\u5A31\u4E50\u533A"},{type:32,floorType:0,roomType:"100900000012",name:"\u5065\u8EAB\u533A"},{type:33,floorType:0,roomType:"100900000012",name:"\u63A5\u5F85\u533A"},{type:34,floorType:0,roomType:"100900000012",name:"\u5F71\u97F3\u533A"},{type:35,floorType:1,roomType:"100900000012",name:"\u9910\u996E\u533A"},{type:36,floorType:1,roomType:"100900000012",name:"\u5176\u4ED6",onlySubArea:!0},{type:37,floorType:1,roomType:"100900000002",name:"\u8D77\u5C45\u5BA4"},{type:38,floorType:0,roomType:"100900000001",name:"\u4E3B\u5367"},{type:39,floorType:0,roomType:"100900000001",name:"\u6B21\u5367"},{type:40,floorType:0,roomType:"100900000001",name:"\u4F18\u5316\u95F4"},{type:41,floorType:0,roomType:"100900000001",name:"\u529E\u516C\u5BA4"},{type:42,floorType:0,roomType:"100900000001",name:"\u4F1A\u8BAE\u5BA4"},{type:43,floorType:0,roomType:"100900000001",name:"\u6D3D\u8C08\u95F4"},{type:44,floorType:1,roomType:"100900000002",name:"\u5171\u4EAB\u5927\u5385"},{type:45,floorType:1,roomType:"100900000012",name:"\u6C34\u5427"},{type:46,floorType:0,roomType:"100900000015",name:"\u51FA\u5165\u53E3"},{type:47,floorType:0,roomType:"100900000015",name:"\u5927\u5385"},{type:48,floorType:0,roomType:"100900000015",name:"\u5305\u53A2"},{type:49,floorType:0,roomType:"100900000015",name:"\u5176\u4ED6"},{type:50,floorType:0,roomType:"100900000016",name:"\u51FA\u5165\u53E3"},{type:51,floorType:0,roomType:"100900000016",name:"\u529E\u516C\u533A"},{type:52,floorType:0,roomType:"100900000016",name:"\u8001\u677F\u95F4"},{type:53,floorType:0,roomType:"100900000016",name:"\u4F1A\u8BAE\u5BA4"},{type:54,floorType:0,roomType:"100900000016",name:"\u4F11\u606F\u533A/\u6C34\u5427"},{type:55,floorType:0,roomType:"100900000016",name:"\u5176\u4ED6"},{type:56,floorType:2,roomType:"100900000012",name:"\u7A7A\u4E2D\u82B1\u56ED"},{type:57,floorType:0,roomType:"100900000001",name:"\u6D0B\u5BA4"},{type:58,floorType:0,roomType:"100900000001",name:"\u548C\u5BA4"}],rf=[{type:0,description:"\u6728\u8D28\u5730\u677F"},{type:1,description:"\u74F7\u7816\u5730\u9762"},{type:2,description:"\u6237\u5916\u5730\u9762"},{type:3,description:"\u536B\u751F\u95F4\u5730\u9762"},{type:4,description:"\u9633\u53F0\u5730\u9762"},{type:5,description:"\u8F66\u5E93\u5730\u9762"}],af=[{roomType:"100900000001",description:"\u5BA4"},{roomType:"100900000002",description:"\u5385"},{roomType:"100900000003",description:"\u53A8"},{roomType:"100900000004",description:"\u536B"},{roomType:"100900000005",description:"\u9633\u53F0"},{roomType:"100900000006",description:"\u9732\u53F0"},{roomType:"100900000007",description:"\u82B1\u56ED"},{roomType:"100900000008",description:"\u50A8"},{roomType:"100900000009",description:"\u4FDD\u59C6\u95F4"},{roomType:"100900000010",description:"\u8F66\u5E93"},{roomType:"100900000011",description:"\u9601\u697C"},{roomType:"100900000012",description:"\u5176\u4ED6"},{roomType:"100900000013",description:"\u8863"},{roomType:"100900000015",description:"\u5546\u94FA"},{roomType:"100900000016",description:"\u5199\u5B57\u697C"}],Oi=(i,t,e)=>{const n=new E.Matrix4,o=new E.Euler(i,t,e,"YXZ");return n.makeRotationFromEuler(o),n},lf=(i,{scale:t,rotation:e,position:n})=>{if(t&&i.scale.set(t,t,t),e){const[o,s,r]=e;o&&i.applyMatrix4(Oi(o,0,0)),s&&i.applyMatrix4(Oi(0,s,0)),r&&i.applyMatrix4(Oi(0,0,r))}return n&&i.position.set(n.x,n.y,n.z),i};function al(i,t){i.traverse(e=>{var n;if(e.type==="Mesh"){const o=e,s=Q({map:o.material.map||{}},t);o.material=new j.MeshBasicMaterial(s),o.renderOrder=1,((n=e.parent)==null?void 0:n.type)==="Mesh"&&(e.renderOrder=e.parent.renderOrder+1)}})}const cf=(i,t)=>{var u;const e=t.fbx_url||"//vrlab-image4.ljcdn.com/release/web/dipan2.f38a21cc.FBX",n=(u=t.north_rad)!=null?u:void 0,o={},s=h=>H(exports,null,function*(){var S;const d=(h==null?void 0:h.fbx_url)||e,m=(S=h==null?void 0:h.north_rad)!=null?S:n;if(typeof m!="number")throw new Error('"northRad"\u914D\u7F6E\u53C2\u6570\u7F3A\u5931\uFF1A\u672A\u914D\u7F6E\u6307\u5357\u9488\u6307\u5411\uFF01');const g=i.model.bounding,p=g.max.x-g.min.x,A=g.max.z-g.min.z,v=Math.max(p,A),w=yield new ya.FBXLoader().loadAsync(d);al(w,{transparent:!0,side:E.DoubleSide,blending:E.AdditiveBlending});const k=[0,m-Math.PI/2,0],{model:{bounding:{max:{x:I,z:P},min:{x:L,y:x,z:F}}}}=i;o.yBase=x;const N={x:(I+L)/2,y:x-1.6,z:(P+F)/2},R=.0045*v;return lf(w,{position:N,rotation:k,scale:R}),o.object=w,!0}),r=({latitude:h})=>{if(!o.object)return;const d=a(h);d&&(o.object.position.y=d)},a=h=>{if(o.yBase===void 0)return;const d=.6;if(h>=Math.PI/4)return o.yBase-(d+1.6);const m=h*(4/Math.PI);return o.yBase-(d*m+1.6)};return{load:s,disable:()=>{!o.object||(i.scene.remove(o.object),i.needsRender=!0,i.off("cameraDirectionUpdate",r))},enable:()=>{if(!o.object)return;const h=a(i.getPose().latitude);h&&(o.object.position.y=h),i.scene.add(o.object),i.needsRender=!0,i.on("cameraDirectionUpdate",r)}}};function uf(i,t){var c,u,h,d,m;const e=(c=t==null?void 0:t.size)!=null?c:512,n=(u=t==null?void 0:t.fontSize)!=null?u:e*(35/256)*1.2,o=(h=t==null?void 0:t.backgroundColor)!=null?h:"rgba(0,0,0,0)",s=(d=t==null?void 0:t.fontColor)!=null?d:"#fff",r=(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=o,l.fillRect(0,0,e,e),l.font=`${n}px "\u5FAE\u8F6F\u96C5\u9ED1"`,l.textAlign=r,l.fillStyle=s,l.fillText(i,e/2,e*.7),new j.CanvasTexture(a)}const df=({x:i,y:t,z:e})=>new j.Vector3(i,t,e),hf=(i,t)=>{var p,A,v;const e={},n=(p=t.animationEnabled)!=null?p:!0,o=(A=t.position)!=null?A:void 0,s=(v=t.rad)!=null?v:void 0,r=t.fbx_url||"//vrlab-image4.ljcdn.com/release/web/entryDoorMini/Anim_Door1.fbx",a=[],l=b=>H(exports,null,function*(){var N,R,S,O,G,W,Y,_;const w=(N=b==null?void 0:b.position)!=null?N:o;if(!w)return Promise.reject(new Error("ModelEntryDoorGuidePlugin.load(): position is undefined"));const k=df(w),I=(R=b==null?void 0:b.rad)!=null?R:s,P=(S=b==null?void 0:b.fbx_url)!=null?S:r;if(e.rad=I,I===void 0)return Promise.reject(new Error(`ModelEntryDoorGuidePlugin.load(): rad is ${I}`));const L=yield new ya.FBXLoader().loadAsync(P);L.position.copy(k),L.rotation.z=I,L.scale.set(.8,.8,.8),al(L,{transparent:!0,side:E.DoubleSide});const x=(Y=(W=(G=(O=L.children)==null?void 0:O[0])==null?void 0:G.children)==null?void 0:W[3])==null?void 0:Y.clone();if(!x)return Promise.reject(new Error(`ModelEntryDoorGuidePlugin.load(): textMesh is ${x}`));const F=(_=t.name)!=null?_:"\u5165\u6237\u95E8";return x.material=new j.MeshBasicMaterial({transparent:!0,map:uf(F)}),x.renderOrder=3,L.children[0].add(x),e.object=L,!0}),c=()=>{if(e.animation)return;if(!e.object)return console.error("ModelEntryDoorGuidePlugin.initAnimation(): state.object is ",e.object);const b=1,w=new j.AnimationMixer(e.object);a.push(w);const k=w.clipAction(e.object.animations[0]);k.timeScale=b;let I;const P=()=>{let N=0,R=0;const S=1e3/30,O=G=>{N=requestAnimationFrame(O);const W=G-R;W<S||(R=G,a.forEach(Y=>Y.update(W/1e3)),i.needsRender=!0)};return N=requestAnimationFrame(O),()=>{cancelAnimationFrame(N)}},F={play:()=>{I||(k.play(),I=P(),requestAnimationFrame(()=>{e.object&&e.object.rotation.z!==e.rad&&(e.object.rotation.z=e.rad)}))},stop:()=>{k.stop(),I==null||I(),I=void 0}};e.animation=F},u=b=>{var k;if(!e.object)return console.error("ModelEntryDoorGuidePlugin.enable(): object is ",e.object);((k=b==null?void 0:b.animationEnable)!=null?k:n)&&(e.animation||c(),e.animation.play()),i.scene.add(e.object),i.needsRender=!0},h=()=>{!e.object||(e.animation&&e.animation.stop(),i.scene.remove(e.object),i.needsRender=!0)},d=b=>b==="Floorplan"?u():h();return{load:l,enable:b=>(e.enabled||(e.enabled=!0,d(i.currentMode),i.on("modeChange",d),u(b)),!0),disable:()=>(e.enabled&&(e.enabled=!1,h(),i.off("modeChange",d)),!0)}};class ko extends En.default.Tween{constructor(){super(...arguments);f(this,"disposeMethods",[]);f(this,"animationFrameDisposer");f(this,"onDispose",e=>(this.disposeMethods.push(e),this));f(this,"play",()=>(this.start(0),this.animationFrameDisposer=Ln(e=>this.update(e)),this));f(this,"dispose",()=>{var e;this.stop(),(e=this.animationFrameDisposer)==null||e.call(this),this.disposeMethods.forEach(n=>n()),this.disposeMethods=[],En.default.remove(this)})}}function ll(i,t=En.default.Easing.Linear.None){const e=new ko({progress:0}).to({progress:1});return i!==void 0&&e.duration(i),t!==void 0&&e.easing(t),e}const In=window.requestAnimationFrame||(i=>setTimeout(i,16)),ff=window.cancelAnimationFrame||clearTimeout;function Pi(i,t=0){t<=0?In(i):In(()=>Pi(i,t-1))}function Ln(i,t=60){let e=-1,n=0,o=-1;const s=1e3/t;function r(a){o===-1&&(o=a),e=In(r),!(a-n<s)&&(n=a,i&&i(a-o))}return e=In(r),function(){ff(e)}}function mf(){const i=Date.now();return new Promise(t=>{In(()=>{t(Date.now()-i)})})}const pf=gi.Easing;function gf(i,t,e,n=pf.Linear.None){const o=new gi.Tween(i).to(t,e).easing(n);Pi(()=>o.start(0));const s=Ln(a=>{o.update(a)===!1&&s()}),r=[];return o.onDestroy=a=>(r.push(a),o),o.destroy=function(){this.stop(),Object.assign(o,{_onStartCallback:null,_onUpdateCallback:null,_onCompleteCallback:null,_onStopCallbackL:null});let a;for(;a=r.shift();)a();s()},o}function vf(i,t){return gf({progress:0},{progress:1},i,t)}var cl=(i=>(i.Move="Move",i.Rotate="Rotate",i))(cl||{}),nt=(i=>(i.Clockwise="Clockwise",i.Anticlockwise="Anticlockwise",i.Loop="Loop",i))(nt||{});const $n=Math.PI*2;function ks(i){return(i%$n+$n)%$n}function xs(i){return i%$n}function Ri(i,t,e){return i+(t-i)*e}const so=(i,t,e)=>{const n=Math.PI,o=n*2;return i=ks(i),t=ks(t),e===nt.Anticlockwise&&i<t&&(i+=o),e===nt.Clockwise&&t<i&&(t+=o),e===nt.Loop&&t-i>n?so(i,t,nt.Anticlockwise):e===nt.Loop&&i-t>n?so(i,t,nt.Clockwise):{from:i,to:t}},Af=i=>{const t={},e=(l,c,...u)=>H(exports,[l,c,...u],function*(s,r,a={preload:!0}){return t.interruptCallback&&t.interruptCallback(!1),a.asyncStartCallback&&(yield a.asyncStartCallback()),s.mode&&s.mode!==i.currentMode&&(yield i.changeMode(s.mode)),a.preload&&s.panoIndex!==void 0&&s.panoIndex!==i.panoIndex&&(yield i.preloadPano(s.panoIndex)),a.asyncEndCallback&&(yield a.asyncEndCallback()),s.panoIndex===void 0&&s.fov===void 0&&s.latitude===void 0&&s.longitude===void 0?!0:yield new Promise((h,d)=>{const m=s.panoIndex!==void 0?s.panoIndex:i.panoIndex;m!==void 0?i.moveToPano(m,Object.assign({duration:r,moveEndCallback:()=>h(!0),moveCancelCallback:()=>d(!1)},s)):d(!1)})}),n=s=>{const r=i.state,a=xs(r.latitude),l=xs(s.latitude),{from:c,to:u}=so(r.longitude,s.longitude,s.rotation||nt.Loop),h=r.fov,d=s.fov;return{from:{latitude:a,longitude:c,fov:h},to:{latitude:l,longitude:u,fov:d}}};return{move:e,rotate:(l,c,...u)=>H(exports,[l,c,...u],function*(s,r,a={}){t.interruptCallback&&t.interruptCallback(!1),a.asyncStartCallback&&(yield a.asyncStartCallback()),i.currentMode!==Ee.Five.Mode.Panorama&&(yield i.changeMode(Ee.Five.Mode.Panorama)),s.panoIndex!==void 0&&s.panoIndex!==i.panoIndex&&(a.preload&&(yield i.preloadPano(s.panoIndex)),yield new Promise((m,g)=>{if(!s.panoIndex){m(!0);return}i.moveToPano(s.panoIndex,{moveEndCallback:()=>m(!0),moveCancelCallback:()=>g(!1)})})),a.asyncEndCallback&&(yield a.asyncEndCallback());const{from:h,to:d}=n(s);return yield new Promise(m=>{const g=({progress:w})=>{const k={};k.longitude=Ri(h.longitude,d.longitude,w),k.latitude=Ri(h.latitude,d.latitude,w),k.fov=Ri(h.fov,d.fov,w),i.setState(k,!0)},p=()=>{m(!0)},A=()=>{m(!1)},v=s.rotateSpeed?Math.ceil(Math.abs(d.longitude-h.longitude)/s.rotateSpeed*1e3):r,b=vf(v,gi.Easing.Linear.None).onUpdate(g).onComplete(p).onDestroy(A);s.rotation===nt.Loop&&b.repeat(1/0).yoyo(!0),t.interruptCallback=(w=!0)=>{b.destroy(),t.interruptCallback=void 0,t.timeoutId&&(clearTimeout(t.timeoutId),t.timeoutId=void 0),m(w)},t.timeoutId=setTimeout(()=>{t.interruptCallback&&t.interruptCallback(!0)},r)})})}};function Ds(i,t){return i.x===t.x&&i.y===t.y}function ul(i,t){return Math.abs(i)===1/0&&Math.abs(t)===1/0?!0:Math.abs(i-t)<.001}function fi(i,t){return(t.y-i.y)/(t.x-i.x)}function dl(i,t,e){const n=fi(i[1],i[0]),o=fi(t[1],t[0]);if(isNaN(n)||isNaN(o)||ul(n,o))return!1;if(Fn(i[0],t))return i[0];if(Fn(i[1],t))return i[1];if(Fn(t[0],i))return t[0];if(Fn(t[1],i))return t[1];if(e&&!bf(i,t))return!1;const s=i[0],r=t[0];if(Math.abs(n)===1/0)return{x:s.x,y:t[1].y-(t[1].x-s.x)*o};if(Math.abs(o)===1/0)return{x:r.x,y:i[1].y-(i[1].x-r.x)*n};const a=(r.y-s.y+n*s.x-o*r.x)/(n-o),l=n*a-n*s.x+s.y;return{x:a,y:l}}function Fn(i,t){return Ds(i,t[0])||Ds(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&&ul(fi(t[0],i),fi(i,t[1]))}function Hn(i,t,e){return(i.x-e.x)*(t.y-e.y)-(t.x-e.x)*(i.y-e.y)}function bf(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)&&Hn(t[0],i[1],i[0])*Hn(i[1],t[1],i[0])>0&&Hn(i[0],t[1],t[0])*Hn(t[1],i[1],t[0])>0?1:0}function hl(i,t=0){t<=0?requestAnimationFrame(i):requestAnimationFrame(()=>hl(i,t-1))}const yf=`<style type="text/css">
|
|
116
116
|
.PanoRulerPlugin-rule-line {
|
|
117
117
|
position: absolute;
|
|
118
118
|
transform-origin: left center;
|
|
@@ -527,7 +527,7 @@ void main() {
|
|
|
527
527
|
width: 100%;
|
|
528
528
|
height: 100%;
|
|
529
529
|
z-index: 5;
|
|
530
|
-
`,e.container.style.pointerEvents="none";const n=A=>(e.wrapper=A,A.appendChild(e.container),l(),!0),o=A=>{e.itemLabels=Ip(A),l()},s=()=>(e.enabled||(e.enabled=!0,l()),!0),r=()=>(e.enabled&&(e.enabled=!1,l()),!0),a=()=>{u(),e.container.remove()},l=()=>{var A;if(!!e.wrapper){if(!e.enabled||!e.fiveModeEnabled){(A=e.app)==null||A.$destroy(),e.app=void 0;return}e.app?e.app.$set({five:i,itemLabels:e.itemLabels}):e.app=new Cp({target:e.container,props:{five:i,modelOcclusionEnable:e.modelOcclusionEnable,onlyVisibleInPanorama:e.onlyVisibleInPanorama,itemLabels:e.itemLabels,wrapper:e.wrapper,hooks:e.hooks,displayStrategyType:e.displayStrategyType,maxVisibleDistance:e.maxVisibleDistance}})}},c=()=>{i.on("modeChange",h),i.once("dispose",a)},u=()=>{i.off("modeChange",h)},h=A=>{if(A!==Ee.Five.Mode.Panorama){e.fiveModeEnabled=!1,r();return}i.once("initAnimationEnded",()=>{e.fiveModeEnabled=!0,s()})};return c(),{appendTo:n,load:o,enable:s,disable:r,dispose:a,hooks:e.hooks}},Dp={name:"ItemLabelPlugin",version:0};class Lp extends Dn{constructor(e){super(e);f(this,"state");f(this,"container");f(this,"enabled");this.five=e,this.five.once("dispose",this.dispose),this.enabled=!0,this.state=this.initState()}enable(e){this.enabled=!0,this.updateState(fe(Q({},e),{userAction:!0}))}disable(e){this.enabled=!1,this.updateState(fe(Q({},e),{userAction:!0}))}show(e){if(!!this.state.enabled)return this.setState(fe(Q({},this.state),{visible:!0}),e),Promise.resolve()}hide(e){if(!!this.state.enabled)return this.setState(fe(Q({},this.state),{visible:!1}),e),Promise.resolve()}dispose(){this.container.remove()}setState(e,n){if(!this.enabled)return;const o=Q({},this.state);this.state=Q(Q(Q({},this.state),e),n),this.stateChangedCallback(o,n)}get visible(){return this.five.state.mode===Ee.Five.Mode.Panorama}appendTo(e){!this.enabled||(this.container=e,this.render())}updateState(e){this.setState(fe(Q({},this.state),{enabled:this.enabled,visible:this.visible}),e)}}function Mp(i){le(i,"svelte-wpy7pz",'.plugin-DoorLabelPlugin-item.svelte-wpy7pz.svelte-wpy7pz{position:absolute;left:0;top:0;width:0;height:0;pointer-events:none;transition:opacity 0.3s ease}.plugin-DoorLabelPlugin-cnt.svelte-wpy7pz.svelte-wpy7pz{position:absolute;top:50%;left:50%;border-radius:0.125rem;background:rgba(0, 0, 0, 0.35);line-height:0.75rem;padding:0.375rem;white-space:nowrap;font-size:0.75rem;font-style:normal;color:white;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:transform ease 1s, background ease 0.3s, color ease 0.3s}.plugin-DoorLabelPlugin-cnt.svelte-wpy7pz.svelte-wpy7pz::after{content:"";display:block;position:absolute;top:-0.0625rem;left:-0.0625rem;bottom:-0.0625rem;right:-0.0625rem;border-radius:0.125rem;border:0.0625rem solid rgba(0, 0, 0, 0);-o-border-image:url("//vrlab-image4.ljcdn.com/release/web/highlightCarouseal-border-image.14b51834.png") 4;border-image:url("//vrlab-image4.ljcdn.com/release/web/highlightCarouseal-border-image.14b51834.png") 4;transition:opacity ease 0.3s}.plugin-DoorLabelPlugin-cnt.svelte-wpy7pz.svelte-wpy7pz:active,.plugin-DoorLabelPlugin-cnt.svelte-wpy7pz.svelte-wpy7pz:focus{background:rgba(0, 0, 0, 0.5);color:rgba(255, 255, 255, 0.5)}.plugin-DoorLabelPlugin-icon.svelte-wpy7pz.svelte-wpy7pz{background:url("//vrlab-image4.ljcdn.com/release/web/DoorLabel-icon.de1304ae.svg") no-repeat;background-size:100%;display:inline-block;width:0.625rem;height:0.625rem;margin-left:0.25rem;transform-origin:center}.plugin-DoorLabelPlugin-cnt[data-camera-toward=forward].left.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=forward].right.svelte-wpy7pz .plugin-DoorLabelPlugin-txt.svelte-wpy7pz{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=forward].right.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(-90deg);margin-left:0;margin-right:0.25rem;order:0}.plugin-DoorLabelPlugin-cnt[data-camera-toward=right].forward.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=right].back.svelte-wpy7pz .plugin-DoorLabelPlugin-txt.svelte-wpy7pz{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=right].back.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(-90deg);margin-left:0;margin-right:0.25rem;order:0}.plugin-DoorLabelPlugin-cnt[data-camera-toward=left].back.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=left].forward.svelte-wpy7pz .plugin-DoorLabelPlugin-txt.svelte-wpy7pz{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=left].forward.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(-90deg);margin-left:0;margin-right:0.25rem;order:0}.plugin-DoorLabelPlugin-cnt[data-camera-toward=back].right.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=back].left.svelte-wpy7pz .plugin-DoorLabelPlugin-txt.svelte-wpy7pz{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=back].left.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(-90deg);margin-left:0;margin-right:0.25rem;order:0}.plugin-DoorLabelPlugin-cnt--customBrand.svelte-wpy7pz.svelte-wpy7pz{color:#f9eac1}.plugin-DoorLabelPlugin-cnt--customBrand.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{background:url("//vrlab-image4.ljcdn.com/release/web/arrow.6e8ec00e.svg") no-repeat}.plugin-DoorLabelPlugin-cnt--customBrand.svelte-wpy7pz.svelte-wpy7pz:active,.plugin-DoorLabelPlugin-cnt--customBrand.svelte-wpy7pz.svelte-wpy7pz:focus{background:rgba(0, 0, 0, 0.5);color:rgba(249, 234, 193, 0.5)}')}function Sp(i){let t,e,n,o,s,r,a,l;return{c(){t=B("div"),e=B("div"),n=B("span"),n.textContent=`${i[8]}`,o=$(),s=B("i"),y(n,"class","plugin-DoorLabelPlugin-txt svelte-wpy7pz"),y(s,"class","plugin-DoorLabelPlugin-icon svelte-wpy7pz"),y(e,"class",r=Ie(Oe.default("plugin-DoorLabelPlugin-cnt",i[0].toward))+" svelte-wpy7pz"),y(e,"style",`transform: ${i[6]||"initial"};pointer-events: ${i[5]?"auto":"none"};opacity: ${i[5]?1:0}`),y(e,"data-camera-toward",i[7]),y(t,"style",`left: ${i[3]||0}%;top: ${i[4]||0}%;opacity: ${i[5]?1:0}`),y(t,"class","plugin-DoorLabelPlugin-item svelte-wpy7pz")},m(c,u){T(c,t,u),V(t,e),V(e,n),V(e,o),V(e,s),i[10](t),a||(l=me(e,"click",i[9]),a=!0)},p(c,[u]){u&1&&r!==(r=Ie(Oe.default("plugin-DoorLabelPlugin-cnt",c[0].toward))+" svelte-wpy7pz")&&y(e,"class",r)},i:X,o:X,d(c){c&&M(t),i[10](null),a=!1,l()}}}function Tp(i,t,e){let{props:n}=t,{onClick:o}=t,s,{left:r,top:a,inSight:l,transform:c,panoIndex:u,cameraToward:h,name:d}=n;const m=()=>{if(!r||!a||!l||!s)return;const A=s.current.clientWidth/window.innerWidth*100,v=s.current.clientHeight/window.innerHeight*100;r<=A/2||r>=100-A/2||a<=v/2||a>=100-v/2},g=A=>{o&&o()};function p(A){Ve[A?"unshift":"push"](()=>{s=A,e(2,s)})}return i.$$set=A=>{"props"in A&&e(0,n=A.props),"onClick"in A&&e(1,o=A.onClick)},m(),[n,o,s,r,a,l,c,h,d,g,p]}class zp extends oe{constructor(t){super(),ie(this,t,Tp,Sp,ne,{props:0,onClick:1},Mp)}}function Bp(i,t){const e=Math.abs(i.top+i.height/2-t.top-t.height/2),n=Math.abs(i.left+i.width/2-t.left-t.width/2),o=(i.height+t.height)/2,s=(i.width+t.width)/2;return!(e>o&&n>s)}function Vp(i){const{camera:t}=i,e=t.getWorldDirection(new j.Vector3);let n=Math.atan(e.z/e.x)*180/Math.PI,o="";return e.x<0&&(n+=180),n<0&&(n+=360),n>315||n<=45?o="right":n>45&&n<=135?o="back":n>135&&n<=225?o="left":n>225&&n<=315&&(o="forward"),o}function jp(i,t){return Math.sqrt(Math.pow(i.z-t.z,2)+Math.pow(i.x-t.x,2))}function Op(i){const t=Math.PI/4;return i>-t&&i<=t?"left":i>t*3||i<=-t*3?"right":i>-t*3&&i<=-t?"forward":i>t&&i<=t*3?"back":""}const Rp={userAction:!0};class Qp extends Lp{constructor(e){super(e);f(this,"MinVisibledistance",1.8);f(this,"MaxVisibledistance",5);f(this,"OffsetHeight",-1.3);f(this,"rooms");f(this,"floorplanServerData");f(this,"doorLabelItems");f(this,"visibleLabelMap",new Map);f(this,"labelItems",[]);f(this,"doorLabels");f(this,"roomObservers");f(this,"loadData",(e,n)=>{n&&(this.MaxVisibledistance=n.MaxVisibledistance,this.MinVisibledistance=n.MinVisibledistance,this.OffsetHeight=n.OffsetHeight),this.doorLabelItems&&this.doorLabelItems.length>0&&this.doorLabelItems.forEach(o=>{o.$destroy()}),this.labelItems=[],this.doorLabels=[],this.doorLabelItems=[],this.floorplanServerData=e,typeof this.five.ready=="function"?this.five.ready().then(()=>this.initData()):this.five.once("panoArrived",()=>{this.initData()})});f(this,"initRoomObservers",()=>{var s,r;const e=this.floorplanServerData.computed_data.floor_datas||[],o=(((r=(s=this.five)==null?void 0:s.work)==null?void 0:r.observers)||[]).map(a=>{const l=a.panoIndex,c=a.floorIndex,u=e==null?void 0:e.find(h=>h.floor_index===c);if(u){const h=u.rooms.find(d=>d.observer_indexs.includes(l));if(h)return{panoIndex:l,floorIndex:c,name:h.name}}}).filter(Boolean);this.roomObservers=o});f(this,"hideAllLabels",()=>{this.labelItems.forEach(e=>{e.visible=!1,e.inSight=!1}),this.render()});f(this,"fixDoorVisibleAndPosition",()=>{this.initRoomObservers();const{panoIndex:e}=this.five;if(!this.visible||this.five.model.empty||e===null||!this.roomObservers.find(a=>a.panoIndex===e))return;const n=this.roomObservers.find(a=>a.panoIndex===e),s=this.five.work.observers.find(a=>a.panoIndex===e).position.clone(),r=(()=>{if(this.visibleLabelMap.has(e))return this.visibleLabelMap.get(e);{const a=[];return this.doorLabels.forEach((l,c)=>{if(l.roomName===n.name)return;const u=l.position.clone(),h=u.distanceTo(s);if(h<this.MinVisibledistance||h>this.MaxVisibledistance)return;const d=new j.Raycaster,m=u.clone().sub(s).normalize();d.set(s,m);const[g]=this.five.model.intersectRaycaster(d);g&&g.distance+.1<h||a.push(c)}),this.visibleLabelMap.set(e,a),a}})();this.labelItems.forEach((a,l)=>{a.visible=r.includes(l)}),this.fixDoorPosition()});f(this,"fixDoorPosition",()=>{var u,h,d,m,g,p,A,v,b,w,k,I;const{panoIndex:e,camera:n}=this.five;if(e===null)return;if(this.five.currentMode!=="Panorama")return this.hideAllLabels();const o=this.five.getElement(),s=o.clientWidth,r=o.clientHeight,a=n.getWorldDirection(new j.Vector3),l=[],c=[...this.labelItems];if(c.forEach((P,L)=>{if(P.visible){const x=n.position.distanceTo(P.position),F=P.position.clone().add(new j.Vector3(0,this.OffsetHeight,0)),R=F.clone().sub(n.position).normalize().angleTo(a),S=F.clone().project(n),O=(S.x+1)/2.2*100,G=(-S.y+1)/2.2*100,W=O>=0&&O<=100&&G>=0&&G<=100&&x>this.MinVisibledistance&&x<=this.MaxVisibledistance;P.left=O,P.top=G,P.inSight=W&&R<Math.PI/2,P.cameraToward=Vp(this.five),W?l.push({disFromCameraToLabel:x,left:O,top:G,index:L}):P.transform="translate(-50%, -50%)"}else P.inSight=!1}),l.length>1){let P=0;l.sort((L,x)=>x.disFromCameraToLabel-L.disFromCameraToLabel);for(let L=1;L<l.length;L++){const{index:x,left:F,top:N}=l[L-1],{index:R,left:S,top:O}=l[L],G=this.container.children[x],W=this.container.children[R];if(!G||!W)return;const Y={left:s*F/100,top:r*N/100,width:(d=(h=(u=G.children)==null?void 0:u[0])==null?void 0:h.clientWidth)!=null?d:0,height:(p=(g=(m=G.children)==null?void 0:m[0])==null?void 0:g.clientHeight)!=null?p:0},_={left:s*S/100,top:r*O/100,width:(b=(v=(A=W.children)==null?void 0:A[0])==null?void 0:v.clientWidth)!=null?b:0,height:(I=(k=(w=W.children)==null?void 0:w[0])==null?void 0:k.clientHeight)!=null?I:0};Bp(Y,_)&&(P++,c[x].transform=`translate(-50%, ${(P-1)*100-50}%)`,c[R].transform=`translate(-50%, ${P*100-50}%)`)}}this.labelItems=c,this.render()});f(this,"onClick",(e,n)=>{if(!this.roomObservers)return;const{work:o}=this.five;let s,r,a=1/0;for(const l of o.observers)if(this.roomObservers.find(u=>u.panoIndex===l.panoIndex&&u.name===e)){const u=l.standingPosition,h=n.distanceTo(u);h<a&&(s=l.panoIndex,r=u.clone().sub(n).normalize(),a=h)}if(r!==null&&s!==null){const l={};if(a>0){const u=new j.Vector3(0,0,-1),h=r.clone(),d=new j.Quaternion;d.setFromUnitVectors(u,h);const m=new j.Euler;m.setFromQuaternion(d,"YXZ"),l.longitude=m.y}this.five.emit("wantsToMoveToPano",s,{},!0)||this.five.moveToPano(s,{longitude:l.longitude})}});f(this,"initData",()=>{var s;this.doorLabels=[];const e=this.five.panoIndex,n=this.floorplanServerData.computed_data.observers[e].floor_index,o=n!==void 0&&((s=this.floorplanServerData.computed_data.floor_datas[n])==null?void 0:s.rooms);this.rooms=o,this.rooms&&this.rooms.length>0&&this.rooms.forEach(r=>{var c;const a=(c=this.floorplanServerData.computed_data.doors)==null?void 0:c.filter(u=>!!(u&&u.name===r.name)),l=this.five.work.observers.filter((u,h)=>!!r.observer_indexs.find(d=>d===h));a&&a.forEach(u=>{const h=u.position;let d=1/0,m;l.forEach(p=>{const A=p.standingPosition,v={x:A.x,y:A.y,z:A.z},b=jp(h,v);b<d&&(d=b,m=v)}),m&&(h.y=m.y+.01);const g=new j.Vector3(h.x,h.y,h.z);g.add(new j.Vector3(-.2,1.8,0).applyEuler(new j.Euler(0,u.rad,0))),this.doorLabels.push({roomName:r.name,name:u.name,position:g,toward:Op(u.rad)})})}),this.labelItems=this.doorLabels.map(r=>fe(Q({},r),{left:0,top:0,visible:!1,inSight:!1,transform:"",cameraToward:""})),this.five.on("wantsToMoveToPano",this.hideAllLabels),this.five.on("modelLoaded",this.fixDoorVisibleAndPosition),this.five.on("panoArrived",this.fixDoorVisibleAndPosition),this.five.on("initAnimationEnded",this.fixDoorPosition),this.five.on("cameraUpdate",this.fixDoorPosition),this.five.on("mouseWheel",this.fixDoorPosition),this.five.on("pinchGesture",this.fixDoorPosition),this.fixDoorVisibleAndPosition()})}stateChangedCallback(e,n){if(this.hooks.hasListener("stateChange")){const o={state:this.state,prevState:e,userAction:n?n.userAction:Rp.userAction};this.hooks.emit("stateChange",o)}}render(){if(!this.enabled){this.doorLabelItems&&this.doorLabelItems.length>0&&this.doorLabelItems.forEach(e=>{e==null||e.$destroy()}),this.doorLabels=void 0;return}this.doorLabelItems&&this.doorLabelItems.forEach(e=>{e.$destroy()}),this.doorLabelItems=[],this.labelItems.forEach(e=>{this.doorLabelItems.push(new zp({target:this.container,props:{props:e,onClick:()=>{this.onClick(e.name,e.position)}}}))})}initState(){return{enabled:!0,visible:!0}}dispose(){this&&this.five&&(this.five.off("wantsToMoveToPano",this.hideAllLabels),this.five.off("modelLoaded",this.fixDoorVisibleAndPosition),this.five.off("panoArrived",this.fixDoorVisibleAndPosition),this.five.off("initAnimationEnded",this.fixDoorPosition),this.five.off("cameraUpdate",this.fixDoorPosition),this.five.off("mouseWheel",this.fixDoorPosition),this.five.off("pinchGesture",this.fixDoorPosition),super.dispose())}}const Fp=i=>new Qp(i),Hp=2,Gp=3,Wp=3,_p=2;function Np(i,t){var r,a,l;if(i.length<2)return console.warn("positionList length must be greater than 1"),[];const e=(r=t==null?void 0:t.unitWidth)!=null?r:.5,n=(a=t==null?void 0:t.unitHeight)!=null?a:.5,o=(l=t==null?void 0:t.skipPanoIndexMesh)!=null?l:!1,s=new E.CatmullRomCurve3(i,!1,"catmullrom",1);if(o){const c=Math.ceil(s.getLength()/n*1.5),u=s.getPoints(c),h=[];let d=0;const m=i;return m.forEach((g,p)=>{let A=0,v=99999999;u.forEach((P,L)=>{const x=P.distanceTo(g);x<v&&(A=L,v=x)});const b=u[A+1],w=b==null?void 0:b.distanceTo(g),k=u[A-1],I=k==null?void 0:k.distanceTo(g);if(A>d&&A-d>1){let P=A;k!==void 0&&I>.8&&(P=A+1),k!==void 0&&I>.2&&I<.3?P=A:v>.2&&v<.3&&(P=A+1);let L=d;if(b!==void 0&&w>.2&&w<.3?L=d+1:v>.2&&v<.3&&(L=d),u[L]&&u[L+1]){const N=m[p-1];if(N)if(N.equals(u[L]))L+=1;else{const R=new j.Vector3().subVectors(u[L+1],u[L]),S=new j.Vector3().subVectors(N,u[L]);R.angleTo(S)<Math.PI/2&&(L+=1)}}if(P<L||P-L<=1)return;const x=u.slice(L,P),F=tr(x,e,n);h.push(F),d=A}}),h}else{const c=Math.ceil(s.getLength()),u=s.getPoints(c);return[tr(u,e,n)]}}function tr(i,t,e){const n=t/2,o=e/t,s=i.length,r=kc.default(i.map(v=>[v.x,v.z])),l=(i.length-1)*Hp*Gp,c=2*s,u=c*Wp,h=c*_p,d=new Uint32Array(l),m=new Float32Array(u),g=new Float32Array(h);i.forEach((v,b)=>{});let p=0;for(let v=0;v<i.length;v++){const[b,w]=r[v][0],k=i[v],{x:I,y:P,z:L}=k,x=new j.Vector3(I+b*n,P+.05,L+w*n);m[v*6+0]=x.x,m[v*6+1]=x.y,m[v*6+2]=x.z;const F=new j.Vector3(I-b*n,P+.05,L-w*n);m[v*6+3]=F.x,m[v*6+4]=F.y,m[v*6+5]=F.z,p+=v>0?i[v-1].clone().sub(i[v]).length():0;const N=p/t/o;g[v*4+0]=0,g[v*4+1]=N,g[v*4+2]=1,g[v*4+3]=N,v!==i.length-1&&(d[v*6+0]=v*2+0,d[v*6+1]=v*2+2,d[v*6+2]=v*2+1,d[v*6+3]=v*2+2,d[v*6+4]=v*2+3,d[v*6+5]=v*2+1)}const A=new E.BufferGeometry;return A.setAttribute("position",new E.BufferAttribute(m,3)),A.setAttribute("uv",new E.BufferAttribute(g,2)),A.setIndex(new E.BufferAttribute(d,1)),A}function Xp(i){const t=new E.TextureLoader().load(i.textureUrl);return t.wrapS=t.wrapT=E.RepeatWrapping,t.encoding=E.sRGBEncoding,t.minFilter=E.LinearFilter,new E.MeshBasicMaterial({color:16777215,map:t,transparent:!0,opacity:.8})}function Yp(i){return!wt(i)}function wt(i){return i!=null}const kl="v1.1.0",xl="GuideLinePlugin",lo=`${xl}@${kl}`,nr=i=>`${lo}--${i}`;class Dl extends Bt{constructor(e,n){super(e,n);f(this,"state",{visible:!1,enabled:!0,disposed:!1});f(this,"data");f(this,"linesGroup");f(this,"disposedErrorLog",()=>{console.error(`${lo} is disposed`)});f(this,"actionWhenEnabled",e=>{if(this.state.enabled)return e()});Object.assign(window,{[`__${xl}_DEBUG__`]:this})}load(e,n,o=!0){return H(this,null,function*(){const s=this.data?JSON.parse(JSON.stringify(this.data)):void 0,r=yield this.formatData(e);this.hooks.emit("dataChange",r,s),this.data=r,this.linesGroup&&this.five.scene.remove(this.linesGroup);const a=this.getLinesGroup(r.routes,r.config);!a||(this.linesGroup=a,yield this.waitFiveModelLoaded(),this.five.scene.add(a),this.handleVisible(this.state.visible),this.handleEnable(this.state.enabled),n&&this.setState(n),this.five.needsRender=!0,this.hooks.emit("dataLoaded",r),console.info(`${lo} loaded`,r))})}formatData(e){return H(this,null,function*(){return typeof e=="object"&&e!==null&&e.version&&e.data?e.data:e})}show(e){return H(this,null,function*(){this.setState({visible:!0},e)})}hide(e){return H(this,null,function*(){this.setState({visible:!1},e)})}enable(e){this.setState({enabled:!0},e)}disable(e){this.setState({enabled:!1},e)}dispose(){this.setState({disposed:!0})}setState(e,n){var s;if(this.state.disposed)return this.disposedErrorLog();const o=Q({},this.state);this.state=Q(Q({},this.state),e),e.disposed!==void 0&&e.disposed!==o.disposed&&e.disposed&&this.handleDispose(),e.visible!==void 0&&e.visible!==o.visible&&this.handleVisible(e.visible,n==null?void 0:n.userAction),e.enabled!==void 0&&e.enabled!==o.enabled&&this.handleEnable(e.enabled,n==null?void 0:n.userAction),it(o,this.state,{deep:!0})||(this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:(s=n==null?void 0:n.userAction)!=null?s:!0}),this.five.needsRender=!0)}handleEnable(e,n=!0){this.linesGroup&&(e?(this.five.scene.add(this.linesGroup),this.actionWhenEnabled(()=>this.hooks.emit("enable",{userAction:n}))):(this.five.scene.remove(this.linesGroup),this.hooks.emit("disable",{userAction:n})))}handleVisible(e,n=!0){this.linesGroup&&(e?(this.linesGroup.visible=!0,this.actionWhenEnabled(()=>this.hooks.emit("show",{userAction:n}))):(this.linesGroup.visible=!1,this.actionWhenEnabled(()=>this.hooks.emit("hide",{userAction:n}))))}handleDispose(){this.linesGroup&&this.five.scene.remove(this.linesGroup),this.hooks.emit("dispose")}getLinesGroup(e,n){const o=e.map(r=>this.getLine(r,n)).filter(wt),s=new E.Group;if(s.name=nr("route-group"),o.length!==0)return s.add(...o),s}getLine(e,n){var l,c,u,h,d,m,g,p;const o=new E.Group,s=e.panoIndexList.map(A=>{var v;return(v=this.five.work.observers[A])==null?void 0:v.standingPosition}).filter(wt),r=Np(s,{skipPanoIndexMesh:(c=(l=e.skipPanoIndexMesh)!=null?l:n==null?void 0:n.skipPanoIndexMesh)!=null?c:!0,unitWidth:(h=(u=e.unitWidth)!=null?u:n==null?void 0:n.unitWidth)!=null?h:.6,unitHeight:(m=(d=e.unitHeight)!=null?d:n==null?void 0:n.unitHeight)!=null?m:.4});if(!r)return;const a=Xp({textureUrl:(p=(g=e.arrowTextureUrl)!=null?g:n==null?void 0:n.arrowTextureUrl)!=null?p:this.staticPrefix+"/release/web/arrow6.b6ce0c62.png"});return r.forEach(A=>{const v=new E.Mesh(A,a);v.name=nr("route-line-mesh"),o.add(v)}),o}waitFiveModelLoaded(){return H(this,null,function*(){return new Promise(e=>{if(this.five.model.loaded){e();return}this.five.once("modelLoaded",()=>{e()})})})}}f(Dl,"lasestVersion",kl);const Ll=(i,t)=>new Dl(i,t);function ir(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 Up(i,t){const e=ir(i),n=ir(t);return e.angleTo(n)}const qp=i=>H(exports,null,function*(){try{i().then(()=>{},()=>{}).catch(()=>{})}catch(t){}}),Xn=Math.PI*2;function Jp(i){return i>=0&&i<Xn?i:(i%Xn+Xn)%Xn}function Zp(i){return{longitude:Jp(-Math.atan2(i.x,-i.z)),latitude:-Math.asin(i.y/1)}}function Kp(i,t,e,n){const o=-i/e,s=i;return o*n+s}function $p(i){return new Promise(t=>{setTimeout(()=>{t()},i)})}const Ml="v1.0.6",Sl="CruisePlugin",xi=`${Sl}@${Ml}`,or=()=>{console.error(`${xi} is disposed`)},eg=()=>{console.warn(`${xi} is disabled`)},tg=()=>{console.error(`${xi} is disabled`)},Gi=new Map;class xo extends Bt{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,{[`__${Sl}_DEBUG__`]:this});const o=this.setFiveLinearUpdateCamera.bind(this),s=this.setFiveOriginUpdateCamera.bind(this);this.hooks.on("play",o),this.hooks.on("broke",s),this.hooks.on("end",s),this.hooks.on("pause",s),this.privateState.disposers.push(()=>{this.hooks.off("play",o),this.hooks.off("broke",s),this.hooks.off("end",s),this.hooks.off("pause",s)})}load(e,n,o){return H(this,null,function*(){var u,h,d,m,g;if(this.state.disposed)return or();this.privateState.fiveOriginGetProgress||(h=(u=this.five.controller)==null?void 0:u.cameraMotion)!=null&&h.getProgress||(yield this.waitFiveLoaded(),this.privateState.fiveOriginGetProgress=(m=(d=this.five.controller)==null?void 0:d.cameraMotion)==null?void 0:m.getProgress),this.clear();const s=this.data?JSON.parse(JSON.stringify(this.data)):void 0,r=yield this.formatData(e);this.data=r,this.hooks.emit("dataChange",r,s);let a=[],l;const c=this.data.keyframes.filter(p=>p.data.panoIndex!==void 0);c.filter((p,A)=>{var v;return p.data.panoIndex!==((v=c[A-1])==null?void 0:v.data.panoIndex)}).map(p=>p.data.panoIndex).forEach(p=>{var v,b;const A=(v=this.five.work.observers[p])==null?void 0:v.floorIndex;if(A!==void 0)if(l===A){const w=a.length-1;a[w]=[...(b=a[w])!=null?b:[],p]}else{l=A;const w=a.length;a[w]=[p]}}),this.GuideLine||(this.GuideLine=Ll(this.five,this.config)),(g=this.GuideLine)==null||g.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:o}),console.info(`${xi} loaded`,r),this.hooks.emit("dataLoaded",r)})}play(e){this.setState({playing:!0},e)}playFrom(e){const{index:n,id:o,userAction:s}=e;this.state.playing&&this.setState({playing:!1},{userAction:s}),this.setState({playing:!0},{userAction:s,playFromIndex:n,playFromId:o})}playFromStart(e){return this.playFrom(fe(Q({},e),{index:0}))}pause(e){this.setState({playing:!1},e)}show(e){return H(this,null,function*(){this.setState({visible:!0},e)})}hide(e){return H(this,null,function*(){this.setState({visible:!1},e)})}enable(e){this.setState({enabled:!0},e)}disable(e){this.setState({enabled:!1},e)}dispose(){this.setState({disposed:!0})}setState(e,n){var s;if(this.state.disposed)return or();if(!this.state.enabled&&e.enabled!==!0&&e.disposed!==!0)return tg();const o=Q({},this.state);this.state=Q(Q({},this.state),e),e.disposed!==void 0&&e.disposed!==o.disposed&&e.disposed&&this.handleDispose(),e.visible!==void 0&&e.visible!==o.visible&&this.handleVisible(e.visible,n==null?void 0:n.userAction),e.enabled!==void 0&&e.enabled!==o.enabled&&this.handleEnable(e.enabled,n==null?void 0:n.userAction),e.playing!==void 0&&e.playing!==o.playing&&this.changePlayState(e.playing,n),e.speed!==void 0&&e.speed!==o.speed&&this.changeSpeed(e.speed,n==null?void 0:n.userAction),it(o,this.state,{deep:!0})||this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:(s=n==null?void 0:n.userAction)!=null?s:!0})}formatData(e){return H(this,null,function*(){this.five.work||(yield this.waitFiveLoaded());const n=this.five.work.observers,o=(()=>{const s=e;return typeof s=="object"&&s!==null&&s.version&&s.data?s.data:s})();if(o.keyframes)return{keyframesId:Ge(),keyframes:o.keyframes.map((s,r)=>{var c;const a=o.keyframes[r+1],l=(()=>!a||a.start===void 0||s.end===void 0?0:a.start-s.end)();return fe(Q({id:(c=s.uuid)!=null?c:Ge(),moveIndex:r,stay:l,index:r},s),{guildPluginOptions:o.guildPluginOptions})})};if(o.panoIndexList){let s=[];const{moveEffect:r,moveToFirstPanoEffect:a,moveToFirstPanoDuration:l}=o;return this.privateState.moveToFirstPanoEffect=a,this.privateState.moveToFirstPanoDuration=l,o.panoIndexList.forEach((c,u)=>{const h=(()=>{var A,v,b,w;const d=o.panoIndexList.slice(u).find(k=>k!==c);if(d===void 0)return;const m=(A=n[c])==null?void 0:A.position,g=(v=n[d])==null?void 0:v.position;if(!g||!m||((b=n[c])==null?void 0:b.floorIndex)!==((w=n[d])==null?void 0:w.floorIndex))return;const p=new E.Vector3().subVectors(g,m);return Zp(p.normalize())})();o.moveType===void 0||o.moveType==="justMove"?s.push({moveIndex:u,stay:o.stay,data:Q({effect:"Move",panoIndex:c,moveEffect:r},h!=null?h:{})}):o.moveType==="moveAndRotate"&&(s.push({moveIndex:u,stay:o.stay,data:{effect:"Move",panoIndex:c,moveEffect:r}}),h&&s.push({moveIndex:u,stay:o.stay,data:Q({effect:"Rotate",panoIndex:c},h)}))}),{keyframesId:Ge(),keyframes:s.map((c,u)=>Q({id:Ge(),index:u},c)),guildPluginOptions:o.guildPluginOptions}}else throw new Error("format error: data no keyframes or no panoIndexList")})}handleEnable(e,n=!0){var o,s;e?((o=this.GuideLine)==null||o.enable(),this.hooks.emit("enable",{userAction:n})):((s=this.GuideLine)==null||s.disable(),this.changePlayState(!1,{userAction:n}),this.hooks.emit("disable",{userAction:n})),this.state.enabled=e}handleVisible(e,n=!0){var o,s;e?((o=this.GuideLine)==null||o.show(),this.actionIfStateIsEnabled(()=>this.hooks.emit("show",{userAction:n}))):((s=this.GuideLine)==null||s.hide(),this.actionIfStateIsEnabled(()=>this.hooks.emit("hide",{userAction:n}))),this.state.visible=e}changePlayState(e,n){this.actionIfStateIsEnabled(()=>{var o;return this.hooks.emit("playStateChange",e?"playing":"pause",{userAction:(o=n==null?void 0:n.userAction)!=null?o:!0})}),e?this.handlePlay(n):this.handlePause(n),this.state.playing=e}handlePlay(e){return H(this,null,function*(){var m;const{data:n,state:o,privateState:s,hooks:r}=this;if(s.playing||!(n!=null&&n.keyframes)||(n==null?void 0:n.keyframes.length)===0)return;const a=Ge();s.playId=a,s.playing=!0,s.broke=!1;const l=n.keyframes,c=this.getPauseData();(e==null?void 0:e.notEmitEvent)!==!0&&r.emit("play",{userAction:(m=e==null?void 0:e.userAction)!=null?m:!0});let u=!1;const d=yield(()=>H(this,null,function*(){var g,p;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(A=>A.id===e.playFromId);if(c!=null&&c.keyframeId){const A=(p=this.data)==null?void 0:p.keyframes.find(v=>v.id===c.keyframeId);if(c!=null&&c.fiveState&&(yield this.move(c.fiveState,{moveEffect:s.moveToFirstPanoEffect,duration:s.moveToFirstPanoDuration})),A){if(A.data.effect==="Move")return A.index;if(A.data.effect==="Rotate"){const v=c.duration!==void 0?c.duration*(1-c.playedProgress):void 0;return yield this.playKeyframe(A,{duration:v}),u=!0,A.index+1}}}}))();this.clearPauseData();for(const g of l){if(s.broke||!o.playing||!s.playing||a!==s.playId)return;if(!(d!==void 0&&g.index<d))try{r.emit("playIndexChange",g.index,g),yield this.playKeyframe(g,{moveEffect:u===!1?s.moveToFirstPanoEffect:void 0,duration:u===!1&&typeof s.moveToFirstPanoDuration=="number"?s.moveToFirstPanoDuration:void 0}),g.stay&&(yield $p(g.stay)),u===!1&&(u=!0)}catch(p){return Promise.resolve("broke")}}o.playing&&a===s.playId&&(this.setState({playing:!1},{userAction:!1}),r.emit("end"),this.clearPauseData())})}handlePause(e){var r;const{state:n,privateState:o,hooks:s}=this;n.playing=!1,o.playing!==!1&&(o.playing=!1,this.setPauseData(),o.broke||this.forceInteruptUpdateCamera(),(e==null?void 0:e.notEmitEvent)!==!0&&s.emit("pause",{userAction:(r=e==null?void 0:e.userAction)!=null?r:!0}))}playKeyframe(e,n){return H(this,null,function*(){var s;const{privateState:o}=this;return((s=this.privateState.currentPlayKeyframe)==null?void 0:s.keyframe.id)!==e.id&&(this.privateState.currentPlayKeyframe={keyframe:e}),o.currentPlayQueue.push(this.getPlayPromise(e,n)),this.actionPromiseQueue()})}addInterruptListener(e){const n=()=>{this.privateState.modeChanging||e()},o=e;return this.five.once("gesture",o),this.five.once("wantsChangeMode",n),()=>{this.five.off("gesture",o),this.five.once("wantsChangeMode",n)}}getPlayPromise(o){return H(this,arguments,function*(e,n={}){var r;const s=e.data;if(n.duration=(r=n.duration)!=null?r:e.start!==void 0&&e.end!==void 0?e.end-e.start:void 0,!!s)return new Promise((a,l)=>{let c=!1;this.addInterruptListener(()=>{if(!c)return this.hooks.emit("broke"),this.privateState.broke=!0,this.setState({playing:!1}),c=!0,l(new Error("play is interupted"))});try{if(c)return;const u=()=>{a(),c=!0};switch(s.effect){case"Move":this.move(s,n).then(u);break;case"Rotate":this.rotate(s,n).then(u);break;default:this.rotate(s,n).then(u)}}catch(u){}})})}actionPromiseQueue(){return H(this,null,function*(){const{privateState:e}=this;return new Promise((n,o)=>{if(e.currentPlayQueue.length===0){n();return}const s=e.currentPlayQueue.shift();if(!s){n();return}s.then(n,o)}).then(()=>e.currentPlayQueue.length===0?Promise.resolve():this.actionPromiseQueue())})}move(e,n){return H(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 H(this,null,function*(){if(e.mode&&e.mode!==this.five.currentMode)yield this.changeMode({mode:e.mode,panoIndex:e.panoIndex});else if(e.panoIndex&&e.panoIndex!==this.five.panoIndex)return yield this.changePano(e,n);yield this.updateCamera(e,n)})}updateCamera(o){return H(this,arguments,function*(e,n={}){const{five:s,privateState:r,state:a}=this,l=(()=>{var m,g;const h=(m=a.config)==null?void 0:m.speedConfig,d=(g=e.rotateSpeed)!=null?g:h==null?void 0:h.rotateSpeed;if((h==null?void 0:h.rotateSpeedUnit)===void 0)return d;if(d!==void 0)return h.rotateSpeedUnit==="rad/ms"?d:d/1e3})(),c=(()=>{if(n.duration)return n.duration;if(l){const h=this.five.getCurrentState();return Up(h,e)/l}return 800})();r.currentPlayKeyframe&&(r.currentPlayKeyframe.originDuration=c);const u=this.getSpeededDuration(c);return new Promise(h=>{qp(()=>s.updateCamera(e,u)),setTimeout(()=>h(),u)})})}changePano(e,n){return H(this,null,function*(){const{five:o,privateState:s,state:r}=this;if(typeof e.panoIndex!="number"||e.panoIndex===o.panoIndex)return;const a=o.getCurrentState().mode!=="Panorama";a&&(this.privateState.modeChanging=!0);const l=(()=>{var d,m;const u=(d=r.config)==null?void 0:d.speedConfig,h=(m=e.moveSpeed)!=null?m:u==null?void 0:u.moveSpeed;if((u==null?void 0:u.moveSpeedUnit)===void 0)return h;if(h!==void 0)return u.moveSpeedUnit==="m/ms"?h:h/1e3})(),c=(()=>{if(n!=null&&n.duration)return n.duration;if(l&&typeof o.panoIndex=="number"&&typeof e.panoIndex=="number"){const u=o.work.observers[o.panoIndex].position,h=o.work.observers[e.panoIndex].position;return u.distanceTo(h)/l}return 800})();s.currentPlayKeyframe&&(s.currentPlayKeyframe.originDuration=c),yield new Promise(u=>{var h,d,m;o.moveToPano(e.panoIndex,{latitude:e.latitude,longitude:e.longitude,fov:e.fov,duration:this.getSpeededDuration(c),effect:(m=(d=n==null?void 0:n.moveEffect)!=null?d:(h=this.state.config)==null?void 0:h.moveEffect)!=null?m:e.moveEffect,moveCancelCallback:()=>u(),moveEndCallback:()=>u()}),a&&o.once("panoArrived",()=>u())}),a&&(this.privateState.modeChanging=!1)})}changeSpeed(e,n=!0){const{state:o,privateState:s,hooks:r}=this,{currentPlayKeyframe:a}=s;if(r.emit("speedChange",e,{userAction:n}),o.playing&&a)try{const l=a.originDuration!==void 0?a.originDuration*(1-this.getProgress()):void 0,c=this.playKeyframe(a.keyframe,{duration:l});s.currentPlayQueue.push(c)}catch(l){}}getSpeededDuration(e){return e/this.state.speed}getProgress(){return this.five.controller.cameraMotion.progress}changeMode(e,n){return H(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 Gi.get((n=this.data)==null?void 0:n.keyframesId)}setPauseData(){var e,n,o,s;if((e=this.data)!=null&&e.keyframesId)return Gi.set((n=this.data)==null?void 0:n.keyframesId,{keyframeId:(o=this.privateState.currentPlayKeyframe)==null?void 0:o.keyframe.id,fiveState:this.five.getCurrentState(),duration:(s=this.privateState.currentPlayKeyframe)==null?void 0:s.originDuration,playedProgress:this.getProgress()})}clearPauseData(){var e,n;if((e=this.data)!=null&&e.keyframesId)return Gi.delete((n=this.data)==null?void 0:n.keyframesId)}clear(){this.clearPauseData(),this.privateState.currentPlayKeyframe=null}handleDispose(){var e,n;this.setState({playing:!1}),this.clearPauseData(),this.clear(),(e=this.GuideLine)==null||e.dispose(),this.GuideLine=void 0,(n=this.privateState.disposers)==null||n.forEach(o=>o==null?void 0:o())}actionIfStateIsEnabled(e,n){if(this.state.enabled)return e();n!=null&&n.warnLog&&eg()}waitFiveLoaded(){return H(this,null,function*(){return new Promise(e=>{if(this.five.work){e();return}this.five.once("loaded",()=>{e()})})})}setFiveLinearUpdateCamera(){!this.privateState.fiveOriginGetProgress||(this.five.controller.cameraMotion.getProgress=e=>{const n=this.five.controller.cameraMotion,o=e-n.startTime;return o<0?0:o>=n.duration?1:1-Kp(1,n.startVelocity,n.duration,o)})}setFiveOriginUpdateCamera(){!this.privateState.fiveOriginGetProgress||(this.five.controller.cameraMotion.getProgress=this.privateState.fiveOriginGetProgress)}}f(xo,"PluginVersion",Ml);const ng=i=>new xo(i);function ig(i,t){t.forEach(e=>{const n=new E.SphereGeometry(.02,16,16),o=[],s=[new E.MeshBasicMaterial({color:16776960}),new E.MeshBasicMaterial({color:16711935}),new E.MeshBasicMaterial({color:16711680}),new E.MeshBasicMaterial({color:65535})];if(e.position.length===4)e.position.forEach((r,a)=>{const l=s[a],c=new E.Mesh(n,l);c.position.copy(qe(r)),o.push(c)});else{const r=s[0],a=new E.Mesh(n,r);a.position.copy(qe(e.position)),o.push(a)}o.forEach(r=>{r.material.depthTest=!1,i.scene.add(r)})})}const Le=i=>i;function Wi(i){if(i.length<3)return;const t=i.map(Pn),e=t[1].clone().sub(t[0]),n=t[2].clone().sub(t[1]);return e.cross(n)}var Tl=(i=>(i.Audio="Audio",i.Text="Text",i.ImageText="ImageText",i.Image="Image",i.Video="Video",i.Link="Link",i.Sticker="Sticker",i.VRLink="VRLink",i.PanoLink="PanoLink",i.Marketing="Marketing",i.MediaPlane="MediaPlane",i.MediaModel="MediaModel",i.Custom="Custom",i.Unknown="Unknown",i))(Tl||{});function og(i){if(i.length!==4)return!1;const[t,e,n,o]=i,s=t.distanceTo(e),r=e.distanceTo(n),a=n.distanceTo(o),l=o.distanceTo(t),c=t.distanceTo(n),u=e.distanceTo(o);return s===a&&r===l&&c===u}class _i extends E.Mesh{constructor(e,n,o){if(e.length!==4)throw new Error("QuadrangleMesh: Invalid number of points, it's not a quadrangle");const[s,r,a,l]=e,c=Tt(...e),u=[s.clone().sub(c),r.clone().sub(c),a.clone().sub(c),l.clone().sub(c)],h=new zl(u,o);super(h,n);f(this,"name","QuadrangleMesh");this.position.copy(c)}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}}class zl extends E.BufferGeometry{constructor(e,n){super();f(this,"name","QuadrangleGeometry");f(this,"points");this.points=e;const o=n!=null?n:og(e)?64:1;if(e.length!==4){console.error("Invalid number of points, it's not a quadrangle");return}const[s,r,a,l]=e,[c,u,h,d]=[new E.Vector2(0,0),new E.Vector2(1,0),new E.Vector2(1,1),new E.Vector2(0,1)],m=[],g=[];m.push(...s.toArray()),g.push(...c.toArray());for(let A=1;A<o;A++)m.push(s.x+(r.x-s.x)*A/o,s.y+(r.y-s.y)*A/o,s.z+(r.z-s.z)*A/o),g.push(c.x+(u.x-c.x)*A/o,c.y+(u.y-c.y)*A/o);m.push(...r.toArray()),g.push(...u.toArray()),m.push(...a.toArray()),g.push(...h.toArray());for(let A=1;A<o;A++)m.push(a.x+(l.x-a.x)*A/o,a.y+(l.y-a.y)*A/o,a.z+(l.z-a.z)*A/o),g.push(h.x+(d.x-h.x)*A/o,h.y+(d.y-h.y)*A/o);m.push(...l.toArray()),g.push(...d.toArray());const p=[];for(let A=0;A<o;A++)p.push(A,A+1,o*2-A,A,o*2-A,o*2+1-A);this.setAttribute("position",new E.BufferAttribute(new Float32Array(m),3)),this.setAttribute("uv",new E.BufferAttribute(new Float32Array(g),2)),this.setIndex(new E.BufferAttribute(new Uint32Array(p),1))}}function sg(i,t,e){const n=t!=null?t:document.createElement("video");n.preload="metadata",n.crossOrigin="anonymous",n.muted=!0,n.loop=!0,n.playsInline=!0,n.autoplay=!0;const o=new E.VideoTexture(n);return o.minFilter=E.LinearFilter,o.magFilter=E.LinearFilter,o.encoding=E.sRGBEncoding,o.metadataLoaded=!1,n.onloadedmetadata=()=>{e==null||e(o),o.dispatchEvent({type:"videoLoaded"}),o.metadataLoaded=!0},n.src=i,o}const rg="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAYAAADFw8lbAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAKqADAAQAAAABAAAAKgAAAADUGqULAAAB0ElEQVRYCe2WSUoEQRBFLVHEiVZU1I03cKW38SSewRt4A5fiTty5cQIFR9pZQWkcUNSe2/Z9yISiSGxRkUAy4BGZSVX168gistraYsQKxArECsQKxApYqkDyU5lmsznMM+ZgAGpQhaUkSRbINgLJCXiCBtSgAkVYtGGIBTKj8AgKSVahDNvQa0IUkUG4Bx91BpLdBTOS/cgUIB3a+gMwI9mFzE3a0I3z5B4r292JzGVA8tSSZILMcUDyzIykthOZvYDk+V9Ktmz4yGzhOhV4/+5YU4N/hzqo0StX3Fg5TcnNlYvgs8bPsM4hkScHoyO46haRnGEYktQVI+4ypUYKyXtxyUu27JCceAMJvjo0HoM5CEZ7cPX7i013q3IWVV5r2aw/2TK+svWbPGU68KQCa6pYeus1V0X99quSfvtVSc39lmfz2mdbz32tg1dAJ0421AVs9E7/FxBSezrMmjI/gm5/nYmMkBq+TqBs7LNgTlZH6EnWlPmORdk+pHQipUNfTxtg7p3NIXWRMvXfoqusmXsNhpC6crIS1Zf9C6yAOdlxpK5BW18CiT7A/G93gE+P0FY/RoO+RWqS62YhB2r4YhlixArECsQKxArECvzjCnwAOr0wF44ggHAAAAAASUVORK5CYII=",Bl="data:image/png;base64,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",co="data:image/png;base64,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",ag="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAMAAAANIilAAAABcVBMVEUAAAAAAAD////////+/v45OTn////////39/fp6enPz8/7+/vw8PD+/v7x8fHc3NzHx8f////////+/v77+/vr6+v////7+/v5+fn////z8/P////////q6uqgoKD+/v79/f3m5ub+/v7////////////////39/f39/f////z8/P////t7e3s7Oz29vb////5+fn////h4eH////g4ODV1dX////////BwcH///////////+Ojo5zc3MlJSX////////////////////////7+/v////////////v7+/u7u7n5+f////39/f////09PT6+vr09PT+/v76+vr////5+fnv7+/09PTk5OT////////////////Jycn///++vr7///////+0tLT///9TU1P///8SEhL////////+/v76+vr////8/Pz39/ft7e3t7e36+vr////////X19fV1dX///+xsbF9fX1iYmL///////+K8mOEAAAAenRSTlMaAIDy8CD41cWRX9uk7Kl1VVEw6dWT/M/NvKyVkY475eWIgx0Z39rHv7axnZyZmIuKhn56emZjX1FEPTU0Kx4PCAX69fTgxcKkopWL7crJuri2sa6rnIyHhX54bVtZVU9NSUcsJSIcFROno6Hcwp+ekHVxbWhnRC8nDLc9s8oAAAOGSURBVEjHpdd3X9pAGAfwkBBDAoQmBJmWvUWWiIDIHoJb66x7a4d78Op7pBQ1J5DY33987vnyXEIu3CGy/0hvnDthM+l0hj3JScSudDKOdhNPpl1i8Ut624Gi6+trI3zW1tcdqGM7/SIC5/ZRR2SNJEm7JkHt7FAJjR18WIs40P3cAFxIOaIRna6ZOHxGunk+TDR1ukjUkSr0w86bcKShiz1OI4JMP8YAD9+4emM2Gm407IfIhzm0NxrhKNsLH4SvQ+RktyvUfZIMXYcPPsSFCcvY6EYW6ZPsxuiYZaLwAW5bDY70Da5paxjvm8d+UcjAUL/GzPtCnDF/mwFWhJ75Zs68x05gxxFRGQfa+RYXokHVCC4O4yOqYLTwBjNB+ncWEZnsbzrIvOLz4CW9g4jODn0ZPO/iZN0UmhaPp0Omq+Q/nLu6NO0hErJnurjKdTBzEdAhkqILXDAdbFkJ7EnDe4EVy198srpiwhE4X1RKDFOqviBwcNPK6gmPmeWlGDz+VdHqRPEVHo0tLTM8RpcX4G+flLe6kU/Cs1pYRnm8uriQhfoC+0ZDvbMLi6ttfO5fDCDCKFrvooAKAov+c4BZvy8EzaolCHRdIZ+fBThl9G0Ih1RCrBJWbPiMKYAZ409oMSqFWAktzJ9GBuDvRoVGOIQJMSas0CiM39u45v0M9tbaeLc6F5M+7dhcbRfgg+pcU/oNa85VDwDOzBtmpP9UKsN8BuCzeb1P+kPi08+fASyr6fVPUh/PJ72+xj/bZk5PSV0YlJ4z83iC4EipS5LkiAkeHxGcQerLwMARRzyW+QklhUgKpST8nXfYg+fHkjS89MPz0MFnhKdCSWpc8RBnPAZB3RUvLt7i3oob7f5juDzuikY81tjcHlcHg9xabdyUWDvF2ay3slecr1ptimNx9lhhs1bzXQxy5NZa6VMx9pS2Wt1H77cVjFartYvBdlDICDc0cbVa3Twd2NcOyuLwVqo+K1ebjgdcr0k+O1uXwThfl8vlhqm+99kASup5GINsYhhmG8d7UXzcBgo2e21cd9WlUll5/7G958ql8uxu7y0zS5SGSkOGBA51TRiGQAi232Y9v4kVQZGavpt6c6l3tLpNsc38gGOC01IeLg4Xi8NaLz1KkqO0VzvcTrFscYo4oLjiRAsKEXeJPRqxW0bsFWLGLVbiocyZSm5vbW0nU9BsIfyp/AGqAvfOkBaFawAAAABJRU5ErkJggg==";function gn(i,t,e){if(i==="fill")return t;if(i==="contain"){const[n,o,s,r]=t,a=n.distanceTo(o),l=s.distanceTo(r),c=n.distanceTo(r),u=o.distanceTo(s),h=a,d=c,m=h/d;if(m>e){const p=d*e,A=new E.Vector3().subVectors(o,n).multiplyScalar((a-p)/2/a),v=new E.Vector3().subVectors(s,r).multiplyScalar((l-p)/2/l);return[n.clone().add(A),o.clone().sub(A),s.clone().sub(v),r.clone().add(v)]}else if(m<e){const p=h/e,A=new E.Vector3().subVectors(r,n).multiplyScalar((c-p)/2/c),v=new E.Vector3().subVectors(s,o).multiplyScalar((u-p)/2/u);return[n.clone().add(A),o.clone().add(v),s.clone().sub(v),r.clone().sub(A)]}else return t}else return console.warn(`objectFit: ${i} is not supported yet`),t}function be(i,t){this._camera=i||null,this._domElement=t||document,this._raycaster=new E.Raycaster,this._selected=null,this._boundObjs={};var e=this;this._$onClick=function(){e._onClick.apply(e,arguments)},this._$onDblClick=function(){e._onDblClick.apply(e,arguments)},this._$onMouseMove=function(){e._onMouseMove.apply(e,arguments)},this._$onMouseDown=function(){e._onMouseDown.apply(e,arguments)},this._$onMouseUp=function(){e._onMouseUp.apply(e,arguments)},this._$onTouchMove=function(){e._onTouchMove.apply(e,arguments)},this._$onTouchStart=function(){e._onTouchStart.apply(e,arguments)},this._$onTouchEnd=function(){e._onTouchEnd.apply(e,arguments)},this._$onContextmenu=function(){e._onContextmenu.apply(e,arguments)},this._domElement.addEventListener("click",this._$onClick,!1),this._domElement.addEventListener("dblclick",this._$onDblClick,!1),this._domElement.addEventListener("mousemove",this._$onMouseMove,!1),this._domElement.addEventListener("mousedown",this._$onMouseDown,!1),this._domElement.addEventListener("mouseup",this._$onMouseUp,!1),this._domElement.addEventListener("touchmove",this._$onTouchMove,!1),this._domElement.addEventListener("touchstart",this._$onTouchStart,!1),this._domElement.addEventListener("touchend",this._$onTouchEnd,!1),this._domElement.addEventListener("contextmenu",this._$onContextmenu,!1)}be.prototype.destroy=function(){this._domElement.removeEventListener("click",this._$onClick,!1),this._domElement.removeEventListener("dblclick",this._$onDblClick,!1),this._domElement.removeEventListener("mousemove",this._$onMouseMove,!1),this._domElement.removeEventListener("mousedown",this._$onMouseDown,!1),this._domElement.removeEventListener("mouseup",this._$onMouseUp,!1),this._domElement.removeEventListener("touchmove",this._$onTouchMove,!1),this._domElement.removeEventListener("touchstart",this._$onTouchStart,!1),this._domElement.removeEventListener("touchend",this._$onTouchEnd,!1),this._domElement.removeEventListener("contextmenu",this._$onContextmenu,!1)};be.eventNames=["click","dblclick","mouseover","mouseout","mousemove","mousedown","mouseup","contextmenu","touchstart","touchend"];be.prototype._getRelativeMouseXY=function(i){var t=i.target||i.srcElement;t.nodeType===3&&(t=t.parentNode);var e={x:0,y:0},n=t,o=getComputedStyle(n,null);e.y+=parseInt(o.getPropertyValue("padding-top"),10),e.x+=parseInt(o.getPropertyValue("padding-left"),10);do e.x+=n.offsetLeft,e.y+=n.offsetTop,o=getComputedStyle(n,null),e.x+=parseInt(o.getPropertyValue("border-left-width"),10),e.y+=parseInt(o.getPropertyValue("border-top-width"),10);while(n=n.offsetParent);var s={width:t===window?window.innerWidth:t.offsetWidth,height:t===window?window.innerHeight:t.offsetHeight};return{x:Number((i.pageX-e.x)/s.width)*2-1,y:-((i.pageY-e.y)/s.height)*2+1}};be.prototype._objectCtxInit=function(i){i._3xDomEvent={}};be.prototype._objectCtxDeinit=function(i){delete i._3xDomEvent};be.prototype._objectCtxIsInit=function(i){return!!i._3xDomEvent};be.prototype._objectCtxGet=function(i){return i._3xDomEvent};be.prototype.camera=function(i){return i&&(this._camera=i),this._camera};be.prototype.bind=function(i,t,e,n){console.assert(be.eventNames.indexOf(t)!==-1,"not available events:"+t),this._objectCtxIsInit(i)||this._objectCtxInit(i);var o=this._objectCtxGet(i);o[t+"Handlers"]||(o[t+"Handlers"]=[]),o[t+"Handlers"].push({callback:e,useCapture:n}),this._boundObjs[t]===void 0&&(this._boundObjs[t]=[]),this._boundObjs[t].push(i)};be.prototype.addEventListener=be.prototype.bind;be.prototype.unbind=function(i,t,e,n){console.assert(be.eventNames.indexOf(t)!==-1,"not available events:"+t),this._objectCtxIsInit(i)||this._objectCtxInit(i);var o=this._objectCtxGet(i);o[t+"Handlers"]||(o[t+"Handlers"]=[]);for(var s=o[t+"Handlers"],r=0;r<s.length;r++){var a=s[r];if(e==a.callback&&n==a.useCapture){s.splice(r,1);break}}var l=this._boundObjs[t].indexOf(i);this._boundObjs[t].splice(l,1)};be.prototype.removeEventListener=be.prototype.unbind;be.prototype._bound=function(i,t){var e=this._objectCtxGet(t);return e?!!e[i+"Handlers"]:!1};be.prototype._onMove=function(i,t,e,n){var o=this._boundObjs[i];if(!(o===void 0||o.length===0)){var s=new E.Vector2;s.set(t,e),this._raycaster.setFromCamera(s,this._camera);var r=this._raycaster.intersectObjects(o),a=this._selected;if(r.length>0){var l,c,u,h=r[0],d=h.object;this._selected=d,u=this._bound("mousemove",d),a!=d&&(l=this._bound("mouseover",d),c=a&&this._bound("mouseout",a))}else c=a&&this._bound("mouseout",a),this._selected=null;u&&this._notify("mousemove",d,n,h),l&&this._notify("mouseover",d,n,h),c&&this._notify("mouseout",a,n,h)}};be.prototype._onEvent=function(i,t,e,n){var o=this._boundObjs[i];if(!(o===void 0||o.length===0)){var s=new E.Vector2;s.set(t,e),this._raycaster.setFromCamera(s,this._camera);var r=this._raycaster.intersectObjects(o,!0);if(r.length!==0){for(var a=r[0],l=a.object,c=this._objectCtxGet(l),u=l.parent;typeof c=="undefined"&&u;)c=this._objectCtxGet(u),u=u.parent;!c||this._notify(i,l,n,a)}}};be.prototype._notify=function(i,t,e,n){var o=this._objectCtxGet(t),s=o?o[i+"Handlers"]:null;if(!o||!s||s.length===0){t.parent&&this._notify(i,t.parent,e,n);return}for(var s=o[i+"Handlers"],r=0;r<s.length;r++){var a=s[r],l=!0;a.callback({type:i,target:t,origDomEvent:e,intersect:n,stopPropagation:function(){l=!1}}),!!l&&a.useCapture===!1&&t.parent&&this._notify(i,t.parent,e,n)}};be.prototype._onMouseDown=function(i){return this._onMouseEvent("mousedown",i)};be.prototype._onMouseUp=function(i){return this._onMouseEvent("mouseup",i)};be.prototype._onMouseEvent=function(i,t){var e=this._getRelativeMouseXY(t);this._onEvent(i,e.x,e.y,t)};be.prototype._onMouseMove=function(i){var t=this._getRelativeMouseXY(i);this._onMove("mousemove",t.x,t.y,i),this._onMove("mouseover",t.x,t.y,i),this._onMove("mouseout",t.x,t.y,i)};be.prototype._onClick=function(i){this._onMouseEvent("click",i)};be.prototype._onDblClick=function(i){this._onMouseEvent("dblclick",i)};be.prototype._onContextmenu=function(i){this._onMouseEvent("contextmenu",i)};be.prototype._onTouchStart=function(i){return this._onTouchEvent("touchstart",i)};be.prototype._onTouchEnd=function(i){return this._onTouchEvent("touchend",i)};be.prototype._onTouchMove=function(i){if(i.touches.length==1){var t=Number(i.touches[0].pageX/window.innerWidth)*2-1,e=-(i.touches[0].pageY/window.innerHeight)*2+1;this._onMove("mousemove",t,e,i),this._onMove("mouseover",t,e,i),this._onMove("mouseout",t,e,i)}};be.prototype._onTouchEvent=function(i,t){var e=t.touches;if(e.length==0&&(e=t.changedTouches),e.length==1){var n=Number(e[0].pageX/window.innerWidth)*2-1,o=-(e[0].pageY/window.innerHeight)*2+1;this._onEvent(i,n,o,t)}};class lg extends be{constructor(e){super(e.camera,e.getElement());f(this,"mouseInfo");f(this,"clickHandlerMap",new Map);const n=()=>this.preventWhenMouseDown();e.on("wantsMoveToPano",n),e.on("wantsTapGesture",n)}addAutoBindEventListener(...e){const n=e[0];n.addEventListener("added",()=>{this.addEventListener(...e)}),n.addEventListener("removed",()=>{this.removeEventListener(...e)}),n.addEventListener("dispose",()=>{this.removeEventListener(...e)})}addEventListener(e,n,o,s){const r=u=>{if(vn(e)===!1){this.mouseInfo=void 0;return}const h=u.origDomEvent;this.mouseInfo={x:h.clientX,y:h.clientY,isDown:!0,mouseDownTimestamp:Date.now()}},a=u=>{if(vn(e)===!1){this.mouseInfo=void 0;return}const h=u.origDomEvent;!this.mouseInfo||(this.mouseInfo.isDown&&this.mouseInfo.x===h.clientX&&this.mouseInfo.y===h.clientY&&Date.now()-this.mouseInfo.mouseDownTimestamp<400&&o(h),this.mouseInfo=void 0)},l=u=>{if(vn(e)===!1){this.mouseInfo=void 0;return}const h=u.origDomEvent;this.mouseInfo={x:Math.floor(h.touches[0].clientX),y:Math.floor(h.touches[0].clientY),isDown:!0,mouseDownTimestamp:Date.now()}},c=u=>{if(vn(e)===!1){this.mouseInfo=void 0;return}const h=u.origDomEvent;!this.mouseInfo||(this.mouseInfo.isDown&&this.mouseInfo.x===Math.floor(h.changedTouches[h.changedTouches.length-1].clientX)&&this.mouseInfo.y===Math.floor(h.changedTouches[h.changedTouches.length-1].clientY)&&Date.now()-this.mouseInfo.mouseDownTimestamp<400&&o(h),this.mouseInfo=void 0)};n==="click"?(super.addEventListener(e,"mousedown",r,s),super.addEventListener(e,"mouseup",a,s),super.addEventListener(e,"touchstart",l,s),super.addEventListener(e,"touchend",c,s),this.clickHandlerMap.set(o,{mousedown:r,mouseup:a,touchstart:l,touchend:c})):super.addEventListener(e,n,o,s)}removeEventListener(e,n,o,s){if(n==="click"){const r=this.clickHandlerMap.get(o);r&&(super.removeEventListener(e,"mousedown",r.mousedown,s),super.removeEventListener(e,"mouseup",r.mouseup,s),super.removeEventListener(e,"touchstart",r.touchstart,s),super.removeEventListener(e,"touchend",r.touchend,s),this.clickHandlerMap.delete(o))}else super.removeEventListener(e,n,o,s)}preventWhenMouseDown(){var e;if((e=this.mouseInfo)!=null&&e.isDown)return!1}}function vn(i){return i?i.visible===!1?!1:vn(i.parent):!0}class cg extends E.ShaderMaterial{constructor(e){super();f(this,"transparent",!1);f(this,"blending",E.CustomBlending);f(this,"blendSrc",E.SrcAlphaFactor);f(this,"blendDst",E.OneMinusSrcAlphaFactor);f(this,"blendSrcAlpha",E.OneFactor);f(this,"blendDstAlpha",E.OneMinusSrcAlphaFactor);f(this,"vertexShader",`
|
|
530
|
+
`,e.container.style.pointerEvents="none";const n=A=>(e.wrapper=A,A.appendChild(e.container),l(),!0),o=A=>{e.itemLabels=Ip(A),l()},s=()=>(e.enabled||(e.enabled=!0,l()),!0),r=()=>(e.enabled&&(e.enabled=!1,l()),!0),a=()=>{u(),e.container.remove()},l=()=>{var A;if(!!e.wrapper){if(!e.enabled||!e.fiveModeEnabled){(A=e.app)==null||A.$destroy(),e.app=void 0;return}e.app?e.app.$set({five:i,itemLabels:e.itemLabels}):e.app=new Cp({target:e.container,props:{five:i,modelOcclusionEnable:e.modelOcclusionEnable,onlyVisibleInPanorama:e.onlyVisibleInPanorama,itemLabels:e.itemLabels,wrapper:e.wrapper,hooks:e.hooks,displayStrategyType:e.displayStrategyType,maxVisibleDistance:e.maxVisibleDistance}})}},c=()=>{i.on("modeChange",h),i.once("dispose",a)},u=()=>{i.off("modeChange",h)},h=A=>{if(A!==Ee.Five.Mode.Panorama){e.fiveModeEnabled=!1,r();return}i.once("initAnimationEnded",()=>{e.fiveModeEnabled=!0,s()})};return c(),{appendTo:n,load:o,enable:s,disable:r,dispose:a,hooks:e.hooks}},Dp={name:"ItemLabelPlugin",version:0};class Lp extends Dn{constructor(e){super(e);f(this,"state");f(this,"container");f(this,"enabled");this.five=e,this.five.once("dispose",this.dispose),this.enabled=!0,this.state=this.initState()}enable(e){this.enabled=!0,this.updateState(fe(Q({},e),{userAction:!0}))}disable(e){this.enabled=!1,this.updateState(fe(Q({},e),{userAction:!0}))}show(e){if(!!this.state.enabled)return this.setState(fe(Q({},this.state),{visible:!0}),e),Promise.resolve()}hide(e){if(!!this.state.enabled)return this.setState(fe(Q({},this.state),{visible:!1}),e),Promise.resolve()}dispose(){this.container.remove()}setState(e,n){if(!this.enabled)return;const o=Q({},this.state);this.state=Q(Q(Q({},this.state),e),n),this.stateChangedCallback(o,n)}get visible(){return this.five.state.mode===Ee.Five.Mode.Panorama}appendTo(e){!this.enabled||(this.container=e,this.render())}updateState(e){this.setState(fe(Q({},this.state),{enabled:this.enabled,visible:this.visible}),e)}}function Mp(i){le(i,"svelte-wpy7pz",'.plugin-DoorLabelPlugin-item.svelte-wpy7pz.svelte-wpy7pz{position:absolute;left:0;top:0;width:0;height:0;pointer-events:none;transition:opacity 0.3s ease}.plugin-DoorLabelPlugin-cnt.svelte-wpy7pz.svelte-wpy7pz{position:absolute;top:50%;left:50%;border-radius:0.125rem;background:rgba(0, 0, 0, 0.35);line-height:0.75rem;padding:0.375rem;white-space:nowrap;font-size:0.75rem;font-style:normal;color:white;display:flex;align-items:center;justify-content:center;cursor:pointer;transition:transform ease 1s, background ease 0.3s, color ease 0.3s}.plugin-DoorLabelPlugin-cnt.svelte-wpy7pz.svelte-wpy7pz::after{content:"";display:block;position:absolute;top:-0.0625rem;left:-0.0625rem;bottom:-0.0625rem;right:-0.0625rem;border-radius:0.125rem;border:0.0625rem solid rgba(0, 0, 0, 0);-o-border-image:url("//vrlab-image4.ljcdn.com/release/web/highlightCarouseal-border-image.14b51834.png") 4;border-image:url("//vrlab-image4.ljcdn.com/release/web/highlightCarouseal-border-image.14b51834.png") 4;transition:opacity ease 0.3s}.plugin-DoorLabelPlugin-cnt.svelte-wpy7pz.svelte-wpy7pz:active,.plugin-DoorLabelPlugin-cnt.svelte-wpy7pz.svelte-wpy7pz:focus{background:rgba(0, 0, 0, 0.5);color:rgba(255, 255, 255, 0.5)}.plugin-DoorLabelPlugin-icon.svelte-wpy7pz.svelte-wpy7pz{background:url("//vrlab-image4.ljcdn.com/release/web/DoorLabel-icon.de1304ae.svg") no-repeat;background-size:100%;display:inline-block;width:0.625rem;height:0.625rem;margin-left:0.25rem;transform-origin:center}.plugin-DoorLabelPlugin-cnt[data-camera-toward=forward].left.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=forward].right.svelte-wpy7pz .plugin-DoorLabelPlugin-txt.svelte-wpy7pz{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=forward].right.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(-90deg);margin-left:0;margin-right:0.25rem;order:0}.plugin-DoorLabelPlugin-cnt[data-camera-toward=right].forward.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=right].back.svelte-wpy7pz .plugin-DoorLabelPlugin-txt.svelte-wpy7pz{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=right].back.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(-90deg);margin-left:0;margin-right:0.25rem;order:0}.plugin-DoorLabelPlugin-cnt[data-camera-toward=left].back.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=left].forward.svelte-wpy7pz .plugin-DoorLabelPlugin-txt.svelte-wpy7pz{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=left].forward.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(-90deg);margin-left:0;margin-right:0.25rem;order:0}.plugin-DoorLabelPlugin-cnt[data-camera-toward=back].right.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=back].left.svelte-wpy7pz .plugin-DoorLabelPlugin-txt.svelte-wpy7pz{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=back].left.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{transform:rotate(-90deg);margin-left:0;margin-right:0.25rem;order:0}.plugin-DoorLabelPlugin-cnt--customBrand.svelte-wpy7pz.svelte-wpy7pz{color:#f9eac1}.plugin-DoorLabelPlugin-cnt--customBrand.svelte-wpy7pz .plugin-DoorLabelPlugin-icon.svelte-wpy7pz{background:url("//vrlab-image4.ljcdn.com/release/web/arrow.6e8ec00e.svg") no-repeat}.plugin-DoorLabelPlugin-cnt--customBrand.svelte-wpy7pz.svelte-wpy7pz:active,.plugin-DoorLabelPlugin-cnt--customBrand.svelte-wpy7pz.svelte-wpy7pz:focus{background:rgba(0, 0, 0, 0.5);color:rgba(249, 234, 193, 0.5)}')}function Sp(i){let t,e,n,o,s,r,a,l;return{c(){t=B("div"),e=B("div"),n=B("span"),n.textContent=`${i[8]}`,o=$(),s=B("i"),y(n,"class","plugin-DoorLabelPlugin-txt svelte-wpy7pz"),y(s,"class","plugin-DoorLabelPlugin-icon svelte-wpy7pz"),y(e,"class",r=Ie(Oe.default("plugin-DoorLabelPlugin-cnt",i[0].toward))+" svelte-wpy7pz"),y(e,"style",`transform: ${i[6]||"initial"};pointer-events: ${i[5]?"auto":"none"};opacity: ${i[5]?1:0}`),y(e,"data-camera-toward",i[7]),y(t,"style",`left: ${i[3]||0}%;top: ${i[4]||0}%;opacity: ${i[5]?1:0}`),y(t,"class","plugin-DoorLabelPlugin-item svelte-wpy7pz")},m(c,u){T(c,t,u),V(t,e),V(e,n),V(e,o),V(e,s),i[10](t),a||(l=me(e,"click",i[9]),a=!0)},p(c,[u]){u&1&&r!==(r=Ie(Oe.default("plugin-DoorLabelPlugin-cnt",c[0].toward))+" svelte-wpy7pz")&&y(e,"class",r)},i:X,o:X,d(c){c&&M(t),i[10](null),a=!1,l()}}}function Tp(i,t,e){let{props:n}=t,{onClick:o}=t,s,{left:r,top:a,inSight:l,transform:c,panoIndex:u,cameraToward:h,name:d}=n;const m=()=>{if(!r||!a||!l||!s)return;const A=s.current.clientWidth/window.innerWidth*100,v=s.current.clientHeight/window.innerHeight*100;r<=A/2||r>=100-A/2||a<=v/2||a>=100-v/2},g=A=>{o&&o()};function p(A){Ve[A?"unshift":"push"](()=>{s=A,e(2,s)})}return i.$$set=A=>{"props"in A&&e(0,n=A.props),"onClick"in A&&e(1,o=A.onClick)},m(),[n,o,s,r,a,l,c,h,d,g,p]}class zp extends oe{constructor(t){super(),ie(this,t,Tp,Sp,ne,{props:0,onClick:1},Mp)}}function Bp(i,t){const e=Math.abs(i.top+i.height/2-t.top-t.height/2),n=Math.abs(i.left+i.width/2-t.left-t.width/2),o=(i.height+t.height)/2,s=(i.width+t.width)/2;return!(e>o&&n>s)}function Vp(i){const{camera:t}=i,e=t.getWorldDirection(new j.Vector3);let n=Math.atan(e.z/e.x)*180/Math.PI,o="";return e.x<0&&(n+=180),n<0&&(n+=360),n>315||n<=45?o="right":n>45&&n<=135?o="back":n>135&&n<=225?o="left":n>225&&n<=315&&(o="forward"),o}function jp(i,t){return Math.sqrt(Math.pow(i.z-t.z,2)+Math.pow(i.x-t.x,2))}function Op(i){const t=Math.PI/4;return i>-t&&i<=t?"left":i>t*3||i<=-t*3?"right":i>-t*3&&i<=-t?"forward":i>t&&i<=t*3?"back":""}const Rp={userAction:!0};class Qp extends Lp{constructor(e){super(e);f(this,"MinVisibledistance",1.8);f(this,"MaxVisibledistance",5);f(this,"OffsetHeight",-1.3);f(this,"rooms");f(this,"floorplanServerData");f(this,"doorLabelItems");f(this,"visibleLabelMap",new Map);f(this,"labelItems",[]);f(this,"doorLabels");f(this,"roomObservers");f(this,"loadData",(e,n)=>{n&&(this.MaxVisibledistance=n.MaxVisibledistance,this.MinVisibledistance=n.MinVisibledistance,this.OffsetHeight=n.OffsetHeight),this.doorLabelItems&&this.doorLabelItems.length>0&&this.doorLabelItems.forEach(o=>{o.$destroy()}),this.labelItems=[],this.doorLabels=[],this.doorLabelItems=[],this.floorplanServerData=e,typeof this.five.ready=="function"?this.five.ready().then(()=>this.initData()):this.five.once("panoArrived",()=>{this.initData()})});f(this,"initRoomObservers",()=>{var s,r;const e=this.floorplanServerData.computed_data.floor_datas||[],o=(((r=(s=this.five)==null?void 0:s.work)==null?void 0:r.observers)||[]).map(a=>{const l=a.panoIndex,c=a.floorIndex,u=e==null?void 0:e.find(h=>h.floor_index===c);if(u){const h=u.rooms.find(d=>d.observer_indexs.includes(l));if(h)return{panoIndex:l,floorIndex:c,name:h.name}}}).filter(Boolean);this.roomObservers=o});f(this,"hideAllLabels",()=>{this.labelItems.forEach(e=>{e.visible=!1,e.inSight=!1}),this.render()});f(this,"fixDoorVisibleAndPosition",()=>{this.initRoomObservers();const{panoIndex:e}=this.five;if(!this.visible||this.five.model.empty||e===null||!this.roomObservers.find(a=>a.panoIndex===e))return;const n=this.roomObservers.find(a=>a.panoIndex===e),s=this.five.work.observers.find(a=>a.panoIndex===e).position.clone(),r=(()=>{if(this.visibleLabelMap.has(e))return this.visibleLabelMap.get(e);{const a=[];return this.doorLabels.forEach((l,c)=>{if(l.roomName===n.name)return;const u=l.position.clone(),h=u.distanceTo(s);if(h<this.MinVisibledistance||h>this.MaxVisibledistance)return;const d=new j.Raycaster,m=u.clone().sub(s).normalize();d.set(s,m);const[g]=this.five.model.intersectRaycaster(d);g&&g.distance+.1<h||a.push(c)}),this.visibleLabelMap.set(e,a),a}})();this.labelItems.forEach((a,l)=>{a.visible=r.includes(l)}),this.fixDoorPosition()});f(this,"fixDoorPosition",()=>{var u,h,d,m,g,p,A,v,b,w,k,I;const{panoIndex:e,camera:n}=this.five;if(e===null)return;if(this.five.currentMode!=="Panorama")return this.hideAllLabels();const o=this.five.getElement(),s=o.clientWidth,r=o.clientHeight,a=n.getWorldDirection(new j.Vector3),l=[],c=[...this.labelItems];if(c.forEach((P,L)=>{if(P.visible){const x=n.position.distanceTo(P.position),F=P.position.clone().add(new j.Vector3(0,this.OffsetHeight,0)),R=F.clone().sub(n.position).normalize().angleTo(a),S=F.clone().project(n),O=(S.x+1)/2.2*100,G=(-S.y+1)/2.2*100,W=O>=0&&O<=100&&G>=0&&G<=100&&x>this.MinVisibledistance&&x<=this.MaxVisibledistance;P.left=O,P.top=G,P.inSight=W&&R<Math.PI/2,P.cameraToward=Vp(this.five),W?l.push({disFromCameraToLabel:x,left:O,top:G,index:L}):P.transform="translate(-50%, -50%)"}else P.inSight=!1}),l.length>1){let P=0;l.sort((L,x)=>x.disFromCameraToLabel-L.disFromCameraToLabel);for(let L=1;L<l.length;L++){const{index:x,left:F,top:N}=l[L-1],{index:R,left:S,top:O}=l[L],G=this.container.children[x],W=this.container.children[R];if(!G||!W)return;const Y={left:s*F/100,top:r*N/100,width:(d=(h=(u=G.children)==null?void 0:u[0])==null?void 0:h.clientWidth)!=null?d:0,height:(p=(g=(m=G.children)==null?void 0:m[0])==null?void 0:g.clientHeight)!=null?p:0},_={left:s*S/100,top:r*O/100,width:(b=(v=(A=W.children)==null?void 0:A[0])==null?void 0:v.clientWidth)!=null?b:0,height:(I=(k=(w=W.children)==null?void 0:w[0])==null?void 0:k.clientHeight)!=null?I:0};Bp(Y,_)&&(P++,c[x].transform=`translate(-50%, ${(P-1)*100-50}%)`,c[R].transform=`translate(-50%, ${P*100-50}%)`)}}this.labelItems=c,this.render()});f(this,"onClick",(e,n)=>{if(!this.roomObservers)return;const{work:o}=this.five;let s,r,a=1/0;for(const l of o.observers)if(this.roomObservers.find(u=>u.panoIndex===l.panoIndex&&u.name===e)){const u=l.standingPosition,h=n.distanceTo(u);h<a&&(s=l.panoIndex,r=u.clone().sub(n).normalize(),a=h)}if(r!==null&&s!==null){const l={};if(a>0){const u=new j.Vector3(0,0,-1),h=r.clone(),d=new j.Quaternion;d.setFromUnitVectors(u,h);const m=new j.Euler;m.setFromQuaternion(d,"YXZ"),l.longitude=m.y}this.five.emit("wantsToMoveToPano",s,{},!0)||this.five.moveToPano(s,{longitude:l.longitude})}});f(this,"initData",()=>{var s;this.doorLabels=[];const e=this.five.panoIndex,n=this.floorplanServerData.computed_data.observers[e].floor_index,o=n!==void 0&&((s=this.floorplanServerData.computed_data.floor_datas[n])==null?void 0:s.rooms);this.rooms=o,this.rooms&&this.rooms.length>0&&this.rooms.forEach(r=>{var c;const a=(c=this.floorplanServerData.computed_data.doors)==null?void 0:c.filter(u=>!!(u&&u.name===r.name)),l=this.five.work.observers.filter((u,h)=>!!r.observer_indexs.find(d=>d===h));a&&a.forEach(u=>{const h=u.position;let d=1/0,m;l.forEach(p=>{const A=p.standingPosition,v={x:A.x,y:A.y,z:A.z},b=jp(h,v);b<d&&(d=b,m=v)}),m&&(h.y=m.y+.01);const g=new j.Vector3(h.x,h.y,h.z);g.add(new j.Vector3(-.2,1.8,0).applyEuler(new j.Euler(0,u.rad,0))),this.doorLabels.push({roomName:r.name,name:u.name,position:g,toward:Op(u.rad)})})}),this.labelItems=this.doorLabels.map(r=>fe(Q({},r),{left:0,top:0,visible:!1,inSight:!1,transform:"",cameraToward:""})),this.five.on("wantsToMoveToPano",this.hideAllLabels),this.five.on("modelLoaded",this.fixDoorVisibleAndPosition),this.five.on("panoArrived",this.fixDoorVisibleAndPosition),this.five.on("initAnimationEnded",this.fixDoorPosition),this.five.on("cameraUpdate",this.fixDoorPosition),this.five.on("mouseWheel",this.fixDoorPosition),this.five.on("pinchGesture",this.fixDoorPosition),this.fixDoorVisibleAndPosition()})}stateChangedCallback(e,n){if(this.hooks.hasListener("stateChange")){const o={state:this.state,prevState:e,userAction:n?n.userAction:Rp.userAction};this.hooks.emit("stateChange",o)}}render(){if(!this.enabled){this.doorLabelItems&&this.doorLabelItems.length>0&&this.doorLabelItems.forEach(e=>{e==null||e.$destroy()}),this.doorLabels=void 0;return}this.doorLabelItems&&this.doorLabelItems.forEach(e=>{e.$destroy()}),this.doorLabelItems=[],this.labelItems.forEach(e=>{this.doorLabelItems.push(new zp({target:this.container,props:{props:e,onClick:()=>{this.onClick(e.name,e.position)}}}))})}initState(){return{enabled:!0,visible:!0}}dispose(){this&&this.five&&(this.five.off("wantsToMoveToPano",this.hideAllLabels),this.five.off("modelLoaded",this.fixDoorVisibleAndPosition),this.five.off("panoArrived",this.fixDoorVisibleAndPosition),this.five.off("initAnimationEnded",this.fixDoorPosition),this.five.off("cameraUpdate",this.fixDoorPosition),this.five.off("mouseWheel",this.fixDoorPosition),this.five.off("pinchGesture",this.fixDoorPosition),super.dispose())}}const Fp=i=>new Qp(i),Hp=2,Gp=3,Wp=3,_p=2;function Np(i,t){var r,a,l;if(i.length<2)return console.warn("positionList length must be greater than 1"),[];const e=(r=t==null?void 0:t.unitWidth)!=null?r:.5,n=(a=t==null?void 0:t.unitHeight)!=null?a:.5,o=(l=t==null?void 0:t.skipPanoIndexMesh)!=null?l:!1,s=new E.CatmullRomCurve3(i,!1,"catmullrom",1);if(o){const c=Math.ceil(s.getLength()/n*1.5),u=s.getPoints(c),h=[];let d=0;const m=i;return m.forEach((g,p)=>{let A=0,v=99999999;u.forEach((P,L)=>{const x=P.distanceTo(g);x<v&&(A=L,v=x)});const b=u[A+1],w=b==null?void 0:b.distanceTo(g),k=u[A-1],I=k==null?void 0:k.distanceTo(g);if(A>d&&A-d>1){let P=A;k!==void 0&&I>.8&&(P=A+1),k!==void 0&&I>.2&&I<.3?P=A:v>.2&&v<.3&&(P=A+1);let L=d;if(b!==void 0&&w>.2&&w<.3?L=d+1:v>.2&&v<.3&&(L=d),u[L]&&u[L+1]){const N=m[p-1];if(N)if(N.equals(u[L]))L+=1;else{const R=new j.Vector3().subVectors(u[L+1],u[L]),S=new j.Vector3().subVectors(N,u[L]);R.angleTo(S)<Math.PI/2&&(L+=1)}}if(P<L||P-L<=1)return;const x=u.slice(L,P),F=tr(x,e,n);h.push(F),d=A}}),h}else{const c=Math.ceil(s.getLength()),u=s.getPoints(c);return[tr(u,e,n)]}}function tr(i,t,e){const n=t/2,o=e/t,s=i.length,r=kc.default(i.map(v=>[v.x,v.z])),l=(i.length-1)*Hp*Gp,c=2*s,u=c*Wp,h=c*_p,d=new Uint32Array(l),m=new Float32Array(u),g=new Float32Array(h);i.forEach((v,b)=>{});let p=0;for(let v=0;v<i.length;v++){const[b,w]=r[v][0],k=i[v],{x:I,y:P,z:L}=k,x=new j.Vector3(I+b*n,P+.05,L+w*n);m[v*6+0]=x.x,m[v*6+1]=x.y,m[v*6+2]=x.z;const F=new j.Vector3(I-b*n,P+.05,L-w*n);m[v*6+3]=F.x,m[v*6+4]=F.y,m[v*6+5]=F.z,p+=v>0?i[v-1].clone().sub(i[v]).length():0;const N=p/t/o;g[v*4+0]=0,g[v*4+1]=N,g[v*4+2]=1,g[v*4+3]=N,v!==i.length-1&&(d[v*6+0]=v*2+0,d[v*6+1]=v*2+2,d[v*6+2]=v*2+1,d[v*6+3]=v*2+2,d[v*6+4]=v*2+3,d[v*6+5]=v*2+1)}const A=new E.BufferGeometry;return A.setAttribute("position",new E.BufferAttribute(m,3)),A.setAttribute("uv",new E.BufferAttribute(g,2)),A.setIndex(new E.BufferAttribute(d,1)),A}function Xp(i){const t=new E.TextureLoader().load(i.textureUrl);return t.wrapS=t.wrapT=E.RepeatWrapping,t.encoding=E.sRGBEncoding,t.minFilter=E.LinearFilter,new E.MeshBasicMaterial({color:16777215,map:t,transparent:!0,opacity:.8})}function Yp(i){return!wt(i)}function wt(i){return i!=null}const kl="v1.1.0",xl="GuideLinePlugin",lo=`${xl}@${kl}`,nr=i=>`${lo}--${i}`;class Dl extends Bt{constructor(e,n){super(e,n);f(this,"state",{visible:!1,enabled:!0,disposed:!1});f(this,"data");f(this,"linesGroup");f(this,"disposedErrorLog",()=>{console.error(`${lo} is disposed`)});f(this,"actionWhenEnabled",e=>{if(this.state.enabled)return e()});Object.assign(window,{[`__${xl}_DEBUG__`]:this})}load(e,n,o=!0){return H(this,null,function*(){const s=this.data?JSON.parse(JSON.stringify(this.data)):void 0,r=yield this.formatData(e);this.hooks.emit("dataChange",r,s),this.data=r,this.linesGroup&&this.five.scene.remove(this.linesGroup);const a=this.getLinesGroup(r.routes,r.config);!a||(this.linesGroup=a,yield this.waitFiveModelLoaded(),this.five.scene.add(a),this.handleVisible(this.state.visible),this.handleEnable(this.state.enabled),n&&this.setState(n),this.five.needsRender=!0,this.hooks.emit("dataLoaded",r),console.info(`${lo} loaded`,r))})}formatData(e){return H(this,null,function*(){return typeof e=="object"&&e!==null&&e.version&&e.data?e.data:e})}show(e){return H(this,null,function*(){this.setState({visible:!0},e)})}hide(e){return H(this,null,function*(){this.setState({visible:!1},e)})}enable(e){this.setState({enabled:!0},e)}disable(e){this.setState({enabled:!1},e)}dispose(){this.setState({disposed:!0})}setState(e,n){var s;if(this.state.disposed)return this.disposedErrorLog();const o=Q({},this.state);this.state=Q(Q({},this.state),e),e.disposed!==void 0&&e.disposed!==o.disposed&&e.disposed&&this.handleDispose(),e.visible!==void 0&&e.visible!==o.visible&&this.handleVisible(e.visible,n==null?void 0:n.userAction),e.enabled!==void 0&&e.enabled!==o.enabled&&this.handleEnable(e.enabled,n==null?void 0:n.userAction),it(o,this.state,{deep:!0})||(this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:(s=n==null?void 0:n.userAction)!=null?s:!0}),this.five.needsRender=!0)}handleEnable(e,n=!0){this.linesGroup&&(e?(this.five.scene.add(this.linesGroup),this.actionWhenEnabled(()=>this.hooks.emit("enable",{userAction:n}))):(this.five.scene.remove(this.linesGroup),this.hooks.emit("disable",{userAction:n})))}handleVisible(e,n=!0){this.linesGroup&&(e?(this.linesGroup.visible=!0,this.actionWhenEnabled(()=>this.hooks.emit("show",{userAction:n}))):(this.linesGroup.visible=!1,this.actionWhenEnabled(()=>this.hooks.emit("hide",{userAction:n}))))}handleDispose(){this.linesGroup&&this.five.scene.remove(this.linesGroup),this.hooks.emit("dispose")}getLinesGroup(e,n){const o=e.map(r=>this.getLine(r,n)).filter(wt),s=new E.Group;if(s.name=nr("route-group"),o.length!==0)return s.add(...o),s}getLine(e,n){var l,c,u,h,d,m,g,p;const o=new E.Group,s=e.panoIndexList.map(A=>{var v;return(v=this.five.work.observers[A])==null?void 0:v.standingPosition}).filter(wt),r=Np(s,{skipPanoIndexMesh:(c=(l=e.skipPanoIndexMesh)!=null?l:n==null?void 0:n.skipPanoIndexMesh)!=null?c:!0,unitWidth:(h=(u=e.unitWidth)!=null?u:n==null?void 0:n.unitWidth)!=null?h:.6,unitHeight:(m=(d=e.unitHeight)!=null?d:n==null?void 0:n.unitHeight)!=null?m:.4});if(!r)return;const a=Xp({textureUrl:(p=(g=e.arrowTextureUrl)!=null?g:n==null?void 0:n.arrowTextureUrl)!=null?p:this.staticPrefix+"/release/web/arrow6.b6ce0c62.png"});return r.forEach(A=>{const v=new E.Mesh(A,a);v.name=nr("route-line-mesh"),o.add(v)}),o}waitFiveModelLoaded(){return H(this,null,function*(){return new Promise(e=>{if(this.five.model.loaded){e();return}this.five.once("modelLoaded",()=>{e()})})})}}f(Dl,"lasestVersion",kl);const Ll=(i,t)=>new Dl(i,t);function ir(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 Up(i,t){const e=ir(i),n=ir(t);return e.angleTo(n)}const qp=i=>H(exports,null,function*(){try{i().then(()=>{},()=>{}).catch(()=>{})}catch(t){}}),Xn=Math.PI*2;function Jp(i){return i>=0&&i<Xn?i:(i%Xn+Xn)%Xn}function Zp(i){return{longitude:Jp(-Math.atan2(i.x,-i.z)),latitude:-Math.asin(i.y/1)}}function Kp(i,t,e,n){const o=-i/e,s=i;return o*n+s}function $p(i){return new Promise(t=>{setTimeout(()=>{t()},i)})}const Ml="v1.0.6",Sl="CruisePlugin",xi=`${Sl}@${Ml}`,or=()=>{console.error(`${xi} is disposed`)},eg=()=>{console.warn(`${xi} is disabled`)},tg=()=>{console.error(`${xi} is disabled`)},Gi=new Map;class xo extends Bt{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,{[`__${Sl}_DEBUG__`]:this});const o=this.setFiveLinearUpdateCamera.bind(this),s=this.setFiveOriginUpdateCamera.bind(this);this.hooks.on("play",o),this.hooks.on("broke",s),this.hooks.on("end",s),this.hooks.on("pause",s),this.privateState.disposers.push(()=>{this.hooks.off("play",o),this.hooks.off("broke",s),this.hooks.off("end",s),this.hooks.off("pause",s)})}load(e,n,o){return H(this,null,function*(){var u,h,d,m,g;if(this.state.disposed)return or();this.privateState.fiveOriginGetProgress||(h=(u=this.five.controller)==null?void 0:u.cameraMotion)!=null&&h.getProgress||(yield this.waitFiveLoaded(),this.privateState.fiveOriginGetProgress=(m=(d=this.five.controller)==null?void 0:d.cameraMotion)==null?void 0:m.getProgress),this.clear();const s=this.data?JSON.parse(JSON.stringify(this.data)):void 0,r=yield this.formatData(e);this.data=r,this.hooks.emit("dataChange",r,s);let a=[],l;const c=this.data.keyframes.filter(p=>p.data.panoIndex!==void 0);c.filter((p,A)=>{var v;return p.data.panoIndex!==((v=c[A-1])==null?void 0:v.data.panoIndex)}).map(p=>p.data.panoIndex).forEach(p=>{var v,b;const A=(v=this.five.work.observers[p])==null?void 0:v.floorIndex;if(A!==void 0)if(l===A){const w=a.length-1;a[w]=[...(b=a[w])!=null?b:[],p]}else{l=A;const w=a.length;a[w]=[p]}}),this.GuideLine||(this.GuideLine=Ll(this.five,this.config)),(g=this.GuideLine)==null||g.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:o}),console.info(`${xi} loaded`,r),this.hooks.emit("dataLoaded",r)})}play(e){this.setState({playing:!0},e)}playFrom(e){const{index:n,id:o,userAction:s}=e;this.state.playing&&this.setState({playing:!1},{userAction:s}),this.setState({playing:!0},{userAction:s,playFromIndex:n,playFromId:o})}playFromStart(e){return this.playFrom(fe(Q({},e),{index:0}))}pause(e){this.setState({playing:!1},e)}show(e){return H(this,null,function*(){this.setState({visible:!0},e)})}hide(e){return H(this,null,function*(){this.setState({visible:!1},e)})}enable(e){this.setState({enabled:!0},e)}disable(e){this.setState({enabled:!1},e)}dispose(){this.setState({disposed:!0})}setState(e,n){var s;if(this.state.disposed)return or();if(!this.state.enabled&&e.enabled!==!0&&e.disposed!==!0)return tg();const o=Q({},this.state);this.state=Q(Q({},this.state),e),e.disposed!==void 0&&e.disposed!==o.disposed&&e.disposed&&this.handleDispose(),e.visible!==void 0&&e.visible!==o.visible&&this.handleVisible(e.visible,n==null?void 0:n.userAction),e.enabled!==void 0&&e.enabled!==o.enabled&&this.handleEnable(e.enabled,n==null?void 0:n.userAction),e.playing!==void 0&&e.playing!==o.playing&&this.changePlayState(e.playing,n),e.speed!==void 0&&e.speed!==o.speed&&this.changeSpeed(e.speed,n==null?void 0:n.userAction),it(o,this.state,{deep:!0})||this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:(s=n==null?void 0:n.userAction)!=null?s:!0})}formatData(e){return H(this,null,function*(){this.five.work||(yield this.waitFiveLoaded());const n=this.five.work.observers,o=(()=>{const s=e;return typeof s=="object"&&s!==null&&s.version&&s.data?s.data:s})();if(o.keyframes)return{keyframesId:Ge(),keyframes:o.keyframes.map((s,r)=>{var c;const a=o.keyframes[r+1],l=(()=>!a||a.start===void 0||s.end===void 0?0:a.start-s.end)();return fe(Q({id:(c=s.uuid)!=null?c:Ge(),moveIndex:r,stay:l,index:r},s),{guildPluginOptions:o.guildPluginOptions})})};if(o.panoIndexList){let s=[];const{moveEffect:r,moveToFirstPanoEffect:a,moveToFirstPanoDuration:l}=o;return this.privateState.moveToFirstPanoEffect=a,this.privateState.moveToFirstPanoDuration=l,o.panoIndexList.forEach((c,u)=>{const h=(()=>{var A,v,b,w;const d=o.panoIndexList.slice(u).find(k=>k!==c);if(d===void 0)return;const m=(A=n[c])==null?void 0:A.position,g=(v=n[d])==null?void 0:v.position;if(!g||!m||((b=n[c])==null?void 0:b.floorIndex)!==((w=n[d])==null?void 0:w.floorIndex))return;const p=new E.Vector3().subVectors(g,m);return Zp(p.normalize())})();o.moveType===void 0||o.moveType==="justMove"?s.push({moveIndex:u,stay:o.stay,data:Q({effect:"Move",panoIndex:c,moveEffect:r},h!=null?h:{})}):o.moveType==="moveAndRotate"&&(s.push({moveIndex:u,stay:o.stay,data:{effect:"Move",panoIndex:c,moveEffect:r}}),h&&s.push({moveIndex:u,stay:o.stay,data:Q({effect:"Rotate",panoIndex:c},h)}))}),{keyframesId:Ge(),keyframes:s.map((c,u)=>Q({id:Ge(),index:u},c)),guildPluginOptions:o.guildPluginOptions}}else throw new Error("format error: data no keyframes or no panoIndexList")})}handleEnable(e,n=!0){var o,s;e?((o=this.GuideLine)==null||o.enable(),this.hooks.emit("enable",{userAction:n})):((s=this.GuideLine)==null||s.disable(),this.changePlayState(!1,{userAction:n}),this.hooks.emit("disable",{userAction:n})),this.state.enabled=e}handleVisible(e,n=!0){var o,s;e?((o=this.GuideLine)==null||o.show(),this.actionIfStateIsEnabled(()=>this.hooks.emit("show",{userAction:n}))):((s=this.GuideLine)==null||s.hide(),this.actionIfStateIsEnabled(()=>this.hooks.emit("hide",{userAction:n}))),this.state.visible=e}changePlayState(e,n){this.actionIfStateIsEnabled(()=>{var o;return this.hooks.emit("playStateChange",e?"playing":"pause",{userAction:(o=n==null?void 0:n.userAction)!=null?o:!0})}),e?this.handlePlay(n):this.handlePause(n),this.state.playing=e}handlePlay(e){return H(this,null,function*(){var m;const{data:n,state:o,privateState:s,hooks:r}=this;if(s.playing||!(n!=null&&n.keyframes)||(n==null?void 0:n.keyframes.length)===0)return;const a=Ge();s.playId=a,s.playing=!0,s.broke=!1;const l=n.keyframes,c=this.getPauseData();(e==null?void 0:e.notEmitEvent)!==!0&&r.emit("play",{userAction:(m=e==null?void 0:e.userAction)!=null?m:!0});let u=!1;const d=yield(()=>H(this,null,function*(){var g,p;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(A=>A.id===e.playFromId);if(c!=null&&c.keyframeId){const A=(p=this.data)==null?void 0:p.keyframes.find(v=>v.id===c.keyframeId);if(c!=null&&c.fiveState&&(yield this.move(c.fiveState,{moveEffect:s.moveToFirstPanoEffect,duration:s.moveToFirstPanoDuration})),A){if(A.data.effect==="Move")return A.index;if(A.data.effect==="Rotate"){const v=c.duration!==void 0?c.duration*(1-c.playedProgress):void 0;return yield this.playKeyframe(A,{duration:v}),u=!0,A.index+1}}}}))();this.clearPauseData();for(const g of l){if(s.broke||!o.playing||!s.playing||a!==s.playId)return;if(!(d!==void 0&&g.index<d))try{r.emit("playIndexChange",g.index,g),yield this.playKeyframe(g,{moveEffect:u===!1?s.moveToFirstPanoEffect:void 0,duration:u===!1&&typeof s.moveToFirstPanoDuration=="number"?s.moveToFirstPanoDuration:void 0}),g.stay&&(yield $p(g.stay)),u===!1&&(u=!0)}catch(p){return Promise.resolve("broke")}}o.playing&&a===s.playId&&(this.setState({playing:!1},{userAction:!1}),r.emit("end"),this.clearPauseData())})}handlePause(e){var r;const{state:n,privateState:o,hooks:s}=this;n.playing=!1,o.playing!==!1&&(o.playing=!1,this.setPauseData(),o.broke||this.forceInteruptUpdateCamera(),(e==null?void 0:e.notEmitEvent)!==!0&&s.emit("pause",{userAction:(r=e==null?void 0:e.userAction)!=null?r:!0}))}playKeyframe(e,n){return H(this,null,function*(){var s;const{privateState:o}=this;return((s=this.privateState.currentPlayKeyframe)==null?void 0:s.keyframe.id)!==e.id&&(this.privateState.currentPlayKeyframe={keyframe:e}),o.currentPlayQueue.push(this.getPlayPromise(e,n)),this.actionPromiseQueue()})}addInterruptListener(e){const n=()=>{this.privateState.modeChanging||e()},o=e;return this.five.once("gesture",o),this.five.once("wantsChangeMode",n),()=>{this.five.off("gesture",o),this.five.once("wantsChangeMode",n)}}getPlayPromise(o){return H(this,arguments,function*(e,n={}){var r;const s=e.data;if(n.duration=(r=n.duration)!=null?r:e.start!==void 0&&e.end!==void 0?e.end-e.start:void 0,!!s)return new Promise((a,l)=>{let c=!1;this.addInterruptListener(()=>{if(!c)return this.hooks.emit("broke"),this.privateState.broke=!0,this.setState({playing:!1}),c=!0,l(new Error("play is interupted"))});try{if(c)return;const u=()=>{a(),c=!0};switch(s.effect){case"Move":this.move(s,n).then(u);break;case"Rotate":this.rotate(s,n).then(u);break;default:this.rotate(s,n).then(u)}}catch(u){}})})}actionPromiseQueue(){return H(this,null,function*(){const{privateState:e}=this;return new Promise((n,o)=>{if(e.currentPlayQueue.length===0){n();return}const s=e.currentPlayQueue.shift();if(!s){n();return}s.then(n,o)}).then(()=>e.currentPlayQueue.length===0?Promise.resolve():this.actionPromiseQueue())})}move(e,n){return H(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 H(this,null,function*(){if(e.mode&&e.mode!==this.five.currentMode)yield this.changeMode({mode:e.mode,panoIndex:e.panoIndex});else if(e.panoIndex&&e.panoIndex!==this.five.panoIndex)return yield this.changePano(e,n);yield this.updateCamera(e,n)})}updateCamera(o){return H(this,arguments,function*(e,n={}){const{five:s,privateState:r,state:a}=this,l=(()=>{var m,g;const h=(m=a.config)==null?void 0:m.speedConfig,d=(g=e.rotateSpeed)!=null?g:h==null?void 0:h.rotateSpeed;if((h==null?void 0:h.rotateSpeedUnit)===void 0)return d;if(d!==void 0)return h.rotateSpeedUnit==="rad/ms"?d:d/1e3})(),c=(()=>{if(n.duration)return n.duration;if(l){const h=this.five.getCurrentState();return Up(h,e)/l}return 800})();r.currentPlayKeyframe&&(r.currentPlayKeyframe.originDuration=c);const u=this.getSpeededDuration(c);return new Promise(h=>{qp(()=>s.updateCamera(e,u)),setTimeout(()=>h(),u)})})}changePano(e,n){return H(this,null,function*(){const{five:o,privateState:s,state:r}=this;if(typeof e.panoIndex!="number"||e.panoIndex===o.panoIndex)return;const a=o.getCurrentState().mode!=="Panorama";a&&(this.privateState.modeChanging=!0);const l=(()=>{var d,m;const u=(d=r.config)==null?void 0:d.speedConfig,h=(m=e.moveSpeed)!=null?m:u==null?void 0:u.moveSpeed;if((u==null?void 0:u.moveSpeedUnit)===void 0)return h;if(h!==void 0)return u.moveSpeedUnit==="m/ms"?h:h/1e3})(),c=(()=>{if(n!=null&&n.duration)return n.duration;if(l&&typeof o.panoIndex=="number"&&typeof e.panoIndex=="number"){const u=o.work.observers[o.panoIndex].position,h=o.work.observers[e.panoIndex].position;return u.distanceTo(h)/l}return 800})();s.currentPlayKeyframe&&(s.currentPlayKeyframe.originDuration=c),yield new Promise(u=>{var h,d,m;o.moveToPano(e.panoIndex,{latitude:e.latitude,longitude:e.longitude,fov:e.fov,duration:this.getSpeededDuration(c),effect:(m=(d=n==null?void 0:n.moveEffect)!=null?d:(h=this.state.config)==null?void 0:h.moveEffect)!=null?m:e.moveEffect,moveCancelCallback:()=>u(),moveEndCallback:()=>u()}),a&&o.once("panoArrived",()=>u())}),a&&(this.privateState.modeChanging=!1)})}changeSpeed(e,n=!0){const{state:o,privateState:s,hooks:r}=this,{currentPlayKeyframe:a}=s;if(r.emit("speedChange",e,{userAction:n}),o.playing&&a)try{const l=a.originDuration!==void 0?a.originDuration*(1-this.getProgress()):void 0,c=this.playKeyframe(a.keyframe,{duration:l});s.currentPlayQueue.push(c)}catch(l){}}getSpeededDuration(e){return e/this.state.speed}getProgress(){return this.five.controller.cameraMotion.progress}changeMode(e,n){return H(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 Gi.get((n=this.data)==null?void 0:n.keyframesId)}setPauseData(){var e,n,o,s;if((e=this.data)!=null&&e.keyframesId)return Gi.set((n=this.data)==null?void 0:n.keyframesId,{keyframeId:(o=this.privateState.currentPlayKeyframe)==null?void 0:o.keyframe.id,fiveState:this.five.getCurrentState(),duration:(s=this.privateState.currentPlayKeyframe)==null?void 0:s.originDuration,playedProgress:this.getProgress()})}clearPauseData(){var e,n;if((e=this.data)!=null&&e.keyframesId)return Gi.delete((n=this.data)==null?void 0:n.keyframesId)}clear(){this.clearPauseData(),this.privateState.currentPlayKeyframe=null}handleDispose(){var e,n;this.setState({playing:!1}),this.clearPauseData(),this.clear(),(e=this.GuideLine)==null||e.dispose(),this.GuideLine=void 0,(n=this.privateState.disposers)==null||n.forEach(o=>o==null?void 0:o())}actionIfStateIsEnabled(e,n){if(this.state.enabled)return e();n!=null&&n.warnLog&&eg()}waitFiveLoaded(){return H(this,null,function*(){return new Promise(e=>{if(this.five.work){e();return}this.five.once("loaded",()=>{e()})})})}setFiveLinearUpdateCamera(){!this.privateState.fiveOriginGetProgress||(this.five.controller.cameraMotion.getProgress=e=>{const n=this.five.controller.cameraMotion,o=e-n.startTime;return o<0?0:o>=n.duration?1:1-Kp(1,n.startVelocity,n.duration,o)})}setFiveOriginUpdateCamera(){!this.privateState.fiveOriginGetProgress||(this.five.controller.cameraMotion.getProgress=this.privateState.fiveOriginGetProgress)}}f(xo,"PluginVersion",Ml);const ng=i=>new xo(i);function ig(i,t){t.forEach(e=>{const n=new E.SphereGeometry(.02,16,16),o=[],s=[new E.MeshBasicMaterial({color:16776960}),new E.MeshBasicMaterial({color:16711935}),new E.MeshBasicMaterial({color:16711680}),new E.MeshBasicMaterial({color:65535})];if(e.position.length===4)e.position.forEach((r,a)=>{const l=s[a],c=new E.Mesh(n,l);c.position.copy(qe(r)),o.push(c)});else{const r=s[0],a=new E.Mesh(n,r);a.position.copy(qe(e.position)),o.push(a)}o.forEach(r=>{r.material.depthTest=!1,i.scene.add(r)})})}const Le=i=>i;function Wi(i){if(i.length<3)return;const t=i.map(Pn),e=t[1].clone().sub(t[0]),n=t[2].clone().sub(t[1]);return e.cross(n)}var Tl=(i=>(i.Audio="Audio",i.Text="Text",i.ImageText="ImageText",i.Image="Image",i.Video="Video",i.Link="Link",i.Sticker="Sticker",i.VRLink="VRLink",i.PanoLink="PanoLink",i.Marketing="Marketing",i.MediaPlane="MediaPlane",i.MediaModel="MediaModel",i.Custom="Custom",i.Unknown="Unknown",i))(Tl||{});function og(i){if(i.length!==4)return!1;const[t,e,n,o]=i,s=t.distanceTo(e),r=e.distanceTo(n),a=n.distanceTo(o),l=o.distanceTo(t),c=t.distanceTo(n),u=e.distanceTo(o);return s===a&&r===l&&c===u}class _i extends E.Mesh{constructor(e,n,o){if(e.length!==4)throw new Error("QuadrangleMesh: Invalid number of points, it's not a quadrangle");const[s,r,a,l]=e,c=Tt(...e),u=[s.clone().sub(c),r.clone().sub(c),a.clone().sub(c),l.clone().sub(c)],h=new zl(u,o);super(h,n);f(this,"name","QuadrangleMesh");this.position.copy(c)}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}}class zl extends E.BufferGeometry{constructor(e,n){super();f(this,"name","QuadrangleGeometry");f(this,"points");this.points=e;const o=n!=null?n:og(e)?64:1;if(e.length!==4){console.error("Invalid number of points, it's not a quadrangle");return}const[s,r,a,l]=e,[c,u,h,d]=[new E.Vector2(0,0),new E.Vector2(1,0),new E.Vector2(1,1),new E.Vector2(0,1)],m=[],g=[];m.push(...s.toArray()),g.push(...c.toArray());for(let A=1;A<o;A++)m.push(s.x+(r.x-s.x)*A/o,s.y+(r.y-s.y)*A/o,s.z+(r.z-s.z)*A/o),g.push(c.x+(u.x-c.x)*A/o,c.y+(u.y-c.y)*A/o);m.push(...r.toArray()),g.push(...u.toArray()),m.push(...a.toArray()),g.push(...h.toArray());for(let A=1;A<o;A++)m.push(a.x+(l.x-a.x)*A/o,a.y+(l.y-a.y)*A/o,a.z+(l.z-a.z)*A/o),g.push(h.x+(d.x-h.x)*A/o,h.y+(d.y-h.y)*A/o);m.push(...l.toArray()),g.push(...d.toArray());const p=[];for(let A=0;A<o;A++)p.push(A,A+1,o*2-A,A,o*2-A,o*2+1-A);this.setAttribute("position",new E.BufferAttribute(new Float32Array(m),3)),this.setAttribute("uv",new E.BufferAttribute(new Float32Array(g),2)),this.setIndex(new E.BufferAttribute(new Uint32Array(p),1))}}function sg(i,t,e){const n=t!=null?t:document.createElement("video");n.preload="metadata",n.crossOrigin="anonymous",n.muted=!0,n.loop=!0,n.playsInline=!0,n.autoplay=!0;const o=new E.VideoTexture(n);return o.minFilter=E.LinearFilter,o.magFilter=E.LinearFilter,o.encoding=E.sRGBEncoding,o.metadataLoaded=!1,n.onloadedmetadata=()=>{e==null||e(o),o.dispatchEvent({type:"videoLoaded"}),o.metadataLoaded=!0},n.src=i,o}const rg="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAYAAADFw8lbAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAKqADAAQAAAABAAAAKgAAAADUGqULAAAB0ElEQVRYCe2WSUoEQRBFLVHEiVZU1I03cKW38SSewRt4A5fiTty5cQIFR9pZQWkcUNSe2/Z9yISiSGxRkUAy4BGZSVX168gistraYsQKxArECsQKxApYqkDyU5lmsznMM+ZgAGpQhaUkSRbINgLJCXiCBtSgAkVYtGGIBTKj8AgKSVahDNvQa0IUkUG4Bx91BpLdBTOS/cgUIB3a+gMwI9mFzE3a0I3z5B4r292JzGVA8tSSZILMcUDyzIykthOZvYDk+V9Ktmz4yGzhOhV4/+5YU4N/hzqo0StX3Fg5TcnNlYvgs8bPsM4hkScHoyO46haRnGEYktQVI+4ypUYKyXtxyUu27JCceAMJvjo0HoM5CEZ7cPX7i013q3IWVV5r2aw/2TK+svWbPGU68KQCa6pYeus1V0X99quSfvtVSc39lmfz2mdbz32tg1dAJ0421AVs9E7/FxBSezrMmjI/gm5/nYmMkBq+TqBs7LNgTlZH6EnWlPmORdk+pHQipUNfTxtg7p3NIXWRMvXfoqusmXsNhpC6crIS1Zf9C6yAOdlxpK5BW18CiT7A/G93gE+P0FY/RoO+RWqS62YhB2r4YhlixArECsQKxArECvzjCnwAOr0wF44ggHAAAAAASUVORK5CYII=",Bl="data:image/png;base64,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",co="data:image/png;base64,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",ag="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAMAAAANIilAAAABcVBMVEUAAAAAAAD////////+/v45OTn////////39/fp6enPz8/7+/vw8PD+/v7x8fHc3NzHx8f////////+/v77+/vr6+v////7+/v5+fn////z8/P////////q6uqgoKD+/v79/f3m5ub+/v7////////////////39/f39/f////z8/P////t7e3s7Oz29vb////5+fn////h4eH////g4ODV1dX////////BwcH///////////+Ojo5zc3MlJSX////////////////////////7+/v////////////v7+/u7u7n5+f////39/f////09PT6+vr09PT+/v76+vr////5+fnv7+/09PTk5OT////////////////Jycn///++vr7///////+0tLT///9TU1P///8SEhL////////+/v76+vr////8/Pz39/ft7e3t7e36+vr////////X19fV1dX///+xsbF9fX1iYmL///////+K8mOEAAAAenRSTlMaAIDy8CD41cWRX9uk7Kl1VVEw6dWT/M/NvKyVkY475eWIgx0Z39rHv7axnZyZmIuKhn56emZjX1FEPTU0Kx4PCAX69fTgxcKkopWL7crJuri2sa6rnIyHhX54bVtZVU9NSUcsJSIcFROno6Hcwp+ekHVxbWhnRC8nDLc9s8oAAAOGSURBVEjHpdd3X9pAGAfwkBBDAoQmBJmWvUWWiIDIHoJb66x7a4d78Op7pBQ1J5DY33987vnyXEIu3CGy/0hvnDthM+l0hj3JScSudDKOdhNPpl1i8Ut624Gi6+trI3zW1tcdqGM7/SIC5/ZRR2SNJEm7JkHt7FAJjR18WIs40P3cAFxIOaIRna6ZOHxGunk+TDR1ukjUkSr0w86bcKShiz1OI4JMP8YAD9+4emM2Gm407IfIhzm0NxrhKNsLH4SvQ+RktyvUfZIMXYcPPsSFCcvY6EYW6ZPsxuiYZaLwAW5bDY70Da5paxjvm8d+UcjAUL/GzPtCnDF/mwFWhJ75Zs68x05gxxFRGQfa+RYXokHVCC4O4yOqYLTwBjNB+ncWEZnsbzrIvOLz4CW9g4jODn0ZPO/iZN0UmhaPp0Omq+Q/nLu6NO0hErJnurjKdTBzEdAhkqILXDAdbFkJ7EnDe4EVy198srpiwhE4X1RKDFOqviBwcNPK6gmPmeWlGDz+VdHqRPEVHo0tLTM8RpcX4G+flLe6kU/Cs1pYRnm8uriQhfoC+0ZDvbMLi6ttfO5fDCDCKFrvooAKAov+c4BZvy8EzaolCHRdIZ+fBThl9G0Ih1RCrBJWbPiMKYAZ409oMSqFWAktzJ9GBuDvRoVGOIQJMSas0CiM39u45v0M9tbaeLc6F5M+7dhcbRfgg+pcU/oNa85VDwDOzBtmpP9UKsN8BuCzeb1P+kPi08+fASyr6fVPUh/PJ72+xj/bZk5PSV0YlJ4z83iC4EipS5LkiAkeHxGcQerLwMARRzyW+QklhUgKpST8nXfYg+fHkjS89MPz0MFnhKdCSWpc8RBnPAZB3RUvLt7i3oob7f5juDzuikY81tjcHlcHg9xabdyUWDvF2ay3slecr1ptimNx9lhhs1bzXQxy5NZa6VMx9pS2Wt1H77cVjFartYvBdlDICDc0cbVa3Twd2NcOyuLwVqo+K1ebjgdcr0k+O1uXwThfl8vlhqm+99kASup5GINsYhhmG8d7UXzcBgo2e21cd9WlUll5/7G958ql8uxu7y0zS5SGSkOGBA51TRiGQAi232Y9v4kVQZGavpt6c6l3tLpNsc38gGOC01IeLg4Xi8NaLz1KkqO0VzvcTrFscYo4oLjiRAsKEXeJPRqxW0bsFWLGLVbiocyZSm5vbW0nU9BsIfyp/AGqAvfOkBaFawAAAABJRU5ErkJggg==";function gn(i,t,e){if(console.log({objectFit:i,originPositions:t,originRatio:e}),i==="fill")return t;if(i==="contain"){const[n,o,s,r]=t,a=n.distanceTo(o),l=s.distanceTo(r),c=n.distanceTo(r),u=o.distanceTo(s),h=a,d=c,m=h/d;if(m>e){const p=d*e,A=new E.Vector3().subVectors(o,n).multiplyScalar((a-p)/2/a),v=new E.Vector3().subVectors(s,r).multiplyScalar((l-p)/2/l);return[n.clone().add(A),o.clone().sub(A),s.clone().sub(v),r.clone().add(v)]}else if(m<e){const p=h/e,A=new E.Vector3().subVectors(r,n).multiplyScalar((c-p)/2/c),v=new E.Vector3().subVectors(s,o).multiplyScalar((u-p)/2/u);return[n.clone().add(A),o.clone().add(v),s.clone().sub(v),r.clone().sub(A)]}else return t}else return console.warn(`objectFit: ${i} is not supported yet`),t}function be(i,t){this._camera=i||null,this._domElement=t||document,this._raycaster=new E.Raycaster,this._selected=null,this._boundObjs={};var e=this;this._$onClick=function(){e._onClick.apply(e,arguments)},this._$onDblClick=function(){e._onDblClick.apply(e,arguments)},this._$onMouseMove=function(){e._onMouseMove.apply(e,arguments)},this._$onMouseDown=function(){e._onMouseDown.apply(e,arguments)},this._$onMouseUp=function(){e._onMouseUp.apply(e,arguments)},this._$onTouchMove=function(){e._onTouchMove.apply(e,arguments)},this._$onTouchStart=function(){e._onTouchStart.apply(e,arguments)},this._$onTouchEnd=function(){e._onTouchEnd.apply(e,arguments)},this._$onContextmenu=function(){e._onContextmenu.apply(e,arguments)},this._domElement.addEventListener("click",this._$onClick,!1),this._domElement.addEventListener("dblclick",this._$onDblClick,!1),this._domElement.addEventListener("mousemove",this._$onMouseMove,!1),this._domElement.addEventListener("mousedown",this._$onMouseDown,!1),this._domElement.addEventListener("mouseup",this._$onMouseUp,!1),this._domElement.addEventListener("touchmove",this._$onTouchMove,!1),this._domElement.addEventListener("touchstart",this._$onTouchStart,!1),this._domElement.addEventListener("touchend",this._$onTouchEnd,!1),this._domElement.addEventListener("contextmenu",this._$onContextmenu,!1)}be.prototype.destroy=function(){this._domElement.removeEventListener("click",this._$onClick,!1),this._domElement.removeEventListener("dblclick",this._$onDblClick,!1),this._domElement.removeEventListener("mousemove",this._$onMouseMove,!1),this._domElement.removeEventListener("mousedown",this._$onMouseDown,!1),this._domElement.removeEventListener("mouseup",this._$onMouseUp,!1),this._domElement.removeEventListener("touchmove",this._$onTouchMove,!1),this._domElement.removeEventListener("touchstart",this._$onTouchStart,!1),this._domElement.removeEventListener("touchend",this._$onTouchEnd,!1),this._domElement.removeEventListener("contextmenu",this._$onContextmenu,!1)};be.eventNames=["click","dblclick","mouseover","mouseout","mousemove","mousedown","mouseup","contextmenu","touchstart","touchend"];be.prototype._getRelativeMouseXY=function(i){var t=i.target||i.srcElement;t.nodeType===3&&(t=t.parentNode);var e={x:0,y:0},n=t,o=getComputedStyle(n,null);e.y+=parseInt(o.getPropertyValue("padding-top"),10),e.x+=parseInt(o.getPropertyValue("padding-left"),10);do e.x+=n.offsetLeft,e.y+=n.offsetTop,o=getComputedStyle(n,null),e.x+=parseInt(o.getPropertyValue("border-left-width"),10),e.y+=parseInt(o.getPropertyValue("border-top-width"),10);while(n=n.offsetParent);var s={width:t===window?window.innerWidth:t.offsetWidth,height:t===window?window.innerHeight:t.offsetHeight};return{x:Number((i.pageX-e.x)/s.width)*2-1,y:-((i.pageY-e.y)/s.height)*2+1}};be.prototype._objectCtxInit=function(i){i._3xDomEvent={}};be.prototype._objectCtxDeinit=function(i){delete i._3xDomEvent};be.prototype._objectCtxIsInit=function(i){return!!i._3xDomEvent};be.prototype._objectCtxGet=function(i){return i._3xDomEvent};be.prototype.camera=function(i){return i&&(this._camera=i),this._camera};be.prototype.bind=function(i,t,e,n){console.assert(be.eventNames.indexOf(t)!==-1,"not available events:"+t),this._objectCtxIsInit(i)||this._objectCtxInit(i);var o=this._objectCtxGet(i);o[t+"Handlers"]||(o[t+"Handlers"]=[]),o[t+"Handlers"].push({callback:e,useCapture:n}),this._boundObjs[t]===void 0&&(this._boundObjs[t]=[]),this._boundObjs[t].push(i)};be.prototype.addEventListener=be.prototype.bind;be.prototype.unbind=function(i,t,e,n){console.assert(be.eventNames.indexOf(t)!==-1,"not available events:"+t),this._objectCtxIsInit(i)||this._objectCtxInit(i);var o=this._objectCtxGet(i);o[t+"Handlers"]||(o[t+"Handlers"]=[]);for(var s=o[t+"Handlers"],r=0;r<s.length;r++){var a=s[r];if(e==a.callback&&n==a.useCapture){s.splice(r,1);break}}var l=this._boundObjs[t].indexOf(i);this._boundObjs[t].splice(l,1)};be.prototype.removeEventListener=be.prototype.unbind;be.prototype._bound=function(i,t){var e=this._objectCtxGet(t);return e?!!e[i+"Handlers"]:!1};be.prototype._onMove=function(i,t,e,n){var o=this._boundObjs[i];if(!(o===void 0||o.length===0)){var s=new E.Vector2;s.set(t,e),this._raycaster.setFromCamera(s,this._camera);var r=this._raycaster.intersectObjects(o),a=this._selected;if(r.length>0){var l,c,u,h=r[0],d=h.object;this._selected=d,u=this._bound("mousemove",d),a!=d&&(l=this._bound("mouseover",d),c=a&&this._bound("mouseout",a))}else c=a&&this._bound("mouseout",a),this._selected=null;u&&this._notify("mousemove",d,n,h),l&&this._notify("mouseover",d,n,h),c&&this._notify("mouseout",a,n,h)}};be.prototype._onEvent=function(i,t,e,n){var o=this._boundObjs[i];if(!(o===void 0||o.length===0)){var s=new E.Vector2;s.set(t,e),this._raycaster.setFromCamera(s,this._camera);var r=this._raycaster.intersectObjects(o,!0);if(r.length!==0){for(var a=r[0],l=a.object,c=this._objectCtxGet(l),u=l.parent;typeof c=="undefined"&&u;)c=this._objectCtxGet(u),u=u.parent;!c||this._notify(i,l,n,a)}}};be.prototype._notify=function(i,t,e,n){var o=this._objectCtxGet(t),s=o?o[i+"Handlers"]:null;if(!o||!s||s.length===0){t.parent&&this._notify(i,t.parent,e,n);return}for(var s=o[i+"Handlers"],r=0;r<s.length;r++){var a=s[r],l=!0;a.callback({type:i,target:t,origDomEvent:e,intersect:n,stopPropagation:function(){l=!1}}),!!l&&a.useCapture===!1&&t.parent&&this._notify(i,t.parent,e,n)}};be.prototype._onMouseDown=function(i){return this._onMouseEvent("mousedown",i)};be.prototype._onMouseUp=function(i){return this._onMouseEvent("mouseup",i)};be.prototype._onMouseEvent=function(i,t){var e=this._getRelativeMouseXY(t);this._onEvent(i,e.x,e.y,t)};be.prototype._onMouseMove=function(i){var t=this._getRelativeMouseXY(i);this._onMove("mousemove",t.x,t.y,i),this._onMove("mouseover",t.x,t.y,i),this._onMove("mouseout",t.x,t.y,i)};be.prototype._onClick=function(i){this._onMouseEvent("click",i)};be.prototype._onDblClick=function(i){this._onMouseEvent("dblclick",i)};be.prototype._onContextmenu=function(i){this._onMouseEvent("contextmenu",i)};be.prototype._onTouchStart=function(i){return this._onTouchEvent("touchstart",i)};be.prototype._onTouchEnd=function(i){return this._onTouchEvent("touchend",i)};be.prototype._onTouchMove=function(i){if(i.touches.length==1){var t=Number(i.touches[0].pageX/window.innerWidth)*2-1,e=-(i.touches[0].pageY/window.innerHeight)*2+1;this._onMove("mousemove",t,e,i),this._onMove("mouseover",t,e,i),this._onMove("mouseout",t,e,i)}};be.prototype._onTouchEvent=function(i,t){var e=t.touches;if(e.length==0&&(e=t.changedTouches),e.length==1){var n=Number(e[0].pageX/window.innerWidth)*2-1,o=-(e[0].pageY/window.innerHeight)*2+1;this._onEvent(i,n,o,t)}};class lg extends be{constructor(e){super(e.camera,e.getElement());f(this,"mouseInfo");f(this,"clickHandlerMap",new Map);const n=()=>this.preventWhenMouseDown();e.on("wantsMoveToPano",n),e.on("wantsTapGesture",n)}addAutoBindEventListener(...e){const n=e[0];n.addEventListener("added",()=>{this.addEventListener(...e)}),n.addEventListener("removed",()=>{this.removeEventListener(...e)}),n.addEventListener("dispose",()=>{this.removeEventListener(...e)})}addEventListener(e,n,o,s){const r=u=>{if(vn(e)===!1){this.mouseInfo=void 0;return}const h=u.origDomEvent;this.mouseInfo={x:h.clientX,y:h.clientY,isDown:!0,mouseDownTimestamp:Date.now()}},a=u=>{if(vn(e)===!1){this.mouseInfo=void 0;return}const h=u.origDomEvent;!this.mouseInfo||(this.mouseInfo.isDown&&this.mouseInfo.x===h.clientX&&this.mouseInfo.y===h.clientY&&Date.now()-this.mouseInfo.mouseDownTimestamp<400&&o(h),this.mouseInfo=void 0)},l=u=>{if(vn(e)===!1){this.mouseInfo=void 0;return}const h=u.origDomEvent;this.mouseInfo={x:Math.floor(h.touches[0].clientX),y:Math.floor(h.touches[0].clientY),isDown:!0,mouseDownTimestamp:Date.now()}},c=u=>{if(vn(e)===!1){this.mouseInfo=void 0;return}const h=u.origDomEvent;!this.mouseInfo||(this.mouseInfo.isDown&&this.mouseInfo.x===Math.floor(h.changedTouches[h.changedTouches.length-1].clientX)&&this.mouseInfo.y===Math.floor(h.changedTouches[h.changedTouches.length-1].clientY)&&Date.now()-this.mouseInfo.mouseDownTimestamp<400&&o(h),this.mouseInfo=void 0)};n==="click"?(super.addEventListener(e,"mousedown",r,s),super.addEventListener(e,"mouseup",a,s),super.addEventListener(e,"touchstart",l,s),super.addEventListener(e,"touchend",c,s),this.clickHandlerMap.set(o,{mousedown:r,mouseup:a,touchstart:l,touchend:c})):super.addEventListener(e,n,o,s)}removeEventListener(e,n,o,s){if(n==="click"){const r=this.clickHandlerMap.get(o);r&&(super.removeEventListener(e,"mousedown",r.mousedown,s),super.removeEventListener(e,"mouseup",r.mouseup,s),super.removeEventListener(e,"touchstart",r.touchstart,s),super.removeEventListener(e,"touchend",r.touchend,s),this.clickHandlerMap.delete(o))}else super.removeEventListener(e,n,o,s)}preventWhenMouseDown(){var e;if((e=this.mouseInfo)!=null&&e.isDown)return!1}}function vn(i){return i?i.visible===!1?!1:vn(i.parent):!0}class cg extends E.ShaderMaterial{constructor(e){super();f(this,"transparent",!1);f(this,"blending",E.CustomBlending);f(this,"blendSrc",E.SrcAlphaFactor);f(this,"blendDst",E.OneMinusSrcAlphaFactor);f(this,"blendSrcAlpha",E.OneFactor);f(this,"blendDstAlpha",E.OneMinusSrcAlphaFactor);f(this,"vertexShader",`
|
|
531
531
|
varying vec2 vUv;
|
|
532
532
|
void main() {
|
|
533
533
|
vUv = uv;
|
|
@@ -572,7 +572,7 @@ void main() {
|
|
|
572
572
|
${i[7]?"transform: translate(-50%, -50%); left: 50%; top: 50%;":""}
|
|
573
573
|
`))&&y(t,"style",e),a&8&&z(t,"width",Ne(i[3])),a&16&&z(t,"height",Ne(i[4])),a&8192&&z(t,"z-index",i[13])},i(r){s||(r&&Re(()=>{o&&o.end(1),n=zt(t,St,{duration:i[0]}),n.start()}),s=!0)},o(r){n&&n.invalidate(),r&&(o=an(t,St,{duration:i[1]})),s=!1},d(r){r&&M(t),r&&o&&o.end()}}}function Ng(i){let t,e=i[2]&&ur(i);return{c(){e&&e.c(),t=pe()},m(n,o){e&&e.m(n,o),T(n,t,o)},p(n,[o]){n[2]?e?(e.p(n,o),o&4&&C(e,1)):(e=ur(n),e.c(),C(e,1),e.m(t.parentNode,t)):e&&(se(),D(e,1,1,()=>{e=null}),re())},i(n){C(e)},o(n){D(e)},d(n){e&&e.d(n),n&&M(t)}}}function Ne(i){return typeof i=="number"?i/16+"rem":i}function Xg(i,t,e){let{inDelay:n=1e3}=t,{outDelay:o=1e3}=t,{visible:s=!0}=t,{width:r=0}=t,{height:a=0}=t,{left:l=0}=t,{bottom:c=0}=t,{center:u=!1}=t,{horizontalCenter:h=!1}=t,{verticalCenter:d=!1}=t,{blurRadius:m}=t,{spreadRadius:g}=t,{opacity:p=.15}=t,{zIndex:A=-1}=t;return i.$$set=v=>{"inDelay"in v&&e(0,n=v.inDelay),"outDelay"in v&&e(1,o=v.outDelay),"visible"in v&&e(2,s=v.visible),"width"in v&&e(3,r=v.width),"height"in v&&e(4,a=v.height),"left"in v&&e(5,l=v.left),"bottom"in v&&e(6,c=v.bottom),"center"in v&&e(7,u=v.center),"horizontalCenter"in v&&e(8,h=v.horizontalCenter),"verticalCenter"in v&&e(9,d=v.verticalCenter),"blurRadius"in v&&e(10,m=v.blurRadius),"spreadRadius"in v&&e(11,g=v.spreadRadius),"opacity"in v&&e(12,p=v.opacity),"zIndex"in v&&e(13,A=v.zIndex)},[n,o,s,r,a,l,c,u,h,d,m,g,p,A]}class st extends oe{constructor(t){super(),ie(this,t,Xg,Ng,ne,{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},_g)}}function Yg(){return Math.random().toString(36).slice(-6)}const Ni=Yg();function Ug(i){le(i,"svelte-1b2n9wi",".text-char.svelte-1b2n9wi{display:inline-block;text-shadow:0.125rem 0rem 0.5rem rgba(0, 0, 0, 0.15)}")}function dr(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 qg(i){let t,e=i[0]+"",n,o=i[20];const s=()=>i[9](t,o),r=()=>i[9](null,o);return{c(){t=B("span"),n=xe(e),y(t,"class","text-char svelte-1b2n9wi")},m(a,l){T(a,t,l),V(t,n),s()},p(a,l){i=a,l&4&&e!==(e=i[0]+"")&&Se(n,e),o!==i[20]&&(r(),o=i[20],s())},d(a){a&&M(t),r()}}}function Jg(i){let t,e=i[20];const n=()=>i[8](t,e),o=()=>i[8](null,e);return{c(){t=B("span"),t.textContent="\xA0",y(t,"class","text-char svelte-1b2n9wi")},m(s,r){T(s,t,r),n()},p(s,r){i=s,e!==i[20]&&(o(),e=i[20],n())},d(s){s&&M(t),o()}}}function hr(i,t){let e,n;function o(a,l){return a[0]===a[3]?Jg:qg}let s=o(t),r=s(t);return{key:i,first:null,c(){e=pe(),r.c(),n=pe(),this.first=e},m(a,l){T(a,e,l),r.m(a,l),T(a,n,l)},p(a,l){t=a,s===(s=o(t))&&r?r.p(t,l):(r.d(1),r=s(t),r&&(r.c(),r.m(n.parentNode,n)))},d(a){a&&M(e),r.d(a),a&&M(n)}}}function Zg(i){let t=[],e=new Map,n,o=i[2];const s=r=>r[18];for(let r=0;r<o.length;r+=1){let a=dr(i,o,r),l=s(a);e.set(l,t[r]=hr(l,a))}return{c(){for(let r=0;r<t.length;r+=1)t[r].c();n=pe()},m(r,a){for(let l=0;l<t.length;l+=1)t[l].m(r,a);T(r,n,a)},p(r,[a]){a&14&&(o=r[2],t=Ke(t,a,s,1,r,o,e,n.parentNode,Ao,hr,n,dr))},i:X,o:X,d(r){for(let a=0;a<t.length;a+=1)t[a].d(r);r&&M(n)}}}function Kg(i,t,e){let n,{inDelay:o=0}=t,{outDelay:s=0}=t,{content:r}=t,{unfolded:a}=t,{isFistUnfoldedUpdate:l=!0}=t;const c=`__EMOJI_SPLIT_${Ni}__`,u=`__EMOJI_${Ni}__`,h=`__SPACE_${Ni}__`;let d,m,g=[];function p(I){const P=[],L=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 I.slice().replace(L,x=>`${c}${u}${x}${c}`).split(c).forEach(x=>x.startsWith(u)?P.push({id:Ge(),content:x.slice(u.length)}):P.push(...x.split("").map(F=>F===" "?h:F).map(F=>({id:Ge(),content:F})))),P}function A(){if(!m)return;const I=!a;m.reversed!==I&&m.reverse(),m.play()}function v(I){if(l){e(4,l=!1);return}clearTimeout(d),d=setTimeout(A,I?o:s)}function b(I){const P=function(){const L=vg(x=>I[x].getBoundingClientRect().x,[Math.min(I.length-1,10),Math.min(I.length-1,30)]);if(L>0)return L}();m=Oo.default({targets:I.slice(0,P).filter(wt),autoplay:!1,duration:400,scale:[.7,1],rotate:[20,0],opacity:[0,1],translateX:[4,0],translateY:[10,0],delay:Oo.default.stagger(50),easing:"easeInOutCubic"}),a&&m.seek(m.duration)}function w(I,P){Ve[I?"unshift":"push"](()=>{g[P]=I,e(1,g)})}function k(I,P){Ve[I?"unshift":"push"](()=>{g[P]=I,e(1,g)})}return i.$$set=I=>{"inDelay"in I&&e(5,o=I.inDelay),"outDelay"in I&&e(6,s=I.outDelay),"content"in I&&e(0,r=I.content),"unfolded"in I&&e(7,a=I.unfolded),"isFistUnfoldedUpdate"in I&&e(4,l=I.isFistUnfoldedUpdate)},i.$$.update=()=>{i.$$.dirty&1&&e(2,n=p(r)),i.$$.dirty&128&&v(a),i.$$.dirty&2&&b(g.filter(I=>!!I))},[r,g,n,h,l,o,s,a,w,k]}class Gl extends oe{constructor(t){super(),ie(this,t,Kg,Zg,ne,{inDelay:5,outDelay:6,content:0,unfolded:7,isFistUnfoldedUpdate:4},Ug)}}function $g(i){le(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 fr(i){let t,e,n,o,s,r,a,l,c,u;return e=new st({props:{center:!0,blurRadius:9,spreadRadius:3}}),{c(){t=B("div"),K(e.$$.fragment),n=$(),o=B("div"),y(o,"class",s="arrow "+i[0]+" svelte-1ogmlqq"),z(o,"background-image","url("+rg+")"),y(t,"class","arrow-wrapper svelte-1ogmlqq")},m(h,d){T(h,t,d),J(e,t,null),V(t,n),V(t,o),l=!0,c||(u=me(o,"click",i[5]),c=!0)},p(h,d){i=h,(!l||d&1&&s!==(s="arrow "+i[0]+" svelte-1ogmlqq"))&&y(o,"class",s)},i(h){l||(C(e.$$.fragment,h),h&&Re(()=>{a&&a.end(1),r=zt(o,St,{duration:i[2],delay:i[3],easing:Ut}),r.start()}),l=!0)},o(h){D(e.$$.fragment,h),r&&r.invalidate(),h&&(a=an(o,St,{duration:i[2],delay:i[4],easing:Ut})),l=!1},d(h){h&&M(t),Z(e),h&&a&&a.end(),c=!1,u()}}}function e0(i){let t,e,n=i[1]&&fr(i);return{c(){n&&n.c(),t=pe()},m(o,s){n&&n.m(o,s),T(o,t,s),e=!0},p(o,[s]){o[1]?n?(n.p(o,s),s&2&&C(n,1)):(n=fr(o),n.c(),C(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(C(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function t0(i,t,e){let{direction:n="right"}=t,{visible:o=!0}=t,{duration:s=0}=t,{inDelay:r=0}=t,{outDelay:a=0}=t;function l(c){rn.call(this,i,c)}return i.$$set=c=>{"direction"in c&&e(0,n=c.direction),"visible"in c&&e(1,o=c.visible),"duration"in c&&e(2,s=c.duration),"inDelay"in c&&e(3,r=c.inDelay),"outDelay"in c&&e(4,a=c.outDelay)},[n,o,s,r,a,l]}class n0 extends oe{constructor(t){super(),ie(this,t,t0,e0,ne,{direction:0,visible:1,duration:2,inDelay:3,outDelay:4},$g)}}function i0(i,t,e=20,n=5){return new Promise((o,s)=>{let r=0;const a=setInterval(()=>{const l=i();t(l)?(clearInterval(a),o(l)):r>=n&&(clearInterval(a),s(l)),r++},e)})}function o0(i){le(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 mr(i){let t,e,n;return e=new Gl({props:{unfolded:i[0],content:i[1],inDelay:500,outDelay:i[5]}}),{c(){t=B("div"),K(e.$$.fragment),y(t,"class","text svelte-1fuzm7v"),z(t,"transform",i[7])},m(o,s){T(o,t,s),J(e,t,null),i[10](t),n=!0},p(o,s){const r={};s&1&&(r.unfolded=o[0]),s&2&&(r.content=o[1]),s&32&&(r.outDelay=o[5]),e.$set(r),s&128&&z(t,"transform",o[7])},i(o){n||(C(e.$$.fragment,o),n=!0)},o(o){D(e.$$.fragment,o),n=!1},d(o){o&&M(t),Z(e),i[10](null)}}}function pr(i){let t,e,n;return e=new n0({props:{direction:i[6],visible:i[0],inDelay:600,duration:1e3}}),{c(){t=B("div"),K(e.$$.fragment),y(t,"class","arrow svelte-1fuzm7v")},m(o,s){T(o,t,s),J(e,t,null),n=!0},p(o,s){const r={};s&64&&(r.direction=o[6]),s&1&&(r.visible=o[0]),e.$set(r)},i(o){n||(C(e.$$.fragment,o),n=!0)},o(o){D(e.$$.fragment,o),n=!1},d(o){o&&M(t),Z(e)}}}function s0(i){let t,e,n,o=i[1]&&mr(i),s=i[3]<i[4]&&pr(i);return{c(){o&&o.c(),t=$(),s&&s.c(),e=pe()},m(r,a){o&&o.m(r,a),T(r,t,a),s&&s.m(r,a),T(r,e,a),n=!0},p(r,[a]){r[1]?o?(o.p(r,a),a&2&&C(o,1)):(o=mr(r),o.c(),C(o,1),o.m(t.parentNode,t)):o&&(se(),D(o,1,1,()=>{o=null}),re()),r[3]<r[4]?s?(s.p(r,a),a&24&&C(s,1)):(s=pr(r),s.c(),C(s,1),s.m(e.parentNode,e)):s&&(se(),D(s,1,1,()=>{s=null}),re())},i(r){n||(C(o),C(s),n=!0)},o(r){D(o),D(s),n=!1},d(r){o&&o.d(r),r&&M(t),s&&s.d(r),r&&M(e)}}}function r0(i,t,e){let n,o,s,{visible:r=!1}=t,{textUnfolded:a=!1}=t,{content:l}=t,c,u=0,h=0,d=0;function m(g){Ve[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,d=c.offsetHeight),i0(()=>c==null?void 0:c.offsetHeight,Boolean).then(()=>{e(4,d=c.offsetHeight)}),e(3,h=Number(g.replace("px","")))}i.$$.dirty&280&&e(9,u=a?h-d:0),i.$$.dirty&512&&e(7,n=`translateY(${u}px)`),i.$$.dirty&256&&e(6,o=a?"left":"right"),i.$$.dirty&256&&e(5,s=a?450:0)},[r,l,c,h,d,s,o,n,a,u,m]}class Wl extends oe{constructor(t){super(),ie(this,t,r0,s0,ne,{visible:0,textUnfolded:8,content:1},o0)}}function a0(i){le(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 gr(i){var u,h;let t,e,n,o,s,r,a,l,c;return t=new st({props:{visible:i[2],left:i[3]/2+"px",bottom:12,width:2,blurRadius:120,spreadRadius:60}}),n=new Lo({props:{unfolded:i[2],length:i[3],outDelay:i[4]+40*Math.min((h=(u=i[6][0])==null?void 0:u.content.length)!=null?h:10,15),useLinearColor:!0}}),r=new Wl({props:{visible:i[2],textUnfolded:i[1],content:i[5]}}),{c(){K(t.$$.fragment),e=$(),K(n.$$.fragment),o=$(),s=B("div"),K(r.$$.fragment),y(s,"class","content svelte-nlvd3x")},m(d,m){J(t,d,m),T(d,e,m),J(n,d,m),T(d,o,m),T(d,s,m),J(r,s,null),a=!0,l||(c=[ct(ln.call(null,s)),me(s,"clientWidth",i[8]),me(s,"click",i[7])],l=!0)},p(d,m){var v,b;const g={};m&4&&(g.visible=d[2]),m&8&&(g.left=d[3]/2+"px"),t.$set(g);const p={};m&4&&(p.unfolded=d[2]),m&8&&(p.length=d[3]),m&16&&(p.outDelay=d[4]+40*Math.min((b=(v=d[6][0])==null?void 0:v.content.length)!=null?b:10,15)),n.$set(p);const A={};m&4&&(A.visible=d[2]),m&2&&(A.textUnfolded=d[1]),m&32&&(A.content=d[5]),r.$set(A)},i(d){a||(C(t.$$.fragment,d),C(n.$$.fragment,d),C(r.$$.fragment,d),a=!0)},o(d){D(t.$$.fragment,d),D(n.$$.fragment,d),D(r.$$.fragment,d),a=!1},d(d){Z(t,d),d&&M(e),Z(n,d),d&&M(o),d&&M(s),Z(r),l=!1,He(c)}}}function l0(i){let t,e,n=i[0].state&&gr(i);return{c(){n&&n.c(),t=pe()},m(o,s){n&&n.m(o,s),T(o,t,s),e=!0},p(o,[s]){o[0].state?n?(n.p(o,s),s&1&&C(n,1)):(n=gr(o),n.c(),C(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(C(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function c0(i,t,e){let n,o,s,{tag:r}=t,a,l=!1,c=[];function u(){e(1,l=!l)}const h=d=>{e(3,a=d.detail)};return i.$$set=d=>{"tag"in d&&e(0,r=d.tag)},i.$$.update=()=>{var d,m,g;i.$$.dirty&1&&e(2,n=!!((d=r.state)!=null&&d.unfolded)),i.$$.dirty&1&&e(5,o=(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,s=l?450:0)},[r,l,n,a,s,o,c,u,h]}class u0 extends oe{constructor(t){super(),ie(this,t,c0,l0,ne,{tag:0},a0)}}function ot(i){return typeof i=="number"?i/16+"rem":i}function d0(i){le(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 h0(i){let t;const e=i[6].default,n=tn(e,i,i[5],null);return{c(){n&&n.c()},m(o,s){n&&n.m(o,s),t=!0},p(o,s){n&&n.p&&(!t||s&32)&&on(n,e,o,o[5],t?nn(e,o[5],s,null):sn(o[5]),null)},i(o){t||(C(n,o),t=!0)},o(o){D(n,o),t=!1},d(o){n&&n.d(o)}}}function f0(i){var s,r;let t,e,n=((s=i[3])==null?void 0:s.inputting)&&vr(),o=((r=i[3])==null?void 0:r.placeholder)&&Ar(i);return{c(){n&&n.c(),t=$(),o&&o.c(),e=pe()},m(a,l){n&&n.m(a,l),T(a,t,l),o&&o.m(a,l),T(a,e,l)},p(a,l){var c,u;(c=a[3])!=null&&c.inputting?n||(n=vr(),n.c(),n.m(t.parentNode,t)):n&&(n.d(1),n=null),(u=a[3])!=null&&u.placeholder?o?o.p(a,l):(o=Ar(a),o.c(),o.m(e.parentNode,e)):o&&(o.d(1),o=null)},i:X,o:X,d(a){n&&n.d(a),a&&M(t),o&&o.d(a),a&&M(e)}}}function m0(i){let t;return{c(){t=xe(i[2])},m(e,n){T(e,t,n)},p(e,n){n&4&&Se(t,e[2])},i:X,o:X,d(e){e&&M(t)}}}function vr(i){let t;return{c(){t=B("div"),y(t,"class","caret svelte-i9wdo4")},m(e,n){T(e,t,n)},d(e){e&&M(t)}}}function Ar(i){let t,e=i[3].placeholder+"",n;return{c(){t=B("span"),n=xe(e),y(t,"class","placeholder svelte-i9wdo4")},m(o,s){T(o,t,s),V(t,n)},p(o,s){s&8&&e!==(e=o[3].placeholder+"")&&Se(n,e)},d(o){o&&M(t)}}}function p0(i){let t,e,n,o;const s=[m0,f0,h0],r=[];function a(l,c){return l[2]?0:l[4]?1:2}return e=a(i),n=r[e]=s[e](i),{c(){t=B("div"),n.c(),y(t,"class","text svelte-i9wdo4"),z(t,"max-width",typeof i[1]=="number"?ot(i[1]):i[1]),z(t,"-webkit-line-clamp",i[0])},m(l,c){T(l,t,c),r[e].m(t,null),o=!0},p(l,[c]){let u=e;e=a(l),e===u?r[e].p(l,c):(se(),D(r[u],1,1,()=>{r[u]=null}),re(),n=r[e],n?n.p(l,c):(n=r[e]=s[e](l),n.c()),C(n,1),n.m(t,null)),c&2&&z(t,"max-width",typeof l[1]=="number"?ot(l[1]):l[1]),c&1&&z(t,"-webkit-line-clamp",l[0])},i(l){o||(C(n),o=!0)},o(l){D(n),o=!1},d(l){l&&M(t),r[e].d()}}}function g0(i,t,e){let n,{$$slots:o={},$$scope:s}=t,{maxLine:r=1}=t,{maxWidth:a=null}=t,{text:l=null}=t,{edit:c=null}=t;return i.$$set=u=>{"maxLine"in u&&e(0,r=u.maxLine),"maxWidth"in u&&e(1,a=u.maxWidth),"text"in u&&e(2,l=u.text),"edit"in u&&e(3,c=u.edit),"$$scope"in u&&e(5,s=u.$$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,s,o]}class Mo extends oe{constructor(t){super(),ie(this,t,g0,p0,ne,{maxLine:0,maxWidth:1,text:2,edit:3},d0)}}function v0(i){le(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 br(i){var h,d;let t,e,n,o,s,r,a,l,c;t=new Lo({props:{unfolded:i[1],direction:"vertical",length:15,duration:500,inDelay:200,useLinearColor:!0}}),a=new Mo({props:{text:i[2],edit:(h=i[0].data.edit)==null?void 0:h.title}});let u=(i[0].data.description||((d=i[0].data.edit)==null?void 0:d.description))&&yr(i);return{c(){K(t.$$.fragment),e=$(),n=B("div"),o=B("div"),s=B("div"),r=B("div"),K(a.$$.fragment),l=$(),u&&u.c(),y(r,"class","title svelte-1oxrkr1"),y(s,"class","plane svelte-1oxrkr1"),y(o,"class","plane__wrapper svelte-1oxrkr1"),z(o,"transform",i[1]?"translateY(-15px)":"translateY(0)"),y(n,"class","plane__container svelte-1oxrkr1"),q(n,"unfolded",i[1]),q(n,"folded",i[3])},m(m,g){J(t,m,g),T(m,e,g),T(m,n,g),V(n,o),V(o,s),V(s,r),J(a,r,null),V(s,l),u&&u.m(s,null),c=!0},p(m,g){var v,b;const p={};g&2&&(p.unfolded=m[1]),t.$set(p);const A={};g&4&&(A.text=m[2]),g&1&&(A.edit=(v=m[0].data.edit)==null?void 0:v.title),a.$set(A),m[0].data.description||((b=m[0].data.edit)==null?void 0:b.description)?u?(u.p(m,g),g&1&&C(u,1)):(u=yr(m),u.c(),C(u,1),u.m(s,null)):u&&(se(),D(u,1,1,()=>{u=null}),re()),g&2&&z(o,"transform",m[1]?"translateY(-15px)":"translateY(0)"),(!c||g&2)&&q(n,"unfolded",m[1]),(!c||g&8)&&q(n,"folded",m[3])},i(m){c||(C(t.$$.fragment,m),C(a.$$.fragment,m),C(u),c=!0)},o(m){D(t.$$.fragment,m),D(a.$$.fragment,m),D(u),c=!1},d(m){Z(t,m),m&&M(e),m&&M(n),Z(a),u&&u.d()}}}function yr(i){var o;let t,e,n;return e=new Mo({props:{text:i[0].data.description,edit:(o=i[0].data.edit)==null?void 0:o.description,maxLine:3}}),{c(){t=B("div"),K(e.$$.fragment),y(t,"class","description svelte-1oxrkr1")},m(s,r){T(s,t,r),J(e,t,null),n=!0},p(s,r){var l;const a={};r&1&&(a.text=s[0].data.description),r&1&&(a.edit=(l=s[0].data.edit)==null?void 0:l.description),e.$set(a)},i(s){n||(C(e.$$.fragment,s),n=!0)},o(s){D(e.$$.fragment,s),n=!1},d(s){s&&M(t),Z(e)}}}function A0(i){let t,e,n=i[0].state&&br(i);return{c(){n&&n.c(),t=pe()},m(o,s){n&&n.m(o,s),T(o,t,s),e=!0},p(o,[s]){o[0].state?n?(n.p(o,s),s&1&&C(n,1)):(n=br(o),n.c(),C(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(C(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function b0(i,t,e){let n,o,s,{tag:r}=t;return i.$$set=a=>{"tag"in a&&e(0,r=a.tag)},i.$$.update=()=>{var a,l,c;i.$$.dirty&1&&e(1,n=!!((a=r.state)!=null&&a.unfolded)),i.$$.dirty&2&&e(3,o=!n),i.$$.dirty&1&&e(2,s=(c=(l=r.data.title)!=null?l:r.data.text)!=null?c:"")},[r,n,s,o]}class y0 extends oe{constructor(t){super(),ie(this,t,b0,A0,ne,{tag:0},v0)}}function w0(i){let t,e;return t=new y0({props:{tag:i[0]}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.tag=n[0]),t.$set(s)},i(n){e||(C(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function E0(i){let t,e;return t=new u0({props:{tag:i[0]}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.tag=n[0]),t.$set(s)},i(n){e||(C(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function P0(i){let t,e,n,o;const s=[E0,w0],r=[];function a(l,c){return l[1]==="line"?0:l[1]==="plane"?1:-1}return~(t=a(i))&&(e=r[t]=s[t](i)),{c(){e&&e.c(),n=pe()},m(l,c){~t&&r[t].m(l,c),T(l,n,c),o=!0},p(l,[c]){let u=t;t=a(l),t===u?~t&&r[t].p(l,c):(e&&(se(),D(r[u],1,1,()=>{r[u]=null}),re()),~t?(e=r[t],e?e.p(l,c):(e=r[t]=s[t](l),e.c()),C(e,1),e.m(n.parentNode,n)):e=null)},i(l){o||(C(e),o=!0)},o(l){D(e),o=!1},d(l){~t&&r[t].d(l),l&&M(n)}}}function C0(i,t,e){let n,{tag:o}=t;return i.$$set=s=>{"tag"in s&&e(0,o=s.tag)},i.$$.update=()=>{var s;i.$$.dirty&1&&e(1,n=(s=o.data.appearance)!=null?s:"line")},[o,n]}class I0 extends oe{constructor(t){super(),ie(this,t,C0,P0,ne,{tag:0})}}function k0(i){le(i,"svelte-blgtit",".line.svelte-blgtit{width:100%;height:100%;overflow:visible;pointer-events:none}")}function wr(i){let t,e,n,o;return{c(){t=we("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(s,r){T(s,t,r),o=!0},p(s,r){i=s},i(s){o||(s&&Re(()=>{n&&n.end(1),e=zt(t,hi,{duration:i[1],delay:i[0],easing:$a}),e.start()}),o=!0)},o(s){e&&e.invalidate(),s&&(n=an(t,hi,{duration:i[1],delay:i[2],easing:Ut})),o=!1},d(s){s&&M(t),s&&n&&n.end()}}}function x0(i){let t,e,n,o,s,r=i[3]&&wr(i);return{c(){t=we("svg"),e=we("defs"),n=we("linearGradient"),o=we("stop"),s=we("stop"),r&&r.c(),y(o,"offset","25%"),y(o,"stop-color","white"),y(o,"stop-opacity","1"),y(s,"offset","100%"),y(s,"stop-color","white"),y(s,"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){T(a,t,l),V(t,e),V(e,n),V(n,o),V(n,s),r&&r.m(t,null)},p(a,[l]){a[3]?r?(r.p(a,l),l&8&&C(r,1)):(r=wr(a),r.c(),C(r,1),r.m(t,null)):r&&(se(),D(r,1,1,()=>{r=null}),re())},i(a){C(r)},o(a){D(r)},d(a){a&&M(t),r&&r.d()}}}function D0(i,t,e){let{inDelay:n=0}=t,{duration:o=1e3}=t,{outDelay:s=0}=t,{unfolded:r}=t;const a=Ge();return i.$$set=l=>{"inDelay"in l&&e(0,n=l.inDelay),"duration"in l&&e(1,o=l.duration),"outDelay"in l&&e(2,s=l.outDelay),"unfolded"in l&&e(3,r=l.unfolded)},[n,o,s,r,a]}class L0 extends oe{constructor(t){super(),ie(this,t,D0,x0,ne,{inDelay:0,duration:1,outDelay:2,unfolded:3},k0)}}function M0(i){le(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
|
|
574
574
|
height var(--sc-dot-size-animation-time) ease,\r
|
|
575
|
-
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 S0(i){let t,e,n;return{c(){t=B("button"),y(t,"class","sc-carousel-button sc-carousel-dot__dot svelte-1mgyhhn"),q(t,"sc-carousel-dot__dot_active",i[0])},m(o,s){T(o,t,s),e||(n=me(t,"click",i[1]),e=!0)},p(o,[s]){s&1&&q(t,"sc-carousel-dot__dot_active",o[0])},i:X,o:X,d(o){o&&M(t),e=!1,n()}}}function T0(i,t,e){let{active:n=!1}=t;function o(s){rn.call(this,i,s)}return i.$$set=s=>{"active"in s&&e(0,n=s.active)},[n,o]}class z0 extends oe{constructor(t){super(),ie(this,t,T0,S0,ne,{active:0},M0)}}function B0(i){le(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 Er(i,t,e){const n=i.slice();return n[5]=t[e],n[7]=e,n}function Pr(i,t){let e,n,o,s;function r(){return t[3](t[7])}return n=new z0({props:{active:t[1]===t[7]}}),n.$on("click",r),{key:i,first:null,c(){e=B("div"),K(n.$$.fragment),o=$(),y(e,"class","sc-carousel-dots__dot-container svelte-670fde"),this.first=e},m(a,l){T(a,e,l),J(n,e,null),V(e,o),s=!0},p(a,l){t=a;const c={};l&3&&(c.active=t[1]===t[7]),n.$set(c)},i(a){s||(C(n.$$.fragment,a),s=!0)},o(a){D(n.$$.fragment,a),s=!1},d(a){a&&M(e),Z(n)}}}function V0(i){let t,e=[],n=new Map,o,s=Array(i[0]);const r=a=>a[7];for(let a=0;a<s.length;a+=1){let l=Er(i,s,a),c=r(l);n.set(c,e[a]=Pr(c,l))}return{c(){t=B("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){T(a,t,l);for(let c=0;c<e.length;c+=1)e[c].m(t,null);o=!0},p(a,[l]){l&7&&(s=Array(a[0]),se(),e=Ke(e,l,r,1,a,s,n,t,It,Pr,null,Er),re())},i(a){if(!o){for(let l=0;l<s.length;l+=1)C(e[l]);o=!0}},o(a){for(let l=0;l<e.length;l+=1)D(e[l]);o=!1},d(a){a&&M(t);for(let l=0;l<e.length;l+=1)e[l].d()}}}function j0(i,t,e){const n=Ai();let{pagesCount:o=1}=t,{currentPageIndex:s=0}=t;function r(l){n("pageChange",l)}const a=l=>r(l);return i.$$set=l=>{"pagesCount"in l&&e(0,o=l.pagesCount),"currentPageIndex"in l&&e(1,s=l.currentPageIndex)},[o,s,r,a]}class O0 extends oe{constructor(t){super(),ie(this,t,j0,V0,ne,{pagesCount:0,currentPageIndex:1},B0)}}const Zt="prev",Et="next";function R0(i){le(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 Q0(i){let t,e,n,o;return{c(){t=B("button"),e=B("i"),y(e,"class","sc-carousel-arrow__arrow svelte-1bftafx"),q(e,"sc-carousel-arrow__arrow-next",i[0]===Et),q(e,"sc-carousel-arrow__arrow-prev",i[0]===Zt),y(t,"class","sc-carousel-button sc-carousel-arrow__circle svelte-1bftafx"),q(t,"sc-carousel-arrow__circle_disabled",i[1])},m(s,r){T(s,t,r),V(t,e),n||(o=me(t,"click",i[2]),n=!0)},p(s,[r]){r&1&&q(e,"sc-carousel-arrow__arrow-next",s[0]===Et),r&1&&q(e,"sc-carousel-arrow__arrow-prev",s[0]===Zt),r&2&&q(t,"sc-carousel-arrow__circle_disabled",s[1])},i:X,o:X,d(s){s&&M(t),n=!1,o()}}}function F0(i,t,e){let{direction:n=Et}=t,{disabled:o=!1}=t;function s(r){rn.call(this,i,r)}return i.$$set=r=>{"direction"in r&&e(0,n=r.direction),"disabled"in r&&e(1,o=r.disabled)},[n,o,s]}class _l extends oe{constructor(t){super(),ie(this,t,F0,Q0,ne,{direction:0,disabled:1},R0)}}function H0(i){le(i,"svelte-i7yfid",".sc-carousel-progress__indicator.svelte-i7yfid{height:100%;background-color:var(--sc-color-hex-dark-50p)}")}function G0(i){let t;return{c(){t=B("div"),y(t,"class","sc-carousel-progress__indicator svelte-i7yfid"),z(t,"width",i[0]+"%")},m(e,n){T(e,t,n)},p(e,[n]){n&1&&z(t,"width",e[0]+"%")},i:X,o:X,d(e){e&&M(t)}}}const Cr=100;function W0(i,t,e){let n,{value:o=0}=t;return i.$$set=s=>{"value"in s&&e(1,o=s.value)},i.$$.update=()=>{i.$$.dirty&2&&e(0,n=Math.min(Math.max(o*Cr,0),Cr))},[n,o]}class _0 extends oe{constructor(t){super(),ie(this,t,W0,G0,ne,{value:1},H0)}}function N0(i,t){i.addEventListener("mousedown",t),i.addEventListener("touchstart",t,{passive:!0})}function X0(i,t){i.removeEventListener("mousedown",t),i.removeEventListener("touchstart",t)}function Y0(i,t){i.addEventListener("mouseup",t),i.addEventListener("touchend",t)}function Ir(i,t){i.removeEventListener("mouseup",t),i.removeEventListener("touchend",t)}function U0(i,t){i.addEventListener("mousemove",t),i.addEventListener("touchmove",t)}function kr(i,t){i.removeEventListener("mousemove",t),i.removeEventListener("touchmove",t)}function So(i){return function(t,e){i.dispatchEvent(new CustomEvent(t,{detail:e}))}}const q0=110,J0=9,Z0=111,K0=20;function Xi(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 $0(i,{thresholdProvider:t}){const e=So(i);let n,o,s=0,r,a=!1;function l(){return Date.now()-r>=Z0&&Math.abs(s)>=K0}function c(d){r=Date.now(),s=0,a=!0;const m=Xi(d);n=m.x,o=m.y,e("swipeStart",{x:n,y:o}),U0(window,u),Y0(window,h)}function u(d){if(!a)return;const m=Xi(d),g=m.x-n,p=m.y-o;n=m.x,o=m.y,e("swipeMove",{x:n,y:o,dx:g,dy:p}),g!==0&&Math.sign(g)!==Math.sign(s)&&(s=0),s+=g,Math.abs(s)>t()&&(e("swipeThresholdReached",{direction:s>0?Zt:Et}),Ir(window,h),kr(window,u))}function h(d){if(Ir(window,h),kr(window,u),a=!1,!l()){e("swipeFailed");return}const m=Xi(d);e("swipeEnd",{x:m.x,y:m.y})}return N0(i,c),{destroy(){X0(i,c)}}}function ev(i,t){i.addEventListener("mouseenter",t)}function tv(i,t){i.removeEventListener("mouseenter",t)}function nv(i,t){i.addEventListener("mouseleave",t)}function xr(i,t){i.removeEventListener("mouseleave",t)}function iv(i){const t=So(i);function e(){nv(i,n),t("hovered",{value:!0})}function n(){t("hovered",{value:!1}),xr(i,n)}return ev(i,e),{destroy(){tv(i,e),xr(i,n)}}}const ov=(i,t)=>{const e=t.x-i.x,n=t.y-i.y;return Math.sqrt(e*e+n*n)};function _t(i,t,e){return Math.max(i,Math.min(t,e))}function sv(i,t){i.addEventListener("touchstart",t,{passive:!0})}function rv(i,t){i.removeEventListener("touchstart",t)}function av(i,t){i.addEventListener("touchend",t)}function Dr(i,t){i.removeEventListener("touchend",t)}function lv(i){const t=So(i);let e=0,n={x:0,y:0};function o({tapEndedAt:a,tapEndedPos:l}){const c=a-e,u=ov(n,l);return c<=q0&&u<=J0}function s(a){e=Date.now();const l=a.touches[0];n={x:l.clientX,y:l.clientY},av(i,r)}function r(a){Dr(i,r);const l=a.changedTouches[0];o({tapEndedAt:Date.now(),tapEndedPos:{x:l.clientX,y:l.clientY}})&&t("tapped")}return sv(i,s),{destroy(){rv(i,s),Dr(i,r)}}}function cv({currentParticleIndex:i,particlesCount:t,clonesCountHead:e,clonesCountTotal:n,particlesToScroll:o}){return i===t-e?0:i===0?Nl({particlesCountWithoutClones:t-n,particlesToScroll:o})-1:Math.floor((i-e)/o)}function uv({currentParticleIndex:i,particlesToScroll:t}){return Math.ceil(i/t)}function dv({currentParticleIndex:i,particlesCount:t,clonesCountHead:e,clonesCountTotal:n,infinite:o,particlesToScroll:s}){return o?cv({currentParticleIndex:i,particlesCount:t,clonesCountHead:e,clonesCountTotal:n,particlesToScroll:s}):uv({currentParticleIndex:i,particlesToScroll:s})}function Nl({particlesCountWithoutClones:i,particlesToScroll:t}){return Math.ceil(i/t)}function hv({particlesCountWithoutClones:i,particlesToScroll:t,particlesToShow:e}){const n=Xl({particlesCountWithoutClones:i,particlesToScroll:t,particlesToShow:e});return Math.ceil(i/t)-n}function fv({infinite:i,particlesCountWithoutClones:t,particlesToScroll:e,particlesToShow:n}){return i?Nl({particlesCountWithoutClones:t,particlesToScroll:e}):hv({particlesCountWithoutClones:t,particlesToScroll:e,particlesToShow:n})}function mv({pageIndex:i,clonesCountHead:t,clonesCountTail:e,particlesToScroll:n,particlesCount:o}){return _t(0,Math.min(t+i*n,o-e),o-1)}function pv({pageIndex:i,particlesToScroll:t,particlesCount:e,particlesToShow:n}){return _t(0,Math.min(i*t,e-n),e-1)}function Yi({infinite:i,pageIndex:t,clonesCountHead:e,clonesCountTail:n,particlesToScroll:o,particlesCount:s,particlesToShow:r}){return i?mv({pageIndex:t,clonesCountHead:e,clonesCountTail:n,particlesToScroll:o,particlesCount:s}):pv({pageIndex:t,particlesToScroll:o,particlesCount:s,particlesToShow:r})}function gv({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 Xl({particlesToScroll:i,particlesToShow:t,particlesCountWithoutClones:e}){const n=i-t;let o=t;for(;;){const s=e-o-n;if(s<t)return Math.max(s,0);o+=t+n}}function vv(i){return new ResizeObserver(t=>{i({width:t[0].contentRect.width})})}function Av({clonesCountHead:i,clonesCountTail:t,particlesContainerChildren:e}){const n=[];for(let r=0;r<t;r++)n.push(e[r].cloneNode(!0));const o=[],s=e.length;for(let r=s-1;r>s-1-i;r--)o.push(e[r].cloneNode(!0));return{clonesToAppend:n,clonesToPrepend:o}}function bv({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 yv({infinite:i,particlesToShow:t,partialPageSize:e}){const n=i?{head:Math.ceil(e||t),tail:Math.ceil(t)}:{head:0,tail:0};return fe(Q({},n),{total:n.head+n.tail})}const wn=(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},fo=i=>t=>{i[t]&&i[t]()},wv=(i,t)=>Dc.default(i,t),Ev=i=>Object.keys(i||{}),Pv=(i,t)=>{const e={};return i.forEach(n=>{e[n]=t[n]}),e},Cv=()=>{const i={},t=(e,n)=>{const{watcherName:o,fn:s}=e,{prop:r,value:a}=n;i[o]||(i[o]={deps:{},fn:s}),i[o].deps[r]=a};return{subscribers:i,subscribe(e,n){e&&t(e,n)},notify(e,n){Object.entries(i).forEach(([o,{deps:s,fn:r}])=>{const a=Ev(s);if(a.includes(n)){const l=Pv(a,e);wv(s,l)||(i[o].deps=l,r())}})}}},Iv=()=>{let i=null;return{targetWatcher(t,e){i={watcherName:t,fn:e},i.fn(),i=null},getTarget(){return i}}};function kv(i,t){const e=Tn.default(i,"data",{}),n=Tn.default(i,"watch",{}),o=Tn.default(i,"methods",{}),s=Tn.default(t,"onChange",()=>{}),{subscribe:r,notify:a,subscribers:l}=Cv(),{targetWatcher:c,getTarget:u}=Iv();let h;const d={},m=()=>({data:h,methods:d});let g=!1;const p=v=>(...b)=>{g=!0;const w=v(...b);return g=!1,w};Object.entries(o).forEach(([v,b])=>{d[v]=p((...w)=>b(m(),...w)),Object.defineProperty(d[v],"name",{value:v})}),h=new Proxy(xc.default(e),{get(v,b){return u()&&!g&&r(u(),{prop:b,value:v[b]}),Reflect.get(...arguments)},set(v,b,w){return v[b]===w||(Reflect.set(...arguments),u()||(s&&s(b,w),a(h,b))),!0}}),Object.entries(n).forEach(([v,b])=>{c(v,()=>{b(m())})});const A=[h,d];return A._internal={_getSubscribers(){return l}},A}function xv({pageIndex:i,particlesToShow:t,particlesToScroll:e,particlesCount:n}){const o=i===0?0:t-e,s=i*t-i*o,r=s+Math.max(t,e)-1,a=[];for(let l=s;l<=Math.min(n-1,r);l++)a.push(l);return a}function Dv({infinite:i,pageIndex:t,pagesCount:e,particlesCount:n,particlesToShow:o,particlesToScroll:s}){const r=_t(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,d)=>h-d),u=c.flatMap(h=>xv({pageIndex:h,particlesToShow:o,particlesToScroll:s,particlesCount:n}));return{pageIndexes:c,particleIndexes:[...new Set(u)].sort((h,d)=>h-d)}}const Lv=(i,t)=>(i(),setInterval(i,t)),Mv=35,Lr=1;class Sv{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(Mv,Math.max(this._autoplayDuration,1));let o=-n;this._interval=Lv(()=>H(this,null,function*(){if(this._paused)return;o+=n;const s=o/this._autoplayDuration;this._onProgressValueChange(s),s>Lr&&(this.reset(),yield t(),e())}),n)})}pause(){this._paused=!0}resume(){this._paused=!1}reset(){clearInterval(this._interval),this._onProgressValueChange(Lr)}}function Tv(i){const t=new Sv({onProgressValueChange:r=>{i("progressValue",1-r)}}),e=kv({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=Dv({infinite:r.infinite,pageIndex:r.currentPageIndex,pagesCount:r.pagesCount,particlesCount:r.particlesCountWithoutClones,particlesToShow:r.particlesToShow,particlesToScroll:r.particlesToScroll}).particleIndexes},setCurrentPageIndex({data:r}){r.currentPageIndex=dv({currentParticleIndex:r.currentParticleIndex,particlesCount:r.particlesCount,clonesCountHead:r.clonesCountHead,clonesCountTotal:r.clonesCountTotal,infinite:r.infinite,particlesToScroll:r.particlesToScroll})},setPartialPageSize({data:r}){r.partialPageSize=Xl({particlesToScroll:r.particlesToScroll,particlesToShow:r.particlesToShow,particlesCountWithoutClones:r.particlesCountWithoutClones})},setClonesCount({data:r}){const{head:a,tail:l}=yv({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=fv({infinite:r.infinite,particlesCountWithoutClones:r.particlesCountWithoutClones,particlesToScroll:r.particlesToScroll,particlesToShow:r.particlesToShow})},setParticlesToShow({data:r}){r.particlesToShow=_t(1,r.particlesToShowInit,r.particlesCountWithoutClones)},setParticlesToScroll({data:r}){r.particlesToScroll=_t(1,r.particlesToScrollInit,r.particlesCountWithoutClones)}},methods:{_prev({data:r}){r.currentParticleIndex=Yi({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=Yi({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=_t(0,a,r.particlesCount-1)},toggleFocused({data:r}){r.focused=!r.focused},_applyAutoplayIfNeeded(l){return H(this,arguments,function*({data:r,methods:a}){if(!r.infinite&&(r.autoplayDirection===Et&&r.currentParticleIndex===r.particlesCount-1||r.autoplayDirection===Zt&&r.currentParticleIndex===0)){t.reset();return}if(r.autoplay){const c=()=>fo({[Et]:()=>H(this,null,function*(){return a.showNextPage()}),[Zt]:()=>H(this,null,function*(){return a.showPrevPage()})})(r.autoplayDirection);yield t.start(c)}})},_jumpIfNeeded(l){return H(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(u,h,d){return H(this,arguments,function*({data:r,methods:a},l,c){if(t.reset(),r.disabled)return;r.disabled=!0,l(),yield a.offsetPage({animated:wn(c,"animated",!0)}),r.disabled=!1,!(yield a._jumpIfNeeded())&&a._applyAutoplayIfNeeded()})},showNextPage(c,u){return H(this,arguments,function*({data:r,methods:a},l){r.disabled||(yield a.changePage(a._next,l))})},showPrevPage(c,u){return H(this,arguments,function*({data:r,methods:a},l){r.disabled||(yield a.changePage(a._prev,l))})},showParticle(c,u,h){return H(this,arguments,function*({methods:r},a,l){yield r.changePage(()=>r._moveToParticle(a),l)})},_getParticleIndexByPageIndex({data:r},a){return Yi({infinite:r.infinite,pageIndex:a,clonesCountHead:r.clonesCountHead,clonesCountTail:r.clonesCountTail,particlesToScroll:r.particlesToScroll,particlesCount:r.particlesCount,particlesToShow:r.particlesToShow})},showPage(c,u,h){return H(this,arguments,function*({methods:r},a,l){const d=r._getParticleIndexByPageIndex(a);yield r.showParticle(d,l)})},offsetPage({data:r},a){const l=wn(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,o]=e;return[{data:n,progressManager:t},o,e._internal]}function zv(i){le(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 Bv=i=>({currentPageIndex:i[0]&32,pagesCount:i[0]&1024,loaded:i[0]&64}),Mr=i=>({currentPageIndex:i[5],pagesCount:i[10],showPage:i[15],loaded:i[6]}),Vv=i=>({loaded:i[0]&64,currentPageIndex:i[0]&32}),Sr=i=>({showNextPage:i[14].showNextPage,loaded:i[6],currentPageIndex:i[5]}),jv=i=>({loaded:i[0]&64,currentPageIndex:i[0]&32}),Tr=i=>({loaded:i[6],currentPageIndex:i[5]}),Ov=i=>({loaded:i[0]&64,currentPageIndex:i[0]&32}),zr=i=>({showPrevPage:i[14].showPrevPage,loaded:i[6],currentPageIndex:i[5]});function Br(i){let t;const e=i[37].prev,n=tn(e,i,i[36],zr),o=n||Rv(i);return{c(){o&&o.c()},m(s,r){o&&o.m(s,r),t=!0},p(s,r){n?n.p&&(!t||r[0]&96|r[1]&32)&&on(n,e,s,s[36],t?nn(e,s[36],r,Ov):sn(s[36]),zr):o&&o.p&&(!t||r[0]&36)&&o.p(s,t?r:[-1,-1])},i(s){t||(C(o,s),t=!0)},o(s){D(o,s),t=!1},d(s){o&&o.d(s)}}}function Rv(i){let t,e,n;return e=new _l({props:{direction:"prev",disabled:!i[2]&&i[5]===0}}),e.$on("click",i[23]),{c(){t=B("div"),K(e.$$.fragment),y(t,"class","sc-carousel__arrow-container svelte-sme1z4")},m(o,s){T(o,t,s),J(e,t,null),n=!0},p(o,s){const r={};s[0]&36&&(r.disabled=!o[2]&&o[5]===0),e.$set(r)},i(o){n||(C(e.$$.fragment,o),n=!0)},o(o){D(e.$$.fragment,o),n=!1},d(o){o&&M(t),Z(e)}}}function Vr(i){let t,e,n;return e=new _0({props:{value:i[7]}}),{c(){t=B("div"),K(e.$$.fragment),y(t,"class","sc-carousel-progress__container svelte-sme1z4")},m(o,s){T(o,t,s),J(e,t,null),n=!0},p(o,s){const r={};s[0]&128&&(r.value=o[7]),e.$set(r)},i(o){n||(C(e.$$.fragment,o),n=!0)},o(o){D(e.$$.fragment,o),n=!1},d(o){o&&M(t),Z(e)}}}function jr(i){let t;const e=i[37].next,n=tn(e,i,i[36],Sr),o=n||Qv(i);return{c(){o&&o.c()},m(s,r){o&&o.m(s,r),t=!0},p(s,r){n?n.p&&(!t||r[0]&96|r[1]&32)&&on(n,e,s,s[36],t?nn(e,s[36],r,Vv):sn(s[36]),Sr):o&&o.p&&(!t||r[0]&1060)&&o.p(s,t?r:[-1,-1])},i(s){t||(C(o,s),t=!0)},o(s){D(o,s),t=!1},d(s){o&&o.d(s)}}}function Qv(i){let t,e,n;return e=new _l({props:{direction:"next",disabled:!i[2]&&i[5]===i[10]-1}}),e.$on("click",i[14].showNextPage),{c(){t=B("div"),K(e.$$.fragment),y(t,"class","sc-carousel__arrow-container svelte-sme1z4")},m(o,s){T(o,t,s),J(e,t,null),n=!0},p(o,s){const r={};s[0]&1060&&(r.disabled=!o[2]&&o[5]===o[10]-1),e.$set(r)},i(o){n||(C(e.$$.fragment,o),n=!0)},o(o){D(e.$$.fragment,o),n=!1},d(o){o&&M(t),Z(e)}}}function Or(i){let t;const e=i[37].dots,n=tn(e,i,i[36],Mr),o=n||Fv(i);return{c(){o&&o.c()},m(s,r){o&&o.m(s,r),t=!0},p(s,r){n?n.p&&(!t||r[0]&1120|r[1]&32)&&on(n,e,s,s[36],t?nn(e,s[36],r,Bv):sn(s[36]),Mr):o&&o.p&&(!t||r[0]&1056)&&o.p(s,t?r:[-1,-1])},i(s){t||(C(o,s),t=!0)},o(s){D(o,s),t=!1},d(s){o&&o.d(s)}}}function Fv(i){let t,e;return t=new O0({props:{pagesCount:i[10],currentPageIndex:i[5]}}),t.$on("pageChange",i[41]),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o[0]&1024&&(s.pagesCount=n[10]),o[0]&32&&(s.currentPageIndex=n[5]),t.$set(s)},i(n){e||(C(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function Hv(i){let t,e,n,o,s,r,a,l,c,u,h,d,m=i[1]&&Br(i);const g=i[37].default,p=tn(g,i,i[36],Tr);let A=i[3]&&Vr(i),v=i[1]&&jr(i),b=i[4]&&Or(i);return{c(){t=B("div"),e=B("div"),m&&m.c(),n=$(),o=B("div"),s=B("div"),p&&p.c(),a=$(),A&&A.c(),l=$(),v&&v.c(),c=$(),b&&b.c(),y(s,"class","sc-carousel__pages-container svelte-sme1z4"),z(s,"transform","translateX("+i[8]+"px)"),z(s,"transition-duration",i[9]+"ms"),z(s,"transition-timing-function",i[0]),y(o,"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(w,k){T(w,t,k),V(t,e),m&&m.m(e,null),V(e,n),V(e,o),V(o,s),p&&p.m(s,null),i[39](s),V(o,a),A&&A.m(o,null),i[40](o),V(e,l),v&&v.m(e,null),V(t,c),b&&b.m(t,null),u=!0,h||(d=[ct(r=$0.call(null,s,{thresholdProvider:i[38]})),me(s,"swipeStart",i[16]),me(s,"swipeMove",i[18]),me(s,"swipeEnd",i[19]),me(s,"swipeFailed",i[20]),me(s,"swipeThresholdReached",i[17]),ct(iv.call(null,o)),me(o,"hovered",i[21]),ct(lv.call(null,o)),me(o,"tapped",i[22])],h=!0)},p(w,k){w[1]?m?(m.p(w,k),k[0]&2&&C(m,1)):(m=Br(w),m.c(),C(m,1),m.m(e,n)):m&&(se(),D(m,1,1,()=>{m=null}),re()),p&&p.p&&(!u||k[0]&96|k[1]&32)&&on(p,g,w,w[36],u?nn(g,w[36],k,jv):sn(w[36]),Tr),(!u||k[0]&256)&&z(s,"transform","translateX("+w[8]+"px)"),(!u||k[0]&512)&&z(s,"transition-duration",w[9]+"ms"),(!u||k[0]&1)&&z(s,"transition-timing-function",w[0]),r&&en(r.update)&&k[0]&2048&&r.update.call(null,{thresholdProvider:w[38]}),w[3]?A?(A.p(w,k),k[0]&8&&C(A,1)):(A=Vr(w),A.c(),C(A,1),A.m(o,null)):A&&(se(),D(A,1,1,()=>{A=null}),re()),w[1]?v?(v.p(w,k),k[0]&2&&C(v,1)):(v=jr(w),v.c(),C(v,1),v.m(e,null)):v&&(se(),D(v,1,1,()=>{v=null}),re()),w[4]?b?(b.p(w,k),k[0]&16&&C(b,1)):(b=Or(w),b.c(),C(b,1),b.m(t,null)):b&&(se(),D(b,1,1,()=>{b=null}),re())},i(w){u||(C(m),C(p,w),C(A),C(v),C(b),u=!0)},o(w){D(m),D(p,w),D(A),D(v),D(b),u=!1},d(w){w&&M(t),m&&m.d(),p&&p.d(w),i[39](null),A&&A.d(),i[40](null),v&&v.d(),b&&b.d(),h=!1,He(d)}}}function Gv(i,t,e){let{$$slots:n={},$$scope:o}=t,s=[],r,a,l=0,c=0,u=1;const[{data:h,progressManager:d},m,g]=Tv((te,Ae)=>{fo({currentPageIndex:()=>e(5,r=Ae),progressValue:()=>e(7,a=Ae),offset:()=>e(8,l=Ae),durationMs:()=>e(9,c=Ae),pagesCount:()=>e(10,u=Ae),loaded:()=>e(6,s=Ae)})(te)}),p=Ai();let{timingFunction:A="ease-in-out"}=t,{arrows:v=!0}=t,{infinite:b=!0}=t,{initialPageIndex:w=0}=t,{duration:k=500}=t,{autoplay:I=!1}=t,{autoplayDuration:P=3e3}=t,{autoplayDirection:L=Et}=t,{pauseOnFocus:x=!1}=t,{autoplayProgressVisible:F=!1}=t,{dots:N=!0}=t,{swiping:R=!0}=t,{particlesToShow:S=1}=t,{particlesToScroll:O=1}=t;function G(te,Ae){return H(this,null,function*(){const je=wn(Ae,"animated",!0);if(typeof te!="number")throw new Error("pageIndex should be a number");yield m.showPage(te,{animated:je})})}function W(te){return H(this,null,function*(){const Ae=wn(te,"animated",!0);yield m.showPrevPage({animated:Ae})})}function Y(te){return H(this,null,function*(){const Ae=wn(te,"animated",!0);yield m.showNextPage({animated:Ae})})}let _=0,ee,U;const ae=vv(({width:te})=>{e(11,_=te),h.particleWidth=_/h.particlesToShow,gv({particlesContainerChildren:U.children,particleWidth:h.particleWidth}),m.offsetPage({animated:!1})});function he(){const{clonesToAppend:te,clonesToPrepend:Ae}=Av({clonesCountHead:h.clonesCountHead,clonesCountTail:h.clonesCountTail,particlesContainerChildren:U.children});bv({particlesContainer:U,clonesToAppend:te,clonesToPrepend:Ae})}Ze(()=>{H(this,null,function*(){yield _o(),U&&ee&&(h.particlesCountWithoutClones=U.children.length,yield _o(),h.infinite&&he(),h.particlesCount=U.children.length,m.showPage(w,{animated:!1}),ae.observe(ee))})}),Ct(()=>{ae.disconnect(),d.reset()});function de(te){return H(this,null,function*(){yield m.showPage(te,{animated:!0})})}function ge(){!R||(h.durationMs=0)}function Ce(te){return H(this,null,function*(){!R||(yield fo({[Et]:m.showNextPage,[Zt]:m.showPrevPage})(te.detail.direction))})}function ke(te){!R||(h.offset+=te.detail.dx)}function Te(){!R||m.showParticle(h.currentParticleIndex)}function ce(){return H(this,null,function*(){!R||(yield m.offsetPage({animated:!0}))})}function ve(te){h.focused=te.detail.value}function Pe(){m.toggleFocused()}function ue(){m.showPrevPage()}const Ye=()=>_/3;function rt(te){Ve[te?"unshift":"push"](()=>{U=te,e(13,U)})}function ye(te){Ve[te?"unshift":"push"](()=>{ee=te,e(12,ee)})}const $e=te=>de(te.detail);return i.$$set=te=>{"timingFunction"in te&&e(0,A=te.timingFunction),"arrows"in te&&e(1,v=te.arrows),"infinite"in te&&e(2,b=te.infinite),"initialPageIndex"in te&&e(24,w=te.initialPageIndex),"duration"in te&&e(25,k=te.duration),"autoplay"in te&&e(26,I=te.autoplay),"autoplayDuration"in te&&e(27,P=te.autoplayDuration),"autoplayDirection"in te&&e(28,L=te.autoplayDirection),"pauseOnFocus"in te&&e(29,x=te.pauseOnFocus),"autoplayProgressVisible"in te&&e(3,F=te.autoplayProgressVisible),"dots"in te&&e(4,N=te.dots),"swiping"in te&&e(30,R=te.swiping),"particlesToShow"in te&&e(31,S=te.particlesToShow),"particlesToScroll"in te&&e(32,O=te.particlesToScroll),"$$scope"in te&&e(36,o=te.$$scope)},i.$$.update=()=>{i.$$.dirty[0]&32&&p("pageChange",r),i.$$.dirty[0]&4&&(h.infinite=b),i.$$.dirty[0]&33554432&&(h.durationMsInit=k),i.$$.dirty[0]&67108864&&(h.autoplay=I),i.$$.dirty[0]&134217728&&(h.autoplayDuration=P),i.$$.dirty[0]&268435456&&(h.autoplayDirection=L),i.$$.dirty[0]&536870912&&(h.pauseOnFocus=x),i.$$.dirty[1]&1&&(h.particlesToShowInit=S),i.$$.dirty[1]&2&&(h.particlesToScrollInit=O)},[A,v,b,F,N,r,s,a,l,c,u,_,ee,U,m,de,ge,Ce,ke,Te,ce,ve,Pe,ue,w,k,I,P,L,x,R,S,O,G,W,Y,o,n,Ye,rt,ye,$e]}class Wv extends oe{constructor(t){super(),ie(this,t,Gv,Hv,ne,{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},zv,[-1,-1])}get goTo(){return this.$$.ctx[33]}get goToPrev(){return this.$$.ctx[34]}get goToNext(){return this.$$.ctx[35]}}function _v(i){le(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 Rr(i){let t;function e(s,r){if(s[2].type==="Image")return Xv;if(s[2].type==="Video")return Nv}let n=e(i),o=n&&n(i);return{c(){t=B("div"),o&&o.c(),y(t,"class","media-item svelte-159ski6"),y(t,"draggable","false")},m(s,r){T(s,t,r),o&&o.m(t,null)},p(s,r){n===(n=e(s))&&o?o.p(s,r):(o&&o.d(1),o=n&&n(s),o&&(o.c(),o.m(t,null)))},d(s){s&&M(t),o&&o.d()}}}function Nv(i){let t,e,n,o,s,r;function a(u,h){return u[7]&&u[2].videoCoverUrl?Uv:Yv}let l=a(i),c=l(i);return{c(){c.c(),t=$(),e=B("div"),n=B("div"),o=B("div"),y(o,"class","video-icon-img svelte-159ski6"),z(o,"background-image","url("+i[20]()+")"),q(o,"canPlay",i[5]),y(n,"class","video-icon svelte-159ski6"),q(n,"large",i[4]==="large"),q(n,"small",i[4]==="small"),y(e,"class","video-play-button-container svelte-159ski6"),q(e,"showPlayButton",i[10])},m(u,h){c.m(u,h),T(u,t,h),T(u,e,h),V(e,n),V(n,o),s||(r=me(o,"click",i[21]),s=!0)},p(u,h){l===(l=a(u))&&c?c.p(u,h):(c.d(1),c=l(u),c&&(c.c(),c.m(t.parentNode,t))),h&8&&z(o,"background-image","url("+u[20]()+")"),h&32&&q(o,"canPlay",u[5]),h&16&&q(n,"large",u[4]==="large"),h&16&&q(n,"small",u[4]==="small"),h&1024&&q(e,"showPlayButton",u[10])},d(u){c.d(u),u&&M(t),u&&M(e),s=!1,r()}}}function Xv(i){let t,e,n,o;return{c(){t=B("img"),y(t,"class","media-content svelte-159ski6"),y(t,"style",e=`object-fit: ${i[6]};`),Xe(t.src,n=i[2].url)||y(t,"src",n),y(t,"alt",o=i[2].name),y(t,"draggable",!1)},m(s,r){T(s,t,r)},p(s,r){r&64&&e!==(e=`object-fit: ${s[6]};`)&&y(t,"style",e),r&4&&!Xe(t.src,n=s[2].url)&&y(t,"src",n),r&4&&o!==(o=s[2].name)&&y(t,"alt",o)},d(s){s&&M(t)}}}function Yv(i){let t,e,n,o,s,r,a;return{c(){t=B("video"),y(t,"class","media-content svelte-159ski6"),y(t,"style",e=`object-fit: ${i[6]};`),Xe(t.src,n=i[2].videoCoverUrl?i[2].url:i[2].url+"#t=0.1")||y(t,"src",n),y(t,"poster",o=i[2].videoCoverUrl),y(t,"preload",s=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,q(t,"showPlayButton",i[10])},m(l,c){T(l,t,c),i[19](t),r||(a=[me(t,"play",i[14]),me(t,"pause",i[15]),me(t,"error",i[16]),me(t,"ended",i[17]),me(t,"click",i[18])],r=!0)},p(l,c){c&64&&e!==(e=`object-fit: ${l[6]};`)&&y(t,"style",e),c&4&&!Xe(t.src,n=l[2].videoCoverUrl?l[2].url:l[2].url+"#t=0.1")&&y(t,"src",n),c&4&&o!==(o=l[2].videoCoverUrl)&&y(t,"poster",o),c&4&&s!==(s=l[2].videoCoverUrl?"none":"auto")&&y(t,"preload",s),c&1024&&q(t,"showPlayButton",l[10])},d(l){l&&M(t),i[19](null),r=!1,He(a)}}}function Uv(i){let t,e,n,o;return{c(){t=B("img"),y(t,"class","media-content svelte-159ski6"),y(t,"style",e=`object-fit: ${i[6]};`),Xe(t.src,n=i[2].videoCoverUrl)||y(t,"src",n),y(t,"alt",o=i[2].name),y(t,"draggable",!1)},m(s,r){T(s,t,r)},p(s,r){r&64&&e!==(e=`object-fit: ${s[6]};`)&&y(t,"style",e),r&4&&!Xe(t.src,n=s[2].videoCoverUrl)&&y(t,"src",n),r&4&&o!==(o=s[2].name)&&y(t,"alt",o)},d(s){s&&M(t)}}}function qv(i){let t,e=i[2]&&Rr(i);return{c(){e&&e.c(),t=pe()},m(n,o){e&&e.m(n,o),T(n,t,o)},p(n,[o]){n[2]?e?e.p(n,o):(e=Rr(n),e.c(),e.m(t.parentNode,t)):e&&(e.d(1),e=null)},i:X,o:X,d(n){e&&e.d(n),n&&M(t)}}}function Jv(i,t,e){let n,o,{mediaInstance:s={videoInstance:void 0,paused:!0}}=t,{tag:r}=t,{media:a}=t,{playButtonIfNeed:l="withoutText"}=t,{playButtonSizeIfNeed:c="small"}=t,{canPlay:u=!0}=t,{objectFit:h="fill"}=t,{disableVideoIfHavePoster:d=!1}=t,m=!0,g=!1;function p(){e(8,g=(a==null?void 0:a.type)==="Video"&&Boolean(a.videoCoverUrl))}const A=At("mediaStore"),v=At("hooks"),b=()=>{console.debug("loadPoster"),!g&&(!n||(e(9,n.muted=!0,n),n.play(),n.pause(),e(9,n.muted=!1,n),e(8,g=!0),console.debug("loadPoster end")))};v.on("loadVideoFirstFrame",b),Ze(()=>{A.subscribe(({currentMediaElement:R})=>{R!==n&&(n==null||n.pause())})});const w=R=>{e(10,m=!1),e(0,s.paused=!1,s),e(8,g=!0),n&&A.set({currentMediaElement:n}),v.emit("playStateChange",{event:R,state:"playing",tag:r,mediaInstance:n})},k=R=>{e(10,m=!0),e(0,s.paused=!0,s),v.emit("playStateChange",{event:R,state:"paused",tag:r,mediaInstance:n})},I=R=>{e(10,m=!0),e(0,s.paused=!0,s),v.emit("playStateChange",{event:R,state:"paused",tag:r,mediaInstance:n})},P=R=>{e(10,m=!0),e(0,s.paused=!0,s),v.emit("playStateChange",{event:R,state:"paused",tag:r,mediaInstance:n})},L=R=>{n&&n.pause()};function x(R){Ve[R?"unshift":"push"](()=>{s.videoInstance=R,e(0,s)})}const F=()=>l==="withText"?Bl:l==="withoutText"?co:l,N=R=>{!u||n&&(e(9,n.muted=!1,n),n.play())};return i.$$set=R=>{"mediaInstance"in R&&e(0,s=R.mediaInstance),"tag"in R&&e(1,r=R.tag),"media"in R&&e(2,a=R.media),"playButtonIfNeed"in R&&e(3,l=R.playButtonIfNeed),"playButtonSizeIfNeed"in R&&e(4,c=R.playButtonSizeIfNeed),"canPlay"in R&&e(5,u=R.canPlay),"objectFit"in R&&e(6,h=R.objectFit),"disableVideoIfHavePoster"in R&&e(7,d=R.disableVideoIfHavePoster)},i.$$.update=()=>{if(i.$$.dirty&1&&e(9,n=s.videoInstance),i.$$.dirty&4&&e(13,o=a==null?void 0:a.url),i.$$.dirty&8192&&Boolean(o)&&p(),i.$$.dirty&512&&n&&e(10,m=n.paused),i.$$.dirty&772&&(a==null?void 0:a.type)==="Video"&&!g){const R=navigator.userAgent.toLowerCase().indexOf("micromessenger")!==-1,O=navigator.userAgent.toLowerCase().indexOf("iphone")!==-1&&R;n&&O&&n.paused&&(document.removeEventListener("WeixinJSBridgeReady",b),document.removeEventListener("touchstart",b),document.removeEventListener("click",b),document.addEventListener("WeixinJSBridgeReady",b),document.addEventListener("touchstart",b),document.addEventListener("click",b))}},[s,r,a,l,c,u,h,d,g,n,m,A,v,o,w,k,I,P,L,x,F,N]}class Yl extends oe{constructor(t){super(),ie(this,t,Jv,qv,ne,{mediaInstance:0,tag:1,media:2,playButtonIfNeed:3,playButtonSizeIfNeed:4,canPlay:5,objectFit:6,disableVideoIfHavePoster:7},_v)}}function Zv(i){le(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 Qr(i,t,e){const n=i.slice();return n[25]=t[e],n[26]=t,n[27]=e,n}function Fr(i){let t,e,n,o,s,r,a;const l=[$v,Kv],c=[];function u(h,d){return h[13]&&h[10].length>1?0:1}return n=u(i),o=c[n]=l[n](i),{c(){t=B("div"),e=B("div"),o.c(),y(e,"class","media-list svelte-1mrbqlg"),q(e,"carouselEnabled",i[13]),y(t,"class","media-list-wrapper svelte-1mrbqlg"),q(t,"unfolded",i[5])},m(h,d){T(h,t,d),V(t,e),c[n].m(e,null),a=!0},p(h,d){i=h;let m=n;n=u(i),n===m?c[n].p(i,d):(se(),D(c[m],1,1,()=>{c[m]=null}),re(),o=c[n],o?o.p(i,d):(o=c[n]=l[n](i),o.c()),C(o,1),o.m(e,null)),(!a||d&8192)&&q(e,"carouselEnabled",i[13]),(!a||d&32)&&q(t,"unfolded",i[5])},i(h){a||(C(o),h&&Re(()=>{r&&r.end(1),s=zt(t,Uo,i[6]?{y:4,duration:i[4],delay:i[2],easing:vt}:void 0),s.start()}),a=!0)},o(h){D(o),s&&s.invalidate(),h&&(r=an(t,Uo,i[6]?{y:4,duration:i[4],delay:i[3],easing:vt}:void 0)),a=!1},d(h){h&&M(t),c[n].d(),h&&r&&r.end()}}}function Kv(i){let t,e,n;const o=[{media:i[1][0]},i[7],{tag:i[0]}];function s(a){i[20](a)}let r={};for(let a=0;a<o.length;a+=1)r=Be(r,o[a]);return i[8][0]!==void 0&&(r.mediaInstance=i[8][0]),t=new Yl({props:r}),Ve.push(()=>Ya(t,"mediaInstance",s)),{c(){K(t.$$.fragment)},m(a,l){J(t,a,l),n=!0},p(a,l){const c=l&131?Qe(o,[l&2&&{media:a[1][0]},l&128&&Xa(a[7]),l&1&&{tag:a[0]}]):{};!e&&l&256&&(e=!0,c.mediaInstance=a[8][0],Ga(()=>e=!1)),t.$set(c)},i(a){n||(C(t.$$.fragment,a),n=!0)},o(a){D(t.$$.fragment,a),n=!1},d(a){Z(t,a)}}}function $v(i){let t,e,n={dots:!1,arrows:!1,$$slots:{default:[eA]},$$scope:{ctx:i}};return t=new Wv({props:n}),i[18](t),t.$on("pageChange",i[19]),{c(){K(t.$$.fragment)},m(o,s){J(t,o,s),e=!0},p(o,s){const r={};s&268436865&&(r.$$scope={dirty:s,ctx:o}),t.$set(r)},i(o){e||(C(t.$$.fragment,o),e=!0)},o(o){D(t.$$.fragment,o),e=!1},d(o){i[18](null),Z(t,o)}}}function Hr(i){let t,e,n;const o=[i[7],{media:i[25]},{tag:i[0]}];function s(a){i[17](a,i[27])}let r={};for(let a=0;a<o.length;a+=1)r=Be(r,o[a]);return i[8][i[27]]!==void 0&&(r.mediaInstance=i[8][i[27]]),t=new Yl({props:r}),Ve.push(()=>Ya(t,"mediaInstance",s)),{c(){K(t.$$.fragment)},m(a,l){J(t,a,l),n=!0},p(a,l){i=a;const c=l&1153?Qe(o,[l&128&&Xa(i[7]),l&1024&&{media:i[25]},l&1&&{tag:i[0]}]):{};!e&&l&256&&(e=!0,c.mediaInstance=i[8][i[27]],Ga(()=>e=!1)),t.$set(c)},i(a){n||(C(t.$$.fragment,a),n=!0)},o(a){D(t.$$.fragment,a),n=!1},d(a){Z(t,a)}}}function eA(i){let t,e,n=i[10],o=[];for(let r=0;r<n.length;r+=1)o[r]=Hr(Qr(i,n,r));const s=r=>D(o[r],1,1,()=>{o[r]=null});return{c(){for(let r=0;r<o.length;r+=1)o[r].c();t=pe()},m(r,a){for(let l=0;l<o.length;l+=1)o[l].m(r,a);T(r,t,a),e=!0},p(r,a){if(a&1409){n=r[10];let l;for(l=0;l<n.length;l+=1){const c=Qr(r,n,l);o[l]?(o[l].p(c,a),C(o[l],1)):(o[l]=Hr(c),o[l].c(),C(o[l],1),o[l].m(t.parentNode,t))}for(se(),l=n.length;l<o.length;l+=1)s(l);re()}},i(r){if(!e){for(let a=0;a<n.length;a+=1)C(o[a]);e=!0}},o(r){o=o.filter(Boolean);for(let a=0;a<o.length;a+=1)D(o[a]);e=!1},d(r){ut(o,r),r&&M(t)}}}function tA(i){let t,e,n=i[5]&&Fr(i);return{c(){n&&n.c(),t=pe()},m(o,s){n&&n.m(o,s),T(o,t,s),e=!0},p(o,[s]){o[5]?n?(n.p(o,s),s&32&&C(n,1)):(n=Fr(o),n.c(),C(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(C(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function nA(i,t,e){let n,o,s,r,{tag:a}=t,{mediaData:l}=t,{inDelay:c=0}=t,{outDelay:u=0}=t,{duration:h=0}=t,{unfolded:d=!0}=t,{animation:m=!0}=t,{mediaItemConfig:g}=t,{enableCarousel:p=!0}=t,{autoplayConfig:A={autoplayVideo:!1,autoplayCarousel:!0,autoplayVideoInCarousel:!1}}=t,v=[],b=0,w,k=null;const I=At("hooks"),P=At("mediaStore");function L(){const S=v[b],O=S==null?void 0:S.videoInstance;!O||(O.paused?(O.muted=!1,O.play()):O.pause())}Ze(()=>{I.on("click",S=>{var O,G,W;!((W=(G=(O=a.tag3DContentSvelte)==null?void 0:O.css3DInstance)==null?void 0:G.css3DObject)!=null&&W.opacityMesh)||S.tag.id===a.id&&L()}),k=setInterval(()=>{r&&(w==null||w.goToNext())},3e3)}),Ct(()=>{clearInterval(k),I.off("click",L)});function x(S,O){i.$$.not_equal(v[O],S)&&(v[O]=S,e(8,v))}function F(S){Ve[S?"unshift":"push"](()=>{w=S,e(12,w)})}const N=S=>{n||P.set({currentMediaElement:null}),e(11,b=S.detail)};function R(S){i.$$.not_equal(v[0],S)&&(v[0]=S,e(8,v))}return i.$$set=S=>{"tag"in S&&e(0,a=S.tag),"mediaData"in S&&e(1,l=S.mediaData),"inDelay"in S&&e(2,c=S.inDelay),"outDelay"in S&&e(3,u=S.outDelay),"duration"in S&&e(4,h=S.duration),"unfolded"in S&&e(5,d=S.unfolded),"animation"in S&&e(6,m=S.animation),"mediaItemConfig"in S&&e(7,g=S.mediaItemConfig),"enableCarousel"in S&&e(15,p=S.enableCarousel),"autoplayConfig"in S&&e(16,A=S.autoplayConfig)},i.$$.update=()=>{i.$$.dirty&256&&e(9,n=v.every(S=>S.paused)),i.$$.dirty&32770&&e(13,o=p&&(l==null?void 0:l.length)>1),i.$$.dirty&2&&e(10,s=l),i.$$.dirty&67072&&(r=s.length>1&&A.autoplayCarousel&&n)},[a,l,c,u,h,d,m,g,v,n,s,b,w,o,P,p,A,x,F,N,R]}class Ul extends oe{constructor(t){super(),ie(this,t,nA,tA,ne,{tag:0,mediaData:1,inDelay:2,outDelay:3,duration:4,unfolded:5,animation:6,mediaItemConfig:7,enableCarousel:15,autoplayConfig:16},Zv)}}function iA(i){le(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 Gr(i){let t,e,n,o,s,r,a,l;t=new st({props:{visible:i[3],left:61,bottom:57,width:2,blurRadius:150,spreadRadius:75}}),o=new L0({props:{unfolded:i[3],outDelay:400}});let c=i[2]&&Wr(i),u=i[1]&&_r(i);return{c(){K(t.$$.fragment),e=$(),n=B("div"),K(o.$$.fragment),s=$(),c&&c.c(),r=$(),u&&u.c(),a=pe(),y(n,"class","line svelte-1f7m1lj")},m(h,d){J(t,h,d),T(h,e,d),T(h,n,d),J(o,n,null),T(h,s,d),c&&c.m(h,d),T(h,r,d),u&&u.m(h,d),T(h,a,d),l=!0},p(h,d){const m={};d&8&&(m.visible=h[3]),t.$set(m);const g={};d&8&&(g.unfolded=h[3]),o.$set(g),h[2]?c?(c.p(h,d),d&4&&C(c,1)):(c=Wr(h),c.c(),C(c,1),c.m(r.parentNode,r)):c&&(se(),D(c,1,1,()=>{c=null}),re()),h[1]?u?(u.p(h,d),d&2&&C(u,1)):(u=_r(h),u.c(),C(u,1),u.m(a.parentNode,a)):u&&(se(),D(u,1,1,()=>{u=null}),re())},i(h){l||(C(t.$$.fragment,h),C(o.$$.fragment,h),C(c),C(u),l=!0)},o(h){D(t.$$.fragment,h),D(o.$$.fragment,h),D(c),D(u),l=!1},d(h){Z(t,h),h&&M(e),h&&M(n),Z(o),h&&M(s),c&&c.d(h),h&&M(r),u&&u.d(h),h&&M(a)}}}function Wr(i){let t,e,n;return e=new Gl({props:{unfolded:i[3],content:i[2],inDelay:500}}),{c(){t=B("div"),K(e.$$.fragment),y(t,"class","text svelte-1f7m1lj")},m(o,s){T(o,t,s),J(e,t,null),n=!0},p(o,s){const r={};s&8&&(r.unfolded=o[3]),s&4&&(r.content=o[2]),e.$set(r)},i(o){n||(C(e.$$.fragment,o),n=!0)},o(o){D(e.$$.fragment,o),n=!1},d(o){o&&M(t),Z(e)}}}function _r(i){let t,e,n;return e=new Ul({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=B("div"),K(e.$$.fragment),y(t,"class","media-wrapper svelte-1f7m1lj")},m(o,s){T(o,t,s),J(e,t,null),n=!0},p(o,s){const r={};s&8&&(r.unfolded=o[3]),s&2&&(r.mediaData=o[1]),s&1&&(r.tag=o[0]),e.$set(r)},i(o){n||(C(e.$$.fragment,o),n=!0)},o(o){D(e.$$.fragment,o),n=!1},d(o){o&&M(t),Z(e)}}}function oA(i){let t,e,n=i[0].state&&Gr(i);return{c(){n&&n.c(),t=pe()},m(o,s){n&&n.m(o,s),T(o,t,s),e=!0},p(o,[s]){o[0].state?n?(n.p(o,s),s&1&&C(n,1)):(n=Gr(o),n.c(),C(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(C(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function sA(i,t,e){let n,o,s,r,{tag:a}=t;return i.$$set=l=>{"tag"in l&&e(0,a=l.tag)},i.$$.update=()=>{var l,c,u;i.$$.dirty&1&&e(3,n=a.state?a.state.unfolded:!1),i.$$.dirty&1&&e(4,o=(c=(l=a.data.title)!=null?l:a.data.text)!=null?c:""),i.$$.dirty&16&&e(2,s=((u=o.length)!=null?u:0)>7?o.substring(0,6)+"...":o),i.$$.dirty&1&&e(1,r=a.data.mediaData)},[a,r,s,n,o]}class rA extends oe{constructor(t){super(),ie(this,t,sA,oA,ne,{tag:0},iA)}}function aA(i){le(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 Nr(i,t,e){const n=i.slice();return n[0]=t[e],n}function Xr(i,t,e){const n=i.slice();return n[0]=t[e],n}function Yr(i){let t,e;return{c(){t=B("img"),y(t,"class","headerImage svelte-sezqcq"),Xe(t.src,e=i[3].headerPictureUrl)||y(t,"src",e),y(t,"alt","")},m(n,o){T(n,t,o)},p(n,o){o&8&&!Xe(t.src,e=n[3].headerPictureUrl)&&y(t,"src",e)},d(n){n&&M(t)}}}function Ur(i){let t,e,n,o,s=i[2]||[],r=[];for(let c=0;c<s.length;c+=1)r[c]=qr(Xr(i,s,c));let a=i[5]||[],l=[];for(let c=0;c<a.length;c+=1)l[c]=Jr(Nr(i,a,c));return{c(){t=B("div"),e=B("div");for(let c=0;c<r.length;c+=1)r[c].c();n=$();for(let c=0;c<l.length;c+=1)l[c].c();y(e,"class","tags svelte-sezqcq"),Re(()=>i[11].call(e)),y(t,"class","tags-wrapper svelte-sezqcq")},m(c,u){T(c,t,u),V(t,e);for(let h=0;h<r.length;h+=1)r[h].m(e,null);V(e,n);for(let h=0;h<l.length;h+=1)l[h].m(e,null);o=vi(e,i[11].bind(e))},p(c,u){if(u&4){s=c[2]||[];let h;for(h=0;h<s.length;h+=1){const d=Xr(c,s,h);r[h]?r[h].p(d,u):(r[h]=qr(d),r[h].c(),r[h].m(e,n))}for(;h<r.length;h+=1)r[h].d(1);r.length=s.length}if(u&32){a=c[5]||[];let h;for(h=0;h<a.length;h+=1){const d=Nr(c,a,h);l[h]?l[h].p(d,u):(l[h]=Jr(d),l[h].c(),l[h].m(e,null))}for(;h<l.length;h+=1)l[h].d(1);l.length=a.length}},d(c){c&&M(t),ut(r,c),ut(l,c),o()}}}function qr(i){let t,e=i[0]+"",n;return{c(){t=B("div"),n=xe(e),y(t,"class","tag primary-tag svelte-sezqcq"),z(t,"min-width",To)},m(o,s){T(o,t,s),V(t,n)},p(o,s){s&4&&e!==(e=o[0]+"")&&Se(n,e)},d(o){o&&M(t)}}}function Jr(i){let t,e=i[0]+"",n;return{c(){t=B("div"),n=xe(e),y(t,"class","tag secondary-tag svelte-sezqcq"),z(t,"min-width",To)},m(o,s){T(o,t,s),V(t,n)},p(o,s){s&32&&e!==(e=o[0]+"")&&Se(n,e)},d(o){o&&M(t)}}}function Zr(i){let t,e,n=i[7]&&Kr(i),o=i[3].highlightText&&ea(i);return{c(){t=B("div"),n&&n.c(),e=$(),o&&o.c(),y(t,"class","footer svelte-sezqcq")},m(s,r){T(s,t,r),n&&n.m(t,null),V(t,e),o&&o.m(t,null)},p(s,r){s[7]?n?n.p(s,r):(n=Kr(s),n.c(),n.m(t,e)):n&&(n.d(1),n=null),s[3].highlightText?o?o.p(s,r):(o=ea(s),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(s){s&&M(t),n&&n.d(),o&&o.d()}}}function Kr(i){let t,e,n=i[3].price.value+"",o,s,r=i[3].price.unit&&$r(i);return{c(){t=B("div"),e=B("span"),o=xe(n),s=$(),r&&r.c(),y(e,"class","value svelte-sezqcq"),y(t,"class","price svelte-sezqcq")},m(a,l){T(a,t,l),V(t,e),V(e,o),V(t,s),r&&r.m(t,null)},p(a,l){l&8&&n!==(n=a[3].price.value+"")&&Se(o,n),a[3].price.unit?r?r.p(a,l):(r=$r(a),r.c(),r.m(t,null)):r&&(r.d(1),r=null)},d(a){a&&M(t),r&&r.d()}}}function $r(i){let t,e=i[3].price.unit+"",n;return{c(){t=B("span"),n=xe(e),y(t,"class","unit svelte-sezqcq")},m(o,s){T(o,t,s),V(t,n)},p(o,s){s&8&&e!==(e=o[3].price.unit+"")&&Se(n,e)},d(o){o&&M(t)}}}function ea(i){let t,e,n,o,s=i[3].highlightText+"",r,a,l;return{c(){t=B("div"),e=B("div"),n=$(),o=B("span"),r=xe(s),a=$(),l=B("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(o,"class","text svelte-sezqcq"),y(t,"class","goto-button goto-icon svelte-sezqcq"),y(l,"class","arrow-wrapper svelte-sezqcq")},m(c,u){T(c,t,u),V(t,e),V(t,n),V(t,o),V(o,r),T(c,a,u),T(c,l,u)},p(c,u){u&8&&s!==(s=c[3].highlightText+"")&&Se(r,s)},d(c){c&&M(t),c&&M(a),c&&M(l)}}}function lA(i){var k,I;let t,e,n,o,s,r,a,l,c,u,h=i[3].title+"",d,m,g,p,A;e=new st({props:{visible:i[4],outDelay:500,left:61,bottom:87,blurRadius:150,spreadRadius:75}});let v=i[3].headerPictureUrl&&Yr(i),b=((k=i[2].length)!=null?k:0)+((I=i[5].length)!=null?I:0)>0&&Ur(i),w=(i[7]||i[3].highlightText)&&Zr(i);return{c(){t=B("div"),K(e.$$.fragment),n=$(),o=B("div"),s=$(),r=B("div"),v&&v.c(),a=$(),l=B("div"),c=B("div"),u=B("div"),d=xe(h),m=$(),b&&b.c(),g=$(),w&&w.c(),y(o,"class","line svelte-sezqcq"),z(o,"transition-delay",i[4]?Un+"ms":qn+na-ta-40+"ms"),y(u,"class","text svelte-sezqcq"),y(c,"class","title svelte-sezqcq"),y(l,"class","title-wrapper svelte-sezqcq"),y(r,"class","content svelte-sezqcq"),z(r,"max-width",ot(i[9])),z(r,"transition-delay",i[4]?Un+qn+"ms":"0ms"),y(t,"class",p=Ie(`marketing ${i[6]}`)+" svelte-sezqcq"),q(t,"unfolded",i[4]),q(t,"folded",i[8])},m(P,L){T(P,t,L),J(e,t,null),V(t,n),V(t,o),V(t,s),V(t,r),v&&v.m(r,null),V(r,a),V(r,l),V(l,c),V(c,u),V(u,d),V(r,m),b&&b.m(r,null),V(r,g),w&&w.m(r,null),A=!0},p(P,[L]){var F,N;const x={};L&16&&(x.visible=P[4]),e.$set(x),L&16&&z(o,"transition-delay",P[4]?Un+"ms":qn+na-ta-40+"ms"),P[3].headerPictureUrl?v?v.p(P,L):(v=Yr(P),v.c(),v.m(r,a)):v&&(v.d(1),v=null),(!A||L&8)&&h!==(h=P[3].title+"")&&Se(d,h),((F=P[2].length)!=null?F:0)+((N=P[5].length)!=null?N:0)>0?b?b.p(P,L):(b=Ur(P),b.c(),b.m(r,g)):b&&(b.d(1),b=null),P[7]||P[3].highlightText?w?w.p(P,L):(w=Zr(P),w.c(),w.m(r,null)):w&&(w.d(1),w=null),L&16&&z(r,"transition-delay",P[4]?Un+qn+"ms":"0ms"),(!A||L&64&&p!==(p=Ie(`marketing ${P[6]}`)+" svelte-sezqcq"))&&y(t,"class",p),(!A||L&80)&&q(t,"unfolded",P[4]),(!A||L&320)&&q(t,"folded",P[8])},i(P){A||(C(e.$$.fragment,P),A=!0)},o(P){D(e.$$.fragment,P),A=!1},d(P){P&&M(t),Z(e),v&&v.d(),b&&b.d(),w&&w.d()}}}const To=40,Un=400,ta=500,qn=180,na=500;function cA(i,t,e){let n,o,s,r,a,l,c,u,{tag:h}=t,d,m=(()=>{var A;const p=(A=h.data.limitWidth)!=null?A:!0;if(typeof p=="number")return p;if(p===!0)return 172})();function g(){d=this.offsetHeight,e(1,d)}return i.$$set=p=>{"tag"in p&&e(0,h=p.tag)},i.$$.update=()=>{var p,A,v,b,w,k;i.$$.dirty&1&&e(4,n=(A=(p=h.state)==null?void 0:p.unfolded)!=null?A:!1),i.$$.dirty&16&&e(8,o=!n),i.$$.dirty&1&&e(3,s=h.data),i.$$.dirty&8&&e(7,r=wt((v=s.price)==null?void 0:v.value)&&((b=s.price)==null?void 0:b.value)!==""),i.$$.dirty&1&&e(6,a=h.data.theme||"light"),i.$$.dirty&1026&&d>40&&e(10,l=l-1),i.$$.dirty&1032&&e(2,c=((w=s.brandTags)==null?void 0:w.slice(0,l).filter(Boolean))||[]),i.$$.dirty&1036&&e(5,u=((k=s.tags)==null?void 0:k.slice(0,l-c.length).filter(Boolean))||[])},e(10,l=(m-20)/To),[h,d,c,s,n,u,a,r,o,m,l,g]}class uA extends oe{constructor(t){super(),ie(this,t,cA,lA,ne,{tag:0},aA)}}class dA 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 H(this,null,function*(){var n,o,s;if(this.tryplaying)return;this.tryplaying=!0,(!this.audioInstance||((n=this.audioInstance)==null?void 0:n.realSrc)!==this.sharedAudioSrc)&&(this.audioInstance=bg(this.sharedAudioSrc,{namespace:Do.PlayAudio})),(o=this.eventListenerDisposer)==null||o.call(this),this.eventListenerDisposer=this.addEventListeners(),this.audioInstance.currentTime=(s=this.currentTime)!=null?s: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: \u97F3\u9891\u6587\u4EF6\u53EF\u80FD\u635F\u574F\u6216\u4FEE\u6539\u8FC7\u6587\u4EF6\u540E\u7F00",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,o;(n=this.onended)==null||n.call(this,e!=null?e:new Event("ended")),(o=this.eventListenerDisposer)==null||o.call(this),this.sharedAudioPaused=!0,this.sharedAudioCurrentTime=0,this.clear()}addEventListeners(){const e=this.audioInstance;if(!e)return;const n=d=>{var m;this.sharedAudioCurrentTime=e.currentTime,(m=this.ontimeupdate)==null||m.call(this,d)},o=d=>{var m;e.isBlankAudio||(this.sharedAudioPaused=!1,(m=this.onplay)==null||m.call(this,d))},s=d=>{this.pause(d)},r=d=>{this.endedHandler(d)},a=d=>{var m;this.sharedAudioPaused=!0,(m=this.onerror)==null||m.call(this,d)},l=d=>{var m;return(m=this.oncanplay)==null?void 0:m.call(this,d)},c=d=>{var m;return(m=this.oncanplaythrough)==null?void 0:m.call(this,d)},u=d=>{var m;return(m=this.onloadeddata)==null?void 0:m.call(this,d)},h=d=>{var m;return(m=this.onloadedmetadata)==null?void 0:m.call(this,d)};return e.addEventListener("timeupdate",n),e.addEventListener("play",o),e.addEventListener("pause",s),e.addEventListener("ended",r),e.addEventListener("error",a),e.addEventListener("canplay",l),e.addEventListener("canplaythrough",c),e.addEventListener("loadeddata",u),e.addEventListener("loadedmetadata",h),()=>{e.removeEventListener("timeupdate",n),e.removeEventListener("play",o),e.removeEventListener("pause",s),e.removeEventListener("ended",r),e.removeEventListener("error",a),e.removeEventListener("canplay",l),e.removeEventListener("canplaythrough",c),e.removeEventListener("loadeddata",u),e.removeEventListener("loadedmetadata",h)}}}function hA(i){le(i,"svelte-13e7hxv",".audio.svelte-13e7hxv{pointer-events:auto;cursor:pointer;width:100%;height:100%}")}function fA(i){let t,e,n,o;const s=i[8].default,r=tn(s,i,i[7],null);return{c(){t=B("div"),r&&r.c(),y(t,"class","audio svelte-13e7hxv"),y(t,"style",i[0])},m(a,l){T(a,t,l),r&&r.m(t,null),e=!0,n||(o=me(t,"click",Va(i[1])),n=!0)},p(a,[l]){r&&r.p&&(!e||l&128)&&on(r,s,a,a[7],e?nn(s,a[7],l,null):sn(a[7]),null),(!e||l&1)&&y(t,"style",a[0])},i(a){e||(C(r,a),e=!0)},o(a){D(r,a),e=!1},d(a){a&&M(t),r&&r.d(a),n=!1,o()}}}function mA(i,t,e){let{$$slots:n={},$$scope:o}=t,{url:s}=t,{enable:r=!0}=t,{style:a=""}=t,{hooksInfo:l}=t;const c=Ai(),u=At("hooks"),h=At("mediaStore");let d,m=!0;function g(){e(5,d.onplay=A=>{u.emit("playStateChange",Q({event:A,state:"playing",mediaInstance:d},l)),c("play"),e(6,m=!1)},d),e(5,d.onpause=A=>{u.emit("playStateChange",Q({event:A,state:"paused",mediaInstance:d},l)),c("pause"),e(6,m=!0)},d),e(5,d.onended=A=>{u.emit("playStateChange",Q({event:A,state:"paused",mediaInstance:d},l)),c("pause"),e(6,m=!0)},d),e(5,d.onloadedmetadata=A=>{typeof d.duration=="number"&&!Number.isNaN(d.duration)&&c("duration",d.duration)},d),e(5,d.onerror=A=>{c("pause"),e(6,m=!0)},d),e(5,d.ontimeupdate=A=>{c("timeupdate",d.currentTime)},d)}h.subscribe(({currentMediaElement:A})=>{A!==d&&(m||d==null||d.pause())});function p(A){!d||(u.emit("click",Q({event:A,target:"AudioTagPlayIcon",audioInstance:d},l)),h.set({currentMediaElement:d}),u.emit("playStateChange",Q({event:A,state:d.paused?"playing":"paused",mediaInstance:d},l)),d.paused?d.play():d.pause())}return i.$$set=A=>{"url"in A&&e(2,s=A.url),"enable"in A&&e(3,r=A.enable),"style"in A&&e(0,a=A.style),"hooksInfo"in A&&e(4,l=A.hooksInfo),"$$scope"in A&&e(7,o=A.$$scope)},i.$$.update=()=>{i.$$.dirty&4&&(s||c("duration",0)),i.$$.dirty&36&&(d==null||d.dispose(),e(5,d=new dA(s)),c("audioRef",d),setTimeout(()=>c("audioRef",d),200),g()),i.$$.dirty&40&&(r||d==null||d.pause()),i.$$.dirty&72&&c(r&&!m?"play":"pause")},[a,p,s,r,l,d,m,o,n]}class ql extends oe{constructor(t){super(),ie(this,t,mA,fA,ne,{url:2,enable:3,style:0,hooksInfo:4},hA)}}function pA(i){le(i,"svelte-srt2pi",".audio-icon__wrapper.svelte-srt2pi.svelte-srt2pi{display:inline-block}.audio-icon.svelte-srt2pi.svelte-srt2pi{display:flex;justify-content:center;align-items:center;position:relative;width:100%;height:100%;border-radius:50%;background-color:rgba(255, 255, 255, 0.8)}.audio-icon.svelte-srt2pi .sound-wave__container.svelte-srt2pi{position:absolute;pointer-events:none;width:60%;height:60%}.sound-wave.svelte-srt2pi.svelte-srt2pi{animation-duration:2s;animation-iteration-count:infinite;animation-play-state:paused;transition:opacity 0}.playing.svelte-srt2pi .sound-wave.svelte-srt2pi{animation-play-state:running}.playing.svelte-srt2pi .sound-wave-1.svelte-srt2pi{animation-name:svelte-srt2pi-sound_wave_1_animation}.playing.svelte-srt2pi .sound-wave-2.svelte-srt2pi{animation-name:svelte-srt2pi-sound_wave_2_animation}.playing.svelte-srt2pi .sound-wave-3.svelte-srt2pi{animation-name:svelte-srt2pi-sound_wave_3_animation}@keyframes svelte-srt2pi-sound_wave_1_animation{0%,10%{opacity:0}25%,100%{opacity:1}}@keyframes svelte-srt2pi-sound_wave_2_animation{0%,35%{opacity:0}50%,100%{opacity:1}}@keyframes svelte-srt2pi-sound_wave_3_animation{0%,60%{opacity:0}75%,100%{opacity:1}}")}function ia(i){let t,e;return t=new st({props:{center:!0,blurRadius:12,spreadRadius:5}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},i(n){e||(C(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function gA(i){let t,e,n,o,s,r=i[1]&&ia();return{c(){t=B("div"),r&&r.c(),e=$(),n=B("div"),o=B("div"),o.innerHTML='<svg width="100%" height="100%" viewBox="0 0 128 128"><g transform="rotate(-45 12 64) translate(12 64)" fill="black" stroke="black" fill-opacity="0.6" stroke-opacity="0.6"><path stroke="none" class="sound-wave sound-wave-1 svelte-srt2pi" d="M0,23 A23,23 0 0,0 23,0 L0,0"></path><path fill="none" stroke-width="15" class="sound-wave sound-wave-2 svelte-srt2pi" d="M0,46 A46,46 0 0,0 46,0"></path><path fill="none" stroke-width="15" class="sound-wave sound-wave-3 svelte-srt2pi" d="M0,80 A80,80 0 0,0 80,0"></path></g></svg>',y(o,"class","sound-wave__container svelte-srt2pi"),y(n,"class","audio-icon svelte-srt2pi"),q(n,"playing",i[0]),y(t,"class","audio-icon__wrapper svelte-srt2pi"),y(t,"style",i[2]),z(t,"width",i[5]),z(t,"height",i[5])},m(a,l){T(a,t,l),r&&r.m(t,null),V(t,e),V(t,n),V(n,o),i[7](o),i[8](t),s=!0},p(a,[l]){a[1]?r?l&2&&C(r,1):(r=ia(),r.c(),C(r,1),r.m(t,e)):r&&(se(),D(r,1,1,()=>{r=null}),re()),(!s||l&1)&&q(n,"playing",a[0]),(!s||l&4)&&y(t,"style",a[2]),l&32&&z(t,"width",a[5]),l&32&&z(t,"height",a[5])},i(a){s||(C(r),s=!0)},o(a){D(r),s=!1},d(a){a&&M(t),r&&r.d(),i[7](null),i[8](null)}}}function vA(i,t,e){let n,{playing:o}=t,{shadow:s=!1}=t,{style:r=null}=t,{width:a="100%"}=t,l,c;function u(d){Ve[d?"unshift":"push"](()=>{c=d,e(4,c)})}function h(d){Ve[d?"unshift":"push"](()=>{l=d,e(3,l)})}return i.$$set=d=>{"playing"in d&&e(0,o=d.playing),"shadow"in d&&e(1,s=d.shadow),"style"in d&&e(2,r=d.style),"width"in d&&e(6,a=d.width)},i.$$.update=()=>{i.$$.dirty&64&&e(5,n=typeof a=="number"?ot(a):a)},[o,s,r,l,c,n,a,u,h]}class Jl extends oe{constructor(t){super(),ie(this,t,vA,gA,ne,{playing:0,shadow:1,style:2,width:6},pA)}}function AA(i){le(i,"svelte-1s6gk4a",".audio-tag.svelte-1s6gk4a{position:absolute;left:0;top:0;width:0;height:0;overflow:visible}.audio-icon__wrapper.svelte-1s6gk4a{position:relative;vertical-align:top;width:100%;height:100%}.content.svelte-1s6gk4a{width:-moz-max-content;width:max-content;height:3.375rem;padding:2.25rem 0.25rem 0 1rem;position:absolute;left:0;bottom:0.125rem;overflow:hidden;box-sizing:border-box;font-size:0;white-space:nowrap;font-weight:600}.wrapper.svelte-1s6gk4a{position:relative;width:100%;height:100%}.audio-icon.svelte-1s6gk4a{pointer-events:none;vertical-align:top;display:inline-block;width:1rem;height:1rem;margin-right:0.25rem;margin-top:0.0625rem}.audio.svelte-1s6gk4a{position:relative;width:100%;height:100%}")}function oa(i){var A,v;let t,e,n,o,s,r,a,l,c,u,h,d,m,g;e=new st({props:{visible:i[6],left:i[3]/2+"px",bottom:12,width:2,blurRadius:120,spreadRadius:60}});let p=i[6]&&sa(i);return c=new Wl({props:{visible:i[6],textUnfolded:i[1],content:i[5]}}),h=new Lo({props:{unfolded:i[6],length:i[3],outDelay:i[4]+20*Math.min((v=(A=i[5])==null?void 0:A.length)!=null?v:10,15),useLinearColor:!0}}),{c(){t=B("div"),K(e.$$.fragment),n=$(),o=B("div"),s=B("div"),r=B("div"),p&&p.c(),a=$(),l=B("div"),K(c.$$.fragment),u=$(),K(h.$$.fragment),y(r,"class","audio-icon svelte-1s6gk4a"),z(l,"display","inline-block"),y(s,"class","wrapper svelte-1s6gk4a"),y(o,"class","content svelte-1s6gk4a"),y(t,"class","audio-tag svelte-1s6gk4a"),q(t,"unfolded",i[6])},m(b,w){T(b,t,w),J(e,t,null),V(t,n),V(t,o),V(o,s),V(s,r),p&&p.m(r,null),V(s,a),V(s,l),J(c,l,null),V(t,u),J(h,t,null),d=!0,m||(g=[me(l,"click",i[7]),ct(ln.call(null,l)),me(l,"clientWidth",i[12])],m=!0)},p(b,w){var L,x;const k={};w&64&&(k.visible=b[6]),w&8&&(k.left=b[3]/2+"px"),e.$set(k),b[6]?p?(p.p(b,w),w&64&&C(p,1)):(p=sa(b),p.c(),C(p,1),p.m(r,null)):p&&(se(),D(p,1,1,()=>{p=null}),re());const I={};w&64&&(I.visible=b[6]),w&2&&(I.textUnfolded=b[1]),w&32&&(I.content=b[5]),c.$set(I);const P={};w&64&&(P.unfolded=b[6]),w&8&&(P.length=b[3]),w&48&&(P.outDelay=b[4]+20*Math.min((x=(L=b[5])==null?void 0:L.length)!=null?x:10,15)),h.$set(P),(!d||w&64)&&q(t,"unfolded",b[6])},i(b){d||(C(e.$$.fragment,b),C(p),C(c.$$.fragment,b),C(h.$$.fragment,b),d=!0)},o(b){D(e.$$.fragment,b),D(p),D(c.$$.fragment,b),D(h.$$.fragment,b),d=!1},d(b){b&&M(t),Z(e),p&&p.d(),Z(c),Z(h),m=!1,He(g)}}}function sa(i){let t,e,n,o,s,r,a;return e=new st({props:{center:!0,blurRadius:15,spreadRadius:6}}),o=new ql({props:{enable:i[6],url:i[0].data.audioUrl,hooksInfo:{tag:i[0]},$$slots:{default:[bA]},$$scope:{ctx:i}}}),o.$on("play",i[8]),o.$on("pause",i[9]),o.$on("error",i[10]),o.$on("audioRef",i[11]),{c(){t=B("div"),K(e.$$.fragment),n=$(),K(o.$$.fragment),y(t,"class","audio svelte-1s6gk4a")},m(l,c){T(l,t,c),J(e,t,null),V(t,n),J(o,t,null),a=!0},p(l,c){i=l;const u={};c&64&&(u.enable=i[6]),c&1&&(u.url=i[0].data.audioUrl),c&1&&(u.hooksInfo={tag:i[0]}),c&8196&&(u.$$scope={dirty:c,ctx:i}),o.$set(u)},i(l){a||(C(e.$$.fragment,l),C(o.$$.fragment,l),l&&Re(()=>{r&&r.end(1),s=zt(t,St,{duration:1e3,delay:0,easing:Ut}),s.start()}),a=!0)},o(l){var c,u;D(e.$$.fragment,l),D(o.$$.fragment,l),s&&s.invalidate(),l&&(r=an(t,St,{duration:1e3,delay:20*Math.min((u=(c=i[5])==null?void 0:c.length)!=null?u:10,15),easing:Ut})),a=!1},d(l){l&&M(t),Z(e),Z(o),l&&r&&r.end()}}}function bA(i){let t,e,n;return e=new Jl({props:{playing:i[2]}}),{c(){t=B("div"),K(e.$$.fragment),y(t,"class","audio-icon__wrapper svelte-1s6gk4a")},m(o,s){T(o,t,s),J(e,t,null),n=!0},p(o,s){const r={};s&4&&(r.playing=o[2]),e.$set(r)},i(o){n||(C(e.$$.fragment,o),n=!0)},o(o){D(e.$$.fragment,o),n=!1},d(o){o&&M(t),Z(e)}}}function yA(i){let t,e,n=i[0].state&&oa(i);return{c(){n&&n.c(),t=pe()},m(o,s){n&&n.m(o,s),T(o,t,s),e=!0},p(o,[s]){o[0].state?n?(n.p(o,s),s&1&&C(n,1)):(n=oa(o),n.c(),C(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(C(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function wA(i,t,e){let n,o,s,{tag:r}=t,a=!1,l=!1,c;function u(){e(1,a=!a)}const h=()=>{e(2,l=!0)},d=()=>{e(2,l=!1)},m=()=>{e(2,l=!1)};function g(A){rn.call(this,i,A)}const p=A=>{e(3,c=A.detail)};return i.$$set=A=>{"tag"in A&&e(0,r=A.tag)},i.$$.update=()=>{var A,v,b;i.$$.dirty&1&&e(6,n=!!((A=r.state)!=null&&A.unfolded)),i.$$.dirty&1&&e(5,o=(b=(v=r.data.title)!=null?v:r.data.text)!=null?b:""),i.$$.dirty&2&&e(4,s=a?450:0)},[r,a,l,c,s,o,n,u,h,d,m,g,p]}class EA extends oe{constructor(t){super(),ie(this,t,wA,yA,ne,{tag:0},AA)}}function PA(i){le(i,"svelte-58hfjf",".audio-tag__wrapper.svelte-58hfjf{position:absolute;left:50%;top:50%;transform:translate(-50%, -50%)}.audio-tag.svelte-58hfjf{position:relative;width:-moz-max-content;width:max-content;height:-moz-max-content;height:max-content;padding:0.1875rem;padding-right:0.625rem;border-radius:624999.9375rem;border:0.03125rem solid rgba(255, 255, 255, 0.2)}.audio__inner.svelte-58hfjf{display:flex;align-items:center;justify-content:center;width:100%;height:100%}.text.svelte-58hfjf{font-weight:bold;font-size:0.75rem;margin-left:0.25rem}.audio-icon__wrapper.svelte-58hfjf{position:relative;vertical-align:top;pointer-events:none;width:1.375rem;height:1.375rem}")}function ra(i){let t,e,n,o;return n=new ql({props:{style:"width: max-content; height: max-content;",enable:i[0].state.visible,url:i[0].data.audioUrl,hooksInfo:{tag:i[0]},$$slots:{default:[IA]},$$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=B("div"),e=B("div"),K(n.$$.fragment),y(e,"class","audio-tag svelte-58hfjf"),z(e,"background-color",i[4].bgColor),z(e,"color",i[4].fontColor),y(t,"class","audio-tag__wrapper svelte-58hfjf")},m(s,r){T(s,t,r),V(t,e),J(n,e,null),o=!0},p(s,r){const a={};r&1&&(a.enable=s[0].state.visible),r&1&&(a.url=s[0].data.audioUrl),r&1&&(a.hooksInfo={tag:s[0]}),r&8232&&(a.$$scope={dirty:r,ctx:s}),n.$set(a),r&16&&z(e,"background-color",s[4].bgColor),r&16&&z(e,"color",s[4].fontColor)},i(s){o||(C(n.$$.fragment,s),o=!0)},o(s){D(n.$$.fragment,s),o=!1},d(s){s&&M(t),Z(n)}}}function CA(i){let t;return{c(){t=xe(i[5])},m(e,n){T(e,t,n)},p(e,n){n&32&&Se(t,e[5])},d(e){e&&M(t)}}}function IA(i){let t,e,n,o,s,r,a;return n=new Jl({props:{playing:i[3]}}),r=new Mo({props:{maxWidth:72,$$slots:{default:[CA]},$$scope:{ctx:i}}}),{c(){t=B("div"),e=B("div"),K(n.$$.fragment),o=$(),s=B("div"),K(r.$$.fragment),y(e,"class","audio-icon__wrapper svelte-58hfjf"),y(s,"class","text svelte-58hfjf"),y(t,"class","audio__inner svelte-58hfjf")},m(l,c){T(l,t,c),V(t,e),J(n,e,null),V(t,o),V(t,s),J(r,s,null),a=!0},p(l,c){const u={};c&8&&(u.playing=l[3]),n.$set(u);const h={};c&8224&&(h.$$scope={dirty:c,ctx:l}),r.$set(h)},i(l){a||(C(n.$$.fragment,l),C(r.$$.fragment,l),a=!0)},o(l){D(n.$$.fragment,l),D(r.$$.fragment,l),a=!1},d(l){l&&M(t),Z(n),Z(r)}}}function kA(i){let t,e,n=i[0].state&&ra(i);return{c(){n&&n.c(),t=pe()},m(o,s){n&&n.m(o,s),T(o,t,s),e=!0},p(o,[s]){o[0].state?n?(n.p(o,s),s&1&&C(n,1)):(n=ra(o),n.c(),C(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(C(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function xA(i,t,e){let n,o,{tag:s}=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 u=()=>{e(3,c=!0)},h=()=>{e(3,c=!1)},d=()=>{e(3,c=!1)},m=A=>{e(1,a=A.detail)},g=A=>{e(2,l=A.detail)};function p(A){rn.call(this,i,A)}return i.$$set=A=>{"tag"in A&&e(0,s=A.tag)},i.$$.update=()=>{var A,v,b;i.$$.dirty&1&&e(5,n=(v=(A=s.data.title)!=null?A:s.data.text)!=null?v:""),i.$$.dirty&1&&e(4,o=(b=r[s.data.theme||"light"])!=null?b:r.light)},[s,a,l,c,o,n,u,h,d,m,g,p]}class DA extends oe{constructor(t){super(),ie(this,t,xA,kA,ne,{tag:0},PA)}}function LA(i){let t,e;return t=new DA({props:{tag:i[0]}}),t.$on("audioRef",i[2]),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.tag=n[0]),t.$set(s)},i(n){e||(C(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function MA(i){let t,e;return t=new EA({props:{tag:i[0]}}),t.$on("audioRef",i[2]),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.tag=n[0]),t.$set(s)},i(n){e||(C(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function SA(i){let t,e,n,o;const s=[MA,LA],r=[];function a(l,c){return l[1]==="line"?0:l[1]==="plane"?1:-1}return~(t=a(i))&&(e=r[t]=s[t](i)),{c(){e&&e.c(),n=pe()},m(l,c){~t&&r[t].m(l,c),T(l,n,c),o=!0},p(l,[c]){let u=t;t=a(l),t===u?~t&&r[t].p(l,c):(e&&(se(),D(r[u],1,1,()=>{r[u]=null}),re()),~t?(e=r[t],e?e.p(l,c):(e=r[t]=s[t](l),e.c()),C(e,1),e.m(n.parentNode,n)):e=null)},i(l){o||(C(e),o=!0)},o(l){D(e),o=!1},d(l){~t&&r[t].d(l),l&&M(n)}}}function TA(i,t,e){let n,{tag:o}=t,s;function r(a){s=a.detail}return o.play=()=>s.play(),o.pause=()=>s.pause(),i.$$set=a=>{"tag"in a&&e(0,o=a.tag)},i.$$.update=()=>{var a;i.$$.dirty&1&&e(1,n=(a=o.data.appearance)!=null?a:"line")},[o,n,r]}class zA extends oe{constructor(t){super(),ie(this,t,TA,SA,ne,{tag:0})}}function BA(i){le(i,"svelte-10cw0el",".media-wrapper.svelte-10cw0el{position:absolute;width:100%;height:100%}")}function aa(i){var o;let t,e,n;return e=new Ul({props:{mediaItemConfig:{canPlay:!0,playButtonSizeIfNeed:"large",playButtonIfNeed:(o=i[4])!=null?o:"withText",disableVideoIfHavePoster:!1,objectFit:i[2]},unfolded:i[6],mediaData:i[5],enableCarousel:i[1],autoplayConfig:i[3],tag:i[0],inDelay:500,duration:500}}),{c(){t=B("div"),K(e.$$.fragment),y(t,"class","media-wrapper svelte-10cw0el")},m(s,r){T(s,t,r),J(e,t,null),n=!0},p(s,r){var l;const a={};r&20&&(a.mediaItemConfig={canPlay:!0,playButtonSizeIfNeed:"large",playButtonIfNeed:(l=s[4])!=null?l:"withText",disableVideoIfHavePoster:!1,objectFit:s[2]}),r&64&&(a.unfolded=s[6]),r&32&&(a.mediaData=s[5]),r&2&&(a.enableCarousel=s[1]),r&8&&(a.autoplayConfig=s[3]),r&1&&(a.tag=s[0]),e.$set(a)},i(s){n||(C(e.$$.fragment,s),n=!0)},o(s){D(e.$$.fragment,s),n=!1},d(s){s&&M(t),Z(e)}}}function VA(i){let t,e,n=i[0].state&&i[5]&&aa(i);return{c(){n&&n.c(),t=pe()},m(o,s){n&&n.m(o,s),T(o,t,s),e=!0},p(o,[s]){o[0].state&&o[5]?n?(n.p(o,s),s&33&&C(n,1)):(n=aa(o),n.c(),C(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(C(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function jA(i,t,e){let n,o,s,r,a,l,{tag:c}=t;return i.$$set=u=>{"tag"in u&&e(0,c=u.tag)},i.$$.update=()=>{var u,h;i.$$.dirty&1&&e(6,n=c.state?c.state.unfolded:!1),i.$$.dirty&1&&e(5,o=c.data.mediaData),i.$$.dirty&1&&e(1,s=c.data.enableCarousel),i.$$.dirty&1&&e(4,r=c.data.playIcon),i.$$.dirty&3&&e(3,a=(u=c.data.autoplayConfig)!=null?u:{autoplay:s!=null?s:!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,s,l,a,r,o,n]}class OA extends oe{constructor(t){super(),ie(this,t,jA,VA,ne,{tag:0},BA)}}function Zl(i){return H(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 RA(i){return H(this,null,function*(){const{url:t,ratio:e=3}=i;i.ratio||console.warn("Tag icon ratio is not set, default is 3");const{width:n,height:o}=yield Zl(t);return fe(Q({},i),{width:n/e,height:o/e})})}function QA(i){return H(this,null,function*(){const{steps:t,url:e,ratio:n=3,fps:o=24}=i;if(!t)throw new Error("KeyframeIcon requires steps");const{width:s,height:r}=yield Zl(e),a=s/n,l=r/n,c=a/t,u=l,h=1/o*t+"s";return fe(Q({},i),{width:c,height:u,duration:h})})}function FA(i){le(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 la(i){i[1]=i[19].width}function ca(i){i[1]=i[19].width,i[16]=i[19].height,i[17]=i[19].steps,i[18]=i[19].duration}function ua(i){let t,e,n,o=i[0]&&da();function s(l,c){return l[8]?GA:HA}let r=s(i),a=r(i);return{c(){t=B("div"),o&&o.c(),e=$(),a.c(),y(t,"class","icon"),z(t,"width",i[1])},m(l,c){T(l,t,c),o&&o.m(t,null),V(t,e),a.m(t,null),n=!0},p(l,c){l[0]?o?c&1&&C(o,1):(o=da(),o.c(),C(o,1),o.m(t,e)):o&&(se(),D(o,1,1,()=>{o=null}),re()),r===(r=s(l))&&a?a.p(l,c):(a.d(1),a=r(l),a&&(a.c(),a.m(t,null))),c&2&&z(t,"width",l[1])},i(l){n||(C(o),n=!0)},o(l){D(o),n=!1},d(l){l&&M(t),o&&o.d(),a.d()}}}function da(i){let t,e;return t=new st({props:{center:!0,blurRadius:24,spreadRadius:16}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},i(n){e||(C(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function HA(i){let t,e,n={ctx:i,current:null,token:null,hasCatch:!1,pending:NA,then:_A,catch:WA,value:19};return ai(e=i[11](Le({url:i[7],ratio:i[5]})),n),{c(){t=pe(),n.block.c()},m(o,s){T(o,t,s),n.block.m(o,n.anchor=s),n.mount=()=>t.parentNode,n.anchor=t},p(o,s){i=o,n.ctx=i,s&160&&e!==(e=i[11](Le({url:i[7],ratio:i[5]})))&&ai(e,n)||Na(n,i,s)},d(o){o&&M(t),n.block.d(o),n.token=null,n=null}}}function GA(i){let t,e,n={ctx:i,current:null,token:null,hasCatch:!1,pending:UA,then:YA,catch:XA,value:19};return ai(e=i[10](Le({url:i[7],steps:i[2],fps:i[6],ratio:i[5]})),n),{c(){t=pe(),n.block.c()},m(o,s){T(o,t,s),n.block.m(o,n.anchor=s),n.mount=()=>t.parentNode,n.anchor=t},p(o,s){i=o,n.ctx=i,s&228&&e!==(e=i[10](Le({url:i[7],steps:i[2],fps:i[6],ratio:i[5]})))&&ai(e,n)||Na(n,i,s)},d(o){o&&M(t),n.block.d(o),n.token=null,n=null}}}function WA(i){return{c:X,m:X,p:X,d:X}}function _A(i){la(i);let t,e;return{c(){t=B("img"),y(t,"alt","tag-icon"),y(t,"class","icon-image svelte-316sq3"),Xe(t.src,e=i[7])||y(t,"src",e),z(t,"width",ot(Gt({originWidth:i[1],scale:i[4],wantedWidth:i[3]}).width))},m(n,o){T(n,t,o)},p(n,o){la(n),o&128&&!Xe(t.src,e=n[7])&&y(t,"src",e),o&184&&z(t,"width",ot(Gt({originWidth:n[1],scale:n[4],wantedWidth:n[3]}).width))},d(n){n&&M(t)}}}function NA(i){return{c:X,m:X,p:X,d:X}}function XA(i){return{c:X,m:X,p:X,d:X}}function YA(i){ca(i);let t,e=`url(${i[7]})`,n=`steps(${i[17]}, jump-none)`;return{c(){t=B("div"),y(t,"class","icon-keyframe svelte-316sq3"),z(t,"width",ot(Gt({originWidth:i[1],originHeight:i[16],scale:i[4],wantedWidth:i[3]}).width)),z(t,"height",ot(Gt({originWidth:i[1],originHeight:i[16],scale:i[4],wantedWidth:i[3]}).height)),z(t,"background-image",e),z(t,"animation-duration",i[18]),z(t,"animation-timing-function",n)},m(o,s){T(o,t,s)},p(o,s){ca(o),s&252&&z(t,"width",ot(Gt({originWidth:o[1],originHeight:o[16],scale:o[4],wantedWidth:o[3]}).width)),s&252&&z(t,"height",ot(Gt({originWidth:o[1],originHeight:o[16],scale:o[4],wantedWidth:o[3]}).height)),s&128&&e!==(e=`url(${o[7]})`)&&z(t,"background-image",e),s&228&&z(t,"animation-duration",o[18]),s&228&&n!==(n=`steps(${o[17]}, jump-none)`)&&z(t,"animation-timing-function",n)},d(o){o&&M(t)}}}function UA(i){return{c:X,m:X,p:X,d:X}}function qA(i){let t,e,n=i[9]&&ua(i);return{c(){n&&n.c(),t=pe()},m(o,s){n&&n.m(o,s),T(o,t,s),e=!0},p(o,[s]){o[9]?n?(n.p(o,s),s&512&&C(n,1)):(n=ua(o),n.c(),C(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(C(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function Gt(i){const{originWidth:t,originHeight:e,scale:n=1,wantedWidth:o}=i,s=(o!=null?o:t)*n,r=typeof e=="number"?s*(e/t):void 0;return fe(Q({},i),{width:s,height:r})}function JA(i,t,e){let n,o,s,r,a,l,c,u,h,{width:d=null}=t,{icon:m=null}=t,{shadow:g=!1}=t;const p=Ai();function A(w){return H(this,null,function*(){const k=yield QA(w);return p("iconLoaded",k),k})}function v(w){return H(this,null,function*(){if(typeof h=="number")return fe(Q({},w),{width:h});const k=yield RA(w);return p("iconLoaded",k),k})}function b(){u||p("iconLoaded")}return Ze(()=>{b()}),i.$$set=w=>{"width"in w&&e(1,d=w.width),"icon"in w&&e(12,m=w.icon),"shadow"in w&&e(0,g=w.shadow)},i.$$.update=()=>{var w,k;i.$$.dirty&4096&&e(7,n=m==null?void 0:m.url),i.$$.dirty&4096&&e(2,o=(w=m==null?void 0:m.steps)!=null?w:1),i.$$.dirty&4096&&e(6,s=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=Le({url:n,steps:o,fps:s,ratio:r,scale:a,width:l})),i.$$.dirty&4&&e(8,u=o>1),i.$$.dirty&2&&(h=d)},b(),[g,d,o,l,a,r,s,n,u,c,A,v,m]}class Kl extends oe{constructor(t){super(),ie(this,t,JA,qA,ne,{width:1,icon:12,shadow:0},FA)}}function ZA(i){le(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 ha(i){let t,e,n,o,s,r;return e=new st({props:{outDelay:0,inDelay:0,center:!0,width:"80%",blurRadius:40,spreadRadius:16,opacity:.08}}),{c(){t=B("div"),K(e.$$.fragment),n=$(),o=B("div"),s=xe(i[1]),y(o,"class","text svelte-e58ijk"),y(t,"class","text-wrapper svelte-e58ijk")},m(a,l){T(a,t,l),J(e,t,null),V(t,n),V(t,o),V(o,s),r=!0},p(a,l){(!r||l&2)&&Se(s,a[1])},i(a){r||(C(e.$$.fragment,a),r=!0)},o(a){D(e.$$.fragment,a),r=!1},d(a){a&&M(t),Z(e)}}}function KA(i){let t,e,n,o;e=new Kl({props:{icon:i[0],shadow:!0}}),e.$on("iconLoaded",i[4]);let s=i[1]&&i[2]&&ha(i);return{c(){t=B("div"),K(e.$$.fragment),n=$(),s&&s.c(),y(t,"class","wrapper svelte-e58ijk")},m(r,a){T(r,t,a),J(e,t,null),V(t,n),s&&s.m(t,null),o=!0},p(r,[a]){const l={};a&1&&(l.icon=r[0]),e.$set(l),r[1]&&r[2]?s?(s.p(r,a),a&6&&C(s,1)):(s=ha(r),s.c(),C(s,1),s.m(t,null)):s&&(se(),D(s,1,1,()=>{s=null}),re())},i(r){o||(C(e.$$.fragment,r),C(s),o=!0)},o(r){D(e.$$.fragment,r),D(s),o=!1},d(r){r&&M(t),Z(e),s&&s.d()}}}function $A(i,t,e){let n,o,s,{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,u;i.$$.dirty&8&&e(1,o=(l=r.data.title)!=null?l:r.data.text),i.$$.dirty&8&&e(0,s=(u=r.data.icon)!=null?u:(c=r.style)==null?void 0:c.point)},e(2,n=!1),[s,o,n,r,a]}class eb extends oe{constructor(t){super(),ie(this,t,$A,KA,ne,{tag:3},ZA)}}function tb(i){le(i,"svelte-kzl2aj",".customElement__container.svelte-kzl2aj{position:relative}")}function fa(i){let t,e=i[0].element+"",n;return{c(){t=new ii(!1),n=pe(),t.a=n},m(o,s){t.m(e,o,s),T(o,n,s)},p(o,s){s&1&&e!==(e=o[0].element+"")&&t.p(e)},d(o){o&&M(n),o&&t.d()}}}function nb(i){let t,e=typeof i[0].element=="string"&&fa(i);return{c(){t=B("div"),e&&e.c(),y(t,"class","customElement__container svelte-kzl2aj")},m(n,o){T(n,t,o),e&&e.m(t,null),i[2](t)},p(n,[o]){typeof n[0].element=="string"?e?e.p(n,o):(e=fa(n),e.c(),e.m(t,null)):e&&(e.d(1),e=null)},i:X,o:X,d(n){n&&M(t),e&&e.d(),i[2](null)}}}function ib(i,t,e){let{tag:n}=t,o,s;Ze(()=>{if(o){if(n.element instanceof Element){const a=n.element;o.appendChild(a),s=()=>a.remove()}else if(typeof n.element=="function"){const a=n.element;s=a(o)}}}),Ct(()=>{s==null||s()});function r(a){Ve[a?"unshift":"push"](()=>{o=a,e(1,o)})}return i.$$set=a=>{"tag"in a&&e(0,n=a.tag)},[n,o,r]}class ob extends oe{constructor(t){super(),ie(this,t,ib,nb,ne,{tag:0},tb)}}function sb(i){le(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,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) 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 rb(i){let t,e;return{c(){t=B("div"),y(t,"data-info","tag content is keep folded"),y(t,"data-id",e=i[1].id)},m(n,o){T(n,t,o)},p(n,o){o&2&&e!==(e=n[1].id)&&y(t,"data-id",e)},i:X,o:X,d(n){n&&M(t)}}}function ab(i){let t,e,n,o,s,r,a,l,c,u;const h=[mb,fb,hb,db,ub,cb],d=[];function m(g,p){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~(o=m(i))&&(s=d[o]=h[o](i)),{c(){var g;t=B("div"),e=B("div"),n=B("div"),s&&s.c(),y(n,"class","content svelte-1r4fqvg"),q(n,"unfolded",(g=i[1].state)==null?void 0:g.unfolded),y(e,"class","content__wrapper svelte-1r4fqvg"),y(t,"class",r=Ie(Oe.default("content__container",i[1].className))+" svelte-1r4fqvg"),y(t,"data-id",a=i[1].id),q(t,"disable",i[1].enabled===!1),q(t,"hide",i[4]),q(t,"withAnimation",i[0]),q(t,"unClickable",i[1].mergedConfig.clickable===!1),z(t,"width",i[1].stickType==="Plane"||i[1].contentType==="MediaModel"?"100%":0),z(t,"height",i[1].stickType==="Plane"||i[1].contentType==="MediaModel"?"100%":0)},m(g,p){T(g,t,p),V(t,e),V(e,n),~o&&d[o].m(n,null),l=!0,c||(u=me(t,"click",Va(i[14])),c=!0)},p(g,p){var v;let A=o;o=m(g),o===A?~o&&d[o].p(g,p):(s&&(se(),D(d[A],1,1,()=>{d[A]=null}),re()),~o?(s=d[o],s?s.p(g,p):(s=d[o]=h[o](g),s.c()),C(s,1),s.m(n,null)):s=null),(!l||p&2)&&q(n,"unfolded",(v=g[1].state)==null?void 0:v.unfolded),(!l||p&2&&r!==(r=Ie(Oe.default("content__container",g[1].className))+" svelte-1r4fqvg"))&&y(t,"class",r),(!l||p&2&&a!==(a=g[1].id))&&y(t,"data-id",a),(!l||p&2)&&q(t,"disable",g[1].enabled===!1),(!l||p&18)&&q(t,"hide",g[4]),(!l||p&3)&&q(t,"withAnimation",g[0]),(!l||p&2)&&q(t,"unClickable",g[1].mergedConfig.clickable===!1),p&2&&z(t,"width",g[1].stickType==="Plane"||g[1].contentType==="MediaModel"?"100%":0),p&2&&z(t,"height",g[1].stickType==="Plane"||g[1].contentType==="MediaModel"?"100%":0)},i(g){l||(C(s),l=!0)},o(g){D(s),l=!1},d(g){g&&M(t),~o&&d[o].d(),c=!1,u()}}}function lb(i){let t,e,n,o,s,r,a;return e=new ob({props:{tag:Le(i[1])}}),{c(){t=B("div"),K(e.$$.fragment),y(t,"class",n=Ie(Oe.default("content__container",i[1].className))+" svelte-1r4fqvg"),y(t,"data-id",o=i[1].id),q(t,"custom-tag-disable",i[1].enabled===!1),q(t,"custom-tag-hide",i[4])},m(l,c){T(l,t,c),J(e,t,null),s=!0,r||(a=me(t,"click",i[13]),r=!0)},p(l,c){const u={};c&2&&(u.tag=Le(l[1])),e.$set(u),(!s||c&2&&n!==(n=Ie(Oe.default("content__container",l[1].className))+" svelte-1r4fqvg"))&&y(t,"class",n),(!s||c&2&&o!==(o=l[1].id))&&y(t,"data-id",o),(!s||c&2)&&q(t,"custom-tag-disable",l[1].enabled===!1),(!s||c&18)&&q(t,"custom-tag-hide",l[4])},i(l){s||(C(e.$$.fragment,l),s=!0)},o(l){D(e.$$.fragment,l),s=!1},d(l){l&&M(t),Z(e),r=!1,a()}}}function cb(i){let t,e;return t=new OA({props:{tag:Le(i[1])}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=Le(n[1])),t.$set(s)},i(n){e||(C(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function ub(i){let t,e;return t=new eb({props:{tag:Le(i[1])}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=Le(n[1])),t.$set(s)},i(n){e||(C(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function db(i){let t,e;return t=new uA({props:{tag:Le(i[1])}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=Le(n[1])),t.$set(s)},i(n){e||(C(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function hb(i){let t,e;return t=new zA({props:{tag:Le(i[1])}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=Le(n[1])),t.$set(s)},i(n){e||(C(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function fb(i){let t,e;return t=new rA({props:{tag:Le(i[1])}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=Le(n[1])),t.$set(s)},i(n){e||(C(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function mb(i){let t,e;return t=new I0({props:{tag:Le(i[1])}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=Le(n[1])),t.$set(s)},i(n){e||(C(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function pb(i){let t,e,n,o;const s=[lb,ab,rb],r=[];function a(l,c){return l[1].element?0:l[3]?1:2}return t=a(i),e=r[t]=s[t](i),{c(){e.c(),n=pe()},m(l,c){r[t].m(l,c),T(l,n,c),o=!0},p(l,[c]){let u=t;t=a(l),t===u?r[t].p(l,c):(se(),D(r[u],1,1,()=>{r[u]=null}),re(),e=r[t],e?e.p(l,c):(e=r[t]=s[t](l),e.c()),C(e,1),e.m(n.parentNode,n))},i(l){o||(C(e),o=!0)},o(l){D(e),o=!1},d(l){r[t].d(l),l&&M(n)}}}function gb(i,t,e){let n,o,s,r,a,l,{withAnimation:c=!1}=t,{tag:u}=t,{hooks:h}=t,{state:d}=t,{mediaStore:m}=t,{temporaryState:g}=t;eo("hooks",h),eo("mediaStore",m);let p,A;function v(I){I?h.emit("exposure",{id:r,type:"start"}):h.emit("exposure",{id:r,type:"end"})}function b(I,P,L){var x,F;return!(!P.visible||!P.enabled||!L.visible||!((x=I.state)!=null&&x.visible)||((F=I.temporaryState)==null?void 0:F.visible)===!1||We(I)&&!I.mediaVisible)}const w=I=>h.emit("click",{event:I,target:"TagContent",tag:u}),k=I=>h.emit("click",{event:I,target:"TagContent",tag:u});return i.$$set=I=>{"withAnimation"in I&&e(0,c=I.withAnimation),"tag"in I&&e(1,u=I.tag),"hooks"in I&&e(2,h=I.hooks),"state"in I&&e(5,d=I.state),"mediaStore"in I&&e(6,m=I.mediaStore),"temporaryState"in I&&e(7,g=I.temporaryState)},i.$$.update=()=>{var I,P,L,x,F,N,R,S,O,G,W;i.$$.dirty&2&&e(11,n=(I=u.state)==null?void 0:I.unfolded),i.$$.dirty&2&&e(10,o=(P=u.state)==null?void 0:P.visible),i.$$.dirty&162&&e(12,s=d.visible&&g.visible&&((L=u.state)==null?void 0:L.visible)),i.$$.dirty&2&&(r=u.id),i.$$.dirty&162&&e(4,a=!b(u,d,g)),i.$$.dirty&4096&&v(s),i.$$.dirty&3842&&u.hooks&&(n!==void 0&&n!==A&&(e(9,A=n),n?(F=(x=u.hooks).emit)==null||F.call(x,"unfolded"):(R=u==null?void 0:(N=u.hooks).emit)==null||R.call(N,"folded")),o!==void 0&&o!==p&&(e(8,p=o),o?(O=(S=u.hooks).emit)==null||O.call(S,"show"):(W=(G=u.hooks).emit)==null||W.call(G,"hide"))),i.$$.dirty&2&&e(3,l=(()=>!(typeof u.mergedConfig.unfoldedConfig=="object"&&u.mergedConfig.unfoldedConfig.keep==="folded"))())},[c,u,h,l,a,d,m,g,p,A,o,n,s,w,k]}class $l extends oe{constructor(t){super(),ie(this,t,gb,pb,ne,{withAnimation:0,tag:1,hooks:2,state:5,mediaStore:6,temporaryState:7},sb)}}function vb(i){le(i,"svelte-1jkrwn7",'@charset "UTF-8";.tag-point-click-helper.svelte-1jkrwn7.svelte-1jkrwn7{position:absolute;pointer-events:auto;cursor:pointer;width:calc(100% + 0.75rem);height:calc(100% + 0.75rem);left:50%;top:50%;transform:translate(-50%, -50%)}.tag-point-wrapper.svelte-1jkrwn7.svelte-1jkrwn7{pointer-events:none;position:absolute;left:50%;top:50%;transform:translate(-50%, -50%);z-index:-1}.tag-folded-point.svelte-1jkrwn7.svelte-1jkrwn7,.tag-unfolded-point.svelte-1jkrwn7.svelte-1jkrwn7{transition:all 0.5s}.tag-point-wrapper.svelte-1jkrwn7 .tag-unfolded-point.svelte-1jkrwn7{display:flex;justify-content:center;align-items:center;position:absolute;width:100%;height:100%;border-radius:50%}.tag-point-wrapper.svelte-1jkrwn7 .tag-unfolded-point.svelte-1jkrwn7:after{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);width:0.3125rem;height:0.3125rem;border-radius:50%;background-color:white}.tag-point-wrapper.svelte-1jkrwn7 .tag-unfolded-point.svelte-1jkrwn7:before{content:"";position:absolute;width:0.875rem;height:0.875rem;border-radius:50%;background-color:rgba(0, 0, 0, 0.2)}.tag-point-wrapper.folded.svelte-1jkrwn7 .tag-folded-point.svelte-1jkrwn7{opacity:1;scale:1}.tag-point-wrapper.folded.svelte-1jkrwn7 .tag-unfolded-point.svelte-1jkrwn7{opacity:0;scale:1}.tag-point-wrapper.unfolded.svelte-1jkrwn7 .tag-folded-point.svelte-1jkrwn7{opacity:0;scale:0.2}.tag-point-wrapper.unfolded.svelte-1jkrwn7 .tag-unfolded-point.svelte-1jkrwn7{opacity:1;scale:1}')}function Ab(i){let t,e,n,o,s,r,a,l,c,u,h,d;return o=new st({props:{center:!0,blurRadius:15,spreadRadius:5,opacity:.3}}),c=new Kl({props:{icon:i[2],width:i[1]}}),c.$on("iconLoaded",i[7]),{c(){t=B("div"),e=B("div"),n=$(),K(o.$$.fragment),s=$(),r=B("div"),a=$(),l=B("div"),K(c.$$.fragment),y(e,"class","tag-point-click-helper svelte-1jkrwn7"),y(r,"class","tag-unfolded-point svelte-1jkrwn7"),z(r,"transition-delay",(i[3]?i[5]:0)+"ms"),y(l,"class","tag-folded-point svelte-1jkrwn7"),z(l,"transition-delay",(i[3]?i[5]:0)+"ms"),y(t,"class","tag-point-wrapper svelte-1jkrwn7"),q(t,"unfolded",i[0]),q(t,"folded",i[3])},m(m,g){T(m,t,g),V(t,e),V(t,n),J(o,t,null),V(t,s),V(t,r),V(t,a),V(t,l),J(c,l,null),u=!0,h||(d=me(e,"click",i[4]),h=!0)},p(m,[g]){g&8&&z(r,"transition-delay",(m[3]?m[5]:0)+"ms");const p={};g&4&&(p.icon=m[2]),g&2&&(p.width=m[1]),c.$set(p),g&8&&z(l,"transition-delay",(m[3]?m[5]:0)+"ms"),(!u||g&1)&&q(t,"unfolded",m[0]),(!u||g&8)&&q(t,"folded",m[3])},i(m){u||(C(o.$$.fragment,m),C(c.$$.fragment,m),u=!0)},o(m){D(o.$$.fragment,m),D(c.$$.fragment,m),u=!1},d(m){m&&M(t),Z(o),Z(c),h=!1,d()}}}function bb(i,t,e){let n,o,s,r;const a=At("hooks");let{tag:l}=t,c,u=!1;const h=()=>{c!==void 0&&clearTimeout(c),u=!0,c=setTimeout(()=>{u=!1},800)},d=p=>{u||a.emit("click",{event:p,target:"TagPoint",tag:l})},m=(()=>l.contentType==="Text"&&l.data.appearance==="plane"?500:800)();function g(p){rn.call(this,i,p)}return i.$$set=p=>{"tag"in p&&e(6,l=p.tag)},i.$$.update=()=>{var p,A,v,b;i.$$.dirty&64&&e(0,n=(p=l.state)==null?void 0:p.unfolded),i.$$.dirty&1&&e(3,o=!n),i.$$.dirty&64&&e(2,s=(v=(A=l.style)==null?void 0:A.point)!=null&&v.url?(b=l.style)==null?void 0:b.point:{url:ag}),i.$$.dirty&64&&e(1,r=(()=>{var I,P,L,x;const w=(P=(I=l.style)==null?void 0:I.point)==null?void 0:P.width;if(typeof w=="number")return w;const k=(x=(L=l.style)==null?void 0:L.point)==null?void 0:x.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,s,o,d,m,l,g]}class yb extends oe{constructor(t){super(),ie(this,t,bb,Ab,ne,{tag:6},vb)}}function wb(i){le(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 Eb(i){let t;return{c(){t=B("div"),y(t,"data-info","tag content is disable")},m(e,n){T(e,t,n)},p:X,i:X,o:X,d(e){e&&M(t)}}}function Pb(i){let t,e;return t=new $l({props:{mediaStore:i[2],withAnimation:i[0],tag:Le(i[1]),hooks:i[14],state:i[3],temporaryState:i[4]}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&4&&(s.mediaStore=n[2]),o&1&&(s.withAnimation=n[0]),o&2&&(s.tag=Le(n[1])),o&8&&(s.state=n[3]),o&16&&(s.temporaryState=n[4]),t.$set(s)},i(n){e||(C(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function Cb(i){let t;return{c(){t=B("div"),y(t,"data-info","tag point is disable")},m(e,n){T(e,t,n)},p:X,i:X,o:X,d(e){e&&M(t)}}}function Ib(i){let t,e;return t=new yb({props:{tag:i[1]}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=n[1]),t.$set(s)},i(n){e||(C(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function kb(i){let t,e,n,o,s,r,a,l,c,u;const h=[Pb,Eb],d=[];function m(v,b){return v[12]?0:1}n=m(i),o=d[n]=h[n](i);const g=[Ib,Cb],p=[];function A(v,b){return v[13]?0:1}return r=A(i),a=p[r]=g[r](i),{c(){t=B("div"),e=B("div"),o.c(),s=$(),a.c(),y(e,"class",l=Ie(Oe.default("wrapper",i[1].className?`${i[1].className}__wrapper`:void 0))+" svelte-pzwdws"),y(e,"data-tag-unfolded",i[8]),y(e,"data-tag-id",i[11]),y(e,"data-content-type",c=i[1].contentType),z(e,"left",i[7]),z(e,"top",i[6]),z(e,"z-index",i[5]),y(t,"class","tag svelte-pzwdws"),y(t,"data-tag-id",i[11]),q(t,"unClickable",i[1].mergedConfig.clickable===!1),q(t,"disable",i[10]),q(t,"hide",i[9]),q(t,"withAnimation",i[0])},m(v,b){T(v,t,b),V(t,e),d[n].m(e,null),V(e,s),p[r].m(e,null),u=!0},p(v,[b]){let w=n;n=m(v),n===w?d[n].p(v,b):(se(),D(d[w],1,1,()=>{d[w]=null}),re(),o=d[n],o?o.p(v,b):(o=d[n]=h[n](v),o.c()),C(o,1),o.m(e,s));let k=r;r=A(v),r===k?p[r].p(v,b):(se(),D(p[k],1,1,()=>{p[k]=null}),re(),a=p[r],a?a.p(v,b):(a=p[r]=g[r](v),a.c()),C(a,1),a.m(e,null)),(!u||b&2&&l!==(l=Ie(Oe.default("wrapper",v[1].className?`${v[1].className}__wrapper`:void 0))+" svelte-pzwdws"))&&y(e,"class",l),(!u||b&256)&&y(e,"data-tag-unfolded",v[8]),(!u||b&2048)&&y(e,"data-tag-id",v[11]),(!u||b&2&&c!==(c=v[1].contentType))&&y(e,"data-content-type",c),b&128&&z(e,"left",v[7]),b&64&&z(e,"top",v[6]),b&32&&z(e,"z-index",v[5]),(!u||b&2048)&&y(t,"data-tag-id",v[11]),(!u||b&2)&&q(t,"unClickable",v[1].mergedConfig.clickable===!1),(!u||b&1024)&&q(t,"disable",v[10]),(!u||b&512)&&q(t,"hide",v[9]),(!u||b&1)&&q(t,"withAnimation",v[0])},i(v){u||(C(o),C(a),u=!0)},o(v){D(o),D(a),u=!1},d(v){v&&M(t),d[n].d(),p[r].d()}}}function xb(i,t,e){let n,o,s,r,a,l,c,u,h,{withAnimation:d=!1}=t,{tag:m}=t,{mediaStore:g}=t,{state:p}=t,{temporaryState:A}=t;const v=At("hooks");return i.$$set=b=>{"withAnimation"in b&&e(0,d=b.withAnimation),"tag"in b&&e(1,m=b.tag),"mediaStore"in b&&e(2,g=b.mediaStore),"state"in b&&e(3,p=b.state),"temporaryState"in b&&e(4,A=b.temporaryState)},i.$$.update=()=>{var b,w,k,I,P,L,x,F;i.$$.dirty&2&&e(13,n=(()=>!(m.contentType==="Sticker"||m.contentType==="Link"||m.contentType==="VRLink"||m.contentType==="PanoLink"||m.contentType==="Audio"&&m.data.appearance==="plane"))()),i.$$.dirty&2&&e(12,o=(()=>m.stickType==="2DPoint")()),i.$$.dirty&2&&e(11,s=m.id),i.$$.dirty&2&&e(10,r=!((b=m.pointTagStyle)!=null&&b.leftPercent)||!((w=m.pointTagStyle)!=null&&w.topPercent)||m.enabled===!1||!m.state),i.$$.dirty&2&&e(9,a=!((k=m.state)!=null&&k.visible)||((I=m.temporaryState)==null?void 0:I.visible)===!1),i.$$.dirty&2&&e(8,l=(P=m.state)==null?void 0:P.unfolded),i.$$.dirty&2&&e(7,c=((L=m.pointTagStyle)==null?void 0:L.leftPercent)+"%"),i.$$.dirty&2&&e(6,u=((x=m.pointTagStyle)==null?void 0:x.topPercent)+"%"),i.$$.dirty&2&&e(5,h=(F=m.state)!=null&&F.unfolded?1:0)},[d,m,g,p,A,h,u,c,l,a,r,s,o,n,v]}class Db extends oe{constructor(t){super(),ie(this,t,xb,kb,ne,{withAnimation:0,tag:1,mediaStore:2,state:3,temporaryState:4},wb)}}function Lb(i){le(i,"svelte-uq11d5",".tag--container.svelte-uq11d5{box-sizing:border-box;position:absolute;left:0;top:0;width:100%;height:100%;pointer-events:none;opacity:1;-webkit-user-select:none;-moz-user-select:none;user-select:none;transform:translate3d(0, 0, 0)}.withAnimation.svelte-uq11d5{transition:opacity 0.3s linear}.tag--container.hide.svelte-uq11d5{opacity:0;pointer-events:none}.tag--container.hide.svelte-uq11d5 *{pointer-events:none !important}")}function ma(i,t,e){const n=i.slice();return n[6]=t[e],n}function pa(i){let t,e=[],n=new Map,o,s=i[1];const r=a=>a[6].id;for(let a=0;a<s.length;a+=1){let l=ma(i,s,a),c=r(l);n.set(c,e[a]=ga(c,l))}return{c(){t=B("div");for(let a=0;a<e.length;a+=1)e[a].c();y(t,"class","tag--container svelte-uq11d5"),q(t,"hide",!i[3].visible||!i[4].visible),q(t,"withAnimation",i[0])},m(a,l){T(a,t,l);for(let c=0;c<e.length;c+=1)e[c].m(t,null);o=!0},p(a,l){l&31&&(s=a[1],se(),e=Ke(e,l,r,1,a,s,n,t,It,ga,null,ma),re()),(!o||l&24)&&q(t,"hide",!a[3].visible||!a[4].visible),(!o||l&1)&&q(t,"withAnimation",a[0])},i(a){if(!o){for(let l=0;l<s.length;l+=1)C(e[l]);o=!0}},o(a){for(let l=0;l<e.length;l+=1)D(e[l]);o=!1},d(a){a&&M(t);for(let l=0;l<e.length;l+=1)e[l].d()}}}function ga(i,t){let e,n,o;return n=new Db({props:{state:t[3],temporaryState:t[4],withAnimation:t[0],tag:t[6],mediaStore:t[2]}}),{key:i,first:null,c(){e=pe(),K(n.$$.fragment),this.first=e},m(s,r){T(s,e,r),J(n,s,r),o=!0},p(s,r){t=s;const a={};r&8&&(a.state=t[3]),r&16&&(a.temporaryState=t[4]),r&1&&(a.withAnimation=t[0]),r&2&&(a.tag=t[6]),r&4&&(a.mediaStore=t[2]),n.$set(a)},i(s){o||(C(n.$$.fragment,s),o=!0)},o(s){D(n.$$.fragment,s),o=!1},d(s){s&&M(e),Z(n,s)}}}function Mb(i){let t,e,n=i[3].enabled&&pa(i);return{c(){n&&n.c(),t=pe()},m(o,s){n&&n.m(o,s),T(o,t,s),e=!0},p(o,[s]){o[3].enabled?n?(n.p(o,s),s&8&&C(n,1)):(n=pa(o),n.c(),C(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(C(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function Sb(i,t,e){let{withAnimation:n=!1}=t,{tags:o=[]}=t,{hooks:s}=t,{mediaStore:r}=t,{state:a}=t,{temporaryState:l}=t;return eo("hooks",s),i.$$set=c=>{"withAnimation"in c&&e(0,n=c.withAnimation),"tags"in c&&e(1,o=c.tags),"hooks"in c&&e(5,s=c.hooks),"mediaStore"in c&&e(2,r=c.mediaStore),"state"in c&&e(3,a=c.state),"temporaryState"in c&&e(4,l=c.temporaryState)},[n,o,r,a,l,s]}class Tb extends oe{constructor(t){super(),ie(this,t,Sb,Mb,ne,{withAnimation:0,tags:1,hooks:5,mediaStore:2,state:3,temporaryState:4},Lb)}}const zb=new wc.GLTFLoader;function Bb(i){return new Promise((t,e)=>{function n(s){t(s)}function o(s){e(s)}zb.load(i,n,void 0,o)})}const Vb=new Map,jb=new Map;class Ob extends Fg{constructor(e){super(e);f(this,"group",new j.Group);f(this,"imagePlaneGroup",new j.Group);f(this,"gltfObjectGroup",new j.Group);f(this,"enabledModelTagSet",new Set);f(this,"temporaryState",{visible:!0});f(this,"TagContainerSvelte");f(this,"loadModel",e=>H(this,null,function*(){var l;const n=e.data.modelUrl;if(!n)return;const o=Bb(n).then(c=>Object.assign(c.scene,{customID:e.id,isTagModel:!0}));e.model={promise:o};const s=yield o;if(((l=e.model)==null?void 0:l.promise)!==o||(e.model.object=s,!this.tags.includes(e)))return;s.visible=this.getCurrentVisibleState(e),new j.Matrix4().fromArray(e.matrix).decompose(s.position,s.quaternion,s.scale),s.updateWorldMatrix(!0,!0),s.visible=this.getVisibleByFiveMode(e);const a=this.gltfObjectGroup.children.find(c=>c.customID===e.id);if(a&&this.gltfObjectGroup.remove(a),this.getRenderType(e)==="Mesh"){if(!e.mediaPlane){const c=e.data.mediaPosition.map(qe);e.mediaPlane=new sr(e.data.mediaData[0].url,e.data.mediaPosition.map(qe),{objectFit:e.data.objectFit});const u=new j.Vector3().addVectors(c[0],c[2]).divideScalar(2);e.mediaPlane.position.copy(u),s.add(e.mediaPlane)}}else s.updateTagCss3DObjectMatrix=()=>this.updateTagCss3DObjectMatrix(e,s),s.updateTagCss3DObjectMatrix();return this.gltfObjectGroup.add(s),s}));this.group.name="PanoTagPluginModelGroup",this.gltfObjectGroup.name="PanoTagPluginGLTFObjectGroup",this.imagePlaneGroup.name="ImagePlaneGroup",this.group.add(this.gltfObjectGroup),this.group.add(this.imagePlaneGroup)}clearTags(){this.tags.forEach(e=>{var n,o;(o=(n=e.mediaPlane)==null?void 0:n.parent)==null||o.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,u,h,d;const o=n.data.mediaData[0];if(!o)return;const{url:s,type:r}=o;if(!s||(n.mediaPlane&&(n.mediaPlane.visible=(c=(l=n.state)==null?void 0:l.visible)!=null?c:!0,n.mediaPlane.visible||n.mediaPlane instanceof uo&&((u=n.data.autoplayConfig)!=null&&u.autoplayVideo||n.mediaPlane.pause())),((h=n.mediaPlane)==null?void 0:h.src)===s))return;const a=n.position.map(qe);if(n.mediaPlane&&n.mediaPlane.removeFromParent(),r==="Image")n.mediaPlane=new sr(s,a),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 uo(s,a,{videoCoverSrc:o.videoCoverUrl,playButton:n.data.playIcon,paused:!((d=n.data.autoplayConfig)!=null&&d.autoplayVideo),videoTextureMap:Vb,ImageTextureMap:jb});m.onVideoReady=p=>{p.addEventListener("play",()=>this.mediaStore.set({currentMediaElement:m.videoInstance}))},m.initialDomEvents(this.domEvents);const g=p=>(this.five.on("renderFrame",p),()=>this.five.off("renderFrame",p));m.initialRenderHooks(g),n.mediaPlane=m}this.imagePlaneGroup.add(n.mediaPlane)})}updateRender3DDomTag(){this.sort([...this.filterCSS3DTag]).forEach(n=>{var o,s;if(n.tag3DContentSvelte){const{svelteApp:r,css3DInstance:a,initialNormal:l,currentNormal:c}=n.tag3DContentSvelte;if(r.$set({tag:n,hooks:this.hooks,state:this.state,temporaryState:this.temporaryState}),!l.equals(c)){const u=new j.Quaternion().setFromUnitVectors(l,c);a.css3DObject.setRotationFromQuaternion(u)}return}else{if(((o=n.state)==null?void 0:o.visible)===!1)return;if(this.css3DRenderPlugin||(this.css3DRenderPlugin=$t(this.five)),n.stickType==="3DPoint"&&!n.normal)return console.error("updateRenderPlaneTag: \u4E09\u7EF4\u70B9\u6807\u7B7E\u7F3A\u5C11\u6CD5\u5411\u91CF\uFF01");const r=this.getPositions(n);if(!r)return;const a=this.getTagNormal(n);if(!a)return;const c=(s=this.getTagConfig(n).tag3DConfig)!=null?s:{};if(this.getRenderType(n)==="BehindDom"){c.mode="behind",c.container=document.createElement("div");const d="black";c.container.style.backgroundColor=d,c.container.style.border=`3px solid ${d}`,this.css3DRenderPlugin.hooks.on("render",()=>{var m;if(u.css3DObject.opacityMesh){const g=this.addObjectClickHandler(n,u.css3DObject.opacityMesh,p=>{this.hooks.emit("click",{event:p,target:"TagContent",tag:n})});(m=this.store.css3DRenderDisposer.get(n.id))==null||m.push(g)}})}const u=this.css3DRenderPlugin.create3DDomContainer(r,c);if(!u)return;this.store.css3DRenderDisposer.set(n.id,[u.dispose]);const h=new $l({target:u.container,props:{tag:n,hooks:this.hooks,state:this.state,mediaStore:this.mediaStore,temporaryState:this.temporaryState}});n.tag3DContentSvelte={svelteApp:h,domContainer:u,css3DInstance:u,initialNormal:a,currentNormal:a,dispose:()=>{h.$destroy(),u.dispose()}}}}),this.clearUnusedPanelTag()}updateRenderModelTag(){const e=o=>!this.enabledModelTagSet.has(o.customID);this.gltfObjectGroup.remove(...this.gltfObjectGroup.children.filter(e)),this.tags.filter(We).forEach(o=>{var s;(s=o.model)==null||s.promise.then(r=>{r.visible=this.getCurrentVisibleState(o)})})}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 p,A,v,b;const o=(v=(A=(p=e.mergedConfig)==null?void 0:p.tag3DConfig)==null?void 0:A.ratio)!=null?v:.00216,s=(b=e.tag3DContentSvelte)==null?void 0:b.css3DInstance.css3DObject;if(!s)return;const r=We(e)?e.data.mediaPosition:e.position;n.updateWorldMatrix(!1,!1);const a=n.matrixWorld,l=new j.Vector3().fromArray(r[0]),c=new j.Vector3().fromArray(r[2]),u=Tt(l,c).add(new j.Vector3(0,0,5e-4)),h=new j.Matrix4().setPosition(u),d=new j.Matrix4().makeScale(o,o,o),m=new j.Matrix4().multiply(a).multiply(h).multiply(d);m.decompose(s.position,s.quaternion,s.scale);const g=s.opacityMesh;g&&m.decompose(g.position,g.quaternion,g.scale)}addMediaModelTag(e){return H(this,null,function*(){const n=e.filter(We).map(o=>this.loadModel(o));yield Promise.all(n),this.setModelMedialVisible(),this.updateRenderAllTags()})}updateRenderPointTag(){var n;const e=this.sort(this.filterPointTag);if(this.setPointTagPosition(),this.TagContainerSvelte)this.TagContainerSvelte.$set({tags:e,state:this.state,temporaryState:this.temporaryState});else{const o=(n=this.five.getElement())==null?void 0:n.parentElement;if(!o)return console.error("updateRenderPlaneTag: tag2DContainer not found");this.TagContainerSvelte=new Tb({target:o,props:{hooks:this.hooks,tags:e,state:this.state,temporaryState:this.temporaryState,mediaStore:this.mediaStore}})}}updateTagContainerVisible(){var e;(e=this.TagContainerSvelte)==null||e.$set({state:this.state,temporaryState:this.temporaryState,withAnimation:this.store.visibleWithAnimation}),this.filterCSS3DTag.forEach(n=>{var o,s,r,a,l;(a=(s=(o=n.tag3DContentSvelte)==null?void 0:o.css3DInstance)==null?void 0:s.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,n]of this.store.css3DRenderDisposer)n==null||n.forEach(o=>o==null?void 0:o());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 o=this.getTagById(e);(!o||o.stickType==="2DPoint")&&(n==null||n.forEach(s=>s==null?void 0:s()),this.store.css3DRenderDisposer.delete(e))}}}const ec="Dnalogel-PanoTagPlugin",Rb=i=>`${ec}--${i}`;class tc extends Ob{constructor(e,n){super(e);f(this,"state",{enabled:!0,visible:!0});f(this,"params");f(this,"debug");f(this,"changeTagModel",(e,n)=>H(this,null,function*(){e.data=tt.default({},e.data,n),yield this.loadModel(e),this.updateRenderAllTags()}));f(this,"handleFiveInitAnimationEnded",()=>{const e=this.five.getCurrentState().mode;this.tags.forEach(n=>{We(n)&&e==="Panorama"&&this.changeTagMode(n,"front"),n.state.visible=this.getVisible(n)}),this.updateRenderAllTags()});f(this,"handleFiveModelShownFloorChange",()=>{this.tags.forEach(e=>{var o,s;const n=this.getTagConfig(e).visibleConfig;typeof n=="object"&&(((o=n.visibleFiveMode)==null?void 0:o.includes("Floorplan"))||((s=n.visibleFiveMode)==null?void 0:s.includes("Mapview")))&&(e.state.visible=this.getVisibleByFiveMode(e))}),this.updateRenderAllTags()});this.params=Q({debug:!1,config:this.config},n),this.debug=this.params.debug,this.config=this.params.config,yg(1,{namespace:Do.PlayAudio});try{const o=window;Array.isArray(o.__PANOTAGPLUGIN_DEBUG_LIST__)||(o.__PANOTAGPLUGIN_DEBUG_LIST__=[]),o.__PANOTAGPLUGIN_DEBUG_LIST__.push(this),o.__PANOTAGPLUGIN_DEBUG__=this}catch(o){}}load(e,n){return H(this,null,function*(){var s,r;this.clearTags(),console.info(ec," load:",{data:JSON.parse(JSON.stringify(e))}),this.config=tt.default({},this.config,{globalConfig:(s=e.globalConfig)!=null?s:{},contentTypeConfig:(r=e.contentTypeConfig)!=null?r:{}});const o=yield this.addTag(e.tagList,n);if(this.debug)try{ig(this.five,this.tags)}catch(a){console.error(a)}return o})}addTag(e,n){return H(this,null,function*(){const s=(Array.isArray(e)?e:[e]).map(r=>{var c;const a=this.getTagConfig(r);return fe(Q({},r),{id:(c=r.id)!=null?c:Ge(),data:tt.default({},a.initialData,r.data),state:Q({visible:void 0,unfolded:!this.can("fold",r)},a.initialState),hooks:new Ee.Subscribe,mergedConfig: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)})}).filter(r=>r.position);return s.forEach(Ag),this.tags.push(...s),mg(this.five).then(()=>H(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(s)}))})}changeConfig(e,n=!0){n?this.config=tt.default({},this.config,e):this.config=e,this.updateTagConfig({force:!0}),this.updateRenderAllTags()}changeGlobalConfig(e,n=!0){n?this.config.globalConfig=tt.default({},this.config.globalConfig,e):this.config.globalConfig=e,this.updateTagConfig({force:!0}),this.updateRenderAllTags()}changeContentTypeConfig(e,n,o=!0){this.config.contentTypeConfig||(this.config.contentTypeConfig={}),o?this.config.contentTypeConfig[e]=tt.default({},this.config.contentTypeConfig[e],n):this.config.contentTypeConfig[e]=n,this.updateTagConfig({force:!0}),this.updateRenderAllTags()}show(e){return H(this,null,function*(){if(this.checkDisposed())return;const{userAction:n=!0,withAnimation:o=!1}=e!=null?e:{};this.setState({visible:!0},{userAction:n,visibleWithAnimation:o}),this.hooks.emit("show",{userAction:n,withAnimation:o})})}hide(e){return H(this,null,function*(){if(this.checkDisposed())return;const{userAction:n=!0,withAnimation:o=!1}=e!=null?e:{};this.setState({visible:!1},{userAction:n,visibleWithAnimation:o}),this.hooks.emit("hide",{userAction:n,withAnimation:o})})}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:o=!0,visibleWithAnimation:s=!1}=n,r=Q({},this.state);this.state=Object.assign(this.state,e),this.store.visibleWithAnimation=s,r.visible!==this.state.visible&&(e.visible?this.handleShow():this.handleHide()),r.enabled!==this.state.enabled&&(e.enabled?this.handleEnable():this.handleDisable()),this.hooks.emit("stateChange",{state:this.state,prevState:r,userAction:o})}dispose(){var e,n,o,s,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=[],(s=(o=this.store).eventListenerDisposer)==null||s.call(o),this.store.eventListenerDisposer=void 0,(a=(r=this.store).resizeObserverDisposer)==null||a.call(r),this.store.resizeObserverDisposer=void 0,this.store.resizeObserverDisposerAdding=!1,this.five.scene.remove(this.group),this.group.remove(...this.group.children),this.gltfObjectGroup.remove(...this.gltfObjectGroup.children),this.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 o=this.getTagById(e);if(!o)return;const s=this.can("fold",o),r=this.can("unfold",o);if(s&&r){o.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 o=this.getTagById(e);!o||(o.enabled=n,this.updateRenderAllTags())}changeTagNormalById(e,n){const o=this.getTagById(e);!o||!o.tag3DContentSvelte||(o.tag3DContentSvelte.currentNormal=qe(n))}changeDataById(e,n,o=!0){const s=this.getTagById(e);!s||(o?s.data=tt.default({},s.data,n):s.data=Q(Q({},s.data),n),this.clearUnusedPanelTag(),this.updateRenderAllTags())}changeStickTypeById(e,n,o=!0){this.changeTagById(e,n,o)}changeTagById(e,n,o=!0){const s=this.getTagById(e);!n||(o?tt.default(s,n):Object.assign(s,n),(s==null?void 0:s.tag3DContentSvelte)&&(n==null?void 0:n.normal)&&(s.tag3DContentSvelte.currentNormal=qe(n.normal)),this.updateRenderAllTags(),this.clearUnusedPanelTag())}destroyTagById(e){(Array.isArray(e)?e:[e]).forEach(o=>{const s=this.tags.findIndex(r=>r.id===o);s!==-1&&this.tags.splice(s,1)}),this.updateRenderAllTags()}setVisibleAndUnfolded(){return H(this,arguments,function*({withAnimation:e}={withAnimation:!1}){if(!!this.isPanorama)return this.setVisibleByPanoIndex(),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,o;this.pauseCurrentMedia(),this.state.enabled=!1,(n=(e=this.store).eventListenerDisposer)==null||n.call(e),this.five.scene.remove(this.group),(o=this.TagContainerSvelte)==null||o.$set({tags:[]}),this.filterCSS3DTag.forEach(s=>{var r;(r=s.tag3DContentSvelte)==null||r.dispose(),s.tag3DContentSvelte=void 0}),this.five.needsRender=!0}addEventListener(){const{five:e,hooks:n}=this,o=this.handleFiveWantsMoveToPano.bind(this),s=this.handleFiveModeChange.bind(this),r=this.handleFiveCameraUpdate.bind(this),a=this.handleFiveCameraUpdateDebounce(),l=this.handleFivePanoArrived.bind(this),c=this.loadVideoFirstFrame.bind(this),u=this.clickhandler.bind(this),h=this.five.currentMode;return h&&this.handleFiveModeChange(h),this.handleFivePanoArrived(),e.on("wantsMoveToPano",o),e.on("modeChange",s),e.on("initAnimationEnded",this.handleFiveInitAnimationEnded),e.on("modelShownFloorChange",this.handleFiveModelShownFloorChange),e.on("cameraUpdate",r),e.on("cameraUpdate",a),e.on("panoArrived",l),e.on("panoArrived",c),n.on("click",u),()=>{e.off("wantsMoveToPano",o),e.off("modeChange",s),e.off("initAnimationEnded",this.handleFiveInitAnimationEnded),e.off("modelShownFloorChange",this.handleFiveModelShownFloorChange),e.off("cameraUpdate",r),e.off("cameraUpdate",a),e.off("panoArrived",l),e.off("panoArrived",c),n.off("click",u),this.store.eventListenerDisposer=void 0}}addResizeListener(){if(!this.store.resizeObserverDisposer&&!this.store.resizeObserverDisposerAdding){const e=this.addResizeObserver();this.store.resizeObserverDisposerAdding=!0,setTimeout(()=>{this.store.resizeObserverDisposer=e,this.store.resizeObserverDisposerAdding=!1},200)}}addResizeObserver(){if(!this.store.disposed)return;const e=this.five.getElement(),n=()=>{!this.state.enabled||(this.show(),this.updateRenderAllTags())},o=()=>{!this.state.enabled||this.hide()},{observe:s,unobserve:r}=ar(gg(()=>{!this.store.resizeObserverDisposer||o()},500),e),{observe:a,unobserve:l}=ar(rr(()=>n(),400),e);return s(),a(),()=>{r(),l()}}handleFiveModeChange(e){this.setModelMedialVisible(),this.tags.forEach(n=>{We(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=fe(Q({},e.temporaryState),{visible:n.visibleConfig.keep==="visible"}):e.temporaryState=fe(Q({},e.temporaryState),{visible:Boolean(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),o=this.can("unfold",e.tag);n&&o&&(e.tag.state.unfolded=!e.tag.state.unfolded,e.tag.state.unfolded&&this.tags.forEach(s=>{s.id!==e.tag.id&&s.state&&this.can("fold",s)&&(s.state.unfolded=!1)}),this.updateRenderAllTags())}handleFiveCameraUpdateDebounce(){return rr(()=>{this.setUnfoldedByCamera(),this.updateRenderAllTags()},100)}handleFiveCameraUpdate(){this.updateRenderPointTag()}handleFivePanoArrived(){return H(this,null,function*(){this.setModelMedialVisible(),yield this.setVisibleAndUnfolded(),this.tags.forEach(e=>{e.temporaryState=fe(Q({},e.temporaryState),{visible:!0})}),this.store.visibleWithAnimation=!0,this.updateTagContainerVisible(),this.updateRenderAllTags()})}setUnfoldedByCamera(){let e=!1;this.tags.forEach(n=>{const o=this.getUnfoldedByCamera(n);!n.state||o!==void 0&&(o===!0&&(e=!0),n.state.unfolded=o)}),e&&this.tags.forEach(n=>{const o=this.getTagConfig(n).unfoldedConfig;typeof o=="object"&&(o.autoUnfold||o.keep)||n.state&&(n.state.unfolded=!1)})}changeTagMode(e,n){var o,s,r,a,l,c;((o=this.getTagConfig(e))==null?void 0:o.renderType)!=="Mesh"&&((a=(r=(s=e.tag3DContentSvelte)==null?void 0:s.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(u=>u==null?void 0:u()),e.tag3DContentSvelte=void 0)}}const Qb=(i,t)=>new tc(i,t);function nc(i){const t=new E.Box3,e=new E.Vector3;if(i.traverse(n=>{var s;if(n.name==="shadow")return;const o=n.geometry;if(o!==void 0)if((s=o==null?void 0:o.attributes)!=null&&s.position){const r=o.attributes.position;for(let a=0,l=r.count;a<l;a++)e.fromBufferAttribute(r,a).applyMatrix4(n.matrix),t.expandByPoint(e)}else o.vertices.forEach(r=>{const a=r.clone().applyMatrix4(n.matrix);t.expandByPoint(a)})}),!t.isEmpty())return t}class Mn{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,u;this.hooks=(c=t.sharedHooks)!=null?c:new Kt,this.camera=t.camera,this.model=t.model,this.originObject3D=t.originObject3D,this.helperObject3D=t.helperObject3D,this.container=t.container,this.scene=t.scene,this.domEvents=new be(t.camera,t.container),this.onRender=(u=t.onRender)!=null?u:()=>{},this.offset=e==null?void 0:e.offset,this.initialHelperPosition(),this.initialHelperQuaternion(),this.enable();const n=(...h)=>this.onSetOriginObjectScale(...h),o=(...h)=>this.onSetOriginObjectRotate(...h),s=(...h)=>this.onSetOriginObjectPosition(...h),r=(...h)=>this.onApplyOriginObjectScale(...h),a=(...h)=>this.onApplyOriginObjectRotate(...h),l=(...h)=>this.onApplyOriginObjectPosition(...h);this.hooks.on("setObjectScale",n),this.hooks.on("setObjectRotate",o),this.hooks.on("setObjectPosition",s),this.hooks.on("applyObjectPosition",l),this.hooks.on("applyObjectRotate",a),this.hooks.on("applyObjectScale",r),this.disposers.push(()=>{this.hooks.off("setObjectScale",n),this.hooks.off("setObjectRotate",o),this.hooks.off("setObjectPosition",s),this.hooks.off("applyObjectPosition",l),this.hooks.off("applyObjectRotate",a),this.hooks.off("applyObjectScale",r)})}initialHelperPosition(){this.helperObject3D.position.add(this.calculateOffset(this.offset)),this.helperObject3D.initialPosition()}initialHelperQuaternion(){this.helperObject3D.initQuaternion()}enable(){this.enabled||(this.enabled=!0,this.scene.add(this.helperObject3D),this.helperObject3D.enable(),this.render())}disable(){!this.enabled||(this.enabled=!1,this.helperObject3D.disable(),this.render())}show(){this.helperObject3D.show(),this.render()}hide(){this.helperObject3D.hide(),this.render()}dispose(){var t;(t=this.disposers)==null||t.forEach(e=>e==null?void 0:e()),this.helperObject3D.dispose(),this.render()}applyHelperMatrix4(t){this.helperObject3D.applyMatrix4(t)}applyHelperQuaternion(t,e){this.helperObject3D.applyHelperQuaternion(t,e)}applyHelperScaleMatrix4(t,e){this.helperObject3D.applyHelperScaleMatrix4(t,e)}onWantsGesture(t,e,n){if(this.isDragging)return!1}onIntersectionOnModelUpdate(t){}onApplyOriginObjectScale(t){this.applyHelperScaleMatrix4(t.matrix,t.origin)}onApplyOriginObjectRotate(t){this.applyHelperQuaternion(t.quaternion,t.origin)}onApplyOriginObjectPosition(t){this.applyHelperMatrix4(t.matrix)}onSetOriginObjectScale(t){this.helperObject3D.scale.copy(t),this.updateOffsetByScale(t)}onSetOriginObjectRotate(t,e){this.helperObject3D.setHelperQuaternion(t,e)}onSetOriginObjectPosition(t){this.helperObject3D.position.copy(t.clone().add(this.calculateOffset(this.offset)))}render(){this.onRender()}updateOffsetByScale(t){if(this.boundingBox&&this.offset){const e=this.originObject3D.position,n=new E.Vector3().subVectors(this.boundingBox.max,e).multiply(t).add(e),o=new E.Vector3().subVectors(this.boundingBox.min,e).multiply(t).add(e),s=this.calculateOffset(this.offset,{min:o,max:n});this.helperObject3D.position.copy(s),this.helperObject3D.initialPosition()}}hoverListener(t,e=16777215,n=1){const o=(Array.isArray(t)?t:[t]).filter(wt),s=[];for(const r of o)if(r instanceof E.Mesh||r instanceof E.Group){const a=r instanceof E.Group?r.children.filter(d=>d instanceof E.Mesh):[r];a.forEach(d=>{d.__originalColor__=d.material.color.clone(),d.__originalOpacity__=d.material.opacity});const l=()=>{a.forEach(d=>{d.material.color.set(e),d.material.opacity=n}),this.render()},c=()=>{a.forEach(d=>{d.material.color.copy(d.__originalColor__),d.material.opacity=d.__originalOpacity__}),this.render()},u=()=>{this.isDragging||l()},h=()=>{this.isDragging||c()};for(const d of a)this.domEvents.addEventListener(d,"mouseover",u),this.domEvents.addEventListener(d,"mouseout",h),this.hooks.on("moveStart",l),this.hooks.on("moveEnd",c),this.hooks.on("rotateEnd",c),s.push(()=>{this.domEvents.removeEventListener(d,"mouseover",u),this.domEvents.removeEventListener(d,"mouseout",h),this.hooks.off("moveStart",l),this.hooks.off("moveEnd",c),this.hooks.off("rotateEnd",c)})}return()=>s.forEach(r=>r==null?void 0:r())}getIntersectObject(t){const e=this.camera.position,n=this.helperObject3D;if(!n)return;const o=this.helperObject3D.raycasterIntersectObject(t)[0];if(!o)return;const s=o;if(s.object=n,this.model.intersectRaycaster){const r=this.model.intersectRaycaster(t)[0];if(r&&r.point.distanceTo(e)<s.point.distanceTo(e))return}return s.object}calculateOffset(t,e){const n=this.originObject3D,o=new E.Vector3(0,0,0);if(!t)return o;const s=()=>e||(this.boundingBox?this.boundingBox:(this.boundingBox=nc(n),this.boundingBox));if(typeof t.x=="number")o.setX(t.x);else if(typeof t.x=="object"){const r=s();o.setX((r.max.x-r.min.x)*t.x.percents)}if(typeof t.y=="number")o.setY(t.y);else if(typeof t.y=="object"){const r=s();o.setY((r.max.y-r.min.y)*t.y.percents)}if(typeof t.z=="number")o.setZ(t.z);else if(typeof t.z=="object"){const r=s();o.setZ((r.max.z-r.min.z)*t.z.percents)}return o}}class Fb extends Mn{constructor(...e){super(...e);f(this,"name","ScaleController")}setScale(e){var l,c,u;let n=1,o=1,s=1;typeof e=="number"?(n=e,o=e,s=e):typeof e=="object"&&(n=(l=e.x)!=null?l:1,o=(c=e.y)!=null?c:1,s=(u=e.z)!=null?u:1);const r=new E.Vector3(n,o,s);this.hooks.emit("wantToScale",r)||(this.originObject3D.scale.copy(r),this.hooks.emit("setObjectScale",r),this.hooks.emit("scale",r),this.render())}}function ic(i,t,e){if(e){const o=new E.Vector3().subVectors(i.position,e).applyQuaternion(i.quaternion.clone().inverse()).applyQuaternion(t).add(e);i.position.copy(o)}i.quaternion.copy(t)}class Hb extends j.Object3D{constructor(){super()}add(...t){if(t.length===0)return this;const e=t.filter(Boolean);return super.add(...e)}remove(...t){if(t.length===0)return this;const e=t.filter(Boolean);return super.remove(...e)}removeFromParent(){const t=this.parent;return t!==null&&t.remove(this),this}}class Di extends Hb{constructor(e,n){var o;super();f(this,"originObject3D");f(this,"onRender");this.originObject3D=e,this.onRender=(o=n==null?void 0:n.onRender)!=null?o:()=>{}}get helperObject(){return this}render(){this.onRender()}enable(){this.parent.children.includes(this)||this.parent.add(this)}disable(){this.removeFromParent()}show(){this.visible=!0,this.render()}hide(){this.visible=!1,this.render()}raycasterIntersectObject(e,n=[]){return e.intersectObject(this,!0,n)}initialPosition(){this.position.add(this.originObject3D.position)}initQuaternion(){this.quaternion.copy(this.originObject3D.quaternion)}applyHelperScaleMatrix4(e,n){this.scale.applyMatrix4(e)}setHelperQuaternion(e,n){ic(this,e,n)}applyHelperQuaternion(e,n){if(n){const o=new j.Vector3().subVectors(this.position,n).applyQuaternion(e).add(n);this.position.copy(o)}this.applyQuaternion(e)}dispose(){this.removeFromParent()}}class Gb extends Di{}class Wb extends Di{}class _b extends Di{}class oc extends Di{}class Nb extends oc{}class Xb extends E.Group{constructor(e){super();f(this,"direction");this.direction=e||"x"}}class va extends E.Mesh{constructor(e,n,o){super(e,n);f(this,"direction");this.direction=o||"x"}}function Yb(i,t){const{offsetWidth:e,offsetHeight:n}=t,{top:o,left:s}=t.getBoundingClientRect();return Object.assign(new E.Vector2,{x:(i.x-s)/e*2-1,y:-(i.y-o)/n*2+1})}function zo(i,t,e){if(!t||!e||!i)return;const n=Yb(t,e);if(Math.abs(n.x)===1||Math.abs(n.y)===1)return;const o=new E.Raycaster;return o.setFromCamera(n,i),o}function Ub(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 Ui extends Xb{constructor(e){var u;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((u=e.color)!=null?u:16214315),o=new E.MeshBasicMaterial({color:n,depthTest:!1,opacity:1,transparent:!0,side:E.DoubleSide}),s=new E.ConeGeometry(.04,.1,32),r=new va(s,o.clone(),e.direction);r.name=`arrow-${e.direction}`,this.arrow=r;const a=.004,l=new E.CylinderGeometry(a,a,.4,32),c=new va(l,o.clone(),e.direction);c.name=`line-${e.direction}`,this.line=c,this.formatArrow(),this.formatLine(),this.add(this.arrow,this.line)}formatArrow(){this.arrow.geometry.translate(0,this.lineHeight+this.arrowHeight/2,0),this.direction==="x"?(this.arrow.geometry.rotateX(Math.PI/2),this.arrow.geometry.rotateY(Math.PI/2)):this.direction==="z"&&this.arrow.geometry.rotateX(Math.PI/2)}formatLine(){this.line.geometry.translate(0,this.lineHeight/2,0),this.direction==="x"?(this.line.geometry.rotateX(Math.PI/2),this.line.geometry.rotateY(Math.PI/2)):this.direction==="z"&&this.line.geometry.rotateX(Math.PI/2)}}const qi={X:15618642,Y:4765519,Z:4227839};class Nt{static get X(){return new E.Color(qi.X).convertSRGBToLinear().clone()}static get Y(){return new E.Color(qi.Y).convertSRGBToLinear().clone()}static get Z(){return new E.Color(qi.Z).convertSRGBToLinear().clone()}}class qb extends Gb{constructor(e){super(e);f(this,"xArrow",new Ui({direction:"x",color:Nt.X}));f(this,"yArrow",new Ui({direction:"y",color:Nt.Y}));f(this,"zArrow",new Ui({direction:"z",color:Nt.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 Mt(i,t){return Jb(document.createElement(t!=null?t:"div"),i)}function Jb(i,t){if(!t)return i;for(const e in t)e&&t[e]&&(i.style[e]=t[e]);return i}function Zb(i){const t=Mt(Q({position:"absolute",display:"block",borderRadius:"4px",paddingTop:"1px",paddingBottom:"1px",paddingLeft:"4px",paddingRight:"4px",pointerEvents:"none",userSelect:"none",zIndex:"9999",backgroundColor:"rgba(0,0,0,0.7)",fontSize:"12px",color:"#fff",letterSpacing:"0",lineHeight:"18px"},i)),e=()=>{t.style.display!=="block"&&(!t.style.top||!t.style.left||(t.style.display="block"))};return{element:t,show:e,hide:()=>{t.style.display="none",t.style.top="",t.style.left=""},setLeftTop:(s,r)=>{t.style.left=s,t.style.top=r,e()}}}class Kb extends _b{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 Ji({direction:"x",color:Nt.X})),(n==null?void 0:n.xzCircleEnable)!==!1&&(this.yCircle=new Ji({direction:"y",color:Nt.Y})),(n==null?void 0:n.xyCircleEnable)!==!1&&(this.zCircle=new Ji({direction:"z",color:Nt.Z})),(n==null?void 0:n.container)&&(n==null?void 0:n.angleTipsEnable)!==!1&&(this.container=n==null?void 0:n.container,this.angleTips=Zb({display:"none"}),this.container.appendChild(this.angleTips.element)),this.add(...[this.xCircle,this.yCircle,this.zCircle].filter(Boolean)),this.show()}hide(){this.children.forEach(e=>e.hide())}show(){var e;this.children.forEach(n=>n.showCircle()),(e=this.angleTips)==null||e.hide()}showDraggingHelper(e){var n;this.hide(),this.children.filter(o=>e.includes(o.direction)).forEach(o=>o.showRing()),(n=this.angleTips)==null||n.show()}dispose(){var e,n;this.removeFromParent(),(n=(e=this.angleTips)==null?void 0:e.element)==null||n.remove()}}class Ji 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 $b(e),this.ring=new e1(e),this.angleSector=new t1(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 $b 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 e1 extends E.Group{constructor(e){super();f(this,"direction");this.direction=e.direction;const n=.015,o=new Array(8).fill(null).map((s,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(...o)}}class t1 extends E.Mesh{constructor(e){var o;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:(o=e.color)!=null?o:16777215,depthTest:!1,transparent:!0,side:E.DoubleSide}),this.direction=e.direction,this.angleDirection=this.direction==="z"?1:-1}}function n1(){const i=Mt({width:"100%",height:"100%",left:"0",top:"0",position:"absolute",pointerEvents:"none"}),t=Mt({boxSizing:"border-box",width:"100%",height:"100%",left:"0",top:"0",position:"relative",display:"flex",alignItems:"center",justifyContent:"center"}),e=Mt({boxSizing:"border-box",width:"100%",height:"100%",left:"0",top:"0",position:"absolute",border:"1px solid rgba(255,255,255,0.4)"});i.appendChild(t),t.appendChild(e);const n="-4px",o={direction:"nesw",element:ft({cursor:"nesw-resize",left:n,bottom:n})},s={direction:"ns",element:ft({cursor:"ns-resize",bottom:n})},r={direction:"nwse",element:ft({cursor:"nwse-resize",right:n,bottom:n})},a={direction:"ew",element:ft({cursor:"ew-resize",right:n})},l={direction:"nesw",element:ft({cursor:"nesw-resize",right:n,top:n})},c={direction:"ns",element:ft({cursor:"ns-resize",top:n})},u={direction:"nwse",element:ft({cursor:"nwse-resize",left:n,top:n})},h={direction:"ew",element:ft({cursor:"ew-resize",left:n})};return new Array(s,a,c,h,o,r,l,u).forEach(m=>t.appendChild(m.element)),{container:i,squares:[o,s,r,a,l,c,u,h]}}function ft(i){const t=Mt(Q({background:"#FFFFFF",width:"9px",height:"9px",position:"absolute",pointerEvents:"none"},i)),e=Mt({width:"15px",height:"15px",position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",pointerEvents:"none"}),n=Mt({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 i1 extends Nb{constructor(e,n,o,s){super(e);f(this,"points",[]);f(this,"cornerPositions",[]);f(this,"css3DInstance");f(this,"plane");f(this,"css3DRenderer",new Xt);f(this,"camera");f(this,"scene");f(this,"container");f(this,"enabled",!1);this.camera=o,this.scene=s,this.container=n,this.initRectangleScaleHelper()}get helperObject(){var e;if(!((e=this.css3DInstance)!=null&&e.css3DObject))throw new Error("css3DInstance is not initialized");return this.css3DInstance.css3DObject}applyMatrix4(e){var n;super.applyMatrix4(e),this.helperObject.applyMatrix4(e),(n=this.plane)==null||n.applyMatrix4(e),this.cornerPositions.forEach(o=>o.applyMatrix4(e))}showDraggingHelper(){}applyHelperScaleMatrix4(e,n){var o;(o=this.plane)==null||o.scale.applyMatrix4(e),this.helperObject.applyScaleMatrix4(e)}updatePoints(){const e=this.calculatePointPosition(this.cornerPositions);this.points.forEach((n,o)=>{n.position.copy(e[o])})}applyHelperQuaternion(e,n){var s;const o=(s=this.css3DInstance)==null?void 0:s.css3DObject;if(o){const r=new E.Vector3().subVectors(o.position,n).applyQuaternion(e).add(n);o.position.copy(r),o.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 o=n.css3DObject.container,{container:s,squares:r}=n1();this.points=r.map((c,u)=>({direction:c.direction,point:c.element,position:this.calculatePointPosition(e)[u]})),o.insertBefore(s,(a=o.children[0])!=null?a:null),this.helperObject.position.copy(this.originObject3D.position),(l=this.plane)==null||l.position.copy(this.originObject3D.position)}getCornerPositions(){const{originObject3D:e}=this;if(e.isCSS3DObjectPlus)return e.cornerPoints;console.error("\u5F53\u524D\u7269\u4F53\u6682\u65F6\u4E0D\u652F\u6301 ScaleHelper")}calculatePointPosition(e){return[e[0].clone(),e[0].clone().add(e[1]).divideScalar(2),e[1].clone(),e[1].clone().add(e[2]).divideScalar(2),e[2].clone(),e[2].clone().add(e[3]).divideScalar(2),e[3].clone(),e[3].clone().add(e[0]).divideScalar(2)]}}class o1 extends Wb{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=nc(this.originObject);if(!e)return;const{min:n,max:o}=e;this.positionAttribute.setXYZ(0,o.x,o.y,o.z),this.positionAttribute.setXYZ(1,n.x,o.y,o.z),this.positionAttribute.setXYZ(2,n.x,n.y,o.z),this.positionAttribute.setXYZ(3,o.x,n.y,o.z),this.positionAttribute.setXYZ(4,o.x,o.y,n.z),this.positionAttribute.setXYZ(5,n.x,o.y,n.z),this.positionAttribute.setXYZ(6,n.x,n.y,n.z),this.positionAttribute.setXYZ(7,o.x,n.y,n.z),this.positionAttribute.needsUpdate=!0}createOutline(){const e=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),n=new E.BufferGeometry;n.setIndex(new E.BufferAttribute(e,1)),n.setAttribute("position",this.positionAttribute);const o=new E.LineBasicMaterial({color:64767,linewidth:1,opacity:1,depthTest:!1,transparent:!0,toneMapped:!1}),s=new E.LineSegments(n,o);return s.matrixAutoUpdate=!1,s}createBox(){const e=new Uint16Array([0,1,2,0,2,3,0,3,7,0,7,4,0,4,5,0,5,1,6,1,5,6,2,1,6,5,4,6,4,7,6,3,2,6,7,3]),n=new E.BufferGeometry;n.setIndex(new E.BufferAttribute(e,1)),n.setAttribute("position",this.positionAttribute);const o=new E.MeshBasicMaterial({color:64767,opacity:.1,depthTest:!1,transparent:!0});return new E.Mesh(n,o)}}class s1 extends Mn{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 o=this.dragStart.bind(this),s=this.dragging.bind(this),r=this.dragEnd.bind(this),a=this.show.bind(this),l=this.hide.bind(this);this.domEvents.addEventListener(this.helperObject3D,"mousedown",o),document.addEventListener("mousemove",s),document.addEventListener("mouseup",r),this.hooks.on("rotateStart",l),this.hooks.on("rotateEnd",a),this.hooks.on("moveByMouseEnable",l),this.hooks.on("moveByMouseDisable",a),this.disposers.push(()=>{this.domEvents.removeEventListener(this.helperObject3D,"mousedown",o),document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",r),this.hooks.off("rotateStart",l),this.hooks.off("rotateEnd",a),this.hooks.off("moveByMouseEnable",l),this.hooks.off("moveByMouseDisable",a)}),this.moveByMouseEnable&&this.moveByMouse()}get moveByMouseEnable(){return this._moveByMouseEnable}dispose(){var e;super.dispose(),(e=this.disposers)==null||e.forEach(n=>n==null?void 0:n())}moveByMouse(){this._moveByMouseEnable=!0;const e=this.handleMouseDown.bind(this),n=this.handleMouseUp.bind(this);this.hooks.emit("moveByMouseEnable"),setTimeout(()=>{this.container.addEventListener("mousedown",e),this.container.addEventListener("mouseup",n)}),this.mousedownEventListenerDisposer=()=>{this.container.removeEventListener("mousedown",e),this.container.removeEventListener("mouseup",n)}}disableMoveByMouse(){var e;this._moveByMouseEnable=!1,this.hooks.emit("moveByMouseDisable"),(e=this.mousedownEventListenerDisposer)==null||e.call(this)}onIntersectionOnModelUpdate(e){!this.moveByMouseEnable||this.hooks.emit("wantToMove",e.point)||(this.originObject3D.position.copy(e.point),this.hooks.emit("setObjectPosition",e.point),this.hooks.emit("move",e.point))}onApplyOriginObjectScale(e){}handleMouseDown(e){const{x:n,y:o}=e;this.mouseInfo={x:n,y:o,mouseDownTimestamp:Date.now()}}handleMouseUp(e){if(!this.mouseInfo)return;const{x:n,y:o}=e;this.mouseInfo.x===n&&this.mouseInfo.y===o&&Date.now()-this.mouseInfo.mouseDownTimestamp<500&&(this.disableMoveByMouse(),this.mouseInfo=void 0)}dragStart(e){if(this._moveByMouseEnable||this.isDragging)return;const n=e==null?void 0:e.intersect;if(!n)return this.dragEnd();const o=(n==null?void 0:n.object).direction;if(!o)return this.dragEnd();const s=new 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(o){case"x":return s;case"y":return r;case"z":return a}})(),c=(()=>{switch(o){case"x":case"y":return a;case"z":return s}})(),u=n.point.clone(),h=new E.Plane;h.setFromNormalAndCoplanarPoint(c,u),this.startInfo={startVectorProject:u.clone().projectOnVector(l),directionVector:l,plane:h},this.helperObject3D.showDraggingHelper([o]),this.hooks.emit("moveStart"),this.isDragging=!0}dragging(e){if(!this.isDragging||!this.startInfo)return;const n=zo(this.camera,e,this.container);return n?(this.move(n),!1):this.dragEnd()}move(e){if(!this.startInfo)return this.dragEnd();const{plane:n,directionVector:o,startVectorProject:s}=this.startInfo,r=this.originObject3D,a=e.ray.intersectPlane(n,new E.Vector3);if(!a)return;const l=a.clone().projectOnVector(o),c=l.clone().sub(s),u=new E.Matrix4;u.setPosition(c);const h=r.position.clone().applyMatrix4(u);this.hooks.emit("wantToMove",h)||(r.applyMatrix4(u),s.copy(l),this.hooks.emit("applyObjectPosition",{matrix:u}),this.hooks.emit("move",h))}dragEnd(){!this.isDragging||(this.startInfo=void 0,this.isDragging=!1,this.helperObject3D.show(),this.hooks.emit("moveEnd"))}}class fn{constructor(t,e,n,o,s,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,u=t.getElement();if(this.five=t,!a||!l||!u||!c)return;const h=()=>{t.needsRender=!0};this.helperController=new e({camera:a,model:l,originObject3D:n,helperObject3D:o,container:u,scene:c,onRender:h,sharedHooks:r},s),t.on("wantsTapGesture",this.onFiveWantsTapGesture),t.on("wantsGesture",this.onFiveWantsGesture),t.on("intersectionOnModelUpdate",this.onFiveIntersectionOnModelUpdate)}dispose(){var t;this.five.off("wantsTapGesture",this.onFiveWantsTapGesture),this.five.off("wantsGesture",this.onFiveWantsGesture),this.five.off("intersectionOnModelUpdate",this.onFiveIntersectionOnModelUpdate),(t=this.helperController)==null||t.dispose()}}const r1="v1.0.1",a1="Object3DHelper",Bo=`${a1}@${r1}`,l1=()=>{console.error(`${Bo} is disposed`)},c1=()=>{console.warn(`${Bo} is disabled`)},u1=()=>{console.error(`${Bo} is disabled`)};class d1{constructor(t){f(this,"controllers",{});f(this,"state",{visible:!0,enabled:!0,disposed:!1});f(this,"hooks",new Kt);f(this,"eventListener",{});t&&this.addControllers(t),this.setState(this.state)}show(t){return H(this,null,function*(){this.setState({visible:!0},t)})}hide(t){return H(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 l1();if(!this.state.enabled&&t.enabled!==!0&&t.disposed!==!0)return u1();const n=Q({},this.state);this.state=Q(Q({},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=Q(Q({},this.controllers),t),this.setState(this.state)}getCurrentState(){return this.state}handleEnable(t,e=!0){t?(this.everyControllerDo(n=>{n.enable()}),this.hooks.emit("enable",{userAction:e})):(this.everyControllerDo(n=>{n.disable()}),this.hooks.emit("disable",{userAction:e})),this.state.enabled=t}handleVisible(t,e=!0){t?(this.everyControllerDo(n=>{n.show()}),this.actionIfStateIsEnabled(()=>this.hooks.emit("show",{userAction:e}))):(this.everyControllerDo(n=>{n.hide()}),this.actionIfStateIsEnabled(()=>this.hooks.emit("hide",{userAction:e}))),this.state.visible=t}everyControllerDo(t){Object.values(this.controllers).forEach(e=>{e&&t(e)})}handleDispose(){var t,e;Object.values(this.controllers).forEach(n=>{n==null||n.dispose()});for(const n in this.controllers){if(!n)continue;const o=n;(e=(t=this.eventListener)[o])==null||e.call(t)}}actionIfStateIsEnabled(t,e){if(this.state.enabled)return t();e!=null&&e.warnLog&&c1()}}function Zi(i){return i*Math.PI/180}class h1 extends Mn{constructor(...e){var c,u,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,(u=n.yCircle)==null?void 0:u.circle,(h=n.zCircle)==null?void 0:h.circle].filter(Boolean));const o=this.dragStart.bind(this),s=this.dragging.bind(this),r=this.dragEnd.bind(this),a=this.show.bind(this),l=this.hide.bind(this);this.domEvents.addEventListener(this.helperObject3D,"mousedown",o),document.addEventListener("mousemove",s),document.addEventListener("mouseup",r),this.hooks.on("moveStart",l),this.hooks.on("moveEnd",a),this.hooks.on("moveByMouseEnable",l),this.hooks.on("moveByMouseDisable",a),this.removeListener=()=>{this.domEvents.removeEventListener(this.helperObject3D,"mousedown",o),document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",r),this.hooks.off("moveStart",l),this.hooks.off("moveEnd",a),this.hooks.off("moveByMouseEnable",l),this.hooks.off("moveByMouseDisable",a)}}get rotateCenter(){return this.helperObject3D.position.clone()}initialHelperQuaternion(){this.helperObject3D.applyHelperQuaternion(this.originObject3D.quaternion)}setRotateAngle(e){const{x:n=0,y:o=0,z:s=0}=e,r=new E.Euler(Zi(n),Zi(o),Zi(s)),a=new E.Quaternion().setFromEuler(r);if(this.hooks.emit("wantToRotate",a))return;const{originObject3D:c,rotateCenter:u}=this;ic(c,a,u),this.hooks.emit("setObjectRotate",a,u),this.hooks.emit("rotate",a),this.render()}dispose(){this.removeListener(),super.dispose()}onApplyOriginObjectRotate(e){this.isDragging||super.onApplyOriginObjectRotate(e)}onApplyOriginObjectScale(e){}dragStart(e){if(this.isDragging)return;const n=e==null?void 0:e.intersect;if(!n)return this.dragEnd();const o=(n==null?void 0:n.object).direction;if(!o)return this.dragEnd();const s=n.point,r=this.getAngleHelper(o);this.setTipsAngle(0);const a=s.clone();a.y+=.2,this.setTipsPosition(a);const l=(()=>{if(o==="x")return new E.Vector3(1,0,0).applyQuaternion(this.originObject3D.quaternion);if(o==="y")return new E.Vector3(0,1,0).applyQuaternion(this.originObject3D.quaternion);if(o==="z")return new E.Vector3(0,0,1).applyQuaternion(this.originObject3D.quaternion)})(),c=new E.Plane().setFromNormalAndCoplanarPoint(l,s),h=c.projectPoint(s.clone(),new E.Vector3).clone().sub(this.rotateCenter),d=h.angleTo(r.baseAxes.clone().applyQuaternion(this.originObject3D.quaternion));this.setAngleHelperStart(o,d),this.setAngleHelperLength(o,0),this.startInfo={direction:o,startVector:h,plane:c,angleHelper:r,angle:0,objectQuaternion:this.originObject3D.quaternion.clone()},this.helperObject3D.showDraggingHelper([o]),this.hooks.emit("rotateStart"),this.isDragging=!0}dragging(e){if(!this.isDragging)return;const n=zo(this.camera,e,this.container);return n?(this.rotate(n),!1):this.dragEnd()}rotate(e){if(!this.startInfo)return this.dragEnd();const{startVector:n,plane:o,angleHelper:s,direction:r,objectQuaternion:a}=this.startInfo,{originObject3D:l}=this,c=e.ray.intersectPlane(o,new E.Vector3);if(!c)return;const u=this.rotateCenter.clone(),d=o.projectPoint(c.clone(),new E.Vector3).clone().sub(u);if(n.angleTo(d)===0)return;const m=new E.Quaternion().setFromUnitVectors(n.clone().normalize(),d.clone().normalize()),g=l.quaternion.clone().premultiply(m);if(this.hooks.emit("wantToRotate",g))return;const v=new E.Euler().setFromQuaternion(new E.Quaternion().setFromUnitVectors(n.clone().normalize().applyQuaternion(a.clone().inverse()),d.clone().normalize().applyQuaternion(a.clone().inverse())),`${r.toUpperCase()}${"XZY".replace(r.toUpperCase(),"")}`)[r]*s.angleDirection;if(this.startInfo.angle+=v,this.setAngleHelperLength(r,this.startInfo.angle),this.setTipsAngle(el(this.startInfo.angle)),u){const b=new E.Vector3().subVectors(l.position,u).applyQuaternion(m).add(u);l.position.copy(b)}l.applyQuaternion(m),this.hooks.emit("applyObjectRotate",{quaternion:m,origin:u}),this.hooks.emit("rotate",l.quaternion),this.startInfo.startVector=d}dragEnd(){!this.isDragging||(this.hooks.emit("setObjectRotate",this.originObject3D.quaternion,this.rotateCenter),this.startInfo=void 0,this.isDragging=!1,this.helperObject3D.show(),this.hooks.emit("rotateEnd"))}getAngleHelper(e){var n,o,s;switch(e){case"x":return(n=this.helperObject3D.xCircle)==null?void 0:n.angleSector;case"y":return(o=this.helperObject3D.yCircle)==null?void 0:o.angleSector;case"z":return(s=this.helperObject3D.zCircle)==null?void 0:s.angleSector}}setAngleHelperStart(e,n){const o=this.getAngleHelper(e);if(!o){console.warn("angleHelper is undefined");return}if(o instanceof E.Mesh&&o.geometry instanceof E.CircleGeometry){const{radius:s,segments:r,thetaLength:a}=o.geometry.parameters;o.geometry=new E.CircleGeometry(s,r,n,a)}else console.warn("only support THREE.CircleGeometry")}setAngleHelperLength(e,n){const s=n>=0?Math.max(n,.001):Math.min(n,-.001),r=this.getAngleHelper(e);if(r instanceof E.Mesh&&r.geometry instanceof E.CircleGeometry){const{radius:a,thetaStart:l}=r.geometry.parameters,c=Math.ceil(Math.abs(s)*(40/(2*Math.PI)));r.geometry=new E.CircleGeometry(a,c,l,s)}else console.warn("only support THREE.CircleGeometry")}setTipsAngle(e){var o;const n=(o=this.helperObject3D.angleTips)==null?void 0:o.element;!n||(n.innerText=`${e.toFixed(0)}\xB0`)}setTipsPosition(e){const n=this.helperObject3D.angleTips;if(!n)return;const o=e.project(this.camera),{x:s,y:r,z:a}=o;if(a>1)return;const l=(s+1)/2*100+"%",c=(-r+1)/2*100+"%";n.setLeftTop(l,c)}}class f1 extends Mn{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 j.Vector3),n[0]):e.setFromCoplanarPoints(n[0],n[1],n[2]),e}dragStart(e,n){var s,r;(r=(s=this.helperObject3D).updatePoints)==null||r.call(s);const o=this.getDragPlane();if(!o)return this.dragEnd();this.startInfo={startPoint:{position:n.position.clone(),direction:n.direction},plane:o},this.hooks.emit("scaleStart"),this.render(),this.isDragging=!0}dragging(e){if(!this.isDragging)return;const n=zo(this.camera,e,this.container);if(!n)return this.dragEnd();this.scale(n)}scale(e){var F,N;if(!this.startInfo)return;const n=this.originObject3D,{startPoint:o,plane:s}=this.startInfo,r=this.helperObject3D.cornerPositions;if(r.length<4)return this.dragEnd();const a=e.ray.intersectPlane(s,new j.Vector3);if(!a||Ub(a,this.camera.position))return;const l=new j.Vector3().addVectors(r[0],r[2]).divideScalar(2),{position:c,direction:u}=o,h=new j.Vector3().subVectors(r[1],r[0]),d=new j.Vector3().subVectors(r[3],r[0]),m=R=>{const S=new j.Vector3(0,0,0);if(!this.startInfo)return S;const O=(R==="ew"?h:d).clone(),G=c.clone().projectOnVector(O),W=a.clone().projectOnVector(O),Y=l.clone().projectOnVector(O);if(W.equals(G))return S;if(R==="ns"&&typeof this.startInfo.dragPointInCenterBottom!="boolean"){const U=new j.Vector3().subVectors(W,Y),ae=U.x<0&&O.x>=0,he=U.y<0&&O.y>=0,de=U.z<0&&O.z>=0;this.startInfo.dragPointInCenterBottom=ae||he||de}if(R==="ew"&&typeof this.startInfo.dragPointInCenterLeft!="boolean"){const U=new j.Vector3().subVectors(W,Y),ae=U.x<0&&O.x>=0,he=U.y<0&&O.y>=0,de=U.z<0&&O.z>=0;this.startInfo.dragPointInCenterLeft=ae||he||de}const _=new j.Vector3().subVectors(W,G),ee=_.length();return ee>.3?(console.warn("offset.length() > 0.3, skipped",ee),S):_},g=m("ew"),p=m("ns"),A=()=>{const R=g;this.helperObject3D.cornerPositions.forEach((S,O)=>{var G;(G=this.startInfo)!=null&&G.dragPointInCenterLeft?(O===0||O===3)&&S.add(R):(O===1||O===2)&&S.add(R)})},v=()=>{const R=p;this.helperObject3D.cornerPositions.forEach((S,O)=>{var G;(G=this.startInfo)!=null&&G.dragPointInCenterBottom?(O===0||O===1)&&S.add(R):(O===2||O===3)&&S.add(R)})};switch(u){case"ew":A();break;case"ns":v();break;case"nesw":case"nwse":A(),v()}const b=new j.Vector3().subVectors(r[1],r[0]).length()/h.length(),w=new j.Vector3().subVectors(r[3],r[0]).length()/d.length(),k=new j.Vector3(b,w,1),I=new E.Matrix4().scale(k);n.isCSS3DObjectPlus?n.applyScaleMatrix4(I):n.scale.applyMatrix4(I),o.position.copy(a);const P=new j.Vector3().addVectors(r[0],r[2]).divideScalar(2),L=new j.Vector3().subVectors(P,l),x=new E.Matrix4().setPosition(L);n.applyMatrix4(x),(F=this.helperObject3D.css3DInstance)==null||F.css3DObject.applyMatrix4(x),(N=this.helperObject3D.plane)==null||N.applyMatrix4(x),this.hooks.emit("applyObjectScale",{matrix:I}),this.hooks.emit("applyObjectPosition",{matrix:x}),this.render()}dragEnd(){!this.isDragging||(this.startInfo=void 0,this.isDragging=!1,this.hooks.emit("scaleEnd"),this.render())}}class m1 extends f1{constructor(...e){super(...e);f(this,"name","CSS3DScaleController");this.addHTMLEventListener()}addHTMLEventListener(){this.helperObject3D.points.forEach(e=>{if(!e)return;const n=e.point,o=a=>this.dragStart(a,e),s=this.dragging.bind(this),r=this.dragEnd.bind(this);n.addEventListener("dragstart",o),n.addEventListener("drag",s),n.addEventListener("dragend",r)})}}class p1 extends Mn{constructor(...e){super(...e);f(this,"name","BoundingBoxController")}}class g1 extends oc{constructor(t){super(t)}}const mo="Object3DHelperPlugin",Li=mo,v1=()=>{console.error(`${Li} is disposed`)},A1=()=>{console.warn(`${Li} is disabled`)},b1=()=>{console.error(`${Li} is disabled`)};class sc extends Dn{constructor(e){super(e);f(this,"name",mo);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 Xt(this.five.scene),console.warn("Object3DHelper: \u4F7F\u7528\u6B64\u63D2\u4EF6\uFF0C\u9700\u8981\u5728\u521D\u59CB\u5316five\u65F6\uFF0C\u8BBE\u7F6Efive\u53C2\u6570: { backgroundAlpha: 0, backgroundColor: 0x000000 }"),Object.assign(window,{[`__${mo.toUpperCase()}_DEBUG__`]:this})}show(e){return H(this,null,function*(){this.setState({visible:!0},e)})}hide(e){return H(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 v1();if(!this.state.enabled&&e.enabled!==!0&&e.disposed!==!0)return b1();const o=Q({},this.state);this.state=Q(Q({},this.state),e),e.disposed!==void 0&&e.disposed!==o.disposed&&e.disposed&&this.handleDispose(),e.visible!==void 0&&e.visible!==o.visible&&this.handleVisible(e.visible),e.enabled!==void 0&&e.enabled!==o.enabled&&this.handleEnable(e.enabled),this.hooks.emit("stateChange",{state:this.state,prevState:o})}getObject3DHelper(e){return this.objectHelperMap.get(e)}addObject3DHelper(e,n={}){var 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 o=new d1,s=[],r=(m=this.five.getElement())==null?void 0:m.parentElement,a=this.five.camera,{moveHelper:l=!0,rotateHelper:c=!0,scaleHelper:u=!0,boundingBoxHelper:h=!1}=n,d=new Ee.Subscribe;if(l){const g=new qb(e),p=this.getConfig(n.moveHelper),A=new fn(this.five,s1,e,g,p,d);o.addControllers({moveController:A.helperController}),s.push(()=>A.dispose())}if(c){const g=this.getConfig(n.rotateHelper),p=new Kb(e,Q({container:r},g)),A=new fn(this.five,h1,e,p,g,d);o.addControllers({rotateController:A.helperController}),s.push(()=>A.dispose())}if(h){const g=new o1(e),p=new fn(this.five,p1,e,g,void 0,d);o.addControllers({boundingBoxController:p.helperController})}if(u)if(e.isCSS3DObjectPlus&&r){const g=new i1(e,r,a,this.five.scene),p=new fn(this.five,m1,e,g,void 0,d);o.addControllers({scaleController:p.helperController}),s.push(()=>p.dispose()),Ia(this.five).then(()=>{var A,v;if(e.isCSS3DObjectPlus){const b=e;if(!b||b.mode!=="front")return;const w=(A=this.css3DRender.behindModeCSS3DRenderer.wrapper)!=null?A:ka(this.five);w&&(this.css3DObjectParentMap.set(b,b.parent),b.removeFromParent(),this.css3DRender.behindModeCSS3DRenderer.setWrapper(w),(v=this.css3DRender.getBehindCSS3DObjectGroup())==null||v.add(b),this.css3DRender.render(this.five.camera))}})}else{const g=new g1(e),p=new fn(this.five,Fb,e,g,void 0,d);o.addControllers({scaleController:p.helperController}),s.push(()=>p.dispose())}return this.objectHelperMap.set(e,{helper:o,disposers:s}),o.controllers}removeObject3DHelper(e){if(!this.objectHelperMap.has(e))return;const{helper:n,disposers:o}=this.objectHelperMap.get(e);if(!!n){if(e.isCSS3DObjectPlus){const s=e,r=this.css3DObjectParentMap.get(s);r&&r.add(s),this.css3DRender.render(this.five.camera)}this.objectHelperMap.delete(e),n.dispose(),o==null||o.forEach(s=>s==null?void 0:s())}}handleEnable(e,n=!0){e?(this.everyHelperDo(o=>o.enable()),this.hooks.emit("enable",{userAction:n})):(this.everyHelperDo(o=>o.disable()),this.hooks.emit("disable",{userAction:n})),this.state.enabled=e}handleVisible(e,n=!0){e?(this.everyHelperDo(o=>o.show()),this.actionIfStateIsEnabled(()=>this.hooks.emit("show",{userAction:n}))):(this.everyHelperDo(o=>o.hide()),this.actionIfStateIsEnabled(()=>this.hooks.emit("hide",{userAction:n}))),this.state.visible=e}handleDispose(){this.objectHelperMap.forEach(({helper:e,disposers:n})=>{e.dispose(),n==null||n.forEach(o=>o==null?void 0:o())})}everyHelperDo(e){this.objectHelperMap.forEach(({helper:n,disposers:o})=>{n&&e(n)})}actionIfStateIsEnabled(e,n){if(this.state.enabled)return e();n!=null&&n.warnLog&&A1()}getConfig(e){if(!!e&&typeof e!="boolean"&&e.enable)return e}}const y1=i=>new sc(i),w1=`
|
|
575
|
+
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 S0(i){let t,e,n;return{c(){t=B("button"),y(t,"class","sc-carousel-button sc-carousel-dot__dot svelte-1mgyhhn"),q(t,"sc-carousel-dot__dot_active",i[0])},m(o,s){T(o,t,s),e||(n=me(t,"click",i[1]),e=!0)},p(o,[s]){s&1&&q(t,"sc-carousel-dot__dot_active",o[0])},i:X,o:X,d(o){o&&M(t),e=!1,n()}}}function T0(i,t,e){let{active:n=!1}=t;function o(s){rn.call(this,i,s)}return i.$$set=s=>{"active"in s&&e(0,n=s.active)},[n,o]}class z0 extends oe{constructor(t){super(),ie(this,t,T0,S0,ne,{active:0},M0)}}function B0(i){le(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 Er(i,t,e){const n=i.slice();return n[5]=t[e],n[7]=e,n}function Pr(i,t){let e,n,o,s;function r(){return t[3](t[7])}return n=new z0({props:{active:t[1]===t[7]}}),n.$on("click",r),{key:i,first:null,c(){e=B("div"),K(n.$$.fragment),o=$(),y(e,"class","sc-carousel-dots__dot-container svelte-670fde"),this.first=e},m(a,l){T(a,e,l),J(n,e,null),V(e,o),s=!0},p(a,l){t=a;const c={};l&3&&(c.active=t[1]===t[7]),n.$set(c)},i(a){s||(C(n.$$.fragment,a),s=!0)},o(a){D(n.$$.fragment,a),s=!1},d(a){a&&M(e),Z(n)}}}function V0(i){let t,e=[],n=new Map,o,s=Array(i[0]);const r=a=>a[7];for(let a=0;a<s.length;a+=1){let l=Er(i,s,a),c=r(l);n.set(c,e[a]=Pr(c,l))}return{c(){t=B("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){T(a,t,l);for(let c=0;c<e.length;c+=1)e[c].m(t,null);o=!0},p(a,[l]){l&7&&(s=Array(a[0]),se(),e=Ke(e,l,r,1,a,s,n,t,It,Pr,null,Er),re())},i(a){if(!o){for(let l=0;l<s.length;l+=1)C(e[l]);o=!0}},o(a){for(let l=0;l<e.length;l+=1)D(e[l]);o=!1},d(a){a&&M(t);for(let l=0;l<e.length;l+=1)e[l].d()}}}function j0(i,t,e){const n=Ai();let{pagesCount:o=1}=t,{currentPageIndex:s=0}=t;function r(l){n("pageChange",l)}const a=l=>r(l);return i.$$set=l=>{"pagesCount"in l&&e(0,o=l.pagesCount),"currentPageIndex"in l&&e(1,s=l.currentPageIndex)},[o,s,r,a]}class O0 extends oe{constructor(t){super(),ie(this,t,j0,V0,ne,{pagesCount:0,currentPageIndex:1},B0)}}const Zt="prev",Et="next";function R0(i){le(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 Q0(i){let t,e,n,o;return{c(){t=B("button"),e=B("i"),y(e,"class","sc-carousel-arrow__arrow svelte-1bftafx"),q(e,"sc-carousel-arrow__arrow-next",i[0]===Et),q(e,"sc-carousel-arrow__arrow-prev",i[0]===Zt),y(t,"class","sc-carousel-button sc-carousel-arrow__circle svelte-1bftafx"),q(t,"sc-carousel-arrow__circle_disabled",i[1])},m(s,r){T(s,t,r),V(t,e),n||(o=me(t,"click",i[2]),n=!0)},p(s,[r]){r&1&&q(e,"sc-carousel-arrow__arrow-next",s[0]===Et),r&1&&q(e,"sc-carousel-arrow__arrow-prev",s[0]===Zt),r&2&&q(t,"sc-carousel-arrow__circle_disabled",s[1])},i:X,o:X,d(s){s&&M(t),n=!1,o()}}}function F0(i,t,e){let{direction:n=Et}=t,{disabled:o=!1}=t;function s(r){rn.call(this,i,r)}return i.$$set=r=>{"direction"in r&&e(0,n=r.direction),"disabled"in r&&e(1,o=r.disabled)},[n,o,s]}class _l extends oe{constructor(t){super(),ie(this,t,F0,Q0,ne,{direction:0,disabled:1},R0)}}function H0(i){le(i,"svelte-i7yfid",".sc-carousel-progress__indicator.svelte-i7yfid{height:100%;background-color:var(--sc-color-hex-dark-50p)}")}function G0(i){let t;return{c(){t=B("div"),y(t,"class","sc-carousel-progress__indicator svelte-i7yfid"),z(t,"width",i[0]+"%")},m(e,n){T(e,t,n)},p(e,[n]){n&1&&z(t,"width",e[0]+"%")},i:X,o:X,d(e){e&&M(t)}}}const Cr=100;function W0(i,t,e){let n,{value:o=0}=t;return i.$$set=s=>{"value"in s&&e(1,o=s.value)},i.$$.update=()=>{i.$$.dirty&2&&e(0,n=Math.min(Math.max(o*Cr,0),Cr))},[n,o]}class _0 extends oe{constructor(t){super(),ie(this,t,W0,G0,ne,{value:1},H0)}}function N0(i,t){i.addEventListener("mousedown",t),i.addEventListener("touchstart",t,{passive:!0})}function X0(i,t){i.removeEventListener("mousedown",t),i.removeEventListener("touchstart",t)}function Y0(i,t){i.addEventListener("mouseup",t),i.addEventListener("touchend",t)}function Ir(i,t){i.removeEventListener("mouseup",t),i.removeEventListener("touchend",t)}function U0(i,t){i.addEventListener("mousemove",t),i.addEventListener("touchmove",t)}function kr(i,t){i.removeEventListener("mousemove",t),i.removeEventListener("touchmove",t)}function So(i){return function(t,e){i.dispatchEvent(new CustomEvent(t,{detail:e}))}}const q0=110,J0=9,Z0=111,K0=20;function Xi(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 $0(i,{thresholdProvider:t}){const e=So(i);let n,o,s=0,r,a=!1;function l(){return Date.now()-r>=Z0&&Math.abs(s)>=K0}function c(d){r=Date.now(),s=0,a=!0;const m=Xi(d);n=m.x,o=m.y,e("swipeStart",{x:n,y:o}),U0(window,u),Y0(window,h)}function u(d){if(!a)return;const m=Xi(d),g=m.x-n,p=m.y-o;n=m.x,o=m.y,e("swipeMove",{x:n,y:o,dx:g,dy:p}),g!==0&&Math.sign(g)!==Math.sign(s)&&(s=0),s+=g,Math.abs(s)>t()&&(e("swipeThresholdReached",{direction:s>0?Zt:Et}),Ir(window,h),kr(window,u))}function h(d){if(Ir(window,h),kr(window,u),a=!1,!l()){e("swipeFailed");return}const m=Xi(d);e("swipeEnd",{x:m.x,y:m.y})}return N0(i,c),{destroy(){X0(i,c)}}}function ev(i,t){i.addEventListener("mouseenter",t)}function tv(i,t){i.removeEventListener("mouseenter",t)}function nv(i,t){i.addEventListener("mouseleave",t)}function xr(i,t){i.removeEventListener("mouseleave",t)}function iv(i){const t=So(i);function e(){nv(i,n),t("hovered",{value:!0})}function n(){t("hovered",{value:!1}),xr(i,n)}return ev(i,e),{destroy(){tv(i,e),xr(i,n)}}}const ov=(i,t)=>{const e=t.x-i.x,n=t.y-i.y;return Math.sqrt(e*e+n*n)};function _t(i,t,e){return Math.max(i,Math.min(t,e))}function sv(i,t){i.addEventListener("touchstart",t,{passive:!0})}function rv(i,t){i.removeEventListener("touchstart",t)}function av(i,t){i.addEventListener("touchend",t)}function Dr(i,t){i.removeEventListener("touchend",t)}function lv(i){const t=So(i);let e=0,n={x:0,y:0};function o({tapEndedAt:a,tapEndedPos:l}){const c=a-e,u=ov(n,l);return c<=q0&&u<=J0}function s(a){e=Date.now();const l=a.touches[0];n={x:l.clientX,y:l.clientY},av(i,r)}function r(a){Dr(i,r);const l=a.changedTouches[0];o({tapEndedAt:Date.now(),tapEndedPos:{x:l.clientX,y:l.clientY}})&&t("tapped")}return sv(i,s),{destroy(){rv(i,s),Dr(i,r)}}}function cv({currentParticleIndex:i,particlesCount:t,clonesCountHead:e,clonesCountTotal:n,particlesToScroll:o}){return i===t-e?0:i===0?Nl({particlesCountWithoutClones:t-n,particlesToScroll:o})-1:Math.floor((i-e)/o)}function uv({currentParticleIndex:i,particlesToScroll:t}){return Math.ceil(i/t)}function dv({currentParticleIndex:i,particlesCount:t,clonesCountHead:e,clonesCountTotal:n,infinite:o,particlesToScroll:s}){return o?cv({currentParticleIndex:i,particlesCount:t,clonesCountHead:e,clonesCountTotal:n,particlesToScroll:s}):uv({currentParticleIndex:i,particlesToScroll:s})}function Nl({particlesCountWithoutClones:i,particlesToScroll:t}){return Math.ceil(i/t)}function hv({particlesCountWithoutClones:i,particlesToScroll:t,particlesToShow:e}){const n=Xl({particlesCountWithoutClones:i,particlesToScroll:t,particlesToShow:e});return Math.ceil(i/t)-n}function fv({infinite:i,particlesCountWithoutClones:t,particlesToScroll:e,particlesToShow:n}){return i?Nl({particlesCountWithoutClones:t,particlesToScroll:e}):hv({particlesCountWithoutClones:t,particlesToScroll:e,particlesToShow:n})}function mv({pageIndex:i,clonesCountHead:t,clonesCountTail:e,particlesToScroll:n,particlesCount:o}){return _t(0,Math.min(t+i*n,o-e),o-1)}function pv({pageIndex:i,particlesToScroll:t,particlesCount:e,particlesToShow:n}){return _t(0,Math.min(i*t,e-n),e-1)}function Yi({infinite:i,pageIndex:t,clonesCountHead:e,clonesCountTail:n,particlesToScroll:o,particlesCount:s,particlesToShow:r}){return i?mv({pageIndex:t,clonesCountHead:e,clonesCountTail:n,particlesToScroll:o,particlesCount:s}):pv({pageIndex:t,particlesToScroll:o,particlesCount:s,particlesToShow:r})}function gv({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 Xl({particlesToScroll:i,particlesToShow:t,particlesCountWithoutClones:e}){const n=i-t;let o=t;for(;;){const s=e-o-n;if(s<t)return Math.max(s,0);o+=t+n}}function vv(i){return new ResizeObserver(t=>{i({width:t[0].contentRect.width})})}function Av({clonesCountHead:i,clonesCountTail:t,particlesContainerChildren:e}){const n=[];for(let r=0;r<t;r++)n.push(e[r].cloneNode(!0));const o=[],s=e.length;for(let r=s-1;r>s-1-i;r--)o.push(e[r].cloneNode(!0));return{clonesToAppend:n,clonesToPrepend:o}}function bv({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 yv({infinite:i,particlesToShow:t,partialPageSize:e}){const n=i?{head:Math.ceil(e||t),tail:Math.ceil(t)}:{head:0,tail:0};return fe(Q({},n),{total:n.head+n.tail})}const wn=(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},fo=i=>t=>{i[t]&&i[t]()},wv=(i,t)=>Dc.default(i,t),Ev=i=>Object.keys(i||{}),Pv=(i,t)=>{const e={};return i.forEach(n=>{e[n]=t[n]}),e},Cv=()=>{const i={},t=(e,n)=>{const{watcherName:o,fn:s}=e,{prop:r,value:a}=n;i[o]||(i[o]={deps:{},fn:s}),i[o].deps[r]=a};return{subscribers:i,subscribe(e,n){e&&t(e,n)},notify(e,n){Object.entries(i).forEach(([o,{deps:s,fn:r}])=>{const a=Ev(s);if(a.includes(n)){const l=Pv(a,e);wv(s,l)||(i[o].deps=l,r())}})}}},Iv=()=>{let i=null;return{targetWatcher(t,e){i={watcherName:t,fn:e},i.fn(),i=null},getTarget(){return i}}};function kv(i,t){const e=Tn.default(i,"data",{}),n=Tn.default(i,"watch",{}),o=Tn.default(i,"methods",{}),s=Tn.default(t,"onChange",()=>{}),{subscribe:r,notify:a,subscribers:l}=Cv(),{targetWatcher:c,getTarget:u}=Iv();let h;const d={},m=()=>({data:h,methods:d});let g=!1;const p=v=>(...b)=>{g=!0;const w=v(...b);return g=!1,w};Object.entries(o).forEach(([v,b])=>{d[v]=p((...w)=>b(m(),...w)),Object.defineProperty(d[v],"name",{value:v})}),h=new Proxy(xc.default(e),{get(v,b){return u()&&!g&&r(u(),{prop:b,value:v[b]}),Reflect.get(...arguments)},set(v,b,w){return v[b]===w||(Reflect.set(...arguments),u()||(s&&s(b,w),a(h,b))),!0}}),Object.entries(n).forEach(([v,b])=>{c(v,()=>{b(m())})});const A=[h,d];return A._internal={_getSubscribers(){return l}},A}function xv({pageIndex:i,particlesToShow:t,particlesToScroll:e,particlesCount:n}){const o=i===0?0:t-e,s=i*t-i*o,r=s+Math.max(t,e)-1,a=[];for(let l=s;l<=Math.min(n-1,r);l++)a.push(l);return a}function Dv({infinite:i,pageIndex:t,pagesCount:e,particlesCount:n,particlesToShow:o,particlesToScroll:s}){const r=_t(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,d)=>h-d),u=c.flatMap(h=>xv({pageIndex:h,particlesToShow:o,particlesToScroll:s,particlesCount:n}));return{pageIndexes:c,particleIndexes:[...new Set(u)].sort((h,d)=>h-d)}}const Lv=(i,t)=>(i(),setInterval(i,t)),Mv=35,Lr=1;class Sv{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(Mv,Math.max(this._autoplayDuration,1));let o=-n;this._interval=Lv(()=>H(this,null,function*(){if(this._paused)return;o+=n;const s=o/this._autoplayDuration;this._onProgressValueChange(s),s>Lr&&(this.reset(),yield t(),e())}),n)})}pause(){this._paused=!0}resume(){this._paused=!1}reset(){clearInterval(this._interval),this._onProgressValueChange(Lr)}}function Tv(i){const t=new Sv({onProgressValueChange:r=>{i("progressValue",1-r)}}),e=kv({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=Dv({infinite:r.infinite,pageIndex:r.currentPageIndex,pagesCount:r.pagesCount,particlesCount:r.particlesCountWithoutClones,particlesToShow:r.particlesToShow,particlesToScroll:r.particlesToScroll}).particleIndexes},setCurrentPageIndex({data:r}){r.currentPageIndex=dv({currentParticleIndex:r.currentParticleIndex,particlesCount:r.particlesCount,clonesCountHead:r.clonesCountHead,clonesCountTotal:r.clonesCountTotal,infinite:r.infinite,particlesToScroll:r.particlesToScroll})},setPartialPageSize({data:r}){r.partialPageSize=Xl({particlesToScroll:r.particlesToScroll,particlesToShow:r.particlesToShow,particlesCountWithoutClones:r.particlesCountWithoutClones})},setClonesCount({data:r}){const{head:a,tail:l}=yv({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=fv({infinite:r.infinite,particlesCountWithoutClones:r.particlesCountWithoutClones,particlesToScroll:r.particlesToScroll,particlesToShow:r.particlesToShow})},setParticlesToShow({data:r}){r.particlesToShow=_t(1,r.particlesToShowInit,r.particlesCountWithoutClones)},setParticlesToScroll({data:r}){r.particlesToScroll=_t(1,r.particlesToScrollInit,r.particlesCountWithoutClones)}},methods:{_prev({data:r}){r.currentParticleIndex=Yi({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=Yi({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=_t(0,a,r.particlesCount-1)},toggleFocused({data:r}){r.focused=!r.focused},_applyAutoplayIfNeeded(l){return H(this,arguments,function*({data:r,methods:a}){if(!r.infinite&&(r.autoplayDirection===Et&&r.currentParticleIndex===r.particlesCount-1||r.autoplayDirection===Zt&&r.currentParticleIndex===0)){t.reset();return}if(r.autoplay){const c=()=>fo({[Et]:()=>H(this,null,function*(){return a.showNextPage()}),[Zt]:()=>H(this,null,function*(){return a.showPrevPage()})})(r.autoplayDirection);yield t.start(c)}})},_jumpIfNeeded(l){return H(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(u,h,d){return H(this,arguments,function*({data:r,methods:a},l,c){if(t.reset(),r.disabled)return;r.disabled=!0,l(),yield a.offsetPage({animated:wn(c,"animated",!0)}),r.disabled=!1,!(yield a._jumpIfNeeded())&&a._applyAutoplayIfNeeded()})},showNextPage(c,u){return H(this,arguments,function*({data:r,methods:a},l){r.disabled||(yield a.changePage(a._next,l))})},showPrevPage(c,u){return H(this,arguments,function*({data:r,methods:a},l){r.disabled||(yield a.changePage(a._prev,l))})},showParticle(c,u,h){return H(this,arguments,function*({methods:r},a,l){yield r.changePage(()=>r._moveToParticle(a),l)})},_getParticleIndexByPageIndex({data:r},a){return Yi({infinite:r.infinite,pageIndex:a,clonesCountHead:r.clonesCountHead,clonesCountTail:r.clonesCountTail,particlesToScroll:r.particlesToScroll,particlesCount:r.particlesCount,particlesToShow:r.particlesToShow})},showPage(c,u,h){return H(this,arguments,function*({methods:r},a,l){const d=r._getParticleIndexByPageIndex(a);yield r.showParticle(d,l)})},offsetPage({data:r},a){const l=wn(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,o]=e;return[{data:n,progressManager:t},o,e._internal]}function zv(i){le(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 Bv=i=>({currentPageIndex:i[0]&32,pagesCount:i[0]&1024,loaded:i[0]&64}),Mr=i=>({currentPageIndex:i[5],pagesCount:i[10],showPage:i[15],loaded:i[6]}),Vv=i=>({loaded:i[0]&64,currentPageIndex:i[0]&32}),Sr=i=>({showNextPage:i[14].showNextPage,loaded:i[6],currentPageIndex:i[5]}),jv=i=>({loaded:i[0]&64,currentPageIndex:i[0]&32}),Tr=i=>({loaded:i[6],currentPageIndex:i[5]}),Ov=i=>({loaded:i[0]&64,currentPageIndex:i[0]&32}),zr=i=>({showPrevPage:i[14].showPrevPage,loaded:i[6],currentPageIndex:i[5]});function Br(i){let t;const e=i[37].prev,n=tn(e,i,i[36],zr),o=n||Rv(i);return{c(){o&&o.c()},m(s,r){o&&o.m(s,r),t=!0},p(s,r){n?n.p&&(!t||r[0]&96|r[1]&32)&&on(n,e,s,s[36],t?nn(e,s[36],r,Ov):sn(s[36]),zr):o&&o.p&&(!t||r[0]&36)&&o.p(s,t?r:[-1,-1])},i(s){t||(C(o,s),t=!0)},o(s){D(o,s),t=!1},d(s){o&&o.d(s)}}}function Rv(i){let t,e,n;return e=new _l({props:{direction:"prev",disabled:!i[2]&&i[5]===0}}),e.$on("click",i[23]),{c(){t=B("div"),K(e.$$.fragment),y(t,"class","sc-carousel__arrow-container svelte-sme1z4")},m(o,s){T(o,t,s),J(e,t,null),n=!0},p(o,s){const r={};s[0]&36&&(r.disabled=!o[2]&&o[5]===0),e.$set(r)},i(o){n||(C(e.$$.fragment,o),n=!0)},o(o){D(e.$$.fragment,o),n=!1},d(o){o&&M(t),Z(e)}}}function Vr(i){let t,e,n;return e=new _0({props:{value:i[7]}}),{c(){t=B("div"),K(e.$$.fragment),y(t,"class","sc-carousel-progress__container svelte-sme1z4")},m(o,s){T(o,t,s),J(e,t,null),n=!0},p(o,s){const r={};s[0]&128&&(r.value=o[7]),e.$set(r)},i(o){n||(C(e.$$.fragment,o),n=!0)},o(o){D(e.$$.fragment,o),n=!1},d(o){o&&M(t),Z(e)}}}function jr(i){let t;const e=i[37].next,n=tn(e,i,i[36],Sr),o=n||Qv(i);return{c(){o&&o.c()},m(s,r){o&&o.m(s,r),t=!0},p(s,r){n?n.p&&(!t||r[0]&96|r[1]&32)&&on(n,e,s,s[36],t?nn(e,s[36],r,Vv):sn(s[36]),Sr):o&&o.p&&(!t||r[0]&1060)&&o.p(s,t?r:[-1,-1])},i(s){t||(C(o,s),t=!0)},o(s){D(o,s),t=!1},d(s){o&&o.d(s)}}}function Qv(i){let t,e,n;return e=new _l({props:{direction:"next",disabled:!i[2]&&i[5]===i[10]-1}}),e.$on("click",i[14].showNextPage),{c(){t=B("div"),K(e.$$.fragment),y(t,"class","sc-carousel__arrow-container svelte-sme1z4")},m(o,s){T(o,t,s),J(e,t,null),n=!0},p(o,s){const r={};s[0]&1060&&(r.disabled=!o[2]&&o[5]===o[10]-1),e.$set(r)},i(o){n||(C(e.$$.fragment,o),n=!0)},o(o){D(e.$$.fragment,o),n=!1},d(o){o&&M(t),Z(e)}}}function Or(i){let t;const e=i[37].dots,n=tn(e,i,i[36],Mr),o=n||Fv(i);return{c(){o&&o.c()},m(s,r){o&&o.m(s,r),t=!0},p(s,r){n?n.p&&(!t||r[0]&1120|r[1]&32)&&on(n,e,s,s[36],t?nn(e,s[36],r,Bv):sn(s[36]),Mr):o&&o.p&&(!t||r[0]&1056)&&o.p(s,t?r:[-1,-1])},i(s){t||(C(o,s),t=!0)},o(s){D(o,s),t=!1},d(s){o&&o.d(s)}}}function Fv(i){let t,e;return t=new O0({props:{pagesCount:i[10],currentPageIndex:i[5]}}),t.$on("pageChange",i[41]),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o[0]&1024&&(s.pagesCount=n[10]),o[0]&32&&(s.currentPageIndex=n[5]),t.$set(s)},i(n){e||(C(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function Hv(i){let t,e,n,o,s,r,a,l,c,u,h,d,m=i[1]&&Br(i);const g=i[37].default,p=tn(g,i,i[36],Tr);let A=i[3]&&Vr(i),v=i[1]&&jr(i),b=i[4]&&Or(i);return{c(){t=B("div"),e=B("div"),m&&m.c(),n=$(),o=B("div"),s=B("div"),p&&p.c(),a=$(),A&&A.c(),l=$(),v&&v.c(),c=$(),b&&b.c(),y(s,"class","sc-carousel__pages-container svelte-sme1z4"),z(s,"transform","translateX("+i[8]+"px)"),z(s,"transition-duration",i[9]+"ms"),z(s,"transition-timing-function",i[0]),y(o,"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(w,k){T(w,t,k),V(t,e),m&&m.m(e,null),V(e,n),V(e,o),V(o,s),p&&p.m(s,null),i[39](s),V(o,a),A&&A.m(o,null),i[40](o),V(e,l),v&&v.m(e,null),V(t,c),b&&b.m(t,null),u=!0,h||(d=[ct(r=$0.call(null,s,{thresholdProvider:i[38]})),me(s,"swipeStart",i[16]),me(s,"swipeMove",i[18]),me(s,"swipeEnd",i[19]),me(s,"swipeFailed",i[20]),me(s,"swipeThresholdReached",i[17]),ct(iv.call(null,o)),me(o,"hovered",i[21]),ct(lv.call(null,o)),me(o,"tapped",i[22])],h=!0)},p(w,k){w[1]?m?(m.p(w,k),k[0]&2&&C(m,1)):(m=Br(w),m.c(),C(m,1),m.m(e,n)):m&&(se(),D(m,1,1,()=>{m=null}),re()),p&&p.p&&(!u||k[0]&96|k[1]&32)&&on(p,g,w,w[36],u?nn(g,w[36],k,jv):sn(w[36]),Tr),(!u||k[0]&256)&&z(s,"transform","translateX("+w[8]+"px)"),(!u||k[0]&512)&&z(s,"transition-duration",w[9]+"ms"),(!u||k[0]&1)&&z(s,"transition-timing-function",w[0]),r&&en(r.update)&&k[0]&2048&&r.update.call(null,{thresholdProvider:w[38]}),w[3]?A?(A.p(w,k),k[0]&8&&C(A,1)):(A=Vr(w),A.c(),C(A,1),A.m(o,null)):A&&(se(),D(A,1,1,()=>{A=null}),re()),w[1]?v?(v.p(w,k),k[0]&2&&C(v,1)):(v=jr(w),v.c(),C(v,1),v.m(e,null)):v&&(se(),D(v,1,1,()=>{v=null}),re()),w[4]?b?(b.p(w,k),k[0]&16&&C(b,1)):(b=Or(w),b.c(),C(b,1),b.m(t,null)):b&&(se(),D(b,1,1,()=>{b=null}),re())},i(w){u||(C(m),C(p,w),C(A),C(v),C(b),u=!0)},o(w){D(m),D(p,w),D(A),D(v),D(b),u=!1},d(w){w&&M(t),m&&m.d(),p&&p.d(w),i[39](null),A&&A.d(),i[40](null),v&&v.d(),b&&b.d(),h=!1,He(d)}}}function Gv(i,t,e){let{$$slots:n={},$$scope:o}=t,s=[],r,a,l=0,c=0,u=1;const[{data:h,progressManager:d},m,g]=Tv((te,Ae)=>{fo({currentPageIndex:()=>e(5,r=Ae),progressValue:()=>e(7,a=Ae),offset:()=>e(8,l=Ae),durationMs:()=>e(9,c=Ae),pagesCount:()=>e(10,u=Ae),loaded:()=>e(6,s=Ae)})(te)}),p=Ai();let{timingFunction:A="ease-in-out"}=t,{arrows:v=!0}=t,{infinite:b=!0}=t,{initialPageIndex:w=0}=t,{duration:k=500}=t,{autoplay:I=!1}=t,{autoplayDuration:P=3e3}=t,{autoplayDirection:L=Et}=t,{pauseOnFocus:x=!1}=t,{autoplayProgressVisible:F=!1}=t,{dots:N=!0}=t,{swiping:R=!0}=t,{particlesToShow:S=1}=t,{particlesToScroll:O=1}=t;function G(te,Ae){return H(this,null,function*(){const je=wn(Ae,"animated",!0);if(typeof te!="number")throw new Error("pageIndex should be a number");yield m.showPage(te,{animated:je})})}function W(te){return H(this,null,function*(){const Ae=wn(te,"animated",!0);yield m.showPrevPage({animated:Ae})})}function Y(te){return H(this,null,function*(){const Ae=wn(te,"animated",!0);yield m.showNextPage({animated:Ae})})}let _=0,ee,U;const ae=vv(({width:te})=>{e(11,_=te),h.particleWidth=_/h.particlesToShow,gv({particlesContainerChildren:U.children,particleWidth:h.particleWidth}),m.offsetPage({animated:!1})});function he(){const{clonesToAppend:te,clonesToPrepend:Ae}=Av({clonesCountHead:h.clonesCountHead,clonesCountTail:h.clonesCountTail,particlesContainerChildren:U.children});bv({particlesContainer:U,clonesToAppend:te,clonesToPrepend:Ae})}Ze(()=>{H(this,null,function*(){yield _o(),U&&ee&&(h.particlesCountWithoutClones=U.children.length,yield _o(),h.infinite&&he(),h.particlesCount=U.children.length,m.showPage(w,{animated:!1}),ae.observe(ee))})}),Ct(()=>{ae.disconnect(),d.reset()});function de(te){return H(this,null,function*(){yield m.showPage(te,{animated:!0})})}function ge(){!R||(h.durationMs=0)}function Ce(te){return H(this,null,function*(){!R||(yield fo({[Et]:m.showNextPage,[Zt]:m.showPrevPage})(te.detail.direction))})}function ke(te){!R||(h.offset+=te.detail.dx)}function Te(){!R||m.showParticle(h.currentParticleIndex)}function ce(){return H(this,null,function*(){!R||(yield m.offsetPage({animated:!0}))})}function ve(te){h.focused=te.detail.value}function Pe(){m.toggleFocused()}function ue(){m.showPrevPage()}const Ye=()=>_/3;function rt(te){Ve[te?"unshift":"push"](()=>{U=te,e(13,U)})}function ye(te){Ve[te?"unshift":"push"](()=>{ee=te,e(12,ee)})}const $e=te=>de(te.detail);return i.$$set=te=>{"timingFunction"in te&&e(0,A=te.timingFunction),"arrows"in te&&e(1,v=te.arrows),"infinite"in te&&e(2,b=te.infinite),"initialPageIndex"in te&&e(24,w=te.initialPageIndex),"duration"in te&&e(25,k=te.duration),"autoplay"in te&&e(26,I=te.autoplay),"autoplayDuration"in te&&e(27,P=te.autoplayDuration),"autoplayDirection"in te&&e(28,L=te.autoplayDirection),"pauseOnFocus"in te&&e(29,x=te.pauseOnFocus),"autoplayProgressVisible"in te&&e(3,F=te.autoplayProgressVisible),"dots"in te&&e(4,N=te.dots),"swiping"in te&&e(30,R=te.swiping),"particlesToShow"in te&&e(31,S=te.particlesToShow),"particlesToScroll"in te&&e(32,O=te.particlesToScroll),"$$scope"in te&&e(36,o=te.$$scope)},i.$$.update=()=>{i.$$.dirty[0]&32&&p("pageChange",r),i.$$.dirty[0]&4&&(h.infinite=b),i.$$.dirty[0]&33554432&&(h.durationMsInit=k),i.$$.dirty[0]&67108864&&(h.autoplay=I),i.$$.dirty[0]&134217728&&(h.autoplayDuration=P),i.$$.dirty[0]&268435456&&(h.autoplayDirection=L),i.$$.dirty[0]&536870912&&(h.pauseOnFocus=x),i.$$.dirty[1]&1&&(h.particlesToShowInit=S),i.$$.dirty[1]&2&&(h.particlesToScrollInit=O)},[A,v,b,F,N,r,s,a,l,c,u,_,ee,U,m,de,ge,Ce,ke,Te,ce,ve,Pe,ue,w,k,I,P,L,x,R,S,O,G,W,Y,o,n,Ye,rt,ye,$e]}class Wv extends oe{constructor(t){super(),ie(this,t,Gv,Hv,ne,{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},zv,[-1,-1])}get goTo(){return this.$$.ctx[33]}get goToPrev(){return this.$$.ctx[34]}get goToNext(){return this.$$.ctx[35]}}function _v(i){le(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 Rr(i){let t;function e(s,r){if(s[2].type==="Image")return Xv;if(s[2].type==="Video")return Nv}let n=e(i),o=n&&n(i);return{c(){t=B("div"),o&&o.c(),y(t,"class","media-item svelte-159ski6"),y(t,"draggable","false")},m(s,r){T(s,t,r),o&&o.m(t,null)},p(s,r){n===(n=e(s))&&o?o.p(s,r):(o&&o.d(1),o=n&&n(s),o&&(o.c(),o.m(t,null)))},d(s){s&&M(t),o&&o.d()}}}function Nv(i){let t,e,n,o,s,r;function a(u,h){return u[7]&&u[2].videoCoverUrl?Uv:Yv}let l=a(i),c=l(i);return{c(){c.c(),t=$(),e=B("div"),n=B("div"),o=B("div"),y(o,"class","video-icon-img svelte-159ski6"),z(o,"background-image","url("+i[20]()+")"),q(o,"canPlay",i[5]),y(n,"class","video-icon svelte-159ski6"),q(n,"large",i[4]==="large"),q(n,"small",i[4]==="small"),y(e,"class","video-play-button-container svelte-159ski6"),q(e,"showPlayButton",i[10])},m(u,h){c.m(u,h),T(u,t,h),T(u,e,h),V(e,n),V(n,o),s||(r=me(o,"click",i[21]),s=!0)},p(u,h){l===(l=a(u))&&c?c.p(u,h):(c.d(1),c=l(u),c&&(c.c(),c.m(t.parentNode,t))),h&8&&z(o,"background-image","url("+u[20]()+")"),h&32&&q(o,"canPlay",u[5]),h&16&&q(n,"large",u[4]==="large"),h&16&&q(n,"small",u[4]==="small"),h&1024&&q(e,"showPlayButton",u[10])},d(u){c.d(u),u&&M(t),u&&M(e),s=!1,r()}}}function Xv(i){let t,e,n,o;return{c(){t=B("img"),y(t,"class","media-content svelte-159ski6"),y(t,"style",e=`object-fit: ${i[6]};`),Xe(t.src,n=i[2].url)||y(t,"src",n),y(t,"alt",o=i[2].name),y(t,"draggable",!1)},m(s,r){T(s,t,r)},p(s,r){r&64&&e!==(e=`object-fit: ${s[6]};`)&&y(t,"style",e),r&4&&!Xe(t.src,n=s[2].url)&&y(t,"src",n),r&4&&o!==(o=s[2].name)&&y(t,"alt",o)},d(s){s&&M(t)}}}function Yv(i){let t,e,n,o,s,r,a;return{c(){t=B("video"),y(t,"class","media-content svelte-159ski6"),y(t,"style",e=`object-fit: ${i[6]};`),Xe(t.src,n=i[2].videoCoverUrl?i[2].url:i[2].url+"#t=0.1")||y(t,"src",n),y(t,"poster",o=i[2].videoCoverUrl),y(t,"preload",s=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,q(t,"showPlayButton",i[10])},m(l,c){T(l,t,c),i[19](t),r||(a=[me(t,"play",i[14]),me(t,"pause",i[15]),me(t,"error",i[16]),me(t,"ended",i[17]),me(t,"click",i[18])],r=!0)},p(l,c){c&64&&e!==(e=`object-fit: ${l[6]};`)&&y(t,"style",e),c&4&&!Xe(t.src,n=l[2].videoCoverUrl?l[2].url:l[2].url+"#t=0.1")&&y(t,"src",n),c&4&&o!==(o=l[2].videoCoverUrl)&&y(t,"poster",o),c&4&&s!==(s=l[2].videoCoverUrl?"none":"auto")&&y(t,"preload",s),c&1024&&q(t,"showPlayButton",l[10])},d(l){l&&M(t),i[19](null),r=!1,He(a)}}}function Uv(i){let t,e,n,o;return{c(){t=B("img"),y(t,"class","media-content svelte-159ski6"),y(t,"style",e=`object-fit: ${i[6]};`),Xe(t.src,n=i[2].videoCoverUrl)||y(t,"src",n),y(t,"alt",o=i[2].name),y(t,"draggable",!1)},m(s,r){T(s,t,r)},p(s,r){r&64&&e!==(e=`object-fit: ${s[6]};`)&&y(t,"style",e),r&4&&!Xe(t.src,n=s[2].videoCoverUrl)&&y(t,"src",n),r&4&&o!==(o=s[2].name)&&y(t,"alt",o)},d(s){s&&M(t)}}}function qv(i){let t,e=i[2]&&Rr(i);return{c(){e&&e.c(),t=pe()},m(n,o){e&&e.m(n,o),T(n,t,o)},p(n,[o]){n[2]?e?e.p(n,o):(e=Rr(n),e.c(),e.m(t.parentNode,t)):e&&(e.d(1),e=null)},i:X,o:X,d(n){e&&e.d(n),n&&M(t)}}}function Jv(i,t,e){let n,o,{mediaInstance:s={videoInstance:void 0,paused:!0}}=t,{tag:r}=t,{media:a}=t,{playButtonIfNeed:l="withoutText"}=t,{playButtonSizeIfNeed:c="small"}=t,{canPlay:u=!0}=t,{objectFit:h="fill"}=t,{disableVideoIfHavePoster:d=!1}=t,m=!0,g=!1;function p(){e(8,g=(a==null?void 0:a.type)==="Video"&&Boolean(a.videoCoverUrl))}const A=At("mediaStore"),v=At("hooks"),b=()=>{console.debug("loadPoster"),!g&&(!n||(e(9,n.muted=!0,n),n.play(),n.pause(),e(9,n.muted=!1,n),e(8,g=!0),console.debug("loadPoster end")))};v.on("loadVideoFirstFrame",b),Ze(()=>{A.subscribe(({currentMediaElement:R})=>{R!==n&&(n==null||n.pause())})});const w=R=>{e(10,m=!1),e(0,s.paused=!1,s),e(8,g=!0),n&&A.set({currentMediaElement:n}),v.emit("playStateChange",{event:R,state:"playing",tag:r,mediaInstance:n})},k=R=>{e(10,m=!0),e(0,s.paused=!0,s),v.emit("playStateChange",{event:R,state:"paused",tag:r,mediaInstance:n})},I=R=>{e(10,m=!0),e(0,s.paused=!0,s),v.emit("playStateChange",{event:R,state:"paused",tag:r,mediaInstance:n})},P=R=>{e(10,m=!0),e(0,s.paused=!0,s),v.emit("playStateChange",{event:R,state:"paused",tag:r,mediaInstance:n})},L=R=>{n&&n.pause()};function x(R){Ve[R?"unshift":"push"](()=>{s.videoInstance=R,e(0,s)})}const F=()=>l==="withText"?Bl:l==="withoutText"?co:l,N=R=>{!u||n&&(e(9,n.muted=!1,n),n.play())};return i.$$set=R=>{"mediaInstance"in R&&e(0,s=R.mediaInstance),"tag"in R&&e(1,r=R.tag),"media"in R&&e(2,a=R.media),"playButtonIfNeed"in R&&e(3,l=R.playButtonIfNeed),"playButtonSizeIfNeed"in R&&e(4,c=R.playButtonSizeIfNeed),"canPlay"in R&&e(5,u=R.canPlay),"objectFit"in R&&e(6,h=R.objectFit),"disableVideoIfHavePoster"in R&&e(7,d=R.disableVideoIfHavePoster)},i.$$.update=()=>{if(i.$$.dirty&1&&e(9,n=s.videoInstance),i.$$.dirty&4&&e(13,o=a==null?void 0:a.url),i.$$.dirty&8192&&Boolean(o)&&p(),i.$$.dirty&512&&n&&e(10,m=n.paused),i.$$.dirty&772&&(a==null?void 0:a.type)==="Video"&&!g){const R=navigator.userAgent.toLowerCase().indexOf("micromessenger")!==-1,O=navigator.userAgent.toLowerCase().indexOf("iphone")!==-1&&R;n&&O&&n.paused&&(document.removeEventListener("WeixinJSBridgeReady",b),document.removeEventListener("touchstart",b),document.removeEventListener("click",b),document.addEventListener("WeixinJSBridgeReady",b),document.addEventListener("touchstart",b),document.addEventListener("click",b))}},[s,r,a,l,c,u,h,d,g,n,m,A,v,o,w,k,I,P,L,x,F,N]}class Yl extends oe{constructor(t){super(),ie(this,t,Jv,qv,ne,{mediaInstance:0,tag:1,media:2,playButtonIfNeed:3,playButtonSizeIfNeed:4,canPlay:5,objectFit:6,disableVideoIfHavePoster:7},_v)}}function Zv(i){le(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 Qr(i,t,e){const n=i.slice();return n[25]=t[e],n[26]=t,n[27]=e,n}function Fr(i){let t,e,n,o,s,r,a;const l=[$v,Kv],c=[];function u(h,d){return h[13]&&h[10].length>1?0:1}return n=u(i),o=c[n]=l[n](i),{c(){t=B("div"),e=B("div"),o.c(),y(e,"class","media-list svelte-1mrbqlg"),q(e,"carouselEnabled",i[13]),y(t,"class","media-list-wrapper svelte-1mrbqlg"),q(t,"unfolded",i[5])},m(h,d){T(h,t,d),V(t,e),c[n].m(e,null),a=!0},p(h,d){i=h;let m=n;n=u(i),n===m?c[n].p(i,d):(se(),D(c[m],1,1,()=>{c[m]=null}),re(),o=c[n],o?o.p(i,d):(o=c[n]=l[n](i),o.c()),C(o,1),o.m(e,null)),(!a||d&8192)&&q(e,"carouselEnabled",i[13]),(!a||d&32)&&q(t,"unfolded",i[5])},i(h){a||(C(o),h&&Re(()=>{r&&r.end(1),s=zt(t,Uo,i[6]?{y:4,duration:i[4],delay:i[2],easing:vt}:void 0),s.start()}),a=!0)},o(h){D(o),s&&s.invalidate(),h&&(r=an(t,Uo,i[6]?{y:4,duration:i[4],delay:i[3],easing:vt}:void 0)),a=!1},d(h){h&&M(t),c[n].d(),h&&r&&r.end()}}}function Kv(i){let t,e,n;const o=[{media:i[1][0]},i[7],{tag:i[0]}];function s(a){i[20](a)}let r={};for(let a=0;a<o.length;a+=1)r=Be(r,o[a]);return i[8][0]!==void 0&&(r.mediaInstance=i[8][0]),t=new Yl({props:r}),Ve.push(()=>Ya(t,"mediaInstance",s)),{c(){K(t.$$.fragment)},m(a,l){J(t,a,l),n=!0},p(a,l){const c=l&131?Qe(o,[l&2&&{media:a[1][0]},l&128&&Xa(a[7]),l&1&&{tag:a[0]}]):{};!e&&l&256&&(e=!0,c.mediaInstance=a[8][0],Ga(()=>e=!1)),t.$set(c)},i(a){n||(C(t.$$.fragment,a),n=!0)},o(a){D(t.$$.fragment,a),n=!1},d(a){Z(t,a)}}}function $v(i){let t,e,n={dots:!1,arrows:!1,$$slots:{default:[eA]},$$scope:{ctx:i}};return t=new Wv({props:n}),i[18](t),t.$on("pageChange",i[19]),{c(){K(t.$$.fragment)},m(o,s){J(t,o,s),e=!0},p(o,s){const r={};s&268436865&&(r.$$scope={dirty:s,ctx:o}),t.$set(r)},i(o){e||(C(t.$$.fragment,o),e=!0)},o(o){D(t.$$.fragment,o),e=!1},d(o){i[18](null),Z(t,o)}}}function Hr(i){let t,e,n;const o=[i[7],{media:i[25]},{tag:i[0]}];function s(a){i[17](a,i[27])}let r={};for(let a=0;a<o.length;a+=1)r=Be(r,o[a]);return i[8][i[27]]!==void 0&&(r.mediaInstance=i[8][i[27]]),t=new Yl({props:r}),Ve.push(()=>Ya(t,"mediaInstance",s)),{c(){K(t.$$.fragment)},m(a,l){J(t,a,l),n=!0},p(a,l){i=a;const c=l&1153?Qe(o,[l&128&&Xa(i[7]),l&1024&&{media:i[25]},l&1&&{tag:i[0]}]):{};!e&&l&256&&(e=!0,c.mediaInstance=i[8][i[27]],Ga(()=>e=!1)),t.$set(c)},i(a){n||(C(t.$$.fragment,a),n=!0)},o(a){D(t.$$.fragment,a),n=!1},d(a){Z(t,a)}}}function eA(i){let t,e,n=i[10],o=[];for(let r=0;r<n.length;r+=1)o[r]=Hr(Qr(i,n,r));const s=r=>D(o[r],1,1,()=>{o[r]=null});return{c(){for(let r=0;r<o.length;r+=1)o[r].c();t=pe()},m(r,a){for(let l=0;l<o.length;l+=1)o[l].m(r,a);T(r,t,a),e=!0},p(r,a){if(a&1409){n=r[10];let l;for(l=0;l<n.length;l+=1){const c=Qr(r,n,l);o[l]?(o[l].p(c,a),C(o[l],1)):(o[l]=Hr(c),o[l].c(),C(o[l],1),o[l].m(t.parentNode,t))}for(se(),l=n.length;l<o.length;l+=1)s(l);re()}},i(r){if(!e){for(let a=0;a<n.length;a+=1)C(o[a]);e=!0}},o(r){o=o.filter(Boolean);for(let a=0;a<o.length;a+=1)D(o[a]);e=!1},d(r){ut(o,r),r&&M(t)}}}function tA(i){let t,e,n=i[5]&&Fr(i);return{c(){n&&n.c(),t=pe()},m(o,s){n&&n.m(o,s),T(o,t,s),e=!0},p(o,[s]){o[5]?n?(n.p(o,s),s&32&&C(n,1)):(n=Fr(o),n.c(),C(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(C(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function nA(i,t,e){let n,o,s,r,{tag:a}=t,{mediaData:l}=t,{inDelay:c=0}=t,{outDelay:u=0}=t,{duration:h=0}=t,{unfolded:d=!0}=t,{animation:m=!0}=t,{mediaItemConfig:g}=t,{enableCarousel:p=!0}=t,{autoplayConfig:A={autoplayVideo:!1,autoplayCarousel:!0,autoplayVideoInCarousel:!1}}=t,v=[],b=0,w,k=null;const I=At("hooks"),P=At("mediaStore");function L(){const S=v[b],O=S==null?void 0:S.videoInstance;!O||(O.paused?(O.muted=!1,O.play()):O.pause())}Ze(()=>{I.on("click",S=>{var O,G,W;!((W=(G=(O=a.tag3DContentSvelte)==null?void 0:O.css3DInstance)==null?void 0:G.css3DObject)!=null&&W.opacityMesh)||S.tag.id===a.id&&L()}),k=setInterval(()=>{r&&(w==null||w.goToNext())},3e3)}),Ct(()=>{clearInterval(k),I.off("click",L)});function x(S,O){i.$$.not_equal(v[O],S)&&(v[O]=S,e(8,v))}function F(S){Ve[S?"unshift":"push"](()=>{w=S,e(12,w)})}const N=S=>{n||P.set({currentMediaElement:null}),e(11,b=S.detail)};function R(S){i.$$.not_equal(v[0],S)&&(v[0]=S,e(8,v))}return i.$$set=S=>{"tag"in S&&e(0,a=S.tag),"mediaData"in S&&e(1,l=S.mediaData),"inDelay"in S&&e(2,c=S.inDelay),"outDelay"in S&&e(3,u=S.outDelay),"duration"in S&&e(4,h=S.duration),"unfolded"in S&&e(5,d=S.unfolded),"animation"in S&&e(6,m=S.animation),"mediaItemConfig"in S&&e(7,g=S.mediaItemConfig),"enableCarousel"in S&&e(15,p=S.enableCarousel),"autoplayConfig"in S&&e(16,A=S.autoplayConfig)},i.$$.update=()=>{i.$$.dirty&256&&e(9,n=v.every(S=>S.paused)),i.$$.dirty&32770&&e(13,o=p&&(l==null?void 0:l.length)>1),i.$$.dirty&2&&e(10,s=l),i.$$.dirty&67072&&(r=s.length>1&&A.autoplayCarousel&&n)},[a,l,c,u,h,d,m,g,v,n,s,b,w,o,P,p,A,x,F,N,R]}class Ul extends oe{constructor(t){super(),ie(this,t,nA,tA,ne,{tag:0,mediaData:1,inDelay:2,outDelay:3,duration:4,unfolded:5,animation:6,mediaItemConfig:7,enableCarousel:15,autoplayConfig:16},Zv)}}function iA(i){le(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 Gr(i){let t,e,n,o,s,r,a,l;t=new st({props:{visible:i[3],left:61,bottom:57,width:2,blurRadius:150,spreadRadius:75}}),o=new L0({props:{unfolded:i[3],outDelay:400}});let c=i[2]&&Wr(i),u=i[1]&&_r(i);return{c(){K(t.$$.fragment),e=$(),n=B("div"),K(o.$$.fragment),s=$(),c&&c.c(),r=$(),u&&u.c(),a=pe(),y(n,"class","line svelte-1f7m1lj")},m(h,d){J(t,h,d),T(h,e,d),T(h,n,d),J(o,n,null),T(h,s,d),c&&c.m(h,d),T(h,r,d),u&&u.m(h,d),T(h,a,d),l=!0},p(h,d){const m={};d&8&&(m.visible=h[3]),t.$set(m);const g={};d&8&&(g.unfolded=h[3]),o.$set(g),h[2]?c?(c.p(h,d),d&4&&C(c,1)):(c=Wr(h),c.c(),C(c,1),c.m(r.parentNode,r)):c&&(se(),D(c,1,1,()=>{c=null}),re()),h[1]?u?(u.p(h,d),d&2&&C(u,1)):(u=_r(h),u.c(),C(u,1),u.m(a.parentNode,a)):u&&(se(),D(u,1,1,()=>{u=null}),re())},i(h){l||(C(t.$$.fragment,h),C(o.$$.fragment,h),C(c),C(u),l=!0)},o(h){D(t.$$.fragment,h),D(o.$$.fragment,h),D(c),D(u),l=!1},d(h){Z(t,h),h&&M(e),h&&M(n),Z(o),h&&M(s),c&&c.d(h),h&&M(r),u&&u.d(h),h&&M(a)}}}function Wr(i){let t,e,n;return e=new Gl({props:{unfolded:i[3],content:i[2],inDelay:500}}),{c(){t=B("div"),K(e.$$.fragment),y(t,"class","text svelte-1f7m1lj")},m(o,s){T(o,t,s),J(e,t,null),n=!0},p(o,s){const r={};s&8&&(r.unfolded=o[3]),s&4&&(r.content=o[2]),e.$set(r)},i(o){n||(C(e.$$.fragment,o),n=!0)},o(o){D(e.$$.fragment,o),n=!1},d(o){o&&M(t),Z(e)}}}function _r(i){let t,e,n;return e=new Ul({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=B("div"),K(e.$$.fragment),y(t,"class","media-wrapper svelte-1f7m1lj")},m(o,s){T(o,t,s),J(e,t,null),n=!0},p(o,s){const r={};s&8&&(r.unfolded=o[3]),s&2&&(r.mediaData=o[1]),s&1&&(r.tag=o[0]),e.$set(r)},i(o){n||(C(e.$$.fragment,o),n=!0)},o(o){D(e.$$.fragment,o),n=!1},d(o){o&&M(t),Z(e)}}}function oA(i){let t,e,n=i[0].state&&Gr(i);return{c(){n&&n.c(),t=pe()},m(o,s){n&&n.m(o,s),T(o,t,s),e=!0},p(o,[s]){o[0].state?n?(n.p(o,s),s&1&&C(n,1)):(n=Gr(o),n.c(),C(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(C(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function sA(i,t,e){let n,o,s,r,{tag:a}=t;return i.$$set=l=>{"tag"in l&&e(0,a=l.tag)},i.$$.update=()=>{var l,c,u;i.$$.dirty&1&&e(3,n=a.state?a.state.unfolded:!1),i.$$.dirty&1&&e(4,o=(c=(l=a.data.title)!=null?l:a.data.text)!=null?c:""),i.$$.dirty&16&&e(2,s=((u=o.length)!=null?u:0)>7?o.substring(0,6)+"...":o),i.$$.dirty&1&&e(1,r=a.data.mediaData)},[a,r,s,n,o]}class rA extends oe{constructor(t){super(),ie(this,t,sA,oA,ne,{tag:0},iA)}}function aA(i){le(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 Nr(i,t,e){const n=i.slice();return n[0]=t[e],n}function Xr(i,t,e){const n=i.slice();return n[0]=t[e],n}function Yr(i){let t,e;return{c(){t=B("img"),y(t,"class","headerImage svelte-sezqcq"),Xe(t.src,e=i[3].headerPictureUrl)||y(t,"src",e),y(t,"alt","")},m(n,o){T(n,t,o)},p(n,o){o&8&&!Xe(t.src,e=n[3].headerPictureUrl)&&y(t,"src",e)},d(n){n&&M(t)}}}function Ur(i){let t,e,n,o,s=i[2]||[],r=[];for(let c=0;c<s.length;c+=1)r[c]=qr(Xr(i,s,c));let a=i[5]||[],l=[];for(let c=0;c<a.length;c+=1)l[c]=Jr(Nr(i,a,c));return{c(){t=B("div"),e=B("div");for(let c=0;c<r.length;c+=1)r[c].c();n=$();for(let c=0;c<l.length;c+=1)l[c].c();y(e,"class","tags svelte-sezqcq"),Re(()=>i[11].call(e)),y(t,"class","tags-wrapper svelte-sezqcq")},m(c,u){T(c,t,u),V(t,e);for(let h=0;h<r.length;h+=1)r[h].m(e,null);V(e,n);for(let h=0;h<l.length;h+=1)l[h].m(e,null);o=vi(e,i[11].bind(e))},p(c,u){if(u&4){s=c[2]||[];let h;for(h=0;h<s.length;h+=1){const d=Xr(c,s,h);r[h]?r[h].p(d,u):(r[h]=qr(d),r[h].c(),r[h].m(e,n))}for(;h<r.length;h+=1)r[h].d(1);r.length=s.length}if(u&32){a=c[5]||[];let h;for(h=0;h<a.length;h+=1){const d=Nr(c,a,h);l[h]?l[h].p(d,u):(l[h]=Jr(d),l[h].c(),l[h].m(e,null))}for(;h<l.length;h+=1)l[h].d(1);l.length=a.length}},d(c){c&&M(t),ut(r,c),ut(l,c),o()}}}function qr(i){let t,e=i[0]+"",n;return{c(){t=B("div"),n=xe(e),y(t,"class","tag primary-tag svelte-sezqcq"),z(t,"min-width",To)},m(o,s){T(o,t,s),V(t,n)},p(o,s){s&4&&e!==(e=o[0]+"")&&Se(n,e)},d(o){o&&M(t)}}}function Jr(i){let t,e=i[0]+"",n;return{c(){t=B("div"),n=xe(e),y(t,"class","tag secondary-tag svelte-sezqcq"),z(t,"min-width",To)},m(o,s){T(o,t,s),V(t,n)},p(o,s){s&32&&e!==(e=o[0]+"")&&Se(n,e)},d(o){o&&M(t)}}}function Zr(i){let t,e,n=i[7]&&Kr(i),o=i[3].highlightText&&ea(i);return{c(){t=B("div"),n&&n.c(),e=$(),o&&o.c(),y(t,"class","footer svelte-sezqcq")},m(s,r){T(s,t,r),n&&n.m(t,null),V(t,e),o&&o.m(t,null)},p(s,r){s[7]?n?n.p(s,r):(n=Kr(s),n.c(),n.m(t,e)):n&&(n.d(1),n=null),s[3].highlightText?o?o.p(s,r):(o=ea(s),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(s){s&&M(t),n&&n.d(),o&&o.d()}}}function Kr(i){let t,e,n=i[3].price.value+"",o,s,r=i[3].price.unit&&$r(i);return{c(){t=B("div"),e=B("span"),o=xe(n),s=$(),r&&r.c(),y(e,"class","value svelte-sezqcq"),y(t,"class","price svelte-sezqcq")},m(a,l){T(a,t,l),V(t,e),V(e,o),V(t,s),r&&r.m(t,null)},p(a,l){l&8&&n!==(n=a[3].price.value+"")&&Se(o,n),a[3].price.unit?r?r.p(a,l):(r=$r(a),r.c(),r.m(t,null)):r&&(r.d(1),r=null)},d(a){a&&M(t),r&&r.d()}}}function $r(i){let t,e=i[3].price.unit+"",n;return{c(){t=B("span"),n=xe(e),y(t,"class","unit svelte-sezqcq")},m(o,s){T(o,t,s),V(t,n)},p(o,s){s&8&&e!==(e=o[3].price.unit+"")&&Se(n,e)},d(o){o&&M(t)}}}function ea(i){let t,e,n,o,s=i[3].highlightText+"",r,a,l;return{c(){t=B("div"),e=B("div"),n=$(),o=B("span"),r=xe(s),a=$(),l=B("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(o,"class","text svelte-sezqcq"),y(t,"class","goto-button goto-icon svelte-sezqcq"),y(l,"class","arrow-wrapper svelte-sezqcq")},m(c,u){T(c,t,u),V(t,e),V(t,n),V(t,o),V(o,r),T(c,a,u),T(c,l,u)},p(c,u){u&8&&s!==(s=c[3].highlightText+"")&&Se(r,s)},d(c){c&&M(t),c&&M(a),c&&M(l)}}}function lA(i){var k,I;let t,e,n,o,s,r,a,l,c,u,h=i[3].title+"",d,m,g,p,A;e=new st({props:{visible:i[4],outDelay:500,left:61,bottom:87,blurRadius:150,spreadRadius:75}});let v=i[3].headerPictureUrl&&Yr(i),b=((k=i[2].length)!=null?k:0)+((I=i[5].length)!=null?I:0)>0&&Ur(i),w=(i[7]||i[3].highlightText)&&Zr(i);return{c(){t=B("div"),K(e.$$.fragment),n=$(),o=B("div"),s=$(),r=B("div"),v&&v.c(),a=$(),l=B("div"),c=B("div"),u=B("div"),d=xe(h),m=$(),b&&b.c(),g=$(),w&&w.c(),y(o,"class","line svelte-sezqcq"),z(o,"transition-delay",i[4]?Un+"ms":qn+na-ta-40+"ms"),y(u,"class","text svelte-sezqcq"),y(c,"class","title svelte-sezqcq"),y(l,"class","title-wrapper svelte-sezqcq"),y(r,"class","content svelte-sezqcq"),z(r,"max-width",ot(i[9])),z(r,"transition-delay",i[4]?Un+qn+"ms":"0ms"),y(t,"class",p=Ie(`marketing ${i[6]}`)+" svelte-sezqcq"),q(t,"unfolded",i[4]),q(t,"folded",i[8])},m(P,L){T(P,t,L),J(e,t,null),V(t,n),V(t,o),V(t,s),V(t,r),v&&v.m(r,null),V(r,a),V(r,l),V(l,c),V(c,u),V(u,d),V(r,m),b&&b.m(r,null),V(r,g),w&&w.m(r,null),A=!0},p(P,[L]){var F,N;const x={};L&16&&(x.visible=P[4]),e.$set(x),L&16&&z(o,"transition-delay",P[4]?Un+"ms":qn+na-ta-40+"ms"),P[3].headerPictureUrl?v?v.p(P,L):(v=Yr(P),v.c(),v.m(r,a)):v&&(v.d(1),v=null),(!A||L&8)&&h!==(h=P[3].title+"")&&Se(d,h),((F=P[2].length)!=null?F:0)+((N=P[5].length)!=null?N:0)>0?b?b.p(P,L):(b=Ur(P),b.c(),b.m(r,g)):b&&(b.d(1),b=null),P[7]||P[3].highlightText?w?w.p(P,L):(w=Zr(P),w.c(),w.m(r,null)):w&&(w.d(1),w=null),L&16&&z(r,"transition-delay",P[4]?Un+qn+"ms":"0ms"),(!A||L&64&&p!==(p=Ie(`marketing ${P[6]}`)+" svelte-sezqcq"))&&y(t,"class",p),(!A||L&80)&&q(t,"unfolded",P[4]),(!A||L&320)&&q(t,"folded",P[8])},i(P){A||(C(e.$$.fragment,P),A=!0)},o(P){D(e.$$.fragment,P),A=!1},d(P){P&&M(t),Z(e),v&&v.d(),b&&b.d(),w&&w.d()}}}const To=40,Un=400,ta=500,qn=180,na=500;function cA(i,t,e){let n,o,s,r,a,l,c,u,{tag:h}=t,d,m=(()=>{var A;const p=(A=h.data.limitWidth)!=null?A:!0;if(typeof p=="number")return p;if(p===!0)return 172})();function g(){d=this.offsetHeight,e(1,d)}return i.$$set=p=>{"tag"in p&&e(0,h=p.tag)},i.$$.update=()=>{var p,A,v,b,w,k;i.$$.dirty&1&&e(4,n=(A=(p=h.state)==null?void 0:p.unfolded)!=null?A:!1),i.$$.dirty&16&&e(8,o=!n),i.$$.dirty&1&&e(3,s=h.data),i.$$.dirty&8&&e(7,r=wt((v=s.price)==null?void 0:v.value)&&((b=s.price)==null?void 0:b.value)!==""),i.$$.dirty&1&&e(6,a=h.data.theme||"light"),i.$$.dirty&1026&&d>40&&e(10,l=l-1),i.$$.dirty&1032&&e(2,c=((w=s.brandTags)==null?void 0:w.slice(0,l).filter(Boolean))||[]),i.$$.dirty&1036&&e(5,u=((k=s.tags)==null?void 0:k.slice(0,l-c.length).filter(Boolean))||[])},e(10,l=(m-20)/To),[h,d,c,s,n,u,a,r,o,m,l,g]}class uA extends oe{constructor(t){super(),ie(this,t,cA,lA,ne,{tag:0},aA)}}class dA 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 H(this,null,function*(){var n,o,s;if(this.tryplaying)return;this.tryplaying=!0,(!this.audioInstance||((n=this.audioInstance)==null?void 0:n.realSrc)!==this.sharedAudioSrc)&&(this.audioInstance=bg(this.sharedAudioSrc,{namespace:Do.PlayAudio})),(o=this.eventListenerDisposer)==null||o.call(this),this.eventListenerDisposer=this.addEventListeners(),this.audioInstance.currentTime=(s=this.currentTime)!=null?s: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: \u97F3\u9891\u6587\u4EF6\u53EF\u80FD\u635F\u574F\u6216\u4FEE\u6539\u8FC7\u6587\u4EF6\u540E\u7F00",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,o;(n=this.onended)==null||n.call(this,e!=null?e:new Event("ended")),(o=this.eventListenerDisposer)==null||o.call(this),this.sharedAudioPaused=!0,this.sharedAudioCurrentTime=0,this.clear()}addEventListeners(){const e=this.audioInstance;if(!e)return;const n=d=>{var m;this.sharedAudioCurrentTime=e.currentTime,(m=this.ontimeupdate)==null||m.call(this,d)},o=d=>{var m;e.isBlankAudio||(this.sharedAudioPaused=!1,(m=this.onplay)==null||m.call(this,d))},s=d=>{this.pause(d)},r=d=>{this.endedHandler(d)},a=d=>{var m;this.sharedAudioPaused=!0,(m=this.onerror)==null||m.call(this,d)},l=d=>{var m;return(m=this.oncanplay)==null?void 0:m.call(this,d)},c=d=>{var m;return(m=this.oncanplaythrough)==null?void 0:m.call(this,d)},u=d=>{var m;return(m=this.onloadeddata)==null?void 0:m.call(this,d)},h=d=>{var m;return(m=this.onloadedmetadata)==null?void 0:m.call(this,d)};return e.addEventListener("timeupdate",n),e.addEventListener("play",o),e.addEventListener("pause",s),e.addEventListener("ended",r),e.addEventListener("error",a),e.addEventListener("canplay",l),e.addEventListener("canplaythrough",c),e.addEventListener("loadeddata",u),e.addEventListener("loadedmetadata",h),()=>{e.removeEventListener("timeupdate",n),e.removeEventListener("play",o),e.removeEventListener("pause",s),e.removeEventListener("ended",r),e.removeEventListener("error",a),e.removeEventListener("canplay",l),e.removeEventListener("canplaythrough",c),e.removeEventListener("loadeddata",u),e.removeEventListener("loadedmetadata",h)}}}function hA(i){le(i,"svelte-13e7hxv",".audio.svelte-13e7hxv{pointer-events:auto;cursor:pointer;width:100%;height:100%}")}function fA(i){let t,e,n,o;const s=i[8].default,r=tn(s,i,i[7],null);return{c(){t=B("div"),r&&r.c(),y(t,"class","audio svelte-13e7hxv"),y(t,"style",i[0])},m(a,l){T(a,t,l),r&&r.m(t,null),e=!0,n||(o=me(t,"click",Va(i[1])),n=!0)},p(a,[l]){r&&r.p&&(!e||l&128)&&on(r,s,a,a[7],e?nn(s,a[7],l,null):sn(a[7]),null),(!e||l&1)&&y(t,"style",a[0])},i(a){e||(C(r,a),e=!0)},o(a){D(r,a),e=!1},d(a){a&&M(t),r&&r.d(a),n=!1,o()}}}function mA(i,t,e){let{$$slots:n={},$$scope:o}=t,{url:s}=t,{enable:r=!0}=t,{style:a=""}=t,{hooksInfo:l}=t;const c=Ai(),u=At("hooks"),h=At("mediaStore");let d,m=!0;function g(){e(5,d.onplay=A=>{u.emit("playStateChange",Q({event:A,state:"playing",mediaInstance:d},l)),c("play"),e(6,m=!1)},d),e(5,d.onpause=A=>{u.emit("playStateChange",Q({event:A,state:"paused",mediaInstance:d},l)),c("pause"),e(6,m=!0)},d),e(5,d.onended=A=>{u.emit("playStateChange",Q({event:A,state:"paused",mediaInstance:d},l)),c("pause"),e(6,m=!0)},d),e(5,d.onloadedmetadata=A=>{typeof d.duration=="number"&&!Number.isNaN(d.duration)&&c("duration",d.duration)},d),e(5,d.onerror=A=>{c("pause"),e(6,m=!0)},d),e(5,d.ontimeupdate=A=>{c("timeupdate",d.currentTime)},d)}h.subscribe(({currentMediaElement:A})=>{A!==d&&(m||d==null||d.pause())});function p(A){!d||(u.emit("click",Q({event:A,target:"AudioTagPlayIcon",audioInstance:d},l)),h.set({currentMediaElement:d}),u.emit("playStateChange",Q({event:A,state:d.paused?"playing":"paused",mediaInstance:d},l)),d.paused?d.play():d.pause())}return i.$$set=A=>{"url"in A&&e(2,s=A.url),"enable"in A&&e(3,r=A.enable),"style"in A&&e(0,a=A.style),"hooksInfo"in A&&e(4,l=A.hooksInfo),"$$scope"in A&&e(7,o=A.$$scope)},i.$$.update=()=>{i.$$.dirty&4&&(s||c("duration",0)),i.$$.dirty&36&&(d==null||d.dispose(),e(5,d=new dA(s)),c("audioRef",d),setTimeout(()=>c("audioRef",d),200),g()),i.$$.dirty&40&&(r||d==null||d.pause()),i.$$.dirty&72&&c(r&&!m?"play":"pause")},[a,p,s,r,l,d,m,o,n]}class ql extends oe{constructor(t){super(),ie(this,t,mA,fA,ne,{url:2,enable:3,style:0,hooksInfo:4},hA)}}function pA(i){le(i,"svelte-srt2pi",".audio-icon__wrapper.svelte-srt2pi.svelte-srt2pi{display:inline-block}.audio-icon.svelte-srt2pi.svelte-srt2pi{display:flex;justify-content:center;align-items:center;position:relative;width:100%;height:100%;border-radius:50%;background-color:rgba(255, 255, 255, 0.8)}.audio-icon.svelte-srt2pi .sound-wave__container.svelte-srt2pi{position:absolute;pointer-events:none;width:60%;height:60%}.sound-wave.svelte-srt2pi.svelte-srt2pi{animation-duration:2s;animation-iteration-count:infinite;animation-play-state:paused;transition:opacity 0}.playing.svelte-srt2pi .sound-wave.svelte-srt2pi{animation-play-state:running}.playing.svelte-srt2pi .sound-wave-1.svelte-srt2pi{animation-name:svelte-srt2pi-sound_wave_1_animation}.playing.svelte-srt2pi .sound-wave-2.svelte-srt2pi{animation-name:svelte-srt2pi-sound_wave_2_animation}.playing.svelte-srt2pi .sound-wave-3.svelte-srt2pi{animation-name:svelte-srt2pi-sound_wave_3_animation}@keyframes svelte-srt2pi-sound_wave_1_animation{0%,10%{opacity:0}25%,100%{opacity:1}}@keyframes svelte-srt2pi-sound_wave_2_animation{0%,35%{opacity:0}50%,100%{opacity:1}}@keyframes svelte-srt2pi-sound_wave_3_animation{0%,60%{opacity:0}75%,100%{opacity:1}}")}function ia(i){let t,e;return t=new st({props:{center:!0,blurRadius:12,spreadRadius:5}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},i(n){e||(C(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function gA(i){let t,e,n,o,s,r=i[1]&&ia();return{c(){t=B("div"),r&&r.c(),e=$(),n=B("div"),o=B("div"),o.innerHTML='<svg width="100%" height="100%" viewBox="0 0 128 128"><g transform="rotate(-45 12 64) translate(12 64)" fill="black" stroke="black" fill-opacity="0.6" stroke-opacity="0.6"><path stroke="none" class="sound-wave sound-wave-1 svelte-srt2pi" d="M0,23 A23,23 0 0,0 23,0 L0,0"></path><path fill="none" stroke-width="15" class="sound-wave sound-wave-2 svelte-srt2pi" d="M0,46 A46,46 0 0,0 46,0"></path><path fill="none" stroke-width="15" class="sound-wave sound-wave-3 svelte-srt2pi" d="M0,80 A80,80 0 0,0 80,0"></path></g></svg>',y(o,"class","sound-wave__container svelte-srt2pi"),y(n,"class","audio-icon svelte-srt2pi"),q(n,"playing",i[0]),y(t,"class","audio-icon__wrapper svelte-srt2pi"),y(t,"style",i[2]),z(t,"width",i[5]),z(t,"height",i[5])},m(a,l){T(a,t,l),r&&r.m(t,null),V(t,e),V(t,n),V(n,o),i[7](o),i[8](t),s=!0},p(a,[l]){a[1]?r?l&2&&C(r,1):(r=ia(),r.c(),C(r,1),r.m(t,e)):r&&(se(),D(r,1,1,()=>{r=null}),re()),(!s||l&1)&&q(n,"playing",a[0]),(!s||l&4)&&y(t,"style",a[2]),l&32&&z(t,"width",a[5]),l&32&&z(t,"height",a[5])},i(a){s||(C(r),s=!0)},o(a){D(r),s=!1},d(a){a&&M(t),r&&r.d(),i[7](null),i[8](null)}}}function vA(i,t,e){let n,{playing:o}=t,{shadow:s=!1}=t,{style:r=null}=t,{width:a="100%"}=t,l,c;function u(d){Ve[d?"unshift":"push"](()=>{c=d,e(4,c)})}function h(d){Ve[d?"unshift":"push"](()=>{l=d,e(3,l)})}return i.$$set=d=>{"playing"in d&&e(0,o=d.playing),"shadow"in d&&e(1,s=d.shadow),"style"in d&&e(2,r=d.style),"width"in d&&e(6,a=d.width)},i.$$.update=()=>{i.$$.dirty&64&&e(5,n=typeof a=="number"?ot(a):a)},[o,s,r,l,c,n,a,u,h]}class Jl extends oe{constructor(t){super(),ie(this,t,vA,gA,ne,{playing:0,shadow:1,style:2,width:6},pA)}}function AA(i){le(i,"svelte-1s6gk4a",".audio-tag.svelte-1s6gk4a{position:absolute;left:0;top:0;width:0;height:0;overflow:visible}.audio-icon__wrapper.svelte-1s6gk4a{position:relative;vertical-align:top;width:100%;height:100%}.content.svelte-1s6gk4a{width:-moz-max-content;width:max-content;height:3.375rem;padding:2.25rem 0.25rem 0 1rem;position:absolute;left:0;bottom:0.125rem;overflow:hidden;box-sizing:border-box;font-size:0;white-space:nowrap;font-weight:600}.wrapper.svelte-1s6gk4a{position:relative;width:100%;height:100%}.audio-icon.svelte-1s6gk4a{pointer-events:none;vertical-align:top;display:inline-block;width:1rem;height:1rem;margin-right:0.25rem;margin-top:0.0625rem}.audio.svelte-1s6gk4a{position:relative;width:100%;height:100%}")}function oa(i){var A,v;let t,e,n,o,s,r,a,l,c,u,h,d,m,g;e=new st({props:{visible:i[6],left:i[3]/2+"px",bottom:12,width:2,blurRadius:120,spreadRadius:60}});let p=i[6]&&sa(i);return c=new Wl({props:{visible:i[6],textUnfolded:i[1],content:i[5]}}),h=new Lo({props:{unfolded:i[6],length:i[3],outDelay:i[4]+20*Math.min((v=(A=i[5])==null?void 0:A.length)!=null?v:10,15),useLinearColor:!0}}),{c(){t=B("div"),K(e.$$.fragment),n=$(),o=B("div"),s=B("div"),r=B("div"),p&&p.c(),a=$(),l=B("div"),K(c.$$.fragment),u=$(),K(h.$$.fragment),y(r,"class","audio-icon svelte-1s6gk4a"),z(l,"display","inline-block"),y(s,"class","wrapper svelte-1s6gk4a"),y(o,"class","content svelte-1s6gk4a"),y(t,"class","audio-tag svelte-1s6gk4a"),q(t,"unfolded",i[6])},m(b,w){T(b,t,w),J(e,t,null),V(t,n),V(t,o),V(o,s),V(s,r),p&&p.m(r,null),V(s,a),V(s,l),J(c,l,null),V(t,u),J(h,t,null),d=!0,m||(g=[me(l,"click",i[7]),ct(ln.call(null,l)),me(l,"clientWidth",i[12])],m=!0)},p(b,w){var L,x;const k={};w&64&&(k.visible=b[6]),w&8&&(k.left=b[3]/2+"px"),e.$set(k),b[6]?p?(p.p(b,w),w&64&&C(p,1)):(p=sa(b),p.c(),C(p,1),p.m(r,null)):p&&(se(),D(p,1,1,()=>{p=null}),re());const I={};w&64&&(I.visible=b[6]),w&2&&(I.textUnfolded=b[1]),w&32&&(I.content=b[5]),c.$set(I);const P={};w&64&&(P.unfolded=b[6]),w&8&&(P.length=b[3]),w&48&&(P.outDelay=b[4]+20*Math.min((x=(L=b[5])==null?void 0:L.length)!=null?x:10,15)),h.$set(P),(!d||w&64)&&q(t,"unfolded",b[6])},i(b){d||(C(e.$$.fragment,b),C(p),C(c.$$.fragment,b),C(h.$$.fragment,b),d=!0)},o(b){D(e.$$.fragment,b),D(p),D(c.$$.fragment,b),D(h.$$.fragment,b),d=!1},d(b){b&&M(t),Z(e),p&&p.d(),Z(c),Z(h),m=!1,He(g)}}}function sa(i){let t,e,n,o,s,r,a;return e=new st({props:{center:!0,blurRadius:15,spreadRadius:6}}),o=new ql({props:{enable:i[6],url:i[0].data.audioUrl,hooksInfo:{tag:i[0]},$$slots:{default:[bA]},$$scope:{ctx:i}}}),o.$on("play",i[8]),o.$on("pause",i[9]),o.$on("error",i[10]),o.$on("audioRef",i[11]),{c(){t=B("div"),K(e.$$.fragment),n=$(),K(o.$$.fragment),y(t,"class","audio svelte-1s6gk4a")},m(l,c){T(l,t,c),J(e,t,null),V(t,n),J(o,t,null),a=!0},p(l,c){i=l;const u={};c&64&&(u.enable=i[6]),c&1&&(u.url=i[0].data.audioUrl),c&1&&(u.hooksInfo={tag:i[0]}),c&8196&&(u.$$scope={dirty:c,ctx:i}),o.$set(u)},i(l){a||(C(e.$$.fragment,l),C(o.$$.fragment,l),l&&Re(()=>{r&&r.end(1),s=zt(t,St,{duration:1e3,delay:0,easing:Ut}),s.start()}),a=!0)},o(l){var c,u;D(e.$$.fragment,l),D(o.$$.fragment,l),s&&s.invalidate(),l&&(r=an(t,St,{duration:1e3,delay:20*Math.min((u=(c=i[5])==null?void 0:c.length)!=null?u:10,15),easing:Ut})),a=!1},d(l){l&&M(t),Z(e),Z(o),l&&r&&r.end()}}}function bA(i){let t,e,n;return e=new Jl({props:{playing:i[2]}}),{c(){t=B("div"),K(e.$$.fragment),y(t,"class","audio-icon__wrapper svelte-1s6gk4a")},m(o,s){T(o,t,s),J(e,t,null),n=!0},p(o,s){const r={};s&4&&(r.playing=o[2]),e.$set(r)},i(o){n||(C(e.$$.fragment,o),n=!0)},o(o){D(e.$$.fragment,o),n=!1},d(o){o&&M(t),Z(e)}}}function yA(i){let t,e,n=i[0].state&&oa(i);return{c(){n&&n.c(),t=pe()},m(o,s){n&&n.m(o,s),T(o,t,s),e=!0},p(o,[s]){o[0].state?n?(n.p(o,s),s&1&&C(n,1)):(n=oa(o),n.c(),C(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(C(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function wA(i,t,e){let n,o,s,{tag:r}=t,a=!1,l=!1,c;function u(){e(1,a=!a)}const h=()=>{e(2,l=!0)},d=()=>{e(2,l=!1)},m=()=>{e(2,l=!1)};function g(A){rn.call(this,i,A)}const p=A=>{e(3,c=A.detail)};return i.$$set=A=>{"tag"in A&&e(0,r=A.tag)},i.$$.update=()=>{var A,v,b;i.$$.dirty&1&&e(6,n=!!((A=r.state)!=null&&A.unfolded)),i.$$.dirty&1&&e(5,o=(b=(v=r.data.title)!=null?v:r.data.text)!=null?b:""),i.$$.dirty&2&&e(4,s=a?450:0)},[r,a,l,c,s,o,n,u,h,d,m,g,p]}class EA extends oe{constructor(t){super(),ie(this,t,wA,yA,ne,{tag:0},AA)}}function PA(i){le(i,"svelte-58hfjf",".audio-tag__wrapper.svelte-58hfjf{position:absolute;left:50%;top:50%;transform:translate(-50%, -50%)}.audio-tag.svelte-58hfjf{position:relative;width:-moz-max-content;width:max-content;height:-moz-max-content;height:max-content;padding:0.1875rem;padding-right:0.625rem;border-radius:624999.9375rem;border:0.03125rem solid rgba(255, 255, 255, 0.2)}.audio__inner.svelte-58hfjf{display:flex;align-items:center;justify-content:center;width:100%;height:100%}.text.svelte-58hfjf{font-weight:bold;font-size:0.75rem;margin-left:0.25rem}.audio-icon__wrapper.svelte-58hfjf{position:relative;vertical-align:top;pointer-events:none;width:1.375rem;height:1.375rem}")}function ra(i){let t,e,n,o;return n=new ql({props:{style:"width: max-content; height: max-content;",enable:i[0].state.visible,url:i[0].data.audioUrl,hooksInfo:{tag:i[0]},$$slots:{default:[IA]},$$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=B("div"),e=B("div"),K(n.$$.fragment),y(e,"class","audio-tag svelte-58hfjf"),z(e,"background-color",i[4].bgColor),z(e,"color",i[4].fontColor),y(t,"class","audio-tag__wrapper svelte-58hfjf")},m(s,r){T(s,t,r),V(t,e),J(n,e,null),o=!0},p(s,r){const a={};r&1&&(a.enable=s[0].state.visible),r&1&&(a.url=s[0].data.audioUrl),r&1&&(a.hooksInfo={tag:s[0]}),r&8232&&(a.$$scope={dirty:r,ctx:s}),n.$set(a),r&16&&z(e,"background-color",s[4].bgColor),r&16&&z(e,"color",s[4].fontColor)},i(s){o||(C(n.$$.fragment,s),o=!0)},o(s){D(n.$$.fragment,s),o=!1},d(s){s&&M(t),Z(n)}}}function CA(i){let t;return{c(){t=xe(i[5])},m(e,n){T(e,t,n)},p(e,n){n&32&&Se(t,e[5])},d(e){e&&M(t)}}}function IA(i){let t,e,n,o,s,r,a;return n=new Jl({props:{playing:i[3]}}),r=new Mo({props:{maxWidth:72,$$slots:{default:[CA]},$$scope:{ctx:i}}}),{c(){t=B("div"),e=B("div"),K(n.$$.fragment),o=$(),s=B("div"),K(r.$$.fragment),y(e,"class","audio-icon__wrapper svelte-58hfjf"),y(s,"class","text svelte-58hfjf"),y(t,"class","audio__inner svelte-58hfjf")},m(l,c){T(l,t,c),V(t,e),J(n,e,null),V(t,o),V(t,s),J(r,s,null),a=!0},p(l,c){const u={};c&8&&(u.playing=l[3]),n.$set(u);const h={};c&8224&&(h.$$scope={dirty:c,ctx:l}),r.$set(h)},i(l){a||(C(n.$$.fragment,l),C(r.$$.fragment,l),a=!0)},o(l){D(n.$$.fragment,l),D(r.$$.fragment,l),a=!1},d(l){l&&M(t),Z(n),Z(r)}}}function kA(i){let t,e,n=i[0].state&&ra(i);return{c(){n&&n.c(),t=pe()},m(o,s){n&&n.m(o,s),T(o,t,s),e=!0},p(o,[s]){o[0].state?n?(n.p(o,s),s&1&&C(n,1)):(n=ra(o),n.c(),C(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(C(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function xA(i,t,e){let n,o,{tag:s}=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 u=()=>{e(3,c=!0)},h=()=>{e(3,c=!1)},d=()=>{e(3,c=!1)},m=A=>{e(1,a=A.detail)},g=A=>{e(2,l=A.detail)};function p(A){rn.call(this,i,A)}return i.$$set=A=>{"tag"in A&&e(0,s=A.tag)},i.$$.update=()=>{var A,v,b;i.$$.dirty&1&&e(5,n=(v=(A=s.data.title)!=null?A:s.data.text)!=null?v:""),i.$$.dirty&1&&e(4,o=(b=r[s.data.theme||"light"])!=null?b:r.light)},[s,a,l,c,o,n,u,h,d,m,g,p]}class DA extends oe{constructor(t){super(),ie(this,t,xA,kA,ne,{tag:0},PA)}}function LA(i){let t,e;return t=new DA({props:{tag:i[0]}}),t.$on("audioRef",i[2]),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.tag=n[0]),t.$set(s)},i(n){e||(C(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function MA(i){let t,e;return t=new EA({props:{tag:i[0]}}),t.$on("audioRef",i[2]),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.tag=n[0]),t.$set(s)},i(n){e||(C(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function SA(i){let t,e,n,o;const s=[MA,LA],r=[];function a(l,c){return l[1]==="line"?0:l[1]==="plane"?1:-1}return~(t=a(i))&&(e=r[t]=s[t](i)),{c(){e&&e.c(),n=pe()},m(l,c){~t&&r[t].m(l,c),T(l,n,c),o=!0},p(l,[c]){let u=t;t=a(l),t===u?~t&&r[t].p(l,c):(e&&(se(),D(r[u],1,1,()=>{r[u]=null}),re()),~t?(e=r[t],e?e.p(l,c):(e=r[t]=s[t](l),e.c()),C(e,1),e.m(n.parentNode,n)):e=null)},i(l){o||(C(e),o=!0)},o(l){D(e),o=!1},d(l){~t&&r[t].d(l),l&&M(n)}}}function TA(i,t,e){let n,{tag:o}=t,s;function r(a){s=a.detail}return o.play=()=>s.play(),o.pause=()=>s.pause(),i.$$set=a=>{"tag"in a&&e(0,o=a.tag)},i.$$.update=()=>{var a;i.$$.dirty&1&&e(1,n=(a=o.data.appearance)!=null?a:"line")},[o,n,r]}class zA extends oe{constructor(t){super(),ie(this,t,TA,SA,ne,{tag:0})}}function BA(i){le(i,"svelte-10cw0el",".media-wrapper.svelte-10cw0el{position:absolute;width:100%;height:100%}")}function aa(i){var o;let t,e,n;return e=new Ul({props:{mediaItemConfig:{canPlay:!0,playButtonSizeIfNeed:"large",playButtonIfNeed:(o=i[4])!=null?o:"withText",disableVideoIfHavePoster:!1,objectFit:i[2]},unfolded:i[6],mediaData:i[5],enableCarousel:i[1],autoplayConfig:i[3],tag:i[0],inDelay:500,duration:500}}),{c(){t=B("div"),K(e.$$.fragment),y(t,"class","media-wrapper svelte-10cw0el")},m(s,r){T(s,t,r),J(e,t,null),n=!0},p(s,r){var l;const a={};r&20&&(a.mediaItemConfig={canPlay:!0,playButtonSizeIfNeed:"large",playButtonIfNeed:(l=s[4])!=null?l:"withText",disableVideoIfHavePoster:!1,objectFit:s[2]}),r&64&&(a.unfolded=s[6]),r&32&&(a.mediaData=s[5]),r&2&&(a.enableCarousel=s[1]),r&8&&(a.autoplayConfig=s[3]),r&1&&(a.tag=s[0]),e.$set(a)},i(s){n||(C(e.$$.fragment,s),n=!0)},o(s){D(e.$$.fragment,s),n=!1},d(s){s&&M(t),Z(e)}}}function VA(i){let t,e,n=i[0].state&&i[5]&&aa(i);return{c(){n&&n.c(),t=pe()},m(o,s){n&&n.m(o,s),T(o,t,s),e=!0},p(o,[s]){o[0].state&&o[5]?n?(n.p(o,s),s&33&&C(n,1)):(n=aa(o),n.c(),C(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(C(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function jA(i,t,e){let n,o,s,r,a,l,{tag:c}=t;return i.$$set=u=>{"tag"in u&&e(0,c=u.tag)},i.$$.update=()=>{var u,h;i.$$.dirty&1&&e(6,n=c.state?c.state.unfolded:!1),i.$$.dirty&1&&e(5,o=c.data.mediaData),i.$$.dirty&1&&e(1,s=c.data.enableCarousel),i.$$.dirty&1&&e(4,r=c.data.playIcon),i.$$.dirty&3&&e(3,a=(u=c.data.autoplayConfig)!=null?u:{autoplay:s!=null?s:!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,s,l,a,r,o,n]}class OA extends oe{constructor(t){super(),ie(this,t,jA,VA,ne,{tag:0},BA)}}function Zl(i){return H(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 RA(i){return H(this,null,function*(){const{url:t,ratio:e=3}=i;i.ratio||console.warn("Tag icon ratio is not set, default is 3");const{width:n,height:o}=yield Zl(t);return fe(Q({},i),{width:n/e,height:o/e})})}function QA(i){return H(this,null,function*(){const{steps:t,url:e,ratio:n=3,fps:o=24}=i;if(!t)throw new Error("KeyframeIcon requires steps");const{width:s,height:r}=yield Zl(e),a=s/n,l=r/n,c=a/t,u=l,h=1/o*t+"s";return fe(Q({},i),{width:c,height:u,duration:h})})}function FA(i){le(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 la(i){i[1]=i[19].width}function ca(i){i[1]=i[19].width,i[16]=i[19].height,i[17]=i[19].steps,i[18]=i[19].duration}function ua(i){let t,e,n,o=i[0]&&da();function s(l,c){return l[8]?GA:HA}let r=s(i),a=r(i);return{c(){t=B("div"),o&&o.c(),e=$(),a.c(),y(t,"class","icon"),z(t,"width",i[1])},m(l,c){T(l,t,c),o&&o.m(t,null),V(t,e),a.m(t,null),n=!0},p(l,c){l[0]?o?c&1&&C(o,1):(o=da(),o.c(),C(o,1),o.m(t,e)):o&&(se(),D(o,1,1,()=>{o=null}),re()),r===(r=s(l))&&a?a.p(l,c):(a.d(1),a=r(l),a&&(a.c(),a.m(t,null))),c&2&&z(t,"width",l[1])},i(l){n||(C(o),n=!0)},o(l){D(o),n=!1},d(l){l&&M(t),o&&o.d(),a.d()}}}function da(i){let t,e;return t=new st({props:{center:!0,blurRadius:24,spreadRadius:16}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},i(n){e||(C(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function HA(i){let t,e,n={ctx:i,current:null,token:null,hasCatch:!1,pending:NA,then:_A,catch:WA,value:19};return ai(e=i[11](Le({url:i[7],ratio:i[5]})),n),{c(){t=pe(),n.block.c()},m(o,s){T(o,t,s),n.block.m(o,n.anchor=s),n.mount=()=>t.parentNode,n.anchor=t},p(o,s){i=o,n.ctx=i,s&160&&e!==(e=i[11](Le({url:i[7],ratio:i[5]})))&&ai(e,n)||Na(n,i,s)},d(o){o&&M(t),n.block.d(o),n.token=null,n=null}}}function GA(i){let t,e,n={ctx:i,current:null,token:null,hasCatch:!1,pending:UA,then:YA,catch:XA,value:19};return ai(e=i[10](Le({url:i[7],steps:i[2],fps:i[6],ratio:i[5]})),n),{c(){t=pe(),n.block.c()},m(o,s){T(o,t,s),n.block.m(o,n.anchor=s),n.mount=()=>t.parentNode,n.anchor=t},p(o,s){i=o,n.ctx=i,s&228&&e!==(e=i[10](Le({url:i[7],steps:i[2],fps:i[6],ratio:i[5]})))&&ai(e,n)||Na(n,i,s)},d(o){o&&M(t),n.block.d(o),n.token=null,n=null}}}function WA(i){return{c:X,m:X,p:X,d:X}}function _A(i){la(i);let t,e;return{c(){t=B("img"),y(t,"alt","tag-icon"),y(t,"class","icon-image svelte-316sq3"),Xe(t.src,e=i[7])||y(t,"src",e),z(t,"width",ot(Gt({originWidth:i[1],scale:i[4],wantedWidth:i[3]}).width))},m(n,o){T(n,t,o)},p(n,o){la(n),o&128&&!Xe(t.src,e=n[7])&&y(t,"src",e),o&184&&z(t,"width",ot(Gt({originWidth:n[1],scale:n[4],wantedWidth:n[3]}).width))},d(n){n&&M(t)}}}function NA(i){return{c:X,m:X,p:X,d:X}}function XA(i){return{c:X,m:X,p:X,d:X}}function YA(i){ca(i);let t,e=`url(${i[7]})`,n=`steps(${i[17]}, jump-none)`;return{c(){t=B("div"),y(t,"class","icon-keyframe svelte-316sq3"),z(t,"width",ot(Gt({originWidth:i[1],originHeight:i[16],scale:i[4],wantedWidth:i[3]}).width)),z(t,"height",ot(Gt({originWidth:i[1],originHeight:i[16],scale:i[4],wantedWidth:i[3]}).height)),z(t,"background-image",e),z(t,"animation-duration",i[18]),z(t,"animation-timing-function",n)},m(o,s){T(o,t,s)},p(o,s){ca(o),s&252&&z(t,"width",ot(Gt({originWidth:o[1],originHeight:o[16],scale:o[4],wantedWidth:o[3]}).width)),s&252&&z(t,"height",ot(Gt({originWidth:o[1],originHeight:o[16],scale:o[4],wantedWidth:o[3]}).height)),s&128&&e!==(e=`url(${o[7]})`)&&z(t,"background-image",e),s&228&&z(t,"animation-duration",o[18]),s&228&&n!==(n=`steps(${o[17]}, jump-none)`)&&z(t,"animation-timing-function",n)},d(o){o&&M(t)}}}function UA(i){return{c:X,m:X,p:X,d:X}}function qA(i){let t,e,n=i[9]&&ua(i);return{c(){n&&n.c(),t=pe()},m(o,s){n&&n.m(o,s),T(o,t,s),e=!0},p(o,[s]){o[9]?n?(n.p(o,s),s&512&&C(n,1)):(n=ua(o),n.c(),C(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(C(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function Gt(i){const{originWidth:t,originHeight:e,scale:n=1,wantedWidth:o}=i,s=(o!=null?o:t)*n,r=typeof e=="number"?s*(e/t):void 0;return fe(Q({},i),{width:s,height:r})}function JA(i,t,e){let n,o,s,r,a,l,c,u,h,{width:d=null}=t,{icon:m=null}=t,{shadow:g=!1}=t;const p=Ai();function A(w){return H(this,null,function*(){const k=yield QA(w);return p("iconLoaded",k),k})}function v(w){return H(this,null,function*(){if(typeof h=="number")return fe(Q({},w),{width:h});const k=yield RA(w);return p("iconLoaded",k),k})}function b(){u||p("iconLoaded")}return Ze(()=>{b()}),i.$$set=w=>{"width"in w&&e(1,d=w.width),"icon"in w&&e(12,m=w.icon),"shadow"in w&&e(0,g=w.shadow)},i.$$.update=()=>{var w,k;i.$$.dirty&4096&&e(7,n=m==null?void 0:m.url),i.$$.dirty&4096&&e(2,o=(w=m==null?void 0:m.steps)!=null?w:1),i.$$.dirty&4096&&e(6,s=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=Le({url:n,steps:o,fps:s,ratio:r,scale:a,width:l})),i.$$.dirty&4&&e(8,u=o>1),i.$$.dirty&2&&(h=d)},b(),[g,d,o,l,a,r,s,n,u,c,A,v,m]}class Kl extends oe{constructor(t){super(),ie(this,t,JA,qA,ne,{width:1,icon:12,shadow:0},FA)}}function ZA(i){le(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 ha(i){let t,e,n,o,s,r;return e=new st({props:{outDelay:0,inDelay:0,center:!0,width:"80%",blurRadius:40,spreadRadius:16,opacity:.08}}),{c(){t=B("div"),K(e.$$.fragment),n=$(),o=B("div"),s=xe(i[1]),y(o,"class","text svelte-e58ijk"),y(t,"class","text-wrapper svelte-e58ijk")},m(a,l){T(a,t,l),J(e,t,null),V(t,n),V(t,o),V(o,s),r=!0},p(a,l){(!r||l&2)&&Se(s,a[1])},i(a){r||(C(e.$$.fragment,a),r=!0)},o(a){D(e.$$.fragment,a),r=!1},d(a){a&&M(t),Z(e)}}}function KA(i){let t,e,n,o;e=new Kl({props:{icon:i[0],shadow:!0}}),e.$on("iconLoaded",i[4]);let s=i[1]&&i[2]&&ha(i);return{c(){t=B("div"),K(e.$$.fragment),n=$(),s&&s.c(),y(t,"class","wrapper svelte-e58ijk")},m(r,a){T(r,t,a),J(e,t,null),V(t,n),s&&s.m(t,null),o=!0},p(r,[a]){const l={};a&1&&(l.icon=r[0]),e.$set(l),r[1]&&r[2]?s?(s.p(r,a),a&6&&C(s,1)):(s=ha(r),s.c(),C(s,1),s.m(t,null)):s&&(se(),D(s,1,1,()=>{s=null}),re())},i(r){o||(C(e.$$.fragment,r),C(s),o=!0)},o(r){D(e.$$.fragment,r),D(s),o=!1},d(r){r&&M(t),Z(e),s&&s.d()}}}function $A(i,t,e){let n,o,s,{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,u;i.$$.dirty&8&&e(1,o=(l=r.data.title)!=null?l:r.data.text),i.$$.dirty&8&&e(0,s=(u=r.data.icon)!=null?u:(c=r.style)==null?void 0:c.point)},e(2,n=!1),[s,o,n,r,a]}class eb extends oe{constructor(t){super(),ie(this,t,$A,KA,ne,{tag:3},ZA)}}function tb(i){le(i,"svelte-kzl2aj",".customElement__container.svelte-kzl2aj{position:relative}")}function fa(i){let t,e=i[0].element+"",n;return{c(){t=new ii(!1),n=pe(),t.a=n},m(o,s){t.m(e,o,s),T(o,n,s)},p(o,s){s&1&&e!==(e=o[0].element+"")&&t.p(e)},d(o){o&&M(n),o&&t.d()}}}function nb(i){let t,e=typeof i[0].element=="string"&&fa(i);return{c(){t=B("div"),e&&e.c(),y(t,"class","customElement__container svelte-kzl2aj")},m(n,o){T(n,t,o),e&&e.m(t,null),i[2](t)},p(n,[o]){typeof n[0].element=="string"?e?e.p(n,o):(e=fa(n),e.c(),e.m(t,null)):e&&(e.d(1),e=null)},i:X,o:X,d(n){n&&M(t),e&&e.d(),i[2](null)}}}function ib(i,t,e){let{tag:n}=t,o,s;Ze(()=>{if(o){if(n.element instanceof Element){const a=n.element;o.appendChild(a),s=()=>a.remove()}else if(typeof n.element=="function"){const a=n.element;s=a(o)}}}),Ct(()=>{s==null||s()});function r(a){Ve[a?"unshift":"push"](()=>{o=a,e(1,o)})}return i.$$set=a=>{"tag"in a&&e(0,n=a.tag)},[n,o,r]}class ob extends oe{constructor(t){super(),ie(this,t,ib,nb,ne,{tag:0},tb)}}function sb(i){le(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 rb(i){let t,e;return{c(){t=B("div"),y(t,"data-info","tag content is keep folded"),y(t,"data-id",e=i[1].id)},m(n,o){T(n,t,o)},p(n,o){o&2&&e!==(e=n[1].id)&&y(t,"data-id",e)},i:X,o:X,d(n){n&&M(t)}}}function ab(i){let t,e,n,o,s,r,a,l,c,u;const h=[mb,fb,hb,db,ub,cb],d=[];function m(g,p){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~(o=m(i))&&(s=d[o]=h[o](i)),{c(){var g;t=B("div"),e=B("div"),n=B("div"),s&&s.c(),y(n,"class","content svelte-1r4fqvg"),q(n,"unfolded",(g=i[1].state)==null?void 0:g.unfolded),y(e,"class","content__wrapper svelte-1r4fqvg"),y(t,"class",r=Ie(Oe.default("content__container",i[1].className))+" svelte-1r4fqvg"),y(t,"data-id",a=i[1].id),q(t,"disable",i[1].enabled===!1),q(t,"hide",i[4]),q(t,"withAnimation",i[0]),q(t,"unClickable",i[1].mergedConfig.clickable===!1),z(t,"width",i[1].stickType==="Plane"||i[1].contentType==="MediaModel"?"100%":0),z(t,"height",i[1].stickType==="Plane"||i[1].contentType==="MediaModel"?"100%":0)},m(g,p){T(g,t,p),V(t,e),V(e,n),~o&&d[o].m(n,null),l=!0,c||(u=me(t,"click",Va(i[14])),c=!0)},p(g,p){var v;let A=o;o=m(g),o===A?~o&&d[o].p(g,p):(s&&(se(),D(d[A],1,1,()=>{d[A]=null}),re()),~o?(s=d[o],s?s.p(g,p):(s=d[o]=h[o](g),s.c()),C(s,1),s.m(n,null)):s=null),(!l||p&2)&&q(n,"unfolded",(v=g[1].state)==null?void 0:v.unfolded),(!l||p&2&&r!==(r=Ie(Oe.default("content__container",g[1].className))+" svelte-1r4fqvg"))&&y(t,"class",r),(!l||p&2&&a!==(a=g[1].id))&&y(t,"data-id",a),(!l||p&2)&&q(t,"disable",g[1].enabled===!1),(!l||p&18)&&q(t,"hide",g[4]),(!l||p&3)&&q(t,"withAnimation",g[0]),(!l||p&2)&&q(t,"unClickable",g[1].mergedConfig.clickable===!1),p&2&&z(t,"width",g[1].stickType==="Plane"||g[1].contentType==="MediaModel"?"100%":0),p&2&&z(t,"height",g[1].stickType==="Plane"||g[1].contentType==="MediaModel"?"100%":0)},i(g){l||(C(s),l=!0)},o(g){D(s),l=!1},d(g){g&&M(t),~o&&d[o].d(),c=!1,u()}}}function lb(i){let t,e,n,o,s,r,a;return e=new ob({props:{tag:Le(i[1])}}),{c(){t=B("div"),K(e.$$.fragment),y(t,"class",n=Ie(Oe.default("content__container",i[1].className))+" svelte-1r4fqvg"),y(t,"data-id",o=i[1].id),q(t,"custom-tag-disable",i[1].enabled===!1),q(t,"custom-tag-hide",i[4])},m(l,c){T(l,t,c),J(e,t,null),s=!0,r||(a=me(t,"click",i[13]),r=!0)},p(l,c){const u={};c&2&&(u.tag=Le(l[1])),e.$set(u),(!s||c&2&&n!==(n=Ie(Oe.default("content__container",l[1].className))+" svelte-1r4fqvg"))&&y(t,"class",n),(!s||c&2&&o!==(o=l[1].id))&&y(t,"data-id",o),(!s||c&2)&&q(t,"custom-tag-disable",l[1].enabled===!1),(!s||c&18)&&q(t,"custom-tag-hide",l[4])},i(l){s||(C(e.$$.fragment,l),s=!0)},o(l){D(e.$$.fragment,l),s=!1},d(l){l&&M(t),Z(e),r=!1,a()}}}function cb(i){let t,e;return t=new OA({props:{tag:Le(i[1])}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=Le(n[1])),t.$set(s)},i(n){e||(C(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function ub(i){let t,e;return t=new eb({props:{tag:Le(i[1])}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=Le(n[1])),t.$set(s)},i(n){e||(C(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function db(i){let t,e;return t=new uA({props:{tag:Le(i[1])}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=Le(n[1])),t.$set(s)},i(n){e||(C(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function hb(i){let t,e;return t=new zA({props:{tag:Le(i[1])}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=Le(n[1])),t.$set(s)},i(n){e||(C(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function fb(i){let t,e;return t=new rA({props:{tag:Le(i[1])}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=Le(n[1])),t.$set(s)},i(n){e||(C(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function mb(i){let t,e;return t=new I0({props:{tag:Le(i[1])}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=Le(n[1])),t.$set(s)},i(n){e||(C(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function pb(i){let t,e,n,o;const s=[lb,ab,rb],r=[];function a(l,c){return l[1].element?0:l[3]?1:2}return t=a(i),e=r[t]=s[t](i),{c(){e.c(),n=pe()},m(l,c){r[t].m(l,c),T(l,n,c),o=!0},p(l,[c]){let u=t;t=a(l),t===u?r[t].p(l,c):(se(),D(r[u],1,1,()=>{r[u]=null}),re(),e=r[t],e?e.p(l,c):(e=r[t]=s[t](l),e.c()),C(e,1),e.m(n.parentNode,n))},i(l){o||(C(e),o=!0)},o(l){D(e),o=!1},d(l){r[t].d(l),l&&M(n)}}}function gb(i,t,e){let n,o,s,r,a,l,{withAnimation:c=!1}=t,{tag:u}=t,{hooks:h}=t,{state:d}=t,{mediaStore:m}=t,{temporaryState:g}=t;eo("hooks",h),eo("mediaStore",m);let p,A;function v(I){I?h.emit("exposure",{id:r,type:"start"}):h.emit("exposure",{id:r,type:"end"})}function b(I,P,L){var x,F;return!(!P.visible||!P.enabled||!L.visible||!((x=I.state)!=null&&x.visible)||((F=I.temporaryState)==null?void 0:F.visible)===!1||We(I)&&!I.mediaVisible)}const w=I=>h.emit("click",{event:I,target:"TagContent",tag:u}),k=I=>h.emit("click",{event:I,target:"TagContent",tag:u});return i.$$set=I=>{"withAnimation"in I&&e(0,c=I.withAnimation),"tag"in I&&e(1,u=I.tag),"hooks"in I&&e(2,h=I.hooks),"state"in I&&e(5,d=I.state),"mediaStore"in I&&e(6,m=I.mediaStore),"temporaryState"in I&&e(7,g=I.temporaryState)},i.$$.update=()=>{var I,P,L,x,F,N,R,S,O,G,W;i.$$.dirty&2&&e(11,n=(I=u.state)==null?void 0:I.unfolded),i.$$.dirty&2&&e(10,o=(P=u.state)==null?void 0:P.visible),i.$$.dirty&162&&e(12,s=d.visible&&g.visible&&((L=u.state)==null?void 0:L.visible)),i.$$.dirty&2&&(r=u.id),i.$$.dirty&162&&e(4,a=!b(u,d,g)),i.$$.dirty&4096&&v(s),i.$$.dirty&3842&&u.hooks&&(n!==void 0&&n!==A&&(e(9,A=n),n?(F=(x=u.hooks).emit)==null||F.call(x,"unfolded"):(R=u==null?void 0:(N=u.hooks).emit)==null||R.call(N,"folded")),o!==void 0&&o!==p&&(e(8,p=o),o?(O=(S=u.hooks).emit)==null||O.call(S,"show"):(W=(G=u.hooks).emit)==null||W.call(G,"hide"))),i.$$.dirty&2&&e(3,l=(()=>!(typeof u.mergedConfig.unfoldedConfig=="object"&&u.mergedConfig.unfoldedConfig.keep==="folded"))())},[c,u,h,l,a,d,m,g,p,A,o,n,s,w,k]}class $l extends oe{constructor(t){super(),ie(this,t,gb,pb,ne,{withAnimation:0,tag:1,hooks:2,state:5,mediaStore:6,temporaryState:7},sb)}}function vb(i){le(i,"svelte-1jkrwn7",'@charset "UTF-8";.tag-point-click-helper.svelte-1jkrwn7.svelte-1jkrwn7{position:absolute;pointer-events:auto;cursor:pointer;width:calc(100% + 0.75rem);height:calc(100% + 0.75rem);left:50%;top:50%;transform:translate(-50%, -50%)}.tag-point-wrapper.svelte-1jkrwn7.svelte-1jkrwn7{pointer-events:none;position:absolute;left:50%;top:50%;transform:translate(-50%, -50%);z-index:-1}.tag-folded-point.svelte-1jkrwn7.svelte-1jkrwn7,.tag-unfolded-point.svelte-1jkrwn7.svelte-1jkrwn7{transition:all 0.5s}.tag-point-wrapper.svelte-1jkrwn7 .tag-unfolded-point.svelte-1jkrwn7{display:flex;justify-content:center;align-items:center;position:absolute;width:100%;height:100%;border-radius:50%}.tag-point-wrapper.svelte-1jkrwn7 .tag-unfolded-point.svelte-1jkrwn7:after{content:"";position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);width:0.3125rem;height:0.3125rem;border-radius:50%;background-color:white}.tag-point-wrapper.svelte-1jkrwn7 .tag-unfolded-point.svelte-1jkrwn7:before{content:"";position:absolute;width:0.875rem;height:0.875rem;border-radius:50%;background-color:rgba(0, 0, 0, 0.2)}.tag-point-wrapper.folded.svelte-1jkrwn7 .tag-folded-point.svelte-1jkrwn7{opacity:1;scale:1}.tag-point-wrapper.folded.svelte-1jkrwn7 .tag-unfolded-point.svelte-1jkrwn7{opacity:0;scale:1}.tag-point-wrapper.unfolded.svelte-1jkrwn7 .tag-folded-point.svelte-1jkrwn7{opacity:0;scale:0.2}.tag-point-wrapper.unfolded.svelte-1jkrwn7 .tag-unfolded-point.svelte-1jkrwn7{opacity:1;scale:1}')}function Ab(i){let t,e,n,o,s,r,a,l,c,u,h,d;return o=new st({props:{center:!0,blurRadius:15,spreadRadius:5,opacity:.3}}),c=new Kl({props:{icon:i[2],width:i[1]}}),c.$on("iconLoaded",i[7]),{c(){t=B("div"),e=B("div"),n=$(),K(o.$$.fragment),s=$(),r=B("div"),a=$(),l=B("div"),K(c.$$.fragment),y(e,"class","tag-point-click-helper svelte-1jkrwn7"),y(r,"class","tag-unfolded-point svelte-1jkrwn7"),z(r,"transition-delay",(i[3]?i[5]:0)+"ms"),y(l,"class","tag-folded-point svelte-1jkrwn7"),z(l,"transition-delay",(i[3]?i[5]:0)+"ms"),y(t,"class","tag-point-wrapper svelte-1jkrwn7"),q(t,"unfolded",i[0]),q(t,"folded",i[3])},m(m,g){T(m,t,g),V(t,e),V(t,n),J(o,t,null),V(t,s),V(t,r),V(t,a),V(t,l),J(c,l,null),u=!0,h||(d=me(e,"click",i[4]),h=!0)},p(m,[g]){g&8&&z(r,"transition-delay",(m[3]?m[5]:0)+"ms");const p={};g&4&&(p.icon=m[2]),g&2&&(p.width=m[1]),c.$set(p),g&8&&z(l,"transition-delay",(m[3]?m[5]:0)+"ms"),(!u||g&1)&&q(t,"unfolded",m[0]),(!u||g&8)&&q(t,"folded",m[3])},i(m){u||(C(o.$$.fragment,m),C(c.$$.fragment,m),u=!0)},o(m){D(o.$$.fragment,m),D(c.$$.fragment,m),u=!1},d(m){m&&M(t),Z(o),Z(c),h=!1,d()}}}function bb(i,t,e){let n,o,s,r;const a=At("hooks");let{tag:l}=t,c,u=!1;const h=()=>{c!==void 0&&clearTimeout(c),u=!0,c=setTimeout(()=>{u=!1},800)},d=p=>{u||a.emit("click",{event:p,target:"TagPoint",tag:l})},m=(()=>l.contentType==="Text"&&l.data.appearance==="plane"?500:800)();function g(p){rn.call(this,i,p)}return i.$$set=p=>{"tag"in p&&e(6,l=p.tag)},i.$$.update=()=>{var p,A,v,b;i.$$.dirty&64&&e(0,n=(p=l.state)==null?void 0:p.unfolded),i.$$.dirty&1&&e(3,o=!n),i.$$.dirty&64&&e(2,s=(v=(A=l.style)==null?void 0:A.point)!=null&&v.url?(b=l.style)==null?void 0:b.point:{url:ag}),i.$$.dirty&64&&e(1,r=(()=>{var I,P,L,x;const w=(P=(I=l.style)==null?void 0:I.point)==null?void 0:P.width;if(typeof w=="number")return w;const k=(x=(L=l.style)==null?void 0:L.point)==null?void 0:x.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,s,o,d,m,l,g]}class yb extends oe{constructor(t){super(),ie(this,t,bb,Ab,ne,{tag:6},vb)}}function wb(i){le(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 Eb(i){let t;return{c(){t=B("div"),y(t,"data-info","tag content is disable")},m(e,n){T(e,t,n)},p:X,i:X,o:X,d(e){e&&M(t)}}}function Pb(i){let t,e;return t=new $l({props:{mediaStore:i[2],withAnimation:i[0],tag:Le(i[1]),hooks:i[14],state:i[3],temporaryState:i[4]}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&4&&(s.mediaStore=n[2]),o&1&&(s.withAnimation=n[0]),o&2&&(s.tag=Le(n[1])),o&8&&(s.state=n[3]),o&16&&(s.temporaryState=n[4]),t.$set(s)},i(n){e||(C(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function Cb(i){let t;return{c(){t=B("div"),y(t,"data-info","tag point is disable")},m(e,n){T(e,t,n)},p:X,i:X,o:X,d(e){e&&M(t)}}}function Ib(i){let t,e;return t=new yb({props:{tag:i[1]}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.tag=n[1]),t.$set(s)},i(n){e||(C(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function kb(i){let t,e,n,o,s,r,a,l,c,u;const h=[Pb,Eb],d=[];function m(v,b){return v[12]?0:1}n=m(i),o=d[n]=h[n](i);const g=[Ib,Cb],p=[];function A(v,b){return v[13]?0:1}return r=A(i),a=p[r]=g[r](i),{c(){t=B("div"),e=B("div"),o.c(),s=$(),a.c(),y(e,"class",l=Ie(Oe.default("wrapper",i[1].className?`${i[1].className}__wrapper`:void 0))+" svelte-pzwdws"),y(e,"data-tag-unfolded",i[8]),y(e,"data-tag-id",i[11]),y(e,"data-content-type",c=i[1].contentType),z(e,"left",i[7]),z(e,"top",i[6]),z(e,"z-index",i[5]),y(t,"class","tag svelte-pzwdws"),y(t,"data-tag-id",i[11]),q(t,"unClickable",i[1].mergedConfig.clickable===!1),q(t,"disable",i[10]),q(t,"hide",i[9]),q(t,"withAnimation",i[0])},m(v,b){T(v,t,b),V(t,e),d[n].m(e,null),V(e,s),p[r].m(e,null),u=!0},p(v,[b]){let w=n;n=m(v),n===w?d[n].p(v,b):(se(),D(d[w],1,1,()=>{d[w]=null}),re(),o=d[n],o?o.p(v,b):(o=d[n]=h[n](v),o.c()),C(o,1),o.m(e,s));let k=r;r=A(v),r===k?p[r].p(v,b):(se(),D(p[k],1,1,()=>{p[k]=null}),re(),a=p[r],a?a.p(v,b):(a=p[r]=g[r](v),a.c()),C(a,1),a.m(e,null)),(!u||b&2&&l!==(l=Ie(Oe.default("wrapper",v[1].className?`${v[1].className}__wrapper`:void 0))+" svelte-pzwdws"))&&y(e,"class",l),(!u||b&256)&&y(e,"data-tag-unfolded",v[8]),(!u||b&2048)&&y(e,"data-tag-id",v[11]),(!u||b&2&&c!==(c=v[1].contentType))&&y(e,"data-content-type",c),b&128&&z(e,"left",v[7]),b&64&&z(e,"top",v[6]),b&32&&z(e,"z-index",v[5]),(!u||b&2048)&&y(t,"data-tag-id",v[11]),(!u||b&2)&&q(t,"unClickable",v[1].mergedConfig.clickable===!1),(!u||b&1024)&&q(t,"disable",v[10]),(!u||b&512)&&q(t,"hide",v[9]),(!u||b&1)&&q(t,"withAnimation",v[0])},i(v){u||(C(o),C(a),u=!0)},o(v){D(o),D(a),u=!1},d(v){v&&M(t),d[n].d(),p[r].d()}}}function xb(i,t,e){let n,o,s,r,a,l,c,u,h,{withAnimation:d=!1}=t,{tag:m}=t,{mediaStore:g}=t,{state:p}=t,{temporaryState:A}=t;const v=At("hooks");return i.$$set=b=>{"withAnimation"in b&&e(0,d=b.withAnimation),"tag"in b&&e(1,m=b.tag),"mediaStore"in b&&e(2,g=b.mediaStore),"state"in b&&e(3,p=b.state),"temporaryState"in b&&e(4,A=b.temporaryState)},i.$$.update=()=>{var b,w,k,I,P,L,x,F;i.$$.dirty&2&&e(13,n=(()=>!(m.contentType==="Sticker"||m.contentType==="Link"||m.contentType==="VRLink"||m.contentType==="PanoLink"||m.contentType==="Audio"&&m.data.appearance==="plane"))()),i.$$.dirty&2&&e(12,o=(()=>m.stickType==="2DPoint")()),i.$$.dirty&2&&e(11,s=m.id),i.$$.dirty&2&&e(10,r=!((b=m.pointTagStyle)!=null&&b.leftPercent)||!((w=m.pointTagStyle)!=null&&w.topPercent)||m.enabled===!1||!m.state),i.$$.dirty&2&&e(9,a=!((k=m.state)!=null&&k.visible)||((I=m.temporaryState)==null?void 0:I.visible)===!1),i.$$.dirty&2&&e(8,l=(P=m.state)==null?void 0:P.unfolded),i.$$.dirty&2&&e(7,c=((L=m.pointTagStyle)==null?void 0:L.leftPercent)+"%"),i.$$.dirty&2&&e(6,u=((x=m.pointTagStyle)==null?void 0:x.topPercent)+"%"),i.$$.dirty&2&&e(5,h=(F=m.state)!=null&&F.unfolded?1:0)},[d,m,g,p,A,h,u,c,l,a,r,s,o,n,v]}class Db extends oe{constructor(t){super(),ie(this,t,xb,kb,ne,{withAnimation:0,tag:1,mediaStore:2,state:3,temporaryState:4},wb)}}function Lb(i){le(i,"svelte-uq11d5",".tag--container.svelte-uq11d5{box-sizing:border-box;position:absolute;left:0;top:0;width:100%;height:100%;pointer-events:none;opacity:1;-webkit-user-select:none;-moz-user-select:none;user-select:none;transform:translate3d(0, 0, 0)}.withAnimation.svelte-uq11d5{transition:opacity 0.3s linear}.tag--container.hide.svelte-uq11d5{opacity:0;pointer-events:none}.tag--container.hide.svelte-uq11d5 *{pointer-events:none !important}")}function ma(i,t,e){const n=i.slice();return n[6]=t[e],n}function pa(i){let t,e=[],n=new Map,o,s=i[1];const r=a=>a[6].id;for(let a=0;a<s.length;a+=1){let l=ma(i,s,a),c=r(l);n.set(c,e[a]=ga(c,l))}return{c(){t=B("div");for(let a=0;a<e.length;a+=1)e[a].c();y(t,"class","tag--container svelte-uq11d5"),q(t,"hide",!i[3].visible||!i[4].visible),q(t,"withAnimation",i[0])},m(a,l){T(a,t,l);for(let c=0;c<e.length;c+=1)e[c].m(t,null);o=!0},p(a,l){l&31&&(s=a[1],se(),e=Ke(e,l,r,1,a,s,n,t,It,ga,null,ma),re()),(!o||l&24)&&q(t,"hide",!a[3].visible||!a[4].visible),(!o||l&1)&&q(t,"withAnimation",a[0])},i(a){if(!o){for(let l=0;l<s.length;l+=1)C(e[l]);o=!0}},o(a){for(let l=0;l<e.length;l+=1)D(e[l]);o=!1},d(a){a&&M(t);for(let l=0;l<e.length;l+=1)e[l].d()}}}function ga(i,t){let e,n,o;return n=new Db({props:{state:t[3],temporaryState:t[4],withAnimation:t[0],tag:t[6],mediaStore:t[2]}}),{key:i,first:null,c(){e=pe(),K(n.$$.fragment),this.first=e},m(s,r){T(s,e,r),J(n,s,r),o=!0},p(s,r){t=s;const a={};r&8&&(a.state=t[3]),r&16&&(a.temporaryState=t[4]),r&1&&(a.withAnimation=t[0]),r&2&&(a.tag=t[6]),r&4&&(a.mediaStore=t[2]),n.$set(a)},i(s){o||(C(n.$$.fragment,s),o=!0)},o(s){D(n.$$.fragment,s),o=!1},d(s){s&&M(e),Z(n,s)}}}function Mb(i){let t,e,n=i[3].enabled&&pa(i);return{c(){n&&n.c(),t=pe()},m(o,s){n&&n.m(o,s),T(o,t,s),e=!0},p(o,[s]){o[3].enabled?n?(n.p(o,s),s&8&&C(n,1)):(n=pa(o),n.c(),C(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(C(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&M(t)}}}function Sb(i,t,e){let{withAnimation:n=!1}=t,{tags:o=[]}=t,{hooks:s}=t,{mediaStore:r}=t,{state:a}=t,{temporaryState:l}=t;return eo("hooks",s),i.$$set=c=>{"withAnimation"in c&&e(0,n=c.withAnimation),"tags"in c&&e(1,o=c.tags),"hooks"in c&&e(5,s=c.hooks),"mediaStore"in c&&e(2,r=c.mediaStore),"state"in c&&e(3,a=c.state),"temporaryState"in c&&e(4,l=c.temporaryState)},[n,o,r,a,l,s]}class Tb extends oe{constructor(t){super(),ie(this,t,Sb,Mb,ne,{withAnimation:0,tags:1,hooks:5,mediaStore:2,state:3,temporaryState:4},Lb)}}const zb=new wc.GLTFLoader;function Bb(i){return new Promise((t,e)=>{function n(s){t(s)}function o(s){e(s)}zb.load(i,n,void 0,o)})}const Vb=new Map,jb=new Map;class Ob extends Fg{constructor(e){super(e);f(this,"group",new j.Group);f(this,"imagePlaneGroup",new j.Group);f(this,"gltfObjectGroup",new j.Group);f(this,"enabledModelTagSet",new Set);f(this,"temporaryState",{visible:!0});f(this,"TagContainerSvelte");f(this,"loadModel",e=>H(this,null,function*(){var l;const n=e.data.modelUrl;if(!n)return;const o=Bb(n).then(c=>Object.assign(c.scene,{customID:e.id,isTagModel:!0}));e.model={promise:o};const s=yield o;if(((l=e.model)==null?void 0:l.promise)!==o||(e.model.object=s,!this.tags.includes(e)))return;s.visible=this.getCurrentVisibleState(e),new j.Matrix4().fromArray(e.matrix).decompose(s.position,s.quaternion,s.scale),s.updateWorldMatrix(!0,!0),s.visible=this.getVisibleByFiveMode(e);const a=this.gltfObjectGroup.children.find(c=>c.customID===e.id);if(a&&this.gltfObjectGroup.remove(a),this.getRenderType(e)==="Mesh"){if(!e.mediaPlane){const c=e.data.mediaPosition.map(qe);e.mediaPlane=new sr(e.data.mediaData[0].url,e.data.mediaPosition.map(qe),{objectFit:e.data.objectFit});const u=new j.Vector3().addVectors(c[0],c[2]).divideScalar(2);e.mediaPlane.position.copy(u),s.add(e.mediaPlane)}}else s.updateTagCss3DObjectMatrix=()=>this.updateTagCss3DObjectMatrix(e,s),s.updateTagCss3DObjectMatrix();return this.gltfObjectGroup.add(s),s}));this.group.name="PanoTagPluginModelGroup",this.gltfObjectGroup.name="PanoTagPluginGLTFObjectGroup",this.imagePlaneGroup.name="ImagePlaneGroup",this.group.add(this.gltfObjectGroup),this.group.add(this.imagePlaneGroup)}clearTags(){this.tags.forEach(e=>{var n,o;(o=(n=e.mediaPlane)==null?void 0:n.parent)==null||o.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,u,h,d;const o=n.data.mediaData[0];if(!o)return;const{url:s,type:r}=o;if(!s||(n.mediaPlane&&(n.mediaPlane.visible=(c=(l=n.state)==null?void 0:l.visible)!=null?c:!0,n.mediaPlane.visible||n.mediaPlane instanceof uo&&((u=n.data.autoplayConfig)!=null&&u.autoplayVideo||n.mediaPlane.pause())),((h=n.mediaPlane)==null?void 0:h.src)===s))return;const a=n.position.map(qe);if(n.mediaPlane&&n.mediaPlane.removeFromParent(),r==="Image")n.mediaPlane=new sr(s,a,{objectFit:n.data.objectFit}),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 uo(s,a,{videoCoverSrc:o.videoCoverUrl,playButton:n.data.playIcon,paused:!((d=n.data.autoplayConfig)!=null&&d.autoplayVideo),objectFit:n.data.objectFit,videoTextureMap:Vb,ImageTextureMap:jb});m.onVideoReady=p=>{p.addEventListener("play",()=>this.mediaStore.set({currentMediaElement:m.videoInstance}))},m.initialDomEvents(this.domEvents);const g=p=>(this.five.on("renderFrame",p),()=>this.five.off("renderFrame",p));m.initialRenderHooks(g),n.mediaPlane=m}this.imagePlaneGroup.add(n.mediaPlane)})}updateRender3DDomTag(){this.sort([...this.filterCSS3DTag]).forEach(n=>{var o,s;if(n.tag3DContentSvelte){const{svelteApp:r,css3DInstance:a,initialNormal:l,currentNormal:c}=n.tag3DContentSvelte;if(r.$set({tag:n,hooks:this.hooks,state:this.state,temporaryState:this.temporaryState}),!l.equals(c)){const u=new j.Quaternion().setFromUnitVectors(l,c);a.css3DObject.setRotationFromQuaternion(u)}return}else{if(((o=n.state)==null?void 0:o.visible)===!1)return;if(this.css3DRenderPlugin||(this.css3DRenderPlugin=$t(this.five)),n.stickType==="3DPoint"&&!n.normal)return console.error("updateRenderPlaneTag: \u4E09\u7EF4\u70B9\u6807\u7B7E\u7F3A\u5C11\u6CD5\u5411\u91CF\uFF01");const r=this.getPositions(n);if(!r)return;const a=this.getTagNormal(n);if(!a)return;const c=(s=this.getTagConfig(n).tag3DConfig)!=null?s:{};if(this.getRenderType(n)==="BehindDom"){c.mode="behind",c.container=document.createElement("div");const d="black";c.container.style.backgroundColor=d,c.container.style.border=`3px solid ${d}`,this.css3DRenderPlugin.hooks.on("render",()=>{var m;if(u.css3DObject.opacityMesh){const g=this.addObjectClickHandler(n,u.css3DObject.opacityMesh,p=>{this.hooks.emit("click",{event:p,target:"TagContent",tag:n})});(m=this.store.css3DRenderDisposer.get(n.id))==null||m.push(g)}})}const u=this.css3DRenderPlugin.create3DDomContainer(r,c);if(!u)return;this.store.css3DRenderDisposer.set(n.id,[u.dispose]);const h=new $l({target:u.container,props:{tag:n,hooks:this.hooks,state:this.state,mediaStore:this.mediaStore,temporaryState:this.temporaryState}});n.tag3DContentSvelte={svelteApp:h,domContainer:u,css3DInstance:u,initialNormal:a,currentNormal:a,dispose:()=>{h.$destroy(),u.dispose()}}}}),this.clearUnusedPanelTag()}updateRenderModelTag(){const e=o=>!this.enabledModelTagSet.has(o.customID);this.gltfObjectGroup.remove(...this.gltfObjectGroup.children.filter(e)),this.tags.filter(We).forEach(o=>{var s;(s=o.model)==null||s.promise.then(r=>{r.visible=this.getCurrentVisibleState(o)})})}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 p,A,v,b;const o=(v=(A=(p=e.mergedConfig)==null?void 0:p.tag3DConfig)==null?void 0:A.ratio)!=null?v:.00216,s=(b=e.tag3DContentSvelte)==null?void 0:b.css3DInstance.css3DObject;if(!s)return;const r=We(e)?e.data.mediaPosition:e.position;n.updateWorldMatrix(!1,!1);const a=n.matrixWorld,l=new j.Vector3().fromArray(r[0]),c=new j.Vector3().fromArray(r[2]),u=Tt(l,c).add(new j.Vector3(0,0,5e-4)),h=new j.Matrix4().setPosition(u),d=new j.Matrix4().makeScale(o,o,o),m=new j.Matrix4().multiply(a).multiply(h).multiply(d);m.decompose(s.position,s.quaternion,s.scale);const g=s.opacityMesh;g&&m.decompose(g.position,g.quaternion,g.scale)}addMediaModelTag(e){return H(this,null,function*(){const n=e.filter(We).map(o=>this.loadModel(o));yield Promise.all(n),this.setModelMedialVisible(),this.updateRenderAllTags()})}updateRenderPointTag(){var n;const e=this.sort(this.filterPointTag);if(this.setPointTagPosition(),this.TagContainerSvelte)this.TagContainerSvelte.$set({tags:e,state:this.state,temporaryState:this.temporaryState});else{const o=(n=this.five.getElement())==null?void 0:n.parentElement;if(!o)return console.error("updateRenderPlaneTag: tag2DContainer not found");this.TagContainerSvelte=new Tb({target:o,props:{hooks:this.hooks,tags:e,state:this.state,temporaryState:this.temporaryState,mediaStore:this.mediaStore}})}}updateTagContainerVisible(){var e;(e=this.TagContainerSvelte)==null||e.$set({state:this.state,temporaryState:this.temporaryState,withAnimation:this.store.visibleWithAnimation}),this.filterCSS3DTag.forEach(n=>{var o,s,r,a,l;(a=(s=(o=n.tag3DContentSvelte)==null?void 0:o.css3DInstance)==null?void 0:s.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,n]of this.store.css3DRenderDisposer)n==null||n.forEach(o=>o==null?void 0:o());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 o=this.getTagById(e);(!o||o.stickType==="2DPoint")&&(n==null||n.forEach(s=>s==null?void 0:s()),this.store.css3DRenderDisposer.delete(e))}}}const ec="Dnalogel-PanoTagPlugin",Rb=i=>`${ec}--${i}`;class tc extends Ob{constructor(e,n){super(e);f(this,"state",{enabled:!0,visible:!0});f(this,"params");f(this,"debug");f(this,"changeTagModel",(e,n)=>H(this,null,function*(){e.data=tt.default({},e.data,n),yield this.loadModel(e),this.updateRenderAllTags()}));f(this,"handleFiveInitAnimationEnded",()=>{const e=this.five.getCurrentState().mode;this.tags.forEach(n=>{We(n)&&e==="Panorama"&&this.changeTagMode(n,"front"),n.state.visible=this.getVisible(n)}),this.updateRenderAllTags()});f(this,"handleFiveModelShownFloorChange",()=>{this.tags.forEach(e=>{var o,s;const n=this.getTagConfig(e).visibleConfig;typeof n=="object"&&(((o=n.visibleFiveMode)==null?void 0:o.includes("Floorplan"))||((s=n.visibleFiveMode)==null?void 0:s.includes("Mapview")))&&(e.state.visible=this.getVisibleByFiveMode(e))}),this.updateRenderAllTags()});this.params=Q({debug:!1,config:this.config},n),this.debug=this.params.debug,this.config=this.params.config,yg(1,{namespace:Do.PlayAudio});try{const o=window;Array.isArray(o.__PANOTAGPLUGIN_DEBUG_LIST__)||(o.__PANOTAGPLUGIN_DEBUG_LIST__=[]),o.__PANOTAGPLUGIN_DEBUG_LIST__.push(this),o.__PANOTAGPLUGIN_DEBUG__=this}catch(o){}}load(e,n){return H(this,null,function*(){var s,r;this.clearTags(),console.info(ec," load:",{data:JSON.parse(JSON.stringify(e))}),this.config=tt.default({},this.config,{globalConfig:(s=e.globalConfig)!=null?s:{},contentTypeConfig:(r=e.contentTypeConfig)!=null?r:{}});const o=yield this.addTag(e.tagList,n);if(this.debug)try{ig(this.five,this.tags)}catch(a){console.error(a)}return o})}addTag(e,n){return H(this,null,function*(){const s=(Array.isArray(e)?e:[e]).map(r=>{var c;const a=this.getTagConfig(r);return fe(Q({},r),{id:(c=r.id)!=null?c:Ge(),data:tt.default({},a.initialData,r.data),state:Q({visible:void 0,unfolded:!this.can("fold",r)},a.initialState),hooks:new Ee.Subscribe,mergedConfig: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)})}).filter(r=>r.position);return s.forEach(Ag),this.tags.push(...s),mg(this.five).then(()=>H(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(s)}))})}changeConfig(e,n=!0){n?this.config=tt.default({},this.config,e):this.config=e,this.updateTagConfig({force:!0}),this.updateRenderAllTags()}changeGlobalConfig(e,n=!0){n?this.config.globalConfig=tt.default({},this.config.globalConfig,e):this.config.globalConfig=e,this.updateTagConfig({force:!0}),this.updateRenderAllTags()}changeContentTypeConfig(e,n,o=!0){this.config.contentTypeConfig||(this.config.contentTypeConfig={}),o?this.config.contentTypeConfig[e]=tt.default({},this.config.contentTypeConfig[e],n):this.config.contentTypeConfig[e]=n,this.updateTagConfig({force:!0}),this.updateRenderAllTags()}show(e){return H(this,null,function*(){if(this.checkDisposed())return;const{userAction:n=!0,withAnimation:o=!1}=e!=null?e:{};this.setState({visible:!0},{userAction:n,visibleWithAnimation:o}),this.hooks.emit("show",{userAction:n,withAnimation:o})})}hide(e){return H(this,null,function*(){if(this.checkDisposed())return;const{userAction:n=!0,withAnimation:o=!1}=e!=null?e:{};this.setState({visible:!1},{userAction:n,visibleWithAnimation:o}),this.hooks.emit("hide",{userAction:n,withAnimation:o})})}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:o=!0,visibleWithAnimation:s=!1}=n,r=Q({},this.state);this.state=Object.assign(this.state,e),this.store.visibleWithAnimation=s,r.visible!==this.state.visible&&(e.visible?this.handleShow():this.handleHide()),r.enabled!==this.state.enabled&&(e.enabled?this.handleEnable():this.handleDisable()),this.hooks.emit("stateChange",{state:this.state,prevState:r,userAction:o})}dispose(){var e,n,o,s,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=[],(s=(o=this.store).eventListenerDisposer)==null||s.call(o),this.store.eventListenerDisposer=void 0,(a=(r=this.store).resizeObserverDisposer)==null||a.call(r),this.store.resizeObserverDisposer=void 0,this.store.resizeObserverDisposerAdding=!1,this.five.scene.remove(this.group),this.group.remove(...this.group.children),this.gltfObjectGroup.remove(...this.gltfObjectGroup.children),this.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 o=this.getTagById(e);if(!o)return;const s=this.can("fold",o),r=this.can("unfold",o);if(s&&r){o.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 o=this.getTagById(e);!o||(o.enabled=n,this.updateRenderAllTags())}changeTagNormalById(e,n){const o=this.getTagById(e);!o||!o.tag3DContentSvelte||(o.tag3DContentSvelte.currentNormal=qe(n))}changeDataById(e,n,o=!0){const s=this.getTagById(e);!s||(o?s.data=tt.default({},s.data,n):s.data=Q(Q({},s.data),n),this.clearUnusedPanelTag(),this.updateRenderAllTags())}changeStickTypeById(e,n,o=!0){this.changeTagById(e,n,o)}changeTagById(e,n,o=!0){const s=this.getTagById(e);!n||(o?tt.default(s,n):Object.assign(s,n),(s==null?void 0:s.tag3DContentSvelte)&&(n==null?void 0:n.normal)&&(s.tag3DContentSvelte.currentNormal=qe(n.normal)),this.updateRenderAllTags(),this.clearUnusedPanelTag())}destroyTagById(e){(Array.isArray(e)?e:[e]).forEach(o=>{const s=this.tags.findIndex(r=>r.id===o);s!==-1&&this.tags.splice(s,1)}),this.updateRenderAllTags()}setVisibleAndUnfolded(){return H(this,arguments,function*({withAnimation:e}={withAnimation:!1}){if(!!this.isPanorama)return this.setVisibleByPanoIndex(),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,o;this.pauseCurrentMedia(),this.state.enabled=!1,(n=(e=this.store).eventListenerDisposer)==null||n.call(e),this.five.scene.remove(this.group),(o=this.TagContainerSvelte)==null||o.$set({tags:[]}),this.filterCSS3DTag.forEach(s=>{var r;(r=s.tag3DContentSvelte)==null||r.dispose(),s.tag3DContentSvelte=void 0}),this.five.needsRender=!0}addEventListener(){const{five:e,hooks:n}=this,o=this.handleFiveWantsMoveToPano.bind(this),s=this.handleFiveModeChange.bind(this),r=this.handleFiveCameraUpdate.bind(this),a=this.handleFiveCameraUpdateDebounce(),l=this.handleFivePanoArrived.bind(this),c=this.loadVideoFirstFrame.bind(this),u=this.clickhandler.bind(this),h=this.five.currentMode;return h&&this.handleFiveModeChange(h),this.handleFivePanoArrived(),e.on("wantsMoveToPano",o),e.on("modeChange",s),e.on("initAnimationEnded",this.handleFiveInitAnimationEnded),e.on("modelShownFloorChange",this.handleFiveModelShownFloorChange),e.on("cameraUpdate",r),e.on("cameraUpdate",a),e.on("panoArrived",l),e.on("panoArrived",c),n.on("click",u),()=>{e.off("wantsMoveToPano",o),e.off("modeChange",s),e.off("initAnimationEnded",this.handleFiveInitAnimationEnded),e.off("modelShownFloorChange",this.handleFiveModelShownFloorChange),e.off("cameraUpdate",r),e.off("cameraUpdate",a),e.off("panoArrived",l),e.off("panoArrived",c),n.off("click",u),this.store.eventListenerDisposer=void 0}}addResizeListener(){if(!this.store.resizeObserverDisposer&&!this.store.resizeObserverDisposerAdding){const e=this.addResizeObserver();this.store.resizeObserverDisposerAdding=!0,setTimeout(()=>{this.store.resizeObserverDisposer=e,this.store.resizeObserverDisposerAdding=!1},200)}}addResizeObserver(){if(!this.store.disposed)return;const e=this.five.getElement(),n=()=>{!this.state.enabled||(this.show(),this.updateRenderAllTags())},o=()=>{!this.state.enabled||this.hide()},{observe:s,unobserve:r}=ar(gg(()=>{!this.store.resizeObserverDisposer||o()},500),e),{observe:a,unobserve:l}=ar(rr(()=>n(),400),e);return s(),a(),()=>{r(),l()}}handleFiveModeChange(e){this.setModelMedialVisible(),this.tags.forEach(n=>{We(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=fe(Q({},e.temporaryState),{visible:n.visibleConfig.keep==="visible"}):e.temporaryState=fe(Q({},e.temporaryState),{visible:Boolean(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),o=this.can("unfold",e.tag);n&&o&&(e.tag.state.unfolded=!e.tag.state.unfolded,e.tag.state.unfolded&&this.tags.forEach(s=>{s.id!==e.tag.id&&s.state&&this.can("fold",s)&&(s.state.unfolded=!1)}),this.updateRenderAllTags())}handleFiveCameraUpdateDebounce(){return rr(()=>{this.setUnfoldedByCamera(),this.updateRenderAllTags()},100)}handleFiveCameraUpdate(){this.updateRenderPointTag()}handleFivePanoArrived(){return H(this,null,function*(){this.setModelMedialVisible(),yield this.setVisibleAndUnfolded(),this.tags.forEach(e=>{e.temporaryState=fe(Q({},e.temporaryState),{visible:!0})}),this.store.visibleWithAnimation=!0,this.updateTagContainerVisible(),this.updateRenderAllTags()})}setUnfoldedByCamera(){let e=!1;this.tags.forEach(n=>{const o=this.getUnfoldedByCamera(n);!n.state||o!==void 0&&(o===!0&&(e=!0),n.state.unfolded=o)}),e&&this.tags.forEach(n=>{const o=this.getTagConfig(n).unfoldedConfig;typeof o=="object"&&(o.autoUnfold||o.keep)||n.state&&(n.state.unfolded=!1)})}changeTagMode(e,n){var o,s,r,a,l,c;((o=this.getTagConfig(e))==null?void 0:o.renderType)!=="Mesh"&&((a=(r=(s=e.tag3DContentSvelte)==null?void 0:s.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(u=>u==null?void 0:u()),e.tag3DContentSvelte=void 0)}}const Qb=(i,t)=>new tc(i,t);function nc(i){const t=new E.Box3,e=new E.Vector3;if(i.traverse(n=>{var s;if(n.name==="shadow")return;const o=n.geometry;if(o!==void 0)if((s=o==null?void 0:o.attributes)!=null&&s.position){const r=o.attributes.position;for(let a=0,l=r.count;a<l;a++)e.fromBufferAttribute(r,a).applyMatrix4(n.matrix),t.expandByPoint(e)}else o.vertices.forEach(r=>{const a=r.clone().applyMatrix4(n.matrix);t.expandByPoint(a)})}),!t.isEmpty())return t}class Mn{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,u;this.hooks=(c=t.sharedHooks)!=null?c:new Kt,this.camera=t.camera,this.model=t.model,this.originObject3D=t.originObject3D,this.helperObject3D=t.helperObject3D,this.container=t.container,this.scene=t.scene,this.domEvents=new be(t.camera,t.container),this.onRender=(u=t.onRender)!=null?u:()=>{},this.offset=e==null?void 0:e.offset,this.initialHelperPosition(),this.initialHelperQuaternion(),this.enable();const n=(...h)=>this.onSetOriginObjectScale(...h),o=(...h)=>this.onSetOriginObjectRotate(...h),s=(...h)=>this.onSetOriginObjectPosition(...h),r=(...h)=>this.onApplyOriginObjectScale(...h),a=(...h)=>this.onApplyOriginObjectRotate(...h),l=(...h)=>this.onApplyOriginObjectPosition(...h);this.hooks.on("setObjectScale",n),this.hooks.on("setObjectRotate",o),this.hooks.on("setObjectPosition",s),this.hooks.on("applyObjectPosition",l),this.hooks.on("applyObjectRotate",a),this.hooks.on("applyObjectScale",r),this.disposers.push(()=>{this.hooks.off("setObjectScale",n),this.hooks.off("setObjectRotate",o),this.hooks.off("setObjectPosition",s),this.hooks.off("applyObjectPosition",l),this.hooks.off("applyObjectRotate",a),this.hooks.off("applyObjectScale",r)})}initialHelperPosition(){this.helperObject3D.position.add(this.calculateOffset(this.offset)),this.helperObject3D.initialPosition()}initialHelperQuaternion(){this.helperObject3D.initQuaternion()}enable(){this.enabled||(this.enabled=!0,this.scene.add(this.helperObject3D),this.helperObject3D.enable(),this.render())}disable(){!this.enabled||(this.enabled=!1,this.helperObject3D.disable(),this.render())}show(){this.helperObject3D.show(),this.render()}hide(){this.helperObject3D.hide(),this.render()}dispose(){var t;(t=this.disposers)==null||t.forEach(e=>e==null?void 0:e()),this.helperObject3D.dispose(),this.render()}applyHelperMatrix4(t){this.helperObject3D.applyMatrix4(t)}applyHelperQuaternion(t,e){this.helperObject3D.applyHelperQuaternion(t,e)}applyHelperScaleMatrix4(t,e){this.helperObject3D.applyHelperScaleMatrix4(t,e)}onWantsGesture(t,e,n){if(this.isDragging)return!1}onIntersectionOnModelUpdate(t){}onApplyOriginObjectScale(t){this.applyHelperScaleMatrix4(t.matrix,t.origin)}onApplyOriginObjectRotate(t){this.applyHelperQuaternion(t.quaternion,t.origin)}onApplyOriginObjectPosition(t){this.applyHelperMatrix4(t.matrix)}onSetOriginObjectScale(t){this.helperObject3D.scale.copy(t),this.updateOffsetByScale(t)}onSetOriginObjectRotate(t,e){this.helperObject3D.setHelperQuaternion(t,e)}onSetOriginObjectPosition(t){this.helperObject3D.position.copy(t.clone().add(this.calculateOffset(this.offset)))}render(){this.onRender()}updateOffsetByScale(t){if(this.boundingBox&&this.offset){const e=this.originObject3D.position,n=new E.Vector3().subVectors(this.boundingBox.max,e).multiply(t).add(e),o=new E.Vector3().subVectors(this.boundingBox.min,e).multiply(t).add(e),s=this.calculateOffset(this.offset,{min:o,max:n});this.helperObject3D.position.copy(s),this.helperObject3D.initialPosition()}}hoverListener(t,e=16777215,n=1){const o=(Array.isArray(t)?t:[t]).filter(wt),s=[];for(const r of o)if(r instanceof E.Mesh||r instanceof E.Group){const a=r instanceof E.Group?r.children.filter(d=>d instanceof E.Mesh):[r];a.forEach(d=>{d.__originalColor__=d.material.color.clone(),d.__originalOpacity__=d.material.opacity});const l=()=>{a.forEach(d=>{d.material.color.set(e),d.material.opacity=n}),this.render()},c=()=>{a.forEach(d=>{d.material.color.copy(d.__originalColor__),d.material.opacity=d.__originalOpacity__}),this.render()},u=()=>{this.isDragging||l()},h=()=>{this.isDragging||c()};for(const d of a)this.domEvents.addEventListener(d,"mouseover",u),this.domEvents.addEventListener(d,"mouseout",h),this.hooks.on("moveStart",l),this.hooks.on("moveEnd",c),this.hooks.on("rotateEnd",c),s.push(()=>{this.domEvents.removeEventListener(d,"mouseover",u),this.domEvents.removeEventListener(d,"mouseout",h),this.hooks.off("moveStart",l),this.hooks.off("moveEnd",c),this.hooks.off("rotateEnd",c)})}return()=>s.forEach(r=>r==null?void 0:r())}getIntersectObject(t){const e=this.camera.position,n=this.helperObject3D;if(!n)return;const o=this.helperObject3D.raycasterIntersectObject(t)[0];if(!o)return;const s=o;if(s.object=n,this.model.intersectRaycaster){const r=this.model.intersectRaycaster(t)[0];if(r&&r.point.distanceTo(e)<s.point.distanceTo(e))return}return s.object}calculateOffset(t,e){const n=this.originObject3D,o=new E.Vector3(0,0,0);if(!t)return o;const s=()=>e||(this.boundingBox?this.boundingBox:(this.boundingBox=nc(n),this.boundingBox));if(typeof t.x=="number")o.setX(t.x);else if(typeof t.x=="object"){const r=s();o.setX((r.max.x-r.min.x)*t.x.percents)}if(typeof t.y=="number")o.setY(t.y);else if(typeof t.y=="object"){const r=s();o.setY((r.max.y-r.min.y)*t.y.percents)}if(typeof t.z=="number")o.setZ(t.z);else if(typeof t.z=="object"){const r=s();o.setZ((r.max.z-r.min.z)*t.z.percents)}return o}}class Fb extends Mn{constructor(...e){super(...e);f(this,"name","ScaleController")}setScale(e){var l,c,u;let n=1,o=1,s=1;typeof e=="number"?(n=e,o=e,s=e):typeof e=="object"&&(n=(l=e.x)!=null?l:1,o=(c=e.y)!=null?c:1,s=(u=e.z)!=null?u:1);const r=new E.Vector3(n,o,s);this.hooks.emit("wantToScale",r)||(this.originObject3D.scale.copy(r),this.hooks.emit("setObjectScale",r),this.hooks.emit("scale",r),this.render())}}function ic(i,t,e){if(e){const o=new E.Vector3().subVectors(i.position,e).applyQuaternion(i.quaternion.clone().inverse()).applyQuaternion(t).add(e);i.position.copy(o)}i.quaternion.copy(t)}class Hb extends j.Object3D{constructor(){super()}add(...t){if(t.length===0)return this;const e=t.filter(Boolean);return super.add(...e)}remove(...t){if(t.length===0)return this;const e=t.filter(Boolean);return super.remove(...e)}removeFromParent(){const t=this.parent;return t!==null&&t.remove(this),this}}class Di extends Hb{constructor(e,n){var o;super();f(this,"originObject3D");f(this,"onRender");this.originObject3D=e,this.onRender=(o=n==null?void 0:n.onRender)!=null?o:()=>{}}get helperObject(){return this}render(){this.onRender()}enable(){this.parent.children.includes(this)||this.parent.add(this)}disable(){this.removeFromParent()}show(){this.visible=!0,this.render()}hide(){this.visible=!1,this.render()}raycasterIntersectObject(e,n=[]){return e.intersectObject(this,!0,n)}initialPosition(){this.position.add(this.originObject3D.position)}initQuaternion(){this.quaternion.copy(this.originObject3D.quaternion)}applyHelperScaleMatrix4(e,n){this.scale.applyMatrix4(e)}setHelperQuaternion(e,n){ic(this,e,n)}applyHelperQuaternion(e,n){if(n){const o=new j.Vector3().subVectors(this.position,n).applyQuaternion(e).add(n);this.position.copy(o)}this.applyQuaternion(e)}dispose(){this.removeFromParent()}}class Gb extends Di{}class Wb extends Di{}class _b extends Di{}class oc extends Di{}class Nb extends oc{}class Xb extends E.Group{constructor(e){super();f(this,"direction");this.direction=e||"x"}}class va extends E.Mesh{constructor(e,n,o){super(e,n);f(this,"direction");this.direction=o||"x"}}function Yb(i,t){const{offsetWidth:e,offsetHeight:n}=t,{top:o,left:s}=t.getBoundingClientRect();return Object.assign(new E.Vector2,{x:(i.x-s)/e*2-1,y:-(i.y-o)/n*2+1})}function zo(i,t,e){if(!t||!e||!i)return;const n=Yb(t,e);if(Math.abs(n.x)===1||Math.abs(n.y)===1)return;const o=new E.Raycaster;return o.setFromCamera(n,i),o}function Ub(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 Ui extends Xb{constructor(e){var u;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((u=e.color)!=null?u:16214315),o=new E.MeshBasicMaterial({color:n,depthTest:!1,opacity:1,transparent:!0,side:E.DoubleSide}),s=new E.ConeGeometry(.04,.1,32),r=new va(s,o.clone(),e.direction);r.name=`arrow-${e.direction}`,this.arrow=r;const a=.004,l=new E.CylinderGeometry(a,a,.4,32),c=new va(l,o.clone(),e.direction);c.name=`line-${e.direction}`,this.line=c,this.formatArrow(),this.formatLine(),this.add(this.arrow,this.line)}formatArrow(){this.arrow.geometry.translate(0,this.lineHeight+this.arrowHeight/2,0),this.direction==="x"?(this.arrow.geometry.rotateX(Math.PI/2),this.arrow.geometry.rotateY(Math.PI/2)):this.direction==="z"&&this.arrow.geometry.rotateX(Math.PI/2)}formatLine(){this.line.geometry.translate(0,this.lineHeight/2,0),this.direction==="x"?(this.line.geometry.rotateX(Math.PI/2),this.line.geometry.rotateY(Math.PI/2)):this.direction==="z"&&this.line.geometry.rotateX(Math.PI/2)}}const qi={X:15618642,Y:4765519,Z:4227839};class Nt{static get X(){return new E.Color(qi.X).convertSRGBToLinear().clone()}static get Y(){return new E.Color(qi.Y).convertSRGBToLinear().clone()}static get Z(){return new E.Color(qi.Z).convertSRGBToLinear().clone()}}class qb extends Gb{constructor(e){super(e);f(this,"xArrow",new Ui({direction:"x",color:Nt.X}));f(this,"yArrow",new Ui({direction:"y",color:Nt.Y}));f(this,"zArrow",new Ui({direction:"z",color:Nt.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 Mt(i,t){return Jb(document.createElement(t!=null?t:"div"),i)}function Jb(i,t){if(!t)return i;for(const e in t)e&&t[e]&&(i.style[e]=t[e]);return i}function Zb(i){const t=Mt(Q({position:"absolute",display:"block",borderRadius:"4px",paddingTop:"1px",paddingBottom:"1px",paddingLeft:"4px",paddingRight:"4px",pointerEvents:"none",userSelect:"none",zIndex:"9999",backgroundColor:"rgba(0,0,0,0.7)",fontSize:"12px",color:"#fff",letterSpacing:"0",lineHeight:"18px"},i)),e=()=>{t.style.display!=="block"&&(!t.style.top||!t.style.left||(t.style.display="block"))};return{element:t,show:e,hide:()=>{t.style.display="none",t.style.top="",t.style.left=""},setLeftTop:(s,r)=>{t.style.left=s,t.style.top=r,e()}}}class Kb extends _b{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 Ji({direction:"x",color:Nt.X})),(n==null?void 0:n.xzCircleEnable)!==!1&&(this.yCircle=new Ji({direction:"y",color:Nt.Y})),(n==null?void 0:n.xyCircleEnable)!==!1&&(this.zCircle=new Ji({direction:"z",color:Nt.Z})),(n==null?void 0:n.container)&&(n==null?void 0:n.angleTipsEnable)!==!1&&(this.container=n==null?void 0:n.container,this.angleTips=Zb({display:"none"}),this.container.appendChild(this.angleTips.element)),this.add(...[this.xCircle,this.yCircle,this.zCircle].filter(Boolean)),this.show()}hide(){this.children.forEach(e=>e.hide())}show(){var e;this.children.forEach(n=>n.showCircle()),(e=this.angleTips)==null||e.hide()}showDraggingHelper(e){var n;this.hide(),this.children.filter(o=>e.includes(o.direction)).forEach(o=>o.showRing()),(n=this.angleTips)==null||n.show()}dispose(){var e,n;this.removeFromParent(),(n=(e=this.angleTips)==null?void 0:e.element)==null||n.remove()}}class Ji 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 $b(e),this.ring=new e1(e),this.angleSector=new t1(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 $b 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 e1 extends E.Group{constructor(e){super();f(this,"direction");this.direction=e.direction;const n=.015,o=new Array(8).fill(null).map((s,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(...o)}}class t1 extends E.Mesh{constructor(e){var o;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:(o=e.color)!=null?o:16777215,depthTest:!1,transparent:!0,side:E.DoubleSide}),this.direction=e.direction,this.angleDirection=this.direction==="z"?1:-1}}function n1(){const i=Mt({width:"100%",height:"100%",left:"0",top:"0",position:"absolute",pointerEvents:"none"}),t=Mt({boxSizing:"border-box",width:"100%",height:"100%",left:"0",top:"0",position:"relative",display:"flex",alignItems:"center",justifyContent:"center"}),e=Mt({boxSizing:"border-box",width:"100%",height:"100%",left:"0",top:"0",position:"absolute",border:"1px solid rgba(255,255,255,0.4)"});i.appendChild(t),t.appendChild(e);const n="-4px",o={direction:"nesw",element:ft({cursor:"nesw-resize",left:n,bottom:n})},s={direction:"ns",element:ft({cursor:"ns-resize",bottom:n})},r={direction:"nwse",element:ft({cursor:"nwse-resize",right:n,bottom:n})},a={direction:"ew",element:ft({cursor:"ew-resize",right:n})},l={direction:"nesw",element:ft({cursor:"nesw-resize",right:n,top:n})},c={direction:"ns",element:ft({cursor:"ns-resize",top:n})},u={direction:"nwse",element:ft({cursor:"nwse-resize",left:n,top:n})},h={direction:"ew",element:ft({cursor:"ew-resize",left:n})};return new Array(s,a,c,h,o,r,l,u).forEach(m=>t.appendChild(m.element)),{container:i,squares:[o,s,r,a,l,c,u,h]}}function ft(i){const t=Mt(Q({background:"#FFFFFF",width:"9px",height:"9px",position:"absolute",pointerEvents:"none"},i)),e=Mt({width:"15px",height:"15px",position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",pointerEvents:"none"}),n=Mt({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 i1 extends Nb{constructor(e,n,o,s){super(e);f(this,"points",[]);f(this,"cornerPositions",[]);f(this,"css3DInstance");f(this,"plane");f(this,"css3DRenderer",new Xt);f(this,"camera");f(this,"scene");f(this,"container");f(this,"enabled",!1);this.camera=o,this.scene=s,this.container=n,this.initRectangleScaleHelper()}get helperObject(){var e;if(!((e=this.css3DInstance)!=null&&e.css3DObject))throw new Error("css3DInstance is not initialized");return this.css3DInstance.css3DObject}applyMatrix4(e){var n;super.applyMatrix4(e),this.helperObject.applyMatrix4(e),(n=this.plane)==null||n.applyMatrix4(e),this.cornerPositions.forEach(o=>o.applyMatrix4(e))}showDraggingHelper(){}applyHelperScaleMatrix4(e,n){var o;(o=this.plane)==null||o.scale.applyMatrix4(e),this.helperObject.applyScaleMatrix4(e)}updatePoints(){const e=this.calculatePointPosition(this.cornerPositions);this.points.forEach((n,o)=>{n.position.copy(e[o])})}applyHelperQuaternion(e,n){var s;const o=(s=this.css3DInstance)==null?void 0:s.css3DObject;if(o){const r=new E.Vector3().subVectors(o.position,n).applyQuaternion(e).add(n);o.position.copy(r),o.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 o=n.css3DObject.container,{container:s,squares:r}=n1();this.points=r.map((c,u)=>({direction:c.direction,point:c.element,position:this.calculatePointPosition(e)[u]})),o.insertBefore(s,(a=o.children[0])!=null?a:null),this.helperObject.position.copy(this.originObject3D.position),(l=this.plane)==null||l.position.copy(this.originObject3D.position)}getCornerPositions(){const{originObject3D:e}=this;if(e.isCSS3DObjectPlus)return e.cornerPoints;console.error("\u5F53\u524D\u7269\u4F53\u6682\u65F6\u4E0D\u652F\u6301 ScaleHelper")}calculatePointPosition(e){return[e[0].clone(),e[0].clone().add(e[1]).divideScalar(2),e[1].clone(),e[1].clone().add(e[2]).divideScalar(2),e[2].clone(),e[2].clone().add(e[3]).divideScalar(2),e[3].clone(),e[3].clone().add(e[0]).divideScalar(2)]}}class o1 extends Wb{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=nc(this.originObject);if(!e)return;const{min:n,max:o}=e;this.positionAttribute.setXYZ(0,o.x,o.y,o.z),this.positionAttribute.setXYZ(1,n.x,o.y,o.z),this.positionAttribute.setXYZ(2,n.x,n.y,o.z),this.positionAttribute.setXYZ(3,o.x,n.y,o.z),this.positionAttribute.setXYZ(4,o.x,o.y,n.z),this.positionAttribute.setXYZ(5,n.x,o.y,n.z),this.positionAttribute.setXYZ(6,n.x,n.y,n.z),this.positionAttribute.setXYZ(7,o.x,n.y,n.z),this.positionAttribute.needsUpdate=!0}createOutline(){const e=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),n=new E.BufferGeometry;n.setIndex(new E.BufferAttribute(e,1)),n.setAttribute("position",this.positionAttribute);const o=new E.LineBasicMaterial({color:64767,linewidth:1,opacity:1,depthTest:!1,transparent:!0,toneMapped:!1}),s=new E.LineSegments(n,o);return s.matrixAutoUpdate=!1,s}createBox(){const e=new Uint16Array([0,1,2,0,2,3,0,3,7,0,7,4,0,4,5,0,5,1,6,1,5,6,2,1,6,5,4,6,4,7,6,3,2,6,7,3]),n=new E.BufferGeometry;n.setIndex(new E.BufferAttribute(e,1)),n.setAttribute("position",this.positionAttribute);const o=new E.MeshBasicMaterial({color:64767,opacity:.1,depthTest:!1,transparent:!0});return new E.Mesh(n,o)}}class s1 extends Mn{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 o=this.dragStart.bind(this),s=this.dragging.bind(this),r=this.dragEnd.bind(this),a=this.show.bind(this),l=this.hide.bind(this);this.domEvents.addEventListener(this.helperObject3D,"mousedown",o),document.addEventListener("mousemove",s),document.addEventListener("mouseup",r),this.hooks.on("rotateStart",l),this.hooks.on("rotateEnd",a),this.hooks.on("moveByMouseEnable",l),this.hooks.on("moveByMouseDisable",a),this.disposers.push(()=>{this.domEvents.removeEventListener(this.helperObject3D,"mousedown",o),document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",r),this.hooks.off("rotateStart",l),this.hooks.off("rotateEnd",a),this.hooks.off("moveByMouseEnable",l),this.hooks.off("moveByMouseDisable",a)}),this.moveByMouseEnable&&this.moveByMouse()}get moveByMouseEnable(){return this._moveByMouseEnable}dispose(){var e;super.dispose(),(e=this.disposers)==null||e.forEach(n=>n==null?void 0:n())}moveByMouse(){this._moveByMouseEnable=!0;const e=this.handleMouseDown.bind(this),n=this.handleMouseUp.bind(this);this.hooks.emit("moveByMouseEnable"),setTimeout(()=>{this.container.addEventListener("mousedown",e),this.container.addEventListener("mouseup",n)}),this.mousedownEventListenerDisposer=()=>{this.container.removeEventListener("mousedown",e),this.container.removeEventListener("mouseup",n)}}disableMoveByMouse(){var e;this._moveByMouseEnable=!1,this.hooks.emit("moveByMouseDisable"),(e=this.mousedownEventListenerDisposer)==null||e.call(this)}onIntersectionOnModelUpdate(e){!this.moveByMouseEnable||this.hooks.emit("wantToMove",e.point)||(this.originObject3D.position.copy(e.point),this.hooks.emit("setObjectPosition",e.point),this.hooks.emit("move",e.point))}onApplyOriginObjectScale(e){}handleMouseDown(e){const{x:n,y:o}=e;this.mouseInfo={x:n,y:o,mouseDownTimestamp:Date.now()}}handleMouseUp(e){if(!this.mouseInfo)return;const{x:n,y:o}=e;this.mouseInfo.x===n&&this.mouseInfo.y===o&&Date.now()-this.mouseInfo.mouseDownTimestamp<500&&(this.disableMoveByMouse(),this.mouseInfo=void 0)}dragStart(e){if(this._moveByMouseEnable||this.isDragging)return;const n=e==null?void 0:e.intersect;if(!n)return this.dragEnd();const o=(n==null?void 0:n.object).direction;if(!o)return this.dragEnd();const s=new 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(o){case"x":return s;case"y":return r;case"z":return a}})(),c=(()=>{switch(o){case"x":case"y":return a;case"z":return s}})(),u=n.point.clone(),h=new E.Plane;h.setFromNormalAndCoplanarPoint(c,u),this.startInfo={startVectorProject:u.clone().projectOnVector(l),directionVector:l,plane:h},this.helperObject3D.showDraggingHelper([o]),this.hooks.emit("moveStart"),this.isDragging=!0}dragging(e){if(!this.isDragging||!this.startInfo)return;const n=zo(this.camera,e,this.container);return n?(this.move(n),!1):this.dragEnd()}move(e){if(!this.startInfo)return this.dragEnd();const{plane:n,directionVector:o,startVectorProject:s}=this.startInfo,r=this.originObject3D,a=e.ray.intersectPlane(n,new E.Vector3);if(!a)return;const l=a.clone().projectOnVector(o),c=l.clone().sub(s),u=new E.Matrix4;u.setPosition(c);const h=r.position.clone().applyMatrix4(u);this.hooks.emit("wantToMove",h)||(r.applyMatrix4(u),s.copy(l),this.hooks.emit("applyObjectPosition",{matrix:u}),this.hooks.emit("move",h))}dragEnd(){!this.isDragging||(this.startInfo=void 0,this.isDragging=!1,this.helperObject3D.show(),this.hooks.emit("moveEnd"))}}class fn{constructor(t,e,n,o,s,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,u=t.getElement();if(this.five=t,!a||!l||!u||!c)return;const h=()=>{t.needsRender=!0};this.helperController=new e({camera:a,model:l,originObject3D:n,helperObject3D:o,container:u,scene:c,onRender:h,sharedHooks:r},s),t.on("wantsTapGesture",this.onFiveWantsTapGesture),t.on("wantsGesture",this.onFiveWantsGesture),t.on("intersectionOnModelUpdate",this.onFiveIntersectionOnModelUpdate)}dispose(){var t;this.five.off("wantsTapGesture",this.onFiveWantsTapGesture),this.five.off("wantsGesture",this.onFiveWantsGesture),this.five.off("intersectionOnModelUpdate",this.onFiveIntersectionOnModelUpdate),(t=this.helperController)==null||t.dispose()}}const r1="v1.0.1",a1="Object3DHelper",Bo=`${a1}@${r1}`,l1=()=>{console.error(`${Bo} is disposed`)},c1=()=>{console.warn(`${Bo} is disabled`)},u1=()=>{console.error(`${Bo} is disabled`)};class d1{constructor(t){f(this,"controllers",{});f(this,"state",{visible:!0,enabled:!0,disposed:!1});f(this,"hooks",new Kt);f(this,"eventListener",{});t&&this.addControllers(t),this.setState(this.state)}show(t){return H(this,null,function*(){this.setState({visible:!0},t)})}hide(t){return H(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 l1();if(!this.state.enabled&&t.enabled!==!0&&t.disposed!==!0)return u1();const n=Q({},this.state);this.state=Q(Q({},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=Q(Q({},this.controllers),t),this.setState(this.state)}getCurrentState(){return this.state}handleEnable(t,e=!0){t?(this.everyControllerDo(n=>{n.enable()}),this.hooks.emit("enable",{userAction:e})):(this.everyControllerDo(n=>{n.disable()}),this.hooks.emit("disable",{userAction:e})),this.state.enabled=t}handleVisible(t,e=!0){t?(this.everyControllerDo(n=>{n.show()}),this.actionIfStateIsEnabled(()=>this.hooks.emit("show",{userAction:e}))):(this.everyControllerDo(n=>{n.hide()}),this.actionIfStateIsEnabled(()=>this.hooks.emit("hide",{userAction:e}))),this.state.visible=t}everyControllerDo(t){Object.values(this.controllers).forEach(e=>{e&&t(e)})}handleDispose(){var t,e;Object.values(this.controllers).forEach(n=>{n==null||n.dispose()});for(const n in this.controllers){if(!n)continue;const o=n;(e=(t=this.eventListener)[o])==null||e.call(t)}}actionIfStateIsEnabled(t,e){if(this.state.enabled)return t();e!=null&&e.warnLog&&c1()}}function Zi(i){return i*Math.PI/180}class h1 extends Mn{constructor(...e){var c,u,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,(u=n.yCircle)==null?void 0:u.circle,(h=n.zCircle)==null?void 0:h.circle].filter(Boolean));const o=this.dragStart.bind(this),s=this.dragging.bind(this),r=this.dragEnd.bind(this),a=this.show.bind(this),l=this.hide.bind(this);this.domEvents.addEventListener(this.helperObject3D,"mousedown",o),document.addEventListener("mousemove",s),document.addEventListener("mouseup",r),this.hooks.on("moveStart",l),this.hooks.on("moveEnd",a),this.hooks.on("moveByMouseEnable",l),this.hooks.on("moveByMouseDisable",a),this.removeListener=()=>{this.domEvents.removeEventListener(this.helperObject3D,"mousedown",o),document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",r),this.hooks.off("moveStart",l),this.hooks.off("moveEnd",a),this.hooks.off("moveByMouseEnable",l),this.hooks.off("moveByMouseDisable",a)}}get rotateCenter(){return this.helperObject3D.position.clone()}initialHelperQuaternion(){this.helperObject3D.applyHelperQuaternion(this.originObject3D.quaternion)}setRotateAngle(e){const{x:n=0,y:o=0,z:s=0}=e,r=new E.Euler(Zi(n),Zi(o),Zi(s)),a=new E.Quaternion().setFromEuler(r);if(this.hooks.emit("wantToRotate",a))return;const{originObject3D:c,rotateCenter:u}=this;ic(c,a,u),this.hooks.emit("setObjectRotate",a,u),this.hooks.emit("rotate",a),this.render()}dispose(){this.removeListener(),super.dispose()}onApplyOriginObjectRotate(e){this.isDragging||super.onApplyOriginObjectRotate(e)}onApplyOriginObjectScale(e){}dragStart(e){if(this.isDragging)return;const n=e==null?void 0:e.intersect;if(!n)return this.dragEnd();const o=(n==null?void 0:n.object).direction;if(!o)return this.dragEnd();const s=n.point,r=this.getAngleHelper(o);this.setTipsAngle(0);const a=s.clone();a.y+=.2,this.setTipsPosition(a);const l=(()=>{if(o==="x")return new E.Vector3(1,0,0).applyQuaternion(this.originObject3D.quaternion);if(o==="y")return new E.Vector3(0,1,0).applyQuaternion(this.originObject3D.quaternion);if(o==="z")return new E.Vector3(0,0,1).applyQuaternion(this.originObject3D.quaternion)})(),c=new E.Plane().setFromNormalAndCoplanarPoint(l,s),h=c.projectPoint(s.clone(),new E.Vector3).clone().sub(this.rotateCenter),d=h.angleTo(r.baseAxes.clone().applyQuaternion(this.originObject3D.quaternion));this.setAngleHelperStart(o,d),this.setAngleHelperLength(o,0),this.startInfo={direction:o,startVector:h,plane:c,angleHelper:r,angle:0,objectQuaternion:this.originObject3D.quaternion.clone()},this.helperObject3D.showDraggingHelper([o]),this.hooks.emit("rotateStart"),this.isDragging=!0}dragging(e){if(!this.isDragging)return;const n=zo(this.camera,e,this.container);return n?(this.rotate(n),!1):this.dragEnd()}rotate(e){if(!this.startInfo)return this.dragEnd();const{startVector:n,plane:o,angleHelper:s,direction:r,objectQuaternion:a}=this.startInfo,{originObject3D:l}=this,c=e.ray.intersectPlane(o,new E.Vector3);if(!c)return;const u=this.rotateCenter.clone(),d=o.projectPoint(c.clone(),new E.Vector3).clone().sub(u);if(n.angleTo(d)===0)return;const m=new E.Quaternion().setFromUnitVectors(n.clone().normalize(),d.clone().normalize()),g=l.quaternion.clone().premultiply(m);if(this.hooks.emit("wantToRotate",g))return;const v=new E.Euler().setFromQuaternion(new E.Quaternion().setFromUnitVectors(n.clone().normalize().applyQuaternion(a.clone().inverse()),d.clone().normalize().applyQuaternion(a.clone().inverse())),`${r.toUpperCase()}${"XZY".replace(r.toUpperCase(),"")}`)[r]*s.angleDirection;if(this.startInfo.angle+=v,this.setAngleHelperLength(r,this.startInfo.angle),this.setTipsAngle(el(this.startInfo.angle)),u){const b=new E.Vector3().subVectors(l.position,u).applyQuaternion(m).add(u);l.position.copy(b)}l.applyQuaternion(m),this.hooks.emit("applyObjectRotate",{quaternion:m,origin:u}),this.hooks.emit("rotate",l.quaternion),this.startInfo.startVector=d}dragEnd(){!this.isDragging||(this.hooks.emit("setObjectRotate",this.originObject3D.quaternion,this.rotateCenter),this.startInfo=void 0,this.isDragging=!1,this.helperObject3D.show(),this.hooks.emit("rotateEnd"))}getAngleHelper(e){var n,o,s;switch(e){case"x":return(n=this.helperObject3D.xCircle)==null?void 0:n.angleSector;case"y":return(o=this.helperObject3D.yCircle)==null?void 0:o.angleSector;case"z":return(s=this.helperObject3D.zCircle)==null?void 0:s.angleSector}}setAngleHelperStart(e,n){const o=this.getAngleHelper(e);if(!o){console.warn("angleHelper is undefined");return}if(o instanceof E.Mesh&&o.geometry instanceof E.CircleGeometry){const{radius:s,segments:r,thetaLength:a}=o.geometry.parameters;o.geometry=new E.CircleGeometry(s,r,n,a)}else console.warn("only support THREE.CircleGeometry")}setAngleHelperLength(e,n){const s=n>=0?Math.max(n,.001):Math.min(n,-.001),r=this.getAngleHelper(e);if(r instanceof E.Mesh&&r.geometry instanceof E.CircleGeometry){const{radius:a,thetaStart:l}=r.geometry.parameters,c=Math.ceil(Math.abs(s)*(40/(2*Math.PI)));r.geometry=new E.CircleGeometry(a,c,l,s)}else console.warn("only support THREE.CircleGeometry")}setTipsAngle(e){var o;const n=(o=this.helperObject3D.angleTips)==null?void 0:o.element;!n||(n.innerText=`${e.toFixed(0)}\xB0`)}setTipsPosition(e){const n=this.helperObject3D.angleTips;if(!n)return;const o=e.project(this.camera),{x:s,y:r,z:a}=o;if(a>1)return;const l=(s+1)/2*100+"%",c=(-r+1)/2*100+"%";n.setLeftTop(l,c)}}class f1 extends Mn{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 j.Vector3),n[0]):e.setFromCoplanarPoints(n[0],n[1],n[2]),e}dragStart(e,n){var s,r;(r=(s=this.helperObject3D).updatePoints)==null||r.call(s);const o=this.getDragPlane();if(!o)return this.dragEnd();this.startInfo={startPoint:{position:n.position.clone(),direction:n.direction},plane:o},this.hooks.emit("scaleStart"),this.render(),this.isDragging=!0}dragging(e){if(!this.isDragging)return;const n=zo(this.camera,e,this.container);if(!n)return this.dragEnd();this.scale(n)}scale(e){var F,N;if(!this.startInfo)return;const n=this.originObject3D,{startPoint:o,plane:s}=this.startInfo,r=this.helperObject3D.cornerPositions;if(r.length<4)return this.dragEnd();const a=e.ray.intersectPlane(s,new j.Vector3);if(!a||Ub(a,this.camera.position))return;const l=new j.Vector3().addVectors(r[0],r[2]).divideScalar(2),{position:c,direction:u}=o,h=new j.Vector3().subVectors(r[1],r[0]),d=new j.Vector3().subVectors(r[3],r[0]),m=R=>{const S=new j.Vector3(0,0,0);if(!this.startInfo)return S;const O=(R==="ew"?h:d).clone(),G=c.clone().projectOnVector(O),W=a.clone().projectOnVector(O),Y=l.clone().projectOnVector(O);if(W.equals(G))return S;if(R==="ns"&&typeof this.startInfo.dragPointInCenterBottom!="boolean"){const U=new j.Vector3().subVectors(W,Y),ae=U.x<0&&O.x>=0,he=U.y<0&&O.y>=0,de=U.z<0&&O.z>=0;this.startInfo.dragPointInCenterBottom=ae||he||de}if(R==="ew"&&typeof this.startInfo.dragPointInCenterLeft!="boolean"){const U=new j.Vector3().subVectors(W,Y),ae=U.x<0&&O.x>=0,he=U.y<0&&O.y>=0,de=U.z<0&&O.z>=0;this.startInfo.dragPointInCenterLeft=ae||he||de}const _=new j.Vector3().subVectors(W,G),ee=_.length();return ee>.3?(console.warn("offset.length() > 0.3, skipped",ee),S):_},g=m("ew"),p=m("ns"),A=()=>{const R=g;this.helperObject3D.cornerPositions.forEach((S,O)=>{var G;(G=this.startInfo)!=null&&G.dragPointInCenterLeft?(O===0||O===3)&&S.add(R):(O===1||O===2)&&S.add(R)})},v=()=>{const R=p;this.helperObject3D.cornerPositions.forEach((S,O)=>{var G;(G=this.startInfo)!=null&&G.dragPointInCenterBottom?(O===0||O===1)&&S.add(R):(O===2||O===3)&&S.add(R)})};switch(u){case"ew":A();break;case"ns":v();break;case"nesw":case"nwse":A(),v()}const b=new j.Vector3().subVectors(r[1],r[0]).length()/h.length(),w=new j.Vector3().subVectors(r[3],r[0]).length()/d.length(),k=new j.Vector3(b,w,1),I=new E.Matrix4().scale(k);n.isCSS3DObjectPlus?n.applyScaleMatrix4(I):n.scale.applyMatrix4(I),o.position.copy(a);const P=new j.Vector3().addVectors(r[0],r[2]).divideScalar(2),L=new j.Vector3().subVectors(P,l),x=new E.Matrix4().setPosition(L);n.applyMatrix4(x),(F=this.helperObject3D.css3DInstance)==null||F.css3DObject.applyMatrix4(x),(N=this.helperObject3D.plane)==null||N.applyMatrix4(x),this.hooks.emit("applyObjectScale",{matrix:I}),this.hooks.emit("applyObjectPosition",{matrix:x}),this.render()}dragEnd(){!this.isDragging||(this.startInfo=void 0,this.isDragging=!1,this.hooks.emit("scaleEnd"),this.render())}}class m1 extends f1{constructor(...e){super(...e);f(this,"name","CSS3DScaleController");this.addHTMLEventListener()}addHTMLEventListener(){this.helperObject3D.points.forEach(e=>{if(!e)return;const n=e.point,o=a=>this.dragStart(a,e),s=this.dragging.bind(this),r=this.dragEnd.bind(this);n.addEventListener("dragstart",o),n.addEventListener("drag",s),n.addEventListener("dragend",r)})}}class p1 extends Mn{constructor(...e){super(...e);f(this,"name","BoundingBoxController")}}class g1 extends oc{constructor(t){super(t)}}const mo="Object3DHelperPlugin",Li=mo,v1=()=>{console.error(`${Li} is disposed`)},A1=()=>{console.warn(`${Li} is disabled`)},b1=()=>{console.error(`${Li} is disabled`)};class sc extends Dn{constructor(e){super(e);f(this,"name",mo);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 Xt(this.five.scene),console.warn("Object3DHelper: \u4F7F\u7528\u6B64\u63D2\u4EF6\uFF0C\u9700\u8981\u5728\u521D\u59CB\u5316five\u65F6\uFF0C\u8BBE\u7F6Efive\u53C2\u6570: { backgroundAlpha: 0, backgroundColor: 0x000000 }"),Object.assign(window,{[`__${mo.toUpperCase()}_DEBUG__`]:this})}show(e){return H(this,null,function*(){this.setState({visible:!0},e)})}hide(e){return H(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 v1();if(!this.state.enabled&&e.enabled!==!0&&e.disposed!==!0)return b1();const o=Q({},this.state);this.state=Q(Q({},this.state),e),e.disposed!==void 0&&e.disposed!==o.disposed&&e.disposed&&this.handleDispose(),e.visible!==void 0&&e.visible!==o.visible&&this.handleVisible(e.visible),e.enabled!==void 0&&e.enabled!==o.enabled&&this.handleEnable(e.enabled),this.hooks.emit("stateChange",{state:this.state,prevState:o})}getObject3DHelper(e){return this.objectHelperMap.get(e)}addObject3DHelper(e,n={}){var 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 o=new d1,s=[],r=(m=this.five.getElement())==null?void 0:m.parentElement,a=this.five.camera,{moveHelper:l=!0,rotateHelper:c=!0,scaleHelper:u=!0,boundingBoxHelper:h=!1}=n,d=new Ee.Subscribe;if(l){const g=new qb(e),p=this.getConfig(n.moveHelper),A=new fn(this.five,s1,e,g,p,d);o.addControllers({moveController:A.helperController}),s.push(()=>A.dispose())}if(c){const g=this.getConfig(n.rotateHelper),p=new Kb(e,Q({container:r},g)),A=new fn(this.five,h1,e,p,g,d);o.addControllers({rotateController:A.helperController}),s.push(()=>A.dispose())}if(h){const g=new o1(e),p=new fn(this.five,p1,e,g,void 0,d);o.addControllers({boundingBoxController:p.helperController})}if(u)if(e.isCSS3DObjectPlus&&r){const g=new i1(e,r,a,this.five.scene),p=new fn(this.five,m1,e,g,void 0,d);o.addControllers({scaleController:p.helperController}),s.push(()=>p.dispose()),Ia(this.five).then(()=>{var A,v;if(e.isCSS3DObjectPlus){const b=e;if(!b||b.mode!=="front")return;const w=(A=this.css3DRender.behindModeCSS3DRenderer.wrapper)!=null?A:ka(this.five);w&&(this.css3DObjectParentMap.set(b,b.parent),b.removeFromParent(),this.css3DRender.behindModeCSS3DRenderer.setWrapper(w),(v=this.css3DRender.getBehindCSS3DObjectGroup())==null||v.add(b),this.css3DRender.render(this.five.camera))}})}else{const g=new g1(e),p=new fn(this.five,Fb,e,g,void 0,d);o.addControllers({scaleController:p.helperController}),s.push(()=>p.dispose())}return this.objectHelperMap.set(e,{helper:o,disposers:s}),o.controllers}removeObject3DHelper(e){if(!this.objectHelperMap.has(e))return;const{helper:n,disposers:o}=this.objectHelperMap.get(e);if(!!n){if(e.isCSS3DObjectPlus){const s=e,r=this.css3DObjectParentMap.get(s);r&&r.add(s),this.css3DRender.render(this.five.camera)}this.objectHelperMap.delete(e),n.dispose(),o==null||o.forEach(s=>s==null?void 0:s())}}handleEnable(e,n=!0){e?(this.everyHelperDo(o=>o.enable()),this.hooks.emit("enable",{userAction:n})):(this.everyHelperDo(o=>o.disable()),this.hooks.emit("disable",{userAction:n})),this.state.enabled=e}handleVisible(e,n=!0){e?(this.everyHelperDo(o=>o.show()),this.actionIfStateIsEnabled(()=>this.hooks.emit("show",{userAction:n}))):(this.everyHelperDo(o=>o.hide()),this.actionIfStateIsEnabled(()=>this.hooks.emit("hide",{userAction:n}))),this.state.visible=e}handleDispose(){this.objectHelperMap.forEach(({helper:e,disposers:n})=>{e.dispose(),n==null||n.forEach(o=>o==null?void 0:o())})}everyHelperDo(e){this.objectHelperMap.forEach(({helper:n,disposers:o})=>{n&&e(n)})}actionIfStateIsEnabled(e,n){if(this.state.enabled)return e();n!=null&&n.warnLog&&A1()}getConfig(e){if(!!e&&typeof e!="boolean"&&e.enable)return e}}const y1=i=>new sc(i),w1=`
|
|
576
576
|
varying vec2 vUv;
|
|
577
577
|
void main() {
|
|
578
578
|
vUv = uv;
|