@realsee/dnalogel 2.16.0-2 → 2.16.0-4
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/GuideLinePlugin/typing.d.ts +4 -0
- package/dist/GuideLinePlugin/utils/createLineGeometry.d.ts +5 -1
- package/dist/index.cjs.js +39 -22
- package/dist/index.js +988 -960
- package/dist/index.umd.js +36 -19
- package/docs/assets/search.js +1 -1
- package/docs/classes/CSS3DRender.html +31 -31
- package/docs/classes/CruisePluginController.html +26 -26
- package/docs/classes/GuideLineItem.GuideLineItem.html +13 -13
- package/docs/classes/GuideLineModeItem.GuideLineModeItem.html +22 -22
- package/docs/classes/Magnifier.html +20 -20
- package/docs/classes/ModelRoomLabelController.html +11 -11
- package/docs/classes/Object3DHelperController.html +25 -25
- 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 +47 -47
- 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.isAbsoluteURL.html +5 -5
- package/docs/functions/Util.isModelLike.html +5 -5
- package/docs/functions/Util.isNil.html +5 -5
- package/docs/functions/Util.isPanoramaLike.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/Util.uuid.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/GuideLinePluginType.CatmullRomCurve3.html +10 -10
- package/docs/interfaces/GuideLinePluginType.EventMap.html +13 -13
- package/docs/interfaces/GuideLinePluginType.GuideLineGeometryStyle.html +8 -8
- package/docs/interfaces/GuideLinePluginType.GuideLineItemContainer.html +6 -6
- package/docs/interfaces/GuideLinePluginType.GuideLineMaterialStyle.html +29 -11
- package/docs/interfaces/GuideLinePluginType.LineGeometriesConfig.html +8 -8
- package/docs/interfaces/GuideLinePluginType.PluginDataV1.html +7 -7
- package/docs/interfaces/GuideLinePluginType.PluginDataV2.html +6 -6
- package/docs/interfaces/GuideLinePluginType.PluginServerData.html +7 -7
- package/docs/interfaces/GuideLinePluginType.PluginState.html +9 -9
- package/docs/interfaces/GuideLinePluginType.Route.html +10 -10
- package/docs/interfaces/GuideLinePluginType.RouteConfig.html +9 -9
- 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 +11 -11
- 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/GuideLineItem.html +5 -5
- package/docs/modules/GuideLineModeItem.html +5 -5
- package/docs/modules/GuideLinePluginType.html +5 -5
- 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/FloorplanRuleLabels.html +5 -5
- package/docs/types/FloorplanServerRuleLabels.html +5 -5
- package/docs/types/GuideLinePluginExportType.html +5 -5
- package/docs/types/GuideLinePluginType.GuideLineItem.html +5 -5
- package/docs/types/GuideLinePluginType.GuideLineModeItemMode.html +5 -5
- package/docs/types/GuideLinePluginType.GuideLineStyle.html +5 -5
- package/docs/types/GuideLinePluginType.PathItem.html +5 -5
- package/docs/types/GuideLinePluginType.PluginData.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/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/GuideLinePlugin/GuideLineItem/index.js +8 -8
- package/libs/GuideLinePlugin/GuideLineModeItem/index.js +56 -33
- package/libs/GuideLinePlugin/typing.d.ts +4 -0
- package/libs/GuideLinePlugin/utils/createLineGeometry.d.ts +5 -1
- package/libs/GuideLinePlugin/utils/createLineGeometry.js +31 -26
- package/libs/base/BasePlugin.js +1 -1
- package/libs/index.js +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var rc=Object.defineProperty,ac=Object.defineProperties;var lc=Object.getOwnPropertyDescriptors;var Bo=Object.getOwnPropertySymbols;var cc=Object.prototype.hasOwnProperty,uc=Object.prototype.propertyIsEnumerable;var Di=(i,t,e)=>t in i?rc(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e,
|
|
1
|
+
"use strict";var rc=Object.defineProperty,ac=Object.defineProperties;var lc=Object.getOwnPropertyDescriptors;var Bo=Object.getOwnPropertySymbols;var cc=Object.prototype.hasOwnProperty,uc=Object.prototype.propertyIsEnumerable;var Di=(i,t,e)=>t in i?rc(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e,F=(i,t)=>{for(var e in t||(t={}))cc.call(t,e)&&Di(i,e,t[e]);if(Bo)for(var e of Bo(t))uc.call(t,e)&&Di(i,e,t[e]);return i},fe=(i,t)=>ac(i,lc(t));var f=(i,t,e)=>(Di(i,typeof t!="symbol"?t+"":t,e),e);var G=(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 Kn=require("@tweenjs/tween.js"),Ce=require("@realsee/five"),j=require("three"),$n=require("three/examples/jsm/renderers/CSS3DRenderer"),dc=require("hammerjs"),pa=require("@realsee/five/line"),Aa=require("three/examples/jsm/loaders/FBXLoader"),hc=require("classnames"),fc=require("object-assign-deep"),mc=require("polyline-normals"),gc=require("@realsee/five/gltf-loader"),pc=require("animejs"),Ac=require("lodash.get"),vc=require("lodash.clonedeep"),bc=require("lodash.isequal"),dt=i=>i&&typeof i=="object"&&"default"in i?i:{default:i};function va(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 mi=va(Kn),bn=dt(Kn),E=va(j),Pn=dt(dc),Oe=dt(hc),rt=dt(fc),yc=dt(mc),Vo=dt(pc),Sn=dt(Ac),wc=dt(vc),Cc=dt(bc);function ba(){}const jo=()=>Promise.resolve(),Oo={__queue:Promise.resolve()};function Ec(i=jo){Oo.__queue=Oo.__queue.then(i).catch(jo)}function Mn(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 Li(i,t,e){const{x:n,y:o}=i,s=n*t,r=o*e;return{x:s,y:r}}function Tn(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 Pc(i,t,e=ba){new Promise(n=>{setTimeout(()=>{e(),n(!0)},t*i)})}const Ic=window,Ro=window.requestAnimationFrame||Ic.webkitRequestAnimationFrame||(i=>setTimeout(i,16));function Un(i,t=0){t<=0?Ro(i):Ro(()=>Un(i,t-1))}function kc(i,t,e,n=Kn.Easing.Linear.None){const o=new Kn.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 gn=Symbol("$$PAINT_BRUSH_EVENT$$");function zn(i){return i[gn]||(i[gn]={}),i[gn]}function xc(i){i[gn]||delete i[gn]}class Dc{hasListener(t){const e=zn(this);return e&&e[t]&&e[t].length>0}on(t,e,n){const o=zn(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){xc(this);return}const n=zn(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=zn(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 _e(){return(ht()+ht()+"-"+ht()+"-4"+ht().substr(0,3)+"-"+ht()+"-"+ht()+ht()+ht()).toLowerCase()}const Lc=`
|
|
2
2
|
<style type="text/css">
|
|
3
3
|
|
|
4
4
|
#_gl_paintBrush {
|
|
@@ -98,7 +98,7 @@ transition: all 500ms;
|
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
</style>
|
|
101
|
-
`;class Sc extends Dc{constructor(e){super();f(this,"configs");f(this,"clientWidth");f(this,"clientHeight");f(this,"ready",!1);f(this,"uuid",_e());f(this,"tween");f(this,"tweening",!1);f(this,"container");f(this,"canvas");f(this,"data",{});f(this,"tempLine",{});this.configs=e,this.clientWidth=document.body.clientWidth,this.clientHeight=document.body.clientHeight,this.container=this.ifInsertToDOM(),this.canvas={},this.initCtrl()}get color(){return this.configs.currentColor}get state(){return this.data}get dpr(){return this.configs.DPR||1}ifInsertToDOM(){if(this.container)return this.container;if(this.configs.container)this.configs.container.id="_gl_paintBrush",this.container=this.configs.container;else if(document.getElementById("_gl_paintBrush"))this.container=document.getElementById("_gl_paintBrush");else{const e=document.createElement("div");e.id="_gl_paintBrush",document.body.appendChild(e),this.container=e}return this.container.innerHTML=Lc,this.container}initCanvas(e){const n=document.createElement("canvas");n.className=e,n.width=this.clientWidth,n.height=this.clientHeight;const o=n.getContext("2d");if(!!o)return o.lineWidth=5*this.dpr,o.lineCap="round",o.lineJoin="round",this.container.appendChild(n),n}initCtrl(){const e=document.createElement("div");e.className="_paintBrush-ctrl";const n=document.createElement("div");n.className="_paintBrush-ctrlinner";const o=document.createElement("a");o.className="_paintBrush-ctrlitem _paintBrush-ctrlitem--undo",o.addEventListener("click",a=>{var d;if(a.stopPropagation(),this.configs.onClickUndo&&this.configs.onClickUndo(),!this.canvas[this.uuid]||!this.data[this.uuid]||this.data[this.uuid].length===0)return;const l=this.data[this.uuid].pop();l&&this.emitStateChange({type:at.Undo,color:this.color,ready:this.ready,state:l,uuid:this.uuid});const c=(d=this.canvas[this.uuid])==null?void 0:d.getContext("2d");if(!this.canvas[this.uuid])return;const{width:u,height:h}=this.canvas[this.uuid];c&&c.clearRect(0,0,u,h),this.data[this.uuid].forEach(m=>this.handleDrawLine(this.uuid,m,{withUndo:!0}))});const s=document.createElement("a");return s.className="_paintBrush-ctrlitem _paintBrush-ctrlitem--close",s.addEventListener("click",a=>{a.stopPropagation(),this.closeBrush(),this.configs.onClickClose&&this.configs.onClickClose()}),[o,s].forEach(a=>{const l=document.createElement("i");l.className="brush-icon";const c=document.createElement("span");c.className="brush-txt",c.innerText=a.className.endsWith("undo")?this.configs.onUndoText:this.configs.onExitText,a.appendChild(l),a.appendChild(c)}),n.appendChild(o),n.appendChild(s),e.appendChild(n),this.container.appendChild(e),e}openBrush(){if(this.ready)return;this.canvas[this.uuid]||(this.canvas[this.uuid]=this.initCanvas("_paintBrush-canvas")),this.container.className="brushing";const e=this.canvas[this.uuid];e.getContext("2d").clearRect(0,0,e.width,e.height),this.openBrushHandle(),this.ready=!0,this.emit("readyChange",!0)}closeBrush(){!this.ready||(this.container.className="",this.data={},this.tempLine={},Object.keys(this.canvas).forEach(e=>{this.canvas[e].ontouchstart=()=>!1,this.canvas[e].ontouchmove=()=>!1,this.canvas[e].ontouchend=()=>!1,this.canvas[e].ontouchcancel=()=>!1;const n=this.canvas[e].getContext("2d");n&&n.clearRect(0,0,this.canvas[e].width,this.canvas[e].height)}),this.ready=!1,this.emit("readyChange",!1),this.emitStateChange({type:at.Exit,color:this.color,ready:!1,uuid:this.uuid}))}updateCurrentColor(e){const n=this.canvas[this.uuid];if(!n)return;const o=n.getContext("2d");!o||(this.configs.currentColor=e,o.strokeStyle=e)}openBrushHandle(){const e=this.canvas[this.uuid];if(!e)return;const n=e.getContext("2d");if(!n)return;const o=this.color||"#6D92FF";n.strokeStyle=o;let s=null,r=[],a,l=[],c=0;const u=(h,d,m)=>{const g=this.color||"#ff0000";n.strokeStyle=g,n.beginPath(),n.moveTo(h.x,h.y),n.quadraticCurveTo(d.x,d.y,m.x,m.y),n.stroke()};e.onmousedown=h=>{h.preventDefault(),c=Date.now();const d=h.clientX,m=h.clientY;r=[],r.push({x:d,y:m}),s={x:d,y:m},a=Mn({x:d,y:m},this.clientWidth,this.clientHeight),l=[]},e.onmousemove=h=>{if(h.preventDefault(),!s)return;const d=Number(h.clientX),m=Number(h.clientY);if(Math.abs(d-s.x)<5&&Math.abs(m-s.y)<5||(r.push({x:d,y:m}),l.push(Mn({x:d,y:m},this.clientWidth,this.clientHeight)),r.length<3))return;const{control:g,end:p}=Tn(r);!g||!p||(u(s,g,p),s=p)},e.onmouseup=h=>{if(h.preventDefault(),s=null,r.length<3)return;this.data[this.uuid]||(this.data[this.uuid]=[]);const d=Date.now()-c,m={move:Object.assign({},a),uuid:this.uuid,line:[...l],color:this.color,duration:d<1280?d:d<2e3?1280:0};this.data[this.uuid].push(m),Un(()=>{this.emitStateChange({type:at.Drawline,color:this.color,ready:this.ready,state:m,uuid:this.uuid})})},e.ontouchstart=h=>{h.preventDefault(),c=Date.now();const d=h.touches[0].clientX,m=h.touches[0].clientY;r=[],r.push({x:d,y:m}),s={x:d,y:m},a=Mn({x:d,y:m},this.clientWidth,this.clientHeight),l=[]},e.ontouchmove=h=>{if(h.preventDefault(),!s)return;const d=Number(h.touches[0].clientX),m=Number(h.touches[0].clientY);if(Math.abs(d-s.x)<5&&Math.abs(m-s.y)<5||(r.push({x:d,y:m}),l.push(Mn({x:d,y:m},this.clientWidth,this.clientHeight)),r.length<3))return;const{control:g,end:p}=Tn(r);!g||!p||(u(s,g,p),s=p)},e.ontouchend=e.ontouchcancel=h=>{if(h.preventDefault(),s=null,r.length<3)return;this.data[this.uuid]||(this.data[this.uuid]=[]);const d=Date.now()-c,m={move:Object.assign({},a),line:[...l],uuid:this.uuid,color:this.color,duration:d<1280?d:d<2e3?1280:0};this.data[this.uuid].push(m),Un(()=>{this.emitStateChange({type:at.Drawline,color:this.color,ready:this.ready,state:m,uuid:this.uuid})})}}emitStateChange(e,n=!0){if(e.type!==at.Drawline){this.emit("stateChange",e,n);return}const o=Date.now(),s=e.state;if(!s||!s.line)return;const r=Math.ceil(s.line.length/100);for(let a=0;a<r;a++){const l={uuid:this.uuid,color:this.color,ready:this.ready,type:e.type,state:{uuid:this.uuid,move:s.move,duration:s.duration,color:this.color,line:s.line.slice(a*100,(a+1)*100)},timestamp:o,end:a===r-1};Pc(a,20,()=>{this.emit("stateChange",l,n)})}}action(e){const{ready:n,type:o,uuid:s}=e;if(!n&&this.ready){this.closeBrush();return}if(n&&!this.ready){this.openBrush();return}if(!!this.ready)switch(o){case at.Drawline:const{state:r,timestamp:a,end:l}=e;if(!a||!r)return;this.tempLine[a]=[].concat(this.tempLine[a]||[],r.line),l&&(Object.assign(r,{line:this.tempLine[a]}),this.handleDrawLine(s,r,{},()=>delete this.tempLine[a]));break;case at.Undo:this.handleUndo(s);break}}handleDrawLine(e,n,{withUndo:o=!1},s=ba){!n||Object.prototype.toString.call(n)!="[object Object]"||Object.keys(n).length===0||Ec(()=>new Promise(r=>{if(o||(this.canvas[e]||(this.canvas[e]=this.initCanvas("_paintBrush-canvas--sync")),this.data[e]||(this.data[e]=[]),this.data[e].push(n)),!this.canvas[e])return;const a=this.canvas[e].getContext("2d");if(!a)return;const{line:l=[],color:c="black",duration:u=0,uuid:h}=n,d=Li(n.move||{},this.clientWidth,this.clientHeight);let m=[d];if(a.strokeStyle=c,a.beginPath(),a.moveTo(d.x,d.y),u&&!o){let g=[];const p=this;p.tween=kc({step:0},{step:l.length-1},u).onUpdate(({step:A})=>{var b;if(p.tweening=!0,!p.ready)return a.clearRect(0,0,p.canvas[h].width,p.canvas[h].height),(b=p.tween)==null?void 0:b.stop();const v=Math.floor(A);if(!g.find(w=>w===v)){if(g.push(v),m.push(Li(l[v],p.clientWidth,p.clientHeight)),m.length<3)return;const{control:w,end:k}=Tn(m);if(!w||!k)return;a.quadraticCurveTo(w.x,w.y,k.x,k.y),a.stroke()}}).onComplete(A=>{p.tween=void 0,p.tweening=!1,g=[],m=[],s&&s(),r()})}else{for(let g=0;g<l.length;g++){if(m.push(Li(l[g],this.clientWidth,this.clientHeight)),m.length<3)continue;const{control:p,end:A}=Tn(m);!p||!A||a.quadraticCurveTo(p.x,p.y,A.x,A.y)}a.stroke(),m=[],s&&s(),r()}}))}handleUndo(e){if(!this.canvas[e]||!this.data[e]||this.data[e].length===0)return;this.data[e].pop();const n=()=>{var s;const o=(s=this.canvas[e])==null?void 0:s.getContext("2d");o&&o.clearRect(0,0,this.canvas[e].width,this.canvas[e].height),this.data[e].forEach(r=>this.handleDrawLine(e,r,{withUndo:!0}))};if(this.tween&&this.tweening){this.tween.stop(),Un(n,60);return}n()}destroyBrush(){this.closeBrush(),this.ready=!1,this.emit("readyChange",!0)}}class Mc{constructor(t={}){f(this,"controller");const e=Object.assign({currentColor:"#f44336",onUndoText:"\u56DE\u9000",onExitText:"\u5173\u95ED"},t);this.controller=new Sc(e)}on(t,e){this.controller.on(t,e)}off(t,e){this.controller.off(t,e)}once(t,e){this.controller.once(t,e)}show(){this.controller.openBrush()}action(t){this.controller.action(t)}get state(){return this.controller.state}get configs(){return this.controller.configs}dispose(){return this.controller.destroyBrush()}setCurrentColor(t){this.controller.updateCurrentColor(t)}}const Tc=(i,t)=>{var O,S;let e=(S=(O=t==null?void 0:t.initialState)==null?void 0:O.enabled)!=null?S:!0,n=!1,o=!0,s=null;const a=Q(Q({},{lookAtCurrentCamera:!1,lockedPanoIndex:null,lockedLatitude:null,lockedLongitude:null}),t==null?void 0:t.config),l=new E.Scene,c=new Ce.Camera(60);let u=new E.Object3D,h,d;{const F=new E.DirectionalLight(16777215,.5);F.position.copy(new E.Vector3(1,1,1)),l.add(F)}{const F=new E.DirectionalLight(16777215,.3);l.add(F)}{const F=new E.AmbientLight(16777215,.3);l.add(F)}l.add(u);const m=()=>{if(n)return;h=C(i.model,c.fov,c.aspect),d=i.model.bounding.getCenter(new E.Vector3),l.remove(u),u=G(i.model),l.add(u),n=!0,B();function F(Y){const W=Y.clone();return W.uniforms.modelAlpha.value=1,W.uniforms.map.value&&(W.uniforms.map.value.needsUpdate=!0),W}function G(Y){if(Y instanceof E.Mesh){const W=Y.geometry,ee=Array.isArray(Y.material)?Y.material.map(F):F(Y.material);return new E.Mesh(W,ee)}else if(Y instanceof E.Group){const W=new E.Group;return Y.children.forEach(ee=>W.add(G(ee))),W}else{const W=new E.Object3D;return Y.children.forEach(ee=>W.add(G(ee))),W}}},g=()=>{if(!!i.renderer)return s||(s=new E.WebGLRenderer({antialias:!1,alpha:!0}),s.setPixelRatio(i.renderer.getPixelRatio()),s.outputEncoding=E.sRGBEncoding,s.setClearColor(1579548,0),s.autoClear=!0),s},p=()=>{u.traverse(F=>{F instanceof E.Mesh&&[].concat(F.material).forEach(Y=>Y.dispose())}),l.remove(u),u=new E.Object3D,l.add(u),n=!1,B()},A=()=>{!e||n||m()},v=()=>{e||(e=!0,l.add(u),!n&&i.model.loaded&&m(),B())},b=()=>{!e||(l.remove(u),o=!0,x(),e=!1)},w=(F,G={})=>{const Y=g();if(!Y)return;F.appendChild(Y.domElement),k(G);const W=window.getComputedStyle(F).position;W!=="relative"&&W!=="absolute"&&W!=="fixed"&&W!=="sticky"&&(F.style.position="relative")},k=(F={})=>{if(!s)return;const Y=s.domElement.parentNode;if(Y!=null&&Y.nodeName){const{width:W=Y.offsetWidth,height:ee=Y.offsetHeight}=F;s.setSize(W,ee),c.aspect=W/ee,c.updateProjectionMatrix()}B()};function C(F,G,Y){const W=F.bounding,ee=Math.pow(Math.pow(W.max.x-W.min.x+1,2)+Math.pow(W.max.y-W.min.y+1,2)+Math.pow(W.max.z-W.min.z+1,2),1/2);let U=ee/2/Math.tan(Math.PI*G/360);return Y<1&&(U=U/Y),isNaN(U)?ee:U}function I(F){return i.work.observers[F].standingPosition.clone()}const B=()=>{if(!e||!h||!d)return;const F=i.getPose();F.fov=c.fov,F.offset=d,F.distance=h,typeof a.lockedLatitude=="number"&&(F.latitude=a.lockedLatitude),typeof a.lockedLongitude=="number"&&(F.longitude=a.lockedLongitude),typeof a.lockedPanoIndex=="number"&&(F.offset=I(a.lockedPanoIndex)),a.lookAtCurrentCamera&&(F.offset=i.camera.position.clone().setY(i.camera.position.y+1)),c.setFromPose(F),o=!0},x=()=>{!e||o!==!0||!s||!s.domElement.parentNode||s.domElement.parentNode.offsetWidth===0||(s.render(l,c),o=!1)},H=()=>{s&&s.dispose(),s=null},N=F=>{Object.assign(a,F),B()},R=()=>({enabled:e});return Object.assign(window,{camera:c}),i.on("modelLoaded",A),i.on("modelWillLoad",p),i.on("cameraDirectionUpdate",B),i.on("dispose",H),i.on("renderFrame",x),i.on("cameraPositionUpdate",B),{appendTo:w,refresh:k,changeConfigs:N,enable:v,disable:b,getCurrentState:R}};function pt(...i){const t=[];return i.forEach(e=>{e.isCSS3DObjectPlus?t.push(e):t.push(...pt(...e.children))}),t}function ei(i,t){const e=Math.round(i);return e%2===0?e:e+Number(t!=null&&t.floor?-1:1)}function zc(i,t,e=!0){if(!i)return console.error("createResizeObserver: element is undefined"),{observe:()=>{},unobserve:()=>{}};const n=()=>{const s=ei(i.clientWidth,{floor:!0}),r=ei(i.clientHeight,{floor:!0});t(s,r)};if(typeof ResizeObserver=="undefined"||!ResizeObserver)return console.warn("createResizeObserver: ResizeObserver is undefined"),{observe:()=>n(),unobserve:()=>{}};const o=new ResizeObserver(n);return e&&n(),{observe:()=>o.observe(i),unobserve:()=>o.unobserve(i)}}class Qo extends $n.CSS3DRenderer{constructor(){super();f(this,"wrapper");f(this,"requestAnimationFrameId");f(this,"resizeDisoper");this.domElement.style.position="absolute",this.domElement.style.top="0",this.domElement.style.left="0",this.domElement.style.userSelect="none",this.domElement.style.pointerEvents="none"}setWrapper(e){if(!e)throw new Error("CSS3DRenderer: wrapper is required");if(e.contains(this.domElement))return;const n=this.wrapper;return n&&n.contains(this.domElement)&&this.domElement.remove(),this.appendToElement(e),this.wrapper=e,this}appendToElement(e){e.appendChild(this.domElement);const n=(r,a)=>this.setSize(r,a),{observe:o,unobserve:s}=zc(e,n,!0);o(),this.resizeDisoper=s,this.wrapper=e}renderEveryFrame(e,n){if(this.wrapper||console.warn("wrapper is not find, creating a html element and call setWrapper(wrapper)",this,e),this.requestAnimationFrameId)return;const o=()=>{this.requestAnimationFrameId=requestAnimationFrame(o),!!e.visible&&pt(e).length!==0&&this.render(e,n)};o()}stopRender(){this.requestAnimationFrameId&&cancelAnimationFrame(this.requestAnimationFrameId)}dispose(){var e;this.stopRender(),(e=this.resizeDisoper)==null||e.call(this),this.domElement.remove()}}function Bc(i){return typeof Symbol=="undefined"?`$Symbol<${i}>$`:Symbol(i)}const pn=Bc("$$EVENT$$");function Bn(i){return i[pn]||(i[pn]={}),i[pn]}function Vc(i){i[pn]||delete i[pn]}class Jt{hasListener(t){const e=Bn(this);return Boolean((e==null?void 0:e[t])&&e[t].length>0)}on(t,e,n){const o=Bn(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=Bn(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=Bn(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}}const jc=({x:i,y:t,z:e})=>new j.Vector3(i,t,e),qe=i=>new j.Vector3().fromArray(i),yn=i=>i instanceof j.Vector3?i:Array.isArray(i)?qe(i):jc(i);class Oc extends E.Mesh{constructor(e,n){const o=new E.MeshBasicMaterial({opacity:0,color:0,transparent:!1,side:E.DoubleSide}),s=new E.PlaneGeometry(e,n);super(s,o);f(this,"name","opacity-mesh")}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}}function In(...i){const t=new j.Vector3;return i.forEach(e=>{t.add(e)}),t.divideScalar(i.length),t}const ya=1,Rc=`CSS3DObjectPlus@${ya}`,Qc=.00216,Fc=.003;class Hc extends $n.CSS3DObject{constructor(e){var C,I,B;const n=e.container,o=e.cornerPoints,s=(C=e.ratio)!=null?C:Fc,r=(I=e.dpr)!=null?I:1,a=(B=e.pointerEvents)!=null?B:"auto",l=Math.max(Qc,s),c=o[0].distanceTo(o[1]),u=o[1].distanceTo(o[2]),h=ei(c/s*r),d=ei(u/s*r),m=In(...o);let g;if(l===s)n.style.width=`${h}px`,n.style.height=`${d}px`,g=n;else{const x=document.createElement("div");x.style.width=`${h}px`,x.style.height=`${d}px`,x.style.pointerEvents="none";const H=s/l;n.style.position="absolute",n.style.left="0",n.style.top="0",n.style.width=`${H*h}px`,n.style.height=`${H*d}px`,x.appendChild(n),g=x}super(g);f(this,"version",ya);f(this,"isCSS3DObjectPlus",!0);f(this,"container");f(this,"width");f(this,"height");f(this,"domWidthPx");f(this,"domHeightPx");f(this,"cornerPoints");f(this,"centerPosition");f(this,"ratio");f(this,"mode","front");f(this,"hooks",new Jt);f(this,"opacityMesh");f(this,"selfVisible",!0);f(this,"parentVisibleListenerDisposer");f(this,"createOpacityMesh",e=>{const{domWidthPx:n,domHeightPx:o}=e,s=new Oc(n,o);return s.position.copy(e.position),s.rotation.copy(e.rotation),s.scale.copy(e.scale),s});f(this,"addParentVisibleListener",()=>{var e;if((e=this.parent)!=null&&e.isCSS3DGroup){const n=this.parent,o=s=>{this.setVisible(s&&this.selfVisible,{setSelfVisible:!1})};n.hooks.on("visibleChange",o),this.parentVisibleListenerDisposer=()=>n.hooks.off("visibleChange",o)}});f(this,"removeParentVisibleListener",()=>{var e;(e=this.parentVisibleListenerDisposer)==null||e.call(this)});if(n.style.pointerEvents=a,this.scale.set(l,l,l),this.cornerPoints=o,this.ratio=s,this.container=n,e.mode&&(this.mode=e.mode),l===s)this.width=c,this.height=u,this.domWidthPx=h,this.domHeightPx=d,this.centerPosition=m;else{const x=s/l;this.width=x*c,this.height=x*u,this.domWidthPx=x*h,this.domHeightPx=x*d,this.centerPosition=new j.Vector3().subVectors(m,o[0]).multiplyScalar(x).add(o[0])}n.classList.add(`${Rc}__container`);const p=new j.Vector3().subVectors(o[1],o[0]),A=new j.Vector3().subVectors(o[3],o[0]),v=new j.Vector3().crossVectors(p,A).normalize();this.lookAt(v);const b=this.up.clone().applyQuaternion(this.quaternion),w=A.clone(),k=new j.Vector3().crossVectors(b,w).normalize();this.rotateOnWorldAxis(k,b.angleTo(w)),this.position.copy(m),this.addEventListener("added",()=>{var x;this.mode==="front"&&((x=this.opacityMesh)==null||x.removeFromParent()),this.addParentVisibleListener()}),this.addEventListener("removed",()=>{var x;(x=this.opacityMesh)==null||x.removeFromParent(),this.removeParentVisibleListener()})}setVisible(e,n={setSelfVisible:!0}){n.setSelfVisible&&(this.selfVisible=e),this.visible=e,this.opacityMesh&&(this.opacityMesh.visible=e)}removeFromParent(){var n;const e=this.parent;return e!==null&&e.remove(this),(n=this.opacityMesh)==null||n.removeFromParent(),this}removeOpacityMesh(){var e;return(e=this.opacityMesh)==null||e.removeFromParent(),this.opacityMesh=void 0,this}dispose(){var e;this.container.remove(),this.removeFromParent(),(e=this.opacityMesh)==null||e.removeFromParent()}getOpacityMesh(){if(this.opacityMesh)return this.opacityMesh;{const e=this.createOpacityMesh(this);return this.opacityMesh=e,e}}applyMatrix4(e){var n;super.applyMatrix4(e),(n=this.opacityMesh)==null||n.applyMatrix4(e)}applyQuaternion(e){var n;return super.applyQuaternion(e),(n=this.opacityMesh)==null||n.applyQuaternion(e),this}applyScaleMatrix4(e){var n;this.scale.applyMatrix4(e),(n=this.opacityMesh)==null||n.scale.applyMatrix4(e)}}class _c extends E.Scene{constructor(){super()}add(...t){return super.add(...t),pt(...t).forEach(e=>{e.mode="front"}),this}}class Gc extends E.Scene{constructor(e){super();f(this,"scene");if(!e)throw new Error("CSS3DBehindScene: scene is required");this.scene=e}add(...e){return super.add(...e),pt(...e).forEach(n=>{n.mode="behind",this.scene.add(n.getOpacityMesh())}),this}remove(...e){return pt(...e).forEach(n=>{var o;(o=n.opacityMesh)==null||o.removeFromParent(),n.opacityMesh=null}),super.remove(...e),this}}class wa extends E.Group{constructor(e){super();f(this,"isCSS3DGroup",!0);f(this,"mode");f(this,"CSS3DObjectLength",0);f(this,"hooks",new Jt);this.mode=e}add(...e){return pt(...e).forEach(n=>{n.mode=this.mode}),super.add(...e),this.updateLength(),this}setVisible(e){this.visible=e,this.hooks.emit("visibleChange",e)}remove(...e){return super.remove(...e),this.updateLength(),this}updateLength(){this.CSS3DObjectLength=pt(this).length}}class Wc extends wa{constructor(){super("front")}}class Nc extends wa{constructor(e){super("behind");f(this,"scene");if(!e)throw new Error("CSS3DBehindScene: scene is required");this.scene=e}add(...e){return pt(...e).forEach(n=>{this.scene.add(n.getOpacityMesh())}),super.add(...e),this}}const Xc=3,qi="CSS3DRenderer",fn=`${qi}@${Xc}`,Vt=()=>{console.error(`${fn} is disposed`)},Se={css3DObjects:[],frontModeStore:{css3DRenderer:new Qo},behindModeStore:{css3DRenderer:new Qo}};function Fo(i){return Se.css3DObjects.find(t=>t.id===i)}function Yc(i){Se.frontModeStore.css3DRenderer.setWrapper(i)}function Uc(i){Se.behindModeStore.css3DRenderer.setWrapper(i)}class Wt{constructor(t){f(this,"hooks",new Jt);f(this,"state",{enabled:!0,visible:!0,disposed:!1});f(this,"_scene");f(this,"store",{frontModeGroup:new Wc});f(this,"create3DElement",(t,e,n)=>{if(this.state.disposed)return Vt();const o=(()=>{const k={ratio:.00216,devicePixelRatio:1,mode:"front",autoRender:!0,container:document.createElement("div"),pointerEvents:"none"};return Object.assign(k,n)})(),s=e.map(yn);if((s==null?void 0:s.length)<4)return console.error(`${fn}: requires 4 point but params may have fewer`);const{ratio:r,devicePixelRatio:a,mode:l,autoRender:c,container:u,pointerEvents:h}=o;let d=!1;const m=this.createObject(s,{ratio:r,dpr:a,container:u,mode:l,pointerEvents:h});Se.css3DObjects.push(m),o.scene&&this.setScene(o.scene);const g=()=>{if(d)return;const k=m.mode==="front"?this.getFrontCSS3DObjectGroup():this.getBehindCSS3DObjectGroup();!k||k.add(m)},p=()=>{d||(g(),this.render(t),this.hooks.emit("render"))},A=k=>this.setVisibleById(m.id,k),v=k=>this.setEnabledById(m.id,k),b=()=>(d=!0,m.removeFromParent(),!0),w=l==="front"?Se.frontModeStore.css3DRenderer:Se.behindModeStore.css3DRenderer;return c&&p(),{id:m.uuid,container:u,css3DObject:m,render:c?void 0:p,show:()=>A(!0),hide:()=>A(!1),setVisible:A,enable:()=>v(!0),disable:()=>v(!1),setEnabled:v,dispose:b,appendToElement:k=>w.setWrapper(k)}});f(this,"setVisibleById",(t,e)=>{var n;(n=Fo(t))==null||n.setVisible(e)});f(this,"setEnabledById",(t,e)=>{const n=Fo(t);if(!n)return;const o=n.mode==="front"?this.getFrontCSS3DObjectGroup({addGroupIfNotExists:!1}):this.getBehindCSS3DObjectGroup({addGroupIfNotExists:!1});!o||(e?o.add(n):o.remove(n))});f(this,"createObject",(t,e)=>{const n=new Hc(Q({cornerPoints:t},e));return n.element.classList.add(`${qi}__container`),n.element.id=`${qi}__container--${n.uuid}`,n});t&&this.setScene(t)}get scene(){return this._scene||console.error("scene doesn't exist!, please call setScene(scene) first"),this._scene}static get frontModeCSS3DRenderer(){return Se.frontModeStore.css3DRenderer}static get behindModeCSS3DRenderer(){return Se.behindModeStore.css3DRenderer}get frontModeCSS3DRenderer(){return Se.frontModeStore.css3DRenderer}get behindModeCSS3DRenderer(){return Se.behindModeStore.css3DRenderer}setScene(t){this._scene=t}getCurrentState(){return this.state}setState(t,e={userAction:!0}){if(this.state.disposed)return Vt();const n=Q({},this.state);this.state=Object.assign(this.state,t),n.visible!==this.state.visible&&(t.visible?this.handleShow():this.handleHide()),n.enabled!==this.state.enabled&&(t.enabled?this.handleEnable():this.handleDisable()),n.disposed!==this.state.disposed&&this.handleDispose(),this.hooks.emit("stateChange",{state:this.state,prevState:n,userAction:e.userAction})}dispose(){this.setState({disposed:!0}),this.hooks.emit("dispose")}show(){return _(this,arguments,function*({userAction:t}={userAction:!0}){if(this.state.disposed)return Vt();this.setState({visible:!0},{userAction:t}),this.hooks.emit("show",{userAction:t})})}hide(){return _(this,arguments,function*({userAction:t}={userAction:!0}){if(this.state.disposed)return Vt();this.setState({visible:!1},{userAction:t}),this.hooks.emit("hide",{userAction:t})})}enable({userAction:t}={userAction:!0}){if(this.state.disposed)return Vt();this.setState({enabled:!0},{userAction:t}),this.hooks.emit("enable",{userAction:t})}disable({userAction:t}={userAction:!0}){if(this.state.disposed)return Vt();this.setState({enabled:!1},{userAction:t}),this.hooks.emit("disable",{userAction:t})}getFrontCSS3DScene({createSceneIfNotExists:t=!1}={}){var n;const e=(n=Se.frontModeStore)==null?void 0:n.css3DScene;if(e)return e;if(t){const o=new _c;Se.frontModeStore.css3DScene=o}return Se.frontModeStore.css3DScene}getBehindCSS3DScene({createSceneIfNotExists:t=!1}={}){var n,o;const e=(n=Se.behindModeStore)==null?void 0:n.css3DScene;if(e)return e;if(t){const s=(o=Se.behindModeStore.scene)!=null?o:this.scene;if(!s){console.error(`${fn}: scene is required when mode is behind`);return}const r=new Gc(s);Se.behindModeStore.css3DScene=r,Se.behindModeStore.scene=s}return Se.behindModeStore.css3DScene}getFrontCSS3DObjectGroup({addGroupIfNotExists:t=!0}={}){const e=this.getFrontCSS3DScene({createSceneIfNotExists:t});return t&&e&&(e.getObjectById(this.store.frontModeGroup.id)||e.add(this.store.frontModeGroup)),this.store.frontModeGroup}getBehindCSS3DObjectGroup({addGroupIfNotExists:t=!0}={}){var n;const e=this.getBehindCSS3DScene({createSceneIfNotExists:t});if(t&&e&&this.scene){const o=(n=this.store.behindModeGroup)!=null?n:new Nc(this.scene);this.store.behindModeGroup=o,e.getObjectById(o.id)||e.add(o)}return this.store.behindModeGroup}render(t){var e,n;if(this.getFrontCSS3DObjectGroup({addGroupIfNotExists:!1}).CSS3DObjectLength>0){const o=this.getFrontCSS3DScene({createSceneIfNotExists:!0});if(!o)return console.error(`${fn}: css3DScene is required when mode is front`);Se.frontModeStore.css3DRenderer.renderEveryFrame(o,t)}if(((n=(e=this.getBehindCSS3DObjectGroup({addGroupIfNotExists:!1}))==null?void 0:e.CSS3DObjectLength)!=null?n:0)>0){const o=this.getBehindCSS3DScene({createSceneIfNotExists:!0});if(!o)return console.error(`${fn}: css3DScene is required when mode is behind`);Se.behindModeStore.css3DRenderer.renderEveryFrame(o,t)}}handleShow(){return _(this,null,function*(){var t;this.store.frontModeGroup.setVisible(!0),(t=this.store.behindModeGroup)==null||t.setVisible(!0)})}handleHide(){return _(this,null,function*(){var t;this.store.frontModeGroup.setVisible(!1),(t=this.store.behindModeGroup)==null||t.setVisible(!1)})}handleEnable(){var t,e;(t=this.getFrontCSS3DScene())==null||t.add(this.store.frontModeGroup),this.store.behindModeGroup&&((e=this.getBehindCSS3DScene())==null||e.add(this.store.behindModeGroup))}handleDisable(){var t,e,n;this.store.frontModeGroup.children.forEach(o=>{o instanceof $n.CSS3DObject&&o.element instanceof Element&&o.element.parentNode!==null&&o.element.remove()}),(t=this.store.behindModeGroup)==null||t.children.forEach(o=>{o instanceof $n.CSS3DObject&&o.element instanceof Element&&o.element.parentNode!==null&&o.element.remove()}),(e=this.getFrontCSS3DScene())==null||e.remove(this.store.frontModeGroup),this.store.behindModeGroup&&((n=this.getBehindCSS3DScene())==null||n.remove(this.store.behindModeGroup))}handleDispose(){this.handleDisable()}}f(Wt,"setFrontModeContainer",Yc),f(Wt,"setBehindModeContainer",Uc);function Ca(i){return _(this,null,function*(){return new Promise(t=>{var e;if((e=i.model)!=null&&e.loaded){t();return}else i.once("modelLoaded",()=>t())})})}const Ue=document.createElement("div");Ue.classList.add("behindFiveElement");Ue.style.position="absolute";Ue.style.top="0";Ue.style.left="0";Ue.style.width="100%";Ue.style.height="100%";Ue.style.pointerEvents="none";function Ea(i){var n,o,s,r,a;const t=(a=(o=Si(i.getElement()))!=null?o:Si((n=i.getElement())==null?void 0:n.parentElement))!=null?a:Si((r=(s=i.getElement())==null?void 0:s.parentElement)==null?void 0:r.parentElement),e=t==null?void 0:t.parentElement;if(e)return e.contains(Ue)||t.parentElement.insertBefore(Ue,t),Ue;console.error("Can not find a valid element to insert behindFiveElement. How to fix it: https://github.com/realsee-developer/dnalogel/tree/main/plugins/src/CSS3DRenderPlugin/README.md")}function Si(i){var a;if(!i)return;const t=(a=i.style.position)!=null?a:getComputedStyle(i).position;if(t!=="fixed"&&t!=="absolute"&&t!=="relative")return;const e=getComputedStyle(i),n=e.backgroundColor,o=e.backgroundImage;if(!(n!=="transparent"&&n!=="rgba(0, 0, 0, 0)"&&n!==""||o!=="none"&&o!==""))return i}class Ji{constructor(t=0,e=0){f(this,"min");f(this,"max");f(this,"isInterval",!0);this.min=t,this.max=e}fromArray(t){return this.min=t[0],this.max=t[1],this}isOverlap(t){return Math.min(this.max,t.max)<Math.max(this.min,t.min)}contains(t){return this.min<t.min&&this.max>t.max}}class qc{constructor(t,e){f(this,"min");f(this,"max");f(this,"xInterval");f(this,"yInterval");f(this,"isRectangle",!0);this.min=t,this.max=e,this.xInterval=new Ji(this.min.x,this.max.x),this.yInterval=new Ji(this.min.y,this.max.y)}isOverlapWithRectangle(t){return!this.xInterval.isOverlap(t.xInterval)&&!this.yInterval.isOverlap(t.yInterval)}containsRect(t){return this.xInterval.contains(t.xInterval)&&this.yInterval.contains(t.yInterval)}}function uo(i){return i==="Panorama"||i==="DepthPanorama"||i==="VRPanorama"||i==="XRPanorama"}function Pa(i){return!uo(i)}function Vn(i,t,e){const n=i[t],o=i[e];!n||!o||(i[t]=o,i[e]=n)}function Jc(i,t,e){const n=e/2;for(let o=1;o<=n;o++){const s=e-(o-1);for(let r=1;r<=t;r++){const a=(o-1)*t+r-1,l=(s-1)*t+r-1;Vn(i,a*4+0,l*4+0),Vn(i,a*4+1,l*4+1),Vn(i,a*4+2,l*4+2),Vn(i,a*4+3,l*4+3)}}}class Ia{constructor(t,e){f(this,"width");f(this,"height");f(this,"containerDom");f(this,"hooks",new Ce.Subscribe);f(this,"canvas",document.createElement("canvas"));f(this,"five");f(this,"scale");f(this,"config");f(this,"offset",{x:0,y:0});f(this,"context");f(this,"renderCenter",new E.Vector3);f(this,"hammer");f(this,"state",{enabled:!1});f(this,"onPan",t=>{if(!this.containerDom||this.hooks.emit("wantsPanGesture",t))return;const n=this.offset.x+t.deltaX,o=this.offset.y+t.deltaY;this.canvas.style.boxShadow="0 2px 30px 0 rgba(0,0,0,0.20)",this.canvas.style.transform=`translate3d(${n}px, ${o}px, 100px)`});f(this,"onPanEnd",t=>{this.offset={x:this.offset.x+t.deltaX,y:this.offset.y+t.deltaY},this.canvas.style.boxShadow="none"});var o,s,r;if(!t.renderer)throw new Error("Five Render \u672A\u521D\u59CB\u5316");this.five=t,this.scale=(o=e==null?void 0:e.scale)!=null?o:2,this.width=(s=e==null?void 0:e.width)!=null?s:190,this.height=(r=e==null?void 0:e.height)!=null?r:190,this.config={dragEnabled:(e==null?void 0:e.dragEnabled)||!1,autoFixPCPosition:(e==null?void 0:e.autoFixPCPosition)||!1,initialPosition:(e==null?void 0:e.initialPosition)||{left:"0",top:"0"}};const n=this.canvas.getContext("2d");if(!n)throw new Error("CANNOT CREATE CONTEXT2D");this.context=n,this.config.dragEnabled&&(this.hammer=new Pn.default(this.canvas),this.hammer.on("pan",this.onPan),this.hammer.on("panend",this.onPanEnd)),this.initStyle()}dispose(){var t;this.clear(),this.disable(),(t=this.hammer)==null||t.destroy()}enable(){var t;if(!this.state.enabled)return this.state.enabled=!0,(t=this.containerDom)==null||t.append(this.canvas),this}disable(){if(!!this.state.enabled)return this.state.enabled=!1,this.canvas.remove(),this}appendTo(t){var e;return this.containerDom&&((e=this.containerDom)==null||e.removeChild(this.canvas)),this.containerDom=t,this.state.enabled&&t.append(this.canvas),this}clear(){return this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this}renderWithPoint(t){!this.containerDom||!this.state.enabled||(this.renderCenter=t,this.render(),this.config.autoFixPCPosition&&this.autoFixPCPosition())}autoFixPCPosition(){if(!this.containerDom)return;const{width:t,height:e}=this,n=this.renderCenter.clone().project(this.five.camera),o=(n.x+1)/2*this.containerDom.clientWidth,s=-(n.x-1)/2*this.containerDom.clientWidth,r=-(n.y-1)/2*this.containerDom.clientHeight;o<183?(this.canvas.style.top=-e/2+"px",this.canvas.style.left=90+"px"):r<183?(this.canvas.style.top=90+"px",this.canvas.style.left=-t/2+"px"):s<183?(this.canvas.style.top=-e/2+"px",this.canvas.style.left=-t-90+"px"):(this.canvas.style.left=-t/2+"px",this.canvas.style.top=-e-90+"px"),this.canvas.style.transform=`translate3d(${o}px, ${r}px, 10px)`,this.offset={x:o,y:r}}render(){if(!this.five.renderer||!this.containerDom)return;const{scale:t,context:e,width:n,height:o}=this,s=this.renderCenter.clone().project(this.five.camera),r=this.five.renderer.getSize(new E.Vector2),a=1,l=n/t,c=o/t,u=a*t,h=(s.x+1)/2*r.x,d=(s.y+1)/2*r.y,m=this.five.getPixels(h-l/2,d-l/2,l,c,u),g=Math.floor(n*a),p=Math.floor(o*a);Jc(m,g,p);const A=new ImageData(g,p);A.data.set(m),e.putImageData(A,0,0)}initStyle(){const t=this.canvas;t.classList.add("five-plugin__magnifier"),t.style.position="absolute",t.style.pointerEvents="all",t.style.borderRadius="50%",t.style.zIndex="99";const e=1;t.setAttribute("width",(this.width*e).toString()),t.setAttribute("height",(this.height*e).toString()),t.style.border="2px solid rgba(255,255,255,0.20)",t.style.width=this.width+"px",t.style.height=this.height+"px",t.style.top=this.config.initialPosition.top,t.style.left=this.config.initialPosition.left,t.style.transform="translate(0,0,100px)",this.config.dragEnabled&&(this.canvas.style.cursor="pointer")}}function Zc(i,t){const{offsetWidth:e,offsetHeight:n}=t,{top:o,left:s}=t.getBoundingClientRect();return new E.Vector2().set((i.x-s)/e*2-1,-(i.y-o)/n*2+1)}function ka(i,t){const{offsetWidth:e,offsetHeight:n}=t;return new E.Vector2().set(i.x/e*2-1,-i.y/n*2+1)}function Kc(i,t){const e=i.getElement();if(!e)return;const n=ka(t,e),o=new E.Raycaster;return o.setFromCamera(n,i.camera),o}function $c(i,t){const{x:e,y:n}=t,o=e*2-1,s=n*2-1,r=new E.Vector2().fromArray([o,s]),a=new E.Raycaster;return a.setFromCamera(r,i.camera),i.model.intersectRaycaster(a)[0]}const eu="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAbYAAAGwCAYAAADFUEBtAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAABtqADAAQAAAABAAABsAAAAABTZ8U6AAAtiklEQVR4Ae2dAXJbSbJdp+d7AfYSHOGVeAPek5fkNXgLjviLmRkZl+CRbtc8UBKRRalZpyIesiorMx/eIcjb+QCh//Y3hwQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkI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+
`;class Sc extends Dc{constructor(e){super();f(this,"configs");f(this,"clientWidth");f(this,"clientHeight");f(this,"ready",!1);f(this,"uuid",_e());f(this,"tween");f(this,"tweening",!1);f(this,"container");f(this,"canvas");f(this,"data",{});f(this,"tempLine",{});this.configs=e,this.clientWidth=document.body.clientWidth,this.clientHeight=document.body.clientHeight,this.container=this.ifInsertToDOM(),this.canvas={},this.initCtrl()}get color(){return this.configs.currentColor}get state(){return this.data}get dpr(){return this.configs.DPR||1}ifInsertToDOM(){if(this.container)return this.container;if(this.configs.container)this.configs.container.id="_gl_paintBrush",this.container=this.configs.container;else if(document.getElementById("_gl_paintBrush"))this.container=document.getElementById("_gl_paintBrush");else{const e=document.createElement("div");e.id="_gl_paintBrush",document.body.appendChild(e),this.container=e}return this.container.innerHTML=Lc,this.container}initCanvas(e){const n=document.createElement("canvas");n.className=e,n.width=this.clientWidth,n.height=this.clientHeight;const o=n.getContext("2d");if(!!o)return o.lineWidth=5*this.dpr,o.lineCap="round",o.lineJoin="round",this.container.appendChild(n),n}initCtrl(){const e=document.createElement("div");e.className="_paintBrush-ctrl";const n=document.createElement("div");n.className="_paintBrush-ctrlinner";const o=document.createElement("a");o.className="_paintBrush-ctrlitem _paintBrush-ctrlitem--undo",o.addEventListener("click",a=>{var d;if(a.stopPropagation(),this.configs.onClickUndo&&this.configs.onClickUndo(),!this.canvas[this.uuid]||!this.data[this.uuid]||this.data[this.uuid].length===0)return;const l=this.data[this.uuid].pop();l&&this.emitStateChange({type:at.Undo,color:this.color,ready:this.ready,state:l,uuid:this.uuid});const c=(d=this.canvas[this.uuid])==null?void 0:d.getContext("2d");if(!this.canvas[this.uuid])return;const{width:u,height:h}=this.canvas[this.uuid];c&&c.clearRect(0,0,u,h),this.data[this.uuid].forEach(m=>this.handleDrawLine(this.uuid,m,{withUndo:!0}))});const s=document.createElement("a");return s.className="_paintBrush-ctrlitem _paintBrush-ctrlitem--close",s.addEventListener("click",a=>{a.stopPropagation(),this.closeBrush(),this.configs.onClickClose&&this.configs.onClickClose()}),[o,s].forEach(a=>{const l=document.createElement("i");l.className="brush-icon";const c=document.createElement("span");c.className="brush-txt",c.innerText=a.className.endsWith("undo")?this.configs.onUndoText:this.configs.onExitText,a.appendChild(l),a.appendChild(c)}),n.appendChild(o),n.appendChild(s),e.appendChild(n),this.container.appendChild(e),e}openBrush(){if(this.ready)return;this.canvas[this.uuid]||(this.canvas[this.uuid]=this.initCanvas("_paintBrush-canvas")),this.container.className="brushing";const e=this.canvas[this.uuid];e.getContext("2d").clearRect(0,0,e.width,e.height),this.openBrushHandle(),this.ready=!0,this.emit("readyChange",!0)}closeBrush(){!this.ready||(this.container.className="",this.data={},this.tempLine={},Object.keys(this.canvas).forEach(e=>{this.canvas[e].ontouchstart=()=>!1,this.canvas[e].ontouchmove=()=>!1,this.canvas[e].ontouchend=()=>!1,this.canvas[e].ontouchcancel=()=>!1;const n=this.canvas[e].getContext("2d");n&&n.clearRect(0,0,this.canvas[e].width,this.canvas[e].height)}),this.ready=!1,this.emit("readyChange",!1),this.emitStateChange({type:at.Exit,color:this.color,ready:!1,uuid:this.uuid}))}updateCurrentColor(e){const n=this.canvas[this.uuid];if(!n)return;const o=n.getContext("2d");!o||(this.configs.currentColor=e,o.strokeStyle=e)}openBrushHandle(){const e=this.canvas[this.uuid];if(!e)return;const n=e.getContext("2d");if(!n)return;const o=this.color||"#6D92FF";n.strokeStyle=o;let s=null,r=[],a,l=[],c=0;const u=(h,d,m)=>{const g=this.color||"#ff0000";n.strokeStyle=g,n.beginPath(),n.moveTo(h.x,h.y),n.quadraticCurveTo(d.x,d.y,m.x,m.y),n.stroke()};e.onmousedown=h=>{h.preventDefault(),c=Date.now();const d=h.clientX,m=h.clientY;r=[],r.push({x:d,y:m}),s={x:d,y:m},a=Mn({x:d,y:m},this.clientWidth,this.clientHeight),l=[]},e.onmousemove=h=>{if(h.preventDefault(),!s)return;const d=Number(h.clientX),m=Number(h.clientY);if(Math.abs(d-s.x)<5&&Math.abs(m-s.y)<5||(r.push({x:d,y:m}),l.push(Mn({x:d,y:m},this.clientWidth,this.clientHeight)),r.length<3))return;const{control:g,end:p}=Tn(r);!g||!p||(u(s,g,p),s=p)},e.onmouseup=h=>{if(h.preventDefault(),s=null,r.length<3)return;this.data[this.uuid]||(this.data[this.uuid]=[]);const d=Date.now()-c,m={move:Object.assign({},a),uuid:this.uuid,line:[...l],color:this.color,duration:d<1280?d:d<2e3?1280:0};this.data[this.uuid].push(m),Un(()=>{this.emitStateChange({type:at.Drawline,color:this.color,ready:this.ready,state:m,uuid:this.uuid})})},e.ontouchstart=h=>{h.preventDefault(),c=Date.now();const d=h.touches[0].clientX,m=h.touches[0].clientY;r=[],r.push({x:d,y:m}),s={x:d,y:m},a=Mn({x:d,y:m},this.clientWidth,this.clientHeight),l=[]},e.ontouchmove=h=>{if(h.preventDefault(),!s)return;const d=Number(h.touches[0].clientX),m=Number(h.touches[0].clientY);if(Math.abs(d-s.x)<5&&Math.abs(m-s.y)<5||(r.push({x:d,y:m}),l.push(Mn({x:d,y:m},this.clientWidth,this.clientHeight)),r.length<3))return;const{control:g,end:p}=Tn(r);!g||!p||(u(s,g,p),s=p)},e.ontouchend=e.ontouchcancel=h=>{if(h.preventDefault(),s=null,r.length<3)return;this.data[this.uuid]||(this.data[this.uuid]=[]);const d=Date.now()-c,m={move:Object.assign({},a),line:[...l],uuid:this.uuid,color:this.color,duration:d<1280?d:d<2e3?1280:0};this.data[this.uuid].push(m),Un(()=>{this.emitStateChange({type:at.Drawline,color:this.color,ready:this.ready,state:m,uuid:this.uuid})})}}emitStateChange(e,n=!0){if(e.type!==at.Drawline){this.emit("stateChange",e,n);return}const o=Date.now(),s=e.state;if(!s||!s.line)return;const r=Math.ceil(s.line.length/100);for(let a=0;a<r;a++){const l={uuid:this.uuid,color:this.color,ready:this.ready,type:e.type,state:{uuid:this.uuid,move:s.move,duration:s.duration,color:this.color,line:s.line.slice(a*100,(a+1)*100)},timestamp:o,end:a===r-1};Pc(a,20,()=>{this.emit("stateChange",l,n)})}}action(e){const{ready:n,type:o,uuid:s}=e;if(!n&&this.ready){this.closeBrush();return}if(n&&!this.ready){this.openBrush();return}if(!!this.ready)switch(o){case at.Drawline:const{state:r,timestamp:a,end:l}=e;if(!a||!r)return;this.tempLine[a]=[].concat(this.tempLine[a]||[],r.line),l&&(Object.assign(r,{line:this.tempLine[a]}),this.handleDrawLine(s,r,{},()=>delete this.tempLine[a]));break;case at.Undo:this.handleUndo(s);break}}handleDrawLine(e,n,{withUndo:o=!1},s=ba){!n||Object.prototype.toString.call(n)!="[object Object]"||Object.keys(n).length===0||Ec(()=>new Promise(r=>{if(o||(this.canvas[e]||(this.canvas[e]=this.initCanvas("_paintBrush-canvas--sync")),this.data[e]||(this.data[e]=[]),this.data[e].push(n)),!this.canvas[e])return;const a=this.canvas[e].getContext("2d");if(!a)return;const{line:l=[],color:c="black",duration:u=0,uuid:h}=n,d=Li(n.move||{},this.clientWidth,this.clientHeight);let m=[d];if(a.strokeStyle=c,a.beginPath(),a.moveTo(d.x,d.y),u&&!o){let g=[];const p=this;p.tween=kc({step:0},{step:l.length-1},u).onUpdate(({step:A})=>{var b;if(p.tweening=!0,!p.ready)return a.clearRect(0,0,p.canvas[h].width,p.canvas[h].height),(b=p.tween)==null?void 0:b.stop();const v=Math.floor(A);if(!g.find(w=>w===v)){if(g.push(v),m.push(Li(l[v],p.clientWidth,p.clientHeight)),m.length<3)return;const{control:w,end:k}=Tn(m);if(!w||!k)return;a.quadraticCurveTo(w.x,w.y,k.x,k.y),a.stroke()}}).onComplete(A=>{p.tween=void 0,p.tweening=!1,g=[],m=[],s&&s(),r()})}else{for(let g=0;g<l.length;g++){if(m.push(Li(l[g],this.clientWidth,this.clientHeight)),m.length<3)continue;const{control:p,end:A}=Tn(m);!p||!A||a.quadraticCurveTo(p.x,p.y,A.x,A.y)}a.stroke(),m=[],s&&s(),r()}}))}handleUndo(e){if(!this.canvas[e]||!this.data[e]||this.data[e].length===0)return;this.data[e].pop();const n=()=>{var s;const o=(s=this.canvas[e])==null?void 0:s.getContext("2d");o&&o.clearRect(0,0,this.canvas[e].width,this.canvas[e].height),this.data[e].forEach(r=>this.handleDrawLine(e,r,{withUndo:!0}))};if(this.tween&&this.tweening){this.tween.stop(),Un(n,60);return}n()}destroyBrush(){this.closeBrush(),this.ready=!1,this.emit("readyChange",!0)}}class Mc{constructor(t={}){f(this,"controller");const e=Object.assign({currentColor:"#f44336",onUndoText:"\u56DE\u9000",onExitText:"\u5173\u95ED"},t);this.controller=new Sc(e)}on(t,e){this.controller.on(t,e)}off(t,e){this.controller.off(t,e)}once(t,e){this.controller.once(t,e)}show(){this.controller.openBrush()}action(t){this.controller.action(t)}get state(){return this.controller.state}get configs(){return this.controller.configs}dispose(){return this.controller.destroyBrush()}setCurrentColor(t){this.controller.updateCurrentColor(t)}}const Tc=(i,t)=>{var O,S;let e=(S=(O=t==null?void 0:t.initialState)==null?void 0:O.enabled)!=null?S:!0,n=!1,o=!0,s=null;const a=F(F({},{lookAtCurrentCamera:!1,lockedPanoIndex:null,lockedLatitude:null,lockedLongitude:null}),t==null?void 0:t.config),l=new E.Scene,c=new Ce.Camera(60);let u=new E.Object3D,h,d;{const Q=new E.DirectionalLight(16777215,.5);Q.position.copy(new E.Vector3(1,1,1)),l.add(Q)}{const Q=new E.DirectionalLight(16777215,.3);l.add(Q)}{const Q=new E.AmbientLight(16777215,.3);l.add(Q)}l.add(u);const m=()=>{if(n)return;h=I(i.model,c.fov,c.aspect),d=i.model.bounding.getCenter(new E.Vector3),l.remove(u),u=_(i.model),l.add(u),n=!0,T();function Q(X){const W=X.clone();return W.uniforms.modelAlpha.value=1,W.uniforms.map.value&&(W.uniforms.map.value.needsUpdate=!0),W}function _(X){if(X instanceof E.Mesh){const W=X.geometry,$=Array.isArray(X.material)?X.material.map(Q):Q(X.material);return new E.Mesh(W,$)}else if(X instanceof E.Group){const W=new E.Group;return X.children.forEach($=>W.add(_($))),W}else{const W=new E.Object3D;return X.children.forEach($=>W.add(_($))),W}}},g=()=>{if(!!i.renderer)return s||(s=new E.WebGLRenderer({antialias:!1,alpha:!0}),s.setPixelRatio(i.renderer.getPixelRatio()),s.outputEncoding=E.sRGBEncoding,s.setClearColor(1579548,0),s.autoClear=!0),s},p=()=>{u.traverse(Q=>{Q instanceof E.Mesh&&[].concat(Q.material).forEach(X=>X.dispose())}),l.remove(u),u=new E.Object3D,l.add(u),n=!1,T()},A=()=>{!e||n||m()},v=()=>{e||(e=!0,l.add(u),!n&&i.model.loaded&&m(),T())},b=()=>{!e||(l.remove(u),o=!0,x(),e=!1)},w=(Q,_={})=>{const X=g();if(!X)return;Q.appendChild(X.domElement),k(_);const W=window.getComputedStyle(Q).position;W!=="relative"&&W!=="absolute"&&W!=="fixed"&&W!=="sticky"&&(Q.style.position="relative")},k=(Q={})=>{if(!s)return;const X=s.domElement.parentNode;if(X!=null&&X.nodeName){const{width:W=X.offsetWidth,height:$=X.offsetHeight}=Q;s.setSize(W,$),c.aspect=W/$,c.updateProjectionMatrix()}T()};function I(Q,_,X){const W=Q.bounding,$=Math.pow(Math.pow(W.max.x-W.min.x+1,2)+Math.pow(W.max.y-W.min.y+1,2)+Math.pow(W.max.z-W.min.z+1,2),1/2);let U=$/2/Math.tan(Math.PI*_/360);return X<1&&(U=U/X),isNaN(U)?$:U}function C(Q){return i.work.observers[Q].standingPosition.clone()}const T=()=>{if(!e||!h||!d)return;const Q=i.getPose();Q.fov=c.fov,Q.offset=d,Q.distance=h,typeof a.lockedLatitude=="number"&&(Q.latitude=a.lockedLatitude),typeof a.lockedLongitude=="number"&&(Q.longitude=a.lockedLongitude),typeof a.lockedPanoIndex=="number"&&(Q.offset=C(a.lockedPanoIndex)),a.lookAtCurrentCamera&&(Q.offset=i.camera.position.clone().setY(i.camera.position.y+1)),c.setFromPose(Q),o=!0},x=()=>{!e||o!==!0||!s||!s.domElement.parentNode||s.domElement.parentNode.offsetWidth===0||(s.render(l,c),o=!1)},H=()=>{s&&s.dispose(),s=null},N=Q=>{Object.assign(a,Q),T()},R=()=>({enabled:e});return Object.assign(window,{camera:c}),i.on("modelLoaded",A),i.on("modelWillLoad",p),i.on("cameraDirectionUpdate",T),i.on("dispose",H),i.on("renderFrame",x),i.on("cameraPositionUpdate",T),{appendTo:w,refresh:k,changeConfigs:N,enable:v,disable:b,getCurrentState:R}};function pt(...i){const t=[];return i.forEach(e=>{e.isCSS3DObjectPlus?t.push(e):t.push(...pt(...e.children))}),t}function ei(i,t){const e=Math.round(i);return e%2===0?e:e+Number(t!=null&&t.floor?-1:1)}function zc(i,t,e=!0){if(!i)return console.error("createResizeObserver: element is undefined"),{observe:()=>{},unobserve:()=>{}};const n=()=>{const s=ei(i.clientWidth,{floor:!0}),r=ei(i.clientHeight,{floor:!0});t(s,r)};if(typeof ResizeObserver=="undefined"||!ResizeObserver)return console.warn("createResizeObserver: ResizeObserver is undefined"),{observe:()=>n(),unobserve:()=>{}};const o=new ResizeObserver(n);return e&&n(),{observe:()=>o.observe(i),unobserve:()=>o.unobserve(i)}}class Fo extends $n.CSS3DRenderer{constructor(){super();f(this,"wrapper");f(this,"requestAnimationFrameId");f(this,"resizeDisoper");this.domElement.style.position="absolute",this.domElement.style.top="0",this.domElement.style.left="0",this.domElement.style.userSelect="none",this.domElement.style.pointerEvents="none"}setWrapper(e){if(!e)throw new Error("CSS3DRenderer: wrapper is required");if(e.contains(this.domElement))return;const n=this.wrapper;return n&&n.contains(this.domElement)&&this.domElement.remove(),this.appendToElement(e),this.wrapper=e,this}appendToElement(e){e.appendChild(this.domElement);const n=(r,a)=>this.setSize(r,a),{observe:o,unobserve:s}=zc(e,n,!0);o(),this.resizeDisoper=s,this.wrapper=e}renderEveryFrame(e,n){if(this.wrapper||console.warn("wrapper is not find, creating a html element and call setWrapper(wrapper)",this,e),this.requestAnimationFrameId)return;const o=()=>{this.requestAnimationFrameId=requestAnimationFrame(o),!!e.visible&&pt(e).length!==0&&this.render(e,n)};o()}stopRender(){this.requestAnimationFrameId&&cancelAnimationFrame(this.requestAnimationFrameId)}dispose(){var e;this.stopRender(),(e=this.resizeDisoper)==null||e.call(this),this.domElement.remove()}}function Bc(i){return typeof Symbol=="undefined"?`$Symbol<${i}>$`:Symbol(i)}const pn=Bc("$$EVENT$$");function Bn(i){return i[pn]||(i[pn]={}),i[pn]}function Vc(i){i[pn]||delete i[pn]}class Jt{hasListener(t){const e=Bn(this);return Boolean((e==null?void 0:e[t])&&e[t].length>0)}on(t,e,n){const o=Bn(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=Bn(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=Bn(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}}const jc=({x:i,y:t,z:e})=>new j.Vector3(i,t,e),qe=i=>new j.Vector3().fromArray(i),yn=i=>i instanceof j.Vector3?i:Array.isArray(i)?qe(i):jc(i);class Oc extends E.Mesh{constructor(e,n){const o=new E.MeshBasicMaterial({opacity:0,color:0,transparent:!1,side:E.DoubleSide}),s=new E.PlaneGeometry(e,n);super(s,o);f(this,"name","opacity-mesh")}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}}function In(...i){const t=new j.Vector3;return i.forEach(e=>{t.add(e)}),t.divideScalar(i.length),t}const ya=1,Rc=`CSS3DObjectPlus@${ya}`,Fc=.00216,Qc=.003;class Hc extends $n.CSS3DObject{constructor(e){var I,C,T;const n=e.container,o=e.cornerPoints,s=(I=e.ratio)!=null?I:Qc,r=(C=e.dpr)!=null?C:1,a=(T=e.pointerEvents)!=null?T:"auto",l=Math.max(Fc,s),c=o[0].distanceTo(o[1]),u=o[1].distanceTo(o[2]),h=ei(c/s*r),d=ei(u/s*r),m=In(...o);let g;if(l===s)n.style.width=`${h}px`,n.style.height=`${d}px`,g=n;else{const x=document.createElement("div");x.style.width=`${h}px`,x.style.height=`${d}px`,x.style.pointerEvents="none";const H=s/l;n.style.position="absolute",n.style.left="0",n.style.top="0",n.style.width=`${H*h}px`,n.style.height=`${H*d}px`,x.appendChild(n),g=x}super(g);f(this,"version",ya);f(this,"isCSS3DObjectPlus",!0);f(this,"container");f(this,"width");f(this,"height");f(this,"domWidthPx");f(this,"domHeightPx");f(this,"cornerPoints");f(this,"centerPosition");f(this,"ratio");f(this,"mode","front");f(this,"hooks",new Jt);f(this,"opacityMesh");f(this,"selfVisible",!0);f(this,"parentVisibleListenerDisposer");f(this,"createOpacityMesh",e=>{const{domWidthPx:n,domHeightPx:o}=e,s=new Oc(n,o);return s.position.copy(e.position),s.rotation.copy(e.rotation),s.scale.copy(e.scale),s});f(this,"addParentVisibleListener",()=>{var e;if((e=this.parent)!=null&&e.isCSS3DGroup){const n=this.parent,o=s=>{this.setVisible(s&&this.selfVisible,{setSelfVisible:!1})};n.hooks.on("visibleChange",o),this.parentVisibleListenerDisposer=()=>n.hooks.off("visibleChange",o)}});f(this,"removeParentVisibleListener",()=>{var e;(e=this.parentVisibleListenerDisposer)==null||e.call(this)});if(n.style.pointerEvents=a,this.scale.set(l,l,l),this.cornerPoints=o,this.ratio=s,this.container=n,e.mode&&(this.mode=e.mode),l===s)this.width=c,this.height=u,this.domWidthPx=h,this.domHeightPx=d,this.centerPosition=m;else{const x=s/l;this.width=x*c,this.height=x*u,this.domWidthPx=x*h,this.domHeightPx=x*d,this.centerPosition=new j.Vector3().subVectors(m,o[0]).multiplyScalar(x).add(o[0])}n.classList.add(`${Rc}__container`);const p=new j.Vector3().subVectors(o[1],o[0]),A=new j.Vector3().subVectors(o[3],o[0]),v=new j.Vector3().crossVectors(p,A).normalize();this.lookAt(v);const b=this.up.clone().applyQuaternion(this.quaternion),w=A.clone(),k=new j.Vector3().crossVectors(b,w).normalize();this.rotateOnWorldAxis(k,b.angleTo(w)),this.position.copy(m),this.addEventListener("added",()=>{var x;this.mode==="front"&&((x=this.opacityMesh)==null||x.removeFromParent()),this.addParentVisibleListener()}),this.addEventListener("removed",()=>{var x;(x=this.opacityMesh)==null||x.removeFromParent(),this.removeParentVisibleListener()})}setVisible(e,n={setSelfVisible:!0}){n.setSelfVisible&&(this.selfVisible=e),this.visible=e,this.opacityMesh&&(this.opacityMesh.visible=e)}removeFromParent(){var n;const e=this.parent;return e!==null&&e.remove(this),(n=this.opacityMesh)==null||n.removeFromParent(),this}removeOpacityMesh(){var e;return(e=this.opacityMesh)==null||e.removeFromParent(),this.opacityMesh=void 0,this}dispose(){var e;this.container.remove(),this.removeFromParent(),(e=this.opacityMesh)==null||e.removeFromParent()}getOpacityMesh(){if(this.opacityMesh)return this.opacityMesh;{const e=this.createOpacityMesh(this);return this.opacityMesh=e,e}}applyMatrix4(e){var n;super.applyMatrix4(e),(n=this.opacityMesh)==null||n.applyMatrix4(e)}applyQuaternion(e){var n;return super.applyQuaternion(e),(n=this.opacityMesh)==null||n.applyQuaternion(e),this}applyScaleMatrix4(e){var n;this.scale.applyMatrix4(e),(n=this.opacityMesh)==null||n.scale.applyMatrix4(e)}}class _c extends E.Scene{constructor(){super()}add(...t){return super.add(...t),pt(...t).forEach(e=>{e.mode="front"}),this}}class Gc extends E.Scene{constructor(e){super();f(this,"scene");if(!e)throw new Error("CSS3DBehindScene: scene is required");this.scene=e}add(...e){return super.add(...e),pt(...e).forEach(n=>{n.mode="behind",this.scene.add(n.getOpacityMesh())}),this}remove(...e){return pt(...e).forEach(n=>{var o;(o=n.opacityMesh)==null||o.removeFromParent(),n.opacityMesh=null}),super.remove(...e),this}}class wa extends E.Group{constructor(e){super();f(this,"isCSS3DGroup",!0);f(this,"mode");f(this,"CSS3DObjectLength",0);f(this,"hooks",new Jt);this.mode=e}add(...e){return pt(...e).forEach(n=>{n.mode=this.mode}),super.add(...e),this.updateLength(),this}setVisible(e){this.visible=e,this.hooks.emit("visibleChange",e)}remove(...e){return super.remove(...e),this.updateLength(),this}updateLength(){this.CSS3DObjectLength=pt(this).length}}class Wc extends wa{constructor(){super("front")}}class Nc extends wa{constructor(e){super("behind");f(this,"scene");if(!e)throw new Error("CSS3DBehindScene: scene is required");this.scene=e}add(...e){return pt(...e).forEach(n=>{this.scene.add(n.getOpacityMesh())}),super.add(...e),this}}const Xc=3,qi="CSS3DRenderer",fn=`${qi}@${Xc}`,Vt=()=>{console.error(`${fn} is disposed`)},Se={css3DObjects:[],frontModeStore:{css3DRenderer:new Fo},behindModeStore:{css3DRenderer:new Fo}};function Qo(i){return Se.css3DObjects.find(t=>t.id===i)}function Yc(i){Se.frontModeStore.css3DRenderer.setWrapper(i)}function Uc(i){Se.behindModeStore.css3DRenderer.setWrapper(i)}class Wt{constructor(t){f(this,"hooks",new Jt);f(this,"state",{enabled:!0,visible:!0,disposed:!1});f(this,"_scene");f(this,"store",{frontModeGroup:new Wc});f(this,"create3DElement",(t,e,n)=>{if(this.state.disposed)return Vt();const o=(()=>{const k={ratio:.00216,devicePixelRatio:1,mode:"front",autoRender:!0,container:document.createElement("div"),pointerEvents:"none"};return Object.assign(k,n)})(),s=e.map(yn);if((s==null?void 0:s.length)<4)return console.error(`${fn}: requires 4 point but params may have fewer`);const{ratio:r,devicePixelRatio:a,mode:l,autoRender:c,container:u,pointerEvents:h}=o;let d=!1;const m=this.createObject(s,{ratio:r,dpr:a,container:u,mode:l,pointerEvents:h});Se.css3DObjects.push(m),o.scene&&this.setScene(o.scene);const g=()=>{if(d)return;const k=m.mode==="front"?this.getFrontCSS3DObjectGroup():this.getBehindCSS3DObjectGroup();!k||k.add(m)},p=()=>{d||(g(),this.render(t),this.hooks.emit("render"))},A=k=>this.setVisibleById(m.id,k),v=k=>this.setEnabledById(m.id,k),b=()=>(d=!0,m.removeFromParent(),!0),w=l==="front"?Se.frontModeStore.css3DRenderer:Se.behindModeStore.css3DRenderer;return c&&p(),{id:m.uuid,container:u,css3DObject:m,render:c?void 0:p,show:()=>A(!0),hide:()=>A(!1),setVisible:A,enable:()=>v(!0),disable:()=>v(!1),setEnabled:v,dispose:b,appendToElement:k=>w.setWrapper(k)}});f(this,"setVisibleById",(t,e)=>{var n;(n=Qo(t))==null||n.setVisible(e)});f(this,"setEnabledById",(t,e)=>{const n=Qo(t);if(!n)return;const o=n.mode==="front"?this.getFrontCSS3DObjectGroup({addGroupIfNotExists:!1}):this.getBehindCSS3DObjectGroup({addGroupIfNotExists:!1});!o||(e?o.add(n):o.remove(n))});f(this,"createObject",(t,e)=>{const n=new Hc(F({cornerPoints:t},e));return n.element.classList.add(`${qi}__container`),n.element.id=`${qi}__container--${n.uuid}`,n});t&&this.setScene(t)}get scene(){return this._scene||console.error("scene doesn't exist!, please call setScene(scene) first"),this._scene}static get frontModeCSS3DRenderer(){return Se.frontModeStore.css3DRenderer}static get behindModeCSS3DRenderer(){return Se.behindModeStore.css3DRenderer}get frontModeCSS3DRenderer(){return Se.frontModeStore.css3DRenderer}get behindModeCSS3DRenderer(){return Se.behindModeStore.css3DRenderer}setScene(t){this._scene=t}getCurrentState(){return this.state}setState(t,e={userAction:!0}){if(this.state.disposed)return Vt();const n=F({},this.state);this.state=Object.assign(this.state,t),n.visible!==this.state.visible&&(t.visible?this.handleShow():this.handleHide()),n.enabled!==this.state.enabled&&(t.enabled?this.handleEnable():this.handleDisable()),n.disposed!==this.state.disposed&&this.handleDispose(),this.hooks.emit("stateChange",{state:this.state,prevState:n,userAction:e.userAction})}dispose(){this.setState({disposed:!0}),this.hooks.emit("dispose")}show(){return G(this,arguments,function*({userAction:t}={userAction:!0}){if(this.state.disposed)return Vt();this.setState({visible:!0},{userAction:t}),this.hooks.emit("show",{userAction:t})})}hide(){return G(this,arguments,function*({userAction:t}={userAction:!0}){if(this.state.disposed)return Vt();this.setState({visible:!1},{userAction:t}),this.hooks.emit("hide",{userAction:t})})}enable({userAction:t}={userAction:!0}){if(this.state.disposed)return Vt();this.setState({enabled:!0},{userAction:t}),this.hooks.emit("enable",{userAction:t})}disable({userAction:t}={userAction:!0}){if(this.state.disposed)return Vt();this.setState({enabled:!1},{userAction:t}),this.hooks.emit("disable",{userAction:t})}getFrontCSS3DScene({createSceneIfNotExists:t=!1}={}){var n;const e=(n=Se.frontModeStore)==null?void 0:n.css3DScene;if(e)return e;if(t){const o=new _c;Se.frontModeStore.css3DScene=o}return Se.frontModeStore.css3DScene}getBehindCSS3DScene({createSceneIfNotExists:t=!1}={}){var n,o;const e=(n=Se.behindModeStore)==null?void 0:n.css3DScene;if(e)return e;if(t){const s=(o=Se.behindModeStore.scene)!=null?o:this.scene;if(!s){console.error(`${fn}: scene is required when mode is behind`);return}const r=new Gc(s);Se.behindModeStore.css3DScene=r,Se.behindModeStore.scene=s}return Se.behindModeStore.css3DScene}getFrontCSS3DObjectGroup({addGroupIfNotExists:t=!0}={}){const e=this.getFrontCSS3DScene({createSceneIfNotExists:t});return t&&e&&(e.getObjectById(this.store.frontModeGroup.id)||e.add(this.store.frontModeGroup)),this.store.frontModeGroup}getBehindCSS3DObjectGroup({addGroupIfNotExists:t=!0}={}){var n;const e=this.getBehindCSS3DScene({createSceneIfNotExists:t});if(t&&e&&this.scene){const o=(n=this.store.behindModeGroup)!=null?n:new Nc(this.scene);this.store.behindModeGroup=o,e.getObjectById(o.id)||e.add(o)}return this.store.behindModeGroup}render(t){var e,n;if(this.getFrontCSS3DObjectGroup({addGroupIfNotExists:!1}).CSS3DObjectLength>0){const o=this.getFrontCSS3DScene({createSceneIfNotExists:!0});if(!o)return console.error(`${fn}: css3DScene is required when mode is front`);Se.frontModeStore.css3DRenderer.renderEveryFrame(o,t)}if(((n=(e=this.getBehindCSS3DObjectGroup({addGroupIfNotExists:!1}))==null?void 0:e.CSS3DObjectLength)!=null?n:0)>0){const o=this.getBehindCSS3DScene({createSceneIfNotExists:!0});if(!o)return console.error(`${fn}: css3DScene is required when mode is behind`);Se.behindModeStore.css3DRenderer.renderEveryFrame(o,t)}}handleShow(){return G(this,null,function*(){var t;this.store.frontModeGroup.setVisible(!0),(t=this.store.behindModeGroup)==null||t.setVisible(!0)})}handleHide(){return G(this,null,function*(){var t;this.store.frontModeGroup.setVisible(!1),(t=this.store.behindModeGroup)==null||t.setVisible(!1)})}handleEnable(){var t,e;(t=this.getFrontCSS3DScene())==null||t.add(this.store.frontModeGroup),this.store.behindModeGroup&&((e=this.getBehindCSS3DScene())==null||e.add(this.store.behindModeGroup))}handleDisable(){var t,e,n;this.store.frontModeGroup.children.forEach(o=>{o instanceof $n.CSS3DObject&&o.element instanceof Element&&o.element.parentNode!==null&&o.element.remove()}),(t=this.store.behindModeGroup)==null||t.children.forEach(o=>{o instanceof $n.CSS3DObject&&o.element instanceof Element&&o.element.parentNode!==null&&o.element.remove()}),(e=this.getFrontCSS3DScene())==null||e.remove(this.store.frontModeGroup),this.store.behindModeGroup&&((n=this.getBehindCSS3DScene())==null||n.remove(this.store.behindModeGroup))}handleDispose(){this.handleDisable()}}f(Wt,"setFrontModeContainer",Yc),f(Wt,"setBehindModeContainer",Uc);function Ca(i){return G(this,null,function*(){return new Promise(t=>{var e;if((e=i.model)!=null&&e.loaded){t();return}else i.once("modelLoaded",()=>t())})})}const Ue=document.createElement("div");Ue.classList.add("behindFiveElement");Ue.style.position="absolute";Ue.style.top="0";Ue.style.left="0";Ue.style.width="100%";Ue.style.height="100%";Ue.style.pointerEvents="none";function Ea(i){var n,o,s,r,a;const t=(a=(o=Si(i.getElement()))!=null?o:Si((n=i.getElement())==null?void 0:n.parentElement))!=null?a:Si((r=(s=i.getElement())==null?void 0:s.parentElement)==null?void 0:r.parentElement),e=t==null?void 0:t.parentElement;if(e)return e.contains(Ue)||t.parentElement.insertBefore(Ue,t),Ue;console.error("Can not find a valid element to insert behindFiveElement. How to fix it: https://github.com/realsee-developer/dnalogel/tree/main/plugins/src/CSS3DRenderPlugin/README.md")}function Si(i){var a;if(!i)return;const t=(a=i.style.position)!=null?a:getComputedStyle(i).position;if(t!=="fixed"&&t!=="absolute"&&t!=="relative")return;const e=getComputedStyle(i),n=e.backgroundColor,o=e.backgroundImage;if(!(n!=="transparent"&&n!=="rgba(0, 0, 0, 0)"&&n!==""||o!=="none"&&o!==""))return i}class Ji{constructor(t=0,e=0){f(this,"min");f(this,"max");f(this,"isInterval",!0);this.min=t,this.max=e}fromArray(t){return this.min=t[0],this.max=t[1],this}isOverlap(t){return Math.min(this.max,t.max)<Math.max(this.min,t.min)}contains(t){return this.min<t.min&&this.max>t.max}}class qc{constructor(t,e){f(this,"min");f(this,"max");f(this,"xInterval");f(this,"yInterval");f(this,"isRectangle",!0);this.min=t,this.max=e,this.xInterval=new Ji(this.min.x,this.max.x),this.yInterval=new Ji(this.min.y,this.max.y)}isOverlapWithRectangle(t){return!this.xInterval.isOverlap(t.xInterval)&&!this.yInterval.isOverlap(t.yInterval)}containsRect(t){return this.xInterval.contains(t.xInterval)&&this.yInterval.contains(t.yInterval)}}function uo(i){return i==="Panorama"||i==="DepthPanorama"||i==="VRPanorama"||i==="XRPanorama"}function Pa(i){return!uo(i)}function Vn(i,t,e){const n=i[t],o=i[e];!n||!o||(i[t]=o,i[e]=n)}function Jc(i,t,e){const n=e/2;for(let o=1;o<=n;o++){const s=e-(o-1);for(let r=1;r<=t;r++){const a=(o-1)*t+r-1,l=(s-1)*t+r-1;Vn(i,a*4+0,l*4+0),Vn(i,a*4+1,l*4+1),Vn(i,a*4+2,l*4+2),Vn(i,a*4+3,l*4+3)}}}class Ia{constructor(t,e){f(this,"width");f(this,"height");f(this,"containerDom");f(this,"hooks",new Ce.Subscribe);f(this,"canvas",document.createElement("canvas"));f(this,"five");f(this,"scale");f(this,"config");f(this,"offset",{x:0,y:0});f(this,"context");f(this,"renderCenter",new E.Vector3);f(this,"hammer");f(this,"state",{enabled:!1});f(this,"onPan",t=>{if(!this.containerDom||this.hooks.emit("wantsPanGesture",t))return;const n=this.offset.x+t.deltaX,o=this.offset.y+t.deltaY;this.canvas.style.boxShadow="0 2px 30px 0 rgba(0,0,0,0.20)",this.canvas.style.transform=`translate3d(${n}px, ${o}px, 100px)`});f(this,"onPanEnd",t=>{this.offset={x:this.offset.x+t.deltaX,y:this.offset.y+t.deltaY},this.canvas.style.boxShadow="none"});var o,s,r;if(!t.renderer)throw new Error("Five Render \u672A\u521D\u59CB\u5316");this.five=t,this.scale=(o=e==null?void 0:e.scale)!=null?o:2,this.width=(s=e==null?void 0:e.width)!=null?s:190,this.height=(r=e==null?void 0:e.height)!=null?r:190,this.config={dragEnabled:(e==null?void 0:e.dragEnabled)||!1,autoFixPCPosition:(e==null?void 0:e.autoFixPCPosition)||!1,initialPosition:(e==null?void 0:e.initialPosition)||{left:"0",top:"0"}};const n=this.canvas.getContext("2d");if(!n)throw new Error("CANNOT CREATE CONTEXT2D");this.context=n,this.config.dragEnabled&&(this.hammer=new Pn.default(this.canvas),this.hammer.on("pan",this.onPan),this.hammer.on("panend",this.onPanEnd)),this.initStyle()}dispose(){var t;this.clear(),this.disable(),(t=this.hammer)==null||t.destroy()}enable(){var t;if(!this.state.enabled)return this.state.enabled=!0,(t=this.containerDom)==null||t.append(this.canvas),this}disable(){if(!!this.state.enabled)return this.state.enabled=!1,this.canvas.remove(),this}appendTo(t){var e;return this.containerDom&&((e=this.containerDom)==null||e.removeChild(this.canvas)),this.containerDom=t,this.state.enabled&&t.append(this.canvas),this}clear(){return this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this}renderWithPoint(t){!this.containerDom||!this.state.enabled||(this.renderCenter=t,this.render(),this.config.autoFixPCPosition&&this.autoFixPCPosition())}autoFixPCPosition(){if(!this.containerDom)return;const{width:t,height:e}=this,n=this.renderCenter.clone().project(this.five.camera),o=(n.x+1)/2*this.containerDom.clientWidth,s=-(n.x-1)/2*this.containerDom.clientWidth,r=-(n.y-1)/2*this.containerDom.clientHeight;o<183?(this.canvas.style.top=-e/2+"px",this.canvas.style.left=90+"px"):r<183?(this.canvas.style.top=90+"px",this.canvas.style.left=-t/2+"px"):s<183?(this.canvas.style.top=-e/2+"px",this.canvas.style.left=-t-90+"px"):(this.canvas.style.left=-t/2+"px",this.canvas.style.top=-e-90+"px"),this.canvas.style.transform=`translate3d(${o}px, ${r}px, 10px)`,this.offset={x:o,y:r}}render(){if(!this.five.renderer||!this.containerDom)return;const{scale:t,context:e,width:n,height:o}=this,s=this.renderCenter.clone().project(this.five.camera),r=this.five.renderer.getSize(new E.Vector2),a=1,l=n/t,c=o/t,u=a*t,h=(s.x+1)/2*r.x,d=(s.y+1)/2*r.y,m=this.five.getPixels(h-l/2,d-l/2,l,c,u),g=Math.floor(n*a),p=Math.floor(o*a);Jc(m,g,p);const A=new ImageData(g,p);A.data.set(m),e.putImageData(A,0,0)}initStyle(){const t=this.canvas;t.classList.add("five-plugin__magnifier"),t.style.position="absolute",t.style.pointerEvents="all",t.style.borderRadius="50%",t.style.zIndex="99";const e=1;t.setAttribute("width",(this.width*e).toString()),t.setAttribute("height",(this.height*e).toString()),t.style.border="2px solid rgba(255,255,255,0.20)",t.style.width=this.width+"px",t.style.height=this.height+"px",t.style.top=this.config.initialPosition.top,t.style.left=this.config.initialPosition.left,t.style.transform="translate(0,0,100px)",this.config.dragEnabled&&(this.canvas.style.cursor="pointer")}}function Zc(i,t){const{offsetWidth:e,offsetHeight:n}=t,{top:o,left:s}=t.getBoundingClientRect();return new E.Vector2().set((i.x-s)/e*2-1,-(i.y-o)/n*2+1)}function ka(i,t){const{offsetWidth:e,offsetHeight:n}=t;return new E.Vector2().set(i.x/e*2-1,-i.y/n*2+1)}function Kc(i,t){const e=i.getElement();if(!e)return;const n=ka(t,e),o=new E.Raycaster;return o.setFromCamera(n,i.camera),o}function $c(i,t){const{x:e,y:n}=t,o=e*2-1,s=n*2-1,r=new E.Vector2().fromArray([o,s]),a=new E.Raycaster;return a.setFromCamera(r,i.camera),i.model.intersectRaycaster(a)[0]}const eu="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAbYAAAGwCAYAAADFUEBtAAAAAXNSR0IArs4c6QAAAER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KQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQlIQAISkIAEJCABCUhAAhKQgAQkIAEJSEACEpCABCQgAQn8NQn8fyHnyuSABiy2AAAAAElFTkSuQmCC",tu=`
|
|
102
102
|
varying vec2 vUv;
|
|
103
103
|
void main() {
|
|
104
104
|
vUv = uv;
|
|
@@ -174,12 +174,12 @@ void main() {
|
|
|
174
174
|
<div class='range-piece__content'></div>
|
|
175
175
|
<div class="range-piece__aim"></div>
|
|
176
176
|
</div>
|
|
177
|
-
`;class La{constructor(t){f(this,"five");f(this,"contentElement",document.createElement("div"));f(this,"animeIns");f(this,"container");f(this,"css3DObject");f(this,"disposeCss3DObject");f(this,"state",{enabled:!1});this.five=t;const n=.4/2,s=Kt(t).create3DDomContainer([[-n,n,0],[-n,-n,0],[n,-n,0],[n,n,0]].map(r=>new E.Vector3().fromArray(r)));if(s){const{container:r,dispose:a,css3DObject:l}=s;this.container=r,this.css3DObject=l,this.disposeCss3DObject=a}this.contentElement.style.width="100%",this.contentElement.style.height="100%",this.contentElement.style.backgroundImage=`url(${Da})`,this.contentElement.style.backgroundSize="100%",this.contentElement.style.backgroundRepeat="no-repeat"}enable(){var t;this.state.enabled||(this.state.enabled=!0,(t=this.container)==null||t.appendChild(this.contentElement))}disable(){!this.state.enabled||(this.state.enabled=!1,this.contentElement.remove())}updateWithIntersect(t){if(!t.face||!this.css3DObject)return;const e=new E.Vector3().addVectors(t.point,t.face.normal);this.css3DObject.position.copy(t.point),this.css3DObject.lookAt(e),this.five.needsRender=!0}doAnimation(){var t;(t=this.animeIns)==null||t.dispose(),new fo({progress:0}).to({progress:[1,0]}).duration(500).easing(mi.Easing.Quadratic.InOut).onUpdate(({progress:e})=>{}).play()}dispose(){var t;(t=this.disposeCss3DObject)==null||t.call(this)}}class lu{constructor(t,e){f(this,"five");f(this,"hooks",new Ce.Subscribe);f(this,"magnifier",null);f(this,"pointHelper",null);f(this,"pointDomHelper",null);f(this,"contentDom",document.createElement("div"));f(this,"state",{enabled:!1});f(this,"group",new E.Group);this.five=t,this.magnifier=(e==null?void 0:e.magnifier)===void 0?new Ia(t,{dragEnabled:!0}):null,this.pointHelper=(e==null?void 0:e.pointHelper)===void 0?new xa:null,this.pointDomHelper=(e==null?void 0:e.pointDomHelper)===void 0?new La(t):null,this.group.name="five-point-selector",this.five.scene.add(this.group),this.contentDom.classList.add("five-point-selector-content"),this.contentDom.style.position="absolute",this.contentDom.style.top="0",this.contentDom.style.left="0",this.contentDom.style.width="100%",this.contentDom.style.height="100%",this.contentDom.style.pointerEvents="none"}enable(){var t,e;this.state.enabled||(this.state.enabled=!0,this.pointHelper&&this.group.add(this.pointHelper),(t=this.magnifier)==null||t.enable(),(e=this.pointDomHelper)==null||e.enable(),this.five.needsRender=!0,this.hooks.emit("enabled"))}disable(){var t,e;!this.state.enabled||(this.state.enabled=!1,this.pointHelper&&this.group.remove(this.pointHelper),(t=this.magnifier)==null||t.disable(),(e=this.pointDomHelper)==null||e.disable(),this.hooks.emit("disabled"))}dispose(){this.hooks.off(),this.disable(),this.magnifier=null,this.pointHelper=null,this.pointDomHelper=null}updateWithIntersect(t){var s;this.hooks.emit("pointChanged",{panoIndex:this.five.getCurrentState().panoIndex,position:t.point.toArray(),normal:(s=t.face)==null?void 0:s.normal.toArray()});const e=this.magnifier;e&&e.renderWithPoint(t.point);const n=this.pointHelper;n&&n.updateWithIntersect(t);const o=this.pointDomHelper;o&&o.updateWithIntersect(t),this.five.needsRender=!0}}function cu(i){return!Zt(i)}function Zt(i){return i!=null}function ho(i){return i.indexOf("//")===0||/^[0-9a-z]+\:\/\//i.test(i)}class fo extends bn.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=kn(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=[],bn.default.remove(this)})}}function Sa(i,t=bn.default.Easing.Linear.None){const e=new fo({progress:0}).to({progress:1});return i!==void 0&&e.duration(i),t!==void 0&&e.easing(t),e}const wn=window.requestAnimationFrame||(i=>setTimeout(i,16)),uu=window.cancelAnimationFrame||clearTimeout;function gi(i,t=0){t<=0?wn(i):wn(()=>gi(i,t-1))}function kn(i,t=60){let e=-1,n=0,o=-1;const s=1e3/t;function r(a){o===-1&&(o=a),e=wn(r),!(a-n<s)&&(n=a,i&&i(a-o))}return e=wn(r),function(){uu(e)}}function du(){const i=Date.now();return new Promise(t=>{wn(()=>{t(Date.now()-i)})})}const hu=Object.freeze(Object.defineProperty({__proto__:null,Interval:Ji,Rectangle:qc,isPanoramaLike:uo,isModelLike:Pa,Magnifier:Ia,getCoordsFromClient:Zc,getCoordsFromElement:ka,getRaycasterFromFivePointer:Kc,getIntersectFromRelativePosition:$c,PointHelper:xa,PointDomHelper:La,FivePointSelector:lu,isNil:cu,notNil:Zt,uuid:_e,isAbsoluteURL:ho,BetterTween:fo,tweenProgress:Sa,nextFrame:gi,requestAnimationFrameInterval:kn,getFrameTime:du},Symbol.toStringTag,{value:"Module"})),Ma="v2.0.1",Mi=`CSS3DRenderPlugin@${Ma}`;class fu extends Wt{constructor(e){super();f(this,"five");f(this,"behindFiveContainer");f(this,"VERSION",Ma);f(this,"staticPrefix","//vrlab-static.ljcdn.com");f(this,"create3DDomContainer",(e,n)=>{if(this.state.disposed)return;const o=(()=>{var h;(n==null?void 0:n.dpr)!==void 0&&console.warn(`${Mi}: please use "config.devicePixelRatio" replace "config.dpr"`);const u={ratio:.00216,devicePixelRatio:(h=n==null?void 0:n.dpr)!=null?h:1,mode:"front",autoRender:!0};return Object.assign(u,n,(n==null?void 0:n.mode)==="behind"?{scene:this.five.scene}:void 0)})(),s=this.five.getElement();if(!s){console.error(`${Mi}: five.getElement() is ${s}`);return}const{autoRender:r}=o;o.mode==="behind"&&o.behindFiveContainer&&(this.behindFiveContainer=o.behindFiveContainer);const a=this.create3DElement(this.five.camera,e,fe(Q({},o),{autoRender:!1}));if(!a)return;const l=()=>{const u=a.css3DObject.mode==="front"?s.parentElement:this.getBehindFiveElement();if(!u)return console.error(`${Mi}: wrapper is ${u}`);a.appendToElement(u),a.render()},c=()=>{a.css3DObject.mode==="front"&&l(),a.css3DObject.mode==="behind"&&Ca(this.five).then(()=>l())};return r&&c(),fe(Q({},a),{render:r?void 0:c})});this.five=e}disposeAll(){return this.dispose()}setState(...e){const n=super.setState(...e);return this.five.needsRender=!0,n}getBehindFiveElement(){return this.behindFiveContainer?this.behindFiveContainer:(this.behindFiveContainer=Ea(this.five),this.behindFiveContainer)}isAbsoluteURL(e){return ho(e)?e:`${this.staticPrefix}${e}`}}const Kt=i=>new fu(i);function Ti(i,t,e=new j.Vector3(1,1,1),n=!1){const o=new pa.Line(i,t);return o.setMaterial({dashed:n,color:e,linewidth:1}),o.remove(o.points),o}const mu=i=>{const t={intersection:null,disposers:[]},e=u=>{t.intersection=u},n=()=>{t.intersection=null};i.on("modelLoaded",()=>{i.on("intersectionOnModelUpdate",e),i.on("intersectionHidden",n)}),i.on("dispose",()=>{i.off("intersectionOnModelUpdate",e),i.off("intersectionHidden",n)});const o=(u,h=2,d=.1)=>{const m=h/2,p=c(u,d),A=new j.Group;A.add(Ti(new j.Vector3(p.x+m,p.y,p.z),new j.Vector3(p.x-m,p.y,p.z),new j.Vector3(1,0,0)),Ti(new j.Vector3(p.x,p.y+m,p.z),new j.Vector3(p.x,p.y-m,p.z),new j.Vector3(0,1,0)),Ti(new j.Vector3(p.x,p.y,p.z+m),new j.Vector3(p.x,p.y,p.z-m),new j.Vector3(0,0,1))),i.scene.add(A),i.needsRender=!0;const v=()=>{i.scene.remove(A)};return t.disposers.push(v),{clear:v,pointAxesHelperMesh:A}},s=(u,h=0)=>{var v,b;const d=(v=i==null?void 0:i.camera)==null?void 0:v.position;if(!d)return!1;const m=u.distanceTo(d),g=u.sub(d).normalize(),p=new j.Raycaster(d,g),A=(b=i.model.intersectRaycaster(p))==null?void 0:b[0];return!(A&&A.distance+h<m)},r=()=>t.intersection,a=()=>{var u,h;(h=(u=t.disposers)==null?void 0:u.forEach)==null||h.call(u,d=>d==null?void 0:d()),i.off("intersectionOnModelUpdate",e),i.off("intersectionHidden",n)},l=a,c=(u,h)=>{const d=u.clone();return i.camera.position.clone().sub(d).setLength(h).add(d)};return{intersection:r,pointAxesHelper:o,movePointTowardsCamera:c,destroy:a,dispose:l,canSeePoint:s}};function X(){}const At=i=>i;function Be(i,t){for(const e in t)i[e]=t[e];return i}function gu(i){return i&&typeof i=="object"&&typeof i.then=="function"}function Ta(i){return i()}function Ho(){return Object.create(null)}function Ge(i){i.forEach(Ta)}function $t(i){return typeof i=="function"}function ne(i,t){return i!=i?t==t:i!==t||i&&typeof i=="object"||typeof i=="function"}let jn;function Xe(i,t){return jn||(jn=document.createElement("a")),jn.href=t,i===jn.href}function pu(i){return Object.keys(i).length===0}function en(i,t,e,n){if(i){const o=za(i,t,e,n);return i[0](o)}}function za(i,t,e,n){return i[1]&&n?Be(e.ctx.slice(),i[1](n(t))):e.ctx}function tn(i,t,e,n){if(i[2]&&n){const o=i[2](n(e));if(t.dirty===void 0)return o;if(typeof o=="object"){const s=[],r=Math.max(t.dirty.length,o.length);for(let a=0;a<r;a+=1)s[a]=t.dirty[a]|o[a];return s}return t.dirty|o}return t.dirty}function nn(i,t,e,n,o,s){if(o){const r=za(t,e,n,s);i.p(r,o)}}function on(i){if(i.ctx.length>32){const t=[],e=i.ctx.length/32;for(let n=0;n<e;n++)t[n]=-1;return t}return-1}function Ie(i){return i==null?"":i}function ct(i){return i&&$t(i.destroy)?i.destroy:X}const Ba=typeof window!="undefined";let Va=Ba?()=>window.performance.now():()=>Date.now(),mo=Ba?i=>requestAnimationFrame(i):X;const Ht=new Set;function ja(i){Ht.forEach(t=>{t.c(i)||(Ht.delete(t),t.f())}),Ht.size!==0&&mo(ja)}function Oa(i){let t;return Ht.size===0&&mo(ja),{promise:new Promise(e=>{Ht.add(t={c:i,f:e})}),abort(){Ht.delete(t)}}}function V(i,t){i.appendChild(t)}function le(i,t,e){const n=go(i);if(!n.getElementById(t)){const o=z("style");o.id=t,o.textContent=e,Ra(n,o)}}function go(i){if(!i)return document;const t=i.getRootNode?i.getRootNode():i.ownerDocument;return t&&t.host?t:i.ownerDocument}function Au(i){const t=z("style");return Ra(go(i),t),t.sheet}function Ra(i,t){return V(i.head||i,t),t.sheet}function M(i,t,e){i.insertBefore(t,e||null)}function L(i){i.parentNode&&i.parentNode.removeChild(i)}function ut(i,t){for(let e=0;e<i.length;e+=1)i[e]&&i[e].d(t)}function z(i){return document.createElement(i)}function we(i){return document.createElementNS("http://www.w3.org/2000/svg",i)}function xe(i){return document.createTextNode(i)}function $(){return xe(" ")}function ge(){return xe("")}function me(i,t,e,n){return i.addEventListener(t,e,n),()=>i.removeEventListener(t,e,n)}function Qa(i){return function(t){return t.stopPropagation(),i.call(this,t)}}function y(i,t,e){e==null?i.removeAttribute(t):i.getAttribute(t)!==e&&i.setAttribute(t,e)}function vu(i){return Array.from(i.childNodes)}function Me(i,t){t=""+t,i.wholeText!==t&&(i.data=t)}function T(i,t,e,n){e===null?i.style.removeProperty(t):i.style.setProperty(t,e,n?"important":"")}let On;function bu(){if(On===void 0){On=!1;try{typeof window!="undefined"&&window.parent&&window.parent.document}catch(i){On=!0}}return On}function pi(i,t){getComputedStyle(i).position==="static"&&(i.style.position="relative");const n=z("iframe");n.setAttribute("style","display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden; border: 0; opacity: 0; pointer-events: none; z-index: -1;"),n.setAttribute("aria-hidden","true"),n.tabIndex=-1;const o=bu();let s;return o?(n.src="data:text/html,<script>onresize=function(){parent.postMessage(0,'*')}<\/script>",s=me(window,"message",r=>{r.source===n.contentWindow&&t()})):(n.src="about:blank",n.onload=()=>{s=me(n.contentWindow,"resize",t)}),V(i,n),()=>{(o||s&&n.contentWindow)&&s(),L(n)}}function q(i,t,e){i.classList[e?"add":"remove"](t)}function Fa(i,t,{bubbles:e=!1,cancelable:n=!1}={}){const o=document.createEvent("CustomEvent");return o.initCustomEvent(i,e,n,t),o}class ti{constructor(t=!1){this.is_svg=!1,this.is_svg=t,this.e=this.n=null}c(t){this.h(t)}m(t,e,n=null){this.e||(this.is_svg?this.e=we(e.nodeName):this.e=z(e.nodeName),this.t=e,this.c(t)),this.i(n)}h(t){this.e.innerHTML=t,this.n=Array.from(this.e.childNodes)}i(t){for(let e=0;e<this.n.length;e+=1)M(this.t,this.n[e],t)}p(t){this.d(),this.h(t),this.i(this.a)}d(){this.n.forEach(L)}}const ni=new Map;let ii=0;function yu(i){let t=5381,e=i.length;for(;e--;)t=(t<<5)-t^i.charCodeAt(e);return t>>>0}function wu(i,t){const e={stylesheet:Au(t),rules:{}};return ni.set(i,e),e}function Ha(i,t,e,n,o,s,r,a=0){const l=16.666/n;let c=`{
|
|
177
|
+
`;class La{constructor(t){f(this,"five");f(this,"contentElement",document.createElement("div"));f(this,"animeIns");f(this,"container");f(this,"css3DObject");f(this,"disposeCss3DObject");f(this,"state",{enabled:!1});this.five=t;const n=.4/2,s=Kt(t).create3DDomContainer([[-n,n,0],[-n,-n,0],[n,-n,0],[n,n,0]].map(r=>new E.Vector3().fromArray(r)));if(s){const{container:r,dispose:a,css3DObject:l}=s;this.container=r,this.css3DObject=l,this.disposeCss3DObject=a}this.contentElement.style.width="100%",this.contentElement.style.height="100%",this.contentElement.style.backgroundImage=`url(${Da})`,this.contentElement.style.backgroundSize="100%",this.contentElement.style.backgroundRepeat="no-repeat"}enable(){var t;this.state.enabled||(this.state.enabled=!0,(t=this.container)==null||t.appendChild(this.contentElement))}disable(){!this.state.enabled||(this.state.enabled=!1,this.contentElement.remove())}updateWithIntersect(t){if(!t.face||!this.css3DObject)return;const e=new E.Vector3().addVectors(t.point,t.face.normal);this.css3DObject.position.copy(t.point),this.css3DObject.lookAt(e),this.five.needsRender=!0}doAnimation(){var t;(t=this.animeIns)==null||t.dispose(),new fo({progress:0}).to({progress:[1,0]}).duration(500).easing(mi.Easing.Quadratic.InOut).onUpdate(({progress:e})=>{}).play()}dispose(){var t;(t=this.disposeCss3DObject)==null||t.call(this)}}class lu{constructor(t,e){f(this,"five");f(this,"hooks",new Ce.Subscribe);f(this,"magnifier",null);f(this,"pointHelper",null);f(this,"pointDomHelper",null);f(this,"contentDom",document.createElement("div"));f(this,"state",{enabled:!1});f(this,"group",new E.Group);this.five=t,this.magnifier=(e==null?void 0:e.magnifier)===void 0?new Ia(t,{dragEnabled:!0}):null,this.pointHelper=(e==null?void 0:e.pointHelper)===void 0?new xa:null,this.pointDomHelper=(e==null?void 0:e.pointDomHelper)===void 0?new La(t):null,this.group.name="five-point-selector",this.five.scene.add(this.group),this.contentDom.classList.add("five-point-selector-content"),this.contentDom.style.position="absolute",this.contentDom.style.top="0",this.contentDom.style.left="0",this.contentDom.style.width="100%",this.contentDom.style.height="100%",this.contentDom.style.pointerEvents="none"}enable(){var t,e;this.state.enabled||(this.state.enabled=!0,this.pointHelper&&this.group.add(this.pointHelper),(t=this.magnifier)==null||t.enable(),(e=this.pointDomHelper)==null||e.enable(),this.five.needsRender=!0,this.hooks.emit("enabled"))}disable(){var t,e;!this.state.enabled||(this.state.enabled=!1,this.pointHelper&&this.group.remove(this.pointHelper),(t=this.magnifier)==null||t.disable(),(e=this.pointDomHelper)==null||e.disable(),this.hooks.emit("disabled"))}dispose(){this.hooks.off(),this.disable(),this.magnifier=null,this.pointHelper=null,this.pointDomHelper=null}updateWithIntersect(t){var s;this.hooks.emit("pointChanged",{panoIndex:this.five.getCurrentState().panoIndex,position:t.point.toArray(),normal:(s=t.face)==null?void 0:s.normal.toArray()});const e=this.magnifier;e&&e.renderWithPoint(t.point);const n=this.pointHelper;n&&n.updateWithIntersect(t);const o=this.pointDomHelper;o&&o.updateWithIntersect(t),this.five.needsRender=!0}}function cu(i){return!Zt(i)}function Zt(i){return i!=null}function ho(i){return i.indexOf("//")===0||/^[0-9a-z]+\:\/\//i.test(i)}class fo extends bn.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=kn(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=[],bn.default.remove(this)})}}function Sa(i,t=bn.default.Easing.Linear.None){const e=new fo({progress:0}).to({progress:1});return i!==void 0&&e.duration(i),t!==void 0&&e.easing(t),e}const wn=window.requestAnimationFrame||(i=>setTimeout(i,16)),uu=window.cancelAnimationFrame||clearTimeout;function gi(i,t=0){t<=0?wn(i):wn(()=>gi(i,t-1))}function kn(i,t=60){let e=-1,n=0,o=-1;const s=1e3/t;function r(a){o===-1&&(o=a),e=wn(r),!(a-n<s)&&(n=a,i&&i(a-o))}return e=wn(r),function(){uu(e)}}function du(){const i=Date.now();return new Promise(t=>{wn(()=>{t(Date.now()-i)})})}const hu=Object.freeze(Object.defineProperty({__proto__:null,Interval:Ji,Rectangle:qc,isPanoramaLike:uo,isModelLike:Pa,Magnifier:Ia,getCoordsFromClient:Zc,getCoordsFromElement:ka,getRaycasterFromFivePointer:Kc,getIntersectFromRelativePosition:$c,PointHelper:xa,PointDomHelper:La,FivePointSelector:lu,isNil:cu,notNil:Zt,uuid:_e,isAbsoluteURL:ho,BetterTween:fo,tweenProgress:Sa,nextFrame:gi,requestAnimationFrameInterval:kn,getFrameTime:du},Symbol.toStringTag,{value:"Module"})),Ma="v2.0.1",Mi=`CSS3DRenderPlugin@${Ma}`;class fu extends Wt{constructor(e){super();f(this,"five");f(this,"behindFiveContainer");f(this,"VERSION",Ma);f(this,"staticPrefix","//vrlab-static.ljcdn.com");f(this,"create3DDomContainer",(e,n)=>{if(this.state.disposed)return;const o=(()=>{var h;(n==null?void 0:n.dpr)!==void 0&&console.warn(`${Mi}: please use "config.devicePixelRatio" replace "config.dpr"`);const u={ratio:.00216,devicePixelRatio:(h=n==null?void 0:n.dpr)!=null?h:1,mode:"front",autoRender:!0};return Object.assign(u,n,(n==null?void 0:n.mode)==="behind"?{scene:this.five.scene}:void 0)})(),s=this.five.getElement();if(!s){console.error(`${Mi}: five.getElement() is ${s}`);return}const{autoRender:r}=o;o.mode==="behind"&&o.behindFiveContainer&&(this.behindFiveContainer=o.behindFiveContainer);const a=this.create3DElement(this.five.camera,e,fe(F({},o),{autoRender:!1}));if(!a)return;const l=()=>{const u=a.css3DObject.mode==="front"?s.parentElement:this.getBehindFiveElement();if(!u)return console.error(`${Mi}: wrapper is ${u}`);a.appendToElement(u),a.render()},c=()=>{a.css3DObject.mode==="front"&&l(),a.css3DObject.mode==="behind"&&Ca(this.five).then(()=>l())};return r&&c(),fe(F({},a),{render:r?void 0:c})});this.five=e}disposeAll(){return this.dispose()}setState(...e){const n=super.setState(...e);return this.five.needsRender=!0,n}getBehindFiveElement(){return this.behindFiveContainer?this.behindFiveContainer:(this.behindFiveContainer=Ea(this.five),this.behindFiveContainer)}isAbsoluteURL(e){return ho(e)?e:`${this.staticPrefix}${e}`}}const Kt=i=>new fu(i);function Ti(i,t,e=new j.Vector3(1,1,1),n=!1){const o=new pa.Line(i,t);return o.setMaterial({dashed:n,color:e,linewidth:1}),o.remove(o.points),o}const mu=i=>{const t={intersection:null,disposers:[]},e=u=>{t.intersection=u},n=()=>{t.intersection=null};i.on("modelLoaded",()=>{i.on("intersectionOnModelUpdate",e),i.on("intersectionHidden",n)}),i.on("dispose",()=>{i.off("intersectionOnModelUpdate",e),i.off("intersectionHidden",n)});const o=(u,h=2,d=.1)=>{const m=h/2,p=c(u,d),A=new j.Group;A.add(Ti(new j.Vector3(p.x+m,p.y,p.z),new j.Vector3(p.x-m,p.y,p.z),new j.Vector3(1,0,0)),Ti(new j.Vector3(p.x,p.y+m,p.z),new j.Vector3(p.x,p.y-m,p.z),new j.Vector3(0,1,0)),Ti(new j.Vector3(p.x,p.y,p.z+m),new j.Vector3(p.x,p.y,p.z-m),new j.Vector3(0,0,1))),i.scene.add(A),i.needsRender=!0;const v=()=>{i.scene.remove(A)};return t.disposers.push(v),{clear:v,pointAxesHelperMesh:A}},s=(u,h=0)=>{var v,b;const d=(v=i==null?void 0:i.camera)==null?void 0:v.position;if(!d)return!1;const m=u.distanceTo(d),g=u.sub(d).normalize(),p=new j.Raycaster(d,g),A=(b=i.model.intersectRaycaster(p))==null?void 0:b[0];return!(A&&A.distance+h<m)},r=()=>t.intersection,a=()=>{var u,h;(h=(u=t.disposers)==null?void 0:u.forEach)==null||h.call(u,d=>d==null?void 0:d()),i.off("intersectionOnModelUpdate",e),i.off("intersectionHidden",n)},l=a,c=(u,h)=>{const d=u.clone();return i.camera.position.clone().sub(d).setLength(h).add(d)};return{intersection:r,pointAxesHelper:o,movePointTowardsCamera:c,destroy:a,dispose:l,canSeePoint:s}};function Y(){}const At=i=>i;function Be(i,t){for(const e in t)i[e]=t[e];return i}function gu(i){return i&&typeof i=="object"&&typeof i.then=="function"}function Ta(i){return i()}function Ho(){return Object.create(null)}function Ge(i){i.forEach(Ta)}function $t(i){return typeof i=="function"}function ne(i,t){return i!=i?t==t:i!==t||i&&typeof i=="object"||typeof i=="function"}let jn;function Xe(i,t){return jn||(jn=document.createElement("a")),jn.href=t,i===jn.href}function pu(i){return Object.keys(i).length===0}function en(i,t,e,n){if(i){const o=za(i,t,e,n);return i[0](o)}}function za(i,t,e,n){return i[1]&&n?Be(e.ctx.slice(),i[1](n(t))):e.ctx}function tn(i,t,e,n){if(i[2]&&n){const o=i[2](n(e));if(t.dirty===void 0)return o;if(typeof o=="object"){const s=[],r=Math.max(t.dirty.length,o.length);for(let a=0;a<r;a+=1)s[a]=t.dirty[a]|o[a];return s}return t.dirty|o}return t.dirty}function nn(i,t,e,n,o,s){if(o){const r=za(t,e,n,s);i.p(r,o)}}function on(i){if(i.ctx.length>32){const t=[],e=i.ctx.length/32;for(let n=0;n<e;n++)t[n]=-1;return t}return-1}function Ie(i){return i==null?"":i}function ct(i){return i&&$t(i.destroy)?i.destroy:Y}const Ba=typeof window!="undefined";let Va=Ba?()=>window.performance.now():()=>Date.now(),mo=Ba?i=>requestAnimationFrame(i):Y;const Ht=new Set;function ja(i){Ht.forEach(t=>{t.c(i)||(Ht.delete(t),t.f())}),Ht.size!==0&&mo(ja)}function Oa(i){let t;return Ht.size===0&&mo(ja),{promise:new Promise(e=>{Ht.add(t={c:i,f:e})}),abort(){Ht.delete(t)}}}function V(i,t){i.appendChild(t)}function le(i,t,e){const n=go(i);if(!n.getElementById(t)){const o=B("style");o.id=t,o.textContent=e,Ra(n,o)}}function go(i){if(!i)return document;const t=i.getRootNode?i.getRootNode():i.ownerDocument;return t&&t.host?t:i.ownerDocument}function Au(i){const t=B("style");return Ra(go(i),t),t.sheet}function Ra(i,t){return V(i.head||i,t),t.sheet}function M(i,t,e){i.insertBefore(t,e||null)}function L(i){i.parentNode&&i.parentNode.removeChild(i)}function ut(i,t){for(let e=0;e<i.length;e+=1)i[e]&&i[e].d(t)}function B(i){return document.createElement(i)}function we(i){return document.createElementNS("http://www.w3.org/2000/svg",i)}function xe(i){return document.createTextNode(i)}function ee(){return xe(" ")}function ge(){return xe("")}function me(i,t,e,n){return i.addEventListener(t,e,n),()=>i.removeEventListener(t,e,n)}function Fa(i){return function(t){return t.stopPropagation(),i.call(this,t)}}function y(i,t,e){e==null?i.removeAttribute(t):i.getAttribute(t)!==e&&i.setAttribute(t,e)}function vu(i){return Array.from(i.childNodes)}function Me(i,t){t=""+t,i.wholeText!==t&&(i.data=t)}function z(i,t,e,n){e===null?i.style.removeProperty(t):i.style.setProperty(t,e,n?"important":"")}let On;function bu(){if(On===void 0){On=!1;try{typeof window!="undefined"&&window.parent&&window.parent.document}catch(i){On=!0}}return On}function pi(i,t){getComputedStyle(i).position==="static"&&(i.style.position="relative");const n=B("iframe");n.setAttribute("style","display: block; position: absolute; top: 0; left: 0; width: 100%; height: 100%; overflow: hidden; border: 0; opacity: 0; pointer-events: none; z-index: -1;"),n.setAttribute("aria-hidden","true"),n.tabIndex=-1;const o=bu();let s;return o?(n.src="data:text/html,<script>onresize=function(){parent.postMessage(0,'*')}<\/script>",s=me(window,"message",r=>{r.source===n.contentWindow&&t()})):(n.src="about:blank",n.onload=()=>{s=me(n.contentWindow,"resize",t)}),V(i,n),()=>{(o||s&&n.contentWindow)&&s(),L(n)}}function q(i,t,e){i.classList[e?"add":"remove"](t)}function Qa(i,t,{bubbles:e=!1,cancelable:n=!1}={}){const o=document.createEvent("CustomEvent");return o.initCustomEvent(i,e,n,t),o}class ti{constructor(t=!1){this.is_svg=!1,this.is_svg=t,this.e=this.n=null}c(t){this.h(t)}m(t,e,n=null){this.e||(this.is_svg?this.e=we(e.nodeName):this.e=B(e.nodeName),this.t=e,this.c(t)),this.i(n)}h(t){this.e.innerHTML=t,this.n=Array.from(this.e.childNodes)}i(t){for(let e=0;e<this.n.length;e+=1)M(this.t,this.n[e],t)}p(t){this.d(),this.h(t),this.i(this.a)}d(){this.n.forEach(L)}}const ni=new Map;let ii=0;function yu(i){let t=5381,e=i.length;for(;e--;)t=(t<<5)-t^i.charCodeAt(e);return t>>>0}function wu(i,t){const e={stylesheet:Au(t),rules:{}};return ni.set(i,e),e}function Ha(i,t,e,n,o,s,r,a=0){const l=16.666/n;let c=`{
|
|
178
178
|
`;for(let A=0;A<=1;A+=l){const v=t+(e-t)*s(A);c+=A*100+`%{${r(v,1-v)}}
|
|
179
179
|
`}const u=c+`100% {${r(e,1-e)}}
|
|
180
|
-
}`,h=`__svelte_${yu(u)}_${a}`,d=go(i),{stylesheet:m,rules:g}=ni.get(d)||wu(d,i);g[h]||(g[h]=!0,m.insertRule(`@keyframes ${h} ${u}`,m.cssRules.length));const p=i.style.animation||"";return i.style.animation=`${p?`${p}, `:""}${h} ${n}ms linear ${o}ms 1 both`,ii+=1,h}function Zi(i,t){const e=(i.style.animation||"").split(", "),n=e.filter(t?s=>s.indexOf(t)<0:s=>s.indexOf("__svelte")===-1),o=e.length-n.length;o&&(i.style.animation=n.join(", "),ii-=o,ii||Cu())}function Cu(){mo(()=>{ii||(ni.forEach(i=>{const{ownerNode:t}=i.stylesheet;t&&L(t)}),ni.clear())})}let Cn;function lt(i){Cn=i}function Ct(){if(!Cn)throw new Error("Function called outside component initialization");return Cn}function _a(i){Ct().$$.before_update.push(i)}function Ze(i){Ct().$$.on_mount.push(i)}function Ga(i){Ct().$$.after_update.push(i)}function Et(i){Ct().$$.on_destroy.push(i)}function Ai(){const i=Ct();return(t,e,{cancelable:n=!1}={})=>{const o=i.$$.callbacks[t];if(o){const s=Fa(t,e,{cancelable:n});return o.slice().forEach(r=>{r.call(i,s)}),!s.defaultPrevented}return!0}}function Ki(i,t){return Ct().$$.context.set(i,t),t}function vt(i){return Ct().$$.context.get(i)}function sn(i,t){const e=i.$$.callbacks[t.type];e&&e.slice().forEach(n=>n.call(this,t))}const mn=[],Ve=[],qn=[],$i=[],Wa=Promise.resolve();let eo=!1;function Na(){eo||(eo=!0,Wa.then(po))}function _o(){return Na(),Wa}function Qe(i){qn.push(i)}function Xa(i){$i.push(i)}const zi=new Set;let Rn=0;function po(){const i=Cn;do{for(;Rn<mn.length;){const t=mn[Rn];Rn++,lt(t),Eu(t.$$)}for(lt(null),mn.length=0,Rn=0;Ve.length;)Ve.pop()();for(let t=0;t<qn.length;t+=1){const e=qn[t];zi.has(e)||(zi.add(e),e())}qn.length=0}while(mn.length);for(;$i.length;)$i.pop()();eo=!1,zi.clear(),lt(i)}function Eu(i){if(i.fragment!==null){i.update(),Ge(i.before_update);const t=i.dirty;i.dirty=[-1],i.fragment&&i.fragment.p(i.ctx,t),i.after_update.forEach(Qe)}}let cn;function Ya(){return cn||(cn=Promise.resolve(),cn.then(()=>{cn=null})),cn}function oi(i,t,e){i.dispatchEvent(Fa(`${t?"intro":"outro"}${e}`))}const Jn=new Set;let mt;function se(){mt={r:0,c:[],p:mt}}function re(){mt.r||Ge(mt.c),mt=mt.p}function P(i,t){i&&i.i&&(Jn.delete(i),i.i(t))}function D(i,t,e,n){if(i&&i.o){if(Jn.has(i))return;Jn.add(i),mt.c.push(()=>{Jn.delete(i),n&&(e&&i.d(1),n())}),i.o(t)}else n&&n()}const Ua={duration:0};function Mt(i,t,e){let n=t(i,e),o=!1,s,r,a=0;function l(){s&&Zi(i,s)}function c(){const{delay:h=0,duration:d=300,easing:m=At,tick:g=X,css:p}=n||Ua;p&&(s=Ha(i,0,1,d,h,m,p,a++)),g(0,1);const A=Va()+h,v=A+d;r&&r.abort(),o=!0,Qe(()=>oi(i,!0,"start")),r=Oa(b=>{if(o){if(b>=v)return g(1,0),oi(i,!0,"end"),l(),o=!1;if(b>=A){const w=m((b-A)/d);g(w,1-w)}}return o})}let u=!1;return{start(){u||(u=!0,Zi(i),$t(n)?(n=n(),Ya().then(c)):c())},invalidate(){u=!1},end(){o&&(l(),o=!1)}}}function rn(i,t,e){let n=t(i,e),o=!0,s;const r=mt;r.r+=1;function a(){const{delay:l=0,duration:c=300,easing:u=At,tick:h=X,css:d}=n||Ua;d&&(s=Ha(i,1,0,c,l,u,d));const m=Va()+l,g=m+c;Qe(()=>oi(i,!1,"start")),Oa(p=>{if(o){if(p>=g)return h(0,1),oi(i,!1,"end"),--r.r||Ge(r.c),!1;if(p>=m){const A=u((p-m)/c);h(1-A,A)}}return o})}return $t(n)?Ya().then(()=>{n=n(),a()}):a(),{end(l){l&&n.tick&&n.tick(1,0),o&&(s&&Zi(i,s),o=!1)}}}function si(i,t){const e=t.token={};function n(o,s,r,a){if(t.token!==e)return;t.resolved=a;let l=t.ctx;r!==void 0&&(l=l.slice(),l[r]=a);const c=o&&(t.current=o)(l);let u=!1;t.block&&(t.blocks?t.blocks.forEach((h,d)=>{d!==s&&h&&(se(),D(h,1,1,()=>{t.blocks[d]===h&&(t.blocks[d]=null)}),re())}):t.block.d(1),c.c(),P(c,1),c.m(t.mount(),t.anchor),u=!0),t.block=c,t.blocks&&(t.blocks[s]=c),u&&po()}if(gu(i)){const o=Ct();if(i.then(s=>{lt(o),n(t.then,1,t.value,s),lt(null)},s=>{if(lt(o),n(t.catch,2,t.error,s),lt(null),!t.hasCatch)throw s}),t.current!==t.pending)return n(t.pending,0),!0}else{if(t.current!==t.then)return n(t.then,1,t.value,i),!0;t.resolved=i}}function qa(i,t,e){const n=t.slice(),{resolved:o}=i;i.current===i.then&&(n[i.value]=o),i.current===i.catch&&(n[i.error]=o),i.block.p(n,e)}const Pu=typeof window!="undefined"?window:typeof globalThis!="undefined"?globalThis:global;function Ao(i,t){i.d(1),t.delete(i.key)}function Pt(i,t){D(i,1,1,()=>{t.delete(i.key)})}function Ke(i,t,e,n,o,s,r,a,l,c,u,h){let d=i.length,m=s.length,g=d;const p={};for(;g--;)p[i[g].key]=g;const A=[],v=new Map,b=new Map;for(g=m;g--;){const I=h(o,s,g),B=e(I);let x=r.get(B);x?n&&x.p(I,t):(x=c(B,I),x.c()),v.set(B,A[g]=x),B in p&&b.set(B,Math.abs(g-p[B]))}const w=new Set,k=new Set;function C(I){P(I,1),I.m(a,u),r.set(I.key,I),u=I.first,m--}for(;d&&m;){const I=A[m-1],B=i[d-1],x=I.key,H=B.key;I===B?(u=I.first,d--,m--):v.has(H)?!r.has(x)||w.has(x)?C(I):k.has(H)?d--:b.get(x)>b.get(H)?(k.add(x),C(I)):(w.add(H),d--):(l(B,r),d--)}for(;d--;){const I=i[d];v.has(I.key)||l(I,r)}for(;m;)C(A[m-1]);return A}function Fe(i,t){const e={},n={},o={$$scope:1};let s=i.length;for(;s--;){const r=i[s],a=t[s];if(a){for(const l in r)l in a||(n[l]=1);for(const l in a)o[l]||(e[l]=a[l],o[l]=1);i[s]=a}else for(const l in r)o[l]=1}for(const r in n)r in e||(e[r]=void 0);return e}function Ja(i){return typeof i=="object"&&i!==null?i:{}}function Za(i,t,e){const n=i.$$.props[t];n!==void 0&&(i.$$.bound[n]=e,e(i.$$.ctx[n]))}function K(i){i&&i.c()}function J(i,t,e,n){const{fragment:o,after_update:s}=i.$$;o&&o.m(t,e),n||Qe(()=>{const r=i.$$.on_mount.map(Ta).filter($t);i.$$.on_destroy?i.$$.on_destroy.push(...r):Ge(r),i.$$.on_mount=[]}),s.forEach(Qe)}function Z(i,t){const e=i.$$;e.fragment!==null&&(Ge(e.on_destroy),e.fragment&&e.fragment.d(t),e.on_destroy=e.fragment=null,e.ctx=[])}function Iu(i,t){i.$$.dirty[0]===-1&&(mn.push(i),Na(),i.$$.dirty.fill(0)),i.$$.dirty[t/31|0]|=1<<t%31}function ie(i,t,e,n,o,s,r,a=[-1]){const l=Cn;lt(i);const c=i.$$={fragment:null,ctx:[],props:s,update:X,not_equal:o,bound:Ho(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(l?l.$$.context:[])),callbacks:Ho(),dirty:a,skip_bound:!1,root:t.target||l.$$.root};r&&r(c.root);let u=!1;if(c.ctx=e?e(i,t.props||{},(h,d,...m)=>{const g=m.length?m[0]:d;return c.ctx&&o(c.ctx[h],c.ctx[h]=g)&&(!c.skip_bound&&c.bound[h]&&c.bound[h](g),u&&Iu(i,h)),d}):[],c.update(),u=!0,Ge(c.before_update),c.fragment=n?n(c.ctx):!1,t.target){if(t.hydrate){const h=vu(t.target);c.fragment&&c.fragment.l(h),h.forEach(L)}else c.fragment&&c.fragment.c();t.intro&&P(i.$$.fragment),J(i,t.target,t.anchor,t.customElement),po()}lt(l)}class oe{$destroy(){Z(this,1),this.$destroy=X}$on(t,e){if(!$t(e))return X;const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const o=n.indexOf(e);o!==-1&&n.splice(o,1)}}$set(t){this.$$set&&!pu(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const ku="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAAA8CAYAAACZ1L+0AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAYKADAAQAAAABAAAAPAAAAABU0H2EAAARRElEQVR4Ad2czY9cRZbFq1yFoQGDNCzwuAENohl54dkgdrNh34tZ8GciFi31nwEsmAEhhAWD1GMJCZgx5sMfUHN+J+NE3XfrZWWVcVVLHVLmuXG/74148V5m2bm/N8bR0dH+Bx988Po333zzbz///PONg4ODa+I9I9y/cuXKgV77h4eH+1KH3hP/yv7+vuBAsG+5UCIpCkMzDQ962Eu80Q1P/KmHT82v8IocZFL4pslDvL3fNARHoPI2wtbrV1jBIf9N8SEZ0UUP2wFHv2ocSc/2ouEz8PVooJXQ0/j10aNHoH2Idj4PHz4k1n29/k+5/u3ll1/+r7fffvtLzfGzd8ibjK6+9957f5ajf1XzH9y7d+8Xjf9FRs1SdvNBBg2SDQ1xh9ALH4yN0M2BNZrKwtFc9Fmkquuma5HJBzvLiIONBnx40B7QIzTdxCcNwj3dYlEoUmabAU+UFZDpxah22Ng2NjQXH0LrwccGwyEzXfWhWQwSYQHYuFevXj14/vnn37h79+7Nr7766gup/FX5PnAj33///f/46aef3vj444/vfPbZZz9IYGMcnDbkhEYQL001Hfsu775i+7j6LID6cDQWYo8mabGMxOr+e/ye3y7989p3/9jfvHnz2q1bt25oMb549913/3Lwzjvv/Mu3337775988smdzz///AcVQ+Iec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VolIGMabAnhGgUb71iahI7fFf7FIFCb3j/18voiuemdd/Mu/+uE1sQWfeX3MBuyzx5B39P/fRcr4dcAT9p5bxl4zhIgNqgnlRkILKuf1654tIUCk2oLJYbQpr0ZqRrGt30C1tk4FnyQYccray31B3s9UQviG104IUGmZ8mH5v+3qF2w51nn332TzHCsI7KJzEVm6akEVuPhLWGhUeM0CAjvkHmxCM+uCYPD2R0f2Ilt7lB4tMGZ3i7qPqfe+65P6j3X1y5du3aZ3rSefrGjRsvkNxpI80AeTGC0NgGoakvuFYrtvDjD11okBF6m3yjdfze9eM7sbPQIC8sg8detlPdP7XCy8ASOh6IC534Qf126Au6Aq7S+0P9jOJ/f/jhh7dfeeWVN1C4c+cOv5zoxsQgKD7O/OgIT3OLgrrkLAMR9EuQYsXLlWO5ePNMJ25s7Fhv8EIraduDDOJI7kfh6FT98M6Ka/GrLbE0/131X79+/YVXX331+tNPP32b3nt1tGhXP/rooz/ruf9N/YzWQ/2e2c8Cfg7Wz8RC9WkeE8pj/rQltMRH/jXdsdreAEp04mg8u22zYhvZ9IPueLE4puMLfnjRKzKCbD4ZHv9oK/mwaPOlm/ukkbFwjKLj428j8t8DEEvN9xJoJuhsDI9lxOeHXr3zE8cGm7fpQMfNgR54ntXmYXzx1ltvbX64VUl4SH//66+/fl2/5ndLC/BHMV/Q6ypN06Bm3lgFaKMcEbj+bDHN88/curvewF4hjhNWasrwhy/0waIPjylyYjp49Ag++NhFhi7F+jeEFcc/H6w5TYbnxo2OoufXmNPcX+XWv4QLMo+taJkfeY4gvtRs/n8vzY/cssxB5CyKxi96/aB+/Y9+KfE/X3vttS8lI7e9/wfu514OAjYP0QAAAABJRU5ErkJggg==";function xu(i){le(i,"svelte-1d7uzh5",".room-label-item.svelte-1d7uzh5{position:absolute;font-size:0.5rem;z-index:0;transform:none;cursor:pointer;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.room-label-item__text.svelte-1d7uzh5{position:absolute;left:0;top:-4rem;transform:translate(-50%, 0);display:flex;justify-content:center;align-items:center;height:1.25rem;min-width:2rem;padding:0 0.375rem;pointer-events:all;background-size:100% 100%;background-repeat:no-repeat;white-space:nowrap}.room-label-item__bar.svelte-1d7uzh5{position:absolute;top:-2.75rem;height:3rem;width:0.0625rem;background-image:linear-gradient(to bottom, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0))}.wide.svelte-1d7uzh5{font-size:0.625rem}")}function Du(i){let t,e,n=i[0].name+"",o,s,r,a,l;return{c(){t=z("div"),e=z("span"),o=xe(n),s=$(),r=z("div"),y(e,"class","room-label-item__text svelte-1d7uzh5"),T(e,"background-image","url("+ku+")"),q(e,"wide",i[0].name.length>3),y(r,"class","room-label-item__bar svelte-1d7uzh5"),y(t,"class","room-label-item svelte-1d7uzh5"),T(t,"z-index",i[0].zIndex),T(t,"transform",i[0].transform),T(t,"opacity",i[0].visible?1:0)},m(c,u){M(c,t,u),V(t,e),V(e,o),V(t,s),V(t,r),a||(l=me(e,"click",i[1]),a=!0)},p(c,[u]){u&1&&n!==(n=c[0].name+"")&&Me(o,n),u&1&&q(e,"wide",c[0].name.length>3),u&1&&T(t,"z-index",c[0].zIndex),u&1&&T(t,"transform",c[0].transform),u&1&&T(t,"opacity",c[0].visible?1:0)},i:X,o:X,d(c){c&&L(t),a=!1,l()}}}function Lu(i,t,e){let{five:n}=t,{roomLabel:o}=t;function s(){n.setState({panoIndex:o.panoIndex,mode:"Panorama",longitude:o.longitude})}return i.$$set=r=>{"five"in r&&e(2,n=r.five),"roomLabel"in r&&e(0,o=r.roomLabel)},[o,s,n]}class Su extends oe{constructor(t){super(),ie(this,t,Lu,Du,ne,{five:2,roomLabel:0},xu)}}var Ka=function(){if(typeof Map!="undefined")return Map;function i(t,e){var n=-1;return t.some(function(o,s){return o[0]===e?(n=s,!0):!1}),n}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(e){var n=i(this.__entries__,e),o=this.__entries__[n];return o&&o[1]},t.prototype.set=function(e,n){var o=i(this.__entries__,e);~o?this.__entries__[o][1]=n:this.__entries__.push([e,n])},t.prototype.delete=function(e){var n=this.__entries__,o=i(n,e);~o&&n.splice(o,1)},t.prototype.has=function(e){return!!~i(this.__entries__,e)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,n){n===void 0&&(n=null);for(var o=0,s=this.__entries__;o<s.length;o++){var r=s[o];e.call(n,r[1],r[0])}},t}()}(),to=typeof window!="undefined"&&typeof document!="undefined"&&window.document===document,ri=function(){return typeof global!="undefined"&&global.Math===Math?global:typeof self!="undefined"&&self.Math===Math?self:typeof window!="undefined"&&window.Math===Math?window:Function("return this")()}(),Mu=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(ri):function(i){return setTimeout(function(){return i(Date.now())},1e3/60)}}(),Tu=2;function zu(i,t){var e=!1,n=!1,o=0;function s(){e&&(e=!1,i()),n&&a()}function r(){Mu(s)}function a(){var l=Date.now();if(e){if(l-o<Tu)return;n=!0}else e=!0,n=!1,setTimeout(r,t);o=l}return a}var Bu=20,Vu=["top","right","bottom","left","width","height","size","weight"],ju=typeof MutationObserver!="undefined",Ou=function(){function i(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=zu(this.refresh.bind(this),Bu)}return i.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},i.prototype.removeObserver=function(t){var e=this.observers_,n=e.indexOf(t);~n&&e.splice(n,1),!e.length&&this.connected_&&this.disconnect_()},i.prototype.refresh=function(){var t=this.updateObservers_();t&&this.refresh()},i.prototype.updateObservers_=function(){var t=this.observers_.filter(function(e){return e.gatherActive(),e.hasActive()});return t.forEach(function(e){return e.broadcastActive()}),t.length>0},i.prototype.connect_=function(){!to||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),ju?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},i.prototype.disconnect_=function(){!to||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},i.prototype.onTransitionEnd_=function(t){var e=t.propertyName,n=e===void 0?"":e,o=Vu.some(function(s){return!!~n.indexOf(s)});o&&this.refresh()},i.getInstance=function(){return this.instance_||(this.instance_=new i),this.instance_},i.instance_=null,i}(),$a=function(i,t){for(var e=0,n=Object.keys(t);e<n.length;e++){var o=n[e];Object.defineProperty(i,o,{value:t[o],enumerable:!1,writable:!1,configurable:!0})}return i},Nt=function(i){var t=i&&i.ownerDocument&&i.ownerDocument.defaultView;return t||ri},el=vi(0,0,0,0);function ai(i){return parseFloat(i)||0}function Go(i){for(var t=[],e=1;e<arguments.length;e++)t[e-1]=arguments[e];return t.reduce(function(n,o){var s=i["border-"+o+"-width"];return n+ai(s)},0)}function Ru(i){for(var t=["top","right","bottom","left"],e={},n=0,o=t;n<o.length;n++){var s=o[n],r=i["padding-"+s];e[s]=ai(r)}return e}function Qu(i){var t=i.getBBox();return vi(0,0,t.width,t.height)}function Fu(i){var t=i.clientWidth,e=i.clientHeight;if(!t&&!e)return el;var n=Nt(i).getComputedStyle(i),o=Ru(n),s=o.left+o.right,r=o.top+o.bottom,a=ai(n.width),l=ai(n.height);if(n.boxSizing==="border-box"&&(Math.round(a+s)!==t&&(a-=Go(n,"left","right")+s),Math.round(l+r)!==e&&(l-=Go(n,"top","bottom")+r)),!_u(i)){var c=Math.round(a+s)-t,u=Math.round(l+r)-e;Math.abs(c)!==1&&(a-=c),Math.abs(u)!==1&&(l-=u)}return vi(o.left,o.top,a,l)}var Hu=function(){return typeof SVGGraphicsElement!="undefined"?function(i){return i instanceof Nt(i).SVGGraphicsElement}:function(i){return i instanceof Nt(i).SVGElement&&typeof i.getBBox=="function"}}();function _u(i){return i===Nt(i).document.documentElement}function Gu(i){return to?Hu(i)?Qu(i):Fu(i):el}function Wu(i){var t=i.x,e=i.y,n=i.width,o=i.height,s=typeof DOMRectReadOnly!="undefined"?DOMRectReadOnly:Object,r=Object.create(s.prototype);return $a(r,{x:t,y:e,width:n,height:o,top:e,right:t+n,bottom:o+e,left:t}),r}function vi(i,t,e,n){return{x:i,y:t,width:e,height:n}}var Nu=function(){function i(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=vi(0,0,0,0),this.target=t}return i.prototype.isActive=function(){var t=Gu(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},i.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},i}(),Xu=function(){function i(t,e){var n=Wu(e);$a(this,{target:t,contentRect:n})}return i}(),Yu=function(){function i(t,e,n){if(this.activeObservations_=[],this.observations_=new Ka,typeof t!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=e,this.callbackCtx_=n}return i.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(t instanceof Nt(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var e=this.observations_;e.has(t)||(e.set(t,new Nu(t)),this.controller_.addObserver(this),this.controller_.refresh())}},i.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(t instanceof Nt(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var e=this.observations_;!e.has(t)||(e.delete(t),e.size||this.controller_.removeObserver(this))}},i.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},i.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(e){e.isActive()&&t.activeObservations_.push(e)})},i.prototype.broadcastActive=function(){if(!!this.hasActive()){var t=this.callbackCtx_,e=this.activeObservations_.map(function(n){return new Xu(n.target,n.broadcastRect())});this.callback_.call(t,e,t),this.clearActive()}},i.prototype.clearActive=function(){this.activeObservations_.splice(0)},i.prototype.hasActive=function(){return this.activeObservations_.length>0},i}(),tl=typeof WeakMap!="undefined"?new WeakMap:new Ka,nl=function(){function i(t){if(!(this instanceof i))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var e=Ou.getInstance(),n=new Yu(t,e,this);tl.set(this,n)}return i}();["observe","unobserve","disconnect"].forEach(function(i){nl.prototype[i]=function(){var t;return(t=tl.get(this))[i].apply(t,arguments)}});var Uu=function(){return typeof ri.ResizeObserver!="undefined"?ri.ResizeObserver:nl}();function an(i){new Uu((e,n)=>{var o,s,r,a,l,c;for(const u of e){const{borderBoxSize:h,contentRect:d}=u,m=(r=(s=(o=h==null?void 0:h[0])==null?void 0:o.inlineSize)!=null?s:d.width)!=null?r:i.clientWidth,g=(c=(l=(a=h==null?void 0:h[0])==null?void 0:a.blockSize)!=null?l:d.height)!=null?c:i.clientHeight;i.dispatchEvent(new CustomEvent("clientWidth",{detail:m})),i.dispatchEvent(new CustomEvent("clientHeight",{detail:g}))}}).observe(i)}const{Map:qu}=Pu;function Ju(i){le(i,"svelte-9eg4zi",".room-labels-container.svelte-9eg4zi{width:100%;height:100%;position:relative;color:#fff}")}function Wo(i,t,e){const n=i.slice();return n[13]=t[e],n}function No(i,t){let e,n,o;return n=new Su({props:{roomLabel:t[13],five:t[1]}}),{key:i,first:null,c(){e=ge(),K(n.$$.fragment),this.first=e},m(s,r){M(s,e,r),J(n,s,r),o=!0},p(s,r){t=s;const a={};r&1&&(a.roomLabel=t[13]),r&2&&(a.five=t[1]),n.$set(a)},i(s){o||(P(n.$$.fragment,s),o=!0)},o(s){D(n.$$.fragment,s),o=!1},d(s){s&&L(e),Z(n,s)}}}function Zu(i){let t,e=[],n=new qu,o,s,r,a=i[0];const l=c=>c[13].id;for(let c=0;c<a.length;c+=1){let u=Wo(i,a,c),h=l(u);n.set(h,e[c]=No(h,u))}return{c(){t=z("div");for(let c=0;c<e.length;c+=1)e[c].c();y(t,"class","room-labels-container svelte-9eg4zi")},m(c,u){M(c,t,u);for(let h=0;h<e.length;h+=1)e[h].m(t,null);o=!0,s||(r=[ct(an.call(null,t)),me(t,"clientWidth",i[6]),me(t,"clientHeight",i[7])],s=!0)},p(c,[u]){u&3&&(a=c[0],se(),e=Ke(e,u,l,1,c,a,n,t,Pt,No,null,Wo),re())},i(c){if(!o){for(let u=0;u<a.length;u+=1)P(e[u]);o=!0}},o(c){for(let u=0;u<e.length;u+=1)D(e[u]);o=!1},d(c){c&&L(t);for(let u=0;u<e.length;u+=1)e[u].d();s=!1,Ge(r)}}}function Ku(i,t,e){var A;let n,{five:o}=t,{roomLabels:s}=t,r,a,l=(A=o.model.shownFloor)!=null?A:null;function c(v){if(!(l===null||v.floorIndex===l))return!1;const w=new j.Raycaster,k=o.camera.position.clone(),C=new j.Vector3(v.position.x,v.position.y,v.position.z),I=C.distanceTo(k);w.set(k.clone(),C.clone().sub(k).normalize());const[B]=o.model.intersectRaycaster(w);return!(B&&B.distance+1<I)}function u(v,b){const k=new j.Vector3(v.position.x,v.position.y,v.position.z).clone().project(o.camera),C=Math.ceil((k.x+1)/2*b.x),I=Math.ceil((-k.y+1)/2*b.y);return`translate(${C}px, ${I}px)`}function h(v){const{rendererSize:b,shownFloor:w}=v,k=new Map;function C(B){const x=k.get(B.id);if(x)return x;const{x:H,y:N,z:R}=B.position,O=new j.Vector3(H,N,R).clone().distanceTo(o.camera.position);return k.set(B.id,O),O}return s.map(B=>{const x=c(B),H=x?u(B,b):B.transform,N=C(B),O=s.filter(S=>S.visible&&C(S)<N).length*10;return fe(Q({},B),{visible:x,transform:H,zIndex:O})})}function d(){e(0,s=h({rendererSize:n,shownFloor:l}))}function m(v){e(4,l=v)}o.on("cameraUpdate",d),o.on("modelShownFloorChange",m),Ga(()=>{e(0,s=h({rendererSize:n,shownFloor:l}))}),Et(()=>{o.off("cameraUpdate",d),o.off("modelShownFloorChange",m)});const g=v=>{e(2,r=v.detail)},p=v=>{e(3,a=v.detail)};return i.$$set=v=>{"five"in v&&e(1,o=v.five),"roomLabels"in v&&e(0,s=v.roomLabels)},i.$$.update=()=>{i.$$.dirty&12&&e(5,n={x:r,y:a}),i.$$.dirty&48&&e(0,s=h({rendererSize:n,shownFloor:l}))},[s,o,r,a,l,n,g,p]}class $u extends oe{constructor(t){super(),ie(this,t,Ku,Zu,ne,{five:1,roomLabels:0},Ju)}}function ed(i){return i.model_room_labels.map(({id:t,pano_index:e,floor_index:n,name:o,position:s,longitude:r})=>({id:t,name:o,position:s,longitude:r,panoIndex:e,floorIndex:n,zIndex:0,visible:!1,transform:""}))}class td{constructor(t){f(this,"five");f(this,"enabled",!0);f(this,"fiveModeEnabled");f(this,"app");f(this,"wrapper");f(this,"roomLabels",[]);f(this,"container",document.createElement("div"));f(this,"onFiveModeChange",t=>{if(!this.checkFiveMode(t)){this.fiveModeEnabled=!1,this.render();return}this.five.once("initAnimationEnded",()=>{this.fiveModeEnabled=this.checkFiveMode(this.five.getCurrentState().mode),this.render()})});this.five=t,this.fiveModeEnabled=this.checkFiveMode(t.getCurrentState().mode),this.container.classList.add("model-room-label-plugin-container"),this.container.style.width="100%",this.container.style.height="100%",this.container.style.position="absolute",this.container.style.pointerEvents="none",this.container.style.left="0",this.container.style.top="0",this.container.style.zIndex="5",this.five.once("dispose",()=>this.dispose()),this.five.on("modeChange",this.onFiveModeChange),this.render()}dispose(){this.five.off("modeChange",this.onFiveModeChange),this.container.remove()}load(t){this.roomLabels=ed(t),this.render()}appendTo(t){return this.wrapper=t,t.appendChild(this.container),this.render(),this}disable(){return this.enabled=!1,this.render(),this}enable(){return this.enabled=!0,this.render(),this}checkFiveMode(t){return t==="Floorplan"||t==="Mapview"}render(){var t;if(!!this.wrapper){if(!this.enabled||!this.fiveModeEnabled){(t=this.app)==null||t.$destroy(),this.app=void 0;return}this.app?this.app.$set({five:this.five,roomLabels:this.roomLabels}):this.app=new $u({target:this.container,props:{five:this.five,roomLabels:this.roomLabels}})}}}const nd=i=>new td(i),id={name:"ModelRoomLabelPlugin",version:0};var gt=(i=>(i[i.FLOOR=1]="FLOOR",i[i.CEILING=2]="CEILING",i[i.BOUNDING_CENTER=3]="BOUNDING_CENTER",i))(gt||{});function li(i){return _(this,null,function*(){try{return[null,yield i]}catch(t){return t instanceof Error?[t,null]:[new Error(""),null]}})}function ci(i){return Object.prototype.toString.call(i)==="[object Object]"}function bi(i,t){return i===t?!0:typeof i!=typeof t?!1:!!(Number.isNaN(i)&&Number.isNaN(t))}function od(i,t){const e=Object.getOwnPropertyNames(i),n=Object.getOwnPropertyNames(t);if(e.length!==n.length)return!1;for(let o=0,s=e.length;o<s;o++){const r=e[o];if(!bi(i[r],t[r]))return!1}return!0}function sd(i,t){if(i.length!==t.length)return!1;for(let e=0,n=i.length;e<n;e++)if(!bi(i[e],t[e]))return!1;return!0}function rd(i,t){return bi(i,t)?!0:ci(i)&&ci(t)?od(i,t):Array.isArray(i)&&Array.isArray(t)?sd(i,t):!1}function vo(i,t){return bi(i,t)?!0:ci(i)&&ci(t)?ld(i,t):Array.isArray(i)&&Array.isArray(t)?ad(i,t):!1}function ad(i,t){if(i.length!==t.length)return!1;for(let e=0,n=i.length;e<n;e++)if(!vo(i[e],t[e]))return!1;return!0}function ld(i,t){const e=Object.getOwnPropertyNames(i),n=Object.getOwnPropertyNames(t);if(e.length!==n.length)return!1;for(let o=0,s=e.length;o<s;o++){const r=e[o];if(!vo(i[r],t[r]))return!1}return!0}function nt(i,t,e={deep:!1}){return e.deep?vo(i,t):rd(i,t)}function Xt(i){return i<.5?4*i*i*i:.5*Math.pow(2*i-2,3)+1}function il(i){const t=i-1;return t*t*t+1}function St(i,{delay:t=0,duration:e=400,easing:n=At}={}){const o=+getComputedStyle(i).opacity;return{delay:t,duration:e,easing:n,css:s=>`opacity: ${s*o}`}}function Xo(i,{delay:t=0,duration:e=400,easing:n=il,x:o=0,y:s=0,opacity:r=0}={}){const a=getComputedStyle(i),l=+a.opacity,c=a.transform==="none"?"":a.transform,u=l*(1-r);return{delay:t,duration:e,easing:n,css:(h,d)=>`
|
|
180
|
+
}`,h=`__svelte_${yu(u)}_${a}`,d=go(i),{stylesheet:m,rules:g}=ni.get(d)||wu(d,i);g[h]||(g[h]=!0,m.insertRule(`@keyframes ${h} ${u}`,m.cssRules.length));const p=i.style.animation||"";return i.style.animation=`${p?`${p}, `:""}${h} ${n}ms linear ${o}ms 1 both`,ii+=1,h}function Zi(i,t){const e=(i.style.animation||"").split(", "),n=e.filter(t?s=>s.indexOf(t)<0:s=>s.indexOf("__svelte")===-1),o=e.length-n.length;o&&(i.style.animation=n.join(", "),ii-=o,ii||Cu())}function Cu(){mo(()=>{ii||(ni.forEach(i=>{const{ownerNode:t}=i.stylesheet;t&&L(t)}),ni.clear())})}let Cn;function lt(i){Cn=i}function Ct(){if(!Cn)throw new Error("Function called outside component initialization");return Cn}function _a(i){Ct().$$.before_update.push(i)}function Ze(i){Ct().$$.on_mount.push(i)}function Ga(i){Ct().$$.after_update.push(i)}function Et(i){Ct().$$.on_destroy.push(i)}function Ai(){const i=Ct();return(t,e,{cancelable:n=!1}={})=>{const o=i.$$.callbacks[t];if(o){const s=Qa(t,e,{cancelable:n});return o.slice().forEach(r=>{r.call(i,s)}),!s.defaultPrevented}return!0}}function Ki(i,t){return Ct().$$.context.set(i,t),t}function vt(i){return Ct().$$.context.get(i)}function sn(i,t){const e=i.$$.callbacks[t.type];e&&e.slice().forEach(n=>n.call(this,t))}const mn=[],Ve=[],qn=[],$i=[],Wa=Promise.resolve();let eo=!1;function Na(){eo||(eo=!0,Wa.then(po))}function _o(){return Na(),Wa}function Fe(i){qn.push(i)}function Xa(i){$i.push(i)}const zi=new Set;let Rn=0;function po(){const i=Cn;do{for(;Rn<mn.length;){const t=mn[Rn];Rn++,lt(t),Eu(t.$$)}for(lt(null),mn.length=0,Rn=0;Ve.length;)Ve.pop()();for(let t=0;t<qn.length;t+=1){const e=qn[t];zi.has(e)||(zi.add(e),e())}qn.length=0}while(mn.length);for(;$i.length;)$i.pop()();eo=!1,zi.clear(),lt(i)}function Eu(i){if(i.fragment!==null){i.update(),Ge(i.before_update);const t=i.dirty;i.dirty=[-1],i.fragment&&i.fragment.p(i.ctx,t),i.after_update.forEach(Fe)}}let cn;function Ya(){return cn||(cn=Promise.resolve(),cn.then(()=>{cn=null})),cn}function oi(i,t,e){i.dispatchEvent(Qa(`${t?"intro":"outro"}${e}`))}const Jn=new Set;let mt;function se(){mt={r:0,c:[],p:mt}}function re(){mt.r||Ge(mt.c),mt=mt.p}function P(i,t){i&&i.i&&(Jn.delete(i),i.i(t))}function D(i,t,e,n){if(i&&i.o){if(Jn.has(i))return;Jn.add(i),mt.c.push(()=>{Jn.delete(i),n&&(e&&i.d(1),n())}),i.o(t)}else n&&n()}const Ua={duration:0};function Mt(i,t,e){let n=t(i,e),o=!1,s,r,a=0;function l(){s&&Zi(i,s)}function c(){const{delay:h=0,duration:d=300,easing:m=At,tick:g=Y,css:p}=n||Ua;p&&(s=Ha(i,0,1,d,h,m,p,a++)),g(0,1);const A=Va()+h,v=A+d;r&&r.abort(),o=!0,Fe(()=>oi(i,!0,"start")),r=Oa(b=>{if(o){if(b>=v)return g(1,0),oi(i,!0,"end"),l(),o=!1;if(b>=A){const w=m((b-A)/d);g(w,1-w)}}return o})}let u=!1;return{start(){u||(u=!0,Zi(i),$t(n)?(n=n(),Ya().then(c)):c())},invalidate(){u=!1},end(){o&&(l(),o=!1)}}}function rn(i,t,e){let n=t(i,e),o=!0,s;const r=mt;r.r+=1;function a(){const{delay:l=0,duration:c=300,easing:u=At,tick:h=Y,css:d}=n||Ua;d&&(s=Ha(i,1,0,c,l,u,d));const m=Va()+l,g=m+c;Fe(()=>oi(i,!1,"start")),Oa(p=>{if(o){if(p>=g)return h(0,1),oi(i,!1,"end"),--r.r||Ge(r.c),!1;if(p>=m){const A=u((p-m)/c);h(1-A,A)}}return o})}return $t(n)?Ya().then(()=>{n=n(),a()}):a(),{end(l){l&&n.tick&&n.tick(1,0),o&&(s&&Zi(i,s),o=!1)}}}function si(i,t){const e=t.token={};function n(o,s,r,a){if(t.token!==e)return;t.resolved=a;let l=t.ctx;r!==void 0&&(l=l.slice(),l[r]=a);const c=o&&(t.current=o)(l);let u=!1;t.block&&(t.blocks?t.blocks.forEach((h,d)=>{d!==s&&h&&(se(),D(h,1,1,()=>{t.blocks[d]===h&&(t.blocks[d]=null)}),re())}):t.block.d(1),c.c(),P(c,1),c.m(t.mount(),t.anchor),u=!0),t.block=c,t.blocks&&(t.blocks[s]=c),u&&po()}if(gu(i)){const o=Ct();if(i.then(s=>{lt(o),n(t.then,1,t.value,s),lt(null)},s=>{if(lt(o),n(t.catch,2,t.error,s),lt(null),!t.hasCatch)throw s}),t.current!==t.pending)return n(t.pending,0),!0}else{if(t.current!==t.then)return n(t.then,1,t.value,i),!0;t.resolved=i}}function qa(i,t,e){const n=t.slice(),{resolved:o}=i;i.current===i.then&&(n[i.value]=o),i.current===i.catch&&(n[i.error]=o),i.block.p(n,e)}const Pu=typeof window!="undefined"?window:typeof globalThis!="undefined"?globalThis:global;function Ao(i,t){i.d(1),t.delete(i.key)}function Pt(i,t){D(i,1,1,()=>{t.delete(i.key)})}function Ke(i,t,e,n,o,s,r,a,l,c,u,h){let d=i.length,m=s.length,g=d;const p={};for(;g--;)p[i[g].key]=g;const A=[],v=new Map,b=new Map;for(g=m;g--;){const C=h(o,s,g),T=e(C);let x=r.get(T);x?n&&x.p(C,t):(x=c(T,C),x.c()),v.set(T,A[g]=x),T in p&&b.set(T,Math.abs(g-p[T]))}const w=new Set,k=new Set;function I(C){P(C,1),C.m(a,u),r.set(C.key,C),u=C.first,m--}for(;d&&m;){const C=A[m-1],T=i[d-1],x=C.key,H=T.key;C===T?(u=C.first,d--,m--):v.has(H)?!r.has(x)||w.has(x)?I(C):k.has(H)?d--:b.get(x)>b.get(H)?(k.add(x),I(C)):(w.add(H),d--):(l(T,r),d--)}for(;d--;){const C=i[d];v.has(C.key)||l(C,r)}for(;m;)I(A[m-1]);return A}function Qe(i,t){const e={},n={},o={$$scope:1};let s=i.length;for(;s--;){const r=i[s],a=t[s];if(a){for(const l in r)l in a||(n[l]=1);for(const l in a)o[l]||(e[l]=a[l],o[l]=1);i[s]=a}else for(const l in r)o[l]=1}for(const r in n)r in e||(e[r]=void 0);return e}function Ja(i){return typeof i=="object"&&i!==null?i:{}}function Za(i,t,e){const n=i.$$.props[t];n!==void 0&&(i.$$.bound[n]=e,e(i.$$.ctx[n]))}function K(i){i&&i.c()}function J(i,t,e,n){const{fragment:o,after_update:s}=i.$$;o&&o.m(t,e),n||Fe(()=>{const r=i.$$.on_mount.map(Ta).filter($t);i.$$.on_destroy?i.$$.on_destroy.push(...r):Ge(r),i.$$.on_mount=[]}),s.forEach(Fe)}function Z(i,t){const e=i.$$;e.fragment!==null&&(Ge(e.on_destroy),e.fragment&&e.fragment.d(t),e.on_destroy=e.fragment=null,e.ctx=[])}function Iu(i,t){i.$$.dirty[0]===-1&&(mn.push(i),Na(),i.$$.dirty.fill(0)),i.$$.dirty[t/31|0]|=1<<t%31}function ie(i,t,e,n,o,s,r,a=[-1]){const l=Cn;lt(i);const c=i.$$={fragment:null,ctx:[],props:s,update:Y,not_equal:o,bound:Ho(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(l?l.$$.context:[])),callbacks:Ho(),dirty:a,skip_bound:!1,root:t.target||l.$$.root};r&&r(c.root);let u=!1;if(c.ctx=e?e(i,t.props||{},(h,d,...m)=>{const g=m.length?m[0]:d;return c.ctx&&o(c.ctx[h],c.ctx[h]=g)&&(!c.skip_bound&&c.bound[h]&&c.bound[h](g),u&&Iu(i,h)),d}):[],c.update(),u=!0,Ge(c.before_update),c.fragment=n?n(c.ctx):!1,t.target){if(t.hydrate){const h=vu(t.target);c.fragment&&c.fragment.l(h),h.forEach(L)}else c.fragment&&c.fragment.c();t.intro&&P(i.$$.fragment),J(i,t.target,t.anchor,t.customElement),po()}lt(l)}class oe{$destroy(){Z(this,1),this.$destroy=Y}$on(t,e){if(!$t(e))return Y;const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const o=n.indexOf(e);o!==-1&&n.splice(o,1)}}$set(t){this.$$set&&!pu(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const ku="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAAA8CAYAAACZ1L+0AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAYKADAAQAAAABAAAAPAAAAABU0H2EAAARRElEQVR4Ad2czY9cRZbFq1yFoQGDNCzwuAENohl54dkgdrNh34tZ8GciFi31nwEsmAEhhAWD1GMJCZgx5sMfUHN+J+NE3XfrZWWVcVVLHVLmuXG/74148V5m2bm/N8bR0dH+Bx988Po333zzbz///PONg4ODa+I9I9y/cuXKgV77h4eH+1KH3hP/yv7+vuBAsG+5UCIpCkMzDQ962Eu80Q1P/KmHT82v8IocZFL4pslDvL3fNARHoPI2wtbrV1jBIf9N8SEZ0UUP2wFHv2ocSc/2ouEz8PVooJXQ0/j10aNHoH2Idj4PHz4k1n29/k+5/u3ll1/+r7fffvtLzfGzd8ibjK6+9957f5ajf1XzH9y7d+8Xjf9FRs1SdvNBBg2SDQ1xh9ALH4yN0M2BNZrKwtFc9Fmkquuma5HJBzvLiIONBnx40B7QIzTdxCcNwj3dYlEoUmabAU+UFZDpxah22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/wfu514OAjYP0QAAAABJRU5ErkJggg==";function xu(i){le(i,"svelte-1d7uzh5",".room-label-item.svelte-1d7uzh5{position:absolute;font-size:0.5rem;z-index:0;transform:none;cursor:pointer;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.room-label-item__text.svelte-1d7uzh5{position:absolute;left:0;top:-4rem;transform:translate(-50%, 0);display:flex;justify-content:center;align-items:center;height:1.25rem;min-width:2rem;padding:0 0.375rem;pointer-events:all;background-size:100% 100%;background-repeat:no-repeat;white-space:nowrap}.room-label-item__bar.svelte-1d7uzh5{position:absolute;top:-2.75rem;height:3rem;width:0.0625rem;background-image:linear-gradient(to bottom, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0))}.wide.svelte-1d7uzh5{font-size:0.625rem}")}function Du(i){let t,e,n=i[0].name+"",o,s,r,a,l;return{c(){t=B("div"),e=B("span"),o=xe(n),s=ee(),r=B("div"),y(e,"class","room-label-item__text svelte-1d7uzh5"),z(e,"background-image","url("+ku+")"),q(e,"wide",i[0].name.length>3),y(r,"class","room-label-item__bar svelte-1d7uzh5"),y(t,"class","room-label-item svelte-1d7uzh5"),z(t,"z-index",i[0].zIndex),z(t,"transform",i[0].transform),z(t,"opacity",i[0].visible?1:0)},m(c,u){M(c,t,u),V(t,e),V(e,o),V(t,s),V(t,r),a||(l=me(e,"click",i[1]),a=!0)},p(c,[u]){u&1&&n!==(n=c[0].name+"")&&Me(o,n),u&1&&q(e,"wide",c[0].name.length>3),u&1&&z(t,"z-index",c[0].zIndex),u&1&&z(t,"transform",c[0].transform),u&1&&z(t,"opacity",c[0].visible?1:0)},i:Y,o:Y,d(c){c&&L(t),a=!1,l()}}}function Lu(i,t,e){let{five:n}=t,{roomLabel:o}=t;function s(){n.setState({panoIndex:o.panoIndex,mode:"Panorama",longitude:o.longitude})}return i.$$set=r=>{"five"in r&&e(2,n=r.five),"roomLabel"in r&&e(0,o=r.roomLabel)},[o,s,n]}class Su extends oe{constructor(t){super(),ie(this,t,Lu,Du,ne,{five:2,roomLabel:0},xu)}}var Ka=function(){if(typeof Map!="undefined")return Map;function i(t,e){var n=-1;return t.some(function(o,s){return o[0]===e?(n=s,!0):!1}),n}return function(){function t(){this.__entries__=[]}return Object.defineProperty(t.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),t.prototype.get=function(e){var n=i(this.__entries__,e),o=this.__entries__[n];return o&&o[1]},t.prototype.set=function(e,n){var o=i(this.__entries__,e);~o?this.__entries__[o][1]=n:this.__entries__.push([e,n])},t.prototype.delete=function(e){var n=this.__entries__,o=i(n,e);~o&&n.splice(o,1)},t.prototype.has=function(e){return!!~i(this.__entries__,e)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,n){n===void 0&&(n=null);for(var o=0,s=this.__entries__;o<s.length;o++){var r=s[o];e.call(n,r[1],r[0])}},t}()}(),to=typeof window!="undefined"&&typeof document!="undefined"&&window.document===document,ri=function(){return typeof global!="undefined"&&global.Math===Math?global:typeof self!="undefined"&&self.Math===Math?self:typeof window!="undefined"&&window.Math===Math?window:Function("return this")()}(),Mu=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(ri):function(i){return setTimeout(function(){return i(Date.now())},1e3/60)}}(),Tu=2;function zu(i,t){var e=!1,n=!1,o=0;function s(){e&&(e=!1,i()),n&&a()}function r(){Mu(s)}function a(){var l=Date.now();if(e){if(l-o<Tu)return;n=!0}else e=!0,n=!1,setTimeout(r,t);o=l}return a}var Bu=20,Vu=["top","right","bottom","left","width","height","size","weight"],ju=typeof MutationObserver!="undefined",Ou=function(){function i(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=zu(this.refresh.bind(this),Bu)}return i.prototype.addObserver=function(t){~this.observers_.indexOf(t)||this.observers_.push(t),this.connected_||this.connect_()},i.prototype.removeObserver=function(t){var e=this.observers_,n=e.indexOf(t);~n&&e.splice(n,1),!e.length&&this.connected_&&this.disconnect_()},i.prototype.refresh=function(){var t=this.updateObservers_();t&&this.refresh()},i.prototype.updateObservers_=function(){var t=this.observers_.filter(function(e){return e.gatherActive(),e.hasActive()});return t.forEach(function(e){return e.broadcastActive()}),t.length>0},i.prototype.connect_=function(){!to||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),ju?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},i.prototype.disconnect_=function(){!to||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},i.prototype.onTransitionEnd_=function(t){var e=t.propertyName,n=e===void 0?"":e,o=Vu.some(function(s){return!!~n.indexOf(s)});o&&this.refresh()},i.getInstance=function(){return this.instance_||(this.instance_=new i),this.instance_},i.instance_=null,i}(),$a=function(i,t){for(var e=0,n=Object.keys(t);e<n.length;e++){var o=n[e];Object.defineProperty(i,o,{value:t[o],enumerable:!1,writable:!1,configurable:!0})}return i},Nt=function(i){var t=i&&i.ownerDocument&&i.ownerDocument.defaultView;return t||ri},el=vi(0,0,0,0);function ai(i){return parseFloat(i)||0}function Go(i){for(var t=[],e=1;e<arguments.length;e++)t[e-1]=arguments[e];return t.reduce(function(n,o){var s=i["border-"+o+"-width"];return n+ai(s)},0)}function Ru(i){for(var t=["top","right","bottom","left"],e={},n=0,o=t;n<o.length;n++){var s=o[n],r=i["padding-"+s];e[s]=ai(r)}return e}function Fu(i){var t=i.getBBox();return vi(0,0,t.width,t.height)}function Qu(i){var t=i.clientWidth,e=i.clientHeight;if(!t&&!e)return el;var n=Nt(i).getComputedStyle(i),o=Ru(n),s=o.left+o.right,r=o.top+o.bottom,a=ai(n.width),l=ai(n.height);if(n.boxSizing==="border-box"&&(Math.round(a+s)!==t&&(a-=Go(n,"left","right")+s),Math.round(l+r)!==e&&(l-=Go(n,"top","bottom")+r)),!_u(i)){var c=Math.round(a+s)-t,u=Math.round(l+r)-e;Math.abs(c)!==1&&(a-=c),Math.abs(u)!==1&&(l-=u)}return vi(o.left,o.top,a,l)}var Hu=function(){return typeof SVGGraphicsElement!="undefined"?function(i){return i instanceof Nt(i).SVGGraphicsElement}:function(i){return i instanceof Nt(i).SVGElement&&typeof i.getBBox=="function"}}();function _u(i){return i===Nt(i).document.documentElement}function Gu(i){return to?Hu(i)?Fu(i):Qu(i):el}function Wu(i){var t=i.x,e=i.y,n=i.width,o=i.height,s=typeof DOMRectReadOnly!="undefined"?DOMRectReadOnly:Object,r=Object.create(s.prototype);return $a(r,{x:t,y:e,width:n,height:o,top:e,right:t+n,bottom:o+e,left:t}),r}function vi(i,t,e,n){return{x:i,y:t,width:e,height:n}}var Nu=function(){function i(t){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=vi(0,0,0,0),this.target=t}return i.prototype.isActive=function(){var t=Gu(this.target);return this.contentRect_=t,t.width!==this.broadcastWidth||t.height!==this.broadcastHeight},i.prototype.broadcastRect=function(){var t=this.contentRect_;return this.broadcastWidth=t.width,this.broadcastHeight=t.height,t},i}(),Xu=function(){function i(t,e){var n=Wu(e);$a(this,{target:t,contentRect:n})}return i}(),Yu=function(){function i(t,e,n){if(this.activeObservations_=[],this.observations_=new Ka,typeof t!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=t,this.controller_=e,this.callbackCtx_=n}return i.prototype.observe=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(t instanceof Nt(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var e=this.observations_;e.has(t)||(e.set(t,new Nu(t)),this.controller_.addObserver(this),this.controller_.refresh())}},i.prototype.unobserve=function(t){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(t instanceof Nt(t).Element))throw new TypeError('parameter 1 is not of type "Element".');var e=this.observations_;!e.has(t)||(e.delete(t),e.size||this.controller_.removeObserver(this))}},i.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},i.prototype.gatherActive=function(){var t=this;this.clearActive(),this.observations_.forEach(function(e){e.isActive()&&t.activeObservations_.push(e)})},i.prototype.broadcastActive=function(){if(!!this.hasActive()){var t=this.callbackCtx_,e=this.activeObservations_.map(function(n){return new Xu(n.target,n.broadcastRect())});this.callback_.call(t,e,t),this.clearActive()}},i.prototype.clearActive=function(){this.activeObservations_.splice(0)},i.prototype.hasActive=function(){return this.activeObservations_.length>0},i}(),tl=typeof WeakMap!="undefined"?new WeakMap:new Ka,nl=function(){function i(t){if(!(this instanceof i))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var e=Ou.getInstance(),n=new Yu(t,e,this);tl.set(this,n)}return i}();["observe","unobserve","disconnect"].forEach(function(i){nl.prototype[i]=function(){var t;return(t=tl.get(this))[i].apply(t,arguments)}});var Uu=function(){return typeof ri.ResizeObserver!="undefined"?ri.ResizeObserver:nl}();function an(i){new Uu((e,n)=>{var o,s,r,a,l,c;for(const u of e){const{borderBoxSize:h,contentRect:d}=u,m=(r=(s=(o=h==null?void 0:h[0])==null?void 0:o.inlineSize)!=null?s:d.width)!=null?r:i.clientWidth,g=(c=(l=(a=h==null?void 0:h[0])==null?void 0:a.blockSize)!=null?l:d.height)!=null?c:i.clientHeight;i.dispatchEvent(new CustomEvent("clientWidth",{detail:m})),i.dispatchEvent(new CustomEvent("clientHeight",{detail:g}))}}).observe(i)}const{Map:qu}=Pu;function Ju(i){le(i,"svelte-9eg4zi",".room-labels-container.svelte-9eg4zi{width:100%;height:100%;position:relative;color:#fff}")}function Wo(i,t,e){const n=i.slice();return n[13]=t[e],n}function No(i,t){let e,n,o;return n=new Su({props:{roomLabel:t[13],five:t[1]}}),{key:i,first:null,c(){e=ge(),K(n.$$.fragment),this.first=e},m(s,r){M(s,e,r),J(n,s,r),o=!0},p(s,r){t=s;const a={};r&1&&(a.roomLabel=t[13]),r&2&&(a.five=t[1]),n.$set(a)},i(s){o||(P(n.$$.fragment,s),o=!0)},o(s){D(n.$$.fragment,s),o=!1},d(s){s&&L(e),Z(n,s)}}}function Zu(i){let t,e=[],n=new qu,o,s,r,a=i[0];const l=c=>c[13].id;for(let c=0;c<a.length;c+=1){let u=Wo(i,a,c),h=l(u);n.set(h,e[c]=No(h,u))}return{c(){t=B("div");for(let c=0;c<e.length;c+=1)e[c].c();y(t,"class","room-labels-container svelte-9eg4zi")},m(c,u){M(c,t,u);for(let h=0;h<e.length;h+=1)e[h].m(t,null);o=!0,s||(r=[ct(an.call(null,t)),me(t,"clientWidth",i[6]),me(t,"clientHeight",i[7])],s=!0)},p(c,[u]){u&3&&(a=c[0],se(),e=Ke(e,u,l,1,c,a,n,t,Pt,No,null,Wo),re())},i(c){if(!o){for(let u=0;u<a.length;u+=1)P(e[u]);o=!0}},o(c){for(let u=0;u<e.length;u+=1)D(e[u]);o=!1},d(c){c&&L(t);for(let u=0;u<e.length;u+=1)e[u].d();s=!1,Ge(r)}}}function Ku(i,t,e){var A;let n,{five:o}=t,{roomLabels:s}=t,r,a,l=(A=o.model.shownFloor)!=null?A:null;function c(v){if(!(l===null||v.floorIndex===l))return!1;const w=new j.Raycaster,k=o.camera.position.clone(),I=new j.Vector3(v.position.x,v.position.y,v.position.z),C=I.distanceTo(k);w.set(k.clone(),I.clone().sub(k).normalize());const[T]=o.model.intersectRaycaster(w);return!(T&&T.distance+1<C)}function u(v,b){const k=new j.Vector3(v.position.x,v.position.y,v.position.z).clone().project(o.camera),I=Math.ceil((k.x+1)/2*b.x),C=Math.ceil((-k.y+1)/2*b.y);return`translate(${I}px, ${C}px)`}function h(v){const{rendererSize:b,shownFloor:w}=v,k=new Map;function I(T){const x=k.get(T.id);if(x)return x;const{x:H,y:N,z:R}=T.position,O=new j.Vector3(H,N,R).clone().distanceTo(o.camera.position);return k.set(T.id,O),O}return s.map(T=>{const x=c(T),H=x?u(T,b):T.transform,N=I(T),O=s.filter(S=>S.visible&&I(S)<N).length*10;return fe(F({},T),{visible:x,transform:H,zIndex:O})})}function d(){e(0,s=h({rendererSize:n,shownFloor:l}))}function m(v){e(4,l=v)}o.on("cameraUpdate",d),o.on("modelShownFloorChange",m),Ga(()=>{e(0,s=h({rendererSize:n,shownFloor:l}))}),Et(()=>{o.off("cameraUpdate",d),o.off("modelShownFloorChange",m)});const g=v=>{e(2,r=v.detail)},p=v=>{e(3,a=v.detail)};return i.$$set=v=>{"five"in v&&e(1,o=v.five),"roomLabels"in v&&e(0,s=v.roomLabels)},i.$$.update=()=>{i.$$.dirty&12&&e(5,n={x:r,y:a}),i.$$.dirty&48&&e(0,s=h({rendererSize:n,shownFloor:l}))},[s,o,r,a,l,n,g,p]}class $u extends oe{constructor(t){super(),ie(this,t,Ku,Zu,ne,{five:1,roomLabels:0},Ju)}}function ed(i){return i.model_room_labels.map(({id:t,pano_index:e,floor_index:n,name:o,position:s,longitude:r})=>({id:t,name:o,position:s,longitude:r,panoIndex:e,floorIndex:n,zIndex:0,visible:!1,transform:""}))}class td{constructor(t){f(this,"five");f(this,"enabled",!0);f(this,"fiveModeEnabled");f(this,"app");f(this,"wrapper");f(this,"roomLabels",[]);f(this,"container",document.createElement("div"));f(this,"onFiveModeChange",t=>{if(!this.checkFiveMode(t)){this.fiveModeEnabled=!1,this.render();return}this.five.once("initAnimationEnded",()=>{this.fiveModeEnabled=this.checkFiveMode(this.five.getCurrentState().mode),this.render()})});this.five=t,this.fiveModeEnabled=this.checkFiveMode(t.getCurrentState().mode),this.container.classList.add("model-room-label-plugin-container"),this.container.style.width="100%",this.container.style.height="100%",this.container.style.position="absolute",this.container.style.pointerEvents="none",this.container.style.left="0",this.container.style.top="0",this.container.style.zIndex="5",this.five.once("dispose",()=>this.dispose()),this.five.on("modeChange",this.onFiveModeChange),this.render()}dispose(){this.five.off("modeChange",this.onFiveModeChange),this.container.remove()}load(t){this.roomLabels=ed(t),this.render()}appendTo(t){return this.wrapper=t,t.appendChild(this.container),this.render(),this}disable(){return this.enabled=!1,this.render(),this}enable(){return this.enabled=!0,this.render(),this}checkFiveMode(t){return t==="Floorplan"||t==="Mapview"}render(){var t;if(!!this.wrapper){if(!this.enabled||!this.fiveModeEnabled){(t=this.app)==null||t.$destroy(),this.app=void 0;return}this.app?this.app.$set({five:this.five,roomLabels:this.roomLabels}):this.app=new $u({target:this.container,props:{five:this.five,roomLabels:this.roomLabels}})}}}const nd=i=>new td(i),id={name:"ModelRoomLabelPlugin",version:0};var gt=(i=>(i[i.FLOOR=1]="FLOOR",i[i.CEILING=2]="CEILING",i[i.BOUNDING_CENTER=3]="BOUNDING_CENTER",i))(gt||{});function li(i){return G(this,null,function*(){try{return[null,yield i]}catch(t){return t instanceof Error?[t,null]:[new Error(""),null]}})}function ci(i){return Object.prototype.toString.call(i)==="[object Object]"}function bi(i,t){return i===t?!0:typeof i!=typeof t?!1:!!(Number.isNaN(i)&&Number.isNaN(t))}function od(i,t){const e=Object.getOwnPropertyNames(i),n=Object.getOwnPropertyNames(t);if(e.length!==n.length)return!1;for(let o=0,s=e.length;o<s;o++){const r=e[o];if(!bi(i[r],t[r]))return!1}return!0}function sd(i,t){if(i.length!==t.length)return!1;for(let e=0,n=i.length;e<n;e++)if(!bi(i[e],t[e]))return!1;return!0}function rd(i,t){return bi(i,t)?!0:ci(i)&&ci(t)?od(i,t):Array.isArray(i)&&Array.isArray(t)?sd(i,t):!1}function vo(i,t){return bi(i,t)?!0:ci(i)&&ci(t)?ld(i,t):Array.isArray(i)&&Array.isArray(t)?ad(i,t):!1}function ad(i,t){if(i.length!==t.length)return!1;for(let e=0,n=i.length;e<n;e++)if(!vo(i[e],t[e]))return!1;return!0}function ld(i,t){const e=Object.getOwnPropertyNames(i),n=Object.getOwnPropertyNames(t);if(e.length!==n.length)return!1;for(let o=0,s=e.length;o<s;o++){const r=e[o];if(!vo(i[r],t[r]))return!1}return!0}function nt(i,t,e={deep:!1}){return e.deep?vo(i,t):rd(i,t)}function Xt(i){return i<.5?4*i*i*i:.5*Math.pow(2*i-2,3)+1}function il(i){const t=i-1;return t*t*t+1}function St(i,{delay:t=0,duration:e=400,easing:n=At}={}){const o=+getComputedStyle(i).opacity;return{delay:t,duration:e,easing:n,css:s=>`opacity: ${s*o}`}}function Xo(i,{delay:t=0,duration:e=400,easing:n=il,x:o=0,y:s=0,opacity:r=0}={}){const a=getComputedStyle(i),l=+a.opacity,c=a.transform==="none"?"":a.transform,u=l*(1-r);return{delay:t,duration:e,easing:n,css:(h,d)=>`
|
|
181
181
|
transform: ${c} translate(${(1-h)*o}px, ${(1-h)*s}px);
|
|
182
|
-
opacity: ${l-u*d}`}}function ui(i,{delay:t=0,speed:e,duration:n,easing:o=Xt}={}){let s=i.getTotalLength();const r=getComputedStyle(i);return r.strokeLinecap!=="butt"&&(s+=parseInt(r.strokeWidth)),n===void 0?e===void 0?n=800:n=s/e:typeof n=="function"&&(n=n(s)),{delay:t,duration:n,easing:o,css:(a,l)=>`stroke-dasharray: ${a*s} ${l*s}`}}const bt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADMAAAAzCAMAAAANf8AYAAAC2VBMVEUAAACCnP+Dn/+Enf+HqP+Gp/+Fof+Gpf+IrP+Lsf+Dof+Cmv+Lsv+Mtf+Eo/+Bmf+JrP+Hqf+Env+Krv+Fo/+Pu/+Ms/+Qvv+Hqf+RwP+KsP+Fpf+Mtv+Gov+Bnf+Qv/+Nt/+Krv+Ho/+Rwf+Ouv+Emv+Amv+SxP+Sw/+NuP+Mtf/G0f6huP+Ot/+JrP+Jqv+Dnv+crf6Uqv////+QvP+PvP+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srEjZdAF2iPiYOvIz+Nyuebm5h6+HuvGa2xU0qhwBbkzayzjDO8y3IwgbAdHPp87zNx8sIvLYN/tvhc1TF1lWqSEwaMWgG3ABpIB4sC2HY2Ei0sf0O2YmLWr1CdQGRYp8SK3ic/ZnRWMLqQ+2xGRwUD069dvV8zcuRom+rlA6Y2MbgGmhAGEz4VYSPQF5cyZM6GFYl6eTlN6ixi6aE6PqDLQZRi4EKI/KOfGFjUzqCKsXu6l2RpuAKJxiI1tHhcQJAYOHDhgwOZZs4ZSTHR5lQQYPDW1DS4aELQxdyEIAANGjtk8c6aaqTslk8gVwIAN0w3rAEL2bMtHm12AIOHqenXaNDWztEwo9hKJGHjR6OO0yDSI1IGdoQ0iY0a6Tt+06fKUDRQzqKw8Qlxr1AXrwNqwDvGBA+BrGUDc3d3Xr5+SQZj0E2ERqXIjPAJYNUbD18FoWEeDbHLPzLyQ4ePjQ5i3x1RCubfmpqkjMMNo6KOJ5uqe+f58C9GoaD29XyVSYS1h4DftKeWDDN4AbACZMZAsExEKghWUNKXWhlPfA2P1qjmUT556a9jmQotWi/VOFael1lR7ep4JfRZy8nhpwtG4wMMB/gdi9/nNH+vhezsmJ+fG5quX12fomHl6J+KFy88uA2RJyJPE4wkL4wIPBfgXxO5HxGN7zNw5W2bNnLZhio+OmaR3LD6tplrLfKeYAwX7/O6Dje/2dpniwuKiwoMHH+bn7723Z8/uHTu2fpg9+3p29sYrWVnr1l1cO2HCUFCGT+tshUcWLPj6IDf37ued27Z9unXz2owZU6dOnnxp4sQ1q1ePH79KN6vbQWc1SrfrTit6lO5NO6/F8yZNmofBfgNTwRQLsPLsHQAAAABJRU5ErkJggg==";function ol(i){return i*180/Math.PI}function cd(i){le(i,"svelte-17cl35n",".floorplan__camera-position.svelte-17cl35n{position:absolute;width:0;height:0}.floorplan__camera-rotate.svelte-17cl35n{position:absolute;background-repeat:no-repeat;background-size:100%}")}function ud(i){let t,e;return{c(){t=z("div"),e=z("div"),y(e,"class","floorplan__camera-rotate svelte-17cl35n"),T(e,"background-image",`url(${i[0]||bt})`),T(e,"width",i[4]),T(e,"height",i[4]),T(e,"left","-"+i[4]),T(e,"top","-"+i[4]),T(e,"transform",`rotate(${i[3]}deg)`),T(e,"transform-origin",`${i[4]} ${i[4]}`),y(t,"class","floorplan__camera-position svelte-17cl35n"),T(t,"left",i[1]),T(t,"top",i[2])},m(n,o){M(n,t,o),V(t,e)},p(n,[o]){o&1&&T(e,"background-image",`url(${n[0]||bt})`)},i:X,o:X,d(n){n&&L(t)}}}function dd(i,t,e){let{panoIndex:n}=t,{floorplanData:o}=t,{lastPanoramaLongitude:s}=t,{cameraImageUrl:r}=t;const{observers:a}=o,l=a[n],c=l.positionInImage.x,u=l.positionInImage.y,h=c*100+"%",d=u*100+"%",m=-ol(s)+45,g=document.body.clientWidth,p=document.body.clientHeight,v=`${(g<500||p<500?17:37)/16}rem`;return i.$$set=b=>{"panoIndex"in b&&e(5,n=b.panoIndex),"floorplanData"in b&&e(6,o=b.floorplanData),"lastPanoramaLongitude"in b&&e(7,s=b.lastPanoramaLongitude),"cameraImageUrl"in b&&e(0,r=b.cameraImageUrl)},[r,h,d,m,v,n,o,s]}class hd extends oe{constructor(t){super(),ie(this,t,dd,ud,ne,{panoIndex:5,floorplanData:6,lastPanoramaLongitude:7,cameraImageUrl:0},cd)}}const fd="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAArUAAAB7CAMAAABdA4ieAAAC91BMVEUAAACOpP/H0P+yxP/a4/+asv/W3/+/z/+cs//S3f+mu//Q2//5+v/H1P/d5f/l6//y9f++zf/i6f+ww/+ovP/7/P/u8v/N2f+Mp//q7/+4yf+uwf+Wr/+7y/+1xv+Ho//x9P+9zP+2x/+swP+gt/+Oqf/Y4v/r8P/l7P/b4//F0/+juf+Zsv+XsP+Trf/p7v97mv9wj/+kuv+ftf/x9P92lf/3+f/I1f+5yv+Eof98m//8/f/4+f90lf+9zf/j6f/T3f/L1/+Bnv/6+/+SrP/m7P/f5v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WgnptFiIKoQLWmQ7pLphuOkTB0lqoZDSTGiVBrXE1iT0wbgEEn0gtSEEncoNfRV1uKKN/KqL+/4C1xYSA7XapjATRGU1hGxT3NtcGnUK0UJgZf7TuDWEls1yt9wiWsja7awzYRWttYgWYrPcLbejWqua2WaCqBSixQLvWe5mi06RWqv8TDOhNUrZC9sdm+Xuu5cpUqvU+wwzYbVVkIXYLHd/olekVpmpZ8KiMYbU7ma/EXJZBW5JrZl2V9bRnNWyWe4xt8TWTPd3FdEYSEFslnsoURlAi01FqN56f2br2xeOe9ytgbyf4nErGg/hl6RN4Jc5Lt++2rVjHMdCIIqiqtoRQW2mMogIyZFjlsB2B9wjjaY1PXa3wcbSPaEDR1fP9fVt8aPai2+f2+TlWu2l0yweZHlEO5S9cyu1lDKj5T/fWCH4jLaUnXMbvFyrzby8xRrayqUM2+ZWqvuM1nmpgHWkl8F9z9yG7LNa5yEMa0n8yHb93Er1oXjnoMVyFn3KQVcP7VRpFn+sDiznaiuHNufsHnkIwy7aPA/r5jbFGW3m7S12ku55WPN7Li1PPIRhN6sjtBjTmm+KmYcwPEOKs9tHF1JDHCoHLZ5DQ8yPBic9DoHjAKvsb85qjbFxHOCprMZaf5qdhlorxwGeTsPIttvPlno0y3GAZfbHp6n3ynGAV0m99u/2J6H3znGAvW4n+J25tdY7xwFey1pvQe6/DlrjOMDLqfXW7N5pbs0YWhxgtpj0rl1uiaHFISzccSWohUCzOIemm0VKChwHOMutKCVwHOA4av/JVi0xtDiRpCRfRcvQ4lBfxSnG0OJc/+xTjKHFyVRMP38iDC0O92lZVRhanO+vcVWGFu9BRWkW7+Z3rapEizdy7ZVm8V5Gtr8AtSnix59eOmYAAAAASUVORK5CYII=";function md(i){le(i,"svelte-rpkaro",".floorplan-plugin__compass.svelte-rpkaro{position:absolute;left:50%;top:-2.875rem;width:14.4375rem;height:2.5625rem;will-change:opacity;transform-origin:center 11.5rem}.floorplan-plugin__compass-image.svelte-rpkaro{width:100%;height:100%;position:absolute;left:0;top:0;opacity:0.1;background-repeat:no-repeat;background-size:100% 100%}.floorplan-plugin__compass-text.svelte-rpkaro{position:absolute;left:50%;top:0.9375rem;transform:translateX(-50%);opacity:0.2;font-weight:bold;font-size:0.625rem;color:#fff}")}function gd(i){let t,e,n,o,s;return{c(){t=z("div"),e=z("div"),n=$(),o=z("span"),s=xe(i[0]),y(e,"class","floorplan-plugin__compass-image svelte-rpkaro"),T(e,"background-image",`url(${fd})`),y(o,"class","floorplan-plugin__compass-text svelte-rpkaro"),y(t,"class","floorplan-plugin__compass svelte-rpkaro"),T(t,"transform",i[2])},m(r,a){M(r,t,a),V(t,e),V(t,n),V(t,o),V(o,s)},p(r,a){a&1&&Me(s,r[0])},d(r){r&&L(t)}}}function pd(i){let t,e=i[1]&&gd(i);return{c(){e&&e.c(),t=ge()},m(n,o){e&&e.m(n,o),M(n,t,o)},p(n,[o]){n[1]&&e.p(n,o)},i:X,o:X,d(n){e&&e.d(n),n&&L(t)}}}function Ad(i){return i/Math.PI*180}function vd(i,t,e){var c;let{floorplanData:n}=t,{northDesc:o}=t;const s=(c=n.entrance)==null?void 0:c.northRad,r=typeof s=="number",l=`translateX(-50%) translateZ(10px) rotate(${-(s?Ad(s):0)+90}deg)`;return i.$$set=u=>{"floorplanData"in u&&e(3,n=u.floorplanData),"northDesc"in u&&e(0,o=u.northDesc)},[o,r,l,n]}class bd extends oe{constructor(t){super(),ie(this,t,vd,pd,ne,{floorplanData:3,northDesc:0},md)}}const jt=[];function bo(i,t=X){let e;const n=new Set;function o(a){if(ne(i,a)&&(i=a,e)){const l=!jt.length;for(const c of n)c[1](),jt.push(c,i);if(l){for(let c=0;c<jt.length;c+=2)jt[c][0](jt[c+1]);jt.length=0}}}function s(a){o(a(i))}function r(a,l=X){const c=[a,l];return n.add(c),n.size===1&&(e=t(o)||X),a(i),()=>{n.delete(c),n.size===0&&(e(),e=null)}}return{set:o,update:s,subscribe:r}}function yd(i){le(i,"svelte-1gfoniz","img.svelte-1gfoniz{width:100%;height:100%}")}function wd(i){let t,e;return{c(){t=z("img"),Xe(t.src,e=i[0])||y(t,"src",e),y(t,"alt","floorplan iamge"),y(t,"class","svelte-1gfoniz")},m(n,o){M(n,t,o)},p(n,[o]){o&1&&!Xe(t.src,e=n[0])&&y(t,"src",e)},i:X,o:X,d(n){n&&L(t)}}}function Cd(i,t,e){let{url:n}=t;return i.$$set=o=>{"url"in o&&e(0,n=o.url)},[n]}class Ed extends oe{constructor(t){super(),ie(this,t,Cd,wd,ne,{url:0},yd)}}function Pd(i){le(i,"svelte-ub47ya",".floorplan-plugin__base-image.svelte-ub47ya{width:100%;height:100%}")}function Id(i){let t,e,n,o;return{c(){t=z("div"),e=new ti(!1),n=$(),o=new ti(!1),e.a=n,o.a=null,y(t,"class","floorplan-plugin__base-image svelte-ub47ya")},m(s,r){M(s,t,r),e.m(i[1],t),V(t,n),o.m(i[0],t)},p(s,[r]){r&1&&o.p(s[0])},i:X,o:X,d(s){s&&L(t)}}}function kd(i,t,e){let{content:n}=t;const o=`
|
|
182
|
+
opacity: ${l-u*d}`}}function ui(i,{delay:t=0,speed:e,duration:n,easing:o=Xt}={}){let s=i.getTotalLength();const r=getComputedStyle(i);return r.strokeLinecap!=="butt"&&(s+=parseInt(r.strokeWidth)),n===void 0?e===void 0?n=800:n=s/e:typeof n=="function"&&(n=n(s)),{delay:t,duration:n,easing:o,css:(a,l)=>`stroke-dasharray: ${a*s} ${l*s}`}}const bt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADMAAAAzCAMAAAANf8AYAAAC2VBMVEUAAACCnP+Dn/+Enf+HqP+Gp/+Fof+Gpf+IrP+Lsf+Dof+Cmv+Lsv+Mtf+Eo/+Bmf+JrP+Hqf+Env+Krv+Fo/+Pu/+Ms/+Qvv+Hqf+RwP+KsP+Fpf+Mtv+Gov+Bnf+Qv/+Nt/+Krv+Ho/+Rwf+Ouv+Emv+Amv+SxP+Sw/+NuP+Mtf/G0f6huP+Ot/+JrP+Jqv+Dn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gh+3jDunTseWas1zKtKYbiIsrEjZdAF2iPiYOvIz+Nyuebm5h6+HuvGa2xU0qhwBbkzayzjDO8y3IwgbAdHPp87zNx8sIvLYN/tvhc1TF1lWqSEwaMWgG3ABpIB4sC2HY2Ei0sf0O2YmLWr1CdQGRYp8SK3ic/ZnRWMLqQ+2xGRwUD069dvV8zcuRom+rlA6Y2MbgGmhAGEz4VYSPQF5cyZM6GFYl6eTlN6ixi6aE6PqDLQZRi4EKI/KOfGFjUzqCKsXu6l2RpuAKJxiI1tHhcQJAYOHDhgwOZZs4ZSTHR5lQQYPDW1DS4aELQxdyEIAANGjtk8c6aaqTslk8gVwIAN0w3rAEL2bMtHm12AIOHqenXaNDWztEwo9hKJGHjR6OO0yDSI1IGdoQ0iY0a6Tt+06fKUDRQzqKw8Qlxr1AXrwNqwDvGBA+BrGUDc3d3Xr5+SQZj0E2ERqXIjPAJYNUbD18FoWEeDbHLPzLyQ4ePjQ5i3x1RCubfmpqkjMMNo6KOJ5uqe+f58C9GoaD29XyVSYS1h4DftKeWDDN4AbACZMZAsExEKghWUNKXWhlPfA2P1qjmUT556a9jmQotWi/VOFael1lR7ep4JfRZy8nhpwtG4wMMB/gdi9/nNH+vhezsmJ+fG5quX12fomHl6J+KFy88uA2RJyJPE4wkL4wIPBfgXxO5HxGN7zNw5W2bNnLZhio+OmaR3LD6tplrLfKeYAwX7/O6Dje/2dpniwuKiwoMHH+bn7723Z8/uHTu2fpg9+3p29sYrWVnr1l1cO2HCUFCGT+tshUcWLPj6IDf37ued27Z9unXz2owZU6dOnnxp4sQ1q1ePH79KN6vbQWc1SrfrTit6lO5NO6/F8yZNmofBfgNTwRQLsPLsHQAAAABJRU5ErkJggg==";function ol(i){return i*180/Math.PI}function cd(i){le(i,"svelte-17cl35n",".floorplan__camera-position.svelte-17cl35n{position:absolute;width:0;height:0}.floorplan__camera-rotate.svelte-17cl35n{position:absolute;background-repeat:no-repeat;background-size:100%}")}function ud(i){let t,e;return{c(){t=B("div"),e=B("div"),y(e,"class","floorplan__camera-rotate svelte-17cl35n"),z(e,"background-image",`url(${i[0]||bt})`),z(e,"width",i[4]),z(e,"height",i[4]),z(e,"left","-"+i[4]),z(e,"top","-"+i[4]),z(e,"transform",`rotate(${i[3]}deg)`),z(e,"transform-origin",`${i[4]} ${i[4]}`),y(t,"class","floorplan__camera-position svelte-17cl35n"),z(t,"left",i[1]),z(t,"top",i[2])},m(n,o){M(n,t,o),V(t,e)},p(n,[o]){o&1&&z(e,"background-image",`url(${n[0]||bt})`)},i:Y,o:Y,d(n){n&&L(t)}}}function dd(i,t,e){let{panoIndex:n}=t,{floorplanData:o}=t,{lastPanoramaLongitude:s}=t,{cameraImageUrl:r}=t;const{observers:a}=o,l=a[n],c=l.positionInImage.x,u=l.positionInImage.y,h=c*100+"%",d=u*100+"%",m=-ol(s)+45,g=document.body.clientWidth,p=document.body.clientHeight,v=`${(g<500||p<500?17:37)/16}rem`;return i.$$set=b=>{"panoIndex"in b&&e(5,n=b.panoIndex),"floorplanData"in b&&e(6,o=b.floorplanData),"lastPanoramaLongitude"in b&&e(7,s=b.lastPanoramaLongitude),"cameraImageUrl"in b&&e(0,r=b.cameraImageUrl)},[r,h,d,m,v,n,o,s]}class hd extends oe{constructor(t){super(),ie(this,t,dd,ud,ne,{panoIndex:5,floorplanData:6,lastPanoramaLongitude:7,cameraImageUrl:0},cd)}}const fd="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAArUAAAB7CAMAAABdA4ieAAAC91BMVEUAAACOpP/H0P+yxP/a4/+asv/W3/+/z/+cs//S3f+mu//Q2//5+v/H1P/d5f/l6//y9f++zf/i6f+ww/+ovP/7/P/u8v/N2f+Mp//q7/+4yf+uwf+Wr/+7y/+1xv+Ho//x9P+9zP+2x/+swP+gt/+Oqf/Y4v/r8P/l7P/b4//F0/+juf+Zsv+XsP+Trf/p7v97mv9wj/+kuv+ftf/x9P92lf/3+f/I1f+5yv+Eof98m//8/f/4+f90lf+9zf/j6f/T3f/L1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Myf07YRUlND5qTynvGG6aaDOSWgnptFiIKoQLWmQ7pLphuOkTB0lqoZDSTGiVBrXE1iT0wbgEEn0gtSEEncoNfRV1uKKN/KqL+/4C1xYSA7XapjATRGU1hGxT3NtcGnUK0UJgZf7TuDWEls1yt9wiWsja7awzYRWttYgWYrPcLbejWqua2WaCqBSixQLvWe5mi06RWqv8TDOhNUrZC9sdm+Xuu5cpUqvU+wwzYbVVkIXYLHd/olekVpmpZ8KiMYbU7ma/EXJZBW5JrZl2V9bRnNWyWe4xt8TWTPd3FdEYSEFslnsoURlAi01FqN56f2br2xeOe9ytgbyf4nErGg/hl6RN4Jc5Lt++2rVjHMdCIIqiqtoRQW2mMogIyZFjlsB2B9wjjaY1PXa3wcbSPaEDR1fP9fVt8aPai2+f2+TlWu2l0yweZHlEO5S9cyu1lDKj5T/fWCH4jLaUnXMbvFyrzby8xRrayqUM2+ZWqvuM1nmpgHWkl8F9z9yG7LNa5yEMa0n8yHb93Er1oXjnoMVyFn3KQVcP7VRpFn+sDiznaiuHNufsHnkIwy7aPA/r5jbFGW3m7S12ku55WPN7Li1PPIRhN6sjtBjTmm+KmYcwPEOKs9tHF1JDHCoHLZ5DQ8yPBic9DoHjAKvsb85qjbFxHOCprMZaf5qdhlorxwGeTsPIttvPlno0y3GAZfbHp6n3ynGAV0m99u/2J6H3znGAvW4n+J25tdY7xwFey1pvQe6/DlrjOMDLqfXW7N5pbs0YWhxgtpj0rl1uiaHFISzccSWohUCzOIemm0VKChwHOMutKCVwHOA4av/JVi0xtDiRpCRfRcvQ4lBfxSnG0OJc/+xTjKHFyVRMP38iDC0O92lZVRhanO+vcVWGFu9BRWkW7+Z3rapEizdy7ZVm8V5Gtr8AtSnix59eOmYAAAAASUVORK5CYII=";function md(i){le(i,"svelte-rpkaro",".floorplan-plugin__compass.svelte-rpkaro{position:absolute;left:50%;top:-2.875rem;width:14.4375rem;height:2.5625rem;will-change:opacity;transform-origin:center 11.5rem}.floorplan-plugin__compass-image.svelte-rpkaro{width:100%;height:100%;position:absolute;left:0;top:0;opacity:0.1;background-repeat:no-repeat;background-size:100% 100%}.floorplan-plugin__compass-text.svelte-rpkaro{position:absolute;left:50%;top:0.9375rem;transform:translateX(-50%);opacity:0.2;font-weight:bold;font-size:0.625rem;color:#fff}")}function gd(i){let t,e,n,o,s;return{c(){t=B("div"),e=B("div"),n=ee(),o=B("span"),s=xe(i[0]),y(e,"class","floorplan-plugin__compass-image svelte-rpkaro"),z(e,"background-image",`url(${fd})`),y(o,"class","floorplan-plugin__compass-text svelte-rpkaro"),y(t,"class","floorplan-plugin__compass svelte-rpkaro"),z(t,"transform",i[2])},m(r,a){M(r,t,a),V(t,e),V(t,n),V(t,o),V(o,s)},p(r,a){a&1&&Me(s,r[0])},d(r){r&&L(t)}}}function pd(i){let t,e=i[1]&&gd(i);return{c(){e&&e.c(),t=ge()},m(n,o){e&&e.m(n,o),M(n,t,o)},p(n,[o]){n[1]&&e.p(n,o)},i:Y,o:Y,d(n){e&&e.d(n),n&&L(t)}}}function Ad(i){return i/Math.PI*180}function vd(i,t,e){var c;let{floorplanData:n}=t,{northDesc:o}=t;const s=(c=n.entrance)==null?void 0:c.northRad,r=typeof s=="number",l=`translateX(-50%) translateZ(10px) rotate(${-(s?Ad(s):0)+90}deg)`;return i.$$set=u=>{"floorplanData"in u&&e(3,n=u.floorplanData),"northDesc"in u&&e(0,o=u.northDesc)},[o,r,l,n]}class bd extends oe{constructor(t){super(),ie(this,t,vd,pd,ne,{floorplanData:3,northDesc:0},md)}}const jt=[];function bo(i,t=Y){let e;const n=new Set;function o(a){if(ne(i,a)&&(i=a,e)){const l=!jt.length;for(const c of n)c[1](),jt.push(c,i);if(l){for(let c=0;c<jt.length;c+=2)jt[c][0](jt[c+1]);jt.length=0}}}function s(a){o(a(i))}function r(a,l=Y){const c=[a,l];return n.add(c),n.size===1&&(e=t(o)||Y),a(i),()=>{n.delete(c),n.size===0&&(e(),e=null)}}return{set:o,update:s,subscribe:r}}function yd(i){le(i,"svelte-1gfoniz","img.svelte-1gfoniz{width:100%;height:100%}")}function wd(i){let t,e;return{c(){t=B("img"),Xe(t.src,e=i[0])||y(t,"src",e),y(t,"alt","floorplan iamge"),y(t,"class","svelte-1gfoniz")},m(n,o){M(n,t,o)},p(n,[o]){o&1&&!Xe(t.src,e=n[0])&&y(t,"src",e)},i:Y,o:Y,d(n){n&&L(t)}}}function Cd(i,t,e){let{url:n}=t;return i.$$set=o=>{"url"in o&&e(0,n=o.url)},[n]}class Ed extends oe{constructor(t){super(),ie(this,t,Cd,wd,ne,{url:0},yd)}}function Pd(i){le(i,"svelte-ub47ya",".floorplan-plugin__base-image.svelte-ub47ya{width:100%;height:100%}")}function Id(i){let t,e,n,o;return{c(){t=B("div"),e=new ti(!1),n=ee(),o=new ti(!1),e.a=n,o.a=null,y(t,"class","floorplan-plugin__base-image svelte-ub47ya")},m(s,r){M(s,t,r),e.m(i[1],t),V(t,n),o.m(i[0],t)},p(s,[r]){r&1&&o.p(s[0])},i:Y,o:Y,d(s){s&&L(t)}}}function kd(i,t,e){let{content:n}=t;const o=`
|
|
183
183
|
<style>
|
|
184
184
|
svg [type='lineGroup'] path {
|
|
185
185
|
fill: #ffffff;
|
|
@@ -188,7 +188,7 @@ void main() {
|
|
|
188
188
|
svg [type='lineItemGroup'] g g g g {
|
|
189
189
|
stroke: #ffffff;
|
|
190
190
|
}</style>
|
|
191
|
-
`;return i.$$set=s=>{"content"in s&&e(0,n=s.content)},[n,o]}class xd extends oe{constructor(t){super(),ie(this,t,kd,Id,ne,{content:0},Pd)}}function Dd(i){le(i,"svelte-ozpg4a",".floorplan-plugin__base-image.svelte-ozpg4a{position:absolute;z-index:10;width:100%;height:100%;pointer-events:none}")}function Ld(i){let t,e;return t=new Ed({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||(P(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function Sd(i){let t,e;return t=new xd({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||(P(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function Md(i){let t,e,n,o;const s=[Sd,Ld],r=[];function a(l,c){return l[0]?0:l[1]?1:-1}return~(e=a(i))&&(n=r[e]=s[e](i)),{c(){t=z("div"),n&&n.c(),y(t,"class","floorplan-plugin__base-image svelte-ozpg4a")},m(l,c){M(l,t,c),~e&&r[e].m(t,null),o=!0},p(l,[c]){let u=e;e=a(l),e===u?~e&&r[e].p(l,c):(n&&(se(),D(r[u],1,1,()=>{r[u]=null}),re()),~e?(n=r[e],n?n.p(l,c):(n=r[e]=s[e](l),n.c()),P(n,1),n.m(t,null)):n=null)},i(l){o||(P(n),o=!0)},o(l){D(n),o=!1},d(l){l&&L(t),~e&&r[e].d()}}}function Td(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 sl extends oe{constructor(t){super(),ie(this,t,Td,Md,ne,{floorIndex:2,floorplanData:3},Dd)}}function zd(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 Bd(i){let t,e=i[8].outerHTML+"",n;return{c(){t=new ti(!1),n=ge(),t.a=n},m(o,s){t.m(e,o,s),M(o,n,s)},p(o,s){s&256&&e!==(e=o[8].outerHTML+"")&&t.p(e)},d(o){o&&L(n),o&&t.d()}}}function Vd(i){let t,e,n=i[1]&&Yo(i),o=i[0]&&Uo(i);return{c(){n&&n.c(),t=$(),o&&o.c(),e=ge()},m(s,r){n&&n.m(s,r),M(s,t,r),o&&o.m(s,r),M(s,e,r)},p(s,r){s[1]?n?n.p(s,r):(n=Yo(s),n.c(),n.m(t.parentNode,t)):n&&(n.d(1),n=null),s[0]?o?o.p(s,r):(o=Uo(s),o.c(),o.m(e.parentNode,e)):o&&(o.d(1),o=null)},d(s){n&&n.d(s),s&&L(t),o&&o.d(s),s&&L(e)}}}function Yo(i){let t,e=i[2].name+"",n;return{c(){t=z("span"),n=xe(e),y(t,"class","floorplan-plugin__room-name")},m(o,s){M(o,t,s),V(t,n)},p(o,s){s&4&&e!==(e=o[2].name+"")&&Me(n,e)},d(o){o&&L(t)}}}function Uo(i){let t,e;return{c(){t=z("span"),e=xe(i[7]),y(t,"class","floorplan-plugin__room-size svelte-12pzct5")},m(n,o){M(n,t,o),V(t,e)},p(n,o){o&128&&Me(e,n[7])},d(n){n&&L(t)}}}function jd(i){let t,e,n;function o(a,l){if(a[3]===void 0)return Vd;if(a[8])return Bd}let s=o(i),r=s&&s(i);return{c(){t=z("div"),r&&r.c(),y(t,"class","floorplan-plugin__room-label-item svelte-12pzct5"),T(t,"left",i[9]),T(t,"top",i[10]),T(t,"font-size",i[11]),T(t,"opacity",i[6]?"1":"0")},m(a,l){M(a,t,l),r&&r.m(t,null),e||(n=[ct(an.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&&T(t,"opacity",a[6]?"1":"0")},i:X,o:X,d(a){a&&L(t),r&&r.d(),e=!1,Ge(n)}}}function Od(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 Rd(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(O,S){if(S.width===0||S.height===0)return()=>!1;const F=O.path.map(({x:de,y:pe})=>[de,pe]),G=O.roomLabel.position,{x:Y,y:W}=G,{width:ee,height:U}=S,ae=ee/2,he=U/2;return function(pe){const Pe=Y*pe,ke=W*pe,Te=F.map(([Ae,Ee])=>[Ae*pe,Ee*pe]);return[[Pe+ae,ke-he],[Pe-ae,ke-he],[Pe-ae,ke+he],[Pe+ae,ke+he]].every(Ae=>Od(Ae,Te))}}const v=document.body.clientWidth,b=document.body.clientHeight,w=h.roomLabel,k=w.positionInImage.x*100+"%",C=w.positionInImage.y*100+"%",I=(v<500||b<500?10:14)+"px";let B=0,x=0,H=!1;d.subscribe(function(S){e(16,H=!!S&&S.id===h.id)});const N=O=>{e(4,B=O.detail)},R=O=>{e(5,x=O.detail)};return i.$$set=O=>{"pxmm"in O&&e(12,l=O.pxmm),"roomAreaEnable"in O&&e(0,c=O.roomAreaEnable),"roomNameEnable"in O&&e(1,u=O.roomNameEnable),"room"in O&&e(2,h=O.room),"hoveredRoom"in O&&e(13,d=O.hoveredRoom),"getRoomAreaText"in O&&e(14,m=O.getRoomAreaText),"getLabelElement"in O&&e(3,g=O.getLabelElement),"adaptiveRoomLabelVisibleEnable"in O&&e(15,p=O.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:B,height:x}),i.$$.dirty&262148&&e(17,r=s?A(h,s):void 0),i.$$.dirty&233472&&e(6,a=p?H?!0:!!(r!=null&&r(l)):!0)},[c,u,h,g,B,x,a,o,n,k,C,I,l,d,m,p,H,r,s,N,R]}class Qd extends oe{constructor(t){super(),ie(this,t,Rd,jd,ne,{pxmm:12,roomAreaEnable:0,roomNameEnable:1,room:2,hoveredRoom:13,getRoomAreaText:14,getLabelElement:3,adaptiveRoomLabelVisibleEnable:15},zd)}}function Fd(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 qo(i,t,e){const n=i.slice();return n[12]=t[e],n}function Jo(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=qo(i,a,c),h=l(u);n.set(h,e[c]=Zo(h,u))}return{c(){t=z("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){M(c,t,u);for(let h=0;h<e.length;h+=1)e[h].m(t,null);o=!0,s||(r=[ct(an.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,Pt,Zo,null,qo),re())},i(c){if(!o){for(let u=0;u<a.length;u+=1)P(e[u]);o=!0}},o(c){for(let u=0;u<e.length;u+=1)D(e[u]);o=!1},d(c){c&&L(t);for(let u=0;u<e.length;u+=1)e[u].d();s=!1,Ge(r)}}}function Zo(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 Qd({props:r}),{key:i,first:null,c(){e=ge(),K(n.$$.fragment),this.first=e},m(a,l){M(a,e,l),J(n,a,l),o=!0},p(a,l){t=a;const c=l&447?Fe(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||(P(n.$$.fragment,a),o=!0)},o(a){D(n.$$.fragment,a),o=!1},d(a){a&&L(e),Z(n,a)}}}function Hd(i){let t,e,n=i[8]&&Jo(i);return{c(){n&&n.c(),t=ge()},m(o,s){n&&n.m(o,s),M(o,t,s),e=!0},p(o,[s]){o[8]?n?(n.p(o,s),s&256&&P(n,1)):(n=Jo(o),n.c(),P(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(P(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&L(t)}}}function _d(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 Gd extends oe{constructor(t){super(),ie(this,t,_d,Hd,ne,{floorIndex:9,roomAreaEnable:0,roomNameEnable:1,floorplanData:10,hoveredRoom:2,getRoomAreaText:3,getLabelElement:4,adaptiveRoomLabelVisibleEnable:5},Fd)}}function Wd(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 Ko(i,t,e){const n=i.slice();return n[11]=t[e],n[13]=e,n}function $o(i,t,e){const n=i.slice();return n[14]=t[e],n}function es(i){let t;return{c(){t=z("div"),y(t,"class","floorplan-plugin__rule-scale svelte-djlmk4"),T(t,"left",i[14].left*100+"%"),T(t,"bottom",i[14].bottom*100+"%")},m(e,n){M(e,t,n)},p:X,d(e){e&&L(t)}}}function ts(i,t){let e,n,o=t[1](t[11].distance)+"",s,r;return{key:i,first:null,c(){e=z("div"),n=z("div"),s=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"),T(e,"left",t[11].left*100+"%"),T(e,"bottom",t[11].bottom*100+"%"),this.first=e},m(a,l){M(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)+"")&&Me(s,o)},d(a){a&&L(e)}}}function Nd(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]=es($o(i,u,g));let d=i[4];const m=g=>g[13];for(let g=0;g<d.length;g+=1){let p=Ko(i,d,g),A=m(p);l.set(A,a[g]=ts(A,p))}return{c(){t=z("div"),e=z("div"),n=$(),o=z("div");for(let g=0;g<h.length;g+=1)h[g].c();s=$(),r=z("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]),T(t,"width",i[2]?"100%":1/16+"rem"),T(t,"height",i[2]?1/16+"rem":"100%")},m(g,p){M(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=$o(g,u,A);h[A]?h[A].p(v,p):(h[A]=es(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,ts,null,Ko)),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&&L(t),ut(h,g);for(let p=0;p<a.length;p+=1)a[p].d()}}}const Ot=1e3,Rt=180;function Xd(i,t,e){let{type:n}=t,{data:o}=t,{bounding:s}=t,{getRuleDistanceText:r}=t;const a=n==="top"||n==="bottom",l=s.max.x-s.min.x-(Ot-Rt)*2,c=s.max.y-s.min.y-(Ot-Rt)*2,u=o.map(([g,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-Ot+Rt)/l:0,A=a?0:(g-s.min.y-Ot+Rt)/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-Ot+Rt)/l:0,k=a?0:(b-s.min.y-Ot+Rt)/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 Yd extends oe{constructor(t){super(),ie(this,t,Xd,Nd,ne,{type:0,data:5,bounding:6,getRuleDistanceText:1},Wd)}}function Ud(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 ns(i,t,e){const n=i.slice();return n[13]=t[e][0],n[14]=t[e][1],n}function is(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 Yd({props:r}),{key:i,first:null,c(){e=ge(),K(n.$$.fragment),this.first=e},m(a,l){M(a,e,l),J(n,a,l),o=!0},p(a,l){t=a;const c=l&19?Fe(s,[{type:t[13],data:t[14],bounding:t[1],getRuleDistanceText:t[0]}]):{};n.$set(c)},i(a){o||(P(n.$$.fragment,a),o=!0)},o(a){D(n.$$.fragment,a),o=!1},d(a){a&&L(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=ns(i,s,a),c=r(l);n.set(c,e[a]=is(c,l))}return{c(){t=z("div");for(let a=0;a<e.length;a+=1)e[a].c();y(t,"class","floorplan-plugin__rule-labels-wrapper svelte-1mzj9p3"),T(t,"width",i[3]),T(t,"height",i[2])},m(a,l){M(a,t,l);for(let c=0;c<e.length;c+=1)e[c].m(t,null);o=!0},p(a,[l]){l&19&&(s=a[4],se(),e=Ke(e,l,r,1,a,s,n,t,Pt,is,null,ns),re()),l&8&&T(t,"width",a[3]),l&4&&T(t,"height",a[2])},i(a){if(!o){for(let l=0;l<s.length;l+=1)P(e[l]);o=!0}},o(a){for(let l=0;l<e.length;l+=1)D(e[l]);o=!1},d(a){a&&L(t);for(let l=0;l<e.length;l+=1)e[l].d()}}}const os=1e3,ss=180;function Jd(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-(os-ss)*2),i.$$.dirty&2&&e(8,u=n.max.y-n.min.y-(os-ss)*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 Zd extends oe{constructor(t){super(),ie(this,t,Jd,qd,ne,{floorIndex:5,floorplanData:6,getRuleDistanceText:0},Ud)}}function yi(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 rl({x:i,y:t},e){const{max:n,min:o}=e;return{x:i-o.x,y:n.y-t}}function Kd(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 $d(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 eh(i,t){return Math.max(...t.work.observers.map(n=>i.z>=n.standingPosition.z?n.floorIndex:0))}function th(i){let t;return{c(){t=we("path"),y(t,"d",i[0]),y(t,"fill","#2F313A")},m(e,n){M(e,t,n)},p(e,[n]){n&1&&y(t,"d",e[0])},i:X,o:X,d(e){e&&L(t)}}}function nh(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=yi(o,{needZ:!0}))},[n,o]}class ih extends oe{constructor(t){super(),ie(this,t,nh,th,ne,{path:1})}}function oh(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){M(a,t,l),V(t,e),V(e,n),V(e,o),M(a,s,l),M(a,r,l)},p(a,[l]){l&1&&y(r,"d",a[0])},i:X,o:X,d(a){a&&L(t),a&&L(s),a&&L(r)}}}const Bi=6;function sh(i,t,e){let n,{path:o}=t;const s=Bi*2,r=`M0 ${Bi} h ${s} M${Bi} 0 v ${s}`;return i.$$set=a=>{"path"in a&&e(3,o=a.path)},i.$$.update=()=>{i.$$.dirty&8&&e(0,n=yi(o,{needZ:!0}))},[n,s,r,o]}class rh extends oe{constructor(t){super(),ie(this,t,sh,oh,ne,{path:3})}}function ah(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){M(d,t,m),V(t,e),V(e,n),V(t,o),V(o,s),M(d,r,m),M(d,a,m),M(d,l,m),M(d,c,m),M(d,u,m),M(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&&L(t),d&&L(r),d&&L(a),d&&L(l),d&&L(c),d&&L(u),d&&L(h)}}}function lh(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=yi(o,{needZ:!0}))},[n,o]}class ch extends oe{constructor(t){super(),ie(this,t,lh,ah,ne,{path:1})}}function uh(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 rs(i,t,e){const n=i.slice();return n[5]=t[e],n}function dh(i){let t,e;return t=new rh({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||(P(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function hh(i){let t,e;return t=new ch({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||(P(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function fh(i){let t,e;return t=new ih({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||(P(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function as(i){let t,e,n,o;const s=[fh,hh,dh],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){M(l,t,c),r[e].m(t,null),o=!0},p(l,c){let u=e;e=a(l),e===u?r[e].p(l,c):(se(),D(r[u],1,1,()=>{r[u]=null}),re(),n=r[e],n?n.p(l,c):(n=r[e]=s[e](l),n.c()),P(n,1),n.m(t,null))},i(l){o||(P(n),o=!0)},o(l){D(n),o=!1},d(l){l&&L(t),r[e].d()}}}function mh(i){let t,e,n=i[0],o=[];for(let r=0;r<n.length;r+=1)o[r]=as(rs(i,n,r));const s=r=>D(o[r],1,1,()=>{o[r]=null});return{c(){t=z("div");for(let r=0;r<o.length;r+=1)o[r].c();y(t,"class","floorplan-plugin__room-material svelte-1dykexu")},m(r,a){M(r,t,a);for(let l=0;l<o.length;l+=1)o[l].m(t,null);e=!0},p(r,[a]){if(a&7){n=r[0];let l;for(l=0;l<n.length;l+=1){const c=rs(r,n,l);o[l]?(o[l].p(c,a),P(o[l],1)):(o[l]=as(c),o[l].c(),P(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)P(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&&L(t),ut(o,r)}}}function gh(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=>rl(c,s.bounding))})))},[n,r,a,o,s]}class ph extends oe{constructor(t){super(),ie(this,t,gh,mh,ne,{floorIndex:3,floorplanData:4},uh)}}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 vh(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){M(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&&L(t),n=!1,Ge(o)}}}function bh(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=yi(s.path,{needZ:!0,format:g=>rl(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 yh extends oe{constructor(t){super(),ie(this,t,bh,vh,ne,{room:0,floorIndex:1,floorplanData:6,hoveredRoom:7,highlightData:8},Ah)}}function wh(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 ls(i,t,e){const n=i.slice();return n[6]=t[e],n}function cs(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 yh({props:r}),{key:i,first:null,c(){e=ge(),K(n.$$.fragment),this.first=e},m(a,l){M(a,e,l),J(n,a,l),o=!0},p(a,l){t=a;const c=l&15?Fe(s,[{room:t[6],floorplanData:t[1],hoveredRoom:t[2],floorIndex:t[0],highlightData:t[3]}]):{};n.$set(c)},i(a){o||(P(n.$$.fragment,a),o=!0)},o(a){D(n.$$.fragment,a),o=!1},d(a){a&&L(e),Z(n,a)}}}function Ch(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=ls(i,r,l),u=a(c);o.set(u,n[l]=cs(u,c))}return{c(){t=z("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){M(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,Pt,cs,null,ls),re())},i(l){if(!s){for(let c=0;c<r.length;c+=1)P(n[c]);s=!0}},o(l){for(let c=0;c<n.length;c+=1)D(n[c]);s=!1},d(l){l&&L(t);for(let c=0;c<n.length;c+=1)n[c].d()}}}function Eh(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 al extends oe{constructor(t){super(),ie(this,t,Eh,Ch,ne,{floorIndex:0,floorplanData:1,hoveredRoom:2,highlightData:3},wh)}}function Ph(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 us(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 al({props:o}),{c(){K(t.$$.fragment)},m(s,r){J(t,s,r),e=!0},p(s,r){const a=r&24834?Fe(n,[{floorIndex:s[1],floorplanData:s[8],hoveredRoom:s[14],highlightData:s[13]}]):{};t.$set(a)},i(s){e||(P(t.$$.fragment,s),e=!0)},o(s){D(t.$$.fragment,s),e=!1},d(s){Z(t,s)}}}function ds(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 Gd({props:o}),{c(){K(t.$$.fragment)},m(s,r){J(t,s,r),e=!0},p(s,r){const a=r&22370?Fe(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||(P(t.$$.fragment,s),e=!0)},o(s){D(t.$$.fragment,s),e=!1},d(s){Z(t,s)}}}function hs(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 Zd({props:o}),{c(){K(t.$$.fragment)},m(s,r){J(t,s,r),e=!0},p(s,r){const a=r&2306?Fe(n,[{floorplanData:s[8],floorIndex:s[1],getRuleDistanceText:s[11]}]):{};t.$set(a)},i(s){e||(P(t.$$.fragment,s),e=!0)},o(s){D(t.$$.fragment,s),e=!1},d(s){Z(t,s)}}}function Ih(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 ph({props:h});let d=(i[2]||i[3])&&us(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 sl({props:g});let p=i[4]&&ds(i),A=i[7]&&hs(i);return{c(){t=z("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){M(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?Fe(u,[{floorIndex:v[1],floorplanData:v[8]}]):{};e.$set(w),v[2]||v[3]?d?(d.p(v,b),b&12&&P(d,1)):(d=us(v),d.c(),P(d,1),d.m(t,o)):d&&(se(),D(d,1,1,()=>{d=null}),re());const k=b&258?Fe(m,[{floorplanData:v[8],floorIndex:v[1]}]):{};s.$set(k),v[4]?p?(p.p(v,b),b&16&&P(p,1)):(p=ds(v),p.c(),P(p,1),p.m(t,a)):p&&(se(),D(p,1,1,()=>{p=null}),re()),v[7]?A?(A.p(v,b),b&128&&P(A,1)):(A=hs(v),A.c(),P(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||(P(e.$$.fragment,v),P(d),P(s.$$.fragment,v),P(p),P(A),c=!0)},o(v){D(e.$$.fragment,v),D(d),D(s.$$.fragment,v),D(p),D(A),c=!1},d(v){v&&L(t),Z(e),d&&d.d(),Z(s),p&&p.d(),A&&A.d()}}}function kh(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=bo(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 xh extends oe{constructor(t){super(),ie(this,t,kh,Ih,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},Ph)}}function Dh(i){le(i,"svelte-86bqav",".floorplan-main.svelte-86bqav{width:100%;height:100%;pointer-events:none}")}function fs(i,t,e){const n=i.slice();return n[21]=t[e],n}function ms(i){let t,e,n,o,s,r=i[13].floorDatas,a=[];for(let h=0;h<r.length;h+=1)a[h]=gs(fs(i,r,h));const l=h=>D(a[h],1,1,()=>{a[h]=null});let c=i[5]&&ps(i),u=i[8]&&As(i);return{c(){t=z("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){M(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=fs(i,r,m);a[m]?(a[m].p(g,d),P(a[m],1)):(a[m]=gs(g),a[m].c(),P(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&&P(c,1)):(c=ps(i),c.c(),P(c,1),c.m(t,n)):c&&(se(),D(c,1,1,()=>{c=null}),re()),i[8]?u?(u.p(i,d),d&256&&P(u,1)):(u=As(i),u.c(),P(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)P(a[d]);P(c),P(u),o||Qe(()=>{o=Mt(t,St,{duration:i[0],easing:At}),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&&L(t),ut(a,h),c&&c.d(),u&&u.d()}}}function gs(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 xh({props:o}),{c(){K(t.$$.fragment)},m(s,r){J(t,s,r),e=!0},p(s,r){const a=r&2047696?Fe(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||(P(t.$$.fragment,s),e=!0)},o(s){D(t.$$.fragment,s),e=!1},d(s){Z(t,s)}}}function ps(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 hd({props:o}),{c(){K(t.$$.fragment)},m(s,r){J(t,s,r),e=!0},p(s,r){const a=r&57352?Fe(n,[{panoIndex:s[3],floorplanData:s[13],lastPanoramaLongitude:s[14],cameraImageUrl:s[15]}]):{};t.$set(a)},i(s){e||(P(t.$$.fragment,s),e=!0)},o(s){D(t.$$.fragment,s),e=!1},d(s){Z(t,s)}}}function As(i){let t,e;return t=new bd({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||(P(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function Lh(i){let t,e,n=i[1]&&ms(i);return{c(){n&&n.c(),t=ge()},m(o,s){n&&n.m(o,s),M(o,t,s),e=!0},p(o,[s]){o[1]?n?(n.p(o,s),s&2&&P(n,1)):(n=ms(o),n.c(),P(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(P(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&L(t)}}}function Sh(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:C}=t,{adaptiveRoomLabelVisibleEnable:I}=t,{highlightData:B}=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,C=x.getRuleDistanceText),"adaptiveRoomLabelVisibleEnable"in x&&e(19,I=x.adaptiveRoomLabelVisibleEnable),"highlightData"in x&&e(20,B=x.highlightData)},[n,o,s,r,a,l,c,u,h,d,m,g,p,A,v,b,w,k,C,I,B]}class yo extends oe{constructor(t){super(),ie(this,t,Sh,Lh,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},Dh)}}const Mh="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC0AAAAwCAYAAACFUvPfAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAALaADAAQ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bip+wX3x6volVSx+LPAxF+VLXhZ8VQ+iP2Rta/iWe5v42Fngj0BbdnRTXh12ZIcKhTaGbcYjybRwXBU1lu9KlndXp04NM52poKWO0RZsviNaP9a6grkO972+st05pXhE5c1hTEluJy7XUejGUQNLMbAmTdWY1rKBLW3aTJqBZ7nZkb36DhYCreeYHbMUXHvaYi5XDK70EcgulmRjm77wNtenzuXCbmnTRaAx493rbGf3Jr/njMzj920CnKdUaFCjlDioy7NYNvOdGrQJNgI32/L2tkXfFPlxgToqjWVhD6KdLnQRdARf/HHQz2r2X2Gqy8pAZaAyUBmoDFQGKgP/q4F/AJYg9/s0ZoABAAAAAElFTkSuQmCC";function Th(i){return _(this,null,function*(){const t=new Headers({"Content-Type":"text/plain"}),e=function(o){return _(this,null,function*(){const s={index:o.index,url:o.url,svgUrl:o.svg_url};if(o.svg_url){const r=yield fetch(o.svg_url,{headers:t}).then(a=>a.text());s.svgContent=r}return s})};return yield Promise.all(i.map(e))})}function zh(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 Bh(i){return{floorName:i.floor_name,floorIndex:i.floor_index,rooms:i.rooms.map(zh),rules:i.rules}}function Vh(i){return{index:i.index,floorIndex:i.floor_index,position:i.position,positionInImage:i.position_in_image}}function jh(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 _(this,null,function*(){const t=yield Th(i.outlines),e=i.computed_data.bounding,n=i.computed_data.floor_datas.map(Bh),o=i.computed_data.entrance?jh(i.computed_data.entrance):null;return{outlines:t,entrance:o,bounding:e,floorDatas:n,observers:i.computed_data.observers.map(Vh)}})}function Oh(i,t,e){return i.map(o=>{const s=o.position,r=o.icon?o.icon:{url:Mh,width:45,height:48},a=eh(s,t),l=Kd(s,e),c=$d(l,e);return{floorIndex:a,icon:r,id:o.id,position:l,positionInImage:c}})}function Rh(i,t){return t(i),i}function wi(i,t){return Rh({},e=>{for(const n in i)t.indexOf(n)===-1&&(e[n]=i[n])})}function vs(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 wo(i,t,e=gt.BOUNDING_CENTER){const n=vs(i,t),o=vs(i,t+1);return e===gt.BOUNDING_CENTER?(i.model.bounding.max.y+i.model.bounding.min.y)/2:e===gt.CEILING?o:n}function Co(i,t,e,n){const o=wo(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 xn{constructor(t,e){f(this,"VERSION","2.16.0-2");f(this,"five");f(this,"hooks",new Jt);f(this,"staticPrefix","//vrlab-static.ljcdn.com");this.five=t,e!=null&&e.staticPrefix&&(this.staticPrefix=e.staticPrefix)}getCurrentState(){return this.state}isAbsoluteURL(t){return ho(t)?t:`${this.staticPrefix}${t}`}}class Tt extends xn{}var We=(i=>(i.UnknownError="UnknownError",i.DataNotLoaded="DataNotLoaded",i.BreakOffByHide="BreakOffByHide",i.BreakOffByDisable="BreakOffByDisable",i.ModelNotLoaded="ModelNotLoaded",i.ChangeModeError="ChangeModeError",i.UpdateCameraError="UpdateCameraError",i))(We||{});const ll=500,Qh=80;function no(i,t,e=4){return Math.floor(i*Math.pow(10,e))===Math.floor(t*Math.pow(10,e))}function cl(i,t){return _(this,null,function*(){yield new Promise((e,n)=>{i.changeMode(...t).catch(o=>n(o)),i.once("initAnimationEnded",()=>{const o=i.getCurrentState(),s=t[0];o.mode!==s&&n(new Error("mode \u4E0E\u9884\u671F\u4E0D\u7B26")),(()=>{const l=t[1];return l?Object.keys(l).every(c=>{const u=o[c];if(u===void 0)return!0;const h=l[c];return typeof u=="number"&&typeof h=="number"?no(u,h,2):u===h}):!0})()||n(new Error("five pose \u4E0E\u9884\u671F\u4E0D\u7B26")),e()})})})}function Eo(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!(!no(e,s,2)||!no(n,r,2)||o!==a)}function ul(i,t,e=!0){return _(this,null,function*(){if(Eo(i,t)===!0)return;const o=i.getCurrentState();if(o.mode!==t.mode){const[u]=yield li(cl(i,[t.mode,t,void 0,e]));if(u)throw new Error(We.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 li(i.updateCamera(t,l,e));if(c)throw new Error(We.UpdateCameraError)})}function Yt(i,t,e=300){const n=i.getElement();!n||(n.style.opacity=t+"",n.style.transition=e===0?"none":`opacity ${e}ms linear`,e!==0&&Promise.race([new Promise(o=>n.addEventListener("transitionend",o,{once:!0})),new Promise(o=>setTimeout(o,e))]).then(()=>{n.style.transition="none"}))}function Fh(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 Hh(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 _h extends Tt{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)=>_(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)=>_(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||!Eo(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=Co(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,We.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=>_(this,null,function*(){var r;if(!this.state.enabled)return;if(!((r=this.five.model)!=null&&r.loaded))throw new Error(We.ModelNotLoaded);if(!this.data)throw new Error(We.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=()=>_(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 li(ul(this.five,this.showState,o.userAction));if(c)throw c;if(a)throw l?new Error(l):new Error(We.UnknownError);this.updateSize(),this.floorIndex=o.floorIndex,this.five.model.show(this.floorIndex);const u=o.modelOpacity,h=o.immediately?0:ll;Yt(this.five,u,h),this.render(h)});return this.showPromise=s().then(()=>{this.hooks.emit("showAnimationEnded",{auto:o.isAutoShow,userAction:o.userAction})}).catch(a=>{if(this.updateState({visible:!1},o.userAction),!o.isAutoShow&&a instanceof Error)throw a}).finally(()=>{this.showPromise=void 0,this.showRejection=void 0}),this.showPromise}));f(this,"_hide",e=>{var s;(s=this.showRejection)==null||s.call(this,We.BreakOffByHide),this.showPromise=void 0;const o=Q(Q({},{userAction:!0,isAutoHide:!1}),e);Yt(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||Hh(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();Fh(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:Qh/((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:gt.BOUNDING_CENTER,getLabelElement:void 0,getRoomAreaText:l=>(l/1e6).toFixed(1)+"\u33A1",getRuleDistanceText:l=>l.toString()},s=n?wi(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 _(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 _(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}),!nt(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 yo({target:this.container,intro:!0,props:n})}}const Gh=(i,t)=>new _h(i,t);function Wh(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 Nh(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 Xh extends Tt{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)=>_(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)=>_(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||!Eo(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=Co(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,We.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=>_(this,null,function*(){var r;if(!this.state.enabled)return;if(!((r=this.five.model)!=null&&r.loaded))throw new Error(We.ModelNotLoaded);if(!this.data)throw new Error(We.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=()=>_(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 li(ul(this.five,this.showState,o.userAction));if(c)throw c;if(a)throw l?new Error(l):new Error(We.UnknownError);this.updateSize(),this.updatePosition(),this.floorIndex=o.floorIndex,this.five.model.show(this.floorIndex);const u=o.modelOpacity,h=o.immediately?0:ll;Yt(this.five,u,h),this.render(h)});return this.showPromise=s().then(()=>{this.hooks.emit("showAnimationEnded",{auto:o.isAutoShow,userAction:o.userAction})}).catch(a=>{if(this.updateState({visible:!1},o.userAction),!o.isAutoShow&&a instanceof Error)throw a}).finally(()=>{this.showPromise=void 0,this.showRejection=void 0}),this.showPromise}));f(this,"_hide",e=>{var s;(s=this.showRejection)==null||s.call(this,We.BreakOffByHide),this.showPromise=void 0;const o=Q(Q({},{userAction:!0,isAutoHide:!1}),e);Yt(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(),Wh(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:(Nh(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:gt.BOUNDING_CENTER,getLabelElement:void 0,adaptiveRoomLabelVisibleEnable:!0,getRoomAreaText:a=>(a/1e6).toFixed(1)+"\u33A1",getRuleDistanceText:a=>a.toString()},s=n?wi(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 _(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=wo(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 _(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}),!nt(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 yo({target:this.container,intro:!0,props:n})}}const Yh=(i,t)=>new Xh(i,t);class Uh extends Tt{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=Co(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:gt.BOUNDING_CENTER,getLabelElement:void 0,adaptiveRoomLabelVisibleEnable:!0,getRoomAreaText:a=>(a/1e6).toFixed(1)+"\u33A1",getRuleDistanceText:a=>a.toString()},s=n?wi(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 _(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=wo(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 _(this,arguments,function*(e={}){if(this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},n),this._show({userAction:n})})}hide(){return _(this,arguments,function*(e={}){if(this.isHiddenByHideFunc=!0,!this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!1},n),this._hide({userAction:n})})}enable(e={}){if(this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||n),this._enable({userAction:n})}disable(e={}){if(!this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||n),this._disable({userAction:n})}setState(e,n={}){const o=this.state,s=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,s),e.enabled!==void 0&&o.enabled!==e.enabled){const r={userAction:s};e.enabled?this._enable(r):this._disable(r)}if(e.visible!==void 0&&o.visible!==e.visible){const r={userAction:s};e.visible?this._show(r):this._hide(r)}}changeConfigs(e,n=!0){this.updateState({config:e},n),this.render()}formatData(e){return _(this,null,function*(){return yield yt(e.data)})}_show(e){return _(this,null,function*(){if(!this.state.enabled)return;this.isHiddenByHideFunc=!1;const{userAction:n}=e;this.hooks.emit("show",{userAction:n,auto:!1}),this.five.getCurrentState().mode!=="Topview"&&(yield cl(this.five,["Topview",void 0,void 0,n])),this.five.model.show(this.floorIndex),this.updatePosition(),this.updateSize();const o=500,s=this.state.config.modelOpacity;Yt(this.five,s,o),this.hooks.emit("showAnimationEnded",{userAction:n,auto:!1}),this.render()})}_hide(e){return _(this,null,function*(){if(!this.state.enabled)return;const{userAction:n}=e;this.hooks.emit("hide",{userAction:n,auto:!1});const o=1,s=0;Yt(this.five,o,s),this.render()})}_enable(e){const{userAction:n}=e;this.addEventListener(),this.wrapper&&this.wrapper.append(this.container),this.hooks.emit("enable",{userAction:n}),this.state.visible&&this._show({userAction:n})}updateState(e,n){const o=this.state,s=e.config?Q(Q({},o.config),e.config):o.config;this.state=fe(Q(Q({},this.state),e),{config:s}),!nt(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 yo({target:this.container,intro:!0,props:n})}}const qh=(i,t)=>new Uh(i,t);function Po(i,t=200){let e;return function(...n){e||(i(...n),e=setTimeout(function(){e=null},t))}}function Jh(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 Zh(i){let t,e,n;return{c(){t=z("div"),e=z("div"),n=z("div"),y(n,"class","plugin-radar__camera-rotate svelte-1nqrlxd"),T(n,"background-image","url("+(i[0]||bt)+")"),T(n,"transform",i[1]),y(e,"class","plugin-radar__camera-position svelte-1nqrlxd"),T(e,"transform",i[2]),y(t,"class","plugin-radar__camera-wrapper svelte-1nqrlxd")},m(o,s){M(o,t,s),V(t,e),V(e,n)},p(o,[s]){s&1&&T(n,"background-image","url("+(o[0]||bt)+")"),s&2&&T(n,"transform",o[1]),s&4&&T(e,"transform",o[2])},i:X,o:X,d(o){o&&L(t)}}}function Kh(i){return`rotate(${Math.floor(i/Math.PI*180)*-1+45}deg)`}function $h(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),C=Math.floor(v.positionInImage.y*w);return`translate(${k}px, ${C}px)`}function d(g){e(6,c=g)}const m=Po(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=Kh(u))},[l,o,n,s,r,a,c,u]}class ef extends oe{constructor(t){super(),ie(this,t,$h,Zh,ne,{five:3,pxmm:4,floorplanData:5,cameraImageUrl:0},Jh)}}function tf(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 bs(i,t,e){const n=i.slice();return n[1]=t[e],n}function ys(i,t){let e,n,o=`${t[1].icon.width/16}rem`,s=`${t[1].icon.height/16}rem`,r,a=`${t[1].positionInImage.y*100}%`,l=`${t[1].positionInImage.x*100}%`;return{key:i,first:null,c(){e=z("div"),n=z("div"),r=$(),y(n,"class","plugin-pano-floorplan__extra-object-item svelte-1i87fz7"),T(n,"background-image",`url(${t[1].icon.url})`),T(n,"width",o),T(n,"height",s),y(e,"class","plugin-pano-floorplan__extra-object-item--position svelte-1i87fz7"),T(e,"top",a),T(e,"left",l),this.first=e},m(c,u){M(c,e,u),V(e,n),V(e,r)},p(c,u){t=c,u&1&&T(n,"background-image",`url(${t[1].icon.url})`),u&1&&o!==(o=`${t[1].icon.width/16}rem`)&&T(n,"width",o),u&1&&s!==(s=`${t[1].icon.height/16}rem`)&&T(n,"height",s),u&1&&a!==(a=`${t[1].positionInImage.y*100}%`)&&T(e,"top",a),u&1&&l!==(l=`${t[1].positionInImage.x*100}%`)&&T(e,"left",l)},d(c){c&&L(e)}}}function nf(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=bs(i,o,r),l=s(a);n.set(l,e[r]=ys(l,a))}return{c(){t=z("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){M(r,t,a);for(let l=0;l<e.length;l+=1)e[l].m(t,null)},p(r,[a]){a&1&&(o=r[0],e=Ke(e,a,s,1,r,o,n,t,Ao,ys,null,bs))},i:X,o:X,d(r){r&&L(t);for(let a=0;a<e.length;a+=1)e[a].d()}}}function of(i,t,e){let{extraObjects:n=[]}=t;return i.$$set=o=>{"extraObjects"in o&&e(0,n=o.extraObjects)},[n]}class sf extends oe{constructor(t){super(),ie(this,t,of,nf,ne,{extraObjects:0},tf)}}function ws(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 al({props:o}),{c(){K(t.$$.fragment)},m(s,r){J(t,s,r),e=!0},p(s,r){const a=r&183?Fe(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||(P(t.$$.fragment,s),e=!0)},o(s){D(t.$$.fragment,s),e=!1},d(s){Z(t,s)}}}function rf(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 sl({props:l}),n=new sf({props:{extraObjects:i[6]}});let c=i[3]&&ws(i);return{c(){K(t.$$.fragment),e=$(),K(n.$$.fragment),o=$(),c&&c.c(),s=ge()},m(u,h){J(t,u,h),M(u,e,h),J(n,u,h),M(u,o,h),c&&c.m(u,h),M(u,s,h),r=!0},p(u,[h]){const d=h&20?Fe(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&&P(c,1)):(c=ws(u),c.c(),P(c,1),c.m(s.parentNode,s)):c&&(se(),D(c,1,1,()=>{c=null}),re())},i(u){r||(P(t.$$.fragment,u),P(n.$$.fragment,u),P(c),r=!0)},o(u){D(t.$$.fragment,u),D(n.$$.fragment,u),D(c),r=!1},d(u){Z(t,u),u&&L(e),Z(n,u),u&&L(o),c&&c.d(u),u&&L(s)}}}function af(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 lf extends oe{constructor(t){super(),ie(this,t,af,rf,ne,{five:0,pxmm:1,floorIndex:2,hoverEnable:3,floorplanData:4,extraObjects:8,highlightData:5})}}function cf(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&&Es(i);return{c(){t=z("div"),s&&s.c(),y(t,"class","plugin-floorplan-radar svelte-1mvqyqq")},m(r,a){M(r,t,a),s&&s.m(t,null),e=!0,n||(o=[ct(an.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&&P(s,1)):(s=Es(r),s.c(),P(s,1),s.m(t,null)):s&&(se(),D(s,1,1,()=>{s=null}),re())},i(r){e||(P(s),e=!0)},o(r){D(s),e=!1},d(r){r&&L(t),s&&s.d(),n=!1,Ge(o)}}}function Es(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 lf({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 ef({props:h}),{c(){t=z("div"),K(e.$$.fragment),n=$(),K(o.$$.fragment),y(t,"class","plugin-floorplan-radar-container svelte-1mvqyqq"),T(t,"width",s),T(t,"height",r)},m(d,m){M(d,t,m),J(e,t,null),V(t,n),J(o,t,null),a=!0},p(d,m){const g=m&3181?Fe(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?Fe(u,[{pxmm:d[10],five:d[0],floorplanData:d[3],cameraImageUrl:d[4]}]):{};o.$set(p),m&512&&s!==(s=`${d[9]}px`)&&T(t,"width",s),m&4096&&r!==(r=`${d[12]}px`)&&T(t,"height",r)},i(d){a||(P(e.$$.fragment,d),P(o.$$.fragment,d),a=!0)},o(d){D(e.$$.fragment,d),D(o.$$.fragment,d),a=!1},d(d){d&&L(t),Z(e),Z(o)}}}function uf(i){let t,e,n=i[1]&&Cs(i);return{c(){n&&n.c(),t=ge()},m(o,s){n&&n.m(o,s),M(o,t,s),e=!0},p(o,[s]){o[1]?n?(n.p(o,s),s&2&&P(n,1)):(n=Cs(o),n.c(),P(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(P(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&L(t)}}}function df(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(C){e(11,h=n.work.observers[C].floorIndex)}Ze(()=>(n.on("panoArrived",A),()=>{n.off("panoArrived",A)}));const v=C=>{e(7,d=C.detail)},b=C=>{e(8,m=C.detail)};return i.$$set=C=>{"five"in C&&e(0,n=C.five),"visible"in C&&e(1,o=C.visible),"hoverEnable"in C&&e(2,s=C.hoverEnable),"floorplanData"in C&&e(3,r=C.floorplanData),"cameraImageUrl"in C&&e(4,a=C.cameraImageUrl),"extraObjects"in C&&e(5,l=C.extraObjects),"highlightData"in C&&e(6,c=C.highlightData)},i.$$.update=()=>{if(i.$$.dirty&904){const C=Math.min(d,m),{max:I,min:B}=r.bounding,x=I.x-B.x,H=I.y-B.y,N=function(){return x>H?[C,C/x*H]:[C/H*x,C]}();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 hf extends oe{constructor(t){super(),ie(this,t,df,uf,ne,{five:0,visible:1,hoverEnable:2,floorplanData:3,cameraImageUrl:4,extraObjects:5,highlightData:6},cf)}}class ff extends Tt{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 _(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 _(this,arguments,function*(e={}){if(this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},n),this._show({userAction:n})})}hide(){return _(this,arguments,function*(e={}){if(!this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!1},n),this._hide({userAction:n})})}enable(e={}){if(this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!0},e.userAction||n),this._enable({userAction:n})}disable(e={}){if(!this.state.enabled)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({enabled:!1},e.userAction||n),this._disable({userAction:n})}setState(e,n={}){const o=this.state,s=n.userAction!==void 0?n.userAction:!0;if(this.updateState(e,s),e.enabled!==void 0&&o.enabled!==e.enabled){const r={userAction:s};e.enabled?this._enable(r):this._disable(r)}if(e.visible!==void 0&&o.visible!==e.visible){const r={userAction:s};e.visible?this._show(r):this._hide(r)}}appendTo(e){this.wrapper=e,this.render()}changeConfigs(e,n=!0){this.setState({config:e},{userAction:n}),this.render()}setExtraObjectsWith3DPositions(e){!this.data||(this.extraObjects=Oh(e,this.five,this.data),this.render())}formatData(e){return _(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),!nt(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 hf({target:this.wrapper,props:e})}}const mf=(i,t)=>new ff(i,t),gf=[{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"}],pf=[{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"}],Vi=(i,t,e)=>{const n=new E.Matrix4,o=new E.Euler(i,t,e,"YXZ");return n.makeRotationFromEuler(o),n},vf=(i,{scale:t,rotation:e,position:n})=>{if(t&&i.scale.set(t,t,t),e){const[o,s,r]=e;o&&i.applyMatrix4(Vi(o,0,0)),s&&i.applyMatrix4(Vi(0,s,0)),r&&i.applyMatrix4(Vi(0,0,r))}return n&&i.position.set(n.x,n.y,n.z),i};function dl(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 bf=(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=>_(exports,null,function*(){var O;const d=(h==null?void 0:h.fbx_url)||e,m=(O=h==null?void 0:h.north_rad)!=null?O: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 Aa.FBXLoader().loadAsync(d);dl(w,{transparent:!0,side:E.DoubleSide,blending:E.AdditiveBlending});const k=[0,m-Math.PI/2,0],{model:{bounding:{max:{x:C,z:I},min:{x:B,y:x,z:H}}}}=i;o.yBase=x;const N={x:(C+B)/2,y:x-1.6,z:(I+H)/2},R=.0045*v;return vf(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 yf(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 wf=({x:i,y:t,z:e})=>new j.Vector3(i,t,e),Cf=(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=>_(exports,null,function*(){var N,R,O,S,F,G,Y,W;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=wf(w),C=(R=b==null?void 0:b.rad)!=null?R:s,I=(O=b==null?void 0:b.fbx_url)!=null?O:r;if(e.rad=C,C===void 0)return Promise.reject(new Error(`ModelEntryDoorGuidePlugin.load(): rad is ${C}`));const B=yield new Aa.FBXLoader().loadAsync(I);B.position.copy(k),B.rotation.z=C,B.scale.set(.8,.8,.8),dl(B,{transparent:!0,side:E.DoubleSide});const x=(Y=(G=(F=(S=B.children)==null?void 0:S[0])==null?void 0:F.children)==null?void 0:G[3])==null?void 0:Y.clone();if(!x)return Promise.reject(new Error(`ModelEntryDoorGuidePlugin.load(): textMesh is ${x}`));const H=(W=t.name)!=null?W:"\u5165\u6237\u95E8";return x.material=new j.MeshBasicMaterial({transparent:!0,map:yf(H)}),x.renderOrder=3,B.children[0].add(x),e.object=B,!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 C;const I=()=>{let N=0,R=0;const O=1e3/30,S=F=>{N=requestAnimationFrame(S);const G=F-R;G<O||(R=F,a.forEach(Y=>Y.update(G/1e3)),i.needsRender=!0)};return N=requestAnimationFrame(S),()=>{cancelAnimationFrame(N)}},H={play:()=>{C||(k.play(),C=I(),requestAnimationFrame(()=>{e.object&&e.object.rotation.z!==e.rad&&(e.object.rotation.z=e.rad)}))},stop:()=>{k.stop(),C==null||C(),C=void 0}};e.animation=H},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)}},Ef=mi.Easing;function Pf(i,t,e,n=Ef.Linear.None){const o=new mi.Tween(i).to(t,e).easing(n);gi(()=>o.start(0));const s=kn(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 If(i,t){return Pf({progress:0},{progress:1},i,t)}var hl=(i=>(i.Move="Move",i.Rotate="Rotate",i))(hl||{}),tt=(i=>(i.Clockwise="Clockwise",i.Anticlockwise="Anticlockwise",i.Loop="Loop",i))(tt||{});const Zn=Math.PI*2;function Ps(i){return(i%Zn+Zn)%Zn}function Is(i){return i%Zn}function ji(i,t,e){return i+(t-i)*e}const io=(i,t,e)=>{const n=Math.PI,o=n*2;return i=Ps(i),t=Ps(t),e===tt.Anticlockwise&&i<t&&(i+=o),e===tt.Clockwise&&t<i&&(t+=o),e===tt.Loop&&t-i>n?io(i,t,tt.Anticlockwise):e===tt.Loop&&i-t>n?io(i,t,tt.Clockwise):{from:i,to:t}},kf=i=>{const t={},e=(l,c,...u)=>_(exports,[l,c,...u],function*(s,r,a={preload:!0}){return t.interruptCallback&&t.interruptCallback(!1),a.asyncStartCallback&&(yield a.asyncStartCallback()),s.mode&&s.mode!==i.currentMode&&(yield i.changeMode(s.mode)),a.preload&&s.panoIndex!==void 0&&s.panoIndex!==i.panoIndex&&(yield i.preloadPano(s.panoIndex)),a.asyncEndCallback&&(yield a.asyncEndCallback()),s.panoIndex===void 0&&s.fov===void 0&&s.latitude===void 0&&s.longitude===void 0?!0:yield new Promise((h,d)=>{const 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=Is(r.latitude),l=Is(s.latitude),{from:c,to:u}=io(r.longitude,s.longitude,s.rotation||tt.Loop),h=r.fov,d=s.fov;return{from:{latitude:a,longitude:c,fov:h},to:{latitude:l,longitude:u,fov:d}}};return{move:e,rotate:(l,c,...u)=>_(exports,[l,c,...u],function*(s,r,a={}){t.interruptCallback&&t.interruptCallback(!1),a.asyncStartCallback&&(yield a.asyncStartCallback()),i.currentMode!==Ce.Five.Mode.Panorama&&(yield i.changeMode(Ce.Five.Mode.Panorama)),s.panoIndex!==void 0&&s.panoIndex!==i.panoIndex&&(a.preload&&(yield i.preloadPano(s.panoIndex)),yield new Promise((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=ji(h.longitude,d.longitude,w),k.latitude=ji(h.latitude,d.latitude,w),k.fov=ji(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=If(v,mi.Easing.Linear.None).onUpdate(g).onComplete(p).onDestroy(A);s.rotation===tt.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 ks(i,t){return i.x===t.x&&i.y===t.y}function fl(i,t){return Math.abs(i)===1/0&&Math.abs(t)===1/0?!0:Math.abs(i-t)<.001}function di(i,t){return(t.y-i.y)/(t.x-i.x)}function ml(i,t,e){const n=di(i[1],i[0]),o=di(t[1],t[0]);if(isNaN(n)||isNaN(o)||fl(n,o))return!1;if(Qn(i[0],t))return i[0];if(Qn(i[1],t))return i[1];if(Qn(t[0],i))return t[0];if(Qn(t[1],i))return t[1];if(e&&!xf(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 Qn(i,t){return ks(i,t[0])||ks(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&&fl(di(t[0],i),di(i,t[1]))}function Fn(i,t,e){return(i.x-e.x)*(t.y-e.y)-(t.x-e.x)*(i.y-e.y)}function xf(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)&&Fn(t[0],i[1],i[0])*Fn(i[1],t[1],i[0])>0&&Fn(i[0],t[1],t[0])*Fn(t[1],i[1],t[0])>0?1:0}function gl(i,t=0){t<=0?requestAnimationFrame(i):requestAnimationFrame(()=>gl(i,t-1))}const Df=`<style type="text/css">
|
|
191
|
+
`;return i.$$set=s=>{"content"in s&&e(0,n=s.content)},[n,o]}class xd extends oe{constructor(t){super(),ie(this,t,kd,Id,ne,{content:0},Pd)}}function Dd(i){le(i,"svelte-ozpg4a",".floorplan-plugin__base-image.svelte-ozpg4a{position:absolute;z-index:10;width:100%;height:100%;pointer-events:none}")}function Ld(i){let t,e;return t=new Ed({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||(P(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function Sd(i){let t,e;return t=new xd({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||(P(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function Md(i){let t,e,n,o;const s=[Sd,Ld],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){M(l,t,c),~e&&r[e].m(t,null),o=!0},p(l,[c]){let u=e;e=a(l),e===u?~e&&r[e].p(l,c):(n&&(se(),D(r[u],1,1,()=>{r[u]=null}),re()),~e?(n=r[e],n?n.p(l,c):(n=r[e]=s[e](l),n.c()),P(n,1),n.m(t,null)):n=null)},i(l){o||(P(n),o=!0)},o(l){D(n),o=!1},d(l){l&&L(t),~e&&r[e].d()}}}function Td(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 sl extends oe{constructor(t){super(),ie(this,t,Td,Md,ne,{floorIndex:2,floorplanData:3},Dd)}}function zd(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 Bd(i){let t,e=i[8].outerHTML+"",n;return{c(){t=new ti(!1),n=ge(),t.a=n},m(o,s){t.m(e,o,s),M(o,n,s)},p(o,s){s&256&&e!==(e=o[8].outerHTML+"")&&t.p(e)},d(o){o&&L(n),o&&t.d()}}}function Vd(i){let t,e,n=i[1]&&Yo(i),o=i[0]&&Uo(i);return{c(){n&&n.c(),t=ee(),o&&o.c(),e=ge()},m(s,r){n&&n.m(s,r),M(s,t,r),o&&o.m(s,r),M(s,e,r)},p(s,r){s[1]?n?n.p(s,r):(n=Yo(s),n.c(),n.m(t.parentNode,t)):n&&(n.d(1),n=null),s[0]?o?o.p(s,r):(o=Uo(s),o.c(),o.m(e.parentNode,e)):o&&(o.d(1),o=null)},d(s){n&&n.d(s),s&&L(t),o&&o.d(s),s&&L(e)}}}function Yo(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){M(o,t,s),V(t,n)},p(o,s){s&4&&e!==(e=o[2].name+"")&&Me(n,e)},d(o){o&&L(t)}}}function Uo(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){M(n,t,o),V(t,e)},p(n,o){o&128&&Me(e,n[7])},d(n){n&&L(t)}}}function jd(i){let t,e,n;function o(a,l){if(a[3]===void 0)return Vd;if(a[8])return Bd}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){M(a,t,l),r&&r.m(t,null),e||(n=[ct(an.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:Y,o:Y,d(a){a&&L(t),r&&r.d(),e=!1,Ge(n)}}}function Od(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 Rd(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(O,S){if(S.width===0||S.height===0)return()=>!1;const Q=O.path.map(({x:de,y:pe})=>[de,pe]),_=O.roomLabel.position,{x:X,y:W}=_,{width:$,height:U}=S,ae=$/2,he=U/2;return function(pe){const Pe=X*pe,ke=W*pe,Te=Q.map(([Ae,Ee])=>[Ae*pe,Ee*pe]);return[[Pe+ae,ke-he],[Pe-ae,ke-he],[Pe-ae,ke+he],[Pe+ae,ke+he]].every(Ae=>Od(Ae,Te))}}const v=document.body.clientWidth,b=document.body.clientHeight,w=h.roomLabel,k=w.positionInImage.x*100+"%",I=w.positionInImage.y*100+"%",C=(v<500||b<500?10:14)+"px";let T=0,x=0,H=!1;d.subscribe(function(S){e(16,H=!!S&&S.id===h.id)});const N=O=>{e(4,T=O.detail)},R=O=>{e(5,x=O.detail)};return i.$$set=O=>{"pxmm"in O&&e(12,l=O.pxmm),"roomAreaEnable"in O&&e(0,c=O.roomAreaEnable),"roomNameEnable"in O&&e(1,u=O.roomNameEnable),"room"in O&&e(2,h=O.room),"hoveredRoom"in O&&e(13,d=O.hoveredRoom),"getRoomAreaText"in O&&e(14,m=O.getRoomAreaText),"getLabelElement"in O&&e(3,g=O.getLabelElement),"adaptiveRoomLabelVisibleEnable"in O&&e(15,p=O.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:T,height:x}),i.$$.dirty&262148&&e(17,r=s?A(h,s):void 0),i.$$.dirty&233472&&e(6,a=p?H?!0:!!(r!=null&&r(l)):!0)},[c,u,h,g,T,x,a,o,n,k,I,C,l,d,m,p,H,r,s,N,R]}class Fd extends oe{constructor(t){super(),ie(this,t,Rd,jd,ne,{pxmm:12,roomAreaEnable:0,roomNameEnable:1,room:2,hoveredRoom:13,getRoomAreaText:14,getLabelElement:3,adaptiveRoomLabelVisibleEnable:15},zd)}}function Qd(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 qo(i,t,e){const n=i.slice();return n[12]=t[e],n}function Jo(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=qo(i,a,c),h=l(u);n.set(h,e[c]=Zo(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){M(c,t,u);for(let h=0;h<e.length;h+=1)e[h].m(t,null);o=!0,s||(r=[ct(an.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,Pt,Zo,null,qo),re())},i(c){if(!o){for(let u=0;u<a.length;u+=1)P(e[u]);o=!0}},o(c){for(let u=0;u<e.length;u+=1)D(e[u]);o=!1},d(c){c&&L(t);for(let u=0;u<e.length;u+=1)e[u].d();s=!1,Ge(r)}}}function Zo(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 Fd({props:r}),{key:i,first:null,c(){e=ge(),K(n.$$.fragment),this.first=e},m(a,l){M(a,e,l),J(n,a,l),o=!0},p(a,l){t=a;const c=l&447?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||(P(n.$$.fragment,a),o=!0)},o(a){D(n.$$.fragment,a),o=!1},d(a){a&&L(e),Z(n,a)}}}function Hd(i){let t,e,n=i[8]&&Jo(i);return{c(){n&&n.c(),t=ge()},m(o,s){n&&n.m(o,s),M(o,t,s),e=!0},p(o,[s]){o[8]?n?(n.p(o,s),s&256&&P(n,1)):(n=Jo(o),n.c(),P(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(P(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&L(t)}}}function _d(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 Gd extends oe{constructor(t){super(),ie(this,t,_d,Hd,ne,{floorIndex:9,roomAreaEnable:0,roomNameEnable:1,floorplanData:10,hoveredRoom:2,getRoomAreaText:3,getLabelElement:4,adaptiveRoomLabelVisibleEnable:5},Qd)}}function Wd(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 Ko(i,t,e){const n=i.slice();return n[11]=t[e],n[13]=e,n}function $o(i,t,e){const n=i.slice();return n[14]=t[e],n}function es(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){M(e,t,n)},p:Y,d(e){e&&L(t)}}}function ts(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=ee(),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){M(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)+"")&&Me(s,o)},d(a){a&&L(e)}}}function Nd(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]=es($o(i,u,g));let d=i[4];const m=g=>g[13];for(let g=0;g<d.length;g+=1){let p=Ko(i,d,g),A=m(p);l.set(A,a[g]=ts(A,p))}return{c(){t=B("div"),e=B("div"),n=ee(),o=B("div");for(let g=0;g<h.length;g+=1)h[g].c();s=ee(),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){M(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=$o(g,u,A);h[A]?h[A].p(v,p):(h[A]=es(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,ts,null,Ko)),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:Y,o:Y,d(g){g&&L(t),ut(h,g);for(let p=0;p<a.length;p+=1)a[p].d()}}}const Ot=1e3,Rt=180;function Xd(i,t,e){let{type:n}=t,{data:o}=t,{bounding:s}=t,{getRuleDistanceText:r}=t;const a=n==="top"||n==="bottom",l=s.max.x-s.min.x-(Ot-Rt)*2,c=s.max.y-s.min.y-(Ot-Rt)*2,u=o.map(([g,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-Ot+Rt)/l:0,A=a?0:(g-s.min.y-Ot+Rt)/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-Ot+Rt)/l:0,k=a?0:(b-s.min.y-Ot+Rt)/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 Yd extends oe{constructor(t){super(),ie(this,t,Xd,Nd,ne,{type:0,data:5,bounding:6,getRuleDistanceText:1},Wd)}}function Ud(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 ns(i,t,e){const n=i.slice();return n[13]=t[e][0],n[14]=t[e][1],n}function is(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 Yd({props:r}),{key:i,first:null,c(){e=ge(),K(n.$$.fragment),this.first=e},m(a,l){M(a,e,l),J(n,a,l),o=!0},p(a,l){t=a;const c=l&19?Qe(s,[{type:t[13],data:t[14],bounding:t[1],getRuleDistanceText:t[0]}]):{};n.$set(c)},i(a){o||(P(n.$$.fragment,a),o=!0)},o(a){D(n.$$.fragment,a),o=!1},d(a){a&&L(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=ns(i,s,a),c=r(l);n.set(c,e[a]=is(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){M(a,t,l);for(let c=0;c<e.length;c+=1)e[c].m(t,null);o=!0},p(a,[l]){l&19&&(s=a[4],se(),e=Ke(e,l,r,1,a,s,n,t,Pt,is,null,ns),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)P(e[l]);o=!0}},o(a){for(let l=0;l<e.length;l+=1)D(e[l]);o=!1},d(a){a&&L(t);for(let l=0;l<e.length;l+=1)e[l].d()}}}const os=1e3,ss=180;function Jd(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-(os-ss)*2),i.$$.dirty&2&&e(8,u=n.max.y-n.min.y-(os-ss)*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 Zd extends oe{constructor(t){super(),ie(this,t,Jd,qd,ne,{floorIndex:5,floorplanData:6,getRuleDistanceText:0},Ud)}}function yi(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 rl({x:i,y:t},e){const{max:n,min:o}=e;return{x:i-o.x,y:n.y-t}}function Kd(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 $d(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 eh(i,t){return Math.max(...t.work.observers.map(n=>i.z>=n.standingPosition.z?n.floorIndex:0))}function th(i){let t;return{c(){t=we("path"),y(t,"d",i[0]),y(t,"fill","#2F313A")},m(e,n){M(e,t,n)},p(e,[n]){n&1&&y(t,"d",e[0])},i:Y,o:Y,d(e){e&&L(t)}}}function nh(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=yi(o,{needZ:!0}))},[n,o]}class ih extends oe{constructor(t){super(),ie(this,t,nh,th,ne,{path:1})}}function oh(i){let t,e,n,o,s,r;return{c(){t=we("defs"),e=we("pattern"),n=we("rect"),o=we("path"),s=ee(),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){M(a,t,l),V(t,e),V(e,n),V(e,o),M(a,s,l),M(a,r,l)},p(a,[l]){l&1&&y(r,"d",a[0])},i:Y,o:Y,d(a){a&&L(t),a&&L(s),a&&L(r)}}}const Bi=6;function sh(i,t,e){let n,{path:o}=t;const s=Bi*2,r=`M0 ${Bi} h ${s} M${Bi} 0 v ${s}`;return i.$$set=a=>{"path"in a&&e(3,o=a.path)},i.$$.update=()=>{i.$$.dirty&8&&e(0,n=yi(o,{needZ:!0}))},[n,s,r,o]}class rh extends oe{constructor(t){super(),ie(this,t,sh,oh,ne,{path:3})}}function ah(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=ee(),a=we("path"),l=ee(),c=we("path"),u=ee(),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){M(d,t,m),V(t,e),V(e,n),V(t,o),V(o,s),M(d,r,m),M(d,a,m),M(d,l,m),M(d,c,m),M(d,u,m),M(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:Y,o:Y,d(d){d&&L(t),d&&L(r),d&&L(a),d&&L(l),d&&L(c),d&&L(u),d&&L(h)}}}function lh(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=yi(o,{needZ:!0}))},[n,o]}class ch extends oe{constructor(t){super(),ie(this,t,lh,ah,ne,{path:1})}}function uh(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 rs(i,t,e){const n=i.slice();return n[5]=t[e],n}function dh(i){let t,e;return t=new rh({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||(P(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function hh(i){let t,e;return t=new ch({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||(P(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function fh(i){let t,e;return t=new ih({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||(P(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function as(i){let t,e,n,o;const s=[fh,hh,dh],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){M(l,t,c),r[e].m(t,null),o=!0},p(l,c){let u=e;e=a(l),e===u?r[e].p(l,c):(se(),D(r[u],1,1,()=>{r[u]=null}),re(),n=r[e],n?n.p(l,c):(n=r[e]=s[e](l),n.c()),P(n,1),n.m(t,null))},i(l){o||(P(n),o=!0)},o(l){D(n),o=!1},d(l){l&&L(t),r[e].d()}}}function mh(i){let t,e,n=i[0],o=[];for(let r=0;r<n.length;r+=1)o[r]=as(rs(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){M(r,t,a);for(let l=0;l<o.length;l+=1)o[l].m(t,null);e=!0},p(r,[a]){if(a&7){n=r[0];let l;for(l=0;l<n.length;l+=1){const c=rs(r,n,l);o[l]?(o[l].p(c,a),P(o[l],1)):(o[l]=as(c),o[l].c(),P(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)P(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&&L(t),ut(o,r)}}}function gh(i,t,e){let n,{floorIndex:o}=t,{floorplanData:s}=t;const r=s.bounding.max.x-s.bounding.min.x,a=s.bounding.max.y-s.bounding.min.y;return i.$$set=l=>{"floorIndex"in l&&e(3,o=l.floorIndex),"floorplanData"in l&&e(4,s=l.floorplanData)},i.$$.update=()=>{i.$$.dirty&24&&e(0,n=s.floorDatas[o].rooms.map(l=>fe(F({},l),{path:l.path.map(c=>rl(c,s.bounding))})))},[n,r,a,o,s]}class ph extends oe{constructor(t){super(),ie(this,t,gh,mh,ne,{floorIndex:3,floorplanData:4},uh)}}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 vh(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){M(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:Y,o:Y,d(s){s&&L(t),n=!1,Ge(o)}}}function bh(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=yi(s.path,{needZ:!0,format:g=>rl(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 yh extends oe{constructor(t){super(),ie(this,t,bh,vh,ne,{room:0,floorIndex:1,floorplanData:6,hoveredRoom:7,highlightData:8},Ah)}}function wh(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 ls(i,t,e){const n=i.slice();return n[6]=t[e],n}function cs(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 yh({props:r}),{key:i,first:null,c(){e=ge(),K(n.$$.fragment),this.first=e},m(a,l){M(a,e,l),J(n,a,l),o=!0},p(a,l){t=a;const c=l&15?Qe(s,[{room:t[6],floorplanData:t[1],hoveredRoom:t[2],floorIndex:t[0],highlightData:t[3]}]):{};n.$set(c)},i(a){o||(P(n.$$.fragment,a),o=!0)},o(a){D(n.$$.fragment,a),o=!1},d(a){a&&L(e),Z(n,a)}}}function Ch(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=ls(i,r,l),u=a(c);o.set(u,n[l]=cs(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){M(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,Pt,cs,null,ls),re())},i(l){if(!s){for(let c=0;c<r.length;c+=1)P(n[c]);s=!0}},o(l){for(let c=0;c<n.length;c+=1)D(n[c]);s=!1},d(l){l&&L(t);for(let c=0;c<n.length;c+=1)n[c].d()}}}function Eh(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 al extends oe{constructor(t){super(),ie(this,t,Eh,Ch,ne,{floorIndex:0,floorplanData:1,hoveredRoom:2,highlightData:3},wh)}}function Ph(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 us(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 al({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||(P(t.$$.fragment,s),e=!0)},o(s){D(t.$$.fragment,s),e=!1},d(s){Z(t,s)}}}function ds(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 Gd({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||(P(t.$$.fragment,s),e=!0)},o(s){D(t.$$.fragment,s),e=!1},d(s){Z(t,s)}}}function hs(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 Zd({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||(P(t.$$.fragment,s),e=!0)},o(s){D(t.$$.fragment,s),e=!1},d(s){Z(t,s)}}}function Ih(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 ph({props:h});let d=(i[2]||i[3])&&us(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 sl({props:g});let p=i[4]&&ds(i),A=i[7]&&hs(i);return{c(){t=B("div"),K(e.$$.fragment),n=ee(),d&&d.c(),o=ee(),K(s.$$.fragment),r=ee(),p&&p.c(),a=ee(),A&&A.c(),y(t,"class",l=Ie(`floorplan-plugin__floor${i[0]?" floorplan-plugin__floor--is-current":""}`)+" svelte-bl8zrz")},m(v,b){M(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&&P(d,1)):(d=us(v),d.c(),P(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&&P(p,1)):(p=ds(v),p.c(),P(p,1),p.m(t,a)):p&&(se(),D(p,1,1,()=>{p=null}),re()),v[7]?A?(A.p(v,b),b&128&&P(A,1)):(A=hs(v),A.c(),P(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||(P(e.$$.fragment,v),P(d),P(s.$$.fragment,v),P(p),P(A),c=!0)},o(v){D(e.$$.fragment,v),D(d),D(s.$$.fragment,v),D(p),D(A),c=!1},d(v){v&&L(t),Z(e),d&&d.d(),Z(s),p&&p.d(),A&&A.d()}}}function kh(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=bo(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 xh extends oe{constructor(t){super(),ie(this,t,kh,Ih,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},Ph)}}function Dh(i){le(i,"svelte-86bqav",".floorplan-main.svelte-86bqav{width:100%;height:100%;pointer-events:none}")}function fs(i,t,e){const n=i.slice();return n[21]=t[e],n}function ms(i){let t,e,n,o,s,r=i[13].floorDatas,a=[];for(let h=0;h<r.length;h+=1)a[h]=gs(fs(i,r,h));const l=h=>D(a[h],1,1,()=>{a[h]=null});let c=i[5]&&ps(i),u=i[8]&&As(i);return{c(){t=B("div");for(let h=0;h<a.length;h+=1)a[h].c();e=ee(),c&&c.c(),n=ee(),u&&u.c(),y(t,"class","floorplan-main svelte-86bqav")},m(h,d){M(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=fs(i,r,m);a[m]?(a[m].p(g,d),P(a[m],1)):(a[m]=gs(g),a[m].c(),P(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&&P(c,1)):(c=ps(i),c.c(),P(c,1),c.m(t,n)):c&&(se(),D(c,1,1,()=>{c=null}),re()),i[8]?u?(u.p(i,d),d&256&&P(u,1)):(u=As(i),u.c(),P(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)P(a[d]);P(c),P(u),o||Fe(()=>{o=Mt(t,St,{duration:i[0],easing:At}),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&&L(t),ut(a,h),c&&c.d(),u&&u.d()}}}function gs(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 xh({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||(P(t.$$.fragment,s),e=!0)},o(s){D(t.$$.fragment,s),e=!1},d(s){Z(t,s)}}}function ps(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 hd({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||(P(t.$$.fragment,s),e=!0)},o(s){D(t.$$.fragment,s),e=!1},d(s){Z(t,s)}}}function As(i){let t,e;return t=new bd({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||(P(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function Lh(i){let t,e,n=i[1]&&ms(i);return{c(){n&&n.c(),t=ge()},m(o,s){n&&n.m(o,s),M(o,t,s),e=!0},p(o,[s]){o[1]?n?(n.p(o,s),s&2&&P(n,1)):(n=ms(o),n.c(),P(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(P(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&L(t)}}}function Sh(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:C}=t,{highlightData:T}=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,C=x.adaptiveRoomLabelVisibleEnable),"highlightData"in x&&e(20,T=x.highlightData)},[n,o,s,r,a,l,c,u,h,d,m,g,p,A,v,b,w,k,I,C,T]}class yo extends oe{constructor(t){super(),ie(this,t,Sh,Lh,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},Dh)}}const Mh="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC0AAAAwCAYAAACFUvPfAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAALaADAAQAAAABAAAAMAAAAADe2FZjAAAEF0lEQVRoBe2WzWskRRiHf13V092TxI2oEzYeVDwITtyDuCiihwiCePGgxIM3vYgHL4J4UIhBRA8i/gPqyUvWg7AiIuIeloDiYUHJLO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1hTEluJy7XUejGUQNLMbAmTdWY1rKBLW3aTJqBZ7nZkb36DhYCreeYHbMUXHvaYi5XDK70EcgulmRjm77wNtenzuXCbmnTRaAx493rbGf3Jr/njMzj920CnKdUaFCjlDioy7NYNvOdGrQJNgI32/L2tkXfFPlxgToqjWVhD6KdLnQRdARf/HHQz2r2X2Gqy8pAZaAyUBmoDFQGKgP/q4F/AJYg9/s0ZoABAAAAAElFTkSuQmCC";function Th(i){return G(this,null,function*(){const t=new Headers({"Content-Type":"text/plain"}),e=function(o){return G(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 zh(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 Bh(i){return{floorName:i.floor_name,floorIndex:i.floor_index,rooms:i.rooms.map(zh),rules:i.rules}}function Vh(i){return{index:i.index,floorIndex:i.floor_index,position:i.position,positionInImage:i.position_in_image}}function jh(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 G(this,null,function*(){const t=yield Th(i.outlines),e=i.computed_data.bounding,n=i.computed_data.floor_datas.map(Bh),o=i.computed_data.entrance?jh(i.computed_data.entrance):null;return{outlines:t,entrance:o,bounding:e,floorDatas:n,observers:i.computed_data.observers.map(Vh)}})}function Oh(i,t,e){return i.map(o=>{const s=o.position,r=o.icon?o.icon:{url:Mh,width:45,height:48},a=eh(s,t),l=Kd(s,e),c=$d(l,e);return{floorIndex:a,icon:r,id:o.id,position:l,positionInImage:c}})}function Rh(i,t){return t(i),i}function wi(i,t){return Rh({},e=>{for(const n in i)t.indexOf(n)===-1&&(e[n]=i[n])})}function vs(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 wo(i,t,e=gt.BOUNDING_CENTER){const n=vs(i,t),o=vs(i,t+1);return e===gt.BOUNDING_CENTER?(i.model.bounding.max.y+i.model.bounding.min.y)/2:e===gt.CEILING?o:n}function Co(i,t,e,n){const o=wo(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 xn{constructor(t,e){f(this,"VERSION","2.16.0-4");f(this,"five");f(this,"hooks",new Jt);f(this,"staticPrefix","//vrlab-static.ljcdn.com");this.five=t,e!=null&&e.staticPrefix&&(this.staticPrefix=e.staticPrefix)}getCurrentState(){return this.state}isAbsoluteURL(t){return ho(t)?t:`${this.staticPrefix}${t}`}}class Tt extends xn{}var We=(i=>(i.UnknownError="UnknownError",i.DataNotLoaded="DataNotLoaded",i.BreakOffByHide="BreakOffByHide",i.BreakOffByDisable="BreakOffByDisable",i.ModelNotLoaded="ModelNotLoaded",i.ChangeModeError="ChangeModeError",i.UpdateCameraError="UpdateCameraError",i))(We||{});const ll=500,Fh=80;function no(i,t,e=4){return Math.floor(i*Math.pow(10,e))===Math.floor(t*Math.pow(10,e))}function cl(i,t){return G(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"?no(u,h,2):u===h}):!0})()||n(new Error("five pose \u4E0E\u9884\u671F\u4E0D\u7B26")),e()})})})}function Eo(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!(!no(e,s,2)||!no(n,r,2)||o!==a)}function ul(i,t,e=!0){return G(this,null,function*(){if(Eo(i,t)===!0)return;const o=i.getCurrentState();if(o.mode!==t.mode){const[u]=yield li(cl(i,[t.mode,t,void 0,e]));if(u)throw new Error(We.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 li(i.updateCamera(t,l,e));if(c)throw new Error(We.UpdateCameraError)})}function Yt(i,t,e=300){const n=i.getElement();!n||(n.style.opacity=t+"",n.style.transition=e===0?"none":`opacity ${e}ms linear`,e!==0&&Promise.race([new Promise(o=>n.addEventListener("transitionend",o,{once:!0})),new Promise(o=>setTimeout(o,e))]).then(()=>{n.style.transition="none"}))}function Qh(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 Hh(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 _h extends Tt{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)=>G(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)=>G(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||!Eo(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=Co(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,We.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=>G(this,null,function*(){var r;if(!this.state.enabled)return;if(!((r=this.five.model)!=null&&r.loaded))throw new Error(We.ModelNotLoaded);if(!this.data)throw new Error(We.DataNotLoaded);this.isHiddenByHideFunc=!1;const n={floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},o=F(F({},n),e),s=()=>G(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 li(ul(this.five,this.showState,o.userAction));if(c)throw c;if(a)throw l?new Error(l):new Error(We.UnknownError);this.updateSize(),this.floorIndex=o.floorIndex,this.five.model.show(this.floorIndex);const u=o.modelOpacity,h=o.immediately?0:ll;Yt(this.five,u,h),this.render(h)});return this.showPromise=s().then(()=>{this.hooks.emit("showAnimationEnded",{auto:o.isAutoShow,userAction:o.userAction})}).catch(a=>{if(this.updateState({visible:!1},o.userAction),!o.isAutoShow&&a instanceof Error)throw a}).finally(()=>{this.showPromise=void 0,this.showRejection=void 0}),this.showPromise}));f(this,"_hide",e=>{var s;(s=this.showRejection)==null||s.call(this,We.BreakOffByHide),this.showPromise=void 0;const o=F(F({},{userAction:!0,isAutoHide:!1}),e);Yt(this.five,1,0),this.hooks.emit("hide",{auto:o.isAutoHide,userAction:o.userAction}),this.render()});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||Hh(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();Qh(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:Fh/((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:gt.BOUNDING_CENTER,getLabelElement:void 0,getRoomAreaText:l=>(l/1e6).toFixed(1)+"\u33A1",getRuleDistanceText:l=>l.toString()},s=n?wi(n,["selector","scale"]):{},r=F(F({},o),s);this.state={enabled:!0,visible:!1,config:r},this.initContainer(),e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}load(e,n,o=!0){return G(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 G(this,null,function*(){return yield yt(e.data)})}updateState(e,n){const o=this.state,s=e.config?F(F({},o.config),e.config):o.config;this.state=fe(F(F({},this.state),e),{config:s}),!nt(this.state,o,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n})}initContainer(){this.container.classList.add("floorplan-plugin"),Object.assign(this.container.style,{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",zIndex:10,pointerEvents:"none"}),this.five.addExtraElement(this.container)}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;const e=this.five;e.on("modeChange",this.onFiveModeChange),e.on("interiaPan",this.onFiveInteriaPan),e.on("panoArrived",this.onFivePanoArrived),e.on("cameraUpdate",this.onFiveCameraUpdate),e.on("wantsGesture",this.onFiveWantsGesture),e.on("wantsPanGesture",this.onFiveWantsPanGesture),e.on("wantsTapGesture",this.onFiveWantsTapGesture),e.on("wantsChangeMode",this.onFiveWantsChangeMode),e.on("modelShownFloorChange",this.onModelShownFloorChange)}removeEventListener(){const e=this.five;this.hasAddedEventListener=!1,e.off("modelLoaded",this.onFiveModelLoaded),e.off("modeChange",this.onFiveModeChange),e.off("interiaPan",this.onFiveInteriaPan),e.off("panoArrived",this.onFivePanoArrived),e.off("cameraUpdate",this.onFiveCameraUpdate),e.off("wantsGesture",this.onFiveWantsGesture),e.off("wantsPanGesture",this.onFiveWantsPanGesture),e.off("wantsTapGesture",this.onFiveWantsTapGesture),e.off("wantsChangeMode",this.onFiveWantsChangeMode),e.off("modelShownFloorChange",this.onModelShownFloorChange)}render(e){if(!this.state.enabled||!this.container||!this.data||this.size.width===0)return;const n=fe(F({},this.state.config),{visible:this.state.visible,duration:e!=null?e:0,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude,highlightData:this.highlightData});if(this.app)return this.app.$set(n);this.app=new yo({target:this.container,intro:!0,props:n})}}const Gh=(i,t)=>new _h(i,t);function Wh(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 Nh(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 Xh extends Tt{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)=>G(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)=>G(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||!Eo(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=Co(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,We.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=>G(this,null,function*(){var r;if(!this.state.enabled)return;if(!((r=this.five.model)!=null&&r.loaded))throw new Error(We.ModelNotLoaded);if(!this.data)throw new Error(We.DataNotLoaded);this.isHiddenByHideFunc=!1;const n={floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},o=F(F({},n),e),s=()=>G(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 li(ul(this.five,this.showState,o.userAction));if(c)throw c;if(a)throw l?new Error(l):new Error(We.UnknownError);this.updateSize(),this.updatePosition(),this.floorIndex=o.floorIndex,this.five.model.show(this.floorIndex);const u=o.modelOpacity,h=o.immediately?0:ll;Yt(this.five,u,h),this.render(h)});return this.showPromise=s().then(()=>{this.hooks.emit("showAnimationEnded",{auto:o.isAutoShow,userAction:o.userAction})}).catch(a=>{if(this.updateState({visible:!1},o.userAction),!o.isAutoShow&&a instanceof Error)throw a}).finally(()=>{this.showPromise=void 0,this.showRejection=void 0}),this.showPromise}));f(this,"_hide",e=>{var s;(s=this.showRejection)==null||s.call(this,We.BreakOffByHide),this.showPromise=void 0;const o=F(F({},{userAction:!0,isAutoHide:!1}),e);Yt(this.five,1,0),this.hooks.emit("hide",{auto:o.isAutoHide,userAction:o.userAction}),this.render()});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(),Wh(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:(Nh(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:gt.BOUNDING_CENTER,getLabelElement:void 0,adaptiveRoomLabelVisibleEnable:!0,getRoomAreaText:a=>(a/1e6).toFixed(1)+"\u33A1",getRuleDistanceText:a=>a.toString()},s=n?wi(n,["selector","scale"]):{},r=F(F({},o),s);this.state={enabled:!0,visible:!1,config:r},this.initContainer(),e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}load(e,n,o=!0){return G(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=wo(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 G(this,null,function*(){return yield yt(e.data)})}updateState(e,n){const o=this.state,s=e.config?F(F({},o.config),e.config):o.config;this.state=fe(F(F({},this.state),e),{config:s}),!nt(this.state,o,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n})}initContainer(){this.container.classList.add("floorplan-plugin"),Object.assign(this.container.style,{position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",zIndex:10,pointerEvents:"none"}),this.five.addExtraElement(this.container)}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;const e=this.five;e.on("modeChange",this.onFiveModeChange),e.on("panoArrived",this.onFivePanoArrived),e.on("cameraUpdate",this.onFiveCameraUpdate),e.on("wantsPanGesture",this.onFiveWantsPanGesture),e.on("wantsTapGesture",this.onFiveWantsTapGesture),e.on("wantsChangeMode",this.onFiveWantsChangeMode),e.on("modelShownFloorChange",this.onModelShownFloorChange)}removeEventListener(){const e=this.five;this.hasAddedEventListener=!1,e.off("modelLoaded",this.onFiveModelLoaded),e.off("modeChange",this.onFiveModeChange),e.off("panoArrived",this.onFivePanoArrived),e.off("cameraUpdate",this.onFiveCameraUpdate),e.off("wantsPanGesture",this.onFiveWantsPanGesture),e.off("wantsTapGesture",this.onFiveWantsTapGesture),e.off("wantsChangeMode",this.onFiveWantsChangeMode),e.off("modelShownFloorChange",this.onModelShownFloorChange)}render(e){if(!this.state.enabled||!this.container||!this.data||this.size.width===0)return;const n=fe(F({},this.state.config),{visible:this.state.visible,duration:e!=null?e:0,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude,highlightData:this.highlightData});if(this.app)return this.app.$set(n);this.app=new yo({target:this.container,intro:!0,props:n})}}const Yh=(i,t)=>new Xh(i,t);class Uh extends Tt{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=Co(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:gt.BOUNDING_CENTER,getLabelElement:void 0,adaptiveRoomLabelVisibleEnable:!0,getRoomAreaText:a=>(a/1e6).toFixed(1)+"\u33A1",getRuleDistanceText:a=>a.toString()},s=n?wi(n,["selector","scale"]):{},r=F(F({},o),s);this.state={enabled:!0,visible:!1,config:r},this.initContainer(),e.model.loaded?this.onFiveModelLoaded():e.once("modelLoaded",this.onFiveModelLoaded),e.once("dispose",this.dispose),this.addEventListener()}load(e,n,o=!0){return G(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=wo(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 G(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 G(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 G(this,null,function*(){return yield yt(e.data)})}_show(e){return G(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 cl(this.five,["Topview",void 0,void 0,n])),this.five.model.show(this.floorIndex),this.updatePosition(),this.updateSize();const o=500,s=this.state.config.modelOpacity;Yt(this.five,s,o),this.hooks.emit("showAnimationEnded",{userAction:n,auto:!1}),this.render()})}_hide(e){return G(this,null,function*(){if(!this.state.enabled)return;const{userAction:n}=e;this.hooks.emit("hide",{userAction:n,auto:!1});const o=1,s=0;Yt(this.five,o,s),this.render()})}_enable(e){const{userAction:n}=e;this.addEventListener(),this.wrapper&&this.wrapper.append(this.container),this.hooks.emit("enable",{userAction:n}),this.state.visible&&this._show({userAction:n})}updateState(e,n){const o=this.state,s=e.config?F(F({},o.config),e.config):o.config;this.state=fe(F(F({},this.state),e),{config:s}),!nt(this.state,o,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n})}addEventListener(){if(!this.state.enabled||this.hasAddedEventListener)return;const e=this.five;e.on("modeChange",this.onFiveModeChange),e.on("panoArrived",this.onFivePanoArrived),e.on("cameraUpdate",this.onFiveCameraUpdate),e.on("wantsGesture",this.onFiveWantsGesture),e.on("wantsMoveToPano",this.onFiveWantsMoveToPano),e.on("initAnimationEnded",this.onFiveInitAnimationEnded),e.on("modelShownFloorChange",this.onModelShownFloorChange)}removeEventListener(){const e=this.five;this.hasAddedEventListener=!1,e.off("modeChange",this.onFiveModeChange),e.off("panoArrived",this.onFivePanoArrived),e.off("cameraUpdate",this.onFiveCameraUpdate),e.off("wantsGesture",this.onFiveWantsGesture),e.off("wantsMoveToPano",this.onFiveWantsMoveToPano),e.off("initAnimationEnded",this.onFiveInitAnimationEnded),e.off("modelShownFloorChange",this.onModelShownFloorChange)}initContainer(){this.container.classList.add("floorplan-plugin"),Object.assign(this.container.style,{position:"absolute",left:"50%",top:"50%",transform:"translate3d(-50%, -50%, 10px)",zIndex:10,pointerEvents:"none","will-change":"width, height"}),this.five.addExtraElement(this.container)}render(e){if(!this.state.enabled||!this.container||!this.data||this.size.width===0)return;const n=fe(F({},this.state.config),{visible:this.state.visible,duration:e!=null?e:0,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude,highlightData:this.highlightData});if(this.app)return this.app.$set(n);this.app=new yo({target:this.container,intro:!0,props:n})}}const qh=(i,t)=>new Uh(i,t);function Po(i,t=200){let e;return function(...n){e||(i(...n),e=setTimeout(function(){e=null},t))}}function Jh(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 Zh(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){M(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:Y,o:Y,d(o){o&&L(t)}}}function Kh(i){return`rotate(${Math.floor(i/Math.PI*180)*-1+45}deg)`}function $h(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=Po(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=Kh(u))},[l,o,n,s,r,a,c,u]}class ef extends oe{constructor(t){super(),ie(this,t,$h,Zh,ne,{five:3,pxmm:4,floorplanData:5,cameraImageUrl:0},Jh)}}function tf(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 bs(i,t,e){const n=i.slice();return n[1]=t[e],n}function ys(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=ee(),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){M(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&&L(e)}}}function nf(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=bs(i,o,r),l=s(a);n.set(l,e[r]=ys(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){M(r,t,a);for(let l=0;l<e.length;l+=1)e[l].m(t,null)},p(r,[a]){a&1&&(o=r[0],e=Ke(e,a,s,1,r,o,n,t,Ao,ys,null,bs))},i:Y,o:Y,d(r){r&&L(t);for(let a=0;a<e.length;a+=1)e[a].d()}}}function of(i,t,e){let{extraObjects:n=[]}=t;return i.$$set=o=>{"extraObjects"in o&&e(0,n=o.extraObjects)},[n]}class sf extends oe{constructor(t){super(),ie(this,t,of,nf,ne,{extraObjects:0},tf)}}function ws(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 al({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||(P(t.$$.fragment,s),e=!0)},o(s){D(t.$$.fragment,s),e=!1},d(s){Z(t,s)}}}function rf(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 sl({props:l}),n=new sf({props:{extraObjects:i[6]}});let c=i[3]&&ws(i);return{c(){K(t.$$.fragment),e=ee(),K(n.$$.fragment),o=ee(),c&&c.c(),s=ge()},m(u,h){J(t,u,h),M(u,e,h),J(n,u,h),M(u,o,h),c&&c.m(u,h),M(u,s,h),r=!0},p(u,[h]){const d=h&20?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&&P(c,1)):(c=ws(u),c.c(),P(c,1),c.m(s.parentNode,s)):c&&(se(),D(c,1,1,()=>{c=null}),re())},i(u){r||(P(t.$$.fragment,u),P(n.$$.fragment,u),P(c),r=!0)},o(u){D(t.$$.fragment,u),D(n.$$.fragment,u),D(c),r=!1},d(u){Z(t,u),u&&L(e),Z(n,u),u&&L(o),c&&c.d(u),u&&L(s)}}}function af(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 lf extends oe{constructor(t){super(),ie(this,t,af,rf,ne,{five:0,pxmm:1,floorIndex:2,hoverEnable:3,floorplanData:4,extraObjects:8,highlightData:5})}}function cf(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&&Es(i);return{c(){t=B("div"),s&&s.c(),y(t,"class","plugin-floorplan-radar svelte-1mvqyqq")},m(r,a){M(r,t,a),s&&s.m(t,null),e=!0,n||(o=[ct(an.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&&P(s,1)):(s=Es(r),s.c(),P(s,1),s.m(t,null)):s&&(se(),D(s,1,1,()=>{s=null}),re())},i(r){e||(P(s),e=!0)},o(r){D(s),e=!1},d(r){r&&L(t),s&&s.d(),n=!1,Ge(o)}}}function Es(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 lf({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 ef({props:h}),{c(){t=B("div"),K(e.$$.fragment),n=ee(),K(o.$$.fragment),y(t,"class","plugin-floorplan-radar-container svelte-1mvqyqq"),z(t,"width",s),z(t,"height",r)},m(d,m){M(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||(P(e.$$.fragment,d),P(o.$$.fragment,d),a=!0)},o(d){D(e.$$.fragment,d),D(o.$$.fragment,d),a=!1},d(d){d&&L(t),Z(e),Z(o)}}}function uf(i){let t,e,n=i[1]&&Cs(i);return{c(){n&&n.c(),t=ge()},m(o,s){n&&n.m(o,s),M(o,t,s),e=!0},p(o,[s]){o[1]?n?(n.p(o,s),s&2&&P(n,1)):(n=Cs(o),n.c(),P(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(P(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&L(t)}}}function df(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:C,min:T}=r.bounding,x=C.x-T.x,H=C.y-T.y,N=function(){return x>H?[I,I/x*H]:[I/H*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 hf extends oe{constructor(t){super(),ie(this,t,df,uf,ne,{five:0,visible:1,hoverEnable:2,floorplanData:3,cameraImageUrl:4,extraObjects:5,highlightData:6},cf)}}class ff extends Tt{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=F(F({},o),s);this.state={enabled:!0,visible:!0,config:r},n!=null&&n.wrapper&&console.warn("\u4E0D\u63A8\u8350\u7EE7\u7EED\u4F7F\u7528 params.selector \u914D\u7F6E\u7236\u5BB9\u5668\uFF0C\u8BF7\u4F7F\u7528 appendTo \u65B9\u6CD5"),typeof(n==null?void 0:n.wrapper)=="string"?this.wrapperSelector=n.wrapper:(n==null?void 0:n.wrapper)instanceof Element&&(this.wrapper=n.wrapper),e.once("dispose",this.dispose)}load(e,n,o=!0){return G(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 G(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 G(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=Oh(e,this.five,this.data),this.render())}formatData(e){return G(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=F(F({},this.state),e),!nt(this.state,o,{deep:!0})&&this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n})}render(){if(this.disposed||!this.state.enabled)return;if(!this.wrapper&&this.wrapperSelector){const n=document.querySelector(this.wrapperSelector);this.wrapper=n}if(!this.data||!this.wrapper)return;const e=fe(F({},this.state.config),{five:this.five,floorplanData:this.data,visible:this.state.visible,extraObjects:this.extraObjects,highlightData:this.highlightData});this.app?this.app.$set(e):this.app=new hf({target:this.wrapper,props:e})}}const mf=(i,t)=>new ff(i,t),gf=[{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"}],pf=[{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"}],Vi=(i,t,e)=>{const n=new E.Matrix4,o=new E.Euler(i,t,e,"YXZ");return n.makeRotationFromEuler(o),n},vf=(i,{scale:t,rotation:e,position:n})=>{if(t&&i.scale.set(t,t,t),e){const[o,s,r]=e;o&&i.applyMatrix4(Vi(o,0,0)),s&&i.applyMatrix4(Vi(0,s,0)),r&&i.applyMatrix4(Vi(0,0,r))}return n&&i.position.set(n.x,n.y,n.z),i};function dl(i,t){i.traverse(e=>{var n;if(e.type==="Mesh"){const o=e,s=F({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 bf=(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=>G(exports,null,function*(){var O;const d=(h==null?void 0:h.fbx_url)||e,m=(O=h==null?void 0:h.north_rad)!=null?O: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 Aa.FBXLoader().loadAsync(d);dl(w,{transparent:!0,side:E.DoubleSide,blending:E.AdditiveBlending});const k=[0,m-Math.PI/2,0],{model:{bounding:{max:{x:I,z:C},min:{x:T,y:x,z:H}}}}=i;o.yBase=x;const N={x:(I+T)/2,y:x-1.6,z:(C+H)/2},R=.0045*v;return vf(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 yf(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 wf=({x:i,y:t,z:e})=>new j.Vector3(i,t,e),Cf=(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=>G(exports,null,function*(){var N,R,O,S,Q,_,X,W;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=wf(w),I=(R=b==null?void 0:b.rad)!=null?R:s,C=(O=b==null?void 0:b.fbx_url)!=null?O:r;if(e.rad=I,I===void 0)return Promise.reject(new Error(`ModelEntryDoorGuidePlugin.load(): rad is ${I}`));const T=yield new Aa.FBXLoader().loadAsync(C);T.position.copy(k),T.rotation.z=I,T.scale.set(.8,.8,.8),dl(T,{transparent:!0,side:E.DoubleSide});const x=(X=(_=(Q=(S=T.children)==null?void 0:S[0])==null?void 0:Q.children)==null?void 0:_[3])==null?void 0:X.clone();if(!x)return Promise.reject(new Error(`ModelEntryDoorGuidePlugin.load(): textMesh is ${x}`));const H=(W=t.name)!=null?W:"\u5165\u6237\u95E8";return x.material=new j.MeshBasicMaterial({transparent:!0,map:yf(H)}),x.renderOrder=3,T.children[0].add(x),e.object=T,!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 C=()=>{let N=0,R=0;const O=1e3/30,S=Q=>{N=requestAnimationFrame(S);const _=Q-R;_<O||(R=Q,a.forEach(X=>X.update(_/1e3)),i.needsRender=!0)};return N=requestAnimationFrame(S),()=>{cancelAnimationFrame(N)}},H={play:()=>{I||(k.play(),I=C(),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=H},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)}},Ef=mi.Easing;function Pf(i,t,e,n=Ef.Linear.None){const o=new mi.Tween(i).to(t,e).easing(n);gi(()=>o.start(0));const s=kn(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 If(i,t){return Pf({progress:0},{progress:1},i,t)}var hl=(i=>(i.Move="Move",i.Rotate="Rotate",i))(hl||{}),tt=(i=>(i.Clockwise="Clockwise",i.Anticlockwise="Anticlockwise",i.Loop="Loop",i))(tt||{});const Zn=Math.PI*2;function Ps(i){return(i%Zn+Zn)%Zn}function Is(i){return i%Zn}function ji(i,t,e){return i+(t-i)*e}const io=(i,t,e)=>{const n=Math.PI,o=n*2;return i=Ps(i),t=Ps(t),e===tt.Anticlockwise&&i<t&&(i+=o),e===tt.Clockwise&&t<i&&(t+=o),e===tt.Loop&&t-i>n?io(i,t,tt.Anticlockwise):e===tt.Loop&&i-t>n?io(i,t,tt.Clockwise):{from:i,to:t}},kf=i=>{const t={},e=(l,c,...u)=>G(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=Is(r.latitude),l=Is(s.latitude),{from:c,to:u}=io(r.longitude,s.longitude,s.rotation||tt.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)=>G(exports,[l,c,...u],function*(s,r,a={}){t.interruptCallback&&t.interruptCallback(!1),a.asyncStartCallback&&(yield a.asyncStartCallback()),i.currentMode!==Ce.Five.Mode.Panorama&&(yield i.changeMode(Ce.Five.Mode.Panorama)),s.panoIndex!==void 0&&s.panoIndex!==i.panoIndex&&(a.preload&&(yield i.preloadPano(s.panoIndex)),yield new Promise((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=ji(h.longitude,d.longitude,w),k.latitude=ji(h.latitude,d.latitude,w),k.fov=ji(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=If(v,mi.Easing.Linear.None).onUpdate(g).onComplete(p).onDestroy(A);s.rotation===tt.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 ks(i,t){return i.x===t.x&&i.y===t.y}function fl(i,t){return Math.abs(i)===1/0&&Math.abs(t)===1/0?!0:Math.abs(i-t)<.001}function di(i,t){return(t.y-i.y)/(t.x-i.x)}function ml(i,t,e){const n=di(i[1],i[0]),o=di(t[1],t[0]);if(isNaN(n)||isNaN(o)||fl(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&&!xf(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 ks(i,t[0])||ks(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&&fl(di(t[0],i),di(i,t[1]))}function Qn(i,t,e){return(i.x-e.x)*(t.y-e.y)-(t.x-e.x)*(i.y-e.y)}function xf(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)&&Qn(t[0],i[1],i[0])*Qn(i[1],t[1],i[0])>0&&Qn(i[0],t[1],t[0])*Qn(t[1],i[1],t[0])>0?1:0}function gl(i,t=0){t<=0?requestAnimationFrame(i):requestAnimationFrame(()=>gl(i,t-1))}const Df=`<style type="text/css">
|
|
192
192
|
.PanoRulerPlugin-rule-line {
|
|
193
193
|
position: absolute;
|
|
194
194
|
transform-origin: left center;
|
|
@@ -281,7 +281,7 @@ void main() {
|
|
|
281
281
|
<div class="PanoRulerPlugin-rule-label-name">${e.options.distanceText(A)}</div>
|
|
282
282
|
</div>
|
|
283
283
|
</div>
|
|
284
|
-
`,b=document.createElement("div");return b.setAttribute("class","PanoRulerPlugin-rule"),b.setAttribute("data-name",p),b.setAttribute("style","display: none"),b.innerHTML=v,b},o=document.createElement("div");o.setAttribute("style","position: absolute;pointer-events: none;width: 100%;height: 100%;left: 0;top: 0;overflow: hidden;");const s=document.createElement("div");s.innerHTML=Df,o.appendChild(s);const r={},a=(p,A)=>{if(e.loaded)throw new Error("\u6807\u5C3A\u88AB\u91CD\u590D\u521D\u59CB\u5316\uFF01");const v=Sf(p,i),b=i.work;if(!b)return!1;for(const w in A){const k=A[w],{standingPosition:C}=b.observers[0],I=k.map(({x:B,z:x,observers:H})=>{const N=H.length>0?p.rooms[p.observers[H[0]]].name:"",R=v[N]?v[N].floor:null;let O=1/0,S={index:0,x:C.x,y:C.y,z:C.z};H.forEach(U=>{if(!b.observers[U])return;const{standingPosition:ae}=b.observers[U],he={index:U,x:ae.x,y:ae.y,z:ae.z},de=Lf({x:B,z:x},he);R?de<O&&Math.abs(he.y-R)<.3&&(O=de,S=he):de<O&&(O=de,S=he)});const F=new j.Vector3(B,S.y,x);Object.assign(F,{observers:H});const G=v[N]?v[N].roof:null,Y=G?new j.Vector3(B,G,x):null;return Y&&Object.assign(Y,{observers:H}),{origin:F,vertical:Y}});r[w]={origins:I.map(B=>B.origin),rules:[]};for(const{origin:B,vertical:x}of I){if(!x)continue;const H=n(w,B.distanceTo(x));o.append(H),r[w].rules.push({vertical:!0,rule:[B,x],$element:H})}for(let B=0;B<I.length;B++){let x=B+1;x>=I.length&&(x=0);const{origin:H}=I[B],{origin:N}=I[x],R=n(w,H.distanceTo(N));o.append(R),r[w].rules.push({vertical:!1,rule:[H,N],$element:R})}}return e.loaded=!0,!0},l=(p,A,v)=>_(exports,null,function*(){const b=p||t.roomInfo,w=A||t.roomRules;if(!b||!w)throw new Error("\u6807\u5C3A\u6570\u636E\u4F9D\u8D56\u4E0D\u9F50\u5168\uFF01");return e.loaded=!1,e.options=Q(Q({},e.options),v||{}),i.model.loaded?a(b,w):yield new Promise(k=>i.once("modelLoaded",()=>k(a(b,w))))});t.roomInfo&&t.roomRules&&l(t.roomInfo,t.roomRules);const c=(p,A,v,b)=>{const w=[[{x:0,y:0},{x:v,y:0}],[{x:0,y:0},{x:0,y:b}],[{x:v,y:0},{x:v,y:b}],[{x:0,y:b},{x:v,y:b}]],k=[];for(let C=0;C<w.length;C++){const I=ml([p,A],[w[C][0],w[C][1]],!0);I&&k.push(I)}return k.length===0?!1:k},u=()=>{var H;const p=(H=i.getElement())==null?void 0:H.parentElement;if(!p||!e.loaded||Object.keys(r).length<=0)return;const{panoIndex:A,camera:v,currentMode:b}=i;if(A===void 0)return;let w;for(const N in r)N.split(",").indexOf(A.toString())>=0&&(w=N);if(!w){for(const N in r)for(const{$element:R}of r[N].rules)R.style.display="none";return}const k=v.position,C=v.getWorldDirection(new j.Vector3),I=p.clientWidth,B=p.clientHeight;if(b!==Ce.Five.Mode.Panorama){for(const N in r)for(const{$element:R}of r[N].rules)R.style.display="none";return}for(const N in r)for(const{$element:R}of r[N].rules)R.style.display=N===w?"block":"none";const[x]=r[w].origins.slice().filter(N=>N.observers.indexOf(A)>=0).sort((N,R)=>{const O=N.clone().setY(0).sub(k).normalize().angleTo(C.clone().setY(0)),S=R.clone().setY(0).sub(k).normalize().angleTo(C.clone().setY(0));return O-S});for(const{rule:N,vertical:R,$element:O}of r[w].rules){const[S,F]=N,G=O.querySelector(".PanoRulerPlugin-rule-line");if(!G)return;if(!x){O.style.display="none";continue}if(S!==x&&F!==x){O.style.display="none";continue}if(S.distanceTo(F)<.3){O.style.display="none";continue}if(S.observers.indexOf(A)===-1||F.observers.indexOf(A)===-1){O.style.display="none";continue}if(S.clone().sub(k).normalize().angleTo(C)>Math.PI/2){O.style.display="none";continue}if(F.clone().sub(k).normalize().angleTo(C)>Math.PI/2){O.style.display="none";continue}const ee=S.distanceTo(F);if(F.clone().sub(F.clone().sub(S).divide(new j.Vector3(2,2,2))).distanceTo(k)/ee>8){O.style.display="none";continue}const he=S.clone().project(v),de=(he.x+1)/2*I,pe=(-he.y+1)/2*B,Pe=F.clone().project(v),ke=(Pe.x+1)/2*I,Te=(-Pe.y+1)/2*B,ce=Math.sqrt(Math.pow(ke-de,2)+Math.pow(Te-pe,2));let Ae=ce,Ee=50;const ue=c({x:~~de,y:~~pe},{x:~~ke,y:~~Te},I,B);if(ue&&ue.length===1&&(x===S?(Ae=Math.sqrt(Math.pow(ue[0].x-de,2)+Math.pow(ue[0].y-pe,2)),Ee=Ae/ce*50):x===F&&(Ae=Math.sqrt(Math.pow(ue[0].x-ke,2)+Math.pow(ue[0].y-Te,2)),Ee=100-Ae/ce*50)),ue&&ue.length===2){const te={x:(ue[0].x+ue[1].x)/2,y:(ue[0].y+ue[1].y)/2};Ee=Math.sqrt(Math.pow(te.x-de,2)+Math.pow(te.y-pe,2))/ce*100}const st=(Math.PI/2-Math.atan2(ke-de,pe-Te))/Math.PI*180,ye=G.querySelector(".PanoRulerPlugin-rule-label"),$e=ye.children[0].clientWidth;$e>=ce||$e/2>=Ee/100*ce||$e/2>=(1-Ee/100)*ce?G.style.display="none":(G.style.display="block",G.style.width=ce+"px",G.style.left=de+"px",G.style.top=pe+"px",G.style.transform=`rotate(${-st}deg)`,ye.style.left=`${Ee}%`)}},h=()=>gl(u),d=()=>{var p,A;return e.loaded?(e.enable||(o.setAttribute("class","PanoRulerPlugin"+(e.options.className?" "+e.options.className:"")),(A=(p=i.getElement())==null?void 0:p.parentElement)==null||A.append(o),u(),i.on("modeChange",u),i.on("cameraUpdate",h),e.enable=!0),!0):!1},m=()=>(e.enable&&(i.off("modeChange",u),i.off("cameraUpdate",h),o&&o.remove(),e.enable=!1),!0);function g(p){if(p.distanceText&&p.distanceText!==e.options.distanceText){const A=p.distanceText;e.options.distanceText=A,Object.values(r).forEach(v=>{v.rules.forEach(b=>{const[w,k]=b.rule,C=w.distanceTo(k),I=b.$element.querySelector(".PanoRulerPlugin-rule-label-name");!I||(I.innerText=A(C))})})}}return{enable:d,disable:m,load:l,state:e,changeConfigs:g}};function Tf(i){le(i,"svelte-1h27ktp",".PanoRulerPlugin-rule-line.svelte-1h27ktp.svelte-1h27ktp{position:absolute;transform-origin:left 0.0625rem;width:0;height:0.125rem;pointer-events:none}.PanoRulerPlugin-rule-line.svelte-1h27ktp.svelte-1h27ktp::after{content:'';position:absolute;left:-0.125rem;top:-0.1rem;width:0.25rem;height:0.25rem;border-radius:50%;background:#fff;z-index:1;animation:svelte-1h27ktp-viewport-rule-point 0.1s 1s;animation-fill-mode:both}.PanoRulerPlugin-rule-line.svelte-1h27ktp.svelte-1h27ktp::before{content:'';position:absolute;right:-0.125rem;top:-0.1rem;width:0.25rem;height:0.25rem;border-radius:50%;background:#fff;z-index:1;animation:svelte-1h27ktp-viewport-rule-point 0.1s 1.5s;animation-fill-mode:both}.PanoRulerPlugin-rule-line.svelte-1h27ktp em.svelte-1h27ktp{display:block;height:0.0625rem;animation:svelte-1h27ktp-viewport-rule-line 0.5s ease 1s;animation-fill-mode:both;box-shadow:0 0 0.25rem rgb(0 0 0 / 40%);position:relative}.rule-mixed-line.svelte-1h27ktp.svelte-1h27ktp{display:flex;height:0.0625rem;animation:svelte-1h27ktp-viewport-rule-line 0.5s ease 1s;animation-fill-mode:both;align-items:center}.em-solid.svelte-1h27ktp.svelte-1h27ktp{height:100%;background:#ffffff}.em-dotted.svelte-1h27ktp.svelte-1h27ktp{height:0.125rem;background:var(--background-image);background-position:center;background-repeat:repeat}.PanoRulerPlugin-rule-label.svelte-1h27ktp.svelte-1h27ktp{position:absolute;width:0;height:0;top:0.0625rem;pointer-events:none}.PanoRulerPlugin-rule-label-name.svelte-1h27ktp.svelte-1h27ktp{position:absolute;padding:0.1875rem 0.375rem;background:rgba(195, 195, 195, 0.3);backdrop-filter:blur(0.25rem);-webkit-backdrop-filter:blur(0.25rem);border-radius:6.25rem;border:0.0625rem solid rgba(255, 255, 255, 0.6);white-space:nowrap;overflow:hidden;color:#ffffff;font-weight:500;font-size:0.75rem;line-height:1;animation:svelte-1h27ktp-viewport-rule-label 0.25s ease 1s;animation-fill-mode:both;box-shadow:inset 0 0 0.625rem 0 rgba(255, 255, 255, 0.3)}@keyframes svelte-1h27ktp-viewport-rule-line{0%{width:0%}100%{width:100%}}@keyframes svelte-1h27ktp-viewport-rule-label{0%{opacity:0;transform:scaleX(0)}100%{opacity:1;transform:translate(-50%, -50%) scaleX(1)}}@keyframes svelte-1h27ktp-viewport-rule-point{0%{transform:scaleX(0)}100%{transform:scaleX(1)}}")}function xs(i,t,e){const n=i.slice();return n[6]=t[e],n}function zf(i){let t,e=i[0].children,n=[];for(let o=0;o<e.length;o+=1)n[o]=Ds(xs(i,e,o));return{c(){t=z("div");for(let o=0;o<n.length;o+=1)n[o].c();y(t,"class","rule-mixed-line svelte-1h27ktp")},m(o,s){M(o,t,s);for(let r=0;r<n.length;r+=1)n[r].m(t,null)},p(o,s){if(s&9){e=o[0].children;let r;for(r=0;r<e.length;r+=1){const a=xs(o,e,r);n[r]?n[r].p(a,s):(n[r]=Ds(a),n[r].c(),n[r].m(t,null))}for(;r<n.length;r+=1)n[r].d(1);n.length=e.length}},d(o){o&&L(t),ut(n,o)}}}function Bf(i){let t,e;return{c(){t=z("em"),y(t,"class",e=Ie(i[0].state?"em-solid":"em-dotted")+" svelte-1h27ktp"),y(t,"style",i[3])},m(n,o){M(n,t,o)},p(n,o){o&1&&e!==(e=Ie(n[0].state?"em-solid":"em-dotted")+" svelte-1h27ktp")&&y(t,"class",e),o&8&&y(t,"style",n[3])},d(n){n&&L(t)}}}function Ds(i){let t,e,n=`${i[6].width}px`;return{c(){t=z("div"),y(t,"class",e=Ie(i[6].state?"em-solid":"em-dotted")+" svelte-1h27ktp"),y(t,"style",i[3]),T(t,"width",n)},m(o,s){M(o,t,s)},p(o,s){s&1&&e!==(e=Ie(o[6].state?"em-solid":"em-dotted")+" svelte-1h27ktp")&&y(t,"class",e),s&8&&y(t,"style",o[3]),s&1&&n!==(n=`${o[6].width}px`)&&T(t,"width",n)},d(o){o&&L(t)}}}function Vf(i){let t,e,n,o,s=i[0].labelElement+"",r,a,l=`${i[0].labelOffset}%`,c=`${i[0].width}px`,u=`${i[0].left}px`,h=`${i[0].top}px`,d=`rotate(${i[0].rotateDeg}deg)`;function m(A,v){return A[0].children.length===0?Bf:zf}let g=m(i),p=g(i);return{c(){t=z("div"),p.c(),e=$(),n=z("div"),o=z("div"),r=xe(s),y(o,"class","PanoRulerPlugin-rule-label-name svelte-1h27ktp"),Qe(()=>i[4].call(o)),y(n,"class","PanoRulerPlugin-rule-label svelte-1h27ktp"),T(n,"left",l),y(t,"class","PanoRulerPlugin-rule-line svelte-1h27ktp"),T(t,"width",c),T(t,"left",u),T(t,"top",h),T(t,"transform",d),T(t,"display",i[0].visible&&i[2]?"block":"none")},m(A,v){M(A,t,v),p.m(t,null),V(t,e),V(t,n),V(n,o),V(o,r),a=pi(o,i[4].bind(o))},p(A,[v]){g===(g=m(A))&&p?p.p(A,v):(p.d(1),p=g(A),p&&(p.c(),p.m(t,e))),v&1&&s!==(s=A[0].labelElement+"")&&Me(r,s),v&1&&l!==(l=`${A[0].labelOffset}%`)&&T(n,"left",l),v&1&&c!==(c=`${A[0].width}px`)&&T(t,"width",c),v&1&&u!==(u=`${A[0].left}px`)&&T(t,"left",u),v&1&&h!==(h=`${A[0].top}px`)&&T(t,"top",h),v&1&&d!==(d=`rotate(${A[0].rotateDeg}deg)`)&&T(t,"transform",d),v&5&&T(t,"display",A[0].visible&&A[2]?"block":"none")},i:X,o:X,d(A){A&&L(t),p.d(),a()}}}function jf(i,t,e){let n,{rulerItemProp:o}=t,s=!0,r,a="data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQiIHdpZHRoPSIxMiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+PGRlZnM+PGZpbHRlciBpZD0icHJlZml4X19hIiBoZWlnaHQ9IjQwMCUiIHdpZHRoPSIxMzcuNCUiIHg9Ii0xOC43JSIgeT0iLTE1MCUiPjxmZU1vcnBob2xvZ3kgaW49IlNvdXJjZUFscGhhIiBvcGVyYXRvcj0iZGlsYXRlIiByYWRpdXM9Ii41IiByZXN1bHQ9InNoYWRvd1NwcmVhZE91dGVyMSIvPjxmZU9mZnNldCBpbj0ic2hhZG93U3ByZWFkT3V0ZXIxIiByZXN1bHQ9InNoYWRvd09mZnNldE91dGVyMSIvPjxmZU1vcnBob2xvZ3kgaW49IlNvdXJjZUFscGhhIiByYWRpdXM9IjEiIHJlc3VsdD0ic2hhZG93SW5uZXIiLz48ZmVPZmZzZXQgaW49InNoYWRvd0lubmVyIiByZXN1bHQ9InNoYWRvd0lubmVyIi8+PGZlQ29tcG9zaXRlIGluPSJzaGFkb3dPZmZzZXRPdXRlcjEiIGluMj0ic2hhZG93SW5uZXIiIG9wZXJhdG9yPSJvdXQiIHJlc3VsdD0ic2hhZG93T2Zmc2V0T3V0ZXIxIi8+PGZlR2F1c3NpYW5CbHVyIGluPSJzaGFkb3dPZmZzZXRPdXRlcjEiIHJlc3VsdD0ic2hhZG93Qmx1ck91dGVyMSIgc3RkRGV2aWF0aW9uPSIuNSIvPjxmZUNvbG9yTWF0cml4IGluPSJzaGFkb3dCbHVyT3V0ZXIxIiB2YWx1ZXM9IjAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAuMiAwIi8+PC9maWx0ZXI+PHBhdGggaWQ9InByZWZpeF9fYiIgZD0iTS44ODkgMkgxMS41OCIvPjwvZGVmcz48ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIHN0cm9rZS1kYXNoYXJyYXk9IjUgNiIgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIiBzdHJva2UtbGluZWpvaW49InJvdW5kIj48dXNlIGZpbGw9IiMwMDAiIGZpbHRlcj0idXJsKCNwcmVmaXhfX2EpIiB4bGluazpocmVmPSIjcHJlZml4X19iIi8+PHVzZSBzdHJva2U9IiNmZmYiIHN0cm9rZS1vcGFjaXR5PSIuNCIgeGxpbms6aHJlZj0iI3ByZWZpeF9fYiIvPjwvZz48L3N2Zz4=";function l(){r=this.offsetWidth,e(1,r)}return i.$$set=c=>{"rulerItemProp"in c&&e(0,o=c.rulerItemProp)},i.$$.update=()=>{i.$$.dirty&3&&(r>=o.width||r/2>=o.labelOffset/100*o.width||r/2>=(1-o.labelOffset/100)*o.width?e(2,s=!1):e(2,s=!0))},e(3,n=`--background-image: url(${a})`),[o,r,s,n,l]}class Of extends oe{constructor(t){super(),ie(this,t,jf,Vf,ne,{rulerItemProp:0},Tf)}}function Ls(i,t,e){const n=i.slice();return n[12]=t[e],n}function Ss(i){let t,e;return t=new Of({props:{rulerItemProp:i[12]}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.rulerItemProp=n[12]),t.$set(s)},i(n){e||(P(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function Rf(i){let t,e,n=i[0],o=[];for(let r=0;r<n.length;r+=1)o[r]=Ss(Ls(i,n,r));const s=r=>D(o[r],1,1,()=>{o[r]=null});return{c(){t=z("div");for(let r=0;r<o.length;r+=1)o[r].c()},m(r,a){M(r,t,a);for(let l=0;l<o.length;l+=1)o[l].m(t,null);e=!0},p(r,[a]){if(a&1){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),P(o[l],1)):(o[l]=Ss(c),o[l].c(),P(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)P(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&&L(t),ut(o,r)}}}function Qf(i,t,e){var p,A,v,b;let{five:n}=t,{rulerDatas:o}=t,{options:s}=t,r=[];const a=((A=(p=n.getElement())==null?void 0:p.parentElement)==null?void 0:A.clientWidth)||0,l=((b=(v=n.getElement())==null?void 0:v.parentElement)==null?void 0:b.clientHeight)||0,c=(w,k)=>{const C=[[{x:0,y:0},{x:a,y:0}],[{x:0,y:0},{x:0,y:l}],[{x:a,y:0},{x:a,y:l}],[{x:0,y:l},{x:a,y:l}]],I=[];for(let B=0;B<C.length;B++){const x=ml([w,k],[C[B][0],C[B][1]],!0);x&&I.push(x)}return I.length===0?!1:I},u=(w,k)=>{const C=w.clone().project(n.camera),I=(C.x+1)/2*a,B=(-C.y+1)/2*l,x=k.clone().project(n.camera),H=(x.x+1)/2*a,N=(-x.y+1)/2*l,R=Math.sqrt(Math.pow(H-I,2)+Math.pow(N-B,2));return{startLeft:I,startTop:B,endLeft:H,endTop:N,distance:R}},h=(w,k,C)=>{const I=n.camera.position,B=n.camera.getWorldDirection(new j.Vector3),x=w.clone().sub(I).normalize().angleTo(B),H=k.clone().sub(I).normalize().angleTo(B),N=w.distanceTo(k),O=k.clone().sub(k.clone().sub(w).divide(new j.Vector3(2,2,2))).distanceTo(I),{startLeft:S,startTop:F,endLeft:G,endTop:Y,distance:W}=u(w,k),U=-((Math.PI/2-Math.atan2(G-S,F-Y))/Math.PI)*180;let ae=!0;C||(ae=!1),!nt(w,C)&&!nt(k,C)&&(ae=!1),N<.3&&(ae=!1),x>Math.PI/2&&(ae=!1),H>Math.PI/2&&(ae=!1),O/N>8&&(ae=!1);let he=50,de=W;const pe=c({x:~~S,y:~~F},{x:~~G,y:~~Y});if(pe&&pe.length===1&&(nt(w,C)?(de=Math.sqrt(Math.pow(pe[0].x-S,2)+Math.pow(pe[0].y-F,2)),he=de/W*50):nt(k,C)&&(de=Math.sqrt(Math.pow(pe[0].x-G,2)+Math.pow(pe[0].y-Y,2)),he=100-de/W*50)),pe&&pe.length===2){const Pe={x:(pe[0].x+pe[1].x)/2,y:(pe[0].y+pe[1].y)/2};he=Math.sqrt(Math.pow(Pe.x-S,2)+Math.pow(Pe.y-F,2))/W*100}return{startLeft:S,startTop:F,distance:W,deg:U,visible:ae,labelOffset:he,ruleLength:N}},d=()=>{const w=n.panoIndex,k=o.find(R=>R.panoIndex===w);if(!k)return e(0,r=[]);if(n.currentMode!==Ce.Five.Mode.Panorama)return e(0,r=[]);const C=n.camera.position,I=n.camera.getWorldDirection(new j.Vector3),B=k.lines.map(R=>new j.Vector3(R.start[0],-R.start[1],-R.start[2])),x=k.lines.map(R=>new j.Vector3(R.end[0],-R.end[1],-R.end[2])),[H]=B.concat(x).sort((R,O)=>{const S=R.clone().setY(0).sub(C).normalize().angleTo(I.clone().setY(0)),F=O.clone().setY(0).sub(C).normalize().angleTo(I.clone().setY(0));return S-F}),N=k.lines.map(R=>{var de,pe;const O=R.start,S=R.end,{startLeft:F,startTop:G,distance:Y,deg:W,visible:ee,labelOffset:U,ruleLength:ae}=h(new j.Vector3(O[0],-O[1],-O[2]),new j.Vector3(S[0],-S[1],-S[2]),H),he=[];return R.children&&((de=R.children)==null?void 0:de.length)>0&&((pe=R.children)==null||pe.forEach(Pe=>{const ke=Pe.start,Te=Pe.end,{distance:ce}=u(new j.Vector3(ke[0],-ke[1],-ke[2]),new j.Vector3(Te[0],-Te[1],-Te[2]));he.push({width:ce,state:Pe.state})})),{width:Y,left:F,top:G,rotateDeg:W,state:R.state,children:he,labelOffset:U,visible:ee,labelElement:s.distanceText(ae)}});e(0,r=N)},m=()=>gi(d),g=Po(d,80);return Ze(()=>{d(),n.on("panoArrived",d),n.on("modeChange",d),n.on("cameraDirectionUpdate",m),n.on("movingToPano",m),n.on("mouseWheel",()=>g()),n.on("pinchGesture",()=>g())}),Et(()=>{n.off("panoArrived",d),n.off("modeChange",d),n.off("cameraDirectionUpdate",m),n.off("movingToPano",m),n.off("mouseWheel",()=>g()),n.off("pinchGesture",()=>g())}),i.$$set=w=>{"five"in w&&e(1,n=w.five),"rulerDatas"in w&&e(2,o=w.rulerDatas),"options"in w&&e(3,s=w.options)},[r,n,o,s]}class Ff extends oe{constructor(t){super(),ie(this,t,Qf,Rf,ne,{five:1,rulerDatas:2,options:3})}}class Hf{constructor(t,e){f(this,"five");f(this,"container",document.createElement("div"));f(this,"panoRulerProData");f(this,"rulerItems");f(this,"state",{enabled:!1,loaded:!1,options:{className:"",distanceText:t=>`${t.toFixed(1)}m`}});var n,o;this.five=t,this.container.classList.add("panoRulerProPlugin-container"),this.container.setAttribute("style","position: absolute;pointer-events: none;width: 100%;height: 100%;left: 0;top: 0;overflow: hidden;"),e&&(e.data&&this.load(e.data),this.state.options=Q(Q({},this.state.options),e.options||{}),(n=e.options)!=null&&n.className&&this.container.classList.add((o=e.options)==null?void 0:o.className)),this.five.once("modelLoaded",()=>_(this,null,function*(){var s,r;(r=(s=this.five.getElement())==null?void 0:s.parentNode)==null||r.append(this.container)})),this.five.once("dispose",()=>this.dispose())}load(t){return _(this,null,function*(){if(!this.five.work)return;const e=t.data;if(!e)throw new Error("\u6807\u5C3A\u6570\u636E\u4F9D\u8D56\u4E0D\u9F50\u5168\uFF01");this.panoRulerProData=e,this.state.loaded=!0})}enable(){return this.state.loaded?(this.state.enabled||(this.state.enabled=!0,this.render()),!0):!1}disable(){return this.state.enabled&&(this.state.enabled=!1,this.render()),!0}render(){return _(this,null,function*(){var t;if(this.state.enabled){if(!this.panoRulerProData||!this.container)return;this.rulerItems=new Ff({target:this.container,props:{five:this.five,rulerDatas:this.panoRulerProData,options:this.state.options}})}else(t=this.rulerItems)==null||t.$destroy(),this.rulerItems=void 0})}dispose(){this.container&&(this.rulerItems.$destroy(),this.rulerItems=void 0),this.container.remove()}}const _f=(i,t)=>new Hf(i,t),Gf="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZIAAABCCAYAAAB9y1BhAAAAAXNSR0IArs4c6QAADh5JREFUeAHtnVuPLDcVhedwC/dACKAICDxEIBQpygNI/Ab+MX8B8YCQEAjxgBAQLsm5Jjkn58r6Sl4jT52qnu4zXd121dqSx67q7ip7eXsv721XzcVFJAgEgSAQBIJAEAgCQeC4CLx48eKbSu+RH/fKuVoQWB8Cn1tfk9KiIHAUBH6tq/xKiTwSBILADgRCJDvAyUebRuAbpfXxSDatBmn8Pgh8YZ8v5TtBYIMIvFCbSZEgEASuQSBEcg1A+XizCDzfbMvT8CBwIAIhkgMBy9c3g0CIZDNdnYbeFIEQyU0RzO/XikCIZK09m3YdHYEQydEhzQVXgkCIZCUdmWYsj0CIZHmMc4c+EchCe5/9llqfAYEQyRlAzy27QCAeSRfdlEq2gECIpIVeSB1aRAAiudVixVKnINAaAiGS1nok9WkFAUJb8Upa6Y3Uo2kEQiRNd08qd0YEQiJnBD+37guBEElf/ZXang6BEMnpsM6dOkcgRNJ5B66x+nrjLmsTX1J6bSJHZ7+o9HklynWaOse1e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ement("div"),t=document.createElement("i"),e=document.createElement("span");return i.appendChild(t),i.appendChild(e),i.style.position="relative",i.style.width="100%",i.style.display="flex",i.style.flexDirection="column",i.style.alignItems="center",i.style.marginTop=`${150/16}rem`,i.style.opacity="0",i.style.transition="opacity 1000ms linear",t.style.display="block",t.style.width=`${134/16}rem`,t.style.height=`${22/16}rem`,t.style.backgroundSize="100%",t.style.backgroundRepeat="no-repeat",t.style.backgroundImage=`url(${Gf})`,e.style.marginTop=`${10/16}rem`,e.style.fontSize=`${16/16}rem`,e.style.color="#fff",e.style.opacity="0.7",e.style.textShadow="0 2px 16px rgb(22 34 83 / 24%)",e.style.fontWeight="bold",{appendTo(n){n.appendChild(i)},dispose(){i.remove()},setRoom(n){e.innerHTML=n.name+" "+Math.floor(n.size/1e6)+"\u33A1"},show(){i.style.opacity="1"},hide(){i.style.opacity="0"}}}const Nf=new E.TextureLoader;function hi(i){return _(this,null,function*(){return new Promise((t,e)=>{Nf.load(i,t,void 0,e)}).then(t=>(t.encoding=E.sRGBEncoding,t.minFilter=E.LinearFilter,t.wrapS=E.ClampToEdgeWrapping,t.wrapT=E.ClampToEdgeWrapping,setTimeout(()=>{t.wrapS!==E.ClampToEdgeWrapping&&console.warn("ios 16.4 texture \u4E0D\u652F\u6301 ClampToEdgeWrapping \u4EE5\u5916\u7684\u65B9\u5F0F")}),t))})}const Hn={userAction:!0};class Xf extends Tt{constructor(e,n){super(e);f(this,"state",{visible:!0,enabled:!0,config:{compassImageUrl:"//vrlab-image4.ljcdn.com/release/web/v3/north-point-circle.96498e69.png",entryDoorImageUrl:"//vrlab-image4.ljcdn.com/release/web/enterDoor.831b8208.png"}});f(this,"data");f(this,"group",new E.Group);f(this,"roomInfoInstance");f(this,"roomInfoWrapperInstance");f(this,"compassMeshTween");f(this,"compassMesh");f(this,"entryDoorMesh");f(this,"dispose",()=>{var e,n,o,s;this.five.scene.remove(this.group),this.group.remove(...this.group.children),(n=(e=this.compassMesh)==null?void 0:e.material.map)==null||n.dispose(),(s=(o=this.entryDoorMesh)==null?void 0:o.material.map)==null||s.dispose(),this.five.off("dispose",this.dispose),this.five.off("panoArrived",this.onFivePanoArrived),this.five.off("panoWillArrive",this.onFivePanoWillArrive),this.five.off("cameraDirectionUpdate",this.onFiveCameraDirectionUpdate)});f(this,"_addEventListener",()=>{this.five.on("panoArrived",this.onFivePanoArrived),this.five.on("panoWillArrive",this.onFivePanoWillArrive),this.five.on("modeChange",this.onFiveModeChange),this.five.on("cameraDirectionUpdate",this.onFiveCameraDirectionUpdate)});f(this,"_removeEventListener",()=>{this.five.off("panoArrived",this.onFivePanoArrived),this.five.off("panoWillArrive",this.onFivePanoWillArrive),this.five.off("modeChange",this.onFiveModeChange),this.five.off("cameraDirectionUpdate",this.onFiveCameraDirectionUpdate)});f(this,"_enable",()=>{this.five.scene.add(this.group),this.init(),this.onFivePanoArrived(this.five.panoIndex||0),this._addEventListener()});f(this,"_disable",()=>{this._clearCompassIfNeed(),this._clearEntryDoorIfNeed(),this.five.scene.remove(this.group),this._removeEventListener()});f(this,"_toggleVisible",()=>{this.group.visible=this.state.visible,this.five.needsRender=!0});f(this,"_clearCompassIfNeed",()=>{var e;this.compassMesh&&(this.group.remove(this.compassMesh),(e=this.compassMesh.material.map)==null||e.dispose(),this.compassMesh=null)});f(this,"_clearEntryDoorIfNeed",()=>{var e;this.entryDoorMesh&&(this.group.remove(this.entryDoorMesh),(e=this.entryDoorMesh.material.map)==null||e.dispose(),this.entryDoorMesh=null),this.roomInfoInstance&&(this.roomInfoInstance.dispose(),this.roomInfoInstance=null),this.roomInfoWrapperInstance&&(this.roomInfoWrapperInstance.dispose(),this.roomInfoWrapperInstance=null)});f(this,"onFivePanoWillArrive",e=>{var n,o;e!==this.five.panoIndex&&((n=this.compassMeshTween)==null||n.dispose(),(o=this.compassMesh)==null||o.material.setValues({opacity:0}))});f(this,"onFivePanoArrived",e=>{var o,s,r,a,l,c,u;const n=(r=(s=(o=this.five.work)==null?void 0:o.observers)==null?void 0:s[e])==null?void 0:r.standingPosition;if(this.compassMesh&&(this.compassMesh.position.copy(n.clone().setY(n.y+.01)),this.compassMesh.material.opacity===0&&((a=this.compassMeshTween)==null||a.dispose(),this.compassMeshTween=Sa(1e3).onUpdate(({progress:h})=>{var d;(d=this.compassMesh)==null||d.material.setValues({opacity:h}),this.five.needsRender=!0}).play())),this.entryDoorMesh){const d=new E.Vector3(this.data.entrance.position.x,this.data.entrance.position.y,this.data.entrance.position.z).clone().setY(n.y).sub(n).normalize(),m=n.clone().add(d.clone().multiplyScalar(.7)).setY(n.y+.01);this.entryDoorMesh.rotation.z=new E.Vector3(0,0,-1).angleTo(d),this.entryDoorMesh.position.copy(m),((l=this.data)==null?void 0:l.room_observers[e].room.type)===1?(c=this.entryDoorMesh)==null||c.material.setValues({opacity:1}):(u=this.entryDoorMesh)==null||u.material.setValues({opacity:0})}this.roomInfoInstance&&this.roomInfoWrapperInstance&&(this.roomInfoWrapperInstance.css3DObject.position.copy(n.clone().setY(n.y+.01)),this.roomInfoInstance.setRoom(this.data.room_observers[e].room)),this.five.needsRender=!0});f(this,"onFiveCameraDirectionUpdate",({longitude:e,latitude:n})=>{var o,s;!this.roomInfoWrapperInstance||(this.roomInfoWrapperInstance.css3DObject.rotation.z=e,n>.66&&this.five.getCurrentState().mode==="Panorama"?(o=this.roomInfoInstance)==null||o.show():(s=this.roomInfoInstance)==null||s.hide())});f(this,"onFiveModeChange",(e,n,o,s,r)=>{e!==n&&this.setState({visible:e===Ce.Five.Mode.Panorama},{userAction:r})});this.five.scene.add(this.group),this.five.once("dispose",this.dispose),this.setState({visible:!0,enabled:!0,config:Q(Q({},this.state.config),n||{})})}enable(e=Hn){this.setState({enabled:!0},e)}disable(e=Hn){this.setState({enabled:!1},e)}show(e=Hn){if(!!this.state.enabled)return this.setState({visible:!0},e),Promise.resolve()}hide(e=Hn){if(!!this.state.enabled)return this.setState({visible:!1},e),Promise.resolve()}setState(e,n={userAction:!0}){var s,r;const o=JSON.parse(JSON.stringify(this.state));this.state={visible:(s=e.visible)!=null?s:o.visible,enabled:(r=e.enabled)!=null?r:o.enabled,config:Q(Q({},o.config),e.config||{})},this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n.userAction}),e.enabled===!0&&(this._enable(),this.hooks.emit("enable",n)),e.enabled===!1&&(this._disable(),this.hooks.emit("disable",n)),e.visible===!1&&(this._toggleVisible(),this.hooks.emit("hide",n)),e.visible===!0&&(this._toggleVisible(),this.hooks.emit("show",n)),e.config&&this.init()}load(e,n,o=!0){return _(this,null,function*(){const s=yield this.formatData(e);JSON.stringify(this.data)!==JSON.stringify(s)&&(this.hooks.emit("dataChange",s,this.data),this.data=Q({},s),this.init(),n&&this.setState(n,{userAction:o}),this.hooks.emit("dataLoaded",this.data))})}formatData(e){return e.version&&e.data?Promise.resolve(e.data):Promise.resolve(e)}init(){return _(this,null,function*(){var o,s,r,a;const e=(s=(o=this.data)==null?void 0:o.north_rad)!=null?s:null;this._clearCompassIfNeed(),e!==null&&(this.compassMesh=yield this.loadCompassMesh(),this.compassMesh.rotateX(-Math.PI/2),this.compassMesh.rotateZ(e-Math.PI/2),this.group.add(this.compassMesh));const n=(a=(r=this.data)==null?void 0:r.entrance)!=null?a:null;this._clearEntryDoorIfNeed(),n!==null&&(this.entryDoorMesh=yield this.loadEntryDoorMesh(),this.roomInfoWrapperInstance=this.loadRoomInfo(),this.roomInfoInstance=Wf(),this.entryDoorMesh.rotateX(-Math.PI/2),this.roomInfoWrapperInstance&&this.roomInfoInstance.appendTo(this.roomInfoWrapperInstance.container),this.group.add(this.entryDoorMesh)),this.onFivePanoArrived(this.five.panoIndex||0),this.five.needsRender=!0})}loadCompassMesh(){return _(this,null,function*(){const e=this.state.config.compassImageUrl,n=yield hi(e),o=new E.CircleGeometry(.7,32),s=new E.MeshBasicMaterial({map:n,transparent:!0,opacity:0,depthTest:!1}),r=new E.Mesh(o,s);return r.name="pano-compass-mesh",r})}loadEntryDoorMesh(){return _(this,null,function*(){const e=this.state.config.entryDoorImageUrl,n=yield hi(e),o=new E.PlaneGeometry(.2,.16),s=new E.MeshBasicMaterial({map:n,transparent:!0,opacity:.8,depthTest:!1}),r=new E.Mesh(o,s);return r.name="pano-compass-entry-door",r})}loadRoomInfo(){const e=[new E.Vector3(-.7,0,-.7),new E.Vector3(.7,0,-.7),new E.Vector3(.7,0,.7),new E.Vector3(-.7,0,.7)];return Kt(this.five).create3DDomContainer(e)}}const Yf=(i,t)=>new Xf(i,t);function _n(i,t,e){const n=i[t],o=i[e];n===void 0||o===void 0||(i[t]=o,i[e]=n)}function Uf(i,t,e){const n=e/2;for(let o=1;o<=n;o++){const s=e-(o-1);for(let r=1;r<=t;r++){const a=(o-1)*t+r-1,l=(s-1)*t+r-1;_n(i,a*4+0,l*4+0),_n(i,a*4+1,l*4+1),_n(i,a*4+2,l*4+2),_n(i,a*4+3,l*4+3)}}}class pl{constructor(t,e){f(this,"width");f(this,"height");f(this,"containerDom");f(this,"hooks",new Ce.Subscribe);f(this,"canvas",document.createElement("canvas"));f(this,"five");f(this,"scale");f(this,"config");f(this,"offset",{x:0,y:0});f(this,"context");f(this,"renderCenter",new E.Vector3);f(this,"hammer");f(this,"state",{enabled:!1});f(this,"offsetRange");f(this,"isPanning",!1);f(this,"onPanstart",()=>{this.isPanning=!0,this.canvas.style.boxShadow="0 2px 30px 0 rgba(0,0,0,0.20)"});f(this,"onPan",t=>{if(!this.isPanning||!this.offsetRange||this.hooks.emit("wantsPanGesture",t))return;const{translateX:n,translateY:o}=this.getPanOffset(t,this.offsetRange);this.canvas.style.transform=`translate3d(${n}px, ${o}px, 100px)`});f(this,"onPanend",t=>{if(this.isPanning=!1,this.canvas.style.boxShadow="none",!this.offsetRange)return;const{translateX:e,translateY:n}=this.getPanOffset(t,this.offsetRange);this.canvas.style.transform=`translate3d(${e}px, ${n}px, 100px)`,this.offset={x:e,y:n}});var o,s,r;if(!t.renderer)throw new Error("Five Render \u672A\u521D\u59CB\u5316");this.five=t,this.scale=(o=e==null?void 0:e.scale)!=null?o:2,this.width=(s=e==null?void 0:e.width)!=null?s:190,this.height=(r=e==null?void 0:e.height)!=null?r:190,this.config={dragEnabled:(e==null?void 0:e.dragEnabled)||!1,autoFixPCPosition:(e==null?void 0:e.autoFixPCPosition)||!1,initialPosition:(e==null?void 0:e.initialPosition)||{left:"0",top:"0"}};const n=this.canvas.getContext("2d");if(!n)throw new Error("CANNOT CREATE CONTEXT2D");this.context=n,this.config.dragEnabled&&(this.hammer=new Pn.default(this.canvas),this.hammer.on("pan",this.onPan),this.hammer.on("panstart",this.onPanstart),this.hammer.on("panend",this.onPanend)),this.initStyle()}dispose(){var t;this.clear(),this.disable(),(t=this.hammer)==null||t.destroy()}enable(){if(!this.state.enabled)return this.state.enabled=!0,this.containerDom&&this._appendTo(this.containerDom),this}disable(){if(!!this.state.enabled)return this.state.enabled=!1,this.canvas.remove(),this}appendTo(t){return this.containerDom=t,this.state.enabled&&this._appendTo(t),this}clear(){return this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this}renderWithPoint(t){!this.containerDom||!this.state.enabled||(this.renderCenter=t,this.render(),this.config.autoFixPCPosition&&this.autoFixPCPosition())}renderWithScreenPoint(t){!this.containerDom||!this.state.enabled||(this.renderCenter=t,this.render(),this.config.autoFixPCPosition&&this.autoFixPCPosition())}resetOffset(){this.offset={x:0,y:0},this.canvas.style.transform=`translate3d(${0}px, ${0}px, 100px)`}getCurrentState(){return{enabled:this.state.enabled}}getRenderCenter(){return this.renderCenter}_appendTo(t){if(this.resetOffset(),t.appendChild(this.canvas),!this.offsetRange){const e=this.canvas.getBoundingClientRect(),n=t.getBoundingClientRect(),o=n.right-e.right,s=n.bottom-e.bottom,r=n.left-e.left,a=n.top-e.top;this.offsetRange={min:{x:r,y:a},max:{x:o,y:s}}}}autoFixPCPosition(){if(!this.containerDom)return;const{width:t,height:e}=this,[n,o,s]=(()=>{if(this.renderCenter instanceof E.Vector3){const r=this.renderCenter.clone().project(this.five.camera);return[(r.x+1)/2*this.containerDom.clientWidth,-(r.x-1)/2*this.containerDom.clientWidth,-(r.y-1)/2*this.containerDom.clientHeight]}else return[this.renderCenter.x,this.containerDom.clientWidth-this.renderCenter.x,this.renderCenter.y]})();n<183?(this.canvas.style.top=-e/2+"px",this.canvas.style.left=90+"px"):s<183?(this.canvas.style.top=90+"px",this.canvas.style.left=-t/2+"px"):o<183?(this.canvas.style.top=-e/2+"px",this.canvas.style.left=-t-90+"px"):(this.canvas.style.left=-t/2+"px",this.canvas.style.top=-e-90+"px"),this.canvas.style.transform=`translate3d(${n}px, ${s}px, 10px)`,this.offset={x:n,y:s}}render(){if(!this.five.renderer||!this.containerDom)return;const{scale:t,context:e,width:n,height:o}=this,s=this.five.renderer.getSize(new E.Vector2),[r,a]=(()=>{if(this.renderCenter instanceof E.Vector3){const A=this.renderCenter.clone().project(this.five.camera);return[(A.x+1)/2*s.x,(A.y+1)/2*s.y]}else return[this.renderCenter.x,s.y-this.renderCenter.y]})(),l=1,c=n/t,u=o/t,h=l*t,d=this.five.getPixels(r-c/2,a-c/2,c,u,h),m=Math.floor(n*l),g=Math.floor(o*l);Uf(d,m,g);const p=new ImageData(m,g);p.data.set(d),e.putImageData(p,0,0)}initStyle(){const t=this.canvas;t.classList.add("five-plugin__magnifier"),t.style.position="absolute",t.style.pointerEvents="all",t.style.borderRadius="50%",t.style.zIndex="99";const e=1;t.setAttribute("width",(this.width*e).toString()),t.setAttribute("height",(this.height*e).toString()),t.style.border="2px solid rgba(255,255,255,0.20)",t.style.width=this.width+"px",t.style.height=this.height+"px",t.style.top=this.config.initialPosition.top,t.style.left=this.config.initialPosition.left,t.style.transform="translate(0,0,100px)",this.config.dragEnabled&&(this.canvas.style.cursor="pointer")}getPanOffset(t,e){const{min:{x:n,y:o},max:{x:s,y:r}}=e,a=this.offset.x+t.deltaX,l=this.offset.y+t.deltaY,c=Math.min(Math.max(a,n),s),u=Math.min(Math.max(l,o),r);return{translateX:c,translateY:u}}}class qf{constructor(t){f(this,"edges",[]);f(this,"five");f(this,"onModelLoaded",()=>{!this.five.model||(this.edges=this.five.model.getEdges())});this.five=t,this.five.model.loaded?this.onModelLoaded():this.five.on("modelLoaded",this.onModelLoaded)}dispose(){}getAdsorbentPoint(t){if(this.edges.length===0)return null;let e=1/0,n;return this.edges.forEach(o=>{const s=o.closestPointToPoint(t.point,!0,new j.Vector3),r=s.distanceTo(t.point);r<e&&(n=s,e=r)}),e>.1?null:n||null}}function Jf(i,t){for(let e=0,n=t.length;e<n;e++)if(i===t[e])return t.splice(e,1)[0]}class Je{constructor(t){f(this,"id");f(this,"lines");f(this,"position");f(this,"type","point");this.id=_e(),this.lines=[],this.position=new j.Vector3,t instanceof j.Vector3?this.position.copy(t):this.position.fromArray(t)}toJson(){return{id:this.id,position:this.position.toArray()}}addLine(t){this.lines.push(t)}removeLine(t){Jf(t,this.lines)}clone(){return new Je(this.position)}}class Ci{constructor(t){f(this,"id",_e());f(this,"lines",[]);f(this,"points",[]);f(this,"visiblePanoIndexes");f(this,"model");f(this,"type","polyline");f(this,"hook",new Ce.Subscribe);this.model=t.model}addLine(t){if(this.includes(t)){console.error(new Error("\u4E0D\u80FD\u91CD\u590D\u6DFB\u52A0\u7EBF\u6BB5"));return}const e=this.getLastPoint(),n=e&&t.findAnotherPoint(e);e?e&&n?(this.lines.push(t),this.points.push(...t.points),this.hook.emit("lineAdded",t)):console.error(new Error("\u4F20\u5165\u7EBF\u6BB5\u65E0\u6CD5\u4E0E\u5F53\u524D\u6298\u7EBF\u8FDB\u884C\u8FDE\u63A5")):(this.lines.push(t),this.points.push(...t.points),this.hook.emit("lineAdded",t))}removeLine(t){if(this.lines.length!==0){if(!this.isLastLine(t)){console.error(new Error("\u4F20\u5165\u7EBF\u6BB5\u4E0D\u662F\u5F53\u524D\u6298\u7EBF\u7684\u6700\u540E\u4E00\u6BB5"));return}this.lines.pop(),this.lines.length===0?this.points.slice(0,this.points.length):this.points.pop(),this.hook.emit("lineRemoved",t)}}isLastLine(t){const e=this.getLastLine();return e?t.id===e.id:!1}getLastLine(){return this.lines.slice(-1)[0]}clear(){this.lines.slice(0,this.lines.length),this.points.slice(0,this.points.length)}overlapWith(t){return t.type==="point"?this.includes(t):t.type==="line"?t.points.some(e=>this.includes(e)):t.type==="polyline"?t.points.some(e=>this.includes(e)):!0}includes(t){return t.type==="point"?this.points.find(({id:e})=>e===t.id)!==void 0:t.type==="line"?this.lines.find(({id:e})=>e===t.id)!==void 0:!1}isEmpty(){return this.points.length===0}getLastPoint(){return this.points.slice(-1)[0]}toJson(){return{id:this.id,lines:this.lines.map(t=>t.toJson()),visiblePanoIndexes:this.visiblePanoIndexes}}getPointByID(t){return this.points.find(({id:e})=>e===t)}fromJson(t){this.clear(),this.id=t.id;const{getPoint:e,getAllPoints:n}=r(),o=t.lines.map(a=>{const[l,c]=a.points,u=e(l),h=e(c);if(!u||!h)throw new Error("\u7EBF\u4E0A\u7684\u70B9\u4E0D\u5B58\u5728");const d=new zt(u,h,this.model);return d.id=a.id,d.text=a.text,d}),s=n();this.points.push(...s),this.lines.push(...o),this.visiblePanoIndexes=t.visiblePanoIndexes;function r(){const a=new Map;function l(u){const h=a.get(u.id);if(h)return h;const d=new Je(u.position);return d.id=u.id,a.set(u.id,d),d}function c(){return Array.from(a.values())}return{getPoint:l,getAllPoints:c}}return this}replace(t){this.id=t.id,this.clear(),this.lines.push(...t.lines),this.points.push(...t.points)}}const Zf=1,Kf=3,$f=new j.Color(16777215),em=new j.Color(6522623),tm=new j.Color(16777215),nm=new j.Color(6522623),im=6,om=8,sm="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgBAMAAACBVGfHAAAAIVBMVEUAAAD////////////////////////////////////////PIev5AAAACnRSTlMAG/Py2baba05un7UgfgAAAHJJREFUKM9joBpgLHVSCRdA4metAoJlCJHmVWBgAeNzroKCCVCBLpjACqgJVjCBxRBT2FbBQQJYQAohsBAsUIUQWA4WiEIILAULeCEEloAFtBACizAEMLRgGIphLabDMJ2O6TlM72MGECIIMQIZIxqoBQCPvpJ/e9FaAAAAAABJRU5ErkJggg==",Al=new j.TextureLoader().load(sm),vl={pointTexture:Al,pointSize:im,lineWidth:Zf,lineColor:$f,pointColor:tm,lineRenderOrder:20,pointsRenderOrder:20};fe(Q({},vl),{dashed:!0});const rm={pointTexture:Al,pointSize:om,lineWidth:Kf,lineColor:em,pointColor:nm,lineRenderOrder:10,pointsRenderOrder:10};function am(i,t,e){var u,h,d,m,g;const n=(u=e==null?void 0:e.lineWidth)!=null?u:2,o=(h=e==null?void 0:e.lineColor)!=null?h:new j.Color(16777215),s=(d=e==null?void 0:e.pointSize)!=null?d:5,r=(m=e==null?void 0:e.lineRenderOrder)!=null?m:10,a=(g=e==null?void 0:e.lineRenderOrder)!=null?g:20,l=new pa.Line(i,t);l.setMaterial({linewidth:n,color:o}),l.line.material.depthTest=!1,l.line.material.transparent=!0,l.line.renderOrder=r,l.points.renderOrder=a;const c=l.points.material;return c.depthTest=!1,c.size=s,e!=null&&e.pointColor&&c.color.set(e.pointColor).convertSRGBToLinear(),e!=null&&e.pointTexture&&(c.map=e.pointTexture),l}function Ms(i,t){const[e,n]=i.points,o=t==="light"?rm:vl,s=am(e.position,n.position,o);return s.name="normalLine_"+i.id,s}function En(i){const{x:t,y:e,z:n}=i;return!(Math.abs(t)>1||Math.abs(e)>1||Math.abs(n)>1)}function Oi(i){const{z:t}=i;return!(Math.abs(t)>1)}function lm(){const i=document.createElement("div");return i.setAttribute("style","backdrop-filter: blur(4px);-webkit-backdrop-filter: blur(4px);-webkit-tap-highlight-color: rgba(0,0,0,0);"),i.style.width="max-content",i.style.padding="3px 6px",i.style.lineHeight="1",i.style.textAlign="center",i.style.transform="translate(-50%, -50%)",i.style.borderRadius="100px",i.style.fontSize="14px",i.style.color="#fff",i.style.background="rgba(195,195,195,0.70)",i.style.border="0.5px solid rgba(255,255,255,0.6)",i.style.cursor="pointer",i}function cm(i){const t=document.createElement("div");return t.id="distance_"+i.id,t.classList.add("five-plugin-measure__distance"),t.style.opacity="0",t.style.position="absolute",t.style.left="0",t.style.top="0",t.style.width="0",t.style.height="0",t.style.transform="translate3d(0, 0, 0)",t.style.transformOrigin="left top",t}function um(i){let t=!0;const{line:e}=i,n=e.id,o=lm(),s=cm(e),r=i.userDistanceItem,a=new j.Vector3(0,0,0),l={lineID:n,ndcPosition:a,update:d,appendTo:m,remove:g,highlight:u,unHighlight:h,getCurrentContent:p,setItemSelectable:A};s.style.pointerEvents=t?"all":"none",r!=null&&r.element?s.appendChild(r.element):s.appendChild(o);function c(){var v;(v=i.clickCallback)==null||v.call(i,l)}function u(){if(r)return r.highlight();o.style.border="0.5px solid #95AEFF",o.style.background="linear-gradient(90deg, #95AEFF 0%, #6386FF 100%)"}function h(){if(r)return r.unHighlight();o.style.border="0.5px solid rgba(255,255,255,0.6)",o.style.background="rgba(195,195,195,0.70)"}function d(v){if(e.mesh.visible===!1){s.style.opacity="0",s.style.pointerEvents="none";return}const b=v.getElement();if(!b)return;const w=b.clientWidth,k=b.clientHeight,C=w/2,I=k/2;if(e.points.length<2)return;const[B,x]=e.points,H=B.position.clone().project(v.camera),N=x.position.clone().project(v.camera),R=H.clone().lerp(N,.5),O=new j.Vector2(H.x*C,H.y*I),S=new j.Vector2(N.x*C,N.y*I),F=O.distanceTo(S);if((()=>!(Math.abs(H.z)>1||Math.abs(N.z)>1||!Oi(H)&&!Oi(N)||!Oi(R)||F===0))()===!1){s.style.opacity="0",s.style.pointerEvents="none";return}const Y=(R.x+1)/2*w,W=-(R.y-1)/2*k,U=-(Math.atan((O.y-S.y)/(O.x-S.x))*180)/Math.PI,ae=s.parentElement&&o.clientWidth>F?-20:0;s.style.transform=`translate(${Y}px, ${W}px) rotate(${U}deg) translateY(${ae}px)`,s.style.opacity="1",s.style.pointerEvents=t?"all":"none",r&&r.update({line:e,polyline:e.getPolyline()});const he=p();o.innerText=he}function m(v){v.appendChild(s),s.addEventListener("click",c)}function g(){o.removeEventListener("click",c),s.remove()}function p(){var B,x,H;if(e.points.length<2)return"";const[v,b]=e.points,w=v.position.clone().distanceTo(b.position),k=(B=i.line.text)!=null?B:i.line.model.config.defaultText,C=(H=(x=i.line.model.config)==null?void 0:x.getDistanceText)==null?void 0:H.call(x,w),I=k!=null?k:C;return I!=null?I:w.toFixed(2)+"m"}function A(v){t=v}return l}class zt{constructor(t,e,n){f(this,"id");f(this,"selected",!1);f(this,"text");f(this,"type","line");f(this,"model");f(this,"mesh");f(this,"points");f(this,"lightMesh");f(this,"hook");f(this,"distanceItem");f(this,"polyline");var o;if(this.id=_e(),this.model=n,t.id===e.id)throw new Error("\u65E0\u6548\u7684\u7EBF\u6BB5, \u4E00\u4E2A\u70B9\u65E0\u6CD5\u6784\u6210\u7EBF\u6BB5");typeof n.config.defaultText=="string"&&(this.text=n.config.defaultText),this.hook=new Ce.Subscribe,this.points=[t,e],this.mesh=Ms(this,"normal"),this.lightMesh=Ms(this,"light"),this.distanceItem=um({line:this,clickCallback:()=>this.hook.emit("selected",this),userDistanceItem:(o=this.model.config)!=null&&o.userDistanceItemCreator?this.model.config.userDistanceItemCreator():void 0}),t.lines.push(this),e.lines.push(this)}clear(){this.selected=!1,this.polyline=void 0}isEmpty(){return this.points.length===0}getPolyline(){if(this.polyline)return this.polyline;const t=this.model.polylines.find(e=>e.lines.includes(this));if(t)return this.polyline=t,t}findAnotherPoint(t){return this.points.find(({id:e})=>e!==t.id)}setText(t){this.text=t,this.hook.emit("textChanged",t)}toJson(){return{id:this.id,points:this.points.map(t=>t.toJson()),text:this.text}}clone(){const t=new zt(this.points[0].clone(),this.points[1].clone(),this.model);return t.text=this.text,t}}class Ei{constructor(t){f(this,"config");f(this,"polylines",[]);f(this,"hook",new Ce.Subscribe);this.config=t}addPolyline(t){if(this.includes(t)){console.error(new Error("\u4E0D\u80FD\u91CD\u590D\u6DFB\u52A0 polyline"));return}this.polylines.push(t),this.hook.emit("polylineAdded",t)}replacePolylineByID(t,e){const n=this.getPolylineByID(t);n==null||n.replace(e)}removePolyline(t){const e=this.polylines.findIndex(({id:n})=>n===t.id);if(e===-1){console.error(new Error("polyline \u4E0D\u5B58\u5728"));return}this.polylines.splice(e,1),this.hook.emit("polylineRemoved",t)}getPolylineByID(t){return this.polylines.find(e=>e.id===t)}getPolylineByLine(t){return this.polylines.find(e=>e.includes(t))}getLineByID(t){return this.getAllLines().find(e=>e.id===t)}getAllLines(){return this.polylines.map(t=>t.lines).flat(1)}getAllPoints(){return this.polylines.map(t=>t.points).flat(1)}includes(t){return this.polylines.find(({id:e})=>e===t.id)!==void 0}clear(){this.polylines.forEach(t=>this.hook.emit("polylineRemoved",t)),this.polylines.splice(0,this.polylines.length)}getClosestPoint(){}parse(t){this.clear(),this.polylines.push(...t.polylines.map(e=>new Ci({model:this}).fromJson(e))),this.polylines.forEach(e=>this.hook.emit("polylineAdded",e))}toJson(){return{polylines:this.polylines.map(t=>t.toJson()).filter(t=>t.lines.length>0)}}}const Gn=i=>i.preventDefault();class Pi{constructor(t){f(this,"model");f(this,"five");f(this,"group");f(this,"config");f(this,"dashed");f(this,"disposed",!1);f(this,"isMobile");f(this,"mouseGroup");f(this,"container");f(this,"fiveHelper");f(this,"hook");f(this,"magnifier");f(this,"userDistanceItemCreator");f(this,"updateDistanceUI",()=>{this.dashed.distanceItem.update(this.five),this.model.getAllLines().forEach(t=>t.distanceItem.update(this.five))});var n,o;this.five=t.five,this.hook=t.hook,this.model=t.model,this.config=t.config,this.magnifier=t.magnifier,this.container=t.container,this.fiveHelper=t.fiveHelper,this.isMobile=(o=(n=t.openParams)==null?void 0:n.isMobile)!=null?o:!1,this.userDistanceItemCreator=t.userDistanceItemCreator,this.group=t.group,this.mouseGroup=t.mouseGroup,this.dashed=new zt(new Je([0,0,0]),new Je([0,0,0]),this.model),this.dashed.distanceItem.setItemSelectable(!1),this.dashed.mesh.setMaterial({dashed:!0,dashScale:100}),this.dashed.mesh.name="dashLine";const e=this.five.getElement();e&&(e.addEventListener("touchstart",Gn),e.addEventListener("contextmenu",Gn))}removeLine(t){this.group.remove(t.mesh,t.lightMesh),t.distanceItem.remove(),this.five.needsRender=!0}updateMouseGroup(t,e){if(!t)return this.mouseGroup;const n=this.fiveHelper.getAdsorbentPoint(t),o=n||t.point;if(this.mouseGroup.position.copy(o),e)this.mouseGroup.quaternion.copy(e.quaternion);else if(t.face){const r=t.face.normal.clone().multiplyScalar(.05),l=t.point.clone().add(r).clone().add(r);this.mouseGroup.lookAt(l)}return this.mouseGroup}dispose(){this.disposed=!0,this.magnifier.disable(),this.model.getAllLines().forEach(e=>this.removeLine(e));const t=this.five.getElement();t&&(t.removeEventListener("touchstart",Gn),t.removeEventListener("contextmenu",Gn))}}function oo(i){const{x:t,y:e}=i.center,{clientWidth:n,clientHeight:o}=i.target,s=i.target.getBoundingClientRect(),r=new j.Vector2(t,e).sub(new j.Vector2(s.left,s.top)),a=new j.Vector2(r.x/n*2-1,-(r.y/o)*2+1);return{point:r,ndcPoint:a}}function Ri(i,t){const e=oo(t).ndcPoint,n=new j.Raycaster;return n.setFromCamera(e,i.camera),i.model.intersectRaycaster(n)}class Wn extends Pi{constructor(e){var o;super(e);f(this,"type","edit");f(this,"polyline");f(this,"pressPoint");f(this,"hasAppendDashed",!1);f(this,"hasAppendMouseGroup",!1);f(this,"fiveElement");f(this,"lastPoint",null);f(this,"hammer");f(this,"onIntersectionUpdate",Po((e,n)=>{var s;this.hasAppendMouseGroup===!1&&(this.group.add(this.mouseGroup),this.magnifier.appendTo(this.container),this.magnifier.enable(),this.hasAppendMouseGroup=!0);const o=this.updateMouseGroup(e,n).position;(s=this.pressPoint)==null||s.position.copy(o),this.updateDashed(),requestAnimationFrame(()=>this.magnifier.renderWithPoint(this.mouseGroup.position)),this.five.needsRender=!0},20));f(this,"revoke",()=>{if(this.polyline.lines.length===0&&this.lastPoint){this.lastPoint=null,this.hasAppendDashed=!1,this.dashed.distanceItem.remove(),this.group.remove(this.dashed.mesh),this.hook.emit("anchorChange",null),this.hook.emit("editedDashedLineChange",null),this.five.needsRender=!0;return}if(this.polyline.lines.length===0&&!this.lastPoint||!this.lastPoint)return;const e=this.polyline.lines[this.polyline.lines.length-1],n=e.findAnotherPoint(this.lastPoint);!n||(this.lastPoint=n,this.hook.emit("anchorChange",n.position),this.group.remove(e.mesh),this.polyline.removeLine(e),this.hasAppendMouseGroup=!1,this.mouseGroup.position.copy(this.lastPoint.position),this.group.remove(this.mouseGroup),e.distanceItem.remove(),this.updateDashed(),this.magnifier.disable(),this.five.needsRender=!0)});f(this,"onMouseLeave",()=>{this.magnifier.disable(),this.group.remove(this.mouseGroup),this.hasAppendMouseGroup=!1,this.lastPoint&&(this.mouseGroup.position.copy(this.lastPoint.position),this.updateDashed())});f(this,"onLineChanged",()=>{this.hook.emit("editedPolylineChange",this.polyline)});f(this,"onPress",e=>{const[n]=Ri(this.five,e);if(!(n!=null&&n.face))return;const o=new Je(n.point);this.pressPoint=o,this.onIntersectionUpdate(n)});f(this,"onPan",e=>{if(!this.pressPoint)return;const[n]=Ri(this.five,e);!(n!=null&&n.face)||this.onIntersectionUpdate(n)});f(this,"onPanEnd",e=>{!this.pressPoint||this.onTap(e)});f(this,"onTap",e=>{this.hasAppendDashed||(this.dashed.distanceItem.appendTo(this.container),this.group.add(this.dashed.mesh)),this.hasAppendDashed=!0;const[n]=Ri(this.five,e);this.updateMouseGroup(n);const o=new Je(this.mouseGroup.position),s=this.lastPoint;if(o&&(this.lastPoint=o),o&&s){const r=new zt(s,o,this.model);r.distanceItem.setItemSelectable(!1),r.distanceItem.appendTo(this.container),this.polyline.addLine(r),this.group.add(r.mesh),r.distanceItem.update(this.five)}this.pressPoint=void 0,this.hasAppendMouseGroup=!1,this.magnifier.disable(),this.group.remove(this.mouseGroup),this.updateDashed(),this.five.needsRender=!0,this.hook.emit("anchorChange",o.position)});f(this,"onWantsTapGesture",()=>!1);f(this,"onWantsToMoveToPano",()=>!1);f(this,"onWantsPanGesture",()=>this.pressPoint?!1:void 0);f(this,"onCameraUpdate",()=>{this.updateDistanceUI(),this.dashed.distanceItem.update(this.five)});f(this,"updateDashed",()=>{!this.lastPoint||(this.dashed.points[0].position.copy(this.lastPoint.position),this.dashed.points[1].position.copy(this.mouseGroup.position),this.dashed.mesh.setPoints(this.lastPoint.position,this.mouseGroup.position),this.dashed.distanceItem.update(this.five),this.hook.emit("editedDashedLineChange",this.dashed))});this.model=new Ei(this.config),this.polyline=new Ci({model:this.model}),this.model.addPolyline(this.polyline),this.five.on("cameraUpdate",this.onCameraUpdate),this.five.on("wantsPanGesture",this.onWantsPanGesture),this.five.on("wantsTapGesture",this.onWantsTapGesture),this.five.on("wantsToMoveToPano",this.onWantsToMoveToPano),this.five.on("intersectionOnModelUpdate",this.onIntersectionUpdate),this.polyline.hook.on("lineAdded",this.onLineChanged),this.polyline.hook.on("lineRemoved",this.onLineChanged);const n=this.five.getElement();if(n){this.fiveElement=n;const s=new Pn.default(n);this.hammer=s,s.on("tap",this.onTap),s.on("pan",this.onPan),s.on("press",this.onPress),s.on("panend",this.onPanEnd)}this.five.helperVisible=!1,(o=this.fiveElement)==null||o.addEventListener("mouseleave",this.onMouseLeave),this.hook.emit("anchorChange",null),this.hook.emit("editedDashedLineChange",null),this.five.refresh()}dispose(){var e,n;super.dispose(),this.five.helperVisible=!0,this.group.remove(this.mouseGroup,this.dashed.mesh),this.five.off("cameraUpdate",this.onCameraUpdate),this.five.off("wantsPanGesture",this.onWantsPanGesture),this.five.off("wantsTapGesture",this.onWantsTapGesture),this.five.off("wantsToMoveToPano",this.onWantsToMoveToPano),this.five.off("intersectionOnModelUpdate",this.onIntersectionUpdate),this.polyline.hook.off("lineAdded",this.onLineChanged),this.polyline.hook.off("lineRemoved",this.onLineChanged),(e=this.hammer)==null||e.destroy(),(n=this.fiveElement)==null||n.removeEventListener("mouseleave",this.onMouseLeave),this.magnifier.dispose(),this.dashed.distanceItem.remove(),this.five.needsRender=!0}getEditingLines(){return this.polyline.lines}}class Ts extends Pi{constructor(e){super(e);f(this,"type","view");f(this,"hammer");f(this,"polylineRemoved",e=>{e.lines.forEach(n=>this.removeLine(n)),this.hook.emit("selectedChange",this.model.getAllLines().filter(n=>n.selected).map(n=>n))});f(this,"polylineAdded",e=>{const n=this.five.getCurrentState().panoIndex;e.lines.forEach(o=>{e.visiblePanoIndexes&&!e.visiblePanoIndexes.includes(n)&&(o.mesh.visible=!1),o.distanceItem.appendTo(this.container),o.distanceItem.update(this.five),this.group.add(o.mesh)})});f(this,"onCameraUpdate",()=>{this.updateDistanceUI()});f(this,"onFivePanoWillArrive",e=>{this.model.polylines.forEach(n=>{!n.visiblePanoIndexes||n.visiblePanoIndexes.includes(e)||n.lines.forEach(o=>{o.mesh.visible=!1,o.distanceItem.update(this.five)})})});f(this,"onFivePanoArrived",e=>{this.model.polylines.forEach(n=>{!n.visiblePanoIndexes||n.visiblePanoIndexes.includes(e)&&n.lines.forEach(o=>{o.mesh.visible=!0,o.distanceItem.update(this.five)})})});this.model.getAllLines().forEach(o=>{o.distanceItem.appendTo(this.container),o.distanceItem.update(this.five),this.group.add(o.mesh)});const n=this.five.getElement();if(n){const o=new Pn.default(n);this.hammer=o}this.onFivePanoWillArrive(this.five.getCurrentState().panoIndex),this.onFivePanoArrived(this.five.getCurrentState().panoIndex),this.updateDistanceUI(),this.five.needsRender=!0,this.model.hook.on("polylineAdded",this.polylineAdded),this.model.hook.on("polylineRemoved",this.polylineRemoved),this.five.on("cameraUpdate",this.onCameraUpdate),this.five.on("panoArrived",this.onFivePanoArrived),this.five.on("panoWillArrive",this.onFivePanoWillArrive)}dispose(){var e;super.dispose(),this.model.hook.off("polylineAdded",this.polylineAdded),this.model.hook.off("polylineRemoved",this.polylineRemoved),this.five.off("cameraUpdate",this.onCameraUpdate),this.five.off("panoArrived",this.onFivePanoArrived),this.five.off("panoWillArrive",this.onFivePanoWillArrive),this.five.needsRender=!0,this.hook.emit("selectedChange",[]),(e=this.hammer)==null||e.destroy()}}const dm=`
|
|
284
|
+
`,b=document.createElement("div");return b.setAttribute("class","PanoRulerPlugin-rule"),b.setAttribute("data-name",p),b.setAttribute("style","display: none"),b.innerHTML=v,b},o=document.createElement("div");o.setAttribute("style","position: absolute;pointer-events: none;width: 100%;height: 100%;left: 0;top: 0;overflow: hidden;");const s=document.createElement("div");s.innerHTML=Df,o.appendChild(s);const r={},a=(p,A)=>{if(e.loaded)throw new Error("\u6807\u5C3A\u88AB\u91CD\u590D\u521D\u59CB\u5316\uFF01");const v=Sf(p,i),b=i.work;if(!b)return!1;for(const w in A){const k=A[w],{standingPosition:I}=b.observers[0],C=k.map(({x:T,z:x,observers:H})=>{const N=H.length>0?p.rooms[p.observers[H[0]]].name:"",R=v[N]?v[N].floor:null;let O=1/0,S={index:0,x:I.x,y:I.y,z:I.z};H.forEach(U=>{if(!b.observers[U])return;const{standingPosition:ae}=b.observers[U],he={index:U,x:ae.x,y:ae.y,z:ae.z},de=Lf({x:T,z:x},he);R?de<O&&Math.abs(he.y-R)<.3&&(O=de,S=he):de<O&&(O=de,S=he)});const Q=new j.Vector3(T,S.y,x);Object.assign(Q,{observers:H});const _=v[N]?v[N].roof:null,X=_?new j.Vector3(T,_,x):null;return X&&Object.assign(X,{observers:H}),{origin:Q,vertical:X}});r[w]={origins:C.map(T=>T.origin),rules:[]};for(const{origin:T,vertical:x}of C){if(!x)continue;const H=n(w,T.distanceTo(x));o.append(H),r[w].rules.push({vertical:!0,rule:[T,x],$element:H})}for(let T=0;T<C.length;T++){let x=T+1;x>=C.length&&(x=0);const{origin:H}=C[T],{origin:N}=C[x],R=n(w,H.distanceTo(N));o.append(R),r[w].rules.push({vertical:!1,rule:[H,N],$element:R})}}return e.loaded=!0,!0},l=(p,A,v)=>G(exports,null,function*(){const b=p||t.roomInfo,w=A||t.roomRules;if(!b||!w)throw new Error("\u6807\u5C3A\u6570\u636E\u4F9D\u8D56\u4E0D\u9F50\u5168\uFF01");return e.loaded=!1,e.options=F(F({},e.options),v||{}),i.model.loaded?a(b,w):yield new Promise(k=>i.once("modelLoaded",()=>k(a(b,w))))});t.roomInfo&&t.roomRules&&l(t.roomInfo,t.roomRules);const c=(p,A,v,b)=>{const w=[[{x:0,y:0},{x:v,y:0}],[{x:0,y:0},{x:0,y:b}],[{x:v,y:0},{x:v,y:b}],[{x:0,y:b},{x:v,y:b}]],k=[];for(let I=0;I<w.length;I++){const C=ml([p,A],[w[I][0],w[I][1]],!0);C&&k.push(C)}return k.length===0?!1:k},u=()=>{var H;const p=(H=i.getElement())==null?void 0:H.parentElement;if(!p||!e.loaded||Object.keys(r).length<=0)return;const{panoIndex:A,camera:v,currentMode:b}=i;if(A===void 0)return;let w;for(const N in r)N.split(",").indexOf(A.toString())>=0&&(w=N);if(!w){for(const N in r)for(const{$element:R}of r[N].rules)R.style.display="none";return}const k=v.position,I=v.getWorldDirection(new j.Vector3),C=p.clientWidth,T=p.clientHeight;if(b!==Ce.Five.Mode.Panorama){for(const N in r)for(const{$element:R}of r[N].rules)R.style.display="none";return}for(const N in r)for(const{$element:R}of r[N].rules)R.style.display=N===w?"block":"none";const[x]=r[w].origins.slice().filter(N=>N.observers.indexOf(A)>=0).sort((N,R)=>{const O=N.clone().setY(0).sub(k).normalize().angleTo(I.clone().setY(0)),S=R.clone().setY(0).sub(k).normalize().angleTo(I.clone().setY(0));return O-S});for(const{rule:N,vertical:R,$element:O}of r[w].rules){const[S,Q]=N,_=O.querySelector(".PanoRulerPlugin-rule-line");if(!_)return;if(!x){O.style.display="none";continue}if(S!==x&&Q!==x){O.style.display="none";continue}if(S.distanceTo(Q)<.3){O.style.display="none";continue}if(S.observers.indexOf(A)===-1||Q.observers.indexOf(A)===-1){O.style.display="none";continue}if(S.clone().sub(k).normalize().angleTo(I)>Math.PI/2){O.style.display="none";continue}if(Q.clone().sub(k).normalize().angleTo(I)>Math.PI/2){O.style.display="none";continue}const $=S.distanceTo(Q);if(Q.clone().sub(Q.clone().sub(S).divide(new j.Vector3(2,2,2))).distanceTo(k)/$>8){O.style.display="none";continue}const he=S.clone().project(v),de=(he.x+1)/2*C,pe=(-he.y+1)/2*T,Pe=Q.clone().project(v),ke=(Pe.x+1)/2*C,Te=(-Pe.y+1)/2*T,ce=Math.sqrt(Math.pow(ke-de,2)+Math.pow(Te-pe,2));let Ae=ce,Ee=50;const ue=c({x:~~de,y:~~pe},{x:~~ke,y:~~Te},C,T);if(ue&&ue.length===1&&(x===S?(Ae=Math.sqrt(Math.pow(ue[0].x-de,2)+Math.pow(ue[0].y-pe,2)),Ee=Ae/ce*50):x===Q&&(Ae=Math.sqrt(Math.pow(ue[0].x-ke,2)+Math.pow(ue[0].y-Te,2)),Ee=100-Ae/ce*50)),ue&&ue.length===2){const te={x:(ue[0].x+ue[1].x)/2,y:(ue[0].y+ue[1].y)/2};Ee=Math.sqrt(Math.pow(te.x-de,2)+Math.pow(te.y-pe,2))/ce*100}const st=(Math.PI/2-Math.atan2(ke-de,pe-Te))/Math.PI*180,ye=_.querySelector(".PanoRulerPlugin-rule-label"),$e=ye.children[0].clientWidth;$e>=ce||$e/2>=Ee/100*ce||$e/2>=(1-Ee/100)*ce?_.style.display="none":(_.style.display="block",_.style.width=ce+"px",_.style.left=de+"px",_.style.top=pe+"px",_.style.transform=`rotate(${-st}deg)`,ye.style.left=`${Ee}%`)}},h=()=>gl(u),d=()=>{var p,A;return e.loaded?(e.enable||(o.setAttribute("class","PanoRulerPlugin"+(e.options.className?" "+e.options.className:"")),(A=(p=i.getElement())==null?void 0:p.parentElement)==null||A.append(o),u(),i.on("modeChange",u),i.on("cameraUpdate",h),e.enable=!0),!0):!1},m=()=>(e.enable&&(i.off("modeChange",u),i.off("cameraUpdate",h),o&&o.remove(),e.enable=!1),!0);function g(p){if(p.distanceText&&p.distanceText!==e.options.distanceText){const A=p.distanceText;e.options.distanceText=A,Object.values(r).forEach(v=>{v.rules.forEach(b=>{const[w,k]=b.rule,I=w.distanceTo(k),C=b.$element.querySelector(".PanoRulerPlugin-rule-label-name");!C||(C.innerText=A(I))})})}}return{enable:d,disable:m,load:l,state:e,changeConfigs:g}};function Tf(i){le(i,"svelte-1h27ktp",".PanoRulerPlugin-rule-line.svelte-1h27ktp.svelte-1h27ktp{position:absolute;transform-origin:left 0.0625rem;width:0;height:0.125rem;pointer-events:none}.PanoRulerPlugin-rule-line.svelte-1h27ktp.svelte-1h27ktp::after{content:'';position:absolute;left:-0.125rem;top:-0.1rem;width:0.25rem;height:0.25rem;border-radius:50%;background:#fff;z-index:1;animation:svelte-1h27ktp-viewport-rule-point 0.1s 1s;animation-fill-mode:both}.PanoRulerPlugin-rule-line.svelte-1h27ktp.svelte-1h27ktp::before{content:'';position:absolute;right:-0.125rem;top:-0.1rem;width:0.25rem;height:0.25rem;border-radius:50%;background:#fff;z-index:1;animation:svelte-1h27ktp-viewport-rule-point 0.1s 1.5s;animation-fill-mode:both}.PanoRulerPlugin-rule-line.svelte-1h27ktp em.svelte-1h27ktp{display:block;height:0.0625rem;animation:svelte-1h27ktp-viewport-rule-line 0.5s ease 1s;animation-fill-mode:both;box-shadow:0 0 0.25rem rgb(0 0 0 / 40%);position:relative}.rule-mixed-line.svelte-1h27ktp.svelte-1h27ktp{display:flex;height:0.0625rem;animation:svelte-1h27ktp-viewport-rule-line 0.5s ease 1s;animation-fill-mode:both;align-items:center}.em-solid.svelte-1h27ktp.svelte-1h27ktp{height:100%;background:#ffffff}.em-dotted.svelte-1h27ktp.svelte-1h27ktp{height:0.125rem;background:var(--background-image);background-position:center;background-repeat:repeat}.PanoRulerPlugin-rule-label.svelte-1h27ktp.svelte-1h27ktp{position:absolute;width:0;height:0;top:0.0625rem;pointer-events:none}.PanoRulerPlugin-rule-label-name.svelte-1h27ktp.svelte-1h27ktp{position:absolute;padding:0.1875rem 0.375rem;background:rgba(195, 195, 195, 0.3);backdrop-filter:blur(0.25rem);-webkit-backdrop-filter:blur(0.25rem);border-radius:6.25rem;border:0.0625rem solid rgba(255, 255, 255, 0.6);white-space:nowrap;overflow:hidden;color:#ffffff;font-weight:500;font-size:0.75rem;line-height:1;animation:svelte-1h27ktp-viewport-rule-label 0.25s ease 1s;animation-fill-mode:both;box-shadow:inset 0 0 0.625rem 0 rgba(255, 255, 255, 0.3)}@keyframes svelte-1h27ktp-viewport-rule-line{0%{width:0%}100%{width:100%}}@keyframes svelte-1h27ktp-viewport-rule-label{0%{opacity:0;transform:scaleX(0)}100%{opacity:1;transform:translate(-50%, -50%) scaleX(1)}}@keyframes svelte-1h27ktp-viewport-rule-point{0%{transform:scaleX(0)}100%{transform:scaleX(1)}}")}function xs(i,t,e){const n=i.slice();return n[6]=t[e],n}function zf(i){let t,e=i[0].children,n=[];for(let o=0;o<e.length;o+=1)n[o]=Ds(xs(i,e,o));return{c(){t=B("div");for(let o=0;o<n.length;o+=1)n[o].c();y(t,"class","rule-mixed-line svelte-1h27ktp")},m(o,s){M(o,t,s);for(let r=0;r<n.length;r+=1)n[r].m(t,null)},p(o,s){if(s&9){e=o[0].children;let r;for(r=0;r<e.length;r+=1){const a=xs(o,e,r);n[r]?n[r].p(a,s):(n[r]=Ds(a),n[r].c(),n[r].m(t,null))}for(;r<n.length;r+=1)n[r].d(1);n.length=e.length}},d(o){o&&L(t),ut(n,o)}}}function Bf(i){let t,e;return{c(){t=B("em"),y(t,"class",e=Ie(i[0].state?"em-solid":"em-dotted")+" svelte-1h27ktp"),y(t,"style",i[3])},m(n,o){M(n,t,o)},p(n,o){o&1&&e!==(e=Ie(n[0].state?"em-solid":"em-dotted")+" svelte-1h27ktp")&&y(t,"class",e),o&8&&y(t,"style",n[3])},d(n){n&&L(t)}}}function Ds(i){let t,e,n=`${i[6].width}px`;return{c(){t=B("div"),y(t,"class",e=Ie(i[6].state?"em-solid":"em-dotted")+" svelte-1h27ktp"),y(t,"style",i[3]),z(t,"width",n)},m(o,s){M(o,t,s)},p(o,s){s&1&&e!==(e=Ie(o[6].state?"em-solid":"em-dotted")+" svelte-1h27ktp")&&y(t,"class",e),s&8&&y(t,"style",o[3]),s&1&&n!==(n=`${o[6].width}px`)&&z(t,"width",n)},d(o){o&&L(t)}}}function Vf(i){let t,e,n,o,s=i[0].labelElement+"",r,a,l=`${i[0].labelOffset}%`,c=`${i[0].width}px`,u=`${i[0].left}px`,h=`${i[0].top}px`,d=`rotate(${i[0].rotateDeg}deg)`;function m(A,v){return A[0].children.length===0?Bf:zf}let g=m(i),p=g(i);return{c(){t=B("div"),p.c(),e=ee(),n=B("div"),o=B("div"),r=xe(s),y(o,"class","PanoRulerPlugin-rule-label-name svelte-1h27ktp"),Fe(()=>i[4].call(o)),y(n,"class","PanoRulerPlugin-rule-label svelte-1h27ktp"),z(n,"left",l),y(t,"class","PanoRulerPlugin-rule-line svelte-1h27ktp"),z(t,"width",c),z(t,"left",u),z(t,"top",h),z(t,"transform",d),z(t,"display",i[0].visible&&i[2]?"block":"none")},m(A,v){M(A,t,v),p.m(t,null),V(t,e),V(t,n),V(n,o),V(o,r),a=pi(o,i[4].bind(o))},p(A,[v]){g===(g=m(A))&&p?p.p(A,v):(p.d(1),p=g(A),p&&(p.c(),p.m(t,e))),v&1&&s!==(s=A[0].labelElement+"")&&Me(r,s),v&1&&l!==(l=`${A[0].labelOffset}%`)&&z(n,"left",l),v&1&&c!==(c=`${A[0].width}px`)&&z(t,"width",c),v&1&&u!==(u=`${A[0].left}px`)&&z(t,"left",u),v&1&&h!==(h=`${A[0].top}px`)&&z(t,"top",h),v&1&&d!==(d=`rotate(${A[0].rotateDeg}deg)`)&&z(t,"transform",d),v&5&&z(t,"display",A[0].visible&&A[2]?"block":"none")},i:Y,o:Y,d(A){A&&L(t),p.d(),a()}}}function jf(i,t,e){let n,{rulerItemProp:o}=t,s=!0,r,a="data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQiIHdpZHRoPSIxMiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+PGRlZnM+PGZpbHRlciBpZD0icHJlZml4X19hIiBoZWlnaHQ9IjQwMCUiIHdpZHR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i8+PHVzZSBzdHJva2U9IiNmZmYiIHN0cm9rZS1vcGFjaXR5PSIuNCIgeGxpbms6aHJlZj0iI3ByZWZpeF9fYiIvPjwvZz48L3N2Zz4=";function l(){r=this.offsetWidth,e(1,r)}return i.$$set=c=>{"rulerItemProp"in c&&e(0,o=c.rulerItemProp)},i.$$.update=()=>{i.$$.dirty&3&&(r>=o.width||r/2>=o.labelOffset/100*o.width||r/2>=(1-o.labelOffset/100)*o.width?e(2,s=!1):e(2,s=!0))},e(3,n=`--background-image: url(${a})`),[o,r,s,n,l]}class Of extends oe{constructor(t){super(),ie(this,t,jf,Vf,ne,{rulerItemProp:0},Tf)}}function Ls(i,t,e){const n=i.slice();return n[12]=t[e],n}function Ss(i){let t,e;return t=new Of({props:{rulerItemProp:i[12]}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.rulerItemProp=n[12]),t.$set(s)},i(n){e||(P(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function Rf(i){let t,e,n=i[0],o=[];for(let r=0;r<n.length;r+=1)o[r]=Ss(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()},m(r,a){M(r,t,a);for(let l=0;l<o.length;l+=1)o[l].m(t,null);e=!0},p(r,[a]){if(a&1){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),P(o[l],1)):(o[l]=Ss(c),o[l].c(),P(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)P(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&&L(t),ut(o,r)}}}function Ff(i,t,e){var p,A,v,b;let{five:n}=t,{rulerDatas:o}=t,{options:s}=t,r=[];const a=((A=(p=n.getElement())==null?void 0:p.parentElement)==null?void 0:A.clientWidth)||0,l=((b=(v=n.getElement())==null?void 0:v.parentElement)==null?void 0:b.clientHeight)||0,c=(w,k)=>{const I=[[{x:0,y:0},{x:a,y:0}],[{x:0,y:0},{x:0,y:l}],[{x:a,y:0},{x:a,y:l}],[{x:0,y:l},{x:a,y:l}]],C=[];for(let T=0;T<I.length;T++){const x=ml([w,k],[I[T][0],I[T][1]],!0);x&&C.push(x)}return C.length===0?!1:C},u=(w,k)=>{const I=w.clone().project(n.camera),C=(I.x+1)/2*a,T=(-I.y+1)/2*l,x=k.clone().project(n.camera),H=(x.x+1)/2*a,N=(-x.y+1)/2*l,R=Math.sqrt(Math.pow(H-C,2)+Math.pow(N-T,2));return{startLeft:C,startTop:T,endLeft:H,endTop:N,distance:R}},h=(w,k,I)=>{const C=n.camera.position,T=n.camera.getWorldDirection(new j.Vector3),x=w.clone().sub(C).normalize().angleTo(T),H=k.clone().sub(C).normalize().angleTo(T),N=w.distanceTo(k),O=k.clone().sub(k.clone().sub(w).divide(new j.Vector3(2,2,2))).distanceTo(C),{startLeft:S,startTop:Q,endLeft:_,endTop:X,distance:W}=u(w,k),U=-((Math.PI/2-Math.atan2(_-S,Q-X))/Math.PI)*180;let ae=!0;I||(ae=!1),!nt(w,I)&&!nt(k,I)&&(ae=!1),N<.3&&(ae=!1),x>Math.PI/2&&(ae=!1),H>Math.PI/2&&(ae=!1),O/N>8&&(ae=!1);let he=50,de=W;const pe=c({x:~~S,y:~~Q},{x:~~_,y:~~X});if(pe&&pe.length===1&&(nt(w,I)?(de=Math.sqrt(Math.pow(pe[0].x-S,2)+Math.pow(pe[0].y-Q,2)),he=de/W*50):nt(k,I)&&(de=Math.sqrt(Math.pow(pe[0].x-_,2)+Math.pow(pe[0].y-X,2)),he=100-de/W*50)),pe&&pe.length===2){const Pe={x:(pe[0].x+pe[1].x)/2,y:(pe[0].y+pe[1].y)/2};he=Math.sqrt(Math.pow(Pe.x-S,2)+Math.pow(Pe.y-Q,2))/W*100}return{startLeft:S,startTop:Q,distance:W,deg:U,visible:ae,labelOffset:he,ruleLength:N}},d=()=>{const w=n.panoIndex,k=o.find(R=>R.panoIndex===w);if(!k)return e(0,r=[]);if(n.currentMode!==Ce.Five.Mode.Panorama)return e(0,r=[]);const I=n.camera.position,C=n.camera.getWorldDirection(new j.Vector3),T=k.lines.map(R=>new j.Vector3(R.start[0],-R.start[1],-R.start[2])),x=k.lines.map(R=>new j.Vector3(R.end[0],-R.end[1],-R.end[2])),[H]=T.concat(x).sort((R,O)=>{const S=R.clone().setY(0).sub(I).normalize().angleTo(C.clone().setY(0)),Q=O.clone().setY(0).sub(I).normalize().angleTo(C.clone().setY(0));return S-Q}),N=k.lines.map(R=>{var de,pe;const O=R.start,S=R.end,{startLeft:Q,startTop:_,distance:X,deg:W,visible:$,labelOffset:U,ruleLength:ae}=h(new j.Vector3(O[0],-O[1],-O[2]),new j.Vector3(S[0],-S[1],-S[2]),H),he=[];return R.children&&((de=R.children)==null?void 0:de.length)>0&&((pe=R.children)==null||pe.forEach(Pe=>{const ke=Pe.start,Te=Pe.end,{distance:ce}=u(new j.Vector3(ke[0],-ke[1],-ke[2]),new j.Vector3(Te[0],-Te[1],-Te[2]));he.push({width:ce,state:Pe.state})})),{width:X,left:Q,top:_,rotateDeg:W,state:R.state,children:he,labelOffset:U,visible:$,labelElement:s.distanceText(ae)}});e(0,r=N)},m=()=>gi(d),g=Po(d,80);return Ze(()=>{d(),n.on("panoArrived",d),n.on("modeChange",d),n.on("cameraDirectionUpdate",m),n.on("movingToPano",m),n.on("mouseWheel",()=>g()),n.on("pinchGesture",()=>g())}),Et(()=>{n.off("panoArrived",d),n.off("modeChange",d),n.off("cameraDirectionUpdate",m),n.off("movingToPano",m),n.off("mouseWheel",()=>g()),n.off("pinchGesture",()=>g())}),i.$$set=w=>{"five"in w&&e(1,n=w.five),"rulerDatas"in w&&e(2,o=w.rulerDatas),"options"in w&&e(3,s=w.options)},[r,n,o,s]}class Qf extends oe{constructor(t){super(),ie(this,t,Ff,Rf,ne,{five:1,rulerDatas:2,options:3})}}class Hf{constructor(t,e){f(this,"five");f(this,"container",document.createElement("div"));f(this,"panoRulerProData");f(this,"rulerItems");f(this,"state",{enabled:!1,loaded:!1,options:{className:"",distanceText:t=>`${t.toFixed(1)}m`}});var n,o;this.five=t,this.container.classList.add("panoRulerProPlugin-container"),this.container.setAttribute("style","position: absolute;pointer-events: none;width: 100%;height: 100%;left: 0;top: 0;overflow: hidden;"),e&&(e.data&&this.load(e.data),this.state.options=F(F({},this.state.options),e.options||{}),(n=e.options)!=null&&n.className&&this.container.classList.add((o=e.options)==null?void 0:o.className)),this.five.once("modelLoaded",()=>G(this,null,function*(){var s,r;(r=(s=this.five.getElement())==null?void 0:s.parentNode)==null||r.append(this.container)})),this.five.once("dispose",()=>this.dispose())}load(t){return G(this,null,function*(){if(!this.five.work)return;const e=t.data;if(!e)throw new Error("\u6807\u5C3A\u6570\u636E\u4F9D\u8D56\u4E0D\u9F50\u5168\uFF01");this.panoRulerProData=e,this.state.loaded=!0})}enable(){return this.state.loaded?(this.state.enabled||(this.state.enabled=!0,this.render()),!0):!1}disable(){return this.state.enabled&&(this.state.enabled=!1,this.render()),!0}render(){return G(this,null,function*(){var t;if(this.state.enabled){if(!this.panoRulerProData||!this.container)return;this.rulerItems=new Qf({target:this.container,props:{five:this.five,rulerDatas:this.panoRulerProData,options:this.state.options}})}else(t=this.rulerItems)==null||t.$destroy(),this.rulerItems=void 0})}dispose(){this.container&&(this.rulerItems.$destroy(),this.rulerItems=void 0),this.container.remove()}}const _f=(i,t)=>new Hf(i,t),Gf="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZIAAABCCAYAAAB9y1BhAAAAAXNSR0IArs4c6QAADh5JREFUeAHtnVuPLDcVhedwC/dACKAICDxEIBQpygNI/Ab+MX8B8YCQEAjxgBAQLsm5Jjkn58r6Sl4jT52qnu4zXd121dqSx67q7ip7eXsv721XzcVFJAg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v2UOr645lAKkex4VeIpLo5jHbls1KD4eYaWIu4R+UeyYLA2RHQWGAADiJ9P9u2StcheRB4VQSkyzgD2PQppwBH4MaEMpBFRSDcqCYQx9ggDphr0QUb3SMSBJpAQGPiciei9P6oYYAmGphKbA4B6TRrJ+j1HKHYzh8cZbpVBowXZ8bgQhzPNJAOvvD4QjkOAj0hUAbdUOVMoHrqudT1OgSk2zgLkAl2n/LYvh9s900kutYV4UIvQiBXMMlBEAgCQWA1CBRCgUjmHAkI5vk+PACR1BcZmGmfH64GzTQkCASBILBhBAqhgEC9rDFGJI7FGJEcB4EgEASCQBAIAkEgCASBIBAEgkAQCAJBIAgEgSAQBIJAEAgCm0fg/x4jQQWGalpFAAAAAElFTkSuQmCC";function Wf(){const i=document.createElement("div"),t=document.createElement("i"),e=document.createElement("span");return i.appendChild(t),i.appendChild(e),i.style.position="relative",i.style.width="100%",i.style.display="flex",i.style.flexDirection="column",i.style.alignItems="center",i.style.marginTop=`${150/16}rem`,i.style.opacity="0",i.style.transition="opacity 1000ms linear",t.style.display="block",t.style.width=`${134/16}rem`,t.style.height=`${22/16}rem`,t.style.backgroundSize="100%",t.style.backgroundRepeat="no-repeat",t.style.backgroundImage=`url(${Gf})`,e.style.marginTop=`${10/16}rem`,e.style.fontSize=`${16/16}rem`,e.style.color="#fff",e.style.opacity="0.7",e.style.textShadow="0 2px 16px rgb(22 34 83 / 24%)",e.style.fontWeight="bold",{appendTo(n){n.appendChild(i)},dispose(){i.remove()},setRoom(n){e.innerHTML=n.name+" "+Math.floor(n.size/1e6)+"\u33A1"},show(){i.style.opacity="1"},hide(){i.style.opacity="0"}}}const Nf=new E.TextureLoader;function hi(i){return G(this,null,function*(){return new Promise((t,e)=>{Nf.load(i,t,void 0,e)}).then(t=>(t.encoding=E.sRGBEncoding,t.minFilter=E.LinearFilter,t.wrapS=E.ClampToEdgeWrapping,t.wrapT=E.ClampToEdgeWrapping,setTimeout(()=>{t.wrapS!==E.ClampToEdgeWrapping&&console.warn("ios 16.4 texture \u4E0D\u652F\u6301 ClampToEdgeWrapping \u4EE5\u5916\u7684\u65B9\u5F0F")}),t))})}const Hn={userAction:!0};class Xf extends Tt{constructor(e,n){super(e);f(this,"state",{visible:!0,enabled:!0,config:{compassImageUrl:"//vrlab-image4.ljcdn.com/release/web/v3/north-point-circle.96498e69.png",entryDoorImageUrl:"//vrlab-image4.ljcdn.com/release/web/enterDoor.831b8208.png"}});f(this,"data");f(this,"group",new E.Group);f(this,"roomInfoInstance");f(this,"roomInfoWrapperInstance");f(this,"compassMeshTween");f(this,"compassMesh");f(this,"entryDoorMesh");f(this,"dispose",()=>{var e,n,o,s;this.five.scene.remove(this.group),this.group.remove(...this.group.children),(n=(e=this.compassMesh)==null?void 0:e.material.map)==null||n.dispose(),(s=(o=this.entryDoorMesh)==null?void 0:o.material.map)==null||s.dispose(),this.five.off("dispose",this.dispose),this.five.off("panoArrived",this.onFivePanoArrived),this.five.off("panoWillArrive",this.onFivePanoWillArrive),this.five.off("cameraDirectionUpdate",this.onFiveCameraDirectionUpdate)});f(this,"_addEventListener",()=>{this.five.on("panoArrived",this.onFivePanoArrived),this.five.on("panoWillArrive",this.onFivePanoWillArrive),this.five.on("modeChange",this.onFiveModeChange),this.five.on("cameraDirectionUpdate",this.onFiveCameraDirectionUpdate)});f(this,"_removeEventListener",()=>{this.five.off("panoArrived",this.onFivePanoArrived),this.five.off("panoWillArrive",this.onFivePanoWillArrive),this.five.off("modeChange",this.onFiveModeChange),this.five.off("cameraDirectionUpdate",this.onFiveCameraDirectionUpdate)});f(this,"_enable",()=>{this.five.scene.add(this.group),this.init(),this.onFivePanoArrived(this.five.panoIndex||0),this._addEventListener()});f(this,"_disable",()=>{this._clearCompassIfNeed(),this._clearEntryDoorIfNeed(),this.five.scene.remove(this.group),this._removeEventListener()});f(this,"_toggleVisible",()=>{this.group.visible=this.state.visible,this.five.needsRender=!0});f(this,"_clearCompassIfNeed",()=>{var e;this.compassMesh&&(this.group.remove(this.compassMesh),(e=this.compassMesh.material.map)==null||e.dispose(),this.compassMesh=null)});f(this,"_clearEntryDoorIfNeed",()=>{var e;this.entryDoorMesh&&(this.group.remove(this.entryDoorMesh),(e=this.entryDoorMesh.material.map)==null||e.dispose(),this.entryDoorMesh=null),this.roomInfoInstance&&(this.roomInfoInstance.dispose(),this.roomInfoInstance=null),this.roomInfoWrapperInstance&&(this.roomInfoWrapperInstance.dispose(),this.roomInfoWrapperInstance=null)});f(this,"onFivePanoWillArrive",e=>{var n,o;e!==this.five.panoIndex&&((n=this.compassMeshTween)==null||n.dispose(),(o=this.compassMesh)==null||o.material.setValues({opacity:0}))});f(this,"onFivePanoArrived",e=>{var o,s,r,a,l,c,u;const n=(r=(s=(o=this.five.work)==null?void 0:o.observers)==null?void 0:s[e])==null?void 0:r.standingPosition;if(this.compassMesh&&(this.compassMesh.position.copy(n.clone().setY(n.y+.01)),this.compassMesh.material.opacity===0&&((a=this.compassMeshTween)==null||a.dispose(),this.compassMeshTween=Sa(1e3).onUpdate(({progress:h})=>{var d;(d=this.compassMesh)==null||d.material.setValues({opacity:h}),this.five.needsRender=!0}).play())),this.entryDoorMesh){const d=new E.Vector3(this.data.entrance.position.x,this.data.entrance.position.y,this.data.entrance.position.z).clone().setY(n.y).sub(n).normalize(),m=n.clone().add(d.clone().multiplyScalar(.7)).setY(n.y+.01);this.entryDoorMesh.rotation.z=new E.Vector3(0,0,-1).angleTo(d),this.entryDoorMesh.position.copy(m),((l=this.data)==null?void 0:l.room_observers[e].room.type)===1?(c=this.entryDoorMesh)==null||c.material.setValues({opacity:1}):(u=this.entryDoorMesh)==null||u.material.setValues({opacity:0})}this.roomInfoInstance&&this.roomInfoWrapperInstance&&(this.roomInfoWrapperInstance.css3DObject.position.copy(n.clone().setY(n.y+.01)),this.roomInfoInstance.setRoom(this.data.room_observers[e].room)),this.five.needsRender=!0});f(this,"onFiveCameraDirectionUpdate",({longitude:e,latitude:n})=>{var o,s;!this.roomInfoWrapperInstance||(this.roomInfoWrapperInstance.css3DObject.rotation.z=e,n>.66&&this.five.getCurrentState().mode==="Panorama"?(o=this.roomInfoInstance)==null||o.show():(s=this.roomInfoInstance)==null||s.hide())});f(this,"onFiveModeChange",(e,n,o,s,r)=>{e!==n&&this.setState({visible:e===Ce.Five.Mode.Panorama},{userAction:r})});this.five.scene.add(this.group),this.five.once("dispose",this.dispose),this.setState({visible:!0,enabled:!0,config:F(F({},this.state.config),n||{})})}enable(e=Hn){this.setState({enabled:!0},e)}disable(e=Hn){this.setState({enabled:!1},e)}show(e=Hn){if(!!this.state.enabled)return this.setState({visible:!0},e),Promise.resolve()}hide(e=Hn){if(!!this.state.enabled)return this.setState({visible:!1},e),Promise.resolve()}setState(e,n={userAction:!0}){var s,r;const o=JSON.parse(JSON.stringify(this.state));this.state={visible:(s=e.visible)!=null?s:o.visible,enabled:(r=e.enabled)!=null?r:o.enabled,config:F(F({},o.config),e.config||{})},this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:n.userAction}),e.enabled===!0&&(this._enable(),this.hooks.emit("enable",n)),e.enabled===!1&&(this._disable(),this.hooks.emit("disable",n)),e.visible===!1&&(this._toggleVisible(),this.hooks.emit("hide",n)),e.visible===!0&&(this._toggleVisible(),this.hooks.emit("show",n)),e.config&&this.init()}load(e,n,o=!0){return G(this,null,function*(){const s=yield this.formatData(e);JSON.stringify(this.data)!==JSON.stringify(s)&&(this.hooks.emit("dataChange",s,this.data),this.data=F({},s),this.init(),n&&this.setState(n,{userAction:o}),this.hooks.emit("dataLoaded",this.data))})}formatData(e){return e.version&&e.data?Promise.resolve(e.data):Promise.resolve(e)}init(){return G(this,null,function*(){var o,s,r,a;const e=(s=(o=this.data)==null?void 0:o.north_rad)!=null?s:null;this._clearCompassIfNeed(),e!==null&&(this.compassMesh=yield this.loadCompassMesh(),this.compassMesh.rotateX(-Math.PI/2),this.compassMesh.rotateZ(e-Math.PI/2),this.group.add(this.compassMesh));const n=(a=(r=this.data)==null?void 0:r.entrance)!=null?a:null;this._clearEntryDoorIfNeed(),n!==null&&(this.entryDoorMesh=yield this.loadEntryDoorMesh(),this.roomInfoWrapperInstance=this.loadRoomInfo(),this.roomInfoInstance=Wf(),this.entryDoorMesh.rotateX(-Math.PI/2),this.roomInfoWrapperInstance&&this.roomInfoInstance.appendTo(this.roomInfoWrapperInstance.container),this.group.add(this.entryDoorMesh)),this.onFivePanoArrived(this.five.panoIndex||0),this.five.needsRender=!0})}loadCompassMesh(){return G(this,null,function*(){const e=this.state.config.compassImageUrl,n=yield hi(e),o=new E.CircleGeometry(.7,32),s=new E.MeshBasicMaterial({map:n,transparent:!0,opacity:0,depthTest:!1}),r=new E.Mesh(o,s);return r.name="pano-compass-mesh",r})}loadEntryDoorMesh(){return G(this,null,function*(){const e=this.state.config.entryDoorImageUrl,n=yield hi(e),o=new E.PlaneGeometry(.2,.16),s=new E.MeshBasicMaterial({map:n,transparent:!0,opacity:.8,depthTest:!1}),r=new E.Mesh(o,s);return r.name="pano-compass-entry-door",r})}loadRoomInfo(){const e=[new E.Vector3(-.7,0,-.7),new E.Vector3(.7,0,-.7),new E.Vector3(.7,0,.7),new E.Vector3(-.7,0,.7)];return Kt(this.five).create3DDomContainer(e)}}const Yf=(i,t)=>new Xf(i,t);function _n(i,t,e){const n=i[t],o=i[e];n===void 0||o===void 0||(i[t]=o,i[e]=n)}function Uf(i,t,e){const n=e/2;for(let o=1;o<=n;o++){const s=e-(o-1);for(let r=1;r<=t;r++){const a=(o-1)*t+r-1,l=(s-1)*t+r-1;_n(i,a*4+0,l*4+0),_n(i,a*4+1,l*4+1),_n(i,a*4+2,l*4+2),_n(i,a*4+3,l*4+3)}}}class pl{constructor(t,e){f(this,"width");f(this,"height");f(this,"containerDom");f(this,"hooks",new Ce.Subscribe);f(this,"canvas",document.createElement("canvas"));f(this,"five");f(this,"scale");f(this,"config");f(this,"offset",{x:0,y:0});f(this,"context");f(this,"renderCenter",new E.Vector3);f(this,"hammer");f(this,"state",{enabled:!1});f(this,"offsetRange");f(this,"isPanning",!1);f(this,"onPanstart",()=>{this.isPanning=!0,this.canvas.style.boxShadow="0 2px 30px 0 rgba(0,0,0,0.20)"});f(this,"onPan",t=>{if(!this.isPanning||!this.offsetRange||this.hooks.emit("wantsPanGesture",t))return;const{translateX:n,translateY:o}=this.getPanOffset(t,this.offsetRange);this.canvas.style.transform=`translate3d(${n}px, ${o}px, 100px)`});f(this,"onPanend",t=>{if(this.isPanning=!1,this.canvas.style.boxShadow="none",!this.offsetRange)return;const{translateX:e,translateY:n}=this.getPanOffset(t,this.offsetRange);this.canvas.style.transform=`translate3d(${e}px, ${n}px, 100px)`,this.offset={x:e,y:n}});var o,s,r;if(!t.renderer)throw new Error("Five Render \u672A\u521D\u59CB\u5316");this.five=t,this.scale=(o=e==null?void 0:e.scale)!=null?o:2,this.width=(s=e==null?void 0:e.width)!=null?s:190,this.height=(r=e==null?void 0:e.height)!=null?r:190,this.config={dragEnabled:(e==null?void 0:e.dragEnabled)||!1,autoFixPCPosition:(e==null?void 0:e.autoFixPCPosition)||!1,initialPosition:(e==null?void 0:e.initialPosition)||{left:"0",top:"0"}};const n=this.canvas.getContext("2d");if(!n)throw new Error("CANNOT CREATE CONTEXT2D");this.context=n,this.config.dragEnabled&&(this.hammer=new Pn.default(this.canvas),this.hammer.on("pan",this.onPan),this.hammer.on("panstart",this.onPanstart),this.hammer.on("panend",this.onPanend)),this.initStyle()}dispose(){var t;this.clear(),this.disable(),(t=this.hammer)==null||t.destroy()}enable(){if(!this.state.enabled)return this.state.enabled=!0,this.containerDom&&this._appendTo(this.containerDom),this}disable(){if(!!this.state.enabled)return this.state.enabled=!1,this.canvas.remove(),this}appendTo(t){return this.containerDom=t,this.state.enabled&&this._appendTo(t),this}clear(){return this.context.clearRect(0,0,this.canvas.width,this.canvas.height),this}renderWithPoint(t){!this.containerDom||!this.state.enabled||(this.renderCenter=t,this.render(),this.config.autoFixPCPosition&&this.autoFixPCPosition())}renderWithScreenPoint(t){!this.containerDom||!this.state.enabled||(this.renderCenter=t,this.render(),this.config.autoFixPCPosition&&this.autoFixPCPosition())}resetOffset(){this.offset={x:0,y:0},this.canvas.style.transform=`translate3d(${0}px, ${0}px, 100px)`}getCurrentState(){return{enabled:this.state.enabled}}getRenderCenter(){return this.renderCenter}_appendTo(t){if(this.resetOffset(),t.appendChild(this.canvas),!this.offsetRange){const e=this.canvas.getBoundingClientRect(),n=t.getBoundingClientRect(),o=n.right-e.right,s=n.bottom-e.bottom,r=n.left-e.left,a=n.top-e.top;this.offsetRange={min:{x:r,y:a},max:{x:o,y:s}}}}autoFixPCPosition(){if(!this.containerDom)return;const{width:t,height:e}=this,[n,o,s]=(()=>{if(this.renderCenter instanceof E.Vector3){const r=this.renderCenter.clone().project(this.five.camera);return[(r.x+1)/2*this.containerDom.clientWidth,-(r.x-1)/2*this.containerDom.clientWidth,-(r.y-1)/2*this.containerDom.clientHeight]}else return[this.renderCenter.x,this.containerDom.clientWidth-this.renderCenter.x,this.renderCenter.y]})();n<183?(this.canvas.style.top=-e/2+"px",this.canvas.style.left=90+"px"):s<183?(this.canvas.style.top=90+"px",this.canvas.style.left=-t/2+"px"):o<183?(this.canvas.style.top=-e/2+"px",this.canvas.style.left=-t-90+"px"):(this.canvas.style.left=-t/2+"px",this.canvas.style.top=-e-90+"px"),this.canvas.style.transform=`translate3d(${n}px, ${s}px, 10px)`,this.offset={x:n,y:s}}render(){if(!this.five.renderer||!this.containerDom)return;const{scale:t,context:e,width:n,height:o}=this,s=this.five.renderer.getSize(new E.Vector2),[r,a]=(()=>{if(this.renderCenter instanceof E.Vector3){const A=this.renderCenter.clone().project(this.five.camera);return[(A.x+1)/2*s.x,(A.y+1)/2*s.y]}else return[this.renderCenter.x,s.y-this.renderCenter.y]})(),l=1,c=n/t,u=o/t,h=l*t,d=this.five.getPixels(r-c/2,a-c/2,c,u,h),m=Math.floor(n*l),g=Math.floor(o*l);Uf(d,m,g);const p=new ImageData(m,g);p.data.set(d),e.putImageData(p,0,0)}initStyle(){const t=this.canvas;t.classList.add("five-plugin__magnifier"),t.style.position="absolute",t.style.pointerEvents="all",t.style.borderRadius="50%",t.style.zIndex="99";const e=1;t.setAttribute("width",(this.width*e).toString()),t.setAttribute("height",(this.height*e).toString()),t.style.border="2px solid rgba(255,255,255,0.20)",t.style.width=this.width+"px",t.style.height=this.height+"px",t.style.top=this.config.initialPosition.top,t.style.left=this.config.initialPosition.left,t.style.transform="translate(0,0,100px)",this.config.dragEnabled&&(this.canvas.style.cursor="pointer")}getPanOffset(t,e){const{min:{x:n,y:o},max:{x:s,y:r}}=e,a=this.offset.x+t.deltaX,l=this.offset.y+t.deltaY,c=Math.min(Math.max(a,n),s),u=Math.min(Math.max(l,o),r);return{translateX:c,translateY:u}}}class qf{constructor(t){f(this,"edges",[]);f(this,"five");f(this,"onModelLoaded",()=>{!this.five.model||(this.edges=this.five.model.getEdges())});this.five=t,this.five.model.loaded?this.onModelLoaded():this.five.on("modelLoaded",this.onModelLoaded)}dispose(){}getAdsorbentPoint(t){if(this.edges.length===0)return null;let e=1/0,n;return this.edges.forEach(o=>{const s=o.closestPointToPoint(t.point,!0,new j.Vector3),r=s.distanceTo(t.point);r<e&&(n=s,e=r)}),e>.1?null:n||null}}function Jf(i,t){for(let e=0,n=t.length;e<n;e++)if(i===t[e])return t.splice(e,1)[0]}class Je{constructor(t){f(this,"id");f(this,"lines");f(this,"position");f(this,"type","point");this.id=_e(),this.lines=[],this.position=new j.Vector3,t instanceof j.Vector3?this.position.copy(t):this.position.fromArray(t)}toJson(){return{id:this.id,position:this.position.toArray()}}addLine(t){this.lines.push(t)}removeLine(t){Jf(t,this.lines)}clone(){return new Je(this.position)}}class Ci{constructor(t){f(this,"id",_e());f(this,"lines",[]);f(this,"points",[]);f(this,"visiblePanoIndexes");f(this,"model");f(this,"type","polyline");f(this,"hook",new Ce.Subscribe);this.model=t.model}addLine(t){if(this.includes(t)){console.error(new Error("\u4E0D\u80FD\u91CD\u590D\u6DFB\u52A0\u7EBF\u6BB5"));return}const e=this.getLastPoint(),n=e&&t.findAnotherPoint(e);e?e&&n?(this.lines.push(t),this.points.push(...t.points),this.hook.emit("lineAdded",t)):console.error(new Error("\u4F20\u5165\u7EBF\u6BB5\u65E0\u6CD5\u4E0E\u5F53\u524D\u6298\u7EBF\u8FDB\u884C\u8FDE\u63A5")):(this.lines.push(t),this.points.push(...t.points),this.hook.emit("lineAdded",t))}removeLine(t){if(this.lines.length!==0){if(!this.isLastLine(t)){console.error(new Error("\u4F20\u5165\u7EBF\u6BB5\u4E0D\u662F\u5F53\u524D\u6298\u7EBF\u7684\u6700\u540E\u4E00\u6BB5"));return}this.lines.pop(),this.lines.length===0?this.points.slice(0,this.points.length):this.points.pop(),this.hook.emit("lineRemoved",t)}}isLastLine(t){const e=this.getLastLine();return e?t.id===e.id:!1}getLastLine(){return this.lines.slice(-1)[0]}clear(){this.lines.slice(0,this.lines.length),this.points.slice(0,this.points.length)}overlapWith(t){return t.type==="point"?this.includes(t):t.type==="line"?t.points.some(e=>this.includes(e)):t.type==="polyline"?t.points.some(e=>this.includes(e)):!0}includes(t){return t.type==="point"?this.points.find(({id:e})=>e===t.id)!==void 0:t.type==="line"?this.lines.find(({id:e})=>e===t.id)!==void 0:!1}isEmpty(){return this.points.length===0}getLastPoint(){return this.points.slice(-1)[0]}toJson(){return{id:this.id,lines:this.lines.map(t=>t.toJson()),visiblePanoIndexes:this.visiblePanoIndexes}}getPointByID(t){return this.points.find(({id:e})=>e===t)}fromJson(t){this.clear(),this.id=t.id;const{getPoint:e,getAllPoints:n}=r(),o=t.lines.map(a=>{const[l,c]=a.points,u=e(l),h=e(c);if(!u||!h)throw new Error("\u7EBF\u4E0A\u7684\u70B9\u4E0D\u5B58\u5728");const d=new zt(u,h,this.model);return d.id=a.id,d.text=a.text,d}),s=n();this.points.push(...s),this.lines.push(...o),this.visiblePanoIndexes=t.visiblePanoIndexes;function r(){const a=new Map;function l(u){const h=a.get(u.id);if(h)return h;const d=new Je(u.position);return d.id=u.id,a.set(u.id,d),d}function c(){return Array.from(a.values())}return{getPoint:l,getAllPoints:c}}return this}replace(t){this.id=t.id,this.clear(),this.lines.push(...t.lines),this.points.push(...t.points)}}const Zf=1,Kf=3,$f=new j.Color(16777215),em=new j.Color(6522623),tm=new j.Color(16777215),nm=new j.Color(6522623),im=6,om=8,sm="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgBAMAAACBVGfHAAAAIVBMVEUAAAD////////////////////////////////////////PIev5AAAACnRSTlMAG/Py2baba05un7UgfgAAAHJJREFUKM9joBpgLHVSCRdA4metAoJlCJHmVWBgAeNzroKCCVCBLpjACqgJVjCBxRBT2FbBQQJYQAohsBAsUIUQWA4WiEIILAULeCEEloAFtBACizAEMLRgGIphLabDMJ2O6TlM72MGECIIMQIZIxqoBQCPvpJ/e9FaAAAAAABJRU5ErkJggg==",Al=new j.TextureLoader().load(sm),vl={pointTexture:Al,pointSize:im,lineWidth:Zf,lineColor:$f,pointColor:tm,lineRenderOrder:20,pointsRenderOrder:20};fe(F({},vl),{dashed:!0});const rm={pointTexture:Al,pointSize:om,lineWidth:Kf,lineColor:em,pointColor:nm,lineRenderOrder:10,pointsRenderOrder:10};function am(i,t,e){var u,h,d,m,g;const n=(u=e==null?void 0:e.lineWidth)!=null?u:2,o=(h=e==null?void 0:e.lineColor)!=null?h:new j.Color(16777215),s=(d=e==null?void 0:e.pointSize)!=null?d:5,r=(m=e==null?void 0:e.lineRenderOrder)!=null?m:10,a=(g=e==null?void 0:e.lineRenderOrder)!=null?g:20,l=new pa.Line(i,t);l.setMaterial({linewidth:n,color:o}),l.line.material.depthTest=!1,l.line.material.transparent=!0,l.line.renderOrder=r,l.points.renderOrder=a;const c=l.points.material;return c.depthTest=!1,c.size=s,e!=null&&e.pointColor&&c.color.set(e.pointColor).convertSRGBToLinear(),e!=null&&e.pointTexture&&(c.map=e.pointTexture),l}function Ms(i,t){const[e,n]=i.points,o=t==="light"?rm:vl,s=am(e.position,n.position,o);return s.name="normalLine_"+i.id,s}function En(i){const{x:t,y:e,z:n}=i;return!(Math.abs(t)>1||Math.abs(e)>1||Math.abs(n)>1)}function Oi(i){const{z:t}=i;return!(Math.abs(t)>1)}function lm(){const i=document.createElement("div");return i.setAttribute("style","backdrop-filter: blur(4px);-webkit-backdrop-filter: blur(4px);-webkit-tap-highlight-color: rgba(0,0,0,0);"),i.style.width="max-content",i.style.padding="3px 6px",i.style.lineHeight="1",i.style.textAlign="center",i.style.transform="translate(-50%, -50%)",i.style.borderRadius="100px",i.style.fontSize="14px",i.style.color="#fff",i.style.background="rgba(195,195,195,0.70)",i.style.border="0.5px solid rgba(255,255,255,0.6)",i.style.cursor="pointer",i}function cm(i){const t=document.createElement("div");return t.id="distance_"+i.id,t.classList.add("five-plugin-measure__distance"),t.style.opacity="0",t.style.position="absolute",t.style.left="0",t.style.top="0",t.style.width="0",t.style.height="0",t.style.transform="translate3d(0, 0, 0)",t.style.transformOrigin="left top",t}function um(i){let t=!0;const{line:e}=i,n=e.id,o=lm(),s=cm(e),r=i.userDistanceItem,a=new j.Vector3(0,0,0),l={lineID:n,ndcPosition:a,update:d,appendTo:m,remove:g,highlight:u,unHighlight:h,getCurrentContent:p,setItemSelectable:A};s.style.pointerEvents=t?"all":"none",r!=null&&r.element?s.appendChild(r.element):s.appendChild(o);function c(){var v;(v=i.clickCallback)==null||v.call(i,l)}function u(){if(r)return r.highlight();o.style.border="0.5px solid #95AEFF",o.style.background="linear-gradient(90deg, #95AEFF 0%, #6386FF 100%)"}function h(){if(r)return r.unHighlight();o.style.border="0.5px solid rgba(255,255,255,0.6)",o.style.background="rgba(195,195,195,0.70)"}function d(v){if(e.mesh.visible===!1){s.style.opacity="0",s.style.pointerEvents="none";return}const b=v.getElement();if(!b)return;const w=b.clientWidth,k=b.clientHeight,I=w/2,C=k/2;if(e.points.length<2)return;const[T,x]=e.points,H=T.position.clone().project(v.camera),N=x.position.clone().project(v.camera),R=H.clone().lerp(N,.5),O=new j.Vector2(H.x*I,H.y*C),S=new j.Vector2(N.x*I,N.y*C),Q=O.distanceTo(S);if((()=>!(Math.abs(H.z)>1||Math.abs(N.z)>1||!Oi(H)&&!Oi(N)||!Oi(R)||Q===0))()===!1){s.style.opacity="0",s.style.pointerEvents="none";return}const X=(R.x+1)/2*w,W=-(R.y-1)/2*k,U=-(Math.atan((O.y-S.y)/(O.x-S.x))*180)/Math.PI,ae=s.parentElement&&o.clientWidth>Q?-20:0;s.style.transform=`translate(${X}px, ${W}px) rotate(${U}deg) translateY(${ae}px)`,s.style.opacity="1",s.style.pointerEvents=t?"all":"none",r&&r.update({line:e,polyline:e.getPolyline()});const he=p();o.innerText=he}function m(v){v.appendChild(s),s.addEventListener("click",c)}function g(){o.removeEventListener("click",c),s.remove()}function p(){var T,x,H;if(e.points.length<2)return"";const[v,b]=e.points,w=v.position.clone().distanceTo(b.position),k=(T=i.line.text)!=null?T:i.line.model.config.defaultText,I=(H=(x=i.line.model.config)==null?void 0:x.getDistanceText)==null?void 0:H.call(x,w),C=k!=null?k:I;return C!=null?C:w.toFixed(2)+"m"}function A(v){t=v}return l}class zt{constructor(t,e,n){f(this,"id");f(this,"selected",!1);f(this,"text");f(this,"type","line");f(this,"model");f(this,"mesh");f(this,"points");f(this,"lightMesh");f(this,"hook");f(this,"distanceItem");f(this,"polyline");var o;if(this.id=_e(),this.model=n,t.id===e.id)throw new Error("\u65E0\u6548\u7684\u7EBF\u6BB5, \u4E00\u4E2A\u70B9\u65E0\u6CD5\u6784\u6210\u7EBF\u6BB5");typeof n.config.defaultText=="string"&&(this.text=n.config.defaultText),this.hook=new Ce.Subscribe,this.points=[t,e],this.mesh=Ms(this,"normal"),this.lightMesh=Ms(this,"light"),this.distanceItem=um({line:this,clickCallback:()=>this.hook.emit("selected",this),userDistanceItem:(o=this.model.config)!=null&&o.userDistanceItemCreator?this.model.config.userDistanceItemCreator():void 0}),t.lines.push(this),e.lines.push(this)}clear(){this.selected=!1,this.polyline=void 0}isEmpty(){return this.points.length===0}getPolyline(){if(this.polyline)return this.polyline;const t=this.model.polylines.find(e=>e.lines.includes(this));if(t)return this.polyline=t,t}findAnotherPoint(t){return this.points.find(({id:e})=>e!==t.id)}setText(t){this.text=t,this.hook.emit("textChanged",t)}toJson(){return{id:this.id,points:this.points.map(t=>t.toJson()),text:this.text}}clone(){const t=new zt(this.points[0].clone(),this.points[1].clone(),this.model);return t.text=this.text,t}}class Ei{constructor(t){f(this,"config");f(this,"polylines",[]);f(this,"hook",new Ce.Subscribe);this.config=t}addPolyline(t){if(this.includes(t)){console.error(new Error("\u4E0D\u80FD\u91CD\u590D\u6DFB\u52A0 polyline"));return}this.polylines.push(t),this.hook.emit("polylineAdded",t)}replacePolylineByID(t,e){const n=this.getPolylineByID(t);n==null||n.replace(e)}removePolyline(t){const e=this.polylines.findIndex(({id:n})=>n===t.id);if(e===-1){console.error(new Error("polyline \u4E0D\u5B58\u5728"));return}this.polylines.splice(e,1),this.hook.emit("polylineRemoved",t)}getPolylineByID(t){return this.polylines.find(e=>e.id===t)}getPolylineByLine(t){return this.polylines.find(e=>e.includes(t))}getLineByID(t){return this.getAllLines().find(e=>e.id===t)}getAllLines(){return this.polylines.map(t=>t.lines).flat(1)}getAllPoints(){return this.polylines.map(t=>t.points).flat(1)}includes(t){return this.polylines.find(({id:e})=>e===t.id)!==void 0}clear(){this.polylines.forEach(t=>this.hook.emit("polylineRemoved",t)),this.polylines.splice(0,this.polylines.length)}getClosestPoint(){}parse(t){this.clear(),this.polylines.push(...t.polylines.map(e=>new Ci({model:this}).fromJson(e))),this.polylines.forEach(e=>this.hook.emit("polylineAdded",e))}toJson(){return{polylines:this.polylines.map(t=>t.toJson()).filter(t=>t.lines.length>0)}}}const Gn=i=>i.preventDefault();class Pi{constructor(t){f(this,"model");f(this,"five");f(this,"group");f(this,"config");f(this,"dashed");f(this,"disposed",!1);f(this,"isMobile");f(this,"mouseGroup");f(this,"container");f(this,"fiveHelper");f(this,"hook");f(this,"magnifier");f(this,"userDistanceItemCreator");f(this,"updateDistanceUI",()=>{this.dashed.distanceItem.update(this.five),this.model.getAllLines().forEach(t=>t.distanceItem.update(this.five))});var n,o;this.five=t.five,this.hook=t.hook,this.model=t.model,this.config=t.config,this.magnifier=t.magnifier,this.container=t.container,this.fiveHelper=t.fiveHelper,this.isMobile=(o=(n=t.openParams)==null?void 0:n.isMobile)!=null?o:!1,this.userDistanceItemCreator=t.userDistanceItemCreator,this.group=t.group,this.mouseGroup=t.mouseGroup,this.dashed=new zt(new Je([0,0,0]),new Je([0,0,0]),this.model),this.dashed.distanceItem.setItemSelectable(!1),this.dashed.mesh.setMaterial({dashed:!0,dashScale:100}),this.dashed.mesh.name="dashLine";const e=this.five.getElement();e&&(e.addEventListener("touchstart",Gn),e.addEventListener("contextmenu",Gn))}removeLine(t){this.group.remove(t.mesh,t.lightMesh),t.distanceItem.remove(),this.five.needsRender=!0}updateMouseGroup(t,e){if(!t)return this.mouseGroup;const n=this.fiveHelper.getAdsorbentPoint(t),o=n||t.point;if(this.mouseGroup.position.copy(o),e)this.mouseGroup.quaternion.copy(e.quaternion);else if(t.face){const r=t.face.normal.clone().multiplyScalar(.05),l=t.point.clone().add(r).clone().add(r);this.mouseGroup.lookAt(l)}return this.mouseGroup}dispose(){this.disposed=!0,this.magnifier.disable(),this.model.getAllLines().forEach(e=>this.removeLine(e));const t=this.five.getElement();t&&(t.removeEventListener("touchstart",Gn),t.removeEventListener("contextmenu",Gn))}}function oo(i){const{x:t,y:e}=i.center,{clientWidth:n,clientHeight:o}=i.target,s=i.target.getBoundingClientRect(),r=new j.Vector2(t,e).sub(new j.Vector2(s.left,s.top)),a=new j.Vector2(r.x/n*2-1,-(r.y/o)*2+1);return{point:r,ndcPoint:a}}function Ri(i,t){const e=oo(t).ndcPoint,n=new j.Raycaster;return n.setFromCamera(e,i.camera),i.model.intersectRaycaster(n)}class Wn extends Pi{constructor(e){var o;super(e);f(this,"type","edit");f(this,"polyline");f(this,"pressPoint");f(this,"hasAppendDashed",!1);f(this,"hasAppendMouseGroup",!1);f(this,"fiveElement");f(this,"lastPoint",null);f(this,"hammer");f(this,"onIntersectionUpdate",Po((e,n)=>{var s;this.hasAppendMouseGroup===!1&&(this.group.add(this.mouseGroup),this.magnifier.appendTo(this.container),this.magnifier.enable(),this.hasAppendMouseGroup=!0);const o=this.updateMouseGroup(e,n).position;(s=this.pressPoint)==null||s.position.copy(o),this.updateDashed(),requestAnimationFrame(()=>this.magnifier.renderWithPoint(this.mouseGroup.position)),this.five.needsRender=!0},20));f(this,"revoke",()=>{if(this.polyline.lines.length===0&&this.lastPoint){this.lastPoint=null,this.hasAppendDashed=!1,this.dashed.distanceItem.remove(),this.group.remove(this.dashed.mesh),this.hook.emit("anchorChange",null),this.hook.emit("editedDashedLineChange",null),this.five.needsRender=!0;return}if(this.polyline.lines.length===0&&!this.lastPoint||!this.lastPoint)return;const e=this.polyline.lines[this.polyline.lines.length-1],n=e.findAnotherPoint(this.lastPoint);!n||(this.lastPoint=n,this.hook.emit("anchorChange",n.position),this.group.remove(e.mesh),this.polyline.removeLine(e),this.hasAppendMouseGroup=!1,this.mouseGroup.position.copy(this.lastPoint.position),this.group.remove(this.mouseGroup),e.distanceItem.remove(),this.updateDashed(),this.magnifier.disable(),this.five.needsRender=!0)});f(this,"onMouseLeave",()=>{this.magnifier.disable(),this.group.remove(this.mouseGroup),this.hasAppendMouseGroup=!1,this.lastPoint&&(this.mouseGroup.position.copy(this.lastPoint.position),this.updateDashed())});f(this,"onLineChanged",()=>{this.hook.emit("editedPolylineChange",this.polyline)});f(this,"onPress",e=>{const[n]=Ri(this.five,e);if(!(n!=null&&n.face))return;const o=new Je(n.point);this.pressPoint=o,this.onIntersectionUpdate(n)});f(this,"onPan",e=>{if(!this.pressPoint)return;const[n]=Ri(this.five,e);!(n!=null&&n.face)||this.onIntersectionUpdate(n)});f(this,"onPanEnd",e=>{!this.pressPoint||this.onTap(e)});f(this,"onTap",e=>{this.hasAppendDashed||(this.dashed.distanceItem.appendTo(this.container),this.group.add(this.dashed.mesh)),this.hasAppendDashed=!0;const[n]=Ri(this.five,e);this.updateMouseGroup(n);const o=new Je(this.mouseGroup.position),s=this.lastPoint;if(o&&(this.lastPoint=o),o&&s){const r=new zt(s,o,this.model);r.distanceItem.setItemSelectable(!1),r.distanceItem.appendTo(this.container),this.polyline.addLine(r),this.group.add(r.mesh),r.distanceItem.update(this.five)}this.pressPoint=void 0,this.hasAppendMouseGroup=!1,this.magnifier.disable(),this.group.remove(this.mouseGroup),this.updateDashed(),this.five.needsRender=!0,this.hook.emit("anchorChange",o.position)});f(this,"onWantsTapGesture",()=>!1);f(this,"onWantsToMoveToPano",()=>!1);f(this,"onWantsPanGesture",()=>this.pressPoint?!1:void 0);f(this,"onCameraUpdate",()=>{this.updateDistanceUI(),this.dashed.distanceItem.update(this.five)});f(this,"updateDashed",()=>{!this.lastPoint||(this.dashed.points[0].position.copy(this.lastPoint.position),this.dashed.points[1].position.copy(this.mouseGroup.position),this.dashed.mesh.setPoints(this.lastPoint.position,this.mouseGroup.position),this.dashed.distanceItem.update(this.five),this.hook.emit("editedDashedLineChange",this.dashed))});this.model=new Ei(this.config),this.polyline=new Ci({model:this.model}),this.model.addPolyline(this.polyline),this.five.on("cameraUpdate",this.onCameraUpdate),this.five.on("wantsPanGesture",this.onWantsPanGesture),this.five.on("wantsTapGesture",this.onWantsTapGesture),this.five.on("wantsToMoveToPano",this.onWantsToMoveToPano),this.five.on("intersectionOnModelUpdate",this.onIntersectionUpdate),this.polyline.hook.on("lineAdded",this.onLineChanged),this.polyline.hook.on("lineRemoved",this.onLineChanged);const n=this.five.getElement();if(n){this.fiveElement=n;const s=new Pn.default(n);this.hammer=s,s.on("tap",this.onTap),s.on("pan",this.onPan),s.on("press",this.onPress),s.on("panend",this.onPanEnd)}this.five.helperVisible=!1,(o=this.fiveElement)==null||o.addEventListener("mouseleave",this.onMouseLeave),this.hook.emit("anchorChange",null),this.hook.emit("editedDashedLineChange",null),this.five.refresh()}dispose(){var e,n;super.dispose(),this.five.helperVisible=!0,this.group.remove(this.mouseGroup,this.dashed.mesh),this.five.off("cameraUpdate",this.onCameraUpdate),this.five.off("wantsPanGesture",this.onWantsPanGesture),this.five.off("wantsTapGesture",this.onWantsTapGesture),this.five.off("wantsToMoveToPano",this.onWantsToMoveToPano),this.five.off("intersectionOnModelUpdate",this.onIntersectionUpdate),this.polyline.hook.off("lineAdded",this.onLineChanged),this.polyline.hook.off("lineRemoved",this.onLineChanged),(e=this.hammer)==null||e.destroy(),(n=this.fiveElement)==null||n.removeEventListener("mouseleave",this.onMouseLeave),this.magnifier.dispose(),this.dashed.distanceItem.remove(),this.five.needsRender=!0}getEditingLines(){return this.polyline.lines}}class Ts extends Pi{constructor(e){super(e);f(this,"type","view");f(this,"hammer");f(this,"polylineRemoved",e=>{e.lines.forEach(n=>this.removeLine(n)),this.hook.emit("selectedChange",this.model.getAllLines().filter(n=>n.selected).map(n=>n))});f(this,"polylineAdded",e=>{const n=this.five.getCurrentState().panoIndex;e.lines.forEach(o=>{e.visiblePanoIndexes&&!e.visiblePanoIndexes.includes(n)&&(o.mesh.visible=!1),o.distanceItem.appendTo(this.container),o.distanceItem.update(this.five),this.group.add(o.mesh)})});f(this,"onCameraUpdate",()=>{this.updateDistanceUI()});f(this,"onFivePanoWillArrive",e=>{this.model.polylines.forEach(n=>{!n.visiblePanoIndexes||n.visiblePanoIndexes.includes(e)||n.lines.forEach(o=>{o.mesh.visible=!1,o.distanceItem.update(this.five)})})});f(this,"onFivePanoArrived",e=>{this.model.polylines.forEach(n=>{!n.visiblePanoIndexes||n.visiblePanoIndexes.includes(e)&&n.lines.forEach(o=>{o.mesh.visible=!0,o.distanceItem.update(this.five)})})});this.model.getAllLines().forEach(o=>{o.distanceItem.appendTo(this.container),o.distanceItem.update(this.five),this.group.add(o.mesh)});const n=this.five.getElement();if(n){const o=new Pn.default(n);this.hammer=o}this.onFivePanoWillArrive(this.five.getCurrentState().panoIndex),this.onFivePanoArrived(this.five.getCurrentState().panoIndex),this.updateDistanceUI(),this.five.needsRender=!0,this.model.hook.on("polylineAdded",this.polylineAdded),this.model.hook.on("polylineRemoved",this.polylineRemoved),this.five.on("cameraUpdate",this.onCameraUpdate),this.five.on("panoArrived",this.onFivePanoArrived),this.five.on("panoWillArrive",this.onFivePanoWillArrive)}dispose(){var e;super.dispose(),this.model.hook.off("polylineAdded",this.polylineAdded),this.model.hook.off("polylineRemoved",this.polylineRemoved),this.five.off("cameraUpdate",this.onCameraUpdate),this.five.off("panoArrived",this.onFivePanoArrived),this.five.off("panoWillArrive",this.onFivePanoWillArrive),this.five.needsRender=!0,this.hook.emit("selectedChange",[]),(e=this.hammer)==null||e.destroy()}}const dm=`
|
|
285
285
|
<svg class="fpm__delete-icon" width="16px" height="17px" viewBox="0 0 16 17" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
286
286
|
<defs>
|
|
287
287
|
<linearGradient x1="22.185491%" y1="100%" x2="66.8316686%" y2="6.67239121%" id="linearGradient-1">
|
|
@@ -309,7 +309,7 @@ void main() {
|
|
|
309
309
|
float match = 1.0 - uv.x;
|
|
310
310
|
gl_FragColor = vec4(1.0,1.0,1.0,match);
|
|
311
311
|
}
|
|
312
|
-
`;function wl(i){var v,b;const t=(v=i.isMobile)!=null?v:!0,e=(b=i.useNormalVector)!=null?b:!0;let n=10349931;e&&i.ballColor>=0&&(n=i.ballColor);const o=new j.Group,s=new j.PlaneGeometry(.3,.3),r=t?bm:ym,a=new j.TextureLoader().load(r);a.encoding=j.sRGBEncoding,a.minFilter=j.LinearFilter;const l=new j.MeshBasicMaterial({map:a,transparent:!0,depthTest:!1}),c=new j.Mesh(s,l),u=new j.CurvePath;u.add(new j.LineCurve3(new j.Vector3(0,0,0),new j.Vector3(0,0,.1)));const h=new j.TubeGeometry(u,8,.003),d=new j.ShaderMaterial({vertexShader:wm,fragmentShader:Cm,depthTest:!1,transparent:!0}),m=new j.Mesh(h,d),g=new j.SphereGeometry(.01,20,20),p=new j.MeshBasicMaterial({color:n,depthTest:!1,transparent:!0,side:j.DoubleSide}),A=new j.Mesh(g,p);return A.position.set(0,0,.1),o.name="mouse-current",o.add(c),e&&o.add(m,A),o}class Em{constructor(t){f(this,"container",document.createElement("div"));f(this,"five");f(this,"group");f(this,"mouseGroup");f(this,"hasAppendMouseGroup",!1);f(this,"fiveHelper");f(this,"hook");f(this,"content");f(this,"intersectMesh");f(this,"centerMouseXY");f(this,"raycaster",new j.Raycaster);f(this,"pieceStyl",{matrix3d:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],scale:1,opacity:.4});f(this,"onCameraDirectionUpdate",()=>{const t=this.getIntersection();if(t){this.pieceChange(t),this.updateMouseGroup(t);const e=new Je(this.mouseGroup.position);this.hook.emit("nowPointChange",e)}});f(this,"onWillChangeState",(t,e)=>{var o;this.dotAnimation();const n=(o=this.getIntersection())==null?void 0:o.point;!n||(e==="editing"?this.hook.emit("getStartPoint",new Je(n)):this.hook.emit("getEndPoint",new Je(n)))});f(this,"computedCenterMouseXY",()=>{const t=this.container.querySelector(".range-piece__aim");if(!t)return null;const{left:e,top:n,width:o,height:s}=t.getBoundingClientRect(),r=Math.round(e+o/2),a=Math.round(n+s/2),c=vm({x:r,y:a},this.five.getElement());this.centerMouseXY=c});f(this,"getIntersection",()=>{if(!this.centerMouseXY)return null;this.raycaster.setFromCamera(this.centerMouseXY,this.five.camera);const t=this.five.model.intersectRaycaster(this.raycaster)[0];return t||null});this.five=t.five,this.hook=t.hook,this.group=t.group,this.mouseGroup=wl(Q({isMobile:!0},t.openParams.crossHairParameter)),this.fiveHelper=t.fiveHelper,this.container.innerHTML=au,this.container.classList.add("range-piece-controller"),this.content=this.container.querySelector(".range-piece__content"),this.content&&(this.content.style.transform=`matrix3d(${this.pieceStyl.matrix3d.toString()}) scale(${this.pieceStyl.scale})`,this.content.style.opacity=`${this.pieceStyl.opacity}`),t.container.append(this.container),this.intersectMesh=new j.Mesh(new j.RingGeometry(.04,.08,32),new j.MeshBasicMaterial({color:1245179,opacity:0,side:j.DoubleSide,transparent:!0})),this.container.addEventListener("animationend",this.computedCenterMouseXY),this.five.on("cameraUpdate",this.onCameraDirectionUpdate),this.hook.on("willChangeState",this.onWillChangeState)}dispose(){this.container.removeEventListener("animationend",this.computedCenterMouseXY),this.five.off("cameraUpdate",this.onCameraDirectionUpdate),this.hook.off("willChangeState",this.onWillChangeState),this.container.remove(),this.group.remove(this.mouseGroup),this.mouseGroup.remove(),this.hasAppendMouseGroup=!1,this.five.scene.remove(this.intersectMesh)}pieceChange(t){const e=t.face,n=t.point;if(e&&n){const s=e.normal.clone().clone().multiplyScalar(.05),r=n.clone().add(s);this.intersectMesh.position.copy(r);const a=r.clone().add(s);this.intersectMesh.lookAt(a),this.five.scene.add(this.intersectMesh);const l=this.intersectMesh.modelViewMatrix.clone().toArray();this.changePieceStyl("matrix3d",l);const c=this.calculateSize(n);this.changePieceStyl("scale",c)}}calculateSize(t){if(!t)return;const e=this.five.camera.position;let n=t.distanceTo(e);const o=4,s=1;return n>o&&(n=o),n<s&&(n=s),-.51/(o-s)*n+1}dotAnimation(){const t=bn.default.Easing.Quadratic.InOut,e={opacity:.4,scale:this.pieceStyl.scale},n={opacity:[1,.4],scale:[this.pieceStyl.scale*.8,this.pieceStyl.scale]};let o=pm;const s=new bn.default.Tween(e).to(n,500).easing(t).start(0).onUpdate(({opacity:r,scale:a})=>{this.changePieceStyl("scale",a),this.changePieceStyl("opacity",r)}).onComplete(()=>{o()});o=kn(r=>{s.update(r)})}changePieceStyl(t,e){!this.content||(this.pieceStyl[t]=e,this.content.style.transform=`matrix3d(${this.pieceStyl.matrix3d.toString()}) scale(${this.pieceStyl.scale})`,this.content.style.opacity=`${this.pieceStyl.opacity}`)}updateMouseGroup(t,e){if(!this.hasAppendMouseGroup){this.group.add(this.mouseGroup),this.hasAppendMouseGroup=!0;const n=this.container.querySelector(".range-piece__aim");n&&(n.style.opacity="0")}if(!t)return this.mouseGroup;if(this.mouseGroup.position.copy(t.point),e)this.mouseGroup.quaternion.copy(e.quaternion);else if(t.face){const o=t.face.normal.clone().multiplyScalar(.05),r=t.point.clone().add(o).clone().add(o);this.mouseGroup.lookAt(r)}return this.mouseGroup}}class un extends Pi{constructor(e){super(e);f(this,"state","watching");f(this,"polyline");f(this,"hasAppendDashed",!1);f(this,"mobileStartPoint",null);f(this,"mobileNowPoint",null);f(this,"highlightedLines",[]);f(this,"deleteDom");f(this,"rangePieceController");f(this,"disposers",[]);f(this,"onLineChanged",()=>{this.hook.emit("editedPolylineChange",this.polyline)});f(this,"onWantsTapGesture",e=>{if(this.state==="editing")return!1;const[n]=this.five.model.intersectRaycaster(e);if(!n)return;const o=this.five.camera,s=n.point.clone().project(o),r=this.container.clientWidth,a=this.container.clientHeight,l=new j.Vector2(s.x*r,s.y*a),c=this.polyline.lines.map(m=>{const[g,p]=m.points,A=g.position.clone().project(o),v=p.position.clone().project(o);if(!En(A)&&!En(v))return null;const b=new j.Vector2(A.x*r,A.y*a),w=new j.Vector2(v.x*r,v.y*a);return{id:m.id,points:[b,w]}}).filter(m=>!!m);if(c.length===0)return;const h=c.map(m=>{const g=yl(l,m.points);return{id:m.id,distance:g.distanceTo(l)}}).sort((m,g)=>m.distance-g.distance)[0];if(h.distance>20)return;const d=this.polyline.lines.find(({id:m})=>m===h.id);if(!!d)return this.chooseLine(d),!1});f(this,"onWantsToMoveToPano",()=>this.state==="watching");f(this,"onCameraUpdate",()=>{this.updateDistanceUI(),this.dashed.distanceItem.update(this.five)});f(this,"updateMobileDashed",()=>{!this.mobileStartPoint||!this.mobileNowPoint||(this.dashed.points[0].position.copy(this.mobileStartPoint.position),this.dashed.points[1].position.copy(this.mobileNowPoint.position),this.dashed.mesh.setPoints(this.mobileStartPoint.position,this.mobileNowPoint.position),this.dashed.distanceItem.update(this.five),this.hook.emit("editedDashedLineChange",this.dashed))});f(this,"updateMagnifier",e=>{this.magnifier.containerDom!==this.container&&this.magnifier.appendTo(this.container),this.magnifier.getCurrentState().enabled||this.magnifier.enable(),requestAnimationFrame(()=>this.magnifier.renderWithPoint(e.position)),this.five.needsRender=!0});f(this,"onGetStartPoint",e=>{this.mobileStartPoint=e});f(this,"onGetEndPoint",e=>{const n=this.mobileNowPoint;if(this.removeLine(this.dashed),this.hasAppendDashed=!1,this.mobileStartPoint&&n){const o=new zt(this.mobileStartPoint,n,this.model);o.distanceItem.appendTo(this.container),o.distanceItem.update(this.five),o.hook.on("selected",this.chooseLine),this.disposers.push(()=>o.hook.off("selected",this.chooseLine)),this.group.add(o.mesh),this.polyline.addLine(o)}this.mobileStartPoint=null,this.mobileNowPoint=null,this.five.needsRender=!0});f(this,"onNowPointChange",e=>{if(this.state==="watching"){this.mobileNowPoint=e,this.updateMagnifier(e);return}this.hasAppendDashed||(this.dashed.distanceItem.appendTo(this.container),this.group.add(this.dashed.mesh),this.hasAppendDashed=!0),this.five.needsRender=!0,this.mobileNowPoint=e,this.updateMobileDashed(),this.updateMagnifier(e),this.five.needsRender=!0});f(this,"onWillChangeState",(e,n)=>{this.state=n,this.state==="watching"?this.five.helperVisible=!0:this.five.helperVisible=!1});f(this,"chooseLine",e=>{const n=so(e);this.highlightLines(n),this.five.needsRender=!0,this.hook.emit("selectedChange",n.map(o=>o))});f(this,"deleteDomClickCallback",()=>{this.highlightedLines.forEach(e=>{this.removeLine(e),this.polyline.removeLine(e)}),this.highlightedLines=[],this.deleteDom.setLines([]).hide()});f(this,"cancelDeleteClickCallback",()=>{this.clearHighlightLines()});this.model=new Ei(this.config),this.polyline=new Ci({model:this.model}),this.model.addPolyline(this.polyline),this.rangePieceController=new Em(e),this.deleteDom=new bl(this.five,{i18n:this.config.i18n,onClick:this.deleteDomClickCallback,cancelDelete:this.cancelDeleteClickCallback}).appendTo(this.container),this.five.on("cameraUpdate",this.onCameraUpdate),this.five.on("wantsTapGesture",this.onWantsTapGesture),this.five.on("wantsToMoveToPano",this.onWantsToMoveToPano),this.polyline.hook.on("lineAdded",this.onLineChanged),this.polyline.hook.on("lineRemoved",this.onLineChanged),this.five.helperVisible=!1,this.hook.emit("editedDashedLineChange",null),this.hook.on("getStartPoint",this.onGetStartPoint),this.hook.on("getEndPoint",this.onGetEndPoint),this.hook.on("nowPointChange",this.onNowPointChange),this.hook.on("willChangeState",this.onWillChangeState),this.five.refresh()}dispose(){super.dispose(),this.disposers.forEach(e=>e()),this.five.helperVisible=!0,this.rangePieceController.dispose(),this.group.remove(this.mouseGroup,this.dashed.mesh),this.five.off("cameraUpdate",this.onCameraUpdate),this.five.off("wantsTapGesture",this.onWantsTapGesture),this.five.off("wantsToMoveToPano",this.onWantsToMoveToPano),this.polyline.hook.off("lineAdded",this.onLineChanged),this.polyline.hook.off("lineRemoved",this.onLineChanged),this.hook.off("getStartPoint",this.onGetStartPoint),this.hook.off("getEndPoint",this.onGetEndPoint),this.hook.off("nowPointChange",this.onNowPointChange),this.hook.off("willChangeState",this.onWillChangeState),this.hook.emit("selectedChange",[]),this.dashed.distanceItem.remove(),this.five.needsRender=!0}highlightLine(e){e.selected||(e.selected=!0,this.group.add(e.lightMesh),e.distanceItem.highlight(),this.five.needsRender=!0)}clearHighlightLines(){this.group.children.length!==0&&(this.deleteDom.setLines([]).hide(),this.polyline.lines.forEach(e=>{e.selected=!1,e.distanceItem.unHighlight(),this.group.remove(e.lightMesh)}),this.highlightedLines=[],this.five.needsRender=!0)}getEditingLines(){return this.polyline.lines}addStartPoint(){}highlightLines(e){this.clearHighlightLines(),this.highlightedLines=e,this.deleteDom.setLines(e).updatePosition().show(),e.forEach(n=>this.highlightLine(n))}}const Cl="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNzIiIGhlaWdodD0iNzIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPjxkZWZzPjxmaWx0ZXIgeD0iLTUuMyUiIHk9Ii01LjMlIiB3aWR0aD0iMTEwLjU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VyIHN0ZERldmlhdGlvbj0iOCIgaW49IlNvdXJjZUdyYXBoaWMiLz48L2ZpbHRlcj48L2RlZnM+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48Y2lyY2xlIHN0cm9rZT0idXJsKCNwcmVmaXhfX2EpIiBzdHJva2Utd2lkdGg9Ii40IiBmaWxsPSJ1cmwoI3ByZWZpeF9fYikiIG9wYWNpdHk9Ii43IiBjeD0iMzYiIGN5PSIzNiIgcj0iMjguMjQ0Ii8+PGVsbGlwc2UgZmlsbD0iIzdDOTBEQSIgb3BhY2l0eT0iLjU5NiIgZmlsdGVyPSJ1cmwoI3ByZWZpeF9fYykiIGN4PSIzNiIgY3k9IjM2IiByeD0iMTguOTYzIiByeT0iNy4xMTEiLz48cGF0aCBkPSJNMzYgMEMxNi4xMTggMCAwIDE2LjExOCAwIDM2czE2LjExOCAzNiAzNiAzNiAzNi0xNi4xMTggMzYtMzZTNTUuODgyIDAgMzYgMHptMCA0LjQ0NGMxNy40MjggMCAzMS41NTYgMTQuMTI4IDMxLjU1NiAzMS41NTZTNTMuNDI4IDY3LjU1NiAzNiA2Ny41NTYgNC40NDQgNTMuNDI4IDQuNDQ0IDM2IDE4LjU3MiA0LjQ0NCAzNiA0LjQ0NHoiIGZpbGw9InVybCgjcHJlZml4X19kKSIgZmlsbC1ydWxlPSJub256ZXJvIi8+PC9nPjwvc3ZnPg==",Pm=`
|
|
312
|
+
`;function wl(i){var v,b;const t=(v=i.isMobile)!=null?v:!0,e=(b=i.useNormalVector)!=null?b:!0;let n=10349931;e&&i.ballColor>=0&&(n=i.ballColor);const o=new j.Group,s=new j.PlaneGeometry(.3,.3),r=t?bm:ym,a=new j.TextureLoader().load(r);a.encoding=j.sRGBEncoding,a.minFilter=j.LinearFilter;const l=new j.MeshBasicMaterial({map:a,transparent:!0,depthTest:!1}),c=new j.Mesh(s,l),u=new j.CurvePath;u.add(new j.LineCurve3(new j.Vector3(0,0,0),new j.Vector3(0,0,.1)));const h=new j.TubeGeometry(u,8,.003),d=new j.ShaderMaterial({vertexShader:wm,fragmentShader:Cm,depthTest:!1,transparent:!0}),m=new j.Mesh(h,d),g=new j.SphereGeometry(.01,20,20),p=new j.MeshBasicMaterial({color:n,depthTest:!1,transparent:!0,side:j.DoubleSide}),A=new j.Mesh(g,p);return A.position.set(0,0,.1),o.name="mouse-current",o.add(c),e&&o.add(m,A),o}class Em{constructor(t){f(this,"container",document.createElement("div"));f(this,"five");f(this,"group");f(this,"mouseGroup");f(this,"hasAppendMouseGroup",!1);f(this,"fiveHelper");f(this,"hook");f(this,"content");f(this,"intersectMesh");f(this,"centerMouseXY");f(this,"raycaster",new j.Raycaster);f(this,"pieceStyl",{matrix3d:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],scale:1,opacity:.4});f(this,"onCameraDirectionUpdate",()=>{const t=this.getIntersection();if(t){this.pieceChange(t),this.updateMouseGroup(t);const e=new Je(this.mouseGroup.position);this.hook.emit("nowPointChange",e)}});f(this,"onWillChangeState",(t,e)=>{var o;this.dotAnimation();const n=(o=this.getIntersection())==null?void 0:o.point;!n||(e==="editing"?this.hook.emit("getStartPoint",new Je(n)):this.hook.emit("getEndPoint",new Je(n)))});f(this,"computedCenterMouseXY",()=>{const t=this.container.querySelector(".range-piece__aim");if(!t)return null;const{left:e,top:n,width:o,height:s}=t.getBoundingClientRect(),r=Math.round(e+o/2),a=Math.round(n+s/2),c=vm({x:r,y:a},this.five.getElement());this.centerMouseXY=c});f(this,"getIntersection",()=>{if(!this.centerMouseXY)return null;this.raycaster.setFromCamera(this.centerMouseXY,this.five.camera);const t=this.five.model.intersectRaycaster(this.raycaster)[0];return t||null});this.five=t.five,this.hook=t.hook,this.group=t.group,this.mouseGroup=wl(F({isMobile:!0},t.openParams.crossHairParameter)),this.fiveHelper=t.fiveHelper,this.container.innerHTML=au,this.container.classList.add("range-piece-controller"),this.content=this.container.querySelector(".range-piece__content"),this.content&&(this.content.style.transform=`matrix3d(${this.pieceStyl.matrix3d.toString()}) scale(${this.pieceStyl.scale})`,this.content.style.opacity=`${this.pieceStyl.opacity}`),t.container.append(this.container),this.intersectMesh=new j.Mesh(new j.RingGeometry(.04,.08,32),new j.MeshBasicMaterial({color:1245179,opacity:0,side:j.DoubleSide,transparent:!0})),this.container.addEventListener("animationend",this.computedCenterMouseXY),this.five.on("cameraUpdate",this.onCameraDirectionUpdate),this.hook.on("willChangeState",this.onWillChangeState)}dispose(){this.container.removeEventListener("animationend",this.computedCenterMouseXY),this.five.off("cameraUpdate",this.onCameraDirectionUpdate),this.hook.off("willChangeState",this.onWillChangeState),this.container.remove(),this.group.remove(this.mouseGroup),this.mouseGroup.remove(),this.hasAppendMouseGroup=!1,this.five.scene.remove(this.intersectMesh)}pieceChange(t){const e=t.face,n=t.point;if(e&&n){const s=e.normal.clone().clone().multiplyScalar(.05),r=n.clone().add(s);this.intersectMesh.position.copy(r);const a=r.clone().add(s);this.intersectMesh.lookAt(a),this.five.scene.add(this.intersectMesh);const l=this.intersectMesh.modelViewMatrix.clone().toArray();this.changePieceStyl("matrix3d",l);const c=this.calculateSize(n);this.changePieceStyl("scale",c)}}calculateSize(t){if(!t)return;const e=this.five.camera.position;let n=t.distanceTo(e);const o=4,s=1;return n>o&&(n=o),n<s&&(n=s),-.51/(o-s)*n+1}dotAnimation(){const t=bn.default.Easing.Quadratic.InOut,e={opacity:.4,scale:this.pieceStyl.scale},n={opacity:[1,.4],scale:[this.pieceStyl.scale*.8,this.pieceStyl.scale]};let o=pm;const s=new bn.default.Tween(e).to(n,500).easing(t).start(0).onUpdate(({opacity:r,scale:a})=>{this.changePieceStyl("scale",a),this.changePieceStyl("opacity",r)}).onComplete(()=>{o()});o=kn(r=>{s.update(r)})}changePieceStyl(t,e){!this.content||(this.pieceStyl[t]=e,this.content.style.transform=`matrix3d(${this.pieceStyl.matrix3d.toString()}) scale(${this.pieceStyl.scale})`,this.content.style.opacity=`${this.pieceStyl.opacity}`)}updateMouseGroup(t,e){if(!this.hasAppendMouseGroup){this.group.add(this.mouseGroup),this.hasAppendMouseGroup=!0;const n=this.container.querySelector(".range-piece__aim");n&&(n.style.opacity="0")}if(!t)return this.mouseGroup;if(this.mouseGroup.position.copy(t.point),e)this.mouseGroup.quaternion.copy(e.quaternion);else if(t.face){const o=t.face.normal.clone().multiplyScalar(.05),r=t.point.clone().add(o).clone().add(o);this.mouseGroup.lookAt(r)}return this.mouseGroup}}class un extends Pi{constructor(e){super(e);f(this,"state","watching");f(this,"polyline");f(this,"hasAppendDashed",!1);f(this,"mobileStartPoint",null);f(this,"mobileNowPoint",null);f(this,"highlightedLines",[]);f(this,"deleteDom");f(this,"rangePieceController");f(this,"disposers",[]);f(this,"onLineChanged",()=>{this.hook.emit("editedPolylineChange",this.polyline)});f(this,"onWantsTapGesture",e=>{if(this.state==="editing")return!1;const[n]=this.five.model.intersectRaycaster(e);if(!n)return;const o=this.five.camera,s=n.point.clone().project(o),r=this.container.clientWidth,a=this.container.clientHeight,l=new j.Vector2(s.x*r,s.y*a),c=this.polyline.lines.map(m=>{const[g,p]=m.points,A=g.position.clone().project(o),v=p.position.clone().project(o);if(!En(A)&&!En(v))return null;const b=new j.Vector2(A.x*r,A.y*a),w=new j.Vector2(v.x*r,v.y*a);return{id:m.id,points:[b,w]}}).filter(m=>!!m);if(c.length===0)return;const h=c.map(m=>{const g=yl(l,m.points);return{id:m.id,distance:g.distanceTo(l)}}).sort((m,g)=>m.distance-g.distance)[0];if(h.distance>20)return;const d=this.polyline.lines.find(({id:m})=>m===h.id);if(!!d)return this.chooseLine(d),!1});f(this,"onWantsToMoveToPano",()=>this.state==="watching");f(this,"onCameraUpdate",()=>{this.updateDistanceUI(),this.dashed.distanceItem.update(this.five)});f(this,"updateMobileDashed",()=>{!this.mobileStartPoint||!this.mobileNowPoint||(this.dashed.points[0].position.copy(this.mobileStartPoint.position),this.dashed.points[1].position.copy(this.mobileNowPoint.position),this.dashed.mesh.setPoints(this.mobileStartPoint.position,this.mobileNowPoint.position),this.dashed.distanceItem.update(this.five),this.hook.emit("editedDashedLineChange",this.dashed))});f(this,"updateMagnifier",e=>{this.magnifier.containerDom!==this.container&&this.magnifier.appendTo(this.container),this.magnifier.getCurrentState().enabled||this.magnifier.enable(),requestAnimationFrame(()=>this.magnifier.renderWithPoint(e.position)),this.five.needsRender=!0});f(this,"onGetStartPoint",e=>{this.mobileStartPoint=e});f(this,"onGetEndPoint",e=>{const n=this.mobileNowPoint;if(this.removeLine(this.dashed),this.hasAppendDashed=!1,this.mobileStartPoint&&n){const o=new zt(this.mobileStartPoint,n,this.model);o.distanceItem.appendTo(this.container),o.distanceItem.update(this.five),o.hook.on("selected",this.chooseLine),this.disposers.push(()=>o.hook.off("selected",this.chooseLine)),this.group.add(o.mesh),this.polyline.addLine(o)}this.mobileStartPoint=null,this.mobileNowPoint=null,this.five.needsRender=!0});f(this,"onNowPointChange",e=>{if(this.state==="watching"){this.mobileNowPoint=e,this.updateMagnifier(e);return}this.hasAppendDashed||(this.dashed.distanceItem.appendTo(this.container),this.group.add(this.dashed.mesh),this.hasAppendDashed=!0),this.five.needsRender=!0,this.mobileNowPoint=e,this.updateMobileDashed(),this.updateMagnifier(e),this.five.needsRender=!0});f(this,"onWillChangeState",(e,n)=>{this.state=n,this.state==="watching"?this.five.helperVisible=!0:this.five.helperVisible=!1});f(this,"chooseLine",e=>{const n=so(e);this.highlightLines(n),this.five.needsRender=!0,this.hook.emit("selectedChange",n.map(o=>o))});f(this,"deleteDomClickCallback",()=>{this.highlightedLines.forEach(e=>{this.removeLine(e),this.polyline.removeLine(e)}),this.highlightedLines=[],this.deleteDom.setLines([]).hide()});f(this,"cancelDeleteClickCallback",()=>{this.clearHighlightLines()});this.model=new Ei(this.config),this.polyline=new Ci({model:this.model}),this.model.addPolyline(this.polyline),this.rangePieceController=new Em(e),this.deleteDom=new bl(this.five,{i18n:this.config.i18n,onClick:this.deleteDomClickCallback,cancelDelete:this.cancelDeleteClickCallback}).appendTo(this.container),this.five.on("cameraUpdate",this.onCameraUpdate),this.five.on("wantsTapGesture",this.onWantsTapGesture),this.five.on("wantsToMoveToPano",this.onWantsToMoveToPano),this.polyline.hook.on("lineAdded",this.onLineChanged),this.polyline.hook.on("lineRemoved",this.onLineChanged),this.five.helperVisible=!1,this.hook.emit("editedDashedLineChange",null),this.hook.on("getStartPoint",this.onGetStartPoint),this.hook.on("getEndPoint",this.onGetEndPoint),this.hook.on("nowPointChange",this.onNowPointChange),this.hook.on("willChangeState",this.onWillChangeState),this.five.refresh()}dispose(){super.dispose(),this.disposers.forEach(e=>e()),this.five.helperVisible=!0,this.rangePieceController.dispose(),this.group.remove(this.mouseGroup,this.dashed.mesh),this.five.off("cameraUpdate",this.onCameraUpdate),this.five.off("wantsTapGesture",this.onWantsTapGesture),this.five.off("wantsToMoveToPano",this.onWantsToMoveToPano),this.polyline.hook.off("lineAdded",this.onLineChanged),this.polyline.hook.off("lineRemoved",this.onLineChanged),this.hook.off("getStartPoint",this.onGetStartPoint),this.hook.off("getEndPoint",this.onGetEndPoint),this.hook.off("nowPointChange",this.onNowPointChange),this.hook.off("willChangeState",this.onWillChangeState),this.hook.emit("selectedChange",[]),this.dashed.distanceItem.remove(),this.five.needsRender=!0}highlightLine(e){e.selected||(e.selected=!0,this.group.add(e.lightMesh),e.distanceItem.highlight(),this.five.needsRender=!0)}clearHighlightLines(){this.group.children.length!==0&&(this.deleteDom.setLines([]).hide(),this.polyline.lines.forEach(e=>{e.selected=!1,e.distanceItem.unHighlight(),this.group.remove(e.lightMesh)}),this.highlightedLines=[],this.five.needsRender=!0)}getEditingLines(){return this.polyline.lines}addStartPoint(){}highlightLines(e){this.clearHighlightLines(),this.highlightedLines=e,this.deleteDom.setLines(e).updatePosition().show(),e.forEach(n=>this.highlightLine(n))}}const Cl="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNzIiIGhlaWdodD0iNzIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM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jIyNi42JSIgaGVpZ2h0PSI0MzcuNSUiIGZpbHRlclVuaXRzPSJvYmplY3RCb3VuZGluZ0JveCIgaWQ9InByZWZpeF9fYyI+PGZlR2F1c3NpYW5CbHVyIHN0ZERldmlhdGlvbj0iOCIgaW49IlNvdXJjZUdyYXBoaWMiLz48L2ZpbHRlcj48L2RlZnM+PGcgZmlsbD0ibm9uZSIgZmlsbC1ydWxlPSJldmVub2RkIj48Y2lyY2xlIHN0cm9rZT0idXJsKCNwcmVmaXhfX2EpIiBzdHJva2Utd2lkdGg9Ii40IiBmaWxsPSJ1cmwoI3ByZWZpeF9fYikiIG9wYWNpdHk9Ii43IiBjeD0iMzYiIGN5PSIzNiIgcj0iMjguMjQ0Ii8+PGVsbGlwc2UgZmlsbD0iIzdDOTBEQSIgb3BhY2l0eT0iLjU5NiIgZmlsdGVyPSJ1cmwoI3ByZWZpeF9fYykiIGN4PSIzNiIgY3k9IjM2IiByeD0iMTguOTYzIiByeT0iNy4xMTEiLz48cGF0aCBkPSJNMzYgMEMxNi4xMTggMCAwIDE2LjExOCAwIDM2czE2LjExOCAzNiAzNiAzNiAzNi0xNi4xMTggMzYtMzZTNTUuODgyIDAgMzYgMHptMCA0LjQ0NGMxNy40MjggMCAzMS41NTYgMTQuMTI4IDMxLjU1NiAzMS41NTZTNTMuNDI4IDY3LjU1NiAzNiA2Ny41NTYgNC40NDQgNTMuNDI4IDQuNDQ0IDM2IDE4LjU3MiA0LjQ0NCAzNiA0LjQ0NHoiIGZpbGw9InVybCgjcHJlZml4X19kKSIgZmlsbC1ydWxlPSJub256ZXJvIi8+PC9nPjwvc3ZnPg==",Pm=`
|
|
313
313
|
<svg class="fpm__exit-icon width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
|
|
314
314
|
<defs>
|
|
315
315
|
<radialGradient cx="50%" cy="50%" fx="50%" fy="50%" r="86.3016741%" id="radialGradient-1">
|
|
@@ -509,14 +509,14 @@ void main() {
|
|
|
509
509
|
</div>
|
|
510
510
|
</div>
|
|
511
511
|
</div>
|
|
512
|
-
`,Lm={display:"none",position:"absolute",top:"0",left:"0",width:"100%",height:"100%",opacity:"0",transform:"translate(0, 10px)",transition:"opacity 500ms ease-in-out, transform 500ms ease-in-out"},Sm={position:"absolute",left:"50%",bottom:"32px",transform:"translateX(-50%)",height:"89px",display:"flex",justifyContent:"space-between",alignItems:"center",fontSize:"14px",pointerEvents:"all",color:"#fff",zIndex:"10"},Mm={position:"absolute",bottom:"0",left:"0",opacity:"0.5",width:"100%",height:"184px",background:"linear-gradient(180deg, rgba(0,0,0,0.00) 0%, #000000 100%)",zIndex:"0"},Pl={margin:"0 64px"},Tm={opacity:"0.85"},Il={width:"72px",height:"72px",backgroundSize:"100%",cursor:"pointer",transition:"all 200ms ease-in-out"},zm={width:"24px",height:"24px",marginRight:"4px",backgroundSize:"100%",cursor:"pointer"},Bm={userSelect:"none",pointerEvents:"none"};class Vm{constructor(t,e,n){f(this,"container");f(this,"measureController");f(this,"mainElement");f(this,"_params");f(this,"_btnTexts",{start:"\u5F00\u59CB",end:"\u7ED3\u675F",revoke:"\u64A4\u9500",exit:"\u9000\u51FA"});f(this,"onMouseEnter",()=>{const{mainItem:t}=this.mainElement;t.style.opacity="1"});f(this,"onMouseLeave",()=>{const{mainItem:t}=this.mainElement;t.style.opacity="0.85"});f(this,"onClick",()=>{this.measureController.getCurrentMode()!=="Edit"?this.measureController.changeMode("Edit"):this.measureController.save().changeMode("Watch")});f(this,"modeChangeHandler",t=>{t==="Edit"?this.change2Done():this.change2Add()});var r,a,l,c;this._params=n,this._btnTexts={start:(r=this._params.startButtonText)!=null?r:this._btnTexts.start,end:(a=this._params.endButtonText)!=null?a:this._btnTexts.end,revoke:(l=this._params.revokeButtonText)!=null?l:this._btnTexts.revoke,exit:(c=this._params.exitButtonText)!=null?c:this._btnTexts.exit},this.measureController=t,this.container=e,this.mainElement=this.getMainElement(),Object.assign(this.mainElement.mainIcon.style,Il),Object.assign(this.mainElement.mainItem.style,Pl);const{revokeTextDom:o,exitTextDom:s}=this._getTextElement();o&&(o.innerText=this._btnTexts.revoke),s&&(s.innerText=this._btnTexts.exit),this.change2Add(),this.measureController.hook.on("modeChange",this.modeChangeHandler),this.mainElement.mainItem.addEventListener("click",this.onClick),this.mainElement.mainItem.addEventListener("mouseenter",this.onMouseEnter),this.mainElement.mainItem.addEventListener("mouseleave",this.onMouseLeave)}dispose(){this.measureController.hook.off("modeChange",this.modeChangeHandler),this.mainElement.mainItem.removeEventListener("click",this.onClick),this.mainElement.mainItem.removeEventListener("mouseenter",this.onMouseEnter),this.mainElement.mainItem.removeEventListener("mouseleave",this.onMouseLeave)}getMainElement(){const t=this.container.querySelector(".fpm__main-text"),e=this.container.querySelector(".fpm__main"),n=this.container.querySelector(".fpm__main-icon");if(!e||!t||!n)throw new Error("cannot find dom");return{mainTextDom:t,mainItem:e,mainIcon:n}}_getTextElement(){const t=this.container.querySelector(".fpm__revoke-text"),e=this.container.querySelector(".fpm__exit-text");return{revokeTextDom:t,exitTextDom:e}}change2Add(){const{mainIcon:t,mainTextDom:e}=this.mainElement;if(t.className.includes("fpm__main__start")){e.innerText=this._btnTexts.start;return}t.className.includes("fpm__main__end")&&(t.style.transform="scale(0.8)",e.className.includes("fpm__main-text__show")?e.classList.replace("fpm__main-text__show","fpm__main-text__hide"):e.classList.add("fpm__main-text__hide"),setTimeout(()=>{t.classList.replace("fpm__main__end","fpm__main__start"),t.style.transform="scale(1)",e.innerText=this._btnTexts.start,e.classList.replace("fpm__main-text__hide","fpm__main-text__show")},200))}change2Done(){const{mainTextDom:t,mainIcon:e}=this.getMainElement();t.innerText!==this._btnTexts.end&&(e.className.includes("fpm__main__end")||e.className.includes("fpm__main__start")&&(e.style.transform="scale(0.8)",t.className.includes("fpm__main-text__show")?t.classList.replace("fpm__main-text__show","fpm__main-text__hide"):t.classList.add("fpm__main-text__hide"),setTimeout(()=>{e.classList.replace("fpm__main__start","fpm__main__end"),e.style.transform="scale(1)",t.innerText=this._btnTexts.end,t.classList.replace("fpm__main-text__hide","fpm__main-text__show")},200)))}}class jm{constructor(t,e,n){f(this,"container");f(this,"measureController");f(this,"mainElement");f(this,"_params");f(this,"_btnTexts",{start:"\u5F00\u59CB",end:"\u7ED3\u675F"});f(this,"onClick",()=>{var t;this.mainElement.mainTextDom.innerText===((t=this._params.startButtonText)!=null?t:"\u5F00\u59CB")?(this.measureController.hook.emit("willChangeState","watching","editing"),this.change2Done()):(this.measureController.hook.emit("willChangeState","editing","watching"),this.change2Add())});var o,s;this._params=n,this._btnTexts={start:(o=this._params.startButtonText)!=null?o:this._btnTexts.start,end:(s=this._params.endButtonText)!=null?s:this._btnTexts.end},this.measureController=t,this.container=e,this.mainElement=this.getMainElement(),this.mainElement.mainIcon.setAttribute("style","-webkit-tap-highlight-color: rgba(0,0,0,0);"),Object.assign(this.mainElement.mainIcon.style,Il),Object.assign(this.mainElement.mainItem.style,Pl),this.change2Add(),this.mainElement.mainItem.addEventListener("click",this.onClick)}dispose(){this.mainElement.mainItem.removeEventListener("click",this.onClick)}getMainElement(){const t=this.container.querySelector(".fpm__main-text"),e=this.container.querySelector(".fpm__main"),n=this.container.querySelector(".fpm__main-icon");if(!e||!t||!n)throw new Error("cannot find dom");return{mainTextDom:t,mainItem:e,mainIcon:n}}change2Add(){const{mainIcon:t,mainTextDom:e}=this.mainElement;if(t.className.includes("fpm__main__start")){e.innerText=this._btnTexts.start;return}t.className.includes("fpm__main__end")&&(t.style.transform="scale(0.8)",e.className.includes("fpm__main-text__show")?e.classList.replace("fpm__main-text__show","fpm__main-text__hide"):e.classList.add("fpm__main-text__hide"),setTimeout(()=>{t.classList.replace("fpm__main__end","fpm__main__start"),t.style.transform="scale(1)",e.innerText=this._btnTexts.start,e.classList.replace("fpm__main-text__hide","fpm__main-text__show")},200))}change2Done(){const{mainTextDom:t,mainIcon:e}=this.mainElement;t.innerText!==this._btnTexts.end&&(e.className.includes("fpm__main__end")||e.className.includes("fpm__main__start")&&(e.style.transform="scale(0.8)",t.className.includes("fpm__main-text__show")?t.classList.replace("fpm__main-text__show","fpm__main-text__hide"):t.classList.add("fpm__main-text__hide"),setTimeout(()=>{e.classList.replace("fpm__main__start","fpm__main__end"),e.style.transform="scale(1)",t.innerText=this._btnTexts.end,t.classList.replace("fpm__main-text__hide","fpm__main-text__show")},200)))}}class Om{constructor(t,e){f(this,"container");f(this,"revokeIcon");f(this,"revokeItem");f(this,"measureController");f(this,"onClick",()=>{this.measureController.revoke()});f(this,"onModeChange",t=>{if(t!=="Edit"&&this.revokeItem.className.includes("enabled")){this.revokeItem.classList.remove("enabled"),this.measureController.hook.off("anchorChange",this.onAnchorChange);return}this.measureController.hook.on("anchorChange",this.onAnchorChange)});f(this,"onAnchorChange",t=>{t&&this.revokeItem.classList.add("enabled")});this.measureController=t,this.container=e;const n=this.container.querySelector(".fpm__revoke-icon"),o=this.container.querySelector(".fpm__revoke");if(!n||!o)throw new Error("\u4E0D\u6B63\u786E\u7684\u9009\u62E9\u5668");this.revokeIcon=n,this.revokeItem=o,this.revokeItem.addEventListener("click",this.onClick),t.hook.on("modeChange",this.onModeChange)}dispose(){this.revokeItem.removeEventListener("click",this.onClick),this.measureController.hook.off("modeChange",this.onModeChange)}}class Vs{constructor(t,e){f(this,"revoke");f(this,"container");f(this,"mainController");f(this,"disposers",[]);f(this,"measureController");f(this,"mode");f(this,"_params");f(this,"handleExit",()=>{const t=this.container.querySelector(".fpm__exit-icon"),e=this.container.querySelector(".fpm__exit");if(!e||!t)throw new Error("cannot find dom");this.mode==="pc"&&(Object.assign(e.style,Tm),Object.assign(t==null?void 0:t.style,zm));const n=()=>{e.style.opacity="1"},o=()=>{e.style.opacity="0.85"},s=()=>{this.measureController.disable()};return e.addEventListener("click",s),e.addEventListener("mouseenter",n),e.addEventListener("mouseleave",o),()=>{e.removeEventListener("click",s),e.removeEventListener("mouseenter",n),e.removeEventListener("mouseleave",o)}});var r;this._params=e,this.measureController=t,this.mode=(r=e.mode)!=null?r:"pc",this.container=document.createElement("div"),this.container.innerHTML=this.mode==="mobile"?Im:Dm,this.container.classList.add("fpm__ui-controller",this.mode),this.container.style.background="rgba(0, 0, 0, 0.15)",e.container.appendChild(this.container);const n=this.container.querySelectorAll(".fpm__text"),o=this.container.querySelector(".fpm_ui-bg"),s=this.container.querySelector(".fpm_operating-space");Object.assign(o==null?void 0:o.style,Mm),Object.assign(s==null?void 0:s.style,Sm),Object.assign(this.container.style,Lm),n.forEach(a=>Object.assign(a.style,Bm))}dispose(){this.hide(),this.container.remove()}show(){return this.container.style.display="block",this.container.style.opacity="1",this.container.style.transform="translate(0, 0)",this.mode==="pc"?(this.revoke=new Om(this.measureController,this.container),this.mainController=new Vm(this.measureController,this.container,this._params)):this.mainController=new jm(this.measureController,this.container,this._params),this.disposers.push(this.handleExit()),this}hide(){var t,e;return this.container.style.display="none",this.container.style.opacity="0",this.container.style.transform="translate(0, 10px)",this.mode==="pc"&&((t=this.revoke)==null||t.dispose()),(e=this.mainController)==null||e.dispose(),this.disposers.forEach(n=>n()),this.disposers=[],this}}class Rm{constructor(t,e){f(this,"measureController");f(this,"textDom",document.createElement("span"));f(this,"container",document.createElement("div"));f(this,"hasAnchor",!1);f(this,"hasChangedToWatch",!1);f(this,"_params");f(this,"onModelChange",t=>{var e;if(t==="View"){this.hide();return}if(t==="Watch"){this.hasChangedToWatch?(this.textDom.innerText="",this.hide()):(this.show(),this.hasChangedToWatch=!0);return}t==="Edit"&&(this.textDom.innerText=(e=this._params.firstPointTip)!=null?e:"\u8BF7\u9009\u62E9\u7B2C\u4E00\u4E2A\u6D4B\u91CF\u70B9\uFF0CEsc\u6216\u5355\u51FB\u9F20\u6807\u53F3\u952E\u53EF\u53D6\u6D88\u9009\u62E9",this.show())});f(this,"anchorChange",t=>{var e,n;!this.hasAnchor&&!!t?(this.hasAnchor=!0,this.textDom.innerText=(e=this._params.nextPointTip)!=null?e:"\u9009\u62E9\u4E0B\u4E00\u4E2A\u6D4B\u91CF\u70B9\uFF0CEsc\u6216\u5355\u51FB\u9F20\u6807\u53F3\u952E\u53D6\u6D88\u9009\u62E9"):t||(this.hasAnchor=!1,this.textDom.innerText=(n=this._params.firstPointTip)!=null?n:"\u8BF7\u9009\u62E9\u7B2C\u4E00\u4E2A\u6D4B\u91CF\u70B9\uFF0CEsc\u6216\u5355\u51FB\u9F20\u6807\u53F3\u952E\u53EF\u53D6\u6D88\u9009\u62E9")});f(this,"onEditedLineChange",t=>{var e;t.lines.length===1&&(this.textDom.innerText=(e=this._params.endTip)!=null?e:"\u53EF\u4EE5\u8FDE\u7EED\u9009\u62E9\u6D4B\u91CF\u70B9\uFF0C\u6216\u70B9\u51FB\u4E0B\u65B9\u201C\u7ED3\u675F\u201D\u6309\u94AE\u5B8C\u6210\u6D4B\u91CF\uFF08Esc\u53D6\u6D88\uFF0CCommand+S\u4FDD\u5B58\uFF09")});this._params=e,this.initDom(),e.container.append(this.container),this.measureController=t,t.hook.on("modeChange",this.onModelChange),t.hook.on("anchorChange",this.anchorChange),t.hook.on("editedPolylineChange",this.onEditedLineChange)}dispose(){this.hide(),this.container.remove()}show(){return this.container.style.opacity="1",this.container.style.transform="translate(0, 0)",this}hide(){return this.container.style.opacity="0",this.container.style.transform="translate(0, -10px)",this.measureController.hook.off("modeChange",this.onModelChange),this.measureController.hook.off("anchorChange",this.anchorChange),this.measureController.hook.off("editedPolylineChange",this.onEditedLineChange),this}initDom(){var n;const t=this.container,e=this.textDom;t.classList.add("fpm__guide-container"),t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.width="100%",t.style.height="110px",t.style.display="flex",t.style.alignItems="center",t.style.justifyContent="center",t.style.transform="translate(0, -10px)",t.style.background="linear-gradient(180deg, rgba(0,0,0,0.40) 0%, rgba(0,0,0,0.00) 100%)",t.style.transition="opacity 500ms ease-in-out, transform 500ms ease-in-out",t.style.opacity="0",e.classList.add("fpm__guide-text"),e.style.color="#fff",e.style.fontSize="20px",e.innerText=(n=this._params.startTip)!=null?n:"\u70B9\u51FB\u4E0B\u65B9\u201C\u5F00\u59CB\u201D\u6309\u94AE\u5F00\u59CB\u6D4B\u8DDD",t.appendChild(e)}}class Qm{constructor(t,e){f(this,"five");f(this,"measureController");f(this,"onKeyDown",t=>{if(t.metaKey&&t.code==="KeyS"){this.measureController.save().changeMode("Watch"),t.preventDefault();return}if(t.code==="Escape")return this.escape()});f(this,"onMouseDown",t=>{t.button===2&&(t.preventDefault(),this.escape())});this.five=e,this.measureController=t;const n=this.five.getElement();!n||(document.body.addEventListener("keydown",this.onKeyDown),n.addEventListener("mousedown",this.onMouseDown))}dispose(){const t=this.five.getElement();!t||(document.body.removeEventListener("keydown",this.onKeyDown),t.removeEventListener("mousedown",this.onMouseDown))}escape(){return this.measureController.getCurrentMode()==="Watch"?this.measureController.disable():this.measureController.changeMode("Watch")}}class Fm{constructor(t,e){f(this,"hasOpen",!1);f(this,"hook",new Ce.Subscribe);f(this,"magnifier");f(this,"five");f(this,"model");f(this,"group");f(this,"config");f(this,"isMobile");f(this,"fiveHelper");f(this,"useUIController");f(this,"params");f(this,"useGuideController");f(this,"container",document.createElement("div"));f(this,"shortcutKeyController");f(this,"controller",null);f(this,"getCurrentMode",()=>this.controller instanceof Wn?"Edit":this.controller instanceof Bs?"Watch":this.controller instanceof un?"Mixed":this.controller instanceof Ts?"View":null);f(this,"changeMode",t=>{var o;if(!this.hasOpen||this.getCurrentMode()===t)return;(o=this.controller)==null||o.dispose();const e={View:Ts,Watch:Bs,Edit:Wn,Mixed:un};if(!e[t])throw new Error("\u4E0D\u5B58\u5728\u7684 Mode");const n=this.createControllerParams();this.controller=new e[t](n),this.hook.emit("modeChange",t)});var o,s,r,a;this.five=t,this.params=e,this.config=wi(e,["openParams","magnifierParams"]),this.model=new Ei(this.config),this.fiveHelper=new qf(t),this.isMobile=(s=(o=e==null?void 0:e.openParams)==null?void 0:o.isMobile)!=null?s:!1,this.magnifier=new pl(t,(r=e.magnifierParams)!=null?r:{width:190,height:190,scale:2}),this.group=new j.Group,this.group.name="plugin-measure-group",this.container.classList.add("five-plugin-measure-container"),this.container.style.position="absolute",this.container.style.left="0",this.container.style.top="0",this.container.style.pointerEvents="none",this.container.style.width="100%",this.container.style.height="100%",this.container.style.opacity="0";const n=(a=this.params.openParams)!=null?a:{};if(this.params.useUIController!==!1){const l=Q({container:this.container,openParams:n},typeof this.params.useUIController=="object"?this.params.useUIController:{});this.useUIController=new Vs(this,l)}if(this.params.useGuideController!==!1){const l=Q({container:this.container},typeof this.params.useGuideController=="object"?this.params.useGuideController:{});this.useGuideController=new Rm(this,l)}}appendTo(t){t.append(this.container)}dispose(){var t,e;this.disable(),(t=this.useUIController)==null||t.dispose(),(e=this.magnifier)==null||e.dispose(),this.five.needsRender=!0}load(t){this.model.parse(t),this.save()}enable(t){var e;this.hasOpen||(this.hasOpen=!0,this.five.scene.add(this.group),this.container.style.opacity="1",t!=null&&t.mode?this.changeMode(t.mode):this.isMobile?this.changeMode("Mixed"):this.changeMode("Watch"),(e=this.useUIController)==null||e.show(),this.shortcutKeyController=new Qm(this,this.five),this.hook.emit("enable",!0))}disable(){var t,e,n,o;this.hasOpen=!1,this.container.style.opacity="0",(t=this.controller)==null||t.dispose(),(e=this.useUIController)==null||e.hide(),(n=this.useGuideController)==null||n.hide(),(o=this.shortcutKeyController)==null||o.dispose(),this.controller=null,this.five.helperVisible=!0,this.five.scene.remove(this.group),this.five.needsRender=!0,this.hook.emit("disable",!0)}edit(){const t=this.isMobile?"Mixed":"Edit";this.changeMode(t)}revoke(){this.controller instanceof Wn&&this.controller.revoke()}removePolyline(t){this.model.removePolyline(t)}removePolylineByID(t){const e=this.model.getPolylineByID(t);e&&this.model.removePolyline(e)}getPolylineByID(t){return this.model.getPolylineByID(t)}getEditedPolyline(){}highlightLine(t){if(this.getCurrentMode()!=="Watch")return!1;const e=this.model.getLineByID(t);return e?(this.controller.highlightLine(e),!0):!1}clearHighlightLines(){return this.getCurrentMode()!=="Watch"?!1:(this.controller.clearHighlightLines(),!0)}save(t){var o;if(!(this.controller instanceof Wn)&&!(this.controller instanceof un))return this;const e=(o=t==null?void 0:t.mode)!=null?o:"View",n=this.controller.polyline;return this.model.addPolyline(n),this.changeMode(e),this}addStartPoint(){this.controller instanceof un&&this.hook.emit("willChangeState","watching","editing")}addEndPoint(){this.controller instanceof un&&this.hook.emit("willChangeState","editing","watching")}toJson(){return this.model.toJson()}changeIsMobile(t){var e;if(this.isMobile=t,this.params.useUIController!==!1){(e=this.useUIController)==null||e.dispose();const n=Q({container:this.container,mode:this.isMobile?"mobile":"pc"},typeof this.params.useUIController=="object"?this.params.useUIController:{});this.useUIController=new Vs(this,n)}}changeConfigs(t){var e;Object.assign(this.config,t),(e=this.controller)==null||e.updateDistanceUI()}setCustomText(t,e){var o;const n=this.model.getLineByID(t);if(!n)throw new Error("\u4E0D\u5B58\u5728\u7684\u7EBF\u6BB5");n.setText(e),(o=this.controller)==null||o.updateDistanceUI()}createControllerParams(){var e;const t=(e=this.params.openParams)!=null?e:{};return t.isMobile=this.isMobile,{five:this.five,hook:this.hook,group:this.group,model:this.model,config:this.config,magnifier:this.magnifier,container:this.container,fiveHelper:this.fiveHelper,openParams:t,mouseGroup:wl(Q({},t.crossHairParameter)),userDistanceItemCreator:this.params.userDistanceItemCreator}}}const Hm=function(t,e){return new Fm(t,e)},kl=bo(null);function _m(i){le(i,"svelte-19zi46m",".PanoSpatialTagPlugin__tag-origin.svelte-19zi46m{position:absolute;width:0.5rem;height:0.5rem;border-radius:50%;background:#fff;box-shadow:0 0 .6rem #fff;transform:translate(-50%, -50%) scale(1);transform-origin:center center;animation:svelte-19zi46m-PanoSpatialTagPlugin__tag-origin 1.2s forwards;pointer-events:auto}.PanoSpatialTagPlugin__tag-origin.svelte-19zi46m:after{content:'';position:absolute;top:50%;height:50%;width:2rem;height:2rem;transform:translate(-50%, -50%)}.PanoSpatialTagPlugin__tag-origin-destroy.svelte-19zi46m{transform:translate(-50%, -50%) scale(0.6);animation:svelte-19zi46m-PanoSpatialTagPlugin__tag-origin-destroy 1.2s forwards .7s}@keyframes svelte-19zi46m-PanoSpatialTagPlugin__tag-origin{0%{transform:translate(-50%, -50%) scale(1);opacity:0}100%{transform:translate(-50%, -50%) scale(0.6);opacity:1 }}@keyframes svelte-19zi46m-PanoSpatialTagPlugin__tag-origin-destroy{0%{transform:translate(-50%, -50%) scale(0.6);opacity:1}10%{transform:translate(-50%, -50%) scale(1);opacity:0.9}100%{transform:translate(-50%, -50%) scale(1);opacity:0}}")}function js(i,t,e){const n=i.slice();return n[3]=t[e],n}function Os(i){let t,e=`${i[3].top}%`,n=`${i[3].left}%`,o,s;function r(){return i[2](i[3])}return{c(){t=z("i"),y(t,"class","svelte-19zi46m"),q(t,"PanoSpatialTagPlugin__tag-origin",!0),q(t,"PanoSpatialTagPlugin__tag-origin-destroy",i[3].destroying),T(t,"top",e),T(t,"left",n),T(t,"visibility",i[3].front?"visible":"hidden")},m(a,l){M(a,t,l),o||(s=me(t,"click",r),o=!0)},p(a,l){i=a,l&1&&q(t,"PanoSpatialTagPlugin__tag-origin-destroy",i[3].destroying),l&1&&e!==(e=`${i[3].top}%`)&&T(t,"top",e),l&1&&n!==(n=`${i[3].left}%`)&&T(t,"left",n),l&1&&T(t,"visibility",i[3].front?"visible":"hidden")},d(a){a&&L(t),o=!1,s()}}}function Gm(i){let t,e=i[0],n=[];for(let o=0;o<e.length;o+=1)n[o]=Os(js(i,e,o));return{c(){for(let o=0;o<n.length;o+=1)n[o].c();t=ge()},m(o,s){for(let r=0;r<n.length;r+=1)n[r].m(o,s);M(o,t,s)},p(o,[s]){if(s&3){e=o[0];let r;for(r=0;r<e.length;r+=1){const a=js(o,e,r);n[r]?n[r].p(a,s):(n[r]=Os(a),n[r].c(),n[r].m(t.parentNode,t))}for(;r<n.length;r+=1)n[r].d(1);n.length=e.length}},i:X,o:X,d(o){ut(n,o),o&&L(t)}}}function Wm(i,t,e){let{origins:n}=t;const o=r=>{kl.update(()=>`${r}-PanoSpatialTagPlugin-${Date.now()}`)},s=r=>o(r.id);return i.$$set=r=>{"origins"in r&&e(0,n=r.origins)},[n,o,s]}class Nm extends oe{constructor(t){super(),ie(this,t,Wm,Gm,ne,{origins:0},_m)}}function Xm(i){le(i,"svelte-1i5h9zh",".PanoSpatialTagPlugin__tag-x.svelte-1i5h9zh.svelte-1i5h9zh{position:absolute;top:0;left:0;display:block;white-space:nowrap;box-sizing:border-box;width:25rem;height:14rem;color:#FFF;transform:translate(0, -100%);transition:height .5s linear}.PanoSpatialTagPlugin__tag-shadow.svelte-1i5h9zh.svelte-1i5h9zh{content:'';position:absolute;width:30rem;height:30rem;top:-15rem;left:-15rem;z-index:-1;opacity:0;transition:opacity .8s .6s;background:url('https://vrlab-image4.ljcdn.com/release/web/PanoSpatialTagPlugin__blur.png');background-size:30rem 30rem}.PanoSpatialTagPlugin__tag-line.svelte-1i5h9zh.svelte-1i5h9zh{position:absolute;left:-1rem;width:2rem;height:100%;overflow:hidden}.PanoSpatialTagPlugin__tag-flagpole.svelte-1i5h9zh.svelte-1i5h9zh{position:absolute;top:0;left:1rem;height:calc(100% - 1.5rem);width:.15rem;background:linear-gradient(to bottom, rgba(255, 255, 255, 1), rgba(255, 255, 255, .1));box-shadow:0 .1rem .5rem rgba(0, 0, 0, .2);opacity:0;transform:translate(-50%, 60%) scaleY(0);transition:transform .4s cubic-bezier(.44,.44,.74,.98) , opacity .4s cubic-bezier(.44,.44,.74,.98), width .5s linear, height .5s linear ;transform-origin:center bottom}.PanoSpatialTagPlugin__tag-line1.svelte-1i5h9zh.svelte-1i5h9zh{position:absolute;top:0;left:0.3rem;height:1.8rem;width:.1rem;background:#fff;opacity:0;transform:translate(-50%, 200%) scaleY(0);transform-origin:center top}.PanoSpatialTagPlugin__tag-line2.svelte-1i5h9zh.svelte-1i5h9zh{position:absolute;top:0;left:0.5rem;height:1.8rem;width:.1rem;background:#fff;opacity:0;transform:translate(-50%, 200%) scaleY(0);transform-origin:center top}.PanoSpatialTagPlugin__tag-show.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-line1.svelte-1i5h9zh{animation:svelte-1i5h9zh-PanoSpatialTagPlugin__tag-line1 linear .5s forwards .45s}.PanoSpatialTagPlugin__tag-show.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-line2.svelte-1i5h9zh{animation:svelte-1i5h9zh-PanoSpatialTagPlugin__tag-line2 linear .5s forwards .65s}.PanoSpatialTagPlugin__tag-x.PanoSpatialTagPlugin__tag-upside-down.svelte-1i5h9zh.svelte-1i5h9zh{transform:translate(0, 0)}.PanoSpatialTagPlugin__tag-upside-down.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-line.svelte-1i5h9zh{transform:scaleY(-1)}.PanoSpatialTagPlugin__tag-animate.svelte-1i5h9zh.svelte-1i5h9zh{position:relative;height:100%;overflow:hidden;transform-origin:left top;transition:transform .5s linear}.PanoSpatialTagPlugin__tag-upside-down.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-animate.svelte-1i5h9zh{transform-origin:left bottom}.PanoSpatialTagPlugin__tag-content.svelte-1i5h9zh.svelte-1i5h9zh{position:absolute;display:inline-block;transform:translate(-100%, 0);transition:transform .9s cubic-bezier(0,.65,.16,1.08) .6s;padding-left:.5rem;font-size:1rem}.PanoSpatialTagPlugin__tag-upside-down.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-content.svelte-1i5h9zh{bottom:0}.PanoSpatialTagPlugin__tag-show.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-flagpole.svelte-1i5h9zh{opacity:1;transform:translate(-50%, 0) scaleY(1)}.PanoSpatialTagPlugin__tag-upside-down.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-shadow.svelte-1i5h9zh{top:unset;bottom:-15rem}.PanoSpatialTagPlugin__tag-show.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-shadow.svelte-1i5h9zh{opacity:.32}.PanoSpatialTagPlugin__tag-show.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-content.svelte-1i5h9zh{transform:translate(0, 0)}.PanoSpatialTagPlugin__tag-hide.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-flagpole.svelte-1i5h9zh{opacity:0;transform:translate(-50%, 60%) scaleY(0);transition:transform .5s .55s, opacity .4s .55s}.PanoSpatialTagPlugin__tag-hide.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-shadow.svelte-1i5h9zh{opacity:0;transition:opacity .8s}.PanoSpatialTagPlugin__tag-hide.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-content.svelte-1i5h9zh{transform:translate(-100%, 0);transition:transform .6s cubic-bezier(.53,.06,.88,.59)}.PanoSpatialTagPlugin__tag-hide.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-content .svelte-1i5h9zh{pointer-events:none}.PanoSpatialTagPlugin__tag-hide.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-line1.svelte-1i5h9zh{opacity:0.5;transform:translate(-50%, 10%) scaleY(0);animation:svelte-1i5h9zh-PanoSpatialTagPlugin__tag-line1-hide linear .28s forwards .3s}.PanoSpatialTagPlugin__tag-hide.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-line2.svelte-1i5h9zh{opacity:0.5;transform:translate(-50%, 0) scaleY(0);animation:svelte-1i5h9zh-PanoSpatialTagPlugin__tag-line2-hide linear .28s forwards .45s}@keyframes svelte-1i5h9zh-PanoSpatialTagPlugin__tag-line1{0%{opacity:0;transform:translate(-50%, 250%) scaleY(1)}50%{opacity:0.5;transform:translate(-50%, 135%) scaleY(1)}100%{opacity:0.5;transform:translate(-50%, 20%) scaleY(0)}}@keyframes svelte-1i5h9zh-PanoSpatialTagPlugin__tag-line2{0%{opacity:0;transform:translate(-50%, 250%) scaleY(1)}50%{opacity:0.5;transform:translate(-50%, 125%) scaleY(1)}100%{opacity:0.5;transform:translate(-50%, 0) scaleY(0)}}@keyframes svelte-1i5h9zh-PanoSpatialTagPlugin__tag-line1-hide{0%{opacity:0.5;transform:translate(-50%, 10%) scaleY(0)}50%{opacity:0.2;transform:translate(-50%, 105%) scaleY(1)}100%{opacity:0;transform:translate(-50%, 200%) scaleY(0)}}@keyframes svelte-1i5h9zh-PanoSpatialTagPlugin__tag-line2-hide{0%{opacity:0.5;transform:translate(-50%, 0) scaleY(0)}50%{opacity:0.2;transform:translate(-50%, 100%) scaleY(1)}100%{opacity:0;transform:translate(-50%, 200%) scaleY(0)}}")}function Ym(i){let t,e,n,o,s,r,a,l,c,u,h,d,m,g,p;return{c(){t=z("div"),e=z("div"),n=$(),o=z("div"),s=z("i"),r=$(),a=z("i"),l=$(),c=z("i"),u=$(),h=z("div"),d=z("div"),y(e,"class","PanoSpatialTagPlugin__tag-shadow svelte-1i5h9zh"),T(e,"transform","translate("+i[7]/2*i[3]*3+"px, "+i[8]/2*(i[1]?-1:1)*i[3]*3+"px) scale("+1/i[3]+")"),y(s,"class","PanoSpatialTagPlugin__tag-flagpole svelte-1i5h9zh"),T(s,"width",i[4]+"rem"),y(a,"class","PanoSpatialTagPlugin__tag-line1 svelte-1i5h9zh"),y(c,"class","PanoSpatialTagPlugin__tag-line2 svelte-1i5h9zh"),y(o,"class","PanoSpatialTagPlugin__tag-line svelte-1i5h9zh"),y(d,"class","PanoSpatialTagPlugin__tag-content svelte-1i5h9zh"),y(h,"class","PanoSpatialTagPlugin__tag-animate svelte-1i5h9zh"),T(h,"transform","scale("+i[3]*3+")"),y(t,"id",m="PanoSpatialTagPlugin__"+i[0]),T(t,"height",20*i[5]+"rem"),y(t,"class","svelte-1i5h9zh"),q(t,"PanoSpatialTagPlugin__tag-x",!0),q(t,"PanoSpatialTagPlugin__tag-upside-down",i[1]),q(t,"PanoSpatialTagPlugin__tag-show",i[10]),q(t,"PanoSpatialTagPlugin__tag-hide",i[10]===!1||i[6])},m(A,v){M(A,t,v),V(t,e),V(t,n),V(t,o),V(o,s),V(o,r),V(o,a),V(o,l),V(o,c),V(t,u),V(t,h),V(h,d),d.innerHTML=i[2],i[16](d),g||(p=me(d,"click",i[11]),g=!0)},p(A,[v]){v&394&&T(e,"transform","translate("+A[7]/2*A[3]*3+"px, "+A[8]/2*(A[1]?-1:1)*A[3]*3+"px) scale("+1/A[3]+")"),v&16&&T(s,"width",A[4]+"rem"),v&4&&(d.innerHTML=A[2]),v&8&&T(h,"transform","scale("+A[3]*3+")"),v&1&&m!==(m="PanoSpatialTagPlugin__"+A[0])&&y(t,"id",m),v&32&&T(t,"height",20*A[5]+"rem"),v&2&&q(t,"PanoSpatialTagPlugin__tag-upside-down",A[1]),v&1024&&q(t,"PanoSpatialTagPlugin__tag-show",A[10]),v&1088&&q(t,"PanoSpatialTagPlugin__tag-hide",A[10]===!1||A[6])},i:X,o:X,d(A){A&&L(t),i[16](null),g=!1,p()}}}function Um(i,t,e){let{id:n}=t,{upsideDown:o}=t,{content:s}=t,{contentZoom:r}=t,{lineWidthZoom:a}=t,{lineHeightZoom:l}=t,{destroying:c=!1}=t,{folded:u}=t,{dispose:h}=t,{events:d}=t,{hooks:m}=t,g=0,p=0,A,v,b=setTimeout(()=>{u||e(10,v=!0),b=void 0},100);const w=I=>{const B=Object.keys(d);let x=I.target;for(;x;){const H=x.getAttribute("class");if(!H){x=x.parentNode;continue}if(H.includes("PanoSpatialTagPlugin__tag-content")){x=null;break}B.forEach(N=>{H.includes(N)&&d[N](n)}),x=x.parentNode}};Ze(()=>{m.emit("initTag",{id:n})});const k=kl.subscribe(I=>{if(I===null)return;const[B,x]=I.split("-PanoSpatialTagPlugin-");n===B&&(m.emit("clickOrigin",{id:n,show:v}),b||(e(10,v=u),e(12,u=!u),b=setTimeout(()=>{b=void 0},1500)))});Ga(()=>{e(7,g=A.offsetWidth),e(8,p=A.offsetHeight),!b&&e(10,v=!u)}),Et(()=>{m.emit("destroyTag",{id:n}),k(),h()});function C(I){Ve[I?"unshift":"push"](()=>{A=I,e(9,A)})}return i.$$set=I=>{"id"in I&&e(0,n=I.id),"upsideDown"in I&&e(1,o=I.upsideDown),"content"in I&&e(2,s=I.content),"contentZoom"in I&&e(3,r=I.contentZoom),"lineWidthZoom"in I&&e(4,a=I.lineWidthZoom),"lineHeightZoom"in I&&e(5,l=I.lineHeightZoom),"destroying"in I&&e(6,c=I.destroying),"folded"in I&&e(12,u=I.folded),"dispose"in I&&e(13,h=I.dispose),"events"in I&&e(14,d=I.events),"hooks"in I&&e(15,m=I.hooks)},[n,o,s,r,a,l,c,g,p,A,v,w,u,h,d,m,C]}class qm extends oe{constructor(t){super(),ie(this,t,Um,Ym,ne,{id:0,upsideDown:1,content:2,contentZoom:3,lineWidthZoom:4,lineHeightZoom:5,destroying:6,folded:12,dispose:13,events:14,hooks:15},Xm)}}const Jm={position:"absolute",top:"0px",left:"0px",width:"100%",height:"100%",pointerEvents:"none"},Rs="<",Qs=">",Fs="%",Hs="locals",Zm="(<%%|%%>|<%=|<%-|<%_|<%#|<%|%>|-%>|_%>)",Km={"&":"&","<":"<",">":">",'"':""","'":"'"},He={EVAL:"eval",ESCAPED:"escaped",RAW:"raw",COMMENT:"comment",LITERAL:"literal"};function _s(i){return i.replace(/;(\s*$)/,"$1")}function $m(i,t){return new eg(i).compileFunction()(t)}class eg{constructor(t){f(this,"templateText");f(this,"mode",null);f(this,"truncate",!1);f(this,"currentLine",1);f(this,"source","");f(this,"regex",new RegExp(Zm));this.templateText=t}compileFunction(){let t;const e=` var __output = "";
|
|
512
|
+
`,Lm={display:"none",position:"absolute",top:"0",left:"0",width:"100%",height:"100%",opacity:"0",transform:"translate(0, 10px)",transition:"opacity 500ms ease-in-out, transform 500ms ease-in-out"},Sm={position:"absolute",left:"50%",bottom:"32px",transform:"translateX(-50%)",height:"89px",display:"flex",justifyContent:"space-between",alignItems:"center",fontSize:"14px",pointerEvents:"all",color:"#fff",zIndex:"10"},Mm={position:"absolute",bottom:"0",left:"0",opacity:"0.5",width:"100%",height:"184px",background:"linear-gradient(180deg, rgba(0,0,0,0.00) 0%, #000000 100%)",zIndex:"0"},Pl={margin:"0 64px"},Tm={opacity:"0.85"},Il={width:"72px",height:"72px",backgroundSize:"100%",cursor:"pointer",transition:"all 200ms ease-in-out"},zm={width:"24px",height:"24px",marginRight:"4px",backgroundSize:"100%",cursor:"pointer"},Bm={userSelect:"none",pointerEvents:"none"};class Vm{constructor(t,e,n){f(this,"container");f(this,"measureController");f(this,"mainElement");f(this,"_params");f(this,"_btnTexts",{start:"\u5F00\u59CB",end:"\u7ED3\u675F",revoke:"\u64A4\u9500",exit:"\u9000\u51FA"});f(this,"onMouseEnter",()=>{const{mainItem:t}=this.mainElement;t.style.opacity="1"});f(this,"onMouseLeave",()=>{const{mainItem:t}=this.mainElement;t.style.opacity="0.85"});f(this,"onClick",()=>{this.measureController.getCurrentMode()!=="Edit"?this.measureController.changeMode("Edit"):this.measureController.save().changeMode("Watch")});f(this,"modeChangeHandler",t=>{t==="Edit"?this.change2Done():this.change2Add()});var r,a,l,c;this._params=n,this._btnTexts={start:(r=this._params.startButtonText)!=null?r:this._btnTexts.start,end:(a=this._params.endButtonText)!=null?a:this._btnTexts.end,revoke:(l=this._params.revokeButtonText)!=null?l:this._btnTexts.revoke,exit:(c=this._params.exitButtonText)!=null?c:this._btnTexts.exit},this.measureController=t,this.container=e,this.mainElement=this.getMainElement(),Object.assign(this.mainElement.mainIcon.style,Il),Object.assign(this.mainElement.mainItem.style,Pl);const{revokeTextDom:o,exitTextDom:s}=this._getTextElement();o&&(o.innerText=this._btnTexts.revoke),s&&(s.innerText=this._btnTexts.exit),this.change2Add(),this.measureController.hook.on("modeChange",this.modeChangeHandler),this.mainElement.mainItem.addEventListener("click",this.onClick),this.mainElement.mainItem.addEventListener("mouseenter",this.onMouseEnter),this.mainElement.mainItem.addEventListener("mouseleave",this.onMouseLeave)}dispose(){this.measureController.hook.off("modeChange",this.modeChangeHandler),this.mainElement.mainItem.removeEventListener("click",this.onClick),this.mainElement.mainItem.removeEventListener("mouseenter",this.onMouseEnter),this.mainElement.mainItem.removeEventListener("mouseleave",this.onMouseLeave)}getMainElement(){const t=this.container.querySelector(".fpm__main-text"),e=this.container.querySelector(".fpm__main"),n=this.container.querySelector(".fpm__main-icon");if(!e||!t||!n)throw new Error("cannot find dom");return{mainTextDom:t,mainItem:e,mainIcon:n}}_getTextElement(){const t=this.container.querySelector(".fpm__revoke-text"),e=this.container.querySelector(".fpm__exit-text");return{revokeTextDom:t,exitTextDom:e}}change2Add(){const{mainIcon:t,mainTextDom:e}=this.mainElement;if(t.className.includes("fpm__main__start")){e.innerText=this._btnTexts.start;return}t.className.includes("fpm__main__end")&&(t.style.transform="scale(0.8)",e.className.includes("fpm__main-text__show")?e.classList.replace("fpm__main-text__show","fpm__main-text__hide"):e.classList.add("fpm__main-text__hide"),setTimeout(()=>{t.classList.replace("fpm__main__end","fpm__main__start"),t.style.transform="scale(1)",e.innerText=this._btnTexts.start,e.classList.replace("fpm__main-text__hide","fpm__main-text__show")},200))}change2Done(){const{mainTextDom:t,mainIcon:e}=this.getMainElement();t.innerText!==this._btnTexts.end&&(e.className.includes("fpm__main__end")||e.className.includes("fpm__main__start")&&(e.style.transform="scale(0.8)",t.className.includes("fpm__main-text__show")?t.classList.replace("fpm__main-text__show","fpm__main-text__hide"):t.classList.add("fpm__main-text__hide"),setTimeout(()=>{e.classList.replace("fpm__main__start","fpm__main__end"),e.style.transform="scale(1)",t.innerText=this._btnTexts.end,t.classList.replace("fpm__main-text__hide","fpm__main-text__show")},200)))}}class jm{constructor(t,e,n){f(this,"container");f(this,"measureController");f(this,"mainElement");f(this,"_params");f(this,"_btnTexts",{start:"\u5F00\u59CB",end:"\u7ED3\u675F"});f(this,"onClick",()=>{var t;this.mainElement.mainTextDom.innerText===((t=this._params.startButtonText)!=null?t:"\u5F00\u59CB")?(this.measureController.hook.emit("willChangeState","watching","editing"),this.change2Done()):(this.measureController.hook.emit("willChangeState","editing","watching"),this.change2Add())});var o,s;this._params=n,this._btnTexts={start:(o=this._params.startButtonText)!=null?o:this._btnTexts.start,end:(s=this._params.endButtonText)!=null?s:this._btnTexts.end},this.measureController=t,this.container=e,this.mainElement=this.getMainElement(),this.mainElement.mainIcon.setAttribute("style","-webkit-tap-highlight-color: rgba(0,0,0,0);"),Object.assign(this.mainElement.mainIcon.style,Il),Object.assign(this.mainElement.mainItem.style,Pl),this.change2Add(),this.mainElement.mainItem.addEventListener("click",this.onClick)}dispose(){this.mainElement.mainItem.removeEventListener("click",this.onClick)}getMainElement(){const t=this.container.querySelector(".fpm__main-text"),e=this.container.querySelector(".fpm__main"),n=this.container.querySelector(".fpm__main-icon");if(!e||!t||!n)throw new Error("cannot find dom");return{mainTextDom:t,mainItem:e,mainIcon:n}}change2Add(){const{mainIcon:t,mainTextDom:e}=this.mainElement;if(t.className.includes("fpm__main__start")){e.innerText=this._btnTexts.start;return}t.className.includes("fpm__main__end")&&(t.style.transform="scale(0.8)",e.className.includes("fpm__main-text__show")?e.classList.replace("fpm__main-text__show","fpm__main-text__hide"):e.classList.add("fpm__main-text__hide"),setTimeout(()=>{t.classList.replace("fpm__main__end","fpm__main__start"),t.style.transform="scale(1)",e.innerText=this._btnTexts.start,e.classList.replace("fpm__main-text__hide","fpm__main-text__show")},200))}change2Done(){const{mainTextDom:t,mainIcon:e}=this.mainElement;t.innerText!==this._btnTexts.end&&(e.className.includes("fpm__main__end")||e.className.includes("fpm__main__start")&&(e.style.transform="scale(0.8)",t.className.includes("fpm__main-text__show")?t.classList.replace("fpm__main-text__show","fpm__main-text__hide"):t.classList.add("fpm__main-text__hide"),setTimeout(()=>{e.classList.replace("fpm__main__start","fpm__main__end"),e.style.transform="scale(1)",t.innerText=this._btnTexts.end,t.classList.replace("fpm__main-text__hide","fpm__main-text__show")},200)))}}class Om{constructor(t,e){f(this,"container");f(this,"revokeIcon");f(this,"revokeItem");f(this,"measureController");f(this,"onClick",()=>{this.measureController.revoke()});f(this,"onModeChange",t=>{if(t!=="Edit"&&this.revokeItem.className.includes("enabled")){this.revokeItem.classList.remove("enabled"),this.measureController.hook.off("anchorChange",this.onAnchorChange);return}this.measureController.hook.on("anchorChange",this.onAnchorChange)});f(this,"onAnchorChange",t=>{t&&this.revokeItem.classList.add("enabled")});this.measureController=t,this.container=e;const n=this.container.querySelector(".fpm__revoke-icon"),o=this.container.querySelector(".fpm__revoke");if(!n||!o)throw new Error("\u4E0D\u6B63\u786E\u7684\u9009\u62E9\u5668");this.revokeIcon=n,this.revokeItem=o,this.revokeItem.addEventListener("click",this.onClick),t.hook.on("modeChange",this.onModeChange)}dispose(){this.revokeItem.removeEventListener("click",this.onClick),this.measureController.hook.off("modeChange",this.onModeChange)}}class Vs{constructor(t,e){f(this,"revoke");f(this,"container");f(this,"mainController");f(this,"disposers",[]);f(this,"measureController");f(this,"mode");f(this,"_params");f(this,"handleExit",()=>{const t=this.container.querySelector(".fpm__exit-icon"),e=this.container.querySelector(".fpm__exit");if(!e||!t)throw new Error("cannot find dom");this.mode==="pc"&&(Object.assign(e.style,Tm),Object.assign(t==null?void 0:t.style,zm));const n=()=>{e.style.opacity="1"},o=()=>{e.style.opacity="0.85"},s=()=>{this.measureController.disable()};return e.addEventListener("click",s),e.addEventListener("mouseenter",n),e.addEventListener("mouseleave",o),()=>{e.removeEventListener("click",s),e.removeEventListener("mouseenter",n),e.removeEventListener("mouseleave",o)}});var r;this._params=e,this.measureController=t,this.mode=(r=e.mode)!=null?r:"pc",this.container=document.createElement("div"),this.container.innerHTML=this.mode==="mobile"?Im:Dm,this.container.classList.add("fpm__ui-controller",this.mode),this.container.style.background="rgba(0, 0, 0, 0.15)",e.container.appendChild(this.container);const n=this.container.querySelectorAll(".fpm__text"),o=this.container.querySelector(".fpm_ui-bg"),s=this.container.querySelector(".fpm_operating-space");Object.assign(o==null?void 0:o.style,Mm),Object.assign(s==null?void 0:s.style,Sm),Object.assign(this.container.style,Lm),n.forEach(a=>Object.assign(a.style,Bm))}dispose(){this.hide(),this.container.remove()}show(){return this.container.style.display="block",this.container.style.opacity="1",this.container.style.transform="translate(0, 0)",this.mode==="pc"?(this.revoke=new Om(this.measureController,this.container),this.mainController=new Vm(this.measureController,this.container,this._params)):this.mainController=new jm(this.measureController,this.container,this._params),this.disposers.push(this.handleExit()),this}hide(){var t,e;return this.container.style.display="none",this.container.style.opacity="0",this.container.style.transform="translate(0, 10px)",this.mode==="pc"&&((t=this.revoke)==null||t.dispose()),(e=this.mainController)==null||e.dispose(),this.disposers.forEach(n=>n()),this.disposers=[],this}}class Rm{constructor(t,e){f(this,"measureController");f(this,"textDom",document.createElement("span"));f(this,"container",document.createElement("div"));f(this,"hasAnchor",!1);f(this,"hasChangedToWatch",!1);f(this,"_params");f(this,"onModelChange",t=>{var e;if(t==="View"){this.hide();return}if(t==="Watch"){this.hasChangedToWatch?(this.textDom.innerText="",this.hide()):(this.show(),this.hasChangedToWatch=!0);return}t==="Edit"&&(this.textDom.innerText=(e=this._params.firstPointTip)!=null?e:"\u8BF7\u9009\u62E9\u7B2C\u4E00\u4E2A\u6D4B\u91CF\u70B9\uFF0CEsc\u6216\u5355\u51FB\u9F20\u6807\u53F3\u952E\u53EF\u53D6\u6D88\u9009\u62E9",this.show())});f(this,"anchorChange",t=>{var e,n;!this.hasAnchor&&!!t?(this.hasAnchor=!0,this.textDom.innerText=(e=this._params.nextPointTip)!=null?e:"\u9009\u62E9\u4E0B\u4E00\u4E2A\u6D4B\u91CF\u70B9\uFF0CEsc\u6216\u5355\u51FB\u9F20\u6807\u53F3\u952E\u53D6\u6D88\u9009\u62E9"):t||(this.hasAnchor=!1,this.textDom.innerText=(n=this._params.firstPointTip)!=null?n:"\u8BF7\u9009\u62E9\u7B2C\u4E00\u4E2A\u6D4B\u91CF\u70B9\uFF0CEsc\u6216\u5355\u51FB\u9F20\u6807\u53F3\u952E\u53EF\u53D6\u6D88\u9009\u62E9")});f(this,"onEditedLineChange",t=>{var e;t.lines.length===1&&(this.textDom.innerText=(e=this._params.endTip)!=null?e:"\u53EF\u4EE5\u8FDE\u7EED\u9009\u62E9\u6D4B\u91CF\u70B9\uFF0C\u6216\u70B9\u51FB\u4E0B\u65B9\u201C\u7ED3\u675F\u201D\u6309\u94AE\u5B8C\u6210\u6D4B\u91CF\uFF08Esc\u53D6\u6D88\uFF0CCommand+S\u4FDD\u5B58\uFF09")});this._params=e,this.initDom(),e.container.append(this.container),this.measureController=t,t.hook.on("modeChange",this.onModelChange),t.hook.on("anchorChange",this.anchorChange),t.hook.on("editedPolylineChange",this.onEditedLineChange)}dispose(){this.hide(),this.container.remove()}show(){return this.container.style.opacity="1",this.container.style.transform="translate(0, 0)",this}hide(){return this.container.style.opacity="0",this.container.style.transform="translate(0, -10px)",this.measureController.hook.off("modeChange",this.onModelChange),this.measureController.hook.off("anchorChange",this.anchorChange),this.measureController.hook.off("editedPolylineChange",this.onEditedLineChange),this}initDom(){var n;const t=this.container,e=this.textDom;t.classList.add("fpm__guide-container"),t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.width="100%",t.style.height="110px",t.style.display="flex",t.style.alignItems="center",t.style.justifyContent="center",t.style.transform="translate(0, -10px)",t.style.background="linear-gradient(180deg, rgba(0,0,0,0.40) 0%, rgba(0,0,0,0.00) 100%)",t.style.transition="opacity 500ms ease-in-out, transform 500ms ease-in-out",t.style.opacity="0",e.classList.add("fpm__guide-text"),e.style.color="#fff",e.style.fontSize="20px",e.innerText=(n=this._params.startTip)!=null?n:"\u70B9\u51FB\u4E0B\u65B9\u201C\u5F00\u59CB\u201D\u6309\u94AE\u5F00\u59CB\u6D4B\u8DDD",t.appendChild(e)}}class Fm{constructor(t,e){f(this,"five");f(this,"measureController");f(this,"onKeyDown",t=>{if(t.metaKey&&t.code==="KeyS"){this.measureController.save().changeMode("Watch"),t.preventDefault();return}if(t.code==="Escape")return this.escape()});f(this,"onMouseDown",t=>{t.button===2&&(t.preventDefault(),this.escape())});this.five=e,this.measureController=t;const n=this.five.getElement();!n||(document.body.addEventListener("keydown",this.onKeyDown),n.addEventListener("mousedown",this.onMouseDown))}dispose(){const t=this.five.getElement();!t||(document.body.removeEventListener("keydown",this.onKeyDown),t.removeEventListener("mousedown",this.onMouseDown))}escape(){return this.measureController.getCurrentMode()==="Watch"?this.measureController.disable():this.measureController.changeMode("Watch")}}class Qm{constructor(t,e){f(this,"hasOpen",!1);f(this,"hook",new Ce.Subscribe);f(this,"magnifier");f(this,"five");f(this,"model");f(this,"group");f(this,"config");f(this,"isMobile");f(this,"fiveHelper");f(this,"useUIController");f(this,"params");f(this,"useGuideController");f(this,"container",document.createElement("div"));f(this,"shortcutKeyController");f(this,"controller",null);f(this,"getCurrentMode",()=>this.controller instanceof Wn?"Edit":this.controller instanceof Bs?"Watch":this.controller instanceof un?"Mixed":this.controller instanceof Ts?"View":null);f(this,"changeMode",t=>{var o;if(!this.hasOpen||this.getCurrentMode()===t)return;(o=this.controller)==null||o.dispose();const e={View:Ts,Watch:Bs,Edit:Wn,Mixed:un};if(!e[t])throw new Error("\u4E0D\u5B58\u5728\u7684 Mode");const n=this.createControllerParams();this.controller=new e[t](n),this.hook.emit("modeChange",t)});var o,s,r,a;this.five=t,this.params=e,this.config=wi(e,["openParams","magnifierParams"]),this.model=new Ei(this.config),this.fiveHelper=new qf(t),this.isMobile=(s=(o=e==null?void 0:e.openParams)==null?void 0:o.isMobile)!=null?s:!1,this.magnifier=new pl(t,(r=e.magnifierParams)!=null?r:{width:190,height:190,scale:2}),this.group=new j.Group,this.group.name="plugin-measure-group",this.container.classList.add("five-plugin-measure-container"),this.container.style.position="absolute",this.container.style.left="0",this.container.style.top="0",this.container.style.pointerEvents="none",this.container.style.width="100%",this.container.style.height="100%",this.container.style.opacity="0";const n=(a=this.params.openParams)!=null?a:{};if(this.params.useUIController!==!1){const l=F({container:this.container,openParams:n},typeof this.params.useUIController=="object"?this.params.useUIController:{});this.useUIController=new Vs(this,l)}if(this.params.useGuideController!==!1){const l=F({container:this.container},typeof this.params.useGuideController=="object"?this.params.useGuideController:{});this.useGuideController=new Rm(this,l)}}appendTo(t){t.append(this.container)}dispose(){var t,e;this.disable(),(t=this.useUIController)==null||t.dispose(),(e=this.magnifier)==null||e.dispose(),this.five.needsRender=!0}load(t){this.model.parse(t),this.save()}enable(t){var e;this.hasOpen||(this.hasOpen=!0,this.five.scene.add(this.group),this.container.style.opacity="1",t!=null&&t.mode?this.changeMode(t.mode):this.isMobile?this.changeMode("Mixed"):this.changeMode("Watch"),(e=this.useUIController)==null||e.show(),this.shortcutKeyController=new Fm(this,this.five),this.hook.emit("enable",!0))}disable(){var t,e,n,o;this.hasOpen=!1,this.container.style.opacity="0",(t=this.controller)==null||t.dispose(),(e=this.useUIController)==null||e.hide(),(n=this.useGuideController)==null||n.hide(),(o=this.shortcutKeyController)==null||o.dispose(),this.controller=null,this.five.helperVisible=!0,this.five.scene.remove(this.group),this.five.needsRender=!0,this.hook.emit("disable",!0)}edit(){const t=this.isMobile?"Mixed":"Edit";this.changeMode(t)}revoke(){this.controller instanceof Wn&&this.controller.revoke()}removePolyline(t){this.model.removePolyline(t)}removePolylineByID(t){const e=this.model.getPolylineByID(t);e&&this.model.removePolyline(e)}getPolylineByID(t){return this.model.getPolylineByID(t)}getEditedPolyline(){}highlightLine(t){if(this.getCurrentMode()!=="Watch")return!1;const e=this.model.getLineByID(t);return e?(this.controller.highlightLine(e),!0):!1}clearHighlightLines(){return this.getCurrentMode()!=="Watch"?!1:(this.controller.clearHighlightLines(),!0)}save(t){var o;if(!(this.controller instanceof Wn)&&!(this.controller instanceof un))return this;const e=(o=t==null?void 0:t.mode)!=null?o:"View",n=this.controller.polyline;return this.model.addPolyline(n),this.changeMode(e),this}addStartPoint(){this.controller instanceof un&&this.hook.emit("willChangeState","watching","editing")}addEndPoint(){this.controller instanceof un&&this.hook.emit("willChangeState","editing","watching")}toJson(){return this.model.toJson()}changeIsMobile(t){var e;if(this.isMobile=t,this.params.useUIController!==!1){(e=this.useUIController)==null||e.dispose();const n=F({container:this.container,mode:this.isMobile?"mobile":"pc"},typeof this.params.useUIController=="object"?this.params.useUIController:{});this.useUIController=new Vs(this,n)}}changeConfigs(t){var e;Object.assign(this.config,t),(e=this.controller)==null||e.updateDistanceUI()}setCustomText(t,e){var o;const n=this.model.getLineByID(t);if(!n)throw new Error("\u4E0D\u5B58\u5728\u7684\u7EBF\u6BB5");n.setText(e),(o=this.controller)==null||o.updateDistanceUI()}createControllerParams(){var e;const t=(e=this.params.openParams)!=null?e:{};return t.isMobile=this.isMobile,{five:this.five,hook:this.hook,group:this.group,model:this.model,config:this.config,magnifier:this.magnifier,container:this.container,fiveHelper:this.fiveHelper,openParams:t,mouseGroup:wl(F({},t.crossHairParameter)),userDistanceItemCreator:this.params.userDistanceItemCreator}}}const Hm=function(t,e){return new Qm(t,e)},kl=bo(null);function _m(i){le(i,"svelte-19zi46m",".PanoSpatialTagPlugin__tag-origin.svelte-19zi46m{position:absolute;width:0.5rem;height:0.5rem;border-radius:50%;background:#fff;box-shadow:0 0 .6rem #fff;transform:translate(-50%, -50%) scale(1);transform-origin:center center;animation:svelte-19zi46m-PanoSpatialTagPlugin__tag-origin 1.2s forwards;pointer-events:auto}.PanoSpatialTagPlugin__tag-origin.svelte-19zi46m:after{content:'';position:absolute;top:50%;height:50%;width:2rem;height:2rem;transform:translate(-50%, -50%)}.PanoSpatialTagPlugin__tag-origin-destroy.svelte-19zi46m{transform:translate(-50%, -50%) scale(0.6);animation:svelte-19zi46m-PanoSpatialTagPlugin__tag-origin-destroy 1.2s forwards .7s}@keyframes svelte-19zi46m-PanoSpatialTagPlugin__tag-origin{0%{transform:translate(-50%, -50%) scale(1);opacity:0}100%{transform:translate(-50%, -50%) scale(0.6);opacity:1 }}@keyframes svelte-19zi46m-PanoSpatialTagPlugin__tag-origin-destroy{0%{transform:translate(-50%, -50%) scale(0.6);opacity:1}10%{transform:translate(-50%, -50%) scale(1);opacity:0.9}100%{transform:translate(-50%, -50%) scale(1);opacity:0}}")}function js(i,t,e){const n=i.slice();return n[3]=t[e],n}function Os(i){let t,e=`${i[3].top}%`,n=`${i[3].left}%`,o,s;function r(){return i[2](i[3])}return{c(){t=B("i"),y(t,"class","svelte-19zi46m"),q(t,"PanoSpatialTagPlugin__tag-origin",!0),q(t,"PanoSpatialTagPlugin__tag-origin-destroy",i[3].destroying),z(t,"top",e),z(t,"left",n),z(t,"visibility",i[3].front?"visible":"hidden")},m(a,l){M(a,t,l),o||(s=me(t,"click",r),o=!0)},p(a,l){i=a,l&1&&q(t,"PanoSpatialTagPlugin__tag-origin-destroy",i[3].destroying),l&1&&e!==(e=`${i[3].top}%`)&&z(t,"top",e),l&1&&n!==(n=`${i[3].left}%`)&&z(t,"left",n),l&1&&z(t,"visibility",i[3].front?"visible":"hidden")},d(a){a&&L(t),o=!1,s()}}}function Gm(i){let t,e=i[0],n=[];for(let o=0;o<e.length;o+=1)n[o]=Os(js(i,e,o));return{c(){for(let o=0;o<n.length;o+=1)n[o].c();t=ge()},m(o,s){for(let r=0;r<n.length;r+=1)n[r].m(o,s);M(o,t,s)},p(o,[s]){if(s&3){e=o[0];let r;for(r=0;r<e.length;r+=1){const a=js(o,e,r);n[r]?n[r].p(a,s):(n[r]=Os(a),n[r].c(),n[r].m(t.parentNode,t))}for(;r<n.length;r+=1)n[r].d(1);n.length=e.length}},i:Y,o:Y,d(o){ut(n,o),o&&L(t)}}}function Wm(i,t,e){let{origins:n}=t;const o=r=>{kl.update(()=>`${r}-PanoSpatialTagPlugin-${Date.now()}`)},s=r=>o(r.id);return i.$$set=r=>{"origins"in r&&e(0,n=r.origins)},[n,o,s]}class Nm extends oe{constructor(t){super(),ie(this,t,Wm,Gm,ne,{origins:0},_m)}}function Xm(i){le(i,"svelte-1i5h9zh",".PanoSpatialTagPlugin__tag-x.svelte-1i5h9zh.svelte-1i5h9zh{position:absolute;top:0;left:0;display:block;white-space:nowrap;box-sizing:border-box;width:25rem;height:14rem;color:#FFF;transform:translate(0, -100%);transition:height .5s linear}.PanoSpatialTagPlugin__tag-shadow.svelte-1i5h9zh.svelte-1i5h9zh{content:'';position:absolute;width:30rem;height:30rem;top:-15rem;left:-15rem;z-index:-1;opacity:0;transition:opacity .8s .6s;background:url('https://vrlab-image4.ljcdn.com/release/web/PanoSpatialTagPlugin__blur.png');background-size:30rem 30rem}.PanoSpatialTagPlugin__tag-line.svelte-1i5h9zh.svelte-1i5h9zh{position:absolute;left:-1rem;width:2rem;height:100%;overflow:hidden}.PanoSpatialTagPlugin__tag-flagpole.svelte-1i5h9zh.svelte-1i5h9zh{position:absolute;top:0;left:1rem;height:calc(100% - 1.5rem);width:.15rem;background:linear-gradient(to bottom, rgba(255, 255, 255, 1), rgba(255, 255, 255, .1));box-shadow:0 .1rem .5rem rgba(0, 0, 0, .2);opacity:0;transform:translate(-50%, 60%) scaleY(0);transition:transform .4s cubic-bezier(.44,.44,.74,.98) , opacity .4s cubic-bezier(.44,.44,.74,.98), width .5s linear, height .5s linear ;transform-origin:center bottom}.PanoSpatialTagPlugin__tag-line1.svelte-1i5h9zh.svelte-1i5h9zh{position:absolute;top:0;left:0.3rem;height:1.8rem;width:.1rem;background:#fff;opacity:0;transform:translate(-50%, 200%) scaleY(0);transform-origin:center top}.PanoSpatialTagPlugin__tag-line2.svelte-1i5h9zh.svelte-1i5h9zh{position:absolute;top:0;left:0.5rem;height:1.8rem;width:.1rem;background:#fff;opacity:0;transform:translate(-50%, 200%) scaleY(0);transform-origin:center top}.PanoSpatialTagPlugin__tag-show.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-line1.svelte-1i5h9zh{animation:svelte-1i5h9zh-PanoSpatialTagPlugin__tag-line1 linear .5s forwards .45s}.PanoSpatialTagPlugin__tag-show.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-line2.svelte-1i5h9zh{animation:svelte-1i5h9zh-PanoSpatialTagPlugin__tag-line2 linear .5s forwards .65s}.PanoSpatialTagPlugin__tag-x.PanoSpatialTagPlugin__tag-upside-down.svelte-1i5h9zh.svelte-1i5h9zh{transform:translate(0, 0)}.PanoSpatialTagPlugin__tag-upside-down.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-line.svelte-1i5h9zh{transform:scaleY(-1)}.PanoSpatialTagPlugin__tag-animate.svelte-1i5h9zh.svelte-1i5h9zh{position:relative;height:100%;overflow:hidden;transform-origin:left top;transition:transform .5s linear}.PanoSpatialTagPlugin__tag-upside-down.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-animate.svelte-1i5h9zh{transform-origin:left bottom}.PanoSpatialTagPlugin__tag-content.svelte-1i5h9zh.svelte-1i5h9zh{position:absolute;display:inline-block;transform:translate(-100%, 0);transition:transform .9s cubic-bezier(0,.65,.16,1.08) .6s;padding-left:.5rem;font-size:1rem}.PanoSpatialTagPlugin__tag-upside-down.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-content.svelte-1i5h9zh{bottom:0}.PanoSpatialTagPlugin__tag-show.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-flagpole.svelte-1i5h9zh{opacity:1;transform:translate(-50%, 0) scaleY(1)}.PanoSpatialTagPlugin__tag-upside-down.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-shadow.svelte-1i5h9zh{top:unset;bottom:-15rem}.PanoSpatialTagPlugin__tag-show.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-shadow.svelte-1i5h9zh{opacity:.32}.PanoSpatialTagPlugin__tag-show.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-content.svelte-1i5h9zh{transform:translate(0, 0)}.PanoSpatialTagPlugin__tag-hide.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-flagpole.svelte-1i5h9zh{opacity:0;transform:translate(-50%, 60%) scaleY(0);transition:transform .5s .55s, opacity .4s .55s}.PanoSpatialTagPlugin__tag-hide.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-shadow.svelte-1i5h9zh{opacity:0;transition:opacity .8s}.PanoSpatialTagPlugin__tag-hide.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-content.svelte-1i5h9zh{transform:translate(-100%, 0);transition:transform .6s cubic-bezier(.53,.06,.88,.59)}.PanoSpatialTagPlugin__tag-hide.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-content .svelte-1i5h9zh{pointer-events:none}.PanoSpatialTagPlugin__tag-hide.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-line1.svelte-1i5h9zh{opacity:0.5;transform:translate(-50%, 10%) scaleY(0);animation:svelte-1i5h9zh-PanoSpatialTagPlugin__tag-line1-hide linear .28s forwards .3s}.PanoSpatialTagPlugin__tag-hide.svelte-1i5h9zh .PanoSpatialTagPlugin__tag-line2.svelte-1i5h9zh{opacity:0.5;transform:translate(-50%, 0) scaleY(0);animation:svelte-1i5h9zh-PanoSpatialTagPlugin__tag-line2-hide linear .28s forwards .45s}@keyframes svelte-1i5h9zh-PanoSpatialTagPlugin__tag-line1{0%{opacity:0;transform:translate(-50%, 250%) scaleY(1)}50%{opacity:0.5;transform:translate(-50%, 135%) scaleY(1)}100%{opacity:0.5;transform:translate(-50%, 20%) scaleY(0)}}@keyframes svelte-1i5h9zh-PanoSpatialTagPlugin__tag-line2{0%{opacity:0;transform:translate(-50%, 250%) scaleY(1)}50%{opacity:0.5;transform:translate(-50%, 125%) scaleY(1)}100%{opacity:0.5;transform:translate(-50%, 0) scaleY(0)}}@keyframes svelte-1i5h9zh-PanoSpatialTagPlugin__tag-line1-hide{0%{opacity:0.5;transform:translate(-50%, 10%) scaleY(0)}50%{opacity:0.2;transform:translate(-50%, 105%) scaleY(1)}100%{opacity:0;transform:translate(-50%, 200%) scaleY(0)}}@keyframes svelte-1i5h9zh-PanoSpatialTagPlugin__tag-line2-hide{0%{opacity:0.5;transform:translate(-50%, 0) scaleY(0)}50%{opacity:0.2;transform:translate(-50%, 100%) scaleY(1)}100%{opacity:0;transform:translate(-50%, 200%) scaleY(0)}}")}function Ym(i){let t,e,n,o,s,r,a,l,c,u,h,d,m,g,p;return{c(){t=B("div"),e=B("div"),n=ee(),o=B("div"),s=B("i"),r=ee(),a=B("i"),l=ee(),c=B("i"),u=ee(),h=B("div"),d=B("div"),y(e,"class","PanoSpatialTagPlugin__tag-shadow svelte-1i5h9zh"),z(e,"transform","translate("+i[7]/2*i[3]*3+"px, "+i[8]/2*(i[1]?-1:1)*i[3]*3+"px) scale("+1/i[3]+")"),y(s,"class","PanoSpatialTagPlugin__tag-flagpole svelte-1i5h9zh"),z(s,"width",i[4]+"rem"),y(a,"class","PanoSpatialTagPlugin__tag-line1 svelte-1i5h9zh"),y(c,"class","PanoSpatialTagPlugin__tag-line2 svelte-1i5h9zh"),y(o,"class","PanoSpatialTagPlugin__tag-line svelte-1i5h9zh"),y(d,"class","PanoSpatialTagPlugin__tag-content svelte-1i5h9zh"),y(h,"class","PanoSpatialTagPlugin__tag-animate svelte-1i5h9zh"),z(h,"transform","scale("+i[3]*3+")"),y(t,"id",m="PanoSpatialTagPlugin__"+i[0]),z(t,"height",20*i[5]+"rem"),y(t,"class","svelte-1i5h9zh"),q(t,"PanoSpatialTagPlugin__tag-x",!0),q(t,"PanoSpatialTagPlugin__tag-upside-down",i[1]),q(t,"PanoSpatialTagPlugin__tag-show",i[10]),q(t,"PanoSpatialTagPlugin__tag-hide",i[10]===!1||i[6])},m(A,v){M(A,t,v),V(t,e),V(t,n),V(t,o),V(o,s),V(o,r),V(o,a),V(o,l),V(o,c),V(t,u),V(t,h),V(h,d),d.innerHTML=i[2],i[16](d),g||(p=me(d,"click",i[11]),g=!0)},p(A,[v]){v&394&&z(e,"transform","translate("+A[7]/2*A[3]*3+"px, "+A[8]/2*(A[1]?-1:1)*A[3]*3+"px) scale("+1/A[3]+")"),v&16&&z(s,"width",A[4]+"rem"),v&4&&(d.innerHTML=A[2]),v&8&&z(h,"transform","scale("+A[3]*3+")"),v&1&&m!==(m="PanoSpatialTagPlugin__"+A[0])&&y(t,"id",m),v&32&&z(t,"height",20*A[5]+"rem"),v&2&&q(t,"PanoSpatialTagPlugin__tag-upside-down",A[1]),v&1024&&q(t,"PanoSpatialTagPlugin__tag-show",A[10]),v&1088&&q(t,"PanoSpatialTagPlugin__tag-hide",A[10]===!1||A[6])},i:Y,o:Y,d(A){A&&L(t),i[16](null),g=!1,p()}}}function Um(i,t,e){let{id:n}=t,{upsideDown:o}=t,{content:s}=t,{contentZoom:r}=t,{lineWidthZoom:a}=t,{lineHeightZoom:l}=t,{destroying:c=!1}=t,{folded:u}=t,{dispose:h}=t,{events:d}=t,{hooks:m}=t,g=0,p=0,A,v,b=setTimeout(()=>{u||e(10,v=!0),b=void 0},100);const w=C=>{const T=Object.keys(d);let x=C.target;for(;x;){const H=x.getAttribute("class");if(!H){x=x.parentNode;continue}if(H.includes("PanoSpatialTagPlugin__tag-content")){x=null;break}T.forEach(N=>{H.includes(N)&&d[N](n)}),x=x.parentNode}};Ze(()=>{m.emit("initTag",{id:n})});const k=kl.subscribe(C=>{if(C===null)return;const[T,x]=C.split("-PanoSpatialTagPlugin-");n===T&&(m.emit("clickOrigin",{id:n,show:v}),b||(e(10,v=u),e(12,u=!u),b=setTimeout(()=>{b=void 0},1500)))});Ga(()=>{e(7,g=A.offsetWidth),e(8,p=A.offsetHeight),!b&&e(10,v=!u)}),Et(()=>{m.emit("destroyTag",{id:n}),k(),h()});function I(C){Ve[C?"unshift":"push"](()=>{A=C,e(9,A)})}return i.$$set=C=>{"id"in C&&e(0,n=C.id),"upsideDown"in C&&e(1,o=C.upsideDown),"content"in C&&e(2,s=C.content),"contentZoom"in C&&e(3,r=C.contentZoom),"lineWidthZoom"in C&&e(4,a=C.lineWidthZoom),"lineHeightZoom"in C&&e(5,l=C.lineHeightZoom),"destroying"in C&&e(6,c=C.destroying),"folded"in C&&e(12,u=C.folded),"dispose"in C&&e(13,h=C.dispose),"events"in C&&e(14,d=C.events),"hooks"in C&&e(15,m=C.hooks)},[n,o,s,r,a,l,c,g,p,A,v,w,u,h,d,m,I]}class qm extends oe{constructor(t){super(),ie(this,t,Um,Ym,ne,{id:0,upsideDown:1,content:2,contentZoom:3,lineWidthZoom:4,lineHeightZoom:5,destroying:6,folded:12,dispose:13,events:14,hooks:15},Xm)}}const Jm={position:"absolute",top:"0px",left:"0px",width:"100%",height:"100%",pointerEvents:"none"},Rs="<",Fs=">",Qs="%",Hs="locals",Zm="(<%%|%%>|<%=|<%-|<%_|<%#|<%|%>|-%>|_%>)",Km={"&":"&","<":"<",">":">",'"':""","'":"'"},He={EVAL:"eval",ESCAPED:"escaped",RAW:"raw",COMMENT:"comment",LITERAL:"literal"};function _s(i){return i.replace(/;(\s*$)/,"$1")}function $m(i,t){return new eg(i).compileFunction()(t)}class eg{constructor(t){f(this,"templateText");f(this,"mode",null);f(this,"truncate",!1);f(this,"currentLine",1);f(this,"source","");f(this,"regex",new RegExp(Zm));this.templateText=t}compileFunction(){let t;const e=` var __output = "";
|
|
513
513
|
function __append(s) { if (s !== undefined && s !== null) __output += s }
|
|
514
514
|
with (`+Hs+` || {}) {
|
|
515
515
|
`,n=` }
|
|
516
516
|
return __output;
|
|
517
517
|
`,o=function(s){return s==null?"":String(s).replace(/[&<>'"]/g,function(r){return Km[r]||r})};return this._generateSource(),this.source=e+this.source+n,t=this.source,t="escapeFn = escapeFn || "+o.toString()+`;
|
|
518
|
-
`+t,new Function(Hs+", escapeFn",t)}_generateSource(){this.templateText=this.templateText.replace(/[ \t]*<%_/gm,"<%_").replace(/_%>[ \t]*/gm,"_%>");const t=this._parseTemplateText(),e=
|
|
519
|
-
`}_scanLine(t){const e=
|
|
518
|
+
`+t,new Function(Hs+", escapeFn",t)}_generateSource(){this.templateText=this.templateText.replace(/[ \t]*<%_/gm,"<%_").replace(/_%>[ \t]*/gm,"_%>");const t=this._parseTemplateText(),e=Qs,n=Rs,o=Fs;t&&t.length&&t.forEach((s,r)=>{let a;if(s.indexOf(n+e)===0&&s.indexOf(n+e+e)!==0&&(a=t[r+2],!(a==e+o||a=="-"+e+o||a=="_"+e+o)))throw new Error('Could not find matching close tag for "'+s+'".');this._scanLine(s)})}_parseTemplateText(){let t=this.templateText;const e=this.regex;let n=e.exec(t);const o=[];let s;for(;n;)s=n.index,s!==0&&(o.push(t.substring(0,s)),t=t.slice(s)),o.push(n[0]),t=t.slice(n[0].length),n=e.exec(t);return t&&o.push(t),o}_addOutput(t){if(this.truncate&&(t=t.replace(/^(?:\r\n|\r|\n)/,""),this.truncate=!1),!t)return t;t=t.replace(/\\/g,"\\\\"),t=t.replace(/\n/g,"\\n"),t=t.replace(/\r/g,"\\r"),t=t.replace(/"/g,'\\"'),this.source+=' ; __append("'+t+`")
|
|
519
|
+
`}_scanLine(t){const e=Qs,n=Rs,o=Fs;switch(t.split(`
|
|
520
520
|
`).length-1,t){case n+e:case n+e+"_":this.mode=He.EVAL;break;case n+e+"=":this.mode=He.ESCAPED;break;case n+e+"-":this.mode=He.RAW;break;case n+e+"#":this.mode=He.COMMENT;break;case n+e+e:this.mode=He.LITERAL,this.source+=' ; __append("'+t.replace(n+e+e,n+e)+`")
|
|
521
521
|
`;break;case e+e+o:this.mode=He.LITERAL,this.source+=' ; __append("'+t.replace(e+e+o,e+o)+`")
|
|
522
522
|
`;break;case e+o:case"-"+e+o:case"_"+e+o:this.mode==He.LITERAL&&this._addOutput(t),this.mode=null,this.truncate=t.indexOf("-")===0||t.indexOf("_")===0;break;default:if(this.mode){switch(this.mode){case He.EVAL:case He.ESCAPED:case He.RAW:t.lastIndexOf("//")>t.lastIndexOf(`
|
|
@@ -524,25 +524,25 @@ void main() {
|
|
|
524
524
|
`)}switch(this.mode){case He.EVAL:this.source+=" ; "+t+`
|
|
525
525
|
`;break;case He.ESCAPED:this.source+=" ; __append(escapeFn("+_s(t)+`))
|
|
526
526
|
`;break;case He.RAW:this.source+=" ; __append("+_s(t)+`)
|
|
527
|
-
`;break;case He.COMMENT:break;case He.LITERAL:this._addOutput(t);break}}else this._addOutput(t)}}}const
|
|
527
|
+
`;break;case He.COMMENT:break;case He.LITERAL:this._addOutput(t);break}}else this._addOutput(t)}}}const Fi=.001,Gs=.01,tg="https://vrlab-image4.ljcdn.com/release/web/PanoSpatialTagPlugin__blur.png",ng=(i,t)=>{var U,ae,he,de,pe,Pe,ke,Te;let e=t==null?void 0:t.container,n=1.4;const o=(U=t==null?void 0:t.wait)!=null?U:200,s=(ae=t==null?void 0:t.maxNumberOnScreen)!=null?ae:3,r=(he=t==null?void 0:t.minRad)!=null?he:Math.PI/4,a=(de=t==null?void 0:t.nearTolerance)!=null?de:100,l=(pe=t==null?void 0:t.upsideHeight)!=null?pe:1.6,c=(Pe=t==null?void 0:t.minDistance)!=null?Pe:1.2,u=(ke=t==null?void 0:t.maxDistance)!=null?ke:3.5,h=Kt(i),d=document.createElement("div");d.classList.add("PanoSpatialTagPlugin"),Object.assign(d.style,Jm);const m=new Ce.Subscribe;let g=new Image;g.src=tg;const p={points:[],origins:[],tags:[],template:"",events:{},render:$m,folded:!1,enabled:!0,forbidden:!0},A=new Nm({target:d,props:{origins:p.origins}}),v=(ce,Ae)=>{I(),Ae&&C()},b=()=>{p.forbidden&&(p.forbidden=!1,C())},w=(ce,Ae)=>{if(p.tags.length===0)return;const Ee=Ae.longitude-i.state.longitude,ue=i.camera.clone();ue.position.copy(Ae.offset),ue.rotateOnWorldAxis(new E.Vector3(0,1,0),Ee),ue.updateProjectionMatrix(),ue.updateMatrixWorld(!0);const Ye=new E.Frustum,st=new E.Matrix4;st.multiplyMatrices(ue.projectionMatrix,ue.matrixWorldInverse),Ye.setFromProjectionMatrix(st),p.tags.forEach(ye=>{const $e=ue.position.clone().setY(n).distanceTo(ye.position);if($e<c||$e>u||!Ye.containsPoint(ye.position))return ye.destroying=!0;const te=ye.position.clone().sub(ue.position).setY(0);if(te.angleTo(ye.normal)>Math.PI/2-r&&te.angleTo(ye.normal)<Math.PI/2+r)return ye.destroying=!0}),p.tags.forEach(ye=>{ye.destroying?ye.app.$set({contentZoom:.1+ue.position.distanceTo(ye.position)/u,lineWidthZoom:.38*(.01+ue.position.distanceTo(ye.position)/u),destroying:ye.destroying}):ye.app.$set({lineWidthZoom:.38*(.01+ue.position.distanceTo(ye.position)/u),lineHeightZoom:.4+(ue.position.distanceTo(ye.position)-c)/u*.6,contentZoom:.1+ue.position.distanceTo(ye.position)/u})}),setTimeout(()=>{p.tags.forEach(ye=>{ye.destroying&&(ye.app.$destroy(),ye=null)}),p.tags=p.tags.filter(ye=>!ye.destroying),I()},1900)},k=ce=>{ce!==Ce.Five.Mode.Panorama&&!p.forbidden&&(A.$set({origins:[]}),p.tags.forEach(Ae=>{Ae.app.$destroy(),Ae=null}),p.origins=[],p.tags=[],p.forbidden=!0)},I=()=>{if(p.forbidden||!p.enabled)return;const ce=i.camera,Ae=ce.getWorldDirection(new E.Vector3);p.origins=p.tags.map(Ee=>{const ue=Ee.position.clone().project(ce),Ye=Ee.position.clone().sub(ce.position).setY(0).angleTo(Ae.setY(0))<Math.PI/2;return{id:Ee.id,front:Ye,left:(ue.x+1)/2*100,top:(-ue.y+1)/2*100,destroying:Ee.destroying}}),A.$set({origins:p.origins})},C=()=>{p.forbidden||!p.enabled||(p.timeoutId&&clearTimeout(p.timeoutId),p.timeoutId=setTimeout(()=>{p.timeoutId=void 0;const ce=T();ce.length&&(p.tags=p.tags.concat(ce),I())},o))},T=()=>{const{clientWidth:ce,clientHeight:Ae}=i.getElement(),Ee=[],ue=i.camera,Ye=new E.Frustum,st=new E.Matrix4,ye=ue.getWorldDirection(new E.Vector3);st.multiplyMatrices(ue.projectionMatrix,ue.matrixWorldInverse),Ye.setFromProjectionMatrix(st);const $e=p.tags.filter(ve=>Ye.containsPoint(ve.position)&&!ve.destroying).length,te=p.points.reduce((ve,je)=>{if(p.tags.find(ze=>je.id===ze.id&&!ze.destroying))return ve;const et=ue.position.clone().setY(n).distanceTo(je.position);if(et<c||et>u||!Ye.containsPoint(je.position))return ve;const ln=je.position.clone().sub(ue.position).setY(0);if(ln.angleTo(je.normal)>Math.PI/2-r&&ln.angleTo(je.normal)<Math.PI/2+r)return ve;const Bt=je.position.clone().project(ue);if(!p.tags.every(ze=>{if(ze.position.clone().sub(ue.position).setY(0).angleTo(ye.setY(0))>Math.PI/2)return!0;const kt=ze.position.clone().project(ue);return Math.sqrt(Math.pow((Bt.x-kt.x)/2*ce,2)+Math.pow((Bt.y-kt.y)/2*Ae,2))>a}))return ve;const It={id:je.id,position:je.position,normal:je.normal,replacement:je.replacement,weight:je.weight,distance:et};let De;for(let ze=0,kt=ve.length;ze<kt;ze++){const Ln=ve[ze];if(It.weight>Ln.weight){De=ze;break}if(It.distance<Ln.distance){De=ze;break}}return De!==void 0?ve.splice(De,0,It):ve.push(It),ve},[]);for(let ve=0,je=te.length;ve<je&&!($e+Ee.length>=s);ve++){const et=te[ve];if(Ee.find(De=>et.id===De.id))continue;const ln=et.position.clone().project(ue);if(!p.tags.concat(Ee).every(De=>{if(De.position.clone().sub(ue.position).setY(0).angleTo(ye.setY(0))>Math.PI/2)return!0;const ze=De.position.clone().project(ue);return Math.sqrt(Math.pow((ln.x-ze.x)/2*ce,2)+Math.pow((ln.y-ze.y)/2*Ae,2))>a}))continue;const Bt=new E.Raycaster(ue.position.clone().setY(n),et.position.clone().sub(ue.position.clone().setY(n)).normalize(),0,et.distance+Gs),[It]=p.intersectObjects?Bt.intersectObjects(p.intersectObjects,!0):i.model.bvhs.loaded?i.model.intersectRaycaster(Bt):Bt.intersectObjects(i.model.children,!0);if(!!It&&et.distance-It.distance<Gs){const{position:De,normal:ze,id:kt,replacement:Ln}=et,ec=new E.Plane().setFromNormalAndCoplanarPoint(ze,De),zo=De.clone().sub(ue.position).cross(new E.Vector3(0,1,0)).setLength(Fi),tc=[De.clone(),De.clone().add(zo),De.clone().add(new E.Vector3(0,Fi,0)).add(zo),De.clone().add(new E.Vector3(0,Fi,0))].map(sc=>ec.projectPoint(sc,new E.Vector3)),{container:nc,dispose:ic}=h.create3DDomContainer(tc)||{},oc=new qm({target:nc,props:{id:kt,content:p.render(p.template,Ln),lineWidthZoom:.38*(.01+ue.position.distanceTo(De)/u),lineHeightZoom:.4+(ue.position.distanceTo(De)-c)/u*.6,contentZoom:.1+ue.position.distanceTo(De)/u,upsideDown:De.y>l,folded:p.folded,events:p.events,hooks:m,dispose:ic}});Ee.push({position:De,normal:ze,id:kt,app:oc})}}return Ee},x=ce=>{p.points=ce.points.map(Ae=>{var Ee,ue;return{id:Ae.id,position:new E.Vector3().fromArray(Ae.position),normal:new E.Vector3().fromArray(Ae.normal),replacement:(Ee=Ae.replacement)!=null?Ee:{},weight:(ue=Ae.weight)!=null?ue:-1}}),ce.render&&(p.render=ce.render),ce.template&&(p.template=ce.template),ce.events&&(p.events=ce.events),ce.enabled===!1&&(p.enabled=ce.enabled),ce.folded===!0&&(p.folded=ce.folded)},H=ce=>{p.intersectObjects=ce,C()},N=()=>{p.enabled=!0,C()},R=()=>{p.enabled=!1,A.$set({origins:[]}),p.tags.forEach(ce=>{ce.app.$destroy(),ce=null}),p.origins=[],p.tags=[]},O=()=>{p.folded=!1,p.tags.forEach(ce=>{ce.app.$set({folded:p.folded})})},S=()=>{p.folded=!0,p.tags.forEach(ce=>{ce.app.$set({folded:p.folded})})},Q=ce=>{p.tags.forEach(Ae=>{Ae.id===ce&&Ae.app.$set({folded:!1})})},_=ce=>{p.tags.forEach(Ae=>{Ae.id===ce&&Ae.app.$set({folded:!0})})},X=()=>{i.once("renderFrame",I)},W=()=>{e||(e=i.getElement().parentElement),e&&e.appendChild(d),p.forbidden=!1,n=i.model.bounding.getCenter(new E.Vector3).y,C(),i.on("panoWillArrive",w),i.on("panoArrived",b),i.on("modeChange",k),i.on("cameraUpdate",v)},$=()=>{g=null,h.disposeAll(),A.$destroy(),p.tags.forEach(ce=>{ce.app.$destroy(),ce=null}),p.origins=[],p.tags=[],i.off("modelLoaded",W),i.off("renderFrame",I),i.off("panoWillArrive",w),i.off("panoArrived",b),i.off("modeChange",k),i.off("cameraUpdate",v),i.off("dispose",$),window.removeEventListener("resize",X,!1)};return window.addEventListener("resize",X,!1),(Te=i==null?void 0:i.model)!=null&&Te.loaded?W():i.once("modelLoaded",W),i.on("dispose",$),{load:x,setIntersectObjects:H,unfoldAll:O,foldAll:S,unfold:Q,fold:_,enable:N,disable:R,hooks:m,dispose:$}};var xt=(i=>(i.SMALL="small",i.MIDLLE="middle",i.LARGE="large",i.EXTRA_LARGE="x-large",i))(xt||{});function ig(i){le(i,"svelte-1ir3cyd",`.item-label-item.svelte-1ir3cyd{position:absolute;z-index:0;transform:none;cursor:pointer;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;opacity:0}.item-label-item.visible.svelte-1ir3cyd{opacity:1;animation:svelte-1ir3cyd-fadeIn .3s ease-in}.item-label-item__text-wrap.svelte-1ir3cyd::before{content:'';position:absolute;width:100%;height:100%;background-color:rgba(0, 0, 0, .3);filter:blur(1rem);z-index:-1}.item-label-item__text-wrap.svelte-1ir3cyd{padding:0.375rem 0.375rem 0;position:absolute;height:1.25rem;pointer-events:all;background-size:100% 100%;background-repeat:no-repeat;white-space:nowrap;line-height:0.625rem;font-size:0.6875rem;font-weight:bold;color:#FFEAC0;transform:translate(-50%, 0);display:flex;justify-content:center;align-items:center}.item-label-item__text.svelte-1ir3cyd{padding-bottom:0.25rem;border-top:0 solid;border-left:0 solid;border-right:0 solid;border-bottom:0.0625rem solid;-o-border-image:linear-gradient(to right, rgba(234, 208, 154, 0), rgba(234, 208, 154, 100), rgba(234, 208, 154, 0)) 4.5 1 4.5;border-image:linear-gradient(to right, rgba(234, 208, 154, 0), rgba(234, 208, 154, 100), rgba(234, 208, 154, 0)) 4.5 1 4.5}.item-label-item__bar.svelte-1ir3cyd{position:absolute;bottom:0;width:0.0625rem;background-image:linear-gradient(to bottom, rgba(234, 208, 154, 0), rgba(234, 208, 154, 1))}@keyframes svelte-1ir3cyd-fadeIn{from{opacity:0
|
|
528
528
|
}to{opacity:1
|
|
529
|
-
}}`)}function og(i){let t,e,n,o=(i[0].name.length>6?`${i[0].name.slice(0,6)}...`:i[0].name)+"",s,r,a,l,c,u;return{c(){t=
|
|
529
|
+
}}`)}function og(i){let t,e,n,o=(i[0].name.length>6?`${i[0].name.slice(0,6)}...`:i[0].name)+"",s,r,a,l,c,u;return{c(){t=B("div"),e=B("div"),n=B("span"),s=xe(o),r=ee(),a=B("div"),y(n,"class","item-label-item__text svelte-1ir3cyd"),y(e,"class","item-label-item__text-wrap svelte-1ir3cyd"),z(e,"top",`-${i[0].strokeLength+26}px`),y(a,"class","item-label-item__bar svelte-1ir3cyd"),z(a,"height",`${i[0].strokeLength}px`),y(t,"class",l=Ie(Oe.default("item-label-item",{visible:i[0].visible}))+" svelte-1ir3cyd"),z(t,"z-index",i[0].zIndex),z(t,"transform",i[0].transform)},m(h,d){M(h,t,d),V(t,e),V(e,n),V(n,s),V(t,r),V(t,a),c||(u=me(n,"click",i[1]),c=!0)},p(h,[d]){d&1&&o!==(o=(h[0].name.length>6?`${h[0].name.slice(0,6)}...`:h[0].name)+"")&&Me(s,o),d&1&&z(e,"top",`-${h[0].strokeLength+26}px`),d&1&&z(a,"height",`${h[0].strokeLength}px`),d&1&&l!==(l=Ie(Oe.default("item-label-item",{visible:h[0].visible}))+" svelte-1ir3cyd")&&y(t,"class",l),d&1&&z(t,"z-index",h[0].zIndex),d&1&&z(t,"transform",h[0].transform)},i:Y,o:Y,d(h){h&&L(t),c=!1,u()}}}function sg(i,t,e){let{itemLabel:n}=t,{hooks:o}=t;function s(){o.emit("onLabelClick",n)}return i.$$set=r=>{"itemLabel"in r&&e(0,n=r.itemLabel),"hooks"in r&&e(2,o=r.hooks)},[n,s,o]}class rg extends oe{constructor(t){super(),ie(this,t,sg,og,ne,{itemLabel:0,hooks:2},ig)}}function xl(i,t=200){let e;return function(...n){clearTimeout(e),e=setTimeout(()=>{i(...n)},t)}}function ag(i){le(i,"svelte-gk8s47",".item-labels-container.svelte-gk8s47{width:100%;height:100%;position:relative}")}function Ws(i,t,e){const n=i.slice();return n[26]=t[e],n}function Ns(i,t){let e,n,o;return n=new rg({props:{itemLabel:t[26],hooks:t[0]}}),{key:i,first:null,c(){e=ge(),K(n.$$.fragment),this.first=e},m(s,r){M(s,e,r),J(n,s,r),o=!0},p(s,r){t=s;const a={};r&2&&(a.itemLabel=t[26]),r&1&&(a.hooks=t[0]),n.$set(a)},i(s){o||(P(n.$$.fragment,s),o=!0)},o(s){D(n.$$.fragment,s),o=!1},d(s){s&&L(e),Z(n,s)}}}function lg(i){let t,e=[],n=new Map,o,s,r=i[1];const a=l=>l[26].id;for(let l=0;l<r.length;l+=1){let c=Ws(i,r,l),u=a(c);n.set(u,e[l]=Ns(u,c))}return{c(){t=B("div");for(let l=0;l<e.length;l+=1)e[l].c();y(t,"class","item-labels-container svelte-gk8s47"),Fe(()=>i[9].call(t)),z(t,"opacity",i[4]?1:0)},m(l,c){M(l,t,c);for(let u=0;u<e.length;u+=1)e[u].m(t,null);o=pi(t,i[9].bind(t)),s=!0},p(l,[c]){c&3&&(r=l[1],se(),e=Ke(e,c,a,1,l,r,n,t,Pt,Ns,null,Ws),re()),c&16&&z(t,"opacity",l[4]?1:0)},i(l){if(!s){for(let c=0;c<r.length;c+=1)P(e[c]);s=!0}},o(l){for(let c=0;c<e.length;c+=1)D(e[c]);s=!1},d(l){l&&L(t);for(let c=0;c<e.length;c+=1)e[c].d();o()}}}let Xs=26,cg=11;function ug(i,t,e){const{Raycaster:n,Vector3:o}=E;let{five:s}=t,{modelOcclusionEnable:r}=t,{itemLabels:a}=t,{hooks:l}=t,{displayStrategyType:c}=t,u=null,h=null,d,m,g=[],p=!0;const A=(S,Q)=>{const _=new n,X=S.camera.position.clone(),W=new o().fromArray(Q.modelPosition),$=W.distanceTo(X);_.set(X.clone(),W.clone().sub(X).normalize());const[U]=S.model.intersectRaycaster(_);return!(U&&U.distance+1<$)},v=(S,Q)=>{const _=new o(Q.modelPosition[0],Q.modelPosition[1],Q.modelPosition[2]),X=S.project2d(_),W=X==null?void 0:X.x,$=X==null?void 0:X.y;return[W,$]},b=S=>`translate(${S[0]}px, ${S[1]}px)`,w=(S,Q)=>g.length===0?!1:!!g.find(X=>S[0]>=X[0]-Q&&S[0]<=X[0]+Q||S[1]>=X[1]-Xs&&S[1]<=X[1]+Xs);function k(S,Q){switch(Q){case xt.SMALL:return Math.ceil(-27.78*S+85);case xt.MIDLLE:return Math.ceil(-38.9*S+130);case xt.LARGE:return Math.ceil(-44.44*S+140);case xt.EXTRA_LARGE:return Math.ceil(-92.59*S+300)}}const I=(S,Q)=>{const _=Q.map(W=>{const $=v(S,W),U=W.name.length*cg,ae=k(W.modelPosition[1],c),de=(r?A(S,W):!0)&&!w([$[0],$[1]+ae],U);if(!de)return fe(F({},W),{visible:de});g.push($);const pe=b($);return fe(F({},W),{visible:de,transform:pe,strokeLength:ae})}),X=_.filter(({visible:W})=>W).map(W=>({itemLabelItem:W,distance:new o(W.modelPosition[0],W.modelPosition[1],W.modelPosition[2]).clone().distanceTo(S.camera.position)})).sort((W,$)=>W.distance-$.distance);return _.map(W=>{const $=X.findIndex(U=>U.itemLabelItem.id===W.id);return $!==void 0?fe(F({},W),{zIndex:$*10}):W})},C=()=>{g=[],e(1,h=I(s,h))};_a(()=>{N()});const T=()=>{e(4,p=!1),x()};Ze(()=>{e(1,h=a),u=a,C(),H(),s.on("cameraUpdate",T)});const x=xl(()=>{e(4,p=!0),C()},300),H=()=>{window.addEventListener("resize",R,!1)},N=()=>{u!==a&&(e(1,h=a),u=a,C())},R=()=>{s.once("renderFrame",C)};Et(()=>{s.off("cameraUpdate",T),window.removeEventListener("resize",R,!1)});function O(){d=this.clientWidth,m=this.clientHeight,e(2,d),e(3,m)}return i.$$set=S=>{"five"in S&&e(5,s=S.five),"modelOcclusionEnable"in S&&e(6,r=S.modelOcclusionEnable),"itemLabels"in S&&e(7,a=S.itemLabels),"hooks"in S&&e(0,l=S.hooks),"displayStrategyType"in S&&e(8,c=S.displayStrategyType)},[l,h,d,m,p,s,r,a,c,O]}class dg extends oe{constructor(t){super(),ie(this,t,ug,lg,ne,{five:5,modelOcclusionEnable:6,itemLabels:7,hooks:0,displayStrategyType:8},ag)}}function hg(i){return i.model_item_labels.map(t=>F({modelPosition:[t.position[0],t.position[1]+t.size[1],t.position[2]]},t))}const fg=(i,t)=>{var d,m;const e={container:document.createElement("div"),data:null,enabled:!0,fiveModeEnabled:void 0,itemLabels:[],wrapper:null,app:void 0,hooks:new Ce.Subscribe,modelOcclusionEnable:(d=t==null?void 0:t.modelOcclusionEnable)!=null?d:!0,displayStrategyType:(m=t==null?void 0:t.displayStrategyType)!=null?m:xt.SMALL};e.container.setAttribute("class","model-item-label-plugin-container"),e.container.style.cssText=`
|
|
530
530
|
position: absolute;
|
|
531
531
|
left: 0;
|
|
532
532
|
top: 0;
|
|
533
533
|
width: 100%;
|
|
534
534
|
height: 100%;
|
|
535
535
|
z-index: 5;
|
|
536
|
-
`,e.container.style.pointerEvents="none";const n=g=>(e.wrapper=g,g.appendChild(e.container),l(),!0),o=g=>{e.itemLabels=hg(g),l()},s=()=>(e.enabled||(e.enabled=!0,l()),!0),r=()=>(e.enabled&&(e.enabled=!1,l()),!0),a=()=>{u(),e.container.remove()},l=()=>{var g;if(!!e.wrapper){if(!e.enabled||!e.fiveModeEnabled){(g=e.app)==null||g.$destroy(),e.app=void 0;return}e.app?e.app.$set({five:i,itemLabels:e.itemLabels}):e.app=new dg({target:e.container,props:{five:i,modelOcclusionEnable:e.modelOcclusionEnable,itemLabels:e.itemLabels,wrapper:e.wrapper,hooks:e.hooks,displayStrategyType:e.displayStrategyType}})}},c=()=>{i.on("modeChange",h),i.once("dispose",a)},u=()=>{i.off("modeChange",h)},h=g=>{if(!!e.enabled){if(g!==Ce.Five.Mode.Floorplan){e.fiveModeEnabled=!1,l();return}i.once("initAnimationEnded",()=>{e.fiveModeEnabled=i.currentMode===Ce.Five.Mode.Floorplan,l()})}};return c(),{appendTo:n,load:o,enable:s,disable:r,dispose:a,hooks:e.hooks}},mg={name:"ModelItemLabelPlugin",version:0};var
|
|
536
|
+
`,e.container.style.pointerEvents="none";const n=g=>(e.wrapper=g,g.appendChild(e.container),l(),!0),o=g=>{e.itemLabels=hg(g),l()},s=()=>(e.enabled||(e.enabled=!0,l()),!0),r=()=>(e.enabled&&(e.enabled=!1,l()),!0),a=()=>{u(),e.container.remove()},l=()=>{var g;if(!!e.wrapper){if(!e.enabled||!e.fiveModeEnabled){(g=e.app)==null||g.$destroy(),e.app=void 0;return}e.app?e.app.$set({five:i,itemLabels:e.itemLabels}):e.app=new dg({target:e.container,props:{five:i,modelOcclusionEnable:e.modelOcclusionEnable,itemLabels:e.itemLabels,wrapper:e.wrapper,hooks:e.hooks,displayStrategyType:e.displayStrategyType}})}},c=()=>{i.on("modeChange",h),i.once("dispose",a)},u=()=>{i.off("modeChange",h)},h=g=>{if(!!e.enabled){if(g!==Ce.Five.Mode.Floorplan){e.fiveModeEnabled=!1,l();return}i.once("initAnimationEnded",()=>{e.fiveModeEnabled=i.currentMode===Ce.Five.Mode.Floorplan,l()})}};return c(),{appendTo:n,load:o,enable:s,disable:r,dispose:a,hooks:e.hooks}},mg={name:"ModelItemLabelPlugin",version:0};var Ft=(i=>(i.TOP_LEFT="topLeft",i.TOP_RIGHT="topRight",i.BOTTOM_LEFT="bottomLeft",i.BOTTOM_RIGHT="bottomRight",i))(Ft||{});function gg(i){if(i.length===0)return[];if(Array.isArray(i[0]))return i;let t=[];return i.forEach(e=>{const n=[e[Ft.TOP_LEFT],e[Ft.BOTTOM_LEFT],e[Ft.BOTTOM_RIGHT],e[Ft.TOP_RIGHT]];t.push(n)}),t}const pg=(i,{videoElement:t})=>{const e={videoMeshes:[],videoTextureEnabled:!1,videoSource:"",rectPoints:[],enabled:!1,videoElement:t},n=Kt(i),o=new Map,s=v=>{e.videoTexture&&(e.videoTexture.image.muted=v)},r=()=>e.videoTexture?e.videoTexture.image.muted:!0,a=()=>{if(e.enabled||!e.videoTexture)return;e.enabled=!0,e.videoMeshes=c(),e.videoMeshes.forEach(b=>i.scene.add(b));const v=()=>{if(!e.videoTexture)return;const b=()=>{var w;!e.videoTexture||((w=e.videoTexture)==null||w.image.removeEventListener("timeupdate",b),e.videoTextureEnabled=!0,e.videoMeshes.forEach(k=>{k.material.map!==e.videoTexture&&(k.material.map=e.videoTexture)}),i.needsRender=!0)};e.videoTexture.image.addEventListener("timeupdate",b),e.videoTexture&&e.videoMeshes.length&&(e.videoTexture.image.play(),e.videoTexture.image.onplay=()=>{n.hide()},e.videoTexture.image.onpause=()=>{n.show()},e.videoTexture.image.onclick=()=>{e.videoTexture.image.muted=!1,e.videoTexture.image.play()})};if(i.model.loaded)v();else return i.once("modelLoaded",()=>v())},l=()=>{!e.enabled||(e.enabled=!1,e.videoMeshes.forEach(v=>{v.geometry.dispose(),v.material.dispose(),i.scene.remove(v),e.videoTexture&&e.videoTexture.image.pause()}),e.videoMeshes=[],i.needsRender=!0)},c=()=>e.rectPoints.map((v,b)=>{const w=new E.BufferGeometry,k=128,I=[];I.push(...v[0].toArray());for(let S=1;S<k;S++)I.push(v[0].x+(v[1].x-v[0].x)*S/k,v[0].y+(v[1].y-v[0].y)*S/k,v[0].z+(v[1].z-v[0].z)*S/k);I.push(...v[1].toArray()),I.push(...v[2].toArray());for(let S=1;S<k;S++)I.push(v[2].x+(v[3].x-v[2].x)*S/k,v[2].y+(v[3].y-v[2].y)*S/k,v[2].z+(v[3].z-v[2].z)*S/k);I.push(...v[3].toArray());const C=[];C.push(0,1);for(let S=1;S<k;S++)C.push(0,1-S/k);C.push(0,0),C.push(1,0);for(let S=1;S<k;S++)C.push(1,S/k);C.push(1,1);const T=[];for(let S=0;S<k;S++)T.push(S,S+1,k*2-S,S,k*2-S,k*2+1-S);w.setAttribute("position",new E.BufferAttribute(new Float32Array(I),3)),w.setAttribute("uv",new E.BufferAttribute(new Float32Array(C),2)),w.setIndex(new E.BufferAttribute(new Uint32Array(T),1));const x=new E.AxesHelper(10);i.scene.add(x);const H=new E.MeshBasicMaterial({map:e.videoTextureEnabled?e.videoTexture:e.imageTexture,side:E.DoubleSide}),N=new E.Mesh(w,H);N.renderOrder=1,N.name=`ModelTVVideoPlugin-${b}-${performance.now()}`;const R=[v[1],v[2],v[3],v[0]],O=n.create3DDomContainer(R);if(O!=null&&O.container){const S=document.createElement("div");S.classList.add("play-icon"),S.style.width="100%",S.style.height="100%",S.style.display="flex",S.style.justifyContent="center",S.style.alignItems="center",S.style.pointerEvents="none",O.container.appendChild(S);const Q=document.createElement("img");Q.src="//vrlab-static.ljcdn.com/release/web/play.2ada5b6f.png",Q.style.width="200px",Q.style.pointerEvents="auto",Q.onclick=()=>{e.videoTexture.image.muted=!1,e.videoTexture.image.play()},S.appendChild(Q),o.set(N,O)}return N}),u=v=>{const b=new E.TextureLoader().load(v);return b.minFilter=E.LinearFilter,b.magFilter=E.LinearFilter,b.format=E.RGBFormat,b},h=(v,b)=>new Promise((w,k)=>{const I=new XMLHttpRequest;I.onreadystatechange=()=>{if(I.readyState==4)if(I.status==200){const C=window.URL||window.webkitURL;b=b||document.createElement("video"),b.crossOrigin="anonymous",b.muted=!0,b.loop=!0,b.playsInline=!0,b.src=C.createObjectURL(I.response);const T=new E.VideoTexture(b);T.minFilter=E.LinearFilter,T.magFilter=E.LinearFilter,T.format=E.RGBFormat,w(Object.assign(T,{videoSource:v}))}else k(new Error("Video download Error: "+I.status))},I.onerror=C=>k(C),I.open("GET",v),I.responseType="blob",I.send()}),d=(v,b)=>G(exports,null,function*(){const{video_src:w,video_poster_src:k,points:I}=v;e.videoSource=w,e.rectPoints=gg(I).map(C=>C.map(({x:T,y:x,z:H})=>new E.Vector3(T,x,H))),e.imageTexture=u(k),b&&(e.videoElement=b),e.videoTexture=yield h(e.videoSource,e.videoElement),e.enabled=!!v.enable,e.enabled&&a()}),m=v=>{if(!e.enabled)return;const b=e.videoMeshes;if(!(!b||v.intersectObjects(b).length===0))return e.videoTexture&&(e.videoTexture.image.paused||e.videoTexture.image.pause()),!1},g=v=>{v==="Floorplan"?n.hide():n.show()},p=()=>{if(!e.enabled)return;const v=i.camera.position;if(o.forEach((b,w)=>{const k=b.css3DObject.position.clone(),I=k.clone().sub(v).normalize(),C=new E.Raycaster(v,I),T=i.model.intersectRaycaster(C)[0],x=k.distanceTo(v),H=.01;T&&T.distance+H<x?b.hide():b.show()}),!r()){const b=e.rectPoints.find(w=>{const k=w[0].clone().add(w[1]).add(w[2]).add(w[3]).divideScalar(4);return w.map(I=>I.clone().add(k).divideScalar(2)).filter(I=>{const C=I.distanceTo(v),T=new E.Raycaster(v,I.clone().sub(v).normalize()),x=i.model.intersectRaycaster(T)[0],H=.01;return!(x&&x.distance+H<C)}).length>=2});(!b||b.length===0)&&s(!0)}},A=()=>{l(),e.videoTexture=void 0,i.off("modeChange",g),i.off("wantsTapGesture",m),i.off("panoArrived",p),i.off("renderFrame",()=>{e.videoMeshes.forEach(v=>{v&&(v.needsRender=!0)})})};return i.on("modeChange",g),i.on("wantsTapGesture",m),i.on("panoArrived",p),i.on("renderFrame",()=>{e.videoMeshes.forEach(v=>{v&&(v.needsRender=!0)})}),{enable:a,disable:l,load:d,dispose:A,state:e,css3DRenderPlugin:n}};function Ag(i){le(i,"svelte-gduhqw",`.item-label-item.svelte-gduhqw.svelte-gduhqw{position:absolute;z-index:0;transform:none;cursor:pointer;pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none;animation:svelte-gduhqw-fadeIn .3s ease-in}.item-label-item.fold.svelte-gduhqw>.item-label-item__text-wrap.svelte-gduhqw{visibility:hidden}.item-label-item.fold.svelte-gduhqw>.item-label-item__bar.anchor.svelte-gduhqw{visibility:hidden}.item-label-item.fold.svelte-gduhqw>.item-label-item__bar.anchor.svelte-gduhqw:after{visibility:visible}.item-label-item__text-wrap.svelte-gduhqw.svelte-gduhqw{height:-moz-fit-content;height:fit-content;padding:0.75rem 1.25rem 0.75rem 0.75rem;position:absolute;width:-moz-max-content;width:max-content;max-width:29.5625rem;min-height:5.75rem;background-image:linear-gradient(269deg, rgba(0, 0, 0, 0.50) 0%, rgba(0, 0, 0, 0.60) 49%, rgba(31, 38, 46, 0.70) 100%);border:0.09375rem solid rgba(255, 255, 255, .65);border-radius:0.1875rem;color:white;transform:translate(-50%, 0);display:flex;justify-content:flex-start;align-items:center;box-sizing:border-box;overflow:hidden;pointer-events:all}.item-label-item__custom.svelte-gduhqw.svelte-gduhqw{padding:0;max-width:unset;min-height:unset;background-image:unset;border:0;border-radius:0}.icon-wrap.svelte-gduhqw.svelte-gduhqw{width:4.25rem;height:100%;display:flex;justify-content:center;align-content:center}.icon.svelte-gduhqw.svelte-gduhqw{width:4.25rem;height:4.25rem;background-repeat:no-repeat;background-size:contain;background-position:center}.item-label-text.svelte-gduhqw.svelte-gduhqw{margin-left:0.75rem;padding-left:0.75rem;min-height:4.25rem;height:auto;display:flex;flex-flow:column;justify-content:space-around;align-content:flex-start;border-left:solid rgba(255, 255, 255, .2) 0.0625rem;border-top:solid rgba(255, 255, 255, .2) 0;border-right:solid rgba(255, 255, 255, .2) 0;border-bottom:solid rgba(255, 255, 255, .2) 0;pointer-events:auto}.item-model.svelte-gduhqw.svelte-gduhqw{white-space:nowrap;font-size:1.375rem;font-weight:bold;line-height:1.875rem}.item-name.svelte-gduhqw.svelte-gduhqw{height:auto;word-wrap:break-word;word-break:break-all;font-size:1.25rem;line-height:1.75rem}.item-label-item__bar.svelte-gduhqw.svelte-gduhqw{position:absolute;bottom:0;width:0.1875rem;background-image:linear-gradient(to bottom, white, rgba(255, 255, 255, 0));box-shadow:0 0.125rem 0.5rem 0 rgba(0, 0, 0, 0.20);pointer-events:none}.item-label-item__bar.anchor.svelte-gduhqw.svelte-gduhqw:after{content:'';position:absolute;bottom:0;width:1.5rem;height:1.5rem;background-image:url("//vrlab-public.ljcdn.com/common/file/web/67e7a198-28c9-47dc-879b-507bd3ae600c.png ");background-position:center;background-size:contain;transform:translate(-0.65625rem, 50%)}@keyframes svelte-gduhqw-fadeIn{from{opacity:0
|
|
537
537
|
}to{opacity:1
|
|
538
|
-
}}`)}function vg(i){let t,e,n,o=(i[0].code||i[0].id)+"",s,r,a,l=i[0].name+"",c,u=i[0].icon&&Ys(i);return{c(){u&&u.c(),t
|
|
538
|
+
}}`)}function vg(i){let t,e,n,o=(i[0].code||i[0].id)+"",s,r,a,l=i[0].name+"",c,u=i[0].icon&&Ys(i);return{c(){u&&u.c(),t=ee(),e=B("div"),n=B("span"),s=xe(o),r=ee(),a=B("span"),c=xe(l),y(n,"class","item-model svelte-gduhqw"),y(a,"class","item-name svelte-gduhqw"),y(e,"class","item-label-text svelte-gduhqw")},m(h,d){u&&u.m(h,d),M(h,t,d),M(h,e,d),V(e,n),V(n,s),V(e,r),V(e,a),V(a,c)},p(h,d){h[0].icon?u?u.p(h,d):(u=Ys(h),u.c(),u.m(t.parentNode,t)):u&&(u.d(1),u=null),d&1&&o!==(o=(h[0].code||h[0].id)+"")&&Me(s,o),d&1&&l!==(l=h[0].name+"")&&Me(c,l)},d(h){u&&u.d(h),h&&L(t),h&&L(e)}}}function bg(i){let t;return{c(){t=B("div")},m(e,n){M(e,t,n),i[6](t)},p:Y,d(e){e&&L(t),i[6](null)}}}function Ys(i){let t,e,n,o,s;return{c(){t=B("div"),e=B("div"),y(e,"class","icon svelte-gduhqw"),y(e,"style",n=`background-image: url(${i[0].icon})`),y(t,"class","icon-wrap svelte-gduhqw")},m(r,a){M(r,t,a),V(t,e),o||(s=me(t,"click",i[7]),o=!0)},p(r,a){a&1&&n!==(n=`background-image: url(${r[0].icon})`)&&y(e,"style",n)},d(r){r&&L(t),o=!1,s()}}}function yg(i){let t,e,n,o,s,r,a,l,c,u;function h(g,p){return p&1&&(n=null),n==null&&(n=!!Boolean(typeof g[0].render=="function")),n?bg:vg}let d=h(i,-1),m=d(i);return{c(){t=B("div"),e=B("div"),m.c(),s=ee(),r=B("div"),y(e,"class",o=Ie(Oe.default("item-label-item__text-wrap",{"item-label-item__custom":Boolean(typeof i[0].render=="function")}))+" svelte-gduhqw"),z(e,"bottom",`${i[0].strokeLength}px`),y(r,"class",a=Ie(Oe.default("item-label-item__bar",{anchor:i[1]}))+" svelte-gduhqw"),z(r,"height",`${i[0].strokeLength}px`),y(t,"class",l=Ie(Oe.default("item-label-item",{fold:i[0].isFold}))+" svelte-gduhqw"),z(t,"z-index",i[0].zIndex),z(t,"transform",i[0].transform)},m(g,p){M(g,t,p),V(t,e),m.m(e,null),V(t,s),V(t,r),c||(u=me(e,"click",i[4]),c=!0)},p(g,[p]){d===(d=h(g,p))&&m?m.p(g,p):(m.d(1),m=d(g),m&&(m.c(),m.m(e,null))),p&1&&o!==(o=Ie(Oe.default("item-label-item__text-wrap",{"item-label-item__custom":Boolean(typeof g[0].render=="function")}))+" svelte-gduhqw")&&y(e,"class",o),p&1&&z(e,"bottom",`${g[0].strokeLength}px`),p&2&&a!==(a=Ie(Oe.default("item-label-item__bar",{anchor:g[1]}))+" svelte-gduhqw")&&y(r,"class",a),p&1&&z(r,"height",`${g[0].strokeLength}px`),p&1&&l!==(l=Ie(Oe.default("item-label-item",{fold:g[0].isFold}))+" svelte-gduhqw")&&y(t,"class",l),p&1&&z(t,"z-index",g[0].zIndex),p&1&&z(t,"transform",g[0].transform)},i:Y,o:Y,d(g){g&&L(t),m.d(),c=!1,u()}}}function wg(i,t,e){let{itemLabel:n}=t,{hooks:o}=t,{anchorEnabled:s}=t,{onIconClick:r}=t;function a(){o.emit("onLabelClick",n)}let l;function c(h){Ve[h?"unshift":"push"](()=>{l=h,e(3,l)})}const u=h=>r(n);return i.$$set=h=>{"itemLabel"in h&&e(0,n=h.itemLabel),"hooks"in h&&e(5,o=h.hooks),"anchorEnabled"in h&&e(1,s=h.anchorEnabled),"onIconClick"in h&&e(2,r=h.onIconClick)},i.$$.update=()=>{if(i.$$.dirty&9&&typeof n.render=="function"&&l&&l.children.length===0){const h=n.render(n);h&&l.appendChild(h)}},[n,s,r,l,a,o,c,u]}class Cg extends oe{constructor(t){super(),ie(this,t,wg,yg,ne,{itemLabel:0,hooks:5,anchorEnabled:1,onIconClick:2},Ag)}}const{Raycaster:Eg,Vector3:P1}=E,Us=(i,t,e,n)=>{const o=t.clone().sub(e).normalize(),s=new Eg;s.set(e,o);const[r]=i.model.intersectRaycaster(s);return r&&r.distance+.01<n};var Dt=(i=>(i.SMALL="small",i.MIDLLE="middle",i.LARGE="large",i.EXTRA_LARGE="x-large",i))(Dt||{});const Pg=(i,t)=>{switch(t){case Dt.SMALL:return Math.ceil(-27.78*i+85);case Dt.MIDLLE:return Math.ceil(-38.9*i+130);case Dt.LARGE:return Math.ceil(-44.44*i+140);case Dt.EXTRA_LARGE:return Math.ceil(-92.59*i+300)}},Ig=i=>`translate(${i[0]}px, ${i[1]}px)`;function qs(i){return i.map(t=>F({observerIndex:void 0,visible:!1,isFold:!1},t))}function kg(i){le(i,"svelte-gk8s47",".item-labels-container.svelte-gk8s47{width:100%;height:100%;position:relative}")}function Js(i,t,e){const n=i.slice();return n[30]=t[e],n}function Zs(i){let t,e;return t=new Cg({props:{itemLabel:i[30],hooks:i[0],anchorEnabled:i[2],onIconClick:i[6]}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},p(n,o){const s={};o[0]&2&&(s.itemLabel=n[30]),o[0]&1&&(s.hooks=n[0]),o[0]&4&&(s.anchorEnabled=n[2]),t.$set(s)},i(n){e||(P(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function Ks(i,t){let e,n,o,s=t[30].visible&&Zs(t);return{key:i,first:null,c(){e=ge(),s&&s.c(),n=ge(),this.first=e},m(r,a){M(r,e,a),s&&s.m(r,a),M(r,n,a),o=!0},p(r,a){t=r,t[30].visible?s?(s.p(t,a),a[0]&2&&P(s,1)):(s=Zs(t),s.c(),P(s,1),s.m(n.parentNode,n)):s&&(se(),D(s,1,1,()=>{s=null}),re())},i(r){o||(P(s),o=!0)},o(r){D(s),o=!1},d(r){r&&L(e),s&&s.d(r),r&&L(n)}}}function xg(i){let t,e=[],n=new Map,o,s,r=i[1];const a=l=>l[30].id;for(let l=0;l<r.length;l+=1){let c=Js(i,r,l),u=a(c);n.set(u,e[l]=Ks(u,c))}return{c(){t=B("div");for(let l=0;l<e.length;l+=1)e[l].c();y(t,"class","item-labels-container svelte-gk8s47"),Fe(()=>i[12].call(t)),z(t,"opacity",i[5]?1:0)},m(l,c){M(l,t,c);for(let u=0;u<e.length;u+=1)e[u].m(t,null);o=pi(t,i[12].bind(t)),s=!0},p(l,c){c[0]&71&&(r=l[1],se(),e=Ke(e,c,a,1,l,r,n,t,Pt,Ks,null,Js),re()),c[0]&32&&z(t,"opacity",l[5]?1:0)},i(l){if(!s){for(let c=0;c<r.length;c+=1)P(e[c]);s=!0}},o(l){for(let c=0;c<e.length;c+=1)D(e[c]);s=!1},d(l){l&&L(t);for(let c=0;c<e.length;c+=1)e[c].d();o()}}}let Dg=11;function Lg(i,t,e){const{Raycaster:n,Vector3:o}=E;let{five:s}=t,{modelOcclusionEnable:r}=t,{itemLabels:a}=t,{hooks:l}=t,{displayStrategyType:c}=t,{maxVisibleDistance:u}=t,h=null,d=null,m=(s==null?void 0:s.currentMode)===Ce.Five.Mode.Panorama,g,p,A=[],v=!0;const b=(_,X)=>{const W=_.camera.position.clone(),$=new o(X.modelPosition[0],X.modelPosition[1],X.modelPosition[2]),U=$.distanceTo(W);return u!==void 0&&_.state.mode===Ce.Five.Mode.Panorama&&U>u?!1:Us(_,$.clone().sub(W).normalize(),W,U)},w=_=>{const{camera:X,model:W}=s,{x:$,y:U,z:ae}=_.clone().project(X),he=($+1)/2,de=(2-(U+1))/2,ke=Math.abs(ae)<1&&[he,de].every(Te=>Te<1&&Te>=0);return Boolean(ke)},k=(_,X)=>{const W=new o(X.modelPosition[0],X.modelPosition[1],X.modelPosition[2]),$=_.project2d(W),U=$==null?void 0:$.x,ae=$==null?void 0:$.y;return[U,ae]},I=(_,X)=>{const W=X.map(U=>{if(_.state.panoIndex!==U.panoIndex)return fe(F({},U),{visible:!1});const ae=k(_,U);U.name.length*Dg;const he=Pg(U.modelPosition[1],c),de=_.currentMode===Ce.Five.Mode.Panorama?w(new o(U.position[0],U.position[1],U.position[2])):!0,pe=r?b(_,U):!1,Pe=de&&!pe;if(!Pe)return fe(F({},U),{visible:Pe});A.push(ae);const ke=Ig(ae);return fe(F({},U),{visible:Pe,transform:ke,strokeLength:he})}),$=W.filter(({visible:U})=>U).map(U=>({itemLabelItem:U,distance:new o(U.modelPosition[0],U.modelPosition[1],U.modelPosition[2]).clone().distanceTo(_.camera.position)})).sort((U,ae)=>U.distance-ae.distance);return W.map(U=>{const ae=$.findIndex(he=>he.itemLabelItem.id===U.id);return ae!==void 0?fe(F({},U),{zIndex:ae*10}):U})},C=()=>{A=[],e(1,d=I(s,d))},T=()=>{e(5,v=!1),x()},x=xl(()=>{e(5,v=!0),C()},300),H=()=>{s.once("renderFrame",C)},N=()=>{window.addEventListener("resize",H,!1)},R=()=>{h!==a&&(e(1,d=qs(a)),h=a,C())},O=(_,X)=>{let W=[];for(let U=0;U<X.length;U++){const{position:ae,panoIndex:he}=X[U],de=_.distanceTo(ae);(u===void 0||de<=u||s.state.mode!==Ce.Five.Mode.Panorama)&&W.push({panoIndex:he,obVector:ae,distance:de})}W=W.sort((U,ae)=>U.distance-ae.distance);let $;for(let U=0;U<W.length;U++){const{obVector:ae,distance:he,panoIndex:de}=W[U];if(!Us(s,_,ae,he)){$=de;break}}return typeof $=="number"?X[$]:void 0},S=_=>{if(s.state.mode===Ce.Five.Mode.Panorama)return;const X=s.work.observers,W=new o().fromArray(_.position),$=O(W,X);if($&&(_.observerIndex=$.panoIndex),typeof _.observerIndex=="number"){const U=X[_.observerIndex],ae=W.clone().sub(U.position).normalize(),he={longitude:Math.PI+Math.atan2(ae.x,ae.z),latitude:Math.acos(ae.y/ae.length())-Math.PI/2};s.setState(fe(F({},he),{mode:Ce.Five.Mode.Panorama,panoIndex:_.observerIndex})),s.once("initAnimationEnded",()=>{e(1,d=d.map(de=>fe(F({},de),{isFold:de.id!==_.id}))),s.once("cameraUpdate",()=>{e(1,d=d.map(de=>fe(F({},de),{isFold:!1})))})})}};_a(()=>{R()}),Ze(()=>{e(1,d=qs(a)),h=a,C(),N(),s.on("cameraUpdate",T)}),Et(()=>{s.off("cameraUpdate",T),window.removeEventListener("resize",H,!1)});function Q(){g=this.clientWidth,p=this.clientHeight,e(3,g),e(4,p)}return i.$$set=_=>{"five"in _&&e(7,s=_.five),"modelOcclusionEnable"in _&&e(8,r=_.modelOcclusionEnable),"itemLabels"in _&&e(9,a=_.itemLabels),"hooks"in _&&e(0,l=_.hooks),"displayStrategyType"in _&&e(10,c=_.displayStrategyType),"maxVisibleDistance"in _&&e(11,u=_.maxVisibleDistance)},[l,d,m,g,p,v,S,s,r,a,c,u,Q]}class Sg extends oe{constructor(t){super(),ie(this,t,Lg,xg,ne,{five:7,modelOcclusionEnable:8,itemLabels:9,hooks:0,displayStrategyType:10,maxVisibleDistance:11},kg,[-1,-1])}}function Mg(i){return i.item_labels.map(t=>fe(F({},t),{modelPosition:[t.position[0],t.position[1],t.position[2]],observerIndex:void 0}))}const Tg=void 0,zg=(i,t)=>{var d,m,g,p;const e={container:document.createElement("div"),data:null,enabled:!0,fiveModeEnabled:!0,itemLabels:[],wrapper:null,app:void 0,hooks:new Ce.Subscribe,modelOcclusionEnable:(d=t==null?void 0:t.modelOcclusionEnable)!=null?d:!0,onlyVisibleInPanorama:(m=t==null?void 0:t.onlyVisibleInPanorama)!=null?m:!0,displayStrategyType:(g=t==null?void 0:t.displayStrategyType)!=null?g:Dt.SMALL,maxVisibleDistance:(p=t==null?void 0:t.maxVisibleDistance)!=null?p:Tg};e.container.setAttribute("class","item-label-plugin-container"),e.container.style.cssText=`
|
|
539
539
|
position: absolute;
|
|
540
540
|
left: 0;
|
|
541
541
|
top: 0;
|
|
542
542
|
width: 100%;
|
|
543
543
|
height: 100%;
|
|
544
544
|
z-index: 5;
|
|
545
|
-
`,e.container.style.pointerEvents="none";const n=A=>(e.wrapper=A,A.appendChild(e.container),l(),!0),o=A=>{e.itemLabels=Mg(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 Sg({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!==Ce.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}},Bg={name:"ItemLabelPlugin",version:0};class Vg extends xn{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===Ce.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 jg(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 Og(i){let t,e,n,o,s,r,a,l;return{c(){t=z("div"),e=z("div"),n=z("span"),n.textContent=`${i[8]}`,o=$(),s=z("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){M(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&&L(t),i[10](null),a=!1,l()}}}function Rg(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 Qg extends oe{constructor(t){super(),ie(this,t,Rg,Og,ne,{props:0,onClick:1},jg)}}function Fg(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 Hg(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 _g(i,t){return Math.sqrt(Math.pow(i.z-t.z,2)+Math.pow(i.x-t.x,2))}function Gg(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 Wg={userAction:!0};class Ng extends Vg{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,C;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((I,B)=>{if(I.visible){const x=n.position.distanceTo(I.position),H=I.position.clone().add(new j.Vector3(0,this.OffsetHeight,0)),R=H.clone().sub(n.position).normalize().angleTo(a),O=H.clone().project(n),S=(O.x+1)/2.2*100,F=(-O.y+1)/2.2*100,G=S>=0&&S<=100&&F>=0&&F<=100&&x>this.MinVisibledistance&&x<=this.MaxVisibledistance;I.left=S,I.top=F,I.inSight=G&&R<Math.PI/2,I.cameraToward=Hg(this.five),G?l.push({disFromCameraToLabel:x,left:S,top:F,index:B}):I.transform="translate(-50%, -50%)"}else I.inSight=!1}),l.length>1){let I=0;l.sort((B,x)=>x.disFromCameraToLabel-B.disFromCameraToLabel);for(let B=1;B<l.length;B++){const{index:x,left:H,top:N}=l[B-1],{index:R,left:O,top:S}=l[B],F=this.container.children[x],G=this.container.children[R];if(!F||!G)return;const Y={left:s*H/100,top:r*N/100,width:(d=(h=(u=F.children)==null?void 0:u[0])==null?void 0:h.clientWidth)!=null?d:0,height:(p=(g=(m=F.children)==null?void 0:m[0])==null?void 0:g.clientHeight)!=null?p:0},W={left:s*O/100,top:r*S/100,width:(b=(v=(A=G.children)==null?void 0:A[0])==null?void 0:v.clientWidth)!=null?b:0,height:(C=(k=(w=G.children)==null?void 0:w[0])==null?void 0:k.clientHeight)!=null?C:0};Fg(Y,W)&&(I++,c[x].transform=`translate(-50%, ${(I-1)*100-50}%)`,c[R].transform=`translate(-50%, ${I*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=_g(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:Gg(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:Wg.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 Qg({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 Xg=i=>new Ng(i);function Yg(i,t){console.warn(`\u26D4 ==> [${i}]: ${t}`)}function Ug(i,t){console.warn(`\u{1F6AB} ==> [${i}]: ${t}`)}const qg=2,Jg=3,Zg=3,Kg=2;function $g(i){const t=i.width,n=i.unitLength/t,o=t/2,s=i.path,r=new E.CurvePath;s.forEach(C=>{const I=ep(C);I&&r.add(I)});const a=Math.ceil(r.getLength()*100),l=r.getPoints(a),c=l.length,u=yc.default(l.map(C=>[C.x,C.z])),d=(l.length-1)*qg*Jg,m=2*c,g=m*Zg,p=m*Kg,A=new Uint32Array(d),v=new Float32Array(g),b=new Float32Array(p);let w=0;for(let C=0;C<l.length;C++){const[I,B]=u[C][0],x=l[C],{x:H,y:N,z:R}=x,O=new j.Vector3(H+I*o,N+.05,R+B*o);v[C*6+0]=O.x,v[C*6+1]=O.y,v[C*6+2]=O.z;const S=new j.Vector3(H-I*o,N+.05,R-B*o);v[C*6+3]=S.x,v[C*6+4]=S.y,v[C*6+5]=S.z,w+=C>0?l[C-1].clone().sub(l[C]).length():0;const F=w/t/n;b[C*4+0]=0,b[C*4+1]=F,b[C*4+2]=1,b[C*4+3]=F,C!==l.length-1&&(A[C*6+0]=C*2+0,A[C*6+1]=C*2+2,A[C*6+2]=C*2+1,A[C*6+3]=C*2+2,A[C*6+4]=C*2+3,A[C*6+5]=C*2+1)}const k=new E.BufferGeometry;return k.setAttribute("position",new E.BufferAttribute(v,3)),k.setAttribute("uv",new E.BufferAttribute(b,2)),k.setIndex(new E.BufferAttribute(A,1)),k}function ep(i){if(tp(i)){const t=[i.closed,i.curve_type,i.tension],e=i.points.map(o=>new E.Vector3().fromArray(o));return new E.CatmullRomCurve3(e,...t)}}function tp(i){return i.type==="CatmullRomCurve3"}const np=`
|
|
545
|
+
`,e.container.style.pointerEvents="none";const n=A=>(e.wrapper=A,A.appendChild(e.container),l(),!0),o=A=>{e.itemLabels=Mg(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 Sg({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!==Ce.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}},Bg={name:"ItemLabelPlugin",version:0};class Vg extends xn{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(F({},e),{userAction:!0}))}disable(e){this.enabled=!1,this.updateState(fe(F({},e),{userAction:!0}))}show(e){if(!!this.state.enabled)return this.setState(fe(F({},this.state),{visible:!0}),e),Promise.resolve()}hide(e){if(!!this.state.enabled)return this.setState(fe(F({},this.state),{visible:!1}),e),Promise.resolve()}dispose(){this.container.remove()}setState(e,n){if(!this.enabled)return;const o=F({},this.state);this.state=F(F(F({},this.state),e),n),this.stateChangedCallback(o,n)}get visible(){return this.five.state.mode===Ce.Five.Mode.Panorama}appendTo(e){!this.enabled||(this.container=e,this.render())}updateState(e){this.setState(fe(F({},this.state),{enabled:this.enabled,visible:this.visible}),e)}}function jg(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 Og(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=ee(),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){M(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:Y,o:Y,d(c){c&&L(t),i[10](null),a=!1,l()}}}function Rg(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 Fg extends oe{constructor(t){super(),ie(this,t,Rg,Og,ne,{props:0,onClick:1},jg)}}function Qg(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 Hg(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 _g(i,t){return Math.sqrt(Math.pow(i.z-t.z,2)+Math.pow(i.x-t.x,2))}function Gg(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 Wg={userAction:!0};class Ng extends Vg{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((C,T)=>{if(C.visible){const x=n.position.distanceTo(C.position),H=C.position.clone().add(new j.Vector3(0,this.OffsetHeight,0)),R=H.clone().sub(n.position).normalize().angleTo(a),O=H.clone().project(n),S=(O.x+1)/2.2*100,Q=(-O.y+1)/2.2*100,_=S>=0&&S<=100&&Q>=0&&Q<=100&&x>this.MinVisibledistance&&x<=this.MaxVisibledistance;C.left=S,C.top=Q,C.inSight=_&&R<Math.PI/2,C.cameraToward=Hg(this.five),_?l.push({disFromCameraToLabel:x,left:S,top:Q,index:T}):C.transform="translate(-50%, -50%)"}else C.inSight=!1}),l.length>1){let C=0;l.sort((T,x)=>x.disFromCameraToLabel-T.disFromCameraToLabel);for(let T=1;T<l.length;T++){const{index:x,left:H,top:N}=l[T-1],{index:R,left:O,top:S}=l[T],Q=this.container.children[x],_=this.container.children[R];if(!Q||!_)return;const X={left:s*H/100,top:r*N/100,width:(d=(h=(u=Q.children)==null?void 0:u[0])==null?void 0:h.clientWidth)!=null?d:0,height:(p=(g=(m=Q.children)==null?void 0:m[0])==null?void 0:g.clientHeight)!=null?p:0},W={left:s*O/100,top:r*S/100,width:(b=(v=(A=_.children)==null?void 0:A[0])==null?void 0:v.clientWidth)!=null?b:0,height:(I=(k=(w=_.children)==null?void 0:w[0])==null?void 0:k.clientHeight)!=null?I:0};Qg(X,W)&&(C++,c[x].transform=`translate(-50%, ${(C-1)*100-50}%)`,c[R].transform=`translate(-50%, ${C*100-50}%)`)}}this.labelItems=c,this.render()});f(this,"onClick",(e,n)=>{if(!this.roomObservers)return;const{work:o}=this.five;let s,r,a=1/0;for(const l of o.observers)if(this.roomObservers.find(u=>u.panoIndex===l.panoIndex&&u.name===e)){const u=l.standingPosition,h=n.distanceTo(u);h<a&&(s=l.panoIndex,r=u.clone().sub(n).normalize(),a=h)}if(r!==null&&s!==null){const l={};if(a>0){const u=new 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=_g(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:Gg(u.rad)})})}),this.labelItems=this.doorLabels.map(r=>fe(F({},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:Wg.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 Fg({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 Xg=i=>new Ng(i);function Yg(i,t){console.warn(`\u26D4 ==> [${i}]: ${t}`)}function Ug(i,t){console.warn(`\u{1F6AB} ==> [${i}]: ${t}`)}const qg=2,Jg=3,Zg=3,Kg=2;function $g(i){const t=i.width,n=i.unitLength/t,o=t/2,s=i.path,r=new E.CurvePath;s.forEach(C=>{const T=ep(C);T&&r.add(T)});const a=Math.ceil(r.getLength()*100),l=r.getPoints(a),c=l.length,u=yc.default(l.map(C=>[C.x,C.z])),d=(c-1)*qg*Jg,m=2*c,g=m*Zg,p=m*Kg,A=new Uint32Array(d),v=new Float32Array(g),b=new Float32Array(p);let w=0,k=0;for(let C=0;C<l.length;C++){const[T,x]=u[C][0],H=l[C],{x:N,y:R,z:O}=H,S=new j.Vector3(N+T*o,R+.05,O+x*o);v[C*6+0]=S.x,v[C*6+1]=S.y,v[C*6+2]=S.z;const Q=new j.Vector3(N-T*o,R+.05,O-x*o);v[C*6+3]=Q.x,v[C*6+4]=Q.y,v[C*6+5]=Q.z,w+=C>0?l[C-1].clone().sub(l[C]).length():0;const _=w/t/n;if(k=_,b[C*4+0]=0,b[C*4+1]=_,b[C*4+2]=1,b[C*4+3]=_,i.skipPositions){const X=new E.Vector3().lerpVectors(S,Q,.5);if(i.skipPositions.some($=>$.distanceTo(X)<.26))continue}C!==l.length-1&&(A[C*6+0]=C*2+0,A[C*6+1]=C*2+2,A[C*6+2]=C*2+1,A[C*6+3]=C*2+2,A[C*6+4]=C*2+3,A[C*6+5]=C*2+1)}const I=new E.BufferGeometry;return I.setAttribute("position",new E.BufferAttribute(v,3)),I.setAttribute("uv",new E.BufferAttribute(b,2)),I.setIndex(new E.BufferAttribute(A,1)),{geometry:I,maxU:k}}function ep(i){if(tp(i)){const t=[i.closed,i.curve_type,i.tension],e=i.points.map(o=>new E.Vector3().fromArray(o));return new E.CatmullRomCurve3(e,...t)}}function tp(i){return i.type==="CatmullRomCurve3"}const np=`
|
|
546
546
|
varying vec2 vUv;
|
|
547
547
|
|
|
548
548
|
void main() {
|
|
@@ -564,6 +564,8 @@ void main() {
|
|
|
564
564
|
uniform float backgroundOpacity;
|
|
565
565
|
// \u6574\u4F53\u900F\u660E\u5EA6
|
|
566
566
|
uniform float opacity;
|
|
567
|
+
// \u6700\u5927 U \u503C
|
|
568
|
+
uniform float maxU;
|
|
567
569
|
// \u7EB9\u7406\u5750\u6807
|
|
568
570
|
varying vec2 vUv;
|
|
569
571
|
|
|
@@ -580,6 +582,20 @@ void main() {
|
|
|
580
582
|
return image;
|
|
581
583
|
}
|
|
582
584
|
|
|
585
|
+
// \u83B7\u53D6\u7EBF\u6027\u6E10\u53D8\u7684\u900F\u660E\u5EA6
|
|
586
|
+
float linearGradientOpacity() {
|
|
587
|
+
// \u5F53\u524D\u7684 u \u503C
|
|
588
|
+
float u = vUv.y;
|
|
589
|
+
float gradientLength = 1.0;
|
|
590
|
+
if (u <= gradientLength) {
|
|
591
|
+
return u / gradientLength; // \u5728 [0, gradientLength] \u8303\u56F4\u5185\uFF0C\u900F\u660E\u5EA6\u4E3A [0, 1]
|
|
592
|
+
} else if (u <= maxU - gradientLength) {
|
|
593
|
+
return 1.0; // \u5728 (gradientLength, maxU - gradientLength) \u8303\u56F4\u5185\uFF0C\u900F\u660E\u5EA6\u4E3A 1
|
|
594
|
+
} else {
|
|
595
|
+
return (maxU - u) / gradientLength; // \u5728 [maxU - gradientLength, maxU] \u8303\u56F4\u5185\uFF0C\u900F\u660E\u5EA6\u4E3A [1, 0]
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
|
|
583
599
|
void main() {
|
|
584
600
|
vec4 image = getTextureColor();
|
|
585
601
|
// \u8BBE\u7F6E\u80CC\u666F\u989C\u8272
|
|
@@ -588,25 +604,26 @@ void main() {
|
|
|
588
604
|
gl_FragColor = mix(gl_FragColor, image, image.a);
|
|
589
605
|
// \u8BBE\u7F6E\u6574\u4F53\u900F\u660E\u5EA6
|
|
590
606
|
gl_FragColor.a = gl_FragColor.a * opacity;
|
|
607
|
+
gl_FragColor.a = gl_FragColor.a * linearGradientOpacity();
|
|
591
608
|
}
|
|
592
|
-
`;class ro{constructor(t,e){f(this,"mesh");f(this,"five");f(this,"mode");f(this,"path",[]);f(this,"skippedPositions",null);f(this,"textureUrl","");f(this,"scale",1);f(this,"width",.5);f(this,"unitLength",.5);f(this,"visible",!1);f(this,"modeVisible",!1);f(this,"customVisible",null);f(this,"plugin");f(this,"textureHasLoaded",!1);f(this,"disposed",!1);f(this,"onPluginShow",()=>{this.updateVisible()});f(this,"onPluginHide",()=>{this.updateVisible()});f(this,"onPluginEnable",()=>{this.updateVisible()});f(this,"onPluginDisable",()=>{this.updateVisible()});f(this,"onFiveModeChange",t=>{this.modeVisible=this.mode==="panorama"?uo(t):Pa(t),this.updateVisible()});f(this,"logWarning",t=>Yg("GuideLineModeItem: ",t));f(this,"logError",t=>Ug("GuideLineModeItem: ",t));this.five=t,this.mode=e.mode,this.plugin=e.plugin;const n=new E.BufferGeometry,o=new E.ShaderMaterial({vertexShader:np,fragmentShader:ip,transparent:!0,uniforms:{map:{value:null},useMapColor:{value:0},mapColor:{value:new E.Color},mapOpacity:{value:1},backgroundColor:{value:new E.Color},backgroundOpacity:{value:0},opacity:{value:1}}});this.mesh=new E.Mesh(n,o),this.mesh.name="GuideLineModeItem",this.plugin.hooks.on("show",this.onPluginShow),this.plugin.hooks.on("hide",this.onPluginHide),this.plugin.hooks.on("enable",this.onPluginEnable),this.plugin.hooks.on("disable",this.onPluginDisable),this.five.on("modeChange",this.onFiveModeChange),this.onFiveModeChange(this.five.getCurrentState().mode)}setCustomVisible(t){if(this.disposed)return this.logError("disposed");this.customVisible!==t&&(this.customVisible=t,this.updateVisible())}setModeVisible(t){if(this.disposed)return this.logError("disposed");this.modeVisible!==t&&(this.modeVisible=t,this.updateVisible())}dispose(){this.disposed||(this.disposed=!0,this.five.off("modeChange",this.onFiveModeChange),this.plugin.hooks.off("show",this.onPluginShow),this.plugin.hooks.off("hide",this.onPluginHide),this.plugin.hooks.off("enable",this.onPluginEnable),this.plugin.hooks.off("disable",this.onPluginDisable),this.doHide())}setUnitSize(t,e){if(this.disposed)return this.logError("disposed");this.width=t,this.unitLength=e,this.setGeometryByPath(this.path,{width:t,unit_length:e})}setScale(t){if(this.disposed)return this.logError("disposed");this.scale=t,this.setGeometryByPath(this.path,{scale:t})}setGeometryByPanoGroup(t,e){if(this.disposed)return this.logError("disposed");if(!this.five.work)return this.logError("setPathByPanoGroup: work is not ready");const n=this.getPathFromPanoGroup(t,this.five.work,e);this.path=n,this.setGeometryByPath(n,e)}setGeometryByPath(t,e){var a,l,c;if(this.disposed)return this.logError("disposed");const n=(a=e==null?void 0:e.scale)!=null?a:this.scale,o=(l=e==null?void 0:e.width)!=null?l:e.width,s=(c=e==null?void 0:e.unit_length)!=null?c:e.unit_length;this.path=t,this.scale=n,this.width=o,this.unitLength=s;const r=$g({path:t,width:o*n,unitLength:s*n});this.mesh.geometry=r}setSkippedPanoGroup(t){if(this.disposed)return this.logError("disposed");if(!this.five.work)return this.logError("setSkippedPanoGroup: work is not ready");const e=t?t.map(n=>this.five.work.observers[n]).map(n=>n.standingPosition.clone()):null;this.skippedPositions=e}setMartial(t){var e;if(this.disposed)return this.logError("disposed");t!=null&&t.color&&this.setColor(t.color),t!=null&&t.opacity&&this.setOpacity(t.opacity),(e=t==null?void 0:t.texture)!=null&&e.url&&this.setTextureUrl(t.texture.url)}setColor(t){if(this.disposed)return this.logError("disposed");this.mesh.material.uniforms.useMapColor.value=t?1:0,this.mesh.material.uniforms.mapColor.value=new E.Color().setRGB(t[0],t[1],t[2]),this.mesh.material.uniformsNeedUpdate=!0,this.five.needsRender=!0}setBackgroundColor(t){if(this.disposed)return this.logError("disposed");this.mesh.material.uniforms.backgroundColor.value=new E.Color().setRGB(t[0],t[1],t[2]),this.mesh.material.uniformsNeedUpdate=!0,this.five.needsRender=!0}setOpacity(t){if(this.disposed)return this.logError("disposed");this.mesh.material.uniforms.opacity.value=t,this.mesh.material.uniformsNeedUpdate=!0,this.five.needsRender=!0}setBackgroundOpacity(t){if(this.disposed)return this.logError("disposed");this.mesh.material.uniforms.backgroundOpacity.value=t,this.mesh.material.uniformsNeedUpdate=!0,this.five.needsRender=!0}setMapOpacity(t){if(this.disposed)return this.logError("disposed");this.mesh.material.uniforms.mapOpacity.value=t,this.mesh.material.uniformsNeedUpdate=!0,this.five.needsRender=!0}setTextureUrl(t){if(this.disposed)return this.logError("disposed");this.textureUrl=t,hi(t).then(e=>{this.disposed||this.textureUrl===t&&(e.wrapT=E.RepeatWrapping,this.textureHasLoaded=!0,this.mesh.material.uniforms.map.value=e,this.mesh.material.uniformsNeedUpdate=!0,this.mesh.material.needsUpdate=!0,this.five.needsRender=!0,this.updateVisible())})}updateVisible(){const t=(()=>!this.plugin.state.enabled||!this.plugin.state.visible?!1:this.customVisible!==null?this.customVisible:this.modeVisible&&this.textureHasLoaded)();this.visible!==t&&(this.visible=t,t?this.doShow():this.doHide())}doShow(){this.five.scene.add(this.mesh),this.five.needsRender=!0}doHide(){this.five.scene.remove(this.mesh),this.five.needsRender=!0}getPathFromPanoGroup(t,e,n){const s=t.map(r=>e.observers[r]).map(r=>r.standingPosition.toArray());return[Q({type:"CatmullRomCurve3",points:s},n)]}}const op=Object.freeze(Object.defineProperty({__proto__:null,GuideLineModeItem:ro},Symbol.toStringTag,{value:"Module"}));class Dl{constructor(t){f(this,"id");f(this,"renderID");f(this,"isGuideLine",!0);f(this,"panoramaItem");f(this,"modelItem");f(this,"plugin");f(this,"five");this.id=t.id,this.five=t.five,this.plugin=t.plugin,this.panoramaItem=new ro(this.five,{mode:"panorama",plugin:this.plugin}),this.modelItem=new ro(this.five,{mode:"model",plugin:this.plugin})}setData(t){this.setDataByMode("panorama",t),this.setDataByMode("model",t)}setDataByMode(t,e){const n=t==="panorama"?this.panoramaItem:this.modelItem,o=t==="panorama"?e.panorama_style:e.model_style;if(!o)return;const s=e.path,r={url:this.plugin.staticPrefix+"/release/web/arrow6.b6ce0c62.png"},a=o,l=rt.default({texture:r},o);e.path?n.setGeometryByPath(s,a):e.pano_group&&n.setGeometryByPanoGroup(e.pano_group,a),n.setMartial(l)}}const sp=Object.freeze(Object.defineProperty({__proto__:null,GuideLineItem:Dl},Symbol.toStringTag,{value:"Module"})),Ll="v1.1.0",ao="GuideLinePlugin",$s=`${ao}@${Ll}`;function rp(i){return Object.hasOwn(i,"routes")}class ap extends Tt{constructor(e,n){super(e,n);f(this,"version",Ll);f(this,"name",ao);f(this,"state",{visible:!1,enabled:!0,disposed:!1});f(this,"data");f(this,"linesGroup");f(this,"itemMap",new Map);f(this,"disposedErrorLog",()=>{console.error(`${$s} is disposed`)});Object.assign(window,{[`__${ao}_DEBUG__`]:this})}load(e,n,o=!0){return _(this,null,function*(){if(this.state.disposed)return;this.clear();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,r.lines.forEach(a=>{this.addGuideLineItem(a)}),yield this.waitFiveLoaded(),this.handleVisible(this.state.visible),this.handleEnable(this.state.enabled),n&&this.setState(n,{userAction:o}),this.hooks.emit("dataLoaded",r),console.info(`${$s} loaded`,r)})}formatData(e){return _(this,null,function*(){const n=this.getDataWithoutVersion(e);if(rp(n)){const{routes:o}=n;return{lines:o.map(r=>{const{panoIndexList:a}=r;return{render_id:_e(),pano_group:a,panorama_style:{visible:!0,width:.6,unit_length:.4}}})}}return n})}show(e){return _(this,null,function*(){this.setState({visible:!0},e)})}hide(e){return _(this,null,function*(){this.setState({visible:!1},e)})}enable(e){this.setState({enabled:!0},e)}disable(e){this.setState({enabled:!1},e)}dispose(){this.setState({disposed:!0})}setState(e,n){var s;if(this.state.disposed)return this.disposedErrorLog();const o=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),nt(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)}addGuideLineItem(e){const n=e.render_id||e.id,o=new Dl({five:this.five,id:n,plugin:this});return this.itemMap.set(n,o),e&&o.setData(e),o}getGuideLineItemByID(e){return this.itemMap.get(e)}removeGuideLineItem(e){this.itemMap.delete(e.id),e.panoramaItem.dispose(),e.modelItem.dispose()}clear(){this.itemMap.forEach(e=>{this.removeGuideLineItem(e)})}handleEnable(e,n=!0){this.hooks.emit(e?"enable":"disable",{userAction:n})}handleVisible(e,n=!0){!this.state.enabled||this.hooks.emit(e?"show":"hide",{userAction:n})}handleDispose(){this.linesGroup&&this.five.scene.remove(this.linesGroup),this.hooks.emit("dispose")}waitFiveLoaded(){return _(this,null,function*(){return new Promise(e=>{if(this.five.work){e();return}this.five.once("loaded",()=>{e()})})})}getDataWithoutVersion(e){return typeof e=="object"&&e!==null&&e.version&&e.data?e.data:e}}const Sl=(i,t)=>new ap(i,t);function er(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 lp(i,t){const e=er(i),n=er(t);return e.angleTo(n)}const cp=i=>_(exports,null,function*(){try{i().then(()=>{},()=>{}).catch(()=>{})}catch(t){}}),Nn=Math.PI*2;function up(i){return i>=0&&i<Nn?i:(i%Nn+Nn)%Nn}function dp(i){return{longitude:up(-Math.atan2(i.x,-i.z)),latitude:-Math.asin(i.y/1)}}function hp(i,t,e,n){const o=-i/e,s=i;return o*n+s}function fp(i){return new Promise(t=>{setTimeout(()=>{t()},i)})}const Ml="v1.0.6",Tl="CruisePlugin",Ii=`${Tl}@${Ml}`,tr=()=>{console.error(`${Ii} is disposed`)},mp=()=>{console.warn(`${Ii} is disabled`)},gp=()=>{console.error(`${Ii} is disabled`)},Fi=new Map;class Io extends Tt{constructor(e,n){super(e,n);f(this,"state",{visible:!0,enabled:!0,disposed:!1,playing:!1,speed:1,config:{speedConfig:{rotateSpeed:.001,rotateSpeedUnit:"rad/ms",moveSpeed:.002,moveSpeedUnit:"m/ms"}}});f(this,"data");f(this,"config");f(this,"privateState",{playing:!1,currentPlayQueue:[],currentPlayKeyframe:null,broke:!1,disposers:[],modeChanging:!1});f(this,"GuideLine");this.config=n,Object.assign(window,{[`__${Tl}_DEBUG__`]:this});const o=this.setFiveLinearUpdateCamera.bind(this),s=this.setFiveOriginUpdateCamera.bind(this);this.hooks.on("play",o),this.hooks.on("broke",s),this.hooks.on("end",s),this.hooks.on("pause",s),this.privateState.disposers.push(()=>{this.hooks.off("play",o),this.hooks.off("broke",s),this.hooks.off("end",s),this.hooks.off("pause",s)})}load(e,n,o){return _(this,null,function*(){var u,h,d,m,g,p;if(this.state.disposed)return tr();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(A=>A.data.panoIndex!==void 0);c.filter((A,v)=>{var b;return A.data.panoIndex!==((b=c[v-1])==null?void 0:b.data.panoIndex)}).map(A=>A.data.panoIndex).forEach(A=>{var b,w;const v=(b=this.five.work.observers[A])==null?void 0:b.floorIndex;if(v!==void 0)if(l===v){const k=a.length-1;a[k]=[...(w=a[k])!=null?w:[],A]}else{l=v;const k=a.length;a[k]=[A]}}),!this.GuideLine&&((g=this.config)==null?void 0:g.useGuideLine)!==!1&&(this.GuideLine=Sl(this.five,this.config)),(p=this.GuideLine)==null||p.load({routes:a.map(A=>({panoIndexList:A})),config:r.guildPluginOptions}),this.setState({playing:!1}),this.handleVisible(this.state.visible),this.handleEnable(this.state.enabled),this.changePlayState(this.state.playing),this.changeSpeed(this.state.speed),n&&this.setState(n,{userAction:o}),console.info(`${Ii} 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 _(this,null,function*(){this.setState({visible:!0},e)})}hide(e){return _(this,null,function*(){this.setState({visible:!1},e)})}enable(e){this.setState({enabled:!0},e)}disable(e){this.setState({enabled:!1},e)}dispose(){this.setState({disposed:!0})}setState(e,n){var s;if(this.state.disposed)return tr();if(!this.state.enabled&&e.enabled!==!0&&e.disposed!==!0)return gp();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),nt(o,this.state,{deep:!0})||this.hooks.emit("stateChange",{state:this.state,prevState:o,userAction:(s=n==null?void 0:n.userAction)!=null?s:!0})}formatData(e){return _(this,null,function*(){this.five.work||(yield this.waitFiveLoaded());const n=this.five.work.observers,o=(()=>{const s=e;return typeof s=="object"&&s!==null&&s.version&&s.data?s.data:s})();if(o.keyframes)return{keyframesId:_e(),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:_e(),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 dp(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:_e(),keyframes:s.map((c,u)=>Q({id:_e(),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 _(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=_e();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(()=>_(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 fp(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 _(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 _(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 _(this,null,function*(){const{privateState:e}=this;return new Promise((n,o)=>{if(e.currentPlayQueue.length===0){n();return}const s=e.currentPlayQueue.shift();if(!s){n();return}s.then(n,o)}).then(()=>e.currentPlayQueue.length===0?Promise.resolve():this.actionPromiseQueue())})}move(e,n){return _(this,null,function*(){if(e.mode&&e.mode!==this.five.currentMode)yield this.changeMode(e);else if(e.panoIndex!==this.five.panoIndex)yield this.changePano(e,n);else return Promise.resolve()})}rotate(e,n){return _(this,null,function*(){if(e.mode&&e.mode!==this.five.currentMode)yield this.changeMode({mode:e.mode,panoIndex:e.panoIndex});else if(e.panoIndex&&e.panoIndex!==this.five.panoIndex)return yield this.changePano(e,n);yield this.updateCamera(e,n)})}updateCamera(o){return _(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 lp(h,e)/l}return 800})();r.currentPlayKeyframe&&(r.currentPlayKeyframe.originDuration=c);const u=this.getSpeededDuration(c);return new Promise(h=>{cp(()=>s.updateCamera(e,u)),setTimeout(()=>h(),u)})})}changePano(e,n){return _(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 _(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 Fi.get((n=this.data)==null?void 0:n.keyframesId)}setPauseData(){var e,n,o,s;if((e=this.data)!=null&&e.keyframesId)return Fi.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 Fi.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&&mp()}waitFiveLoaded(){return _(this,null,function*(){return new Promise(e=>{if(this.five.work){e();return}this.five.once("loaded",()=>{e()})})})}setFiveLinearUpdateCamera(){!this.privateState.fiveOriginGetProgress||(this.five.controller.cameraMotion.getProgress=e=>{const n=this.five.controller.cameraMotion,o=e-n.startTime;return o<0?0:o>=n.duration?1:1-hp(1,n.startVelocity,n.duration,o)})}setFiveOriginUpdateCamera(){!this.privateState.fiveOriginGetProgress||(this.five.controller.cameraMotion.getProgress=this.privateState.fiveOriginGetProgress)}}f(Io,"PluginVersion",Ml);const pp=i=>new Io(i);function Ap(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 Hi(i){if(i.length<3)return;const t=i.map(yn),e=t[1].clone().sub(t[0]),n=t[2].clone().sub(t[1]);return e.cross(n)}var zl=(i=>(i.Audio="Audio",i.Text="Text",i.ImageText="ImageText",i.Image="Image",i.Video="Video",i.Link="Link",i.Sticker="Sticker",i.VRLink="VRLink",i.PanoLink="PanoLink",i.Marketing="Marketing",i.MediaPlane="MediaPlane",i.MediaModel="MediaModel",i.Custom="Custom",i.Unknown="Unknown",i))(zl||{});class nr extends E.Mesh{constructor(e,n){super();f(this,"name","PanoTagPluginImagePlane");f(this,"imageSrc");this.imageSrc=e,hi(e).then(o=>{const s=o.image.width,r=o.image.height,a=new E.MeshBasicMaterial({map:o,transparent:!0}),l=new E.PlaneGeometry(s,r);this.geometry=l,this.material=a;const c=n[0].distanceTo(n[1]),u=n[1].distanceTo(n[2]);this.scale.set(c/s,u/r,1);const h=s/r,d=c/u;h>d?this.scale.set(c/s,c/s,1):h<d?this.scale.set(u/r,u/r,1):this.scale.set(c/s,u/r,1)}).catch(o=>{console.error({e:o})})}setMatrixByCornerPoints(e){const n=new j.Vector3().subVectors(e[1],e[0]),o=new j.Vector3().subVectors(e[3],e[0]),s=In(...e),r=new j.Vector3().crossVectors(n,o).normalize();this.lookAt(r);const a=this.up.clone().applyQuaternion(this.quaternion),l=o.clone(),c=new j.Vector3().crossVectors(a,l).normalize();this.rotateOnWorldAxis(c,a.angleTo(l)),this.position.copy(s)}}var Bl=(i=>(i.Two="2D",i.Three="3D",i))(Bl||{});function vp(i){return i.stickType==="Plane"}function bp(i){return i.stickType==="3DPoint"||i.stickType==="Plane"}function Re(i){return i.stickType==="Model"&&i.contentType==="MediaModel"}function yp(i){return i.stickType==="Plane"&&i.contentType==="MediaPlane"}function fi(i){if(!!i)if(Array.isArray(i)&&i.length===4){const e=i.map(yn);return In(e[0],e[2])}else return yn(i)}function wp(i){if(Re(i)&&i.matrix){const t=new j.Matrix4().fromArray(i.matrix),e=i.data.mediaPosition.map(n=>new j.Vector3().fromArray(n).applyMatrix4(t));return In(e[0],e[2])}else return fi(i.position)}function dn(i,t){if(i===void 0)return;const{min:e,max:n}=t!=null?t:{};if(!(e===void 0&&n===void 0))return!(typeof n=="number"&&n<i||typeof e=="number"&&e>i)}function Cp(i){return new Promise(t=>{i.model.loaded?t():i.once("modelLoaded",()=>t())})}function Ep(i,t,e){const o=new E.Plane().setFromNormalAndCoplanarPoint(e,t),s=t.clone().sub(i).cross(new E.Vector3(0,1,0)).setLength(.01),r=new E.Vector3(0,.01,0);return[t.clone().sub(s).sub(r),t.clone().add(s).sub(r),t.clone().add(s).add(r),t.clone().sub(s).add(r)].map(l=>o.projectPoint(l,new E.Vector3))}const ir=(i,t=1e3/60)=>{let e=null;const n=i;return(...s)=>{e&&clearTimeout(e),e=setTimeout(()=>{n==null||n(...s),e&&clearTimeout(e),e=null},t)}};function Pp(i,t=200){let e;return function(...n){e||(i.apply(this,n),e=setTimeout(function(){e=null},t))}}function Ip(i,t){const[e,n]=t;if(e>=n||n<=1||e<=1)return-1;const o={},s=r=>(o[r]||(o[r]=i(r)),o[r]);for(let r=e;r<n;r++){const a=s(r),l=s(r-1);if(a<l)return r}return-1}function or(i,t){if(!t||typeof ResizeObserver=="undefined"||!ResizeObserver)return{observe:()=>window.addEventListener("resize",i),unobserve:()=>window.removeEventListener("resize",i)};{const e=new ResizeObserver(i);return{observe:()=>e.observe(t),unobserve:()=>e.unobserve(t)}}}function kp(i){var t,e,n,o;if(!i.stickType){const s=(()=>i.pointType==="PointTag"&&i.dimensionType==="3D"?"3DPoint":i.pointType==="PlaneTag"?"Plane":"2DPoint")();i.stickType=s}if(i.contentType==="VRLink"||i.contentType==="PanoLink"||i.contentType==="Link"){const s=i;!((e=(t=s.data)==null?void 0:t.icon)!=null&&e.url)&&!((o=(n=s.style)==null?void 0:n.point)!=null&&o.url)&&(s.data.icon={url:"//vrlab-static.ljcdn.com/release/web/test.09dee741.png",steps:28})}return i}const Ut="data:audio/mpeg;base64,//uQxAAAAAAAAAAAAAAAAAAAAAAASW5mbwAAAA8AAAADAAAGhgBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVWqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqr///////////////////////////////////////////8AAAA5TEFNRT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void 0:t.namespace)||"default",n=An[e]||(An[e]=[]);let o=n.find(s=>!s.realSrc||s.realSrc===Ut);return o||(console.warn("\u672A\u627E\u5230\u7F13\u5B58\u97F3\u9891\uFF0C\u5DF2\u65B0\u5EFA",An),o=new Vl(Ut),n.push(o)),i&&(o.src=i),o}function Dp(i,t){const e=(t==null?void 0:t.namespace)||"default",n=An[e]||(An[e]=[]),o=i-n.length;if(!(o<=0))for(let s=0;s<o;s++)n.push(new Vl(Ut))}class Vl extends Audio{constructor(e){super(e);f(this,"preload","auto");f(this,"crossOrigin","anonymous");f(this,"realSrc","");f(this,"inited",!1);f(this,"removeDocumentEventListener");this.realSrc=e!=null?e:"",this.muted=!0,super.autoplay=!0,super.addEventListener("ended",()=>{this.src=""});const n=()=>Lp(this);document.addEventListener("click",n),document.addEventListener("touchend",n),this.removeDocumentEventListener=()=>{document.removeEventListener("click",n),document.removeEventListener("touchend",n)}}get isBlankAudio(){return this.realSrc===Ut||!this.realSrc}get src(){return super.src}set src(e){super.src=e,this.realSrc=e,this.removeDocumentEventListener()}get muted(){return super.muted}set muted(e){super.muted=e}clear(){this.currentTime=0,this.src=Ut}}function Lp(i){!i||i.inited||(i.src&&(i.inited=!0,i.removeDocumentEventListener()),i.src===Ut&&i.play())}const Sp={globalConfig:{unfoldedConfig:{autoUnfold:{strategy:"MinimumDistance",distance:{max:5}}},tag3DConfig:{ratio:.0035}},contentTypeConfig:{"Any-Audio-plane":{unfoldedConfig:{keep:"unfolded"},initialState:{unfolded:!0}},Link:{unfoldedConfig:{keep:"unfolded"},initialState:{unfolded:!0}},VRLink:{unfoldedConfig:{keep:"unfolded"},initialState:{unfolded:!0}},PanoLink:{unfoldedConfig:{keep:"unfolded"},initialState:{unfolded:!0}},MediaPlane:{unfoldedConfig:{keep:"unfolded"},visibleConfig:{alwaysShowWhenMovePano:!0}},MediaModel:{unfoldedConfig:{keep:"unfolded"},visibleConfig:{keep:"visible",visibleFiveMode:["Panorama","Floorplan","Model","Mapview"],alwaysShowWhenMovePano:!0}}}};class Mp extends xn{constructor(e){super(e);f(this,"tagCacheByPanoIndex",{})}getCache({panoIndex:e,id:n,key:o}){var c,u,h,d;const{five:s}=this,r=(c=s.panoIndex)!=null?c:e;if(r===void 0)throw new Error(`TagCacheController getCache(): fivePanoIndex is ${r}`);const a=`${(h=(u=s.work)==null?void 0:u.workCode)!=null?h:s.model.uuid}-${r}`;let l=this.tagCacheByPanoIndex[a];if(l||(l=new Map,this.tagCacheByPanoIndex[a]=l),n===void 0)return l;if(o===void 0){const m=l.get(n);return m||(l.set(n,{}),l.get(n))}return(d=l.get(n))==null?void 0:d[o]}clearCache(){this.tagCacheByPanoIndex={}}removeCache(){}}const Tp=navigator.userAgent.toLowerCase().indexOf("micromessenger")!==-1&&navigator.userAgent.toLowerCase().indexOf("iphone")!==-1;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 zp extends Mp{constructor(e){super(e);f(this,"tags",[]);f(this,"config",Sp);f(this,"mediaStore",bo({currentMediaElement:null}));f(this,"css3DRenderPlugin");f(this,"store",{disposers:[],disposed:!1,resizeObserverDisposerAdding:!1,css3DRenderDisposer:new Map});f(this,"domEvents");f(this,"mouseInfo");f(this,"preventWhenMouseDown",()=>{var e;if((e=this.mouseInfo)!=null&&e.isDown)return!1});const n=this.five.getElement();n&&(this.domEvents=new be(this.five.camera,n)),this.five.on("wantsMoveToPano",this.preventWhenMouseDown),this.five.on("wantsTapGesture",this.preventWhenMouseDown),this.store.disposers.push(()=>{this.five.off("wantsMoveToPano",this.preventWhenMouseDown),this.five.off("wantsTapGesture",this.preventWhenMouseDown)})}get isPanorama(){return this.five.currentMode==="Panorama"}getTagById(e){const n=this.tags.find(o=>o.id===e);if(!n){console.warn(`error: can not find tag id ${e} by getTagById()`);return}return n}pauseCurrentMedia(){this.mediaStore.set({currentMediaElement:null})}getTagConfig(e){var s,r;if(!e)return(s=this.config.globalConfig)!=null?s:{};const n={};this.config.contentTypeConfig&&Object.keys(this.config.contentTypeConfig).forEach(a=>{const l=a;if(n[l])return;const c=l.split("-");if(c.length===1){const[u]=c;e.contentType===u&&(n[l]=this.config.contentTypeConfig[l])}if(c.length===2){const[u="Any",h="Any"]=c;(e.stickType===u||u==="Any")&&(e.contentType===h||h==="Any")&&(n[l]=this.config.contentTypeConfig[l])}if(c.length===3){const[u="Any",h,d]=c;if(h==="Audio"&&e.contentType==="Audio"){const m=e;(m.stickType===u||u==="Any")&&m.data.appearance===d&&(n[l]=this.config.contentTypeConfig[l])}}});const o=rt.default({},this.config.globalConfig,...Object.values(n),e.config);return typeof o.unfoldedConfig=="object"&&(o.unfoldedConfig.disableFold&&(o.unfoldedConfig={keep:"unfolded"}),o.unfoldedConfig.disableUnfold&&(o.unfoldedConfig={keep:"folded"}),o.unfoldedConfig.keep&&(o.unfoldedConfig={keep:o.unfoldedConfig.keep})),typeof o.visibleConfig=="object"&&o.visibleConfig.keep&&(o.visibleConfig={keep:o.visibleConfig.keep,visibleFiveMode:(r=o.visibleConfig)==null?void 0:r.visibleFiveMode}),o}loadVideoFirstFrame(){Tp&&this.hooks.emit("loadVideoFirstFrame")}updateTagConfig(e){e!=null&&e.force&&this.clearCache(),this.tags.forEach(n=>{const o=this.getTagConfig(n);n.mergedConfig=o})}can(e,n){const o=n,s=this.getTagConfig(o);if(!s||typeof s!="object")return!0;if(e==="show"||e==="hide"){if(!s.visibleConfig||typeof s.visibleConfig!="object")return!0;if(e==="show"&&s.visibleConfig.keep==="hidden"||e==="hide"&&(s.visibleConfig.keep==="visible"||s.visibleConfig.alwaysShowWhenMovePano))return!1}if(e==="fold"||e==="unfold"){if(!s.unfoldedConfig||typeof s.unfoldedConfig!="object")return!0;if(e==="fold"&&s.unfoldedConfig.keep==="unfolded"||e==="unfold"&&s.unfoldedConfig.keep==="folded")return!1}return!0}getRenderType(e){const n=this.getTagConfig(e);if(!n||typeof n!="object"||!n.renderType)return"Dom";const o=e.data.mediaData;if(!o||o.length===0)return"Dom";if(n.renderType==="Mesh"){if(yp(e))if(o.length===1){if(o[0].type==="Image")return"Mesh";if(o[0].type==="Video")return"Dom"}else return"Dom";else if(Re(e))return o.length===1&&o[0].type==="Image"?"Mesh":"BehindDom"}else return"Dom"}getAngle(e,n){var r,a,l;const o=(r=this.five.panoIndex)!=null?r:n;if(o===void 0)throw new Error(`getDistance(): fivePanoIndex is ${o}`);const s=this.getCache({panoIndex:n,id:e.id});if(s.angle!==void 0)return s.angle;{const c=(l=(a=this.five.work)==null?void 0:a.observers[o])==null?void 0:l.position;if(c===void 0)throw new Error(`getAngleRange(): observerPosition is ${c}`);const u=(()=>e.stickType==="3DPoint"?yn(e.normal):Hi(e.position))();if(!u)return;const h=fi(e.position);if(!h)return;const d=new E.Vector3().copy(c).sub(h),m=u.angleTo(d)*180/Math.PI;return s.angle=m,s.angle}}getDistance(e,n){var r,a,l;const o=(r=this.five.panoIndex)!=null?r:n;if(o===void 0)throw new Error(`getDistance(): fivePanoIndex is ${o}`);const s=this.getCache({panoIndex:n,id:e.id});if(s.distance!==void 0)return s.distance;{const c=(l=(a=this.five.work)==null?void 0:a.observers[o])==null?void 0:l.position;if(c===void 0)throw new Error(`getDistance(): observerPosition is ${c}`);const u=wp(e);if(!u)return-1;const h=c.distanceTo(u);return s.distance=h,h}}getPositions(e){if(vp(e))return e.position;if(Re(e))return e.data.mediaPosition;const n=e;return Ep(this.five.camera.position,qe(n.position),qe(n.normal))}addObjectClickHandler(e,n,o){if(!n||!this.domEvents)return()=>{};const s=()=>!(!e.state.visible||!this.state.visible||Re(e)&&!e.mediaVisible),r=u=>{if(!s()){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(!s()){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(!s()){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(!s()){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)};return this.domEvents.addEventListener(n,"mousedown",r,!1),this.domEvents.addEventListener(n,"mouseup",a,!1),this.domEvents.addEventListener(n,"touchstart",l,!1),this.domEvents.addEventListener(n,"touchend",c,!1),()=>{!this.domEvents||(this.mouseInfo=void 0,this.domEvents.removeEventListener(n,"mousedown",r),this.domEvents.removeEventListener(n,"mouseup",a),this.domEvents.removeEventListener(n,"touchstart",l),this.domEvents.removeEventListener(n,"touchend",c))}}getTagNormal(e){if(e.normal)return qe(e.normal);if(e.stickType==="Plane")return Hi(e.position);if(e.stickType==="Model")return Hi(this.getPositions(e))}get filterPointTag(){return this.tags.filter(e=>e.stickType==="2DPoint"||e.stickType==="3DPoint").filter(e=>e.position)}get filter2DPointTag(){return this.tags.filter(e=>e.stickType==="2DPoint").filter(e=>e.position)}get filter3DPointTag(){return this.tags.filter(e=>e.stickType==="3DPoint").filter(e=>e.position)}get filterImagePlane(){return this.tags.filter(e=>e.contentType==="MediaPlane"&&e.stickType==="Plane"&&this.getRenderType(e)==="Mesh")}get filterMediaModel(){return this.tags.filter(e=>e.stickType==="Model"&&e.contentType==="MediaModel")}get filterModelTag(){return this.tags.filter(e=>e.stickType==="Model")}get filterCSS3DTag(){return this.tags.filter(n=>n.stickType==="3DPoint"||n.stickType==="Plane"||n.stickType==="Model").filter(n=>{const o=this.getRenderType(n);return o==="BehindDom"||o==="Dom"})}checkDisposed(){return this.store.disposed?(console.error("PanoTagPluginController has been disposed"),!0):!1}}class Bp extends zp{constructor(e){super(e);f(this,"raycaster",new E.Raycaster)}getVisibleByPanoIndex(e,n){var r;const o=this.getCache({panoIndex:n,id:e.id}),s=(r=this.five.panoIndex)!=null?r:n;if(Re(e))return!0;if(o.visible!==void 0)return o.visible;{const a=(()=>{var u,h,d;const l=(u=this.getTagConfig(e).visibleConfig)!=null?u:{},c=this.getDistance(e);if(typeof l=="function")return{value:l(this.five,{tag:e,distance:c}),reason:"config function result"};if(l.keep==="hidden")return{value:!1,reason:"config.keep is hidden"};if(l.keep==="visible")return{value:!0,reason:"config.keep is visible"};if(l.visiblePanoIndex!==void 0&&l.visiblePanoIndex!=="all"&&s!==void 0){if(Array.isArray(l.visiblePanoIndex)&&!l.visiblePanoIndex.includes(s))return{value:!1,reason:`current panoIndex is not included in visiblePano. currentPanoIndex: ${s}, visiblePanoIndex: ${l.visiblePanoIndex}`};if(l.visiblePanoIndex==="current"&&s!==((h=e.fiveState)==null?void 0:h.panoIndex))return{value:!1,reason:`current panoIndex is not equal to tag.panoIndex. currentPanoIndex: ${s}, tag.panoIndex: ${(d=e.fiveState)==null?void 0:d.panoIndex}`}}if(l.visibleDistance!==void 0&&l.visibleDistance!=="unLimited"&&dn(c,l.visibleDistance)===!1)return{value:!1,reason:`distance is not in visibleDistance. distance: ${c}, visibleDistance: ${l.visibleDistance}`};if(l.intersectRaycaster!==!1&&(typeof l.intersectRaycaster!="object"||l.intersectRaycaster.enabled!==!1)){if(s===void 0)return{value:!1,reason:`intersectRaycaster check failed: fivePanoIndex is ${s}`};const m=this.getRaycasterFromPanoIndex(e,s);if(!m)return{value:!1,reason:`intersectRaycaster check failed: raycaster is ${m}`};const g=this.getTagEnableByIntersect(e,m);if(g.value===!1)return g}if(l.angleRange&&bp(e)){const m=this.getAngle(e);if(dn(m,l.angleRange)===!1)return{value:!1,reason:`angle is not in angleRange. angle: ${m}, angleRange: ${l.angleRange}`}}return{value:!0,reason:"all check passed"}})();return o.visible=a.value,o.__debug_visible_reason__=a,o.visible}}getVisibleByFiveMode(e,n){var r;const o=(r=this.getTagConfig(e).visibleConfig)!=null?r:{};if(typeof o=="function")return n==="Panorama";const s=o==null?void 0:o.visibleFiveMode;return s?s.includes(n):n==="Panorama"}getVisibleByFloorIndex(e){var a;const n=e.fiveState;if(!n)return!0;const o=n.panoIndex,s=(a=this.five.work.observers[o])==null?void 0:a.floorIndex,r=this.five.model.shownFloor;return r===null||r===s}getCurrentVisibleState(e){var n;return(n=this.state.visible&&e.state.visible)!=null?n:!0}getVisible(e){const n=this.five.getCurrentState(),o=this.getVisibleByFiveMode(e,n.mode),s=Re(e)?this.getVisibleByFloorIndex(e):!0,r=n.mode==="Panorama"?this.getVisibleByPanoIndex(e,n.panoIndex):!0;return o&&r&&s}getModelMedialVisibleByPanoIndex(e){if(!this.getCurrentVisibleState(e))return!1;const n=this.five.getCurrentState().panoIndex,o=this.getCache({panoIndex:n,id:e.id});if(o.modelMedialVisible!==void 0)return o.modelMedialVisible;const s=this.getRaycasterFromPanoIndex(e,n);if(!s)return!1;const r=this.getTagEnableByIntersect(e,s);return o.modelMedialVisible=r.value,o.__debug_visible_reason__=r,r.value!==!1}getUnfoldedByPanoIndex(e,n){if(!this.getVisibleByPanoIndex(e))return;const s=this.getCache({panoIndex:n,id:e.id});if(s.unfolded!==void 0)return s.unfolded;{const r=this.getTagConfig(e).unfoldedConfig;if(!r)return;const a=(()=>{const c=this.getDistance(e);if(typeof r=="function")return r(this.five,{tag:e,distance:c});if(r.keep==="folded")return!1;if(r.keep==="unfolded")return!0;if(r.unfoldDistance&&dn(c,r.unfoldDistance)===!1)return!1})();s.unfolded=a;const l=this.getUnfoldedByCamera(e);return l!==void 0?l:s.unfolded}}getUnfoldedByCamera(e){return this.getVisibleByPanoIndex(e)?(()=>{var a;const s=this.getDistance(e),r=this.getTagConfig(e).unfoldedConfig;if(!!r){if(typeof r=="function")return r(this.five,{tag:e,distance:s});if(r.keep==="folded")return!1;if(r.keep==="unfolded")return!0;if(r.autoUnfold===void 0||r.autoUnfold===!1||r.autoUnfold.enable===!1||!r.autoUnfold.strategy)return;if(r.autoUnfold.strategy==="ScreenPostion"){const l=this.getTagProject(e);if(l&&dn(l.x,r.autoUnfold.autoUnfoldProjectX)===!1)return!1}if(r.autoUnfold.strategy==="MinimumDistance"){const u=this.filterPointTag.filter(d=>this.getVisibleByPanoIndex(d)).filter(d=>{const m=this.getTagProject(d);if(!m)return!1;const{x:g,y:p,z:A}=m;return!(Math.abs(A)>1||Math.abs(g)>1||Math.abs(p)>1)}).map(d=>({tag:d,id:d.id,tagConfig:this.getTagConfig(d).unfoldedConfig})).filter(({tag:d,tagConfig:m})=>{var g,p;return!(typeof m!="object"||m.keep||m.autoUnfold===!1||((g=m.autoUnfold)==null?void 0:g.enable)===!1||((p=m.autoUnfold)==null?void 0:p.strategy)!=="MinimumDistance")}).map(d=>fe(Q({},d),{distance:this.getDistance(d.tag)})).filter(({distance:d,tagConfig:m})=>{var g,p;return!(d===void 0||typeof m!="object"||m.autoUnfold===!1||((g=m.autoUnfold)==null?void 0:g.enable)===!1||((p=m.autoUnfold)==null?void 0:p.strategy)!=="MinimumDistance"||m.autoUnfold.distance&&dn(d,m.autoUnfold.distance)===!1)}).sort((d,m)=>d.distance-m.distance).findIndex(d=>d.id===e.id);if(u===-1||u<=((a=r.autoUnfold.maxNumber)!=null?a:1)-1===!1)return!1}return!0}})():void 0}sort(e){return e.sort((n,o)=>{const s=this.getDistance(n),r=this.getDistance(o);return s===void 0||r===void 0?0:r-s})}setPointTagPosition(){const e=this.filterPointTag;e.length!==0&&e.forEach(n=>{var s;if(!((s=n.state)!=null&&s.visible)){n.pointTagStyle=null;return}const o=this.getTagProject(n);if(!o){n.pointTagStyle=null;return}n.pointTagStyle={leftPercent:(o.x+1)/2*100,topPercent:(-o.y+1)/2*100}})}setVisibleByPanoIndex(){this.tags.forEach(e=>{const n=this.getVisibleByPanoIndex(e);e.state&&(e.state.visible=n)})}setModelMedialVisible(){const e=this.five.getCurrentState().mode;this.tags.forEach(n=>{var s;if(!Re(n))return;if(!((s=n.model)!=null&&s.object)){n.mediaVisible=!1;return}const o=e==="Panorama"?this.getModelMedialVisibleByPanoIndex(n):!0;n.mediaVisible=o})}setUnfoldedByPanoIndex(){this.tags.forEach(e=>{const n=this.getUnfoldedByPanoIndex(e);if(!!e.state&&(n!==void 0&&(e.state.unfolded=n),n&&!e.state.visible)){const o=this.getTagConfig(e);typeof o.unfoldedConfig=="object"&&o.unfoldedConfig.autoUnfoldWhenHide!==!1&&(e.state.unfolded=!1)}})}getTagProject(e){if(!this.getVisibleByPanoIndex(e))return;const o=fi(e.position);if(!o)return;const{x:s,y:r,z:a}=o.project(this.five.camera);if(!(a>1))return{x:s,y:r,z:a}}getTagEnableByIntersect(e,n){var u,h,d;const o=(u=this.getTagConfig(e).visibleConfig)!=null?u:{},s=this.getDistance(e),[r]=this.five.model.intersectRaycaster(n),a=(()=>{if(!Re(e))return;const m=this.tags.filter(Re).map(p=>{var A;return(A=p.model)==null?void 0:A.object}).filter(Zt);return n.intersectObjects(m,!0)[0]})(),l=(()=>{var m;return typeof o=="object"&&typeof o.intersectRaycaster=="object"&&(m=o.intersectRaycaster.distanceAccuracy)!=null?m:.01})(),c=Math.min((h=r==null?void 0:r.distance)!=null?h:1/0,(d=a==null?void 0:a.distance)!=null?d:1/0);return c+l<s?{value:!1,reason:`intersectRaycaster check failed: distance is ${s}, intersection.distance is ${r==null?void 0:r.distance}, intersection.point is ${r==null?void 0:r.point.toArray()},
|
|
593
|
-
customModelIntersection.point is ${a==null?void 0:a.point.toArray()}, minIntersectionDistance is ${c}`}:{value:!0,reason:""}}getRaycasterFromPanoIndex(e,n){var a;const o=(a=this.five.work.observers[n])==null?void 0:a.position;if(o===void 0)throw new Error(`getVisible(): observerPosition is ${o}`);const s=fi(e.position);if(!s)return;const r=s.sub(o).normalize();return this.raycaster.set(o,r),this.raycaster}}function Vp(i){le(i,"svelte-xuejcm",".line.svelte-xuejcm{position:absolute;pointer-events:none}.line.vertical.svelte-xuejcm{transform:rotate(-90deg) translate3d(0.03125rem, 0, 0.625rem);transform-origin:0 0}.line.horizontal.svelte-xuejcm{transform:translate3d(0, -0.03125rem, 0.625rem)}.straight-line.svelte-xuejcm{display:block;width:100%;height:100%;overflow:visible}")}function sr(i){let t,e,n,o,s,r,a,l=i[3]&&rr(i);return{c(){t=
|
|
609
|
+
`;class ro{constructor(t,e){f(this,"mesh");f(this,"five");f(this,"mode");f(this,"path",[]);f(this,"skippedPositions",null);f(this,"textureUrl","");f(this,"scale",1);f(this,"width",.5);f(this,"unitLength",.5);f(this,"visible",!1);f(this,"modeVisible",!1);f(this,"customVisible",null);f(this,"plugin");f(this,"textureHasLoaded",!1);f(this,"disposed",!1);f(this,"onPluginShow",()=>{this.updateVisible()});f(this,"onPluginHide",()=>{this.updateVisible()});f(this,"onPluginEnable",()=>{this.updateVisible()});f(this,"onPluginDisable",()=>{this.updateVisible()});f(this,"onFiveModeChange",t=>{this.modeVisible=this.mode==="panorama"?uo(t):Pa(t),this.updateVisible()});f(this,"logWarning",t=>Yg("GuideLineModeItem: ",t));f(this,"logError",t=>Ug("GuideLineModeItem: ",t));this.five=t,this.mode=e.mode,this.plugin=e.plugin;const n=new E.BufferGeometry,o=new E.ShaderMaterial({vertexShader:np,fragmentShader:ip,transparent:!0,uniforms:{map:{value:null},useMapColor:{value:0},mapColor:{value:new E.Color},mapOpacity:{value:1},backgroundColor:{value:new E.Color},backgroundOpacity:{value:0},opacity:{value:1},maxU:{value:0}}});this.mesh=new E.Mesh(n,o),this.mesh.name="GuideLineModeItem",this.plugin.hooks.on("show",this.onPluginShow),this.plugin.hooks.on("hide",this.onPluginHide),this.plugin.hooks.on("enable",this.onPluginEnable),this.plugin.hooks.on("disable",this.onPluginDisable),this.five.on("modeChange",this.onFiveModeChange),this.onFiveModeChange(this.five.getCurrentState().mode)}setCustomVisible(t){if(this.disposed)return this.logError("disposed");this.customVisible!==t&&(this.customVisible=t,this.updateVisible())}setModeVisible(t){if(this.disposed)return this.logError("disposed");this.modeVisible!==t&&(this.modeVisible=t,this.updateVisible())}dispose(){this.disposed||(this.disposed=!0,this.five.off("modeChange",this.onFiveModeChange),this.plugin.hooks.off("show",this.onPluginShow),this.plugin.hooks.off("hide",this.onPluginHide),this.plugin.hooks.off("enable",this.onPluginEnable),this.plugin.hooks.off("disable",this.onPluginDisable),this.doHide())}setUnitSize(t,e){if(this.disposed)return this.logError("disposed");this.width=t,this.unitLength=e,this.setGeometryByPath(this.path,{width:t,unit_length:e})}setScale(t){if(this.disposed)return this.logError("disposed");this.scale=t,this.setGeometryByPath(this.path,{scale:t})}setGeometryByPanoGroup(t,e){if(this.disposed)return this.logError("disposed");if(!this.five.work)return this.logError("setPathByPanoGroup: work is not ready");const n=this.getPathFromPanoGroup(t,this.five.work,e);this.path=n,this.setGeometryByPath(n,e)}setGeometryByPath(t,e){var l,c,u;if(this.disposed)return this.logError("disposed");const n=(l=e==null?void 0:e.scale)!=null?l:this.scale,o=(c=e==null?void 0:e.width)!=null?c:this.width,s=(u=e==null?void 0:e.unit_length)!=null?u:this.unitLength;this.path=t,this.scale=n,this.width=o,this.unitLength=s;const{geometry:r,maxU:a}=$g({path:t,width:o*n,unitLength:s*n,skipPositions:this.skippedPositions});this.mesh.geometry=r,this.mesh.material.needsUpdate=!0,this.mesh.material.uniforms.maxU.value=a,this.five.needsRender=!0}setSkippedPanoGroup(t){if(this.disposed)return this.logError("disposed");if(!this.five.work)return this.logError("setSkippedPanoGroup: work is not ready");const e=t?t.map(n=>this.five.work.observers[n]).map(n=>n.standingPosition.clone()):null;this.skippedPositions=e}setMartial(t){var e;if(this.disposed)return this.logError("disposed");t!=null&&t.color&&this.setColor(t.color),t!=null&&t.opacity&&this.setOpacity(t.opacity),(e=t==null?void 0:t.texture)!=null&&e.url&&this.setTextureUrl(t.texture.url),t!=null&&t.background_color&&this.setBackgroundColor(t.background_color),t!=null&&t.background_opacity&&this.setBackgroundOpacity(t.background_opacity)}setColor(t){if(this.disposed)return this.logError("disposed");this.mesh.material.uniforms.useMapColor.value=t?1:0,this.mesh.material.uniforms.mapColor.value=new E.Color().setRGB(t[0],t[1],t[2]),this.mesh.material.uniformsNeedUpdate=!0,this.five.needsRender=!0}setBackgroundColor(t){if(this.disposed)return this.logError("disposed");this.mesh.material.uniforms.backgroundColor.value=new E.Color().setRGB(t[0],t[1],t[2]),this.mesh.material.uniformsNeedUpdate=!0,this.five.needsRender=!0}setOpacity(t){if(this.disposed)return this.logError("disposed");this.mesh.material.uniforms.opacity.value=t,this.mesh.material.uniformsNeedUpdate=!0,this.five.needsRender=!0}setBackgroundOpacity(t){if(this.disposed)return this.logError("disposed");this.mesh.material.uniforms.backgroundOpacity.value=t,this.mesh.material.uniformsNeedUpdate=!0,this.five.needsRender=!0}setMapOpacity(t){if(this.disposed)return this.logError("disposed");this.mesh.material.uniforms.mapOpacity.value=t,this.mesh.material.uniformsNeedUpdate=!0,this.five.needsRender=!0}setTextureUrl(t){if(this.disposed)return this.logError("disposed");this.textureUrl=t,hi(t).then(e=>{this.disposed||this.textureUrl===t&&(e.wrapT=E.RepeatWrapping,this.textureHasLoaded=!0,this.mesh.material.uniforms.map.value=e,this.mesh.material.uniformsNeedUpdate=!0,this.mesh.material.needsUpdate=!0,this.five.needsRender=!0,this.updateVisible())})}updateVisible(){const t=(()=>!this.plugin.state.enabled||!this.plugin.state.visible?!1:this.customVisible!==null?this.customVisible:this.modeVisible&&this.textureHasLoaded)();this.visible!==t&&(this.visible=t,t?this.doShow():this.doHide())}doShow(){this.five.scene.add(this.mesh),this.five.needsRender=!0}doHide(){this.five.scene.remove(this.mesh),this.five.needsRender=!0}getPathFromPanoGroup(t,e,n){const s=t.map(r=>e.observers[r]).map(r=>r.standingPosition.toArray());return[F({type:"CatmullRomCurve3",points:s},n)]}}const op=Object.freeze(Object.defineProperty({__proto__:null,GuideLineModeItem:ro},Symbol.toStringTag,{value:"Module"}));class Dl{constructor(t){f(this,"id");f(this,"renderID");f(this,"isGuideLine",!0);f(this,"panoramaItem");f(this,"modelItem");f(this,"plugin");f(this,"five");this.id=t.id,this.five=t.five,this.plugin=t.plugin,this.panoramaItem=new ro(this.five,{mode:"panorama",plugin:this.plugin}),this.modelItem=new ro(this.five,{mode:"model",plugin:this.plugin})}setData(t){this.setDataByMode("panorama",t),this.setDataByMode("model",t)}setDataByMode(t,e){const n=t==="panorama"?this.panoramaItem:this.modelItem,o=t==="panorama"?e.panorama_style:e.model_style;if(!o)return;const s=e.path,r={url:this.plugin.staticPrefix+"/release/web/arrow6.b6ce0c62.png"},a=o,l=rt.default({texture:r},o);e.pano_group&&t==="panorama"&&n.setSkippedPanoGroup(e.pano_group),e.path?n.setGeometryByPath(s,a):e.pano_group&&n.setGeometryByPanoGroup(e.pano_group,a),n.setMartial(l)}}const sp=Object.freeze(Object.defineProperty({__proto__:null,GuideLineItem:Dl},Symbol.toStringTag,{value:"Module"})),Ll="v1.1.0",ao="GuideLinePlugin",$s=`${ao}@${Ll}`;function rp(i){return Object.hasOwn(i,"routes")}class ap extends Tt{constructor(e,n){super(e,n);f(this,"version",Ll);f(this,"name",ao);f(this,"state",{visible:!1,enabled:!0,disposed:!1});f(this,"data");f(this,"linesGroup");f(this,"itemMap",new Map);f(this,"disposedErrorLog",()=>{console.error(`${$s} is disposed`)});Object.assign(window,{[`__${ao}_DEBUG__`]:this})}load(e,n,o=!0){return G(this,null,function*(){if(this.state.disposed)return;this.clear();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,r.lines.forEach(a=>{this.addGuideLineItem(a)}),yield this.waitFiveLoaded(),this.handleVisible(this.state.visible),this.handleEnable(this.state.enabled),n&&this.setState(n,{userAction:o}),this.hooks.emit("dataLoaded",r),console.info(`${$s} loaded`,r)})}formatData(e){return G(this,null,function*(){const n=this.getDataWithoutVersion(e);if(rp(n)){const{routes:o}=n;return{lines:o.map(r=>{const{panoIndexList:a}=r;return{render_id:_e(),pano_group:a,panorama_style:{visible:!0,width:.6,unit_length:.4}}})}}return n})}show(e){return G(this,null,function*(){this.setState({visible:!0},e)})}hide(e){return G(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=F({},this.state);this.state=F(F({},this.state),e),e.disposed!==void 0&&e.disposed!==o.disposed&&e.disposed&&this.handleDispose(),e.visible!==void 0&&e.visible!==o.visible&&this.handleVisible(e.visible,n==null?void 0:n.userAction),e.enabled!==void 0&&e.enabled!==o.enabled&&this.handleEnable(e.enabled,n==null?void 0:n.userAction),nt(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)}addGuideLineItem(e){const n=e.render_id||e.id,o=new Dl({five:this.five,id:n,plugin:this});return this.itemMap.set(n,o),e&&o.setData(e),o}getGuideLineItemByID(e){return this.itemMap.get(e)}removeGuideLineItem(e){this.itemMap.delete(e.id),e.panoramaItem.dispose(),e.modelItem.dispose()}clear(){this.itemMap.forEach(e=>{this.removeGuideLineItem(e)})}handleEnable(e,n=!0){this.hooks.emit(e?"enable":"disable",{userAction:n})}handleVisible(e,n=!0){!this.state.enabled||this.hooks.emit(e?"show":"hide",{userAction:n})}handleDispose(){this.linesGroup&&this.five.scene.remove(this.linesGroup),this.hooks.emit("dispose")}waitFiveLoaded(){return G(this,null,function*(){return new Promise(e=>{if(this.five.work){e();return}this.five.once("loaded",()=>{e()})})})}getDataWithoutVersion(e){return typeof e=="object"&&e!==null&&e.version&&e.data?e.data:e}}const Sl=(i,t)=>new ap(i,t);function er(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 lp(i,t){const e=er(i),n=er(t);return e.angleTo(n)}const cp=i=>G(exports,null,function*(){try{i().then(()=>{},()=>{}).catch(()=>{})}catch(t){}}),Nn=Math.PI*2;function up(i){return i>=0&&i<Nn?i:(i%Nn+Nn)%Nn}function dp(i){return{longitude:up(-Math.atan2(i.x,-i.z)),latitude:-Math.asin(i.y/1)}}function hp(i,t,e,n){const o=-i/e,s=i;return o*n+s}function fp(i){return new Promise(t=>{setTimeout(()=>{t()},i)})}const Ml="v1.0.6",Tl="CruisePlugin",Ii=`${Tl}@${Ml}`,tr=()=>{console.error(`${Ii} is disposed`)},mp=()=>{console.warn(`${Ii} is disabled`)},gp=()=>{console.error(`${Ii} is disabled`)},Qi=new Map;class Io extends Tt{constructor(e,n){super(e,n);f(this,"state",{visible:!0,enabled:!0,disposed:!1,playing:!1,speed:1,config:{speedConfig:{rotateSpeed:.001,rotateSpeedUnit:"rad/ms",moveSpeed:.002,moveSpeedUnit:"m/ms"}}});f(this,"data");f(this,"config");f(this,"privateState",{playing:!1,currentPlayQueue:[],currentPlayKeyframe:null,broke:!1,disposers:[],modeChanging:!1});f(this,"GuideLine");this.config=n,Object.assign(window,{[`__${Tl}_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 G(this,null,function*(){var u,h,d,m,g,p;if(this.state.disposed)return tr();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(A=>A.data.panoIndex!==void 0);c.filter((A,v)=>{var b;return A.data.panoIndex!==((b=c[v-1])==null?void 0:b.data.panoIndex)}).map(A=>A.data.panoIndex).forEach(A=>{var b,w;const v=(b=this.five.work.observers[A])==null?void 0:b.floorIndex;if(v!==void 0)if(l===v){const k=a.length-1;a[k]=[...(w=a[k])!=null?w:[],A]}else{l=v;const k=a.length;a[k]=[A]}}),!this.GuideLine&&((g=this.config)==null?void 0:g.useGuideLine)!==!1&&(this.GuideLine=Sl(this.five,this.config)),(p=this.GuideLine)==null||p.load({routes:a.map(A=>({panoIndexList:A})),config:r.guildPluginOptions}),this.setState({playing:!1}),this.handleVisible(this.state.visible),this.handleEnable(this.state.enabled),this.changePlayState(this.state.playing),this.changeSpeed(this.state.speed),n&&this.setState(n,{userAction:o}),console.info(`${Ii} 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(F({},e),{index:0}))}pause(e){this.setState({playing:!1},e)}show(e){return G(this,null,function*(){this.setState({visible:!0},e)})}hide(e){return G(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 tr();if(!this.state.enabled&&e.enabled!==!0&&e.disposed!==!0)return gp();const o=F({},this.state);this.state=F(F({},this.state),e),e.disposed!==void 0&&e.disposed!==o.disposed&&e.disposed&&this.handleDispose(),e.visible!==void 0&&e.visible!==o.visible&&this.handleVisible(e.visible,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),nt(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 G(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:_e(),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(F({id:(c=s.uuid)!=null?c:_e(),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 dp(p.normalize())})();o.moveType===void 0||o.moveType==="justMove"?s.push({moveIndex:u,stay:o.stay,data:F({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:F({effect:"Rotate",panoIndex:c},h)}))}),{keyframesId:_e(),keyframes:s.map((c,u)=>F({id:_e(),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 G(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=_e();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(()=>G(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 fp(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 G(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 G(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 G(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 G(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 G(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 G(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 lp(h,e)/l}return 800})();r.currentPlayKeyframe&&(r.currentPlayKeyframe.originDuration=c);const u=this.getSpeededDuration(c);return new Promise(h=>{cp(()=>s.updateCamera(e,u)),setTimeout(()=>h(),u)})})}changePano(e,n){return G(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 G(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 Qi.get((n=this.data)==null?void 0:n.keyframesId)}setPauseData(){var e,n,o,s;if((e=this.data)!=null&&e.keyframesId)return Qi.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 Qi.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&&mp()}waitFiveLoaded(){return G(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-hp(1,n.startVelocity,n.duration,o)})}setFiveOriginUpdateCamera(){!this.privateState.fiveOriginGetProgress||(this.five.controller.cameraMotion.getProgress=this.privateState.fiveOriginGetProgress)}}f(Io,"PluginVersion",Ml);const pp=i=>new Io(i);function Ap(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 Hi(i){if(i.length<3)return;const t=i.map(yn),e=t[1].clone().sub(t[0]),n=t[2].clone().sub(t[1]);return e.cross(n)}var zl=(i=>(i.Audio="Audio",i.Text="Text",i.ImageText="ImageText",i.Image="Image",i.Video="Video",i.Link="Link",i.Sticker="Sticker",i.VRLink="VRLink",i.PanoLink="PanoLink",i.Marketing="Marketing",i.MediaPlane="MediaPlane",i.MediaModel="MediaModel",i.Custom="Custom",i.Unknown="Unknown",i))(zl||{});class nr extends E.Mesh{constructor(e,n){super();f(this,"name","PanoTagPluginImagePlane");f(this,"imageSrc");this.imageSrc=e,hi(e).then(o=>{const s=o.image.width,r=o.image.height,a=new E.MeshBasicMaterial({map:o,transparent:!0}),l=new E.PlaneGeometry(s,r);this.geometry=l,this.material=a;const c=n[0].distanceTo(n[1]),u=n[1].distanceTo(n[2]);this.scale.set(c/s,u/r,1);const h=s/r,d=c/u;h>d?this.scale.set(c/s,c/s,1):h<d?this.scale.set(u/r,u/r,1):this.scale.set(c/s,u/r,1)}).catch(o=>{console.error({e:o})})}setMatrixByCornerPoints(e){const n=new j.Vector3().subVectors(e[1],e[0]),o=new j.Vector3().subVectors(e[3],e[0]),s=In(...e),r=new j.Vector3().crossVectors(n,o).normalize();this.lookAt(r);const a=this.up.clone().applyQuaternion(this.quaternion),l=o.clone(),c=new j.Vector3().crossVectors(a,l).normalize();this.rotateOnWorldAxis(c,a.angleTo(l)),this.position.copy(s)}}var Bl=(i=>(i.Two="2D",i.Three="3D",i))(Bl||{});function vp(i){return i.stickType==="Plane"}function bp(i){return i.stickType==="3DPoint"||i.stickType==="Plane"}function Re(i){return i.stickType==="Model"&&i.contentType==="MediaModel"}function yp(i){return i.stickType==="Plane"&&i.contentType==="MediaPlane"}function fi(i){if(!!i)if(Array.isArray(i)&&i.length===4){const e=i.map(yn);return In(e[0],e[2])}else return yn(i)}function wp(i){if(Re(i)&&i.matrix){const t=new j.Matrix4().fromArray(i.matrix),e=i.data.mediaPosition.map(n=>new j.Vector3().fromArray(n).applyMatrix4(t));return In(e[0],e[2])}else return fi(i.position)}function dn(i,t){if(i===void 0)return;const{min:e,max:n}=t!=null?t:{};if(!(e===void 0&&n===void 0))return!(typeof n=="number"&&n<i||typeof e=="number"&&e>i)}function Cp(i){return new Promise(t=>{i.model.loaded?t():i.once("modelLoaded",()=>t())})}function Ep(i,t,e){const o=new E.Plane().setFromNormalAndCoplanarPoint(e,t),s=t.clone().sub(i).cross(new E.Vector3(0,1,0)).setLength(.01),r=new E.Vector3(0,.01,0);return[t.clone().sub(s).sub(r),t.clone().add(s).sub(r),t.clone().add(s).add(r),t.clone().sub(s).add(r)].map(l=>o.projectPoint(l,new E.Vector3))}const ir=(i,t=1e3/60)=>{let e=null;const n=i;return(...s)=>{e&&clearTimeout(e),e=setTimeout(()=>{n==null||n(...s),e&&clearTimeout(e),e=null},t)}};function Pp(i,t=200){let e;return function(...n){e||(i.apply(this,n),e=setTimeout(function(){e=null},t))}}function Ip(i,t){const[e,n]=t;if(e>=n||n<=1||e<=1)return-1;const o={},s=r=>(o[r]||(o[r]=i(r)),o[r]);for(let r=e;r<n;r++){const a=s(r),l=s(r-1);if(a<l)return r}return-1}function or(i,t){if(!t||typeof ResizeObserver=="undefined"||!ResizeObserver)return{observe:()=>window.addEventListener("resize",i),unobserve:()=>window.removeEventListener("resize",i)};{const e=new ResizeObserver(i);return{observe:()=>e.observe(t),unobserve:()=>e.unobserve(t)}}}function kp(i){var t,e,n,o;if(!i.stickType){const s=(()=>i.pointType==="PointTag"&&i.dimensionType==="3D"?"3DPoint":i.pointType==="PlaneTag"?"Plane":"2DPoint")();i.stickType=s}if(i.contentType==="VRLink"||i.contentType==="PanoLink"||i.contentType==="Link"){const s=i;!((e=(t=s.data)==null?void 0:t.icon)!=null&&e.url)&&!((o=(n=s.style)==null?void 0:n.point)!=null&&o.url)&&(s.data.icon={url:"//vrlab-static.ljcdn.com/release/web/test.09dee741.png",steps:28})}return i}const Ut="data:audio/mpeg;base64,//uQxAAAAAAAAAAAAAAAAAAAAAAASW5mbwAAAA8AAAADAAAGhgBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVWqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqr///////////////////////////////////////////8AAAA5TEFNRTMuOThyAc0AAAAAAAAAABSAJAiqQgAAgAAABobxtI73AAAAAAAAAAAAAAAAAAAAAAA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8wosososy0EalnZyjQUGBRQGIFggOWUacWUeYmuadrZziQKKEgQsQLAhQkUJAgMQDghltLO1onp0cpkNInSFMqlYeSEJ5AHsqFdOwy1DA2sRmRJKxdKRfLhfLw5BzUxBTUUzLjk4LjJVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVUxBTUUzLjk4LjJVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVf/7ksRRA8AAAaQAAAAgAAA0gAAABFVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVU=",An={};var ko=(i=>(i.Default="default",i.GetAudioDuration="getAudioDuration",i.PlayAudio="playAudio",i))(ko||{});function xp(i,t){const e=(t==null?void 0:t.namespace)||"default",n=An[e]||(An[e]=[]);let o=n.find(s=>!s.realSrc||s.realSrc===Ut);return o||(console.warn("\u672A\u627E\u5230\u7F13\u5B58\u97F3\u9891\uFF0C\u5DF2\u65B0\u5EFA",An),o=new Vl(Ut),n.push(o)),i&&(o.src=i),o}function Dp(i,t){const e=(t==null?void 0:t.namespace)||"default",n=An[e]||(An[e]=[]),o=i-n.length;if(!(o<=0))for(let s=0;s<o;s++)n.push(new Vl(Ut))}class Vl extends Audio{constructor(e){super(e);f(this,"preload","auto");f(this,"crossOrigin","anonymous");f(this,"realSrc","");f(this,"inited",!1);f(this,"removeDocumentEventListener");this.realSrc=e!=null?e:"",this.muted=!0,super.autoplay=!0,super.addEventListener("ended",()=>{this.src=""});const n=()=>Lp(this);document.addEventListener("click",n),document.addEventListener("touchend",n),this.removeDocumentEventListener=()=>{document.removeEventListener("click",n),document.removeEventListener("touchend",n)}}get isBlankAudio(){return this.realSrc===Ut||!this.realSrc}get src(){return super.src}set src(e){super.src=e,this.realSrc=e,this.removeDocumentEventListener()}get muted(){return super.muted}set muted(e){super.muted=e}clear(){this.currentTime=0,this.src=Ut}}function Lp(i){!i||i.inited||(i.src&&(i.inited=!0,i.removeDocumentEventListener()),i.src===Ut&&i.play())}const Sp={globalConfig:{unfoldedConfig:{autoUnfold:{strategy:"MinimumDistance",distance:{max:5}}},tag3DConfig:{ratio:.0035}},contentTypeConfig:{"Any-Audio-plane":{unfoldedConfig:{keep:"unfolded"},initialState:{unfolded:!0}},Link:{unfoldedConfig:{keep:"unfolded"},initialState:{unfolded:!0}},VRLink:{unfoldedConfig:{keep:"unfolded"},initialState:{unfolded:!0}},PanoLink:{unfoldedConfig:{keep:"unfolded"},initialState:{unfolded:!0}},MediaPlane:{unfoldedConfig:{keep:"unfolded"},visibleConfig:{alwaysShowWhenMovePano:!0}},MediaModel:{unfoldedConfig:{keep:"unfolded"},visibleConfig:{keep:"visible",visibleFiveMode:["Panorama","Floorplan","Model","Mapview"],alwaysShowWhenMovePano:!0}}}};class Mp extends xn{constructor(e){super(e);f(this,"tagCacheByPanoIndex",{})}getCache({panoIndex:e,id:n,key:o}){var c,u,h,d;const{five:s}=this,r=(c=s.panoIndex)!=null?c:e;if(r===void 0)throw new Error(`TagCacheController getCache(): fivePanoIndex is ${r}`);const a=`${(h=(u=s.work)==null?void 0:u.workCode)!=null?h:s.model.uuid}-${r}`;let l=this.tagCacheByPanoIndex[a];if(l||(l=new Map,this.tagCacheByPanoIndex[a]=l),n===void 0)return l;if(o===void 0){const m=l.get(n);return m||(l.set(n,{}),l.get(n))}return(d=l.get(n))==null?void 0:d[o]}clearCache(){this.tagCacheByPanoIndex={}}removeCache(){}}const Tp=navigator.userAgent.toLowerCase().indexOf("micromessenger")!==-1&&navigator.userAgent.toLowerCase().indexOf("iphone")!==-1;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 zp extends Mp{constructor(e){super(e);f(this,"tags",[]);f(this,"config",Sp);f(this,"mediaStore",bo({currentMediaElement:null}));f(this,"css3DRenderPlugin");f(this,"store",{disposers:[],disposed:!1,resizeObserverDisposerAdding:!1,css3DRenderDisposer:new Map});f(this,"domEvents");f(this,"mouseInfo");f(this,"preventWhenMouseDown",()=>{var e;if((e=this.mouseInfo)!=null&&e.isDown)return!1});const n=this.five.getElement();n&&(this.domEvents=new be(this.five.camera,n)),this.five.on("wantsMoveToPano",this.preventWhenMouseDown),this.five.on("wantsTapGesture",this.preventWhenMouseDown),this.store.disposers.push(()=>{this.five.off("wantsMoveToPano",this.preventWhenMouseDown),this.five.off("wantsTapGesture",this.preventWhenMouseDown)})}get isPanorama(){return this.five.currentMode==="Panorama"}getTagById(e){const n=this.tags.find(o=>o.id===e);if(!n){console.warn(`error: can not find tag id ${e} by getTagById()`);return}return n}pauseCurrentMedia(){this.mediaStore.set({currentMediaElement:null})}getTagConfig(e){var s,r;if(!e)return(s=this.config.globalConfig)!=null?s:{};const n={};this.config.contentTypeConfig&&Object.keys(this.config.contentTypeConfig).forEach(a=>{const l=a;if(n[l])return;const c=l.split("-");if(c.length===1){const[u]=c;e.contentType===u&&(n[l]=this.config.contentTypeConfig[l])}if(c.length===2){const[u="Any",h="Any"]=c;(e.stickType===u||u==="Any")&&(e.contentType===h||h==="Any")&&(n[l]=this.config.contentTypeConfig[l])}if(c.length===3){const[u="Any",h,d]=c;if(h==="Audio"&&e.contentType==="Audio"){const m=e;(m.stickType===u||u==="Any")&&m.data.appearance===d&&(n[l]=this.config.contentTypeConfig[l])}}});const o=rt.default({},this.config.globalConfig,...Object.values(n),e.config);return typeof o.unfoldedConfig=="object"&&(o.unfoldedConfig.disableFold&&(o.unfoldedConfig={keep:"unfolded"}),o.unfoldedConfig.disableUnfold&&(o.unfoldedConfig={keep:"folded"}),o.unfoldedConfig.keep&&(o.unfoldedConfig={keep:o.unfoldedConfig.keep})),typeof o.visibleConfig=="object"&&o.visibleConfig.keep&&(o.visibleConfig={keep:o.visibleConfig.keep,visibleFiveMode:(r=o.visibleConfig)==null?void 0:r.visibleFiveMode}),o}loadVideoFirstFrame(){Tp&&this.hooks.emit("loadVideoFirstFrame")}updateTagConfig(e){e!=null&&e.force&&this.clearCache(),this.tags.forEach(n=>{const o=this.getTagConfig(n);n.mergedConfig=o})}can(e,n){const o=n,s=this.getTagConfig(o);if(!s||typeof s!="object")return!0;if(e==="show"||e==="hide"){if(!s.visibleConfig||typeof s.visibleConfig!="object")return!0;if(e==="show"&&s.visibleConfig.keep==="hidden"||e==="hide"&&(s.visibleConfig.keep==="visible"||s.visibleConfig.alwaysShowWhenMovePano))return!1}if(e==="fold"||e==="unfold"){if(!s.unfoldedConfig||typeof s.unfoldedConfig!="object")return!0;if(e==="fold"&&s.unfoldedConfig.keep==="unfolded"||e==="unfold"&&s.unfoldedConfig.keep==="folded")return!1}return!0}getRenderType(e){const n=this.getTagConfig(e);if(!n||typeof n!="object"||!n.renderType)return"Dom";const o=e.data.mediaData;if(!o||o.length===0)return"Dom";if(n.renderType==="Mesh"){if(yp(e))if(o.length===1){if(o[0].type==="Image")return"Mesh";if(o[0].type==="Video")return"Dom"}else return"Dom";else if(Re(e))return o.length===1&&o[0].type==="Image"?"Mesh":"BehindDom"}else return"Dom"}getAngle(e,n){var r,a,l;const o=(r=this.five.panoIndex)!=null?r:n;if(o===void 0)throw new Error(`getDistance(): fivePanoIndex is ${o}`);const s=this.getCache({panoIndex:n,id:e.id});if(s.angle!==void 0)return s.angle;{const c=(l=(a=this.five.work)==null?void 0:a.observers[o])==null?void 0:l.position;if(c===void 0)throw new Error(`getAngleRange(): observerPosition is ${c}`);const u=(()=>e.stickType==="3DPoint"?yn(e.normal):Hi(e.position))();if(!u)return;const h=fi(e.position);if(!h)return;const d=new E.Vector3().copy(c).sub(h),m=u.angleTo(d)*180/Math.PI;return s.angle=m,s.angle}}getDistance(e,n){var r,a,l;const o=(r=this.five.panoIndex)!=null?r:n;if(o===void 0)throw new Error(`getDistance(): fivePanoIndex is ${o}`);const s=this.getCache({panoIndex:n,id:e.id});if(s.distance!==void 0)return s.distance;{const c=(l=(a=this.five.work)==null?void 0:a.observers[o])==null?void 0:l.position;if(c===void 0)throw new Error(`getDistance(): observerPosition is ${c}`);const u=wp(e);if(!u)return-1;const h=c.distanceTo(u);return s.distance=h,h}}getPositions(e){if(vp(e))return e.position;if(Re(e))return e.data.mediaPosition;const n=e;return Ep(this.five.camera.position,qe(n.position),qe(n.normal))}addObjectClickHandler(e,n,o){if(!n||!this.domEvents)return()=>{};const s=()=>!(!e.state.visible||!this.state.visible||Re(e)&&!e.mediaVisible),r=u=>{if(!s()){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(!s()){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(!s()){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(!s()){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)};return this.domEvents.addEventListener(n,"mousedown",r,!1),this.domEvents.addEventListener(n,"mouseup",a,!1),this.domEvents.addEventListener(n,"touchstart",l,!1),this.domEvents.addEventListener(n,"touchend",c,!1),()=>{!this.domEvents||(this.mouseInfo=void 0,this.domEvents.removeEventListener(n,"mousedown",r),this.domEvents.removeEventListener(n,"mouseup",a),this.domEvents.removeEventListener(n,"touchstart",l),this.domEvents.removeEventListener(n,"touchend",c))}}getTagNormal(e){if(e.normal)return qe(e.normal);if(e.stickType==="Plane")return Hi(e.position);if(e.stickType==="Model")return Hi(this.getPositions(e))}get filterPointTag(){return this.tags.filter(e=>e.stickType==="2DPoint"||e.stickType==="3DPoint").filter(e=>e.position)}get filter2DPointTag(){return this.tags.filter(e=>e.stickType==="2DPoint").filter(e=>e.position)}get filter3DPointTag(){return this.tags.filter(e=>e.stickType==="3DPoint").filter(e=>e.position)}get filterImagePlane(){return this.tags.filter(e=>e.contentType==="MediaPlane"&&e.stickType==="Plane"&&this.getRenderType(e)==="Mesh")}get filterMediaModel(){return this.tags.filter(e=>e.stickType==="Model"&&e.contentType==="MediaModel")}get filterModelTag(){return this.tags.filter(e=>e.stickType==="Model")}get filterCSS3DTag(){return this.tags.filter(n=>n.stickType==="3DPoint"||n.stickType==="Plane"||n.stickType==="Model").filter(n=>{const o=this.getRenderType(n);return o==="BehindDom"||o==="Dom"})}checkDisposed(){return this.store.disposed?(console.error("PanoTagPluginController has been disposed"),!0):!1}}class Bp extends zp{constructor(e){super(e);f(this,"raycaster",new E.Raycaster)}getVisibleByPanoIndex(e,n){var r;const o=this.getCache({panoIndex:n,id:e.id}),s=(r=this.five.panoIndex)!=null?r:n;if(Re(e))return!0;if(o.visible!==void 0)return o.visible;{const a=(()=>{var u,h,d;const l=(u=this.getTagConfig(e).visibleConfig)!=null?u:{},c=this.getDistance(e);if(typeof l=="function")return{value:l(this.five,{tag:e,distance:c}),reason:"config function result"};if(l.keep==="hidden")return{value:!1,reason:"config.keep is hidden"};if(l.keep==="visible")return{value:!0,reason:"config.keep is visible"};if(l.visiblePanoIndex!==void 0&&l.visiblePanoIndex!=="all"&&s!==void 0){if(Array.isArray(l.visiblePanoIndex)&&!l.visiblePanoIndex.includes(s))return{value:!1,reason:`current panoIndex is not included in visiblePano. currentPanoIndex: ${s}, visiblePanoIndex: ${l.visiblePanoIndex}`};if(l.visiblePanoIndex==="current"&&s!==((h=e.fiveState)==null?void 0:h.panoIndex))return{value:!1,reason:`current panoIndex is not equal to tag.panoIndex. currentPanoIndex: ${s}, tag.panoIndex: ${(d=e.fiveState)==null?void 0:d.panoIndex}`}}if(l.visibleDistance!==void 0&&l.visibleDistance!=="unLimited"&&dn(c,l.visibleDistance)===!1)return{value:!1,reason:`distance is not in visibleDistance. distance: ${c}, visibleDistance: ${l.visibleDistance}`};if(l.intersectRaycaster!==!1&&(typeof l.intersectRaycaster!="object"||l.intersectRaycaster.enabled!==!1)){if(s===void 0)return{value:!1,reason:`intersectRaycaster check failed: fivePanoIndex is ${s}`};const m=this.getRaycasterFromPanoIndex(e,s);if(!m)return{value:!1,reason:`intersectRaycaster check failed: raycaster is ${m}`};const g=this.getTagEnableByIntersect(e,m);if(g.value===!1)return g}if(l.angleRange&&bp(e)){const m=this.getAngle(e);if(dn(m,l.angleRange)===!1)return{value:!1,reason:`angle is not in angleRange. angle: ${m}, angleRange: ${l.angleRange}`}}return{value:!0,reason:"all check passed"}})();return o.visible=a.value,o.__debug_visible_reason__=a,o.visible}}getVisibleByFiveMode(e,n){var r;const o=(r=this.getTagConfig(e).visibleConfig)!=null?r:{};if(typeof o=="function")return n==="Panorama";const s=o==null?void 0:o.visibleFiveMode;return s?s.includes(n):n==="Panorama"}getVisibleByFloorIndex(e){var a;const n=e.fiveState;if(!n)return!0;const o=n.panoIndex,s=(a=this.five.work.observers[o])==null?void 0:a.floorIndex,r=this.five.model.shownFloor;return r===null||r===s}getCurrentVisibleState(e){var n;return(n=this.state.visible&&e.state.visible)!=null?n:!0}getVisible(e){const n=this.five.getCurrentState(),o=this.getVisibleByFiveMode(e,n.mode),s=Re(e)?this.getVisibleByFloorIndex(e):!0,r=n.mode==="Panorama"?this.getVisibleByPanoIndex(e,n.panoIndex):!0;return o&&r&&s}getModelMedialVisibleByPanoIndex(e){if(!this.getCurrentVisibleState(e))return!1;const n=this.five.getCurrentState().panoIndex,o=this.getCache({panoIndex:n,id:e.id});if(o.modelMedialVisible!==void 0)return o.modelMedialVisible;const s=this.getRaycasterFromPanoIndex(e,n);if(!s)return!1;const r=this.getTagEnableByIntersect(e,s);return o.modelMedialVisible=r.value,o.__debug_visible_reason__=r,r.value!==!1}getUnfoldedByPanoIndex(e,n){if(!this.getVisibleByPanoIndex(e))return;const s=this.getCache({panoIndex:n,id:e.id});if(s.unfolded!==void 0)return s.unfolded;{const r=this.getTagConfig(e).unfoldedConfig;if(!r)return;const a=(()=>{const c=this.getDistance(e);if(typeof r=="function")return r(this.five,{tag:e,distance:c});if(r.keep==="folded")return!1;if(r.keep==="unfolded")return!0;if(r.unfoldDistance&&dn(c,r.unfoldDistance)===!1)return!1})();s.unfolded=a;const l=this.getUnfoldedByCamera(e);return l!==void 0?l:s.unfolded}}getUnfoldedByCamera(e){return this.getVisibleByPanoIndex(e)?(()=>{var a;const s=this.getDistance(e),r=this.getTagConfig(e).unfoldedConfig;if(!!r){if(typeof r=="function")return r(this.five,{tag:e,distance:s});if(r.keep==="folded")return!1;if(r.keep==="unfolded")return!0;if(r.autoUnfold===void 0||r.autoUnfold===!1||r.autoUnfold.enable===!1||!r.autoUnfold.strategy)return;if(r.autoUnfold.strategy==="ScreenPostion"){const l=this.getTagProject(e);if(l&&dn(l.x,r.autoUnfold.autoUnfoldProjectX)===!1)return!1}if(r.autoUnfold.strategy==="MinimumDistance"){const u=this.filterPointTag.filter(d=>this.getVisibleByPanoIndex(d)).filter(d=>{const m=this.getTagProject(d);if(!m)return!1;const{x:g,y:p,z:A}=m;return!(Math.abs(A)>1||Math.abs(g)>1||Math.abs(p)>1)}).map(d=>({tag:d,id:d.id,tagConfig:this.getTagConfig(d).unfoldedConfig})).filter(({tag:d,tagConfig:m})=>{var g,p;return!(typeof m!="object"||m.keep||m.autoUnfold===!1||((g=m.autoUnfold)==null?void 0:g.enable)===!1||((p=m.autoUnfold)==null?void 0:p.strategy)!=="MinimumDistance")}).map(d=>fe(F({},d),{distance:this.getDistance(d.tag)})).filter(({distance:d,tagConfig:m})=>{var g,p;return!(d===void 0||typeof m!="object"||m.autoUnfold===!1||((g=m.autoUnfold)==null?void 0:g.enable)===!1||((p=m.autoUnfold)==null?void 0:p.strategy)!=="MinimumDistance"||m.autoUnfold.distance&&dn(d,m.autoUnfold.distance)===!1)}).sort((d,m)=>d.distance-m.distance).findIndex(d=>d.id===e.id);if(u===-1||u<=((a=r.autoUnfold.maxNumber)!=null?a:1)-1===!1)return!1}return!0}})():void 0}sort(e){return e.sort((n,o)=>{const s=this.getDistance(n),r=this.getDistance(o);return s===void 0||r===void 0?0:r-s})}setPointTagPosition(){const e=this.filterPointTag;e.length!==0&&e.forEach(n=>{var s;if(!((s=n.state)!=null&&s.visible)){n.pointTagStyle=null;return}const o=this.getTagProject(n);if(!o){n.pointTagStyle=null;return}n.pointTagStyle={leftPercent:(o.x+1)/2*100,topPercent:(-o.y+1)/2*100}})}setVisibleByPanoIndex(){this.tags.forEach(e=>{const n=this.getVisibleByPanoIndex(e);e.state&&(e.state.visible=n)})}setModelMedialVisible(){const e=this.five.getCurrentState().mode;this.tags.forEach(n=>{var s;if(!Re(n))return;if(!((s=n.model)!=null&&s.object)){n.mediaVisible=!1;return}const o=e==="Panorama"?this.getModelMedialVisibleByPanoIndex(n):!0;n.mediaVisible=o})}setUnfoldedByPanoIndex(){this.tags.forEach(e=>{const n=this.getUnfoldedByPanoIndex(e);if(!!e.state&&(n!==void 0&&(e.state.unfolded=n),n&&!e.state.visible)){const o=this.getTagConfig(e);typeof o.unfoldedConfig=="object"&&o.unfoldedConfig.autoUnfoldWhenHide!==!1&&(e.state.unfolded=!1)}})}getTagProject(e){if(!this.getVisibleByPanoIndex(e))return;const o=fi(e.position);if(!o)return;const{x:s,y:r,z:a}=o.project(this.five.camera);if(!(a>1))return{x:s,y:r,z:a}}getTagEnableByIntersect(e,n){var u,h,d;const o=(u=this.getTagConfig(e).visibleConfig)!=null?u:{},s=this.getDistance(e),[r]=this.five.model.intersectRaycaster(n),a=(()=>{if(!Re(e))return;const m=this.tags.filter(Re).map(p=>{var A;return(A=p.model)==null?void 0:A.object}).filter(Zt);return n.intersectObjects(m,!0)[0]})(),l=(()=>{var m;return typeof o=="object"&&typeof o.intersectRaycaster=="object"&&(m=o.intersectRaycaster.distanceAccuracy)!=null?m:.01})(),c=Math.min((h=r==null?void 0:r.distance)!=null?h:1/0,(d=a==null?void 0:a.distance)!=null?d:1/0);return c+l<s?{value:!1,reason:`intersectRaycaster check failed: distance is ${s}, intersection.distance is ${r==null?void 0:r.distance}, intersection.point is ${r==null?void 0:r.point.toArray()},
|
|
610
|
+
customModelIntersection.point is ${a==null?void 0:a.point.toArray()}, minIntersectionDistance is ${c}`}:{value:!0,reason:""}}getRaycasterFromPanoIndex(e,n){var a;const o=(a=this.five.work.observers[n])==null?void 0:a.position;if(o===void 0)throw new Error(`getVisible(): observerPosition is ${o}`);const s=fi(e.position);if(!s)return;const r=s.sub(o).normalize();return this.raycaster.set(o,r),this.raycaster}}function Vp(i){le(i,"svelte-xuejcm",".line.svelte-xuejcm{position:absolute;pointer-events:none}.line.vertical.svelte-xuejcm{transform:rotate(-90deg) translate3d(0.03125rem, 0, 0.625rem);transform-origin:0 0}.line.horizontal.svelte-xuejcm{transform:translate3d(0, -0.03125rem, 0.625rem)}.straight-line.svelte-xuejcm{display:block;width:100%;height:100%;overflow:visible}")}function sr(i){let t,e,n,o,s,r,a,l=i[3]&&rr(i);return{c(){t=B("div"),e=we("svg"),n=we("defs"),o=we("linearGradient"),s=we("stop"),r=we("stop"),l&&l.c(),y(s,"offset","25%"),y(s,"stop-color",i[5]),y(s,"stop-opacity","1"),y(r,"offset","100%"),y(r,"stop-color",i[5]),y(r,"stop-opacity","0.5"),y(o,"x1",.5),y(o,"y1",.5),y(o,"x2",i[8]),y(o,"y2",.5),y(o,"id",i[10]),y(o,"gradientUnits","userSpaceOnUse"),y(e,"class","straight-line svelte-xuejcm"),y(e,"viewBox",a="0 0 "+i[8]+" "+i[7]),y(e,"preserveAspectRatio","none"),y(t,"class","line svelte-xuejcm"),q(t,"vertical",i[9]),q(t,"horizontal",!i[9]),z(t,"width",i[8]+"px"),z(t,"height",i[7]+"px")},m(c,u){M(c,t,u),V(t,e),V(e,n),V(n,o),V(o,s),V(o,r),l&&l.m(e,null)},p(c,u){u&32&&y(s,"stop-color",c[5]),u&32&&y(r,"stop-color",c[5]),u&256&&y(o,"x2",c[8]),c[3]?l?(l.p(c,u),u&8&&P(l,1)):(l=rr(c),l.c(),P(l,1),l.m(e,null)):l&&(se(),D(l,1,1,()=>{l=null}),re()),u&384&&a!==(a="0 0 "+c[8]+" "+c[7])&&y(e,"viewBox",a),u&512&&q(t,"vertical",c[9]),u&512&&q(t,"horizontal",!c[9]),u&256&&z(t,"width",c[8]+"px"),u&128&&z(t,"height",c[7]+"px")},d(c){c&&L(t),l&&l.d()}}}function rr(i){let t,e,n,o,s;return{c(){t=we("path"),y(t,"fill","none"),y(t,"stroke",e=i[4]?`url(#${i[10]})`:i[5]),y(t,"stroke-width",1),y(t,"d",i[6])},m(r,a){M(r,t,a),s=!0},p(r,a){i=r,(!s||a&48&&e!==(e=i[4]?`url(#${i[10]})`:i[5]))&&y(t,"stroke",e),(!s||a&64)&&y(t,"d",i[6])},i(r){s||(r&&Fe(()=>{o&&o.end(1),n=Mt(t,ui,{duration:i[2],delay:i[0],easing:At}),n.start()}),s=!0)},o(r){n&&n.invalidate(),r&&(o=rn(t,ui,{duration:i[2],delay:i[1],easing:At})),s=!1},d(r){r&&L(t),r&&o&&o.end()}}}function jp(i){let t,e=i[8]&&sr(i);return{c(){e&&e.c(),t=ge()},m(n,o){e&&e.m(n,o),M(n,t,o)},p(n,[o]){n[8]?e?e.p(n,o):(e=sr(n),e.c(),e.m(t.parentNode,t)):e&&(e.d(1),e=null)},i:Y,o:Y,d(n){e&&e.d(n),n&&L(t)}}}function Op(i,t,e){let n,o,s,r,{inDelay:a=0}=t,{outDelay:l=0}=t,{duration:c=1e3}=t,{unfolded:u}=t,{length:h}=t,{direction:d="horizontal"}=t,{useLinearColor:m=!1}=t,{color:g="white"}=t;const p=_e();return i.$$set=A=>{"inDelay"in A&&e(0,a=A.inDelay),"outDelay"in A&&e(1,l=A.outDelay),"duration"in A&&e(2,c=A.duration),"unfolded"in A&&e(3,u=A.unfolded),"length"in A&&e(11,h=A.length),"direction"in A&&e(12,d=A.direction),"useLinearColor"in A&&e(4,m=A.useLinearColor),"color"in A&&e(5,g=A.color)},i.$$.update=()=>{i.$$.dirty&4096&&e(9,n=d==="vertical"),i.$$.dirty&2048&&e(8,o=h),i.$$.dirty&2048&&e(6,r=`M0.5 0.5 H ${h}`)},e(7,s=1),[a,l,c,u,m,g,r,s,o,n,p,h,d]}class xo extends oe{constructor(t){super(),ie(this,t,Op,jp,ne,{inDelay:0,outDelay:1,duration:2,unfolded:3,length:11,direction:12,useLinearColor:4,color:5},Vp)}}function Rp(i){le(i,"svelte-faoauy",".shadow.svelte-faoauy{position:absolute}")}function ar(i){let t,e,n,o,s;return{c(){t=B("div"),y(t,"class","shadow svelte-faoauy"),y(t,"style",e=`
|
|
594
611
|
left:${Ne(i[5])};
|
|
595
612
|
bottom:${Ne(i[6])};
|
|
596
613
|
box-shadow: 0 0 ${Ne(i[10])} ${Ne(i[11])} rgba(0, 0, 0, ${i[12]});
|
|
597
614
|
${i[8]?"transform: translateX(-50%); left: 50%":""}
|
|
598
615
|
${i[9]?"transform: translateX(-50%); top: 50%":""}
|
|
599
616
|
${i[7]?"transform: translate(-50%, -50%); left: 50%; top: 50%;":""}
|
|
600
|
-
`),
|
|
617
|
+
`),z(t,"width",Ne(i[3])),z(t,"height",Ne(i[4])),z(t,"z-index",i[13])},m(r,a){M(r,t,a),s=!0},p(r,a){i=r,(!s||a&8160&&e!==(e=`
|
|
601
618
|
left:${Ne(i[5])};
|
|
602
619
|
bottom:${Ne(i[6])};
|
|
603
620
|
box-shadow: 0 0 ${Ne(i[10])} ${Ne(i[11])} rgba(0, 0, 0, ${i[12]});
|
|
604
621
|
${i[8]?"transform: translateX(-50%); left: 50%":""}
|
|
605
622
|
${i[9]?"transform: translateX(-50%); top: 50%":""}
|
|
606
623
|
${i[7]?"transform: translate(-50%, -50%); left: 50%; top: 50%;":""}
|
|
607
|
-
`))&&y(t,"style",e),a&8&&T(t,"width",Ne(i[3])),a&16&&T(t,"height",Ne(i[4])),a&8192&&T(t,"z-index",i[13])},i(r){s||(r&&Qe(()=>{o&&o.end(1),n=Mt(t,St,{duration:i[0]}),n.start()}),s=!0)},o(r){n&&n.invalidate(),r&&(o=rn(t,St,{duration:i[1]})),s=!1},d(r){r&&L(t),r&&o&&o.end()}}}function Qp(i){let t,e=i[2]&&ar(i);return{c(){e&&e.c(),t=ge()},m(n,o){e&&e.m(n,o),M(n,t,o)},p(n,[o]){n[2]?e?(e.p(n,o),o&4&&P(e,1)):(e=ar(n),e.c(),P(e,1),e.m(t.parentNode,t)):e&&(se(),D(e,1,1,()=>{e=null}),re())},i(n){P(e)},o(n){D(e)},d(n){e&&e.d(n),n&&L(t)}}}function Ne(i){return typeof i=="number"?i/16+"rem":i}function Fp(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 ot extends oe{constructor(t){super(),ie(this,t,Fp,Qp,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},Rp)}}function Hp(){return Math.random().toString(36).slice(-6)}const _i=Hp();function _p(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 lr(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 Gp(i){let t,e=i[0]+"",n,o=i[20];const s=()=>i[9](t,o),r=()=>i[9](null,o);return{c(){t=z("span"),n=xe(e),y(t,"class","text-char svelte-1b2n9wi")},m(a,l){M(a,t,l),V(t,n),s()},p(a,l){i=a,l&4&&e!==(e=i[0]+"")&&Me(n,e),o!==i[20]&&(r(),o=i[20],s())},d(a){a&&L(t),r()}}}function Wp(i){let t,e=i[20];const n=()=>i[8](t,e),o=()=>i[8](null,e);return{c(){t=z("span"),t.textContent="\xA0",y(t,"class","text-char svelte-1b2n9wi")},m(s,r){M(s,t,r),n()},p(s,r){i=s,e!==i[20]&&(o(),e=i[20],n())},d(s){s&&L(t),o()}}}function cr(i,t){let e,n;function o(a,l){return a[0]===a[3]?Wp:Gp}let s=o(t),r=s(t);return{key:i,first:null,c(){e=ge(),r.c(),n=ge(),this.first=e},m(a,l){M(a,e,l),r.m(a,l),M(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&&L(e),r.d(a),a&&L(n)}}}function Np(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=lr(i,o,r),l=s(a);e.set(l,t[r]=cr(l,a))}return{c(){for(let r=0;r<t.length;r+=1)t[r].c();n=ge()},m(r,a){for(let l=0;l<t.length;l+=1)t[l].m(r,a);M(r,n,a)},p(r,[a]){a&14&&(o=r[2],t=Ke(t,a,s,1,r,o,e,n.parentNode,Ao,cr,n,lr))},i:X,o:X,d(r){for(let a=0;a<t.length;a+=1)t[a].d(r);r&&L(n)}}}function Xp(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_${_i}__`,u=`__EMOJI_${_i}__`,h=`__SPACE_${_i}__`;let d,m,g=[];function p(C){const I=[],B=new RegExp(new RegExp("\\p{Regional_Indicator}\\p{Regional_Indicator}|\\p{Emoji}(\\p{Emoji_Modifier}+|\\uFE0F\\u20E3?)?(\\u200D\\p{Emoji}(\\p{Emoji_Modifier}+|\\uFE0F\\u20E3?)?)+|\\p{Emoji_Presentation}(\\p{Emoji_Modifier}+|\\uFE0F\\u20E3?)?|\\p{Emoji}(\\p{Emoji_Modifier}+|\\uFE0F\\u20E3?)","gu"));return C.slice().replace(B,x=>`${c}${u}${x}${c}`).split(c).forEach(x=>x.startsWith(u)?I.push({id:_e(),content:x.slice(u.length)}):I.push(...x.split("").map(H=>H===" "?h:H).map(H=>({id:_e(),content:H})))),I}function A(){if(!m)return;const C=!a;m.reversed!==C&&m.reverse(),m.play()}function v(C){if(l){e(4,l=!1);return}clearTimeout(d),d=setTimeout(A,C?o:s)}function b(C){const I=function(){const B=Ip(x=>C[x].getBoundingClientRect().x,[Math.min(C.length-1,10),Math.min(C.length-1,30)]);if(B>0)return B}();m=Vo.default({targets:C.slice(0,I).filter(Zt),autoplay:!1,duration:400,scale:[.7,1],rotate:[20,0],opacity:[0,1],translateX:[4,0],translateY:[10,0],delay:Vo.default.stagger(50),easing:"easeInOutCubic"}),a&&m.seek(m.duration)}function w(C,I){Ve[C?"unshift":"push"](()=>{g[I]=C,e(1,g)})}function k(C,I){Ve[C?"unshift":"push"](()=>{g[I]=C,e(1,g)})}return i.$$set=C=>{"inDelay"in C&&e(5,o=C.inDelay),"outDelay"in C&&e(6,s=C.outDelay),"content"in C&&e(0,r=C.content),"unfolded"in C&&e(7,a=C.unfolded),"isFistUnfoldedUpdate"in C&&e(4,l=C.isFistUnfoldedUpdate)},i.$$.update=()=>{i.$$.dirty&1&&e(2,n=p(r)),i.$$.dirty&128&&v(a),i.$$.dirty&2&&b(g.filter(C=>!!C))},[r,g,n,h,l,o,s,a,w,k]}class jl extends oe{constructor(t){super(),ie(this,t,Xp,Np,ne,{inDelay:5,outDelay:6,content:0,unfolded:7,isFistUnfoldedUpdate:4},_p)}}const Yp="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAYAAADFw8lbAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAKqADAAQAAAABAAAAKgAAAADUGqULAAAB0ElEQVRYCe2WSUoEQRBFLVHEiVZU1I03cKW38SSewRt4A5fiTty5cQIFR9pZQWkcUNSe2/Z9yISiSGxRkUAy4BGZSVX168gistraYsQKxArECsQKxApYqkDyU5lmsznMM+ZgAGpQhaUkSRbINgLJCXiCBtSgAkVYtGGIBTKj8AgKSVahDNvQa0IUkUG4Bx91BpLdBTOS/cgUIB3a+gMwI9mFzE3a0I3z5B4r292JzGVA8tSSZILMcUDyzIykthOZvYDk+V9Ktmz4yGzhOhV4/+5YU4N/hzqo0StX3Fg5TcnNlYvgs8bPsM4hkScHoyO46haRnGEYktQVI+4ypUYKyXtxyUu27JCceAMJvjo0HoM5CEZ7cPX7i013q3IWVV5r2aw/2TK+svWbPGU68KQCa6pYeus1V0X99quSfvtVSc39lmfz2mdbz32tg1dAJ0421AVs9E7/FxBSezrMmjI/gm5/nYmMkBq+TqBs7LNgTlZH6EnWlPmORdk+pHQipUNfTxtg7p3NIXWRMvXfoqusmXsNhpC6crIS1Zf9C6yAOdlxpK5BW18CiT7A/G93gE+P0FY/RoO+RWqS62YhB2r4YhlixArECsQKxArECvzjCnwAOr0wF44ggHAAAAAASUVORK5CYII=",Up="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAWgAAACoCAMAAAD6pITnAAABQVBMVEUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACvr68AAAAAAAAAAAB5eXkAAAA8PDzr6+sLCwuenp4UFBT////8/PyLi4umpqZycnKxsbHMzMykpKTy8vKoqKhcXFwpKSmwsLD+/v7k5OSCgoLw8PDo6O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YeRHiIlA2DVi1qkRtK8PSULaEDF+Ue7ashwkTlf8DQc/cITdx9+UAAAAASUVORK5CYII=",Jp="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 Zp(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 ur(i){let t,e,n,o,s,r,a,l,c,u;return e=new ot({props:{center:!0,blurRadius:9,spreadRadius:3}}),{c(){t=z("div"),K(e.$$.fragment),n=$(),o=z("div"),y(o,"class",s="arrow "+i[0]+" svelte-1ogmlqq"),T(o,"background-image","url("+Yp+")"),y(t,"class","arrow-wrapper svelte-1ogmlqq")},m(h,d){M(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||(P(e.$$.fragment,h),h&&Qe(()=>{a&&a.end(1),r=Mt(o,St,{duration:i[2],delay:i[3],easing:Xt}),r.start()}),l=!0)},o(h){D(e.$$.fragment,h),r&&r.invalidate(),h&&(a=rn(o,St,{duration:i[2],delay:i[4],easing:Xt})),l=!1},d(h){h&&L(t),Z(e),h&&a&&a.end(),c=!1,u()}}}function Kp(i){let t,e,n=i[1]&&ur(i);return{c(){n&&n.c(),t=ge()},m(o,s){n&&n.m(o,s),M(o,t,s),e=!0},p(o,[s]){o[1]?n?(n.p(o,s),s&2&&P(n,1)):(n=ur(o),n.c(),P(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(P(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&L(t)}}}function $p(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){sn.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 e0 extends oe{constructor(t){super(),ie(this,t,$p,Kp,ne,{direction:0,visible:1,duration:2,inDelay:3,outDelay:4},Zp)}}function t0(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 n0(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 dr(i){let t,e,n;return e=new jl({props:{unfolded:i[0],content:i[1],inDelay:500,outDelay:i[5]}}),{c(){t=z("div"),K(e.$$.fragment),y(t,"class","text svelte-1fuzm7v"),T(t,"transform",i[7])},m(o,s){M(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&&T(t,"transform",o[7])},i(o){n||(P(e.$$.fragment,o),n=!0)},o(o){D(e.$$.fragment,o),n=!1},d(o){o&&L(t),Z(e),i[10](null)}}}function hr(i){let t,e,n;return e=new e0({props:{direction:i[6],visible:i[0],inDelay:600,duration:1e3}}),{c(){t=z("div"),K(e.$$.fragment),y(t,"class","arrow svelte-1fuzm7v")},m(o,s){M(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||(P(e.$$.fragment,o),n=!0)},o(o){D(e.$$.fragment,o),n=!1},d(o){o&&L(t),Z(e)}}}function i0(i){let t,e,n,o=i[1]&&dr(i),s=i[3]<i[4]&&hr(i);return{c(){o&&o.c(),t=$(),s&&s.c(),e=ge()},m(r,a){o&&o.m(r,a),M(r,t,a),s&&s.m(r,a),M(r,e,a),n=!0},p(r,[a]){r[1]?o?(o.p(r,a),a&2&&P(o,1)):(o=dr(r),o.c(),P(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&&P(s,1)):(s=hr(r),s.c(),P(s,1),s.m(e.parentNode,e)):s&&(se(),D(s,1,1,()=>{s=null}),re())},i(r){n||(P(o),P(s),n=!0)},o(r){D(o),D(s),n=!1},d(r){o&&o.d(r),r&&L(t),s&&s.d(r),r&&L(e)}}}function o0(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),t0(()=>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 Ol extends oe{constructor(t){super(),ie(this,t,o0,i0,ne,{visible:0,textUnfolded:8,content:1},n0)}}function s0(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 fr(i){var u,h;let t,e,n,o,s,r,a,l,c;return t=new ot({props:{visible:i[2],left:i[3]/2+"px",bottom:12,width:2,blurRadius:120,spreadRadius:60}}),n=new xo({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 Ol({props:{visible:i[2],textUnfolded:i[1],content:i[5]}}),{c(){K(t.$$.fragment),e=$(),K(n.$$.fragment),o=$(),s=z("div"),K(r.$$.fragment),y(s,"class","content svelte-nlvd3x")},m(d,m){J(t,d,m),M(d,e,m),J(n,d,m),M(d,o,m),M(d,s,m),J(r,s,null),a=!0,l||(c=[ct(an.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||(P(t.$$.fragment,d),P(n.$$.fragment,d),P(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&&L(e),Z(n,d),d&&L(o),d&&L(s),Z(r),l=!1,Ge(c)}}}function r0(i){let t,e,n=i[0].state&&fr(i);return{c(){n&&n.c(),t=ge()},m(o,s){n&&n.m(o,s),M(o,t,s),e=!0},p(o,[s]){o[0].state?n?(n.p(o,s),s&1&&P(n,1)):(n=fr(o),n.c(),P(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(P(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&L(t)}}}function a0(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 l0 extends oe{constructor(t){super(),ie(this,t,a0,r0,ne,{tag:0},s0)}}function it(i){return typeof i=="number"?i/16+"rem":i}function c0(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 u0(i){let t;const e=i[6].default,n=en(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)&&nn(n,e,o,o[5],t?tn(e,o[5],s,null):on(o[5]),null)},i(o){t||(P(n,o),t=!0)},o(o){D(n,o),t=!1},d(o){n&&n.d(o)}}}function d0(i){var s,r;let t,e,n=((s=i[3])==null?void 0:s.inputting)&&mr(),o=((r=i[3])==null?void 0:r.placeholder)&&gr(i);return{c(){n&&n.c(),t=$(),o&&o.c(),e=ge()},m(a,l){n&&n.m(a,l),M(a,t,l),o&&o.m(a,l),M(a,e,l)},p(a,l){var c,u;(c=a[3])!=null&&c.inputting?n||(n=mr(),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=gr(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&&L(t),o&&o.d(a),a&&L(e)}}}function h0(i){let t;return{c(){t=xe(i[2])},m(e,n){M(e,t,n)},p(e,n){n&4&&Me(t,e[2])},i:X,o:X,d(e){e&&L(t)}}}function mr(i){let t;return{c(){t=z("div"),y(t,"class","caret svelte-i9wdo4")},m(e,n){M(e,t,n)},d(e){e&&L(t)}}}function gr(i){let t,e=i[3].placeholder+"",n;return{c(){t=z("span"),n=xe(e),y(t,"class","placeholder svelte-i9wdo4")},m(o,s){M(o,t,s),V(t,n)},p(o,s){s&8&&e!==(e=o[3].placeholder+"")&&Me(n,e)},d(o){o&&L(t)}}}function f0(i){let t,e,n,o;const s=[h0,d0,u0],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=z("div"),n.c(),y(t,"class","text svelte-i9wdo4"),T(t,"max-width",typeof i[1]=="number"?it(i[1]):i[1]),T(t,"-webkit-line-clamp",i[0])},m(l,c){M(l,t,c),r[e].m(t,null),o=!0},p(l,[c]){let u=e;e=a(l),e===u?r[e].p(l,c):(se(),D(r[u],1,1,()=>{r[u]=null}),re(),n=r[e],n?n.p(l,c):(n=r[e]=s[e](l),n.c()),P(n,1),n.m(t,null)),c&2&&T(t,"max-width",typeof l[1]=="number"?it(l[1]):l[1]),c&1&&T(t,"-webkit-line-clamp",l[0])},i(l){o||(P(n),o=!0)},o(l){D(n),o=!1},d(l){l&&L(t),r[e].d()}}}function m0(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 Do extends oe{constructor(t){super(),ie(this,t,m0,f0,ne,{maxLine:0,maxWidth:1,text:2,edit:3},c0)}}function g0(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 pr(i){var h,d;let t,e,n,o,s,r,a,l,c;t=new xo({props:{unfolded:i[1],direction:"vertical",length:15,duration:500,inDelay:200,useLinearColor:!0}}),a=new Do({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))&&Ar(i);return{c(){K(t.$$.fragment),e=$(),n=z("div"),o=z("div"),s=z("div"),r=z("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"),T(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),M(m,e,g),M(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&&P(u,1)):(u=Ar(m),u.c(),P(u,1),u.m(s,null)):u&&(se(),D(u,1,1,()=>{u=null}),re()),g&2&&T(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||(P(t.$$.fragment,m),P(a.$$.fragment,m),P(u),c=!0)},o(m){D(t.$$.fragment,m),D(a.$$.fragment,m),D(u),c=!1},d(m){Z(t,m),m&&L(e),m&&L(n),Z(a),u&&u.d()}}}function Ar(i){var o;let t,e,n;return e=new Do({props:{text:i[0].data.description,edit:(o=i[0].data.edit)==null?void 0:o.description,maxLine:3}}),{c(){t=z("div"),K(e.$$.fragment),y(t,"class","description svelte-1oxrkr1")},m(s,r){M(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||(P(e.$$.fragment,s),n=!0)},o(s){D(e.$$.fragment,s),n=!1},d(s){s&&L(t),Z(e)}}}function p0(i){let t,e,n=i[0].state&&pr(i);return{c(){n&&n.c(),t=ge()},m(o,s){n&&n.m(o,s),M(o,t,s),e=!0},p(o,[s]){o[0].state?n?(n.p(o,s),s&1&&P(n,1)):(n=pr(o),n.c(),P(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(P(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&L(t)}}}function A0(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 v0 extends oe{constructor(t){super(),ie(this,t,A0,p0,ne,{tag:0},g0)}}function b0(i){let t,e;return t=new v0({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||(P(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function y0(i){let t,e;return t=new l0({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||(P(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function w0(i){let t,e,n,o;const s=[y0,b0],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=ge()},m(l,c){~t&&r[t].m(l,c),M(l,n,c),o=!0},p(l,[c]){let u=t;t=a(l),t===u?~t&&r[t].p(l,c):(e&&(se(),D(r[u],1,1,()=>{r[u]=null}),re()),~t?(e=r[t],e?e.p(l,c):(e=r[t]=s[t](l),e.c()),P(e,1),e.m(n.parentNode,n)):e=null)},i(l){o||(P(e),o=!0)},o(l){D(e),o=!1},d(l){~t&&r[t].d(l),l&&L(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 E0 extends oe{constructor(t){super(),ie(this,t,C0,w0,ne,{tag:0})}}function P0(i){le(i,"svelte-blgtit",".line.svelte-blgtit{width:100%;height:100%;overflow:visible;pointer-events:none}")}function vr(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){M(s,t,r),o=!0},p(s,r){i=s},i(s){o||(s&&Qe(()=>{n&&n.end(1),e=Mt(t,ui,{duration:i[1],delay:i[0],easing:il}),e.start()}),o=!0)},o(s){e&&e.invalidate(),s&&(n=rn(t,ui,{duration:i[1],delay:i[2],easing:Xt})),o=!1},d(s){s&&L(t),s&&n&&n.end()}}}function I0(i){let t,e,n,o,s,r=i[3]&&vr(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){M(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&&P(r,1)):(r=vr(a),r.c(),P(r,1),r.m(t,null)):r&&(se(),D(r,1,1,()=>{r=null}),re())},i(a){P(r)},o(a){D(r)},d(a){a&&L(t),r&&r.d()}}}function k0(i,t,e){let{inDelay:n=0}=t,{duration:o=1e3}=t,{outDelay:s=0}=t,{unfolded:r}=t;const a=_e();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 x0 extends oe{constructor(t){super(),ie(this,t,k0,I0,ne,{inDelay:0,duration:1,outDelay:2,unfolded:3},P0)}}function D0(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
|
|
624
|
+
`))&&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&&Fe(()=>{o&&o.end(1),n=Mt(t,St,{duration:i[0]}),n.start()}),s=!0)},o(r){n&&n.invalidate(),r&&(o=rn(t,St,{duration:i[1]})),s=!1},d(r){r&&L(t),r&&o&&o.end()}}}function Fp(i){let t,e=i[2]&&ar(i);return{c(){e&&e.c(),t=ge()},m(n,o){e&&e.m(n,o),M(n,t,o)},p(n,[o]){n[2]?e?(e.p(n,o),o&4&&P(e,1)):(e=ar(n),e.c(),P(e,1),e.m(t.parentNode,t)):e&&(se(),D(e,1,1,()=>{e=null}),re())},i(n){P(e)},o(n){D(e)},d(n){e&&e.d(n),n&&L(t)}}}function Ne(i){return typeof i=="number"?i/16+"rem":i}function Qp(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 ot extends oe{constructor(t){super(),ie(this,t,Qp,Fp,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},Rp)}}function Hp(){return Math.random().toString(36).slice(-6)}const _i=Hp();function _p(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 lr(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 Gp(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){M(a,t,l),V(t,n),s()},p(a,l){i=a,l&4&&e!==(e=i[0]+"")&&Me(n,e),o!==i[20]&&(r(),o=i[20],s())},d(a){a&&L(t),r()}}}function Wp(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){M(s,t,r),n()},p(s,r){i=s,e!==i[20]&&(o(),e=i[20],n())},d(s){s&&L(t),o()}}}function cr(i,t){let e,n;function o(a,l){return a[0]===a[3]?Wp:Gp}let s=o(t),r=s(t);return{key:i,first:null,c(){e=ge(),r.c(),n=ge(),this.first=e},m(a,l){M(a,e,l),r.m(a,l),M(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&&L(e),r.d(a),a&&L(n)}}}function Np(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=lr(i,o,r),l=s(a);e.set(l,t[r]=cr(l,a))}return{c(){for(let r=0;r<t.length;r+=1)t[r].c();n=ge()},m(r,a){for(let l=0;l<t.length;l+=1)t[l].m(r,a);M(r,n,a)},p(r,[a]){a&14&&(o=r[2],t=Ke(t,a,s,1,r,o,e,n.parentNode,Ao,cr,n,lr))},i:Y,o:Y,d(r){for(let a=0;a<t.length;a+=1)t[a].d(r);r&&L(n)}}}function Xp(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_${_i}__`,u=`__EMOJI_${_i}__`,h=`__SPACE_${_i}__`;let d,m,g=[];function p(I){const C=[],T=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(T,x=>`${c}${u}${x}${c}`).split(c).forEach(x=>x.startsWith(u)?C.push({id:_e(),content:x.slice(u.length)}):C.push(...x.split("").map(H=>H===" "?h:H).map(H=>({id:_e(),content:H})))),C}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 C=function(){const T=Ip(x=>I[x].getBoundingClientRect().x,[Math.min(I.length-1,10),Math.min(I.length-1,30)]);if(T>0)return T}();m=Vo.default({targets:I.slice(0,C).filter(Zt),autoplay:!1,duration:400,scale:[.7,1],rotate:[20,0],opacity:[0,1],translateX:[4,0],translateY:[10,0],delay:Vo.default.stagger(50),easing:"easeInOutCubic"}),a&&m.seek(m.duration)}function w(I,C){Ve[I?"unshift":"push"](()=>{g[C]=I,e(1,g)})}function k(I,C){Ve[I?"unshift":"push"](()=>{g[C]=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 jl extends oe{constructor(t){super(),ie(this,t,Xp,Np,ne,{inDelay:5,outDelay:6,content:0,unfolded:7,isFistUnfoldedUpdate:4},_p)}}const Yp="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACoAAAAqCAYAAADFw8lbAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAKqADAAQAAAABAAAAKgAAAADUGqULAAAB0ElEQVRYCe2WSUoEQRBFLVHEiVZU1I03cKW38SSewRt4A5fiTty5cQIFR9pZQWkcUNSe2/Z9yISiSGxRkUAy4BGZSVX168gistraYsQKxArECsQKxApYqkDyU5lmsznMM+ZgAGpQhaUkSRbINgLJCXiCBtSgAkVYtGGIBTKj8AgKSVahDNvQa0IUkUG4Bx91BpLdBTOS/cgUIB3a+gMwI9mFzE3a0I3z5B4r292JzGVA8tSSZILMcUDyzIykthOZvYDk+V9Ktmz4yGzhOhV4/+5YU4N/hzqo0StX3Fg5TcnNlYvgs8bPsM4hkScHoyO46haRnGEYktQVI+4ypUYKyXtxyUu27JCceAMJvjo0HoM5CEZ7cPX7i013q3IWVV5r2aw/2TK+svWbPGU68KQCa6pYeus1V0X99quSfvtVSc39lmfz2mdbz32tg1dAJ0421AVs9E7/FxBSezrMmjI/gm5/nYmMkBq+TqBs7LNgTlZH6EnWlPmORdk+pHQipUNfTxtg7p3NIXWRMvXfoqusmXsNhpC6crIS1Zf9C6yAOdlxpK5BW18CiT7A/G93gE+P0FY/RoO+RWqS62YhB2r4YhlixArECsQKxArECvzjCnwAOr0wF44ggHAAAAAASUVORK5CYII=",Up="data:image/png;base64,iVBORw0K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gYX5RXG2HnYZXtouzNRzXE3R0KE6jWjZU2iaZ9u8pqpU3UfvwrYSgSBVDtGDurBlHn/zj0QMIh7qlDNOfmcBj9ihKo9o+l1euiWGxSE5eun3na6jxQk3joEgdQ7TR+FWutE43lhQpph3sQvISAVRa9ppRzipY4gZqdw8/WigIWDWt1gD8EIsqSLlT/KPUVlKSAujs2XTLYeRHiIlA2DVi1qkRtK8PSULaEDF+Ue7ashwkTlf8DQc/cITdx9+UAAAAASUVORK5CYII=",Jp="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 Zp(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 ur(i){let t,e,n,o,s,r,a,l,c,u;return e=new ot({props:{center:!0,blurRadius:9,spreadRadius:3}}),{c(){t=B("div"),K(e.$$.fragment),n=ee(),o=B("div"),y(o,"class",s="arrow "+i[0]+" svelte-1ogmlqq"),z(o,"background-image","url("+Yp+")"),y(t,"class","arrow-wrapper svelte-1ogmlqq")},m(h,d){M(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||(P(e.$$.fragment,h),h&&Fe(()=>{a&&a.end(1),r=Mt(o,St,{duration:i[2],delay:i[3],easing:Xt}),r.start()}),l=!0)},o(h){D(e.$$.fragment,h),r&&r.invalidate(),h&&(a=rn(o,St,{duration:i[2],delay:i[4],easing:Xt})),l=!1},d(h){h&&L(t),Z(e),h&&a&&a.end(),c=!1,u()}}}function Kp(i){let t,e,n=i[1]&&ur(i);return{c(){n&&n.c(),t=ge()},m(o,s){n&&n.m(o,s),M(o,t,s),e=!0},p(o,[s]){o[1]?n?(n.p(o,s),s&2&&P(n,1)):(n=ur(o),n.c(),P(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(P(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&L(t)}}}function $p(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){sn.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 e0 extends oe{constructor(t){super(),ie(this,t,$p,Kp,ne,{direction:0,visible:1,duration:2,inDelay:3,outDelay:4},Zp)}}function t0(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 n0(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 dr(i){let t,e,n;return e=new jl({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){M(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||(P(e.$$.fragment,o),n=!0)},o(o){D(e.$$.fragment,o),n=!1},d(o){o&&L(t),Z(e),i[10](null)}}}function hr(i){let t,e,n;return e=new e0({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){M(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||(P(e.$$.fragment,o),n=!0)},o(o){D(e.$$.fragment,o),n=!1},d(o){o&&L(t),Z(e)}}}function i0(i){let t,e,n,o=i[1]&&dr(i),s=i[3]<i[4]&&hr(i);return{c(){o&&o.c(),t=ee(),s&&s.c(),e=ge()},m(r,a){o&&o.m(r,a),M(r,t,a),s&&s.m(r,a),M(r,e,a),n=!0},p(r,[a]){r[1]?o?(o.p(r,a),a&2&&P(o,1)):(o=dr(r),o.c(),P(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&&P(s,1)):(s=hr(r),s.c(),P(s,1),s.m(e.parentNode,e)):s&&(se(),D(s,1,1,()=>{s=null}),re())},i(r){n||(P(o),P(s),n=!0)},o(r){D(o),D(s),n=!1},d(r){o&&o.d(r),r&&L(t),s&&s.d(r),r&&L(e)}}}function o0(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),t0(()=>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 Ol extends oe{constructor(t){super(),ie(this,t,o0,i0,ne,{visible:0,textUnfolded:8,content:1},n0)}}function s0(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 fr(i){var u,h;let t,e,n,o,s,r,a,l,c;return t=new ot({props:{visible:i[2],left:i[3]/2+"px",bottom:12,width:2,blurRadius:120,spreadRadius:60}}),n=new xo({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 Ol({props:{visible:i[2],textUnfolded:i[1],content:i[5]}}),{c(){K(t.$$.fragment),e=ee(),K(n.$$.fragment),o=ee(),s=B("div"),K(r.$$.fragment),y(s,"class","content svelte-nlvd3x")},m(d,m){J(t,d,m),M(d,e,m),J(n,d,m),M(d,o,m),M(d,s,m),J(r,s,null),a=!0,l||(c=[ct(an.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||(P(t.$$.fragment,d),P(n.$$.fragment,d),P(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&&L(e),Z(n,d),d&&L(o),d&&L(s),Z(r),l=!1,Ge(c)}}}function r0(i){let t,e,n=i[0].state&&fr(i);return{c(){n&&n.c(),t=ge()},m(o,s){n&&n.m(o,s),M(o,t,s),e=!0},p(o,[s]){o[0].state?n?(n.p(o,s),s&1&&P(n,1)):(n=fr(o),n.c(),P(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(P(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&L(t)}}}function a0(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 l0 extends oe{constructor(t){super(),ie(this,t,a0,r0,ne,{tag:0},s0)}}function it(i){return typeof i=="number"?i/16+"rem":i}function c0(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 u0(i){let t;const e=i[6].default,n=en(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)&&nn(n,e,o,o[5],t?tn(e,o[5],s,null):on(o[5]),null)},i(o){t||(P(n,o),t=!0)},o(o){D(n,o),t=!1},d(o){n&&n.d(o)}}}function d0(i){var s,r;let t,e,n=((s=i[3])==null?void 0:s.inputting)&&mr(),o=((r=i[3])==null?void 0:r.placeholder)&&gr(i);return{c(){n&&n.c(),t=ee(),o&&o.c(),e=ge()},m(a,l){n&&n.m(a,l),M(a,t,l),o&&o.m(a,l),M(a,e,l)},p(a,l){var c,u;(c=a[3])!=null&&c.inputting?n||(n=mr(),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=gr(a),o.c(),o.m(e.parentNode,e)):o&&(o.d(1),o=null)},i:Y,o:Y,d(a){n&&n.d(a),a&&L(t),o&&o.d(a),a&&L(e)}}}function h0(i){let t;return{c(){t=xe(i[2])},m(e,n){M(e,t,n)},p(e,n){n&4&&Me(t,e[2])},i:Y,o:Y,d(e){e&&L(t)}}}function mr(i){let t;return{c(){t=B("div"),y(t,"class","caret svelte-i9wdo4")},m(e,n){M(e,t,n)},d(e){e&&L(t)}}}function gr(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){M(o,t,s),V(t,n)},p(o,s){s&8&&e!==(e=o[3].placeholder+"")&&Me(n,e)},d(o){o&&L(t)}}}function f0(i){let t,e,n,o;const s=[h0,d0,u0],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"?it(i[1]):i[1]),z(t,"-webkit-line-clamp",i[0])},m(l,c){M(l,t,c),r[e].m(t,null),o=!0},p(l,[c]){let u=e;e=a(l),e===u?r[e].p(l,c):(se(),D(r[u],1,1,()=>{r[u]=null}),re(),n=r[e],n?n.p(l,c):(n=r[e]=s[e](l),n.c()),P(n,1),n.m(t,null)),c&2&&z(t,"max-width",typeof l[1]=="number"?it(l[1]):l[1]),c&1&&z(t,"-webkit-line-clamp",l[0])},i(l){o||(P(n),o=!0)},o(l){D(n),o=!1},d(l){l&&L(t),r[e].d()}}}function m0(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 Do extends oe{constructor(t){super(),ie(this,t,m0,f0,ne,{maxLine:0,maxWidth:1,text:2,edit:3},c0)}}function g0(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 pr(i){var h,d;let t,e,n,o,s,r,a,l,c;t=new xo({props:{unfolded:i[1],direction:"vertical",length:15,duration:500,inDelay:200,useLinearColor:!0}}),a=new Do({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))&&Ar(i);return{c(){K(t.$$.fragment),e=ee(),n=B("div"),o=B("div"),s=B("div"),r=B("div"),K(a.$$.fragment),l=ee(),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),M(m,e,g),M(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&&P(u,1)):(u=Ar(m),u.c(),P(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||(P(t.$$.fragment,m),P(a.$$.fragment,m),P(u),c=!0)},o(m){D(t.$$.fragment,m),D(a.$$.fragment,m),D(u),c=!1},d(m){Z(t,m),m&&L(e),m&&L(n),Z(a),u&&u.d()}}}function Ar(i){var o;let t,e,n;return e=new Do({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){M(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||(P(e.$$.fragment,s),n=!0)},o(s){D(e.$$.fragment,s),n=!1},d(s){s&&L(t),Z(e)}}}function p0(i){let t,e,n=i[0].state&&pr(i);return{c(){n&&n.c(),t=ge()},m(o,s){n&&n.m(o,s),M(o,t,s),e=!0},p(o,[s]){o[0].state?n?(n.p(o,s),s&1&&P(n,1)):(n=pr(o),n.c(),P(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(P(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&L(t)}}}function A0(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 v0 extends oe{constructor(t){super(),ie(this,t,A0,p0,ne,{tag:0},g0)}}function b0(i){let t,e;return t=new v0({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||(P(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function y0(i){let t,e;return t=new l0({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||(P(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function w0(i){let t,e,n,o;const s=[y0,b0],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=ge()},m(l,c){~t&&r[t].m(l,c),M(l,n,c),o=!0},p(l,[c]){let u=t;t=a(l),t===u?~t&&r[t].p(l,c):(e&&(se(),D(r[u],1,1,()=>{r[u]=null}),re()),~t?(e=r[t],e?e.p(l,c):(e=r[t]=s[t](l),e.c()),P(e,1),e.m(n.parentNode,n)):e=null)},i(l){o||(P(e),o=!0)},o(l){D(e),o=!1},d(l){~t&&r[t].d(l),l&&L(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 E0 extends oe{constructor(t){super(),ie(this,t,C0,w0,ne,{tag:0})}}function P0(i){le(i,"svelte-blgtit",".line.svelte-blgtit{width:100%;height:100%;overflow:visible;pointer-events:none}")}function vr(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){M(s,t,r),o=!0},p(s,r){i=s},i(s){o||(s&&Fe(()=>{n&&n.end(1),e=Mt(t,ui,{duration:i[1],delay:i[0],easing:il}),e.start()}),o=!0)},o(s){e&&e.invalidate(),s&&(n=rn(t,ui,{duration:i[1],delay:i[2],easing:Xt})),o=!1},d(s){s&&L(t),s&&n&&n.end()}}}function I0(i){let t,e,n,o,s,r=i[3]&&vr(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){M(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&&P(r,1)):(r=vr(a),r.c(),P(r,1),r.m(t,null)):r&&(se(),D(r,1,1,()=>{r=null}),re())},i(a){P(r)},o(a){D(r)},d(a){a&&L(t),r&&r.d()}}}function k0(i,t,e){let{inDelay:n=0}=t,{duration:o=1e3}=t,{outDelay:s=0}=t,{unfolded:r}=t;const a=_e();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 x0 extends oe{constructor(t){super(),ie(this,t,k0,I0,ne,{inDelay:0,duration:1,outDelay:2,unfolded:3},P0)}}function D0(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
|
|
608
625
|
height var(--sc-dot-size-animation-time) ease,\r
|
|
609
|
-
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 L0(i){let t,e,n;return{c(){t=z("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){M(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&&L(t),e=!1,n()}}}function S0(i,t,e){let{active:n=!1}=t;function o(s){sn.call(this,i,s)}return i.$$set=s=>{"active"in s&&e(0,n=s.active)},[n,o]}class M0 extends oe{constructor(t){super(),ie(this,t,S0,L0,ne,{active:0},D0)}}function T0(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 br(i,t,e){const n=i.slice();return n[5]=t[e],n[7]=e,n}function yr(i,t){let e,n,o,s;function r(){return t[3](t[7])}return n=new M0({props:{active:t[1]===t[7]}}),n.$on("click",r),{key:i,first:null,c(){e=z("div"),K(n.$$.fragment),o=$(),y(e,"class","sc-carousel-dots__dot-container svelte-670fde"),this.first=e},m(a,l){M(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||(P(n.$$.fragment,a),s=!0)},o(a){D(n.$$.fragment,a),s=!1},d(a){a&&L(e),Z(n)}}}function z0(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=br(i,s,a),c=r(l);n.set(c,e[a]=yr(c,l))}return{c(){t=z("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){M(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,Pt,yr,null,br),re())},i(a){if(!o){for(let l=0;l<s.length;l+=1)P(e[l]);o=!0}},o(a){for(let l=0;l<e.length;l+=1)D(e[l]);o=!1},d(a){a&&L(t);for(let l=0;l<e.length;l+=1)e[l].d()}}}function B0(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 V0 extends oe{constructor(t){super(),ie(this,t,B0,z0,ne,{pagesCount:0,currentPageIndex:1},T0)}}const qt="prev",wt="next";function j0(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 O0(i){let t,e,n,o;return{c(){t=z("button"),e=z("i"),y(e,"class","sc-carousel-arrow__arrow svelte-1bftafx"),q(e,"sc-carousel-arrow__arrow-next",i[0]===wt),q(e,"sc-carousel-arrow__arrow-prev",i[0]===qt),y(t,"class","sc-carousel-button sc-carousel-arrow__circle svelte-1bftafx"),q(t,"sc-carousel-arrow__circle_disabled",i[1])},m(s,r){M(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]===wt),r&1&&q(e,"sc-carousel-arrow__arrow-prev",s[0]===qt),r&2&&q(t,"sc-carousel-arrow__circle_disabled",s[1])},i:X,o:X,d(s){s&&L(t),n=!1,o()}}}function R0(i,t,e){let{direction:n=wt}=t,{disabled:o=!1}=t;function s(r){sn.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 Rl extends oe{constructor(t){super(),ie(this,t,R0,O0,ne,{direction:0,disabled:1},j0)}}function Q0(i){le(i,"svelte-i7yfid",".sc-carousel-progress__indicator.svelte-i7yfid{height:100%;background-color:var(--sc-color-hex-dark-50p)}")}function F0(i){let t;return{c(){t=z("div"),y(t,"class","sc-carousel-progress__indicator svelte-i7yfid"),T(t,"width",i[0]+"%")},m(e,n){M(e,t,n)},p(e,[n]){n&1&&T(t,"width",e[0]+"%")},i:X,o:X,d(e){e&&L(t)}}}const wr=100;function H0(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*wr,0),wr))},[n,o]}class _0 extends oe{constructor(t){super(),ie(this,t,H0,F0,ne,{value:1},Q0)}}function G0(i,t){i.addEventListener("mousedown",t),i.addEventListener("touchstart",t,{passive:!0})}function W0(i,t){i.removeEventListener("mousedown",t),i.removeEventListener("touchstart",t)}function N0(i,t){i.addEventListener("mouseup",t),i.addEventListener("touchend",t)}function Cr(i,t){i.removeEventListener("mouseup",t),i.removeEventListener("touchend",t)}function X0(i,t){i.addEventListener("mousemove",t),i.addEventListener("touchmove",t)}function Er(i,t){i.removeEventListener("mousemove",t),i.removeEventListener("touchmove",t)}function Lo(i){return function(t,e){i.dispatchEvent(new CustomEvent(t,{detail:e}))}}const Y0=110,U0=9,q0=111,J0=20;function Gi(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 Z0(i,{thresholdProvider:t}){const e=Lo(i);let n,o,s=0,r,a=!1;function l(){return Date.now()-r>=q0&&Math.abs(s)>=J0}function c(d){r=Date.now(),s=0,a=!0;const m=Gi(d);n=m.x,o=m.y,e("swipeStart",{x:n,y:o}),X0(window,u),N0(window,h)}function u(d){if(!a)return;const m=Gi(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?qt:wt}),Cr(window,h),Er(window,u))}function h(d){if(Cr(window,h),Er(window,u),a=!1,!l()){e("swipeFailed");return}const m=Gi(d);e("swipeEnd",{x:m.x,y:m.y})}return G0(i,c),{destroy(){W0(i,c)}}}function K0(i,t){i.addEventListener("mouseenter",t)}function $0(i,t){i.removeEventListener("mouseenter",t)}function eA(i,t){i.addEventListener("mouseleave",t)}function Pr(i,t){i.removeEventListener("mouseleave",t)}function tA(i){const t=Lo(i);function e(){eA(i,n),t("hovered",{value:!0})}function n(){t("hovered",{value:!1}),Pr(i,n)}return K0(i,e),{destroy(){$0(i,e),Pr(i,n)}}}const nA=(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 iA(i,t){i.addEventListener("touchstart",t,{passive:!0})}function oA(i,t){i.removeEventListener("touchstart",t)}function sA(i,t){i.addEventListener("touchend",t)}function Ir(i,t){i.removeEventListener("touchend",t)}function rA(i){const t=Lo(i);let e=0,n={x:0,y:0};function o({tapEndedAt:a,tapEndedPos:l}){const c=a-e,u=nA(n,l);return c<=Y0&&u<=U0}function s(a){e=Date.now();const l=a.touches[0];n={x:l.clientX,y:l.clientY},sA(i,r)}function r(a){Ir(i,r);const l=a.changedTouches[0];o({tapEndedAt:Date.now(),tapEndedPos:{x:l.clientX,y:l.clientY}})&&t("tapped")}return iA(i,s),{destroy(){oA(i,s),Ir(i,r)}}}function aA({currentParticleIndex:i,particlesCount:t,clonesCountHead:e,clonesCountTotal:n,particlesToScroll:o}){return i===t-e?0:i===0?Ql({particlesCountWithoutClones:t-n,particlesToScroll:o})-1:Math.floor((i-e)/o)}function lA({currentParticleIndex:i,particlesToScroll:t}){return Math.ceil(i/t)}function cA({currentParticleIndex:i,particlesCount:t,clonesCountHead:e,clonesCountTotal:n,infinite:o,particlesToScroll:s}){return o?aA({currentParticleIndex:i,particlesCount:t,clonesCountHead:e,clonesCountTotal:n,particlesToScroll:s}):lA({currentParticleIndex:i,particlesToScroll:s})}function Ql({particlesCountWithoutClones:i,particlesToScroll:t}){return Math.ceil(i/t)}function uA({particlesCountWithoutClones:i,particlesToScroll:t,particlesToShow:e}){const n=Fl({particlesCountWithoutClones:i,particlesToScroll:t,particlesToShow:e});return Math.ceil(i/t)-n}function dA({infinite:i,particlesCountWithoutClones:t,particlesToScroll:e,particlesToShow:n}){return i?Ql({particlesCountWithoutClones:t,particlesToScroll:e}):uA({particlesCountWithoutClones:t,particlesToScroll:e,particlesToShow:n})}function hA({pageIndex:i,clonesCountHead:t,clonesCountTail:e,particlesToScroll:n,particlesCount:o}){return _t(0,Math.min(t+i*n,o-e),o-1)}function fA({pageIndex:i,particlesToScroll:t,particlesCount:e,particlesToShow:n}){return _t(0,Math.min(i*t,e-n),e-1)}function Wi({infinite:i,pageIndex:t,clonesCountHead:e,clonesCountTail:n,particlesToScroll:o,particlesCount:s,particlesToShow:r}){return i?hA({pageIndex:t,clonesCountHead:e,clonesCountTail:n,particlesToScroll:o,particlesCount:s}):fA({pageIndex:t,particlesToScroll:o,particlesCount:s,particlesToShow:r})}function mA({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 Fl({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 gA(i){return new ResizeObserver(t=>{i({width:t[0].contentRect.width})})}function pA({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 AA({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 vA({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 vn=(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},lo=i=>t=>{i[t]&&i[t]()},bA=(i,t)=>Cc.default(i,t),yA=i=>Object.keys(i||{}),wA=(i,t)=>{const e={};return i.forEach(n=>{e[n]=t[n]}),e},CA=()=>{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=yA(s);if(a.includes(n)){const l=wA(a,e);bA(s,l)||(i[o].deps=l,r())}})}}},EA=()=>{let i=null;return{targetWatcher(t,e){i={watcherName:t,fn:e},i.fn(),i=null},getTarget(){return i}}};function PA(i,t){const e=Sn.default(i,"data",{}),n=Sn.default(i,"watch",{}),o=Sn.default(i,"methods",{}),s=Sn.default(t,"onChange",()=>{}),{subscribe:r,notify:a,subscribers:l}=CA(),{targetWatcher:c,getTarget:u}=EA();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(wc.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 IA({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 kA({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=>IA({pageIndex:h,particlesToShow:o,particlesToScroll:s,particlesCount:n}));return{pageIndexes:c,particleIndexes:[...new Set(u)].sort((h,d)=>h-d)}}const xA=(i,t)=>(i(),setInterval(i,t)),DA=35,kr=1;class LA{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(DA,Math.max(this._autoplayDuration,1));let o=-n;this._interval=xA(()=>_(this,null,function*(){if(this._paused)return;o+=n;const s=o/this._autoplayDuration;this._onProgressValueChange(s),s>kr&&(this.reset(),yield t(),e())}),n)})}pause(){this._paused=!0}resume(){this._paused=!1}reset(){clearInterval(this._interval),this._onProgressValueChange(kr)}}function SA(i){const t=new LA({onProgressValueChange:r=>{i("progressValue",1-r)}}),e=PA({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=kA({infinite:r.infinite,pageIndex:r.currentPageIndex,pagesCount:r.pagesCount,particlesCount:r.particlesCountWithoutClones,particlesToShow:r.particlesToShow,particlesToScroll:r.particlesToScroll}).particleIndexes},setCurrentPageIndex({data:r}){r.currentPageIndex=cA({currentParticleIndex:r.currentParticleIndex,particlesCount:r.particlesCount,clonesCountHead:r.clonesCountHead,clonesCountTotal:r.clonesCountTotal,infinite:r.infinite,particlesToScroll:r.particlesToScroll})},setPartialPageSize({data:r}){r.partialPageSize=Fl({particlesToScroll:r.particlesToScroll,particlesToShow:r.particlesToShow,particlesCountWithoutClones:r.particlesCountWithoutClones})},setClonesCount({data:r}){const{head:a,tail:l}=vA({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=dA({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=Wi({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=Wi({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 _(this,arguments,function*({data:r,methods:a}){if(!r.infinite&&(r.autoplayDirection===wt&&r.currentParticleIndex===r.particlesCount-1||r.autoplayDirection===qt&&r.currentParticleIndex===0)){t.reset();return}if(r.autoplay){const c=()=>lo({[wt]:()=>_(this,null,function*(){return a.showNextPage()}),[qt]:()=>_(this,null,function*(){return a.showPrevPage()})})(r.autoplayDirection);yield t.start(c)}})},_jumpIfNeeded(l){return _(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 _(this,arguments,function*({data:r,methods:a},l,c){if(t.reset(),r.disabled)return;r.disabled=!0,l(),yield a.offsetPage({animated:vn(c,"animated",!0)}),r.disabled=!1,!(yield a._jumpIfNeeded())&&a._applyAutoplayIfNeeded()})},showNextPage(c,u){return _(this,arguments,function*({data:r,methods:a},l){r.disabled||(yield a.changePage(a._next,l))})},showPrevPage(c,u){return _(this,arguments,function*({data:r,methods:a},l){r.disabled||(yield a.changePage(a._prev,l))})},showParticle(c,u,h){return _(this,arguments,function*({methods:r},a,l){yield r.changePage(()=>r._moveToParticle(a),l)})},_getParticleIndexByPageIndex({data:r},a){return Wi({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 _(this,arguments,function*({methods:r},a,l){const d=r._getParticleIndexByPageIndex(a);yield r.showParticle(d,l)})},offsetPage({data:r},a){const l=vn(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 MA(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 TA=i=>({currentPageIndex:i[0]&32,pagesCount:i[0]&1024,loaded:i[0]&64}),xr=i=>({currentPageIndex:i[5],pagesCount:i[10],showPage:i[15],loaded:i[6]}),zA=i=>({loaded:i[0]&64,currentPageIndex:i[0]&32}),Dr=i=>({showNextPage:i[14].showNextPage,loaded:i[6],currentPageIndex:i[5]}),BA=i=>({loaded:i[0]&64,currentPageIndex:i[0]&32}),Lr=i=>({loaded:i[6],currentPageIndex:i[5]}),VA=i=>({loaded:i[0]&64,currentPageIndex:i[0]&32}),Sr=i=>({showPrevPage:i[14].showPrevPage,loaded:i[6],currentPageIndex:i[5]});function Mr(i){let t;const e=i[37].prev,n=en(e,i,i[36],Sr),o=n||jA(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)&&nn(n,e,s,s[36],t?tn(e,s[36],r,VA):on(s[36]),Sr):o&&o.p&&(!t||r[0]&36)&&o.p(s,t?r:[-1,-1])},i(s){t||(P(o,s),t=!0)},o(s){D(o,s),t=!1},d(s){o&&o.d(s)}}}function jA(i){let t,e,n;return e=new Rl({props:{direction:"prev",disabled:!i[2]&&i[5]===0}}),e.$on("click",i[23]),{c(){t=z("div"),K(e.$$.fragment),y(t,"class","sc-carousel__arrow-container svelte-sme1z4")},m(o,s){M(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||(P(e.$$.fragment,o),n=!0)},o(o){D(e.$$.fragment,o),n=!1},d(o){o&&L(t),Z(e)}}}function Tr(i){let t,e,n;return e=new _0({props:{value:i[7]}}),{c(){t=z("div"),K(e.$$.fragment),y(t,"class","sc-carousel-progress__container svelte-sme1z4")},m(o,s){M(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||(P(e.$$.fragment,o),n=!0)},o(o){D(e.$$.fragment,o),n=!1},d(o){o&&L(t),Z(e)}}}function zr(i){let t;const e=i[37].next,n=en(e,i,i[36],Dr),o=n||OA(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)&&nn(n,e,s,s[36],t?tn(e,s[36],r,zA):on(s[36]),Dr):o&&o.p&&(!t||r[0]&1060)&&o.p(s,t?r:[-1,-1])},i(s){t||(P(o,s),t=!0)},o(s){D(o,s),t=!1},d(s){o&&o.d(s)}}}function OA(i){let t,e,n;return e=new Rl({props:{direction:"next",disabled:!i[2]&&i[5]===i[10]-1}}),e.$on("click",i[14].showNextPage),{c(){t=z("div"),K(e.$$.fragment),y(t,"class","sc-carousel__arrow-container svelte-sme1z4")},m(o,s){M(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||(P(e.$$.fragment,o),n=!0)},o(o){D(e.$$.fragment,o),n=!1},d(o){o&&L(t),Z(e)}}}function Br(i){let t;const e=i[37].dots,n=en(e,i,i[36],xr),o=n||RA(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)&&nn(n,e,s,s[36],t?tn(e,s[36],r,TA):on(s[36]),xr):o&&o.p&&(!t||r[0]&1056)&&o.p(s,t?r:[-1,-1])},i(s){t||(P(o,s),t=!0)},o(s){D(o,s),t=!1},d(s){o&&o.d(s)}}}function RA(i){let t,e;return t=new V0({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||(P(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function QA(i){let t,e,n,o,s,r,a,l,c,u,h,d,m=i[1]&&Mr(i);const g=i[37].default,p=en(g,i,i[36],Lr);let A=i[3]&&Tr(i),v=i[1]&&zr(i),b=i[4]&&Br(i);return{c(){t=z("div"),e=z("div"),m&&m.c(),n=$(),o=z("div"),s=z("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"),T(s,"transform","translateX("+i[8]+"px)"),T(s,"transition-duration",i[9]+"ms"),T(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){M(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=Z0.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(tA.call(null,o)),me(o,"hovered",i[21]),ct(rA.call(null,o)),me(o,"tapped",i[22])],h=!0)},p(w,k){w[1]?m?(m.p(w,k),k[0]&2&&P(m,1)):(m=Mr(w),m.c(),P(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)&&nn(p,g,w,w[36],u?tn(g,w[36],k,BA):on(w[36]),Lr),(!u||k[0]&256)&&T(s,"transform","translateX("+w[8]+"px)"),(!u||k[0]&512)&&T(s,"transition-duration",w[9]+"ms"),(!u||k[0]&1)&&T(s,"transition-timing-function",w[0]),r&&$t(r.update)&&k[0]&2048&&r.update.call(null,{thresholdProvider:w[38]}),w[3]?A?(A.p(w,k),k[0]&8&&P(A,1)):(A=Tr(w),A.c(),P(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&&P(v,1)):(v=zr(w),v.c(),P(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&&P(b,1)):(b=Br(w),b.c(),P(b,1),b.m(t,null)):b&&(se(),D(b,1,1,()=>{b=null}),re())},i(w){u||(P(m),P(p,w),P(A),P(v),P(b),u=!0)},o(w){D(m),D(p,w),D(A),D(v),D(b),u=!1},d(w){w&&L(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,Ge(d)}}}function FA(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]=SA((te,ve)=>{lo({currentPageIndex:()=>e(5,r=ve),progressValue:()=>e(7,a=ve),offset:()=>e(8,l=ve),durationMs:()=>e(9,c=ve),pagesCount:()=>e(10,u=ve),loaded:()=>e(6,s=ve)})(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:C=!1}=t,{autoplayDuration:I=3e3}=t,{autoplayDirection:B=wt}=t,{pauseOnFocus:x=!1}=t,{autoplayProgressVisible:H=!1}=t,{dots:N=!0}=t,{swiping:R=!0}=t,{particlesToShow:O=1}=t,{particlesToScroll:S=1}=t;function F(te,ve){return _(this,null,function*(){const je=vn(ve,"animated",!0);if(typeof te!="number")throw new Error("pageIndex should be a number");yield m.showPage(te,{animated:je})})}function G(te){return _(this,null,function*(){const ve=vn(te,"animated",!0);yield m.showPrevPage({animated:ve})})}function Y(te){return _(this,null,function*(){const ve=vn(te,"animated",!0);yield m.showNextPage({animated:ve})})}let W=0,ee,U;const ae=gA(({width:te})=>{e(11,W=te),h.particleWidth=W/h.particlesToShow,mA({particlesContainerChildren:U.children,particleWidth:h.particleWidth}),m.offsetPage({animated:!1})});function he(){const{clonesToAppend:te,clonesToPrepend:ve}=pA({clonesCountHead:h.clonesCountHead,clonesCountTail:h.clonesCountTail,particlesContainerChildren:U.children});AA({particlesContainer:U,clonesToAppend:te,clonesToPrepend:ve})}Ze(()=>{_(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))})}),Et(()=>{ae.disconnect(),d.reset()});function de(te){return _(this,null,function*(){yield m.showPage(te,{animated:!0})})}function pe(){!R||(h.durationMs=0)}function Pe(te){return _(this,null,function*(){!R||(yield lo({[wt]:m.showNextPage,[qt]:m.showPrevPage})(te.detail.direction))})}function ke(te){!R||(h.offset+=te.detail.dx)}function Te(){!R||m.showParticle(h.currentParticleIndex)}function ce(){return _(this,null,function*(){!R||(yield m.offsetPage({animated:!0}))})}function Ae(te){h.focused=te.detail.value}function Ee(){m.toggleFocused()}function ue(){m.showPrevPage()}const Ye=()=>W/3;function st(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,C=te.autoplay),"autoplayDuration"in te&&e(27,I=te.autoplayDuration),"autoplayDirection"in te&&e(28,B=te.autoplayDirection),"pauseOnFocus"in te&&e(29,x=te.pauseOnFocus),"autoplayProgressVisible"in te&&e(3,H=te.autoplayProgressVisible),"dots"in te&&e(4,N=te.dots),"swiping"in te&&e(30,R=te.swiping),"particlesToShow"in te&&e(31,O=te.particlesToShow),"particlesToScroll"in te&&e(32,S=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=C),i.$$.dirty[0]&134217728&&(h.autoplayDuration=I),i.$$.dirty[0]&268435456&&(h.autoplayDirection=B),i.$$.dirty[0]&536870912&&(h.pauseOnFocus=x),i.$$.dirty[1]&1&&(h.particlesToShowInit=O),i.$$.dirty[1]&2&&(h.particlesToScrollInit=S)},[A,v,b,H,N,r,s,a,l,c,u,W,ee,U,m,de,pe,Pe,ke,Te,ce,Ae,Ee,ue,w,k,C,I,B,x,R,O,S,F,G,Y,o,n,Ye,st,ye,$e]}class HA extends oe{constructor(t){super(),ie(this,t,FA,QA,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},MA,[-1,-1])}get goTo(){return this.$$.ctx[33]}get goToPrev(){return this.$$.ctx[34]}get goToNext(){return this.$$.ctx[35]}}function _A(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 Vr(i){let t;function e(s,r){if(s[2].type==="Image")return WA;if(s[2].type==="Video")return GA}let n=e(i),o=n&&n(i);return{c(){t=z("div"),o&&o.c(),y(t,"class","media-item svelte-159ski6"),y(t,"draggable","false")},m(s,r){M(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&&L(t),o&&o.d()}}}function GA(i){let t,e,n,o,s,r;function a(u,h){return u[7]&&u[2].videoCoverUrl?XA:NA}let l=a(i),c=l(i);return{c(){c.c(),t=$(),e=z("div"),n=z("div"),o=z("div"),y(o,"class","video-icon-img svelte-159ski6"),T(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),M(u,t,h),M(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&&T(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&&L(t),u&&L(e),s=!1,r()}}}function WA(i){let t,e,n,o;return{c(){t=z("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){M(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&&L(t)}}}function NA(i){let t,e,n,o,s,r,a;return{c(){t=z("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){M(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&&L(t),i[19](null),r=!1,Ge(a)}}}function XA(i){let t,e,n,o;return{c(){t=z("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){M(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&&L(t)}}}function YA(i){let t,e=i[2]&&Vr(i);return{c(){e&&e.c(),t=ge()},m(n,o){e&&e.m(n,o),M(n,t,o)},p(n,[o]){n[2]?e?e.p(n,o):(e=Vr(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&&L(t)}}}function UA(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=vt("mediaStore"),v=vt("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})},C=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})},B=R=>{n&&n.pause()};function x(R){Ve[R?"unshift":"push"](()=>{s.videoInstance=R,e(0,s)})}const H=()=>l==="withText"?Up:l==="withoutText"?qp: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,S=navigator.userAgent.toLowerCase().indexOf("iphone")!==-1&&R;n&&S&&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,C,I,B,x,H,N]}class Hl extends oe{constructor(t){super(),ie(this,t,UA,YA,ne,{mediaInstance:0,tag:1,media:2,playButtonIfNeed:3,playButtonSizeIfNeed:4,canPlay:5,objectFit:6,disableVideoIfHavePoster:7},_A)}}function qA(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 jr(i,t,e){const n=i.slice();return n[25]=t[e],n[26]=t,n[27]=e,n}function Or(i){let t,e,n,o,s,r,a;const l=[ZA,JA],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=z("div"),e=z("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){M(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()),P(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||(P(o),h&&Qe(()=>{r&&r.end(1),s=Mt(t,Xo,i[6]?{y:4,duration:i[4],delay:i[2],easing:At}:void 0),s.start()}),a=!0)},o(h){D(o),s&&s.invalidate(),h&&(r=rn(t,Xo,i[6]?{y:4,duration:i[4],delay:i[3],easing:At}:void 0)),a=!1},d(h){h&&L(t),c[n].d(),h&&r&&r.end()}}}function JA(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 Hl({props:r}),Ve.push(()=>Za(t,"mediaInstance",s)),{c(){K(t.$$.fragment)},m(a,l){J(t,a,l),n=!0},p(a,l){const c=l&131?Fe(o,[l&2&&{media:a[1][0]},l&128&&Ja(a[7]),l&1&&{tag:a[0]}]):{};!e&&l&256&&(e=!0,c.mediaInstance=a[8][0],Xa(()=>e=!1)),t.$set(c)},i(a){n||(P(t.$$.fragment,a),n=!0)},o(a){D(t.$$.fragment,a),n=!1},d(a){Z(t,a)}}}function ZA(i){let t,e,n={dots:!1,arrows:!1,$$slots:{default:[KA]},$$scope:{ctx:i}};return t=new HA({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||(P(t.$$.fragment,o),e=!0)},o(o){D(t.$$.fragment,o),e=!1},d(o){i[18](null),Z(t,o)}}}function Rr(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 Hl({props:r}),Ve.push(()=>Za(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?Fe(o,[l&128&&Ja(i[7]),l&1024&&{media:i[25]},l&1&&{tag:i[0]}]):{};!e&&l&256&&(e=!0,c.mediaInstance=i[8][i[27]],Xa(()=>e=!1)),t.$set(c)},i(a){n||(P(t.$$.fragment,a),n=!0)},o(a){D(t.$$.fragment,a),n=!1},d(a){Z(t,a)}}}function KA(i){let t,e,n=i[10],o=[];for(let r=0;r<n.length;r+=1)o[r]=Rr(jr(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=ge()},m(r,a){for(let l=0;l<o.length;l+=1)o[l].m(r,a);M(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=jr(r,n,l);o[l]?(o[l].p(c,a),P(o[l],1)):(o[l]=Rr(c),o[l].c(),P(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)P(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&&L(t)}}}function $A(i){let t,e,n=i[5]&&Or(i);return{c(){n&&n.c(),t=ge()},m(o,s){n&&n.m(o,s),M(o,t,s),e=!0},p(o,[s]){o[5]?n?(n.p(o,s),s&32&&P(n,1)):(n=Or(o),n.c(),P(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(P(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&L(t)}}}function ev(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={autoplay:!0,autoplayVideo:!1}}=t,v=[],b=0,w,k=null;const C=vt("hooks"),I=vt("mediaStore");function B(){const O=v[b],S=O==null?void 0:O.videoInstance;!S||(S.paused?(S.muted=!1,S.play()):S.pause())}Ze(()=>{C.on("click",O=>{var S,F,G;!((G=(F=(S=a.tag3DContentSvelte)==null?void 0:S.domContainer)==null?void 0:F.css3DObject)!=null&&G.opacityMesh)||O.tag.id===a.id&&B()}),k=setInterval(()=>{r&&(w==null||w.goToNext())},3e3)}),Et(()=>{clearInterval(k),C.off("click",B)});function x(O,S){i.$$.not_equal(v[S],O)&&(v[S]=O,e(8,v))}function H(O){Ve[O?"unshift":"push"](()=>{w=O,e(12,w)})}const N=O=>{n||I.set({currentMediaElement:null}),e(11,b=O.detail)};function R(O){i.$$.not_equal(v[0],O)&&(v[0]=O,e(8,v))}return i.$$set=O=>{"tag"in O&&e(0,a=O.tag),"mediaData"in O&&e(1,l=O.mediaData),"inDelay"in O&&e(2,c=O.inDelay),"outDelay"in O&&e(3,u=O.outDelay),"duration"in O&&e(4,h=O.duration),"unfolded"in O&&e(5,d=O.unfolded),"animation"in O&&e(6,m=O.animation),"mediaItemConfig"in O&&e(7,g=O.mediaItemConfig),"enableCarousel"in O&&e(15,p=O.enableCarousel),"autoplayConfig"in O&&e(16,A=O.autoplayConfig)},i.$$.update=()=>{i.$$.dirty&256&&e(9,n=v.every(O=>O.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.autoplay&&n)},[a,l,c,u,h,d,m,g,v,n,s,b,w,o,I,p,A,x,H,N,R]}class _l extends oe{constructor(t){super(),ie(this,t,ev,$A,ne,{tag:0,mediaData:1,inDelay:2,outDelay:3,duration:4,unfolded:5,animation:6,mediaItemConfig:7,enableCarousel:15,autoplayConfig:16},qA)}}function tv(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 Qr(i){let t,e,n,o,s,r,a,l;t=new ot({props:{visible:i[3],left:61,bottom:57,width:2,blurRadius:150,spreadRadius:75}}),o=new x0({props:{unfolded:i[3],outDelay:400}});let c=i[2]&&Fr(i),u=i[1]&&Hr(i);return{c(){K(t.$$.fragment),e=$(),n=z("div"),K(o.$$.fragment),s=$(),c&&c.c(),r=$(),u&&u.c(),a=ge(),y(n,"class","line svelte-1f7m1lj")},m(h,d){J(t,h,d),M(h,e,d),M(h,n,d),J(o,n,null),M(h,s,d),c&&c.m(h,d),M(h,r,d),u&&u.m(h,d),M(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&&P(c,1)):(c=Fr(h),c.c(),P(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&&P(u,1)):(u=Hr(h),u.c(),P(u,1),u.m(a.parentNode,a)):u&&(se(),D(u,1,1,()=>{u=null}),re())},i(h){l||(P(t.$$.fragment,h),P(o.$$.fragment,h),P(c),P(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&&L(e),h&&L(n),Z(o),h&&L(s),c&&c.d(h),h&&L(r),u&&u.d(h),h&&L(a)}}}function Fr(i){let t,e,n;return e=new jl({props:{unfolded:i[3],content:i[2],inDelay:500}}),{c(){t=z("div"),K(e.$$.fragment),y(t,"class","text svelte-1f7m1lj")},m(o,s){M(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||(P(e.$$.fragment,o),n=!0)},o(o){D(e.$$.fragment,o),n=!1},d(o){o&&L(t),Z(e)}}}function Hr(i){let t,e,n;return e=new _l({props:{autoplayConfig:{autoplay:!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=z("div"),K(e.$$.fragment),y(t,"class","media-wrapper svelte-1f7m1lj")},m(o,s){M(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||(P(e.$$.fragment,o),n=!0)},o(o){D(e.$$.fragment,o),n=!1},d(o){o&&L(t),Z(e)}}}function nv(i){let t,e,n=i[0].state&&Qr(i);return{c(){n&&n.c(),t=ge()},m(o,s){n&&n.m(o,s),M(o,t,s),e=!0},p(o,[s]){o[0].state?n?(n.p(o,s),s&1&&P(n,1)):(n=Qr(o),n.c(),P(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(P(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&L(t)}}}function iv(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 ov extends oe{constructor(t){super(),ie(this,t,iv,nv,ne,{tag:0},tv)}}function sv(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 _r(i,t,e){const n=i.slice();return n[0]=t[e],n}function Gr(i,t,e){const n=i.slice();return n[0]=t[e],n}function Wr(i){let t,e;return{c(){t=z("img"),y(t,"class","headerImage svelte-sezqcq"),Xe(t.src,e=i[3].headerPictureUrl)||y(t,"src",e),y(t,"alt","")},m(n,o){M(n,t,o)},p(n,o){o&8&&!Xe(t.src,e=n[3].headerPictureUrl)&&y(t,"src",e)},d(n){n&&L(t)}}}function Nr(i){let t,e,n,o,s=i[2]||[],r=[];for(let c=0;c<s.length;c+=1)r[c]=Xr(Gr(i,s,c));let a=i[5]||[],l=[];for(let c=0;c<a.length;c+=1)l[c]=Yr(_r(i,a,c));return{c(){t=z("div"),e=z("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"),Qe(()=>i[11].call(e)),y(t,"class","tags-wrapper svelte-sezqcq")},m(c,u){M(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=pi(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=Gr(c,s,h);r[h]?r[h].p(d,u):(r[h]=Xr(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=_r(c,a,h);l[h]?l[h].p(d,u):(l[h]=Yr(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&&L(t),ut(r,c),ut(l,c),o()}}}function Xr(i){let t,e=i[0]+"",n;return{c(){t=z("div"),n=xe(e),y(t,"class","tag primary-tag svelte-sezqcq"),T(t,"min-width",So)},m(o,s){M(o,t,s),V(t,n)},p(o,s){s&4&&e!==(e=o[0]+"")&&Me(n,e)},d(o){o&&L(t)}}}function Yr(i){let t,e=i[0]+"",n;return{c(){t=z("div"),n=xe(e),y(t,"class","tag secondary-tag svelte-sezqcq"),T(t,"min-width",So)},m(o,s){M(o,t,s),V(t,n)},p(o,s){s&32&&e!==(e=o[0]+"")&&Me(n,e)},d(o){o&&L(t)}}}function Ur(i){let t,e,n=i[7]&&qr(i),o=i[3].highlightText&&Zr(i);return{c(){t=z("div"),n&&n.c(),e=$(),o&&o.c(),y(t,"class","footer svelte-sezqcq")},m(s,r){M(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=qr(s),n.c(),n.m(t,e)):n&&(n.d(1),n=null),s[3].highlightText?o?o.p(s,r):(o=Zr(s),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(s){s&&L(t),n&&n.d(),o&&o.d()}}}function qr(i){let t,e,n=i[3].price.value+"",o,s,r=i[3].price.unit&&Jr(i);return{c(){t=z("div"),e=z("span"),o=xe(n),s=$(),r&&r.c(),y(e,"class","value svelte-sezqcq"),y(t,"class","price svelte-sezqcq")},m(a,l){M(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+"")&&Me(o,n),a[3].price.unit?r?r.p(a,l):(r=Jr(a),r.c(),r.m(t,null)):r&&(r.d(1),r=null)},d(a){a&&L(t),r&&r.d()}}}function Jr(i){let t,e=i[3].price.unit+"",n;return{c(){t=z("span"),n=xe(e),y(t,"class","unit svelte-sezqcq")},m(o,s){M(o,t,s),V(t,n)},p(o,s){s&8&&e!==(e=o[3].price.unit+"")&&Me(n,e)},d(o){o&&L(t)}}}function Zr(i){let t,e,n,o,s=i[3].highlightText+"",r,a,l;return{c(){t=z("div"),e=z("div"),n=$(),o=z("span"),r=xe(s),a=$(),l=z("div"),l.innerHTML='<svg class="arrow svelte-sezqcq" viewBox="0 0 6 9"><g transform="translate(-3, -2)" fill-rule="nonzero" class="svelte-sezqcq"><path d="M4.43868724,2.12056563 C4.28121824,1.95989074 4.02582143,1.95979988 3.86824251,2.1203627 C3.72498894,2.26632889 3.71189225,2.49481723 3.82900374,2.65587166 L6.57092402,5.92894326 C6.72651763,6.11470411 6.72651763,6.38529589 6.57092402,6.57105674 L3.86804348,9.79798499 C3.72488984,9.94405307 3.71194952,10.1725507 3.8291712,10.3335217 L3.86824251,10.3796373 C4.01149607,10.5256035 4.23559087,10.5387981 4.39346025,10.4192733 L4.43868724,10.3794344 L8.1144599,6.5985342 C8.30312347,6.40447482 8.30312347,6.09552518 8.1144599,5.9014658 L4.43868724,2.12056563 Z" class="svelte-sezqcq"></path></g></svg>',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){M(c,t,u),V(t,e),V(t,n),V(t,o),V(o,r),M(c,a,u),M(c,l,u)},p(c,u){u&8&&s!==(s=c[3].highlightText+"")&&Me(r,s)},d(c){c&&L(t),c&&L(a),c&&L(l)}}}function rv(i){var k,C;let t,e,n,o,s,r,a,l,c,u,h=i[3].title+"",d,m,g,p,A;e=new ot({props:{visible:i[4],outDelay:500,left:61,bottom:87,blurRadius:150,spreadRadius:75}});let v=i[3].headerPictureUrl&&Wr(i),b=((k=i[2].length)!=null?k:0)+((C=i[5].length)!=null?C:0)>0&&Nr(i),w=(i[7]||i[3].highlightText)&&Ur(i);return{c(){t=z("div"),K(e.$$.fragment),n=$(),o=z("div"),s=$(),r=z("div"),v&&v.c(),a=$(),l=z("div"),c=z("div"),u=z("div"),d=xe(h),m=$(),b&&b.c(),g=$(),w&&w.c(),y(o,"class","line svelte-sezqcq"),T(o,"transition-delay",i[4]?Xn+"ms":Yn+$r-Kr-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"),T(r,"max-width",it(i[9])),T(r,"transition-delay",i[4]?Xn+Yn+"ms":"0ms"),y(t,"class",p=Ie(`marketing ${i[6]}`)+" svelte-sezqcq"),q(t,"unfolded",i[4]),q(t,"folded",i[8])},m(I,B){M(I,t,B),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(I,[B]){var H,N;const x={};B&16&&(x.visible=I[4]),e.$set(x),B&16&&T(o,"transition-delay",I[4]?Xn+"ms":Yn+$r-Kr-40+"ms"),I[3].headerPictureUrl?v?v.p(I,B):(v=Wr(I),v.c(),v.m(r,a)):v&&(v.d(1),v=null),(!A||B&8)&&h!==(h=I[3].title+"")&&Me(d,h),((H=I[2].length)!=null?H:0)+((N=I[5].length)!=null?N:0)>0?b?b.p(I,B):(b=Nr(I),b.c(),b.m(r,g)):b&&(b.d(1),b=null),I[7]||I[3].highlightText?w?w.p(I,B):(w=Ur(I),w.c(),w.m(r,null)):w&&(w.d(1),w=null),B&16&&T(r,"transition-delay",I[4]?Xn+Yn+"ms":"0ms"),(!A||B&64&&p!==(p=Ie(`marketing ${I[6]}`)+" svelte-sezqcq"))&&y(t,"class",p),(!A||B&80)&&q(t,"unfolded",I[4]),(!A||B&320)&&q(t,"folded",I[8])},i(I){A||(P(e.$$.fragment,I),A=!0)},o(I){D(e.$$.fragment,I),A=!1},d(I){I&&L(t),Z(e),v&&v.d(),b&&b.d(),w&&w.d()}}}const So=40,Xn=400,Kr=500,Yn=180,$r=500;function av(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=Zt((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)/So),[h,d,c,s,n,u,a,r,o,m,l,g]}class lv extends oe{constructor(t){super(),ie(this,t,av,rv,ne,{tag:0},sv)}}class cv 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 _(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=xp(this.sharedAudioSrc,{namespace:ko.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 uv(i){le(i,"svelte-13e7hxv",".audio.svelte-13e7hxv{pointer-events:auto;cursor:pointer;width:100%;height:100%}")}function dv(i){let t,e,n,o;const s=i[8].default,r=en(s,i,i[7],null);return{c(){t=z("div"),r&&r.c(),y(t,"class","audio svelte-13e7hxv"),y(t,"style",i[0])},m(a,l){M(a,t,l),r&&r.m(t,null),e=!0,n||(o=me(t,"click",Qa(i[1])),n=!0)},p(a,[l]){r&&r.p&&(!e||l&128)&&nn(r,s,a,a[7],e?tn(s,a[7],l,null):on(a[7]),null),(!e||l&1)&&y(t,"style",a[0])},i(a){e||(P(r,a),e=!0)},o(a){D(r,a),e=!1},d(a){a&&L(t),r&&r.d(a),n=!1,o()}}}function hv(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=vt("hooks"),h=vt("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 cv(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 Gl extends oe{constructor(t){super(),ie(this,t,hv,dv,ne,{url:2,enable:3,style:0,hooksInfo:4},uv)}}function fv(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 ea(i){let t,e;return t=new ot({props:{center:!0,blurRadius:12,spreadRadius:5}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},i(n){e||(P(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function mv(i){let t,e,n,o,s,r=i[1]&&ea();return{c(){t=z("div"),r&&r.c(),e=$(),n=z("div"),o=z("div"),o.innerHTML='<svg width="100%" height="100%" viewBox="0 0 128 128"><g transform="rotate(-45 12 64) translate(12 64)" fill="black" stroke="black" fill-opacity="0.6" stroke-opacity="0.6"><path stroke="none" class="sound-wave sound-wave-1 svelte-srt2pi" d="M0,23 A23,23 0 0,0 23,0 L0,0"></path><path fill="none" stroke-width="15" class="sound-wave sound-wave-2 svelte-srt2pi" d="M0,46 A46,46 0 0,0 46,0"></path><path fill="none" stroke-width="15" class="sound-wave sound-wave-3 svelte-srt2pi" d="M0,80 A80,80 0 0,0 80,0"></path></g></svg>',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]),T(t,"width",i[5]),T(t,"height",i[5])},m(a,l){M(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&&P(r,1):(r=ea(),r.c(),P(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&&T(t,"width",a[5]),l&32&&T(t,"height",a[5])},i(a){s||(P(r),s=!0)},o(a){D(r),s=!1},d(a){a&&L(t),r&&r.d(),i[7](null),i[8](null)}}}function gv(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"?it(a):a)},[o,s,r,l,c,n,a,u,h]}class Wl extends oe{constructor(t){super(),ie(this,t,gv,mv,ne,{playing:0,shadow:1,style:2,width:6},fv)}}function pv(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 ta(i){var A,v;let t,e,n,o,s,r,a,l,c,u,h,d,m,g;e=new ot({props:{visible:i[6],left:i[3]/2+"px",bottom:12,width:2,blurRadius:120,spreadRadius:60}});let p=i[6]&&na(i);return c=new Ol({props:{visible:i[6],textUnfolded:i[1],content:i[5]}}),h=new xo({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=z("div"),K(e.$$.fragment),n=$(),o=z("div"),s=z("div"),r=z("div"),p&&p.c(),a=$(),l=z("div"),K(c.$$.fragment),u=$(),K(h.$$.fragment),y(r,"class","audio-icon svelte-1s6gk4a"),T(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){M(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(an.call(null,l)),me(l,"clientWidth",i[12])],m=!0)},p(b,w){var B,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&&P(p,1)):(p=na(b),p.c(),P(p,1),p.m(r,null)):p&&(se(),D(p,1,1,()=>{p=null}),re());const C={};w&64&&(C.visible=b[6]),w&2&&(C.textUnfolded=b[1]),w&32&&(C.content=b[5]),c.$set(C);const I={};w&64&&(I.unfolded=b[6]),w&8&&(I.length=b[3]),w&48&&(I.outDelay=b[4]+20*Math.min((x=(B=b[5])==null?void 0:B.length)!=null?x:10,15)),h.$set(I),(!d||w&64)&&q(t,"unfolded",b[6])},i(b){d||(P(e.$$.fragment,b),P(p),P(c.$$.fragment,b),P(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&&L(t),Z(e),p&&p.d(),Z(c),Z(h),m=!1,Ge(g)}}}function na(i){let t,e,n,o,s,r,a;return e=new ot({props:{center:!0,blurRadius:15,spreadRadius:6}}),o=new Gl({props:{enable:i[6],url:i[0].data.audioUrl,hooksInfo:{tag:i[0]},$$slots:{default:[Av]},$$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=z("div"),K(e.$$.fragment),n=$(),K(o.$$.fragment),y(t,"class","audio svelte-1s6gk4a")},m(l,c){M(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||(P(e.$$.fragment,l),P(o.$$.fragment,l),l&&Qe(()=>{r&&r.end(1),s=Mt(t,St,{duration:1e3,delay:0,easing:Xt}),s.start()}),a=!0)},o(l){var c,u;D(e.$$.fragment,l),D(o.$$.fragment,l),s&&s.invalidate(),l&&(r=rn(t,St,{duration:1e3,delay:20*Math.min((u=(c=i[5])==null?void 0:c.length)!=null?u:10,15),easing:Xt})),a=!1},d(l){l&&L(t),Z(e),Z(o),l&&r&&r.end()}}}function Av(i){let t,e,n;return e=new Wl({props:{playing:i[2]}}),{c(){t=z("div"),K(e.$$.fragment),y(t,"class","audio-icon__wrapper svelte-1s6gk4a")},m(o,s){M(o,t,s),J(e,t,null),n=!0},p(o,s){const r={};s&4&&(r.playing=o[2]),e.$set(r)},i(o){n||(P(e.$$.fragment,o),n=!0)},o(o){D(e.$$.fragment,o),n=!1},d(o){o&&L(t),Z(e)}}}function vv(i){let t,e,n=i[0].state&&ta(i);return{c(){n&&n.c(),t=ge()},m(o,s){n&&n.m(o,s),M(o,t,s),e=!0},p(o,[s]){o[0].state?n?(n.p(o,s),s&1&&P(n,1)):(n=ta(o),n.c(),P(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(P(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&L(t)}}}function bv(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){sn.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 yv extends oe{constructor(t){super(),ie(this,t,bv,vv,ne,{tag:0},pv)}}function wv(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 ia(i){let t,e,n,o;return n=new Gl({props:{style:"width: max-content; height: max-content;",enable:i[0].state.visible,url:i[0].data.audioUrl,hooksInfo:{tag:i[0]},$$slots:{default:[Ev]},$$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=z("div"),e=z("div"),K(n.$$.fragment),y(e,"class","audio-tag svelte-58hfjf"),T(e,"background-color",i[4].bgColor),T(e,"color",i[4].fontColor),y(t,"class","audio-tag__wrapper svelte-58hfjf")},m(s,r){M(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&&T(e,"background-color",s[4].bgColor),r&16&&T(e,"color",s[4].fontColor)},i(s){o||(P(n.$$.fragment,s),o=!0)},o(s){D(n.$$.fragment,s),o=!1},d(s){s&&L(t),Z(n)}}}function Cv(i){let t;return{c(){t=xe(i[5])},m(e,n){M(e,t,n)},p(e,n){n&32&&Me(t,e[5])},d(e){e&&L(t)}}}function Ev(i){let t,e,n,o,s,r,a;return n=new Wl({props:{playing:i[3]}}),r=new Do({props:{maxWidth:72,$$slots:{default:[Cv]},$$scope:{ctx:i}}}),{c(){t=z("div"),e=z("div"),K(n.$$.fragment),o=$(),s=z("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){M(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||(P(n.$$.fragment,l),P(r.$$.fragment,l),a=!0)},o(l){D(n.$$.fragment,l),D(r.$$.fragment,l),a=!1},d(l){l&&L(t),Z(n),Z(r)}}}function Pv(i){let t,e,n=i[0].state&&ia(i);return{c(){n&&n.c(),t=ge()},m(o,s){n&&n.m(o,s),M(o,t,s),e=!0},p(o,[s]){o[0].state?n?(n.p(o,s),s&1&&P(n,1)):(n=ia(o),n.c(),P(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(P(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&L(t)}}}function Iv(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){sn.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 kv extends oe{constructor(t){super(),ie(this,t,Iv,Pv,ne,{tag:0},wv)}}function xv(i){let t,e;return t=new kv({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||(P(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function Dv(i){let t,e;return t=new yv({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||(P(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function Lv(i){let t,e,n,o;const s=[Dv,xv],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=ge()},m(l,c){~t&&r[t].m(l,c),M(l,n,c),o=!0},p(l,[c]){let u=t;t=a(l),t===u?~t&&r[t].p(l,c):(e&&(se(),D(r[u],1,1,()=>{r[u]=null}),re()),~t?(e=r[t],e?e.p(l,c):(e=r[t]=s[t](l),e.c()),P(e,1),e.m(n.parentNode,n)):e=null)},i(l){o||(P(e),o=!0)},o(l){D(e),o=!1},d(l){~t&&r[t].d(l),l&&L(n)}}}function Sv(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 Mv extends oe{constructor(t){super(),ie(this,t,Sv,Lv,ne,{tag:0})}}function Tv(i){le(i,"svelte-10cw0el",".media-wrapper.svelte-10cw0el{position:absolute;width:100%;height:100%}")}function oa(i){var o;let t,e,n;return e=new _l({props:{mediaItemConfig:{canPlay:!0,playButtonSizeIfNeed:"large",playButtonIfNeed:(o=i[4])!=null?o:"withText",disableVideoIfHavePoster:!1,objectFit:i[2]},unfolded:i[6],mediaData:i[5],enableCarousel:i[1],autoplayConfig:i[3],tag:i[0],inDelay:500,duration:500}}),{c(){t=z("div"),K(e.$$.fragment),y(t,"class","media-wrapper svelte-10cw0el")},m(s,r){M(s,t,r),J(e,t,null),n=!0},p(s,r){var l;const a={};r&20&&(a.mediaItemConfig={canPlay:!0,playButtonSizeIfNeed:"large",playButtonIfNeed:(l=s[4])!=null?l:"withText",disableVideoIfHavePoster:!1,objectFit:s[2]}),r&64&&(a.unfolded=s[6]),r&32&&(a.mediaData=s[5]),r&2&&(a.enableCarousel=s[1]),r&8&&(a.autoplayConfig=s[3]),r&1&&(a.tag=s[0]),e.$set(a)},i(s){n||(P(e.$$.fragment,s),n=!0)},o(s){D(e.$$.fragment,s),n=!1},d(s){s&&L(t),Z(e)}}}function zv(i){let t,e,n=i[0].state&&i[5]&&oa(i);return{c(){n&&n.c(),t=ge()},m(o,s){n&&n.m(o,s),M(o,t,s),e=!0},p(o,[s]){o[0].state&&o[5]?n?(n.p(o,s),s&33&&P(n,1)):(n=oa(o),n.c(),P(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(P(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&L(t)}}}function Bv(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 Vv extends oe{constructor(t){super(),ie(this,t,Bv,zv,ne,{tag:0},Tv)}}function Nl(i){return _(this,null,function*(){return new Promise((t,e)=>{if(!i){e(Error("url is empty"));return}const n=new Image;n.src=i,n.onload=()=>t({width:n.width,height:n.height}),n.onerror=e})})}function jv(i){return _(this,null,function*(){const{url:t,ratio:e=3}=i;i.ratio||console.warn("Tag icon ratio is not set, default is 3");const{width:n,height:o}=yield Nl(t);return fe(Q({},i),{width:n/e,height:o/e})})}function Ov(i){return _(this,null,function*(){const{steps:t,url:e,ratio:n=3,fps:o=24}=i;if(!t)throw new Error("KeyframeIcon requires steps");const{width:s,height:r}=yield Nl(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 Rv(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 sa(i){i[1]=i[19].width}function ra(i){i[1]=i[19].width,i[16]=i[19].height,i[17]=i[19].steps,i[18]=i[19].duration}function aa(i){let t,e,n,o=i[0]&&la();function s(l,c){return l[8]?Fv:Qv}let r=s(i),a=r(i);return{c(){t=z("div"),o&&o.c(),e=$(),a.c(),y(t,"class","icon"),T(t,"width",i[1])},m(l,c){M(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&&P(o,1):(o=la(),o.c(),P(o,1),o.m(t,e)):o&&(se(),D(o,1,1,()=>{o=null}),re()),r===(r=s(l))&&a?a.p(l,c):(a.d(1),a=r(l),a&&(a.c(),a.m(t,null))),c&2&&T(t,"width",l[1])},i(l){n||(P(o),n=!0)},o(l){D(o),n=!1},d(l){l&&L(t),o&&o.d(),a.d()}}}function la(i){let t,e;return t=new ot({props:{center:!0,blurRadius:24,spreadRadius:16}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},i(n){e||(P(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function Qv(i){let t,e,n={ctx:i,current:null,token:null,hasCatch:!1,pending:Gv,then:_v,catch:Hv,value:19};return si(e=i[11](Le({url:i[7],ratio:i[5]})),n),{c(){t=ge(),n.block.c()},m(o,s){M(o,t,s),n.block.m(o,n.anchor=s),n.mount=()=>t.parentNode,n.anchor=t},p(o,s){i=o,n.ctx=i,s&160&&e!==(e=i[11](Le({url:i[7],ratio:i[5]})))&&si(e,n)||qa(n,i,s)},d(o){o&&L(t),n.block.d(o),n.token=null,n=null}}}function Fv(i){let t,e,n={ctx:i,current:null,token:null,hasCatch:!1,pending:Xv,then:Nv,catch:Wv,value:19};return si(e=i[10](Le({url:i[7],steps:i[2],fps:i[6],ratio:i[5]})),n),{c(){t=ge(),n.block.c()},m(o,s){M(o,t,s),n.block.m(o,n.anchor=s),n.mount=()=>t.parentNode,n.anchor=t},p(o,s){i=o,n.ctx=i,s&228&&e!==(e=i[10](Le({url:i[7],steps:i[2],fps:i[6],ratio:i[5]})))&&si(e,n)||qa(n,i,s)},d(o){o&&L(t),n.block.d(o),n.token=null,n=null}}}function Hv(i){return{c:X,m:X,p:X,d:X}}function _v(i){sa(i);let t,e;return{c(){t=z("img"),y(t,"alt","tag-icon"),y(t,"class","icon-image svelte-316sq3"),Xe(t.src,e=i[7])||y(t,"src",e),T(t,"width",it(Ft({originWidth:i[1],scale:i[4],wantedWidth:i[3]}).width))},m(n,o){M(n,t,o)},p(n,o){sa(n),o&128&&!Xe(t.src,e=n[7])&&y(t,"src",e),o&184&&T(t,"width",it(Ft({originWidth:n[1],scale:n[4],wantedWidth:n[3]}).width))},d(n){n&&L(t)}}}function Gv(i){return{c:X,m:X,p:X,d:X}}function Wv(i){return{c:X,m:X,p:X,d:X}}function Nv(i){ra(i);let t,e=`url(${i[7]})`,n=`steps(${i[17]}, jump-none)`;return{c(){t=z("div"),y(t,"class","icon-keyframe svelte-316sq3"),T(t,"width",it(Ft({originWidth:i[1],originHeight:i[16],scale:i[4],wantedWidth:i[3]}).width)),T(t,"height",it(Ft({originWidth:i[1],originHeight:i[16],scale:i[4],wantedWidth:i[3]}).height)),T(t,"background-image",e),T(t,"animation-duration",i[18]),T(t,"animation-timing-function",n)},m(o,s){M(o,t,s)},p(o,s){ra(o),s&252&&T(t,"width",it(Ft({originWidth:o[1],originHeight:o[16],scale:o[4],wantedWidth:o[3]}).width)),s&252&&T(t,"height",it(Ft({originWidth:o[1],originHeight:o[16],scale:o[4],wantedWidth:o[3]}).height)),s&128&&e!==(e=`url(${o[7]})`)&&T(t,"background-image",e),s&228&&T(t,"animation-duration",o[18]),s&228&&n!==(n=`steps(${o[17]}, jump-none)`)&&T(t,"animation-timing-function",n)},d(o){o&&L(t)}}}function Xv(i){return{c:X,m:X,p:X,d:X}}function Yv(i){let t,e,n=i[9]&&aa(i);return{c(){n&&n.c(),t=ge()},m(o,s){n&&n.m(o,s),M(o,t,s),e=!0},p(o,[s]){o[9]?n?(n.p(o,s),s&512&&P(n,1)):(n=aa(o),n.c(),P(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(P(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&L(t)}}}function Ft(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 Uv(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 _(this,null,function*(){const k=yield Ov(w);return p("iconLoaded",k),k})}function v(w){return _(this,null,function*(){if(typeof h=="number")return fe(Q({},w),{width:h});const k=yield jv(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 Xl extends oe{constructor(t){super(),ie(this,t,Uv,Yv,ne,{width:1,icon:12,shadow:0},Rv)}}function qv(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 ca(i){let t,e,n,o,s,r;return e=new ot({props:{outDelay:0,inDelay:0,center:!0,width:"80%",blurRadius:40,spreadRadius:16,opacity:.08}}),{c(){t=z("div"),K(e.$$.fragment),n=$(),o=z("div"),s=xe(i[1]),y(o,"class","text svelte-e58ijk"),y(t,"class","text-wrapper svelte-e58ijk")},m(a,l){M(a,t,l),J(e,t,null),V(t,n),V(t,o),V(o,s),r=!0},p(a,l){(!r||l&2)&&Me(s,a[1])},i(a){r||(P(e.$$.fragment,a),r=!0)},o(a){D(e.$$.fragment,a),r=!1},d(a){a&&L(t),Z(e)}}}function Jv(i){let t,e,n,o;e=new Xl({props:{icon:i[0],shadow:!0}}),e.$on("iconLoaded",i[4]);let s=i[1]&&i[2]&&ca(i);return{c(){t=z("div"),K(e.$$.fragment),n=$(),s&&s.c(),y(t,"class","wrapper svelte-e58ijk")},m(r,a){M(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&&P(s,1)):(s=ca(r),s.c(),P(s,1),s.m(t,null)):s&&(se(),D(s,1,1,()=>{s=null}),re())},i(r){o||(P(e.$$.fragment,r),P(s),o=!0)},o(r){D(e.$$.fragment,r),D(s),o=!1},d(r){r&&L(t),Z(e),s&&s.d()}}}function Zv(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 Kv extends oe{constructor(t){super(),ie(this,t,Zv,Jv,ne,{tag:3},qv)}}function $v(i){le(i,"svelte-kzl2aj",".customElement__container.svelte-kzl2aj{position:relative}")}function ua(i){let t,e=i[0].element+"",n;return{c(){t=new ti(!1),n=ge(),t.a=n},m(o,s){t.m(e,o,s),M(o,n,s)},p(o,s){s&1&&e!==(e=o[0].element+"")&&t.p(e)},d(o){o&&L(n),o&&t.d()}}}function eb(i){let t,e=typeof i[0].element=="string"&&ua(i);return{c(){t=z("div"),e&&e.c(),y(t,"class","customElement__container svelte-kzl2aj")},m(n,o){M(n,t,o),e&&e.m(t,null),i[2](t)},p(n,[o]){typeof n[0].element=="string"?e?e.p(n,o):(e=ua(n),e.c(),e.m(t,null)):e&&(e.d(1),e=null)},i:X,o:X,d(n){n&&L(t),e&&e.d(),i[2](null)}}}function tb(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)}}}),Et(()=>{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 nb extends oe{constructor(t){super(),ie(this,t,tb,eb,ne,{tag:0},$v)}}function ib(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/zgAAAIcACkAKQHgAAEAAAAAAAAAAAAAAAAAAABJAAMCLgGQAAUACAKKAlgAAABLAooCWAAAAV4AMgEsAAAAAAg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YtoboAb7EvukBfcHBvdL+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 ob(i){let t,e;return{c(){t=z("div"),y(t,"data-info","tag content is keep folded"),y(t,"data-id",e=i[1].id)},m(n,o){M(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&&L(t)}}}function sb(i){let t,e,n,o,s,r,a,l,c,u;const h=[hb,db,ub,cb,lb,ab],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=z("div"),e=z("div"),n=z("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),T(t,"width",i[1].stickType==="Plane"||i[1].contentType==="MediaModel"?"100%":0),T(t,"height",i[1].stickType==="Plane"||i[1].contentType==="MediaModel"?"100%":0)},m(g,p){M(g,t,p),V(t,e),V(e,n),~o&&d[o].m(n,null),l=!0,c||(u=me(t,"click",Qa(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()),P(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&&T(t,"width",g[1].stickType==="Plane"||g[1].contentType==="MediaModel"?"100%":0),p&2&&T(t,"height",g[1].stickType==="Plane"||g[1].contentType==="MediaModel"?"100%":0)},i(g){l||(P(s),l=!0)},o(g){D(s),l=!1},d(g){g&&L(t),~o&&d[o].d(),c=!1,u()}}}function rb(i){let t,e,n,o,s,r,a;return e=new nb({props:{tag:Le(i[1])}}),{c(){t=z("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){M(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||(P(e.$$.fragment,l),s=!0)},o(l){D(e.$$.fragment,l),s=!1},d(l){l&&L(t),Z(e),r=!1,a()}}}function ab(i){let t,e;return t=new Vv({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||(P(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function lb(i){let t,e;return t=new Kv({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||(P(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function cb(i){let t,e;return t=new lv({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||(P(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 Mv({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||(P(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 ov({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||(P(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 E0({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||(P(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function fb(i){let t,e,n,o;const s=[rb,sb,ob],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=ge()},m(l,c){r[t].m(l,c),M(l,n,c),o=!0},p(l,[c]){let u=t;t=a(l),t===u?r[t].p(l,c):(se(),D(r[u],1,1,()=>{r[u]=null}),re(),e=r[t],e?e.p(l,c):(e=r[t]=s[t](l),e.c()),P(e,1),e.m(n.parentNode,n))},i(l){o||(P(e),o=!0)},o(l){D(e),o=!1},d(l){r[t].d(l),l&&L(n)}}}function mb(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;Ki("hooks",h),Ki("mediaStore",m);let p,A;function v(C){C?h.emit("exposure",{id:r,type:"start"}):h.emit("exposure",{id:r,type:"end"})}function b(C,I,B){var x,H;return!(!I.visible||!I.enabled||!B.visible||!((x=C.state)!=null&&x.visible)||((H=C.temporaryState)==null?void 0:H.visible)===!1||Re(C)&&!C.mediaVisible)}const w=C=>h.emit("click",{event:C,target:"TagContent",tag:u}),k=C=>h.emit("click",{event:C,target:"TagContent",tag:u});return i.$$set=C=>{"withAnimation"in C&&e(0,c=C.withAnimation),"tag"in C&&e(1,u=C.tag),"hooks"in C&&e(2,h=C.hooks),"state"in C&&e(5,d=C.state),"mediaStore"in C&&e(6,m=C.mediaStore),"temporaryState"in C&&e(7,g=C.temporaryState)},i.$$.update=()=>{var C,I,B,x,H,N,R,O,S,F,G;i.$$.dirty&2&&e(11,n=(C=u.state)==null?void 0:C.unfolded),i.$$.dirty&2&&e(10,o=(I=u.state)==null?void 0:I.visible),i.$$.dirty&162&&e(12,s=d.visible&&g.visible&&((B=u.state)==null?void 0:B.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?(H=(x=u.hooks).emit)==null||H.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?(S=(O=u.hooks).emit)==null||S.call(O,"show"):(G=(F=u.hooks).emit)==null||G.call(F,"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 Yl extends oe{constructor(t){super(),ie(this,t,mb,fb,ne,{withAnimation:0,tag:1,hooks:2,state:5,mediaStore:6,temporaryState:7},ib)}}function gb(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 pb(i){let t,e,n,o,s,r,a,l,c,u,h,d;return o=new ot({props:{center:!0,blurRadius:15,spreadRadius:5,opacity:.3}}),c=new Xl({props:{icon:i[2],width:i[1]}}),c.$on("iconLoaded",i[7]),{c(){t=z("div"),e=z("div"),n=$(),K(o.$$.fragment),s=$(),r=z("div"),a=$(),l=z("div"),K(c.$$.fragment),y(e,"class","tag-point-click-helper svelte-1jkrwn7"),y(r,"class","tag-unfolded-point svelte-1jkrwn7"),T(r,"transition-delay",(i[3]?i[5]:0)+"ms"),y(l,"class","tag-folded-point svelte-1jkrwn7"),T(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){M(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&&T(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&&T(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||(P(o.$$.fragment,m),P(c.$$.fragment,m),u=!0)},o(m){D(o.$$.fragment,m),D(c.$$.fragment,m),u=!1},d(m){m&&L(t),Z(o),Z(c),h=!1,d()}}}function Ab(i,t,e){let n,o,s,r;const a=vt("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){sn.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:Jp}),i.$$.dirty&64&&e(1,r=(()=>{var C,I,B,x;const w=(I=(C=l.style)==null?void 0:C.point)==null?void 0:I.width;if(typeof w=="number")return w;const k=(x=(B=l.style)==null?void 0:B.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 vb extends oe{constructor(t){super(),ie(this,t,Ab,pb,ne,{tag:6},gb)}}function bb(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 yb(i){let t;return{c(){t=z("div"),y(t,"data-info","tag content is disable")},m(e,n){M(e,t,n)},p:X,i:X,o:X,d(e){e&&L(t)}}}function wb(i){let t,e;return t=new Yl({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||(P(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=z("div"),y(t,"data-info","tag point is disable")},m(e,n){M(e,t,n)},p:X,i:X,o:X,d(e){e&&L(t)}}}function Eb(i){let t,e;return t=new vb({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||(P(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,s,r,a,l,c,u;const h=[wb,yb],d=[];function m(v,b){return v[12]?0:1}n=m(i),o=d[n]=h[n](i);const g=[Eb,Cb],p=[];function A(v,b){return v[13]?0:1}return r=A(i),a=p[r]=g[r](i),{c(){t=z("div"),e=z("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),T(e,"left",i[7]),T(e,"top",i[6]),T(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){M(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()),P(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()),P(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&&T(e,"left",v[7]),b&64&&T(e,"top",v[6]),b&32&&T(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||(P(o),P(a),u=!0)},o(v){D(o),D(a),u=!1},d(v){v&&L(t),d[n].d(),p[r].d()}}}function Ib(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=vt("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,C,I,B,x,H;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)||((C=m.temporaryState)==null?void 0:C.visible)===!1),i.$$.dirty&2&&e(8,l=(I=m.state)==null?void 0:I.unfolded),i.$$.dirty&2&&e(7,c=((B=m.pointTagStyle)==null?void 0:B.leftPercent)+"%"),i.$$.dirty&2&&e(6,u=((x=m.pointTagStyle)==null?void 0:x.topPercent)+"%"),i.$$.dirty&2&&e(5,h=(H=m.state)!=null&&H.unfolded?1:0)},[d,m,g,p,A,h,u,c,l,a,r,s,o,n,v]}class kb extends oe{constructor(t){super(),ie(this,t,Ib,Pb,ne,{withAnimation:0,tag:1,mediaStore:2,state:3,temporaryState:4},bb)}}function xb(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 da(i,t,e){const n=i.slice();return n[6]=t[e],n}function ha(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=da(i,s,a),c=r(l);n.set(c,e[a]=fa(c,l))}return{c(){t=z("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){M(a,t,l);for(let c=0;c<e.length;c+=1)e[c].m(t,null);o=!0},p(a,l){l&31&&(s=a[1],se(),e=Ke(e,l,r,1,a,s,n,t,Pt,fa,null,da),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)P(e[l]);o=!0}},o(a){for(let l=0;l<e.length;l+=1)D(e[l]);o=!1},d(a){a&&L(t);for(let l=0;l<e.length;l+=1)e[l].d()}}}function fa(i,t){let e,n,o;return n=new kb({props:{state:t[3],temporaryState:t[4],withAnimation:t[0],tag:t[6],mediaStore:t[2]}}),{key:i,first:null,c(){e=ge(),K(n.$$.fragment),this.first=e},m(s,r){M(s,e,r),J(n,s,r),o=!0},p(s,r){t=s;const a={};r&8&&(a.state=t[3]),r&16&&(a.temporaryState=t[4]),r&1&&(a.withAnimation=t[0]),r&2&&(a.tag=t[6]),r&4&&(a.mediaStore=t[2]),n.$set(a)},i(s){o||(P(n.$$.fragment,s),o=!0)},o(s){D(n.$$.fragment,s),o=!1},d(s){s&&L(e),Z(n,s)}}}function Db(i){let t,e,n=i[3].enabled&&ha(i);return{c(){n&&n.c(),t=ge()},m(o,s){n&&n.m(o,s),M(o,t,s),e=!0},p(o,[s]){o[3].enabled?n?(n.p(o,s),s&8&&P(n,1)):(n=ha(o),n.c(),P(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(P(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&L(t)}}}function Lb(i,t,e){let{withAnimation:n=!1}=t,{tags:o=[]}=t,{hooks:s}=t,{mediaStore:r}=t,{state:a}=t,{temporaryState:l}=t;return Ki("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 Sb extends oe{constructor(t){super(),ie(this,t,Lb,Db,ne,{withAnimation:0,tags:1,hooks:5,mediaStore:2,state:3,temporaryState:4},xb)}}const Mb=new gc.GLTFLoader;function Tb(i){return new Promise((t,e)=>{function n(s){t(s)}function o(s){e(s)}Mb.load(i,n,void 0,o)})}class zb extends Bp{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=>_(this,null,function*(){var l;const n=e.data.modelUrl;if(!n)return;const o=Tb(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.getVisibleByFloorIndex(e);const a=this.gltfObjectGroup.children.find(c=>c.customID===e.id);if(a&&this.gltfObjectGroup.remove(a),this.getRenderType(e)==="Mesh"){if(!e.imagePlane){const c=e.data.mediaPosition.map(qe);e.imagePlane=new nr(e.data.mediaData[0].url,e.data.mediaPosition.map(qe));const u=new j.Vector3().addVectors(c[0],c[2]).divideScalar(2);e.imagePlane.position.copy(u),s.add(e.imagePlane)}}else this.updateTagCss3DObjectMatrix(e,s);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.imagePlane)==null?void 0:n.parent)==null||o.remove(e.imagePlane)}),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 r,a,l,c;const o=(r=n.data.mediaData[0])==null?void 0:r.url;if(!o||(n.imagePlane&&(n.imagePlane.visible=(l=(a=n.state)==null?void 0:a.visible)!=null?l:!0),((c=n.imagePlane)==null?void 0:c.imageSrc)===o))return;const s=n.position.map(qe);n.imagePlane=new nr(o,s),n.imagePlane.setMatrixByCornerPoints(s),this.imagePlaneGroup.add(n.imagePlane)})}updateRender3DDomTag(){this.sort([...this.filterCSS3DTag]).forEach(n=>{var o,s;if(n.tag3DContentSvelte){const{svelteApp:r,domContainer: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=Kt(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 h="black";c.container.style.backgroundColor=h,c.container.style.border=`3px solid ${h}`,this.css3DRenderPlugin.hooks.on("render",()=>{var d;if(u.css3DObject.opacityMesh){const m=this.addObjectClickHandler(n,u.css3DObject.opacityMesh,g=>{this.hooks.emit("click",{event:g,target:"TagContent",tag:n})});(d=this.store.css3DRenderDisposer.get(n.id))==null||d.push(m)}})}const u=this.css3DRenderPlugin.create3DDomContainer(r,c);if(!u)return;this.store.css3DRenderDisposer.set(n.id,[u.dispose]),n.tag3DContentSvelte={svelteApp:new Yl({target:u.container,props:{tag:n,hooks:this.hooks,state:this.state,mediaStore:this.mediaStore,temporaryState:this.temporaryState}}),domContainer:u,initialNormal:a,currentNormal:a}}}),this.clearUnusedPanelTag()}updateRenderModelTag(){const e=o=>!this.enabledModelTagSet.has(o.customID);this.gltfObjectGroup.remove(...this.gltfObjectGroup.children.filter(e)),this.tags.filter(Re).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.imagePlane&&(e.imagePlane.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.domContainer.css3DObject;if(!s)return;const r=Re(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=In(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 _(this,null,function*(){const n=e.filter(Re).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 Sb({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.domContainer)==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.domContainer.dispose(),e.tag3DContentSvelte=void 0});for(const[e,n]of this.store.css3DRenderDisposer){const o=this.getTagById(e);(!o||o.stickType==="2DPoint")&&(n==null||n.forEach(s=>s==null?void 0:s()),this.store.css3DRenderDisposer.delete(e))}}}const Ul="Dnalogel-PanoTagPlugin",Bb=i=>`${Ul}--${i}`;class ql extends zb{constructor(e,n){super(e);f(this,"state",{enabled:!0,visible:!0});f(this,"params");f(this,"debug");f(this,"changeTagModel",(e,n)=>_(this,null,function*(){e.data=rt.default({},e.data,n),yield this.loadModel(e),this.updateRenderAllTags()}));f(this,"handleFiveInitAnimationEnded",()=>{const e=this.five.getCurrentState().mode;this.tags.forEach(n=>{Re(n)&&e==="Panorama"&&this.changeTagMode(n,"front"),n.state.visible=this.getVisible(n)}),this.updateRenderAllTags()});f(this,"handleFiveModelShownFloorChange",()=>{this.tags.forEach(e=>{!Re(e)||(e.state.visible=this.getVisible(e))}),this.updateRenderAllTags()});this.params=Q({debug:!1,config:this.config},n),this.debug=this.params.debug,this.config=this.params.config,Dp(1,{namespace:ko.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 _(this,null,function*(){var s,r;this.clearTags(),console.info(Ul," load:",{data:JSON.parse(JSON.stringify(e))}),this.config=rt.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{Ap(this.five,this.tags)}catch(a){console.error(a)}return o})}addTag(e,n){return _(this,null,function*(){const s=(Array.isArray(e)?e:[e]).map(r=>{const a=this.getTagConfig(r);return fe(Q({},r),{state:Q({visible:void 0,unfolded:!this.can("fold",r)},a.initialState),hooks:new Ce.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(kp),this.tags.push(...s),Cp(this.five).then(()=>_(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=rt.default({},this.config,e):this.config=e,this.updateTagConfig({force:!0}),this.updateRenderAllTags()}changeGlobalConfig(e,n=!0){n?this.config.globalConfig=rt.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]=rt.default({},this.config.contentTypeConfig[e],n):this.config.contentTypeConfig[e]=n,this.clearCache(),this.updateRenderAllTags()}show(e){return _(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 _(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.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=rt.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?rt.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 _(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.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.svelteApp.$destroy(),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}=or(Pp(()=>{!this.store.resizeObserverDisposer||o()},500),e),{observe:a,unobserve:l}=or(ir(()=>n(),400),e);return s(),a(),()=>{r(),l()}}handleFiveModeChange(e){this.setModelMedialVisible(),this.tags.forEach(n=>{Re(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 ir(()=>{this.setUnfoldedByCamera(),this.updateRenderAllTags()},100)}handleFiveCameraUpdate(){this.updateRenderPointTag()}handleFivePanoArrived(){return _(this,null,function*(){this.setModelMedialVisible(),yield this.setVisibleAndUnfolded(),this.tags.forEach(e=>{e.temporaryState=fe(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.domContainer)==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 Vb=(i,t)=>new ql(i,t);function Jl(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 Dn{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 Jt,this.camera=t.camera,this.model=t.model,this.originObject3D=t.originObject3D,this.helperObject3D=t.helperObject3D,this.container=t.container,this.scene=t.scene,this.domEvents=new be(t.camera,t.container),this.onRender=(u=t.onRender)!=null?u:()=>{},this.offset=e==null?void 0:e.offset,this.initialHelperPosition(),this.initialHelperQuaternion(),this.enable();const n=(...h)=>this.onSetOriginObjectScale(...h),o=(...h)=>this.onSetOriginObjectRotate(...h),s=(...h)=>this.onSetOriginObjectPosition(...h),r=(...h)=>this.onApplyOriginObjectScale(...h),a=(...h)=>this.onApplyOriginObjectRotate(...h),l=(...h)=>this.onApplyOriginObjectPosition(...h);this.hooks.on("setObjectScale",n),this.hooks.on("setObjectRotate",o),this.hooks.on("setObjectPosition",s),this.hooks.on("applyObjectPosition",l),this.hooks.on("applyObjectRotate",a),this.hooks.on("applyObjectScale",r),this.disposers.push(()=>{this.hooks.off("setObjectScale",n),this.hooks.off("setObjectRotate",o),this.hooks.off("setObjectPosition",s),this.hooks.off("applyObjectPosition",l),this.hooks.off("applyObjectRotate",a),this.hooks.off("applyObjectScale",r)})}initialHelperPosition(){this.helperObject3D.position.add(this.calculateOffset(this.offset)),this.helperObject3D.initialPosition()}initialHelperQuaternion(){this.helperObject3D.initQuaternion()}enable(){this.enabled||(this.enabled=!0,this.scene.add(this.helperObject3D),this.helperObject3D.enable(),this.render())}disable(){!this.enabled||(this.enabled=!1,this.helperObject3D.disable(),this.render())}show(){this.helperObject3D.show(),this.render()}hide(){this.helperObject3D.hide(),this.render()}dispose(){var t;(t=this.disposers)==null||t.forEach(e=>e==null?void 0:e()),this.helperObject3D.dispose(),this.render()}applyHelperMatrix4(t){this.helperObject3D.applyMatrix4(t)}applyHelperQuaternion(t,e){this.helperObject3D.applyHelperQuaternion(t,e)}applyHelperScaleMatrix4(t,e){this.helperObject3D.applyHelperScaleMatrix4(t,e)}onWantsGesture(t,e,n){if(this.isDragging)return!1}onIntersectionOnModelUpdate(t){}onApplyOriginObjectScale(t){this.applyHelperScaleMatrix4(t.matrix,t.origin)}onApplyOriginObjectRotate(t){this.applyHelperQuaternion(t.quaternion,t.origin)}onApplyOriginObjectPosition(t){this.applyHelperMatrix4(t.matrix)}onSetOriginObjectScale(t){this.helperObject3D.scale.copy(t),this.updateOffsetByScale(t)}onSetOriginObjectRotate(t,e){this.helperObject3D.setHelperQuaternion(t,e)}onSetOriginObjectPosition(t){this.helperObject3D.position.copy(t.clone().add(this.calculateOffset(this.offset)))}render(){this.onRender()}updateOffsetByScale(t){if(this.boundingBox&&this.offset){const e=this.originObject3D.position,n=new 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(Zt),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=Jl(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 jb extends Dn{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 Zl(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 Ob 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 ki extends Ob{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){Zl(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 Rb extends ki{}class Qb extends ki{}class Fb extends ki{}class Kl extends ki{}class Hb extends Kl{}class _b extends E.Group{constructor(e){super();f(this,"direction");this.direction=e||"x"}}class ma extends E.Mesh{constructor(e,n,o){super(e,n);f(this,"direction");this.direction=o||"x"}}function Gb(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 Mo(i,t,e){if(!t||!e||!i)return;const n=Gb(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 Wb(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 Ni extends _b{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 ma(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 ma(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 Xi={X:15618642,Y:4765519,Z:4227839};class Gt{static get X(){return new E.Color(Xi.X).convertSRGBToLinear().clone()}static get Y(){return new E.Color(Xi.Y).convertSRGBToLinear().clone()}static get Z(){return new E.Color(Xi.Z).convertSRGBToLinear().clone()}}class Nb extends Rb{constructor(e){super(e);f(this,"xArrow",new Ni({direction:"x",color:Gt.X}));f(this,"yArrow",new Ni({direction:"y",color:Gt.Y}));f(this,"zArrow",new Ni({direction:"z",color:Gt.Z}));this.add(this.xArrow),this.add(this.yArrow),this.add(this.zArrow)}show(){super.show(),this.xArrow.visible=!0,this.yArrow.visible=!0,this.zArrow.visible=!0}showDraggingHelper(e){this.xArrow.visible=e.includes("x"),this.yArrow.visible=e.includes("y"),this.zArrow.visible=e.includes("z")}dispose(){this.remove(this.xArrow,this.yArrow,this.zArrow)}}function Lt(i,t){return Xb(document.createElement(t!=null?t:"div"),i)}function Xb(i,t){if(!t)return i;for(const e in t)e&&t[e]&&(i.style[e]=t[e]);return i}function Yb(i){const t=Lt(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 Ub extends Fb{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 Yi({direction:"x",color:Gt.X})),(n==null?void 0:n.xzCircleEnable)!==!1&&(this.yCircle=new Yi({direction:"y",color:Gt.Y})),(n==null?void 0:n.xyCircleEnable)!==!1&&(this.zCircle=new Yi({direction:"z",color:Gt.Z})),(n==null?void 0:n.container)&&(n==null?void 0:n.angleTipsEnable)!==!1&&(this.container=n==null?void 0:n.container,this.angleTips=Yb({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 Yi 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 qb(e),this.ring=new Jb(e),this.angleSector=new Zb(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 qb 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 Jb 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 Zb 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 Kb(){const i=Lt({width:"100%",height:"100%",left:"0",top:"0",position:"absolute",pointerEvents:"none"}),t=Lt({boxSizing:"border-box",width:"100%",height:"100%",left:"0",top:"0",position:"relative",display:"flex",alignItems:"center",justifyContent:"center"}),e=Lt({boxSizing:"border-box",width:"100%",height:"100%",left:"0",top:"0",position:"absolute",border:"1px solid rgba(255,255,255,0.4)"});i.appendChild(t),t.appendChild(e);const n="-4px",o={direction:"nesw",element: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=Lt(Q({background:"#FFFFFF",width:"9px",height:"9px",position:"absolute",pointerEvents:"none"},i)),e=Lt({width:"15px",height:"15px",position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",pointerEvents:"none"}),n=Lt({width:"15px",height:"15px",cursor:i==null?void 0:i.cursor,pointerEvents:"auto",background:"transparent"});return n.draggable=!0,e.appendChild(n),t.appendChild(e),t}class $b extends Hb{constructor(e,n,o,s){super(e);f(this,"points",[]);f(this,"cornerPositions",[]);f(this,"css3DInstance");f(this,"plane");f(this,"css3DRenderer",new Wt);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}=Kb();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 e1 extends Qb{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=Jl(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 t1 extends Dn{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=Mo(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 hn{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 n1="v1.0.1",i1="Object3DHelper",To=`${i1}@${n1}`,o1=()=>{console.error(`${To} is disposed`)},s1=()=>{console.warn(`${To} is disabled`)},r1=()=>{console.error(`${To} is disabled`)};class a1{constructor(t){f(this,"controllers",{});f(this,"state",{visible:!0,enabled:!0,disposed:!1});f(this,"hooks",new Jt);f(this,"eventListener",{});t&&this.addControllers(t),this.setState(this.state)}show(t){return _(this,null,function*(){this.setState({visible:!0},t)})}hide(t){return _(this,null,function*(){this.setState({visible:!1},t)})}enable(t){this.setState({enabled:!0},t)}disable(t){this.setState({enabled:!1},t)}dispose(){this.setState({disposed:!0})}setState(t,e){if(this.state.disposed)return o1();if(!this.state.enabled&&t.enabled!==!0&&t.disposed!==!0)return r1();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&&s1()}}function Ui(i){return i*Math.PI/180}class l1 extends Dn{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(Ui(n),Ui(o),Ui(s)),a=new E.Quaternion().setFromEuler(r);if(this.hooks.emit("wantToRotate",a))return;const{originObject3D:c,rotateCenter:u}=this;Zl(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=Mo(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(ol(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 c1 extends Dn{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=Mo(this.camera,e,this.container);if(!n)return this.dragEnd();this.scale(n)}scale(e){var H,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||Wb(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 O=new j.Vector3(0,0,0);if(!this.startInfo)return O;const S=(R==="ew"?h:d).clone(),F=c.clone().projectOnVector(S),G=a.clone().projectOnVector(S),Y=l.clone().projectOnVector(S);if(G.equals(F))return O;if(R==="ns"&&typeof this.startInfo.dragPointInCenterBottom!="boolean"){const U=new j.Vector3().subVectors(G,Y),ae=U.x<0&&S.x>=0,he=U.y<0&&S.y>=0,de=U.z<0&&S.z>=0;this.startInfo.dragPointInCenterBottom=ae||he||de}if(R==="ew"&&typeof this.startInfo.dragPointInCenterLeft!="boolean"){const U=new j.Vector3().subVectors(G,Y),ae=U.x<0&&S.x>=0,he=U.y<0&&S.y>=0,de=U.z<0&&S.z>=0;this.startInfo.dragPointInCenterLeft=ae||he||de}const W=new j.Vector3().subVectors(G,F),ee=W.length();return ee>.3?(console.warn("offset.length() > 0.3, skipped",ee),O):W},g=m("ew"),p=m("ns"),A=()=>{const R=g;this.helperObject3D.cornerPositions.forEach((O,S)=>{var F;(F=this.startInfo)!=null&&F.dragPointInCenterLeft?(S===0||S===3)&&O.add(R):(S===1||S===2)&&O.add(R)})},v=()=>{const R=p;this.helperObject3D.cornerPositions.forEach((O,S)=>{var F;(F=this.startInfo)!=null&&F.dragPointInCenterBottom?(S===0||S===1)&&O.add(R):(S===2||S===3)&&O.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),C=new E.Matrix4().scale(k);n.isCSS3DObjectPlus?n.applyScaleMatrix4(C):n.scale.applyMatrix4(C),o.position.copy(a);const I=new j.Vector3().addVectors(r[0],r[2]).divideScalar(2),B=new j.Vector3().subVectors(I,l),x=new E.Matrix4().setPosition(B);n.applyMatrix4(x),(H=this.helperObject3D.css3DInstance)==null||H.css3DObject.applyMatrix4(x),(N=this.helperObject3D.plane)==null||N.applyMatrix4(x),this.hooks.emit("applyObjectScale",{matrix:C}),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 u1 extends c1{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 d1 extends Dn{constructor(...e){super(...e);f(this,"name","BoundingBoxController")}}class h1 extends Kl{constructor(t){super(t)}}const co="Object3DHelperPlugin",xi=co,f1=()=>{console.error(`${xi} is disposed`)},m1=()=>{console.warn(`${xi} is disabled`)},g1=()=>{console.error(`${xi} is disabled`)};class $l extends xn{constructor(e){super(e);f(this,"name",co);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 Wt(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,{[`__${co.toUpperCase()}_DEBUG__`]:this})}show(e){return _(this,null,function*(){this.setState({visible:!0},e)})}hide(e){return _(this,null,function*(){this.setState({visible:!1},e)})}enable(e){this.setState({enabled:!0},e)}disable(e){this.setState({enabled:!1},e)}dispose(){this.setState({disposed:!0})}setState(e,n){if(this.state.disposed)return f1();if(!this.state.enabled&&e.enabled!==!0&&e.disposed!==!0)return g1();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 a1,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 Ce.Subscribe;if(l){const g=new Nb(e),p=this.getConfig(n.moveHelper),A=new hn(this.five,t1,e,g,p,d);o.addControllers({moveController:A.helperController}),s.push(()=>A.dispose())}if(c){const g=this.getConfig(n.rotateHelper),p=new Ub(e,Q({container:r},g)),A=new hn(this.five,l1,e,p,g,d);o.addControllers({rotateController:A.helperController}),s.push(()=>A.dispose())}if(h){const g=new e1(e),p=new hn(this.five,d1,e,g,void 0,d);o.addControllers({boundingBoxController:p.helperController})}if(u)if(e.isCSS3DObjectPlus&&r){const g=new $b(e,r,a,this.five.scene),p=new hn(this.five,u1,e,g,void 0,d);o.addControllers({scaleController:p.helperController}),s.push(()=>p.dispose()),Ca(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:Ea(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 h1(e),p=new hn(this.five,jb,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&&m1()}getConfig(e){if(!!e&&typeof e!="boolean"&&e.enable)return e}}const p1=i=>new $l(i),A1=`
|
|
626
|
+
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 L0(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){M(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:Y,o:Y,d(o){o&&L(t),e=!1,n()}}}function S0(i,t,e){let{active:n=!1}=t;function o(s){sn.call(this,i,s)}return i.$$set=s=>{"active"in s&&e(0,n=s.active)},[n,o]}class M0 extends oe{constructor(t){super(),ie(this,t,S0,L0,ne,{active:0},D0)}}function T0(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 br(i,t,e){const n=i.slice();return n[5]=t[e],n[7]=e,n}function yr(i,t){let e,n,o,s;function r(){return t[3](t[7])}return n=new M0({props:{active:t[1]===t[7]}}),n.$on("click",r),{key:i,first:null,c(){e=B("div"),K(n.$$.fragment),o=ee(),y(e,"class","sc-carousel-dots__dot-container svelte-670fde"),this.first=e},m(a,l){M(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||(P(n.$$.fragment,a),s=!0)},o(a){D(n.$$.fragment,a),s=!1},d(a){a&&L(e),Z(n)}}}function z0(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=br(i,s,a),c=r(l);n.set(c,e[a]=yr(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){M(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,Pt,yr,null,br),re())},i(a){if(!o){for(let l=0;l<s.length;l+=1)P(e[l]);o=!0}},o(a){for(let l=0;l<e.length;l+=1)D(e[l]);o=!1},d(a){a&&L(t);for(let l=0;l<e.length;l+=1)e[l].d()}}}function B0(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 V0 extends oe{constructor(t){super(),ie(this,t,B0,z0,ne,{pagesCount:0,currentPageIndex:1},T0)}}const qt="prev",wt="next";function j0(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 O0(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]===wt),q(e,"sc-carousel-arrow__arrow-prev",i[0]===qt),y(t,"class","sc-carousel-button sc-carousel-arrow__circle svelte-1bftafx"),q(t,"sc-carousel-arrow__circle_disabled",i[1])},m(s,r){M(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]===wt),r&1&&q(e,"sc-carousel-arrow__arrow-prev",s[0]===qt),r&2&&q(t,"sc-carousel-arrow__circle_disabled",s[1])},i:Y,o:Y,d(s){s&&L(t),n=!1,o()}}}function R0(i,t,e){let{direction:n=wt}=t,{disabled:o=!1}=t;function s(r){sn.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 Rl extends oe{constructor(t){super(),ie(this,t,R0,O0,ne,{direction:0,disabled:1},j0)}}function F0(i){le(i,"svelte-i7yfid",".sc-carousel-progress__indicator.svelte-i7yfid{height:100%;background-color:var(--sc-color-hex-dark-50p)}")}function Q0(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){M(e,t,n)},p(e,[n]){n&1&&z(t,"width",e[0]+"%")},i:Y,o:Y,d(e){e&&L(t)}}}const wr=100;function H0(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*wr,0),wr))},[n,o]}class _0 extends oe{constructor(t){super(),ie(this,t,H0,Q0,ne,{value:1},F0)}}function G0(i,t){i.addEventListener("mousedown",t),i.addEventListener("touchstart",t,{passive:!0})}function W0(i,t){i.removeEventListener("mousedown",t),i.removeEventListener("touchstart",t)}function N0(i,t){i.addEventListener("mouseup",t),i.addEventListener("touchend",t)}function Cr(i,t){i.removeEventListener("mouseup",t),i.removeEventListener("touchend",t)}function X0(i,t){i.addEventListener("mousemove",t),i.addEventListener("touchmove",t)}function Er(i,t){i.removeEventListener("mousemove",t),i.removeEventListener("touchmove",t)}function Lo(i){return function(t,e){i.dispatchEvent(new CustomEvent(t,{detail:e}))}}const Y0=110,U0=9,q0=111,J0=20;function Gi(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 Z0(i,{thresholdProvider:t}){const e=Lo(i);let n,o,s=0,r,a=!1;function l(){return Date.now()-r>=q0&&Math.abs(s)>=J0}function c(d){r=Date.now(),s=0,a=!0;const m=Gi(d);n=m.x,o=m.y,e("swipeStart",{x:n,y:o}),X0(window,u),N0(window,h)}function u(d){if(!a)return;const m=Gi(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?qt:wt}),Cr(window,h),Er(window,u))}function h(d){if(Cr(window,h),Er(window,u),a=!1,!l()){e("swipeFailed");return}const m=Gi(d);e("swipeEnd",{x:m.x,y:m.y})}return G0(i,c),{destroy(){W0(i,c)}}}function K0(i,t){i.addEventListener("mouseenter",t)}function $0(i,t){i.removeEventListener("mouseenter",t)}function eA(i,t){i.addEventListener("mouseleave",t)}function Pr(i,t){i.removeEventListener("mouseleave",t)}function tA(i){const t=Lo(i);function e(){eA(i,n),t("hovered",{value:!0})}function n(){t("hovered",{value:!1}),Pr(i,n)}return K0(i,e),{destroy(){$0(i,e),Pr(i,n)}}}const nA=(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 iA(i,t){i.addEventListener("touchstart",t,{passive:!0})}function oA(i,t){i.removeEventListener("touchstart",t)}function sA(i,t){i.addEventListener("touchend",t)}function Ir(i,t){i.removeEventListener("touchend",t)}function rA(i){const t=Lo(i);let e=0,n={x:0,y:0};function o({tapEndedAt:a,tapEndedPos:l}){const c=a-e,u=nA(n,l);return c<=Y0&&u<=U0}function s(a){e=Date.now();const l=a.touches[0];n={x:l.clientX,y:l.clientY},sA(i,r)}function r(a){Ir(i,r);const l=a.changedTouches[0];o({tapEndedAt:Date.now(),tapEndedPos:{x:l.clientX,y:l.clientY}})&&t("tapped")}return iA(i,s),{destroy(){oA(i,s),Ir(i,r)}}}function aA({currentParticleIndex:i,particlesCount:t,clonesCountHead:e,clonesCountTotal:n,particlesToScroll:o}){return i===t-e?0:i===0?Fl({particlesCountWithoutClones:t-n,particlesToScroll:o})-1:Math.floor((i-e)/o)}function lA({currentParticleIndex:i,particlesToScroll:t}){return Math.ceil(i/t)}function cA({currentParticleIndex:i,particlesCount:t,clonesCountHead:e,clonesCountTotal:n,infinite:o,particlesToScroll:s}){return o?aA({currentParticleIndex:i,particlesCount:t,clonesCountHead:e,clonesCountTotal:n,particlesToScroll:s}):lA({currentParticleIndex:i,particlesToScroll:s})}function Fl({particlesCountWithoutClones:i,particlesToScroll:t}){return Math.ceil(i/t)}function uA({particlesCountWithoutClones:i,particlesToScroll:t,particlesToShow:e}){const n=Ql({particlesCountWithoutClones:i,particlesToScroll:t,particlesToShow:e});return Math.ceil(i/t)-n}function dA({infinite:i,particlesCountWithoutClones:t,particlesToScroll:e,particlesToShow:n}){return i?Fl({particlesCountWithoutClones:t,particlesToScroll:e}):uA({particlesCountWithoutClones:t,particlesToScroll:e,particlesToShow:n})}function hA({pageIndex:i,clonesCountHead:t,clonesCountTail:e,particlesToScroll:n,particlesCount:o}){return _t(0,Math.min(t+i*n,o-e),o-1)}function fA({pageIndex:i,particlesToScroll:t,particlesCount:e,particlesToShow:n}){return _t(0,Math.min(i*t,e-n),e-1)}function Wi({infinite:i,pageIndex:t,clonesCountHead:e,clonesCountTail:n,particlesToScroll:o,particlesCount:s,particlesToShow:r}){return i?hA({pageIndex:t,clonesCountHead:e,clonesCountTail:n,particlesToScroll:o,particlesCount:s}):fA({pageIndex:t,particlesToScroll:o,particlesCount:s,particlesToShow:r})}function mA({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 Ql({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 gA(i){return new ResizeObserver(t=>{i({width:t[0].contentRect.width})})}function pA({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 AA({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 vA({infinite:i,particlesToShow:t,partialPageSize:e}){const n=i?{head:Math.ceil(e||t),tail:Math.ceil(t)}:{head:0,tail:0};return fe(F({},n),{total:n.head+n.tail})}const vn=(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},lo=i=>t=>{i[t]&&i[t]()},bA=(i,t)=>Cc.default(i,t),yA=i=>Object.keys(i||{}),wA=(i,t)=>{const e={};return i.forEach(n=>{e[n]=t[n]}),e},CA=()=>{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=yA(s);if(a.includes(n)){const l=wA(a,e);bA(s,l)||(i[o].deps=l,r())}})}}},EA=()=>{let i=null;return{targetWatcher(t,e){i={watcherName:t,fn:e},i.fn(),i=null},getTarget(){return i}}};function PA(i,t){const e=Sn.default(i,"data",{}),n=Sn.default(i,"watch",{}),o=Sn.default(i,"methods",{}),s=Sn.default(t,"onChange",()=>{}),{subscribe:r,notify:a,subscribers:l}=CA(),{targetWatcher:c,getTarget:u}=EA();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(wc.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 IA({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 kA({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=>IA({pageIndex:h,particlesToShow:o,particlesToScroll:s,particlesCount:n}));return{pageIndexes:c,particleIndexes:[...new Set(u)].sort((h,d)=>h-d)}}const xA=(i,t)=>(i(),setInterval(i,t)),DA=35,kr=1;class LA{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(DA,Math.max(this._autoplayDuration,1));let o=-n;this._interval=xA(()=>G(this,null,function*(){if(this._paused)return;o+=n;const s=o/this._autoplayDuration;this._onProgressValueChange(s),s>kr&&(this.reset(),yield t(),e())}),n)})}pause(){this._paused=!0}resume(){this._paused=!1}reset(){clearInterval(this._interval),this._onProgressValueChange(kr)}}function SA(i){const t=new LA({onProgressValueChange:r=>{i("progressValue",1-r)}}),e=PA({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=kA({infinite:r.infinite,pageIndex:r.currentPageIndex,pagesCount:r.pagesCount,particlesCount:r.particlesCountWithoutClones,particlesToShow:r.particlesToShow,particlesToScroll:r.particlesToScroll}).particleIndexes},setCurrentPageIndex({data:r}){r.currentPageIndex=cA({currentParticleIndex:r.currentParticleIndex,particlesCount:r.particlesCount,clonesCountHead:r.clonesCountHead,clonesCountTotal:r.clonesCountTotal,infinite:r.infinite,particlesToScroll:r.particlesToScroll})},setPartialPageSize({data:r}){r.partialPageSize=Ql({particlesToScroll:r.particlesToScroll,particlesToShow:r.particlesToShow,particlesCountWithoutClones:r.particlesCountWithoutClones})},setClonesCount({data:r}){const{head:a,tail:l}=vA({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=dA({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=Wi({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=Wi({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 G(this,arguments,function*({data:r,methods:a}){if(!r.infinite&&(r.autoplayDirection===wt&&r.currentParticleIndex===r.particlesCount-1||r.autoplayDirection===qt&&r.currentParticleIndex===0)){t.reset();return}if(r.autoplay){const c=()=>lo({[wt]:()=>G(this,null,function*(){return a.showNextPage()}),[qt]:()=>G(this,null,function*(){return a.showPrevPage()})})(r.autoplayDirection);yield t.start(c)}})},_jumpIfNeeded(l){return G(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 G(this,arguments,function*({data:r,methods:a},l,c){if(t.reset(),r.disabled)return;r.disabled=!0,l(),yield a.offsetPage({animated:vn(c,"animated",!0)}),r.disabled=!1,!(yield a._jumpIfNeeded())&&a._applyAutoplayIfNeeded()})},showNextPage(c,u){return G(this,arguments,function*({data:r,methods:a},l){r.disabled||(yield a.changePage(a._next,l))})},showPrevPage(c,u){return G(this,arguments,function*({data:r,methods:a},l){r.disabled||(yield a.changePage(a._prev,l))})},showParticle(c,u,h){return G(this,arguments,function*({methods:r},a,l){yield r.changePage(()=>r._moveToParticle(a),l)})},_getParticleIndexByPageIndex({data:r},a){return Wi({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 G(this,arguments,function*({methods:r},a,l){const d=r._getParticleIndexByPageIndex(a);yield r.showParticle(d,l)})},offsetPage({data:r},a){const l=vn(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 MA(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 TA=i=>({currentPageIndex:i[0]&32,pagesCount:i[0]&1024,loaded:i[0]&64}),xr=i=>({currentPageIndex:i[5],pagesCount:i[10],showPage:i[15],loaded:i[6]}),zA=i=>({loaded:i[0]&64,currentPageIndex:i[0]&32}),Dr=i=>({showNextPage:i[14].showNextPage,loaded:i[6],currentPageIndex:i[5]}),BA=i=>({loaded:i[0]&64,currentPageIndex:i[0]&32}),Lr=i=>({loaded:i[6],currentPageIndex:i[5]}),VA=i=>({loaded:i[0]&64,currentPageIndex:i[0]&32}),Sr=i=>({showPrevPage:i[14].showPrevPage,loaded:i[6],currentPageIndex:i[5]});function Mr(i){let t;const e=i[37].prev,n=en(e,i,i[36],Sr),o=n||jA(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)&&nn(n,e,s,s[36],t?tn(e,s[36],r,VA):on(s[36]),Sr):o&&o.p&&(!t||r[0]&36)&&o.p(s,t?r:[-1,-1])},i(s){t||(P(o,s),t=!0)},o(s){D(o,s),t=!1},d(s){o&&o.d(s)}}}function jA(i){let t,e,n;return e=new Rl({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){M(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||(P(e.$$.fragment,o),n=!0)},o(o){D(e.$$.fragment,o),n=!1},d(o){o&&L(t),Z(e)}}}function Tr(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){M(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||(P(e.$$.fragment,o),n=!0)},o(o){D(e.$$.fragment,o),n=!1},d(o){o&&L(t),Z(e)}}}function zr(i){let t;const e=i[37].next,n=en(e,i,i[36],Dr),o=n||OA(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)&&nn(n,e,s,s[36],t?tn(e,s[36],r,zA):on(s[36]),Dr):o&&o.p&&(!t||r[0]&1060)&&o.p(s,t?r:[-1,-1])},i(s){t||(P(o,s),t=!0)},o(s){D(o,s),t=!1},d(s){o&&o.d(s)}}}function OA(i){let t,e,n;return e=new Rl({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){M(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||(P(e.$$.fragment,o),n=!0)},o(o){D(e.$$.fragment,o),n=!1},d(o){o&&L(t),Z(e)}}}function Br(i){let t;const e=i[37].dots,n=en(e,i,i[36],xr),o=n||RA(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)&&nn(n,e,s,s[36],t?tn(e,s[36],r,TA):on(s[36]),xr):o&&o.p&&(!t||r[0]&1056)&&o.p(s,t?r:[-1,-1])},i(s){t||(P(o,s),t=!0)},o(s){D(o,s),t=!1},d(s){o&&o.d(s)}}}function RA(i){let t,e;return t=new V0({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||(P(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function FA(i){let t,e,n,o,s,r,a,l,c,u,h,d,m=i[1]&&Mr(i);const g=i[37].default,p=en(g,i,i[36],Lr);let A=i[3]&&Tr(i),v=i[1]&&zr(i),b=i[4]&&Br(i);return{c(){t=B("div"),e=B("div"),m&&m.c(),n=ee(),o=B("div"),s=B("div"),p&&p.c(),a=ee(),A&&A.c(),l=ee(),v&&v.c(),c=ee(),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){M(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=Z0.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(tA.call(null,o)),me(o,"hovered",i[21]),ct(rA.call(null,o)),me(o,"tapped",i[22])],h=!0)},p(w,k){w[1]?m?(m.p(w,k),k[0]&2&&P(m,1)):(m=Mr(w),m.c(),P(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)&&nn(p,g,w,w[36],u?tn(g,w[36],k,BA):on(w[36]),Lr),(!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&&$t(r.update)&&k[0]&2048&&r.update.call(null,{thresholdProvider:w[38]}),w[3]?A?(A.p(w,k),k[0]&8&&P(A,1)):(A=Tr(w),A.c(),P(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&&P(v,1)):(v=zr(w),v.c(),P(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&&P(b,1)):(b=Br(w),b.c(),P(b,1),b.m(t,null)):b&&(se(),D(b,1,1,()=>{b=null}),re())},i(w){u||(P(m),P(p,w),P(A),P(v),P(b),u=!0)},o(w){D(m),D(p,w),D(A),D(v),D(b),u=!1},d(w){w&&L(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,Ge(d)}}}function QA(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]=SA((te,ve)=>{lo({currentPageIndex:()=>e(5,r=ve),progressValue:()=>e(7,a=ve),offset:()=>e(8,l=ve),durationMs:()=>e(9,c=ve),pagesCount:()=>e(10,u=ve),loaded:()=>e(6,s=ve)})(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:C=3e3}=t,{autoplayDirection:T=wt}=t,{pauseOnFocus:x=!1}=t,{autoplayProgressVisible:H=!1}=t,{dots:N=!0}=t,{swiping:R=!0}=t,{particlesToShow:O=1}=t,{particlesToScroll:S=1}=t;function Q(te,ve){return G(this,null,function*(){const je=vn(ve,"animated",!0);if(typeof te!="number")throw new Error("pageIndex should be a number");yield m.showPage(te,{animated:je})})}function _(te){return G(this,null,function*(){const ve=vn(te,"animated",!0);yield m.showPrevPage({animated:ve})})}function X(te){return G(this,null,function*(){const ve=vn(te,"animated",!0);yield m.showNextPage({animated:ve})})}let W=0,$,U;const ae=gA(({width:te})=>{e(11,W=te),h.particleWidth=W/h.particlesToShow,mA({particlesContainerChildren:U.children,particleWidth:h.particleWidth}),m.offsetPage({animated:!1})});function he(){const{clonesToAppend:te,clonesToPrepend:ve}=pA({clonesCountHead:h.clonesCountHead,clonesCountTail:h.clonesCountTail,particlesContainerChildren:U.children});AA({particlesContainer:U,clonesToAppend:te,clonesToPrepend:ve})}Ze(()=>{G(this,null,function*(){yield _o(),U&&$&&(h.particlesCountWithoutClones=U.children.length,yield _o(),h.infinite&&he(),h.particlesCount=U.children.length,m.showPage(w,{animated:!1}),ae.observe($))})}),Et(()=>{ae.disconnect(),d.reset()});function de(te){return G(this,null,function*(){yield m.showPage(te,{animated:!0})})}function pe(){!R||(h.durationMs=0)}function Pe(te){return G(this,null,function*(){!R||(yield lo({[wt]:m.showNextPage,[qt]:m.showPrevPage})(te.detail.direction))})}function ke(te){!R||(h.offset+=te.detail.dx)}function Te(){!R||m.showParticle(h.currentParticleIndex)}function ce(){return G(this,null,function*(){!R||(yield m.offsetPage({animated:!0}))})}function Ae(te){h.focused=te.detail.value}function Ee(){m.toggleFocused()}function ue(){m.showPrevPage()}const Ye=()=>W/3;function st(te){Ve[te?"unshift":"push"](()=>{U=te,e(13,U)})}function ye(te){Ve[te?"unshift":"push"](()=>{$=te,e(12,$)})}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,C=te.autoplayDuration),"autoplayDirection"in te&&e(28,T=te.autoplayDirection),"pauseOnFocus"in te&&e(29,x=te.pauseOnFocus),"autoplayProgressVisible"in te&&e(3,H=te.autoplayProgressVisible),"dots"in te&&e(4,N=te.dots),"swiping"in te&&e(30,R=te.swiping),"particlesToShow"in te&&e(31,O=te.particlesToShow),"particlesToScroll"in te&&e(32,S=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=C),i.$$.dirty[0]&268435456&&(h.autoplayDirection=T),i.$$.dirty[0]&536870912&&(h.pauseOnFocus=x),i.$$.dirty[1]&1&&(h.particlesToShowInit=O),i.$$.dirty[1]&2&&(h.particlesToScrollInit=S)},[A,v,b,H,N,r,s,a,l,c,u,W,$,U,m,de,pe,Pe,ke,Te,ce,Ae,Ee,ue,w,k,I,C,T,x,R,O,S,Q,_,X,o,n,Ye,st,ye,$e]}class HA extends oe{constructor(t){super(),ie(this,t,QA,FA,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},MA,[-1,-1])}get goTo(){return this.$$.ctx[33]}get goToPrev(){return this.$$.ctx[34]}get goToNext(){return this.$$.ctx[35]}}function _A(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 Vr(i){let t;function e(s,r){if(s[2].type==="Image")return WA;if(s[2].type==="Video")return GA}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){M(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&&L(t),o&&o.d()}}}function GA(i){let t,e,n,o,s,r;function a(u,h){return u[7]&&u[2].videoCoverUrl?XA:NA}let l=a(i),c=l(i);return{c(){c.c(),t=ee(),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),M(u,t,h),M(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&&L(t),u&&L(e),s=!1,r()}}}function WA(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){M(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&&L(t)}}}function NA(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){M(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&&L(t),i[19](null),r=!1,Ge(a)}}}function XA(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){M(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&&L(t)}}}function YA(i){let t,e=i[2]&&Vr(i);return{c(){e&&e.c(),t=ge()},m(n,o){e&&e.m(n,o),M(n,t,o)},p(n,[o]){n[2]?e?e.p(n,o):(e=Vr(n),e.c(),e.m(t.parentNode,t)):e&&(e.d(1),e=null)},i:Y,o:Y,d(n){e&&e.d(n),n&&L(t)}}}function UA(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=vt("mediaStore"),v=vt("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})},C=R=>{e(10,m=!0),e(0,s.paused=!0,s),v.emit("playStateChange",{event:R,state:"paused",tag:r,mediaInstance:n})},T=R=>{n&&n.pause()};function x(R){Ve[R?"unshift":"push"](()=>{s.videoInstance=R,e(0,s)})}const H=()=>l==="withText"?Up:l==="withoutText"?qp: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,S=navigator.userAgent.toLowerCase().indexOf("iphone")!==-1&&R;n&&S&&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,C,T,x,H,N]}class Hl extends oe{constructor(t){super(),ie(this,t,UA,YA,ne,{mediaInstance:0,tag:1,media:2,playButtonIfNeed:3,playButtonSizeIfNeed:4,canPlay:5,objectFit:6,disableVideoIfHavePoster:7},_A)}}function qA(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 jr(i,t,e){const n=i.slice();return n[25]=t[e],n[26]=t,n[27]=e,n}function Or(i){let t,e,n,o,s,r,a;const l=[ZA,JA],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){M(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()),P(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||(P(o),h&&Fe(()=>{r&&r.end(1),s=Mt(t,Xo,i[6]?{y:4,duration:i[4],delay:i[2],easing:At}:void 0),s.start()}),a=!0)},o(h){D(o),s&&s.invalidate(),h&&(r=rn(t,Xo,i[6]?{y:4,duration:i[4],delay:i[3],easing:At}:void 0)),a=!1},d(h){h&&L(t),c[n].d(),h&&r&&r.end()}}}function JA(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 Hl({props:r}),Ve.push(()=>Za(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&&Ja(a[7]),l&1&&{tag:a[0]}]):{};!e&&l&256&&(e=!0,c.mediaInstance=a[8][0],Xa(()=>e=!1)),t.$set(c)},i(a){n||(P(t.$$.fragment,a),n=!0)},o(a){D(t.$$.fragment,a),n=!1},d(a){Z(t,a)}}}function ZA(i){let t,e,n={dots:!1,arrows:!1,$$slots:{default:[KA]},$$scope:{ctx:i}};return t=new HA({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||(P(t.$$.fragment,o),e=!0)},o(o){D(t.$$.fragment,o),e=!1},d(o){i[18](null),Z(t,o)}}}function Rr(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 Hl({props:r}),Ve.push(()=>Za(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&&Ja(i[7]),l&1024&&{media:i[25]},l&1&&{tag:i[0]}]):{};!e&&l&256&&(e=!0,c.mediaInstance=i[8][i[27]],Xa(()=>e=!1)),t.$set(c)},i(a){n||(P(t.$$.fragment,a),n=!0)},o(a){D(t.$$.fragment,a),n=!1},d(a){Z(t,a)}}}function KA(i){let t,e,n=i[10],o=[];for(let r=0;r<n.length;r+=1)o[r]=Rr(jr(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=ge()},m(r,a){for(let l=0;l<o.length;l+=1)o[l].m(r,a);M(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=jr(r,n,l);o[l]?(o[l].p(c,a),P(o[l],1)):(o[l]=Rr(c),o[l].c(),P(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)P(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&&L(t)}}}function $A(i){let t,e,n=i[5]&&Or(i);return{c(){n&&n.c(),t=ge()},m(o,s){n&&n.m(o,s),M(o,t,s),e=!0},p(o,[s]){o[5]?n?(n.p(o,s),s&32&&P(n,1)):(n=Or(o),n.c(),P(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(P(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&L(t)}}}function ev(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={autoplay:!0,autoplayVideo:!1}}=t,v=[],b=0,w,k=null;const I=vt("hooks"),C=vt("mediaStore");function T(){const O=v[b],S=O==null?void 0:O.videoInstance;!S||(S.paused?(S.muted=!1,S.play()):S.pause())}Ze(()=>{I.on("click",O=>{var S,Q,_;!((_=(Q=(S=a.tag3DContentSvelte)==null?void 0:S.domContainer)==null?void 0:Q.css3DObject)!=null&&_.opacityMesh)||O.tag.id===a.id&&T()}),k=setInterval(()=>{r&&(w==null||w.goToNext())},3e3)}),Et(()=>{clearInterval(k),I.off("click",T)});function x(O,S){i.$$.not_equal(v[S],O)&&(v[S]=O,e(8,v))}function H(O){Ve[O?"unshift":"push"](()=>{w=O,e(12,w)})}const N=O=>{n||C.set({currentMediaElement:null}),e(11,b=O.detail)};function R(O){i.$$.not_equal(v[0],O)&&(v[0]=O,e(8,v))}return i.$$set=O=>{"tag"in O&&e(0,a=O.tag),"mediaData"in O&&e(1,l=O.mediaData),"inDelay"in O&&e(2,c=O.inDelay),"outDelay"in O&&e(3,u=O.outDelay),"duration"in O&&e(4,h=O.duration),"unfolded"in O&&e(5,d=O.unfolded),"animation"in O&&e(6,m=O.animation),"mediaItemConfig"in O&&e(7,g=O.mediaItemConfig),"enableCarousel"in O&&e(15,p=O.enableCarousel),"autoplayConfig"in O&&e(16,A=O.autoplayConfig)},i.$$.update=()=>{i.$$.dirty&256&&e(9,n=v.every(O=>O.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.autoplay&&n)},[a,l,c,u,h,d,m,g,v,n,s,b,w,o,C,p,A,x,H,N,R]}class _l extends oe{constructor(t){super(),ie(this,t,ev,$A,ne,{tag:0,mediaData:1,inDelay:2,outDelay:3,duration:4,unfolded:5,animation:6,mediaItemConfig:7,enableCarousel:15,autoplayConfig:16},qA)}}function tv(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 Fr(i){let t,e,n,o,s,r,a,l;t=new ot({props:{visible:i[3],left:61,bottom:57,width:2,blurRadius:150,spreadRadius:75}}),o=new x0({props:{unfolded:i[3],outDelay:400}});let c=i[2]&&Qr(i),u=i[1]&&Hr(i);return{c(){K(t.$$.fragment),e=ee(),n=B("div"),K(o.$$.fragment),s=ee(),c&&c.c(),r=ee(),u&&u.c(),a=ge(),y(n,"class","line svelte-1f7m1lj")},m(h,d){J(t,h,d),M(h,e,d),M(h,n,d),J(o,n,null),M(h,s,d),c&&c.m(h,d),M(h,r,d),u&&u.m(h,d),M(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&&P(c,1)):(c=Qr(h),c.c(),P(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&&P(u,1)):(u=Hr(h),u.c(),P(u,1),u.m(a.parentNode,a)):u&&(se(),D(u,1,1,()=>{u=null}),re())},i(h){l||(P(t.$$.fragment,h),P(o.$$.fragment,h),P(c),P(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&&L(e),h&&L(n),Z(o),h&&L(s),c&&c.d(h),h&&L(r),u&&u.d(h),h&&L(a)}}}function Qr(i){let t,e,n;return e=new jl({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){M(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||(P(e.$$.fragment,o),n=!0)},o(o){D(e.$$.fragment,o),n=!1},d(o){o&&L(t),Z(e)}}}function Hr(i){let t,e,n;return e=new _l({props:{autoplayConfig:{autoplay:!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){M(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||(P(e.$$.fragment,o),n=!0)},o(o){D(e.$$.fragment,o),n=!1},d(o){o&&L(t),Z(e)}}}function nv(i){let t,e,n=i[0].state&&Fr(i);return{c(){n&&n.c(),t=ge()},m(o,s){n&&n.m(o,s),M(o,t,s),e=!0},p(o,[s]){o[0].state?n?(n.p(o,s),s&1&&P(n,1)):(n=Fr(o),n.c(),P(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(P(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&L(t)}}}function iv(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 ov extends oe{constructor(t){super(),ie(this,t,iv,nv,ne,{tag:0},tv)}}function sv(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 _r(i,t,e){const n=i.slice();return n[0]=t[e],n}function Gr(i,t,e){const n=i.slice();return n[0]=t[e],n}function Wr(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){M(n,t,o)},p(n,o){o&8&&!Xe(t.src,e=n[3].headerPictureUrl)&&y(t,"src",e)},d(n){n&&L(t)}}}function Nr(i){let t,e,n,o,s=i[2]||[],r=[];for(let c=0;c<s.length;c+=1)r[c]=Xr(Gr(i,s,c));let a=i[5]||[],l=[];for(let c=0;c<a.length;c+=1)l[c]=Yr(_r(i,a,c));return{c(){t=B("div"),e=B("div");for(let c=0;c<r.length;c+=1)r[c].c();n=ee();for(let c=0;c<l.length;c+=1)l[c].c();y(e,"class","tags svelte-sezqcq"),Fe(()=>i[11].call(e)),y(t,"class","tags-wrapper svelte-sezqcq")},m(c,u){M(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=pi(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=Gr(c,s,h);r[h]?r[h].p(d,u):(r[h]=Xr(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=_r(c,a,h);l[h]?l[h].p(d,u):(l[h]=Yr(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&&L(t),ut(r,c),ut(l,c),o()}}}function Xr(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",So)},m(o,s){M(o,t,s),V(t,n)},p(o,s){s&4&&e!==(e=o[0]+"")&&Me(n,e)},d(o){o&&L(t)}}}function Yr(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",So)},m(o,s){M(o,t,s),V(t,n)},p(o,s){s&32&&e!==(e=o[0]+"")&&Me(n,e)},d(o){o&&L(t)}}}function Ur(i){let t,e,n=i[7]&&qr(i),o=i[3].highlightText&&Zr(i);return{c(){t=B("div"),n&&n.c(),e=ee(),o&&o.c(),y(t,"class","footer svelte-sezqcq")},m(s,r){M(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=qr(s),n.c(),n.m(t,e)):n&&(n.d(1),n=null),s[3].highlightText?o?o.p(s,r):(o=Zr(s),o.c(),o.m(t,null)):o&&(o.d(1),o=null)},d(s){s&&L(t),n&&n.d(),o&&o.d()}}}function qr(i){let t,e,n=i[3].price.value+"",o,s,r=i[3].price.unit&&Jr(i);return{c(){t=B("div"),e=B("span"),o=xe(n),s=ee(),r&&r.c(),y(e,"class","value svelte-sezqcq"),y(t,"class","price svelte-sezqcq")},m(a,l){M(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+"")&&Me(o,n),a[3].price.unit?r?r.p(a,l):(r=Jr(a),r.c(),r.m(t,null)):r&&(r.d(1),r=null)},d(a){a&&L(t),r&&r.d()}}}function Jr(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){M(o,t,s),V(t,n)},p(o,s){s&8&&e!==(e=o[3].price.unit+"")&&Me(n,e)},d(o){o&&L(t)}}}function Zr(i){let t,e,n,o,s=i[3].highlightText+"",r,a,l;return{c(){t=B("div"),e=B("div"),n=ee(),o=B("span"),r=xe(s),a=ee(),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){M(c,t,u),V(t,e),V(t,n),V(t,o),V(o,r),M(c,a,u),M(c,l,u)},p(c,u){u&8&&s!==(s=c[3].highlightText+"")&&Me(r,s)},d(c){c&&L(t),c&&L(a),c&&L(l)}}}function rv(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 ot({props:{visible:i[4],outDelay:500,left:61,bottom:87,blurRadius:150,spreadRadius:75}});let v=i[3].headerPictureUrl&&Wr(i),b=((k=i[2].length)!=null?k:0)+((I=i[5].length)!=null?I:0)>0&&Nr(i),w=(i[7]||i[3].highlightText)&&Ur(i);return{c(){t=B("div"),K(e.$$.fragment),n=ee(),o=B("div"),s=ee(),r=B("div"),v&&v.c(),a=ee(),l=B("div"),c=B("div"),u=B("div"),d=xe(h),m=ee(),b&&b.c(),g=ee(),w&&w.c(),y(o,"class","line svelte-sezqcq"),z(o,"transition-delay",i[4]?Xn+"ms":Yn+$r-Kr-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",it(i[9])),z(r,"transition-delay",i[4]?Xn+Yn+"ms":"0ms"),y(t,"class",p=Ie(`marketing ${i[6]}`)+" svelte-sezqcq"),q(t,"unfolded",i[4]),q(t,"folded",i[8])},m(C,T){M(C,t,T),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(C,[T]){var H,N;const x={};T&16&&(x.visible=C[4]),e.$set(x),T&16&&z(o,"transition-delay",C[4]?Xn+"ms":Yn+$r-Kr-40+"ms"),C[3].headerPictureUrl?v?v.p(C,T):(v=Wr(C),v.c(),v.m(r,a)):v&&(v.d(1),v=null),(!A||T&8)&&h!==(h=C[3].title+"")&&Me(d,h),((H=C[2].length)!=null?H:0)+((N=C[5].length)!=null?N:0)>0?b?b.p(C,T):(b=Nr(C),b.c(),b.m(r,g)):b&&(b.d(1),b=null),C[7]||C[3].highlightText?w?w.p(C,T):(w=Ur(C),w.c(),w.m(r,null)):w&&(w.d(1),w=null),T&16&&z(r,"transition-delay",C[4]?Xn+Yn+"ms":"0ms"),(!A||T&64&&p!==(p=Ie(`marketing ${C[6]}`)+" svelte-sezqcq"))&&y(t,"class",p),(!A||T&80)&&q(t,"unfolded",C[4]),(!A||T&320)&&q(t,"folded",C[8])},i(C){A||(P(e.$$.fragment,C),A=!0)},o(C){D(e.$$.fragment,C),A=!1},d(C){C&&L(t),Z(e),v&&v.d(),b&&b.d(),w&&w.d()}}}const So=40,Xn=400,Kr=500,Yn=180,$r=500;function av(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=Zt((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)/So),[h,d,c,s,n,u,a,r,o,m,l,g]}class lv extends oe{constructor(t){super(),ie(this,t,av,rv,ne,{tag:0},sv)}}class cv 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 G(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=xp(this.sharedAudioSrc,{namespace:ko.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 uv(i){le(i,"svelte-13e7hxv",".audio.svelte-13e7hxv{pointer-events:auto;cursor:pointer;width:100%;height:100%}")}function dv(i){let t,e,n,o;const s=i[8].default,r=en(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){M(a,t,l),r&&r.m(t,null),e=!0,n||(o=me(t,"click",Fa(i[1])),n=!0)},p(a,[l]){r&&r.p&&(!e||l&128)&&nn(r,s,a,a[7],e?tn(s,a[7],l,null):on(a[7]),null),(!e||l&1)&&y(t,"style",a[0])},i(a){e||(P(r,a),e=!0)},o(a){D(r,a),e=!1},d(a){a&&L(t),r&&r.d(a),n=!1,o()}}}function hv(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=vt("hooks"),h=vt("mediaStore");let d,m=!0;function g(){e(5,d.onplay=A=>{u.emit("playStateChange",F({event:A,state:"playing",mediaInstance:d},l)),c("play"),e(6,m=!1)},d),e(5,d.onpause=A=>{u.emit("playStateChange",F({event:A,state:"paused",mediaInstance:d},l)),c("pause"),e(6,m=!0)},d),e(5,d.onended=A=>{u.emit("playStateChange",F({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",F({event:A,target:"AudioTagPlayIcon",audioInstance:d},l)),h.set({currentMediaElement:d}),u.emit("playStateChange",F({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 cv(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 Gl extends oe{constructor(t){super(),ie(this,t,hv,dv,ne,{url:2,enable:3,style:0,hooksInfo:4},uv)}}function fv(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 ea(i){let t,e;return t=new ot({props:{center:!0,blurRadius:12,spreadRadius:5}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},i(n){e||(P(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function mv(i){let t,e,n,o,s,r=i[1]&&ea();return{c(){t=B("div"),r&&r.c(),e=ee(),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){M(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&&P(r,1):(r=ea(),r.c(),P(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||(P(r),s=!0)},o(a){D(r),s=!1},d(a){a&&L(t),r&&r.d(),i[7](null),i[8](null)}}}function gv(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"?it(a):a)},[o,s,r,l,c,n,a,u,h]}class Wl extends oe{constructor(t){super(),ie(this,t,gv,mv,ne,{playing:0,shadow:1,style:2,width:6},fv)}}function pv(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 ta(i){var A,v;let t,e,n,o,s,r,a,l,c,u,h,d,m,g;e=new ot({props:{visible:i[6],left:i[3]/2+"px",bottom:12,width:2,blurRadius:120,spreadRadius:60}});let p=i[6]&&na(i);return c=new Ol({props:{visible:i[6],textUnfolded:i[1],content:i[5]}}),h=new xo({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=ee(),o=B("div"),s=B("div"),r=B("div"),p&&p.c(),a=ee(),l=B("div"),K(c.$$.fragment),u=ee(),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){M(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(an.call(null,l)),me(l,"clientWidth",i[12])],m=!0)},p(b,w){var T,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&&P(p,1)):(p=na(b),p.c(),P(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 C={};w&64&&(C.unfolded=b[6]),w&8&&(C.length=b[3]),w&48&&(C.outDelay=b[4]+20*Math.min((x=(T=b[5])==null?void 0:T.length)!=null?x:10,15)),h.$set(C),(!d||w&64)&&q(t,"unfolded",b[6])},i(b){d||(P(e.$$.fragment,b),P(p),P(c.$$.fragment,b),P(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&&L(t),Z(e),p&&p.d(),Z(c),Z(h),m=!1,Ge(g)}}}function na(i){let t,e,n,o,s,r,a;return e=new ot({props:{center:!0,blurRadius:15,spreadRadius:6}}),o=new Gl({props:{enable:i[6],url:i[0].data.audioUrl,hooksInfo:{tag:i[0]},$$slots:{default:[Av]},$$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=ee(),K(o.$$.fragment),y(t,"class","audio svelte-1s6gk4a")},m(l,c){M(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||(P(e.$$.fragment,l),P(o.$$.fragment,l),l&&Fe(()=>{r&&r.end(1),s=Mt(t,St,{duration:1e3,delay:0,easing:Xt}),s.start()}),a=!0)},o(l){var c,u;D(e.$$.fragment,l),D(o.$$.fragment,l),s&&s.invalidate(),l&&(r=rn(t,St,{duration:1e3,delay:20*Math.min((u=(c=i[5])==null?void 0:c.length)!=null?u:10,15),easing:Xt})),a=!1},d(l){l&&L(t),Z(e),Z(o),l&&r&&r.end()}}}function Av(i){let t,e,n;return e=new Wl({props:{playing:i[2]}}),{c(){t=B("div"),K(e.$$.fragment),y(t,"class","audio-icon__wrapper svelte-1s6gk4a")},m(o,s){M(o,t,s),J(e,t,null),n=!0},p(o,s){const r={};s&4&&(r.playing=o[2]),e.$set(r)},i(o){n||(P(e.$$.fragment,o),n=!0)},o(o){D(e.$$.fragment,o),n=!1},d(o){o&&L(t),Z(e)}}}function vv(i){let t,e,n=i[0].state&&ta(i);return{c(){n&&n.c(),t=ge()},m(o,s){n&&n.m(o,s),M(o,t,s),e=!0},p(o,[s]){o[0].state?n?(n.p(o,s),s&1&&P(n,1)):(n=ta(o),n.c(),P(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(P(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&L(t)}}}function bv(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){sn.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 yv extends oe{constructor(t){super(),ie(this,t,bv,vv,ne,{tag:0},pv)}}function wv(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 ia(i){let t,e,n,o;return n=new Gl({props:{style:"width: max-content; height: max-content;",enable:i[0].state.visible,url:i[0].data.audioUrl,hooksInfo:{tag:i[0]},$$slots:{default:[Ev]},$$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){M(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||(P(n.$$.fragment,s),o=!0)},o(s){D(n.$$.fragment,s),o=!1},d(s){s&&L(t),Z(n)}}}function Cv(i){let t;return{c(){t=xe(i[5])},m(e,n){M(e,t,n)},p(e,n){n&32&&Me(t,e[5])},d(e){e&&L(t)}}}function Ev(i){let t,e,n,o,s,r,a;return n=new Wl({props:{playing:i[3]}}),r=new Do({props:{maxWidth:72,$$slots:{default:[Cv]},$$scope:{ctx:i}}}),{c(){t=B("div"),e=B("div"),K(n.$$.fragment),o=ee(),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){M(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||(P(n.$$.fragment,l),P(r.$$.fragment,l),a=!0)},o(l){D(n.$$.fragment,l),D(r.$$.fragment,l),a=!1},d(l){l&&L(t),Z(n),Z(r)}}}function Pv(i){let t,e,n=i[0].state&&ia(i);return{c(){n&&n.c(),t=ge()},m(o,s){n&&n.m(o,s),M(o,t,s),e=!0},p(o,[s]){o[0].state?n?(n.p(o,s),s&1&&P(n,1)):(n=ia(o),n.c(),P(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(P(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&L(t)}}}function Iv(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){sn.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 kv extends oe{constructor(t){super(),ie(this,t,Iv,Pv,ne,{tag:0},wv)}}function xv(i){let t,e;return t=new kv({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||(P(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function Dv(i){let t,e;return t=new yv({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||(P(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function Lv(i){let t,e,n,o;const s=[Dv,xv],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=ge()},m(l,c){~t&&r[t].m(l,c),M(l,n,c),o=!0},p(l,[c]){let u=t;t=a(l),t===u?~t&&r[t].p(l,c):(e&&(se(),D(r[u],1,1,()=>{r[u]=null}),re()),~t?(e=r[t],e?e.p(l,c):(e=r[t]=s[t](l),e.c()),P(e,1),e.m(n.parentNode,n)):e=null)},i(l){o||(P(e),o=!0)},o(l){D(e),o=!1},d(l){~t&&r[t].d(l),l&&L(n)}}}function Sv(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 Mv extends oe{constructor(t){super(),ie(this,t,Sv,Lv,ne,{tag:0})}}function Tv(i){le(i,"svelte-10cw0el",".media-wrapper.svelte-10cw0el{position:absolute;width:100%;height:100%}")}function oa(i){var o;let t,e,n;return e=new _l({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){M(s,t,r),J(e,t,null),n=!0},p(s,r){var l;const a={};r&20&&(a.mediaItemConfig={canPlay:!0,playButtonSizeIfNeed:"large",playButtonIfNeed:(l=s[4])!=null?l:"withText",disableVideoIfHavePoster:!1,objectFit:s[2]}),r&64&&(a.unfolded=s[6]),r&32&&(a.mediaData=s[5]),r&2&&(a.enableCarousel=s[1]),r&8&&(a.autoplayConfig=s[3]),r&1&&(a.tag=s[0]),e.$set(a)},i(s){n||(P(e.$$.fragment,s),n=!0)},o(s){D(e.$$.fragment,s),n=!1},d(s){s&&L(t),Z(e)}}}function zv(i){let t,e,n=i[0].state&&i[5]&&oa(i);return{c(){n&&n.c(),t=ge()},m(o,s){n&&n.m(o,s),M(o,t,s),e=!0},p(o,[s]){o[0].state&&o[5]?n?(n.p(o,s),s&33&&P(n,1)):(n=oa(o),n.c(),P(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(P(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&L(t)}}}function Bv(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 Vv extends oe{constructor(t){super(),ie(this,t,Bv,zv,ne,{tag:0},Tv)}}function Nl(i){return G(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 jv(i){return G(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 Nl(t);return fe(F({},i),{width:n/e,height:o/e})})}function Ov(i){return G(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 Nl(e),a=s/n,l=r/n,c=a/t,u=l,h=1/o*t+"s";return fe(F({},i),{width:c,height:u,duration:h})})}function Rv(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 sa(i){i[1]=i[19].width}function ra(i){i[1]=i[19].width,i[16]=i[19].height,i[17]=i[19].steps,i[18]=i[19].duration}function aa(i){let t,e,n,o=i[0]&&la();function s(l,c){return l[8]?Qv:Fv}let r=s(i),a=r(i);return{c(){t=B("div"),o&&o.c(),e=ee(),a.c(),y(t,"class","icon"),z(t,"width",i[1])},m(l,c){M(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&&P(o,1):(o=la(),o.c(),P(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||(P(o),n=!0)},o(l){D(o),n=!1},d(l){l&&L(t),o&&o.d(),a.d()}}}function la(i){let t,e;return t=new ot({props:{center:!0,blurRadius:24,spreadRadius:16}}),{c(){K(t.$$.fragment)},m(n,o){J(t,n,o),e=!0},i(n){e||(P(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function Fv(i){let t,e,n={ctx:i,current:null,token:null,hasCatch:!1,pending:Gv,then:_v,catch:Hv,value:19};return si(e=i[11](Le({url:i[7],ratio:i[5]})),n),{c(){t=ge(),n.block.c()},m(o,s){M(o,t,s),n.block.m(o,n.anchor=s),n.mount=()=>t.parentNode,n.anchor=t},p(o,s){i=o,n.ctx=i,s&160&&e!==(e=i[11](Le({url:i[7],ratio:i[5]})))&&si(e,n)||qa(n,i,s)},d(o){o&&L(t),n.block.d(o),n.token=null,n=null}}}function Qv(i){let t,e,n={ctx:i,current:null,token:null,hasCatch:!1,pending:Xv,then:Nv,catch:Wv,value:19};return si(e=i[10](Le({url:i[7],steps:i[2],fps:i[6],ratio:i[5]})),n),{c(){t=ge(),n.block.c()},m(o,s){M(o,t,s),n.block.m(o,n.anchor=s),n.mount=()=>t.parentNode,n.anchor=t},p(o,s){i=o,n.ctx=i,s&228&&e!==(e=i[10](Le({url:i[7],steps:i[2],fps:i[6],ratio:i[5]})))&&si(e,n)||qa(n,i,s)},d(o){o&&L(t),n.block.d(o),n.token=null,n=null}}}function Hv(i){return{c:Y,m:Y,p:Y,d:Y}}function _v(i){sa(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",it(Qt({originWidth:i[1],scale:i[4],wantedWidth:i[3]}).width))},m(n,o){M(n,t,o)},p(n,o){sa(n),o&128&&!Xe(t.src,e=n[7])&&y(t,"src",e),o&184&&z(t,"width",it(Qt({originWidth:n[1],scale:n[4],wantedWidth:n[3]}).width))},d(n){n&&L(t)}}}function Gv(i){return{c:Y,m:Y,p:Y,d:Y}}function Wv(i){return{c:Y,m:Y,p:Y,d:Y}}function Nv(i){ra(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",it(Qt({originWidth:i[1],originHeight:i[16],scale:i[4],wantedWidth:i[3]}).width)),z(t,"height",it(Qt({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){M(o,t,s)},p(o,s){ra(o),s&252&&z(t,"width",it(Qt({originWidth:o[1],originHeight:o[16],scale:o[4],wantedWidth:o[3]}).width)),s&252&&z(t,"height",it(Qt({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&&L(t)}}}function Xv(i){return{c:Y,m:Y,p:Y,d:Y}}function Yv(i){let t,e,n=i[9]&&aa(i);return{c(){n&&n.c(),t=ge()},m(o,s){n&&n.m(o,s),M(o,t,s),e=!0},p(o,[s]){o[9]?n?(n.p(o,s),s&512&&P(n,1)):(n=aa(o),n.c(),P(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(P(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&L(t)}}}function Qt(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(F({},i),{width:s,height:r})}function Uv(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 G(this,null,function*(){const k=yield Ov(w);return p("iconLoaded",k),k})}function v(w){return G(this,null,function*(){if(typeof h=="number")return fe(F({},w),{width:h});const k=yield jv(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 Xl extends oe{constructor(t){super(),ie(this,t,Uv,Yv,ne,{width:1,icon:12,shadow:0},Rv)}}function qv(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 ca(i){let t,e,n,o,s,r;return e=new ot({props:{outDelay:0,inDelay:0,center:!0,width:"80%",blurRadius:40,spreadRadius:16,opacity:.08}}),{c(){t=B("div"),K(e.$$.fragment),n=ee(),o=B("div"),s=xe(i[1]),y(o,"class","text svelte-e58ijk"),y(t,"class","text-wrapper svelte-e58ijk")},m(a,l){M(a,t,l),J(e,t,null),V(t,n),V(t,o),V(o,s),r=!0},p(a,l){(!r||l&2)&&Me(s,a[1])},i(a){r||(P(e.$$.fragment,a),r=!0)},o(a){D(e.$$.fragment,a),r=!1},d(a){a&&L(t),Z(e)}}}function Jv(i){let t,e,n,o;e=new Xl({props:{icon:i[0],shadow:!0}}),e.$on("iconLoaded",i[4]);let s=i[1]&&i[2]&&ca(i);return{c(){t=B("div"),K(e.$$.fragment),n=ee(),s&&s.c(),y(t,"class","wrapper svelte-e58ijk")},m(r,a){M(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&&P(s,1)):(s=ca(r),s.c(),P(s,1),s.m(t,null)):s&&(se(),D(s,1,1,()=>{s=null}),re())},i(r){o||(P(e.$$.fragment,r),P(s),o=!0)},o(r){D(e.$$.fragment,r),D(s),o=!1},d(r){r&&L(t),Z(e),s&&s.d()}}}function Zv(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 Kv extends oe{constructor(t){super(),ie(this,t,Zv,Jv,ne,{tag:3},qv)}}function $v(i){le(i,"svelte-kzl2aj",".customElement__container.svelte-kzl2aj{position:relative}")}function ua(i){let t,e=i[0].element+"",n;return{c(){t=new ti(!1),n=ge(),t.a=n},m(o,s){t.m(e,o,s),M(o,n,s)},p(o,s){s&1&&e!==(e=o[0].element+"")&&t.p(e)},d(o){o&&L(n),o&&t.d()}}}function eb(i){let t,e=typeof i[0].element=="string"&&ua(i);return{c(){t=B("div"),e&&e.c(),y(t,"class","customElement__container svelte-kzl2aj")},m(n,o){M(n,t,o),e&&e.m(t,null),i[2](t)},p(n,[o]){typeof n[0].element=="string"?e?e.p(n,o):(e=ua(n),e.c(),e.m(t,null)):e&&(e.d(1),e=null)},i:Y,o:Y,d(n){n&&L(t),e&&e.d(),i[2](null)}}}function tb(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)}}}),Et(()=>{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 nb extends oe{constructor(t){super(),ie(this,t,tb,eb,ne,{tag:0},$v)}}function ib(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/OAHgAyAAAQADAAIAAAAAAAAB9ABdAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlgAAAJYAAACWAAAAlg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vgHFRPss7Cnu78arYOreqgexWpNr0YbaWyDem4fUmlmTUcaXqBftGAeE/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 ob(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){M(n,t,o)},p(n,o){o&2&&e!==(e=n[1].id)&&y(t,"data-id",e)},i:Y,o:Y,d(n){n&&L(t)}}}function sb(i){let t,e,n,o,s,r,a,l,c,u;const h=[hb,db,ub,cb,lb,ab],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){M(g,t,p),V(t,e),V(e,n),~o&&d[o].m(n,null),l=!0,c||(u=me(t,"click",Fa(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()),P(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||(P(s),l=!0)},o(g){D(s),l=!1},d(g){g&&L(t),~o&&d[o].d(),c=!1,u()}}}function rb(i){let t,e,n,o,s,r,a;return e=new nb({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){M(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||(P(e.$$.fragment,l),s=!0)},o(l){D(e.$$.fragment,l),s=!1},d(l){l&&L(t),Z(e),r=!1,a()}}}function ab(i){let t,e;return t=new Vv({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||(P(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function lb(i){let t,e;return t=new Kv({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||(P(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function cb(i){let t,e;return t=new lv({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||(P(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 Mv({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||(P(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 ov({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||(P(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 E0({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||(P(t.$$.fragment,n),e=!0)},o(n){D(t.$$.fragment,n),e=!1},d(n){Z(t,n)}}}function fb(i){let t,e,n,o;const s=[rb,sb,ob],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=ge()},m(l,c){r[t].m(l,c),M(l,n,c),o=!0},p(l,[c]){let u=t;t=a(l),t===u?r[t].p(l,c):(se(),D(r[u],1,1,()=>{r[u]=null}),re(),e=r[t],e?e.p(l,c):(e=r[t]=s[t](l),e.c()),P(e,1),e.m(n.parentNode,n))},i(l){o||(P(e),o=!0)},o(l){D(e),o=!1},d(l){r[t].d(l),l&&L(n)}}}function mb(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;Ki("hooks",h),Ki("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,C,T){var x,H;return!(!C.visible||!C.enabled||!T.visible||!((x=I.state)!=null&&x.visible)||((H=I.temporaryState)==null?void 0:H.visible)===!1||Re(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,C,T,x,H,N,R,O,S,Q,_;i.$$.dirty&2&&e(11,n=(I=u.state)==null?void 0:I.unfolded),i.$$.dirty&2&&e(10,o=(C=u.state)==null?void 0:C.visible),i.$$.dirty&162&&e(12,s=d.visible&&g.visible&&((T=u.state)==null?void 0:T.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?(H=(x=u.hooks).emit)==null||H.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?(S=(O=u.hooks).emit)==null||S.call(O,"show"):(_=(Q=u.hooks).emit)==null||_.call(Q,"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 Yl extends oe{constructor(t){super(),ie(this,t,mb,fb,ne,{withAnimation:0,tag:1,hooks:2,state:5,mediaStore:6,temporaryState:7},ib)}}function gb(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 pb(i){let t,e,n,o,s,r,a,l,c,u,h,d;return o=new ot({props:{center:!0,blurRadius:15,spreadRadius:5,opacity:.3}}),c=new Xl({props:{icon:i[2],width:i[1]}}),c.$on("iconLoaded",i[7]),{c(){t=B("div"),e=B("div"),n=ee(),K(o.$$.fragment),s=ee(),r=B("div"),a=ee(),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){M(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||(P(o.$$.fragment,m),P(c.$$.fragment,m),u=!0)},o(m){D(o.$$.fragment,m),D(c.$$.fragment,m),u=!1},d(m){m&&L(t),Z(o),Z(c),h=!1,d()}}}function Ab(i,t,e){let n,o,s,r;const a=vt("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){sn.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:Jp}),i.$$.dirty&64&&e(1,r=(()=>{var I,C,T,x;const w=(C=(I=l.style)==null?void 0:I.point)==null?void 0:C.width;if(typeof w=="number")return w;const k=(x=(T=l.style)==null?void 0:T.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 vb extends oe{constructor(t){super(),ie(this,t,Ab,pb,ne,{tag:6},gb)}}function bb(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 yb(i){let t;return{c(){t=B("div"),y(t,"data-info","tag content is disable")},m(e,n){M(e,t,n)},p:Y,i:Y,o:Y,d(e){e&&L(t)}}}function wb(i){let t,e;return t=new Yl({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||(P(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){M(e,t,n)},p:Y,i:Y,o:Y,d(e){e&&L(t)}}}function Eb(i){let t,e;return t=new vb({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||(P(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,s,r,a,l,c,u;const h=[wb,yb],d=[];function m(v,b){return v[12]?0:1}n=m(i),o=d[n]=h[n](i);const g=[Eb,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=ee(),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){M(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()),P(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()),P(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||(P(o),P(a),u=!0)},o(v){D(o),D(a),u=!1},d(v){v&&L(t),d[n].d(),p[r].d()}}}function Ib(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=vt("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,C,T,x,H;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=(C=m.state)==null?void 0:C.unfolded),i.$$.dirty&2&&e(7,c=((T=m.pointTagStyle)==null?void 0:T.leftPercent)+"%"),i.$$.dirty&2&&e(6,u=((x=m.pointTagStyle)==null?void 0:x.topPercent)+"%"),i.$$.dirty&2&&e(5,h=(H=m.state)!=null&&H.unfolded?1:0)},[d,m,g,p,A,h,u,c,l,a,r,s,o,n,v]}class kb extends oe{constructor(t){super(),ie(this,t,Ib,Pb,ne,{withAnimation:0,tag:1,mediaStore:2,state:3,temporaryState:4},bb)}}function xb(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 da(i,t,e){const n=i.slice();return n[6]=t[e],n}function ha(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=da(i,s,a),c=r(l);n.set(c,e[a]=fa(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){M(a,t,l);for(let c=0;c<e.length;c+=1)e[c].m(t,null);o=!0},p(a,l){l&31&&(s=a[1],se(),e=Ke(e,l,r,1,a,s,n,t,Pt,fa,null,da),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)P(e[l]);o=!0}},o(a){for(let l=0;l<e.length;l+=1)D(e[l]);o=!1},d(a){a&&L(t);for(let l=0;l<e.length;l+=1)e[l].d()}}}function fa(i,t){let e,n,o;return n=new kb({props:{state:t[3],temporaryState:t[4],withAnimation:t[0],tag:t[6],mediaStore:t[2]}}),{key:i,first:null,c(){e=ge(),K(n.$$.fragment),this.first=e},m(s,r){M(s,e,r),J(n,s,r),o=!0},p(s,r){t=s;const a={};r&8&&(a.state=t[3]),r&16&&(a.temporaryState=t[4]),r&1&&(a.withAnimation=t[0]),r&2&&(a.tag=t[6]),r&4&&(a.mediaStore=t[2]),n.$set(a)},i(s){o||(P(n.$$.fragment,s),o=!0)},o(s){D(n.$$.fragment,s),o=!1},d(s){s&&L(e),Z(n,s)}}}function Db(i){let t,e,n=i[3].enabled&&ha(i);return{c(){n&&n.c(),t=ge()},m(o,s){n&&n.m(o,s),M(o,t,s),e=!0},p(o,[s]){o[3].enabled?n?(n.p(o,s),s&8&&P(n,1)):(n=ha(o),n.c(),P(n,1),n.m(t.parentNode,t)):n&&(se(),D(n,1,1,()=>{n=null}),re())},i(o){e||(P(n),e=!0)},o(o){D(n),e=!1},d(o){n&&n.d(o),o&&L(t)}}}function Lb(i,t,e){let{withAnimation:n=!1}=t,{tags:o=[]}=t,{hooks:s}=t,{mediaStore:r}=t,{state:a}=t,{temporaryState:l}=t;return Ki("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 Sb extends oe{constructor(t){super(),ie(this,t,Lb,Db,ne,{withAnimation:0,tags:1,hooks:5,mediaStore:2,state:3,temporaryState:4},xb)}}const Mb=new gc.GLTFLoader;function Tb(i){return new Promise((t,e)=>{function n(s){t(s)}function o(s){e(s)}Mb.load(i,n,void 0,o)})}class zb extends Bp{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=>G(this,null,function*(){var l;const n=e.data.modelUrl;if(!n)return;const o=Tb(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.getVisibleByFloorIndex(e);const a=this.gltfObjectGroup.children.find(c=>c.customID===e.id);if(a&&this.gltfObjectGroup.remove(a),this.getRenderType(e)==="Mesh"){if(!e.imagePlane){const c=e.data.mediaPosition.map(qe);e.imagePlane=new nr(e.data.mediaData[0].url,e.data.mediaPosition.map(qe));const u=new j.Vector3().addVectors(c[0],c[2]).divideScalar(2);e.imagePlane.position.copy(u),s.add(e.imagePlane)}}else this.updateTagCss3DObjectMatrix(e,s);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.imagePlane)==null?void 0:n.parent)==null||o.remove(e.imagePlane)}),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 r,a,l,c;const o=(r=n.data.mediaData[0])==null?void 0:r.url;if(!o||(n.imagePlane&&(n.imagePlane.visible=(l=(a=n.state)==null?void 0:a.visible)!=null?l:!0),((c=n.imagePlane)==null?void 0:c.imageSrc)===o))return;const s=n.position.map(qe);n.imagePlane=new nr(o,s),n.imagePlane.setMatrixByCornerPoints(s),this.imagePlaneGroup.add(n.imagePlane)})}updateRender3DDomTag(){this.sort([...this.filterCSS3DTag]).forEach(n=>{var o,s;if(n.tag3DContentSvelte){const{svelteApp:r,domContainer: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=Kt(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 h="black";c.container.style.backgroundColor=h,c.container.style.border=`3px solid ${h}`,this.css3DRenderPlugin.hooks.on("render",()=>{var d;if(u.css3DObject.opacityMesh){const m=this.addObjectClickHandler(n,u.css3DObject.opacityMesh,g=>{this.hooks.emit("click",{event:g,target:"TagContent",tag:n})});(d=this.store.css3DRenderDisposer.get(n.id))==null||d.push(m)}})}const u=this.css3DRenderPlugin.create3DDomContainer(r,c);if(!u)return;this.store.css3DRenderDisposer.set(n.id,[u.dispose]),n.tag3DContentSvelte={svelteApp:new Yl({target:u.container,props:{tag:n,hooks:this.hooks,state:this.state,mediaStore:this.mediaStore,temporaryState:this.temporaryState}}),domContainer:u,initialNormal:a,currentNormal:a}}}),this.clearUnusedPanelTag()}updateRenderModelTag(){const e=o=>!this.enabledModelTagSet.has(o.customID);this.gltfObjectGroup.remove(...this.gltfObjectGroup.children.filter(e)),this.tags.filter(Re).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.imagePlane&&(e.imagePlane.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.domContainer.css3DObject;if(!s)return;const r=Re(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=In(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 G(this,null,function*(){const n=e.filter(Re).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 Sb({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.domContainer)==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.domContainer.dispose(),e.tag3DContentSvelte=void 0});for(const[e,n]of this.store.css3DRenderDisposer){const o=this.getTagById(e);(!o||o.stickType==="2DPoint")&&(n==null||n.forEach(s=>s==null?void 0:s()),this.store.css3DRenderDisposer.delete(e))}}}const Ul="Dnalogel-PanoTagPlugin",Bb=i=>`${Ul}--${i}`;class ql extends zb{constructor(e,n){super(e);f(this,"state",{enabled:!0,visible:!0});f(this,"params");f(this,"debug");f(this,"changeTagModel",(e,n)=>G(this,null,function*(){e.data=rt.default({},e.data,n),yield this.loadModel(e),this.updateRenderAllTags()}));f(this,"handleFiveInitAnimationEnded",()=>{const e=this.five.getCurrentState().mode;this.tags.forEach(n=>{Re(n)&&e==="Panorama"&&this.changeTagMode(n,"front"),n.state.visible=this.getVisible(n)}),this.updateRenderAllTags()});f(this,"handleFiveModelShownFloorChange",()=>{this.tags.forEach(e=>{!Re(e)||(e.state.visible=this.getVisible(e))}),this.updateRenderAllTags()});this.params=F({debug:!1,config:this.config},n),this.debug=this.params.debug,this.config=this.params.config,Dp(1,{namespace:ko.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 G(this,null,function*(){var s,r;this.clearTags(),console.info(Ul," load:",{data:JSON.parse(JSON.stringify(e))}),this.config=rt.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{Ap(this.five,this.tags)}catch(a){console.error(a)}return o})}addTag(e,n){return G(this,null,function*(){const s=(Array.isArray(e)?e:[e]).map(r=>{const a=this.getTagConfig(r);return fe(F({},r),{state:F({visible:void 0,unfolded:!this.can("fold",r)},a.initialState),hooks:new Ce.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(kp),this.tags.push(...s),Cp(this.five).then(()=>G(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=rt.default({},this.config,e):this.config=e,this.updateTagConfig({force:!0}),this.updateRenderAllTags()}changeGlobalConfig(e,n=!0){n?this.config.globalConfig=rt.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]=rt.default({},this.config.contentTypeConfig[e],n):this.config.contentTypeConfig[e]=n,this.clearCache(),this.updateRenderAllTags()}show(e){return G(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 G(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=F({},this.state);this.state=Object.assign(this.state,e),this.store.visibleWithAnimation=s,r.visible!==this.state.visible&&(e.visible?this.handleShow():this.handleHide()),r.enabled!==this.state.enabled&&(e.enabled?this.handleEnable():this.handleDisable()),this.hooks.emit("stateChange",{state:this.state,prevState:r,userAction:o})}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.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=rt.default({},s.data,n):s.data=F(F({},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?rt.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 G(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.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.svelteApp.$destroy(),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}=or(Pp(()=>{!this.store.resizeObserverDisposer||o()},500),e),{observe:a,unobserve:l}=or(ir(()=>n(),400),e);return s(),a(),()=>{r(),l()}}handleFiveModeChange(e){this.setModelMedialVisible(),this.tags.forEach(n=>{Re(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(F({},e.temporaryState),{visible:n.visibleConfig.keep==="visible"}):e.temporaryState=fe(F({},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 ir(()=>{this.setUnfoldedByCamera(),this.updateRenderAllTags()},100)}handleFiveCameraUpdate(){this.updateRenderPointTag()}handleFivePanoArrived(){return G(this,null,function*(){this.setModelMedialVisible(),yield this.setVisibleAndUnfolded(),this.tags.forEach(e=>{e.temporaryState=fe(F({},e.temporaryState),{visible:!0})}),this.store.visibleWithAnimation=!0,this.updateTagContainerVisible(),this.updateRenderAllTags()})}setUnfoldedByCamera(){let e=!1;this.tags.forEach(n=>{const o=this.getUnfoldedByCamera(n);!n.state||o!==void 0&&(o===!0&&(e=!0),n.state.unfolded=o)}),e&&this.tags.forEach(n=>{const o=this.getTagConfig(n).unfoldedConfig;typeof o=="object"&&(o.autoUnfold||o.keep)||n.state&&(n.state.unfolded=!1)})}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.domContainer)==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 Vb=(i,t)=>new ql(i,t);function Jl(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 Dn{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 Jt,this.camera=t.camera,this.model=t.model,this.originObject3D=t.originObject3D,this.helperObject3D=t.helperObject3D,this.container=t.container,this.scene=t.scene,this.domEvents=new be(t.camera,t.container),this.onRender=(u=t.onRender)!=null?u:()=>{},this.offset=e==null?void 0:e.offset,this.initialHelperPosition(),this.initialHelperQuaternion(),this.enable();const n=(...h)=>this.onSetOriginObjectScale(...h),o=(...h)=>this.onSetOriginObjectRotate(...h),s=(...h)=>this.onSetOriginObjectPosition(...h),r=(...h)=>this.onApplyOriginObjectScale(...h),a=(...h)=>this.onApplyOriginObjectRotate(...h),l=(...h)=>this.onApplyOriginObjectPosition(...h);this.hooks.on("setObjectScale",n),this.hooks.on("setObjectRotate",o),this.hooks.on("setObjectPosition",s),this.hooks.on("applyObjectPosition",l),this.hooks.on("applyObjectRotate",a),this.hooks.on("applyObjectScale",r),this.disposers.push(()=>{this.hooks.off("setObjectScale",n),this.hooks.off("setObjectRotate",o),this.hooks.off("setObjectPosition",s),this.hooks.off("applyObjectPosition",l),this.hooks.off("applyObjectRotate",a),this.hooks.off("applyObjectScale",r)})}initialHelperPosition(){this.helperObject3D.position.add(this.calculateOffset(this.offset)),this.helperObject3D.initialPosition()}initialHelperQuaternion(){this.helperObject3D.initQuaternion()}enable(){this.enabled||(this.enabled=!0,this.scene.add(this.helperObject3D),this.helperObject3D.enable(),this.render())}disable(){!this.enabled||(this.enabled=!1,this.helperObject3D.disable(),this.render())}show(){this.helperObject3D.show(),this.render()}hide(){this.helperObject3D.hide(),this.render()}dispose(){var t;(t=this.disposers)==null||t.forEach(e=>e==null?void 0:e()),this.helperObject3D.dispose(),this.render()}applyHelperMatrix4(t){this.helperObject3D.applyMatrix4(t)}applyHelperQuaternion(t,e){this.helperObject3D.applyHelperQuaternion(t,e)}applyHelperScaleMatrix4(t,e){this.helperObject3D.applyHelperScaleMatrix4(t,e)}onWantsGesture(t,e,n){if(this.isDragging)return!1}onIntersectionOnModelUpdate(t){}onApplyOriginObjectScale(t){this.applyHelperScaleMatrix4(t.matrix,t.origin)}onApplyOriginObjectRotate(t){this.applyHelperQuaternion(t.quaternion,t.origin)}onApplyOriginObjectPosition(t){this.applyHelperMatrix4(t.matrix)}onSetOriginObjectScale(t){this.helperObject3D.scale.copy(t),this.updateOffsetByScale(t)}onSetOriginObjectRotate(t,e){this.helperObject3D.setHelperQuaternion(t,e)}onSetOriginObjectPosition(t){this.helperObject3D.position.copy(t.clone().add(this.calculateOffset(this.offset)))}render(){this.onRender()}updateOffsetByScale(t){if(this.boundingBox&&this.offset){const e=this.originObject3D.position,n=new 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(Zt),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=Jl(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 jb extends Dn{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 Zl(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 Ob 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 ki extends Ob{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){Zl(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 Rb extends ki{}class Fb extends ki{}class Qb extends ki{}class Kl extends ki{}class Hb extends Kl{}class _b extends E.Group{constructor(e){super();f(this,"direction");this.direction=e||"x"}}class ma extends E.Mesh{constructor(e,n,o){super(e,n);f(this,"direction");this.direction=o||"x"}}function Gb(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 Mo(i,t,e){if(!t||!e||!i)return;const n=Gb(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 Wb(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 Ni extends _b{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 ma(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 ma(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 Xi={X:15618642,Y:4765519,Z:4227839};class Gt{static get X(){return new E.Color(Xi.X).convertSRGBToLinear().clone()}static get Y(){return new E.Color(Xi.Y).convertSRGBToLinear().clone()}static get Z(){return new E.Color(Xi.Z).convertSRGBToLinear().clone()}}class Nb extends Rb{constructor(e){super(e);f(this,"xArrow",new Ni({direction:"x",color:Gt.X}));f(this,"yArrow",new Ni({direction:"y",color:Gt.Y}));f(this,"zArrow",new Ni({direction:"z",color:Gt.Z}));this.add(this.xArrow),this.add(this.yArrow),this.add(this.zArrow)}show(){super.show(),this.xArrow.visible=!0,this.yArrow.visible=!0,this.zArrow.visible=!0}showDraggingHelper(e){this.xArrow.visible=e.includes("x"),this.yArrow.visible=e.includes("y"),this.zArrow.visible=e.includes("z")}dispose(){this.remove(this.xArrow,this.yArrow,this.zArrow)}}function Lt(i,t){return Xb(document.createElement(t!=null?t:"div"),i)}function Xb(i,t){if(!t)return i;for(const e in t)e&&t[e]&&(i.style[e]=t[e]);return i}function Yb(i){const t=Lt(F({position:"absolute",display:"block",borderRadius:"4px",paddingTop:"1px",paddingBottom:"1px",paddingLeft:"4px",paddingRight:"4px",pointerEvents:"none",userSelect:"none",zIndex:"9999",backgroundColor:"rgba(0,0,0,0.7)",fontSize:"12px",color:"#fff",letterSpacing:"0",lineHeight:"18px"},i)),e=()=>{t.style.display!=="block"&&(!t.style.top||!t.style.left||(t.style.display="block"))};return{element:t,show:e,hide:()=>{t.style.display="none",t.style.top="",t.style.left=""},setLeftTop:(s,r)=>{t.style.left=s,t.style.top=r,e()}}}class Ub extends Qb{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 Yi({direction:"x",color:Gt.X})),(n==null?void 0:n.xzCircleEnable)!==!1&&(this.yCircle=new Yi({direction:"y",color:Gt.Y})),(n==null?void 0:n.xyCircleEnable)!==!1&&(this.zCircle=new Yi({direction:"z",color:Gt.Z})),(n==null?void 0:n.container)&&(n==null?void 0:n.angleTipsEnable)!==!1&&(this.container=n==null?void 0:n.container,this.angleTips=Yb({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 Yi 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 qb(e),this.ring=new Jb(e),this.angleSector=new Zb(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 qb 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 Jb 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 Zb 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 Kb(){const i=Lt({width:"100%",height:"100%",left:"0",top:"0",position:"absolute",pointerEvents:"none"}),t=Lt({boxSizing:"border-box",width:"100%",height:"100%",left:"0",top:"0",position:"relative",display:"flex",alignItems:"center",justifyContent:"center"}),e=Lt({boxSizing:"border-box",width:"100%",height:"100%",left:"0",top:"0",position:"absolute",border:"1px solid rgba(255,255,255,0.4)"});i.appendChild(t),t.appendChild(e);const n="-4px",o={direction:"nesw",element: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=Lt(F({background:"#FFFFFF",width:"9px",height:"9px",position:"absolute",pointerEvents:"none"},i)),e=Lt({width:"15px",height:"15px",position:"absolute",left:"50%",top:"50%",transform:"translate(-50%, -50%)",pointerEvents:"none"}),n=Lt({width:"15px",height:"15px",cursor:i==null?void 0:i.cursor,pointerEvents:"auto",background:"transparent"});return n.draggable=!0,e.appendChild(n),t.appendChild(e),t}class $b extends Hb{constructor(e,n,o,s){super(e);f(this,"points",[]);f(this,"cornerPositions",[]);f(this,"css3DInstance");f(this,"plane");f(this,"css3DRenderer",new Wt);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}=Kb();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 e1 extends Fb{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=Jl(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 t1 extends Dn{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=Mo(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 hn{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 n1="v1.0.1",i1="Object3DHelper",To=`${i1}@${n1}`,o1=()=>{console.error(`${To} is disposed`)},s1=()=>{console.warn(`${To} is disabled`)},r1=()=>{console.error(`${To} is disabled`)};class a1{constructor(t){f(this,"controllers",{});f(this,"state",{visible:!0,enabled:!0,disposed:!1});f(this,"hooks",new Jt);f(this,"eventListener",{});t&&this.addControllers(t),this.setState(this.state)}show(t){return G(this,null,function*(){this.setState({visible:!0},t)})}hide(t){return G(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 o1();if(!this.state.enabled&&t.enabled!==!0&&t.disposed!==!0)return r1();const n=F({},this.state);this.state=F(F({},this.state),t),t.disposed!==void 0&&t.disposed!==n.disposed&&t.disposed&&this.handleDispose(),t.visible!==void 0&&this.handleVisible(t.visible),t.enabled!==void 0&&this.handleEnable(t.enabled),this.hooks.emit("stateChange",{state:this.state,prevState:n})}addControllers(t){this.controllers=F(F({},this.controllers),t),this.setState(this.state)}getCurrentState(){return this.state}handleEnable(t,e=!0){t?(this.everyControllerDo(n=>{n.enable()}),this.hooks.emit("enable",{userAction:e})):(this.everyControllerDo(n=>{n.disable()}),this.hooks.emit("disable",{userAction:e})),this.state.enabled=t}handleVisible(t,e=!0){t?(this.everyControllerDo(n=>{n.show()}),this.actionIfStateIsEnabled(()=>this.hooks.emit("show",{userAction:e}))):(this.everyControllerDo(n=>{n.hide()}),this.actionIfStateIsEnabled(()=>this.hooks.emit("hide",{userAction:e}))),this.state.visible=t}everyControllerDo(t){Object.values(this.controllers).forEach(e=>{e&&t(e)})}handleDispose(){var t,e;Object.values(this.controllers).forEach(n=>{n==null||n.dispose()});for(const n in this.controllers){if(!n)continue;const o=n;(e=(t=this.eventListener)[o])==null||e.call(t)}}actionIfStateIsEnabled(t,e){if(this.state.enabled)return t();e!=null&&e.warnLog&&s1()}}function Ui(i){return i*Math.PI/180}class l1 extends Dn{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(Ui(n),Ui(o),Ui(s)),a=new E.Quaternion().setFromEuler(r);if(this.hooks.emit("wantToRotate",a))return;const{originObject3D:c,rotateCenter:u}=this;Zl(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=Mo(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(ol(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 c1 extends Dn{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=Mo(this.camera,e,this.container);if(!n)return this.dragEnd();this.scale(n)}scale(e){var H,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||Wb(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 O=new j.Vector3(0,0,0);if(!this.startInfo)return O;const S=(R==="ew"?h:d).clone(),Q=c.clone().projectOnVector(S),_=a.clone().projectOnVector(S),X=l.clone().projectOnVector(S);if(_.equals(Q))return O;if(R==="ns"&&typeof this.startInfo.dragPointInCenterBottom!="boolean"){const U=new j.Vector3().subVectors(_,X),ae=U.x<0&&S.x>=0,he=U.y<0&&S.y>=0,de=U.z<0&&S.z>=0;this.startInfo.dragPointInCenterBottom=ae||he||de}if(R==="ew"&&typeof this.startInfo.dragPointInCenterLeft!="boolean"){const U=new j.Vector3().subVectors(_,X),ae=U.x<0&&S.x>=0,he=U.y<0&&S.y>=0,de=U.z<0&&S.z>=0;this.startInfo.dragPointInCenterLeft=ae||he||de}const W=new j.Vector3().subVectors(_,Q),$=W.length();return $>.3?(console.warn("offset.length() > 0.3, skipped",$),O):W},g=m("ew"),p=m("ns"),A=()=>{const R=g;this.helperObject3D.cornerPositions.forEach((O,S)=>{var Q;(Q=this.startInfo)!=null&&Q.dragPointInCenterLeft?(S===0||S===3)&&O.add(R):(S===1||S===2)&&O.add(R)})},v=()=>{const R=p;this.helperObject3D.cornerPositions.forEach((O,S)=>{var Q;(Q=this.startInfo)!=null&&Q.dragPointInCenterBottom?(S===0||S===1)&&O.add(R):(S===2||S===3)&&O.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 C=new j.Vector3().addVectors(r[0],r[2]).divideScalar(2),T=new j.Vector3().subVectors(C,l),x=new E.Matrix4().setPosition(T);n.applyMatrix4(x),(H=this.helperObject3D.css3DInstance)==null||H.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 u1 extends c1{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 d1 extends Dn{constructor(...e){super(...e);f(this,"name","BoundingBoxController")}}class h1 extends Kl{constructor(t){super(t)}}const co="Object3DHelperPlugin",xi=co,f1=()=>{console.error(`${xi} is disposed`)},m1=()=>{console.warn(`${xi} is disabled`)},g1=()=>{console.error(`${xi} is disabled`)};class $l extends xn{constructor(e){super(e);f(this,"name",co);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 Wt(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,{[`__${co.toUpperCase()}_DEBUG__`]:this})}show(e){return G(this,null,function*(){this.setState({visible:!0},e)})}hide(e){return G(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 f1();if(!this.state.enabled&&e.enabled!==!0&&e.disposed!==!0)return g1();const o=F({},this.state);this.state=F(F({},this.state),e),e.disposed!==void 0&&e.disposed!==o.disposed&&e.disposed&&this.handleDispose(),e.visible!==void 0&&e.visible!==o.visible&&this.handleVisible(e.visible),e.enabled!==void 0&&e.enabled!==o.enabled&&this.handleEnable(e.enabled),this.hooks.emit("stateChange",{state:this.state,prevState:o})}getObject3DHelper(e){return this.objectHelperMap.get(e)}addObject3DHelper(e,n={}){var 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 a1,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 Ce.Subscribe;if(l){const g=new Nb(e),p=this.getConfig(n.moveHelper),A=new hn(this.five,t1,e,g,p,d);o.addControllers({moveController:A.helperController}),s.push(()=>A.dispose())}if(c){const g=this.getConfig(n.rotateHelper),p=new Ub(e,F({container:r},g)),A=new hn(this.five,l1,e,p,g,d);o.addControllers({rotateController:A.helperController}),s.push(()=>A.dispose())}if(h){const g=new e1(e),p=new hn(this.five,d1,e,g,void 0,d);o.addControllers({boundingBoxController:p.helperController})}if(u)if(e.isCSS3DObjectPlus&&r){const g=new $b(e,r,a,this.five.scene),p=new hn(this.five,u1,e,g,void 0,d);o.addControllers({scaleController:p.helperController}),s.push(()=>p.dispose()),Ca(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:Ea(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 h1(e),p=new hn(this.five,jb,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&&m1()}getConfig(e){if(!!e&&typeof e!="boolean"&&e.enable)return e}}const p1=i=>new $l(i),A1=`
|
|
610
627
|
varying vec2 vUv;
|
|
611
628
|
void main() {
|
|
612
629
|
vUv = uv;
|
|
@@ -626,4 +643,4 @@ void main() {
|
|
|
626
643
|
float match = (1.0 - step(0.5, abs(uv.x - 0.5))) * (1.0 - step(0.5, abs(uv.y - 0.5))) * (transX < transY ? transX : transY);
|
|
627
644
|
gl_FragColor = vec4(texture2D(map, uv).xyz, match);
|
|
628
645
|
}
|
|
629
|
-
`;function b1(i){const t=Math.PI*2;let e=-Math.atan2(i.x,-i.z);e=(e%t+t)%t;const n=-Math.asin(i.y/1);return{longitude:e,latitude:n}}class ga{constructor(t,e){f(this,"_id");f(this,"url");f(this,"five");f(this,"panoIndex");f(this,"observer");f(this,"origin");f(this,"video");f(this,"videoMesh");f(this,"_enabled",!0);f(this,"_disposed",!1);f(this,"videoDataLoaded",!1);f(this,"hasVideoEverPlayed",!1);f(this,"renderFiveDisposer");f(this,"uv2Position",(t,e)=>{var m;const o=Math.PI,s=Math.PI*2,r=t,a=1-e,l=new j.Vector3(-1*Math.cos(s*r)*Math.sin(o*a),1*Math.cos(o*a),1*Math.sin(s*r)*Math.sin(o*a));l.setX(-l.x);const c=(m=this.five.work)==null?void 0:m.observers[this.panoIndex];if(!c)return this.logWarning(`\u70B9\u4F4D ${this.panoIndex} \u4E0D\u5B58\u5728\uFF0C\u8BF7\u68C0\u67E5 Five \u6570\u636E\u662F\u5426\u6B63\u5E38\u3002`);const u=c.position.clone(),h=c.quaternion.clone(),d=l.clone();return d.applyAxisAngle(new j.Vector3(0,1,0),Math.PI/2),d.applyQuaternion(h),d.add(u),d});f(this,"onFiveDataLoaded",()=>{var l;const t=(l=this.five.work)==null?void 0:l.observers[this.panoIndex];if(!t)return this.logWarning(`\u70B9\u4F4D ${this.panoIndex} \u4E0D\u5B58\u5728\uFF0C\u8BF7\u68C0\u67E5 Five \u6570\u636E\u662F\u5426\u6B63\u5E38\u3002`);this.observer=t;const{x:e,y:n,z:o,w:s}=t.quaternion,r=new j.Quaternion(e,n,o,s),a=t.position;this.videoMesh.position.fromArray([a.x,a.y,a.z]),this.videoMesh.quaternion.set(0,0,0,1),this.videoMesh.rotateOnAxis(new j.Vector3(0,1,0),Math.PI/2),this.videoMesh.applyQuaternion(r)});f(this,"onFiveWantsMoveToPano",t=>{t===this.panoIndex&&(this.hasVideoEverPlayed||this.video.play().catch(e=>{console.error("\u{1F436} ==> error:",e)}))});f(this,"onFivePanoArrived",t=>{if(this.disposed)return this.logWarning("\u5B9E\u4F8B\u5DF2\u88AB\u9500\u6BC1");!this.enabled||this.panoIndex===t&&this.mount()});f(this,"onFivePanoWillArrive",t=>{if(t!==this.panoIndex)return this.unmount();this.panoIndex!==t&&this.unmount()});f(this,"onFiveModeChange",t=>{t!=="Panorama"&&this.hide()});f(this,"onFiveInitAnimationEnded",()=>{const t=this.five.getCurrentState();t.mode==="Panorama"&&t.panoIndex===this.panoIndex&&this.mount()});f(this,"onFiveWantsTapGesture",t=>{if(!this.five.scene.children.includes(this.videoMesh))return;if(this.disposed)return this.logWarning("\u5B9E\u4F8B\u5DF2\u88AB\u9500\u6BC1");if(!this.enabled)return this.logWarning("\u5B9E\u4F8B\u5DF2\u88AB\u7981\u7528");const[e]=t.intersectObject(this.videoMesh);if(!e)return;if(this.checkIntersectionInBounding(this.origin,e))return this.video.muted=!this.video.muted,!1});f(this,"onVideoDataLoaded",()=>{this.videoDataLoaded=!0,this.video.paused===!1&&this.video.src!==""&&this.onVideoPlayingAndLoaded()});f(this,"onVideoPlaying",()=>{this.hasVideoEverPlayed=!0,this.video.src!==""&&this.videoDataLoaded&&this.onVideoPlayingAndLoaded()});f(this,"onVideoPlayingAndLoaded",()=>{if(!this.videoDataLoaded)return this.logWarning("\u89C6\u9891\u6570\u636E\u672A\u52A0\u8F7D");if(this.video.paused===!0)return this.logWarning("\u89C6\u9891\u5DF2\u6682\u505C");this.video.addEventListener("timeupdate",()=>{this.video.src!==""&&this.panoIndex===this.five.getCurrentState().panoIndex&&this.five.getCurrentState().mode==="Panorama"&&(this.renderFiveDisposer||(this.renderFiveDisposer=kn(()=>{this.five.needsRender=!0},30)),this.five.scene.add(this.videoMesh))},{once:!0})});f(this,"onVideoPaused",()=>{var t;(t=this.renderFiveDisposer)==null||t.call(this),this.renderFiveDisposer=void 0});var l,c;this.five=t,this.panoIndex=e.panoIndex,this._id=e.renderID,this.url=e.url,this.origin=e.origin.slice(),this._enabled=(c=(l=e.initialState)==null?void 0:l.enabled)!=null?c:!0;const n=document.createElement("video");n.crossOrigin="anonymous",n.autoplay=!1,n.muted=!0,n.loop=!0,n.playsInline=!0,this.video=n;const o=new j.VideoTexture(this.video);o.minFilter=j.LinearFilter,o.magFilter=j.LinearFilter;const s=new j.ShaderMaterial({vertexShader:A1,fragmentShader:v1,uniforms:{map:{value:o},size:{value:new j.Vector4(this.origin[0],1-this.origin[1]-this.origin[3],this.origin[2],this.origin[3])}},depthTest:!0,transparent:!0}),r=new j.SphereBufferGeometry(1,64,64);r.scale(-1,1,1);const a=new j.Mesh(r,s);a.name="pano-video",this.videoMesh=a,this.five.work&&this.onFiveDataLoaded(),this.enabled&&this.addEventListeners(),this.mountIfNeeded()}get renderID(){return this._id}get disposed(){return this._disposed}get enabled(){return this._enabled}dispose(){this.disposed||(this.disable(),this._disposed=!0)}enable(){this.disposed||this.enabled||(this._enabled=!0,this.addEventListeners(),this.mountIfNeeded())}disable(){this.disposed||!this.enabled||(this._enabled=!1,this.removeEventListeners(),this.unmount())}lookAtVideo(){if(!this.observer)return;const t=this.getUVCenter();if(!t)return;const e=this.uv2Position(t[0],t[1]);if(!e)return;const n=new j.Vector3().subVectors(e,this.observer.position).normalize(),{longitude:o,latitude:s}=b1(n);this.five.setState({panoIndex:this.panoIndex,longitude:o,latitude:s}),this.onFiveWantsMoveToPano(this.panoIndex)}getUVCenter(){if(!this.origin)return;const t=this.origin[0]+this.origin[2]/2,e=this.origin[1]+this.origin[3]/2;return[t,e]}addEventListeners(){this.five.on("loaded",this.onFiveDataLoaded),this.five.on("modeChange",this.onFiveModeChange),this.five.on("panoArrived",this.onFivePanoArrived),this.five.on("panoWillArrive",this.onFivePanoWillArrive),this.five.on("wantsMoveToPano",this.onFiveWantsMoveToPano),this.five.on("wantsTapGesture",this.onFiveWantsTapGesture),this.five.on("initAnimationEnded",this.onFiveInitAnimationEnded),this.video.addEventListener("canplaythrough",this.onVideoDataLoaded),this.video.addEventListener("playing",this.onVideoPlaying),this.video.addEventListener("pause",this.onVideoPaused)}removeEventListeners(){this.five.off("loaded",this.onFiveDataLoaded),this.five.off("modeChange",this.onFiveModeChange),this.five.off("panoArrived",this.onFivePanoArrived),this.five.off("panoWillArrive",this.onFivePanoWillArrive),this.five.off("wantsMoveToPano",this.onFiveWantsMoveToPano),this.five.off("wantsTapGesture",this.onFiveWantsTapGesture),this.five.off("initAnimationEnded",this.onFiveInitAnimationEnded),this.video.removeEventListener("canplaythrough",this.onVideoDataLoaded),this.video.removeEventListener("playing",this.onVideoPlaying),this.video.removeEventListener("pause",this.onVideoPaused)}mountIfNeeded(){const t=this.five.getCurrentState();t.mode==="Panorama"&&t.panoIndex===this.panoIndex&&this.enabled&&this.mount()}mount(){if(this.disposed)return this.logWarning("\u63D2\u4EF6\u5DF2\u7ECF\u9500\u6BC1\uFF0C\u65E0\u6CD5\u6302\u8F7D\u3002");if(this.url==="")return this.logWarning("\u89C6\u9891\u8D44\u6E90\u4E0D\u5B58\u5728\u3002");this.video.src!==this.url&&(this.video.src=this.url),this.video.paused&&this.video.play().catch(t=>{this.logWarning(t instanceof Error?t.message:"\u89C6\u9891\u64AD\u653E\u5931\u8D25\u3002"),this.five.once("gesture",()=>{this.video.play().catch(e=>{this.logWarning(e instanceof Error?e.message:"\u81EA\u52A8\u64AD\u653E\u89C6\u9891\u5931\u8D25\u3002")})})})}unmount(){this.video.pause(),this.video.src!==""&&(this.video.src=""),this.five.scene.remove(this.videoMesh)}hide(){this.video.pause(),this.five.scene.remove(this.videoMesh)}logWarning(t){console.warn("\u26D4 ==> [VideoMeshController]:",t)}checkIntersectionInBounding(t,e){if(!e.uv)return!1;const[n,o]=e.uv.toArray(),[s,r,a,l]=t,c=1-r-l,u=s+a,h=c+l;return n>=s&&n<=u&&o>=c&&o<=h}}class y1 extends xn{constructor(e){super(e);f(this,"enabled",!0);f(this,"controllerMap",new Map);f(this,"_disposed",!1);this.five=e}get state(){return{enabled:this.enabled}}get disposed(){return this._disposed}load(e,n){var o;if(this.disposed)return this.logWarning("\u63D2\u4EF6\u5DF2\u88AB\u9500\u6BC1");typeof((o=n==null?void 0:n.initialState)==null?void 0:o.enabled)!="undefined"&&n.initialState.enabled!==this.enabled&&(n.initialState.enabled?this.enable():this.disable()),e.list.forEach(s=>{const r=s.pano_index,a=s.render_id;s.video_list.forEach(l=>{this.controllerMap.set(l.render_id,new ga(this.five,fe(Q({},l),{panoIndex:r,renderID:a,initialState:{enabled:this.enabled}})))})})}enable(e){var o;if(this.disposed)return this.logWarning("\u63D2\u4EF6\u5DF2\u88AB\u9500\u6BC1");if(this.enabled)return;this.enabled=!0,Array.from(this.controllerMap.values()).forEach(s=>s.enable());const n=(o=e==null?void 0:e.userAction)!=null?o:!0;this.hooks.emit("enable",{userAction:n})}disable(e){var o;if(this.disposed)return this.logWarning("\u63D2\u4EF6\u5DF2\u88AB\u9500\u6BC1");if(!this.enabled)return;this.enabled=!1,Array.from(this.controllerMap.values()).forEach(s=>s.disable());const n=(o=e==null?void 0:e.userAction)!=null?o:!0;this.hooks.emit("disable",{userAction:n})}lookAtVideoItemByRenderID(e){if(this.disposed)return this.logWarning("\u63D2\u4EF6\u5DF2\u88AB\u9500\u6BC1");const n=this.controllerMap.get(e);if(!n)return this.logWarning(`ID \u4E3A ${e} \u7684\u70B9\u4F4D\u89C6\u9891\u4E0D\u5B58\u5728`);n.lookAtVideo()}add(e,n){if(this.disposed)return this.logWarning("\u63D2\u4EF6\u5DF2\u88AB\u9500\u6BC1");n.forEach(o=>{if(this.controllerMap.get(o.render_id))return this.logWarning(`ID \u4E3A ${o.render_id} \u7684\u70B9\u4F4D\u89C6\u9891\u5DF2\u5B58\u5728`);const s=o.render_id;this.controllerMap.set(o.render_id,new ga(this.five,fe(Q({},o),{panoIndex:e,renderID:s,initialState:{enabled:this.enabled}})))})}removeByRenderID(e){if(this.disposed)return this.logWarning("\u63D2\u4EF6\u5DF2\u88AB\u9500\u6BC1");const n=this.controllerMap.get(e);if(!n)return this.logWarning(`ID \u4E3A ${e} \u7684\u70B9\u4F4D\u89C6\u9891\u4E0D\u5B58\u5728`);n.dispose(),this.controllerMap.delete(e)}clear(){if(this.disposed)return this.logWarning("\u63D2\u4EF6\u5DF2\u88AB\u9500\u6BC1");Array.from(this.controllerMap.values()).forEach(e=>e.dispose()),this.controllerMap.clear()}dispose(){if(this.disposed)return this.logWarning("\u63D2\u4EF6\u5DF2\u88AB\u9500\u6BC1");this._disposed=!0,Array.from(this.controllerMap.values()).forEach(e=>e.dispose()),this.controllerMap.clear()}logWarning(e){console.warn("\u26D4 ==> [PanoVideoPluginController]:",e)}}const w1=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),C1=i=>new y1(i);console.info("@realsee/dnalogel %cv2.16.0-2","background-color: #12ce9b;color:black;padding:0 6px;border-radius: 3px");exports.CSS3DRender=Wt;exports.CSS3DRenderPlugin=Kt;exports.CameraMovementEffect=hl;exports.CameraMovementPlugin=kf;exports.ContentType=zl;exports.CruisePlugin=pp;exports.CruisePluginController=Io;exports.DIRECTION=Qt;exports.DISPLAY_STRATEGY_TYPE=xt;exports.DimensionType=Bl;exports.FLOOR_PLAN_ATTACHED_TO=gt;exports.FLOOR_TYPE_MAP=pf;exports.GuideLineItem=sp;exports.GuideLineModeItem=op;exports.GuideLinePlugin=Sl;exports.ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE=Dt;exports.ItemLabelPlugin=zg;exports.Magnifier=pl;exports.MapviewFloorplanPlugin=Yh;exports.ModelChassisCompassPlugin=bf;exports.ModelEntryDoorGuidePlugin=Cf;exports.ModelFloorplanPlugin=Gh;exports.ModelItemLabelPlugin=fg;exports.ModelRoomLabelPlugin=nd;exports.ModelTVVideoPlugin=pg;exports.ModelViewPlugin=Tc;exports.Object3DHelperController=$l;exports.Object3DHelperPlugin=p1;exports.PLUGIN=xi;exports.PaintBrush=Mc;exports.PaintBrushTypeEnum=at;exports.PanoCompassPlugin=Yf;exports.PanoCursorRaycasterPlugin=mu;exports.PanoDoorLabelPlugin=Xg;exports.PanoFloorplanRadarPlugin=mf;exports.PanoMeasurePlugin=Hm;exports.PanoMeasurePluginLine=zt;exports.PanoMeasurePluginModel=Ei;exports.PanoMeasurePluginPoint=Je;exports.PanoMeasurePluginPolyline=Ci;exports.PanoRulerPlugin=Mf;exports.PanoRulerProPlugin=_f;exports.PanoSpatialTagPlugin=ng;exports.PanoTagPlugin=Vb;exports.PanoTagPluginController=ql;exports.PanoVideoPlugin=C1;exports.PanoVideoPluginType=w1;exports.ROOM_FETILE_TYPE_MAP=gf;exports.ROOM_TYPE_MAP=Af;exports.Rotation=tt;exports.TopviewFloorplanPlugin=qh;exports.Util=hu;exports.itemLabelPluginServerParams=Bg;exports.modelItemLabelPluginServerParams=mg;exports.modelRoomLabelPluginServerParams=id;exports.pluginFlag=Bb;
|
|
646
|
+
`;function b1(i){const t=Math.PI*2;let e=-Math.atan2(i.x,-i.z);e=(e%t+t)%t;const n=-Math.asin(i.y/1);return{longitude:e,latitude:n}}class ga{constructor(t,e){f(this,"_id");f(this,"url");f(this,"five");f(this,"panoIndex");f(this,"observer");f(this,"origin");f(this,"video");f(this,"videoMesh");f(this,"_enabled",!0);f(this,"_disposed",!1);f(this,"videoDataLoaded",!1);f(this,"hasVideoEverPlayed",!1);f(this,"renderFiveDisposer");f(this,"uv2Position",(t,e)=>{var m;const o=Math.PI,s=Math.PI*2,r=t,a=1-e,l=new j.Vector3(-1*Math.cos(s*r)*Math.sin(o*a),1*Math.cos(o*a),1*Math.sin(s*r)*Math.sin(o*a));l.setX(-l.x);const c=(m=this.five.work)==null?void 0:m.observers[this.panoIndex];if(!c)return this.logWarning(`\u70B9\u4F4D ${this.panoIndex} \u4E0D\u5B58\u5728\uFF0C\u8BF7\u68C0\u67E5 Five \u6570\u636E\u662F\u5426\u6B63\u5E38\u3002`);const u=c.position.clone(),h=c.quaternion.clone(),d=l.clone();return d.applyAxisAngle(new j.Vector3(0,1,0),Math.PI/2),d.applyQuaternion(h),d.add(u),d});f(this,"onFiveDataLoaded",()=>{var l;const t=(l=this.five.work)==null?void 0:l.observers[this.panoIndex];if(!t)return this.logWarning(`\u70B9\u4F4D ${this.panoIndex} \u4E0D\u5B58\u5728\uFF0C\u8BF7\u68C0\u67E5 Five \u6570\u636E\u662F\u5426\u6B63\u5E38\u3002`);this.observer=t;const{x:e,y:n,z:o,w:s}=t.quaternion,r=new j.Quaternion(e,n,o,s),a=t.position;this.videoMesh.position.fromArray([a.x,a.y,a.z]),this.videoMesh.quaternion.set(0,0,0,1),this.videoMesh.rotateOnAxis(new j.Vector3(0,1,0),Math.PI/2),this.videoMesh.applyQuaternion(r)});f(this,"onFiveWantsMoveToPano",t=>{t===this.panoIndex&&(this.hasVideoEverPlayed||this.video.play().catch(e=>{console.error("\u{1F436} ==> error:",e)}))});f(this,"onFivePanoArrived",t=>{if(this.disposed)return this.logWarning("\u5B9E\u4F8B\u5DF2\u88AB\u9500\u6BC1");!this.enabled||this.panoIndex===t&&this.mount()});f(this,"onFivePanoWillArrive",t=>{if(t!==this.panoIndex)return this.unmount();this.panoIndex!==t&&this.unmount()});f(this,"onFiveModeChange",t=>{t!=="Panorama"&&this.hide()});f(this,"onFiveInitAnimationEnded",()=>{const t=this.five.getCurrentState();t.mode==="Panorama"&&t.panoIndex===this.panoIndex&&this.mount()});f(this,"onFiveWantsTapGesture",t=>{if(!this.five.scene.children.includes(this.videoMesh))return;if(this.disposed)return this.logWarning("\u5B9E\u4F8B\u5DF2\u88AB\u9500\u6BC1");if(!this.enabled)return this.logWarning("\u5B9E\u4F8B\u5DF2\u88AB\u7981\u7528");const[e]=t.intersectObject(this.videoMesh);if(!e)return;if(this.checkIntersectionInBounding(this.origin,e))return this.video.muted=!this.video.muted,!1});f(this,"onVideoDataLoaded",()=>{this.videoDataLoaded=!0,this.video.paused===!1&&this.video.src!==""&&this.onVideoPlayingAndLoaded()});f(this,"onVideoPlaying",()=>{this.hasVideoEverPlayed=!0,this.video.src!==""&&this.videoDataLoaded&&this.onVideoPlayingAndLoaded()});f(this,"onVideoPlayingAndLoaded",()=>{if(!this.videoDataLoaded)return this.logWarning("\u89C6\u9891\u6570\u636E\u672A\u52A0\u8F7D");if(this.video.paused===!0)return this.logWarning("\u89C6\u9891\u5DF2\u6682\u505C");this.video.addEventListener("timeupdate",()=>{this.video.src!==""&&this.panoIndex===this.five.getCurrentState().panoIndex&&this.five.getCurrentState().mode==="Panorama"&&(this.renderFiveDisposer||(this.renderFiveDisposer=kn(()=>{this.five.needsRender=!0},30)),this.five.scene.add(this.videoMesh))},{once:!0})});f(this,"onVideoPaused",()=>{var t;(t=this.renderFiveDisposer)==null||t.call(this),this.renderFiveDisposer=void 0});var l,c;this.five=t,this.panoIndex=e.panoIndex,this._id=e.renderID,this.url=e.url,this.origin=e.origin.slice(),this._enabled=(c=(l=e.initialState)==null?void 0:l.enabled)!=null?c:!0;const n=document.createElement("video");n.crossOrigin="anonymous",n.autoplay=!1,n.muted=!0,n.loop=!0,n.playsInline=!0,this.video=n;const o=new j.VideoTexture(this.video);o.minFilter=j.LinearFilter,o.magFilter=j.LinearFilter;const s=new j.ShaderMaterial({vertexShader:A1,fragmentShader:v1,uniforms:{map:{value:o},size:{value:new j.Vector4(this.origin[0],1-this.origin[1]-this.origin[3],this.origin[2],this.origin[3])}},depthTest:!0,transparent:!0}),r=new j.SphereBufferGeometry(1,64,64);r.scale(-1,1,1);const a=new j.Mesh(r,s);a.name="pano-video",this.videoMesh=a,this.five.work&&this.onFiveDataLoaded(),this.enabled&&this.addEventListeners(),this.mountIfNeeded()}get renderID(){return this._id}get disposed(){return this._disposed}get enabled(){return this._enabled}dispose(){this.disposed||(this.disable(),this._disposed=!0)}enable(){this.disposed||this.enabled||(this._enabled=!0,this.addEventListeners(),this.mountIfNeeded())}disable(){this.disposed||!this.enabled||(this._enabled=!1,this.removeEventListeners(),this.unmount())}lookAtVideo(){if(!this.observer)return;const t=this.getUVCenter();if(!t)return;const e=this.uv2Position(t[0],t[1]);if(!e)return;const n=new j.Vector3().subVectors(e,this.observer.position).normalize(),{longitude:o,latitude:s}=b1(n);this.five.setState({panoIndex:this.panoIndex,longitude:o,latitude:s}),this.onFiveWantsMoveToPano(this.panoIndex)}getUVCenter(){if(!this.origin)return;const t=this.origin[0]+this.origin[2]/2,e=this.origin[1]+this.origin[3]/2;return[t,e]}addEventListeners(){this.five.on("loaded",this.onFiveDataLoaded),this.five.on("modeChange",this.onFiveModeChange),this.five.on("panoArrived",this.onFivePanoArrived),this.five.on("panoWillArrive",this.onFivePanoWillArrive),this.five.on("wantsMoveToPano",this.onFiveWantsMoveToPano),this.five.on("wantsTapGesture",this.onFiveWantsTapGesture),this.five.on("initAnimationEnded",this.onFiveInitAnimationEnded),this.video.addEventListener("canplaythrough",this.onVideoDataLoaded),this.video.addEventListener("playing",this.onVideoPlaying),this.video.addEventListener("pause",this.onVideoPaused)}removeEventListeners(){this.five.off("loaded",this.onFiveDataLoaded),this.five.off("modeChange",this.onFiveModeChange),this.five.off("panoArrived",this.onFivePanoArrived),this.five.off("panoWillArrive",this.onFivePanoWillArrive),this.five.off("wantsMoveToPano",this.onFiveWantsMoveToPano),this.five.off("wantsTapGesture",this.onFiveWantsTapGesture),this.five.off("initAnimationEnded",this.onFiveInitAnimationEnded),this.video.removeEventListener("canplaythrough",this.onVideoDataLoaded),this.video.removeEventListener("playing",this.onVideoPlaying),this.video.removeEventListener("pause",this.onVideoPaused)}mountIfNeeded(){const t=this.five.getCurrentState();t.mode==="Panorama"&&t.panoIndex===this.panoIndex&&this.enabled&&this.mount()}mount(){if(this.disposed)return this.logWarning("\u63D2\u4EF6\u5DF2\u7ECF\u9500\u6BC1\uFF0C\u65E0\u6CD5\u6302\u8F7D\u3002");if(this.url==="")return this.logWarning("\u89C6\u9891\u8D44\u6E90\u4E0D\u5B58\u5728\u3002");this.video.src!==this.url&&(this.video.src=this.url),this.video.paused&&this.video.play().catch(t=>{this.logWarning(t instanceof Error?t.message:"\u89C6\u9891\u64AD\u653E\u5931\u8D25\u3002"),this.five.once("gesture",()=>{this.video.play().catch(e=>{this.logWarning(e instanceof Error?e.message:"\u81EA\u52A8\u64AD\u653E\u89C6\u9891\u5931\u8D25\u3002")})})})}unmount(){this.video.pause(),this.video.src!==""&&(this.video.src=""),this.five.scene.remove(this.videoMesh)}hide(){this.video.pause(),this.five.scene.remove(this.videoMesh)}logWarning(t){console.warn("\u26D4 ==> [VideoMeshController]:",t)}checkIntersectionInBounding(t,e){if(!e.uv)return!1;const[n,o]=e.uv.toArray(),[s,r,a,l]=t,c=1-r-l,u=s+a,h=c+l;return n>=s&&n<=u&&o>=c&&o<=h}}class y1 extends xn{constructor(e){super(e);f(this,"enabled",!0);f(this,"controllerMap",new Map);f(this,"_disposed",!1);this.five=e}get state(){return{enabled:this.enabled}}get disposed(){return this._disposed}load(e,n){var o;if(this.disposed)return this.logWarning("\u63D2\u4EF6\u5DF2\u88AB\u9500\u6BC1");typeof((o=n==null?void 0:n.initialState)==null?void 0:o.enabled)!="undefined"&&n.initialState.enabled!==this.enabled&&(n.initialState.enabled?this.enable():this.disable()),e.list.forEach(s=>{const r=s.pano_index,a=s.render_id;s.video_list.forEach(l=>{this.controllerMap.set(l.render_id,new ga(this.five,fe(F({},l),{panoIndex:r,renderID:a,initialState:{enabled:this.enabled}})))})})}enable(e){var o;if(this.disposed)return this.logWarning("\u63D2\u4EF6\u5DF2\u88AB\u9500\u6BC1");if(this.enabled)return;this.enabled=!0,Array.from(this.controllerMap.values()).forEach(s=>s.enable());const n=(o=e==null?void 0:e.userAction)!=null?o:!0;this.hooks.emit("enable",{userAction:n})}disable(e){var o;if(this.disposed)return this.logWarning("\u63D2\u4EF6\u5DF2\u88AB\u9500\u6BC1");if(!this.enabled)return;this.enabled=!1,Array.from(this.controllerMap.values()).forEach(s=>s.disable());const n=(o=e==null?void 0:e.userAction)!=null?o:!0;this.hooks.emit("disable",{userAction:n})}lookAtVideoItemByRenderID(e){if(this.disposed)return this.logWarning("\u63D2\u4EF6\u5DF2\u88AB\u9500\u6BC1");const n=this.controllerMap.get(e);if(!n)return this.logWarning(`ID \u4E3A ${e} \u7684\u70B9\u4F4D\u89C6\u9891\u4E0D\u5B58\u5728`);n.lookAtVideo()}add(e,n){if(this.disposed)return this.logWarning("\u63D2\u4EF6\u5DF2\u88AB\u9500\u6BC1");n.forEach(o=>{if(this.controllerMap.get(o.render_id))return this.logWarning(`ID \u4E3A ${o.render_id} \u7684\u70B9\u4F4D\u89C6\u9891\u5DF2\u5B58\u5728`);const s=o.render_id;this.controllerMap.set(o.render_id,new ga(this.five,fe(F({},o),{panoIndex:e,renderID:s,initialState:{enabled:this.enabled}})))})}removeByRenderID(e){if(this.disposed)return this.logWarning("\u63D2\u4EF6\u5DF2\u88AB\u9500\u6BC1");const n=this.controllerMap.get(e);if(!n)return this.logWarning(`ID \u4E3A ${e} \u7684\u70B9\u4F4D\u89C6\u9891\u4E0D\u5B58\u5728`);n.dispose(),this.controllerMap.delete(e)}clear(){if(this.disposed)return this.logWarning("\u63D2\u4EF6\u5DF2\u88AB\u9500\u6BC1");Array.from(this.controllerMap.values()).forEach(e=>e.dispose()),this.controllerMap.clear()}dispose(){if(this.disposed)return this.logWarning("\u63D2\u4EF6\u5DF2\u88AB\u9500\u6BC1");this._disposed=!0,Array.from(this.controllerMap.values()).forEach(e=>e.dispose()),this.controllerMap.clear()}logWarning(e){console.warn("\u26D4 ==> [PanoVideoPluginController]:",e)}}const w1=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),C1=i=>new y1(i);console.info("@realsee/dnalogel %cv2.16.0-4","background-color: #12ce9b;color:black;padding:0 6px;border-radius: 3px");exports.CSS3DRender=Wt;exports.CSS3DRenderPlugin=Kt;exports.CameraMovementEffect=hl;exports.CameraMovementPlugin=kf;exports.ContentType=zl;exports.CruisePlugin=pp;exports.CruisePluginController=Io;exports.DIRECTION=Ft;exports.DISPLAY_STRATEGY_TYPE=xt;exports.DimensionType=Bl;exports.FLOOR_PLAN_ATTACHED_TO=gt;exports.FLOOR_TYPE_MAP=pf;exports.GuideLineItem=sp;exports.GuideLineModeItem=op;exports.GuideLinePlugin=Sl;exports.ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE=Dt;exports.ItemLabelPlugin=zg;exports.Magnifier=pl;exports.MapviewFloorplanPlugin=Yh;exports.ModelChassisCompassPlugin=bf;exports.ModelEntryDoorGuidePlugin=Cf;exports.ModelFloorplanPlugin=Gh;exports.ModelItemLabelPlugin=fg;exports.ModelRoomLabelPlugin=nd;exports.ModelTVVideoPlugin=pg;exports.ModelViewPlugin=Tc;exports.Object3DHelperController=$l;exports.Object3DHelperPlugin=p1;exports.PLUGIN=xi;exports.PaintBrush=Mc;exports.PaintBrushTypeEnum=at;exports.PanoCompassPlugin=Yf;exports.PanoCursorRaycasterPlugin=mu;exports.PanoDoorLabelPlugin=Xg;exports.PanoFloorplanRadarPlugin=mf;exports.PanoMeasurePlugin=Hm;exports.PanoMeasurePluginLine=zt;exports.PanoMeasurePluginModel=Ei;exports.PanoMeasurePluginPoint=Je;exports.PanoMeasurePluginPolyline=Ci;exports.PanoRulerPlugin=Mf;exports.PanoRulerProPlugin=_f;exports.PanoSpatialTagPlugin=ng;exports.PanoTagPlugin=Vb;exports.PanoTagPluginController=ql;exports.PanoVideoPlugin=C1;exports.PanoVideoPluginType=w1;exports.ROOM_FETILE_TYPE_MAP=gf;exports.ROOM_TYPE_MAP=Af;exports.Rotation=tt;exports.TopviewFloorplanPlugin=qh;exports.Util=hu;exports.itemLabelPluginServerParams=Bg;exports.modelItemLabelPluginServerParams=mg;exports.modelRoomLabelPluginServerParams=id;exports.pluginFlag=Bb;
|