@realsee/dnalogel 2.0.5-alpha.5 → 2.0.5-alpha.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +12 -12
- package/dist/index.es.js +205 -204
- package/dist/index.js +205 -204
- package/dist/index.umd.js +12 -12
- package/docs/classes/CruisePluginController.html +1 -1
- package/docs/classes/Magnifier.html +1 -1
- package/docs/classes/ModelRoomLabelController.html +1 -1
- package/docs/classes/PaintBrush.html +1 -1
- package/docs/enums/CameraMovementEffect.html +1 -1
- package/docs/enums/DIRECTION.html +1 -1
- package/docs/enums/DISPLAY_STRATEGY_TYPE.html +1 -1
- package/docs/enums/FLOOR_PLAN_ATTACHED_TO.html +1 -1
- package/docs/enums/ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE.html +1 -1
- package/docs/enums/PaintBrushTypeEnum.html +1 -1
- package/docs/enums/Rotation.html +1 -1
- package/docs/index.html +1 -1
- package/docs/interfaces/CSS3DRenderPluginEventMap.html +1 -1
- package/docs/interfaces/CSS3DRenderPluginState.html +1 -1
- package/docs/interfaces/CameraMovementPluginExportType.html +1 -1
- package/docs/interfaces/FloorplanBounding.html +1 -1
- package/docs/interfaces/FloorplanData.html +1 -1
- package/docs/interfaces/FloorplanEntrance.html +1 -1
- package/docs/interfaces/FloorplanExtraObject.html +1 -1
- package/docs/interfaces/FloorplanExtraObject3D.html +1 -1
- package/docs/interfaces/FloorplanFloorData.html +1 -1
- package/docs/interfaces/FloorplanImagePosition.html +1 -1
- package/docs/interfaces/FloorplanObserver.html +1 -1
- package/docs/interfaces/FloorplanOutlineItem.html +1 -1
- package/docs/interfaces/FloorplanPosition.html +1 -1
- package/docs/interfaces/FloorplanRoomItem.html +1 -1
- package/docs/interfaces/FloorplanRoomLabelItem.html +1 -1
- package/docs/interfaces/FloorplanServerBounding.html +1 -1
- package/docs/interfaces/FloorplanServerComputedData.html +1 -1
- package/docs/interfaces/FloorplanServerData.html +1 -1
- package/docs/interfaces/FloorplanServerDoorItem.html +1 -1
- package/docs/interfaces/FloorplanServerDoorPosition.html +1 -1
- package/docs/interfaces/FloorplanServerEntrance.html +1 -1
- package/docs/interfaces/FloorplanServerFloorData.html +1 -1
- package/docs/interfaces/FloorplanServerImagePosition.html +1 -1
- package/docs/interfaces/FloorplanServerObserver.html +1 -1
- package/docs/interfaces/FloorplanServerOutlineItem.html +1 -1
- package/docs/interfaces/FloorplanServerPosition.html +1 -1
- package/docs/interfaces/FloorplanServerRoomItem.html +1 -1
- package/docs/interfaces/FloorplanServerRoomLabelItem.html +1 -1
- package/docs/interfaces/ItemLabelPluginData.html +1 -1
- package/docs/interfaces/ItemLabelPluginExportReturnsType.html +1 -1
- package/docs/interfaces/ItemLabelPluginParametersType.html +1 -1
- package/docs/interfaces/LineJson.html +1 -1
- package/docs/interfaces/ModelChassisCompassPluginData.html +1 -1
- package/docs/interfaces/ModelChassisCompassPluginExportType.html +1 -1
- package/docs/interfaces/ModelChassisCompassPluginParameterType.html +1 -1
- package/docs/interfaces/ModelEntryDoorGuidePluginData.html +1 -1
- package/docs/interfaces/ModelEntryDoorGuidePluginExportType.html +1 -1
- package/docs/interfaces/ModelItemLabelPluginData.html +1 -1
- package/docs/interfaces/ModelItemLabelPluginExportReturnsType.html +1 -1
- package/docs/interfaces/ModelItemLabelPluginParametersType.html +1 -1
- package/docs/interfaces/ModelRoomLabelPluginData.html +1 -1
- package/docs/interfaces/ModelTVVideoPluginData.html +1 -1
- package/docs/interfaces/ModelTVVideoPluginExportType.html +1 -1
- package/docs/interfaces/ModelTVVideoPluginParameterType.html +1 -1
- package/docs/interfaces/ModelViewPluginExportType.html +1 -1
- package/docs/interfaces/OpenParameter.html +1 -1
- package/docs/interfaces/PaintBrushAction.html +1 -1
- package/docs/interfaces/PaintBrushConfigs.html +1 -1
- package/docs/interfaces/PaintBrushState.html +1 -1
- package/docs/interfaces/PanoCursorRaycasterPluginExportType.html +1 -1
- package/docs/interfaces/PanoCursorRaycasterPluginParameterType.html +1 -1
- package/docs/interfaces/PanoMeasureParameterType.html +1 -1
- package/docs/interfaces/PanoRulerPluginExportType.html +1 -1
- package/docs/interfaces/PanoRulerPluginOptions.html +1 -1
- package/docs/interfaces/PanoRulerPluginParameterType.html +1 -1
- package/docs/interfaces/PanoRulerProPluginExportType.html +1 -1
- package/docs/interfaces/PanoRulerProPluginOptions.html +1 -1
- package/docs/interfaces/PanoRulerProPluginParameterType.html +1 -1
- package/docs/interfaces/PanoRulerProPluginState.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginContentEvent.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginContentReplacement.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginData.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginDataElement.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginExportType.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginOriginElement.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginParameterType.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginPointElement.html +1 -1
- package/docs/interfaces/PanoSpatialTagPluginTagElement.html +1 -1
- package/docs/interfaces/Point.html +1 -1
- package/docs/interfaces/PointJson.html +1 -1
- package/docs/interfaces/Room.html +1 -1
- package/docs/interfaces/RoomInfo.html +1 -1
- package/docs/interfaces/RoomLabel.html +1 -1
- package/docs/interfaces/RoomRules.html +1 -1
- package/docs/interfaces/Rooms.html +1 -1
- package/docs/modules.html +1 -1
- package/libs/ModelTVVideoPlugin/Plugin.js +40 -39
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -98,10 +98,10 @@ transition: all 500ms;
|
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
</style>
|
|
101
|
-
`;class Kr extends Ur{constructor(e){super();d(this,"configs");d(this,"clientWidth");d(this,"clientHeight");d(this,"ready",!1);d(this,"uuid",ut());d(this,"tween");d(this,"tweening",!1);d(this,"container");d(this,"canvas");d(this,"data",{});d(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=qr,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 u;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:ht.Undo,color:this.color,ready:this.ready,state:l,uuid:this.uuid});const c=(u=this.canvas[this.uuid])==null?void 0:u.getContext("2d");if(!this.canvas[this.uuid])return;const{width:h,height:f}=this.canvas[this.uuid];c&&c.clearRect(0,0,h,f),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:ht.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 h=(f,u,m)=>{const g=this.color||"#ff0000";n.strokeStyle=g,n.beginPath(),n.moveTo(f.x,f.y),n.quadraticCurveTo(u.x,u.y,m.x,m.y),n.stroke()};e.onmousedown=f=>{f.preventDefault(),c=Date.now();const u=f.clientX,m=f.clientY;r=[],r.push({x:u,y:m}),s={x:u,y:m},a=mn({x:u,y:m},this.clientWidth,this.clientHeight),l=[]},e.onmousemove=f=>{if(f.preventDefault(),!s)return;const u=Number(f.clientX),m=Number(f.clientY);if(Math.abs(u-s.x)<5&&Math.abs(m-s.y)<5||(r.push({x:u,y:m}),l.push(mn({x:u,y:m},this.clientWidth,this.clientHeight)),r.length<3))return;const{control:g,end:v}=pn(r);!g||!v||(h(s,g,v),s=v)},e.onmouseup=f=>{if(f.preventDefault(),s=null,r.length<3)return;this.data[this.uuid]||(this.data[this.uuid]=[]);const u=Date.now()-c,m={move:Object.assign({},a),uuid:this.uuid,line:[...l],color:this.color,duration:u<1280?u:u<2e3?1280:0};this.data[this.uuid].push(m),Tn(()=>{this.emitStateChange({type:ht.Drawline,color:this.color,ready:this.ready,state:m,uuid:this.uuid})})},e.ontouchstart=f=>{f.preventDefault(),c=Date.now();const u=f.touches[0].clientX,m=f.touches[0].clientY;r=[],r.push({x:u,y:m}),s={x:u,y:m},console.log("ontouchstart",u,m,s),a=mn({x:u,y:m},this.clientWidth,this.clientHeight),l=[]},e.ontouchmove=f=>{if(f.preventDefault(),!s)return;const u=Number(f.touches[0].clientX),m=Number(f.touches[0].clientY);if(Math.abs(u-s.x)<5&&Math.abs(m-s.y)<5||(r.push({x:u,y:m}),l.push(mn({x:u,y:m},this.clientWidth,this.clientHeight)),r.length<3))return;const{control:g,end:v}=pn(r);!g||!v||(h(s,g,v),s=v)},e.ontouchend=e.ontouchcancel=f=>{if(f.preventDefault(),s=null,r.length<3)return;this.data[this.uuid]||(this.data[this.uuid]=[]);const u=Date.now()-c,m={move:Object.assign({},a),line:[...l],uuid:this.uuid,color:this.color,duration:u<1280?u:u<2e3?1280:0};this.data[this.uuid].push(m),Tn(()=>{this.emitStateChange({type:ht.Drawline,color:this.color,ready:this.ready,state:m,uuid:this.uuid})})}}emitStateChange(e,n=!0){if(e.type!==ht.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};Wr(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 ht.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 ht.Undo:this.handleUndo(s);break}}handleDrawLine(e,n,{withUndo:o=!1},s=Ts){!n||Object.prototype.toString.call(n)!="[object Object]"||Object.keys(n).length===0||(console.log("handleDrawLine",n,n.line),Qr(()=>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:h=0,uuid:f}=n,u=ai(n.move||{},this.clientWidth,this.clientHeight);let m=[u];if(a.strokeStyle=c,a.beginPath(),a.moveTo(u.x,u.y),h&&!o){let g=[];const v=this;v.tween=Zr({step:0},{step:l.length-1},h).onUpdate(({step:b})=>{var I;if(v.tweening=!0,!v.ready)return a.clearRect(0,0,v.canvas[f].width,v.canvas[f].height),(I=v.tween)==null?void 0:I.stop();const y=Math.floor(b);if(!g.find(P=>P===y)){if(g.push(y),console.log("__debug__",l,l[y],y),m.push(ai(l[y],v.clientWidth,v.clientHeight)),m.length<3)return;const{control:P,end:k}=pn(m);if(!P||!k)return;a.quadraticCurveTo(P.x,P.y,k.x,k.y),a.stroke()}}).onComplete(b=>{v.tween=void 0,v.tweening=!1,g=[],m=[],s&&s(),r()})}else{for(let g=0;g<l.length;g++){if(m.push(ai(l[g],this.clientWidth,this.clientHeight)),m.length<3)continue;const{control:v,end:b}=pn(m);!v||!b||a.quadraticCurveTo(v.x,v.y,b.x,b.y)}a.stroke(),m=[],s&&s(),r()}})))}handleUndo(e){if(console.log("handleUndo",e,this.canvas[e]),!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(),Tn(n,60);return}n()}destroyBrush(){this.closeBrush(),this.ready=!1,this.emit("readyChange",!0)}}class _r{constructor(t={}){d(this,"controller");const e=Object.assign({currentColor:"#f44336",onUndoText:"\u56DE\u9000",onExitText:"\u5173\u95ED"},t);this.controller=new Kr(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 $r=(i,t)=>{let e=!0,n=null;const s={...{lookAtCurrentCamera:!1,lockedPanoIndex:null,lockedLatitude:null,lockedLongitude:null},...t==null?void 0:t.config},r=new O.Scene,a=new ye.Camera(60);let l=new O.Object3D,c,h;{const E=new O.DirectionalLight(16777215,.5);E.position.copy(new O.Vector3(1,1,1)),r.add(E)}{const E=new O.DirectionalLight(16777215,.3);r.add(E)}{const E=new O.AmbientLight(16777215,.3);r.add(E)}r.add(l);const f=()=>{if(!!i.renderer)return n||(n=new O.WebGLRenderer({antialias:!1,alpha:!0}),n.setPixelRatio(i.renderer.getPixelRatio()),n.outputEncoding=O.sRGBEncoding,n.setClearColor(1579548,0),n.autoClear=!0),n},u=()=>{l.traverse(E=>{E instanceof O.Mesh&&[].concat(E.material).forEach(C=>C.dispose())}),r.remove(l),l=new O.Object3D,r.add(l),I()},m=()=>{c=b(i.model,a.fov,a.aspect),h=i.model.bounding.getCenter(new O.Vector3);function E(C){const z=C.clone();return z.uniforms.modelAlpha.value=1,z.uniforms.map.value&&(z.uniforms.map.value.needsUpdate=!0),z}function T(C){if(C instanceof O.Mesh){const z=C.geometry,B=Array.isArray(C.material)?C.material.map(E):E(C.material);return new O.Mesh(z,B)}else if(C instanceof O.Group){const z=new O.Group;return C.children.forEach(B=>z.add(T(B))),z}else{const z=new O.Object3D;return C.children.forEach(B=>z.add(T(B))),z}}r.remove(l),l=T(i.model),r.add(l),I()},g=(E,T={})=>{const C=f();if(!C)return;E.appendChild(C.domElement),v(T);const z=window.getComputedStyle(E).position;z!=="relative"&&z!=="absolute"&&z!=="fixed"&&z!=="sticky"&&(E.style.position="relative")},v=(E={})=>{if(!n)return;const C=n.domElement.parentNode;if(C!=null&&C.nodeName){const{width:z=C.offsetWidth,height:B=C.offsetHeight}=E;n.setSize(z,B),a.aspect=z/B,a.updateProjectionMatrix()}I()};function b(E,T,C){const z=E.bounding,B=Math.pow(Math.pow(z.max.x-z.min.x+1,2)+Math.pow(z.max.y-z.min.y+1,2)+Math.pow(z.max.z-z.min.z+1,2),1/2);let F=B/2/Math.tan(Math.PI*T/360);return C<1&&(F=F/C),isNaN(F)?B:F}function y(E){return i.work.observers[E].standingPosition.clone()}const I=()=>{if(!c||!h)return;const E=i.getPose();E.fov=a.fov,E.offset=h,E.distance=c,typeof s.lockedLatitude=="number"&&(E.latitude=s.lockedLatitude),typeof s.lockedLongitude=="number"&&(E.longitude=s.lockedLongitude),typeof s.lockedPanoIndex=="number"&&(E.offset=y(s.lockedPanoIndex)),s.lookAtCurrentCamera&&(E.offset=i.camera.position.clone().setY(i.camera.position.y+1)),a.setFromPose(E),e=!0},P=()=>{e!==!0||!n||!n.domElement.parentNode||n.domElement.parentNode.offsetWidth===0||(n.render(r,a),e=!1)},k=()=>{n&&n.dispose(),n=null},D=E=>{Object.assign(s,E),I()};return Object.assign(window,{camera:a}),i.on("modelLoaded",m),i.on("modelWillLoad",u),i.on("cameraDirectionUpdate",I),i.on("dispose",k),i.on("renderFrame",P),i.on("cameraPositionUpdate",I),{appendTo:g,refresh:v,changeConfigs:D}};function ea(i){return typeof Symbol>"u"?`$Symbol<${i}>$`:Symbol(i)}const $t=ea("$$EVENT$$");function vn(i){return i[$t]||(i[$t]={}),i[$t]}function ta(i){i[$t]||delete i[$t]}class na{hasListener(t){const e=vn(this);return Boolean((e==null?void 0:e[t])&&e[t].length>0)}on(t,e,n){const o=vn(this);return o[t]||(o[t]=[]),o[t].push([e,n||!1]),()=>this.off(t,e)}once(t,e){return this.on(t,e,!0)}off(t,e){if(t===void 0){ta(this);return}const n=vn(this);if(n[t]||(n[t]=[]),e===void 0){n[t].length=0;return}let o=0;for(;o<n[t].length&&n[t][o][0]!==e;o++);o<n[t].length&&n[t].splice(o,1)}emit(t,...e){let n=!1;const s=vn(this)[t]||[];for(let r of s.slice()){const[a,l=!1]=r,c=a(...e);l&&this.off(t,a),c===!1&&(n=!0)}return n}}function ia(...i){const t=new M.Vector3;return i.forEach(e=>{t.add(e)}),t.divideScalar(i.length),t}function jn(i,t){const e=Math.round(i);return e%2===0?e:e+Number(t!=null&&t.smaller?-1:1)}const oa=({x:i,y:t,z:e})=>new M.Vector3(i,t,e),sa=([i,t,e])=>new M.Vector3(i,t,e),ra=i=>i instanceof M.Vector3?i:Array.isArray(i)?sa(i):oa(i),Ds="1.0.1",aa=`CSS3DObjectPlus@${Ds}`,la=.00216,ca=.003;class ha extends bi.CSS3DObject{constructor(e,n,o=ca,s=1){const r=Math.max(la,o),a=n[0].distanceTo(n[1]),l=n[1].distanceTo(n[2]),c=jn(a/o*s),h=jn(l/o*s),f=ia(...n);let u;if(r===o)e.style.width=`${c}px`,e.style.height=`${h}px`,u=e;else{const P=document.createElement("div");P.style.width=`${c}px`,P.style.height=`${h}px`,P.style.pointerEvents="none";const k=o/r;e.style.position="absolute",e.style.left="0",e.style.top="0",e.style.width=`${k*c}px`,e.style.height=`${k*h}px`,P.appendChild(e),u=P}super(u);d(this,"version",Ds);d(this,"width");d(this,"height");d(this,"domWidthPx");d(this,"domHeightPx");d(this,"cornerPoints");d(this,"ratio");d(this,"container");d(this,"centerPosition");if(this.scale.set(r,r,r),this.cornerPoints=n,this.ratio=o,this.container=e,r===o)this.width=a,this.height=l,this.domWidthPx=c,this.domHeightPx=h,this.centerPosition=f;else{const P=o/r;this.width=P*a,this.height=P*l,this.domWidthPx=P*c,this.domHeightPx=P*h,this.centerPosition=new M.Vector3().subVectors(f.clone(),n[0].clone()).multiplyScalar(P).add(n[0])}e.classList.add(`${aa}__container`);const m=new M.Vector3().subVectors(n[1],n[0]),g=new M.Vector3().subVectors(n[3],n[0]),v=new M.Vector3().crossVectors(m,g).normalize();this.lookAt(v);const b=this.up.clone().applyQuaternion(this.quaternion),y=g.clone(),I=new M.Vector3().crossVectors(b,y).normalize();this.rotateOnWorldAxis(I,b.angleTo(y)),this.position.copy(f)}}const ua="v2.0.1",zs="CSS3DRenderer",Dn=`${zs}@${ua}`,so=i=>`${Dn}--${i}`,pe={};class da{constructor(){d(this,"hooks",new na);d(this,"state",{enabled:!0,visible:!0,disposed:!1});d(this,"store",{disposers:[],frontModeCSS3DObjects:{},behindModeCSS3DObjects:{}});d(this,"create3DElement",(t,e,n)=>{if(this.state.disposed)return this.disposedErrorLog();const o=(()=>{const j={ratio:.00216,devicePixelRatio:1,mode:"front",autoRender:!0,container:document.createElement("div"),pointerEvents:"none"};return Object.assign(j,n)})(),s=e.map(ra);if((s==null?void 0:s.length)<4)return console.error(`${Dn}: requires 4 point but params may have fewer`);const{ratio:r,devicePixelRatio:a,mode:l,autoRender:c,container:h,pointerEvents:f}=o,u=[],{css3DObject:m,opacityMesh:g}=this.createObject(s,{ratio:r,dpr:a,container:h,mode:l,pointerEvents:f});h.id=`container--${m.uuid}`;const v=l==="front"&&!pe.frontModeStore,b=l==="behind"&&!pe.behindModeStore;b&&(pe.behindModeStore={scene:o.scene,css3DScene:new O.Scene,css3DRenderer:new bi.CSS3DRenderer}),v&&(pe.frontModeStore={css3DScene:new O.Scene,css3DRenderer:new bi.CSS3DRenderer});const y=l==="front"?pe.frontModeStore:pe.behindModeStore,{css3DScene:I,css3DRenderer:P}=y,k=(()=>{const j=()=>{l==="front"?this.store.frontModeCSS3DObjects[m.uuid]={visible:!0,enabled:!0,css3DObject:m,mode:"front"}:this.store.behindModeCSS3DObjects[m.uuid]={visible:!0,enabled:!0,css3DObject:m,opacityMesh:g,mode:"behind",scene:o.scene},I.add(m),l==="behind"&&g&&(o.scene.add(g),u.push(()=>g&&o.scene.remove(g)))};if(v||b){P.domElement.style.position="absolute",P.domElement.style.top="0",P.domElement.style.userSelect="none",P.domElement.style.pointerEvents="none",P.domElement.classList.add(so(l));const R=()=>{const H=requestAnimationFrame(R);y.requestAnimationFrameId=H,P.render(I,t)};return()=>{j(),R()}}return()=>j()})(),D=l==="front"?pe.frontModeContainer:pe.behindModeContainer;if(D){this.appendToElement(D,l);const j=l==="front"?pe.frontModeStore:pe.behindModeStore;j&&(j.appendedToPage=!0)}const E=j=>this.setVisibleById(m.uuid,j),T=j=>this.setEnabledById(m.uuid,j),C=()=>E(!0),z=()=>E(!1),B=()=>T(!0),F=()=>T(!1),$=()=>(delete this.store.frontModeCSS3DObjects[m.uuid],delete this.store.behindModeCSS3DObjects[m.uuid],u.forEach(j=>j==null?void 0:j()),I.remove(m),I.children.length===0&&(typeof y.requestAnimationFrameId=="number"&&cancelAnimationFrame(y.requestAnimationFrameId),P.domElement.remove(),l==="front"&&(pe.frontModeStore=void 0),l==="behind"&&(pe.behindModeStore=void 0),pe.resizeObserver=void 0),!0);return this.store.disposers.push($),c&&k(),{id:m.uuid,container:h,dispose:$,css3DObject:m,render:c?void 0:k,show:C,hide:z,setVisible:E,disable:F,enable:B,setEnabled:T,appendToElement:j=>this.appendToElement(j,l)}});d(this,"setVisibleById",(t,e)=>{var o;const n=(o=this.store.frontModeCSS3DObjects[t])!=null?o:this.store.behindModeCSS3DObjects[t];if(!n)return console.error("id not found",t);n.visible=e,this.state.visible&&(n.css3DObject.visible=e,n.mode==="behind"&&(n.opacityMesh.visible=e))});d(this,"setEnabledById",(t,e)=>{var s,r,a;const n=(s=this.store.frontModeCSS3DObjects[t])!=null?s:this.store.behindModeCSS3DObjects[t];if(!n)return;const o=n.mode==="front"?(r=pe.frontModeStore)==null?void 0:r.css3DScene:(a=pe.behindModeStore)==null?void 0:a.css3DScene;!o||(e?(o.add(n.css3DObject),n.mode==="behind"&&n.scene.add(n.opacityMesh)):(o.remove(n.css3DObject),n.mode==="behind"&&n.scene.remove(n.opacityMesh)),n.enabled=e)});d(this,"createObject",(t,e)=>{const{ratio:n,dpr:o,container:s,mode:r,pointerEvents:a}=e,l=new ha(s,t,n,o);s.style.pointerEvents=a,s.classList.add(`${zs}__container`);const{domWidthPx:c,domHeightPx:h}=l,f=(()=>{if(r==="behind"){const u=new O.MeshBasicMaterial({opacity:0,transparent:!1,side:O.DoubleSide}),m=new O.PlaneGeometry(c,h),g=new O.Mesh(m,u);return g.name=so("mesh"),g.position.copy(l.position),g.rotation.copy(l.rotation),g.scale.copy(l.scale),g}})();return{css3DObject:l,opacityMesh:f}});d(this,"createResizeObserver",(t,e,n=!0)=>{if(!t)return console.error("createResizeObserver: element is undefined"),{observe:()=>{},unobserve:()=>{}};const o=()=>{const r=jn(t.clientWidth,{smaller:!0}),a=jn(t.clientHeight,{smaller:!0});e(r,a)};if(typeof ResizeObserver>"u"||!ResizeObserver)return console.warn("createResizeObserver: ResizeObserver is undefined"),{observe:()=>o(),unobserve:()=>{}};const s=new ResizeObserver(o);return n&&o(),{observe:()=>s.observe(t),unobserve:()=>s.unobserve(t)}});d(this,"disposedErrorLog",()=>{console.error(`${Dn} is disposed`)})}getCurrentState(){return this.state}setState(t,e={userAction:!0}){if(this.state.disposed)return this.disposedErrorLog();const n={...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()),this.hooks.emit("stateChange",{state:this.state,prevState:n,userAction:e.userAction})}dispose(){this.store.disposers.forEach(t=>t==null?void 0:t()),this.store.disposers=[],this.hooks.emit("dispose"),this.state.disposed=!0}async show({userAction:t}={userAction:!0}){if(this.state.disposed)return this.disposedErrorLog();this.setState({visible:!0},{userAction:t}),this.hooks.emit("show",{userAction:t})}async hide({userAction:t}={userAction:!0}){if(this.state.disposed)return this.disposedErrorLog();this.setState({visible:!1},{userAction:t}),this.hooks.emit("hide",{userAction:t})}enable({userAction:t}={userAction:!0}){if(this.state.disposed)return this.disposedErrorLog();this.setState({enabled:!0},{userAction:t}),this.hooks.emit("enable",{userAction:t})}disable({userAction:t}={userAction:!0}){if(this.state.disposed)return this.disposedErrorLog();this.setState({enabled:!1},{userAction:t}),this.hooks.emit("disable",{userAction:t})}appendToElement(t,e){if(!t)throw new Error(`${Dn} Cannot append to container: container is ${t}`);const n=e==="front"?pe.frontModeStore:pe.behindModeStore;if(!n){e==="front"&&(pe.frontModeContainer=t),e==="behind"&&(pe.behindModeContainer=t);return}if(!n.appendedToPage){if(t.appendChild(n.css3DRenderer.domElement),!pe.resizeObserver){const o=(a,l)=>{var c,h;(c=pe.frontModeStore)==null||c.css3DRenderer.setSize(a,l),(h=pe.behindModeStore)==null||h.css3DRenderer.setSize(a,l)},{observe:s,unobserve:r}=this.createResizeObserver(t,o,!0);pe.resizeObserver={observe:s,unobserve:r},s(),this.store.disposers.push(r)}n.appendedToPage=!0}}async handleShow(){Object.values(this.store.frontModeCSS3DObjects).forEach(t=>{t.css3DObject.visible=t.visible}),Object.values(this.store.behindModeCSS3DObjects).forEach(t=>{t.css3DObject.visible=t.visible,t.opacityMesh.visible=t.visible})}async handleHide(){Object.values(this.store.frontModeCSS3DObjects).forEach(t=>{t.css3DObject.visible=!1}),Object.values(this.store.behindModeCSS3DObjects).forEach(t=>{t.css3DObject.visible=!1,t.opacityMesh.visible=!1})}handleEnable(){Object.values(this.store.frontModeCSS3DObjects).forEach(t=>{var e;!t.enabled||(e=pe.frontModeStore)==null||e.css3DScene.add(t.css3DObject)}),Object.values(this.store.behindModeCSS3DObjects).forEach(t=>{var e,n;!t.enabled||((e=pe.behindModeStore)==null||e.css3DScene.add(t.css3DObject),(n=pe.behindModeStore)==null||n.scene.add(t.opacityMesh))})}handleDisable(){Object.values(this.store.frontModeCSS3DObjects).forEach(t=>{var e;(e=pe.frontModeStore)==null||e.css3DScene.remove(t.css3DObject)}),Object.values(this.store.behindModeCSS3DObjects).forEach(t=>{var e,n;(e=pe.behindModeStore)==null||e.css3DScene.remove(t.css3DObject),(n=pe.behindModeStore)==null||n.scene.remove(t.opacityMesh)})}}const fa="v2.0.1",ro=`CSS3DRenderPlugin@${fa}`;class ma extends da{constructor(e){super();d(this,"five");d(this,"create3DDomContainer",(e,n)=>{if(this.state.disposed)return;const o=(()=>{var m;(n==null?void 0:n.dpr)!==void 0&&console.warn(`${ro}: please use "config.devicePixelRatio" replace "config.dpr"`);const u={ratio:.00216,devicePixelRatio:(m=n==null?void 0:n.dpr)!=null?m: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(`${ro}: five.getElement() is ${s}`);return}const{autoRender:r,mode:a}=o,l=a==="front"?s.parentElement:o.behindFiveContainer;this.appendToElement(l||document.body,a);const c=this.create3DElement(this.five.camera,e,{...o,autoRender:!1});if(!c)return;const h=c.render,f=()=>{var u;a==="front"&&h(),a==="behind"&&((u=this.five.model)!=null&&u.loaded?h():this.five.once("modelLoaded",()=>h()))};return r&&f(),{...c,render:r?void 0:f}});this.five=e}disposeAll(){return this.dispose()}setState(...e){const n=super.setState(...e);return this.five.needsRender=!0,n}}const Xn=i=>new ma(i);function li(i,t,e=new M.Vector3(1,1,1),n=!1){const o=new Cs.Line(i,t);return o.setMaterial({dashed:n,color:e,linewidth:1}),o.remove(o.points),o}const pa=i=>{const t={intersection:null,disposers:[]},e=h=>{t.intersection=h},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=(h,f=2,u=.1)=>{const m=f/2,v=c(h,u),b=new M.Group;b.add(li(new M.Vector3(v.x+m,v.y,v.z),new M.Vector3(v.x-m,v.y,v.z),new M.Vector3(1,0,0)),li(new M.Vector3(v.x,v.y+m,v.z),new M.Vector3(v.x,v.y-m,v.z),new M.Vector3(0,1,0)),li(new M.Vector3(v.x,v.y,v.z+m),new M.Vector3(v.x,v.y,v.z-m),new M.Vector3(0,0,1))),i.scene.add(b),i.needsRender=!0;const y=()=>{i.scene.remove(b)};return t.disposers.push(y),{clear:y,pointAxesHelperMesh:b}},s=(h,f=0)=>{var y,I;const u=(y=i==null?void 0:i.camera)==null?void 0:y.position;if(!u)return!1;const m=h.distanceTo(u),g=h.sub(u).normalize(),v=new M.Raycaster(u,g),b=(I=i.model.intersectRaycaster(v))==null?void 0:I[0];return!(b&&b.distance+f<m)},r=()=>t.intersection,a=()=>{var h,f;(f=(h=t.disposers)==null?void 0:h.forEach)==null||f.call(h,u=>u==null?void 0:u()),i.off("intersectionOnModelUpdate",e),i.off("intersectionHidden",n)},l=a,c=(h,f)=>{const u=h.clone();return i.camera.position.clone().sub(u).setLength(f).add(u)};return{intersection:r,pointAxesHelper:o,movePointTowardsCamera:c,destroy:a,dispose:l,canSeePoint:s}};function ne(){}const ki=i=>i;function Fe(i,t){for(const e in t)i[e]=t[e];return i}function Ms(i){return i()}function ao(){return Object.create(null)}function Bt(i){i.forEach(Ms)}function Ti(i){return typeof i=="function"}function he(i,t){return i!=i?t==t:i!==t||i&&typeof i=="object"||typeof i=="function"}let bn;function lo(i,t){return bn||(bn=document.createElement("a")),bn.href=t,i===bn.href}function ga(i){return Object.keys(i).length===0}function je(i){return i==null?"":i}const Ss=typeof window<"u";let va=Ss?()=>window.performance.now():()=>Date.now(),Di=Ss?i=>requestAnimationFrame(i):ne;const Ot=new Set;function js(i){Ot.forEach(t=>{t.c(i)||(Ot.delete(t),t.f())}),Ot.size!==0&&Di(js)}function ba(i){let t;return Ot.size===0&&Di(js),{promise:new Promise(e=>{Ot.add(t={c:i,f:e})}),abort(){Ot.delete(t)}}}function Q(i,t){i.appendChild(t)}function ge(i,t,e){const n=zi(i);if(!n.getElementById(t)){const o=X("style");o.id=t,o.textContent=e,Os(n,o)}}function zi(i){if(!i)return document;const t=i.getRootNode?i.getRootNode():i.ownerDocument;return t&&t.host?t:i.ownerDocument}function Aa(i){const t=X("style");return Os(zi(i),t),t.sheet}function Os(i,t){return Q(i.head||i,t),t.sheet}function V(i,t,e){i.insertBefore(t,e||null)}function W(i){i.parentNode.removeChild(i)}function Ht(i,t){for(let e=0;e<i.length;e+=1)i[e]&&i[e].d(t)}function X(i){return document.createElement(i)}function De(i){return document.createElementNS("http://www.w3.org/2000/svg",i)}function Ue(i){return document.createTextNode(i)}function fe(){return Ue(" ")}function Ge(){return Ue("")}function qe(i,t,e,n){return i.addEventListener(t,e,n),()=>i.removeEventListener(t,e,n)}function x(i,t,e){e==null?i.removeAttribute(t):i.getAttribute(t)!==e&&i.setAttribute(t,e)}function ya(i){return Array.from(i.childNodes)}function dt(i,t){t=""+t,i.wholeText!==t&&(i.data=t)}function S(i,t,e,n){e===null?i.style.removeProperty(t):i.style.setProperty(t,e,n?"important":"")}let An;function Pa(){if(An===void 0){An=!1;try{typeof window<"u"&&window.parent&&window.parent.document}catch{An=!0}}return An}function Ft(i,t){getComputedStyle(i).position==="static"&&(i.style.position="relative");const n=X("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=Pa();let s;return o?(n.src="data:text/html,<script>onresize=function(){parent.postMessage(0,'*')}<\/script>",s=qe(window,"message",r=>{r.source===n.contentWindow&&t()})):(n.src="about:blank",n.onload=()=>{s=qe(n.contentWindow,"resize",t)}),Q(i,n),()=>{(o||s&&n.contentWindow)&&s(),W(n)}}function Se(i,t,e){i.classList[e?"add":"remove"](t)}function wa(i,t,{bubbles:e=!1,cancelable:n=!1}={}){const o=document.createEvent("CustomEvent");return o.initCustomEvent(i,e,n,t),o}class Ai{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=De(e.nodeName):this.e=X(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)V(this.t,this.n[e],t)}p(t){this.d(),this.h(t),this.i(this.a)}d(){this.n.forEach(W)}}const On=new Map;let Rn=0;function Ea(i){let t=5381,e=i.length;for(;e--;)t=(t<<5)-t^i.charCodeAt(e);return t>>>0}function Ia(i,t){const e={stylesheet:Aa(t),rules:{}};return On.set(i,e),e}function xa(i,t,e,n,o,s,r,a=0){const l=16.666/n;let c=`{
|
|
101
|
+
`;class Kr extends Ur{constructor(e){super();d(this,"configs");d(this,"clientWidth");d(this,"clientHeight");d(this,"ready",!1);d(this,"uuid",ut());d(this,"tween");d(this,"tweening",!1);d(this,"container");d(this,"canvas");d(this,"data",{});d(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=qr,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 u;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:ht.Undo,color:this.color,ready:this.ready,state:l,uuid:this.uuid});const c=(u=this.canvas[this.uuid])==null?void 0:u.getContext("2d");if(!this.canvas[this.uuid])return;const{width:h,height:f}=this.canvas[this.uuid];c&&c.clearRect(0,0,h,f),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:ht.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 h=(f,u,m)=>{const g=this.color||"#ff0000";n.strokeStyle=g,n.beginPath(),n.moveTo(f.x,f.y),n.quadraticCurveTo(u.x,u.y,m.x,m.y),n.stroke()};e.onmousedown=f=>{f.preventDefault(),c=Date.now();const u=f.clientX,m=f.clientY;r=[],r.push({x:u,y:m}),s={x:u,y:m},a=mn({x:u,y:m},this.clientWidth,this.clientHeight),l=[]},e.onmousemove=f=>{if(f.preventDefault(),!s)return;const u=Number(f.clientX),m=Number(f.clientY);if(Math.abs(u-s.x)<5&&Math.abs(m-s.y)<5||(r.push({x:u,y:m}),l.push(mn({x:u,y:m},this.clientWidth,this.clientHeight)),r.length<3))return;const{control:g,end:v}=pn(r);!g||!v||(h(s,g,v),s=v)},e.onmouseup=f=>{if(f.preventDefault(),s=null,r.length<3)return;this.data[this.uuid]||(this.data[this.uuid]=[]);const u=Date.now()-c,m={move:Object.assign({},a),uuid:this.uuid,line:[...l],color:this.color,duration:u<1280?u:u<2e3?1280:0};this.data[this.uuid].push(m),Tn(()=>{this.emitStateChange({type:ht.Drawline,color:this.color,ready:this.ready,state:m,uuid:this.uuid})})},e.ontouchstart=f=>{f.preventDefault(),c=Date.now();const u=f.touches[0].clientX,m=f.touches[0].clientY;r=[],r.push({x:u,y:m}),s={x:u,y:m},console.log("ontouchstart",u,m,s),a=mn({x:u,y:m},this.clientWidth,this.clientHeight),l=[]},e.ontouchmove=f=>{if(f.preventDefault(),!s)return;const u=Number(f.touches[0].clientX),m=Number(f.touches[0].clientY);if(Math.abs(u-s.x)<5&&Math.abs(m-s.y)<5||(r.push({x:u,y:m}),l.push(mn({x:u,y:m},this.clientWidth,this.clientHeight)),r.length<3))return;const{control:g,end:v}=pn(r);!g||!v||(h(s,g,v),s=v)},e.ontouchend=e.ontouchcancel=f=>{if(f.preventDefault(),s=null,r.length<3)return;this.data[this.uuid]||(this.data[this.uuid]=[]);const u=Date.now()-c,m={move:Object.assign({},a),line:[...l],uuid:this.uuid,color:this.color,duration:u<1280?u:u<2e3?1280:0};this.data[this.uuid].push(m),Tn(()=>{this.emitStateChange({type:ht.Drawline,color:this.color,ready:this.ready,state:m,uuid:this.uuid})})}}emitStateChange(e,n=!0){if(e.type!==ht.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};Wr(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 ht.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 ht.Undo:this.handleUndo(s);break}}handleDrawLine(e,n,{withUndo:o=!1},s=Ts){!n||Object.prototype.toString.call(n)!="[object Object]"||Object.keys(n).length===0||(console.log("handleDrawLine",n,n.line),Qr(()=>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:h=0,uuid:f}=n,u=ai(n.move||{},this.clientWidth,this.clientHeight);let m=[u];if(a.strokeStyle=c,a.beginPath(),a.moveTo(u.x,u.y),h&&!o){let g=[];const v=this;v.tween=Zr({step:0},{step:l.length-1},h).onUpdate(({step:b})=>{var I;if(v.tweening=!0,!v.ready)return a.clearRect(0,0,v.canvas[f].width,v.canvas[f].height),(I=v.tween)==null?void 0:I.stop();const y=Math.floor(b);if(!g.find(P=>P===y)){if(g.push(y),console.log("__debug__",l,l[y],y),m.push(ai(l[y],v.clientWidth,v.clientHeight)),m.length<3)return;const{control:P,end:L}=pn(m);if(!P||!L)return;a.quadraticCurveTo(P.x,P.y,L.x,L.y),a.stroke()}}).onComplete(b=>{v.tween=void 0,v.tweening=!1,g=[],m=[],s&&s(),r()})}else{for(let g=0;g<l.length;g++){if(m.push(ai(l[g],this.clientWidth,this.clientHeight)),m.length<3)continue;const{control:v,end:b}=pn(m);!v||!b||a.quadraticCurveTo(v.x,v.y,b.x,b.y)}a.stroke(),m=[],s&&s(),r()}})))}handleUndo(e){if(console.log("handleUndo",e,this.canvas[e]),!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(),Tn(n,60);return}n()}destroyBrush(){this.closeBrush(),this.ready=!1,this.emit("readyChange",!0)}}class _r{constructor(t={}){d(this,"controller");const e=Object.assign({currentColor:"#f44336",onUndoText:"\u56DE\u9000",onExitText:"\u5173\u95ED"},t);this.controller=new Kr(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 $r=(i,t)=>{let e=!0,n=null;const s={...{lookAtCurrentCamera:!1,lockedPanoIndex:null,lockedLatitude:null,lockedLongitude:null},...t==null?void 0:t.config},r=new O.Scene,a=new ye.Camera(60);let l=new O.Object3D,c,h;{const E=new O.DirectionalLight(16777215,.5);E.position.copy(new O.Vector3(1,1,1)),r.add(E)}{const E=new O.DirectionalLight(16777215,.3);r.add(E)}{const E=new O.AmbientLight(16777215,.3);r.add(E)}r.add(l);const f=()=>{if(!!i.renderer)return n||(n=new O.WebGLRenderer({antialias:!1,alpha:!0}),n.setPixelRatio(i.renderer.getPixelRatio()),n.outputEncoding=O.sRGBEncoding,n.setClearColor(1579548,0),n.autoClear=!0),n},u=()=>{l.traverse(E=>{E instanceof O.Mesh&&[].concat(E.material).forEach(C=>C.dispose())}),r.remove(l),l=new O.Object3D,r.add(l),I()},m=()=>{c=b(i.model,a.fov,a.aspect),h=i.model.bounding.getCenter(new O.Vector3);function E(C){const z=C.clone();return z.uniforms.modelAlpha.value=1,z.uniforms.map.value&&(z.uniforms.map.value.needsUpdate=!0),z}function T(C){if(C instanceof O.Mesh){const z=C.geometry,B=Array.isArray(C.material)?C.material.map(E):E(C.material);return new O.Mesh(z,B)}else if(C instanceof O.Group){const z=new O.Group;return C.children.forEach(B=>z.add(T(B))),z}else{const z=new O.Object3D;return C.children.forEach(B=>z.add(T(B))),z}}r.remove(l),l=T(i.model),r.add(l),I()},g=(E,T={})=>{const C=f();if(!C)return;E.appendChild(C.domElement),v(T);const z=window.getComputedStyle(E).position;z!=="relative"&&z!=="absolute"&&z!=="fixed"&&z!=="sticky"&&(E.style.position="relative")},v=(E={})=>{if(!n)return;const C=n.domElement.parentNode;if(C!=null&&C.nodeName){const{width:z=C.offsetWidth,height:B=C.offsetHeight}=E;n.setSize(z,B),a.aspect=z/B,a.updateProjectionMatrix()}I()};function b(E,T,C){const z=E.bounding,B=Math.pow(Math.pow(z.max.x-z.min.x+1,2)+Math.pow(z.max.y-z.min.y+1,2)+Math.pow(z.max.z-z.min.z+1,2),1/2);let F=B/2/Math.tan(Math.PI*T/360);return C<1&&(F=F/C),isNaN(F)?B:F}function y(E){return i.work.observers[E].standingPosition.clone()}const I=()=>{if(!c||!h)return;const E=i.getPose();E.fov=a.fov,E.offset=h,E.distance=c,typeof s.lockedLatitude=="number"&&(E.latitude=s.lockedLatitude),typeof s.lockedLongitude=="number"&&(E.longitude=s.lockedLongitude),typeof s.lockedPanoIndex=="number"&&(E.offset=y(s.lockedPanoIndex)),s.lookAtCurrentCamera&&(E.offset=i.camera.position.clone().setY(i.camera.position.y+1)),a.setFromPose(E),e=!0},P=()=>{e!==!0||!n||!n.domElement.parentNode||n.domElement.parentNode.offsetWidth===0||(n.render(r,a),e=!1)},L=()=>{n&&n.dispose(),n=null},D=E=>{Object.assign(s,E),I()};return Object.assign(window,{camera:a}),i.on("modelLoaded",m),i.on("modelWillLoad",u),i.on("cameraDirectionUpdate",I),i.on("dispose",L),i.on("renderFrame",P),i.on("cameraPositionUpdate",I),{appendTo:g,refresh:v,changeConfigs:D}};function ea(i){return typeof Symbol>"u"?`$Symbol<${i}>$`:Symbol(i)}const $t=ea("$$EVENT$$");function vn(i){return i[$t]||(i[$t]={}),i[$t]}function ta(i){i[$t]||delete i[$t]}class na{hasListener(t){const e=vn(this);return Boolean((e==null?void 0:e[t])&&e[t].length>0)}on(t,e,n){const o=vn(this);return o[t]||(o[t]=[]),o[t].push([e,n||!1]),()=>this.off(t,e)}once(t,e){return this.on(t,e,!0)}off(t,e){if(t===void 0){ta(this);return}const n=vn(this);if(n[t]||(n[t]=[]),e===void 0){n[t].length=0;return}let o=0;for(;o<n[t].length&&n[t][o][0]!==e;o++);o<n[t].length&&n[t].splice(o,1)}emit(t,...e){let n=!1;const s=vn(this)[t]||[];for(let r of s.slice()){const[a,l=!1]=r,c=a(...e);l&&this.off(t,a),c===!1&&(n=!0)}return n}}function ia(...i){const t=new M.Vector3;return i.forEach(e=>{t.add(e)}),t.divideScalar(i.length),t}function jn(i,t){const e=Math.round(i);return e%2===0?e:e+Number(t!=null&&t.smaller?-1:1)}const oa=({x:i,y:t,z:e})=>new M.Vector3(i,t,e),sa=([i,t,e])=>new M.Vector3(i,t,e),ra=i=>i instanceof M.Vector3?i:Array.isArray(i)?sa(i):oa(i),Ds="1.0.1",aa=`CSS3DObjectPlus@${Ds}`,la=.00216,ca=.003;class ha extends bi.CSS3DObject{constructor(e,n,o=ca,s=1){const r=Math.max(la,o),a=n[0].distanceTo(n[1]),l=n[1].distanceTo(n[2]),c=jn(a/o*s),h=jn(l/o*s),f=ia(...n);let u;if(r===o)e.style.width=`${c}px`,e.style.height=`${h}px`,u=e;else{const P=document.createElement("div");P.style.width=`${c}px`,P.style.height=`${h}px`,P.style.pointerEvents="none";const L=o/r;e.style.position="absolute",e.style.left="0",e.style.top="0",e.style.width=`${L*c}px`,e.style.height=`${L*h}px`,P.appendChild(e),u=P}super(u);d(this,"version",Ds);d(this,"width");d(this,"height");d(this,"domWidthPx");d(this,"domHeightPx");d(this,"cornerPoints");d(this,"ratio");d(this,"container");d(this,"centerPosition");if(this.scale.set(r,r,r),this.cornerPoints=n,this.ratio=o,this.container=e,r===o)this.width=a,this.height=l,this.domWidthPx=c,this.domHeightPx=h,this.centerPosition=f;else{const P=o/r;this.width=P*a,this.height=P*l,this.domWidthPx=P*c,this.domHeightPx=P*h,this.centerPosition=new M.Vector3().subVectors(f.clone(),n[0].clone()).multiplyScalar(P).add(n[0])}e.classList.add(`${aa}__container`);const m=new M.Vector3().subVectors(n[1],n[0]),g=new M.Vector3().subVectors(n[3],n[0]),v=new M.Vector3().crossVectors(m,g).normalize();this.lookAt(v);const b=this.up.clone().applyQuaternion(this.quaternion),y=g.clone(),I=new M.Vector3().crossVectors(b,y).normalize();this.rotateOnWorldAxis(I,b.angleTo(y)),this.position.copy(f)}}const ua="v2.0.1",zs="CSS3DRenderer",Dn=`${zs}@${ua}`,so=i=>`${Dn}--${i}`,pe={};class da{constructor(){d(this,"hooks",new na);d(this,"state",{enabled:!0,visible:!0,disposed:!1});d(this,"store",{disposers:[],frontModeCSS3DObjects:{},behindModeCSS3DObjects:{}});d(this,"create3DElement",(t,e,n)=>{if(this.state.disposed)return this.disposedErrorLog();const o=(()=>{const j={ratio:.00216,devicePixelRatio:1,mode:"front",autoRender:!0,container:document.createElement("div"),pointerEvents:"none"};return Object.assign(j,n)})(),s=e.map(ra);if((s==null?void 0:s.length)<4)return console.error(`${Dn}: requires 4 point but params may have fewer`);const{ratio:r,devicePixelRatio:a,mode:l,autoRender:c,container:h,pointerEvents:f}=o,u=[],{css3DObject:m,opacityMesh:g}=this.createObject(s,{ratio:r,dpr:a,container:h,mode:l,pointerEvents:f});h.id=`container--${m.uuid}`;const v=l==="front"&&!pe.frontModeStore,b=l==="behind"&&!pe.behindModeStore;b&&(pe.behindModeStore={scene:o.scene,css3DScene:new O.Scene,css3DRenderer:new bi.CSS3DRenderer}),v&&(pe.frontModeStore={css3DScene:new O.Scene,css3DRenderer:new bi.CSS3DRenderer});const y=l==="front"?pe.frontModeStore:pe.behindModeStore,{css3DScene:I,css3DRenderer:P}=y,L=(()=>{const j=()=>{l==="front"?this.store.frontModeCSS3DObjects[m.uuid]={visible:!0,enabled:!0,css3DObject:m,mode:"front"}:this.store.behindModeCSS3DObjects[m.uuid]={visible:!0,enabled:!0,css3DObject:m,opacityMesh:g,mode:"behind",scene:o.scene},I.add(m),l==="behind"&&g&&(o.scene.add(g),u.push(()=>g&&o.scene.remove(g)))};if(v||b){P.domElement.style.position="absolute",P.domElement.style.top="0",P.domElement.style.userSelect="none",P.domElement.style.pointerEvents="none",P.domElement.classList.add(so(l));const R=()=>{const H=requestAnimationFrame(R);y.requestAnimationFrameId=H,P.render(I,t)};return()=>{j(),R()}}return()=>j()})(),D=l==="front"?pe.frontModeContainer:pe.behindModeContainer;if(D){this.appendToElement(D,l);const j=l==="front"?pe.frontModeStore:pe.behindModeStore;j&&(j.appendedToPage=!0)}const E=j=>this.setVisibleById(m.uuid,j),T=j=>this.setEnabledById(m.uuid,j),C=()=>E(!0),z=()=>E(!1),B=()=>T(!0),F=()=>T(!1),$=()=>(delete this.store.frontModeCSS3DObjects[m.uuid],delete this.store.behindModeCSS3DObjects[m.uuid],u.forEach(j=>j==null?void 0:j()),I.remove(m),I.children.length===0&&(typeof y.requestAnimationFrameId=="number"&&cancelAnimationFrame(y.requestAnimationFrameId),P.domElement.remove(),l==="front"&&(pe.frontModeStore=void 0),l==="behind"&&(pe.behindModeStore=void 0),pe.resizeObserver=void 0),!0);return this.store.disposers.push($),c&&L(),{id:m.uuid,container:h,dispose:$,css3DObject:m,render:c?void 0:L,show:C,hide:z,setVisible:E,disable:F,enable:B,setEnabled:T,appendToElement:j=>this.appendToElement(j,l)}});d(this,"setVisibleById",(t,e)=>{var o;const n=(o=this.store.frontModeCSS3DObjects[t])!=null?o:this.store.behindModeCSS3DObjects[t];if(!n)return console.error("id not found",t);n.visible=e,this.state.visible&&(n.css3DObject.visible=e,n.mode==="behind"&&(n.opacityMesh.visible=e))});d(this,"setEnabledById",(t,e)=>{var s,r,a;const n=(s=this.store.frontModeCSS3DObjects[t])!=null?s:this.store.behindModeCSS3DObjects[t];if(!n)return;const o=n.mode==="front"?(r=pe.frontModeStore)==null?void 0:r.css3DScene:(a=pe.behindModeStore)==null?void 0:a.css3DScene;!o||(e?(o.add(n.css3DObject),n.mode==="behind"&&n.scene.add(n.opacityMesh)):(o.remove(n.css3DObject),n.mode==="behind"&&n.scene.remove(n.opacityMesh)),n.enabled=e)});d(this,"createObject",(t,e)=>{const{ratio:n,dpr:o,container:s,mode:r,pointerEvents:a}=e,l=new ha(s,t,n,o);s.style.pointerEvents=a,s.classList.add(`${zs}__container`);const{domWidthPx:c,domHeightPx:h}=l,f=(()=>{if(r==="behind"){const u=new O.MeshBasicMaterial({opacity:0,transparent:!1,side:O.DoubleSide}),m=new O.PlaneGeometry(c,h),g=new O.Mesh(m,u);return g.name=so("mesh"),g.position.copy(l.position),g.rotation.copy(l.rotation),g.scale.copy(l.scale),g}})();return{css3DObject:l,opacityMesh:f}});d(this,"createResizeObserver",(t,e,n=!0)=>{if(!t)return console.error("createResizeObserver: element is undefined"),{observe:()=>{},unobserve:()=>{}};const o=()=>{const r=jn(t.clientWidth,{smaller:!0}),a=jn(t.clientHeight,{smaller:!0});e(r,a)};if(typeof ResizeObserver>"u"||!ResizeObserver)return console.warn("createResizeObserver: ResizeObserver is undefined"),{observe:()=>o(),unobserve:()=>{}};const s=new ResizeObserver(o);return n&&o(),{observe:()=>s.observe(t),unobserve:()=>s.unobserve(t)}});d(this,"disposedErrorLog",()=>{console.error(`${Dn} is disposed`)})}getCurrentState(){return this.state}setState(t,e={userAction:!0}){if(this.state.disposed)return this.disposedErrorLog();const n={...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()),this.hooks.emit("stateChange",{state:this.state,prevState:n,userAction:e.userAction})}dispose(){this.store.disposers.forEach(t=>t==null?void 0:t()),this.store.disposers=[],this.hooks.emit("dispose"),this.state.disposed=!0}async show({userAction:t}={userAction:!0}){if(this.state.disposed)return this.disposedErrorLog();this.setState({visible:!0},{userAction:t}),this.hooks.emit("show",{userAction:t})}async hide({userAction:t}={userAction:!0}){if(this.state.disposed)return this.disposedErrorLog();this.setState({visible:!1},{userAction:t}),this.hooks.emit("hide",{userAction:t})}enable({userAction:t}={userAction:!0}){if(this.state.disposed)return this.disposedErrorLog();this.setState({enabled:!0},{userAction:t}),this.hooks.emit("enable",{userAction:t})}disable({userAction:t}={userAction:!0}){if(this.state.disposed)return this.disposedErrorLog();this.setState({enabled:!1},{userAction:t}),this.hooks.emit("disable",{userAction:t})}appendToElement(t,e){if(!t)throw new Error(`${Dn} Cannot append to container: container is ${t}`);const n=e==="front"?pe.frontModeStore:pe.behindModeStore;if(!n){e==="front"&&(pe.frontModeContainer=t),e==="behind"&&(pe.behindModeContainer=t);return}if(!n.appendedToPage){if(t.appendChild(n.css3DRenderer.domElement),!pe.resizeObserver){const o=(a,l)=>{var c,h;(c=pe.frontModeStore)==null||c.css3DRenderer.setSize(a,l),(h=pe.behindModeStore)==null||h.css3DRenderer.setSize(a,l)},{observe:s,unobserve:r}=this.createResizeObserver(t,o,!0);pe.resizeObserver={observe:s,unobserve:r},s(),this.store.disposers.push(r)}n.appendedToPage=!0}}async handleShow(){Object.values(this.store.frontModeCSS3DObjects).forEach(t=>{t.css3DObject.visible=t.visible}),Object.values(this.store.behindModeCSS3DObjects).forEach(t=>{t.css3DObject.visible=t.visible,t.opacityMesh.visible=t.visible})}async handleHide(){Object.values(this.store.frontModeCSS3DObjects).forEach(t=>{t.css3DObject.visible=!1}),Object.values(this.store.behindModeCSS3DObjects).forEach(t=>{t.css3DObject.visible=!1,t.opacityMesh.visible=!1})}handleEnable(){Object.values(this.store.frontModeCSS3DObjects).forEach(t=>{var e;!t.enabled||(e=pe.frontModeStore)==null||e.css3DScene.add(t.css3DObject)}),Object.values(this.store.behindModeCSS3DObjects).forEach(t=>{var e,n;!t.enabled||((e=pe.behindModeStore)==null||e.css3DScene.add(t.css3DObject),(n=pe.behindModeStore)==null||n.scene.add(t.opacityMesh))})}handleDisable(){Object.values(this.store.frontModeCSS3DObjects).forEach(t=>{var e;(e=pe.frontModeStore)==null||e.css3DScene.remove(t.css3DObject)}),Object.values(this.store.behindModeCSS3DObjects).forEach(t=>{var e,n;(e=pe.behindModeStore)==null||e.css3DScene.remove(t.css3DObject),(n=pe.behindModeStore)==null||n.scene.remove(t.opacityMesh)})}}const fa="v2.0.1",ro=`CSS3DRenderPlugin@${fa}`;class ma extends da{constructor(e){super();d(this,"five");d(this,"create3DDomContainer",(e,n)=>{if(this.state.disposed)return;const o=(()=>{var m;(n==null?void 0:n.dpr)!==void 0&&console.warn(`${ro}: please use "config.devicePixelRatio" replace "config.dpr"`);const u={ratio:.00216,devicePixelRatio:(m=n==null?void 0:n.dpr)!=null?m: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(`${ro}: five.getElement() is ${s}`);return}const{autoRender:r,mode:a}=o,l=a==="front"?s.parentElement:o.behindFiveContainer;this.appendToElement(l||document.body,a);const c=this.create3DElement(this.five.camera,e,{...o,autoRender:!1});if(!c)return;const h=c.render,f=()=>{var u;a==="front"&&h(),a==="behind"&&((u=this.five.model)!=null&&u.loaded?h():this.five.once("modelLoaded",()=>h()))};return r&&f(),{...c,render:r?void 0:f}});this.five=e}disposeAll(){return this.dispose()}setState(...e){const n=super.setState(...e);return this.five.needsRender=!0,n}}const Xn=i=>new ma(i);function li(i,t,e=new M.Vector3(1,1,1),n=!1){const o=new Cs.Line(i,t);return o.setMaterial({dashed:n,color:e,linewidth:1}),o.remove(o.points),o}const pa=i=>{const t={intersection:null,disposers:[]},e=h=>{t.intersection=h},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=(h,f=2,u=.1)=>{const m=f/2,v=c(h,u),b=new M.Group;b.add(li(new M.Vector3(v.x+m,v.y,v.z),new M.Vector3(v.x-m,v.y,v.z),new M.Vector3(1,0,0)),li(new M.Vector3(v.x,v.y+m,v.z),new M.Vector3(v.x,v.y-m,v.z),new M.Vector3(0,1,0)),li(new M.Vector3(v.x,v.y,v.z+m),new M.Vector3(v.x,v.y,v.z-m),new M.Vector3(0,0,1))),i.scene.add(b),i.needsRender=!0;const y=()=>{i.scene.remove(b)};return t.disposers.push(y),{clear:y,pointAxesHelperMesh:b}},s=(h,f=0)=>{var y,I;const u=(y=i==null?void 0:i.camera)==null?void 0:y.position;if(!u)return!1;const m=h.distanceTo(u),g=h.sub(u).normalize(),v=new M.Raycaster(u,g),b=(I=i.model.intersectRaycaster(v))==null?void 0:I[0];return!(b&&b.distance+f<m)},r=()=>t.intersection,a=()=>{var h,f;(f=(h=t.disposers)==null?void 0:h.forEach)==null||f.call(h,u=>u==null?void 0:u()),i.off("intersectionOnModelUpdate",e),i.off("intersectionHidden",n)},l=a,c=(h,f)=>{const u=h.clone();return i.camera.position.clone().sub(u).setLength(f).add(u)};return{intersection:r,pointAxesHelper:o,movePointTowardsCamera:c,destroy:a,dispose:l,canSeePoint:s}};function ne(){}const ki=i=>i;function Fe(i,t){for(const e in t)i[e]=t[e];return i}function Ms(i){return i()}function ao(){return Object.create(null)}function Bt(i){i.forEach(Ms)}function Ti(i){return typeof i=="function"}function he(i,t){return i!=i?t==t:i!==t||i&&typeof i=="object"||typeof i=="function"}let bn;function lo(i,t){return bn||(bn=document.createElement("a")),bn.href=t,i===bn.href}function ga(i){return Object.keys(i).length===0}function je(i){return i==null?"":i}const Ss=typeof window<"u";let va=Ss?()=>window.performance.now():()=>Date.now(),Di=Ss?i=>requestAnimationFrame(i):ne;const Ot=new Set;function js(i){Ot.forEach(t=>{t.c(i)||(Ot.delete(t),t.f())}),Ot.size!==0&&Di(js)}function ba(i){let t;return Ot.size===0&&Di(js),{promise:new Promise(e=>{Ot.add(t={c:i,f:e})}),abort(){Ot.delete(t)}}}function Q(i,t){i.appendChild(t)}function ge(i,t,e){const n=zi(i);if(!n.getElementById(t)){const o=X("style");o.id=t,o.textContent=e,Os(n,o)}}function zi(i){if(!i)return document;const t=i.getRootNode?i.getRootNode():i.ownerDocument;return t&&t.host?t:i.ownerDocument}function Aa(i){const t=X("style");return Os(zi(i),t),t.sheet}function Os(i,t){return Q(i.head||i,t),t.sheet}function V(i,t,e){i.insertBefore(t,e||null)}function W(i){i.parentNode.removeChild(i)}function Ht(i,t){for(let e=0;e<i.length;e+=1)i[e]&&i[e].d(t)}function X(i){return document.createElement(i)}function De(i){return document.createElementNS("http://www.w3.org/2000/svg",i)}function Ue(i){return document.createTextNode(i)}function fe(){return Ue(" ")}function Ge(){return Ue("")}function qe(i,t,e,n){return i.addEventListener(t,e,n),()=>i.removeEventListener(t,e,n)}function x(i,t,e){e==null?i.removeAttribute(t):i.getAttribute(t)!==e&&i.setAttribute(t,e)}function ya(i){return Array.from(i.childNodes)}function dt(i,t){t=""+t,i.wholeText!==t&&(i.data=t)}function S(i,t,e,n){e===null?i.style.removeProperty(t):i.style.setProperty(t,e,n?"important":"")}let An;function Pa(){if(An===void 0){An=!1;try{typeof window<"u"&&window.parent&&window.parent.document}catch{An=!0}}return An}function Ft(i,t){getComputedStyle(i).position==="static"&&(i.style.position="relative");const n=X("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=Pa();let s;return o?(n.src="data:text/html,<script>onresize=function(){parent.postMessage(0,'*')}<\/script>",s=qe(window,"message",r=>{r.source===n.contentWindow&&t()})):(n.src="about:blank",n.onload=()=>{s=qe(n.contentWindow,"resize",t)}),Q(i,n),()=>{(o||s&&n.contentWindow)&&s(),W(n)}}function Se(i,t,e){i.classList[e?"add":"remove"](t)}function wa(i,t,{bubbles:e=!1,cancelable:n=!1}={}){const o=document.createEvent("CustomEvent");return o.initCustomEvent(i,e,n,t),o}class Ai{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=De(e.nodeName):this.e=X(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)V(this.t,this.n[e],t)}p(t){this.d(),this.h(t),this.i(this.a)}d(){this.n.forEach(W)}}const On=new Map;let Rn=0;function Ea(i){let t=5381,e=i.length;for(;e--;)t=(t<<5)-t^i.charCodeAt(e);return t>>>0}function Ia(i,t){const e={stylesheet:Aa(t),rules:{}};return On.set(i,e),e}function xa(i,t,e,n,o,s,r,a=0){const l=16.666/n;let c=`{
|
|
102
102
|
`;for(let b=0;b<=1;b+=l){const y=t+(e-t)*s(b);c+=b*100+`%{${r(y,1-y)}}
|
|
103
103
|
`}const h=c+`100% {${r(e,1-e)}}
|
|
104
|
-
}`,f=`__svelte_${Ea(h)}_${a}`,u=zi(i),{stylesheet:m,rules:g}=On.get(u)||Ia(u,i);g[f]||(g[f]=!0,m.insertRule(`@keyframes ${f} ${h}`,m.cssRules.length));const v=i.style.animation||"";return i.style.animation=`${v?`${v}, `:""}${f} ${n}ms linear ${o}ms 1 both`,Rn+=1,f}function co(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(", "),Rn-=o,Rn||Ca())}function Ca(){Di(()=>{Rn||(On.forEach(i=>{const{ownerNode:t}=i.stylesheet;t&&W(t)}),On.clear())})}let tn;function en(i){tn=i}function Qn(){if(!tn)throw new Error("Function called outside component initialization");return tn}function Rs(i){Qn().$$.before_update.push(i)}function Ct(i){Qn().$$.on_mount.push(i)}function La(i){Qn().$$.after_update.push(i)}function nn(i){Qn().$$.on_destroy.push(i)}const qt=[],Rt=[],zn=[],ho=[],ka=Promise.resolve();let yi=!1;function Ta(){yi||(yi=!0,ka.then(Ns))}function Ke(i){zn.push(i)}const ci=new Set;let yn=0;function Ns(){const i=tn;do{for(;yn<qt.length;){const t=qt[yn];yn++,en(t),Da(t.$$)}for(en(null),qt.length=0,yn=0;Rt.length;)Rt.pop()();for(let t=0;t<zn.length;t+=1){const e=zn[t];ci.has(e)||(ci.add(e),e())}zn.length=0}while(qt.length);for(;ho.length;)ho.pop()();yi=!1,ci.clear(),en(i)}function Da(i){if(i.fragment!==null){i.update(),Bt(i.before_update);const t=i.dirty;i.dirty=[-1],i.fragment&&i.fragment.p(i.ctx,t),i.after_update.forEach(Ke)}}let Jt;function za(){return Jt||(Jt=Promise.resolve(),Jt.then(()=>{Jt=null})),Jt}function uo(i,t,e){i.dispatchEvent(wa(`${t?"intro":"outro"}${e}`))}const Mn=new Set;let wt;function Ie(){wt={r:0,c:[],p:wt}}function xe(){wt.r||Bt(wt.c),wt=wt.p}function G(i,t){i&&i.i&&(Mn.delete(i),i.i(t))}function K(i,t,e,n){if(i&&i.o){if(Mn.has(i))return;Mn.add(i),wt.c.push(()=>{Mn.delete(i),n&&(e&&i.d(1),n())}),i.o(t)}else n&&n()}const Ma={duration:0};function Sa(i,t,e){let n=t(i,e),o=!1,s,r,a=0;function l(){s&&co(i,s)}function c(){const{delay:f=0,duration:u=300,easing:m=ki,tick:g=ne,css:v}=n||Ma;v&&(s=xa(i,0,1,u,f,m,v,a++)),g(0,1);const b=va()+f,y=b+u;r&&r.abort(),o=!0,Ke(()=>uo(i,!0,"start")),r=ba(I=>{if(o){if(I>=y)return g(1,0),uo(i,!0,"end"),l(),o=!1;if(I>=b){const P=m((I-b)/u);g(P,1-P)}}return o})}let h=!1;return{start(){h||(h=!0,co(i),Ti(n)?(n=n(),za().then(c)):c())},invalidate(){h=!1},end(){o&&(l(),o=!1)}}}const ja=typeof window<"u"?window:typeof globalThis<"u"?globalThis:global;function Bs(i,t){i.d(1),t.delete(i.key)}function Gt(i,t){K(i,1,1,()=>{t.delete(i.key)})}function At(i,t,e,n,o,s,r,a,l,c,h,f){let u=i.length,m=s.length,g=u;const v={};for(;g--;)v[i[g].key]=g;const b=[],y=new Map,I=new Map;for(g=m;g--;){const E=f(o,s,g),T=e(E);let C=r.get(T);C?n&&C.p(E,t):(C=c(T,E),C.c()),y.set(T,b[g]=C),T in v&&I.set(T,Math.abs(g-v[T]))}const P=new Set,k=new Set;function D(E){G(E,1),E.m(a,h),r.set(E.key,E),h=E.first,m--}for(;u&&m;){const E=b[m-1],T=i[u-1],C=E.key,z=T.key;E===T?(h=E.first,u--,m--):y.has(z)?!r.has(C)||P.has(C)?D(E):k.has(z)?u--:I.get(C)>I.get(z)?(k.add(C),D(E)):(P.add(z),u--):(l(T,r),u--)}for(;u--;){const E=i[u];y.has(E.key)||l(E,r)}for(;m;)D(b[m-1]);return b}function Xe(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 Pe(i){i&&i.c()}function ve(i,t,e,n){const{fragment:o,after_update:s}=i.$$;o&&o.m(t,e),n||Ke(()=>{const r=i.$$.on_mount.map(Ms).filter(Ti);i.$$.on_destroy?i.$$.on_destroy.push(...r):Bt(r),i.$$.on_mount=[]}),s.forEach(Ke)}function be(i,t){const e=i.$$;e.fragment!==null&&(Bt(e.on_destroy),e.fragment&&e.fragment.d(t),e.on_destroy=e.fragment=null,e.ctx=[])}function Oa(i,t){i.$$.dirty[0]===-1&&(qt.push(i),Ta(),i.$$.dirty.fill(0)),i.$$.dirty[t/31|0]|=1<<t%31}function ue(i,t,e,n,o,s,r,a=[-1]){const l=tn;en(i);const c=i.$$={fragment:null,ctx:[],props:s,update:ne,not_equal:o,bound:ao(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(l?l.$$.context:[])),callbacks:ao(),dirty:a,skip_bound:!1,root:t.target||l.$$.root};r&&r(c.root);let h=!1;if(c.ctx=e?e(i,t.props||{},(f,u,...m)=>{const g=m.length?m[0]:u;return c.ctx&&o(c.ctx[f],c.ctx[f]=g)&&(!c.skip_bound&&c.bound[f]&&c.bound[f](g),h&&Oa(i,f)),u}):[],c.update(),h=!0,Bt(c.before_update),c.fragment=n?n(c.ctx):!1,t.target){if(t.hydrate){const f=ya(t.target);c.fragment&&c.fragment.l(f),f.forEach(W)}else c.fragment&&c.fragment.c();t.intro&&G(i.$$.fragment),ve(i,t.target,t.anchor,t.customElement),Ns()}en(l)}class de{$destroy(){be(this,1),this.$destroy=ne}$on(t,e){if(!Ti(e))return ne;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&&!ga(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const Ra="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+IecsAOp8OOHRpkiJniWQnrBJmwc7EF8atxBA2ihx/obf7Qqa+un+aDI0f7k08nU+PLj3PBR+qpcvFdd3BNP7YgI7mnHqHzBRndv1hH33///QNtlAcvvfTSq999992dQzFu/vjjj/c//fTTu1z+unT2wDFoHN13QbVg5CQS3tBfQGwHoo+chltPto4FMsR3nKCZ7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m6akEVuPhLWGhUeM0CAjvkHmxCM+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 Na(i){ge(i,"svelte-877671",".room-label-item.svelte-877671{position:absolute;font-size:0.41667rem;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-877671{position:absolute;left:0;top:-3.33333rem;transform:translate(-50%, 0);display:flex;justify-content:center;align-items:center;height:1.04167rem;min-width:1.66667rem;padding:0 0.3125rem;pointer-events:all;background-size:100% 100%;background-repeat:no-repeat;white-space:nowrap}.room-label-item__bar.svelte-877671{position:absolute;top:-2.29167rem;height:2.5rem;width:1px;background-image:linear-gradient(to bottom, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0))}.wide.svelte-877671{font-size:0.52083rem}")}function Ba(i){let t,e,n=i[0].name+"",o,s,r,a,l;return{c(){t=X("div"),e=X("span"),o=Ue(n),s=fe(),r=X("div"),x(e,"class","room-label-item__text svelte-877671"),S(e,"background-image","url("+Ra+")"),Se(e,"wide",i[0].name.length>3),x(r,"class","room-label-item__bar svelte-877671"),x(t,"class","room-label-item svelte-877671"),S(t,"z-index",i[0].zIndex),S(t,"transform",i[0].transform),S(t,"opacity",i[0].visible?1:0)},m(c,h){V(c,t,h),Q(t,e),Q(e,o),Q(t,s),Q(t,r),a||(l=qe(e,"click",i[1]),a=!0)},p(c,[h]){h&1&&n!==(n=c[0].name+"")&&dt(o,n),h&1&&Se(e,"wide",c[0].name.length>3),h&1&&S(t,"z-index",c[0].zIndex),h&1&&S(t,"transform",c[0].transform),h&1&&S(t,"opacity",c[0].visible?1:0)},i:ne,o:ne,d(c){c&&W(t),a=!1,l()}}}function Ha(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 Fa extends de{constructor(t){super(),ue(this,t,Ha,Ba,he,{five:2,roomLabel:0},Na)}}const{Map:Ga}=ja;function Xa(i){ge(i,"svelte-9eg4zi",".room-labels-container.svelte-9eg4zi{width:100%;height:100%;position:relative;color:#fff}")}function fo(i,t,e){const n=i.slice();return n[13]=t[e],n}function mo(i,t){let e,n,o;return n=new Fa({props:{roomLabel:t[13],five:t[1]}}),{key:i,first:null,c(){e=Ge(),Pe(n.$$.fragment),this.first=e},m(s,r){V(s,e,r),ve(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||(G(n.$$.fragment,s),o=!0)},o(s){K(n.$$.fragment,s),o=!1},d(s){s&&W(e),be(n,s)}}}function Qa(i){let t,e=[],n=new Ga,o,s,r=i[0];const a=l=>l[13].id;for(let l=0;l<r.length;l+=1){let c=fo(i,r,l),h=a(c);n.set(h,e[l]=mo(h,c))}return{c(){t=X("div");for(let l=0;l<e.length;l+=1)e[l].c();x(t,"class","room-labels-container svelte-9eg4zi"),Ke(()=>i[6].call(t))},m(l,c){V(l,t,c);for(let h=0;h<e.length;h+=1)e[h].m(t,null);o=Ft(t,i[6].bind(t)),s=!0},p(l,[c]){c&3&&(r=l[0],Ie(),e=At(e,c,a,1,l,r,n,t,Gt,mo,null,fo),xe())},i(l){if(!s){for(let c=0;c<r.length;c+=1)G(e[c]);s=!0}},o(l){for(let c=0;c<e.length;c+=1)K(e[c]);s=!1},d(l){l&&W(t);for(let c=0;c<e.length;c+=1)e[c].d();o()}}}function Wa(i,t,e){let n;var o;let{five:s}=t,{roomLabels:r}=t,a,l,c=(o=s.model.shownFloor)!==null&&o!==void 0?o:null;function h(b){if(!(c===null||b.floorIndex===c))return!1;const I=new M.Raycaster,P=s.camera.position.clone(),k=new M.Vector3(b.position.x,b.position.y,b.position.z),D=k.distanceTo(P);I.set(P.clone(),k.clone().sub(P).normalize());const[E]=s.model.intersectRaycaster(I);return!(E&&E.distance+1<D)}function f(b,y){const P=new M.Vector3(b.position.x,b.position.y,b.position.z).clone().project(s.camera),k=Math.ceil((P.x+1)/2*y.x),D=Math.ceil((-P.y+1)/2*y.y);return`translate(${k}px, ${D}px)`}function u(b){const{rendererSize:y,shownFloor:I}=b,P=new Map;function k(E){const T=P.get(E.id);if(T)return T;const{x:C,y:z,z:B}=E.position,F=new M.Vector3(C,z,B).clone().distanceTo(s.camera.position);return P.set(E.id,F),F}return r.map(E=>{const T=h(E),C=T?f(E,y):E.transform,z=k(E),F=r.filter($=>$.visible&&k($)<z).length*10;return Object.assign(Object.assign({},E),{visible:T,transform:C,zIndex:F})})}function m(){e(0,r=u({rendererSize:n,shownFloor:c}))}function g(b){e(4,c=b)}s.on("cameraUpdate",m),s.on("modelShownFloorChange",g),nn(()=>{s.off("cameraUpdate",m),s.off("modelShownFloorChange",g)});function v(){a=this.clientWidth,l=this.clientHeight,e(2,a),e(3,l)}return i.$$set=b=>{"five"in b&&e(1,s=b.five),"roomLabels"in b&&e(0,r=b.roomLabels)},i.$$.update=()=>{i.$$.dirty&12&&e(5,n={x:a,y:l}),i.$$.dirty&48&&e(0,r=u({rendererSize:n,shownFloor:c}))},[r,s,a,l,c,n,v]}class Ya extends de{constructor(t){super(),ue(this,t,Wa,Qa,he,{five:1,roomLabels:0},Xa)}}function Va(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 Za{constructor(t){d(this,"five");d(this,"enabled",!0);d(this,"fiveModeEnabled");d(this,"app");d(this,"wrapper");d(this,"roomLabels",[]);d(this,"container",document.createElement("div"));d(this,"onFiveModeChange",t=>{if(t!=="Floorplan"){this.fiveModeEnabled=!1,this.render();return}this.five.once("initAnimationEnded",()=>{this.fiveModeEnabled=this.five.currentMode==="Floorplan",this.render()})});this.five=t,this.fiveModeEnabled=this.five.currentMode==="Floorplan",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=Va(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}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 Ya({target:this.container,props:{five:this.five,roomLabels:this.roomLabels}})}}}const Ja=i=>new Za(i),Ua={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||{});async function Nn(i){try{return[null,await i]}catch(t){return t instanceof Error?[t,null]:[new Error(""),null]}}function Bn(i){return Object.prototype.toString.call(i)==="[object Object]"}function Wn(i,t){return i===t?!0:typeof i!=typeof t?!1:!!(Number.isNaN(i)&&Number.isNaN(t))}function qa(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(!Wn(i[r],t[r]))return!1}return!0}function Ka(i,t){if(i.length!==t.length)return!1;for(let e=0,n=i.length;e<n;e++)if(!Wn(i[e],t[e]))return!1;return!0}function _a(i,t){return Wn(i,t)?!0:Bn(i)&&Bn(t)?qa(i,t):Array.isArray(i)&&Array.isArray(t)?Ka(i,t):!1}function Mi(i,t){return Wn(i,t)?!0:Bn(i)&&Bn(t)?el(i,t):Array.isArray(i)&&Array.isArray(t)?$a(i,t):!1}function $a(i,t){if(i.length!==t.length)return!1;for(let e=0,n=i.length;e<n;e++)if(!Mi(i[e],t[e]))return!1;return!0}function el(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(!Mi(i[r],t[r]))return!1}return!0}function nt(i,t,e={deep:!1}){return e.deep?Mi(i,t):_a(i,t)}function tl(i,{delay:t=0,duration:e=400,easing:n=ki}={}){const o=+getComputedStyle(i).opacity;return{delay:t,duration:e,easing:n,css:s=>`opacity: ${s*o}`}}const vt="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADMAAAAzCAMAAAANf8AYAAAC2VBMVEUAAACCnP+Dn/+Enf+HqP+Gp/+Fof+Gpf+IrP+Lsf+Dof+C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LsPLsHQAAAABJRU5ErkJggg==";function nl(i){return i*180/Math.PI}function il(i){ge(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 ol(i){let t,e;return{c(){t=X("div"),e=X("div"),x(e,"class","floorplan__camera-rotate svelte-17cl35n"),S(e,"background-image",`url(${i[0]||vt})`),S(e,"width",i[4]),S(e,"height",i[4]),S(e,"left","-"+i[4]),S(e,"top","-"+i[4]),S(e,"transform",`rotate(${i[3]}deg)`),S(e,"transform-origin",`${i[4]} ${i[4]}`),x(t,"class","floorplan__camera-position svelte-17cl35n"),S(t,"left",i[1]),S(t,"top",i[2])},m(n,o){V(n,t,o),Q(t,e)},p(n,[o]){o&1&&S(e,"background-image",`url(${n[0]||vt})`)},i:ne,o:ne,d(n){n&&W(t)}}}function sl(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,h=l.positionInImage.y,f=c*100+"%",u=h*100+"%",m=-nl(s)+45,g=document.body.clientWidth,v=document.body.clientHeight,y=`${(g<500||v<500?17:37)/16}rem`;return i.$$set=I=>{"panoIndex"in I&&e(5,n=I.panoIndex),"floorplanData"in I&&e(6,o=I.floorplanData),"lastPanoramaLongitude"in I&&e(7,s=I.lastPanoramaLongitude),"cameraImageUrl"in I&&e(0,r=I.cameraImageUrl)},[r,f,u,m,y,n,o,s]}class rl extends de{constructor(t){super(),ue(this,t,sl,ol,he,{panoIndex:5,floorplanData:6,lastPanoramaLongitude:7,cameraImageUrl:0},il)}}const al="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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apEizdy7ZVm8V5Gtr8AtSnix59eOmYAAAAASUVORK5CYII=";function ll(i){ge(i,"svelte-z9kwkx",".floorplan-plugin__compass.svelte-z9kwkx{position:absolute;left:50%;top:-2.39583rem;width:12.03125rem;height:2.13542rem;will-change:opacity;transform-origin:center 9.58333rem}.floorplan-plugin__compass-image.svelte-z9kwkx{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-z9kwkx{position:absolute;left:50%;top:0.78125rem;transform:translateX(-50%);opacity:0.2;font-weight:bold;font-size:0.52083rem;color:#fff}")}function cl(i){let t,e,n,o,s;return{c(){t=X("div"),e=X("div"),n=fe(),o=X("span"),s=Ue(i[0]),x(e,"class","floorplan-plugin__compass-image svelte-z9kwkx"),S(e,"background-image",`url(${al})`),x(o,"class","floorplan-plugin__compass-text svelte-z9kwkx"),x(t,"class","floorplan-plugin__compass svelte-z9kwkx"),S(t,"transform",i[2])},m(r,a){V(r,t,a),Q(t,e),Q(t,n),Q(t,o),Q(o,s)},p(r,a){a&1&&dt(s,r[0])},d(r){r&&W(t)}}}function hl(i){let t,e=i[1]&&cl(i);return{c(){e&&e.c(),t=Ge()},m(n,o){e&&e.m(n,o),V(n,t,o)},p(n,[o]){n[1]&&e.p(n,o)},i:ne,o:ne,d(n){e&&e.d(n),n&&W(t)}}}function ul(i){return i/Math.PI*180}function dl(i,t,e){var n;let{floorplanData:o}=t,{northDesc:s}=t;const r=(n=o.entrance)===null||n===void 0?void 0:n.northRad,a=typeof r=="number",c=`translateX(-50%) translateZ(10px) rotate(${-(r?ul(r):0)+90}deg)`;return i.$$set=h=>{"floorplanData"in h&&e(3,o=h.floorplanData),"northDesc"in h&&e(0,s=h.northDesc)},[s,a,c,o]}class fl extends de{constructor(t){super(),ue(this,t,dl,hl,he,{floorplanData:3,northDesc:0},ll)}}const zt=[];function Hs(i,t=ne){let e;const n=new Set;function o(a){if(he(i,a)&&(i=a,e)){const l=!zt.length;for(const c of n)c[1](),zt.push(c,i);if(l){for(let c=0;c<zt.length;c+=2)zt[c][0](zt[c+1]);zt.length=0}}}function s(a){o(a(i))}function r(a,l=ne){const c=[a,l];return n.add(c),n.size===1&&(e=t(o)||ne),a(i),()=>{n.delete(c),n.size===0&&(e(),e=null)}}return{set:o,update:s,subscribe:r}}function ml(i){ge(i,"svelte-1gfoniz","img.svelte-1gfoniz{width:100%;height:100%}")}function pl(i){let t,e;return{c(){t=X("img"),lo(t.src,e=i[0])||x(t,"src",e),x(t,"alt","floorplan iamge"),x(t,"class","svelte-1gfoniz")},m(n,o){V(n,t,o)},p(n,[o]){o&1&&!lo(t.src,e=n[0])&&x(t,"src",e)},i:ne,o:ne,d(n){n&&W(t)}}}function gl(i,t,e){let{url:n}=t;return i.$$set=o=>{"url"in o&&e(0,n=o.url)},[n]}class vl extends de{constructor(t){super(),ue(this,t,gl,pl,he,{url:0},ml)}}function bl(i){ge(i,"svelte-ub47ya",".floorplan-plugin__base-image.svelte-ub47ya{width:100%;height:100%}")}function Al(i){let t,e,n,o;return{c(){t=X("div"),e=new Ai(!1),n=fe(),o=new Ai(!1),e.a=n,o.a=null,x(t,"class","floorplan-plugin__base-image svelte-ub47ya")},m(s,r){V(s,t,r),e.m(i[1],t),Q(t,n),o.m(i[0],t)},p(s,[r]){r&1&&o.p(s[0])},i:ne,o:ne,d(s){s&&W(t)}}}function yl(i,t,e){let{content:n}=t;const o=`
|
|
104
|
+
}`,f=`__svelte_${Ea(h)}_${a}`,u=zi(i),{stylesheet:m,rules:g}=On.get(u)||Ia(u,i);g[f]||(g[f]=!0,m.insertRule(`@keyframes ${f} ${h}`,m.cssRules.length));const v=i.style.animation||"";return i.style.animation=`${v?`${v}, `:""}${f} ${n}ms linear ${o}ms 1 both`,Rn+=1,f}function co(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(", "),Rn-=o,Rn||Ca())}function Ca(){Di(()=>{Rn||(On.forEach(i=>{const{ownerNode:t}=i.stylesheet;t&&W(t)}),On.clear())})}let tn;function en(i){tn=i}function Qn(){if(!tn)throw new Error("Function called outside component initialization");return tn}function Rs(i){Qn().$$.before_update.push(i)}function Ct(i){Qn().$$.on_mount.push(i)}function La(i){Qn().$$.after_update.push(i)}function nn(i){Qn().$$.on_destroy.push(i)}const qt=[],Rt=[],zn=[],ho=[],ka=Promise.resolve();let yi=!1;function Ta(){yi||(yi=!0,ka.then(Ns))}function Ke(i){zn.push(i)}const ci=new Set;let yn=0;function Ns(){const i=tn;do{for(;yn<qt.length;){const t=qt[yn];yn++,en(t),Da(t.$$)}for(en(null),qt.length=0,yn=0;Rt.length;)Rt.pop()();for(let t=0;t<zn.length;t+=1){const e=zn[t];ci.has(e)||(ci.add(e),e())}zn.length=0}while(qt.length);for(;ho.length;)ho.pop()();yi=!1,ci.clear(),en(i)}function Da(i){if(i.fragment!==null){i.update(),Bt(i.before_update);const t=i.dirty;i.dirty=[-1],i.fragment&&i.fragment.p(i.ctx,t),i.after_update.forEach(Ke)}}let Jt;function za(){return Jt||(Jt=Promise.resolve(),Jt.then(()=>{Jt=null})),Jt}function uo(i,t,e){i.dispatchEvent(wa(`${t?"intro":"outro"}${e}`))}const Mn=new Set;let wt;function Ie(){wt={r:0,c:[],p:wt}}function xe(){wt.r||Bt(wt.c),wt=wt.p}function G(i,t){i&&i.i&&(Mn.delete(i),i.i(t))}function K(i,t,e,n){if(i&&i.o){if(Mn.has(i))return;Mn.add(i),wt.c.push(()=>{Mn.delete(i),n&&(e&&i.d(1),n())}),i.o(t)}else n&&n()}const Ma={duration:0};function Sa(i,t,e){let n=t(i,e),o=!1,s,r,a=0;function l(){s&&co(i,s)}function c(){const{delay:f=0,duration:u=300,easing:m=ki,tick:g=ne,css:v}=n||Ma;v&&(s=xa(i,0,1,u,f,m,v,a++)),g(0,1);const b=va()+f,y=b+u;r&&r.abort(),o=!0,Ke(()=>uo(i,!0,"start")),r=ba(I=>{if(o){if(I>=y)return g(1,0),uo(i,!0,"end"),l(),o=!1;if(I>=b){const P=m((I-b)/u);g(P,1-P)}}return o})}let h=!1;return{start(){h||(h=!0,co(i),Ti(n)?(n=n(),za().then(c)):c())},invalidate(){h=!1},end(){o&&(l(),o=!1)}}}const ja=typeof window<"u"?window:typeof globalThis<"u"?globalThis:global;function Bs(i,t){i.d(1),t.delete(i.key)}function Gt(i,t){K(i,1,1,()=>{t.delete(i.key)})}function At(i,t,e,n,o,s,r,a,l,c,h,f){let u=i.length,m=s.length,g=u;const v={};for(;g--;)v[i[g].key]=g;const b=[],y=new Map,I=new Map;for(g=m;g--;){const E=f(o,s,g),T=e(E);let C=r.get(T);C?n&&C.p(E,t):(C=c(T,E),C.c()),y.set(T,b[g]=C),T in v&&I.set(T,Math.abs(g-v[T]))}const P=new Set,L=new Set;function D(E){G(E,1),E.m(a,h),r.set(E.key,E),h=E.first,m--}for(;u&&m;){const E=b[m-1],T=i[u-1],C=E.key,z=T.key;E===T?(h=E.first,u--,m--):y.has(z)?!r.has(C)||P.has(C)?D(E):L.has(z)?u--:I.get(C)>I.get(z)?(L.add(C),D(E)):(P.add(z),u--):(l(T,r),u--)}for(;u--;){const E=i[u];y.has(E.key)||l(E,r)}for(;m;)D(b[m-1]);return b}function Xe(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 Pe(i){i&&i.c()}function ve(i,t,e,n){const{fragment:o,after_update:s}=i.$$;o&&o.m(t,e),n||Ke(()=>{const r=i.$$.on_mount.map(Ms).filter(Ti);i.$$.on_destroy?i.$$.on_destroy.push(...r):Bt(r),i.$$.on_mount=[]}),s.forEach(Ke)}function be(i,t){const e=i.$$;e.fragment!==null&&(Bt(e.on_destroy),e.fragment&&e.fragment.d(t),e.on_destroy=e.fragment=null,e.ctx=[])}function Oa(i,t){i.$$.dirty[0]===-1&&(qt.push(i),Ta(),i.$$.dirty.fill(0)),i.$$.dirty[t/31|0]|=1<<t%31}function ue(i,t,e,n,o,s,r,a=[-1]){const l=tn;en(i);const c=i.$$={fragment:null,ctx:[],props:s,update:ne,not_equal:o,bound:ao(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(l?l.$$.context:[])),callbacks:ao(),dirty:a,skip_bound:!1,root:t.target||l.$$.root};r&&r(c.root);let h=!1;if(c.ctx=e?e(i,t.props||{},(f,u,...m)=>{const g=m.length?m[0]:u;return c.ctx&&o(c.ctx[f],c.ctx[f]=g)&&(!c.skip_bound&&c.bound[f]&&c.bound[f](g),h&&Oa(i,f)),u}):[],c.update(),h=!0,Bt(c.before_update),c.fragment=n?n(c.ctx):!1,t.target){if(t.hydrate){const f=ya(t.target);c.fragment&&c.fragment.l(f),f.forEach(W)}else c.fragment&&c.fragment.c();t.intro&&G(i.$$.fragment),ve(i,t.target,t.anchor,t.customElement),Ns()}en(l)}class de{$destroy(){be(this,1),this.$destroy=ne}$on(t,e){if(!Ti(e))return ne;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&&!ga(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const Ra="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGAAAAA8CAYAAACZ1L+0AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAYKADAAQAAAABAAAAPAAAAABU0H2EAAARRElEQVR4Ad2czY9cRZbFq1yFoQGDNCzwuAENohl54dkgdrNh34tZ8GciFi31nwEsmAEhhAWD1GMJCZgx5sMfUHN+J+NE3Xfr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N/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 Na(i){ge(i,"svelte-877671",".room-label-item.svelte-877671{position:absolute;font-size:0.41667rem;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-877671{position:absolute;left:0;top:-3.33333rem;transform:translate(-50%, 0);display:flex;justify-content:center;align-items:center;height:1.04167rem;min-width:1.66667rem;padding:0 0.3125rem;pointer-events:all;background-size:100% 100%;background-repeat:no-repeat;white-space:nowrap}.room-label-item__bar.svelte-877671{position:absolute;top:-2.29167rem;height:2.5rem;width:1px;background-image:linear-gradient(to bottom, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0))}.wide.svelte-877671{font-size:0.52083rem}")}function Ba(i){let t,e,n=i[0].name+"",o,s,r,a,l;return{c(){t=X("div"),e=X("span"),o=Ue(n),s=fe(),r=X("div"),x(e,"class","room-label-item__text svelte-877671"),S(e,"background-image","url("+Ra+")"),Se(e,"wide",i[0].name.length>3),x(r,"class","room-label-item__bar svelte-877671"),x(t,"class","room-label-item svelte-877671"),S(t,"z-index",i[0].zIndex),S(t,"transform",i[0].transform),S(t,"opacity",i[0].visible?1:0)},m(c,h){V(c,t,h),Q(t,e),Q(e,o),Q(t,s),Q(t,r),a||(l=qe(e,"click",i[1]),a=!0)},p(c,[h]){h&1&&n!==(n=c[0].name+"")&&dt(o,n),h&1&&Se(e,"wide",c[0].name.length>3),h&1&&S(t,"z-index",c[0].zIndex),h&1&&S(t,"transform",c[0].transform),h&1&&S(t,"opacity",c[0].visible?1:0)},i:ne,o:ne,d(c){c&&W(t),a=!1,l()}}}function Ha(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 Fa extends de{constructor(t){super(),ue(this,t,Ha,Ba,he,{five:2,roomLabel:0},Na)}}const{Map:Ga}=ja;function Xa(i){ge(i,"svelte-9eg4zi",".room-labels-container.svelte-9eg4zi{width:100%;height:100%;position:relative;color:#fff}")}function fo(i,t,e){const n=i.slice();return n[13]=t[e],n}function mo(i,t){let e,n,o;return n=new Fa({props:{roomLabel:t[13],five:t[1]}}),{key:i,first:null,c(){e=Ge(),Pe(n.$$.fragment),this.first=e},m(s,r){V(s,e,r),ve(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||(G(n.$$.fragment,s),o=!0)},o(s){K(n.$$.fragment,s),o=!1},d(s){s&&W(e),be(n,s)}}}function Qa(i){let t,e=[],n=new Ga,o,s,r=i[0];const a=l=>l[13].id;for(let l=0;l<r.length;l+=1){let c=fo(i,r,l),h=a(c);n.set(h,e[l]=mo(h,c))}return{c(){t=X("div");for(let l=0;l<e.length;l+=1)e[l].c();x(t,"class","room-labels-container svelte-9eg4zi"),Ke(()=>i[6].call(t))},m(l,c){V(l,t,c);for(let h=0;h<e.length;h+=1)e[h].m(t,null);o=Ft(t,i[6].bind(t)),s=!0},p(l,[c]){c&3&&(r=l[0],Ie(),e=At(e,c,a,1,l,r,n,t,Gt,mo,null,fo),xe())},i(l){if(!s){for(let c=0;c<r.length;c+=1)G(e[c]);s=!0}},o(l){for(let c=0;c<e.length;c+=1)K(e[c]);s=!1},d(l){l&&W(t);for(let c=0;c<e.length;c+=1)e[c].d();o()}}}function Wa(i,t,e){let n;var o;let{five:s}=t,{roomLabels:r}=t,a,l,c=(o=s.model.shownFloor)!==null&&o!==void 0?o:null;function h(b){if(!(c===null||b.floorIndex===c))return!1;const I=new M.Raycaster,P=s.camera.position.clone(),L=new M.Vector3(b.position.x,b.position.y,b.position.z),D=L.distanceTo(P);I.set(P.clone(),L.clone().sub(P).normalize());const[E]=s.model.intersectRaycaster(I);return!(E&&E.distance+1<D)}function f(b,y){const P=new M.Vector3(b.position.x,b.position.y,b.position.z).clone().project(s.camera),L=Math.ceil((P.x+1)/2*y.x),D=Math.ceil((-P.y+1)/2*y.y);return`translate(${L}px, ${D}px)`}function u(b){const{rendererSize:y,shownFloor:I}=b,P=new Map;function L(E){const T=P.get(E.id);if(T)return T;const{x:C,y:z,z:B}=E.position,F=new M.Vector3(C,z,B).clone().distanceTo(s.camera.position);return P.set(E.id,F),F}return r.map(E=>{const T=h(E),C=T?f(E,y):E.transform,z=L(E),F=r.filter($=>$.visible&&L($)<z).length*10;return Object.assign(Object.assign({},E),{visible:T,transform:C,zIndex:F})})}function m(){e(0,r=u({rendererSize:n,shownFloor:c}))}function g(b){e(4,c=b)}s.on("cameraUpdate",m),s.on("modelShownFloorChange",g),nn(()=>{s.off("cameraUpdate",m),s.off("modelShownFloorChange",g)});function v(){a=this.clientWidth,l=this.clientHeight,e(2,a),e(3,l)}return i.$$set=b=>{"five"in b&&e(1,s=b.five),"roomLabels"in b&&e(0,r=b.roomLabels)},i.$$.update=()=>{i.$$.dirty&12&&e(5,n={x:a,y:l}),i.$$.dirty&48&&e(0,r=u({rendererSize:n,shownFloor:c}))},[r,s,a,l,c,n,v]}class Ya extends de{constructor(t){super(),ue(this,t,Wa,Qa,he,{five:1,roomLabels:0},Xa)}}function Va(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 Za{constructor(t){d(this,"five");d(this,"enabled",!0);d(this,"fiveModeEnabled");d(this,"app");d(this,"wrapper");d(this,"roomLabels",[]);d(this,"container",document.createElement("div"));d(this,"onFiveModeChange",t=>{if(t!=="Floorplan"){this.fiveModeEnabled=!1,this.render();return}this.five.once("initAnimationEnded",()=>{this.fiveModeEnabled=this.five.currentMode==="Floorplan",this.render()})});this.five=t,this.fiveModeEnabled=this.five.currentMode==="Floorplan",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=Va(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}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 Ya({target:this.container,props:{five:this.five,roomLabels:this.roomLabels}})}}}const Ja=i=>new Za(i),Ua={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||{});async function Nn(i){try{return[null,await i]}catch(t){return t instanceof Error?[t,null]:[new Error(""),null]}}function Bn(i){return Object.prototype.toString.call(i)==="[object Object]"}function Wn(i,t){return i===t?!0:typeof i!=typeof t?!1:!!(Number.isNaN(i)&&Number.isNaN(t))}function qa(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(!Wn(i[r],t[r]))return!1}return!0}function Ka(i,t){if(i.length!==t.length)return!1;for(let e=0,n=i.length;e<n;e++)if(!Wn(i[e],t[e]))return!1;return!0}function _a(i,t){return Wn(i,t)?!0:Bn(i)&&Bn(t)?qa(i,t):Array.isArray(i)&&Array.isArray(t)?Ka(i,t):!1}function Mi(i,t){return Wn(i,t)?!0:Bn(i)&&Bn(t)?el(i,t):Array.isArray(i)&&Array.isArray(t)?$a(i,t):!1}function $a(i,t){if(i.length!==t.length)return!1;for(let e=0,n=i.length;e<n;e++)if(!Mi(i[e],t[e]))return!1;return!0}function el(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(!Mi(i[r],t[r]))return!1}return!0}function nt(i,t,e={deep:!1}){return e.deep?Mi(i,t):_a(i,t)}function tl(i,{delay:t=0,duration:e=400,easing:n=ki}={}){const o=+getComputedStyle(i).opacity;return{delay:t,duration:e,easing:n,css:s=>`opacity: ${s*o}`}}const vt="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+Ms//J0/3p9/+Ux/+Ouf+Krf+Iqf+Fpv+/zf6WsP+MpP+RqP+Uyf+Jy//V3P6Yuf+Qqf+Rqv/5/f+Sxf+Jy/////+Lx/+Ouf+Nw/+Owv+PwP+Jr/+J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RYp8SK3ic/ZnRWMLqQ+2xGRwUD069dvV8zcuRom+rlA6Y2MbgGmhAGEz4VYSPQF5cyZM6GFYl6eTlN6ixi6aE6PqDLQZRi4EKI/KOfGFjUzqCKsXu6l2RpuAKJxiI1tHhcQJAYOHDhgwOZZs4ZSTHR5lQQYPDW1DS4aELQxdyEIAANGjtk8c6aaqTslk8gVwIAN0w3rAEL2bMtHm12AIOHqenXaNDWztEwo9hKJGHjR6OO0yDSI1IGdoQ0iY0a6Tt+06fKUDRQzqKw8Qlxr1AXrwNqwDvGBA+BrGUDc3d3Xr5+SQZj0E2ERqXIjPAJYNUbD18FoWEeDbHLPzLyQ4ePjQ5i3x1RCubfmpqkjMMNo6KOJ5uqe+f58C9GoaD29XyVSYS1h4DftKeWDDN4AbACZMZAsExEKghWUNKXWhlPfA2P1qjmUT556a9jmQotWi/VOFael1lR7ep4JfRZy8nhpwtG4wMMB/gdi9/nNH+vhezsmJ+fG5quX12fomHl6J+KFy88uA2RJyJPE4wkL4wIPBfgXxO5HxGN7zNw5W2bNnLZhio+OmaR3LD6tplrLfKeYAwX7/O6Dje/2dpniwuKiwoMHH+bn7723Z8/uHTu2fpg9+3p29sYrWVnr1l1cO2HCUFCGT+tshUcWLPj6IDf37ued27Z9unXz2owZU6dOnnxp4sQ1q1ePH79KN6vbQWc1SrfrTit6lO5NO6/F8yZNmofBfgNTwRQLsPLsHQAAAABJRU5ErkJggg==";function nl(i){return i*180/Math.PI}function il(i){ge(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 ol(i){let t,e;return{c(){t=X("div"),e=X("div"),x(e,"class","floorplan__camera-rotate svelte-17cl35n"),S(e,"background-image",`url(${i[0]||vt})`),S(e,"width",i[4]),S(e,"height",i[4]),S(e,"left","-"+i[4]),S(e,"top","-"+i[4]),S(e,"transform",`rotate(${i[3]}deg)`),S(e,"transform-origin",`${i[4]} ${i[4]}`),x(t,"class","floorplan__camera-position svelte-17cl35n"),S(t,"left",i[1]),S(t,"top",i[2])},m(n,o){V(n,t,o),Q(t,e)},p(n,[o]){o&1&&S(e,"background-image",`url(${n[0]||vt})`)},i:ne,o:ne,d(n){n&&W(t)}}}function sl(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,h=l.positionInImage.y,f=c*100+"%",u=h*100+"%",m=-nl(s)+45,g=document.body.clientWidth,v=document.body.clientHeight,y=`${(g<500||v<500?17:37)/16}rem`;return i.$$set=I=>{"panoIndex"in I&&e(5,n=I.panoIndex),"floorplanData"in I&&e(6,o=I.floorplanData),"lastPanoramaLongitude"in I&&e(7,s=I.lastPanoramaLongitude),"cameraImageUrl"in I&&e(0,r=I.cameraImageUrl)},[r,f,u,m,y,n,o,s]}class rl extends de{constructor(t){super(),ue(this,t,sl,ol,he,{panoIndex:5,floorplanData:6,lastPanoramaLongitude:7,cameraImageUrl:0},il)}}const al="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/O2v/L2P/E0v/Az//+///s8P/e5v+rv/+pvv+Anv+qvv+Pqv+Kpv+CoP93l/9xlP/z9v/p7v90lf9uj//P2//v8//o7f/k6v/K1v+6yv9rjv98nv/E0v/9/v/09//h6P/X4f9p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YRWttYgWYrPcLbejWqua2WaCqBSixQLvWe5mi06RWqv8TDOhNUrZC9sdm+Xuu5cpUqvU+wwzYbVVkIXYLHd/olekVpmpZ8KiMYbU7ma/EXJZBW5JrZl2V9bRnNWyWe4xt8TWTPd3FdEYSEFslnsoURlAi01FqN56f2br2xeOe9ytgbyf4nErGg/hl6RN4Jc5Lt++2rVjHMdCIIqiqtoRQW2mMogIyZFjlsB2B9wjjaY1PXa3wcbSPaEDR1fP9fVt8aPai2+f2+TlWu2l0yweZHlEO5S9cyu1lDKj5T/fWCH4jLaUnXMbvFyrzby8xRrayqUM2+ZWqvuM1nmpgHWkl8F9z9yG7LNa5yEMa0n8yHb93Er1oXjnoMVyFn3KQVcP7VRpFn+sDiznaiuHNufsHnkIwy7aPA/r5jbFGW3m7S12ku55WPN7Li1PPIRhN6sjtBjTmm+KmYcwPEOKs9tHF1JDHCoHLZ5DQ8yPBic9DoHjAKvsb85qjbFxHOCprMZaf5qdhlorxwGeTsPIttvPlno0y3GAZfbHp6n3ynGAV0m99u/2J6H3znGAvW4n+J25tdY7xwFey1pvQe6/DlrjOMDLqfXW7N5pbs0YWhxgtpj0rl1uiaHFISzccSWohUCzOIemm0VKChwHOMutKCVwHOA4av/JVi0xtDiRpCRfRcvQ4lBfxSnG0OJc/+xTjKHFyVRMP38iDC0O92lZVRhanO+vcVWGFu9BRWkW7+Z3rapEizdy7ZVm8V5Gtr8AtSnix59eOmYAAAAASUVORK5CYII=";function ll(i){ge(i,"svelte-z9kwkx",".floorplan-plugin__compass.svelte-z9kwkx{position:absolute;left:50%;top:-2.39583rem;width:12.03125rem;height:2.13542rem;will-change:opacity;transform-origin:center 9.58333rem}.floorplan-plugin__compass-image.svelte-z9kwkx{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-z9kwkx{position:absolute;left:50%;top:0.78125rem;transform:translateX(-50%);opacity:0.2;font-weight:bold;font-size:0.52083rem;color:#fff}")}function cl(i){let t,e,n,o,s;return{c(){t=X("div"),e=X("div"),n=fe(),o=X("span"),s=Ue(i[0]),x(e,"class","floorplan-plugin__compass-image svelte-z9kwkx"),S(e,"background-image",`url(${al})`),x(o,"class","floorplan-plugin__compass-text svelte-z9kwkx"),x(t,"class","floorplan-plugin__compass svelte-z9kwkx"),S(t,"transform",i[2])},m(r,a){V(r,t,a),Q(t,e),Q(t,n),Q(t,o),Q(o,s)},p(r,a){a&1&&dt(s,r[0])},d(r){r&&W(t)}}}function hl(i){let t,e=i[1]&&cl(i);return{c(){e&&e.c(),t=Ge()},m(n,o){e&&e.m(n,o),V(n,t,o)},p(n,[o]){n[1]&&e.p(n,o)},i:ne,o:ne,d(n){e&&e.d(n),n&&W(t)}}}function ul(i){return i/Math.PI*180}function dl(i,t,e){var n;let{floorplanData:o}=t,{northDesc:s}=t;const r=(n=o.entrance)===null||n===void 0?void 0:n.northRad,a=typeof r=="number",c=`translateX(-50%) translateZ(10px) rotate(${-(r?ul(r):0)+90}deg)`;return i.$$set=h=>{"floorplanData"in h&&e(3,o=h.floorplanData),"northDesc"in h&&e(0,s=h.northDesc)},[s,a,c,o]}class fl extends de{constructor(t){super(),ue(this,t,dl,hl,he,{floorplanData:3,northDesc:0},ll)}}const zt=[];function Hs(i,t=ne){let e;const n=new Set;function o(a){if(he(i,a)&&(i=a,e)){const l=!zt.length;for(const c of n)c[1](),zt.push(c,i);if(l){for(let c=0;c<zt.length;c+=2)zt[c][0](zt[c+1]);zt.length=0}}}function s(a){o(a(i))}function r(a,l=ne){const c=[a,l];return n.add(c),n.size===1&&(e=t(o)||ne),a(i),()=>{n.delete(c),n.size===0&&(e(),e=null)}}return{set:o,update:s,subscribe:r}}function ml(i){ge(i,"svelte-1gfoniz","img.svelte-1gfoniz{width:100%;height:100%}")}function pl(i){let t,e;return{c(){t=X("img"),lo(t.src,e=i[0])||x(t,"src",e),x(t,"alt","floorplan iamge"),x(t,"class","svelte-1gfoniz")},m(n,o){V(n,t,o)},p(n,[o]){o&1&&!lo(t.src,e=n[0])&&x(t,"src",e)},i:ne,o:ne,d(n){n&&W(t)}}}function gl(i,t,e){let{url:n}=t;return i.$$set=o=>{"url"in o&&e(0,n=o.url)},[n]}class vl extends de{constructor(t){super(),ue(this,t,gl,pl,he,{url:0},ml)}}function bl(i){ge(i,"svelte-ub47ya",".floorplan-plugin__base-image.svelte-ub47ya{width:100%;height:100%}")}function Al(i){let t,e,n,o;return{c(){t=X("div"),e=new Ai(!1),n=fe(),o=new Ai(!1),e.a=n,o.a=null,x(t,"class","floorplan-plugin__base-image svelte-ub47ya")},m(s,r){V(s,t,r),e.m(i[1],t),Q(t,n),o.m(i[0],t)},p(s,[r]){r&1&&o.p(s[0])},i:ne,o:ne,d(s){s&&W(t)}}}function yl(i,t,e){let{content:n}=t;const o=`
|
|
105
105
|
<style>
|
|
106
106
|
svg [type='lineGroup'] path {
|
|
107
107
|
fill: #ffffff;
|
|
@@ -110,7 +110,7 @@ transition: all 500ms;
|
|
|
110
110
|
svg [type='lineItemGroup'] g g g g {
|
|
111
111
|
stroke: #ffffff;
|
|
112
112
|
}</style>
|
|
113
|
-
`;return i.$$set=s=>{"content"in s&&e(0,n=s.content)},[n,o]}class Pl extends de{constructor(t){super(),ue(this,t,yl,Al,he,{content:0},bl)}}function wl(i){ge(i,"svelte-ozpg4a",".floorplan-plugin__base-image.svelte-ozpg4a{position:absolute;z-index:10;width:100%;height:100%;pointer-events:none}")}function El(i){let t,e;return t=new vl({props:{url:i[1].url}}),{c(){Pe(t.$$.fragment)},m(n,o){ve(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.url=n[1].url),t.$set(s)},i(n){e||(G(t.$$.fragment,n),e=!0)},o(n){K(t.$$.fragment,n),e=!1},d(n){be(t,n)}}}function Il(i){let t,e;return t=new Pl({props:{content:i[0]}}),{c(){Pe(t.$$.fragment)},m(n,o){ve(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.content=n[0]),t.$set(s)},i(n){e||(G(t.$$.fragment,n),e=!0)},o(n){K(t.$$.fragment,n),e=!1},d(n){be(t,n)}}}function xl(i){let t,e,n,o;const s=[Il,El],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=X("div"),n&&n.c(),x(t,"class","floorplan-plugin__base-image svelte-ozpg4a")},m(l,c){V(l,t,c),~e&&r[e].m(t,null),o=!0},p(l,[c]){let h=e;e=a(l),e===h?~e&&r[e].p(l,c):(n&&(Ie(),K(r[h],1,1,()=>{r[h]=null}),xe()),~e?(n=r[e],n?n.p(l,c):(n=r[e]=s[e](l),n.c()),G(n,1),n.m(t,null)):n=null)},i(l){o||(G(n),o=!0)},o(l){K(n),o=!1},d(l){l&&W(t),~e&&r[e].d()}}}function Cl(i,t,e){let n,o;var s,r;let{floorIndex:a}=t,{floorplanData:l}=t;return i.$$set=c=>{"floorIndex"in c&&e(2,a=c.floorIndex),"floorplanData"in c&&e(3,l=c.floorplanData)},i.$$.update=()=>{i.$$.dirty&12&&e(1,n=l.outlines[a]),i.$$.dirty&60&&e(0,o=e(5,r=e(4,s=l.outlines)===null||s===void 0?void 0:s[a])===null||r===void 0?void 0:r.svgContent)},[o,n,a,l,s,r]}class Fs extends de{constructor(t){super(),ue(this,t,Cl,xl,he,{floorIndex:2,floorplanData:3},wl)}}function Ll(i){ge(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 kl(i){let t,e=i[4].outerHTML+"",n;return{c(){t=new Ai(!1),n=Ge(),t.a=n},m(o,s){t.m(e,o,s),V(o,n,s)},p(o,s){s&16&&e!==(e=o[4].outerHTML+"")&&t.p(e)},d(o){o&&W(n),o&&t.d()}}}function Tl(i){let t,e=i[0].name+"",n,o,s,r;return{c(){t=X("span"),n=Ue(e),o=fe(),s=X("span"),r=Ue(i[5]),x(t,"class","floorplan-plugin__room-name"),x(s,"class","floorplan-plugin__room-size svelte-12pzct5")},m(a,l){V(a,t,l),Q(t,n),V(a,o,l),V(a,s,l),Q(s,r)},p(a,l){l&1&&e!==(e=a[0].name+"")&&dt(n,e),l&32&&dt(r,a[5])},d(a){a&&W(t),a&&W(o),a&&W(s)}}}function Dl(i){let t;function e(s,r){if(s[1]===void 0)return Tl;if(s[4])return kl}let n=e(i),o=n&&n(i);return{c(){t=X("div"),o&&o.c(),x(t,"class","floorplan-plugin__room-label-item svelte-12pzct5"),S(t,"left",i[6]),S(t,"top",i[7]),S(t,"font-size",i[8]),S(t,"opacity",i[3]?"1":"0")},m(s,r){V(s,t,r),o&&o.m(t,null),i[16](t)},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))),r&8&&S(t,"opacity",s[3]?"1":"0")},i:ne,o:ne,d(s){s&&W(t),o&&o.d(),i[16](null)}}}function zl(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],h=t[r][1];l>n!=h>n&&e<(c-a)*(n-l)/(h-l)+a&&(o=!o)}return o}function Ml(i,t,e){let n,o,s,r,{pxmm:a}=t,{room:l}=t,{hoveredRoom:c}=t,{getRoomAreaText:h}=t,{getLabelElement:f}=t,{adaptiveRoomLabelVisibleEnable:u}=t;function m(C,z){if(z.width===0||z.height===0)return()=>!1;const B=C.path.map(({x:te,y:Y})=>[te,Y]),F=C.roomLabel.position,{x:$,y:j}=F,{width:R,height:H}=z,_=R/2,U=H/2;return function(Y){const ee=$*Y,se=j*Y,ie=B.map(([Ae,Ce])=>[Ae*Y,Ce*Y]);return[[ee+_,se-U],[ee-_,se-U],[ee-_,se+U],[ee+_,se+U]].every(Ae=>zl(Ae,ie))}}const g=document.body.clientWidth,v=document.body.clientHeight,b=l.roomLabel,y=b.positionInImage.x*100+"%",I=b.positionInImage.y*100+"%",P=(g<500||v<500?10:14)/16+"rem";let k=!1,D,E;c.subscribe(function(z){e(13,k=!!z&&z.id===l.id)}),Ct(()=>{const C=D==null?void 0:D.getClientRects()[0];e(14,E={width:C.width,height:C.height})});function T(C){Rt[C?"unshift":"push"](()=>{D=C,e(2,D)})}return i.$$set=C=>{"pxmm"in C&&e(9,a=C.pxmm),"room"in C&&e(0,l=C.room),"hoveredRoom"in C&&e(10,c=C.hoveredRoom),"getRoomAreaText"in C&&e(11,h=C.getRoomAreaText),"getLabelElement"in C&&e(1,f=C.getLabelElement),"adaptiveRoomLabelVisibleEnable"in C&&e(12,u=C.adaptiveRoomLabelVisibleEnable)},i.$$.update=()=>{i.$$.dirty&2049&&e(5,n=l.size?h(l.size):""),i.$$.dirty&16385&&e(15,o=E?m(l,E):void 0),i.$$.dirty&3&&e(4,s=f==null?void 0:f(l)),i.$$.dirty&45568&&e(3,r=u?k?!0:!!(o!=null&&o(a)):!0)},[l,f,D,r,s,n,y,I,P,a,c,h,u,k,E,o,T]}class Sl extends de{constructor(t){super(),ue(this,t,Ml,Dl,he,{pxmm:9,room:0,hoveredRoom:10,getRoomAreaText:11,getLabelElement:1,adaptiveRoomLabelVisibleEnable:12},Ll)}}function jl(i){ge(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 po(i,t,e){const n=i.slice();return n[10]=t[e],n}function go(i){let t,e=[],n=new Map,o,s,r=i[6];const a=l=>l[10].id;for(let l=0;l<r.length;l+=1){let c=po(i,r,l),h=a(c);n.set(h,e[l]=vo(h,c))}return{c(){t=X("div");for(let l=0;l<e.length;l+=1)e[l].c();x(t,"class","floorplan-plugin__room-labels svelte-13xux0b"),Ke(()=>i[9].call(t))},m(l,c){V(l,t,c);for(let h=0;h<e.length;h+=1)e[h].m(t,null);o=Ft(t,i[9].bind(t)),s=!0},p(l,c){c&111&&(r=l[6],Ie(),e=At(e,c,a,1,l,r,n,t,Gt,vo,null,po),xe())},i(l){if(!s){for(let c=0;c<r.length;c+=1)G(e[c]);s=!0}},o(l){for(let c=0;c<e.length;c+=1)K(e[c]);s=!1},d(l){l&&W(t);for(let c=0;c<e.length;c+=1)e[c].d();o()}}}function vo(i,t){let e,n,o;const s=[{pxmm:t[5],room:t[10],getLabelElement:t[2],getRoomAreaText:t[1],hoveredRoom:t[0],adaptiveRoomLabelVisibleEnable:t[3]}];let r={};for(let a=0;a<s.length;a+=1)r=Fe(r,s[a]);return n=new Sl({props:r}),{key:i,first:null,c(){e=Ge(),Pe(n.$$.fragment),this.first=e},m(a,l){V(a,e,l),ve(n,a,l),o=!0},p(a,l){t=a;const c=l&111?Xe(s,[{pxmm:t[5],room:t[10],getLabelElement:t[2],getRoomAreaText:t[1],hoveredRoom:t[0],adaptiveRoomLabelVisibleEnable:t[3]}]):{};n.$set(c)},i(a){o||(G(n.$$.fragment,a),o=!0)},o(a){K(n.$$.fragment,a),o=!1},d(a){a&&W(e),be(n,a)}}}function Ol(i){let t,e,n=i[6]&&go(i);return{c(){n&&n.c(),t=Ge()},m(o,s){n&&n.m(o,s),V(o,t,s),e=!0},p(o,[s]){o[6]?n?(n.p(o,s),s&64&&G(n,1)):(n=go(o),n.c(),G(n,1),n.m(t.parentNode,t)):n&&(Ie(),K(n,1,1,()=>{n=null}),xe())},i(o){e||(G(n),e=!0)},o(o){K(n),e=!1},d(o){n&&n.d(o),o&&W(t)}}}function Rl(i,t,e){let n,{floorIndex:o}=t,{floorplanData:s}=t,{hoveredRoom:r}=t,{getRoomAreaText:a}=t,{getLabelElement:l}=t,{adaptiveRoomLabelVisibleEnable:c}=t,h=0,f=0;function u(){h=this.clientWidth,e(4,h)}return i.$$set=m=>{"floorIndex"in m&&e(7,o=m.floorIndex),"floorplanData"in m&&e(8,s=m.floorplanData),"hoveredRoom"in m&&e(0,r=m.hoveredRoom),"getRoomAreaText"in m&&e(1,a=m.getRoomAreaText),"getLabelElement"in m&&e(2,l=m.getLabelElement),"adaptiveRoomLabelVisibleEnable"in m&&e(3,c=m.adaptiveRoomLabelVisibleEnable)},i.$$.update=()=>{if(i.$$.dirty&384&&e(6,n=s.floorDatas[o].rooms),i.$$.dirty&272){const{max:m,min:g}=s.bounding,v=m.x-g.x;e(5,f=h/v)}},[r,a,l,c,h,f,n,o,s,u]}class Nl extends de{constructor(t){super(),ue(this,t,Rl,Ol,he,{floorIndex:7,floorplanData:8,hoveredRoom:0,getRoomAreaText:1,getLabelElement:2,adaptiveRoomLabelVisibleEnable:3},jl)}}function Bl(i){ge(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 bo(i,t,e){const n=i.slice();return n[11]=t[e],n[13]=e,n}function Ao(i,t,e){const n=i.slice();return n[14]=t[e],n}function yo(i){let t;return{c(){t=X("div"),x(t,"class","floorplan-plugin__rule-scale svelte-djlmk4"),S(t,"left",i[14].left*100+"%"),S(t,"bottom",i[14].bottom*100+"%")},m(e,n){V(e,t,n)},p:ne,d(e){e&&W(t)}}}function Po(i,t){let e,n,o=t[1](t[11].distance)+"",s,r;return{key:i,first:null,c(){e=X("div"),n=X("div"),s=Ue(o),r=fe(),x(n,"class","floorplan-plugin__rule-text svelte-djlmk4"),Se(n,"is-row",t[2]),x(e,"class","floorplan-plugin__rule-text-item svelte-djlmk4"),S(e,"left",t[11].left*100+"%"),S(e,"bottom",t[11].bottom*100+"%"),this.first=e},m(a,l){V(a,e,l),Q(e,n),Q(n,s),Q(e,r)},p(a,l){t=a,l&2&&o!==(o=t[1](t[11].distance)+"")&&dt(s,o)},d(a){a&&W(e)}}}function Hl(i){let t,e,n,o,s,r,a=[],l=new Map,c,h=i[3],f=[];for(let g=0;g<h.length;g+=1)f[g]=yo(Ao(i,h,g));let u=i[4];const m=g=>g[13];for(let g=0;g<u.length;g+=1){let v=bo(i,u,g),b=m(v);l.set(b,a[g]=Po(b,v))}return{c(){t=X("div"),e=X("div"),n=fe(),o=X("div");for(let g=0;g<f.length;g+=1)f[g].c();s=fe(),r=X("div");for(let g=0;g<a.length;g+=1)a[g].c();x(e,"class","floorplan-plugin__rule-line svelte-djlmk4"),x(o,"class","floorplan-plugin__rule-scale-wrapper svelte-djlmk4"),Se(o,"is-row",i[2]),x(r,"class","floorplan-plugin__rule-text-wrapper svelte-djlmk4"),x(t,"class",c="floorplan-plugin__rule-labels floorplan-plugin__rule-labels--"+i[0]+" svelte-djlmk4"),Se(t,"is-row",i[2]),S(t,"width",i[2]?"100%":1/16+"rem"),S(t,"height",i[2]?1/16+"rem":"100%")},m(g,v){V(g,t,v),Q(t,e),Q(t,n),Q(t,o);for(let b=0;b<f.length;b+=1)f[b].m(o,null);Q(t,s),Q(t,r);for(let b=0;b<a.length;b+=1)a[b].m(r,null)},p(g,[v]){if(v&8){h=g[3];let b;for(b=0;b<h.length;b+=1){const y=Ao(g,h,b);f[b]?f[b].p(y,v):(f[b]=yo(y),f[b].c(),f[b].m(o,null))}for(;b<f.length;b+=1)f[b].d(1);f.length=h.length}v&22&&(u=g[4],a=At(a,v,m,1,g,u,l,r,Bs,Po,null,bo)),v&1&&c!==(c="floorplan-plugin__rule-labels floorplan-plugin__rule-labels--"+g[0]+" svelte-djlmk4")&&x(t,"class",c),v&5&&Se(t,"is-row",g[2])},i:ne,o:ne,d(g){g&&W(t),Ht(f,g);for(let v=0;v<a.length;v+=1)a[v].d()}}}const Mt=1e3,St=180;function Fl(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-(Mt-St)*2,c=s.max.y-s.min.y-(Mt-St)*2,h=o.map(([g,v])=>a?[g.x,v.x]:[g.y,v.y]).flat().sort().filter((g,v,b)=>v===0?!0:g!==b[v-1]),f=h.map(g=>{const v=a?(g-s.min.x-Mt+St)/l:0,b=a?0:(g-s.min.y-Mt+St)/c;return{left:v,bottom:b}});f.unshift({left:0,bottom:0}),f.push(a?{left:1,bottom:0}:{left:0,bottom:1});const u=h[h.length-1]-h[0],m=h.map((g,v,b)=>{const y=v===0?0:g-b[v-1],I=v===0?0:(g+b[v-1])/2,P=a?(I-s.min.x-Mt+St)/l:0,k=a?0:(I-s.min.y-Mt+St)/c;return{left:P,bottom:k,distance:y}}).filter(({distance:g})=>g/u>.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,f,m,o,s]}class Gl extends de{constructor(t){super(),ue(this,t,Fl,Hl,he,{type:0,data:5,bounding:6,getRuleDistanceText:1},Bl)}}function Xl(i){ge(i,"svelte-1mzj9p3",".floorplan-plugin__rule-labels-wrapper.svelte-1mzj9p3{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);pointer-events:none}")}function wo(i,t,e){const n=i.slice();return n[13]=t[e][0],n[14]=t[e][1],n}function Eo(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=Fe(r,s[a]);return n=new Gl({props:r}),{key:i,first:null,c(){e=Ge(),Pe(n.$$.fragment),this.first=e},m(a,l){V(a,e,l),ve(n,a,l),o=!0},p(a,l){t=a;const c=l&19?Xe(s,[{type:t[13],data:t[14],bounding:t[1],getRuleDistanceText:t[0]}]):{};n.$set(c)},i(a){o||(G(n.$$.fragment,a),o=!0)},o(a){K(n.$$.fragment,a),o=!1},d(a){a&&W(e),be(n,a)}}}function Ql(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=wo(i,s,a),c=r(l);n.set(c,e[a]=Eo(c,l))}return{c(){t=X("div");for(let a=0;a<e.length;a+=1)e[a].c();x(t,"class","floorplan-plugin__rule-labels-wrapper svelte-1mzj9p3"),S(t,"width",i[3]),S(t,"height",i[2])},m(a,l){V(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],Ie(),e=At(e,l,r,1,a,s,n,t,Gt,Eo,null,wo),xe()),l&8&&S(t,"width",a[3]),l&4&&S(t,"height",a[2])},i(a){if(!o){for(let l=0;l<s.length;l+=1)G(e[l]);o=!0}},o(a){for(let l=0;l<e.length;l+=1)K(e[l]);o=!1},d(a){a&&W(t);for(let l=0;l<e.length;l+=1)e[l].d()}}}const Io=1e3,xo=180;function Wl(i,t,e){let n,o,s,r,a,l,c,h,f,u,{floorIndex:m}=t,{floorplanData:g}=t,{getRuleDistanceText:v}=t;return i.$$set=b=>{"floorIndex"in b&&e(5,m=b.floorIndex),"floorplanData"in b&&e(6,g=b.floorplanData),"getRuleDistanceText"in b&&e(0,v=b.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(b=>[b,o[b]])),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-(Io-xo)*2),i.$$.dirty&2&&e(8,h=n.max.y-n.min.y-(Io-xo)*2),i.$$.dirty&1536&&e(3,f=c/a*100+"%"),i.$$.dirty&384&&e(2,u=h/l*100+"%")},[v,n,u,f,r,m,g,l,h,a,c,o,s]}class Yl extends de{constructor(t){super(),ue(this,t,Wl,Ql,he,{floorIndex:5,floorplanData:6,getRuleDistanceText:0},Xl)}}function Yn(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,h=l+","+c;return a===0?(e+="M"+h,e):o!=null&&o[a]?(e+="A"+o[a]+","+h,e):(e+="L"+h,e)}),e+(n?"Z":"")}function Gs({x:i,y:t},e){const{max:n,min:o}=e;return{x:i-o.x,y:n.y-t}}function Vl(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 Zl(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 Jl(i,t){return Math.max(...t.work.observers.map(n=>i.z>=n.standingPosition.z?n.floorIndex:0))}function Ul(i){let t;return{c(){t=De("path"),x(t,"d",i[0]),x(t,"fill","#2F313A")},m(e,n){V(e,t,n)},p(e,[n]){n&1&&x(t,"d",e[0])},i:ne,o:ne,d(e){e&&W(t)}}}function ql(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=Yn(o,{needZ:!0}))},[n,o]}class Kl extends de{constructor(t){super(),ue(this,t,ql,Ul,he,{path:1})}}function _l(i){let t,e,n,o,s,r;return{c(){t=De("defs"),e=De("pattern"),n=De("rect"),o=De("path"),s=fe(),r=De("path"),x(n,"x","0"),x(n,"y","0"),x(n,"width",i[1]),x(n,"height",i[1]),x(n,"fill","#323747"),x(o,"d",i[2]),x(o,"stroke","#ffffff"),x(o,"stroke-opacity","0.06"),x(o,"stroke-width","0.5"),x(o,"fill","none"),x(e,"id","fpm-room-pattern-0"),x(e,"x","0"),x(e,"y","0"),x(e,"width",i[1]),x(e,"height",i[1]),x(e,"patternUnits","userSpaceOnUse"),x(e,"patternTransform","scale(50 50)"),x(r,"d",i[0]),x(r,"fill","url(#fpm-room-pattern-0)")},m(a,l){V(a,t,l),Q(t,e),Q(e,n),Q(e,o),V(a,s,l),V(a,r,l)},p(a,[l]){l&1&&x(r,"d",a[0])},i:ne,o:ne,d(a){a&&W(t),a&&W(s),a&&W(r)}}}const hi=6;function $l(i,t,e){let n,{path:o}=t;const s=hi*2,r=`M0 ${hi} h ${s} M${hi} 0 v ${s}`;return i.$$set=a=>{"path"in a&&e(3,o=a.path)},i.$$.update=()=>{i.$$.dirty&8&&e(0,n=Yn(o,{needZ:!0}))},[n,s,r,o]}class ec extends de{constructor(t){super(),ue(this,t,$l,_l,he,{path:3})}}function tc(i){let t,e,n,o,s,r,a,l,c,h,f;return{c(){t=De("defs"),e=De("pattern"),n=De("rect"),o=De("pattern"),s=De("rect"),r=fe(),a=De("path"),l=fe(),c=De("path"),h=fe(),f=De("path"),x(n,"x","0"),x(n,"y","0"),x(n,"width","6"),x(n,"height","50"),x(n,"fill","none"),x(n,"stroke","#4B4B57"),x(n,"stroke-width","0.5"),x(e,"id","room-material-pattern-1"),x(e,"x","0"),x(e,"y","0"),x(e,"width","12"),x(e,"height","50"),x(e,"patternUnits","userSpaceOnUse"),x(e,"patternTransform","scale(50 50)"),x(s,"x","0"),x(s,"y","0"),x(s,"width","6"),x(s,"height","50"),x(s,"fill","none"),x(s,"stroke","#4B4B57"),x(s,"stroke-width","0.5"),x(o,"id","room-material-pattern-2"),x(o,"x","6"),x(o,"y","25"),x(o,"width","12"),x(o,"height","50"),x(o,"patternUnits","userSpaceOnUse"),x(o,"patternTransform","scale(50 50)"),x(a,"d",i[0]),x(a,"fill","#43434D"),x(c,"d",i[0]),x(c,"fill","url(#room-material-pattern-1)"),x(f,"d",i[0]),x(f,"fill","url(#room-material-pattern-2)")},m(u,m){V(u,t,m),Q(t,e),Q(e,n),Q(t,o),Q(o,s),V(u,r,m),V(u,a,m),V(u,l,m),V(u,c,m),V(u,h,m),V(u,f,m)},p(u,[m]){m&1&&x(a,"d",u[0]),m&1&&x(c,"d",u[0]),m&1&&x(f,"d",u[0])},i:ne,o:ne,d(u){u&&W(t),u&&W(r),u&&W(a),u&&W(l),u&&W(c),u&&W(h),u&&W(f)}}}function nc(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=Yn(o,{needZ:!0}))},[n,o]}class ic extends de{constructor(t){super(),ue(this,t,nc,tc,he,{path:1})}}function oc(i){ge(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 Co(i,t,e){const n=i.slice();return n[5]=t[e],n}function sc(i){let t,e;return t=new ec({props:{path:i[5].path}}),{c(){Pe(t.$$.fragment)},m(n,o){ve(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.path=n[5].path),t.$set(s)},i(n){e||(G(t.$$.fragment,n),e=!0)},o(n){K(t.$$.fragment,n),e=!1},d(n){be(t,n)}}}function rc(i){let t,e;return t=new ic({props:{path:i[5].path}}),{c(){Pe(t.$$.fragment)},m(n,o){ve(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.path=n[5].path),t.$set(s)},i(n){e||(G(t.$$.fragment,n),e=!0)},o(n){K(t.$$.fragment,n),e=!1},d(n){be(t,n)}}}function ac(i){let t,e;return t=new Kl({props:{path:i[5].path}}),{c(){Pe(t.$$.fragment)},m(n,o){ve(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.path=n[5].path),t.$set(s)},i(n){e||(G(t.$$.fragment,n),e=!0)},o(n){K(t.$$.fragment,n),e=!1},d(n){be(t,n)}}}function Lo(i){let t,e,n,o;const s=[ac,rc,sc],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=De("svg"),n.c(),x(t,"width","100%"),x(t,"height","100%"),x(t,"viewBox",`0 0 ${i[1]} ${i[2]}`),x(t,"class","svelte-1dykexu")},m(l,c){V(l,t,c),r[e].m(t,null),o=!0},p(l,c){let h=e;e=a(l),e===h?r[e].p(l,c):(Ie(),K(r[h],1,1,()=>{r[h]=null}),xe(),n=r[e],n?n.p(l,c):(n=r[e]=s[e](l),n.c()),G(n,1),n.m(t,null))},i(l){o||(G(n),o=!0)},o(l){K(n),o=!1},d(l){l&&W(t),r[e].d()}}}function lc(i){let t,e,n=i[0],o=[];for(let r=0;r<n.length;r+=1)o[r]=Lo(Co(i,n,r));const s=r=>K(o[r],1,1,()=>{o[r]=null});return{c(){t=X("div");for(let r=0;r<o.length;r+=1)o[r].c();x(t,"class","floorplan-plugin__room-material svelte-1dykexu")},m(r,a){V(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=Co(r,n,l);o[l]?(o[l].p(c,a),G(o[l],1)):(o[l]=Lo(c),o[l].c(),G(o[l],1),o[l].m(t,null))}for(Ie(),l=n.length;l<o.length;l+=1)s(l);xe()}},i(r){if(!e){for(let a=0;a<n.length;a+=1)G(o[a]);e=!0}},o(r){o=o.filter(Boolean);for(let a=0;a<o.length;a+=1)K(o[a]);e=!1},d(r){r&&W(t),Ht(o,r)}}}function cc(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=>Object.assign(Object.assign({},l),{path:l.path.map(c=>Gs(c,s.bounding))})))},[n,r,a,o,s]}class hc extends de{constructor(t){super(),ue(this,t,cc,lc,he,{floorIndex:3,floorplanData:4},oc)}}function uc(i){ge(i,"svelte-19uvvss","path.svelte-19uvvss{opacity:0}path.svelte-19uvvss:hover{opacity:0.1}")}function dc(i){let t,e,n;return{c(){t=De("path"),x(t,"d",i[2]),x(t,"fill","#fff"),x(t,"class","svelte-19uvvss")},m(o,s){V(o,t,s),e||(n=[qe(t,"mouseenter",i[0]),qe(t,"mouseleave",i[1])],e=!0)},p:ne,i:ne,o:ne,d(o){o&&W(t),e=!1,Bt(n)}}}function fc(i,t,e){let{room:n}=t,{floorplanData:o}=t,{hoveredRoom:s}=t;function r(){s.set(n)}function a(){s.set(void 0)}const{bounding:l}=o,c=Yn(n.path,{needZ:!0,format:h=>Gs(h,l)});return i.$$set=h=>{"room"in h&&e(3,n=h.room),"floorplanData"in h&&e(4,o=h.floorplanData),"hoveredRoom"in h&&e(5,s=h.hoveredRoom)},[r,a,c,n,o,s]}class mc extends de{constructor(t){super(),ue(this,t,fc,dc,he,{room:3,floorplanData:4,hoveredRoom:5},uc)}}function pc(i){ge(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 ko(i,t,e){const n=i.slice();return n[5]=t[e],n}function To(i,t){let e,n,o;const s=[{room:t[5],floorplanData:t[1],hoveredRoom:t[2]}];let r={};for(let a=0;a<s.length;a+=1)r=Fe(r,s[a]);return n=new mc({props:r}),{key:i,first:null,c(){e=Ge(),Pe(n.$$.fragment),this.first=e},m(a,l){V(a,e,l),ve(n,a,l),o=!0},p(a,l){t=a;const c=l&7?Xe(s,[{room:t[5],floorplanData:t[1],hoveredRoom:t[2]}]):{};n.$set(c)},i(a){o||(G(n.$$.fragment,a),o=!0)},o(a){K(n.$$.fragment,a),o=!1},d(a){a&&W(e),be(n,a)}}}function gc(i){let t,e,n=[],o=new Map,s,r=i[1].floorDatas[i[0]].rooms;const a=l=>l[5].id;for(let l=0;l<r.length;l+=1){let c=ko(i,r,l),h=a(c);o.set(h,n[l]=To(h,c))}return{c(){t=X("div"),e=De("svg");for(let l=0;l<n.length;l+=1)n[l].c();x(e,"width","100%"),x(e,"height","100%"),x(e,"viewBox",`0 0 ${i[3]} ${i[4]}`),x(e,"class","svelte-1kqo6e4"),x(t,"class","floorplan-plugin__room-highlight svelte-1kqo6e4")},m(l,c){V(l,t,c),Q(t,e);for(let h=0;h<n.length;h+=1)n[h].m(e,null);s=!0},p(l,[c]){c&7&&(r=l[1].floorDatas[l[0]].rooms,Ie(),n=At(n,c,a,1,l,r,o,e,Gt,To,null,ko),xe())},i(l){if(!s){for(let c=0;c<r.length;c+=1)G(n[c]);s=!0}},o(l){for(let c=0;c<n.length;c+=1)K(n[c]);s=!1},d(l){l&&W(t);for(let c=0;c<n.length;c+=1)n[c].d()}}}function vc(i,t,e){let{floorIndex:n}=t,{floorplanData:o}=t,{hoveredRoom:s}=t;const r=o.bounding.max.x-o.bounding.min.x,a=o.bounding.max.y-o.bounding.min.y;return i.$$set=l=>{"floorIndex"in l&&e(0,n=l.floorIndex),"floorplanData"in l&&e(1,o=l.floorplanData),"hoveredRoom"in l&&e(2,s=l.hoveredRoom)},[n,o,s,r,a]}class Xs extends de{constructor(t){super(),ue(this,t,vc,gc,he,{floorIndex:0,floorplanData:1,hoveredRoom:2},pc)}}function bc(i){ge(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 Do(i){let t,e;const n=[{floorIndex:i[1],floorplanData:i[5],hoveredRoom:i[10]}];let o={};for(let s=0;s<n.length;s+=1)o=Fe(o,n[s]);return t=new Xs({props:o}),{c(){Pe(t.$$.fragment)},m(s,r){ve(t,s,r),e=!0},p(s,r){const a=r&1058?Xe(n,[{floorIndex:s[1],floorplanData:s[5],hoveredRoom:s[10]}]):{};t.$set(a)},i(s){e||(G(t.$$.fragment,s),e=!0)},o(s){K(t.$$.fragment,s),e=!1},d(s){be(t,s)}}}function zo(i){let t,e;const n=[{floorplanData:i[5],floorIndex:i[1],getRoomAreaText:i[6],getLabelElement:i[7],hoveredRoom:i[10],adaptiveRoomLabelVisibleEnable:i[9]}];let o={};for(let s=0;s<n.length;s+=1)o=Fe(o,n[s]);return t=new Nl({props:o}),{c(){Pe(t.$$.fragment)},m(s,r){ve(t,s,r),e=!0},p(s,r){const a=r&1762?Xe(n,[{floorplanData:s[5],floorIndex:s[1],getRoomAreaText:s[6],getLabelElement:s[7],hoveredRoom:s[10],adaptiveRoomLabelVisibleEnable:s[9]}]):{};t.$set(a)},i(s){e||(G(t.$$.fragment,s),e=!0)},o(s){K(t.$$.fragment,s),e=!1},d(s){be(t,s)}}}function Mo(i){let t,e;const n=[{floorplanData:i[5],floorIndex:i[1],getRuleDistanceText:i[8]}];let o={};for(let s=0;s<n.length;s+=1)o=Fe(o,n[s]);return t=new Yl({props:o}),{c(){Pe(t.$$.fragment)},m(s,r){ve(t,s,r),e=!0},p(s,r){const a=r&290?Xe(n,[{floorplanData:s[5],floorIndex:s[1],getRuleDistanceText:s[8]}]):{};t.$set(a)},i(s){e||(G(t.$$.fragment,s),e=!0)},o(s){K(t.$$.fragment,s),e=!1},d(s){be(t,s)}}}function Ac(i){let t,e,n,o,s,r,a,l,c;const h=[{floorIndex:i[1],floorplanData:i[5]}];let f={};for(let y=0;y<h.length;y+=1)f=Fe(f,h[y]);e=new hc({props:f});let u=i[2]&&Do(i);const m=[{floorplanData:i[5],floorIndex:i[1]}];let g={};for(let y=0;y<m.length;y+=1)g=Fe(g,m[y]);s=new Fs({props:g});let v=i[3]&&zo(i),b=i[4]&&Mo(i);return{c(){t=X("div"),Pe(e.$$.fragment),n=fe(),u&&u.c(),o=fe(),Pe(s.$$.fragment),r=fe(),v&&v.c(),a=fe(),b&&b.c(),x(t,"class",l=je(`floorplan-plugin__floor${i[0]?" floorplan-plugin__floor--is-current":""}`)+" svelte-bl8zrz")},m(y,I){V(y,t,I),ve(e,t,null),Q(t,n),u&&u.m(t,null),Q(t,o),ve(s,t,null),Q(t,r),v&&v.m(t,null),Q(t,a),b&&b.m(t,null),c=!0},p(y,[I]){const P=I&34?Xe(h,[{floorIndex:y[1],floorplanData:y[5]}]):{};e.$set(P),y[2]?u?(u.p(y,I),I&4&&G(u,1)):(u=Do(y),u.c(),G(u,1),u.m(t,o)):u&&(Ie(),K(u,1,1,()=>{u=null}),xe());const k=I&34?Xe(m,[{floorplanData:y[5],floorIndex:y[1]}]):{};s.$set(k),y[3]?v?(v.p(y,I),I&8&&G(v,1)):(v=zo(y),v.c(),G(v,1),v.m(t,a)):v&&(Ie(),K(v,1,1,()=>{v=null}),xe()),y[4]?b?(b.p(y,I),I&16&&G(b,1)):(b=Mo(y),b.c(),G(b,1),b.m(t,null)):b&&(Ie(),K(b,1,1,()=>{b=null}),xe()),(!c||I&1&&l!==(l=je(`floorplan-plugin__floor${y[0]?" floorplan-plugin__floor--is-current":""}`)+" svelte-bl8zrz"))&&x(t,"class",l)},i(y){c||(G(e.$$.fragment,y),G(u),G(s.$$.fragment,y),G(v),G(b),c=!0)},o(y){K(e.$$.fragment,y),K(u),K(s.$$.fragment,y),K(v),K(b),c=!1},d(y){y&&W(t),be(e),u&&u.d(),be(s),v&&v.d(),b&&b.d()}}}function yc(i,t,e){let{isCurrent:n}=t,{floorIndex:o}=t,{hoverEnable:s}=t,{roomLabelsEnable:r}=t,{ruleLabelsEnable:a}=t,{floorplanData:l}=t,{getRoomAreaText:c}=t,{getLabelElement:h}=t,{getRuleDistanceText:f}=t,{adaptiveRoomLabelVisibleEnable:u}=t;const m=Hs(void 0);return i.$$set=g=>{"isCurrent"in g&&e(0,n=g.isCurrent),"floorIndex"in g&&e(1,o=g.floorIndex),"hoverEnable"in g&&e(2,s=g.hoverEnable),"roomLabelsEnable"in g&&e(3,r=g.roomLabelsEnable),"ruleLabelsEnable"in g&&e(4,a=g.ruleLabelsEnable),"floorplanData"in g&&e(5,l=g.floorplanData),"getRoomAreaText"in g&&e(6,c=g.getRoomAreaText),"getLabelElement"in g&&e(7,h=g.getLabelElement),"getRuleDistanceText"in g&&e(8,f=g.getRuleDistanceText),"adaptiveRoomLabelVisibleEnable"in g&&e(9,u=g.adaptiveRoomLabelVisibleEnable)},[n,o,s,r,a,l,c,h,f,u,m]}class Pc extends de{constructor(t){super(),ue(this,t,yc,Ac,he,{isCurrent:0,floorIndex:1,hoverEnable:2,roomLabelsEnable:3,ruleLabelsEnable:4,floorplanData:5,getRoomAreaText:6,getLabelElement:7,getRuleDistanceText:8,adaptiveRoomLabelVisibleEnable:9},bc)}}function wc(i){ge(i,"svelte-86bqav",".floorplan-main.svelte-86bqav{width:100%;height:100%;pointer-events:none}")}function So(i,t,e){const n=i.slice();return n[16]=t[e],n}function jo(i){let t,e,n,o,s,r,a=i[9].floorDatas,l=[];for(let m=0;m<a.length;m+=1)l[m]=Oo(So(i,a,m));const c=m=>K(l[m],1,1,()=>{l[m]=null}),h=[{panoIndex:i[3],floorplanData:i[9],lastPanoramaLongitude:i[10],cameraImageUrl:i[11]}];let f={};for(let m=0;m<h.length;m+=1)f=Fe(f,h[m]);n=new rl({props:f});let u=i[6]&&Ro(i);return{c(){t=X("div");for(let m=0;m<l.length;m+=1)l[m].c();e=fe(),Pe(n.$$.fragment),o=fe(),u&&u.c(),x(t,"class","floorplan-main svelte-86bqav")},m(m,g){V(m,t,g);for(let v=0;v<l.length;v+=1)l[v].m(t,null);Q(t,e),ve(n,t,null),Q(t,o),u&&u.m(t,null),r=!0},p(m,g){if(i=m,g&62384){a=i[9].floorDatas;let b;for(b=0;b<a.length;b+=1){const y=So(i,a,b);l[b]?(l[b].p(y,g),G(l[b],1)):(l[b]=Oo(y),l[b].c(),G(l[b],1),l[b].m(t,e))}for(Ie(),b=a.length;b<l.length;b+=1)c(b);xe()}const v=g&3592?Xe(h,[{panoIndex:i[3],floorplanData:i[9],lastPanoramaLongitude:i[10],cameraImageUrl:i[11]}]):{};n.$set(v),i[6]?u?(u.p(i,g),g&64&&G(u,1)):(u=Ro(i),u.c(),G(u,1),u.m(t,null)):u&&(Ie(),K(u,1,1,()=>{u=null}),xe())},i(m){if(!r){for(let g=0;g<a.length;g+=1)G(l[g]);G(n.$$.fragment,m),G(u),s||Ke(()=>{s=Sa(t,tl,{duration:i[0],easing:ki}),s.start()}),r=!0}},o(m){l=l.filter(Boolean);for(let g=0;g<l.length;g+=1)K(l[g]);K(n.$$.fragment,m),K(u),r=!1},d(m){m&&W(t),Ht(l,m),be(n),u&&u.d()}}}function Oo(i){let t,e;const n=[{hoverEnable:i[5],floorplanData:i[9],getRoomAreaText:i[12],getLabelElement:i[13],getRuleDistanceText:i[14],roomLabelsEnable:i[7],ruleLabelsEnable:i[8],adaptiveRoomLabelVisibleEnable:i[15]},{floorIndex:i[16].floorIndex},{isCurrent:i[16].floorIndex===i[4]}];let o={};for(let s=0;s<n.length;s+=1)o=Fe(o,n[s]);return t=new Pc({props:o}),{c(){Pe(t.$$.fragment)},m(s,r){ve(t,s,r),e=!0},p(s,r){const a=r&62384?Xe(n,[r&62368&&{hoverEnable:s[5],floorplanData:s[9],getRoomAreaText:s[12],getLabelElement:s[13],getRuleDistanceText:s[14],roomLabelsEnable:s[7],ruleLabelsEnable:s[8],adaptiveRoomLabelVisibleEnable:s[15]},r&512&&{floorIndex:s[16].floorIndex},r&528&&{isCurrent:s[16].floorIndex===s[4]}]):{};t.$set(a)},i(s){e||(G(t.$$.fragment,s),e=!0)},o(s){K(t.$$.fragment,s),e=!1},d(s){be(t,s)}}}function Ro(i){let t,e;return t=new fl({props:{floorplanData:i[9],northDesc:i[2]}}),{c(){Pe(t.$$.fragment)},m(n,o){ve(t,n,o),e=!0},p(n,o){const s={};o&512&&(s.floorplanData=n[9]),o&4&&(s.northDesc=n[2]),t.$set(s)},i(n){e||(G(t.$$.fragment,n),e=!0)},o(n){K(t.$$.fragment,n),e=!1},d(n){be(t,n)}}}function Ec(i){let t,e,n=i[1]&&jo(i);return{c(){n&&n.c(),t=Ge()},m(o,s){n&&n.m(o,s),V(o,t,s),e=!0},p(o,[s]){o[1]?n?(n.p(o,s),s&2&&G(n,1)):(n=jo(o),n.c(),G(n,1),n.m(t.parentNode,t)):n&&(Ie(),K(n,1,1,()=>{n=null}),xe())},i(o){e||(G(n),e=!0)},o(o){K(n),e=!1},d(o){n&&n.d(o),o&&W(t)}}}function Ic(i,t,e){let{duration:n=0}=t,{visible:o}=t,{northDesc:s}=t,{panoIndex:r}=t,{floorIndex:a}=t,{hoverEnable:l}=t,{compassEnable:c}=t,{roomLabelsEnable:h}=t,{ruleLabelsEnable:f}=t,{floorplanData:u}=t,{lastPanoramaLongitude:m}=t,{cameraImageUrl:g}=t,{getRoomAreaText:v}=t,{getLabelElement:b}=t,{getRuleDistanceText:y}=t,{adaptiveRoomLabelVisibleEnable:I}=t;return i.$$set=P=>{"duration"in P&&e(0,n=P.duration),"visible"in P&&e(1,o=P.visible),"northDesc"in P&&e(2,s=P.northDesc),"panoIndex"in P&&e(3,r=P.panoIndex),"floorIndex"in P&&e(4,a=P.floorIndex),"hoverEnable"in P&&e(5,l=P.hoverEnable),"compassEnable"in P&&e(6,c=P.compassEnable),"roomLabelsEnable"in P&&e(7,h=P.roomLabelsEnable),"ruleLabelsEnable"in P&&e(8,f=P.ruleLabelsEnable),"floorplanData"in P&&e(9,u=P.floorplanData),"lastPanoramaLongitude"in P&&e(10,m=P.lastPanoramaLongitude),"cameraImageUrl"in P&&e(11,g=P.cameraImageUrl),"getRoomAreaText"in P&&e(12,v=P.getRoomAreaText),"getLabelElement"in P&&e(13,b=P.getLabelElement),"getRuleDistanceText"in P&&e(14,y=P.getRuleDistanceText),"adaptiveRoomLabelVisibleEnable"in P&&e(15,I=P.adaptiveRoomLabelVisibleEnable)},[n,o,s,r,a,l,c,h,f,u,m,g,v,b,y,I]}class Si extends de{constructor(t){super(),ue(this,t,Ic,Ec,he,{duration:0,visible:1,northDesc:2,panoIndex:3,floorIndex:4,hoverEnable:5,compassEnable:6,roomLabelsEnable:7,ruleLabelsEnable:8,floorplanData:9,lastPanoramaLongitude:10,cameraImageUrl:11,getRoomAreaText:12,getLabelElement:13,getRu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SnnolZVU9cUn2O9SmaMWGFBqYXRwbqAJWIi94TX5biotpcGl1DXZ6LnqIbNDTnmUgi52Mv5l5ysMxIcZcGjy2DTK4ZHlcBC14zeSge4qphICjj3bS0A7o9nSp2TOkm7aZ8bGZy/jxhO87V91G0+dfY/Z7BWIIK9KYUi5qy/Hf8YfBG3sqJTHiQWhmTVkbip+wX3x6volVSx+LPAxF+VLXhZ8VQ+iP2Rta/iWe5v42Fngj0BbdnRTXh12ZIcKhTaGbcYjybRwXBU1lu9KlndXp04NM52poKWO0RZsviNaP9a6grkO972+st05pXhE5c1hTEluJy7XUejGUQNLMbAmTdWY1rKBLW3aTJqBZ7nZkb36DhYCreeYHbMUXHvaYi5XDK70EcgulmRjm77wNtenzuXCbmnTRaAx493rbGf3Jr/njMzj920CnKdUaFCjlDioy7NYNvOdGrQJNgI32/L2tkXfFPlxgToqjWVhD6KdLnQRdARf/HHQz2r2X2Gqy8pAZaAyUBmoDFQGKgP/q4F/AJYg9/s0ZoABAAAAAElFTkSuQmCC";async function Cc(i){const t=new Headers({"Content-Type":"text/plain"}),e=async function(o){const s={index:o.index,url:o.url,svgUrl:o.svg_url};if(o.svg_url){const r=await fetch(o.svg_url,{headers:t}).then(a=>a.text());s.svgContent=r}return s};return await Promise.all(i.map(e))}function Lc(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 kc(i){return{floorName:i.floor_name,floorIndex:i.floor_index,rooms:i.rooms.map(Lc),rules:i.rules}}function Tc(i){return{index:i.index,floorIndex:i.floor_index,position:i.position,positionInImage:i.position_in_image}}function Dc(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}}async function bt(i){const t=await Cc(i.outlines),e=i.computed_data.bounding,n=i.computed_data.floor_datas.map(kc),o=i.computed_data.entrance?Dc(i.computed_data.entrance):null;return{outlines:t,entrance:o,bounding:e,floorDatas:n,observers:i.computed_data.observers.map(Tc)}}function zc(i,t,e){return i.map(o=>{const s=o.position,r=o.icon?o.icon:{url:xc,width:45,height:48},a=Jl(s,t),l=Vl(s,e),c=Zl(l,e);return{floorIndex:a,icon:r,id:o.id,position:l,positionInImage:c}})}function Mc(i,t){return t(i),i}function Vn(i,t){return Mc({},e=>{for(const n in i)t.indexOf(n)===-1&&(e[n]=i[n])})}function No(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 ji(i,t,e=gt.BOUNDING_CENTER){const n=No(i,t),o=No(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 Oi(i,t,e,n){const o=ji(i,e,n==null?void 0:n.attachedTo),s=new O.Vector3(0,o,0),r=new O.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 Qs{constructor(t){d(this,"five");d(this,"hooks",new ye.Subscribe);this.five=t}getCurrentState(){return this.state}}class Lt extends Qs{}var Ye=(i=>(i.UnknownError="UnknownError",i.DataNotLoaded="DataNotLoaded",i.BreakOffByHide="BreakOffByHide",i.BreakOffByDisable="BreakOffByDisable",i.ModelNotLoaded="ModelNotLoaded",i.ChangeModeError="ChangeModeError",i.UpdateCameraError="UpdateCameraError",i))(Ye||{});const Ws=500,Sc=80;function Pi(i,t,e=4){return Math.floor(i*Math.pow(10,e))===Math.floor(t*Math.pow(10,e))}async function Ys(i,t){await 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 h=o[c];if(h===void 0)return!0;const f=l[c];return typeof h=="number"&&typeof f=="number"?Pi(h,f,2):h===f}):!0})()||n(new Error("five pose \u4E0E\u9884\u671F\u4E0D\u7B26")),e()})})}function Ri(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!(!Pi(e,s,2)||!Pi(n,r,2)||o!==a)}async function Vs(i,t,e=!0){if(Ri(i,t)===!0)return;const o=i.getCurrentState();if(o.mode!==t.mode){const[h]=await Nn(Ys(i,[t.mode,t,void 0,e]));if(h)throw new Error(Ye.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]=await Nn(i.updateCamera(t,l,e));if(c)throw new Error(Ye.UpdateCameraError)}function Nt(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 jc(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 Oc(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 Rc extends Lt{constructor(e,n){var a;super(e);d(this,"name","modelFloorplanPlugin");d(this,"state");d(this,"data");d(this,"showState");d(this,"showPromise");d(this,"app");d(this,"panoIndex",0);d(this,"floorIndex",0);d(this,"selector");d(this,"showRejection");d(this,"wrapper");d(this,"container",document.createElement("div"));d(this,"lastPanoramaLongitude",0);d(this,"size",{width:0,height:0});d(this,"hasAddedEventListener",!1);d(this,"isHiddenByHideFunc",!1);d(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")});d(this,"show",async(e={})=>{if(!this.state.enabled||!this.showPromise&&this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},n),this._show(e)});d(this,"hide",async(e={})=>{!this.state.enabled||(this.isHiddenByHideFunc=!0,this.state.visible!==!1&&(this.updateState({visible:!1},e.userAction||!0),this._hide(e)))});d(this,"updateSize",()=>{if(!this.data||!Ri(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=Oi(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})});d(this,"_disable",e=>{var o,s,r;const{userAction:n}=e;this.hooks.emit("disable",{userAction:n}),(o=this.showRejection)==null||o.call(this,Ye.BreakOffByDisable),this.showPromise=void 0,(s=this.app)==null||s.$destroy(),this.app=void 0,(r=this.container)==null||r.remove(),this.removeEventListener()});d(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}))});d(this,"_show",async e=>{var r;if(!this.state.enabled)return;if(!((r=this.five.model)!=null&&r.loaded))throw new Error(Ye.ModelNotLoaded);if(!this.data)throw new Error(Ye.DataNotLoaded);this.isHiddenByHideFunc=!1;const o={...{floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},...e},s=async()=>{this.hooks.emit("show",{userAction:o.userAction,auto:o.isAutoShow});let a=!1,l;this.showRejection=u=>{a=!0,l=u};const[c]=await Nn(Vs(this.five,this.showState,o.userAction));if(c)throw c;if(a)throw l?new Error(l):new Error(Ye.UnknownError);this.updateSize(),this.floorIndex=o.floorIndex,this.five.model.show(this.floorIndex);const h=o.modelOpacity,f=o.immediately?0:Ws;Nt(this.five,h,f),this.render(f)};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});d(this,"_hide",e=>{var s;(s=this.showRejection)==null||s.call(this,Ye.BreakOffByHide),this.showPromise=void 0;const o={...{userAction:!0,isAutoHide:!1},...e};Nt(this.five,1,0),this.hooks.emit("hide",{auto:o.isAutoHide,userAction:o.userAction}),this.render()});d(this,"handleClick",()=>{if(!this.state.visible)return;if(this.hooks.emit("click"))return!1});d(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)});d(this,"onFiveModeChange",e=>{e!==this.showState.mode&&(this.updateState({visible:!1},!1),this._hide({userAction:!1}))});d(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||Oc(o)&&(this.updateState({visible:!0},!0),this._show({isAutoShow:!0})))});d(this,"onFivePanoArrived",e=>{var n;!((n=this.five)!=null&&n.work)||(this.panoIndex=e,this.floorIndex=this.five.work.observers[e].floorIndex)});d(this,"onFiveCameraUpdate",(e,n)=>{if(!this.state.visible||this.showPromise)return;const o=this.five.getCurrentState();jc(o)&&(this.updateState({visible:!1},n),this._hide({userAction:n,isAutoHide:!0}))});d(this,"onFiveWantsGesture",(e,n)=>{if(!!this.state.visible&&(n.length>1||e==="mouseWheel"))return!1});d(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});d(this,"onFiveWantsTapGesture",()=>this.handleClick());d(this,"onFiveWantsChangeMode",(e,n)=>{n==="Panorama"&&e==="Floorplan"&&(this.lastPanoramaLongitude=this.five.getCurrentState().longitude)});d(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:Sc/((a=n==null?void 0:n.scale)!=null?a:1)};const o={northDesc:"\u5317",modelOpacity:1,hoverEnable:!0,compassEnable:!0,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,adaptiveRoomLabelVisibleEnable:!0,cameraImageUrl:vt,attachedTo:gt.BOUNDING_CENTER,getLabelElement:void 0,getRoomAreaText:l=>(l/1e6).toFixed(1)+"\u33A1",getRuleDistanceText:l=>l.toString()},s=n?Vn(n,["selector","scale"]):{},r={...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()}async load(e,n,o=!0){function s(h){return Object.prototype.hasOwnProperty.apply(h,["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=await bt(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()}async formatData(e){return await bt(e.data)}updateState(e,n){const o=this.state,s=e.config?{...o.config,...e.config}:o.config;this.state={...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={...this.state.config,visible:this.state.visible,duration:e!=null?e:0,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude};if(this.app)return this.app.$set(n);this.app=new Si({target:this.container,intro:!0,props:n})}}const Nc=(i,t)=>new Rc(i,t);function Bc(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 Hc(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 Fc extends Lt{constructor(e,n){super(e);d(this,"name","modelFloorplanPlugin");d(this,"state");d(this,"data");d(this,"showState");d(this,"showPromise");d(this,"app");d(this,"panoIndex",0);d(this,"floorIndex",0);d(this,"selector");d(this,"showRejection");d(this,"wrapper");d(this,"container",document.createElement("div"));d(this,"lastPanoramaLongitude",0);d(this,"size",{width:0,height:0});d(this,"hasAddedEventListener",!1);d(this,"isHiddenByHideFunc",!1);d(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")});d(this,"show",async(e={})=>{if(!this.state.enabled||!this.showPromise&&this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},n),this._show(e)});d(this,"hide",async(e={})=>{!this.state.enabled||(this.isHiddenByHideFunc=!0,this.state.visible!==!1&&(this.updateState({visible:!1},e.userAction||!0),this._hide(e)))});d(this,"updateSize",()=>{if(!this.data||!Ri(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=Oi(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})});d(this,"_disable",e=>{var o,s,r;const{userAction:n}=e;this.hooks.emit("disable",{userAction:n}),(o=this.showRejection)==null||o.call(this,Ye.BreakOffByDisable),this.showPromise=void 0,(s=this.app)==null||s.$destroy(),this.app=void 0,(r=this.container)==null||r.remove(),this.removeEventListener()});d(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}))});d(this,"_show",async e=>{var r;if(!this.state.enabled)return;if(!((r=this.five.model)!=null&&r.loaded))throw new Error(Ye.ModelNotLoaded);if(!this.data)throw new Error(Ye.DataNotLoaded);this.isHiddenByHideFunc=!1;const o={...{floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},...e},s=async()=>{this.hooks.emit("show",{userAction:o.userAction,auto:o.isAutoShow});let a=!1,l;this.showRejection=u=>{a=!0,l=u};const[c]=await Nn(Vs(this.five,this.showState,o.userAction));if(c)throw c;if(a)throw l?new Error(l):new Error(Ye.UnknownError);this.updateSize(),this.updatePosition(),this.floorIndex=o.floorIndex,this.five.model.show(this.floorIndex);const h=o.modelOpacity,f=o.immediately?0:Ws;Nt(this.five,h,f),this.render(f)};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});d(this,"_hide",e=>{var s;(s=this.showRejection)==null||s.call(this,Ye.BreakOffByHide),this.showPromise=void 0;const o={...{userAction:!0,isAutoHide:!1},...e};Nt(this.five,1,0),this.hooks.emit("hide",{auto:o.isAutoHide,userAction:o.userAction}),this.render()});d(this,"handleClick",()=>{if(!this.state.visible)return;if(this.hooks.emit("click"))return!1});d(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)});d(this,"onFiveModeChange",e=>{e!==this.showState.mode&&(this.updateState({visible:!1},!1),this._hide({userAction:!1}))});d(this,"onFivePanoArrived",e=>{var n;!((n=this.five)!=null&&n.work)||(this.panoIndex=e,this.floorIndex=this.five.work.observers[e].floorIndex)});d(this,"onFiveCameraUpdate",(e,n)=>{if(!this.state.visible||this.showPromise)return;const o=this.five.getCurrentState();this.updatePosition(),this.updateSize(),Bc(o)&&(this.updateState({visible:!1},n),this._hide({userAction:n}))});d(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:(Hc(o)&&(this.updateState({visible:!0},!0),this._show({isAutoShow:!0})),!1)}}});d(this,"onFiveWantsTapGesture",()=>this.handleClick());d(this,"onFiveWantsChangeMode",(e,n)=>{n==="Panorama"&&e===this.showState.mode&&(this.lastPanoramaLongitude=this.five.getCurrentState().longitude)});d(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,hoverEnable:!0,compassEnable:!0,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,cameraImageUrl:vt,attachedTo:gt.BOUNDING_CENTER,getLabelElement:void 0,adaptiveRoomLabelVisibleEnable:!0,getRoomAreaText:a=>(a/1e6).toFixed(1)+"\u33A1",getRuleDistanceText:a=>a.toString()},s=n?Vn(n,["selector","scale"]):{},r={...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()}async load(e,n,o=!0){function s(h){return Object.prototype.hasOwnProperty.apply(h,["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=await bt(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=ji(this.five,this.floorIndex,this.state.config.attachedTo),n=(a=this.five.model)==null?void 0:a.bounding.getCenter(new O.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+"%"}async formatData(e){return await bt(e.data)}updateState(e,n){const o=this.state,s=e.config?{...o.config,...e.config}:o.config;this.state={...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={...this.state.config,visible:this.state.visible,duration:e!=null?e:0,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude};if(this.app)return this.app.$set(n);this.app=new Si({target:this.container,intro:!0,props:n})}}const Gc=(i,t)=>new Fc(i,t);class Xc extends Lt{constructor(e,n){super(e);d(this,"name","topviewFloorplanPlugin");d(this,"state");d(this,"data");d(this,"app");d(this,"selector");d(this,"panoIndex",0);d(this,"floorIndex",0);d(this,"wrapper");d(this,"container",document.createElement("div"));d(this,"lastPanoramaLongitude",0);d(this,"size",{width:0,height:0});d(this,"hasAddedEventListener",!1);d(this,"isHiddenByHideFunc",!1);d(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=Oi(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})});d(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")});d(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})});d(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)});d(this,"onFiveModeChange",(...[e,,,,n])=>{e!=="Topview"&&this.state.visible&&(this.updateState({visible:!1},n),this._hide({userAction:n}))});d(this,"onFivePanoArrived",e=>{var n;!((n=this.five)!=null&&n.work)||(this.panoIndex=e,this.floorIndex=this.five.work.observers[e].floorIndex)});d(this,"onFiveCameraUpdate",(e,n)=>{!this.state.visible||(this.updatePosition(),this.updateSize())});d(this,"onFiveWantsGesture",e=>{if(!(e!=="pan"&&e!=="pinch"&&e!=="mouseWheel")&&this.state.visible&&!this.state.config.gestureEnable)return!1});d(this,"onFiveWantsMoveToPano",()=>{if(this.state.visible&&this.state.config.preventRoomClick)return!1});d(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}))});d(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,hoverEnable:!0,compassEnable:!0,gestureEnable:!1,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,cameraImageUrl:vt,attachedTo:gt.BOUNDING_CENTER,getLabelElement:void 0,adaptiveRoomLabelVisibleEnable:!0,getRoomAreaText:a=>(a/1e6).toFixed(1)+"\u33A1",getRuleDistanceText:a=>a.toString()},s=n?Vn(n,["selector","scale"]):{},r={...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()}async load(e,n,o=!0){function s(h){return Object.prototype.hasOwnProperty.apply(h,["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=await bt(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=ji(this.five,this.floorIndex,this.state.config.attachedTo),n=(a=this.five.model)==null?void 0:a.bounding.getCenter(new O.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}async show(e={}){if(this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},n),this._show({userAction:n})}async hide(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()}async formatData(e){return await bt(e.data)}async _show(e){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"&&await Ys(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;Nt(this.five,s,o),this.hooks.emit("showAnimationEnded",{userAction:n,auto:!1}),this.render()}async _hide(e){if(!this.state.enabled)return;const{userAction:n}=e;this.hooks.emit("hide",{userAction:n,auto:!1});const o=1,s=0;Nt(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?{...o.config,...e.config}:o.config;this.state={...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={...this.state.config,visible:this.state.visible,duration:e!=null?e:0,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude};if(this.app)return this.app.$set(n);this.app=new Si({target:this.container,intro:!0,props:n})}}const Qc=(i,t)=>new Xc(i,t);function Ni(i,t=200){let e;return function(...n){e||(i(...n),e=setTimeout(function(){e=null},t))}}function Wc(i){ge(i,"svelte-1ty3s4p",".plugin-radar__camera-wrapper.svelte-1ty3s4p{width:100%;height:100%;position:absolute;pointer-events:none}.plugin-radar__camera-position.svelte-1ty3s4p{position:absolute;left:0;top:0;width:0;height:0;transform:none;pointer-events:none;transition:transform 1s linear}.plugin-radar__camera-rotate.svelte-1ty3s4p{position:absolute;left:-0.78125rem;top:-0.78125rem;width:0.88542rem;height:0.88542rem;transform-origin:0.78125rem 0.78125rem;transform:rotate(45deg);background-repeat:no-repeat;background-size:100%}")}function Yc(i){let t,e,n;return{c(){t=X("div"),e=X("div"),n=X("div"),x(n,"class","plugin-radar__camera-rotate svelte-1ty3s4p"),S(n,"background-image","url("+(i[0]||vt)+")"),S(n,"transform",i[1]),x(e,"class","plugin-radar__camera-position svelte-1ty3s4p"),S(e,"transform",i[2]),x(t,"class","plugin-radar__camera-wrapper svelte-1ty3s4p")},m(o,s){V(o,t,s),Q(t,e),Q(e,n)},p(o,[s]){s&1&&S(n,"background-image","url("+(o[0]||vt)+")"),s&2&&S(n,"transform",o[1]),s&4&&S(e,"transform",o[2])},i:ne,o:ne,d(o){o&&W(t)}}}function Vc(i){return`rotate(${Math.floor(i/Math.PI*180)*-1+45}deg)`}function Zc(i,t,e){let n,o,{five:s}=t,{pxmm:r}=t,{floorplanData:a}=t,{cameraImageUrl:l}=t,c=s.getCurrentState().panoIndex,h=s.getCurrentState().longitude;function f(g,v){const b=g.bounding,y=g.observers[v];if(!y)return"";const I=(b.max.x-b.min.x)*r,P=(b.max.y-b.min.y)*r,k=Math.floor(y.positionInImage.x*I),D=Math.floor(y.positionInImage.y*P);return`translate(${k}px, ${D}px)`}function u(g){e(6,c=g)}const m=Ni(g=>{e(7,h=g.longitude)},1e3/60);return Ct(()=>(s.on("panoWillArrive",u),s.on("cameraDirectionUpdate",m),function(){s.off("panoWillArrive",u),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=f(a,c)),i.$$.dirty&128&&e(1,o=Vc(h))},[l,o,n,s,r,a,c,h]}class Jc extends de{constructor(t){super(),ue(this,t,Zc,Yc,he,{five:3,pxmm:4,floorplanData:5,cameraImageUrl:0},Wc)}}function Uc(i){ge(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 Bo(i,t,e){const n=i.slice();return n[1]=t[e],n}function Ho(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=X("div"),n=X("div"),r=fe(),x(n,"class","plugin-pano-floorplan__extra-object-item svelte-1i87fz7"),S(n,"background-image",`url(${t[1].icon.url})`),S(n,"width",o),S(n,"height",s),x(e,"class","plugin-pano-floorplan__extra-object-item--position svelte-1i87fz7"),S(e,"top",a),S(e,"left",l),this.first=e},m(c,h){V(c,e,h),Q(e,n),Q(e,r)},p(c,h){t=c,h&1&&S(n,"background-image",`url(${t[1].icon.url})`),h&1&&o!==(o=`${t[1].icon.width/16}rem`)&&S(n,"width",o),h&1&&s!==(s=`${t[1].icon.height/16}rem`)&&S(n,"height",s),h&1&&a!==(a=`${t[1].positionInImage.y*100}%`)&&S(e,"top",a),h&1&&l!==(l=`${t[1].positionInImage.x*100}%`)&&S(e,"left",l)},d(c){c&&W(e)}}}function qc(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=Bo(i,o,r),l=s(a);n.set(l,e[r]=Ho(l,a))}return{c(){t=X("div");for(let r=0;r<e.length;r+=1)e[r].c();x(t,"class","plugin-pano-floorplan__extra-objects svelte-1i87fz7")},m(r,a){V(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=At(e,a,s,1,r,o,n,t,Bs,Ho,null,Bo))},i:ne,o:ne,d(r){r&&W(t);for(let a=0;a<e.length;a+=1)e[a].d()}}}function Kc(i,t,e){let{extraObjects:n=[]}=t;return i.$$set=o=>{"extraObjects"in o&&e(0,n=o.extraObjects)},[n]}class _c extends de{constructor(t){super(),ue(this,t,Kc,qc,he,{extraObjects:0},Uc)}}function Fo(i){let t,e;const n=[{five:i[0],pxmm:i[1],floorIndex:i[2],floorplanData:i[4],onRoomHeightClick:i[6]}];let o={};for(let s=0;s<n.length;s+=1)o=Fe(o,n[s]);return t=new Xs({props:o}),{c(){Pe(t.$$.fragment)},m(s,r){ve(t,s,r),e=!0},p(s,r){const a=r&87?Xe(n,[{five:s[0],pxmm:s[1],floorIndex:s[2],floorplanData:s[4],onRoomHeightClick:s[6]}]):{};t.$set(a)},i(s){e||(G(t.$$.fragment,s),e=!0)},o(s){K(t.$$.fragment,s),e=!1},d(s){be(t,s)}}}function $c(i){let t,e,n,o,s,r;const a=[{floorIndex:i[2],floorplanData:i[4]}];let l={};for(let h=0;h<a.length;h+=1)l=Fe(l,a[h]);t=new Fs({props:l}),n=new _c({props:{extraObjects:i[5]}});let c=i[3]&&Fo(i);return{c(){Pe(t.$$.fragment),e=fe(),Pe(n.$$.fragment),o=fe(),c&&c.c(),s=Ge()},m(h,f){ve(t,h,f),V(h,e,f),ve(n,h,f),V(h,o,f),c&&c.m(h,f),V(h,s,f),r=!0},p(h,[f]){const u=f&20?Xe(a,[{floorIndex:h[2],floorplanData:h[4]}]):{};t.$set(u);const m={};f&32&&(m.extraObjects=h[5]),n.$set(m),h[3]?c?(c.p(h,f),f&8&&G(c,1)):(c=Fo(h),c.c(),G(c,1),c.m(s.parentNode,s)):c&&(Ie(),K(c,1,1,()=>{c=null}),xe())},i(h){r||(G(t.$$.fragment,h),G(n.$$.fragment,h),G(c),r=!0)},o(h){K(t.$$.fragment,h),K(n.$$.fragment,h),K(c),r=!1},d(h){be(t,h),h&&W(e),be(n,h),h&&W(o),c&&c.d(h),h&&W(s)}}}function eh(i,t,e){let n,{five:o}=t,{pxmm:s}=t,{floorIndex:r}=t,{hoverEnable:a}=t,{floorplanData:l}=t,{extraObjects:c=[]}=t;const h=void 0;return i.$$set=f=>{"five"in f&&e(0,o=f.five),"pxmm"in f&&e(1,s=f.pxmm),"floorIndex"in f&&e(2,r=f.floorIndex),"hoverEnable"in f&&e(3,a=f.hoverEnable),"floorplanData"in f&&e(4,l=f.floorplanData),"extraObjects"in f&&e(7,c=f.extraObjects)},i.$$.update=()=>{i.$$.dirty&132&&e(5,n=c==null?void 0:c.filter(f=>f.floorIndex===r))},[o,s,r,a,l,n,h,c]}class th extends de{constructor(t){super(),ue(this,t,eh,$c,he,{five:0,pxmm:1,floorIndex:2,hoverEnable:3,floorplanData:4,extraObjects:7})}}function nh(i){ge(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 Go(i){let t,e,n,o=i[6]!==0&&Xo(i);return{c(){t=X("div"),o&&o.c(),x(t,"class","plugin-floorplan-radar svelte-1mvqyqq"),Ke(()=>i[12].call(t))},m(s,r){V(s,t,r),o&&o.m(t,null),e=Ft(t,i[12].bind(t)),n=!0},p(s,r){s[6]!==0?o?(o.p(s,r),r&64&&G(o,1)):(o=Xo(s),o.c(),G(o,1),o.m(t,null)):o&&(Ie(),K(o,1,1,()=>{o=null}),xe())},i(s){n||(G(o),n=!0)},o(s){K(o),n=!1},d(s){s&&W(t),o&&o.d(),e()}}}function Xo(i){let t,e,n,o,s=`${i[8]}px`,r=`${i[11]}px`,a;const l=[{five:i[0],pxmm:i[9],floorIndex:i[10],floorplanData:i[3],hoverEnable:i[2],extraObjects:i[5]}];let c={};for(let u=0;u<l.length;u+=1)c=Fe(c,l[u]);e=new th({props:c});const h=[{pxmm:i[9],five:i[0],floorplanData:i[3],cameraImageUrl:i[4]}];let f={};for(let u=0;u<h.length;u+=1)f=Fe(f,h[u]);return o=new Jc({props:f}),{c(){t=X("div"),Pe(e.$$.fragment),n=fe(),Pe(o.$$.fragment),x(t,"class","plugin-floorplan-radar-container svelte-1mvqyqq"),S(t,"width",s),S(t,"height",r)},m(u,m){V(u,t,m),ve(e,t,null),Q(t,n),ve(o,t,null),a=!0},p(u,m){const g=m&1581?Xe(l,[{five:u[0],pxmm:u[9],floorIndex:u[10],floorplanData:u[3],hoverEnable:u[2],extraObjects:u[5]}]):{};e.$set(g);const v=m&537?Xe(h,[{pxmm:u[9],five:u[0],floorplanData:u[3],cameraImageUrl:u[4]}]):{};o.$set(v),m&256&&s!==(s=`${u[8]}px`)&&S(t,"width",s),m&2048&&r!==(r=`${u[11]}px`)&&S(t,"height",r)},i(u){a||(G(e.$$.fragment,u),G(o.$$.fragment,u),a=!0)},o(u){K(e.$$.fragment,u),K(o.$$.fragment,u),a=!1},d(u){u&&W(t),be(e),be(o)}}}function ih(i){let t,e,n=i[1]&&Go(i);return{c(){n&&n.c(),t=Ge()},m(o,s){n&&n.m(o,s),V(o,t,s),e=!0},p(o,[s]){o[1]?n?(n.p(o,s),s&2&&G(n,1)):(n=Go(o),n.c(),G(n,1),n.m(t.parentNode,t)):n&&(Ie(),K(n,1,1,()=>{n=null}),xe())},i(o){e||(G(n),e=!0)},o(o){K(n),e=!1},d(o){n&&n.d(o),o&&W(t)}}}function oh(i,t,e){let{five:n}=t,{visible:o}=t,{hoverEnable:s}=t,{floorplanData:r}=t,{cameraImageUrl:a}=t,{extraObjects:l=[]}=t,c=0,h=0,f=0,u=0,m=0,g=0;function v(y){e(10,h=n.work.observers[y].floorIndex)}Ct(()=>(n.on("panoArrived",v),()=>{n.off("panoArrived",v)}));function b(){f=this.clientWidth,u=this.clientHeight,e(6,f),e(7,u)}return i.$$set=y=>{"five"in y&&e(0,n=y.five),"visible"in y&&e(1,o=y.visible),"hoverEnable"in y&&e(2,s=y.hoverEnable),"floorplanData"in y&&e(3,r=y.floorplanData),"cameraImageUrl"in y&&e(4,a=y.cameraImageUrl),"extraObjects"in y&&e(5,l=y.extraObjects)},i.$$.update=()=>{if(i.$$.dirty&456){const y=Math.min(f,u),{max:I,min:P}=r.bounding,k=I.x-P.x,D=I.y-P.y,E=function(){return k>D?[y,y/k*D]:[y/D*k,y]}();e(8,m=E[0]),e(11,g=E[1]),e(9,c=m/k)}},[n,o,s,r,a,l,f,u,m,c,h,g,b]}class sh extends de{constructor(t){super(),ue(this,t,oh,ih,he,{five:0,visible:1,hoverEnable:2,floorplanData:3,cameraImageUrl:4,extraObjects:5},nh)}}class rh extends Lt{constructor(e,n){super(e);d(this,"name","panoFloorplanRadarPlugin");d(this,"state");d(this,"data");d(this,"app");d(this,"wrapperSelector","");d(this,"wrapper",null);d(this,"disposed",!1);d(this,"extraObjects",[]);d(this,"dispose",()=>{var e;this.disposed=!0,(e=this.app)==null||e.$destroy(),this.wrapper=null,this.wrapperSelector="",this.hooks.emit("dispose")});d(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:!1,cameraImageUrl:vt},s=n!=null&&n.configs?n.configs:{},r={...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)}async load(e,n,o=!0){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=await bt(a),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,l),n&&this.updateState(n,o),this.render()}async show(e={}){if(this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},n),this._show({userAction:n})}async hide(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=zc(e,this.five,this.data),this.render())}async formatData(e){return await bt(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={...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={...this.state.config,five:this.five,floorplanData:this.data,visible:this.state.visible,extraObjects:this.extraObjects};this.app?this.app.$set(e):this.app=new sh({target:this.wrapper,props:e})}}const ah=(i,t)=>new rh(i,t),lh=[{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"}],ch=[{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"}],hh=[{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"}],ui=(i,t,e)=>{const n=new O.Matrix4,o=new O.Euler(i,t,e,"YXZ");return n.makeRotationFromEuler(o),n},uh=(i,{scale:t,rotation:e,position:n})=>{if(t&&i.scale.set(t,t,t),e){const[o,s,r]=e;o&&i.applyMatrix4(ui(o,0,0)),s&&i.applyMatrix4(ui(0,s,0)),r&&i.applyMatrix4(ui(0,0,r))}return n&&i.position.set(n.x,n.y,n.z),i};function Zs(i,t){i.traverse(e=>{var n;if(e.type==="Mesh"){const o=e,s={map:o.material.map||{},...t};o.material=new M.MeshBasicMaterial(s),o.renderOrder=1,((n=e.parent)==null?void 0:n.type)==="Mesh"&&(e.renderOrder=e.parent.renderOrder+1)}})}const dh=(i,t)=>{var h;const e=t.fbx_url||"//vrlab-static.ljcdn.com/release/web/v3/dipan3/dipan.FBX",n=(h=t.north_rad)!=null?h:void 0,o={},s=async f=>{var $;const u=(f==null?void 0:f.fbx_url)||e,m=($=f==null?void 0:f.north_rad)!=null?$: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,v=g.max.x-g.min.x,b=g.max.z-g.min.z,y=Math.max(v,b),P=await new Ls.FBXLoader().loadAsync(u);Zs(P,{transparent:!0,side:O.DoubleSide,blending:O.AdditiveBlending});const k=[0,m-Math.PI/2,0],{model:{bounding:{max:{x:D,z:E},min:{x:T,y:C,z}}}}=i;o.yBase=C;const B={x:(D+T)/2,y:C-1.6,z:(E+z)/2},F=.0045*y;return uh(P,{position:B,rotation:k,scale:F}),o.object=P,!0},r=({latitude:f})=>{if(!o.object)return;const u=a(f);u&&(o.object.position.y=u)},a=f=>{if(o.yBase===void 0)return;const u=.6;if(f>=Math.PI/4)return o.yBase-(u+1.6);const m=f*(4/Math.PI);return o.yBase-(u*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 f=a(i.getPose().latitude);f&&(o.object.position.y=f),i.scene.add(o.object),i.needsRender=!0,i.on("cameraDirectionUpdate",r)}}};function fh(i,t){var c,h,f,u,m;const e=(c=t==null?void 0:t.size)!=null?c:512,n=(h=t==null?void 0:t.fontSize)!=null?h:e*(35/256)*1.2,o=(f=t==null?void 0:t.backgroundColor)!=null?f:"rgba(0,0,0,0)",s=(u=t==null?void 0:t.fontColor)!=null?u:"#fff",r=(m=t==null?void 0:t.textAlign)!=null?m:"center",a=document.createElement("canvas");a.setAttribute("width",e+""),a.setAttribute("height",e+"");const l=a.getContext("2d");return l.fillStyle=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 M.CanvasTexture(a)}const mh=({x:i,y:t,z:e})=>new M.Vector3(i,t,e),ph=(i,t)=>{var v,b,y;const e={},n=(v=t.animationEnabled)!=null?v:!0,o=(b=t.position)!=null?b:void 0,s=(y=t.rad)!=null?y:void 0,r=t.fbx_url||"//vrlab-image4.ljcdn.com/release/web/entryDoorMini/Anim_Door1.fbx",a=[],l=async I=>{var z,B,F,$,j,R,H;const P=(z=I==null?void 0:I.position)!=null?z:o;if(!P)return Promise.reject("ModelEntryDoorGuidePlugin.load(): position is undefined");const k=mh(P),D=(B=I==null?void 0:I.rad)!=null?B:s,E=(F=I==null?void 0:I.fbx_url)!=null?F:r;if(e.rad=D,D===void 0)return Promise.reject(`ModelEntryDoorGuidePlugin.load(): rad is ${D}`);const T=await new Ls.FBXLoader().loadAsync(E);T.position.copy(k),T.rotation.z=D,T.scale.set(.8,.8,.8),Zs(T,{transparent:!0,side:O.DoubleSide});const C=(H=(R=(j=($=T.children)==null?void 0:$[0])==null?void 0:j.children)==null?void 0:R[3])==null?void 0:H.clone();return C?(C.material=new M.MeshBasicMaterial({transparent:!0,map:fh("\u5165\u6237\u95E8")}),C.renderOrder=3,T.children[0].add(C),e.object=T,!0):Promise.reject(`ModelEntryDoorGuidePlugin.load(): textMesh is ${C}`)},c=()=>{if(e.animation)return;if(!e.object)return console.error("ModelEntryDoorGuidePlugin.initAnimation(): state.object is ",e.object);const I=1,P=new M.AnimationMixer(e.object);a.push(P);const k=P.clipAction(e.object.animations[0]);k.timeScale=I;let D;const E=()=>{let B=0,F=0;const $=1e3/30,j=R=>{B=requestAnimationFrame(j);const H=R-F;H<$||(F=R,a.forEach(_=>_.update(H/1e3)),i.needsRender=!0)};return B=requestAnimationFrame(j),()=>{cancelAnimationFrame(B)}},z={play:()=>{D||(k.play(),D=E(),requestAnimationFrame(()=>{e.object&&e.object.rotation.z!==e.rad&&(e.object.rotation.z=e.rad)}))},stop:()=>{k.stop(),D==null||D(),D=void 0}};e.animation=z},h=I=>{var k;if(!e.object)return console.error("ModelEntryDoorGuidePlugin.enable(): object is ",e.object);((k=I==null?void 0:I.animationEnable)!=null?k:n)&&(e.animation||c(),e.animation.play()),i.scene.add(e.object),i.needsRender=!0},f=()=>{!e.object||(e.animation&&e.animation.stop(),i.scene.remove(e.object),i.needsRender=!0)},u=I=>I==="Floorplan"?h():f();return{load:l,enable:I=>(e.enabled||(e.enabled=!0,u(i.currentMode),i.on("modeChange",u),h(I)),!0),disable:()=>(e.enabled&&(e.enabled=!1,f(),i.off("modeChange",u)),!0)}},Hn=window.requestAnimationFrame||(i=>setTimeout(i,16)),gh=window.cancelAnimationFrame||clearTimeout;function Bi(i,t=0){t<=0?Hn(i):Hn(()=>Bi(i,t-1))}function Hi(i,t=60){let e=-1,n=0,o=-1;const s=1e3/t;function r(a){o===-1&&(o=a),e=Hn(r),!(a-n<s)&&(n=a,i&&i(a-o))}return e=Hn(r),function(){gh(e)}}const vh=Li.Easing;function bh(i,t,e,n=vh.Linear.None){const o=new Li.Tween(i).to(t,e).easing(n);Bi(()=>o.start(0));const s=Hi(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 Ah(i,t){return bh({progress:0},{progress:1},i,t)}var Js=(i=>(i.Move="Move",i.Rotate="Rotate",i))(Js||{}),et=(i=>(i.Clockwise="Clockwise",i.Anticlockwise="Anticlockwise",i.Loop="Loop",i))(et||{});const Sn=Math.PI*2;function Qo(i){return(i%Sn+Sn)%Sn}function Wo(i){return i%Sn}function di(i,t,e){return i+(t-i)*e}const wi=(i,t,e)=>{const n=Math.PI,o=n*2;return i=Qo(i),t=Qo(t),e===et.Anticlockwise&&i<t&&(i+=o),e===et.Clockwise&&t<i&&(t+=o),e===et.Loop&&t-i>n?wi(i,t,et.Anticlockwise):e===et.Loop&&i-t>n?wi(i,t,et.Clockwise):{from:i,to:t}},yh=i=>{const t={},e=async(s,r,a={preload:!0})=>(t.interruptCallback&&t.interruptCallback(!1),a.asyncStartCallback&&await a.asyncStartCallback(),s.mode&&s.mode!==i.currentMode&&await i.changeMode(s.mode),a.preload&&s.panoIndex!==void 0&&s.panoIndex!==i.panoIndex&&await i.preloadPano(s.panoIndex),a.asyncEndCallback&&await a.asyncEndCallback(),s.panoIndex===void 0&&s.fov===void 0&&s.latitude===void 0&&s.longitude===void 0?!0:await new Promise((l,c)=>{const h=s.panoIndex!==void 0?s.panoIndex:i.panoIndex;h!==void 0?i.moveToPano(h,Object.assign({duration:r,moveEndCallback:()=>l(!0),moveCancelCallback:()=>c(!1)},s)):c(!1)})),n=s=>{const r=i.state,a=Wo(r.latitude),l=Wo(s.latitude),{from:c,to:h}=wi(r.longitude,s.longitude,s.rotation||et.Loop),f=r.fov,u=s.fov;return{from:{latitude:a,longitude:c,fov:f},to:{latitude:l,longitude:h,fov:u}}};return{move:e,rotate:async(s,r,a={})=>{t.interruptCallback&&t.interruptCallback(!1),a.asyncStartCallback&&await a.asyncStartCallback(),i.currentMode!==ye.Five.Mode.Panorama&&await i.changeMode(ye.Five.Mode.Panorama),s.panoIndex!==void 0&&s.panoIndex!==i.panoIndex&&(a.preload&&await i.preloadPano(s.panoIndex),await new Promise((h,f)=>{if(!s.panoIndex){h(!0);return}i.moveToPano(s.panoIndex,{moveEndCallback:()=>h(!0),moveCancelCallback:()=>f(!1)})})),a.asyncEndCallback&&await a.asyncEndCallback();const{from:l,to:c}=n(s);return await new Promise(h=>{const f=({progress:b})=>{const y={};y.longitude=di(l.longitude,c.longitude,b),y.latitude=di(l.latitude,c.latitude,b),y.fov=di(l.fov,c.fov,b),i.setState(y,!0)},u=()=>{h(!0)},m=()=>{h(!1)},g=s.rotateSpeed?Math.ceil(Math.abs(c.longitude-l.longitude)/s.rotateSpeed*1e3):r,v=Ah(g,Li.Easing.Linear.None).onUpdate(f).onComplete(u).onDestroy(m);s.rotation===et.Loop&&v.repeat(1/0).yoyo(!0),t.interruptCallback=(b=!0)=>{v.destroy(),t.interruptCallback=void 0,t.timeoutId&&(clearTimeout(t.timeoutId),t.timeoutId=void 0),h(b)},t.timeoutId=setTimeout(()=>{t.interruptCallback&&t.interruptCallback(!0)},r)})}}};function Yo(i,t){return i.x===t.x&&i.y===t.y}function Us(i,t){return Math.abs(i)===1/0&&Math.abs(t)===1/0?!0:Math.abs(i-t)<.001}function Fn(i,t){return(t.y-i.y)/(t.x-i.x)}function qs(i,t,e){const n=Fn(i[1],i[0]),o=Fn(t[1],t[0]);if(isNaN(n)||isNaN(o)||Us(n,o))return!1;if(Pn(i[0],t))return i[0];if(Pn(i[1],t))return i[1];if(Pn(t[0],i))return t[0];if(Pn(t[1],i))return t[1];if(e&&!Ph(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 Pn(i,t){return Yo(i,t[0])||Yo(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&&Us(Fn(t[0],i),Fn(i,t[1]))}function wn(i,t,e){return(i.x-e.x)*(t.y-e.y)-(t.x-e.x)*(i.y-e.y)}function Ph(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)&&wn(t[0],i[1],i[0])*wn(i[1],t[1],i[0])>0&&wn(i[0],t[1],t[0])*wn(t[1],i[1],t[0])>0?1:0}function Ks(i,t=0){t<=0?requestAnimationFrame(i):requestAnimationFrame(()=>Ks(i,t-1))}const wh=`<style type="text/css">
|
|
113
|
+
`;return i.$$set=s=>{"content"in s&&e(0,n=s.content)},[n,o]}class Pl extends de{constructor(t){super(),ue(this,t,yl,Al,he,{content:0},bl)}}function wl(i){ge(i,"svelte-ozpg4a",".floorplan-plugin__base-image.svelte-ozpg4a{position:absolute;z-index:10;width:100%;height:100%;pointer-events:none}")}function El(i){let t,e;return t=new vl({props:{url:i[1].url}}),{c(){Pe(t.$$.fragment)},m(n,o){ve(t,n,o),e=!0},p(n,o){const s={};o&2&&(s.url=n[1].url),t.$set(s)},i(n){e||(G(t.$$.fragment,n),e=!0)},o(n){K(t.$$.fragment,n),e=!1},d(n){be(t,n)}}}function Il(i){let t,e;return t=new Pl({props:{content:i[0]}}),{c(){Pe(t.$$.fragment)},m(n,o){ve(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.content=n[0]),t.$set(s)},i(n){e||(G(t.$$.fragment,n),e=!0)},o(n){K(t.$$.fragment,n),e=!1},d(n){be(t,n)}}}function xl(i){let t,e,n,o;const s=[Il,El],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=X("div"),n&&n.c(),x(t,"class","floorplan-plugin__base-image svelte-ozpg4a")},m(l,c){V(l,t,c),~e&&r[e].m(t,null),o=!0},p(l,[c]){let h=e;e=a(l),e===h?~e&&r[e].p(l,c):(n&&(Ie(),K(r[h],1,1,()=>{r[h]=null}),xe()),~e?(n=r[e],n?n.p(l,c):(n=r[e]=s[e](l),n.c()),G(n,1),n.m(t,null)):n=null)},i(l){o||(G(n),o=!0)},o(l){K(n),o=!1},d(l){l&&W(t),~e&&r[e].d()}}}function Cl(i,t,e){let n,o;var s,r;let{floorIndex:a}=t,{floorplanData:l}=t;return i.$$set=c=>{"floorIndex"in c&&e(2,a=c.floorIndex),"floorplanData"in c&&e(3,l=c.floorplanData)},i.$$.update=()=>{i.$$.dirty&12&&e(1,n=l.outlines[a]),i.$$.dirty&60&&e(0,o=e(5,r=e(4,s=l.outlines)===null||s===void 0?void 0:s[a])===null||r===void 0?void 0:r.svgContent)},[o,n,a,l,s,r]}class Fs extends de{constructor(t){super(),ue(this,t,Cl,xl,he,{floorIndex:2,floorplanData:3},wl)}}function Ll(i){ge(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 kl(i){let t,e=i[4].outerHTML+"",n;return{c(){t=new Ai(!1),n=Ge(),t.a=n},m(o,s){t.m(e,o,s),V(o,n,s)},p(o,s){s&16&&e!==(e=o[4].outerHTML+"")&&t.p(e)},d(o){o&&W(n),o&&t.d()}}}function Tl(i){let t,e=i[0].name+"",n,o,s,r;return{c(){t=X("span"),n=Ue(e),o=fe(),s=X("span"),r=Ue(i[5]),x(t,"class","floorplan-plugin__room-name"),x(s,"class","floorplan-plugin__room-size svelte-12pzct5")},m(a,l){V(a,t,l),Q(t,n),V(a,o,l),V(a,s,l),Q(s,r)},p(a,l){l&1&&e!==(e=a[0].name+"")&&dt(n,e),l&32&&dt(r,a[5])},d(a){a&&W(t),a&&W(o),a&&W(s)}}}function Dl(i){let t;function e(s,r){if(s[1]===void 0)return Tl;if(s[4])return kl}let n=e(i),o=n&&n(i);return{c(){t=X("div"),o&&o.c(),x(t,"class","floorplan-plugin__room-label-item svelte-12pzct5"),S(t,"left",i[6]),S(t,"top",i[7]),S(t,"font-size",i[8]),S(t,"opacity",i[3]?"1":"0")},m(s,r){V(s,t,r),o&&o.m(t,null),i[16](t)},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))),r&8&&S(t,"opacity",s[3]?"1":"0")},i:ne,o:ne,d(s){s&&W(t),o&&o.d(),i[16](null)}}}function zl(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],h=t[r][1];l>n!=h>n&&e<(c-a)*(n-l)/(h-l)+a&&(o=!o)}return o}function Ml(i,t,e){let n,o,s,r,{pxmm:a}=t,{room:l}=t,{hoveredRoom:c}=t,{getRoomAreaText:h}=t,{getLabelElement:f}=t,{adaptiveRoomLabelVisibleEnable:u}=t;function m(C,z){if(z.width===0||z.height===0)return()=>!1;const B=C.path.map(({x:te,y:Y})=>[te,Y]),F=C.roomLabel.position,{x:$,y:j}=F,{width:R,height:H}=z,_=R/2,U=H/2;return function(Y){const ee=$*Y,se=j*Y,ie=B.map(([Ae,Ce])=>[Ae*Y,Ce*Y]);return[[ee+_,se-U],[ee-_,se-U],[ee-_,se+U],[ee+_,se+U]].every(Ae=>zl(Ae,ie))}}const g=document.body.clientWidth,v=document.body.clientHeight,b=l.roomLabel,y=b.positionInImage.x*100+"%",I=b.positionInImage.y*100+"%",P=(g<500||v<500?10:14)/16+"rem";let L=!1,D,E;c.subscribe(function(z){e(13,L=!!z&&z.id===l.id)}),Ct(()=>{const C=D==null?void 0:D.getClientRects()[0];e(14,E={width:C.width,height:C.height})});function T(C){Rt[C?"unshift":"push"](()=>{D=C,e(2,D)})}return i.$$set=C=>{"pxmm"in C&&e(9,a=C.pxmm),"room"in C&&e(0,l=C.room),"hoveredRoom"in C&&e(10,c=C.hoveredRoom),"getRoomAreaText"in C&&e(11,h=C.getRoomAreaText),"getLabelElement"in C&&e(1,f=C.getLabelElement),"adaptiveRoomLabelVisibleEnable"in C&&e(12,u=C.adaptiveRoomLabelVisibleEnable)},i.$$.update=()=>{i.$$.dirty&2049&&e(5,n=l.size?h(l.size):""),i.$$.dirty&16385&&e(15,o=E?m(l,E):void 0),i.$$.dirty&3&&e(4,s=f==null?void 0:f(l)),i.$$.dirty&45568&&e(3,r=u?L?!0:!!(o!=null&&o(a)):!0)},[l,f,D,r,s,n,y,I,P,a,c,h,u,L,E,o,T]}class Sl extends de{constructor(t){super(),ue(this,t,Ml,Dl,he,{pxmm:9,room:0,hoveredRoom:10,getRoomAreaText:11,getLabelElement:1,adaptiveRoomLabelVisibleEnable:12},Ll)}}function jl(i){ge(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 po(i,t,e){const n=i.slice();return n[10]=t[e],n}function go(i){let t,e=[],n=new Map,o,s,r=i[6];const a=l=>l[10].id;for(let l=0;l<r.length;l+=1){let c=po(i,r,l),h=a(c);n.set(h,e[l]=vo(h,c))}return{c(){t=X("div");for(let l=0;l<e.length;l+=1)e[l].c();x(t,"class","floorplan-plugin__room-labels svelte-13xux0b"),Ke(()=>i[9].call(t))},m(l,c){V(l,t,c);for(let h=0;h<e.length;h+=1)e[h].m(t,null);o=Ft(t,i[9].bind(t)),s=!0},p(l,c){c&111&&(r=l[6],Ie(),e=At(e,c,a,1,l,r,n,t,Gt,vo,null,po),xe())},i(l){if(!s){for(let c=0;c<r.length;c+=1)G(e[c]);s=!0}},o(l){for(let c=0;c<e.length;c+=1)K(e[c]);s=!1},d(l){l&&W(t);for(let c=0;c<e.length;c+=1)e[c].d();o()}}}function vo(i,t){let e,n,o;const s=[{pxmm:t[5],room:t[10],getLabelElement:t[2],getRoomAreaText:t[1],hoveredRoom:t[0],adaptiveRoomLabelVisibleEnable:t[3]}];let r={};for(let a=0;a<s.length;a+=1)r=Fe(r,s[a]);return n=new Sl({props:r}),{key:i,first:null,c(){e=Ge(),Pe(n.$$.fragment),this.first=e},m(a,l){V(a,e,l),ve(n,a,l),o=!0},p(a,l){t=a;const c=l&111?Xe(s,[{pxmm:t[5],room:t[10],getLabelElement:t[2],getRoomAreaText:t[1],hoveredRoom:t[0],adaptiveRoomLabelVisibleEnable:t[3]}]):{};n.$set(c)},i(a){o||(G(n.$$.fragment,a),o=!0)},o(a){K(n.$$.fragment,a),o=!1},d(a){a&&W(e),be(n,a)}}}function Ol(i){let t,e,n=i[6]&&go(i);return{c(){n&&n.c(),t=Ge()},m(o,s){n&&n.m(o,s),V(o,t,s),e=!0},p(o,[s]){o[6]?n?(n.p(o,s),s&64&&G(n,1)):(n=go(o),n.c(),G(n,1),n.m(t.parentNode,t)):n&&(Ie(),K(n,1,1,()=>{n=null}),xe())},i(o){e||(G(n),e=!0)},o(o){K(n),e=!1},d(o){n&&n.d(o),o&&W(t)}}}function Rl(i,t,e){let n,{floorIndex:o}=t,{floorplanData:s}=t,{hoveredRoom:r}=t,{getRoomAreaText:a}=t,{getLabelElement:l}=t,{adaptiveRoomLabelVisibleEnable:c}=t,h=0,f=0;function u(){h=this.clientWidth,e(4,h)}return i.$$set=m=>{"floorIndex"in m&&e(7,o=m.floorIndex),"floorplanData"in m&&e(8,s=m.floorplanData),"hoveredRoom"in m&&e(0,r=m.hoveredRoom),"getRoomAreaText"in m&&e(1,a=m.getRoomAreaText),"getLabelElement"in m&&e(2,l=m.getLabelElement),"adaptiveRoomLabelVisibleEnable"in m&&e(3,c=m.adaptiveRoomLabelVisibleEnable)},i.$$.update=()=>{if(i.$$.dirty&384&&e(6,n=s.floorDatas[o].rooms),i.$$.dirty&272){const{max:m,min:g}=s.bounding,v=m.x-g.x;e(5,f=h/v)}},[r,a,l,c,h,f,n,o,s,u]}class Nl extends de{constructor(t){super(),ue(this,t,Rl,Ol,he,{floorIndex:7,floorplanData:8,hoveredRoom:0,getRoomAreaText:1,getLabelElement:2,adaptiveRoomLabelVisibleEnable:3},jl)}}function Bl(i){ge(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 bo(i,t,e){const n=i.slice();return n[11]=t[e],n[13]=e,n}function Ao(i,t,e){const n=i.slice();return n[14]=t[e],n}function yo(i){let t;return{c(){t=X("div"),x(t,"class","floorplan-plugin__rule-scale svelte-djlmk4"),S(t,"left",i[14].left*100+"%"),S(t,"bottom",i[14].bottom*100+"%")},m(e,n){V(e,t,n)},p:ne,d(e){e&&W(t)}}}function Po(i,t){let e,n,o=t[1](t[11].distance)+"",s,r;return{key:i,first:null,c(){e=X("div"),n=X("div"),s=Ue(o),r=fe(),x(n,"class","floorplan-plugin__rule-text svelte-djlmk4"),Se(n,"is-row",t[2]),x(e,"class","floorplan-plugin__rule-text-item svelte-djlmk4"),S(e,"left",t[11].left*100+"%"),S(e,"bottom",t[11].bottom*100+"%"),this.first=e},m(a,l){V(a,e,l),Q(e,n),Q(n,s),Q(e,r)},p(a,l){t=a,l&2&&o!==(o=t[1](t[11].distance)+"")&&dt(s,o)},d(a){a&&W(e)}}}function Hl(i){let t,e,n,o,s,r,a=[],l=new Map,c,h=i[3],f=[];for(let g=0;g<h.length;g+=1)f[g]=yo(Ao(i,h,g));let u=i[4];const m=g=>g[13];for(let g=0;g<u.length;g+=1){let v=bo(i,u,g),b=m(v);l.set(b,a[g]=Po(b,v))}return{c(){t=X("div"),e=X("div"),n=fe(),o=X("div");for(let g=0;g<f.length;g+=1)f[g].c();s=fe(),r=X("div");for(let g=0;g<a.length;g+=1)a[g].c();x(e,"class","floorplan-plugin__rule-line svelte-djlmk4"),x(o,"class","floorplan-plugin__rule-scale-wrapper svelte-djlmk4"),Se(o,"is-row",i[2]),x(r,"class","floorplan-plugin__rule-text-wrapper svelte-djlmk4"),x(t,"class",c="floorplan-plugin__rule-labels floorplan-plugin__rule-labels--"+i[0]+" svelte-djlmk4"),Se(t,"is-row",i[2]),S(t,"width",i[2]?"100%":1/16+"rem"),S(t,"height",i[2]?1/16+"rem":"100%")},m(g,v){V(g,t,v),Q(t,e),Q(t,n),Q(t,o);for(let b=0;b<f.length;b+=1)f[b].m(o,null);Q(t,s),Q(t,r);for(let b=0;b<a.length;b+=1)a[b].m(r,null)},p(g,[v]){if(v&8){h=g[3];let b;for(b=0;b<h.length;b+=1){const y=Ao(g,h,b);f[b]?f[b].p(y,v):(f[b]=yo(y),f[b].c(),f[b].m(o,null))}for(;b<f.length;b+=1)f[b].d(1);f.length=h.length}v&22&&(u=g[4],a=At(a,v,m,1,g,u,l,r,Bs,Po,null,bo)),v&1&&c!==(c="floorplan-plugin__rule-labels floorplan-plugin__rule-labels--"+g[0]+" svelte-djlmk4")&&x(t,"class",c),v&5&&Se(t,"is-row",g[2])},i:ne,o:ne,d(g){g&&W(t),Ht(f,g);for(let v=0;v<a.length;v+=1)a[v].d()}}}const Mt=1e3,St=180;function Fl(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-(Mt-St)*2,c=s.max.y-s.min.y-(Mt-St)*2,h=o.map(([g,v])=>a?[g.x,v.x]:[g.y,v.y]).flat().sort().filter((g,v,b)=>v===0?!0:g!==b[v-1]),f=h.map(g=>{const v=a?(g-s.min.x-Mt+St)/l:0,b=a?0:(g-s.min.y-Mt+St)/c;return{left:v,bottom:b}});f.unshift({left:0,bottom:0}),f.push(a?{left:1,bottom:0}:{left:0,bottom:1});const u=h[h.length-1]-h[0],m=h.map((g,v,b)=>{const y=v===0?0:g-b[v-1],I=v===0?0:(g+b[v-1])/2,P=a?(I-s.min.x-Mt+St)/l:0,L=a?0:(I-s.min.y-Mt+St)/c;return{left:P,bottom:L,distance:y}}).filter(({distance:g})=>g/u>.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,f,m,o,s]}class Gl extends de{constructor(t){super(),ue(this,t,Fl,Hl,he,{type:0,data:5,bounding:6,getRuleDistanceText:1},Bl)}}function Xl(i){ge(i,"svelte-1mzj9p3",".floorplan-plugin__rule-labels-wrapper.svelte-1mzj9p3{position:absolute;top:50%;left:50%;transform:translate(-50%, -50%);pointer-events:none}")}function wo(i,t,e){const n=i.slice();return n[13]=t[e][0],n[14]=t[e][1],n}function Eo(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=Fe(r,s[a]);return n=new Gl({props:r}),{key:i,first:null,c(){e=Ge(),Pe(n.$$.fragment),this.first=e},m(a,l){V(a,e,l),ve(n,a,l),o=!0},p(a,l){t=a;const c=l&19?Xe(s,[{type:t[13],data:t[14],bounding:t[1],getRuleDistanceText:t[0]}]):{};n.$set(c)},i(a){o||(G(n.$$.fragment,a),o=!0)},o(a){K(n.$$.fragment,a),o=!1},d(a){a&&W(e),be(n,a)}}}function Ql(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=wo(i,s,a),c=r(l);n.set(c,e[a]=Eo(c,l))}return{c(){t=X("div");for(let a=0;a<e.length;a+=1)e[a].c();x(t,"class","floorplan-plugin__rule-labels-wrapper svelte-1mzj9p3"),S(t,"width",i[3]),S(t,"height",i[2])},m(a,l){V(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],Ie(),e=At(e,l,r,1,a,s,n,t,Gt,Eo,null,wo),xe()),l&8&&S(t,"width",a[3]),l&4&&S(t,"height",a[2])},i(a){if(!o){for(let l=0;l<s.length;l+=1)G(e[l]);o=!0}},o(a){for(let l=0;l<e.length;l+=1)K(e[l]);o=!1},d(a){a&&W(t);for(let l=0;l<e.length;l+=1)e[l].d()}}}const Io=1e3,xo=180;function Wl(i,t,e){let n,o,s,r,a,l,c,h,f,u,{floorIndex:m}=t,{floorplanData:g}=t,{getRuleDistanceText:v}=t;return i.$$set=b=>{"floorIndex"in b&&e(5,m=b.floorIndex),"floorplanData"in b&&e(6,g=b.floorplanData),"getRuleDistanceText"in b&&e(0,v=b.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(b=>[b,o[b]])),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-(Io-xo)*2),i.$$.dirty&2&&e(8,h=n.max.y-n.min.y-(Io-xo)*2),i.$$.dirty&1536&&e(3,f=c/a*100+"%"),i.$$.dirty&384&&e(2,u=h/l*100+"%")},[v,n,u,f,r,m,g,l,h,a,c,o,s]}class Yl extends de{constructor(t){super(),ue(this,t,Wl,Ql,he,{floorIndex:5,floorplanData:6,getRuleDistanceText:0},Xl)}}function Yn(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,h=l+","+c;return a===0?(e+="M"+h,e):o!=null&&o[a]?(e+="A"+o[a]+","+h,e):(e+="L"+h,e)}),e+(n?"Z":"")}function Gs({x:i,y:t},e){const{max:n,min:o}=e;return{x:i-o.x,y:n.y-t}}function Vl(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 Zl(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 Jl(i,t){return Math.max(...t.work.observers.map(n=>i.z>=n.standingPosition.z?n.floorIndex:0))}function Ul(i){let t;return{c(){t=De("path"),x(t,"d",i[0]),x(t,"fill","#2F313A")},m(e,n){V(e,t,n)},p(e,[n]){n&1&&x(t,"d",e[0])},i:ne,o:ne,d(e){e&&W(t)}}}function ql(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=Yn(o,{needZ:!0}))},[n,o]}class Kl extends de{constructor(t){super(),ue(this,t,ql,Ul,he,{path:1})}}function _l(i){let t,e,n,o,s,r;return{c(){t=De("defs"),e=De("pattern"),n=De("rect"),o=De("path"),s=fe(),r=De("path"),x(n,"x","0"),x(n,"y","0"),x(n,"width",i[1]),x(n,"height",i[1]),x(n,"fill","#323747"),x(o,"d",i[2]),x(o,"stroke","#ffffff"),x(o,"stroke-opacity","0.06"),x(o,"stroke-width","0.5"),x(o,"fill","none"),x(e,"id","fpm-room-pattern-0"),x(e,"x","0"),x(e,"y","0"),x(e,"width",i[1]),x(e,"height",i[1]),x(e,"patternUnits","userSpaceOnUse"),x(e,"patternTransform","scale(50 50)"),x(r,"d",i[0]),x(r,"fill","url(#fpm-room-pattern-0)")},m(a,l){V(a,t,l),Q(t,e),Q(e,n),Q(e,o),V(a,s,l),V(a,r,l)},p(a,[l]){l&1&&x(r,"d",a[0])},i:ne,o:ne,d(a){a&&W(t),a&&W(s),a&&W(r)}}}const hi=6;function $l(i,t,e){let n,{path:o}=t;const s=hi*2,r=`M0 ${hi} h ${s} M${hi} 0 v ${s}`;return i.$$set=a=>{"path"in a&&e(3,o=a.path)},i.$$.update=()=>{i.$$.dirty&8&&e(0,n=Yn(o,{needZ:!0}))},[n,s,r,o]}class ec extends de{constructor(t){super(),ue(this,t,$l,_l,he,{path:3})}}function tc(i){let t,e,n,o,s,r,a,l,c,h,f;return{c(){t=De("defs"),e=De("pattern"),n=De("rect"),o=De("pattern"),s=De("rect"),r=fe(),a=De("path"),l=fe(),c=De("path"),h=fe(),f=De("path"),x(n,"x","0"),x(n,"y","0"),x(n,"width","6"),x(n,"height","50"),x(n,"fill","none"),x(n,"stroke","#4B4B57"),x(n,"stroke-width","0.5"),x(e,"id","room-material-pattern-1"),x(e,"x","0"),x(e,"y","0"),x(e,"width","12"),x(e,"height","50"),x(e,"patternUnits","userSpaceOnUse"),x(e,"patternTransform","scale(50 50)"),x(s,"x","0"),x(s,"y","0"),x(s,"width","6"),x(s,"height","50"),x(s,"fill","none"),x(s,"stroke","#4B4B57"),x(s,"stroke-width","0.5"),x(o,"id","room-material-pattern-2"),x(o,"x","6"),x(o,"y","25"),x(o,"width","12"),x(o,"height","50"),x(o,"patternUnits","userSpaceOnUse"),x(o,"patternTransform","scale(50 50)"),x(a,"d",i[0]),x(a,"fill","#43434D"),x(c,"d",i[0]),x(c,"fill","url(#room-material-pattern-1)"),x(f,"d",i[0]),x(f,"fill","url(#room-material-pattern-2)")},m(u,m){V(u,t,m),Q(t,e),Q(e,n),Q(t,o),Q(o,s),V(u,r,m),V(u,a,m),V(u,l,m),V(u,c,m),V(u,h,m),V(u,f,m)},p(u,[m]){m&1&&x(a,"d",u[0]),m&1&&x(c,"d",u[0]),m&1&&x(f,"d",u[0])},i:ne,o:ne,d(u){u&&W(t),u&&W(r),u&&W(a),u&&W(l),u&&W(c),u&&W(h),u&&W(f)}}}function nc(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=Yn(o,{needZ:!0}))},[n,o]}class ic extends de{constructor(t){super(),ue(this,t,nc,tc,he,{path:1})}}function oc(i){ge(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 Co(i,t,e){const n=i.slice();return n[5]=t[e],n}function sc(i){let t,e;return t=new ec({props:{path:i[5].path}}),{c(){Pe(t.$$.fragment)},m(n,o){ve(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.path=n[5].path),t.$set(s)},i(n){e||(G(t.$$.fragment,n),e=!0)},o(n){K(t.$$.fragment,n),e=!1},d(n){be(t,n)}}}function rc(i){let t,e;return t=new ic({props:{path:i[5].path}}),{c(){Pe(t.$$.fragment)},m(n,o){ve(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.path=n[5].path),t.$set(s)},i(n){e||(G(t.$$.fragment,n),e=!0)},o(n){K(t.$$.fragment,n),e=!1},d(n){be(t,n)}}}function ac(i){let t,e;return t=new Kl({props:{path:i[5].path}}),{c(){Pe(t.$$.fragment)},m(n,o){ve(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.path=n[5].path),t.$set(s)},i(n){e||(G(t.$$.fragment,n),e=!0)},o(n){K(t.$$.fragment,n),e=!1},d(n){be(t,n)}}}function Lo(i){let t,e,n,o;const s=[ac,rc,sc],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=De("svg"),n.c(),x(t,"width","100%"),x(t,"height","100%"),x(t,"viewBox",`0 0 ${i[1]} ${i[2]}`),x(t,"class","svelte-1dykexu")},m(l,c){V(l,t,c),r[e].m(t,null),o=!0},p(l,c){let h=e;e=a(l),e===h?r[e].p(l,c):(Ie(),K(r[h],1,1,()=>{r[h]=null}),xe(),n=r[e],n?n.p(l,c):(n=r[e]=s[e](l),n.c()),G(n,1),n.m(t,null))},i(l){o||(G(n),o=!0)},o(l){K(n),o=!1},d(l){l&&W(t),r[e].d()}}}function lc(i){let t,e,n=i[0],o=[];for(let r=0;r<n.length;r+=1)o[r]=Lo(Co(i,n,r));const s=r=>K(o[r],1,1,()=>{o[r]=null});return{c(){t=X("div");for(let r=0;r<o.length;r+=1)o[r].c();x(t,"class","floorplan-plugin__room-material svelte-1dykexu")},m(r,a){V(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=Co(r,n,l);o[l]?(o[l].p(c,a),G(o[l],1)):(o[l]=Lo(c),o[l].c(),G(o[l],1),o[l].m(t,null))}for(Ie(),l=n.length;l<o.length;l+=1)s(l);xe()}},i(r){if(!e){for(let a=0;a<n.length;a+=1)G(o[a]);e=!0}},o(r){o=o.filter(Boolean);for(let a=0;a<o.length;a+=1)K(o[a]);e=!1},d(r){r&&W(t),Ht(o,r)}}}function cc(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=>Object.assign(Object.assign({},l),{path:l.path.map(c=>Gs(c,s.bounding))})))},[n,r,a,o,s]}class hc extends de{constructor(t){super(),ue(this,t,cc,lc,he,{floorIndex:3,floorplanData:4},oc)}}function uc(i){ge(i,"svelte-19uvvss","path.svelte-19uvvss{opacity:0}path.svelte-19uvvss:hover{opacity:0.1}")}function dc(i){let t,e,n;return{c(){t=De("path"),x(t,"d",i[2]),x(t,"fill","#fff"),x(t,"class","svelte-19uvvss")},m(o,s){V(o,t,s),e||(n=[qe(t,"mouseenter",i[0]),qe(t,"mouseleave",i[1])],e=!0)},p:ne,i:ne,o:ne,d(o){o&&W(t),e=!1,Bt(n)}}}function fc(i,t,e){let{room:n}=t,{floorplanData:o}=t,{hoveredRoom:s}=t;function r(){s.set(n)}function a(){s.set(void 0)}const{bounding:l}=o,c=Yn(n.path,{needZ:!0,format:h=>Gs(h,l)});return i.$$set=h=>{"room"in h&&e(3,n=h.room),"floorplanData"in h&&e(4,o=h.floorplanData),"hoveredRoom"in h&&e(5,s=h.hoveredRoom)},[r,a,c,n,o,s]}class mc extends de{constructor(t){super(),ue(this,t,fc,dc,he,{room:3,floorplanData:4,hoveredRoom:5},uc)}}function pc(i){ge(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 ko(i,t,e){const n=i.slice();return n[5]=t[e],n}function To(i,t){let e,n,o;const s=[{room:t[5],floorplanData:t[1],hoveredRoom:t[2]}];let r={};for(let a=0;a<s.length;a+=1)r=Fe(r,s[a]);return n=new mc({props:r}),{key:i,first:null,c(){e=Ge(),Pe(n.$$.fragment),this.first=e},m(a,l){V(a,e,l),ve(n,a,l),o=!0},p(a,l){t=a;const c=l&7?Xe(s,[{room:t[5],floorplanData:t[1],hoveredRoom:t[2]}]):{};n.$set(c)},i(a){o||(G(n.$$.fragment,a),o=!0)},o(a){K(n.$$.fragment,a),o=!1},d(a){a&&W(e),be(n,a)}}}function gc(i){let t,e,n=[],o=new Map,s,r=i[1].floorDatas[i[0]].rooms;const a=l=>l[5].id;for(let l=0;l<r.length;l+=1){let c=ko(i,r,l),h=a(c);o.set(h,n[l]=To(h,c))}return{c(){t=X("div"),e=De("svg");for(let l=0;l<n.length;l+=1)n[l].c();x(e,"width","100%"),x(e,"height","100%"),x(e,"viewBox",`0 0 ${i[3]} ${i[4]}`),x(e,"class","svelte-1kqo6e4"),x(t,"class","floorplan-plugin__room-highlight svelte-1kqo6e4")},m(l,c){V(l,t,c),Q(t,e);for(let h=0;h<n.length;h+=1)n[h].m(e,null);s=!0},p(l,[c]){c&7&&(r=l[1].floorDatas[l[0]].rooms,Ie(),n=At(n,c,a,1,l,r,o,e,Gt,To,null,ko),xe())},i(l){if(!s){for(let c=0;c<r.length;c+=1)G(n[c]);s=!0}},o(l){for(let c=0;c<n.length;c+=1)K(n[c]);s=!1},d(l){l&&W(t);for(let c=0;c<n.length;c+=1)n[c].d()}}}function vc(i,t,e){let{floorIndex:n}=t,{floorplanData:o}=t,{hoveredRoom:s}=t;const r=o.bounding.max.x-o.bounding.min.x,a=o.bounding.max.y-o.bounding.min.y;return i.$$set=l=>{"floorIndex"in l&&e(0,n=l.floorIndex),"floorplanData"in l&&e(1,o=l.floorplanData),"hoveredRoom"in l&&e(2,s=l.hoveredRoom)},[n,o,s,r,a]}class Xs extends de{constructor(t){super(),ue(this,t,vc,gc,he,{floorIndex:0,floorplanData:1,hoveredRoom:2},pc)}}function bc(i){ge(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 Do(i){let t,e;const n=[{floorIndex:i[1],floorplanData:i[5],hoveredRoom:i[10]}];let o={};for(let s=0;s<n.length;s+=1)o=Fe(o,n[s]);return t=new Xs({props:o}),{c(){Pe(t.$$.fragment)},m(s,r){ve(t,s,r),e=!0},p(s,r){const a=r&1058?Xe(n,[{floorIndex:s[1],floorplanData:s[5],hoveredRoom:s[10]}]):{};t.$set(a)},i(s){e||(G(t.$$.fragment,s),e=!0)},o(s){K(t.$$.fragment,s),e=!1},d(s){be(t,s)}}}function zo(i){let t,e;const n=[{floorplanData:i[5],floorIndex:i[1],getRoomAreaText:i[6],getLabelElement:i[7],hoveredRoom:i[10],adaptiveRoomLabelVisibleEnable:i[9]}];let o={};for(let s=0;s<n.length;s+=1)o=Fe(o,n[s]);return t=new Nl({props:o}),{c(){Pe(t.$$.fragment)},m(s,r){ve(t,s,r),e=!0},p(s,r){const a=r&1762?Xe(n,[{floorplanData:s[5],floorIndex:s[1],getRoomAreaText:s[6],getLabelElement:s[7],hoveredRoom:s[10],adaptiveRoomLabelVisibleEnable:s[9]}]):{};t.$set(a)},i(s){e||(G(t.$$.fragment,s),e=!0)},o(s){K(t.$$.fragment,s),e=!1},d(s){be(t,s)}}}function Mo(i){let t,e;const n=[{floorplanData:i[5],floorIndex:i[1],getRuleDistanceText:i[8]}];let o={};for(let s=0;s<n.length;s+=1)o=Fe(o,n[s]);return t=new Yl({props:o}),{c(){Pe(t.$$.fragment)},m(s,r){ve(t,s,r),e=!0},p(s,r){const a=r&290?Xe(n,[{floorplanData:s[5],floorIndex:s[1],getRuleDistanceText:s[8]}]):{};t.$set(a)},i(s){e||(G(t.$$.fragment,s),e=!0)},o(s){K(t.$$.fragment,s),e=!1},d(s){be(t,s)}}}function Ac(i){let t,e,n,o,s,r,a,l,c;const h=[{floorIndex:i[1],floorplanData:i[5]}];let f={};for(let y=0;y<h.length;y+=1)f=Fe(f,h[y]);e=new hc({props:f});let u=i[2]&&Do(i);const m=[{floorplanData:i[5],floorIndex:i[1]}];let g={};for(let y=0;y<m.length;y+=1)g=Fe(g,m[y]);s=new Fs({props:g});let v=i[3]&&zo(i),b=i[4]&&Mo(i);return{c(){t=X("div"),Pe(e.$$.fragment),n=fe(),u&&u.c(),o=fe(),Pe(s.$$.fragment),r=fe(),v&&v.c(),a=fe(),b&&b.c(),x(t,"class",l=je(`floorplan-plugin__floor${i[0]?" floorplan-plugin__floor--is-current":""}`)+" svelte-bl8zrz")},m(y,I){V(y,t,I),ve(e,t,null),Q(t,n),u&&u.m(t,null),Q(t,o),ve(s,t,null),Q(t,r),v&&v.m(t,null),Q(t,a),b&&b.m(t,null),c=!0},p(y,[I]){const P=I&34?Xe(h,[{floorIndex:y[1],floorplanData:y[5]}]):{};e.$set(P),y[2]?u?(u.p(y,I),I&4&&G(u,1)):(u=Do(y),u.c(),G(u,1),u.m(t,o)):u&&(Ie(),K(u,1,1,()=>{u=null}),xe());const L=I&34?Xe(m,[{floorplanData:y[5],floorIndex:y[1]}]):{};s.$set(L),y[3]?v?(v.p(y,I),I&8&&G(v,1)):(v=zo(y),v.c(),G(v,1),v.m(t,a)):v&&(Ie(),K(v,1,1,()=>{v=null}),xe()),y[4]?b?(b.p(y,I),I&16&&G(b,1)):(b=Mo(y),b.c(),G(b,1),b.m(t,null)):b&&(Ie(),K(b,1,1,()=>{b=null}),xe()),(!c||I&1&&l!==(l=je(`floorplan-plugin__floor${y[0]?" floorplan-plugin__floor--is-current":""}`)+" svelte-bl8zrz"))&&x(t,"class",l)},i(y){c||(G(e.$$.fragment,y),G(u),G(s.$$.fragment,y),G(v),G(b),c=!0)},o(y){K(e.$$.fragment,y),K(u),K(s.$$.fragment,y),K(v),K(b),c=!1},d(y){y&&W(t),be(e),u&&u.d(),be(s),v&&v.d(),b&&b.d()}}}function yc(i,t,e){let{isCurrent:n}=t,{floorIndex:o}=t,{hoverEnable:s}=t,{roomLabelsEnable:r}=t,{ruleLabelsEnable:a}=t,{floorplanData:l}=t,{getRoomAreaText:c}=t,{getLabelElement:h}=t,{getRuleDistanceText:f}=t,{adaptiveRoomLabelVisibleEnable:u}=t;const m=Hs(void 0);return i.$$set=g=>{"isCurrent"in g&&e(0,n=g.isCurrent),"floorIndex"in g&&e(1,o=g.floorIndex),"hoverEnable"in g&&e(2,s=g.hoverEnable),"roomLabelsEnable"in g&&e(3,r=g.roomLabelsEnable),"ruleLabelsEnable"in g&&e(4,a=g.ruleLabelsEnable),"floorplanData"in g&&e(5,l=g.floorplanData),"getRoomAreaText"in g&&e(6,c=g.getRoomAreaText),"getLabelElement"in g&&e(7,h=g.getLabelElement),"getRuleDistanceText"in g&&e(8,f=g.getRuleDistanceText),"adaptiveRoomLabelVisibleEnable"in g&&e(9,u=g.adaptiveRoomLabelVisibleEnable)},[n,o,s,r,a,l,c,h,f,u,m]}class Pc extends de{constructor(t){super(),ue(this,t,yc,Ac,he,{isCurrent:0,floorIndex:1,hoverEnable:2,roomLabelsEnable:3,ruleLabelsEnable:4,floorplanData:5,getRoomAreaText:6,getLabelElement:7,getRuleDistanceText:8,adaptiveRoomLabelVisibleEnable:9},bc)}}function wc(i){ge(i,"svelte-86bqav",".floorplan-main.svelte-86bqav{width:100%;height:100%;pointer-events:none}")}function So(i,t,e){const n=i.slice();return n[16]=t[e],n}function jo(i){let t,e,n,o,s,r,a=i[9].floorDatas,l=[];for(let m=0;m<a.length;m+=1)l[m]=Oo(So(i,a,m));const c=m=>K(l[m],1,1,()=>{l[m]=null}),h=[{panoIndex:i[3],floorplanData:i[9],lastPanoramaLongitude:i[10],cameraImageUrl:i[11]}];let f={};for(let m=0;m<h.length;m+=1)f=Fe(f,h[m]);n=new rl({props:f});let u=i[6]&&Ro(i);return{c(){t=X("div");for(let m=0;m<l.length;m+=1)l[m].c();e=fe(),Pe(n.$$.fragment),o=fe(),u&&u.c(),x(t,"class","floorplan-main svelte-86bqav")},m(m,g){V(m,t,g);for(let v=0;v<l.length;v+=1)l[v].m(t,null);Q(t,e),ve(n,t,null),Q(t,o),u&&u.m(t,null),r=!0},p(m,g){if(i=m,g&62384){a=i[9].floorDatas;let b;for(b=0;b<a.length;b+=1){const y=So(i,a,b);l[b]?(l[b].p(y,g),G(l[b],1)):(l[b]=Oo(y),l[b].c(),G(l[b],1),l[b].m(t,e))}for(Ie(),b=a.length;b<l.length;b+=1)c(b);xe()}const v=g&3592?Xe(h,[{panoIndex:i[3],floorplanData:i[9],lastPanoramaLongitude:i[10],cameraImageUrl:i[11]}]):{};n.$set(v),i[6]?u?(u.p(i,g),g&64&&G(u,1)):(u=Ro(i),u.c(),G(u,1),u.m(t,null)):u&&(Ie(),K(u,1,1,()=>{u=null}),xe())},i(m){if(!r){for(let g=0;g<a.length;g+=1)G(l[g]);G(n.$$.fragment,m),G(u),s||Ke(()=>{s=Sa(t,tl,{duration:i[0],easing:ki}),s.start()}),r=!0}},o(m){l=l.filter(Boolean);for(let g=0;g<l.length;g+=1)K(l[g]);K(n.$$.fragment,m),K(u),r=!1},d(m){m&&W(t),Ht(l,m),be(n),u&&u.d()}}}function Oo(i){let t,e;const n=[{hoverEnable:i[5],floorplanData:i[9],getRoomAreaText:i[12],getLabelElement:i[13],getRuleDistanceText:i[14],roomLabelsEnable:i[7],ruleLabelsEnable:i[8],adaptiveRoomLabelVisibleEnable:i[15]},{floorIndex:i[16].floorIndex},{isCurrent:i[16].floorIndex===i[4]}];let o={};for(let s=0;s<n.length;s+=1)o=Fe(o,n[s]);return t=new Pc({props:o}),{c(){Pe(t.$$.fragment)},m(s,r){ve(t,s,r),e=!0},p(s,r){const a=r&62384?Xe(n,[r&62368&&{hoverEnable:s[5],floorplanData:s[9],getRoomAreaText:s[12],getLabelElement:s[13],getRuleDistanceText:s[14],roomLabelsEnable:s[7],ruleLabelsEnable:s[8],adaptiveRoomLabelVisibleEnable:s[15]},r&512&&{floorIndex:s[16].floorIndex},r&528&&{isCurrent:s[16].floorIndex===s[4]}]):{};t.$set(a)},i(s){e||(G(t.$$.fragment,s),e=!0)},o(s){K(t.$$.fragment,s),e=!1},d(s){be(t,s)}}}function Ro(i){let t,e;return t=new fl({props:{floorplanData:i[9],northDesc:i[2]}}),{c(){Pe(t.$$.fragment)},m(n,o){ve(t,n,o),e=!0},p(n,o){const s={};o&512&&(s.floorplanData=n[9]),o&4&&(s.northDesc=n[2]),t.$set(s)},i(n){e||(G(t.$$.fragment,n),e=!0)},o(n){K(t.$$.fragment,n),e=!1},d(n){be(t,n)}}}function Ec(i){let t,e,n=i[1]&&jo(i);return{c(){n&&n.c(),t=Ge()},m(o,s){n&&n.m(o,s),V(o,t,s),e=!0},p(o,[s]){o[1]?n?(n.p(o,s),s&2&&G(n,1)):(n=jo(o),n.c(),G(n,1),n.m(t.parentNode,t)):n&&(Ie(),K(n,1,1,()=>{n=null}),xe())},i(o){e||(G(n),e=!0)},o(o){K(n),e=!1},d(o){n&&n.d(o),o&&W(t)}}}function Ic(i,t,e){let{duration:n=0}=t,{visible:o}=t,{northDesc:s}=t,{panoIndex:r}=t,{floorIndex:a}=t,{hoverEnable:l}=t,{compassEnable:c}=t,{roomLabelsEnable:h}=t,{ruleLabelsEnable:f}=t,{floorplanData:u}=t,{lastPanoramaLongitude:m}=t,{cameraImageUrl:g}=t,{getRoomAreaText:v}=t,{getLabelElement:b}=t,{getRuleDistanceText:y}=t,{adaptiveRoomLabelVisibleEnable:I}=t;return i.$$set=P=>{"duration"in P&&e(0,n=P.duration),"visible"in P&&e(1,o=P.visible),"northDesc"in P&&e(2,s=P.northDesc),"panoIndex"in P&&e(3,r=P.panoIndex),"floorIndex"in P&&e(4,a=P.floorIndex),"hoverEnable"in P&&e(5,l=P.hoverEnable),"compassEnable"in P&&e(6,c=P.compassEnable),"roomLabelsEnable"in P&&e(7,h=P.roomLabelsEnable),"ruleLabelsEnable"in P&&e(8,f=P.ruleLabelsEnable),"floorplanData"in P&&e(9,u=P.floorplanData),"lastPanoramaLongitude"in P&&e(10,m=P.lastPanoramaLongitude),"cameraImageUrl"in P&&e(11,g=P.cameraImageUrl),"getRoomAreaText"in P&&e(12,v=P.getRoomAreaText),"getLabelElement"in P&&e(13,b=P.getLabelElement),"getRuleDistanceText"in P&&e(14,y=P.getRuleDistanceText),"adaptiveRoomLabelVisibleEnable"in P&&e(15,I=P.adaptiveRoomLabelVisibleEnable)},[n,o,s,r,a,l,c,h,f,u,m,g,v,b,y,I]}class Si extends de{constructor(t){super(),ue(this,t,Ic,Ec,he,{duration:0,visible:1,northDesc:2,panoIndex:3,floorIndex:4,hoverEnable:5,compassEnable:6,roomLabelsEnable:7,ruleLabelsEnable:8,floorplanData:9,lastPanoramaLongitude:10,cameraImageUrl:11,getRoomAreaText:12,getLabelElement:13,getRuleDistanceText:14,adaptiveRoomLabelVisibleEnable:15},wc)}}const xc="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC0AAAAwCAYAAACFUvPfAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAALaADAAQAAAABAAAAMAAAAADe2FZjAAAEF0lEQVRoBe2WzWskRRiHf13V092TxI2oEzYeVDwITtyDuCiihwiCePGgxIM3vYgHL4J4UIhBRA8i/gPqyUvWg7AiIuIeloDiYUHJLOK6BPwIk9nNODM9Xf1RVe1b3elJRjCZmQ6euqGmuqer33rq4e23GqiOykBloDJQGagMVAYqA5WBykBlYFYD1qwP/tdzaZqOx9zYOLxeX0+L5yzLGp0X/03a25MOnGRcBtx+6Rlo9SL08G4EooFnxa8Yiivox5/h5Ys/4cl7NVorNDRnngX+0MIkVMeMSf23zyKML8J7/Dy8hwF2Buh9CnS+AEQIdLspBuGb+M7/qLW4qJrNpsLapjYhpwVnx3BMfCtNNx3Etc9xywvnMf80wG8HmQainw0RxSGrnmeBp+8k5/j9S0HbvXb5io0Lz880/0wPHV1NlhLd316He+4xOCv5ragF7L9PrH1qBJyB0626x/lC+qrSvH5r/W+n1WpxUM5nMY4GPeH8lHJaPgfeAFQHCL+ntkXT+vnUc3W6pvTIwC0wy3rA4dwLmK2avZ7Eo9uKBuYJfgJscbs8dLCxDMt+EOEPBEZNEWyBYHqTz6bPXrzUnNrSShxHIsYiOL69zrCGLLcLqJP68tB+9w5wj+YhWDafQ2s61wNqxjZhmrQ2pvMFCEvXuCUZ7wqH794ZWs28LJqlTXSUyuksF2M/yOwqgkx2c1ADa4wLAQRk2sAGQQakhN6yFC2hltfz5kSY44NKQeeh+vtI/SSzWhg2CzCgmWISmKUGmaYFBDfCSymnfxJ6/+ospVcWOLLp5DGP/y0P/Rp66O99DQNq7Po3Ds0a0wY+My2QSv2N2mO/OyxR2o6UQk+Lv7yJ06JYSnnolZVU9cUn2O9SmaMWGFBqYXRwbqAJWIi94TX5biotpcGl1DXZ6LnqIbNDTnmUgi52Mv5l5ysMxIcZcGjy2DTK4ZHlcBC14zeSge4qphICjj3bS0A7o9nSp2TOkm7aZ8bGZy/jxhO87V91G0+dfY/Z7BWIIK9KYUi5qy/Hf8YfBG3sqJTHiQWhmTVkbip+wX3x6volVSx+LPAxF+VLXhZ8VQ+iP2Rta/iWe5v42Fngj0BbdnRTXh12ZIcKhTaGbcYjybRwXBU1lu9KlndXp04NM52poKWO0RZsviNaP9a6grkO972+st05pXhE5c1hTEluJy7XUejGUQNLMbAmTdWY1rKBLW3aTJqBZ7nZkb36DhYCreeYHbMUXHvaYi5XDK70EcgulmRjm77wNtenzuXCbmnTRaAx493rbGf3Jr/njMzj920CnKdUaFCjlDioy7NYNvOdGrQJNgI32/L2tkXfFPlxgToqjWVhD6KdLnQRdARf/HHQz2r2X2Gqy8pAZaAyUBmoDFQGKgP/q4F/AJYg9/s0ZoABAAAAAElFTkSuQmCC";async function Cc(i){const t=new Headers({"Content-Type":"text/plain"}),e=async function(o){const s={index:o.index,url:o.url,svgUrl:o.svg_url};if(o.svg_url){const r=await fetch(o.svg_url,{headers:t}).then(a=>a.text());s.svgContent=r}return s};return await Promise.all(i.map(e))}function Lc(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 kc(i){return{floorName:i.floor_name,floorIndex:i.floor_index,rooms:i.rooms.map(Lc),rules:i.rules}}function Tc(i){return{index:i.index,floorIndex:i.floor_index,position:i.position,positionInImage:i.position_in_image}}function Dc(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}}async function bt(i){const t=await Cc(i.outlines),e=i.computed_data.bounding,n=i.computed_data.floor_datas.map(kc),o=i.computed_data.entrance?Dc(i.computed_data.entrance):null;return{outlines:t,entrance:o,bounding:e,floorDatas:n,observers:i.computed_data.observers.map(Tc)}}function zc(i,t,e){return i.map(o=>{const s=o.position,r=o.icon?o.icon:{url:xc,width:45,height:48},a=Jl(s,t),l=Vl(s,e),c=Zl(l,e);return{floorIndex:a,icon:r,id:o.id,position:l,positionInImage:c}})}function Mc(i,t){return t(i),i}function Vn(i,t){return Mc({},e=>{for(const n in i)t.indexOf(n)===-1&&(e[n]=i[n])})}function No(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 ji(i,t,e=gt.BOUNDING_CENTER){const n=No(i,t),o=No(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 Oi(i,t,e,n){const o=ji(i,e,n==null?void 0:n.attachedTo),s=new O.Vector3(0,o,0),r=new O.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 Qs{constructor(t){d(this,"five");d(this,"hooks",new ye.Subscribe);this.five=t}getCurrentState(){return this.state}}class Lt extends Qs{}var Ye=(i=>(i.UnknownError="UnknownError",i.DataNotLoaded="DataNotLoaded",i.BreakOffByHide="BreakOffByHide",i.BreakOffByDisable="BreakOffByDisable",i.ModelNotLoaded="ModelNotLoaded",i.ChangeModeError="ChangeModeError",i.UpdateCameraError="UpdateCameraError",i))(Ye||{});const Ws=500,Sc=80;function Pi(i,t,e=4){return Math.floor(i*Math.pow(10,e))===Math.floor(t*Math.pow(10,e))}async function Ys(i,t){await 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 h=o[c];if(h===void 0)return!0;const f=l[c];return typeof h=="number"&&typeof f=="number"?Pi(h,f,2):h===f}):!0})()||n(new Error("five pose \u4E0E\u9884\u671F\u4E0D\u7B26")),e()})})}function Ri(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!(!Pi(e,s,2)||!Pi(n,r,2)||o!==a)}async function Vs(i,t,e=!0){if(Ri(i,t)===!0)return;const o=i.getCurrentState();if(o.mode!==t.mode){const[h]=await Nn(Ys(i,[t.mode,t,void 0,e]));if(h)throw new Error(Ye.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]=await Nn(i.updateCamera(t,l,e));if(c)throw new Error(Ye.UpdateCameraError)}function Nt(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 jc(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 Oc(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 Rc extends Lt{constructor(e,n){var a;super(e);d(this,"name","modelFloorplanPlugin");d(this,"state");d(this,"data");d(this,"showState");d(this,"showPromise");d(this,"app");d(this,"panoIndex",0);d(this,"floorIndex",0);d(this,"selector");d(this,"showRejection");d(this,"wrapper");d(this,"container",document.createElement("div"));d(this,"lastPanoramaLongitude",0);d(this,"size",{width:0,height:0});d(this,"hasAddedEventListener",!1);d(this,"isHiddenByHideFunc",!1);d(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")});d(this,"show",async(e={})=>{if(!this.state.enabled||!this.showPromise&&this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},n),this._show(e)});d(this,"hide",async(e={})=>{!this.state.enabled||(this.isHiddenByHideFunc=!0,this.state.visible!==!1&&(this.updateState({visible:!1},e.userAction||!0),this._hide(e)))});d(this,"updateSize",()=>{if(!this.data||!Ri(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=Oi(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})});d(this,"_disable",e=>{var o,s,r;const{userAction:n}=e;this.hooks.emit("disable",{userAction:n}),(o=this.showRejection)==null||o.call(this,Ye.BreakOffByDisable),this.showPromise=void 0,(s=this.app)==null||s.$destroy(),this.app=void 0,(r=this.container)==null||r.remove(),this.removeEventListener()});d(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}))});d(this,"_show",async e=>{var r;if(!this.state.enabled)return;if(!((r=this.five.model)!=null&&r.loaded))throw new Error(Ye.ModelNotLoaded);if(!this.data)throw new Error(Ye.DataNotLoaded);this.isHiddenByHideFunc=!1;const o={...{floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},...e},s=async()=>{this.hooks.emit("show",{userAction:o.userAction,auto:o.isAutoShow});let a=!1,l;this.showRejection=u=>{a=!0,l=u};const[c]=await Nn(Vs(this.five,this.showState,o.userAction));if(c)throw c;if(a)throw l?new Error(l):new Error(Ye.UnknownError);this.updateSize(),this.floorIndex=o.floorIndex,this.five.model.show(this.floorIndex);const h=o.modelOpacity,f=o.immediately?0:Ws;Nt(this.five,h,f),this.render(f)};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});d(this,"_hide",e=>{var s;(s=this.showRejection)==null||s.call(this,Ye.BreakOffByHide),this.showPromise=void 0;const o={...{userAction:!0,isAutoHide:!1},...e};Nt(this.five,1,0),this.hooks.emit("hide",{auto:o.isAutoHide,userAction:o.userAction}),this.render()});d(this,"handleClick",()=>{if(!this.state.visible)return;if(this.hooks.emit("click"))return!1});d(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)});d(this,"onFiveModeChange",e=>{e!==this.showState.mode&&(this.updateState({visible:!1},!1),this._hide({userAction:!1}))});d(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||Oc(o)&&(this.updateState({visible:!0},!0),this._show({isAutoShow:!0})))});d(this,"onFivePanoArrived",e=>{var n;!((n=this.five)!=null&&n.work)||(this.panoIndex=e,this.floorIndex=this.five.work.observers[e].floorIndex)});d(this,"onFiveCameraUpdate",(e,n)=>{if(!this.state.visible||this.showPromise)return;const o=this.five.getCurrentState();jc(o)&&(this.updateState({visible:!1},n),this._hide({userAction:n,isAutoHide:!0}))});d(this,"onFiveWantsGesture",(e,n)=>{if(!!this.state.visible&&(n.length>1||e==="mouseWheel"))return!1});d(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});d(this,"onFiveWantsTapGesture",()=>this.handleClick());d(this,"onFiveWantsChangeMode",(e,n)=>{n==="Panorama"&&e==="Floorplan"&&(this.lastPanoramaLongitude=this.five.getCurrentState().longitude)});d(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:Sc/((a=n==null?void 0:n.scale)!=null?a:1)};const o={northDesc:"\u5317",modelOpacity:1,hoverEnable:!0,compassEnable:!0,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,adaptiveRoomLabelVisibleEnable:!0,cameraImageUrl:vt,attachedTo:gt.BOUNDING_CENTER,getLabelElement:void 0,getRoomAreaText:l=>(l/1e6).toFixed(1)+"\u33A1",getRuleDistanceText:l=>l.toString()},s=n?Vn(n,["selector","scale"]):{},r={...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()}async load(e,n,o=!0){function s(h){return Object.prototype.hasOwnProperty.apply(h,["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=await bt(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()}async formatData(e){return await bt(e.data)}updateState(e,n){const o=this.state,s=e.config?{...o.config,...e.config}:o.config;this.state={...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={...this.state.config,visible:this.state.visible,duration:e!=null?e:0,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude};if(this.app)return this.app.$set(n);this.app=new Si({target:this.container,intro:!0,props:n})}}const Nc=(i,t)=>new Rc(i,t);function Bc(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 Hc(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 Fc extends Lt{constructor(e,n){super(e);d(this,"name","modelFloorplanPlugin");d(this,"state");d(this,"data");d(this,"showState");d(this,"showPromise");d(this,"app");d(this,"panoIndex",0);d(this,"floorIndex",0);d(this,"selector");d(this,"showRejection");d(this,"wrapper");d(this,"container",document.createElement("div"));d(this,"lastPanoramaLongitude",0);d(this,"size",{width:0,height:0});d(this,"hasAddedEventListener",!1);d(this,"isHiddenByHideFunc",!1);d(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")});d(this,"show",async(e={})=>{if(!this.state.enabled||!this.showPromise&&this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},n),this._show(e)});d(this,"hide",async(e={})=>{!this.state.enabled||(this.isHiddenByHideFunc=!0,this.state.visible!==!1&&(this.updateState({visible:!1},e.userAction||!0),this._hide(e)))});d(this,"updateSize",()=>{if(!this.data||!Ri(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=Oi(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})});d(this,"_disable",e=>{var o,s,r;const{userAction:n}=e;this.hooks.emit("disable",{userAction:n}),(o=this.showRejection)==null||o.call(this,Ye.BreakOffByDisable),this.showPromise=void 0,(s=this.app)==null||s.$destroy(),this.app=void 0,(r=this.container)==null||r.remove(),this.removeEventListener()});d(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}))});d(this,"_show",async e=>{var r;if(!this.state.enabled)return;if(!((r=this.five.model)!=null&&r.loaded))throw new Error(Ye.ModelNotLoaded);if(!this.data)throw new Error(Ye.DataNotLoaded);this.isHiddenByHideFunc=!1;const o={...{floorIndex:this.floorIndex,modelOpacity:this.state.config.modelOpacity,immediately:!1,isAutoShow:!1,userAction:!0},...e},s=async()=>{this.hooks.emit("show",{userAction:o.userAction,auto:o.isAutoShow});let a=!1,l;this.showRejection=u=>{a=!0,l=u};const[c]=await Nn(Vs(this.five,this.showState,o.userAction));if(c)throw c;if(a)throw l?new Error(l):new Error(Ye.UnknownError);this.updateSize(),this.updatePosition(),this.floorIndex=o.floorIndex,this.five.model.show(this.floorIndex);const h=o.modelOpacity,f=o.immediately?0:Ws;Nt(this.five,h,f),this.render(f)};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});d(this,"_hide",e=>{var s;(s=this.showRejection)==null||s.call(this,Ye.BreakOffByHide),this.showPromise=void 0;const o={...{userAction:!0,isAutoHide:!1},...e};Nt(this.five,1,0),this.hooks.emit("hide",{auto:o.isAutoHide,userAction:o.userAction}),this.render()});d(this,"handleClick",()=>{if(!this.state.visible)return;if(this.hooks.emit("click"))return!1});d(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)});d(this,"onFiveModeChange",e=>{e!==this.showState.mode&&(this.updateState({visible:!1},!1),this._hide({userAction:!1}))});d(this,"onFivePanoArrived",e=>{var n;!((n=this.five)!=null&&n.work)||(this.panoIndex=e,this.floorIndex=this.five.work.observers[e].floorIndex)});d(this,"onFiveCameraUpdate",(e,n)=>{if(!this.state.visible||this.showPromise)return;const o=this.five.getCurrentState();this.updatePosition(),this.updateSize(),Bc(o)&&(this.updateState({visible:!1},n),this._hide({userAction:n}))});d(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:(Hc(o)&&(this.updateState({visible:!0},!0),this._show({isAutoShow:!0})),!1)}}});d(this,"onFiveWantsTapGesture",()=>this.handleClick());d(this,"onFiveWantsChangeMode",(e,n)=>{n==="Panorama"&&e===this.showState.mode&&(this.lastPanoramaLongitude=this.five.getCurrentState().longitude)});d(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,hoverEnable:!0,compassEnable:!0,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,cameraImageUrl:vt,attachedTo:gt.BOUNDING_CENTER,getLabelElement:void 0,adaptiveRoomLabelVisibleEnable:!0,getRoomAreaText:a=>(a/1e6).toFixed(1)+"\u33A1",getRuleDistanceText:a=>a.toString()},s=n?Vn(n,["selector","scale"]):{},r={...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()}async load(e,n,o=!0){function s(h){return Object.prototype.hasOwnProperty.apply(h,["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=await bt(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=ji(this.five,this.floorIndex,this.state.config.attachedTo),n=(a=this.five.model)==null?void 0:a.bounding.getCenter(new O.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+"%"}async formatData(e){return await bt(e.data)}updateState(e,n){const o=this.state,s=e.config?{...o.config,...e.config}:o.config;this.state={...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={...this.state.config,visible:this.state.visible,duration:e!=null?e:0,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude};if(this.app)return this.app.$set(n);this.app=new Si({target:this.container,intro:!0,props:n})}}const Gc=(i,t)=>new Fc(i,t);class Xc extends Lt{constructor(e,n){super(e);d(this,"name","topviewFloorplanPlugin");d(this,"state");d(this,"data");d(this,"app");d(this,"selector");d(this,"panoIndex",0);d(this,"floorIndex",0);d(this,"wrapper");d(this,"container",document.createElement("div"));d(this,"lastPanoramaLongitude",0);d(this,"size",{width:0,height:0});d(this,"hasAddedEventListener",!1);d(this,"isHiddenByHideFunc",!1);d(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=Oi(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})});d(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")});d(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})});d(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)});d(this,"onFiveModeChange",(...[e,,,,n])=>{e!=="Topview"&&this.state.visible&&(this.updateState({visible:!1},n),this._hide({userAction:n}))});d(this,"onFivePanoArrived",e=>{var n;!((n=this.five)!=null&&n.work)||(this.panoIndex=e,this.floorIndex=this.five.work.observers[e].floorIndex)});d(this,"onFiveCameraUpdate",(e,n)=>{!this.state.visible||(this.updatePosition(),this.updateSize())});d(this,"onFiveWantsGesture",e=>{if(!(e!=="pan"&&e!=="pinch"&&e!=="mouseWheel")&&this.state.visible&&!this.state.config.gestureEnable)return!1});d(this,"onFiveWantsMoveToPano",()=>{if(this.state.visible&&this.state.config.preventRoomClick)return!1});d(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}))});d(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,hoverEnable:!0,compassEnable:!0,gestureEnable:!1,autoShowEnable:!0,ruleLabelsEnable:!0,roomLabelsEnable:!0,cameraImageUrl:vt,attachedTo:gt.BOUNDING_CENTER,getLabelElement:void 0,adaptiveRoomLabelVisibleEnable:!0,getRoomAreaText:a=>(a/1e6).toFixed(1)+"\u33A1",getRuleDistanceText:a=>a.toString()},s=n?Vn(n,["selector","scale"]):{},r={...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()}async load(e,n,o=!0){function s(h){return Object.prototype.hasOwnProperty.apply(h,["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=await bt(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=ji(this.five,this.floorIndex,this.state.config.attachedTo),n=(a=this.five.model)==null?void 0:a.bounding.getCenter(new O.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}async show(e={}){if(this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},n),this._show({userAction:n})}async hide(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()}async formatData(e){return await bt(e.data)}async _show(e){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"&&await Ys(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;Nt(this.five,s,o),this.hooks.emit("showAnimationEnded",{userAction:n,auto:!1}),this.render()}async _hide(e){if(!this.state.enabled)return;const{userAction:n}=e;this.hooks.emit("hide",{userAction:n,auto:!1});const o=1,s=0;Nt(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?{...o.config,...e.config}:o.config;this.state={...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={...this.state.config,visible:this.state.visible,duration:e!=null?e:0,panoIndex:this.panoIndex,floorIndex:this.floorIndex,floorplanData:this.data,lastPanoramaLongitude:this.lastPanoramaLongitude};if(this.app)return this.app.$set(n);this.app=new Si({target:this.container,intro:!0,props:n})}}const Qc=(i,t)=>new Xc(i,t);function Ni(i,t=200){let e;return function(...n){e||(i(...n),e=setTimeout(function(){e=null},t))}}function Wc(i){ge(i,"svelte-1ty3s4p",".plugin-radar__camera-wrapper.svelte-1ty3s4p{width:100%;height:100%;position:absolute;pointer-events:none}.plugin-radar__camera-position.svelte-1ty3s4p{position:absolute;left:0;top:0;width:0;height:0;transform:none;pointer-events:none;transition:transform 1s linear}.plugin-radar__camera-rotate.svelte-1ty3s4p{position:absolute;left:-0.78125rem;top:-0.78125rem;width:0.88542rem;height:0.88542rem;transform-origin:0.78125rem 0.78125rem;transform:rotate(45deg);background-repeat:no-repeat;background-size:100%}")}function Yc(i){let t,e,n;return{c(){t=X("div"),e=X("div"),n=X("div"),x(n,"class","plugin-radar__camera-rotate svelte-1ty3s4p"),S(n,"background-image","url("+(i[0]||vt)+")"),S(n,"transform",i[1]),x(e,"class","plugin-radar__camera-position svelte-1ty3s4p"),S(e,"transform",i[2]),x(t,"class","plugin-radar__camera-wrapper svelte-1ty3s4p")},m(o,s){V(o,t,s),Q(t,e),Q(e,n)},p(o,[s]){s&1&&S(n,"background-image","url("+(o[0]||vt)+")"),s&2&&S(n,"transform",o[1]),s&4&&S(e,"transform",o[2])},i:ne,o:ne,d(o){o&&W(t)}}}function Vc(i){return`rotate(${Math.floor(i/Math.PI*180)*-1+45}deg)`}function Zc(i,t,e){let n,o,{five:s}=t,{pxmm:r}=t,{floorplanData:a}=t,{cameraImageUrl:l}=t,c=s.getCurrentState().panoIndex,h=s.getCurrentState().longitude;function f(g,v){const b=g.bounding,y=g.observers[v];if(!y)return"";const I=(b.max.x-b.min.x)*r,P=(b.max.y-b.min.y)*r,L=Math.floor(y.positionInImage.x*I),D=Math.floor(y.positionInImage.y*P);return`translate(${L}px, ${D}px)`}function u(g){e(6,c=g)}const m=Ni(g=>{e(7,h=g.longitude)},1e3/60);return Ct(()=>(s.on("panoWillArrive",u),s.on("cameraDirectionUpdate",m),function(){s.off("panoWillArrive",u),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=f(a,c)),i.$$.dirty&128&&e(1,o=Vc(h))},[l,o,n,s,r,a,c,h]}class Jc extends de{constructor(t){super(),ue(this,t,Zc,Yc,he,{five:3,pxmm:4,floorplanData:5,cameraImageUrl:0},Wc)}}function Uc(i){ge(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 Bo(i,t,e){const n=i.slice();return n[1]=t[e],n}function Ho(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=X("div"),n=X("div"),r=fe(),x(n,"class","plugin-pano-floorplan__extra-object-item svelte-1i87fz7"),S(n,"background-image",`url(${t[1].icon.url})`),S(n,"width",o),S(n,"height",s),x(e,"class","plugin-pano-floorplan__extra-object-item--position svelte-1i87fz7"),S(e,"top",a),S(e,"left",l),this.first=e},m(c,h){V(c,e,h),Q(e,n),Q(e,r)},p(c,h){t=c,h&1&&S(n,"background-image",`url(${t[1].icon.url})`),h&1&&o!==(o=`${t[1].icon.width/16}rem`)&&S(n,"width",o),h&1&&s!==(s=`${t[1].icon.height/16}rem`)&&S(n,"height",s),h&1&&a!==(a=`${t[1].positionInImage.y*100}%`)&&S(e,"top",a),h&1&&l!==(l=`${t[1].positionInImage.x*100}%`)&&S(e,"left",l)},d(c){c&&W(e)}}}function qc(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=Bo(i,o,r),l=s(a);n.set(l,e[r]=Ho(l,a))}return{c(){t=X("div");for(let r=0;r<e.length;r+=1)e[r].c();x(t,"class","plugin-pano-floorplan__extra-objects svelte-1i87fz7")},m(r,a){V(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=At(e,a,s,1,r,o,n,t,Bs,Ho,null,Bo))},i:ne,o:ne,d(r){r&&W(t);for(let a=0;a<e.length;a+=1)e[a].d()}}}function Kc(i,t,e){let{extraObjects:n=[]}=t;return i.$$set=o=>{"extraObjects"in o&&e(0,n=o.extraObjects)},[n]}class _c extends de{constructor(t){super(),ue(this,t,Kc,qc,he,{extraObjects:0},Uc)}}function Fo(i){let t,e;const n=[{five:i[0],pxmm:i[1],floorIndex:i[2],floorplanData:i[4],onRoomHeightClick:i[6]}];let o={};for(let s=0;s<n.length;s+=1)o=Fe(o,n[s]);return t=new Xs({props:o}),{c(){Pe(t.$$.fragment)},m(s,r){ve(t,s,r),e=!0},p(s,r){const a=r&87?Xe(n,[{five:s[0],pxmm:s[1],floorIndex:s[2],floorplanData:s[4],onRoomHeightClick:s[6]}]):{};t.$set(a)},i(s){e||(G(t.$$.fragment,s),e=!0)},o(s){K(t.$$.fragment,s),e=!1},d(s){be(t,s)}}}function $c(i){let t,e,n,o,s,r;const a=[{floorIndex:i[2],floorplanData:i[4]}];let l={};for(let h=0;h<a.length;h+=1)l=Fe(l,a[h]);t=new Fs({props:l}),n=new _c({props:{extraObjects:i[5]}});let c=i[3]&&Fo(i);return{c(){Pe(t.$$.fragment),e=fe(),Pe(n.$$.fragment),o=fe(),c&&c.c(),s=Ge()},m(h,f){ve(t,h,f),V(h,e,f),ve(n,h,f),V(h,o,f),c&&c.m(h,f),V(h,s,f),r=!0},p(h,[f]){const u=f&20?Xe(a,[{floorIndex:h[2],floorplanData:h[4]}]):{};t.$set(u);const m={};f&32&&(m.extraObjects=h[5]),n.$set(m),h[3]?c?(c.p(h,f),f&8&&G(c,1)):(c=Fo(h),c.c(),G(c,1),c.m(s.parentNode,s)):c&&(Ie(),K(c,1,1,()=>{c=null}),xe())},i(h){r||(G(t.$$.fragment,h),G(n.$$.fragment,h),G(c),r=!0)},o(h){K(t.$$.fragment,h),K(n.$$.fragment,h),K(c),r=!1},d(h){be(t,h),h&&W(e),be(n,h),h&&W(o),c&&c.d(h),h&&W(s)}}}function eh(i,t,e){let n,{five:o}=t,{pxmm:s}=t,{floorIndex:r}=t,{hoverEnable:a}=t,{floorplanData:l}=t,{extraObjects:c=[]}=t;const h=void 0;return i.$$set=f=>{"five"in f&&e(0,o=f.five),"pxmm"in f&&e(1,s=f.pxmm),"floorIndex"in f&&e(2,r=f.floorIndex),"hoverEnable"in f&&e(3,a=f.hoverEnable),"floorplanData"in f&&e(4,l=f.floorplanData),"extraObjects"in f&&e(7,c=f.extraObjects)},i.$$.update=()=>{i.$$.dirty&132&&e(5,n=c==null?void 0:c.filter(f=>f.floorIndex===r))},[o,s,r,a,l,n,h,c]}class th extends de{constructor(t){super(),ue(this,t,eh,$c,he,{five:0,pxmm:1,floorIndex:2,hoverEnable:3,floorplanData:4,extraObjects:7})}}function nh(i){ge(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 Go(i){let t,e,n,o=i[6]!==0&&Xo(i);return{c(){t=X("div"),o&&o.c(),x(t,"class","plugin-floorplan-radar svelte-1mvqyqq"),Ke(()=>i[12].call(t))},m(s,r){V(s,t,r),o&&o.m(t,null),e=Ft(t,i[12].bind(t)),n=!0},p(s,r){s[6]!==0?o?(o.p(s,r),r&64&&G(o,1)):(o=Xo(s),o.c(),G(o,1),o.m(t,null)):o&&(Ie(),K(o,1,1,()=>{o=null}),xe())},i(s){n||(G(o),n=!0)},o(s){K(o),n=!1},d(s){s&&W(t),o&&o.d(),e()}}}function Xo(i){let t,e,n,o,s=`${i[8]}px`,r=`${i[11]}px`,a;const l=[{five:i[0],pxmm:i[9],floorIndex:i[10],floorplanData:i[3],hoverEnable:i[2],extraObjects:i[5]}];let c={};for(let u=0;u<l.length;u+=1)c=Fe(c,l[u]);e=new th({props:c});const h=[{pxmm:i[9],five:i[0],floorplanData:i[3],cameraImageUrl:i[4]}];let f={};for(let u=0;u<h.length;u+=1)f=Fe(f,h[u]);return o=new Jc({props:f}),{c(){t=X("div"),Pe(e.$$.fragment),n=fe(),Pe(o.$$.fragment),x(t,"class","plugin-floorplan-radar-container svelte-1mvqyqq"),S(t,"width",s),S(t,"height",r)},m(u,m){V(u,t,m),ve(e,t,null),Q(t,n),ve(o,t,null),a=!0},p(u,m){const g=m&1581?Xe(l,[{five:u[0],pxmm:u[9],floorIndex:u[10],floorplanData:u[3],hoverEnable:u[2],extraObjects:u[5]}]):{};e.$set(g);const v=m&537?Xe(h,[{pxmm:u[9],five:u[0],floorplanData:u[3],cameraImageUrl:u[4]}]):{};o.$set(v),m&256&&s!==(s=`${u[8]}px`)&&S(t,"width",s),m&2048&&r!==(r=`${u[11]}px`)&&S(t,"height",r)},i(u){a||(G(e.$$.fragment,u),G(o.$$.fragment,u),a=!0)},o(u){K(e.$$.fragment,u),K(o.$$.fragment,u),a=!1},d(u){u&&W(t),be(e),be(o)}}}function ih(i){let t,e,n=i[1]&&Go(i);return{c(){n&&n.c(),t=Ge()},m(o,s){n&&n.m(o,s),V(o,t,s),e=!0},p(o,[s]){o[1]?n?(n.p(o,s),s&2&&G(n,1)):(n=Go(o),n.c(),G(n,1),n.m(t.parentNode,t)):n&&(Ie(),K(n,1,1,()=>{n=null}),xe())},i(o){e||(G(n),e=!0)},o(o){K(n),e=!1},d(o){n&&n.d(o),o&&W(t)}}}function oh(i,t,e){let{five:n}=t,{visible:o}=t,{hoverEnable:s}=t,{floorplanData:r}=t,{cameraImageUrl:a}=t,{extraObjects:l=[]}=t,c=0,h=0,f=0,u=0,m=0,g=0;function v(y){e(10,h=n.work.observers[y].floorIndex)}Ct(()=>(n.on("panoArrived",v),()=>{n.off("panoArrived",v)}));function b(){f=this.clientWidth,u=this.clientHeight,e(6,f),e(7,u)}return i.$$set=y=>{"five"in y&&e(0,n=y.five),"visible"in y&&e(1,o=y.visible),"hoverEnable"in y&&e(2,s=y.hoverEnable),"floorplanData"in y&&e(3,r=y.floorplanData),"cameraImageUrl"in y&&e(4,a=y.cameraImageUrl),"extraObjects"in y&&e(5,l=y.extraObjects)},i.$$.update=()=>{if(i.$$.dirty&456){const y=Math.min(f,u),{max:I,min:P}=r.bounding,L=I.x-P.x,D=I.y-P.y,E=function(){return L>D?[y,y/L*D]:[y/D*L,y]}();e(8,m=E[0]),e(11,g=E[1]),e(9,c=m/L)}},[n,o,s,r,a,l,f,u,m,c,h,g,b]}class sh extends de{constructor(t){super(),ue(this,t,oh,ih,he,{five:0,visible:1,hoverEnable:2,floorplanData:3,cameraImageUrl:4,extraObjects:5},nh)}}class rh extends Lt{constructor(e,n){super(e);d(this,"name","panoFloorplanRadarPlugin");d(this,"state");d(this,"data");d(this,"app");d(this,"wrapperSelector","");d(this,"wrapper",null);d(this,"disposed",!1);d(this,"extraObjects",[]);d(this,"dispose",()=>{var e;this.disposed=!0,(e=this.app)==null||e.$destroy(),this.wrapper=null,this.wrapperSelector="",this.hooks.emit("dispose")});d(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:!1,cameraImageUrl:vt},s=n!=null&&n.configs?n.configs:{},r={...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)}async load(e,n,o=!0){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=await bt(a),this.hooks.emit("dataLoaded",this.data),this.hooks.emit("dataChange",this.data,l),n&&this.updateState(n,o),this.render()}async show(e={}){if(this.state.visible)return;const n=e.userAction!==void 0?e.userAction:!0;this.updateState({visible:!0},n),this._show({userAction:n})}async hide(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=zc(e,this.five,this.data),this.render())}async formatData(e){return await bt(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={...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={...this.state.config,five:this.five,floorplanData:this.data,visible:this.state.visible,extraObjects:this.extraObjects};this.app?this.app.$set(e):this.app=new sh({target:this.wrapper,props:e})}}const ah=(i,t)=>new rh(i,t),lh=[{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"}],ch=[{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"}],hh=[{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"}],ui=(i,t,e)=>{const n=new O.Matrix4,o=new O.Euler(i,t,e,"YXZ");return n.makeRotationFromEuler(o),n},uh=(i,{scale:t,rotation:e,position:n})=>{if(t&&i.scale.set(t,t,t),e){const[o,s,r]=e;o&&i.applyMatrix4(ui(o,0,0)),s&&i.applyMatrix4(ui(0,s,0)),r&&i.applyMatrix4(ui(0,0,r))}return n&&i.position.set(n.x,n.y,n.z),i};function Zs(i,t){i.traverse(e=>{var n;if(e.type==="Mesh"){const o=e,s={map:o.material.map||{},...t};o.material=new M.MeshBasicMaterial(s),o.renderOrder=1,((n=e.parent)==null?void 0:n.type)==="Mesh"&&(e.renderOrder=e.parent.renderOrder+1)}})}const dh=(i,t)=>{var h;const e=t.fbx_url||"//vrlab-static.ljcdn.com/release/web/v3/dipan3/dipan.FBX",n=(h=t.north_rad)!=null?h:void 0,o={},s=async f=>{var $;const u=(f==null?void 0:f.fbx_url)||e,m=($=f==null?void 0:f.north_rad)!=null?$: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,v=g.max.x-g.min.x,b=g.max.z-g.min.z,y=Math.max(v,b),P=await new Ls.FBXLoader().loadAsync(u);Zs(P,{transparent:!0,side:O.DoubleSide,blending:O.AdditiveBlending});const L=[0,m-Math.PI/2,0],{model:{bounding:{max:{x:D,z:E},min:{x:T,y:C,z}}}}=i;o.yBase=C;const B={x:(D+T)/2,y:C-1.6,z:(E+z)/2},F=.0045*y;return uh(P,{position:B,rotation:L,scale:F}),o.object=P,!0},r=({latitude:f})=>{if(!o.object)return;const u=a(f);u&&(o.object.position.y=u)},a=f=>{if(o.yBase===void 0)return;const u=.6;if(f>=Math.PI/4)return o.yBase-(u+1.6);const m=f*(4/Math.PI);return o.yBase-(u*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 f=a(i.getPose().latitude);f&&(o.object.position.y=f),i.scene.add(o.object),i.needsRender=!0,i.on("cameraDirectionUpdate",r)}}};function fh(i,t){var c,h,f,u,m;const e=(c=t==null?void 0:t.size)!=null?c:512,n=(h=t==null?void 0:t.fontSize)!=null?h:e*(35/256)*1.2,o=(f=t==null?void 0:t.backgroundColor)!=null?f:"rgba(0,0,0,0)",s=(u=t==null?void 0:t.fontColor)!=null?u:"#fff",r=(m=t==null?void 0:t.textAlign)!=null?m:"center",a=document.createElement("canvas");a.setAttribute("width",e+""),a.setAttribute("height",e+"");const l=a.getContext("2d");return l.fillStyle=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 M.CanvasTexture(a)}const mh=({x:i,y:t,z:e})=>new M.Vector3(i,t,e),ph=(i,t)=>{var v,b,y;const e={},n=(v=t.animationEnabled)!=null?v:!0,o=(b=t.position)!=null?b:void 0,s=(y=t.rad)!=null?y:void 0,r=t.fbx_url||"//vrlab-image4.ljcdn.com/release/web/entryDoorMini/Anim_Door1.fbx",a=[],l=async I=>{var z,B,F,$,j,R,H;const P=(z=I==null?void 0:I.position)!=null?z:o;if(!P)return Promise.reject("ModelEntryDoorGuidePlugin.load(): position is undefined");const L=mh(P),D=(B=I==null?void 0:I.rad)!=null?B:s,E=(F=I==null?void 0:I.fbx_url)!=null?F:r;if(e.rad=D,D===void 0)return Promise.reject(`ModelEntryDoorGuidePlugin.load(): rad is ${D}`);const T=await new Ls.FBXLoader().loadAsync(E);T.position.copy(L),T.rotation.z=D,T.scale.set(.8,.8,.8),Zs(T,{transparent:!0,side:O.DoubleSide});const C=(H=(R=(j=($=T.children)==null?void 0:$[0])==null?void 0:j.children)==null?void 0:R[3])==null?void 0:H.clone();return C?(C.material=new M.MeshBasicMaterial({transparent:!0,map:fh("\u5165\u6237\u95E8")}),C.renderOrder=3,T.children[0].add(C),e.object=T,!0):Promise.reject(`ModelEntryDoorGuidePlugin.load(): textMesh is ${C}`)},c=()=>{if(e.animation)return;if(!e.object)return console.error("ModelEntryDoorGuidePlugin.initAnimation(): state.object is ",e.object);const I=1,P=new M.AnimationMixer(e.object);a.push(P);const L=P.clipAction(e.object.animations[0]);L.timeScale=I;let D;const E=()=>{let B=0,F=0;const $=1e3/30,j=R=>{B=requestAnimationFrame(j);const H=R-F;H<$||(F=R,a.forEach(_=>_.update(H/1e3)),i.needsRender=!0)};return B=requestAnimationFrame(j),()=>{cancelAnimationFrame(B)}},z={play:()=>{D||(L.play(),D=E(),requestAnimationFrame(()=>{e.object&&e.object.rotation.z!==e.rad&&(e.object.rotation.z=e.rad)}))},stop:()=>{L.stop(),D==null||D(),D=void 0}};e.animation=z},h=I=>{var L;if(!e.object)return console.error("ModelEntryDoorGuidePlugin.enable(): object is ",e.object);((L=I==null?void 0:I.animationEnable)!=null?L:n)&&(e.animation||c(),e.animation.play()),i.scene.add(e.object),i.needsRender=!0},f=()=>{!e.object||(e.animation&&e.animation.stop(),i.scene.remove(e.object),i.needsRender=!0)},u=I=>I==="Floorplan"?h():f();return{load:l,enable:I=>(e.enabled||(e.enabled=!0,u(i.currentMode),i.on("modeChange",u),h(I)),!0),disable:()=>(e.enabled&&(e.enabled=!1,f(),i.off("modeChange",u)),!0)}},Hn=window.requestAnimationFrame||(i=>setTimeout(i,16)),gh=window.cancelAnimationFrame||clearTimeout;function Bi(i,t=0){t<=0?Hn(i):Hn(()=>Bi(i,t-1))}function Hi(i,t=60){let e=-1,n=0,o=-1;const s=1e3/t;function r(a){o===-1&&(o=a),e=Hn(r),!(a-n<s)&&(n=a,i&&i(a-o))}return e=Hn(r),function(){gh(e)}}const vh=Li.Easing;function bh(i,t,e,n=vh.Linear.None){const o=new Li.Tween(i).to(t,e).easing(n);Bi(()=>o.start(0));const s=Hi(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 Ah(i,t){return bh({progress:0},{progress:1},i,t)}var Js=(i=>(i.Move="Move",i.Rotate="Rotate",i))(Js||{}),et=(i=>(i.Clockwise="Clockwise",i.Anticlockwise="Anticlockwise",i.Loop="Loop",i))(et||{});const Sn=Math.PI*2;function Qo(i){return(i%Sn+Sn)%Sn}function Wo(i){return i%Sn}function di(i,t,e){return i+(t-i)*e}const wi=(i,t,e)=>{const n=Math.PI,o=n*2;return i=Qo(i),t=Qo(t),e===et.Anticlockwise&&i<t&&(i+=o),e===et.Clockwise&&t<i&&(t+=o),e===et.Loop&&t-i>n?wi(i,t,et.Anticlockwise):e===et.Loop&&i-t>n?wi(i,t,et.Clockwise):{from:i,to:t}},yh=i=>{const t={},e=async(s,r,a={preload:!0})=>(t.interruptCallback&&t.interruptCallback(!1),a.asyncStartCallback&&await a.asyncStartCallback(),s.mode&&s.mode!==i.currentMode&&await i.changeMode(s.mode),a.preload&&s.panoIndex!==void 0&&s.panoIndex!==i.panoIndex&&await i.preloadPano(s.panoIndex),a.asyncEndCallback&&await a.asyncEndCallback(),s.panoIndex===void 0&&s.fov===void 0&&s.latitude===void 0&&s.longitude===void 0?!0:await new Promise((l,c)=>{const h=s.panoIndex!==void 0?s.panoIndex:i.panoIndex;h!==void 0?i.moveToPano(h,Object.assign({duration:r,moveEndCallback:()=>l(!0),moveCancelCallback:()=>c(!1)},s)):c(!1)})),n=s=>{const r=i.state,a=Wo(r.latitude),l=Wo(s.latitude),{from:c,to:h}=wi(r.longitude,s.longitude,s.rotation||et.Loop),f=r.fov,u=s.fov;return{from:{latitude:a,longitude:c,fov:f},to:{latitude:l,longitude:h,fov:u}}};return{move:e,rotate:async(s,r,a={})=>{t.interruptCallback&&t.interruptCallback(!1),a.asyncStartCallback&&await a.asyncStartCallback(),i.currentMode!==ye.Five.Mode.Panorama&&await i.changeMode(ye.Five.Mode.Panorama),s.panoIndex!==void 0&&s.panoIndex!==i.panoIndex&&(a.preload&&await i.preloadPano(s.panoIndex),await new Promise((h,f)=>{if(!s.panoIndex){h(!0);return}i.moveToPano(s.panoIndex,{moveEndCallback:()=>h(!0),moveCancelCallback:()=>f(!1)})})),a.asyncEndCallback&&await a.asyncEndCallback();const{from:l,to:c}=n(s);return await new Promise(h=>{const f=({progress:b})=>{const y={};y.longitude=di(l.longitude,c.longitude,b),y.latitude=di(l.latitude,c.latitude,b),y.fov=di(l.fov,c.fov,b),i.setState(y,!0)},u=()=>{h(!0)},m=()=>{h(!1)},g=s.rotateSpeed?Math.ceil(Math.abs(c.longitude-l.longitude)/s.rotateSpeed*1e3):r,v=Ah(g,Li.Easing.Linear.None).onUpdate(f).onComplete(u).onDestroy(m);s.rotation===et.Loop&&v.repeat(1/0).yoyo(!0),t.interruptCallback=(b=!0)=>{v.destroy(),t.interruptCallback=void 0,t.timeoutId&&(clearTimeout(t.timeoutId),t.timeoutId=void 0),h(b)},t.timeoutId=setTimeout(()=>{t.interruptCallback&&t.interruptCallback(!0)},r)})}}};function Yo(i,t){return i.x===t.x&&i.y===t.y}function Us(i,t){return Math.abs(i)===1/0&&Math.abs(t)===1/0?!0:Math.abs(i-t)<.001}function Fn(i,t){return(t.y-i.y)/(t.x-i.x)}function qs(i,t,e){const n=Fn(i[1],i[0]),o=Fn(t[1],t[0]);if(isNaN(n)||isNaN(o)||Us(n,o))return!1;if(Pn(i[0],t))return i[0];if(Pn(i[1],t))return i[1];if(Pn(t[0],i))return t[0];if(Pn(t[1],i))return t[1];if(e&&!Ph(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 Pn(i,t){return Yo(i,t[0])||Yo(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&&Us(Fn(t[0],i),Fn(i,t[1]))}function wn(i,t,e){return(i.x-e.x)*(t.y-e.y)-(t.x-e.x)*(i.y-e.y)}function Ph(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)&&wn(t[0],i[1],i[0])*wn(i[1],t[1],i[0])>0&&wn(i[0],t[1],t[0])*wn(t[1],i[1],t[0])>0?1:0}function Ks(i,t=0){t<=0?requestAnimationFrame(i):requestAnimationFrame(()=>Ks(i,t-1))}const wh=`<style type="text/css">
|
|
114
114
|
.PanoRulerPlugin-rule-line {
|
|
115
115
|
position: absolute;
|
|
116
116
|
transform-origin: left center;
|
|
@@ -203,13 +203,13 @@ transition: all 500ms;
|
|
|
203
203
|
<div class="PanoRulerPlugin-rule-label-name">${e.options.distanceText(b)}</div>
|
|
204
204
|
</div>
|
|
205
205
|
</div>
|
|
206
|
-
`,I=document.createElement("div");return I.setAttribute("class","PanoRulerPlugin-rule"),I.setAttribute("data-name",v),I.setAttribute("style","display: none"),I.innerHTML=y,I},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=wh,o.appendChild(s);const r={},a=(v,b)=>{if(e.loaded)throw new Error("\u6807\u5C3A\u88AB\u91CD\u590D\u521D\u59CB\u5316\uFF01");const y=Ih(v,i),I=i.work;if(!I)return!1;for(const P in b){const k=b[P],{standingPosition:D}=I.observers[0],E=k.map(({x:T,z:C,observers:z})=>{const B=z.length>0?v.rooms[v.observers[z[0]]].name:"",F=y[B]?y[B].floor:null;let $=1/0,j={index:0,x:D.x,y:D.y,z:D.z};z.forEach(Y=>{if(!I.observers[Y])return;const{standingPosition:ee}=I.observers[Y],se={index:Y,x:ee.x,y:ee.y,z:ee.z},ie=Eh({x:T,z:C},se);F?ie<$&&Math.abs(se.y-F)<.3&&($=ie,j=se):ie<$&&($=ie,j=se)});const R=new M.Vector3(T,j.y,C);Object.assign(R,{observers:z});const H=y[B]?y[B].roof:null,_=H?new M.Vector3(T,H,C):null;return _&&Object.assign(_,{observers:z}),{origin:R,vertical:_}});r[P]={origins:E.map(T=>T.origin),rules:[]};for(const{origin:T,vertical:C}of E){if(!C)continue;const z=n(P,T.distanceTo(C));o.append(z),r[P].rules.push({vertical:!0,rule:[T,C],$element:z})}for(let T=0;T<E.length;T++){let C=T+1;C>=E.length&&(C=0);const{origin:z}=E[T],{origin:B}=E[C],F=n(P,z.distanceTo(B));o.append(F),r[P].rules.push({vertical:!1,rule:[z,B],$element:F})}}return e.loaded=!0,!0},l=async(v,b,y)=>{const I=v||t.roomInfo,P=b||t.roomRules;if(!I||!P)throw new Error("\u6807\u5C3A\u6570\u636E\u4F9D\u8D56\u4E0D\u9F50\u5168\uFF01");return e.loaded=!1,e.options={...e.options,...y||{}},i.model.loaded?a(I,P):await new Promise(k=>i.once("modelLoaded",()=>k(a(I,P))))};t.roomInfo&&t.roomRules&&l(t.roomInfo,t.roomRules);const c=(v,b,y,I)=>{const P=[[{x:0,y:0},{x:y,y:0}],[{x:0,y:0},{x:0,y:I}],[{x:y,y:0},{x:y,y:I}],[{x:0,y:I},{x:y,y:I}]],k=[];for(let D=0;D<P.length;D++){const E=qs([v,b],[P[D][0],P[D][1]],!0);E&&k.push(E)}return k.length===0?!1:k},h=()=>{var z;const v=(z=i.getElement())==null?void 0:z.parentElement;if(!v||!e.loaded||Object.keys(r).length<=0)return;const{panoIndex:b,camera:y,currentMode:I}=i;if(b===void 0)return;let P;for(const B in r)B.split(",").indexOf(b.toString())>=0&&(P=B);if(!P){for(const B in r)for(const{$element:F}of r[B].rules)F.style.display="none";return}const k=y.position,D=y.getWorldDirection(new M.Vector3),E=v.clientWidth,T=v.clientHeight;if(I!==ye.Five.Mode.Panorama){for(const B in r)for(const{$element:F}of r[B].rules)F.style.display="none";return}for(const B in r)for(const{$element:F}of r[B].rules)F.style.display=B===P?"block":"none";const[C]=r[P].origins.slice().filter(B=>B.observers.indexOf(b)>=0).sort((B,F)=>{const $=B.clone().setY(0).sub(k).normalize().angleTo(D.clone().setY(0)),j=F.clone().setY(0).sub(k).normalize().angleTo(D.clone().setY(0));return $-j});for(const{rule:B,vertical:F,$element:$}of r[P].rules){const[j,R]=B,H=$.querySelector(".PanoRulerPlugin-rule-line");if(!H)return;if(!C){$.style.display="none";continue}if(j!==C&&R!==C){$.style.display="none";continue}if(j.distanceTo(R)<.3){$.style.display="none";continue}if(j.observers.indexOf(b)===-1||R.observers.indexOf(b)===-1){$.style.display="none";continue}if(j.clone().sub(k).normalize().angleTo(D)>Math.PI/2){$.style.display="none";continue}if(R.clone().sub(k).normalize().angleTo(D)>Math.PI/2){$.style.display="none";continue}const te=j.distanceTo(R);if(R.clone().sub(R.clone().sub(j).divide(new M.Vector3(2,2,2))).distanceTo(k)/te>8){$.style.display="none";continue}const se=j.clone().project(y),ie=(se.x+1)/2*E,ce=(-se.y+1)/2*T,Ae=R.clone().project(y),Ce=(Ae.x+1)/2*E,Me=(-Ae.y+1)/2*T,Z=Math.sqrt(Math.pow(Ce-ie,2)+Math.pow(Me-ce,2));let re=Z,oe=50;const q=c({x:~~ie,y:~~ce},{x:~~Ce,y:~~Me},E,T);if(q&&q.length===1&&(C===j?(re=Math.sqrt(Math.pow(q[0].x-ie,2)+Math.pow(q[0].y-ce,2)),oe=re/Z*50):C===R&&(re=Math.sqrt(Math.pow(q[0].x-Ce,2)+Math.pow(q[0].y-Me,2)),oe=100-re/Z*50)),q&&q.length===2){const He={x:(q[0].x+q[1].x)/2,y:(q[0].y+q[1].y)/2};oe=Math.sqrt(Math.pow(He.x-ie,2)+Math.pow(He.y-ce,2))/Z*100}const Qe=(Math.PI/2-Math.atan2(Ce-ie,ce-Me))/Math.PI*180,le=H.querySelector(".PanoRulerPlugin-rule-label"),Be=le.children[0].clientWidth;Be>=Z||Be/2>=oe/100*Z||Be/2>=(1-oe/100)*Z?H.style.display="none":(H.style.display="block",H.style.width=Z+"px",H.style.left=ie+"px",H.style.top=ce+"px",H.style.transform=`rotate(${-Qe}deg)`,le.style.left=`${oe}%`)}},f=()=>Ks(h),u=()=>{var v,b;return e.loaded?(e.enable||(o.setAttribute("class","PanoRulerPlugin"+(e.options.className?" "+e.options.className:"")),(b=(v=i.getElement())==null?void 0:v.parentElement)==null||b.append(o),h(),i.on("modeChange",h),i.on("cameraUpdate",f),e.enable=!0),!0):!1},m=()=>(e.enable&&(i.off("modeChange",h),i.off("cameraUpdate",f),o&&o.remove(),e.enable=!1),!0);function g(v){if(v.distanceText&&v.distanceText!==e.options.distanceText){const b=v.distanceText;e.options.distanceText=b,Object.values(r).forEach(y=>{y.rules.forEach(I=>{const[P,k]=I.rule,D=P.distanceTo(k),E=I.$element.querySelector(".PanoRulerPlugin-rule-label-name");!E||(E.innerText=b(D))})})}}return{enable:u,disable:m,load:l,state:e,changeConfigs:g}};function Ch(i){ge(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 Vo(i,t,e){const n=i.slice();return n[6]=t[e],n}function Lh(i){let t,e=i[0].children,n=[];for(let o=0;o<e.length;o+=1)n[o]=Zo(Vo(i,e,o));return{c(){t=X("div");for(let o=0;o<n.length;o+=1)n[o].c();x(t,"class","rule-mixed-line svelte-1h27ktp")},m(o,s){V(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=Vo(o,e,r);n[r]?n[r].p(a,s):(n[r]=Zo(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&&W(t),Ht(n,o)}}}function kh(i){let t,e;return{c(){t=X("em"),x(t,"class",e=je(i[0].state?"em-solid":"em-dotted")+" svelte-1h27ktp"),x(t,"style",i[3])},m(n,o){V(n,t,o)},p(n,o){o&1&&e!==(e=je(n[0].state?"em-solid":"em-dotted")+" svelte-1h27ktp")&&x(t,"class",e),o&8&&x(t,"style",n[3])},d(n){n&&W(t)}}}function Zo(i){let t,e,n=`${i[6].width}px`;return{c(){t=X("div"),x(t,"class",e=je(i[6].state?"em-solid":"em-dotted")+" svelte-1h27ktp"),x(t,"style",i[3]),S(t,"width",n)},m(o,s){V(o,t,s)},p(o,s){s&1&&e!==(e=je(o[6].state?"em-solid":"em-dotted")+" svelte-1h27ktp")&&x(t,"class",e),s&8&&x(t,"style",o[3]),s&1&&n!==(n=`${o[6].width}px`)&&S(t,"width",n)},d(o){o&&W(t)}}}function Th(i){let t,e,n,o,s=i[0].labelElement+"",r,a,l=`${i[0].labelOffset}%`,c=`${i[0].width}px`,h=`${i[0].left}px`,f=`${i[0].top}px`,u=`rotate(${i[0].rotateDeg}deg)`;function m(b,y){return b[0].children.length===0?kh:Lh}let g=m(i),v=g(i);return{c(){t=X("div"),v.c(),e=fe(),n=X("div"),o=X("div"),r=Ue(s),x(o,"class","PanoRulerPlugin-rule-label-name svelte-1h27ktp"),Ke(()=>i[4].call(o)),x(n,"class","PanoRulerPlugin-rule-label svelte-1h27ktp"),S(n,"left",l),x(t,"class","PanoRulerPlugin-rule-line svelte-1h27ktp"),S(t,"width",c),S(t,"left",h),S(t,"top",f),S(t,"transform",u),S(t,"display",i[0].visible&&i[2]?"block":"none")},m(b,y){V(b,t,y),v.m(t,null),Q(t,e),Q(t,n),Q(n,o),Q(o,r),a=Ft(o,i[4].bind(o))},p(b,[y]){g===(g=m(b))&&v?v.p(b,y):(v.d(1),v=g(b),v&&(v.c(),v.m(t,e))),y&1&&s!==(s=b[0].labelElement+"")&&dt(r,s),y&1&&l!==(l=`${b[0].labelOffset}%`)&&S(n,"left",l),y&1&&c!==(c=`${b[0].width}px`)&&S(t,"width",c),y&1&&h!==(h=`${b[0].left}px`)&&S(t,"left",h),y&1&&f!==(f=`${b[0].top}px`)&&S(t,"top",f),y&1&&u!==(u=`rotate(${b[0].rotateDeg}deg)`)&&S(t,"transform",u),y&5&&S(t,"display",b[0].visible&&b[2]?"block":"none")},i:ne,o:ne,d(b){b&&W(t),v.d(),a()}}}function Dh(i,t,e){let n,{rulerItemProp:o}=t,s=!0,r,a="data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQiIHdpZHRoPSIxMiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+PGRlZnM+PGZpbHRlciBpZD0icHJlZml4X19hIiBoZWlnaHQ9IjQwMCUiIHdpZHRoPSIxMzcuNCUiIHg9Ii0xOC43JSIgeT0iLTE1MCUiPjxmZU1vcnBob2xvZ3kgaW49IlNvdXJjZUFscGhhIiBvcG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PjwvZz48L3N2Zz4=";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 zh extends de{constructor(t){super(),ue(this,t,Dh,Th,he,{rulerItemProp:0},Ch)}}function Jo(i,t,e){const n=i.slice();return n[16]=t[e],n}function Uo(i){let t,e;return t=new zh({props:{rulerItemProp:i[16]}}),{c(){Pe(t.$$.fragment)},m(n,o){ve(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.rulerItemProp=n[16]),t.$set(s)},i(n){e||(G(t.$$.fragment,n),e=!0)},o(n){K(t.$$.fragment,n),e=!1},d(n){be(t,n)}}}function Mh(i){let t,e,n=i[0],o=[];for(let r=0;r<n.length;r+=1)o[r]=Uo(Jo(i,n,r));const s=r=>K(o[r],1,1,()=>{o[r]=null});return{c(){t=X("div");for(let r=0;r<o.length;r+=1)o[r].c()},m(r,a){V(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=Jo(r,n,l);o[l]?(o[l].p(c,a),G(o[l],1)):(o[l]=Uo(c),o[l].c(),G(o[l],1),o[l].m(t,null))}for(Ie(),l=n.length;l<o.length;l+=1)s(l);xe()}},i(r){if(!e){for(let a=0;a<n.length;a+=1)G(o[a]);e=!0}},o(r){o=o.filter(Boolean);for(let a=0;a<o.length;a+=1)K(o[a]);e=!1},d(r){r&&W(t),Ht(o,r)}}}function Sh(i,t,e){var n,o,s,r;let{five:a}=t,{rulerDatas:l}=t,{options:c}=t,h=[];const f=((o=(n=a.getElement())===null||n===void 0?void 0:n.parentElement)===null||o===void 0?void 0:o.clientWidth)||0,u=((r=(s=a.getElement())===null||s===void 0?void 0:s.parentElement)===null||r===void 0?void 0:r.clientHeight)||0,m=(P,k)=>{const D=[[{x:0,y:0},{x:f,y:0}],[{x:0,y:0},{x:0,y:u}],[{x:f,y:0},{x:f,y:u}],[{x:0,y:u},{x:f,y:u}]],E=[];for(let T=0;T<D.length;T++){const C=qs([P,k],[D[T][0],D[T][1]],!0);C&&E.push(C)}return E.length===0?!1:E},g=(P,k)=>{const D=P.clone().project(a.camera),E=(D.x+1)/2*f,T=(-D.y+1)/2*u,C=k.clone().project(a.camera),z=(C.x+1)/2*f,B=(-C.y+1)/2*u,F=Math.sqrt(Math.pow(z-E,2)+Math.pow(B-T,2));return{startLeft:E,startTop:T,endLeft:z,endTop:B,distance:F}},v=(P,k,D)=>{const E=a.camera.position,T=a.camera.getWorldDirection(new M.Vector3),C=P.clone().sub(E).normalize().angleTo(T),z=k.clone().sub(E).normalize().angleTo(T),B=P.distanceTo(k),$=k.clone().sub(k.clone().sub(P).divide(new M.Vector3(2,2,2))).distanceTo(E),{startLeft:j,startTop:R,endLeft:H,endTop:_,distance:U}=g(P,k),Y=-((Math.PI/2-Math.atan2(H-j,R-_))/Math.PI)*180;let ee=!0;D||(ee=!1),!nt(P,D)&&!nt(k,D)&&(ee=!1),B<.3&&(ee=!1),C>Math.PI/2&&(ee=!1),z>Math.PI/2&&(ee=!1),$/B>8&&(ee=!1);let se=50,ie=U;const ce=m({x:~~j,y:~~R},{x:~~H,y:~~_});if(ce&&ce.length===1&&(nt(P,D)?(ie=Math.sqrt(Math.pow(ce[0].x-j,2)+Math.pow(ce[0].y-R,2)),se=ie/U*50):nt(k,D)&&(ie=Math.sqrt(Math.pow(ce[0].x-H,2)+Math.pow(ce[0].y-_,2)),se=100-ie/U*50)),ce&&ce.length===2){const Ae={x:(ce[0].x+ce[1].x)/2,y:(ce[0].y+ce[1].y)/2};se=Math.sqrt(Math.pow(Ae.x-j,2)+Math.pow(Ae.y-R,2))/U*100}return{startLeft:j,startTop:R,distance:U,deg:Y,visible:ee,labelOffset:se,ruleLength:B}},b=()=>{const P=a.panoIndex,k=l.find(F=>F.panoIndex===P);if(!k)return e(0,h=[]);if(a.currentMode!==ye.Five.Mode.Panorama)return e(0,h=[]);const D=a.camera.position,E=a.camera.getWorldDirection(new M.Vector3),T=k.lines.map(F=>new M.Vector3(F.start[0],-F.start[1],-F.start[2])),C=k.lines.map(F=>new M.Vector3(F.end[0],-F.end[1],-F.end[2])),[z]=T.concat(C).sort((F,$)=>{const j=F.clone().setY(0).sub(D).normalize().angleTo(E.clone().setY(0)),R=$.clone().setY(0).sub(D).normalize().angleTo(E.clone().setY(0));return j-R}),B=k.lines.map(F=>{var $,j;const R=F.start,H=F.end,{startLeft:_,startTop:U,distance:te,deg:Y,visible:ee,labelOffset:se,ruleLength:ie}=v(new M.Vector3(R[0],-R[1],-R[2]),new M.Vector3(H[0],-H[1],-H[2]),z),ce=[];return F.children&&(($=F.children)===null||$===void 0?void 0:$.length)>0&&((j=F.children)===null||j===void 0||j.forEach(Ae=>{const Ce=Ae.start,Me=Ae.end,{distance:Z}=g(new M.Vector3(Ce[0],-Ce[1],-Ce[2]),new M.Vector3(Me[0],-Me[1],-Me[2]));ce.push({width:Z,state:Ae.state})})),{width:te,left:_,top:U,rotateDeg:Y,state:F.state,children:ce,labelOffset:se,visible:ee,labelElement:c.distanceText(ie)}});e(0,h=B)},y=()=>Bi(b),I=Ni(b,80);return Ct(()=>{b(),a.on("panoArrived",b),a.on("modeChange",b),a.on("cameraDirectionUpdate",y),a.on("movingToPano",y),a.on("mouseWheel",()=>I()),a.on("pinchGesture",()=>I())}),nn(()=>{a.off("panoArrived",b),a.off("modeChange",b),a.off("cameraDirectionUpdate",y),a.off("movingToPano",y),a.off("mouseWheel",()=>I()),a.off("pinchGesture",()=>I())}),i.$$set=P=>{"five"in P&&e(1,a=P.five),"rulerDatas"in P&&e(2,l=P.rulerDatas),"options"in P&&e(3,c=P.options)},[h,a,l,c]}class jh extends de{constructor(t){super(),ue(this,t,Sh,Mh,he,{five:1,rulerDatas:2,options:3})}}class Oh{constructor(t,e){d(this,"five");d(this,"container",document.createElement("div"));d(this,"panoRulerProData");d(this,"rulerItems");d(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={...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",async()=>{var s,r;(r=(s=this.five.getElement())==null?void 0:s.parentNode)==null||r.append(this.container)}),this.five.once("dispose",()=>this.dispose())}async load(t){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}async render(){var t;if(this.state.enabled){if(!this.panoRulerProData||!this.container)return;this.rulerItems=new jh({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 Rh=(i,t)=>new Oh(i,t),Nh="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZIAAABCCAYAAAB9y1BhAAAAAXNSR0IArs4c6QAADh5JREFUeAHtnVuPLDcVhedwC/dACKAICDxEIBQpygNI/Ab+MX8B8YCQEAjxgBAQLsm5Jjkn58r6Sl4jT52qnu4zXd121dqSx67q7ip7eXsv721XzcVFJAgEgSAQBIJAEAgCQeC4CLx48eKbSu+RH/fKuVoQWB8Cn1tfk9KiIHAUBH6tq/xKiTwSBILADgRCJDvA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ppwBH4MaEMpBFRSDcqCYQx9ggDphr0QUb3SMSBJpAQGPiciei9P6oYYAmGphKbA4B6TRrJ+j1HKHYzh8cZbpVBowXZ8bgQhzPNJAOvvD4QjkOAj0hUAbdUOVMoHrqudT1OgSk2zgLkAl2n/LYvh9s900kutYV4UIvQiBXMMlBEAgCQWA1CBRCgUjmHAkI5vk+PACR1BcZmGmfH64GzTQkCASBILBhBAqhgEC9rDFGJI7FGJEcB4EgEASCQBAIAkEgCASBIBAEgkAQCAJBIAgEgSAQBIJAEAgCm0fg/x4jQQWGalpFAAAAAElFTkSuQmCC";function Bh(){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(${Nh})`,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 Hh=new O.TextureLoader;async function qo(i){return new Promise((t,e)=>{Hh.load(i,t,void 0,e)}).then(t=>(t.encoding=O.sRGBEncoding,t))}class Fh extends xt.default.Tween{constructor(){super(...arguments);d(this,"disposeMethods",[]);d(this,"animationFrameDisposer");d(this,"onDispose",e=>(this.disposeMethods.push(e),this));d(this,"play",()=>(this.start(0),this.animationFrameDisposer=Hi(e=>this.update(e)),this));d(this,"dispose",()=>{var e;this.stop(),(e=this.animationFrameDisposer)==null||e.call(this),this.disposeMethods.forEach(n=>n()),this.disposeMethods=[],xt.default.remove(this)})}}function Gh(i,t=xt.default.Easing.Linear.None){const e=new Fh({progress:0}).to({progress:1});return i!==void 0&&e.duration(i),t!==void 0&&e.easing(t),e}const En={userAction:!0};class Xh extends Lt{constructor(e,n){super(e);d(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"}});d(this,"data");d(this,"group",new O.Group);d(this,"roomInfoInstance");d(this,"roomInfoWrapperInstance");d(this,"compassMeshTween");d(this,"compassMesh");d(this,"entryDoorMesh");d(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)});d(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)});d(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)});d(this,"_enable",()=>{this.five.scene.add(this.group),this.init(),this.onFivePanoArrived(this.five.panoIndex||0),this._addEventListener()});d(this,"_disable",()=>{this._clearCompassIfNeed(),this._clearEntryDoorIfNeed(),this.five.scene.remove(this.group),this._removeEventListener()});d(this,"_toggleVisible",()=>{this.group.visible=this.state.visible,this.five.needsRender=!0});d(this,"_clearCompassIfNeed",()=>{var e;this.compassMesh&&(this.group.remove(this.compassMesh),(e=this.compassMesh.material.map)==null||e.dispose(),this.compassMesh=null)});d(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)});d(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}))});d(this,"onFivePanoArrived",e=>{var o,s,r,a,l,c,h;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=Gh(1e3).onUpdate(({progress:f})=>{var u;(u=this.compassMesh)==null||u.material.setValues({opacity:f}),this.five.needsRender=!0}).play())),this.entryDoorMesh){const u=new O.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(u.clone().multiplyScalar(.7)).setY(n.y+.01);this.entryDoorMesh.rotation.z=new O.Vector3(0,0,-1).angleTo(u),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}):(h=this.entryDoorMesh)==null||h.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});d(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())});d(this,"onFiveModeChange",(e,n,o,s,r)=>{e!==n&&this.setState({visible:e===ye.Five.Mode.Panorama},{userAction:r})});this.five.scene.add(this.group),this.five.once("dispose",this.dispose),this.setState({visible:!0,enabled:!0,config:{...this.state.config,...n||{}}})}enable(e=En){this.setState({enabled:!0},e)}disable(e=En){this.setState({enabled:!1},e)}show(e=En){if(!!this.state.enabled)return this.setState({visible:!0},e),Promise.resolve()}hide(e=En){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:{...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()}async load(e,n,o=!0){const s=await this.formatData(e);JSON.stringify(this.data)!==JSON.stringify(s)&&(this.hooks.emit("dataChange",s,this.data),this.data={...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)}async init(){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=await 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=await this.loadEntryDoorMesh(),this.roomInfoWrapperInstance=this.loadRoomInfo(),this.roomInfoInstance=Bh(),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}async loadCompassMesh(){const e=this.state.config.compassImageUrl,n=await qo(e),o=new O.CircleGeometry(.7,32),s=new O.MeshBasicMaterial({map:n,transparent:!0,opacity:0,depthTest:!1}),r=new O.Mesh(o,s);return r.name="pano-compass-mesh",r}async loadEntryDoorMesh(){const e=this.state.config.entryDoorImageUrl,n=await qo(e),o=new O.PlaneGeometry(.2,.16),s=new O.MeshBasicMaterial({map:n,transparent:!0,opacity:.8,depthTest:!1}),r=new O.Mesh(o,s);return r.name="pano-compass-entry-door",r}loadRoomInfo(){const e=[new O.Vector3(-.7,0,-.7),new O.Vector3(.7,0,-.7),new O.Vector3(.7,0,.7),new O.Vector3(-.7,0,.7)];return Xn(this.five).create3DDomContainer(e)}}const Qh=(i,t)=>new Xh(i,t);var _s={exports:{}};/*! Hammer.JS - v2.0.7 - 2016-04-22
|
|
206
|
+
`,I=document.createElement("div");return I.setAttribute("class","PanoRulerPlugin-rule"),I.setAttribute("data-name",v),I.setAttribute("style","display: none"),I.innerHTML=y,I},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=wh,o.appendChild(s);const r={},a=(v,b)=>{if(e.loaded)throw new Error("\u6807\u5C3A\u88AB\u91CD\u590D\u521D\u59CB\u5316\uFF01");const y=Ih(v,i),I=i.work;if(!I)return!1;for(const P in b){const L=b[P],{standingPosition:D}=I.observers[0],E=L.map(({x:T,z:C,observers:z})=>{const B=z.length>0?v.rooms[v.observers[z[0]]].name:"",F=y[B]?y[B].floor:null;let $=1/0,j={index:0,x:D.x,y:D.y,z:D.z};z.forEach(Y=>{if(!I.observers[Y])return;const{standingPosition:ee}=I.observers[Y],se={index:Y,x:ee.x,y:ee.y,z:ee.z},ie=Eh({x:T,z:C},se);F?ie<$&&Math.abs(se.y-F)<.3&&($=ie,j=se):ie<$&&($=ie,j=se)});const R=new M.Vector3(T,j.y,C);Object.assign(R,{observers:z});const H=y[B]?y[B].roof:null,_=H?new M.Vector3(T,H,C):null;return _&&Object.assign(_,{observers:z}),{origin:R,vertical:_}});r[P]={origins:E.map(T=>T.origin),rules:[]};for(const{origin:T,vertical:C}of E){if(!C)continue;const z=n(P,T.distanceTo(C));o.append(z),r[P].rules.push({vertical:!0,rule:[T,C],$element:z})}for(let T=0;T<E.length;T++){let C=T+1;C>=E.length&&(C=0);const{origin:z}=E[T],{origin:B}=E[C],F=n(P,z.distanceTo(B));o.append(F),r[P].rules.push({vertical:!1,rule:[z,B],$element:F})}}return e.loaded=!0,!0},l=async(v,b,y)=>{const I=v||t.roomInfo,P=b||t.roomRules;if(!I||!P)throw new Error("\u6807\u5C3A\u6570\u636E\u4F9D\u8D56\u4E0D\u9F50\u5168\uFF01");return e.loaded=!1,e.options={...e.options,...y||{}},i.model.loaded?a(I,P):await new Promise(L=>i.once("modelLoaded",()=>L(a(I,P))))};t.roomInfo&&t.roomRules&&l(t.roomInfo,t.roomRules);const c=(v,b,y,I)=>{const P=[[{x:0,y:0},{x:y,y:0}],[{x:0,y:0},{x:0,y:I}],[{x:y,y:0},{x:y,y:I}],[{x:0,y:I},{x:y,y:I}]],L=[];for(let D=0;D<P.length;D++){const E=qs([v,b],[P[D][0],P[D][1]],!0);E&&L.push(E)}return L.length===0?!1:L},h=()=>{var z;const v=(z=i.getElement())==null?void 0:z.parentElement;if(!v||!e.loaded||Object.keys(r).length<=0)return;const{panoIndex:b,camera:y,currentMode:I}=i;if(b===void 0)return;let P;for(const B in r)B.split(",").indexOf(b.toString())>=0&&(P=B);if(!P){for(const B in r)for(const{$element:F}of r[B].rules)F.style.display="none";return}const L=y.position,D=y.getWorldDirection(new M.Vector3),E=v.clientWidth,T=v.clientHeight;if(I!==ye.Five.Mode.Panorama){for(const B in r)for(const{$element:F}of r[B].rules)F.style.display="none";return}for(const B in r)for(const{$element:F}of r[B].rules)F.style.display=B===P?"block":"none";const[C]=r[P].origins.slice().filter(B=>B.observers.indexOf(b)>=0).sort((B,F)=>{const $=B.clone().setY(0).sub(L).normalize().angleTo(D.clone().setY(0)),j=F.clone().setY(0).sub(L).normalize().angleTo(D.clone().setY(0));return $-j});for(const{rule:B,vertical:F,$element:$}of r[P].rules){const[j,R]=B,H=$.querySelector(".PanoRulerPlugin-rule-line");if(!H)return;if(!C){$.style.display="none";continue}if(j!==C&&R!==C){$.style.display="none";continue}if(j.distanceTo(R)<.3){$.style.display="none";continue}if(j.observers.indexOf(b)===-1||R.observers.indexOf(b)===-1){$.style.display="none";continue}if(j.clone().sub(L).normalize().angleTo(D)>Math.PI/2){$.style.display="none";continue}if(R.clone().sub(L).normalize().angleTo(D)>Math.PI/2){$.style.display="none";continue}const te=j.distanceTo(R);if(R.clone().sub(R.clone().sub(j).divide(new M.Vector3(2,2,2))).distanceTo(L)/te>8){$.style.display="none";continue}const se=j.clone().project(y),ie=(se.x+1)/2*E,ce=(-se.y+1)/2*T,Ae=R.clone().project(y),Ce=(Ae.x+1)/2*E,Me=(-Ae.y+1)/2*T,Z=Math.sqrt(Math.pow(Ce-ie,2)+Math.pow(Me-ce,2));let re=Z,oe=50;const q=c({x:~~ie,y:~~ce},{x:~~Ce,y:~~Me},E,T);if(q&&q.length===1&&(C===j?(re=Math.sqrt(Math.pow(q[0].x-ie,2)+Math.pow(q[0].y-ce,2)),oe=re/Z*50):C===R&&(re=Math.sqrt(Math.pow(q[0].x-Ce,2)+Math.pow(q[0].y-Me,2)),oe=100-re/Z*50)),q&&q.length===2){const He={x:(q[0].x+q[1].x)/2,y:(q[0].y+q[1].y)/2};oe=Math.sqrt(Math.pow(He.x-ie,2)+Math.pow(He.y-ce,2))/Z*100}const Qe=(Math.PI/2-Math.atan2(Ce-ie,ce-Me))/Math.PI*180,le=H.querySelector(".PanoRulerPlugin-rule-label"),Be=le.children[0].clientWidth;Be>=Z||Be/2>=oe/100*Z||Be/2>=(1-oe/100)*Z?H.style.display="none":(H.style.display="block",H.style.width=Z+"px",H.style.left=ie+"px",H.style.top=ce+"px",H.style.transform=`rotate(${-Qe}deg)`,le.style.left=`${oe}%`)}},f=()=>Ks(h),u=()=>{var v,b;return e.loaded?(e.enable||(o.setAttribute("class","PanoRulerPlugin"+(e.options.className?" "+e.options.className:"")),(b=(v=i.getElement())==null?void 0:v.parentElement)==null||b.append(o),h(),i.on("modeChange",h),i.on("cameraUpdate",f),e.enable=!0),!0):!1},m=()=>(e.enable&&(i.off("modeChange",h),i.off("cameraUpdate",f),o&&o.remove(),e.enable=!1),!0);function g(v){if(v.distanceText&&v.distanceText!==e.options.distanceText){const b=v.distanceText;e.options.distanceText=b,Object.values(r).forEach(y=>{y.rules.forEach(I=>{const[P,L]=I.rule,D=P.distanceTo(L),E=I.$element.querySelector(".PanoRulerPlugin-rule-label-name");!E||(E.innerText=b(D))})})}}return{enable:u,disable:m,load:l,state:e,changeConfigs:g}};function Ch(i){ge(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 Vo(i,t,e){const n=i.slice();return n[6]=t[e],n}function Lh(i){let t,e=i[0].children,n=[];for(let o=0;o<e.length;o+=1)n[o]=Zo(Vo(i,e,o));return{c(){t=X("div");for(let o=0;o<n.length;o+=1)n[o].c();x(t,"class","rule-mixed-line svelte-1h27ktp")},m(o,s){V(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=Vo(o,e,r);n[r]?n[r].p(a,s):(n[r]=Zo(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&&W(t),Ht(n,o)}}}function kh(i){let t,e;return{c(){t=X("em"),x(t,"class",e=je(i[0].state?"em-solid":"em-dotted")+" svelte-1h27ktp"),x(t,"style",i[3])},m(n,o){V(n,t,o)},p(n,o){o&1&&e!==(e=je(n[0].state?"em-solid":"em-dotted")+" svelte-1h27ktp")&&x(t,"class",e),o&8&&x(t,"style",n[3])},d(n){n&&W(t)}}}function Zo(i){let t,e,n=`${i[6].width}px`;return{c(){t=X("div"),x(t,"class",e=je(i[6].state?"em-solid":"em-dotted")+" svelte-1h27ktp"),x(t,"style",i[3]),S(t,"width",n)},m(o,s){V(o,t,s)},p(o,s){s&1&&e!==(e=je(o[6].state?"em-solid":"em-dotted")+" svelte-1h27ktp")&&x(t,"class",e),s&8&&x(t,"style",o[3]),s&1&&n!==(n=`${o[6].width}px`)&&S(t,"width",n)},d(o){o&&W(t)}}}function Th(i){let t,e,n,o,s=i[0].labelElement+"",r,a,l=`${i[0].labelOffset}%`,c=`${i[0].width}px`,h=`${i[0].left}px`,f=`${i[0].top}px`,u=`rotate(${i[0].rotateDeg}deg)`;function m(b,y){return b[0].children.length===0?kh:Lh}let g=m(i),v=g(i);return{c(){t=X("div"),v.c(),e=fe(),n=X("div"),o=X("div"),r=Ue(s),x(o,"class","PanoRulerPlugin-rule-label-name svelte-1h27ktp"),Ke(()=>i[4].call(o)),x(n,"class","PanoRulerPlugin-rule-label svelte-1h27ktp"),S(n,"left",l),x(t,"class","PanoRulerPlugin-rule-line svelte-1h27ktp"),S(t,"width",c),S(t,"left",h),S(t,"top",f),S(t,"transform",u),S(t,"display",i[0].visible&&i[2]?"block":"none")},m(b,y){V(b,t,y),v.m(t,null),Q(t,e),Q(t,n),Q(n,o),Q(o,r),a=Ft(o,i[4].bind(o))},p(b,[y]){g===(g=m(b))&&v?v.p(b,y):(v.d(1),v=g(b),v&&(v.c(),v.m(t,e))),y&1&&s!==(s=b[0].labelElement+"")&&dt(r,s),y&1&&l!==(l=`${b[0].labelOffset}%`)&&S(n,"left",l),y&1&&c!==(c=`${b[0].width}px`)&&S(t,"width",c),y&1&&h!==(h=`${b[0].left}px`)&&S(t,"left",h),y&1&&f!==(f=`${b[0].top}px`)&&S(t,"top",f),y&1&&u!==(u=`rotate(${b[0].rotateDeg}deg)`)&&S(t,"transform",u),y&5&&S(t,"display",b[0].visible&&b[2]?"block":"none")},i:ne,o:ne,d(b){b&&W(t),v.d(),a()}}}function Dh(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 zh extends de{constructor(t){super(),ue(this,t,Dh,Th,he,{rulerItemProp:0},Ch)}}function Jo(i,t,e){const n=i.slice();return n[16]=t[e],n}function Uo(i){let t,e;return t=new zh({props:{rulerItemProp:i[16]}}),{c(){Pe(t.$$.fragment)},m(n,o){ve(t,n,o),e=!0},p(n,o){const s={};o&1&&(s.rulerItemProp=n[16]),t.$set(s)},i(n){e||(G(t.$$.fragment,n),e=!0)},o(n){K(t.$$.fragment,n),e=!1},d(n){be(t,n)}}}function Mh(i){let t,e,n=i[0],o=[];for(let r=0;r<n.length;r+=1)o[r]=Uo(Jo(i,n,r));const s=r=>K(o[r],1,1,()=>{o[r]=null});return{c(){t=X("div");for(let r=0;r<o.length;r+=1)o[r].c()},m(r,a){V(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=Jo(r,n,l);o[l]?(o[l].p(c,a),G(o[l],1)):(o[l]=Uo(c),o[l].c(),G(o[l],1),o[l].m(t,null))}for(Ie(),l=n.length;l<o.length;l+=1)s(l);xe()}},i(r){if(!e){for(let a=0;a<n.length;a+=1)G(o[a]);e=!0}},o(r){o=o.filter(Boolean);for(let a=0;a<o.length;a+=1)K(o[a]);e=!1},d(r){r&&W(t),Ht(o,r)}}}function Sh(i,t,e){var n,o,s,r;let{five:a}=t,{rulerDatas:l}=t,{options:c}=t,h=[];const f=((o=(n=a.getElement())===null||n===void 0?void 0:n.parentElement)===null||o===void 0?void 0:o.clientWidth)||0,u=((r=(s=a.getElement())===null||s===void 0?void 0:s.parentElement)===null||r===void 0?void 0:r.clientHeight)||0,m=(P,L)=>{const D=[[{x:0,y:0},{x:f,y:0}],[{x:0,y:0},{x:0,y:u}],[{x:f,y:0},{x:f,y:u}],[{x:0,y:u},{x:f,y:u}]],E=[];for(let T=0;T<D.length;T++){const C=qs([P,L],[D[T][0],D[T][1]],!0);C&&E.push(C)}return E.length===0?!1:E},g=(P,L)=>{const D=P.clone().project(a.camera),E=(D.x+1)/2*f,T=(-D.y+1)/2*u,C=L.clone().project(a.camera),z=(C.x+1)/2*f,B=(-C.y+1)/2*u,F=Math.sqrt(Math.pow(z-E,2)+Math.pow(B-T,2));return{startLeft:E,startTop:T,endLeft:z,endTop:B,distance:F}},v=(P,L,D)=>{const E=a.camera.position,T=a.camera.getWorldDirection(new M.Vector3),C=P.clone().sub(E).normalize().angleTo(T),z=L.clone().sub(E).normalize().angleTo(T),B=P.distanceTo(L),$=L.clone().sub(L.clone().sub(P).divide(new M.Vector3(2,2,2))).distanceTo(E),{startLeft:j,startTop:R,endLeft:H,endTop:_,distance:U}=g(P,L),Y=-((Math.PI/2-Math.atan2(H-j,R-_))/Math.PI)*180;let ee=!0;D||(ee=!1),!nt(P,D)&&!nt(L,D)&&(ee=!1),B<.3&&(ee=!1),C>Math.PI/2&&(ee=!1),z>Math.PI/2&&(ee=!1),$/B>8&&(ee=!1);let se=50,ie=U;const ce=m({x:~~j,y:~~R},{x:~~H,y:~~_});if(ce&&ce.length===1&&(nt(P,D)?(ie=Math.sqrt(Math.pow(ce[0].x-j,2)+Math.pow(ce[0].y-R,2)),se=ie/U*50):nt(L,D)&&(ie=Math.sqrt(Math.pow(ce[0].x-H,2)+Math.pow(ce[0].y-_,2)),se=100-ie/U*50)),ce&&ce.length===2){const Ae={x:(ce[0].x+ce[1].x)/2,y:(ce[0].y+ce[1].y)/2};se=Math.sqrt(Math.pow(Ae.x-j,2)+Math.pow(Ae.y-R,2))/U*100}return{startLeft:j,startTop:R,distance:U,deg:Y,visible:ee,labelOffset:se,ruleLength:B}},b=()=>{const P=a.panoIndex,L=l.find(F=>F.panoIndex===P);if(!L)return e(0,h=[]);if(a.currentMode!==ye.Five.Mode.Panorama)return e(0,h=[]);const D=a.camera.position,E=a.camera.getWorldDirection(new M.Vector3),T=L.lines.map(F=>new M.Vector3(F.start[0],-F.start[1],-F.start[2])),C=L.lines.map(F=>new M.Vector3(F.end[0],-F.end[1],-F.end[2])),[z]=T.concat(C).sort((F,$)=>{const j=F.clone().setY(0).sub(D).normalize().angleTo(E.clone().setY(0)),R=$.clone().setY(0).sub(D).normalize().angleTo(E.clone().setY(0));return j-R}),B=L.lines.map(F=>{var $,j;const R=F.start,H=F.end,{startLeft:_,startTop:U,distance:te,deg:Y,visible:ee,labelOffset:se,ruleLength:ie}=v(new M.Vector3(R[0],-R[1],-R[2]),new M.Vector3(H[0],-H[1],-H[2]),z),ce=[];return F.children&&(($=F.children)===null||$===void 0?void 0:$.length)>0&&((j=F.children)===null||j===void 0||j.forEach(Ae=>{const Ce=Ae.start,Me=Ae.end,{distance:Z}=g(new M.Vector3(Ce[0],-Ce[1],-Ce[2]),new M.Vector3(Me[0],-Me[1],-Me[2]));ce.push({width:Z,state:Ae.state})})),{width:te,left:_,top:U,rotateDeg:Y,state:F.state,children:ce,labelOffset:se,visible:ee,labelElement:c.distanceText(ie)}});e(0,h=B)},y=()=>Bi(b),I=Ni(b,80);return Ct(()=>{b(),a.on("panoArrived",b),a.on("modeChange",b),a.on("cameraDirectionUpdate",y),a.on("movingToPano",y),a.on("mouseWheel",()=>I()),a.on("pinchGesture",()=>I())}),nn(()=>{a.off("panoArrived",b),a.off("modeChange",b),a.off("cameraDirectionUpdate",y),a.off("movingToPano",y),a.off("mouseWheel",()=>I()),a.off("pinchGesture",()=>I())}),i.$$set=P=>{"five"in P&&e(1,a=P.five),"rulerDatas"in P&&e(2,l=P.rulerDatas),"options"in P&&e(3,c=P.options)},[h,a,l,c]}class jh extends de{constructor(t){super(),ue(this,t,Sh,Mh,he,{five:1,rulerDatas:2,options:3})}}class Oh{constructor(t,e){d(this,"five");d(this,"container",document.createElement("div"));d(this,"panoRulerProData");d(this,"rulerItems");d(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={...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",async()=>{var s,r;(r=(s=this.five.getElement())==null?void 0:s.parentNode)==null||r.append(this.container)}),this.five.once("dispose",()=>this.dispose())}async load(t){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}async render(){var t;if(this.state.enabled){if(!this.panoRulerProData||!this.container)return;this.rulerItems=new jh({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 Rh=(i,t)=>new Oh(i,t),Nh="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZIAAABCCAYAAAB9y1BhAAAAAXNSR0IArs4c6QAADh5JREFUeAHtnVuPLDcVhedwC/dACKAICDxEIBQpygNI/Ab+MX8B8YCQEAjxgBAQLsm5Jjkn58r6Sl4jT52qnu4zXd121dqSx67q7ip7eXsv721XzcVFJAgEgSAQBIJAEAgCQeC4CLx48eKbSu+RH/fKuVoQWB8Cn1tfk9KiIHAUBH6tq/xKiTwSBILADgRCJDvAyUebRuAbpfXxSDatBmn8Pgh8YZ8v5TtBYIMIvFCbSZEgEASuQSBEcg1A+XizCDzfbMvT8CBwIAIhkgMBy9c3g0CIZDNdnYbeFIEQyU0RzO/XikCIZK09m3YdHYEQydEhzQVXgkCIZCUdmWYsj0CIZHmMc4c+EchCe5/9llqfAYEQyRlAzy27QCAeSRfdlEq2gECIpIVeSB1aRAAiudVixVKnINAaAiGS1nok9WkFAUJb8Upa6Y3Uo2kEQiRNd08qd0YEQiJnBD+37guBEElf/ZXang6BEMnpsM6d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0fg/x4jQQWGalpFAAAAAElFTkSuQmCC";function Bh(){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(${Nh})`,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 Hh=new O.TextureLoader;async function qo(i){return new Promise((t,e)=>{Hh.load(i,t,void 0,e)}).then(t=>(t.encoding=O.sRGBEncoding,t))}class Fh extends xt.default.Tween{constructor(){super(...arguments);d(this,"disposeMethods",[]);d(this,"animationFrameDisposer");d(this,"onDispose",e=>(this.disposeMethods.push(e),this));d(this,"play",()=>(this.start(0),this.animationFrameDisposer=Hi(e=>this.update(e)),this));d(this,"dispose",()=>{var e;this.stop(),(e=this.animationFrameDisposer)==null||e.call(this),this.disposeMethods.forEach(n=>n()),this.disposeMethods=[],xt.default.remove(this)})}}function Gh(i,t=xt.default.Easing.Linear.None){const e=new Fh({progress:0}).to({progress:1});return i!==void 0&&e.duration(i),t!==void 0&&e.easing(t),e}const En={userAction:!0};class Xh extends Lt{constructor(e,n){super(e);d(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"}});d(this,"data");d(this,"group",new O.Group);d(this,"roomInfoInstance");d(this,"roomInfoWrapperInstance");d(this,"compassMeshTween");d(this,"compassMesh");d(this,"entryDoorMesh");d(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)});d(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)});d(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)});d(this,"_enable",()=>{this.five.scene.add(this.group),this.init(),this.onFivePanoArrived(this.five.panoIndex||0),this._addEventListener()});d(this,"_disable",()=>{this._clearCompassIfNeed(),this._clearEntryDoorIfNeed(),this.five.scene.remove(this.group),this._removeEventListener()});d(this,"_toggleVisible",()=>{this.group.visible=this.state.visible,this.five.needsRender=!0});d(this,"_clearCompassIfNeed",()=>{var e;this.compassMesh&&(this.group.remove(this.compassMesh),(e=this.compassMesh.material.map)==null||e.dispose(),this.compassMesh=null)});d(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)});d(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}))});d(this,"onFivePanoArrived",e=>{var o,s,r,a,l,c,h;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=Gh(1e3).onUpdate(({progress:f})=>{var u;(u=this.compassMesh)==null||u.material.setValues({opacity:f}),this.five.needsRender=!0}).play())),this.entryDoorMesh){const u=new O.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(u.clone().multiplyScalar(.7)).setY(n.y+.01);this.entryDoorMesh.rotation.z=new O.Vector3(0,0,-1).angleTo(u),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}):(h=this.entryDoorMesh)==null||h.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});d(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())});d(this,"onFiveModeChange",(e,n,o,s,r)=>{e!==n&&this.setState({visible:e===ye.Five.Mode.Panorama},{userAction:r})});this.five.scene.add(this.group),this.five.once("dispose",this.dispose),this.setState({visible:!0,enabled:!0,config:{...this.state.config,...n||{}}})}enable(e=En){this.setState({enabled:!0},e)}disable(e=En){this.setState({enabled:!1},e)}show(e=En){if(!!this.state.enabled)return this.setState({visible:!0},e),Promise.resolve()}hide(e=En){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:{...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()}async load(e,n,o=!0){const s=await this.formatData(e);JSON.stringify(this.data)!==JSON.stringify(s)&&(this.hooks.emit("dataChange",s,this.data),this.data={...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)}async init(){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=await 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=await this.loadEntryDoorMesh(),this.roomInfoWrapperInstance=this.loadRoomInfo(),this.roomInfoInstance=Bh(),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}async loadCompassMesh(){const e=this.state.config.compassImageUrl,n=await qo(e),o=new O.CircleGeometry(.7,32),s=new O.MeshBasicMaterial({map:n,transparent:!0,opacity:0,depthTest:!1}),r=new O.Mesh(o,s);return r.name="pano-compass-mesh",r}async loadEntryDoorMesh(){const e=this.state.config.entryDoorImageUrl,n=await qo(e),o=new O.PlaneGeometry(.2,.16),s=new O.MeshBasicMaterial({map:n,transparent:!0,opacity:.8,depthTest:!1}),r=new O.Mesh(o,s);return r.name="pano-compass-entry-door",r}loadRoomInfo(){const e=[new O.Vector3(-.7,0,-.7),new O.Vector3(.7,0,-.7),new O.Vector3(.7,0,.7),new O.Vector3(-.7,0,.7)];return Xn(this.five).create3DDomContainer(e)}}const Qh=(i,t)=>new Xh(i,t);var _s={exports:{}};/*! Hammer.JS - v2.0.7 - 2016-04-22
|
|
207
207
|
* http://hammerjs.github.io/
|
|
208
208
|
*
|
|
209
209
|
* Copyright (c) 2016 Jorik Tangelder;
|
|
210
|
-
* Licensed under the MIT license */(function(i){(function(t,e,n,o){var s=["","webkit","Moz","MS","ms","o"],r=e.createElement("div"),a="function",l=Math.round,c=Math.abs,h=Date.now;function f(p,A,w){return setTimeout(P(p,w),A)}function u(p,A,w){return Array.isArray(p)?(m(p,w[A],w),!0):!1}function m(p,A,w){var
|
|
210
|
+
* Licensed under the MIT license */(function(i){(function(t,e,n,o){var s=["","webkit","Moz","MS","ms","o"],r=e.createElement("div"),a="function",l=Math.round,c=Math.abs,h=Date.now;function f(p,A,w){return setTimeout(P(p,w),A)}function u(p,A,w){return Array.isArray(p)?(m(p,w[A],w),!0):!1}function m(p,A,w){var k;if(!!p)if(p.forEach)p.forEach(A,w);else if(p.length!==o)for(k=0;k<p.length;)A.call(w,p[k],k,p),k++;else for(k in p)p.hasOwnProperty(k)&&A.call(w,p[k],k,p)}function g(p,A,w){var k="DEPRECATED METHOD: "+A+`
|
|
211
211
|
`+w+` AT
|
|
212
|
-
`;return function(){var N=new Error("get-stack-trace"),J=N&&N.stack?N.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",ae=t.console&&(t.console.warn||t.console.log);return ae&&ae.call(t.console,L,J),p.apply(this,arguments)}}var v;typeof Object.assign!="function"?v=function(A){if(A===o||A===null)throw new TypeError("Cannot convert undefined or null to object");for(var w=Object(A),L=1;L<arguments.length;L++){var N=arguments[L];if(N!==o&&N!==null)for(var J in N)N.hasOwnProperty(J)&&(w[J]=N[J])}return w}:v=Object.assign;var b=g(function(A,w,L){for(var N=Object.keys(w),J=0;J<N.length;)(!L||L&&A[N[J]]===o)&&(A[N[J]]=w[N[J]]),J++;return A},"extend","Use `assign`."),y=g(function(A,w){return b(A,w,!0)},"merge","Use `assign`.");function I(p,A,w){var L=A.prototype,N;N=p.prototype=Object.create(L),N.constructor=p,N._super=L,w&&v(N,w)}function P(p,A){return function(){return p.apply(A,arguments)}}function k(p,A){return typeof p==a?p.apply(A&&A[0]||o,A):p}function D(p,A){return p===o?A:p}function E(p,A,w){m(B(A),function(L){p.addEventListener(L,w,!1)})}function T(p,A,w){m(B(A),function(L){p.removeEventListener(L,w,!1)})}function C(p,A){for(;p;){if(p==A)return!0;p=p.parentNode}return!1}function z(p,A){return p.indexOf(A)>-1}function B(p){return p.trim().split(/\s+/g)}function F(p,A,w){if(p.indexOf&&!w)return p.indexOf(A);for(var L=0;L<p.length;){if(w&&p[L][w]==A||!w&&p[L]===A)return L;L++}return-1}function $(p){return Array.prototype.slice.call(p,0)}function j(p,A,w){for(var L=[],N=[],J=0;J<p.length;){var ae=A?p[J][A]:p[J];F(N,ae)<0&&L.push(p[J]),N[J]=ae,J++}return w&&(A?L=L.sort(function(ze,Oe){return ze[A]>Oe[A]}):L=L.sort()),L}function R(p,A){for(var w,L,N=A[0].toUpperCase()+A.slice(1),J=0;J<s.length;){if(w=s[J],L=w?w+N:A,L in p)return L;J++}return o}var H=1;function _(){return H++}function U(p){var A=p.ownerDocument||p;return A.defaultView||A.parentWindow||t}var te=/mobile|tablet|ip(ad|hone|od)|android/i,Y="ontouchstart"in t,ee=R(t,"PointerEvent")!==o,se=Y&&te.test(navigator.userAgent),ie="touch",ce="pen",Ae="mouse",Ce="kinect",Me=25,Z=1,re=2,oe=4,q=8,Ne=1,Qe=2,le=4,Be=8,He=16,me=Qe|le,Ee=Be|He,We=me|Ee,ft=["x","y"],Ze=["clientX","clientY"];function Le(p,A){var w=this;this.manager=p,this.callback=A,this.element=p.element,this.target=p.options.inputTarget,this.domHandler=function(L){k(p.options.enable,[p])&&w.handler(L)},this.init()}Le.prototype={handler:function(){},init:function(){this.evEl&&E(this.element,this.evEl,this.domHandler),this.evTarget&&E(this.target,this.evTarget,this.domHandler),this.evWin&&E(U(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&T(this.element,this.evEl,this.domHandler),this.evTarget&&T(this.target,this.evTarget,this.domHandler),this.evWin&&T(U(this.element),this.evWin,this.domHandler)}};function we(p){var A,w=p.options.inputClass;return w?A=w:ee?A=_n:se?A=ln:Y?A=$n:A=an,new A(p,ke)}function ke(p,A,w){var L=w.pointers.length,N=w.changedPointers.length,J=A&Z&&L-N===0,ae=A&(oe|q)&&L-N===0;w.isFirst=!!J,w.isFinal=!!ae,J&&(p.session={}),w.eventType=A,st(p,w),p.emit("hammer.input",w),p.recognize(w),p.session.prevInput=w}function st(p,A){var w=p.session,L=A.pointers,N=L.length;w.firstInput||(w.firstInput=Qt(A)),N>1&&!w.firstMultiple?w.firstMultiple=Qt(A):N===1&&(w.firstMultiple=!1);var J=w.firstInput,ae=w.firstMultiple,Te=ae?ae.center:J.center,ze=A.center=on(L);A.timeStamp=h(),A.deltaTime=A.timeStamp-J.timeStamp,A.angle=Wt(Te,ze),A.distance=Tt(Te,ze),kt(w,A),A.offsetDirection=rn(A.deltaX,A.deltaY);var Oe=sn(A.deltaTime,A.deltaX,A.deltaY);A.overallVelocityX=Oe.x,A.overallVelocityY=Oe.y,A.overallVelocity=c(Oe.x)>c(Oe.y)?Oe.x:Oe.y,A.scale=ae?Ar(ae.pointers,L):1,A.rotation=ae?br(ae.pointers,L):0,A.maxPointers=w.prevInput?A.pointers.length>w.prevInput.maxPointers?A.pointers.length:w.prevInput.maxPointers:A.pointers.length,Kn(w,A);var $e=p.element;C(A.srcEvent.target,$e)&&($e=A.srcEvent.target),A.target=$e}function kt(p,A){var w=A.center,L=p.offsetDelta||{},N=p.prevDelta||{},J=p.prevInput||{};(A.eventType===Z||J.eventType===oe)&&(N=p.prevDelta={x:J.deltaX||0,y:J.deltaY||0},L=p.offsetDelta={x:w.x,y:w.y}),A.deltaX=N.x+(w.x-L.x),A.deltaY=N.y+(w.y-L.y)}function Kn(p,A){var w=p.lastInterval||A,L=A.timeStamp-w.timeStamp,N,J,ae,Te;if(A.eventType!=q&&(L>Me||w.velocity===o)){var ze=A.deltaX-w.deltaX,Oe=A.deltaY-w.deltaY,$e=sn(L,ze,Oe);J=$e.x,ae=$e.y,N=c($e.x)>c($e.y)?$e.x:$e.y,Te=rn(ze,Oe),p.lastInterval=A}else N=w.velocity,J=w.velocityX,ae=w.velocityY,Te=w.direction;A.velocity=N,A.velocityX=J,A.velocityY=ae,A.direction=Te}function Qt(p){for(var A=[],w=0;w<p.pointers.length;)A[w]={clientX:l(p.pointers[w].clientX),clientY:l(p.pointers[w].clientY)},w++;return{timeStamp:h(),pointers:A,center:on(A),deltaX:p.deltaX,deltaY:p.deltaY}}function on(p){var A=p.length;if(A===1)return{x:l(p[0].clientX),y:l(p[0].clientY)};for(var w=0,L=0,N=0;N<A;)w+=p[N].clientX,L+=p[N].clientY,N++;return{x:l(w/A),y:l(L/A)}}function sn(p,A,w){return{x:A/p||0,y:w/p||0}}function rn(p,A){return p===A?Ne:c(p)>=c(A)?p<0?Qe:le:A<0?Be:He}function Tt(p,A,w){w||(w=ft);var L=A[w[0]]-p[w[0]],N=A[w[1]]-p[w[1]];return Math.sqrt(L*L+N*N)}function Wt(p,A,w){w||(w=ft);var L=A[w[0]]-p[w[0]],N=A[w[1]]-p[w[1]];return Math.atan2(N,L)*180/Math.PI}function br(p,A){return Wt(A[1],A[0],Ze)+Wt(p[1],p[0],Ze)}function Ar(p,A){return Tt(A[0],A[1],Ze)/Tt(p[0],p[1],Ze)}var yr={mousedown:Z,mousemove:re,mouseup:oe},Pr="mousedown",wr="mousemove mouseup";function an(){this.evEl=Pr,this.evWin=wr,this.pressed=!1,Le.apply(this,arguments)}I(an,Le,{handler:function(A){var w=yr[A.type];w&Z&&A.button===0&&(this.pressed=!0),w&re&&A.which!==1&&(w=oe),this.pressed&&(w&oe&&(this.pressed=!1),this.callback(this.manager,w,{pointers:[A],changedPointers:[A],pointerType:Ae,srcEvent:A}))}});var Er={pointerdown:Z,pointermove:re,pointerup:oe,pointercancel:q,pointerout:q},Ir={2:ie,3:ce,4:Ae,5:Ce},Qi="pointerdown",Wi="pointermove pointerup pointercancel";t.MSPointerEvent&&!t.PointerEvent&&(Qi="MSPointerDown",Wi="MSPointerMove MSPointerUp MSPointerCancel");function _n(){this.evEl=Qi,this.evWin=Wi,Le.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}I(_n,Le,{handler:function(A){var w=this.store,L=!1,N=A.type.toLowerCase().replace("ms",""),J=Er[N],ae=Ir[A.pointerType]||A.pointerType,Te=ae==ie,ze=F(w,A.pointerId,"pointerId");J&Z&&(A.button===0||Te)?ze<0&&(w.push(A),ze=w.length-1):J&(oe|q)&&(L=!0),!(ze<0)&&(w[ze]=A,this.callback(this.manager,J,{pointers:w,changedPointers:[A],pointerType:ae,srcEvent:A}),L&&w.splice(ze,1))}});var xr={touchstart:Z,touchmove:re,touchend:oe,touchcancel:q},Cr="touchstart",Lr="touchstart touchmove touchend touchcancel";function Yi(){this.evTarget=Cr,this.evWin=Lr,this.started=!1,Le.apply(this,arguments)}I(Yi,Le,{handler:function(A){var w=xr[A.type];if(w===Z&&(this.started=!0),!!this.started){var L=kr.call(this,A,w);w&(oe|q)&&L[0].length-L[1].length===0&&(this.started=!1),this.callback(this.manager,w,{pointers:L[0],changedPointers:L[1],pointerType:ie,srcEvent:A})}}});function kr(p,A){var w=$(p.touches),L=$(p.changedTouches);return A&(oe|q)&&(w=j(w.concat(L),"identifier",!0)),[w,L]}var Tr={touchstart:Z,touchmove:re,touchend:oe,touchcancel:q},Dr="touchstart touchmove touchend touchcancel";function ln(){this.evTarget=Dr,this.targetIds={},Le.apply(this,arguments)}I(ln,Le,{handler:function(A){var w=Tr[A.type],L=zr.call(this,A,w);!L||this.callback(this.manager,w,{pointers:L[0],changedPointers:L[1],pointerType:ie,srcEvent:A})}});function zr(p,A){var w=$(p.touches),L=this.targetIds;if(A&(Z|re)&&w.length===1)return L[w[0].identifier]=!0,[w,w];var N,J,ae=$(p.changedTouches),Te=[],ze=this.target;if(J=w.filter(function(Oe){return C(Oe.target,ze)}),A===Z)for(N=0;N<J.length;)L[J[N].identifier]=!0,N++;for(N=0;N<ae.length;)L[ae[N].identifier]&&Te.push(ae[N]),A&(oe|q)&&delete L[ae[N].identifier],N++;if(!!Te.length)return[j(J.concat(Te),"identifier",!0),Te]}var Mr=2500,Vi=25;function $n(){Le.apply(this,arguments);var p=P(this.handler,this);this.touch=new ln(this.manager,p),this.mouse=new an(this.manager,p),this.primaryTouch=null,this.lastTouches=[]}I($n,Le,{handler:function(A,w,L){var N=L.pointerType==ie,J=L.pointerType==Ae;if(!(J&&L.sourceCapabilities&&L.sourceCapabilities.firesTouchEvents)){if(N)Sr.call(this,w,L);else if(J&&jr.call(this,L))return;this.callback(A,w,L)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function Sr(p,A){p&Z?(this.primaryTouch=A.changedPointers[0].identifier,Zi.call(this,A)):p&(oe|q)&&Zi.call(this,A)}function Zi(p){var A=p.changedPointers[0];if(A.identifier===this.primaryTouch){var w={x:A.clientX,y:A.clientY};this.lastTouches.push(w);var L=this.lastTouches,N=function(){var J=L.indexOf(w);J>-1&&L.splice(J,1)};setTimeout(N,Mr)}}function jr(p){for(var A=p.srcEvent.clientX,w=p.srcEvent.clientY,L=0;L<this.lastTouches.length;L++){var N=this.lastTouches[L],J=Math.abs(A-N.x),ae=Math.abs(w-N.y);if(J<=Vi&&ae<=Vi)return!0}return!1}var Ji=R(r.style,"touchAction"),Ui=Ji!==o,qi="compute",Ki="auto",ei="manipulation",yt="none",Yt="pan-x",Vt="pan-y",cn=Rr();function ti(p,A){this.manager=p,this.set(A)}ti.prototype={set:function(p){p==qi&&(p=this.compute()),Ui&&this.manager.element.style&&cn[p]&&(this.manager.element.style[Ji]=p),this.actions=p.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var p=[];return m(this.manager.recognizers,function(A){k(A.options.enable,[A])&&(p=p.concat(A.getTouchAction()))}),Or(p.join(" "))},preventDefaults:function(p){var A=p.srcEvent,w=p.offsetDirection;if(this.manager.session.prevented){A.preventDefault();return}var L=this.actions,N=z(L,yt)&&!cn[yt],J=z(L,Vt)&&!cn[Vt],ae=z(L,Yt)&&!cn[Yt];if(N){var Te=p.pointers.length===1,ze=p.distance<2,Oe=p.deltaTime<250;if(Te&&ze&&Oe)return}if(!(ae&&J)&&(N||J&&w&me||ae&&w&Ee))return this.preventSrc(A)},preventSrc:function(p){this.manager.session.prevented=!0,p.preventDefault()}};function Or(p){if(z(p,yt))return yt;var A=z(p,Yt),w=z(p,Vt);return A&&w?yt:A||w?A?Yt:Vt:z(p,ei)?ei:Ki}function Rr(){if(!Ui)return!1;var p={},A=t.CSS&&t.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(w){p[w]=A?t.CSS.supports("touch-action",w):!0}),p}var hn=1,Ve=2,Dt=4,mt=8,rt=mt,Zt=16,_e=32;function at(p){this.options=v({},this.defaults,p||{}),this.id=_(),this.manager=null,this.options.enable=D(this.options.enable,!0),this.state=hn,this.simultaneous={},this.requireFail=[]}at.prototype={defaults:{},set:function(p){return v(this.options,p),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(p){if(u(p,"recognizeWith",this))return this;var A=this.simultaneous;return p=un(p,this),A[p.id]||(A[p.id]=p,p.recognizeWith(this)),this},dropRecognizeWith:function(p){return u(p,"dropRecognizeWith",this)?this:(p=un(p,this),delete this.simultaneous[p.id],this)},requireFailure:function(p){if(u(p,"requireFailure",this))return this;var A=this.requireFail;return p=un(p,this),F(A,p)===-1&&(A.push(p),p.requireFailure(this)),this},dropRequireFailure:function(p){if(u(p,"dropRequireFailure",this))return this;p=un(p,this);var A=F(this.requireFail,p);return A>-1&&this.requireFail.splice(A,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(p){return!!this.simultaneous[p.id]},emit:function(p){var A=this,w=this.state;function L(N){A.manager.emit(N,p)}w<mt&&L(A.options.event+_i(w)),L(A.options.event),p.additionalEvent&&L(p.additionalEvent),w>=mt&&L(A.options.event+_i(w))},tryEmit:function(p){if(this.canEmit())return this.emit(p);this.state=_e},canEmit:function(){for(var p=0;p<this.requireFail.length;){if(!(this.requireFail[p].state&(_e|hn)))return!1;p++}return!0},recognize:function(p){var A=v({},p);if(!k(this.options.enable,[this,A])){this.reset(),this.state=_e;return}this.state&(rt|Zt|_e)&&(this.state=hn),this.state=this.process(A),this.state&(Ve|Dt|mt|Zt)&&this.tryEmit(A)},process:function(p){},getTouchAction:function(){},reset:function(){}};function _i(p){return p&Zt?"cancel":p&mt?"end":p&Dt?"move":p&Ve?"start":""}function $i(p){return p==He?"down":p==Be?"up":p==Qe?"left":p==le?"right":""}function un(p,A){var w=A.manager;return w?w.get(p):p}function Je(){at.apply(this,arguments)}I(Je,at,{defaults:{pointers:1},attrTest:function(p){var A=this.options.pointers;return A===0||p.pointers.length===A},process:function(p){var A=this.state,w=p.eventType,L=A&(Ve|Dt),N=this.attrTest(p);return L&&(w&q||!N)?A|Zt:L||N?w&oe?A|mt:A&Ve?A|Dt:Ve:_e}});function dn(){Je.apply(this,arguments),this.pX=null,this.pY=null}I(dn,Je,{defaults:{event:"pan",threshold:10,pointers:1,direction:We},getTouchAction:function(){var p=this.options.direction,A=[];return p&me&&A.push(Vt),p&Ee&&A.push(Yt),A},directionTest:function(p){var A=this.options,w=!0,L=p.distance,N=p.direction,J=p.deltaX,ae=p.deltaY;return N&A.direction||(A.direction&me?(N=J===0?Ne:J<0?Qe:le,w=J!=this.pX,L=Math.abs(p.deltaX)):(N=ae===0?Ne:ae<0?Be:He,w=ae!=this.pY,L=Math.abs(p.deltaY))),p.direction=N,w&&L>A.threshold&&N&A.direction},attrTest:function(p){return Je.prototype.attrTest.call(this,p)&&(this.state&Ve||!(this.state&Ve)&&this.directionTest(p))},emit:function(p){this.pX=p.deltaX,this.pY=p.deltaY;var A=$i(p.direction);A&&(p.additionalEvent=this.options.event+A),this._super.emit.call(this,p)}});function ni(){Je.apply(this,arguments)}I(ni,Je,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[yt]},attrTest:function(p){return this._super.attrTest.call(this,p)&&(Math.abs(p.scale-1)>this.options.threshold||this.state&Ve)},emit:function(p){if(p.scale!==1){var A=p.scale<1?"in":"out";p.additionalEvent=this.options.event+A}this._super.emit.call(this,p)}});function ii(){at.apply(this,arguments),this._timer=null,this._input=null}I(ii,at,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Ki]},process:function(p){var A=this.options,w=p.pointers.length===A.pointers,L=p.distance<A.threshold,N=p.deltaTime>A.time;if(this._input=p,!L||!w||p.eventType&(oe|q)&&!N)this.reset();else if(p.eventType&Z)this.reset(),this._timer=f(function(){this.state=rt,this.tryEmit()},A.time,this);else if(p.eventType&oe)return rt;return _e},reset:function(){clearTimeout(this._timer)},emit:function(p){this.state===rt&&(p&&p.eventType&oe?this.manager.emit(this.options.event+"up",p):(this._input.timeStamp=h(),this.manager.emit(this.options.event,this._input)))}});function oi(){Je.apply(this,arguments)}I(oi,Je,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[yt]},attrTest:function(p){return this._super.attrTest.call(this,p)&&(Math.abs(p.rotation)>this.options.threshold||this.state&Ve)}});function si(){Je.apply(this,arguments)}I(si,Je,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:me|Ee,pointers:1},getTouchAction:function(){return dn.prototype.getTouchAction.call(this)},attrTest:function(p){var A=this.options.direction,w;return A&(me|Ee)?w=p.overallVelocity:A&me?w=p.overallVelocityX:A&Ee&&(w=p.overallVelocityY),this._super.attrTest.call(this,p)&&A&p.offsetDirection&&p.distance>this.options.threshold&&p.maxPointers==this.options.pointers&&c(w)>this.options.velocity&&p.eventType&oe},emit:function(p){var A=$i(p.offsetDirection);A&&this.manager.emit(this.options.event+A,p),this.manager.emit(this.options.event,p)}});function fn(){at.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}I(fn,at,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[ei]},process:function(p){var A=this.options,w=p.pointers.length===A.pointers,L=p.distance<A.threshold,N=p.deltaTime<A.time;if(this.reset(),p.eventType&Z&&this.count===0)return this.failTimeout();if(L&&N&&w){if(p.eventType!=oe)return this.failTimeout();var J=this.pTime?p.timeStamp-this.pTime<A.interval:!0,ae=!this.pCenter||Tt(this.pCenter,p.center)<A.posThreshold;this.pTime=p.timeStamp,this.pCenter=p.center,!ae||!J?this.count=1:this.count+=1,this._input=p;var Te=this.count%A.taps;if(Te===0)return this.hasRequireFailures()?(this._timer=f(function(){this.state=rt,this.tryEmit()},A.interval,this),Ve):rt}return _e},failTimeout:function(){return this._timer=f(function(){this.state=_e},this.options.interval,this),_e},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==rt&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function lt(p,A){return A=A||{},A.recognizers=D(A.recognizers,lt.defaults.preset),new ri(p,A)}lt.VERSION="2.0.7",lt.defaults={domEvents:!1,touchAction:qi,enable:!0,inputTarget:null,inputClass:null,preset:[[oi,{enable:!1}],[ni,{enable:!1},["rotate"]],[si,{direction:me}],[dn,{direction:me},["swipe"]],[fn],[fn,{event:"doubletap",taps:2},["tap"]],[ii]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var Nr=1,eo=2;function ri(p,A){this.options=v({},lt.defaults,A||{}),this.options.inputTarget=this.options.inputTarget||p,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=p,this.input=we(this),this.touchAction=new ti(this,this.options.touchAction),to(this,!0),m(this.options.recognizers,function(w){var L=this.add(new w[0](w[1]));w[2]&&L.recognizeWith(w[2]),w[3]&&L.requireFailure(w[3])},this)}ri.prototype={set:function(p){return v(this.options,p),p.touchAction&&this.touchAction.update(),p.inputTarget&&(this.input.destroy(),this.input.target=p.inputTarget,this.input.init()),this},stop:function(p){this.session.stopped=p?eo:Nr},recognize:function(p){var A=this.session;if(!A.stopped){this.touchAction.preventDefaults(p);var w,L=this.recognizers,N=A.curRecognizer;(!N||N&&N.state&rt)&&(N=A.curRecognizer=null);for(var J=0;J<L.length;)w=L[J],A.stopped!==eo&&(!N||w==N||w.canRecognizeWith(N))?w.recognize(p):w.reset(),!N&&w.state&(Ve|Dt|mt)&&(N=A.curRecognizer=w),J++}},get:function(p){if(p instanceof at)return p;for(var A=this.recognizers,w=0;w<A.length;w++)if(A[w].options.event==p)return A[w];return null},add:function(p){if(u(p,"add",this))return this;var A=this.get(p.options.event);return A&&this.remove(A),this.recognizers.push(p),p.manager=this,this.touchAction.update(),p},remove:function(p){if(u(p,"remove",this))return this;if(p=this.get(p),p){var A=this.recognizers,w=F(A,p);w!==-1&&(A.splice(w,1),this.touchAction.update())}return this},on:function(p,A){if(p!==o&&A!==o){var w=this.handlers;return m(B(p),function(L){w[L]=w[L]||[],w[L].push(A)}),this}},off:function(p,A){if(p!==o){var w=this.handlers;return m(B(p),function(L){A?w[L]&&w[L].splice(F(w[L],A),1):delete w[L]}),this}},emit:function(p,A){this.options.domEvents&&Br(p,A);var w=this.handlers[p]&&this.handlers[p].slice();if(!(!w||!w.length)){A.type=p,A.preventDefault=function(){A.srcEvent.preventDefault()};for(var L=0;L<w.length;)w[L](A),L++}},destroy:function(){this.element&&to(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function to(p,A){var w=p.element;if(!!w.style){var L;m(p.options.cssProps,function(N,J){L=R(w.style,J),A?(p.oldCssProps[L]=w.style[L],w.style[L]=N):w.style[L]=p.oldCssProps[L]||""}),A||(p.oldCssProps={})}}function Br(p,A){var w=e.createEvent("Event");w.initEvent(p,!0,!0),w.gesture=A,A.target.dispatchEvent(w)}v(lt,{INPUT_START:Z,INPUT_MOVE:re,INPUT_END:oe,INPUT_CANCEL:q,STATE_POSSIBLE:hn,STATE_BEGAN:Ve,STATE_CHANGED:Dt,STATE_ENDED:mt,STATE_RECOGNIZED:rt,STATE_CANCELLED:Zt,STATE_FAILED:_e,DIRECTION_NONE:Ne,DIRECTION_LEFT:Qe,DIRECTION_RIGHT:le,DIRECTION_UP:Be,DIRECTION_DOWN:He,DIRECTION_HORIZONTAL:me,DIRECTION_VERTICAL:Ee,DIRECTION_ALL:We,Manager:ri,Input:Le,TouchAction:ti,TouchInput:ln,MouseInput:an,PointerEventInput:_n,TouchMouseInput:$n,SingleTouchInput:Yi,Recognizer:at,AttrRecognizer:Je,Tap:fn,Pan:dn,Swipe:si,Pinch:ni,Rotate:oi,Press:ii,on:E,off:T,each:m,merge:y,extend:b,assign:v,inherit:I,bindFn:P,prefixed:R});var Hr=typeof t<"u"?t:typeof self<"u"?self:{};Hr.Hammer=lt,typeof o=="function"&&o.amd?o(function(){return lt}):i.exports?i.exports=lt:t[n]=lt})(window,document,"Hammer")})(_s);const Zn=_s.exports;function In(i,t,e){const n=i[t];i[t]=i[e],i[e]=n}function Wh(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;In(i,a*4+0,l*4+0),In(i,a*4+1,l*4+1),In(i,a*4+2,l*4+2),In(i,a*4+3,l*4+3)}}}class $s{constructor(t,e){d(this,"width");d(this,"height");d(this,"visible",!1);d(this,"hooks",new ye.Subscribe);d(this,"contentDom",document.createElement("canvas"));d(this,"five");d(this,"scale");d(this,"wrapper");d(this,"config");d(this,"offset",{x:0,y:0});d(this,"canvas",this.contentDom);d(this,"context");d(this,"renderCenter",new O.Vector3);d(this,"lastPanEvent");d(this,"hammer");d(this,"onPan",t=>{var c,h,f,u;if(!this.wrapper)return;const e=(h=(c=this.lastPanEvent)==null?void 0:c.deltaX)!=null?h:0,n=(u=(f=this.lastPanEvent)==null?void 0:f.deltaY)!=null?u:0,o=t.deltaX-e,s=t.deltaY-n;if(this.lastPanEvent=t,this.hooks.emit("wantsPanGesture",{srcEvent:t,deltaX:o,deltaY:s}))return;const a=this.offset.x+o,l=this.offset.y+s;this.contentDom.style.boxShadow="0 2px 30px 0 rgba(0,0,0,0.20)",this.canvas.style.transform=`translate3d(${a}px, ${l}px, 100px)`,this.offset={x:a,y:l}});d(this,"onPanEnd",t=>{this.lastPanEvent=void 0,this.contentDom.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 Zn(this.canvas),this.hammer.on("pan",this.onPan),this.hammer.on("panend",this.onPanEnd))}dispose(){var t;this.clear(),this.remove(),(t=this.hammer)==null||t.destroy()}remove(){this.canvas.remove(),this.visible=!1}clear(){this.context.clearRect(0,0,this.canvas.width,this.canvas.height)}appendTo(t){this.wrapper=t,this.initStyle(),t.append(this.canvas),this.visible=!0}renderWithPoint(t){!this.wrapper||(this.renderCenter=t,this.render(),this.config.autoFixPCPosition&&this.autoFixPCPosition())}autoFixPCPosition(){if(!this.wrapper)return;const{width:t,height:e}=this,n=this.renderCenter.clone().project(this.five.camera),o=(n.x+1)/2*this.wrapper.clientWidth,s=-(n.x-1)/2*this.wrapper.clientWidth,r=-(n.y-1)/2*this.wrapper.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.wrapper)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 O.Vector2),a=1,l=n/t,c=o/t,h=a*t,f=(s.x+1)/2*r.x,u=(s.y+1)/2*r.y,m=this.five.getPixels(f-l/2,u-l/2,l,c,h),g=Math.floor(n*a),v=Math.floor(o*a);Wh(m,g,v);const b=new ImageData(g,v);b.data.set(m),e.putImageData(b,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")}}class Yh{constructor(t){d(this,"edges",[]);d(this,"five");d(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 M.Vector3),r=s.distanceTo(t.point);r<e&&(n=s,e=r)}),e>.1?null:n||null}}class Ei{constructor(){d(this,"id",ut());d(this,"points",[]);d(this,"lines",[])}push(t){const e=this.getNext(t);if(!e)throw new Error("\u5F53\u524D\u7EBF\u6BB5\u4E8E\u4E0A\u4E00\u6761\u7EBF\u6BB5\u65E0\u6CD5\u6784\u6210\u6298\u7EBF");return this.lines.push(e.line),this.points.push(...e.points),this.lines.length}pop(){const t=this.lines.pop();return this.lines.length===0?this.points.slice(0,this.points.length):this.points.pop(),t}getNext(t){const e=this.points.slice(-1)[0];if(!e)return{line:t,points:t.points};if(!t.points.includes(e))return null;const n=t.points.find(o=>o!==e);return n?{line:t,points:[n]}:null}toJson(){return{id:this.id,lines:this.lines.map(t=>t.id),points:this.points.map(t=>t.id)}}toCompletelyJson(){return{id:this.id,points:this.points.map(t=>t.toJson()),lines:this.lines.map(t=>t.toCompletelyJson())}}}const Vh=1,Zh=3,Jh=new M.Color(16777215),Uh=new M.Color(6522623),qh=new M.Color(16777215),Kh=new M.Color(6522623),_h=6,$h=8,eu="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgBAMAAACBVGfHAAAAIVBMVEUAAAD////////////////////////////////////////PIev5AAAACnRSTlMAG/Py2baba05un7UgfgAAAHJJREFUKM9joBpgLHVSCRdA4metAoJlCJHmVWBgAeNzroKCCVCBLpjACqgJVjCBxRBT2FbBQQJYQAohsBAsUIUQWA4WiEIILAULeCEEloAFtBACizAEMLRgGIphLabDMJ2O6TlM72MGECIIMQIZIxqoBQCPvpJ/e9FaAAAAAABJRU5ErkJggg==",er=new M.TextureLoader().load(eu),tr={pointTexture:er,pointSize:_h,lineWidth:Vh,lineColor:Jh,pointColor:qh,lineRenderOrder:20,pointsRenderOrder:20};({...tr});const tu={pointTexture:er,pointSize:$h,lineWidth:Zh,lineColor:Uh,pointColor:Kh,lineRenderOrder:10,pointsRenderOrder:10};function nu(i,t,e){var h,f,u,m,g;const n=(h=e==null?void 0:e.lineWidth)!=null?h:2,o=(f=e==null?void 0:e.lineColor)!=null?f:new M.Color(16777215),s=(u=e==null?void 0:e.pointSize)!=null?u: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 Cs.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 Ko(i,t){const[e,n]=i.points,o=t==="light"?tu:tr,s=nu(e.position,n.position,o);return s.name="normalLine_"+i.id,s}function it(i){const{x:t,y:e,z:n}=i;return!(Math.abs(t)>1||Math.abs(e)>1||Math.abs(n)>1)}function iu(){const i=document.createElement("div");return i.setAttribute("style","backdrop-filter: blur(4px);-webkit-backdrop-filter: blur(4px);"),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.pointerEvents="all",i.style.cursor="pointer",i}function ou(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.transform="translate3d(0, 0, 0)",t.style.transformOrigin="left top",t}function su(i){function t(){var g;(g=i.clickCallback)==null||g.call(i,m)}function e(){if(f)return f.highlight();c.style.border="0.5px solid #95AEFF",c.style.background="linear-gradient(90deg, #95AEFF 0%, #6386FF 100%)"}function n(){if(f)return f.unHighlight();c.style.border="0.5px solid rgba(255,255,255,0.6)",c.style.background="rgba(195,195,195,0.70)"}function o(g){const v=g.getElement();if(!v)return;const b=v.clientWidth,y=v.clientHeight;if(a.points.length<2)return;const[I,P]=a.points,k=I.position.clone().project(g.camera),D=P.position.clone().project(g.camera),E=k.clone().lerp(D,.5),T=new M.Vector2(k.x*b,k.y*y),C=new M.Vector2(D.x*b,D.y*y);if((()=>!(Math.abs(k.z)>1||Math.abs(D.z)>1||!it(k)&&!it(D)||!it(E)||T.distanceTo(C)<20))()===!1){h.style.opacity="0",h.style.pointerEvents="none";return}const B=(E.x+1)/2*b,F=-(E.y-1)/2*y,j=-(Math.atan((T.y-C.y)/(T.x-C.x))*180)/Math.PI;h.style.transform=`translate(${B}px, ${F}px) rotate(${j}deg)`,h.style.opacity="1",h.style.pointerEvents="all",f&&f.update({line:a.toCompletelyJson(),polyline:a.getPolyline().toCompletelyJson()});const R=I.position.clone().distanceTo(P.position),H=i.line.model.params.getDistanceText(R);c.innerText!==H&&(c.innerText=H)}function s(g){g.appendChild(h),h.addEventListener("click",t)}function r(){c.removeEventListener("click",t),h.remove()}const{line:a}=i,l=a.id,c=iu(),h=ou(a),f=i.userDistanceItem,u=new M.Vector3(0,0,0),m={lineID:l,ndcPosition:u,update:o,appendTo:s,remove:r,highlight:e,unHighlight:n};return f!=null&&f.element?h.appendChild(f.element):h.appendChild(c),m}class Xt{constructor(t,e,n){d(this,"id");d(this,"selected",!1);d(this,"type","line");d(this,"model");d(this,"mesh");d(this,"points");d(this,"lightMesh");d(this,"hook");d(this,"distanceItem");d(this,"polyline");if(this.id=ut(),this.model=n,t.id===e.id)throw new Error("\u65E0\u6548\u7684\u7EBF\u6BB5, \u4E00\u4E2A\u70B9\u65E0\u6CD5\u6784\u6210\u7EBF\u6BB5");this.hook=new ye.Subscribe,this.points=[t,e],this.mesh=Ko(this,"normal"),this.lightMesh=Ko(this,"light"),this.distanceItem=su({line:this,clickCallback:()=>this.hook.emit("selected",this),userDistanceItem:this.model.params.userDistanceItemCreator?this.model.params.userDistanceItemCreator():void 0}),t.lines.push(this),e.lines.push(this)}clear(){this.selected=!1,this.polyline=void 0}getPolyline(){if(this.polyline)return this.polyline;const t=this.model.polylines.find(n=>n.lines.includes(this));if(this.polyline=t,t)return t;const e=new Ei;return e.push(this),e}findAnotherPoint(t){return this.points.find(({id:e})=>e!==t.id)}toJson(){return{id:this.id,points:this.points.map(({id:t})=>t)}}toCompletelyJson(){return{id:this.id,points:this.points.map(t=>t.toJson())}}clone(){return new Xt(this.points[0].clone(),this.points[1].clone(),this.model)}}function Kt(i,t){for(let e=0,n=t.length;e<n;e++)if(i===t[e])return t.splice(e,1)[0]}class ot{constructor(t){d(this,"id");d(this,"lines");d(this,"position");d(this,"type","point");this.id=ut(),this.lines=[],this.position=new M.Vector3,t instanceof M.Vector3?this.position.copy(t):this.position.fromArray(t)}toJson(){return{id:this.id,lines:this.lines.map(({id:t})=>t),position:this.position.toArray()}}addLine(t){this.lines.push(t)}removeLine(t){Kt(t,this.lines)}clone(){return new ot(this.position)}}class Fi{constructor(t){d(this,"lines",[]);d(this,"points",[]);d(this,"params");d(this,"polylines",[]);d(this,"hook",new ye.Subscribe);this.params=t}addLine(t){const[e,n]=t.points;if(!e||!n)return this;this.includes(e)||this.points.push(e),this.includes(n)||this.points.push(n),this.lines.push(t);const o=this.polylines.find(s=>!!s.getNext(t));if(o)o.push(t);else{const s=new Ei;s.push(t),this.polylines.push(s)}this.hook.emit("lineAdded",t)}removeLineByID(t){const e=this.getLineByID(t);e&&this.removeLine(e)}removeLine(t){const e=this.polylines.find(s=>s.lines.includes(t));if(e){if(e.lines.slice(-1)[0]!==t)throw new Error("\u4E0D\u80FD\u4ECE\u4E2D\u95F4\u5220\u9664\u7EBF\u6BB5");e.pop(),e.lines.length===0&&Kt(e,this.polylines)}const[n,o]=t.points;return n.lines.length===0&&Kt(n,this.points),o.lines.length===0&&Kt(o,this.points),Kt(t,this.lines),t.clear(),this.hook.emit("lineRemoved",t),this}mergeModel(t){t.lines.forEach(e=>this.addLine(e))}includes(t){if(t.type==="point")return this.points.find(({id:e})=>e===t.id)!==void 0;if(t.type==="line")return this.lines.find(({id:e})=>e===t.id)!==void 0}getPointByID(t){return this.points.find(({id:e})=>e===t)}getLineByID(t){return this.lines.find(({id:e})=>e===t)}getClosestPoint(){}parse(t){const e=t.points.map(({id:s,position:r})=>{const a=new ot(r);return a.id=s,a}),n=t.lines.map(s=>{const[r,a]=s.points,l=this.getPointByID.call({points:e},r),c=this.getPointByID.call({points:e},a);if(!l||!c)throw new Error("\u7EBF\u4E0A\u7684\u70B9\u4E0D\u5B58\u5728");const h=new Xt(l,c,this);return h.id=s.id,h}),o=t.polylines.map(s=>{const r=new Ei;return s.lines.forEach(a=>{const l=n.find(({id:c})=>c===a);l&&r.push(l)}),r});return this.points.splice(0,this.points.length,...e),this.lines.splice(0,this.lines.length,...n),this.polylines.splice(0,this.polylines.length,...o),this}toJson(){return{points:this.points.map(t=>t.toJson()),lines:this.lines.map(t=>t.toJson()),polylines:this.polylines.map(t=>t.toJson()).filter(t=>t.lines.length>0)}}}const xn=i=>i.preventDefault();class Jn{constructor(t){d(this,"model");d(this,"five");d(this,"group");d(this,"config");d(this,"dashed");d(this,"disposed",!1);d(this,"isMobile");d(this,"mouseGroup");d(this,"container");d(this,"fiveHelper");d(this,"hook");d(this,"magnifier");d(this,"userDistanceItemCreator");d(this,"updateDistanceUI",()=>{this.dashed.distanceItem.update(this.five),this.model.lines.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 Xt(new ot([0,0,0]),new ot([0,0,0]),this.model),this.dashed.mesh.setMaterial({dashed:!0,dashScale:100}),this.dashed.mesh.name="dashLine";const e=this.five.getElement();e&&(e.addEventListener("touchstart",xn),e.addEventListener("contextmenu",xn))}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.remove(),this.model.lines.forEach(e=>this.removeLine(e));const t=this.five.getElement();t&&(t.removeEventListener("touchstart",xn),t.removeEventListener("contextmenu",xn))}}function Ii(i){const{x:t,y:e}=i.center,{clientWidth:n,clientHeight:o}=i.target,s=i.target.getBoundingClientRect(),r=new M.Vector2(t,e).sub(new M.Vector2(s.left,s.top)),a=new M.Vector2(r.x/n*2-1,-(r.y/o)*2+1);return{point:r,ndcPoint:a}}function fi(i,t){const e=Ii(t).ndcPoint,n=new M.Raycaster;return n.setFromCamera(e,i.camera),i.model.intersectRaycaster(n)}class Cn extends Jn{constructor(e){var o;super(e);d(this,"type","edit");d(this,"pressPoint");d(this,"hasAppendDashed",!1);d(this,"hasAppendMouseGroup",!1);d(this,"fiveElement");d(this,"lastPoint",null);d(this,"hammer");d(this,"onIntersectionUpdate",Ni((e,n)=>{var s;this.hasAppendMouseGroup===!1&&(this.group.add(this.mouseGroup),this.magnifier.appendTo(this.container),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));d(this,"revoke",()=>{if(this.model.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.five.needsRender=!0;return}if(this.model.lines.length===0&&!this.lastPoint||!this.lastPoint)return;const e=this.model.lines[this.model.lines.length-1],n=e.findAnotherPoint(this.lastPoint);!n||(this.lastPoint=n,this.hook.emit("anchorChange",n.position),this.group.remove(e.mesh),this.model.removeLine(e),this.hasAppendMouseGroup=!1,this.mouseGroup.position.copy(this.lastPoint.position),this.group.remove(this.mouseGroup),e.distanceItem.remove(),this.updateDashed(),this.magnifier.remove(),this.five.needsRender=!0)});d(this,"onMouseLeave",()=>{this.magnifier.remove(),this.group.remove(this.mouseGroup),this.hasAppendMouseGroup=!1,this.lastPoint&&(this.mouseGroup.position.copy(this.lastPoint.position),this.updateDashed())});d(this,"onLineChanged",()=>{this.hook.emit("editedLineChange",this.model.lines.map(e=>e.toCompletelyJson()))});d(this,"onPress",e=>{const[n]=fi(this.five,e);if(!n||!n.face)return;const o=new ot(n.point);this.pressPoint=o,this.onIntersectionUpdate(n)});d(this,"onPan",e=>{if(!this.pressPoint)return;const[n]=fi(this.five,e);!n||!n.face||this.onIntersectionUpdate(n)});d(this,"onPanEnd",e=>{!this.pressPoint||this.onTap(e)});d(this,"onTap",e=>{this.hasAppendDashed||(this.dashed.distanceItem.appendTo(this.container),this.group.add(this.dashed.mesh)),this.hasAppendDashed=!0;const[n]=fi(this.five,e);this.updateMouseGroup(n);const o=new ot(this.mouseGroup.position),s=this.lastPoint;if(o&&(this.lastPoint=o),o&&s){const r=new Xt(s,o,this.model);r.distanceItem.appendTo(this.container),this.model.addLine(r),this.group.add(r.mesh),r.distanceItem.update(this.five)}this.pressPoint=void 0,this.hasAppendMouseGroup=!1,this.magnifier.remove(),this.group.remove(this.mouseGroup),this.updateDashed(),this.five.needsRender=!0,this.hook.emit("anchorChange",o.position)});d(this,"onWantsTapGesture",()=>!1);d(this,"onWantsToMoveToPano",()=>!1);d(this,"onWantsPanGesture",()=>this.pressPoint?!1:void 0);d(this,"onCameraUpdate",()=>{this.updateDistanceUI(),this.dashed.distanceItem.update(this.five)});d(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.model=new Fi(this.config),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.model.hook.on("lineAdded",this.onLineChanged),this.model.hook.on("lineRemoved",this.onLineChanged);const n=this.five.getElement();if(n){this.fiveElement=n;const s=new Zn(n);this.hammer=s,s.on("tap",this.onTap),s.on("pan",this.onPan),s.on("press",this.onPress),s.on("panend",this.onPanEnd)}(o=this.fiveElement)==null||o.addEventListener("mouseleave",this.onMouseLeave),this.hook.emit("anchorChange",null),this.five.refresh()}dispose(){var e,n;super.dispose(),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.model.hook.off("lineAdded",this.onLineChanged),this.model.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.model.lines}}function Gi(i,t){const e=i.x-t[0].x,n=i.y-t[0].y,o=t[1].x-t[0].x,s=t[1].y-t[0].y,r=e*o+n*s,a=o*o+s*s,l=r/a;let c,h;return l<0||ru(t[0],t[1])?(c=t[0].x,h=t[0].y):l>1?(c=t[1].x,h=t[1].y):(c=t[0].x+l*o,h=t[0].y+l*s),new M.Vector2(c,h)}function ru(i,t){return i.x===t.x&&i.y===t.y}function Gn(i){const t=(s,r,a)=>{const l=s.lines.find(h=>h.points.findIndex(({id:u})=>u===s.id)!==r);if(!l)return a;const c=l.points[r];return c?t(c,r,a.concat(l)):a},e=t(i.points[0],1,[]),n=t(i.points[0],0,[]);return e.concat(n)}class au extends Jn{constructor(e){super(e);d(this,"type","view");d(this,"highlightedLines",[]);d(this,"hammer");d(this,"wantsTapGesture",e=>{if(this.model.lines.length===0)return;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 M.Vector2(s.x*r,s.y*a),c=this.model.lines.map(m=>{const[g,v]=m.points,b=g.position.clone().project(o),y=v.position.clone().project(o);if(!it(b)&&!it(y))return null;const I=new M.Vector2(b.x*r,b.y*a),P=new M.Vector2(y.x*r,y.y*a);return{id:m.id,points:[I,P]}}).filter(m=>!!m);if(c.length===0)return;const f=c.map(m=>{const g=Gi(l,m.points);return{id:m.id,distance:g.distanceTo(l)}}).sort((m,g)=>m.distance-g.distance)[0],u=f.distance>20?void 0:this.model.lines.find(({id:m})=>m===f.id);if(this.highlightedLines.length>0&&!u)return this.clearHighlightLines(),!1;if(u)return this.chooseLine(u),!1});d(this,"chooseLine",e=>{const n=Gn(e);this.highlightLines(n),this.five.needsRender=!0,this.hook.emit("selectedChange",n.map(o=>o.toCompletelyJson()))});d(this,"lineRemoved",e=>{this.removeLine(e),this.hook.emit("selectedChange",this.model.lines.filter(n=>n.selected).map(n=>n.toCompletelyJson()))});d(this,"onCameraUpdate",()=>{this.updateDistanceUI()});this.model.lines.forEach(o=>{o.distanceItem.appendTo(this.container),o.distanceItem.update(this.five),o.hook.on("selected",this.chooseLine),this.group.add(o.mesh)});const n=this.five.getElement();if(n){const o=new Zn(n);this.hammer=o}this.model.hook.on("lineRemoved",this.lineRemoved),this.five.on("cameraUpdate",this.onCameraUpdate),this.five.on("wantsTapGesture",this.wantsTapGesture),this.five.needsRender=!0}dispose(){var e;super.dispose(),this.model.hook.off("lineRemoved",this.lineRemoved),this.five.off("cameraUpdate",this.onCameraUpdate),this.five.off("wantsTapGesture",this.wantsTapGesture),this.five.needsRender=!0,this.hook.emit("selectedChange",[]),(e=this.hammer)==null||e.destroy()}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.model.lines.forEach(e=>{e.selected=!1,e.distanceItem.unHighlight(),this.group.remove(e.lightMesh)}),this.highlightedLines=[],this.five.needsRender=!0)}highlightLines(e){this.clearHighlightLines(),this.highlightedLines=e,e.forEach(n=>this.highlightLine(n))}}const lu=`
|
|
212
|
+
`;return function(){var N=new Error("get-stack-trace"),J=N&&N.stack?N.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",ae=t.console&&(t.console.warn||t.console.log);return ae&&ae.call(t.console,k,J),p.apply(this,arguments)}}var v;typeof Object.assign!="function"?v=function(A){if(A===o||A===null)throw new TypeError("Cannot convert undefined or null to object");for(var w=Object(A),k=1;k<arguments.length;k++){var N=arguments[k];if(N!==o&&N!==null)for(var J in N)N.hasOwnProperty(J)&&(w[J]=N[J])}return w}:v=Object.assign;var b=g(function(A,w,k){for(var N=Object.keys(w),J=0;J<N.length;)(!k||k&&A[N[J]]===o)&&(A[N[J]]=w[N[J]]),J++;return A},"extend","Use `assign`."),y=g(function(A,w){return b(A,w,!0)},"merge","Use `assign`.");function I(p,A,w){var k=A.prototype,N;N=p.prototype=Object.create(k),N.constructor=p,N._super=k,w&&v(N,w)}function P(p,A){return function(){return p.apply(A,arguments)}}function L(p,A){return typeof p==a?p.apply(A&&A[0]||o,A):p}function D(p,A){return p===o?A:p}function E(p,A,w){m(B(A),function(k){p.addEventListener(k,w,!1)})}function T(p,A,w){m(B(A),function(k){p.removeEventListener(k,w,!1)})}function C(p,A){for(;p;){if(p==A)return!0;p=p.parentNode}return!1}function z(p,A){return p.indexOf(A)>-1}function B(p){return p.trim().split(/\s+/g)}function F(p,A,w){if(p.indexOf&&!w)return p.indexOf(A);for(var k=0;k<p.length;){if(w&&p[k][w]==A||!w&&p[k]===A)return k;k++}return-1}function $(p){return Array.prototype.slice.call(p,0)}function j(p,A,w){for(var k=[],N=[],J=0;J<p.length;){var ae=A?p[J][A]:p[J];F(N,ae)<0&&k.push(p[J]),N[J]=ae,J++}return w&&(A?k=k.sort(function(ze,Oe){return ze[A]>Oe[A]}):k=k.sort()),k}function R(p,A){for(var w,k,N=A[0].toUpperCase()+A.slice(1),J=0;J<s.length;){if(w=s[J],k=w?w+N:A,k in p)return k;J++}return o}var H=1;function _(){return H++}function U(p){var A=p.ownerDocument||p;return A.defaultView||A.parentWindow||t}var te=/mobile|tablet|ip(ad|hone|od)|android/i,Y="ontouchstart"in t,ee=R(t,"PointerEvent")!==o,se=Y&&te.test(navigator.userAgent),ie="touch",ce="pen",Ae="mouse",Ce="kinect",Me=25,Z=1,re=2,oe=4,q=8,Ne=1,Qe=2,le=4,Be=8,He=16,me=Qe|le,Ee=Be|He,We=me|Ee,ft=["x","y"],Ze=["clientX","clientY"];function Le(p,A){var w=this;this.manager=p,this.callback=A,this.element=p.element,this.target=p.options.inputTarget,this.domHandler=function(k){L(p.options.enable,[p])&&w.handler(k)},this.init()}Le.prototype={handler:function(){},init:function(){this.evEl&&E(this.element,this.evEl,this.domHandler),this.evTarget&&E(this.target,this.evTarget,this.domHandler),this.evWin&&E(U(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&T(this.element,this.evEl,this.domHandler),this.evTarget&&T(this.target,this.evTarget,this.domHandler),this.evWin&&T(U(this.element),this.evWin,this.domHandler)}};function we(p){var A,w=p.options.inputClass;return w?A=w:ee?A=_n:se?A=ln:Y?A=$n:A=an,new A(p,ke)}function ke(p,A,w){var k=w.pointers.length,N=w.changedPointers.length,J=A&Z&&k-N===0,ae=A&(oe|q)&&k-N===0;w.isFirst=!!J,w.isFinal=!!ae,J&&(p.session={}),w.eventType=A,st(p,w),p.emit("hammer.input",w),p.recognize(w),p.session.prevInput=w}function st(p,A){var w=p.session,k=A.pointers,N=k.length;w.firstInput||(w.firstInput=Qt(A)),N>1&&!w.firstMultiple?w.firstMultiple=Qt(A):N===1&&(w.firstMultiple=!1);var J=w.firstInput,ae=w.firstMultiple,Te=ae?ae.center:J.center,ze=A.center=on(k);A.timeStamp=h(),A.deltaTime=A.timeStamp-J.timeStamp,A.angle=Wt(Te,ze),A.distance=Tt(Te,ze),kt(w,A),A.offsetDirection=rn(A.deltaX,A.deltaY);var Oe=sn(A.deltaTime,A.deltaX,A.deltaY);A.overallVelocityX=Oe.x,A.overallVelocityY=Oe.y,A.overallVelocity=c(Oe.x)>c(Oe.y)?Oe.x:Oe.y,A.scale=ae?Ar(ae.pointers,k):1,A.rotation=ae?br(ae.pointers,k):0,A.maxPointers=w.prevInput?A.pointers.length>w.prevInput.maxPointers?A.pointers.length:w.prevInput.maxPointers:A.pointers.length,Kn(w,A);var $e=p.element;C(A.srcEvent.target,$e)&&($e=A.srcEvent.target),A.target=$e}function kt(p,A){var w=A.center,k=p.offsetDelta||{},N=p.prevDelta||{},J=p.prevInput||{};(A.eventType===Z||J.eventType===oe)&&(N=p.prevDelta={x:J.deltaX||0,y:J.deltaY||0},k=p.offsetDelta={x:w.x,y:w.y}),A.deltaX=N.x+(w.x-k.x),A.deltaY=N.y+(w.y-k.y)}function Kn(p,A){var w=p.lastInterval||A,k=A.timeStamp-w.timeStamp,N,J,ae,Te;if(A.eventType!=q&&(k>Me||w.velocity===o)){var ze=A.deltaX-w.deltaX,Oe=A.deltaY-w.deltaY,$e=sn(k,ze,Oe);J=$e.x,ae=$e.y,N=c($e.x)>c($e.y)?$e.x:$e.y,Te=rn(ze,Oe),p.lastInterval=A}else N=w.velocity,J=w.velocityX,ae=w.velocityY,Te=w.direction;A.velocity=N,A.velocityX=J,A.velocityY=ae,A.direction=Te}function Qt(p){for(var A=[],w=0;w<p.pointers.length;)A[w]={clientX:l(p.pointers[w].clientX),clientY:l(p.pointers[w].clientY)},w++;return{timeStamp:h(),pointers:A,center:on(A),deltaX:p.deltaX,deltaY:p.deltaY}}function on(p){var A=p.length;if(A===1)return{x:l(p[0].clientX),y:l(p[0].clientY)};for(var w=0,k=0,N=0;N<A;)w+=p[N].clientX,k+=p[N].clientY,N++;return{x:l(w/A),y:l(k/A)}}function sn(p,A,w){return{x:A/p||0,y:w/p||0}}function rn(p,A){return p===A?Ne:c(p)>=c(A)?p<0?Qe:le:A<0?Be:He}function Tt(p,A,w){w||(w=ft);var k=A[w[0]]-p[w[0]],N=A[w[1]]-p[w[1]];return Math.sqrt(k*k+N*N)}function Wt(p,A,w){w||(w=ft);var k=A[w[0]]-p[w[0]],N=A[w[1]]-p[w[1]];return Math.atan2(N,k)*180/Math.PI}function br(p,A){return Wt(A[1],A[0],Ze)+Wt(p[1],p[0],Ze)}function Ar(p,A){return Tt(A[0],A[1],Ze)/Tt(p[0],p[1],Ze)}var yr={mousedown:Z,mousemove:re,mouseup:oe},Pr="mousedown",wr="mousemove mouseup";function an(){this.evEl=Pr,this.evWin=wr,this.pressed=!1,Le.apply(this,arguments)}I(an,Le,{handler:function(A){var w=yr[A.type];w&Z&&A.button===0&&(this.pressed=!0),w&re&&A.which!==1&&(w=oe),this.pressed&&(w&oe&&(this.pressed=!1),this.callback(this.manager,w,{pointers:[A],changedPointers:[A],pointerType:Ae,srcEvent:A}))}});var Er={pointerdown:Z,pointermove:re,pointerup:oe,pointercancel:q,pointerout:q},Ir={2:ie,3:ce,4:Ae,5:Ce},Qi="pointerdown",Wi="pointermove pointerup pointercancel";t.MSPointerEvent&&!t.PointerEvent&&(Qi="MSPointerDown",Wi="MSPointerMove MSPointerUp MSPointerCancel");function _n(){this.evEl=Qi,this.evWin=Wi,Le.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}I(_n,Le,{handler:function(A){var w=this.store,k=!1,N=A.type.toLowerCase().replace("ms",""),J=Er[N],ae=Ir[A.pointerType]||A.pointerType,Te=ae==ie,ze=F(w,A.pointerId,"pointerId");J&Z&&(A.button===0||Te)?ze<0&&(w.push(A),ze=w.length-1):J&(oe|q)&&(k=!0),!(ze<0)&&(w[ze]=A,this.callback(this.manager,J,{pointers:w,changedPointers:[A],pointerType:ae,srcEvent:A}),k&&w.splice(ze,1))}});var xr={touchstart:Z,touchmove:re,touchend:oe,touchcancel:q},Cr="touchstart",Lr="touchstart touchmove touchend touchcancel";function Yi(){this.evTarget=Cr,this.evWin=Lr,this.started=!1,Le.apply(this,arguments)}I(Yi,Le,{handler:function(A){var w=xr[A.type];if(w===Z&&(this.started=!0),!!this.started){var k=kr.call(this,A,w);w&(oe|q)&&k[0].length-k[1].length===0&&(this.started=!1),this.callback(this.manager,w,{pointers:k[0],changedPointers:k[1],pointerType:ie,srcEvent:A})}}});function kr(p,A){var w=$(p.touches),k=$(p.changedTouches);return A&(oe|q)&&(w=j(w.concat(k),"identifier",!0)),[w,k]}var Tr={touchstart:Z,touchmove:re,touchend:oe,touchcancel:q},Dr="touchstart touchmove touchend touchcancel";function ln(){this.evTarget=Dr,this.targetIds={},Le.apply(this,arguments)}I(ln,Le,{handler:function(A){var w=Tr[A.type],k=zr.call(this,A,w);!k||this.callback(this.manager,w,{pointers:k[0],changedPointers:k[1],pointerType:ie,srcEvent:A})}});function zr(p,A){var w=$(p.touches),k=this.targetIds;if(A&(Z|re)&&w.length===1)return k[w[0].identifier]=!0,[w,w];var N,J,ae=$(p.changedTouches),Te=[],ze=this.target;if(J=w.filter(function(Oe){return C(Oe.target,ze)}),A===Z)for(N=0;N<J.length;)k[J[N].identifier]=!0,N++;for(N=0;N<ae.length;)k[ae[N].identifier]&&Te.push(ae[N]),A&(oe|q)&&delete k[ae[N].identifier],N++;if(!!Te.length)return[j(J.concat(Te),"identifier",!0),Te]}var Mr=2500,Vi=25;function $n(){Le.apply(this,arguments);var p=P(this.handler,this);this.touch=new ln(this.manager,p),this.mouse=new an(this.manager,p),this.primaryTouch=null,this.lastTouches=[]}I($n,Le,{handler:function(A,w,k){var N=k.pointerType==ie,J=k.pointerType==Ae;if(!(J&&k.sourceCapabilities&&k.sourceCapabilities.firesTouchEvents)){if(N)Sr.call(this,w,k);else if(J&&jr.call(this,k))return;this.callback(A,w,k)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function Sr(p,A){p&Z?(this.primaryTouch=A.changedPointers[0].identifier,Zi.call(this,A)):p&(oe|q)&&Zi.call(this,A)}function Zi(p){var A=p.changedPointers[0];if(A.identifier===this.primaryTouch){var w={x:A.clientX,y:A.clientY};this.lastTouches.push(w);var k=this.lastTouches,N=function(){var J=k.indexOf(w);J>-1&&k.splice(J,1)};setTimeout(N,Mr)}}function jr(p){for(var A=p.srcEvent.clientX,w=p.srcEvent.clientY,k=0;k<this.lastTouches.length;k++){var N=this.lastTouches[k],J=Math.abs(A-N.x),ae=Math.abs(w-N.y);if(J<=Vi&&ae<=Vi)return!0}return!1}var Ji=R(r.style,"touchAction"),Ui=Ji!==o,qi="compute",Ki="auto",ei="manipulation",yt="none",Yt="pan-x",Vt="pan-y",cn=Rr();function ti(p,A){this.manager=p,this.set(A)}ti.prototype={set:function(p){p==qi&&(p=this.compute()),Ui&&this.manager.element.style&&cn[p]&&(this.manager.element.style[Ji]=p),this.actions=p.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var p=[];return m(this.manager.recognizers,function(A){L(A.options.enable,[A])&&(p=p.concat(A.getTouchAction()))}),Or(p.join(" "))},preventDefaults:function(p){var A=p.srcEvent,w=p.offsetDirection;if(this.manager.session.prevented){A.preventDefault();return}var k=this.actions,N=z(k,yt)&&!cn[yt],J=z(k,Vt)&&!cn[Vt],ae=z(k,Yt)&&!cn[Yt];if(N){var Te=p.pointers.length===1,ze=p.distance<2,Oe=p.deltaTime<250;if(Te&&ze&&Oe)return}if(!(ae&&J)&&(N||J&&w&me||ae&&w&Ee))return this.preventSrc(A)},preventSrc:function(p){this.manager.session.prevented=!0,p.preventDefault()}};function Or(p){if(z(p,yt))return yt;var A=z(p,Yt),w=z(p,Vt);return A&&w?yt:A||w?A?Yt:Vt:z(p,ei)?ei:Ki}function Rr(){if(!Ui)return!1;var p={},A=t.CSS&&t.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach(function(w){p[w]=A?t.CSS.supports("touch-action",w):!0}),p}var hn=1,Ve=2,Dt=4,mt=8,rt=mt,Zt=16,_e=32;function at(p){this.options=v({},this.defaults,p||{}),this.id=_(),this.manager=null,this.options.enable=D(this.options.enable,!0),this.state=hn,this.simultaneous={},this.requireFail=[]}at.prototype={defaults:{},set:function(p){return v(this.options,p),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(p){if(u(p,"recognizeWith",this))return this;var A=this.simultaneous;return p=un(p,this),A[p.id]||(A[p.id]=p,p.recognizeWith(this)),this},dropRecognizeWith:function(p){return u(p,"dropRecognizeWith",this)?this:(p=un(p,this),delete this.simultaneous[p.id],this)},requireFailure:function(p){if(u(p,"requireFailure",this))return this;var A=this.requireFail;return p=un(p,this),F(A,p)===-1&&(A.push(p),p.requireFailure(this)),this},dropRequireFailure:function(p){if(u(p,"dropRequireFailure",this))return this;p=un(p,this);var A=F(this.requireFail,p);return A>-1&&this.requireFail.splice(A,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(p){return!!this.simultaneous[p.id]},emit:function(p){var A=this,w=this.state;function k(N){A.manager.emit(N,p)}w<mt&&k(A.options.event+_i(w)),k(A.options.event),p.additionalEvent&&k(p.additionalEvent),w>=mt&&k(A.options.event+_i(w))},tryEmit:function(p){if(this.canEmit())return this.emit(p);this.state=_e},canEmit:function(){for(var p=0;p<this.requireFail.length;){if(!(this.requireFail[p].state&(_e|hn)))return!1;p++}return!0},recognize:function(p){var A=v({},p);if(!L(this.options.enable,[this,A])){this.reset(),this.state=_e;return}this.state&(rt|Zt|_e)&&(this.state=hn),this.state=this.process(A),this.state&(Ve|Dt|mt|Zt)&&this.tryEmit(A)},process:function(p){},getTouchAction:function(){},reset:function(){}};function _i(p){return p&Zt?"cancel":p&mt?"end":p&Dt?"move":p&Ve?"start":""}function $i(p){return p==He?"down":p==Be?"up":p==Qe?"left":p==le?"right":""}function un(p,A){var w=A.manager;return w?w.get(p):p}function Je(){at.apply(this,arguments)}I(Je,at,{defaults:{pointers:1},attrTest:function(p){var A=this.options.pointers;return A===0||p.pointers.length===A},process:function(p){var A=this.state,w=p.eventType,k=A&(Ve|Dt),N=this.attrTest(p);return k&&(w&q||!N)?A|Zt:k||N?w&oe?A|mt:A&Ve?A|Dt:Ve:_e}});function dn(){Je.apply(this,arguments),this.pX=null,this.pY=null}I(dn,Je,{defaults:{event:"pan",threshold:10,pointers:1,direction:We},getTouchAction:function(){var p=this.options.direction,A=[];return p&me&&A.push(Vt),p&Ee&&A.push(Yt),A},directionTest:function(p){var A=this.options,w=!0,k=p.distance,N=p.direction,J=p.deltaX,ae=p.deltaY;return N&A.direction||(A.direction&me?(N=J===0?Ne:J<0?Qe:le,w=J!=this.pX,k=Math.abs(p.deltaX)):(N=ae===0?Ne:ae<0?Be:He,w=ae!=this.pY,k=Math.abs(p.deltaY))),p.direction=N,w&&k>A.threshold&&N&A.direction},attrTest:function(p){return Je.prototype.attrTest.call(this,p)&&(this.state&Ve||!(this.state&Ve)&&this.directionTest(p))},emit:function(p){this.pX=p.deltaX,this.pY=p.deltaY;var A=$i(p.direction);A&&(p.additionalEvent=this.options.event+A),this._super.emit.call(this,p)}});function ni(){Je.apply(this,arguments)}I(ni,Je,{defaults:{event:"pinch",threshold:0,pointers:2},getTouchAction:function(){return[yt]},attrTest:function(p){return this._super.attrTest.call(this,p)&&(Math.abs(p.scale-1)>this.options.threshold||this.state&Ve)},emit:function(p){if(p.scale!==1){var A=p.scale<1?"in":"out";p.additionalEvent=this.options.event+A}this._super.emit.call(this,p)}});function ii(){at.apply(this,arguments),this._timer=null,this._input=null}I(ii,at,{defaults:{event:"press",pointers:1,time:251,threshold:9},getTouchAction:function(){return[Ki]},process:function(p){var A=this.options,w=p.pointers.length===A.pointers,k=p.distance<A.threshold,N=p.deltaTime>A.time;if(this._input=p,!k||!w||p.eventType&(oe|q)&&!N)this.reset();else if(p.eventType&Z)this.reset(),this._timer=f(function(){this.state=rt,this.tryEmit()},A.time,this);else if(p.eventType&oe)return rt;return _e},reset:function(){clearTimeout(this._timer)},emit:function(p){this.state===rt&&(p&&p.eventType&oe?this.manager.emit(this.options.event+"up",p):(this._input.timeStamp=h(),this.manager.emit(this.options.event,this._input)))}});function oi(){Je.apply(this,arguments)}I(oi,Je,{defaults:{event:"rotate",threshold:0,pointers:2},getTouchAction:function(){return[yt]},attrTest:function(p){return this._super.attrTest.call(this,p)&&(Math.abs(p.rotation)>this.options.threshold||this.state&Ve)}});function si(){Je.apply(this,arguments)}I(si,Je,{defaults:{event:"swipe",threshold:10,velocity:.3,direction:me|Ee,pointers:1},getTouchAction:function(){return dn.prototype.getTouchAction.call(this)},attrTest:function(p){var A=this.options.direction,w;return A&(me|Ee)?w=p.overallVelocity:A&me?w=p.overallVelocityX:A&Ee&&(w=p.overallVelocityY),this._super.attrTest.call(this,p)&&A&p.offsetDirection&&p.distance>this.options.threshold&&p.maxPointers==this.options.pointers&&c(w)>this.options.velocity&&p.eventType&oe},emit:function(p){var A=$i(p.offsetDirection);A&&this.manager.emit(this.options.event+A,p),this.manager.emit(this.options.event,p)}});function fn(){at.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}I(fn,at,{defaults:{event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[ei]},process:function(p){var A=this.options,w=p.pointers.length===A.pointers,k=p.distance<A.threshold,N=p.deltaTime<A.time;if(this.reset(),p.eventType&Z&&this.count===0)return this.failTimeout();if(k&&N&&w){if(p.eventType!=oe)return this.failTimeout();var J=this.pTime?p.timeStamp-this.pTime<A.interval:!0,ae=!this.pCenter||Tt(this.pCenter,p.center)<A.posThreshold;this.pTime=p.timeStamp,this.pCenter=p.center,!ae||!J?this.count=1:this.count+=1,this._input=p;var Te=this.count%A.taps;if(Te===0)return this.hasRequireFailures()?(this._timer=f(function(){this.state=rt,this.tryEmit()},A.interval,this),Ve):rt}return _e},failTimeout:function(){return this._timer=f(function(){this.state=_e},this.options.interval,this),_e},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==rt&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function lt(p,A){return A=A||{},A.recognizers=D(A.recognizers,lt.defaults.preset),new ri(p,A)}lt.VERSION="2.0.7",lt.defaults={domEvents:!1,touchAction:qi,enable:!0,inputTarget:null,inputClass:null,preset:[[oi,{enable:!1}],[ni,{enable:!1},["rotate"]],[si,{direction:me}],[dn,{direction:me},["swipe"]],[fn],[fn,{event:"doubletap",taps:2},["tap"]],[ii]],cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}};var Nr=1,eo=2;function ri(p,A){this.options=v({},lt.defaults,A||{}),this.options.inputTarget=this.options.inputTarget||p,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=p,this.input=we(this),this.touchAction=new ti(this,this.options.touchAction),to(this,!0),m(this.options.recognizers,function(w){var k=this.add(new w[0](w[1]));w[2]&&k.recognizeWith(w[2]),w[3]&&k.requireFailure(w[3])},this)}ri.prototype={set:function(p){return v(this.options,p),p.touchAction&&this.touchAction.update(),p.inputTarget&&(this.input.destroy(),this.input.target=p.inputTarget,this.input.init()),this},stop:function(p){this.session.stopped=p?eo:Nr},recognize:function(p){var A=this.session;if(!A.stopped){this.touchAction.preventDefaults(p);var w,k=this.recognizers,N=A.curRecognizer;(!N||N&&N.state&rt)&&(N=A.curRecognizer=null);for(var J=0;J<k.length;)w=k[J],A.stopped!==eo&&(!N||w==N||w.canRecognizeWith(N))?w.recognize(p):w.reset(),!N&&w.state&(Ve|Dt|mt)&&(N=A.curRecognizer=w),J++}},get:function(p){if(p instanceof at)return p;for(var A=this.recognizers,w=0;w<A.length;w++)if(A[w].options.event==p)return A[w];return null},add:function(p){if(u(p,"add",this))return this;var A=this.get(p.options.event);return A&&this.remove(A),this.recognizers.push(p),p.manager=this,this.touchAction.update(),p},remove:function(p){if(u(p,"remove",this))return this;if(p=this.get(p),p){var A=this.recognizers,w=F(A,p);w!==-1&&(A.splice(w,1),this.touchAction.update())}return this},on:function(p,A){if(p!==o&&A!==o){var w=this.handlers;return m(B(p),function(k){w[k]=w[k]||[],w[k].push(A)}),this}},off:function(p,A){if(p!==o){var w=this.handlers;return m(B(p),function(k){A?w[k]&&w[k].splice(F(w[k],A),1):delete w[k]}),this}},emit:function(p,A){this.options.domEvents&&Br(p,A);var w=this.handlers[p]&&this.handlers[p].slice();if(!(!w||!w.length)){A.type=p,A.preventDefault=function(){A.srcEvent.preventDefault()};for(var k=0;k<w.length;)w[k](A),k++}},destroy:function(){this.element&&to(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function to(p,A){var w=p.element;if(!!w.style){var k;m(p.options.cssProps,function(N,J){k=R(w.style,J),A?(p.oldCssProps[k]=w.style[k],w.style[k]=N):w.style[k]=p.oldCssProps[k]||""}),A||(p.oldCssProps={})}}function Br(p,A){var w=e.createEvent("Event");w.initEvent(p,!0,!0),w.gesture=A,A.target.dispatchEvent(w)}v(lt,{INPUT_START:Z,INPUT_MOVE:re,INPUT_END:oe,INPUT_CANCEL:q,STATE_POSSIBLE:hn,STATE_BEGAN:Ve,STATE_CHANGED:Dt,STATE_ENDED:mt,STATE_RECOGNIZED:rt,STATE_CANCELLED:Zt,STATE_FAILED:_e,DIRECTION_NONE:Ne,DIRECTION_LEFT:Qe,DIRECTION_RIGHT:le,DIRECTION_UP:Be,DIRECTION_DOWN:He,DIRECTION_HORIZONTAL:me,DIRECTION_VERTICAL:Ee,DIRECTION_ALL:We,Manager:ri,Input:Le,TouchAction:ti,TouchInput:ln,MouseInput:an,PointerEventInput:_n,TouchMouseInput:$n,SingleTouchInput:Yi,Recognizer:at,AttrRecognizer:Je,Tap:fn,Pan:dn,Swipe:si,Pinch:ni,Rotate:oi,Press:ii,on:E,off:T,each:m,merge:y,extend:b,assign:v,inherit:I,bindFn:P,prefixed:R});var Hr=typeof t<"u"?t:typeof self<"u"?self:{};Hr.Hammer=lt,typeof o=="function"&&o.amd?o(function(){return lt}):i.exports?i.exports=lt:t[n]=lt})(window,document,"Hammer")})(_s);const Zn=_s.exports;function In(i,t,e){const n=i[t];i[t]=i[e],i[e]=n}function Wh(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;In(i,a*4+0,l*4+0),In(i,a*4+1,l*4+1),In(i,a*4+2,l*4+2),In(i,a*4+3,l*4+3)}}}class $s{constructor(t,e){d(this,"width");d(this,"height");d(this,"visible",!1);d(this,"hooks",new ye.Subscribe);d(this,"contentDom",document.createElement("canvas"));d(this,"five");d(this,"scale");d(this,"wrapper");d(this,"config");d(this,"offset",{x:0,y:0});d(this,"canvas",this.contentDom);d(this,"context");d(this,"renderCenter",new O.Vector3);d(this,"lastPanEvent");d(this,"hammer");d(this,"onPan",t=>{var c,h,f,u;if(!this.wrapper)return;const e=(h=(c=this.lastPanEvent)==null?void 0:c.deltaX)!=null?h:0,n=(u=(f=this.lastPanEvent)==null?void 0:f.deltaY)!=null?u:0,o=t.deltaX-e,s=t.deltaY-n;if(this.lastPanEvent=t,this.hooks.emit("wantsPanGesture",{srcEvent:t,deltaX:o,deltaY:s}))return;const a=this.offset.x+o,l=this.offset.y+s;this.contentDom.style.boxShadow="0 2px 30px 0 rgba(0,0,0,0.20)",this.canvas.style.transform=`translate3d(${a}px, ${l}px, 100px)`,this.offset={x:a,y:l}});d(this,"onPanEnd",t=>{this.lastPanEvent=void 0,this.contentDom.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 Zn(this.canvas),this.hammer.on("pan",this.onPan),this.hammer.on("panend",this.onPanEnd))}dispose(){var t;this.clear(),this.remove(),(t=this.hammer)==null||t.destroy()}remove(){this.canvas.remove(),this.visible=!1}clear(){this.context.clearRect(0,0,this.canvas.width,this.canvas.height)}appendTo(t){this.wrapper=t,this.initStyle(),t.append(this.canvas),this.visible=!0}renderWithPoint(t){!this.wrapper||(this.renderCenter=t,this.render(),this.config.autoFixPCPosition&&this.autoFixPCPosition())}autoFixPCPosition(){if(!this.wrapper)return;const{width:t,height:e}=this,n=this.renderCenter.clone().project(this.five.camera),o=(n.x+1)/2*this.wrapper.clientWidth,s=-(n.x-1)/2*this.wrapper.clientWidth,r=-(n.y-1)/2*this.wrapper.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.wrapper)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 O.Vector2),a=1,l=n/t,c=o/t,h=a*t,f=(s.x+1)/2*r.x,u=(s.y+1)/2*r.y,m=this.five.getPixels(f-l/2,u-l/2,l,c,h),g=Math.floor(n*a),v=Math.floor(o*a);Wh(m,g,v);const b=new ImageData(g,v);b.data.set(m),e.putImageData(b,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")}}class Yh{constructor(t){d(this,"edges",[]);d(this,"five");d(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 M.Vector3),r=s.distanceTo(t.point);r<e&&(n=s,e=r)}),e>.1?null:n||null}}class Ei{constructor(){d(this,"id",ut());d(this,"points",[]);d(this,"lines",[])}push(t){const e=this.getNext(t);if(!e)throw new Error("\u5F53\u524D\u7EBF\u6BB5\u4E8E\u4E0A\u4E00\u6761\u7EBF\u6BB5\u65E0\u6CD5\u6784\u6210\u6298\u7EBF");return this.lines.push(e.line),this.points.push(...e.points),this.lines.length}pop(){const t=this.lines.pop();return this.lines.length===0?this.points.slice(0,this.points.length):this.points.pop(),t}getNext(t){const e=this.points.slice(-1)[0];if(!e)return{line:t,points:t.points};if(!t.points.includes(e))return null;const n=t.points.find(o=>o!==e);return n?{line:t,points:[n]}:null}toJson(){return{id:this.id,lines:this.lines.map(t=>t.id),points:this.points.map(t=>t.id)}}toCompletelyJson(){return{id:this.id,points:this.points.map(t=>t.toJson()),lines:this.lines.map(t=>t.toCompletelyJson())}}}const Vh=1,Zh=3,Jh=new M.Color(16777215),Uh=new M.Color(6522623),qh=new M.Color(16777215),Kh=new M.Color(6522623),_h=6,$h=8,eu="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgBAMAAACBVGfHAAAAIVBMVEUAAAD////////////////////////////////////////PIev5AAAACnRSTlMAG/Py2baba05un7UgfgAAAHJJREFUKM9joBpgLHVSCRdA4metAoJlCJHmVWBgAeNzroKCCVCBLpjACqgJVjCBxRBT2FbBQQJYQAohsBAsUIUQWA4WiEIILAULeCEEloAFtBACizAEMLRgGIphLabDMJ2O6TlM72MGECIIMQIZIxqoBQCPvpJ/e9FaAAAAAABJRU5ErkJggg==",er=new M.TextureLoader().load(eu),tr={pointTexture:er,pointSize:_h,lineWidth:Vh,lineColor:Jh,pointColor:qh,lineRenderOrder:20,pointsRenderOrder:20};({...tr});const tu={pointTexture:er,pointSize:$h,lineWidth:Zh,lineColor:Uh,pointColor:Kh,lineRenderOrder:10,pointsRenderOrder:10};function nu(i,t,e){var h,f,u,m,g;const n=(h=e==null?void 0:e.lineWidth)!=null?h:2,o=(f=e==null?void 0:e.lineColor)!=null?f:new M.Color(16777215),s=(u=e==null?void 0:e.pointSize)!=null?u: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 Cs.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 Ko(i,t){const[e,n]=i.points,o=t==="light"?tu:tr,s=nu(e.position,n.position,o);return s.name="normalLine_"+i.id,s}function it(i){const{x:t,y:e,z:n}=i;return!(Math.abs(t)>1||Math.abs(e)>1||Math.abs(n)>1)}function iu(){const i=document.createElement("div");return i.setAttribute("style","backdrop-filter: blur(4px);-webkit-backdrop-filter: blur(4px);"),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.pointerEvents="all",i.style.cursor="pointer",i}function ou(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.transform="translate3d(0, 0, 0)",t.style.transformOrigin="left top",t}function su(i){function t(){var g;(g=i.clickCallback)==null||g.call(i,m)}function e(){if(f)return f.highlight();c.style.border="0.5px solid #95AEFF",c.style.background="linear-gradient(90deg, #95AEFF 0%, #6386FF 100%)"}function n(){if(f)return f.unHighlight();c.style.border="0.5px solid rgba(255,255,255,0.6)",c.style.background="rgba(195,195,195,0.70)"}function o(g){const v=g.getElement();if(!v)return;const b=v.clientWidth,y=v.clientHeight;if(a.points.length<2)return;const[I,P]=a.points,L=I.position.clone().project(g.camera),D=P.position.clone().project(g.camera),E=L.clone().lerp(D,.5),T=new M.Vector2(L.x*b,L.y*y),C=new M.Vector2(D.x*b,D.y*y);if((()=>!(Math.abs(L.z)>1||Math.abs(D.z)>1||!it(L)&&!it(D)||!it(E)||T.distanceTo(C)<20))()===!1){h.style.opacity="0",h.style.pointerEvents="none";return}const B=(E.x+1)/2*b,F=-(E.y-1)/2*y,j=-(Math.atan((T.y-C.y)/(T.x-C.x))*180)/Math.PI;h.style.transform=`translate(${B}px, ${F}px) rotate(${j}deg)`,h.style.opacity="1",h.style.pointerEvents="all",f&&f.update({line:a.toCompletelyJson(),polyline:a.getPolyline().toCompletelyJson()});const R=I.position.clone().distanceTo(P.position),H=i.line.model.params.getDistanceText(R);c.innerText!==H&&(c.innerText=H)}function s(g){g.appendChild(h),h.addEventListener("click",t)}function r(){c.removeEventListener("click",t),h.remove()}const{line:a}=i,l=a.id,c=iu(),h=ou(a),f=i.userDistanceItem,u=new M.Vector3(0,0,0),m={lineID:l,ndcPosition:u,update:o,appendTo:s,remove:r,highlight:e,unHighlight:n};return f!=null&&f.element?h.appendChild(f.element):h.appendChild(c),m}class Xt{constructor(t,e,n){d(this,"id");d(this,"selected",!1);d(this,"type","line");d(this,"model");d(this,"mesh");d(this,"points");d(this,"lightMesh");d(this,"hook");d(this,"distanceItem");d(this,"polyline");if(this.id=ut(),this.model=n,t.id===e.id)throw new Error("\u65E0\u6548\u7684\u7EBF\u6BB5, \u4E00\u4E2A\u70B9\u65E0\u6CD5\u6784\u6210\u7EBF\u6BB5");this.hook=new ye.Subscribe,this.points=[t,e],this.mesh=Ko(this,"normal"),this.lightMesh=Ko(this,"light"),this.distanceItem=su({line:this,clickCallback:()=>this.hook.emit("selected",this),userDistanceItem:this.model.params.userDistanceItemCreator?this.model.params.userDistanceItemCreator():void 0}),t.lines.push(this),e.lines.push(this)}clear(){this.selected=!1,this.polyline=void 0}getPolyline(){if(this.polyline)return this.polyline;const t=this.model.polylines.find(n=>n.lines.includes(this));if(this.polyline=t,t)return t;const e=new Ei;return e.push(this),e}findAnotherPoint(t){return this.points.find(({id:e})=>e!==t.id)}toJson(){return{id:this.id,points:this.points.map(({id:t})=>t)}}toCompletelyJson(){return{id:this.id,points:this.points.map(t=>t.toJson())}}clone(){return new Xt(this.points[0].clone(),this.points[1].clone(),this.model)}}function Kt(i,t){for(let e=0,n=t.length;e<n;e++)if(i===t[e])return t.splice(e,1)[0]}class ot{constructor(t){d(this,"id");d(this,"lines");d(this,"position");d(this,"type","point");this.id=ut(),this.lines=[],this.position=new M.Vector3,t instanceof M.Vector3?this.position.copy(t):this.position.fromArray(t)}toJson(){return{id:this.id,lines:this.lines.map(({id:t})=>t),position:this.position.toArray()}}addLine(t){this.lines.push(t)}removeLine(t){Kt(t,this.lines)}clone(){return new ot(this.position)}}class Fi{constructor(t){d(this,"lines",[]);d(this,"points",[]);d(this,"params");d(this,"polylines",[]);d(this,"hook",new ye.Subscribe);this.params=t}addLine(t){const[e,n]=t.points;if(!e||!n)return this;this.includes(e)||this.points.push(e),this.includes(n)||this.points.push(n),this.lines.push(t);const o=this.polylines.find(s=>!!s.getNext(t));if(o)o.push(t);else{const s=new Ei;s.push(t),this.polylines.push(s)}this.hook.emit("lineAdded",t)}removeLineByID(t){const e=this.getLineByID(t);e&&this.removeLine(e)}removeLine(t){const e=this.polylines.find(s=>s.lines.includes(t));if(e){if(e.lines.slice(-1)[0]!==t)throw new Error("\u4E0D\u80FD\u4ECE\u4E2D\u95F4\u5220\u9664\u7EBF\u6BB5");e.pop(),e.lines.length===0&&Kt(e,this.polylines)}const[n,o]=t.points;return n.lines.length===0&&Kt(n,this.points),o.lines.length===0&&Kt(o,this.points),Kt(t,this.lines),t.clear(),this.hook.emit("lineRemoved",t),this}mergeModel(t){t.lines.forEach(e=>this.addLine(e))}includes(t){if(t.type==="point")return this.points.find(({id:e})=>e===t.id)!==void 0;if(t.type==="line")return this.lines.find(({id:e})=>e===t.id)!==void 0}getPointByID(t){return this.points.find(({id:e})=>e===t)}getLineByID(t){return this.lines.find(({id:e})=>e===t)}getClosestPoint(){}parse(t){const e=t.points.map(({id:s,position:r})=>{const a=new ot(r);return a.id=s,a}),n=t.lines.map(s=>{const[r,a]=s.points,l=this.getPointByID.call({points:e},r),c=this.getPointByID.call({points:e},a);if(!l||!c)throw new Error("\u7EBF\u4E0A\u7684\u70B9\u4E0D\u5B58\u5728");const h=new Xt(l,c,this);return h.id=s.id,h}),o=t.polylines.map(s=>{const r=new Ei;return s.lines.forEach(a=>{const l=n.find(({id:c})=>c===a);l&&r.push(l)}),r});return this.points.splice(0,this.points.length,...e),this.lines.splice(0,this.lines.length,...n),this.polylines.splice(0,this.polylines.length,...o),this}toJson(){return{points:this.points.map(t=>t.toJson()),lines:this.lines.map(t=>t.toJson()),polylines:this.polylines.map(t=>t.toJson()).filter(t=>t.lines.length>0)}}}const xn=i=>i.preventDefault();class Jn{constructor(t){d(this,"model");d(this,"five");d(this,"group");d(this,"config");d(this,"dashed");d(this,"disposed",!1);d(this,"isMobile");d(this,"mouseGroup");d(this,"container");d(this,"fiveHelper");d(this,"hook");d(this,"magnifier");d(this,"userDistanceItemCreator");d(this,"updateDistanceUI",()=>{this.dashed.distanceItem.update(this.five),this.model.lines.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 Xt(new ot([0,0,0]),new ot([0,0,0]),this.model),this.dashed.mesh.setMaterial({dashed:!0,dashScale:100}),this.dashed.mesh.name="dashLine";const e=this.five.getElement();e&&(e.addEventListener("touchstart",xn),e.addEventListener("contextmenu",xn))}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.remove(),this.model.lines.forEach(e=>this.removeLine(e));const t=this.five.getElement();t&&(t.removeEventListener("touchstart",xn),t.removeEventListener("contextmenu",xn))}}function Ii(i){const{x:t,y:e}=i.center,{clientWidth:n,clientHeight:o}=i.target,s=i.target.getBoundingClientRect(),r=new M.Vector2(t,e).sub(new M.Vector2(s.left,s.top)),a=new M.Vector2(r.x/n*2-1,-(r.y/o)*2+1);return{point:r,ndcPoint:a}}function fi(i,t){const e=Ii(t).ndcPoint,n=new M.Raycaster;return n.setFromCamera(e,i.camera),i.model.intersectRaycaster(n)}class Cn extends Jn{constructor(e){var o;super(e);d(this,"type","edit");d(this,"pressPoint");d(this,"hasAppendDashed",!1);d(this,"hasAppendMouseGroup",!1);d(this,"fiveElement");d(this,"lastPoint",null);d(this,"hammer");d(this,"onIntersectionUpdate",Ni((e,n)=>{var s;this.hasAppendMouseGroup===!1&&(this.group.add(this.mouseGroup),this.magnifier.appendTo(this.container),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));d(this,"revoke",()=>{if(this.model.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.five.needsRender=!0;return}if(this.model.lines.length===0&&!this.lastPoint||!this.lastPoint)return;const e=this.model.lines[this.model.lines.length-1],n=e.findAnotherPoint(this.lastPoint);!n||(this.lastPoint=n,this.hook.emit("anchorChange",n.position),this.group.remove(e.mesh),this.model.removeLine(e),this.hasAppendMouseGroup=!1,this.mouseGroup.position.copy(this.lastPoint.position),this.group.remove(this.mouseGroup),e.distanceItem.remove(),this.updateDashed(),this.magnifier.remove(),this.five.needsRender=!0)});d(this,"onMouseLeave",()=>{this.magnifier.remove(),this.group.remove(this.mouseGroup),this.hasAppendMouseGroup=!1,this.lastPoint&&(this.mouseGroup.position.copy(this.lastPoint.position),this.updateDashed())});d(this,"onLineChanged",()=>{this.hook.emit("editedLineChange",this.model.lines.map(e=>e.toCompletelyJson()))});d(this,"onPress",e=>{const[n]=fi(this.five,e);if(!n||!n.face)return;const o=new ot(n.point);this.pressPoint=o,this.onIntersectionUpdate(n)});d(this,"onPan",e=>{if(!this.pressPoint)return;const[n]=fi(this.five,e);!n||!n.face||this.onIntersectionUpdate(n)});d(this,"onPanEnd",e=>{!this.pressPoint||this.onTap(e)});d(this,"onTap",e=>{this.hasAppendDashed||(this.dashed.distanceItem.appendTo(this.container),this.group.add(this.dashed.mesh)),this.hasAppendDashed=!0;const[n]=fi(this.five,e);this.updateMouseGroup(n);const o=new ot(this.mouseGroup.position),s=this.lastPoint;if(o&&(this.lastPoint=o),o&&s){const r=new Xt(s,o,this.model);r.distanceItem.appendTo(this.container),this.model.addLine(r),this.group.add(r.mesh),r.distanceItem.update(this.five)}this.pressPoint=void 0,this.hasAppendMouseGroup=!1,this.magnifier.remove(),this.group.remove(this.mouseGroup),this.updateDashed(),this.five.needsRender=!0,this.hook.emit("anchorChange",o.position)});d(this,"onWantsTapGesture",()=>!1);d(this,"onWantsToMoveToPano",()=>!1);d(this,"onWantsPanGesture",()=>this.pressPoint?!1:void 0);d(this,"onCameraUpdate",()=>{this.updateDistanceUI(),this.dashed.distanceItem.update(this.five)});d(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.model=new Fi(this.config),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.model.hook.on("lineAdded",this.onLineChanged),this.model.hook.on("lineRemoved",this.onLineChanged);const n=this.five.getElement();if(n){this.fiveElement=n;const s=new Zn(n);this.hammer=s,s.on("tap",this.onTap),s.on("pan",this.onPan),s.on("press",this.onPress),s.on("panend",this.onPanEnd)}(o=this.fiveElement)==null||o.addEventListener("mouseleave",this.onMouseLeave),this.hook.emit("anchorChange",null),this.five.refresh()}dispose(){var e,n;super.dispose(),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.model.hook.off("lineAdded",this.onLineChanged),this.model.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.model.lines}}function Gi(i,t){const e=i.x-t[0].x,n=i.y-t[0].y,o=t[1].x-t[0].x,s=t[1].y-t[0].y,r=e*o+n*s,a=o*o+s*s,l=r/a;let c,h;return l<0||ru(t[0],t[1])?(c=t[0].x,h=t[0].y):l>1?(c=t[1].x,h=t[1].y):(c=t[0].x+l*o,h=t[0].y+l*s),new M.Vector2(c,h)}function ru(i,t){return i.x===t.x&&i.y===t.y}function Gn(i){const t=(s,r,a)=>{const l=s.lines.find(h=>h.points.findIndex(({id:u})=>u===s.id)!==r);if(!l)return a;const c=l.points[r];return c?t(c,r,a.concat(l)):a},e=t(i.points[0],1,[]),n=t(i.points[0],0,[]);return e.concat(n)}class au extends Jn{constructor(e){super(e);d(this,"type","view");d(this,"highlightedLines",[]);d(this,"hammer");d(this,"wantsTapGesture",e=>{if(this.model.lines.length===0)return;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 M.Vector2(s.x*r,s.y*a),c=this.model.lines.map(m=>{const[g,v]=m.points,b=g.position.clone().project(o),y=v.position.clone().project(o);if(!it(b)&&!it(y))return null;const I=new M.Vector2(b.x*r,b.y*a),P=new M.Vector2(y.x*r,y.y*a);return{id:m.id,points:[I,P]}}).filter(m=>!!m);if(c.length===0)return;const f=c.map(m=>{const g=Gi(l,m.points);return{id:m.id,distance:g.distanceTo(l)}}).sort((m,g)=>m.distance-g.distance)[0],u=f.distance>20?void 0:this.model.lines.find(({id:m})=>m===f.id);if(this.highlightedLines.length>0&&!u)return this.clearHighlightLines(),!1;if(u)return this.chooseLine(u),!1});d(this,"chooseLine",e=>{const n=Gn(e);this.highlightLines(n),this.five.needsRender=!0,this.hook.emit("selectedChange",n.map(o=>o.toCompletelyJson()))});d(this,"lineRemoved",e=>{this.removeLine(e),this.hook.emit("selectedChange",this.model.lines.filter(n=>n.selected).map(n=>n.toCompletelyJson()))});d(this,"onCameraUpdate",()=>{this.updateDistanceUI()});this.model.lines.forEach(o=>{o.distanceItem.appendTo(this.container),o.distanceItem.update(this.five),o.hook.on("selected",this.chooseLine),this.group.add(o.mesh)});const n=this.five.getElement();if(n){const o=new Zn(n);this.hammer=o}this.model.hook.on("lineRemoved",this.lineRemoved),this.five.on("cameraUpdate",this.onCameraUpdate),this.five.on("wantsTapGesture",this.wantsTapGesture),this.five.needsRender=!0}dispose(){var e;super.dispose(),this.model.hook.off("lineRemoved",this.lineRemoved),this.five.off("cameraUpdate",this.onCameraUpdate),this.five.off("wantsTapGesture",this.wantsTapGesture),this.five.needsRender=!0,this.hook.emit("selectedChange",[]),(e=this.hammer)==null||e.destroy()}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.model.lines.forEach(e=>{e.selected=!1,e.distanceItem.unHighlight(),this.group.remove(e.lightMesh)}),this.highlightedLines=[],this.five.needsRender=!0)}highlightLines(e){this.clearHighlightLines(),this.highlightedLines=e,e.forEach(n=>this.highlightLine(n))}}const lu=`
|
|
213
213
|
<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">
|
|
214
214
|
<defs>
|
|
215
215
|
<linearGradient x1="22.185491%" y1="100%" x2="66.8316686%" y2="6.67239121%" id="linearGradient-1">
|
|
@@ -498,7 +498,7 @@ void main() {
|
|
|
498
498
|
<div class='range-piece__content'></div>
|
|
499
499
|
<div class="range-piece__aim"></div>
|
|
500
500
|
</div>
|
|
501
|
-
`;function Ou(){}const{Vector2:Ru}=O;function Nu(i,t){const{offsetWidth:e,offsetHeight:n}=t,{top:o,left:s}=t.getBoundingClientRect();return Object.assign(new Ru,{x:(i.x-s)/e*2-1,y:-(i.y-o)/n*2+1})}class Bu{constructor(t){d(this,"container",document.createElement("div"));d(this,"five");d(this,"group");d(this,"mouseGroup");d(this,"hasAppendMouseGroup",!1);d(this,"fiveHelper");d(this,"hook");d(this,"content");d(this,"intersectMesh");d(this,"centerMouseXY");d(this,"raycaster",new M.Raycaster);d(this,"pieceStyl",{matrix3d:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],scale:1,opacity:.4});d(this,"onCameraDirectionUpdate",()=>{const t=this.getIntersection();if(t){this.pieceChange(t),this.updateMouseGroup(t);const e=new ot(this.mouseGroup.position);this.hook.emit("nowPointChange",e)}});d(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 ot(n)):this.hook.emit("getEndPoint",new ot(n)))});d(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=Nu({x:r,y:a},this.five.getElement());this.centerMouseXY=c});d(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=ir({isMobile:!0,...t.openParams.crossHairParameter}),this.fiveHelper=t.fiveHelper,this.container.innerHTML=ju,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 M.Mesh(new M.RingGeometry(.04,.08,32),new M.MeshBasicMaterial({color:1245179,opacity:0,side:M.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=xt.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=Ou;const s=new xt.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=Hi(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 Hu{constructor(t,e){d(this,"hasOpen",!1);d(this,"hook",new ye.Subscribe);d(this,"magnifier");d(this,"five");d(this,"model");d(this,"group");d(this,"config");d(this,"fiveHelper");d(this,"useUIController");d(this,"params");d(this,"useGuideController");d(this,"rangePieceController");d(this,"container",document.createElement("div"));d(this,"shortcutKeyController");d(this,"controller",null);d(this,"controllerParams");d(this,"getCurrentMode",()=>this.controller instanceof Cn?"Edit":this.controller instanceof mi?"Watch":this.controller instanceof $o?"Mixed":null);d(this,"changeMode",t=>{var n;if(!this.hasOpen||this.getCurrentMode()===t)return;if(this.getCurrentMode()==="Mixed"||t==="Mixed")return new Error("\u4E0D\u652F\u6301\u5207\u6362\u7684Mode");(n=this.controller)==null||n.dispose();const e={View:au,Watch:mi,Edit:Cn};if(!e[t])throw new Error("\u4E0D\u5B58\u5728\u7684 Mode");this.controller=new e[t](this.controllerParams),this.hook.emit("modeChange",t)});var s,r;this.five=t,this.params=e;const n={userDistanceItemCreator:void 0,getDistanceText(a){return a.toFixed(2)+"m"}};this.config={...n,...Vn(e,["openParams","magnifierParams"])},this.model=new Fi(this.config),this.fiveHelper=new Yh(t),this.magnifier=new $s(t,(s=e.magnifierParams)!=null?s:{width:190,height:190,scale:2}),this.group=new M.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",this.container.style.background="rgba(0, 0, 0, 0.15)";const o=(r=this.params.openParams)!=null?r:{};this.controllerParams={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:o,mouseGroup:ir({...o.crossHairParameter}),userDistanceItemCreator:this.params.userDistanceItemCreator},this.params.useUIController!==!1&&(this.useUIController=new es(this,this.controllerParams)),this.params.useGuideController!==!1&&(this.useGuideController=new Du(this,this.controllerParams))}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(){var t,e,n;this.hasOpen||(this.hasOpen=!0,this.five.scene.add(this.group),this.container.style.opacity="1",(t=this.params.openParams)!=null&&t.isMobile?(this.controller=new $o(this.controllerParams),this.rangePieceController=new Bu(this.controllerParams)):(this.five.helperVisible=!1,this.controller=new mi(this.controllerParams)),(e=this.useUIController)==null||e.show(),(n=this.useGuideController)==null||n.show(),this.shortcutKeyController=new zu(this,this.five),this.hook.emit("enable",!0))}disable(){var t,e,n,o,s;this.hasOpen=!1,this.container.style.opacity="0",(t=this.controller)==null||t.dispose(),(e=this.rangePieceController)==null||e.dispose(),(n=this.useUIController)==null||n.hide(),(o=this.useGuideController)==null||o.hide(),(s=this.shortcutKeyController)==null||s.dispose(),this.controller=null,this.five.helperVisible=!0,this.five.scene.remove(this.group),this.five.needsRender=!0,this.hook.emit("disable",!0)}revoke(){this.controller instanceof Cn&&this.controller.revoke()}removeLineByID(t){this.model.removeLineByID(t)}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(){return this.controller instanceof Cn?(this.model.mergeModel(this.controller.model),this):this}toJson(){return this.model.toJson()}changeIsMobile(t){var e,n;((e=this.controllerParams.openParams)==null?void 0:e.isMobile)===void 0&&(this.controllerParams.openParams.isMobile=t),this.controllerParams.openParams.isMobile!==t&&(this.controllerParams.openParams.isMobile=t,this.params.useUIController!==!1&&((n=this.useUIController)==null||n.dispose()),this.useUIController=new es(this,this.controllerParams))}changeConfigs(t){var e;if(t.getDistanceText&&t.getDistanceText!==this.config.getDistanceText){const n=t.getDistanceText;this.config.getDistanceText=n,(e=this.controller)==null||e.updateDistanceUI()}}}const Fu=function(t,e){return new Hu(t,e)},lr=Hs(null);function Gu(i){ge(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 ts(i,t,e){const n=i.slice();return n[3]=t[e],n}function ns(i){let t,e=`${i[3].top}%`,n=`${i[3].left}%`,o,s;function r(){return i[2](i[3])}return{c(){t=X("i"),x(t,"class","svelte-19zi46m"),Se(t,"PanoSpatialTagPlugin__tag-origin",!0),Se(t,"PanoSpatialTagPlugin__tag-origin-destroy",i[3].destroying),S(t,"top",e),S(t,"left",n),S(t,"visibility",i[3].front?"visible":"hidden")},m(a,l){V(a,t,l),o||(s=qe(t,"click",r),o=!0)},p(a,l){i=a,l&1&&Se(t,"PanoSpatialTagPlugin__tag-origin-destroy",i[3].destroying),l&1&&e!==(e=`${i[3].top}%`)&&S(t,"top",e),l&1&&n!==(n=`${i[3].left}%`)&&S(t,"left",n),l&1&&S(t,"visibility",i[3].front?"visible":"hidden")},d(a){a&&W(t),o=!1,s()}}}function Xu(i){let t,e=i[0],n=[];for(let o=0;o<e.length;o+=1)n[o]=ns(ts(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);V(o,t,s)},p(o,[s]){if(s&3){e=o[0];let r;for(r=0;r<e.length;r+=1){const a=ts(o,e,r);n[r]?n[r].p(a,s):(n[r]=ns(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:ne,o:ne,d(o){Ht(n,o),o&&W(t)}}}function Qu(i,t,e){let{origins:n}=t;const o=r=>{lr.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 Wu extends de{constructor(t){super(),ue(this,t,Qu,Xu,he,{origins:0},Gu)}}function Yu(i){ge(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 Vu(i){let t,e,n,o,s,r,a,l,c,h,f,u,m,g,v;return{c(){t=X("div"),e=X("div"),n=fe(),o=X("div"),s=X("i"),r=fe(),a=X("i"),l=fe(),c=X("i"),h=fe(),f=X("div"),u=X("div"),x(e,"class","PanoSpatialTagPlugin__tag-shadow svelte-1i5h9zh"),S(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]+")"),x(s,"class","PanoSpatialTagPlugin__tag-flagpole svelte-1i5h9zh"),S(s,"width",i[4]+"rem"),x(a,"class","PanoSpatialTagPlugin__tag-line1 svelte-1i5h9zh"),x(c,"class","PanoSpatialTagPlugin__tag-line2 svelte-1i5h9zh"),x(o,"class","PanoSpatialTagPlugin__tag-line svelte-1i5h9zh"),x(u,"class","PanoSpatialTagPlugin__tag-content svelte-1i5h9zh"),x(f,"class","PanoSpatialTagPlugin__tag-animate svelte-1i5h9zh"),S(f,"transform","scale("+i[3]*3+")"),x(t,"id",m="PanoSpatialTagPlugin__"+i[0]),S(t,"height",20*i[5]+"rem"),x(t,"class","svelte-1i5h9zh"),Se(t,"PanoSpatialTagPlugin__tag-x",!0),Se(t,"PanoSpatialTagPlugin__tag-upside-down",i[1]),Se(t,"PanoSpatialTagPlugin__tag-show",i[10]),Se(t,"PanoSpatialTagPlugin__tag-hide",i[10]===!1||i[6])},m(b,y){V(b,t,y),Q(t,e),Q(t,n),Q(t,o),Q(o,s),Q(o,r),Q(o,a),Q(o,l),Q(o,c),Q(t,h),Q(t,f),Q(f,u),u.innerHTML=i[2],i[16](u),g||(v=qe(u,"click",i[11]),g=!0)},p(b,[y]){y&394&&S(e,"transform","translate("+b[7]/2*b[3]*3+"px, "+b[8]/2*(b[1]?-1:1)*b[3]*3+"px) scale("+1/b[3]+")"),y&16&&S(s,"width",b[4]+"rem"),y&4&&(u.innerHTML=b[2]),y&8&&S(f,"transform","scale("+b[3]*3+")"),y&1&&m!==(m="PanoSpatialTagPlugin__"+b[0])&&x(t,"id",m),y&32&&S(t,"height",20*b[5]+"rem"),y&2&&Se(t,"PanoSpatialTagPlugin__tag-upside-down",b[1]),y&1024&&Se(t,"PanoSpatialTagPlugin__tag-show",b[10]),y&1088&&Se(t,"PanoSpatialTagPlugin__tag-hide",b[10]===!1||b[6])},i:ne,o:ne,d(b){b&&W(t),i[16](null),g=!1,v()}}}function Zu(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:h}=t,{dispose:f}=t,{events:u}=t,{hooks:m}=t,g=0,v=0,b,y,I=setTimeout(()=>{h||e(10,y=!0),I=void 0},100);const P=E=>{const T=Object.keys(u);let C=E.target;for(;C;){const z=C.getAttribute("class");if(!z){C=C.parentNode;continue}if(z.includes("PanoSpatialTagPlugin__tag-content")){C=null;break}T.forEach(B=>{z.includes(B)&&u[B](n)}),C=C.parentNode}};Ct(()=>{m.emit("initTag",{id:n})});const k=lr.subscribe(E=>{if(E===null)return;const[T,C]=E.split("-PanoSpatialTagPlugin-");n===T&&(m.emit("clickOrigin",{id:n,show:y}),I||(e(10,y=h),e(12,h=!h),I=setTimeout(()=>{I=void 0},1500)))});La(()=>{e(7,g=b.offsetWidth),e(8,v=b.offsetHeight),!I&&e(10,y=!h)}),nn(()=>{m.emit("destroyTag",{id:n}),k(),f()});function D(E){Rt[E?"unshift":"push"](()=>{b=E,e(9,b)})}return i.$$set=E=>{"id"in E&&e(0,n=E.id),"upsideDown"in E&&e(1,o=E.upsideDown),"content"in E&&e(2,s=E.content),"contentZoom"in E&&e(3,r=E.contentZoom),"lineWidthZoom"in E&&e(4,a=E.lineWidthZoom),"lineHeightZoom"in E&&e(5,l=E.lineHeightZoom),"destroying"in E&&e(6,c=E.destroying),"folded"in E&&e(12,h=E.folded),"dispose"in E&&e(13,f=E.dispose),"events"in E&&e(14,u=E.events),"hooks"in E&&e(15,m=E.hooks)},[n,o,s,r,a,l,c,g,v,b,y,P,h,f,u,m,D]}class Ju extends de{constructor(t){super(),ue(this,t,Zu,Vu,he,{id:0,upsideDown:1,content:2,contentZoom:3,lineWidthZoom:4,lineHeightZoom:5,destroying:6,folded:12,dispose:13,events:14,hooks:15},Yu)}}const Uu={position:"absolute",top:"0px",left:"0px",width:"100%",height:"100%",pointerEvents:"none"},is="<",os=">",ss="%",rs="locals",qu="(<%%|%%>|<%=|<%-|<%_|<%#|<%|%>|-%>|_%>)",Ku={"&":"&","<":"<",">":">",'"':""","'":"'"},Re={EVAL:"eval",ESCAPED:"escaped",RAW:"raw",COMMENT:"comment",LITERAL:"literal"};function as(i){return i.replace(/;(\s*$)/,"$1")}function _u(i,t){return new $u(i).compileFunction()(t)}class $u{constructor(t){d(this,"templateText");d(this,"mode",null);d(this,"truncate",!1);d(this,"currentLine",1);d(this,"source","");d(this,"regex",new RegExp(qu));this.templateText=t}compileFunction(){let t;const e=` var __output = "";
|
|
501
|
+
`;function Ou(){}const{Vector2:Ru}=O;function Nu(i,t){const{offsetWidth:e,offsetHeight:n}=t,{top:o,left:s}=t.getBoundingClientRect();return Object.assign(new Ru,{x:(i.x-s)/e*2-1,y:-(i.y-o)/n*2+1})}class Bu{constructor(t){d(this,"container",document.createElement("div"));d(this,"five");d(this,"group");d(this,"mouseGroup");d(this,"hasAppendMouseGroup",!1);d(this,"fiveHelper");d(this,"hook");d(this,"content");d(this,"intersectMesh");d(this,"centerMouseXY");d(this,"raycaster",new M.Raycaster);d(this,"pieceStyl",{matrix3d:[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],scale:1,opacity:.4});d(this,"onCameraDirectionUpdate",()=>{const t=this.getIntersection();if(t){this.pieceChange(t),this.updateMouseGroup(t);const e=new ot(this.mouseGroup.position);this.hook.emit("nowPointChange",e)}});d(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 ot(n)):this.hook.emit("getEndPoint",new ot(n)))});d(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=Nu({x:r,y:a},this.five.getElement());this.centerMouseXY=c});d(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=ir({isMobile:!0,...t.openParams.crossHairParameter}),this.fiveHelper=t.fiveHelper,this.container.innerHTML=ju,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 M.Mesh(new M.RingGeometry(.04,.08,32),new M.MeshBasicMaterial({color:1245179,opacity:0,side:M.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=xt.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=Ou;const s=new xt.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=Hi(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 Hu{constructor(t,e){d(this,"hasOpen",!1);d(this,"hook",new ye.Subscribe);d(this,"magnifier");d(this,"five");d(this,"model");d(this,"group");d(this,"config");d(this,"fiveHelper");d(this,"useUIController");d(this,"params");d(this,"useGuideController");d(this,"rangePieceController");d(this,"container",document.createElement("div"));d(this,"shortcutKeyController");d(this,"controller",null);d(this,"controllerParams");d(this,"getCurrentMode",()=>this.controller instanceof Cn?"Edit":this.controller instanceof mi?"Watch":this.controller instanceof $o?"Mixed":null);d(this,"changeMode",t=>{var n;if(!this.hasOpen||this.getCurrentMode()===t)return;if(this.getCurrentMode()==="Mixed"||t==="Mixed")return new Error("\u4E0D\u652F\u6301\u5207\u6362\u7684Mode");(n=this.controller)==null||n.dispose();const e={View:au,Watch:mi,Edit:Cn};if(!e[t])throw new Error("\u4E0D\u5B58\u5728\u7684 Mode");this.controller=new e[t](this.controllerParams),this.hook.emit("modeChange",t)});var s,r;this.five=t,this.params=e;const n={userDistanceItemCreator:void 0,getDistanceText(a){return a.toFixed(2)+"m"}};this.config={...n,...Vn(e,["openParams","magnifierParams"])},this.model=new Fi(this.config),this.fiveHelper=new Yh(t),this.magnifier=new $s(t,(s=e.magnifierParams)!=null?s:{width:190,height:190,scale:2}),this.group=new M.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",this.container.style.background="rgba(0, 0, 0, 0.15)";const o=(r=this.params.openParams)!=null?r:{};this.controllerParams={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:o,mouseGroup:ir({...o.crossHairParameter}),userDistanceItemCreator:this.params.userDistanceItemCreator},this.params.useUIController!==!1&&(this.useUIController=new es(this,this.controllerParams)),this.params.useGuideController!==!1&&(this.useGuideController=new Du(this,this.controllerParams))}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(){var t,e,n;this.hasOpen||(this.hasOpen=!0,this.five.scene.add(this.group),this.container.style.opacity="1",(t=this.params.openParams)!=null&&t.isMobile?(this.controller=new $o(this.controllerParams),this.rangePieceController=new Bu(this.controllerParams)):(this.five.helperVisible=!1,this.controller=new mi(this.controllerParams)),(e=this.useUIController)==null||e.show(),(n=this.useGuideController)==null||n.show(),this.shortcutKeyController=new zu(this,this.five),this.hook.emit("enable",!0))}disable(){var t,e,n,o,s;this.hasOpen=!1,this.container.style.opacity="0",(t=this.controller)==null||t.dispose(),(e=this.rangePieceController)==null||e.dispose(),(n=this.useUIController)==null||n.hide(),(o=this.useGuideController)==null||o.hide(),(s=this.shortcutKeyController)==null||s.dispose(),this.controller=null,this.five.helperVisible=!0,this.five.scene.remove(this.group),this.five.needsRender=!0,this.hook.emit("disable",!0)}revoke(){this.controller instanceof Cn&&this.controller.revoke()}removeLineByID(t){this.model.removeLineByID(t)}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(){return this.controller instanceof Cn?(this.model.mergeModel(this.controller.model),this):this}toJson(){return this.model.toJson()}changeIsMobile(t){var e,n;((e=this.controllerParams.openParams)==null?void 0:e.isMobile)===void 0&&(this.controllerParams.openParams.isMobile=t),this.controllerParams.openParams.isMobile!==t&&(this.controllerParams.openParams.isMobile=t,this.params.useUIController!==!1&&((n=this.useUIController)==null||n.dispose()),this.useUIController=new es(this,this.controllerParams))}changeConfigs(t){var e;if(t.getDistanceText&&t.getDistanceText!==this.config.getDistanceText){const n=t.getDistanceText;this.config.getDistanceText=n,(e=this.controller)==null||e.updateDistanceUI()}}}const Fu=function(t,e){return new Hu(t,e)},lr=Hs(null);function Gu(i){ge(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 ts(i,t,e){const n=i.slice();return n[3]=t[e],n}function ns(i){let t,e=`${i[3].top}%`,n=`${i[3].left}%`,o,s;function r(){return i[2](i[3])}return{c(){t=X("i"),x(t,"class","svelte-19zi46m"),Se(t,"PanoSpatialTagPlugin__tag-origin",!0),Se(t,"PanoSpatialTagPlugin__tag-origin-destroy",i[3].destroying),S(t,"top",e),S(t,"left",n),S(t,"visibility",i[3].front?"visible":"hidden")},m(a,l){V(a,t,l),o||(s=qe(t,"click",r),o=!0)},p(a,l){i=a,l&1&&Se(t,"PanoSpatialTagPlugin__tag-origin-destroy",i[3].destroying),l&1&&e!==(e=`${i[3].top}%`)&&S(t,"top",e),l&1&&n!==(n=`${i[3].left}%`)&&S(t,"left",n),l&1&&S(t,"visibility",i[3].front?"visible":"hidden")},d(a){a&&W(t),o=!1,s()}}}function Xu(i){let t,e=i[0],n=[];for(let o=0;o<e.length;o+=1)n[o]=ns(ts(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);V(o,t,s)},p(o,[s]){if(s&3){e=o[0];let r;for(r=0;r<e.length;r+=1){const a=ts(o,e,r);n[r]?n[r].p(a,s):(n[r]=ns(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:ne,o:ne,d(o){Ht(n,o),o&&W(t)}}}function Qu(i,t,e){let{origins:n}=t;const o=r=>{lr.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 Wu extends de{constructor(t){super(),ue(this,t,Qu,Xu,he,{origins:0},Gu)}}function Yu(i){ge(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 Vu(i){let t,e,n,o,s,r,a,l,c,h,f,u,m,g,v;return{c(){t=X("div"),e=X("div"),n=fe(),o=X("div"),s=X("i"),r=fe(),a=X("i"),l=fe(),c=X("i"),h=fe(),f=X("div"),u=X("div"),x(e,"class","PanoSpatialTagPlugin__tag-shadow svelte-1i5h9zh"),S(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]+")"),x(s,"class","PanoSpatialTagPlugin__tag-flagpole svelte-1i5h9zh"),S(s,"width",i[4]+"rem"),x(a,"class","PanoSpatialTagPlugin__tag-line1 svelte-1i5h9zh"),x(c,"class","PanoSpatialTagPlugin__tag-line2 svelte-1i5h9zh"),x(o,"class","PanoSpatialTagPlugin__tag-line svelte-1i5h9zh"),x(u,"class","PanoSpatialTagPlugin__tag-content svelte-1i5h9zh"),x(f,"class","PanoSpatialTagPlugin__tag-animate svelte-1i5h9zh"),S(f,"transform","scale("+i[3]*3+")"),x(t,"id",m="PanoSpatialTagPlugin__"+i[0]),S(t,"height",20*i[5]+"rem"),x(t,"class","svelte-1i5h9zh"),Se(t,"PanoSpatialTagPlugin__tag-x",!0),Se(t,"PanoSpatialTagPlugin__tag-upside-down",i[1]),Se(t,"PanoSpatialTagPlugin__tag-show",i[10]),Se(t,"PanoSpatialTagPlugin__tag-hide",i[10]===!1||i[6])},m(b,y){V(b,t,y),Q(t,e),Q(t,n),Q(t,o),Q(o,s),Q(o,r),Q(o,a),Q(o,l),Q(o,c),Q(t,h),Q(t,f),Q(f,u),u.innerHTML=i[2],i[16](u),g||(v=qe(u,"click",i[11]),g=!0)},p(b,[y]){y&394&&S(e,"transform","translate("+b[7]/2*b[3]*3+"px, "+b[8]/2*(b[1]?-1:1)*b[3]*3+"px) scale("+1/b[3]+")"),y&16&&S(s,"width",b[4]+"rem"),y&4&&(u.innerHTML=b[2]),y&8&&S(f,"transform","scale("+b[3]*3+")"),y&1&&m!==(m="PanoSpatialTagPlugin__"+b[0])&&x(t,"id",m),y&32&&S(t,"height",20*b[5]+"rem"),y&2&&Se(t,"PanoSpatialTagPlugin__tag-upside-down",b[1]),y&1024&&Se(t,"PanoSpatialTagPlugin__tag-show",b[10]),y&1088&&Se(t,"PanoSpatialTagPlugin__tag-hide",b[10]===!1||b[6])},i:ne,o:ne,d(b){b&&W(t),i[16](null),g=!1,v()}}}function Zu(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:h}=t,{dispose:f}=t,{events:u}=t,{hooks:m}=t,g=0,v=0,b,y,I=setTimeout(()=>{h||e(10,y=!0),I=void 0},100);const P=E=>{const T=Object.keys(u);let C=E.target;for(;C;){const z=C.getAttribute("class");if(!z){C=C.parentNode;continue}if(z.includes("PanoSpatialTagPlugin__tag-content")){C=null;break}T.forEach(B=>{z.includes(B)&&u[B](n)}),C=C.parentNode}};Ct(()=>{m.emit("initTag",{id:n})});const L=lr.subscribe(E=>{if(E===null)return;const[T,C]=E.split("-PanoSpatialTagPlugin-");n===T&&(m.emit("clickOrigin",{id:n,show:y}),I||(e(10,y=h),e(12,h=!h),I=setTimeout(()=>{I=void 0},1500)))});La(()=>{e(7,g=b.offsetWidth),e(8,v=b.offsetHeight),!I&&e(10,y=!h)}),nn(()=>{m.emit("destroyTag",{id:n}),L(),f()});function D(E){Rt[E?"unshift":"push"](()=>{b=E,e(9,b)})}return i.$$set=E=>{"id"in E&&e(0,n=E.id),"upsideDown"in E&&e(1,o=E.upsideDown),"content"in E&&e(2,s=E.content),"contentZoom"in E&&e(3,r=E.contentZoom),"lineWidthZoom"in E&&e(4,a=E.lineWidthZoom),"lineHeightZoom"in E&&e(5,l=E.lineHeightZoom),"destroying"in E&&e(6,c=E.destroying),"folded"in E&&e(12,h=E.folded),"dispose"in E&&e(13,f=E.dispose),"events"in E&&e(14,u=E.events),"hooks"in E&&e(15,m=E.hooks)},[n,o,s,r,a,l,c,g,v,b,y,P,h,f,u,m,D]}class Ju extends de{constructor(t){super(),ue(this,t,Zu,Vu,he,{id:0,upsideDown:1,content:2,contentZoom:3,lineWidthZoom:4,lineHeightZoom:5,destroying:6,folded:12,dispose:13,events:14,hooks:15},Yu)}}const Uu={position:"absolute",top:"0px",left:"0px",width:"100%",height:"100%",pointerEvents:"none"},is="<",os=">",ss="%",rs="locals",qu="(<%%|%%>|<%=|<%-|<%_|<%#|<%|%>|-%>|_%>)",Ku={"&":"&","<":"<",">":">",'"':""","'":"'"},Re={EVAL:"eval",ESCAPED:"escaped",RAW:"raw",COMMENT:"comment",LITERAL:"literal"};function as(i){return i.replace(/;(\s*$)/,"$1")}function _u(i,t){return new $u(i).compileFunction()(t)}class $u{constructor(t){d(this,"templateText");d(this,"mode",null);d(this,"truncate",!1);d(this,"currentLine",1);d(this,"source","");d(this,"regex",new RegExp(qu));this.templateText=t}compileFunction(){let t;const e=` var __output = "";
|
|
502
502
|
function __append(s) { if (s !== undefined && s !== null) __output += s }
|
|
503
503
|
with (`+rs+` || {}) {
|
|
504
504
|
`,n=` }
|
|
@@ -513,26 +513,26 @@ void main() {
|
|
|
513
513
|
`)}switch(this.mode){case Re.EVAL:this.source+=" ; "+t+`
|
|
514
514
|
`;break;case Re.ESCAPED:this.source+=" ; __append(escapeFn("+as(t)+`))
|
|
515
515
|
`;break;case Re.RAW:this.source+=" ; __append("+as(t)+`)
|
|
516
|
-
`;break;case Re.COMMENT:break;case Re.LITERAL:this._addOutput(t);break}}else this._addOutput(t)}}}const pi=.001,ls=.01,ed="https://vrlab-image4.ljcdn.com/release/web/PanoSpatialTagPlugin__blur.png",td=(i,t)=>{var Y,ee,se,ie,ce,Ae,Ce,Me;let e=t==null?void 0:t.container,n=1.4;const o=(Y=t==null?void 0:t.wait)!=null?Y:200,s=(ee=t==null?void 0:t.maxNumberOnScreen)!=null?ee:3,r=(se=t==null?void 0:t.minRad)!=null?se:Math.PI/4,a=(ie=t==null?void 0:t.nearTolerance)!=null?ie:100,l=(ce=t==null?void 0:t.upsideHeight)!=null?ce:1.6,c=(Ae=t==null?void 0:t.minDistance)!=null?Ae:1.2,h=(Ce=t==null?void 0:t.maxDistance)!=null?Ce:3.5,f=Xn(i),u=document.createElement("div");u.classList.add("PanoSpatialTagPlugin"),Object.assign(u.style,Uu);const m=new ye.Subscribe;let g=new Image;g.src=ed;const v={points:[],origins:[],tags:[],template:"",events:{},render:_u,folded:!1,enabled:!0,forbidden:!0},b=new Wu({target:u,props:{origins:v.origins}}),y=(Z,re)=>{D(),re&&E()},I=()=>{v.forbidden&&(v.forbidden=!1,E())},P=(Z,re)=>{if(v.tags.length===0)return;const oe=re.longitude-i.state.longitude,q=i.camera.clone();q.position.copy(re.offset),q.rotateOnWorldAxis(new O.Vector3(0,1,0),oe),q.updateProjectionMatrix(),q.updateMatrixWorld(!0);const Ne=new O.Frustum,Qe=new O.Matrix4;Qe.multiplyMatrices(q.projectionMatrix,q.matrixWorldInverse),Ne.setFromProjectionMatrix(Qe),v.tags.forEach(le=>{const Be=q.position.clone().setY(n).distanceTo(le.position);if(Be<c||Be>h||!Ne.containsPoint(le.position))return le.destroying=!0;const He=le.position.clone().sub(q.position).setY(0);if(He.angleTo(le.normal)>Math.PI/2-r&&He.angleTo(le.normal)<Math.PI/2+r)return le.destroying=!0}),v.tags.forEach(le=>{le.destroying?le.app.$set({contentZoom:.1+q.position.distanceTo(le.position)/h,lineWidthZoom:.38*(.01+q.position.distanceTo(le.position)/h),destroying:le.destroying}):le.app.$set({lineWidthZoom:.38*(.01+q.position.distanceTo(le.position)/h),lineHeightZoom:.4+(q.position.distanceTo(le.position)-c)/h*.6,contentZoom:.1+q.position.distanceTo(le.position)/h})}),setTimeout(()=>{v.tags.forEach(le=>{le.destroying&&(le.app.$destroy(),le=null)}),v.tags=v.tags.filter(le=>!le.destroying),D()},1900)},
|
|
516
|
+
`;break;case Re.COMMENT:break;case Re.LITERAL:this._addOutput(t);break}}else this._addOutput(t)}}}const pi=.001,ls=.01,ed="https://vrlab-image4.ljcdn.com/release/web/PanoSpatialTagPlugin__blur.png",td=(i,t)=>{var Y,ee,se,ie,ce,Ae,Ce,Me;let e=t==null?void 0:t.container,n=1.4;const o=(Y=t==null?void 0:t.wait)!=null?Y:200,s=(ee=t==null?void 0:t.maxNumberOnScreen)!=null?ee:3,r=(se=t==null?void 0:t.minRad)!=null?se:Math.PI/4,a=(ie=t==null?void 0:t.nearTolerance)!=null?ie:100,l=(ce=t==null?void 0:t.upsideHeight)!=null?ce:1.6,c=(Ae=t==null?void 0:t.minDistance)!=null?Ae:1.2,h=(Ce=t==null?void 0:t.maxDistance)!=null?Ce:3.5,f=Xn(i),u=document.createElement("div");u.classList.add("PanoSpatialTagPlugin"),Object.assign(u.style,Uu);const m=new ye.Subscribe;let g=new Image;g.src=ed;const v={points:[],origins:[],tags:[],template:"",events:{},render:_u,folded:!1,enabled:!0,forbidden:!0},b=new Wu({target:u,props:{origins:v.origins}}),y=(Z,re)=>{D(),re&&E()},I=()=>{v.forbidden&&(v.forbidden=!1,E())},P=(Z,re)=>{if(v.tags.length===0)return;const oe=re.longitude-i.state.longitude,q=i.camera.clone();q.position.copy(re.offset),q.rotateOnWorldAxis(new O.Vector3(0,1,0),oe),q.updateProjectionMatrix(),q.updateMatrixWorld(!0);const Ne=new O.Frustum,Qe=new O.Matrix4;Qe.multiplyMatrices(q.projectionMatrix,q.matrixWorldInverse),Ne.setFromProjectionMatrix(Qe),v.tags.forEach(le=>{const Be=q.position.clone().setY(n).distanceTo(le.position);if(Be<c||Be>h||!Ne.containsPoint(le.position))return le.destroying=!0;const He=le.position.clone().sub(q.position).setY(0);if(He.angleTo(le.normal)>Math.PI/2-r&&He.angleTo(le.normal)<Math.PI/2+r)return le.destroying=!0}),v.tags.forEach(le=>{le.destroying?le.app.$set({contentZoom:.1+q.position.distanceTo(le.position)/h,lineWidthZoom:.38*(.01+q.position.distanceTo(le.position)/h),destroying:le.destroying}):le.app.$set({lineWidthZoom:.38*(.01+q.position.distanceTo(le.position)/h),lineHeightZoom:.4+(q.position.distanceTo(le.position)-c)/h*.6,contentZoom:.1+q.position.distanceTo(le.position)/h})}),setTimeout(()=>{v.tags.forEach(le=>{le.destroying&&(le.app.$destroy(),le=null)}),v.tags=v.tags.filter(le=>!le.destroying),D()},1900)},L=Z=>{Z!==ye.Five.Mode.Panorama&&!v.forbidden&&(b.$set({origins:[]}),v.tags.forEach(re=>{re.app.$destroy(),re=null}),v.origins=[],v.tags=[],v.forbidden=!0)},D=()=>{if(v.forbidden||!v.enabled)return;const Z=i.camera,re=Z.getWorldDirection(new O.Vector3);v.origins=v.tags.map(oe=>{const q=oe.position.clone().project(Z),Ne=oe.position.clone().sub(Z.position).setY(0).angleTo(re.setY(0))<Math.PI/2;return{id:oe.id,front:Ne,left:(q.x+1)/2*100,top:(-q.y+1)/2*100,destroying:oe.destroying}}),b.$set({origins:v.origins})},E=()=>{v.forbidden||!v.enabled||(v.timeoutId&&clearTimeout(v.timeoutId),v.timeoutId=setTimeout(()=>{v.timeoutId=void 0;const Z=T();Z.length&&(v.tags=v.tags.concat(Z),D())},o))},T=()=>{const{clientWidth:Z,clientHeight:re}=i.getElement(),oe=[],q=i.camera,Ne=new O.Frustum,Qe=new O.Matrix4,le=q.getWorldDirection(new O.Vector3);Qe.multiplyMatrices(q.projectionMatrix,q.matrixWorldInverse),Ne.setFromProjectionMatrix(Qe);const Be=v.tags.filter(me=>Ne.containsPoint(me.position)&&!me.destroying).length,He=v.points.reduce((me,Ee)=>{if(v.tags.find(ke=>Ee.id===ke.id&&!ke.destroying))return me;const We=q.position.clone().setY(n).distanceTo(Ee.position);if(We<c||We>h||!Ne.containsPoint(Ee.position))return me;const ft=Ee.position.clone().sub(q.position).setY(0);if(ft.angleTo(Ee.normal)>Math.PI/2-r&&ft.angleTo(Ee.normal)<Math.PI/2+r)return me;const Ze=Ee.position.clone().project(q);if(!v.tags.every(ke=>{if(ke.position.clone().sub(q.position).setY(0).angleTo(le.setY(0))>Math.PI/2)return!0;const st=ke.position.clone().project(q);return Math.sqrt(Math.pow((Ze.x-st.x)/2*Z,2)+Math.pow((Ze.y-st.y)/2*re,2))>a}))return me;const Le={id:Ee.id,position:Ee.position,normal:Ee.normal,replacement:Ee.replacement,weight:Ee.weight,distance:We};let we;for(let ke=0,st=me.length;ke<st;ke++){const kt=me[ke];if(Le.weight>kt.weight){we=ke;break}if(Le.distance<kt.distance){we=ke;break}}return we!==void 0?me.splice(we,0,Le):me.push(Le),me},[]);for(let me=0,Ee=He.length;me<Ee&&!(Be+oe.length>=s);me++){const We=He[me];if(oe.find(we=>We.id===we.id))continue;const ft=We.position.clone().project(q);if(!v.tags.concat(oe).every(we=>{if(we.position.clone().sub(q.position).setY(0).angleTo(le.setY(0))>Math.PI/2)return!0;const ke=we.position.clone().project(q);return Math.sqrt(Math.pow((ft.x-ke.x)/2*Z,2)+Math.pow((ft.y-ke.y)/2*re,2))>a}))continue;const Ze=new O.Raycaster(q.position.clone().setY(n),We.position.clone().sub(q.position.clone().setY(n)).normalize(),0,We.distance+ls),[Le]=v.intersectObjects?Ze.intersectObjects(v.intersectObjects,!0):i.model.bvhs.loaded?i.model.intersectRaycaster(Ze):Ze.intersectObjects(i.model.children,!0);if(!!Le&&We.distance-Le.distance<ls){const{position:we,normal:ke,id:st,replacement:kt}=We,Kn=new O.Plane().setFromNormalAndCoplanarPoint(ke,we),Qt=we.clone().sub(q.position).cross(new O.Vector3(0,1,0)).setLength(pi),on=[we.clone(),we.clone().add(Qt),we.clone().add(new O.Vector3(0,pi,0)).add(Qt),we.clone().add(new O.Vector3(0,pi,0))].map(Wt=>Kn.projectPoint(Wt,new O.Vector3)),{container:sn,dispose:rn}=f.create3DDomContainer(on)||{},Tt=new Ju({target:sn,props:{id:st,content:v.render(v.template,kt),lineWidthZoom:.38*(.01+q.position.distanceTo(we)/h),lineHeightZoom:.4+(q.position.distanceTo(we)-c)/h*.6,contentZoom:.1+q.position.distanceTo(we)/h,upsideDown:we.y>l,folded:v.folded,events:v.events,hooks:m,dispose:rn}});oe.push({position:we,normal:ke,id:st,app:Tt})}}return oe},C=Z=>{v.points=Z.points.map(re=>{var oe,q;return{id:re.id,position:new O.Vector3().fromArray(re.position),normal:new O.Vector3().fromArray(re.normal),replacement:(oe=re.replacement)!=null?oe:{},weight:(q=re.weight)!=null?q:-1}}),Z.render&&(v.render=Z.render),Z.template&&(v.template=Z.template),Z.events&&(v.events=Z.events),Z.enabled===!1&&(v.enabled=Z.enabled),Z.folded===!0&&(v.folded=Z.folded)},z=Z=>{v.intersectObjects=Z,E()},B=()=>{v.enabled=!0,E()},F=()=>{v.enabled=!1,b.$set({origins:[]}),v.tags.forEach(Z=>{Z.app.$destroy(),Z=null}),v.origins=[],v.tags=[]},$=()=>{v.folded=!1,v.tags.forEach(Z=>{Z.app.$set({folded:v.folded})})},j=()=>{v.folded=!0,v.tags.forEach(Z=>{Z.app.$set({folded:v.folded})})},R=Z=>{v.tags.forEach(re=>{re.id===Z&&re.app.$set({folded:!1})})},H=Z=>{v.tags.forEach(re=>{re.id===Z&&re.app.$set({folded:!0})})},_=()=>{i.once("renderFrame",D)},U=()=>{e||(e=i.getElement().parentElement),e&&e.appendChild(u),v.forbidden=!1,n=i.model.bounding.getCenter(new O.Vector3).y,E(),i.on("panoWillArrive",P),i.on("panoArrived",I),i.on("modeChange",L),i.on("cameraUpdate",y)},te=()=>{g=null,f.disposeAll(),b.$destroy(),v.tags.forEach(Z=>{Z.app.$destroy(),Z=null}),v.origins=[],v.tags=[],i.off("modelLoaded",U),i.off("renderFrame",D),i.off("panoWillArrive",P),i.off("panoArrived",I),i.off("modeChange",L),i.off("cameraUpdate",y),i.off("dispose",te),window.removeEventListener("resize",_,!1)};return window.addEventListener("resize",_,!1),(Me=i==null?void 0:i.model)!=null&&Me.loaded?U():i.once("modelLoaded",U),i.on("dispose",te),{load:C,setIntersectObjects:z,unfoldAll:$,foldAll:j,unfold:R,fold:H,enable:B,disable:F,hooks:m,dispose:te}};var Et=(i=>(i.SMALL="small",i.MIDLLE="middle",i.LARGE="large",i.EXTRA_LARGE="x-large",i))(Et||{}),cr={exports:{}};/*!
|
|
517
517
|
Copyright (c) 2018 Jed Watson.
|
|
518
518
|
Licensed under the MIT License (MIT), see
|
|
519
519
|
http://jedwatson.github.io/classnames
|
|
520
520
|
*/(function(i){(function(){var t={}.hasOwnProperty;function e(){for(var n=[],o=0;o<arguments.length;o++){var s=arguments[o];if(!!s){var r=typeof s;if(r==="string"||r==="number")n.push(s);else if(Array.isArray(s)){if(s.length){var a=e.apply(null,s);a&&n.push(a)}}else if(r==="object"){if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]")){n.push(s.toString());continue}for(var l in s)t.call(s,l)&&s[l]&&n.push(l)}}}return n.join(" ")}i.exports?(e.default=e,i.exports=e):window.classNames=e})()})(cr);const tt=cr.exports;function nd(i){ge(i,"svelte-i9z7qw",`.item-label-item.svelte-i9z7qw{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-i9z7qw{opacity:1;animation:svelte-i9z7qw-fadeIn .3s ease-in}.item-label-item__text-wrap.svelte-i9z7qw::before{content:'';position:absolute;width:100%;height:100%;background-color:rgba(0, 0, 0, .3);filter:blur(0.83333rem);z-index:-1}.item-label-item__text-wrap.svelte-i9z7qw{padding:0.3125rem 0.3125rem 0;position:absolute;height:1.04167rem;pointer-events:all;background-size:100% 100%;background-repeat:no-repeat;white-space:nowrap;line-height:0.52083rem;font-size:0.57292rem;font-weight:bold;color:#FFEAC0;transform:translate(-50%, 0);display:flex;justify-content:center;align-items:center}.item-label-item__text.svelte-i9z7qw{padding-bottom:0.20833rem;border-top:0 solid;border-left:0 solid;border-right:0 solid;border-bottom:1px 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-i9z7qw{position:absolute;bottom:0;width:1px;background-image:linear-gradient(to bottom, rgba(234, 208, 154, 0), rgba(234, 208, 154, 1))}@keyframes svelte-i9z7qw-fadeIn{from{opacity:0
|
|
521
521
|
}to{opacity:1
|
|
522
|
-
}}`)}function id(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,h;return{c(){t=X("div"),e=X("div"),n=X("span"),s=Ue(o),r=fe(),a=X("div"),x(n,"class","item-label-item__text svelte-i9z7qw"),x(e,"class","item-label-item__text-wrap svelte-i9z7qw"),S(e,"top",`-${i[0].strokeLength+26}px`),x(a,"class","item-label-item__bar svelte-i9z7qw"),S(a,"height",`${i[0].strokeLength}px`),x(t,"class",l=je(tt("item-label-item",{visible:i[0].visible}))+" svelte-i9z7qw"),S(t,"z-index",i[0].zIndex),S(t,"transform",i[0].transform)},m(f,u){V(f,t,u),Q(t,e),Q(e,n),Q(n,s),Q(t,r),Q(t,a),c||(h=qe(n,"click",i[1]),c=!0)},p(f,[u]){u&1&&o!==(o=(f[0].name.length>6?`${f[0].name.slice(0,6)}...`:f[0].name)+"")&&dt(s,o),u&1&&S(e,"top",`-${f[0].strokeLength+26}px`),u&1&&S(a,"height",`${f[0].strokeLength}px`),u&1&&l!==(l=je(tt("item-label-item",{visible:f[0].visible}))+" svelte-i9z7qw")&&x(t,"class",l),u&1&&S(t,"z-index",f[0].zIndex),u&1&&S(t,"transform",f[0].transform)},i:ne,o:ne,d(f){f&&W(t),c=!1,h()}}}function od(i,t,e){let{itemLabel:n}=t,{hooks:o}=t;function s(){console.log("__onclick___: ",n),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 sd extends de{constructor(t){super(),ue(this,t,od,id,he,{itemLabel:0,hooks:2},nd)}}function hr(i,t=200){let e;return function(...n){clearTimeout(e),e=setTimeout(()=>{i(...n)},t)}}function rd(i){ge(i,"svelte-gk8s47",".item-labels-container.svelte-gk8s47{width:100%;height:100%;position:relative}")}function cs(i,t,e){const n=i.slice();return n[26]=t[e],n}function hs(i,t){let e,n,o;return n=new sd({props:{itemLabel:t[26],hooks:t[0]}}),{key:i,first:null,c(){e=Ge(),Pe(n.$$.fragment),this.first=e},m(s,r){V(s,e,r),ve(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||(G(n.$$.fragment,s),o=!0)},o(s){K(n.$$.fragment,s),o=!1},d(s){s&&W(e),be(n,s)}}}function ad(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=cs(i,r,l),h=a(c);n.set(h,e[l]=hs(h,c))}return{c(){t=X("div");for(let l=0;l<e.length;l+=1)e[l].c();x(t,"class","item-labels-container svelte-gk8s47"),Ke(()=>i[9].call(t)),S(t,"opacity",i[4]?1:0)},m(l,c){V(l,t,c);for(let h=0;h<e.length;h+=1)e[h].m(t,null);o=Ft(t,i[9].bind(t)),s=!0},p(l,[c]){c&3&&(r=l[1],Ie(),e=At(e,c,a,1,l,r,n,t,Gt,hs,null,cs),xe()),c&16&&S(t,"opacity",l[4]?1:0)},i(l){if(!s){for(let c=0;c<r.length;c+=1)G(e[c]);s=!0}},o(l){for(let c=0;c<e.length;c+=1)K(e[c]);s=!1},d(l){l&&W(t);for(let c=0;c<e.length;c+=1)e[c].d();o()}}}let us=26,ld=11;function cd(i,t,e){const{Raycaster:n,Vector3:o}=O;let{five:s}=t,{modelOcclusionEnable:r}=t,{itemLabels:a}=t,{hooks:l}=t,{displayStrategyType:c}=t,h=null,f=null,u,m,g=[],v=!0;const b=(j,R)=>{const H=new n,_=j.camera.position.clone(),U=new o().fromArray(R.modelPosition),te=U.distanceTo(_);H.set(_.clone(),U.clone().sub(_).normalize());const[Y]=j.model.intersectRaycaster(H);return!(Y&&Y.distance+1<te)},y=(j,R)=>{const H=new o(R.modelPosition[0],R.modelPosition[1],R.modelPosition[2]),_=j.project2d(H),U=_==null?void 0:_.x,te=_==null?void 0:_.y;return[U,te]},I=j=>`translate(${j[0]}px, ${j[1]}px)`,P=(j,R)=>g.length===0?!1:!!g.find(_=>j[0]>=_[0]-R&&j[0]<=_[0]+R||j[1]>=_[1]-us&&j[1]<=_[1]+us);function
|
|
522
|
+
}}`)}function id(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,h;return{c(){t=X("div"),e=X("div"),n=X("span"),s=Ue(o),r=fe(),a=X("div"),x(n,"class","item-label-item__text svelte-i9z7qw"),x(e,"class","item-label-item__text-wrap svelte-i9z7qw"),S(e,"top",`-${i[0].strokeLength+26}px`),x(a,"class","item-label-item__bar svelte-i9z7qw"),S(a,"height",`${i[0].strokeLength}px`),x(t,"class",l=je(tt("item-label-item",{visible:i[0].visible}))+" svelte-i9z7qw"),S(t,"z-index",i[0].zIndex),S(t,"transform",i[0].transform)},m(f,u){V(f,t,u),Q(t,e),Q(e,n),Q(n,s),Q(t,r),Q(t,a),c||(h=qe(n,"click",i[1]),c=!0)},p(f,[u]){u&1&&o!==(o=(f[0].name.length>6?`${f[0].name.slice(0,6)}...`:f[0].name)+"")&&dt(s,o),u&1&&S(e,"top",`-${f[0].strokeLength+26}px`),u&1&&S(a,"height",`${f[0].strokeLength}px`),u&1&&l!==(l=je(tt("item-label-item",{visible:f[0].visible}))+" svelte-i9z7qw")&&x(t,"class",l),u&1&&S(t,"z-index",f[0].zIndex),u&1&&S(t,"transform",f[0].transform)},i:ne,o:ne,d(f){f&&W(t),c=!1,h()}}}function od(i,t,e){let{itemLabel:n}=t,{hooks:o}=t;function s(){console.log("__onclick___: ",n),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 sd extends de{constructor(t){super(),ue(this,t,od,id,he,{itemLabel:0,hooks:2},nd)}}function hr(i,t=200){let e;return function(...n){clearTimeout(e),e=setTimeout(()=>{i(...n)},t)}}function rd(i){ge(i,"svelte-gk8s47",".item-labels-container.svelte-gk8s47{width:100%;height:100%;position:relative}")}function cs(i,t,e){const n=i.slice();return n[26]=t[e],n}function hs(i,t){let e,n,o;return n=new sd({props:{itemLabel:t[26],hooks:t[0]}}),{key:i,first:null,c(){e=Ge(),Pe(n.$$.fragment),this.first=e},m(s,r){V(s,e,r),ve(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||(G(n.$$.fragment,s),o=!0)},o(s){K(n.$$.fragment,s),o=!1},d(s){s&&W(e),be(n,s)}}}function ad(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=cs(i,r,l),h=a(c);n.set(h,e[l]=hs(h,c))}return{c(){t=X("div");for(let l=0;l<e.length;l+=1)e[l].c();x(t,"class","item-labels-container svelte-gk8s47"),Ke(()=>i[9].call(t)),S(t,"opacity",i[4]?1:0)},m(l,c){V(l,t,c);for(let h=0;h<e.length;h+=1)e[h].m(t,null);o=Ft(t,i[9].bind(t)),s=!0},p(l,[c]){c&3&&(r=l[1],Ie(),e=At(e,c,a,1,l,r,n,t,Gt,hs,null,cs),xe()),c&16&&S(t,"opacity",l[4]?1:0)},i(l){if(!s){for(let c=0;c<r.length;c+=1)G(e[c]);s=!0}},o(l){for(let c=0;c<e.length;c+=1)K(e[c]);s=!1},d(l){l&&W(t);for(let c=0;c<e.length;c+=1)e[c].d();o()}}}let us=26,ld=11;function cd(i,t,e){const{Raycaster:n,Vector3:o}=O;let{five:s}=t,{modelOcclusionEnable:r}=t,{itemLabels:a}=t,{hooks:l}=t,{displayStrategyType:c}=t,h=null,f=null,u,m,g=[],v=!0;const b=(j,R)=>{const H=new n,_=j.camera.position.clone(),U=new o().fromArray(R.modelPosition),te=U.distanceTo(_);H.set(_.clone(),U.clone().sub(_).normalize());const[Y]=j.model.intersectRaycaster(H);return!(Y&&Y.distance+1<te)},y=(j,R)=>{const H=new o(R.modelPosition[0],R.modelPosition[1],R.modelPosition[2]),_=j.project2d(H),U=_==null?void 0:_.x,te=_==null?void 0:_.y;return[U,te]},I=j=>`translate(${j[0]}px, ${j[1]}px)`,P=(j,R)=>g.length===0?!1:!!g.find(_=>j[0]>=_[0]-R&&j[0]<=_[0]+R||j[1]>=_[1]-us&&j[1]<=_[1]+us);function L(j,R){switch(R){case Et.SMALL:return Math.ceil(-27.78*j+85);case Et.MIDLLE:return Math.ceil(-38.9*j+130);case Et.LARGE:return Math.ceil(-44.44*j+140);case Et.EXTRA_LARGE:return Math.ceil(-92.59*j+300)}}const D=(j,R)=>{const H=R.map(U=>{const te=y(j,U),Y=U.name.length*ld,ee=L(U.modelPosition[1],c),ie=(r?b(j,U):!0)&&!P([te[0],te[1]+ee],Y);if(!ie)return Object.assign(Object.assign({},U),{visible:ie});g.push(te);const ce=I(te);return Object.assign(Object.assign({},U),{visible:ie,transform:ce,strokeLength:ee})}),_=H.filter(({visible:U})=>U).map(U=>({itemLabelItem:U,distance:new o(U.modelPosition[0],U.modelPosition[1],U.modelPosition[2]).clone().distanceTo(j.camera.position)})).sort((U,te)=>U.distance-te.distance);return H.map(U=>{const te=_.findIndex(Y=>Y.itemLabelItem.id===U.id);return te!==void 0?Object.assign(Object.assign({},U),{zIndex:te*10}):U})},E=()=>{g=[],e(1,f=D(s,f))};Rs(()=>{B()});const T=()=>{e(4,v=!1),C()};Ct(()=>{e(1,f=a),h=a,E(),z(),s.on("cameraUpdate",T)});const C=hr(()=>{e(4,v=!0),E()},300),z=()=>{window.addEventListener("resize",F,!1)},B=()=>{h!==a&&(e(1,f=a),h=a,E())},F=()=>{s.once("renderFrame",E)};nn(()=>{s.off("cameraUpdate",T),window.removeEventListener("resize",F,!1)});function $(){u=this.clientWidth,m=this.clientHeight,e(2,u),e(3,m)}return i.$$set=j=>{"five"in j&&e(5,s=j.five),"modelOcclusionEnable"in j&&e(6,r=j.modelOcclusionEnable),"itemLabels"in j&&e(7,a=j.itemLabels),"hooks"in j&&e(0,l=j.hooks),"displayStrategyType"in j&&e(8,c=j.displayStrategyType)},[l,f,u,m,v,s,r,a,c,$]}class hd extends de{constructor(t){super(),ue(this,t,cd,ad,he,{five:5,modelOcclusionEnable:6,itemLabels:7,hooks:0,displayStrategyType:8},rd)}}function ud(i){return i.model_item_labels.map(t=>({modelPosition:[t.position[0],t.position[1]+t.size[1],t.position[2]],...t}))}const dd=(i,t)=>{var u,m;const e={container:document.createElement("div"),data:null,enabled:!0,fiveModeEnabled:void 0,itemLabels:[],wrapper:null,app:void 0,hooks:new ye.Subscribe,modelOcclusionEnable:(u=t==null?void 0:t.modelOcclusionEnable)!=null?u:!0,displayStrategyType:(m=t==null?void 0:t.displayStrategyType)!=null?m:Et.SMALL};e.container.setAttribute("class","model-item-label-plugin-container"),e.container.style.cssText=`
|
|
523
523
|
position: absolute;
|
|
524
524
|
left: 0;
|
|
525
525
|
top: 0;
|
|
526
526
|
width: 100%;
|
|
527
527
|
height: 100%;
|
|
528
528
|
z-index: 5;
|
|
529
|
-
`,e.container.style.pointerEvents="none";const n=g=>(e.wrapper=g,g.appendChild(e.container),l(),!0),o=g=>{e.itemLabels=ud(g),l()},s=()=>(e.enabled||(e.enabled=!0,l()),!0),r=()=>(e.enabled&&(e.enabled=!1,l()),!0),a=()=>{h(),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 hd({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",f),i.once("dispose",a)},h=()=>{i.off("modeChange",f)},f=g=>{if(!!e.enabled){if(g!==ye.Five.Mode.Floorplan){e.fiveModeEnabled=!1,l();return}i.once("initAnimationEnded",()=>{e.fiveModeEnabled=i.currentMode===ye.Five.Mode.Floorplan,l()})}};return c(),{appendTo:n,load:o,enable:s,disable:r,dispose:a,hooks:e.hooks}},fd={name:"ModelItemLabelPlugin",version:0};var jt=(i=>(i.TOP_LEFT="topLeft",i.TOP_RIGHT="topRight",i.BOTTOM_LEFT="bottomLeft",i.BOTTOM_RIGHT="bottomRight",i))(jt||{});function md(i){if(i.length===0)return[];if(Array.isArray(i[0]))return i;let t=[];return i.forEach(e=>{const n=[e[jt.TOP_LEFT],e[jt.BOTTOM_LEFT],e[jt.BOTTOM_RIGHT],e[jt.TOP_RIGHT]];t.push(n)}),t}const pd=(i,{videoElement:t})=>{const e={videoMeshes:[],videoTextureEnabled:!1,videoSource:"",rectPoints:[],enabled:!1,videoElement:t},n=Xn(i),o=new Map,s=P=>{e.videoTexture&&(e.videoTexture.image.muted=P)},r=()=>e.videoTexture?e.videoTexture.image.muted:!0,a=()=>{if(e.enabled||!e.videoTexture)return;e.enabled=!0,e.videoMeshes=c(),e.videoMeshes.forEach(
|
|
529
|
+
`,e.container.style.pointerEvents="none";const n=g=>(e.wrapper=g,g.appendChild(e.container),l(),!0),o=g=>{e.itemLabels=ud(g),l()},s=()=>(e.enabled||(e.enabled=!0,l()),!0),r=()=>(e.enabled&&(e.enabled=!1,l()),!0),a=()=>{h(),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 hd({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",f),i.once("dispose",a)},h=()=>{i.off("modeChange",f)},f=g=>{if(!!e.enabled){if(g!==ye.Five.Mode.Floorplan){e.fiveModeEnabled=!1,l();return}i.once("initAnimationEnded",()=>{e.fiveModeEnabled=i.currentMode===ye.Five.Mode.Floorplan,l()})}};return c(),{appendTo:n,load:o,enable:s,disable:r,dispose:a,hooks:e.hooks}},fd={name:"ModelItemLabelPlugin",version:0};var jt=(i=>(i.TOP_LEFT="topLeft",i.TOP_RIGHT="topRight",i.BOTTOM_LEFT="bottomLeft",i.BOTTOM_RIGHT="bottomRight",i))(jt||{});function md(i){if(i.length===0)return[];if(Array.isArray(i[0]))return i;let t=[];return i.forEach(e=>{const n=[e[jt.TOP_LEFT],e[jt.BOTTOM_LEFT],e[jt.BOTTOM_RIGHT],e[jt.TOP_RIGHT]];t.push(n)}),t}const pd=(i,{videoElement:t})=>{const e={videoMeshes:[],videoTextureEnabled:!1,videoSource:"",rectPoints:[],enabled:!1,videoElement:t},n=Xn(i),o=new Map,s=P=>{e.videoTexture&&(e.videoTexture.image.muted=P)},r=()=>e.videoTexture?e.videoTexture.image.muted:!0,a=()=>{if(e.enabled||!e.videoTexture)return;e.enabled=!0,e.videoMeshes=c(),e.videoMeshes.forEach(L=>i.scene.add(L)),o.forEach(L=>{L.enable()});const P=()=>{if(!e.videoTexture)return;const L=()=>{var D;!e.videoTexture||((D=e.videoTexture)==null||D.image.removeEventListener("timeupdate",L),e.videoTextureEnabled=!0,e.videoMeshes.forEach(E=>{E.material.map!==e.videoTexture&&(E.material.map=e.videoTexture)}),i.needsRender=!0)};e.videoTexture.image.addEventListener("timeupdate",L),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)P();else return i.once("modelLoaded",()=>P());v()},l=()=>{!e.enabled||(e.enabled=!1,e.videoMeshes.forEach(P=>{P.geometry.dispose(),P.material.dispose(),i.scene.remove(P),e.videoTexture&&e.videoTexture.image.pause()}),o.forEach(P=>{P.disable()}),e.videoMeshes=[],i.needsRender=!0)},c=()=>e.rectPoints.map((P,L)=>{const D=new O.BufferGeometry,E=128,T=[];T.push(...P[0].toArray());for(let R=1;R<E;R++)T.push(P[0].x+(P[1].x-P[0].x)*R/E,P[0].y+(P[1].y-P[0].y)*R/E,P[0].z+(P[1].z-P[0].z)*R/E);T.push(...P[1].toArray()),T.push(...P[2].toArray());for(let R=1;R<E;R++)T.push(P[2].x+(P[3].x-P[2].x)*R/E,P[2].y+(P[3].y-P[2].y)*R/E,P[2].z+(P[3].z-P[2].z)*R/E);T.push(...P[3].toArray());const C=[];C.push(0,1);for(let R=1;R<E;R++)C.push(0,1-R/E);C.push(0,0),C.push(1,0);for(let R=1;R<E;R++)C.push(1,R/E);C.push(1,1);const z=[];for(let R=0;R<E;R++)z.push(R,R+1,E*2-R,R,E*2-R,E*2+1-R);D.setAttribute("position",new O.BufferAttribute(new Float32Array(T),3)),D.setAttribute("uv",new O.BufferAttribute(new Float32Array(C),2)),D.setIndex(new O.BufferAttribute(new Uint32Array(z),1));const B=new O.MeshBasicMaterial({map:e.videoTextureEnabled?e.videoTexture:e.imageTexture,side:O.DoubleSide}),F=new O.Mesh(D,B);F.renderOrder=1,F.name=`ModelTVVideoPlugin-${L}-${performance.now()}`;const $=[P[1],P[2],P[3],P[0]],j=n.create3DDomContainer($);if(j!=null&&j.container){const R=document.createElement("div");R.classList.add("play-icon"),R.style.width="100%",R.style.height="100%",R.style.display="flex",R.style.justifyContent="center",R.style.alignItems="center",R.style.pointerEvents="none",j.container.appendChild(R);const H=document.createElement("img");H.src="//vrlab-static.ljcdn.com/release/web/play.2ada5b6f.png",H.style.width="200px",H.style.pointerEvents="auto",H.onclick=()=>{e.videoTexture.image.muted=!1,e.videoTexture.image.play()},R.appendChild(H),o.set(F,j)}return F}),h=P=>{const L=new O.TextureLoader().load(P);return L.minFilter=O.LinearFilter,L.magFilter=O.LinearFilter,L.format=O.RGBFormat,L},f=(P,L)=>new Promise((D,E)=>{const T=new XMLHttpRequest;T.onreadystatechange=()=>{if(T.readyState==4)if(T.status==200){const C=window.URL||window.webkitURL;L=L||document.createElement("video"),L.crossOrigin="anonymous",L.muted=!0,L.loop=!0,L.playsInline=!0,L.src=C.createObjectURL(T.response);const z=new O.VideoTexture(L);z.minFilter=O.LinearFilter,z.magFilter=O.LinearFilter,z.format=O.RGBFormat,D(Object.assign(z,{videoSource:P}))}else E(new Error("Video download Error: "+T.status))},T.onerror=C=>E(C),T.open("GET",P),T.responseType="blob",T.send()}),u=async(P,L)=>{o.forEach(C=>C.dispose()),o.clear();const{video_src:D,video_poster_src:E,points:T}=P;e.videoSource=D,e.rectPoints=md(T).map(C=>C.map(({x:z,y:B,z:F})=>new O.Vector3(z,B,F))),e.imageTexture=h(E),L&&(e.videoElement=L),e.videoTexture=await f(e.videoSource,e.videoElement),e.enabled=!!P.enable,e.enabled&&a()},m=P=>{if(!e.enabled)return;const L=e.videoMeshes;if(!(!L||P.intersectObjects(L).length===0))return e.videoTexture&&(e.videoTexture.image.paused||e.videoTexture.image.pause()),!1},g=P=>{var L;P==="Floorplan"?n.hide():(L=e.videoTexture)!=null&&L.image.paused?n.show():n.hide()},v=()=>{if(!e.enabled)return;const P=i.camera.position;if(o.forEach((L,D)=>{const E=L.css3DObject.position.clone(),T=E.clone().sub(P).normalize(),C=new O.Raycaster(P,T),z=i.model.intersectRaycaster(C)[0],B=E.distanceTo(P),F=.01;z&&z.distance+F<B?L.hide():L.show()}),!r()){const L=e.rectPoints.find(D=>{const E=D[0].clone().add(D[1]).add(D[2]).add(D[3]).divideScalar(4);return D.map(T=>T.clone().add(E).divideScalar(2)).filter(T=>{const C=T.distanceTo(P),z=new O.Raycaster(P,T.clone().sub(P).normalize()),B=i.model.intersectRaycaster(z)[0],F=.01;return!(B&&B.distance+F<C)}).length>=2});(!L||L.length===0)&&s(!0)}},b=()=>{v()},y=()=>{e.videoMeshes.forEach(P=>{P&&(P.needsRender=!0)})},I=()=>{l(),e.videoTexture=void 0,i.off("modeChange",g),i.off("wantsTapGesture",m),i.off("panoArrived",b),i.off("renderFrame",y),o.clear()};return i.on("modeChange",g),i.on("wantsTapGesture",m),i.on("panoArrived",b),i.on("renderFrame",y),{enable:a,disable:l,load:u,dispose:I,state:e,css3DRenderPlugin:n}};function gd(i){ge(i,"svelte-1q3t254",`.item-label-item.svelte-1q3t254.svelte-1q3t254{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-1q3t254-fadeIn .3s ease-in}.item-label-item.fold.svelte-1q3t254>.item-label-item__text-wrap.svelte-1q3t254{visibility:hidden}.item-label-item.fold.svelte-1q3t254>.item-label-item__bar.anchor.svelte-1q3t254{visibility:hidden}.item-label-item.fold.svelte-1q3t254>.item-label-item__bar.anchor.svelte-1q3t254:after{visibility:visible}.item-label-item__text-wrap.svelte-1q3t254.svelte-1q3t254{height:-moz-fit-content;height:fit-content;padding:0.625rem 1.04167rem 0.625rem 0.625rem;position:absolute;width:-moz-max-content;width:max-content;max-width:24.63542rem;min-height:4.79167rem;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:1.5px solid rgba(255, 255, 255, .65);border-radius:0.15625rem;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-1q3t254.svelte-1q3t254{padding:0;max-width:unset;min-height:unset;background-image:unset;border:0;border-radius:0}.icon-wrap.svelte-1q3t254.svelte-1q3t254{width:3.54167rem;height:100%;display:flex;justify-content:center;align-content:center}.icon.svelte-1q3t254.svelte-1q3t254{width:3.54167rem;height:3.54167rem;background-repeat:no-repeat;background-size:contain;background-position:center}.item-label-text.svelte-1q3t254.svelte-1q3t254{margin-left:0.625rem;padding-left:0.625rem;min-height:3.54167rem;height:auto;display:flex;flex-flow:column;justify-content:space-around;align-content:flex-start;border-left:solid rgba(255, 255, 255, .2) 1px;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-1q3t254.svelte-1q3t254{white-space:nowrap;font-size:1.14583rem;font-weight:bold;line-height:1.5625rem}.item-name.svelte-1q3t254.svelte-1q3t254{height:auto;word-wrap:break-word;word-break:break-all;font-size:1.04167rem;line-height:1.45833rem}.item-label-item__bar.svelte-1q3t254.svelte-1q3t254{position:absolute;bottom:0;width:0.15625rem;background-image:linear-gradient(to bottom, white, rgba(255, 255, 255, 0));box-shadow:0 2px 0.41667rem 0 rgba(0, 0, 0, 0.20);pointer-events:none}.item-label-item__bar.anchor.svelte-1q3t254.svelte-1q3t254:after{content:'';position:absolute;bottom:0;width:1.25rem;height:1.25rem;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.54688rem, 50%)}@keyframes svelte-1q3t254-fadeIn{from{opacity:0
|
|
530
530
|
}to{opacity:1
|
|
531
|
-
}}`)}function vd(i){let t,e,n,o=(i[0].code||i[0].id)+"",s,r,a,l=i[0].name+"",c,h=i[0].icon&&ds(i);return{c(){h&&h.c(),t=fe(),e=X("div"),n=X("span"),s=Ue(o),r=fe(),a=X("span"),c=Ue(l),x(n,"class","item-model svelte-1q3t254"),x(a,"class","item-name svelte-1q3t254"),x(e,"class","item-label-text svelte-1q3t254")},m(f,u){h&&h.m(f,u),V(f,t,u),V(f,e,u),Q(e,n),Q(n,s),Q(e,r),Q(e,a),Q(a,c)},p(f,u){f[0].icon?h?h.p(f,u):(h=ds(f),h.c(),h.m(t.parentNode,t)):h&&(h.d(1),h=null),u&1&&o!==(o=(f[0].code||f[0].id)+"")&&dt(s,o),u&1&&l!==(l=f[0].name+"")&&dt(c,l)},d(f){h&&h.d(f),f&&W(t),f&&W(e)}}}function bd(i){let t;return{c(){t=X("div")},m(e,n){V(e,t,n),i[6](t)},p:ne,d(e){e&&W(t),i[6](null)}}}function ds(i){let t,e,n,o,s;return{c(){t=X("div"),e=X("div"),x(e,"class","icon svelte-1q3t254"),x(e,"style",n=`background-image: url(${i[0].icon})`),x(t,"class","icon-wrap svelte-1q3t254")},m(r,a){V(r,t,a),Q(t,e),o||(s=qe(t,"click",i[7]),o=!0)},p(r,a){a&1&&n!==(n=`background-image: url(${r[0].icon})`)&&x(e,"style",n)},d(r){r&&W(t),o=!1,s()}}}function Ad(i){let t,e,n,o,s,r,a,l,c,h;function f(g,v){return v&1&&(n=null),n==null&&(n=!!Boolean(typeof g[0].render=="function")),n?bd:vd}let u=f(i,-1),m=u(i);return{c(){t=X("div"),e=X("div"),m.c(),s=fe(),r=X("div"),x(e,"class",o=je(tt("item-label-item__text-wrap",{"item-label-item__custom":Boolean(typeof i[0].render=="function")}))+" svelte-1q3t254"),S(e,"bottom",`${i[0].strokeLength}px`),x(r,"class",a=je(tt("item-label-item__bar",{anchor:i[1]}))+" svelte-1q3t254"),S(r,"height",`${i[0].strokeLength}px`),x(t,"class",l=je(tt("item-label-item",{fold:i[0].isFold}))+" svelte-1q3t254"),S(t,"z-index",i[0].zIndex),S(t,"transform",i[0].transform)},m(g,v){V(g,t,v),Q(t,e),m.m(e,null),Q(t,s),Q(t,r),c||(h=qe(e,"click",i[4]),c=!0)},p(g,[v]){u===(u=f(g,v))&&m?m.p(g,v):(m.d(1),m=u(g),m&&(m.c(),m.m(e,null))),v&1&&o!==(o=je(tt("item-label-item__text-wrap",{"item-label-item__custom":Boolean(typeof g[0].render=="function")}))+" svelte-1q3t254")&&x(e,"class",o),v&1&&S(e,"bottom",`${g[0].strokeLength}px`),v&2&&a!==(a=je(tt("item-label-item__bar",{anchor:g[1]}))+" svelte-1q3t254")&&x(r,"class",a),v&1&&S(r,"height",`${g[0].strokeLength}px`),v&1&&l!==(l=je(tt("item-label-item",{fold:g[0].isFold}))+" svelte-1q3t254")&&x(t,"class",l),v&1&&S(t,"z-index",g[0].zIndex),v&1&&S(t,"transform",g[0].transform)},i:ne,o:ne,d(g){g&&W(t),m.d(),c=!1,h()}}}function yd(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(f){Rt[f?"unshift":"push"](()=>{l=f,e(3,l)})}const h=f=>r(n);return i.$$set=f=>{"itemLabel"in f&&e(0,n=f.itemLabel),"hooks"in f&&e(5,o=f.hooks),"anchorEnabled"in f&&e(1,s=f.anchorEnabled),"onIconClick"in f&&e(2,r=f.onIconClick)},i.$$.update=()=>{if(i.$$.dirty&9&&typeof n.render=="function"&&l&&l.children.length===0){const f=n.render(n);f&&l.appendChild(f)}},[n,s,r,l,a,o,c,h]}class Pd extends de{constructor(t){super(),ue(this,t,yd,Ad,he,{itemLabel:0,hooks:5,anchorEnabled:1,onIconClick:2},gd)}}const{Raycaster:wd,Vector3:Ef}=O,fs=(i,t,e,n)=>{const o=t.clone().sub(e).normalize(),s=new wd;s.set(e,o);const[r]=i.model.intersectRaycaster(s);return r&&r.distance+.01<n};var It=(i=>(i.SMALL="small",i.MIDLLE="middle",i.LARGE="large",i.EXTRA_LARGE="x-large",i))(It||{});const Ed=(i,t)=>{switch(t){case It.SMALL:return Math.ceil(-27.78*i+85);case It.MIDLLE:return Math.ceil(-38.9*i+130);case It.LARGE:return Math.ceil(-44.44*i+140);case It.EXTRA_LARGE:return Math.ceil(-92.59*i+300)}},Id=i=>`translate(${i[0]}px, ${i[1]}px)`;function ms(i){return i.map(t=>({observerIndex:void 0,visible:!1,isFold:!1,...t}))}function xd(i){ge(i,"svelte-gk8s47",".item-labels-container.svelte-gk8s47{width:100%;height:100%;position:relative}")}function ps(i,t,e){const n=i.slice();return n[30]=t[e],n}function gs(i){let t,e;return t=new Pd({props:{itemLabel:i[30],hooks:i[0],anchorEnabled:i[2],onIconClick:i[6]}}),{c(){Pe(t.$$.fragment)},m(n,o){ve(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||(G(t.$$.fragment,n),e=!0)},o(n){K(t.$$.fragment,n),e=!1},d(n){be(t,n)}}}function vs(i,t){let e,n,o,s=t[30].visible&&gs(t);return{key:i,first:null,c(){e=Ge(),s&&s.c(),n=Ge(),this.first=e},m(r,a){V(r,e,a),s&&s.m(r,a),V(r,n,a),o=!0},p(r,a){t=r,t[30].visible?s?(s.p(t,a),a[0]&2&&G(s,1)):(s=gs(t),s.c(),G(s,1),s.m(n.parentNode,n)):s&&(Ie(),K(s,1,1,()=>{s=null}),xe())},i(r){o||(G(s),o=!0)},o(r){K(s),o=!1},d(r){r&&W(e),s&&s.d(r),r&&W(n)}}}function Cd(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=ps(i,r,l),h=a(c);n.set(h,e[l]=vs(h,c))}return{c(){t=X("div");for(let l=0;l<e.length;l+=1)e[l].c();x(t,"class","item-labels-container svelte-gk8s47"),Ke(()=>i[12].call(t)),S(t,"opacity",i[5]?1:0)},m(l,c){V(l,t,c);for(let h=0;h<e.length;h+=1)e[h].m(t,null);o=Ft(t,i[12].bind(t)),s=!0},p(l,c){c[0]&71&&(r=l[1],Ie(),e=At(e,c,a,1,l,r,n,t,Gt,vs,null,ps),xe()),c[0]&32&&S(t,"opacity",l[5]?1:0)},i(l){if(!s){for(let c=0;c<r.length;c+=1)G(e[c]);s=!0}},o(l){for(let c=0;c<e.length;c+=1)K(e[c]);s=!1},d(l){l&&W(t);for(let c=0;c<e.length;c+=1)e[c].d();o()}}}let Ld=11;function kd(i,t,e){const{Raycaster:n,Vector3:o}=O;let{five:s}=t,{modelOcclusionEnable:r}=t,{itemLabels:a}=t,{hooks:l}=t,{displayStrategyType:c}=t,{maxVisibleDistance:h}=t,f=null,u=null,m=(s==null?void 0:s.currentMode)===ye.Five.Mode.Panorama,g,v,b=[],y=!0;const I=(H,_)=>{const U=H.camera.position.clone(),te=new o(_.modelPosition[0],_.modelPosition[1],_.modelPosition[2]),Y=te.distanceTo(U);return h!==void 0&&H.state.mode===ye.Five.Mode.Panorama&&Y>h?!1:fs(H,te.clone().sub(U).normalize(),U,Y)},P=H=>{const{camera:_,model:U}=s,{x:te,y:Y,z:ee}=H.clone().project(_),se=(te+1)/2,ie=(2-(Y+1))/2,Ce=Math.abs(ee)<1&&[se,ie].every(Me=>Me<1&&Me>=0);return Boolean(Ce)},
|
|
531
|
+
}}`)}function vd(i){let t,e,n,o=(i[0].code||i[0].id)+"",s,r,a,l=i[0].name+"",c,h=i[0].icon&&ds(i);return{c(){h&&h.c(),t=fe(),e=X("div"),n=X("span"),s=Ue(o),r=fe(),a=X("span"),c=Ue(l),x(n,"class","item-model svelte-1q3t254"),x(a,"class","item-name svelte-1q3t254"),x(e,"class","item-label-text svelte-1q3t254")},m(f,u){h&&h.m(f,u),V(f,t,u),V(f,e,u),Q(e,n),Q(n,s),Q(e,r),Q(e,a),Q(a,c)},p(f,u){f[0].icon?h?h.p(f,u):(h=ds(f),h.c(),h.m(t.parentNode,t)):h&&(h.d(1),h=null),u&1&&o!==(o=(f[0].code||f[0].id)+"")&&dt(s,o),u&1&&l!==(l=f[0].name+"")&&dt(c,l)},d(f){h&&h.d(f),f&&W(t),f&&W(e)}}}function bd(i){let t;return{c(){t=X("div")},m(e,n){V(e,t,n),i[6](t)},p:ne,d(e){e&&W(t),i[6](null)}}}function ds(i){let t,e,n,o,s;return{c(){t=X("div"),e=X("div"),x(e,"class","icon svelte-1q3t254"),x(e,"style",n=`background-image: url(${i[0].icon})`),x(t,"class","icon-wrap svelte-1q3t254")},m(r,a){V(r,t,a),Q(t,e),o||(s=qe(t,"click",i[7]),o=!0)},p(r,a){a&1&&n!==(n=`background-image: url(${r[0].icon})`)&&x(e,"style",n)},d(r){r&&W(t),o=!1,s()}}}function Ad(i){let t,e,n,o,s,r,a,l,c,h;function f(g,v){return v&1&&(n=null),n==null&&(n=!!Boolean(typeof g[0].render=="function")),n?bd:vd}let u=f(i,-1),m=u(i);return{c(){t=X("div"),e=X("div"),m.c(),s=fe(),r=X("div"),x(e,"class",o=je(tt("item-label-item__text-wrap",{"item-label-item__custom":Boolean(typeof i[0].render=="function")}))+" svelte-1q3t254"),S(e,"bottom",`${i[0].strokeLength}px`),x(r,"class",a=je(tt("item-label-item__bar",{anchor:i[1]}))+" svelte-1q3t254"),S(r,"height",`${i[0].strokeLength}px`),x(t,"class",l=je(tt("item-label-item",{fold:i[0].isFold}))+" svelte-1q3t254"),S(t,"z-index",i[0].zIndex),S(t,"transform",i[0].transform)},m(g,v){V(g,t,v),Q(t,e),m.m(e,null),Q(t,s),Q(t,r),c||(h=qe(e,"click",i[4]),c=!0)},p(g,[v]){u===(u=f(g,v))&&m?m.p(g,v):(m.d(1),m=u(g),m&&(m.c(),m.m(e,null))),v&1&&o!==(o=je(tt("item-label-item__text-wrap",{"item-label-item__custom":Boolean(typeof g[0].render=="function")}))+" svelte-1q3t254")&&x(e,"class",o),v&1&&S(e,"bottom",`${g[0].strokeLength}px`),v&2&&a!==(a=je(tt("item-label-item__bar",{anchor:g[1]}))+" svelte-1q3t254")&&x(r,"class",a),v&1&&S(r,"height",`${g[0].strokeLength}px`),v&1&&l!==(l=je(tt("item-label-item",{fold:g[0].isFold}))+" svelte-1q3t254")&&x(t,"class",l),v&1&&S(t,"z-index",g[0].zIndex),v&1&&S(t,"transform",g[0].transform)},i:ne,o:ne,d(g){g&&W(t),m.d(),c=!1,h()}}}function yd(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(f){Rt[f?"unshift":"push"](()=>{l=f,e(3,l)})}const h=f=>r(n);return i.$$set=f=>{"itemLabel"in f&&e(0,n=f.itemLabel),"hooks"in f&&e(5,o=f.hooks),"anchorEnabled"in f&&e(1,s=f.anchorEnabled),"onIconClick"in f&&e(2,r=f.onIconClick)},i.$$.update=()=>{if(i.$$.dirty&9&&typeof n.render=="function"&&l&&l.children.length===0){const f=n.render(n);f&&l.appendChild(f)}},[n,s,r,l,a,o,c,h]}class Pd extends de{constructor(t){super(),ue(this,t,yd,Ad,he,{itemLabel:0,hooks:5,anchorEnabled:1,onIconClick:2},gd)}}const{Raycaster:wd,Vector3:Ef}=O,fs=(i,t,e,n)=>{const o=t.clone().sub(e).normalize(),s=new wd;s.set(e,o);const[r]=i.model.intersectRaycaster(s);return r&&r.distance+.01<n};var It=(i=>(i.SMALL="small",i.MIDLLE="middle",i.LARGE="large",i.EXTRA_LARGE="x-large",i))(It||{});const Ed=(i,t)=>{switch(t){case It.SMALL:return Math.ceil(-27.78*i+85);case It.MIDLLE:return Math.ceil(-38.9*i+130);case It.LARGE:return Math.ceil(-44.44*i+140);case It.EXTRA_LARGE:return Math.ceil(-92.59*i+300)}},Id=i=>`translate(${i[0]}px, ${i[1]}px)`;function ms(i){return i.map(t=>({observerIndex:void 0,visible:!1,isFold:!1,...t}))}function xd(i){ge(i,"svelte-gk8s47",".item-labels-container.svelte-gk8s47{width:100%;height:100%;position:relative}")}function ps(i,t,e){const n=i.slice();return n[30]=t[e],n}function gs(i){let t,e;return t=new Pd({props:{itemLabel:i[30],hooks:i[0],anchorEnabled:i[2],onIconClick:i[6]}}),{c(){Pe(t.$$.fragment)},m(n,o){ve(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||(G(t.$$.fragment,n),e=!0)},o(n){K(t.$$.fragment,n),e=!1},d(n){be(t,n)}}}function vs(i,t){let e,n,o,s=t[30].visible&&gs(t);return{key:i,first:null,c(){e=Ge(),s&&s.c(),n=Ge(),this.first=e},m(r,a){V(r,e,a),s&&s.m(r,a),V(r,n,a),o=!0},p(r,a){t=r,t[30].visible?s?(s.p(t,a),a[0]&2&&G(s,1)):(s=gs(t),s.c(),G(s,1),s.m(n.parentNode,n)):s&&(Ie(),K(s,1,1,()=>{s=null}),xe())},i(r){o||(G(s),o=!0)},o(r){K(s),o=!1},d(r){r&&W(e),s&&s.d(r),r&&W(n)}}}function Cd(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=ps(i,r,l),h=a(c);n.set(h,e[l]=vs(h,c))}return{c(){t=X("div");for(let l=0;l<e.length;l+=1)e[l].c();x(t,"class","item-labels-container svelte-gk8s47"),Ke(()=>i[12].call(t)),S(t,"opacity",i[5]?1:0)},m(l,c){V(l,t,c);for(let h=0;h<e.length;h+=1)e[h].m(t,null);o=Ft(t,i[12].bind(t)),s=!0},p(l,c){c[0]&71&&(r=l[1],Ie(),e=At(e,c,a,1,l,r,n,t,Gt,vs,null,ps),xe()),c[0]&32&&S(t,"opacity",l[5]?1:0)},i(l){if(!s){for(let c=0;c<r.length;c+=1)G(e[c]);s=!0}},o(l){for(let c=0;c<e.length;c+=1)K(e[c]);s=!1},d(l){l&&W(t);for(let c=0;c<e.length;c+=1)e[c].d();o()}}}let Ld=11;function kd(i,t,e){const{Raycaster:n,Vector3:o}=O;let{five:s}=t,{modelOcclusionEnable:r}=t,{itemLabels:a}=t,{hooks:l}=t,{displayStrategyType:c}=t,{maxVisibleDistance:h}=t,f=null,u=null,m=(s==null?void 0:s.currentMode)===ye.Five.Mode.Panorama,g,v,b=[],y=!0;const I=(H,_)=>{const U=H.camera.position.clone(),te=new o(_.modelPosition[0],_.modelPosition[1],_.modelPosition[2]),Y=te.distanceTo(U);return h!==void 0&&H.state.mode===ye.Five.Mode.Panorama&&Y>h?!1:fs(H,te.clone().sub(U).normalize(),U,Y)},P=H=>{const{camera:_,model:U}=s,{x:te,y:Y,z:ee}=H.clone().project(_),se=(te+1)/2,ie=(2-(Y+1))/2,Ce=Math.abs(ee)<1&&[se,ie].every(Me=>Me<1&&Me>=0);return Boolean(Ce)},L=(H,_)=>{const U=new o(_.modelPosition[0],_.modelPosition[1],_.modelPosition[2]),te=H.project2d(U),Y=te==null?void 0:te.x,ee=te==null?void 0:te.y;return[Y,ee]},D=(H,_)=>{const U=_.map(Y=>{if(H.state.panoIndex!==Y.panoIndex)return Object.assign(Object.assign({},Y),{visible:!1});const ee=L(H,Y);Y.name.length*Ld;const se=Ed(Y.modelPosition[1],c),ie=H.currentMode===ye.Five.Mode.Panorama?P(new o(Y.position[0],Y.position[1],Y.position[2])):!0,ce=r?I(H,Y):!1,Ae=ie&&!ce;if(!Ae)return Object.assign(Object.assign({},Y),{visible:Ae});b.push(ee);const Ce=Id(ee);return Object.assign(Object.assign({},Y),{visible:Ae,transform:Ce,strokeLength:se})}),te=U.filter(({visible:Y})=>Y).map(Y=>({itemLabelItem:Y,distance:new o(Y.modelPosition[0],Y.modelPosition[1],Y.modelPosition[2]).clone().distanceTo(H.camera.position)})).sort((Y,ee)=>Y.distance-ee.distance);return U.map(Y=>{const ee=te.findIndex(se=>se.itemLabelItem.id===Y.id);return ee!==void 0?Object.assign(Object.assign({},Y),{zIndex:ee*10}):Y})},E=()=>{b=[],e(1,u=D(s,u))},T=()=>{e(5,y=!1),C()},C=hr(()=>{e(5,y=!0),E()},300),z=()=>{s.once("renderFrame",E)},B=()=>{window.addEventListener("resize",z,!1)},F=()=>{f!==a&&(e(1,u=ms(a)),f=a,E())},$=(H,_)=>{let U=[];for(let Y=0;Y<_.length;Y++){const{position:ee,panoIndex:se}=_[Y],ie=H.distanceTo(ee);(h===void 0||ie<=h||s.state.mode!==ye.Five.Mode.Panorama)&&U.push({panoIndex:se,obVector:ee,distance:ie})}U=U.sort((Y,ee)=>Y.distance-ee.distance);let te;for(let Y=0;Y<U.length;Y++){const{obVector:ee,distance:se,panoIndex:ie}=U[Y];if(!fs(s,H,ee,se)){te=ie;break}}return typeof te=="number"?_[te]:void 0},j=H=>{if(s.state.mode===ye.Five.Mode.Panorama)return;const _=s.work.observers,U=new o().fromArray(H.position),te=$(U,_);if(te&&(H.observerIndex=te.panoIndex),typeof H.observerIndex=="number"){const Y=_[H.observerIndex],ee=U.clone().sub(Y.position).normalize(),se={longitude:Math.PI+Math.atan2(ee.x,ee.z),latitude:Math.acos(ee.y/ee.length())-Math.PI/2};s.setState(Object.assign(Object.assign({},se),{mode:ye.Five.Mode.Panorama,panoIndex:H.observerIndex})),s.once("initAnimationEnded",()=>{e(1,u=u.map(ie=>Object.assign(Object.assign({},ie),{isFold:ie.id!==H.id}))),s.once("cameraUpdate",()=>{e(1,u=u.map(ie=>Object.assign(Object.assign({},ie),{isFold:!1})))})})}};Rs(()=>{F()}),Ct(()=>{e(1,u=ms(a)),f=a,E(),B(),s.on("cameraUpdate",T)}),nn(()=>{s.off("cameraUpdate",T),window.removeEventListener("resize",z,!1)});function R(){g=this.clientWidth,v=this.clientHeight,e(3,g),e(4,v)}return i.$$set=H=>{"five"in H&&e(7,s=H.five),"modelOcclusionEnable"in H&&e(8,r=H.modelOcclusionEnable),"itemLabels"in H&&e(9,a=H.itemLabels),"hooks"in H&&e(0,l=H.hooks),"displayStrategyType"in H&&e(10,c=H.displayStrategyType),"maxVisibleDistance"in H&&e(11,h=H.maxVisibleDistance)},[l,u,m,g,v,y,j,s,r,a,c,h,R]}class Td extends de{constructor(t){super(),ue(this,t,kd,Cd,he,{five:7,modelOcclusionEnable:8,itemLabels:9,hooks:0,displayStrategyType:10,maxVisibleDistance:11},xd,[-1,-1])}}function Dd(i){return i.item_labels.map(t=>({...t,modelPosition:[t.position[0],t.position[1],t.position[2]],observerIndex:void 0}))}const zd=void 0,Md=(i,t)=>{var u,m,g,v;const e={container:document.createElement("div"),data:null,enabled:!0,fiveModeEnabled:!0,itemLabels:[],wrapper:null,app:void 0,hooks:new ye.Subscribe,modelOcclusionEnable:(u=t==null?void 0:t.modelOcclusionEnable)!=null?u:!0,onlyVisibleInPanorama:(m=t==null?void 0:t.onlyVisibleInPanorama)!=null?m:!0,displayStrategyType:(g=t==null?void 0:t.displayStrategyType)!=null?g:It.SMALL,maxVisibleDistance:(v=t==null?void 0:t.maxVisibleDistance)!=null?v:zd};e.container.setAttribute("class","item-label-plugin-container"),e.container.style.cssText=`
|
|
532
532
|
position: absolute;
|
|
533
533
|
left: 0;
|
|
534
534
|
top: 0;
|
|
535
535
|
width: 100%;
|
|
536
536
|
height: 100%;
|
|
537
537
|
z-index: 5;
|
|
538
|
-
`,e.container.style.pointerEvents="none";const n=b=>(e.wrapper=b,b.appendChild(e.container),l(),!0),o=b=>{e.itemLabels=Dd(b),l()},s=()=>(e.enabled||(e.enabled=!0,l()),!0),r=()=>(e.enabled&&(e.enabled=!1,l()),!0),a=()=>{h(),e.container.remove()},l=()=>{var b;if(!!e.wrapper){if(!e.enabled||!e.fiveModeEnabled){(b=e.app)==null||b.$destroy(),e.app=void 0;return}e.app?e.app.$set({five:i,itemLabels:e.itemLabels}):e.app=new Td({target:e.container,props:{five:i,modelOcclusionEnable:e.modelOcclusionEnable,onlyVisibleInPanorama:e.onlyVisibleInPanorama,itemLabels:e.itemLabels,wrapper:e.wrapper,hooks:e.hooks,displayStrategyType:e.displayStrategyType,maxVisibleDistance:e.maxVisibleDistance}})}},c=()=>{i.on("modeChange",f),i.once("dispose",a)},h=()=>{i.off("modeChange",f)},f=b=>{if(b!==ye.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}},Sd={name:"ItemLabelPlugin",version:0};class jd extends Qs{constructor(e){super(e);d(this,"state");d(this,"container");d(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({...e,userAction:!0})}disable(e){this.enabled=!1,this.updateState({...e,userAction:!0})}show(e){if(!!this.state.enabled)return this.setState({...this.state,visible:!0},e),Promise.resolve()}hide(e){if(!!this.state.enabled)return this.setState({...this.state,visible:!1},e),Promise.resolve()}dispose(){this.container.remove()}setState(e,n){if(!this.enabled)return;const o={...this.state};this.state={...this.state,...e,...n},this.stateChangedCallback(o,n)}get visible(){return this.five.state.mode===ye.Five.Mode.Panorama}appendTo(e){!this.enabled||(this.container=e,this.render())}updateState(e){this.setState({...this.state,enabled:this.enabled,visible:this.visible},e)}}function Od(i){ge(i,"svelte-16kdbw2",'.plugin-DoorLabelPlugin-item.svelte-16kdbw2.svelte-16kdbw2{position:absolute;left:0;top:0;width:0;height:0;pointer-events:none;transition:opacity 0.3s ease}.plugin-DoorLabelPlugin-cnt.svelte-16kdbw2.svelte-16kdbw2{position:absolute;top:50%;left:50%;border-radius:2px;background:rgba(0, 0, 0, 0.35);line-height:0.625rem;padding:0.3125rem;white-space:nowrap;font-size:0.625rem;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-16kdbw2.svelte-16kdbw2::after{content:"";display:block;position:absolute;top:-1px;left:-1px;bottom:-1px;right:-1px;border-radius:2px;border:1px 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-16kdbw2.svelte-16kdbw2:active,.plugin-DoorLabelPlugin-cnt.svelte-16kdbw2.svelte-16kdbw2:focus{background:rgba(0, 0, 0, 0.5);color:rgba(255, 255, 255, 0.5)}.plugin-DoorLabelPlugin-icon.svelte-16kdbw2.svelte-16kdbw2{background:url("//vrlab-image4.ljcdn.com/release/web/DoorLabel-icon.de1304ae.svg") no-repeat;background-size:100%;display:inline-block;width:0.52083rem;height:0.52083rem;margin-left:0.20833rem;transform-origin:center}.plugin-DoorLabelPlugin-cnt[data-camera-toward=forward].left.svelte-16kdbw2 .plugin-DoorLabelPlugin-icon.svelte-16kdbw2{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=forward].right.svelte-16kdbw2 .plugin-DoorLabelPlugin-txt.svelte-16kdbw2{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=forward].right.svelte-16kdbw2 .plugin-DoorLabelPlugin-icon.svelte-16kdbw2{transform:rotate(-90deg);margin-left:0;margin-right:0.20833rem;order:0}.plugin-DoorLabelPlugin-cnt[data-camera-toward=right].forward.svelte-16kdbw2 .plugin-DoorLabelPlugin-icon.svelte-16kdbw2{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=right].back.svelte-16kdbw2 .plugin-DoorLabelPlugin-txt.svelte-16kdbw2{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=right].back.svelte-16kdbw2 .plugin-DoorLabelPlugin-icon.svelte-16kdbw2{transform:rotate(-90deg);margin-left:0;margin-right:0.20833rem;order:0}.plugin-DoorLabelPlugin-cnt[data-camera-toward=left].back.svelte-16kdbw2 .plugin-DoorLabelPlugin-icon.svelte-16kdbw2{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=left].forward.svelte-16kdbw2 .plugin-DoorLabelPlugin-txt.svelte-16kdbw2{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=left].forward.svelte-16kdbw2 .plugin-DoorLabelPlugin-icon.svelte-16kdbw2{transform:rotate(-90deg);margin-left:0;margin-right:0.20833rem;order:0}.plugin-DoorLabelPlugin-cnt[data-camera-toward=back].right.svelte-16kdbw2 .plugin-DoorLabelPlugin-icon.svelte-16kdbw2{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=back].left.svelte-16kdbw2 .plugin-DoorLabelPlugin-txt.svelte-16kdbw2{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=back].left.svelte-16kdbw2 .plugin-DoorLabelPlugin-icon.svelte-16kdbw2{transform:rotate(-90deg);margin-left:0;margin-right:0.20833rem;order:0}.plugin-DoorLabelPlugin-cnt--customBrand.svelte-16kdbw2.svelte-16kdbw2{color:#f9eac1}.plugin-DoorLabelPlugin-cnt--customBrand.svelte-16kdbw2 .plugin-DoorLabelPlugin-icon.svelte-16kdbw2{background:url("//vrlab-image4.ljcdn.com/release/web/arrow.6e8ec00e.svg") no-repeat}.plugin-DoorLabelPlugin-cnt--customBrand.svelte-16kdbw2.svelte-16kdbw2:active,.plugin-DoorLabelPlugin-cnt--customBrand.svelte-16kdbw2.svelte-16kdbw2:focus{background:rgba(0, 0, 0, 0.5);color:rgba(249, 234, 193, 0.5)}')}function Rd(i){let t,e,n,o,s,r,a,l;return{c(){t=X("div"),e=X("div"),n=X("span"),n.textContent=`${i[8]}`,o=fe(),s=X("i"),x(n,"class","plugin-DoorLabelPlugin-txt svelte-16kdbw2"),x(s,"class","plugin-DoorLabelPlugin-icon svelte-16kdbw2"),x(e,"class",r=je(tt("plugin-DoorLabelPlugin-cnt",i[0].toward))+" svelte-16kdbw2"),x(e,"style",`transform: ${i[6]||"initial"};pointer-events: ${i[5]?"auto":"none"};opacity: ${i[5]?1:0}`),x(e,"data-camera-toward",i[7]),x(t,"style",`left: ${i[3]||0}%;top: ${i[4]||0}%;opacity: ${i[5]?1:0}`),x(t,"class","plugin-DoorLabelPlugin-item svelte-16kdbw2")},m(c,h){V(c,t,h),Q(t,e),Q(e,n),Q(e,o),Q(e,s),i[10](t),a||(l=qe(e,"click",i[9]),a=!0)},p(c,[h]){h&1&&r!==(r=je(tt("plugin-DoorLabelPlugin-cnt",c[0].toward))+" svelte-16kdbw2")&&x(e,"class",r)},i:ne,o:ne,d(c){c&&W(t),i[10](null),a=!1,l()}}}function Nd(i,t,e){let{props:n}=t,{onClick:o}=t,s,{left:r,top:a,inSight:l,transform:c,panoIndex:h,cameraToward:f,name:u}=n,m=0;const g=()=>{if(!r||!a||!l||!s)return;const y=s.current.clientWidth/window.innerWidth*100,I=s.current.clientHeight/window.innerHeight*100;if(r<=y/2||r>=100-y/2||a<=I/2||a>=100-I/2)return;h!==m&&(console.log("panoDoorLabelPlugin",h,"\u89E6\u53D1\u57CB\u70B9"),m=h)},v=y=>{o&&o()};function b(y){Rt[y?"unshift":"push"](()=>{s=y,e(2,s)})}return i.$$set=y=>{"props"in y&&e(0,n=y.props),"onClick"in y&&e(1,o=y.onClick)},g(),[n,o,s,r,a,l,c,f,u,v,b]}class Bd extends de{constructor(t){super(),ue(this,t,Nd,Rd,he,{props:0,onClick:1},Od)}}function Hd(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 Fd(i){const{camera:t}=i,e=t.getWorldDirection(new M.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 Gd(i,t){return Math.sqrt(Math.pow(i.z-t.z,2)+Math.pow(i.x-t.x,2))}function Xd(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 Qd={userAction:!0};class Wd extends jd{constructor(e){super(e);d(this,"MinVisibledistance",1.8);d(this,"MaxVisibledistance",5);d(this,"OffsetHeight",-1.3);d(this,"rooms");d(this,"floorplanServerData");d(this,"doorLabelItems");d(this,"visibleLabelMap",new Map);d(this,"labelItems",[]);d(this,"doorLabels");d(this,"roomObservers");d(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,this.five.once("panoArrived",()=>{console.log("doorplugin","panoArrived"),this.initData()})});d(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,h=e==null?void 0:e.find(f=>f.floor_index===c);if(h){const f=h.rooms.find(u=>u.observer_indexs.includes(l));if(f)return{panoIndex:l,floorIndex:c,name:f.name}}}).filter(Boolean);this.roomObservers=o});d(this,"hideAllLabels",()=>{this.labelItems.forEach(e=>{e.visible=!1,e.inSight=!1}),this.render()});d(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 h=l.position.clone(),f=h.distanceTo(s);if(f<this.MinVisibledistance||f>this.MaxVisibledistance)return;const u=new M.Raycaster,m=h.clone().sub(s).normalize();u.set(s,m);const[g]=this.five.model.intersectRaycaster(u);g&&g.distance+.1<f||a.push(c)}),this.visibleLabelMap.set(e,a),a}})();this.labelItems.forEach((a,l)=>{a.visible=r.includes(l)}),this.fixDoorPosition()});d(this,"fixDoorPosition",()=>{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 M.Vector3),l=[],c=[...this.labelItems];if(c.forEach((h,f)=>{if(h.visible){const u=n.position.distanceTo(h.position),m=h.position.clone().add(new M.Vector3(0,this.OffsetHeight,0)),v=m.clone().sub(n.position).normalize().angleTo(a),b=m.clone().project(n),y=(b.x+1)/2.2*100,I=(-b.y+1)/2.2*100,P=y>=0&&y<=100&&I>=0&&I<=100&&u>this.MinVisibledistance&&u<=this.MaxVisibledistance;h.left=y,h.top=I,h.inSight=P&&v<Math.PI/2,h.cameraToward=Fd(this.five),P?l.push({disFromCameraToLabel:u,left:y,top:I,index:f}):h.transform="translate(-50%, -50%)"}else h.inSight=!1}),l.length>1){let h=0;l.sort((f,u)=>u.disFromCameraToLabel-f.disFromCameraToLabel);for(let f=1;f<l.length;f++){const{index:u,left:m,top:g}=l[f-1],{index:v,left:b,top:y}=l[f],I=this.container.children[u],P=this.container.children[v];if(!I||!P)return;const k={left:s*m/100,top:r*g/100,width:I.children[0].clientWidth,height:I.children[0].clientHeight},D={left:s*b/100,top:r*y/100,width:P.children[0].clientWidth,height:P.children[0].clientHeight};Hd(k,D)&&(h++,c[u].transform=`translate(-50%, ${(h-1)*100-50}%)`,c[v].transform=`translate(-50%, ${h*100-50}%)`)}}this.labelItems=c,this.render()});d(this,"onClick",(e,n)=>{if(!this.roomObservers)return;const{work:o}=this.five;let s,r,a=1/0;for(let l=0;l<o.observers.length;l++){if(this.roomObservers[l].name!==e)continue;const h=o.observers[l].standingPosition,f=n.distanceTo(h);f<a&&(s=l,r=h.clone().sub(n).normalize(),a=f)}if(r!==null&&s!==null){const l={};if(a>0){const h=new M.Vector3(0,0,-1),f=r.clone(),u=new M.Quaternion;u.setFromUnitVectors(h,f);const m=new M.Euler;m.setFromQuaternion(u,"YXZ"),l.longitude=m.y}this.five.emit("wantsToMoveToPano",s,{},!0)||this.five.moveToPano(s,{longitude:l.longitude})}});d(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(h=>!!(h&&h.name===r.name)),l=this.five.work.observers.filter((h,f)=>!!r.observer_indexs.find(u=>u===f));a&&a.forEach(h=>{const f=h.position;let u=1/0,m;l.forEach(v=>{const b=v.standingPosition,y={x:b.x,y:b.y,z:b.z},I=Gd(f,y);I<u&&(u=I,m=y)}),m&&(f.y=m.y+.01);const g=new M.Vector3(f.x,f.y,f.z);g.add(new M.Vector3(-.2,1.8,0).applyEuler(new M.Euler(0,h.rad,0))),this.doorLabels.push({roomName:r.name,name:h.name,position:g,toward:Xd(h.rad)})})}),this.labelItems=this.doorLabels.map(r=>({...r,left:0,top:0,visible:!1,inSight:!1,transform:"",cameraToward:""})),console.log("doorplugin","labelItems",this.labelItems),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:Qd.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 Bd({target:this.container,props:{props:e,onClick:()=>{this.onClick(e.name,e.position)}}}))})}initState(){return{enabled:!0,visible:!0}}dispose(){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 Yd=i=>new Wd(i);var Un={},Vd=Zd;function Zd(i,t,e){return i[0]=t[0]+e[0],i[1]=t[1]+e[1],i}var Jd=Ud;function Ud(i,t,e){return i[0]=t,i[1]=e,i}var qd=Kd;function Kd(i,t){var e=t[0],n=t[1],o=e*e+n*n;return o>0&&(o=1/Math.sqrt(o),i[0]=t[0]*o,i[1]=t[1]*o),i}var _d=$d;function $d(i,t,e){return i[0]=t[0]-e[0],i[1]=t[1]-e[1],i}var ef=tf;function tf(i,t){return i[0]*t[0]+i[1]*t[1]}var nf=Vd,xi=Jd,ur=qd,of=_d,sf=ef,bs=[0,0];Un.computeMiter=function(t,e,n,o,s){return nf(t,n,o),ur(t,t),xi(e,-t[1],t[0]),xi(bs,-n[1],n[0]),s/sf(e,bs)};Un.normal=function(t,e){return xi(t,-e[1],e[0]),t};Un.direction=function(t,e,n){return of(t,e,n),ur(t,t),t};var ct=Un,Pt=[0,0],Ln=[0,0],As=[0,0],Ut=[0,0],rf=function(i,t){var e=null,n=[];t&&(i=i.slice(),i.push(i[0]));for(var o=i.length,s=1;s<o;s++){var r=i[s-1],a=i[s],l=s<i.length-1?i[s+1]:null;if(ct.direction(Pt,a,r),e||(e=[0,0],ct.normal(e,Pt)),s===1&&gi(n,e,1),!l)ct.normal(e,Pt),gi(n,e,1);else{ct.direction(Ln,l,a);var c=ct.computeMiter(As,Ut,Pt,Ln,1);gi(n,Ut,c)}}if(i.length>2&&t){var h=i[o-2],f=i[0],u=i[1];ct.direction(Pt,f,h),ct.direction(Ln,u,f),ct.normal(e,Pt);var m=ct.computeMiter(As,Ut,Pt,Ln,1);n[0][0]=Ut.slice(),n[o-1][0]=Ut.slice(),n[0][1]=m,n[o-1][1]=m,n.pop()}return n};function gi(i,t,e){i.push([[t[0],t[1]],e])}const af=2,lf=3,cf=3,hf=2;function uf(i,t){var r,a,l;if(i.length<2)return console.warn("positionList length must be greater than 1"),[];const e=(r=t==null?void 0:t.unitWidth)!=null?r:.5,n=(a=t==null?void 0:t.unitHeight)!=null?a:.5,o=(l=t==null?void 0:t.skipPosition)!=null?l:!1,s=new O.CatmullRomCurve3(i,!1,"catmullrom",1);if(o){const c=Math.ceil(s.getLength()/n*1.5),h=s.getPoints(c),f=[];let u=0;const m=i;return m.forEach((g,v)=>{let b=0,y=99999999;h.forEach((E,T)=>{const C=E.distanceTo(g);C<y&&(b=T,y=C)});const I=h[b+1],P=I==null?void 0:I.distanceTo(g),k=h[b-1],D=k==null?void 0:k.distanceTo(g);if(b>u&&b-u>1){let E=b;k!==void 0&&D>.8&&(E=b+1),k!==void 0&&D>.2&&D<.3?E=b:y>.2&&y<.3&&(E=b+1);let T=u;if(I!==void 0&&P>.2&&P<.3?T=u+1:y>.2&&y<.3&&(T=u),h[T]&&h[T+1]){const B=m[v-1];if(B)if(B.equals(h[T]))T+=1;else{const F=new M.Vector3().subVectors(h[T+1],h[T]),$=new M.Vector3().subVectors(B,h[T]);F.angleTo($)<Math.PI/2&&(T+=1)}}if(E<T||E-T<=1)return;const C=h.slice(T,E),z=ys(C,e,n);f.push(z),u=b}}),f}else{const c=Math.ceil(s.getLength()),h=s.getPoints(c);return[ys(h,e,n)]}}function ys(i,t,e){const n=t/2,o=e/t,s=i.length,r=rf(i.map(y=>[y.x,y.z])),l=(i.length-1)*af*lf,c=2*s,h=c*cf,f=c*hf,u=new Uint32Array(l),m=new Float32Array(h),g=new Float32Array(f);i.forEach((y,I)=>{});let v=0;for(let y=0;y<i.length;y++){const[I,P]=r[y][0],k=i[y],{x:D,y:E,z:T}=k,C=new M.Vector3(D+I*n,E+.05,T+P*n);m[y*6+0]=C.x,m[y*6+1]=C.y,m[y*6+2]=C.z;const z=new M.Vector3(D-I*n,E+.05,T-P*n);m[y*6+3]=z.x,m[y*6+4]=z.y,m[y*6+5]=z.z,v+=y>0?i[y-1].clone().sub(i[y]).length():0;const B=v/t/o;g[y*4+0]=0,g[y*4+1]=B,g[y*4+2]=1,g[y*4+3]=B,y!==i.length-1&&(u[y*6+0]=y*2+0,u[y*6+1]=y*2+2,u[y*6+2]=y*2+1,u[y*6+3]=y*2+2,u[y*6+4]=y*2+3,u[y*6+5]=y*2+1)}const b=new O.BufferGeometry;return b.setAttribute("position",new O.BufferAttribute(m,3)),b.setAttribute("uv",new O.BufferAttribute(g,2)),b.setIndex(new O.BufferAttribute(u,1)),b}function df(i){var n;const t=new O.TextureLoader().load((n=i==null?void 0:i.textureUrl)!=null?n:"//vrlab-static.ljcdn.com/release/web/arrow6.b6ce0c62.png");return t.wrapS=t.wrapT=O.RepeatWrapping,t.encoding=O.sRGBEncoding,new O.MeshBasicMaterial({color:16777215,map:t,transparent:!0,opacity:.8})}function Ps(i){return i!=null}const dr="v1.0.1",fr="GuideLinePlugin",Ci=`${fr}@${dr}`,ws=i=>`${Ci}--${i}`;class mr extends Lt{constructor(e){super(e);d(this,"state",{visible:!1,enabled:!0,disposed:!1});d(this,"data");d(this,"linesGroup");d(this,"disposedErrorLog",()=>{console.error(`${Ci} is disposed`)});d(this,"actionWhenEnabled",e=>{if(this.state.enabled)return e()});Object.assign(window,{[`__${fr}_DEBUG__`]:this})}async load(e,n,o=!0){const s=this.data?JSON.parse(JSON.stringify(this.data)):void 0,r=await this.formatData(e);this.hooks.emit("dataChange",r,s),this.data=r,this.linesGroup&&this.five.scene.remove(this.linesGroup);const a=this.getLinesGroup(r.routes);!a||(this.linesGroup=a,this.five.scene.add(a),this.handleVisible(this.state.visible),this.handleEnable(this.state.enabled),n&&this.setState(n),this.five.needsRender=!0,this.hooks.emit("dataLoaded",r),console.log(`${Ci} loaded`,r))}async formatData(e){return typeof e=="object"&&e!==null&&e.version&&e.data?e.data:e}async show(e){this.setState({visible:!0},e)}async hide(e){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={...this.state};this.state={...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)}handleEnable(e,n=!0){this.linesGroup&&(e?(this.five.scene.add(this.linesGroup),this.actionWhenEnabled(()=>this.hooks.emit("enable",{userAction:n}))):(this.five.scene.remove(this.linesGroup),this.hooks.emit("disable",{userAction:n})))}handleVisible(e,n=!0){this.linesGroup&&(e?(this.linesGroup.visible=!0,this.actionWhenEnabled(()=>this.hooks.emit("show",{userAction:n}))):(this.linesGroup.visible=!1,this.actionWhenEnabled(()=>this.hooks.emit("hide",{userAction:n}))))}handleDispose(){this.linesGroup&&this.five.scene.add(this.linesGroup)}getLinesGroup(e){const n=e.map(this.getLine.bind(this)).filter(Ps),o=new O.Group;if(o.name=ws("route-group"),n.length!==0)return o.add(...n),o}getLine(e){const n=new O.Group,o=e.panoIndexList.map(a=>{var l;return(l=this.five.work.observers[a])==null?void 0:l.standingPosition}).filter(Ps),s=uf(o,{skipPosition:!0,unitWidth:.6,unitHeight:.4});if(!s)return;const r=df({textureUrl:e.arrowTextureUrl});return s.forEach(a=>{const l=new O.Mesh(a,r);l.name=ws("route-line-mesh"),n.add(l)}),n}}d(mr,"lasestVersion",dr);const pr=i=>new mr(i);function Es(i){const t=Math.abs(Math.cos(i.latitude));return new O.Vector3(-Math.sin(i.longitude)*t,-Math.sin(i.latitude),-Math.cos(i.longitude)*t)}function ff(i,t){const e=Es(i),n=Es(t);return e.angleTo(n)}const mf=async i=>{try{i().then(()=>{},()=>{}).catch(()=>{})}catch{}},kn=Math.PI*2;function pf(i){return i>=0&&i<kn?i:(i%kn+kn)%kn}function gf(i){return{longitude:pf(-Math.atan2(i.x,-i.z)),latitude:-Math.asin(i.y/1)}}function vf(i,t,e,n){const o=-i/e,s=i;return o*n+s}function bf(i){return new Promise(t=>{setTimeout(()=>{t()},i)})}const gr="v1.0.6",vr="CruisePlugin",qn=`${vr}@${gr}`,Is=()=>{console.error(`${qn} is disposed`)},Af=()=>{console.warn(`${qn} is disabled`)},yf=()=>{console.error(`${qn} is disabled`)},vi=new Map;class Xi extends Lt{constructor(e){super(e);d(this,"state",{visible:!0,enabled:!0,disposed:!1,playing:!1,speed:1,config:{speedConfig:{rotateSpeed:.001,rotateSpeedUnit:"rad/ms",moveSpeed:.002,moveSpeedUnit:"m/ms"}}});d(this,"data");d(this,"privateState",{playing:!1,currentPlayQueue:[],currentPlayKeyframe:null,broke:!1,disposers:[]});d(this,"GuideLine");Object.assign(window,{[`__${vr}_DEBUG__`]:this});const n=this.setFiveLinearUpdateCamera.bind(this),o=this.setFiveOriginUpdateCamera.bind(this);this.hooks.on("play",n),this.hooks.on("broke",o),this.hooks.on("end",o),this.hooks.on("pause",o),this.privateState.disposers.push(()=>{this.hooks.off("play",n),this.hooks.off("broke",o),this.hooks.off("end",o),this.hooks.off("pause",o)})}async load(e,n,o){var h,f,u,m,g;if(this.state.disposed)return Is();this.privateState.fiveOriginGetProgress||(f=(h=this.five.controller)==null?void 0:h.cameraMotion)!=null&&f.getProgress||(await this.waitFiveLoaded(),this.privateState.fiveOriginGetProgress=(m=(u=this.five.controller)==null?void 0:u.cameraMotion)==null?void 0:m.getProgress),this.clear();const s=this.data?JSON.parse(JSON.stringify(this.data)):void 0,r=await this.formatData(e);this.data=r,this.hooks.emit("dataChange",r,s);let a=[],l;const c=this.data.keyframes.filter(v=>v.data.panoIndex!==void 0);c.filter((v,b)=>{var y;return v.data.panoIndex!==((y=c[b-1])==null?void 0:y.data.panoIndex)}).map(v=>v.data.panoIndex).forEach(v=>{var y,I;const b=(y=this.five.work.observers[v])==null?void 0:y.floorIndex;if(b!==void 0)if(l===b){const P=a.length-1;a[P]=[...(I=a[P])!=null?I:[],v]}else{l=b;const P=a.length;a[P]=[v]}}),this.GuideLine||(this.GuideLine=pr(this.five)),(g=this.GuideLine)==null||g.load({routes:a.map(v=>({panoIndexList:v}))}),this.setState({playing:!1}),this.handleVisible(this.state.visible),this.handleEnable(this.state.enabled),this.changePlayState(this.state.playing),this.changeSpeed(this.state.speed),n&&this.setState(n,{userAction:o}),console.log(`${qn} 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({...e,index:0})}pause(e){this.setState({playing:!1},e)}async show(e){this.setState({visible:!0},e)}async hide(e){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 Is();if(!this.state.enabled&&e.enabled!==!0&&e.disposed!==!0)return yf();const o={...this.state};this.state={...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})}async formatData(e){this.five.work||await 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:ut(),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{id:(c=s.uuid)!=null?c:ut(),moveIndex:r,stay:l,index:r,...s}})};if(o.panoIndexList){let s=[];const{moveEffect:r,moveToFirstPanoEffect:a}=o;return this.privateState.moveToFirstPanoEffect=a,o.panoIndexList.filter((l,c)=>l!==o.panoIndexList[c-1]).forEach((l,c)=>{const h=(()=>{var v,b,y,I;const f=o.panoIndexList[c+1];if(f===void 0)return;const u=(v=n[l])==null?void 0:v.position,m=(b=n[f])==null?void 0:b.position;if(!m||!u||((y=n[l])==null?void 0:y.floorIndex)!==((I=n[f])==null?void 0:I.floorIndex))return;const g=new O.Vector3().subVectors(m,u);return gf(g)})();o.moveType===void 0||o.moveType==="justMove"?s.push({moveIndex:c,stay:o.stay,data:{effect:"Move",panoIndex:l,moveEffect:r,...h!=null?h:{}}}):o.moveType==="moveAndRotate"&&(s.push({moveIndex:c,stay:o.stay,data:{effect:"Move",panoIndex:l,moveEffect:r}}),h&&s.push({moveIndex:c,stay:o.stay,data:{effect:"Rotate",panoIndex:l,...h}}))}),{keyframesId:ut(),keyframes:s.map((l,c)=>({id:ut(),index:c,...l}))}}else throw new Error("format error: data no keyframes or no panoIndexList")}handleEnable(e,n=!0){var o,s;e?((o=this.GuideLine)==null||o.enable(),this.hooks.emit("enable",{userAction:n})):((s=this.GuideLine)==null||s.disable(),this.changePlayState(!1,{userAction:n}),this.hooks.emit("disable",{userAction:n})),this.state.enabled=e}handleVisible(e,n=!0){var o,s;e?((o=this.GuideLine)==null||o.show(),this.actionIfStateIsEnabled(()=>this.hooks.emit("show",{userAction:n}))):((s=this.GuideLine)==null||s.hide(),this.actionIfStateIsEnabled(()=>this.hooks.emit("hide",{userAction:n}))),this.state.visible=e}changePlayState(e,n){this.actionIfStateIsEnabled(()=>{var o;return this.hooks.emit("playStateChange",e?"playing":"pause",{userAction:(o=n==null?void 0:n.userAction)!=null?o:!0})}),e?this.handlePlay(n):this.handlePause(n),this.state.playing=e}async handlePlay(e){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=ut();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 h=!1;const u=await(async()=>{var g,v;if((e==null?void 0:e.playFromIndex)!==void 0)return e.playFromIndex;if((e==null?void 0:e.playFromId)!==void 0)return(g=this.data)==null?void 0:g.keyframes.findIndex(b=>b.id===e.playFromId);if(c!=null&&c.keyframeId){const b=(v=this.data)==null?void 0:v.keyframes.find(y=>y.id===c.keyframeId);if(c!=null&&c.fiveState&&await this.move(c.fiveState,{moveEffect:s.moveToFirstPanoEffect}),b){if(b.data.effect==="Move")return b.index;if(b.data.effect==="Rotate"){const y=c.duration!==void 0?c.duration*(1-c.playedProgress):void 0;return await this.playKeyframe(b,{duration:y}),h=!0,b.index+1}}}})();this.clearPauseData();for(const g of l){if(s.broke||!o.playing||!s.playing||a!==s.playId)return;if(!(u!==void 0&&g.index<u))try{r.emit("playIndexChange",g.index,g),await this.playKeyframe(g,{moveEffect:h===!1?s.moveToFirstPanoEffect:void 0,duration:800}),g.stay&&await bf(g.stay),h===!1&&(h=!0)}catch{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}))}async playKeyframe(e,n){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){return this.five.once("gesture",e),this.five.once("modeChange",e),()=>{this.five.off("gesture",e),this.five.once("modeChange",e)}}async getPlayPromise(e,n){var s;const o=e.data;if(n.duration=(s=n==null?void 0:n.duration)!=null?s:e.start!==void 0&&e.end!==void 0?e.end-e.start:void 0,!!o)return new Promise((r,a)=>{let l=!1;this.addInterruptListener(()=>{if(!l)return this.hooks.emit("broke"),this.privateState.broke=!0,this.setState({playing:!1}),l=!0,a(new Error("play is interupted"))});try{if(l)return;const c=()=>{r(),l=!0};switch(o.effect){case"Move":this.move(o,n).then(c);break;case"Rotate":this.rotate(o,n).then(c);break;default:this.rotate(o,n).then(c)}}catch{}})}async actionPromiseQueue(){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())}async move(e,n){if(e.mode&&e.mode!==this.five.currentMode)await this.changeMode(e);else if(e.panoIndex!==this.five.panoIndex)await this.changePano(e,n);else return Promise.resolve()}async rotate(e,n){if(e.mode&&e.mode!==this.five.currentMode)await this.changeMode({mode:e.mode,panoIndex:e.panoIndex});else if(e.panoIndex&&e.panoIndex!==this.five.panoIndex)return await this.changePano(e,n);await this.updateCamera(e,n==null?void 0:n.duration)}async updateCamera(e,n=800){const{five:o,privateState:s,state:r}=this;let a=n;const l=(()=>{var u,m;const h=(u=r.config)==null?void 0:u.speedConfig,f=(m=e.rotateSpeed)!=null?m:h==null?void 0:h.rotateSpeed;if((h==null?void 0:h.rotateSpeedUnit)===void 0)return f;if(f!==void 0)return h.rotateSpeedUnit==="rad/ms"?f:f/1e3})();if(l){const h=this.five.getCurrentState();a=ff(h,e)/l}s.currentPlayKeyframe&&(s.currentPlayKeyframe.originDuration=a);const c=this.getSpeededDuration(a);return new Promise(h=>{mf(()=>o.updateCamera(e,c)),setTimeout(()=>h(),c)})}async changePano(e,n){var h;const{five:o,privateState:s,state:r}=this;if(typeof e.panoIndex!="number"||e.panoIndex===o.panoIndex)return;let a=(h=n==null?void 0:n.duration)!=null?h:800;const l=(()=>{var m,g;const f=(m=r.config)==null?void 0:m.speedConfig,u=(g=e.moveSpeed)!=null?g:f==null?void 0:f.moveSpeed;if((f==null?void 0:f.moveSpeedUnit)===void 0)return u;if(u!==void 0)return f.moveSpeedUnit==="m/ms"?u:u/1e3})();if(l&&typeof o.panoIndex=="number"&&typeof e.panoIndex=="number"){const f=o.work.observers[o.panoIndex].position,u=o.work.observers[e.panoIndex].position;a=f.distanceTo(u)/l}s.currentPlayKeyframe&&(s.currentPlayKeyframe.originDuration=a);const c=this.getSpeededDuration(a);return new Promise(f=>{var u,m,g;o.moveToPano(e.panoIndex,{latitude:e.latitude,longitude:e.longitude,fov:e.fov,duration:c,effect:(g=(m=n==null?void 0:n.moveEffect)!=null?m:(u=this.state.config)==null?void 0:u.moveEffect)!=null?g:e.moveEffect,moveCancelCallback:()=>f(),moveEndCallback:()=>f()})})}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{}}getSpeededDuration(e){return e/this.state.speed}getProgress(){return this.five.controller.cameraMotion.progress}async changeMode(e,n){e.mode&&e.mode!==this.five.currentMode&&await this.five.changeMode(e.mode,e,n)}forceInteruptUpdateCamera(){this.five.updateCamera({},0)}getPauseData(){var e,n;if((e=this.data)!=null&&e.keyframesId)return vi.get((n=this.data)==null?void 0:n.keyframesId)}setPauseData(){var e,n,o,s;if((e=this.data)!=null&&e.keyframesId)return vi.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 vi.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&&Af()}async waitFiveLoaded(){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-vf(1,n.startVelocity,n.duration,o)})}setFiveOriginUpdateCamera(){!this.privateState.fiveOriginGetProgress||(this.five.controller.cameraMotion.getProgress=this.privateState.fiveOriginGetProgress)}}d(Xi,"PluginVersion",gr);const Pf=i=>new Xi(i);exports.CSS3DRenderPlugin=Xn;exports.CameraMovementEffect=Js;exports.CameraMovementPlugin=yh;exports.CruisePlugin=Pf;exports.CruisePluginController=Xi;exports.DIRECTION=jt;exports.DISPLAY_STRATEGY_TYPE=Et;exports.FLOOR_PLAN_ATTACHED_TO=gt;exports.FLOOR_TYPE_MAP=ch;exports.GuideLinePlugin=pr;exports.ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE=It;exports.ItemLabelPlugin=Md;exports.Magnifier=$s;exports.MapviewFloorplanPlugin=Gc;exports.ModelChassisCompassPlugin=dh;exports.ModelEntryDoorGuidePlugin=ph;exports.ModelFloorplanPlugin=Nc;exports.ModelItemLabelPlugin=dd;exports.ModelRoomLabelPlugin=Ja;exports.ModelTVVideoPlugin=pd;exports.ModelViewPlugin=$r;exports.PaintBrush=_r;exports.PaintBrushTypeEnum=ht;exports.PanoCompassPlugin=Qh;exports.PanoCursorRaycasterPlugin=pa;exports.PanoDoorLabelPlugin=Yd;exports.PanoFloorplanRadarPlugin=ah;exports.PanoMeasurePlugin=Fu;exports.PanoRulerPlugin=xh;exports.PanoRulerProPlugin=Rh;exports.PanoSpatialTagPlugin=td;exports.ROOM_FETILE_TYPE_MAP=lh;exports.ROOM_TYPE_MAP=hh;exports.Rotation=et;exports.TopviewFloorplanPlugin=Qc;exports.itemLabelPluginServerParams=Sd;exports.modelItemLabelPluginServerParams=fd;exports.modelRoomLabelPluginServerParams=Ua;
|
|
538
|
+
`,e.container.style.pointerEvents="none";const n=b=>(e.wrapper=b,b.appendChild(e.container),l(),!0),o=b=>{e.itemLabels=Dd(b),l()},s=()=>(e.enabled||(e.enabled=!0,l()),!0),r=()=>(e.enabled&&(e.enabled=!1,l()),!0),a=()=>{h(),e.container.remove()},l=()=>{var b;if(!!e.wrapper){if(!e.enabled||!e.fiveModeEnabled){(b=e.app)==null||b.$destroy(),e.app=void 0;return}e.app?e.app.$set({five:i,itemLabels:e.itemLabels}):e.app=new Td({target:e.container,props:{five:i,modelOcclusionEnable:e.modelOcclusionEnable,onlyVisibleInPanorama:e.onlyVisibleInPanorama,itemLabels:e.itemLabels,wrapper:e.wrapper,hooks:e.hooks,displayStrategyType:e.displayStrategyType,maxVisibleDistance:e.maxVisibleDistance}})}},c=()=>{i.on("modeChange",f),i.once("dispose",a)},h=()=>{i.off("modeChange",f)},f=b=>{if(b!==ye.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}},Sd={name:"ItemLabelPlugin",version:0};class jd extends Qs{constructor(e){super(e);d(this,"state");d(this,"container");d(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({...e,userAction:!0})}disable(e){this.enabled=!1,this.updateState({...e,userAction:!0})}show(e){if(!!this.state.enabled)return this.setState({...this.state,visible:!0},e),Promise.resolve()}hide(e){if(!!this.state.enabled)return this.setState({...this.state,visible:!1},e),Promise.resolve()}dispose(){this.container.remove()}setState(e,n){if(!this.enabled)return;const o={...this.state};this.state={...this.state,...e,...n},this.stateChangedCallback(o,n)}get visible(){return this.five.state.mode===ye.Five.Mode.Panorama}appendTo(e){!this.enabled||(this.container=e,this.render())}updateState(e){this.setState({...this.state,enabled:this.enabled,visible:this.visible},e)}}function Od(i){ge(i,"svelte-16kdbw2",'.plugin-DoorLabelPlugin-item.svelte-16kdbw2.svelte-16kdbw2{position:absolute;left:0;top:0;width:0;height:0;pointer-events:none;transition:opacity 0.3s ease}.plugin-DoorLabelPlugin-cnt.svelte-16kdbw2.svelte-16kdbw2{position:absolute;top:50%;left:50%;border-radius:2px;background:rgba(0, 0, 0, 0.35);line-height:0.625rem;padding:0.3125rem;white-space:nowrap;font-size:0.625rem;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-16kdbw2.svelte-16kdbw2::after{content:"";display:block;position:absolute;top:-1px;left:-1px;bottom:-1px;right:-1px;border-radius:2px;border:1px 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-16kdbw2.svelte-16kdbw2:active,.plugin-DoorLabelPlugin-cnt.svelte-16kdbw2.svelte-16kdbw2:focus{background:rgba(0, 0, 0, 0.5);color:rgba(255, 255, 255, 0.5)}.plugin-DoorLabelPlugin-icon.svelte-16kdbw2.svelte-16kdbw2{background:url("//vrlab-image4.ljcdn.com/release/web/DoorLabel-icon.de1304ae.svg") no-repeat;background-size:100%;display:inline-block;width:0.52083rem;height:0.52083rem;margin-left:0.20833rem;transform-origin:center}.plugin-DoorLabelPlugin-cnt[data-camera-toward=forward].left.svelte-16kdbw2 .plugin-DoorLabelPlugin-icon.svelte-16kdbw2{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=forward].right.svelte-16kdbw2 .plugin-DoorLabelPlugin-txt.svelte-16kdbw2{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=forward].right.svelte-16kdbw2 .plugin-DoorLabelPlugin-icon.svelte-16kdbw2{transform:rotate(-90deg);margin-left:0;margin-right:0.20833rem;order:0}.plugin-DoorLabelPlugin-cnt[data-camera-toward=right].forward.svelte-16kdbw2 .plugin-DoorLabelPlugin-icon.svelte-16kdbw2{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=right].back.svelte-16kdbw2 .plugin-DoorLabelPlugin-txt.svelte-16kdbw2{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=right].back.svelte-16kdbw2 .plugin-DoorLabelPlugin-icon.svelte-16kdbw2{transform:rotate(-90deg);margin-left:0;margin-right:0.20833rem;order:0}.plugin-DoorLabelPlugin-cnt[data-camera-toward=left].back.svelte-16kdbw2 .plugin-DoorLabelPlugin-icon.svelte-16kdbw2{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=left].forward.svelte-16kdbw2 .plugin-DoorLabelPlugin-txt.svelte-16kdbw2{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=left].forward.svelte-16kdbw2 .plugin-DoorLabelPlugin-icon.svelte-16kdbw2{transform:rotate(-90deg);margin-left:0;margin-right:0.20833rem;order:0}.plugin-DoorLabelPlugin-cnt[data-camera-toward=back].right.svelte-16kdbw2 .plugin-DoorLabelPlugin-icon.svelte-16kdbw2{transform:rotate(90deg)}.plugin-DoorLabelPlugin-cnt[data-camera-toward=back].left.svelte-16kdbw2 .plugin-DoorLabelPlugin-txt.svelte-16kdbw2{order:1}.plugin-DoorLabelPlugin-cnt[data-camera-toward=back].left.svelte-16kdbw2 .plugin-DoorLabelPlugin-icon.svelte-16kdbw2{transform:rotate(-90deg);margin-left:0;margin-right:0.20833rem;order:0}.plugin-DoorLabelPlugin-cnt--customBrand.svelte-16kdbw2.svelte-16kdbw2{color:#f9eac1}.plugin-DoorLabelPlugin-cnt--customBrand.svelte-16kdbw2 .plugin-DoorLabelPlugin-icon.svelte-16kdbw2{background:url("//vrlab-image4.ljcdn.com/release/web/arrow.6e8ec00e.svg") no-repeat}.plugin-DoorLabelPlugin-cnt--customBrand.svelte-16kdbw2.svelte-16kdbw2:active,.plugin-DoorLabelPlugin-cnt--customBrand.svelte-16kdbw2.svelte-16kdbw2:focus{background:rgba(0, 0, 0, 0.5);color:rgba(249, 234, 193, 0.5)}')}function Rd(i){let t,e,n,o,s,r,a,l;return{c(){t=X("div"),e=X("div"),n=X("span"),n.textContent=`${i[8]}`,o=fe(),s=X("i"),x(n,"class","plugin-DoorLabelPlugin-txt svelte-16kdbw2"),x(s,"class","plugin-DoorLabelPlugin-icon svelte-16kdbw2"),x(e,"class",r=je(tt("plugin-DoorLabelPlugin-cnt",i[0].toward))+" svelte-16kdbw2"),x(e,"style",`transform: ${i[6]||"initial"};pointer-events: ${i[5]?"auto":"none"};opacity: ${i[5]?1:0}`),x(e,"data-camera-toward",i[7]),x(t,"style",`left: ${i[3]||0}%;top: ${i[4]||0}%;opacity: ${i[5]?1:0}`),x(t,"class","plugin-DoorLabelPlugin-item svelte-16kdbw2")},m(c,h){V(c,t,h),Q(t,e),Q(e,n),Q(e,o),Q(e,s),i[10](t),a||(l=qe(e,"click",i[9]),a=!0)},p(c,[h]){h&1&&r!==(r=je(tt("plugin-DoorLabelPlugin-cnt",c[0].toward))+" svelte-16kdbw2")&&x(e,"class",r)},i:ne,o:ne,d(c){c&&W(t),i[10](null),a=!1,l()}}}function Nd(i,t,e){let{props:n}=t,{onClick:o}=t,s,{left:r,top:a,inSight:l,transform:c,panoIndex:h,cameraToward:f,name:u}=n,m=0;const g=()=>{if(!r||!a||!l||!s)return;const y=s.current.clientWidth/window.innerWidth*100,I=s.current.clientHeight/window.innerHeight*100;if(r<=y/2||r>=100-y/2||a<=I/2||a>=100-I/2)return;h!==m&&(console.log("panoDoorLabelPlugin",h,"\u89E6\u53D1\u57CB\u70B9"),m=h)},v=y=>{o&&o()};function b(y){Rt[y?"unshift":"push"](()=>{s=y,e(2,s)})}return i.$$set=y=>{"props"in y&&e(0,n=y.props),"onClick"in y&&e(1,o=y.onClick)},g(),[n,o,s,r,a,l,c,f,u,v,b]}class Bd extends de{constructor(t){super(),ue(this,t,Nd,Rd,he,{props:0,onClick:1},Od)}}function Hd(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 Fd(i){const{camera:t}=i,e=t.getWorldDirection(new M.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 Gd(i,t){return Math.sqrt(Math.pow(i.z-t.z,2)+Math.pow(i.x-t.x,2))}function Xd(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 Qd={userAction:!0};class Wd extends jd{constructor(e){super(e);d(this,"MinVisibledistance",1.8);d(this,"MaxVisibledistance",5);d(this,"OffsetHeight",-1.3);d(this,"rooms");d(this,"floorplanServerData");d(this,"doorLabelItems");d(this,"visibleLabelMap",new Map);d(this,"labelItems",[]);d(this,"doorLabels");d(this,"roomObservers");d(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,this.five.once("panoArrived",()=>{console.log("doorplugin","panoArrived"),this.initData()})});d(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,h=e==null?void 0:e.find(f=>f.floor_index===c);if(h){const f=h.rooms.find(u=>u.observer_indexs.includes(l));if(f)return{panoIndex:l,floorIndex:c,name:f.name}}}).filter(Boolean);this.roomObservers=o});d(this,"hideAllLabels",()=>{this.labelItems.forEach(e=>{e.visible=!1,e.inSight=!1}),this.render()});d(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 h=l.position.clone(),f=h.distanceTo(s);if(f<this.MinVisibledistance||f>this.MaxVisibledistance)return;const u=new M.Raycaster,m=h.clone().sub(s).normalize();u.set(s,m);const[g]=this.five.model.intersectRaycaster(u);g&&g.distance+.1<f||a.push(c)}),this.visibleLabelMap.set(e,a),a}})();this.labelItems.forEach((a,l)=>{a.visible=r.includes(l)}),this.fixDoorPosition()});d(this,"fixDoorPosition",()=>{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 M.Vector3),l=[],c=[...this.labelItems];if(c.forEach((h,f)=>{if(h.visible){const u=n.position.distanceTo(h.position),m=h.position.clone().add(new M.Vector3(0,this.OffsetHeight,0)),v=m.clone().sub(n.position).normalize().angleTo(a),b=m.clone().project(n),y=(b.x+1)/2.2*100,I=(-b.y+1)/2.2*100,P=y>=0&&y<=100&&I>=0&&I<=100&&u>this.MinVisibledistance&&u<=this.MaxVisibledistance;h.left=y,h.top=I,h.inSight=P&&v<Math.PI/2,h.cameraToward=Fd(this.five),P?l.push({disFromCameraToLabel:u,left:y,top:I,index:f}):h.transform="translate(-50%, -50%)"}else h.inSight=!1}),l.length>1){let h=0;l.sort((f,u)=>u.disFromCameraToLabel-f.disFromCameraToLabel);for(let f=1;f<l.length;f++){const{index:u,left:m,top:g}=l[f-1],{index:v,left:b,top:y}=l[f],I=this.container.children[u],P=this.container.children[v];if(!I||!P)return;const L={left:s*m/100,top:r*g/100,width:I.children[0].clientWidth,height:I.children[0].clientHeight},D={left:s*b/100,top:r*y/100,width:P.children[0].clientWidth,height:P.children[0].clientHeight};Hd(L,D)&&(h++,c[u].transform=`translate(-50%, ${(h-1)*100-50}%)`,c[v].transform=`translate(-50%, ${h*100-50}%)`)}}this.labelItems=c,this.render()});d(this,"onClick",(e,n)=>{if(!this.roomObservers)return;const{work:o}=this.five;let s,r,a=1/0;for(let l=0;l<o.observers.length;l++){if(this.roomObservers[l].name!==e)continue;const h=o.observers[l].standingPosition,f=n.distanceTo(h);f<a&&(s=l,r=h.clone().sub(n).normalize(),a=f)}if(r!==null&&s!==null){const l={};if(a>0){const h=new M.Vector3(0,0,-1),f=r.clone(),u=new M.Quaternion;u.setFromUnitVectors(h,f);const m=new M.Euler;m.setFromQuaternion(u,"YXZ"),l.longitude=m.y}this.five.emit("wantsToMoveToPano",s,{},!0)||this.five.moveToPano(s,{longitude:l.longitude})}});d(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(h=>!!(h&&h.name===r.name)),l=this.five.work.observers.filter((h,f)=>!!r.observer_indexs.find(u=>u===f));a&&a.forEach(h=>{const f=h.position;let u=1/0,m;l.forEach(v=>{const b=v.standingPosition,y={x:b.x,y:b.y,z:b.z},I=Gd(f,y);I<u&&(u=I,m=y)}),m&&(f.y=m.y+.01);const g=new M.Vector3(f.x,f.y,f.z);g.add(new M.Vector3(-.2,1.8,0).applyEuler(new M.Euler(0,h.rad,0))),this.doorLabels.push({roomName:r.name,name:h.name,position:g,toward:Xd(h.rad)})})}),this.labelItems=this.doorLabels.map(r=>({...r,left:0,top:0,visible:!1,inSight:!1,transform:"",cameraToward:""})),console.log("doorplugin","labelItems",this.labelItems),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:Qd.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 Bd({target:this.container,props:{props:e,onClick:()=>{this.onClick(e.name,e.position)}}}))})}initState(){return{enabled:!0,visible:!0}}dispose(){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 Yd=i=>new Wd(i);var Un={},Vd=Zd;function Zd(i,t,e){return i[0]=t[0]+e[0],i[1]=t[1]+e[1],i}var Jd=Ud;function Ud(i,t,e){return i[0]=t,i[1]=e,i}var qd=Kd;function Kd(i,t){var e=t[0],n=t[1],o=e*e+n*n;return o>0&&(o=1/Math.sqrt(o),i[0]=t[0]*o,i[1]=t[1]*o),i}var _d=$d;function $d(i,t,e){return i[0]=t[0]-e[0],i[1]=t[1]-e[1],i}var ef=tf;function tf(i,t){return i[0]*t[0]+i[1]*t[1]}var nf=Vd,xi=Jd,ur=qd,of=_d,sf=ef,bs=[0,0];Un.computeMiter=function(t,e,n,o,s){return nf(t,n,o),ur(t,t),xi(e,-t[1],t[0]),xi(bs,-n[1],n[0]),s/sf(e,bs)};Un.normal=function(t,e){return xi(t,-e[1],e[0]),t};Un.direction=function(t,e,n){return of(t,e,n),ur(t,t),t};var ct=Un,Pt=[0,0],Ln=[0,0],As=[0,0],Ut=[0,0],rf=function(i,t){var e=null,n=[];t&&(i=i.slice(),i.push(i[0]));for(var o=i.length,s=1;s<o;s++){var r=i[s-1],a=i[s],l=s<i.length-1?i[s+1]:null;if(ct.direction(Pt,a,r),e||(e=[0,0],ct.normal(e,Pt)),s===1&&gi(n,e,1),!l)ct.normal(e,Pt),gi(n,e,1);else{ct.direction(Ln,l,a);var c=ct.computeMiter(As,Ut,Pt,Ln,1);gi(n,Ut,c)}}if(i.length>2&&t){var h=i[o-2],f=i[0],u=i[1];ct.direction(Pt,f,h),ct.direction(Ln,u,f),ct.normal(e,Pt);var m=ct.computeMiter(As,Ut,Pt,Ln,1);n[0][0]=Ut.slice(),n[o-1][0]=Ut.slice(),n[0][1]=m,n[o-1][1]=m,n.pop()}return n};function gi(i,t,e){i.push([[t[0],t[1]],e])}const af=2,lf=3,cf=3,hf=2;function uf(i,t){var r,a,l;if(i.length<2)return console.warn("positionList length must be greater than 1"),[];const e=(r=t==null?void 0:t.unitWidth)!=null?r:.5,n=(a=t==null?void 0:t.unitHeight)!=null?a:.5,o=(l=t==null?void 0:t.skipPosition)!=null?l:!1,s=new O.CatmullRomCurve3(i,!1,"catmullrom",1);if(o){const c=Math.ceil(s.getLength()/n*1.5),h=s.getPoints(c),f=[];let u=0;const m=i;return m.forEach((g,v)=>{let b=0,y=99999999;h.forEach((E,T)=>{const C=E.distanceTo(g);C<y&&(b=T,y=C)});const I=h[b+1],P=I==null?void 0:I.distanceTo(g),L=h[b-1],D=L==null?void 0:L.distanceTo(g);if(b>u&&b-u>1){let E=b;L!==void 0&&D>.8&&(E=b+1),L!==void 0&&D>.2&&D<.3?E=b:y>.2&&y<.3&&(E=b+1);let T=u;if(I!==void 0&&P>.2&&P<.3?T=u+1:y>.2&&y<.3&&(T=u),h[T]&&h[T+1]){const B=m[v-1];if(B)if(B.equals(h[T]))T+=1;else{const F=new M.Vector3().subVectors(h[T+1],h[T]),$=new M.Vector3().subVectors(B,h[T]);F.angleTo($)<Math.PI/2&&(T+=1)}}if(E<T||E-T<=1)return;const C=h.slice(T,E),z=ys(C,e,n);f.push(z),u=b}}),f}else{const c=Math.ceil(s.getLength()),h=s.getPoints(c);return[ys(h,e,n)]}}function ys(i,t,e){const n=t/2,o=e/t,s=i.length,r=rf(i.map(y=>[y.x,y.z])),l=(i.length-1)*af*lf,c=2*s,h=c*cf,f=c*hf,u=new Uint32Array(l),m=new Float32Array(h),g=new Float32Array(f);i.forEach((y,I)=>{});let v=0;for(let y=0;y<i.length;y++){const[I,P]=r[y][0],L=i[y],{x:D,y:E,z:T}=L,C=new M.Vector3(D+I*n,E+.05,T+P*n);m[y*6+0]=C.x,m[y*6+1]=C.y,m[y*6+2]=C.z;const z=new M.Vector3(D-I*n,E+.05,T-P*n);m[y*6+3]=z.x,m[y*6+4]=z.y,m[y*6+5]=z.z,v+=y>0?i[y-1].clone().sub(i[y]).length():0;const B=v/t/o;g[y*4+0]=0,g[y*4+1]=B,g[y*4+2]=1,g[y*4+3]=B,y!==i.length-1&&(u[y*6+0]=y*2+0,u[y*6+1]=y*2+2,u[y*6+2]=y*2+1,u[y*6+3]=y*2+2,u[y*6+4]=y*2+3,u[y*6+5]=y*2+1)}const b=new O.BufferGeometry;return b.setAttribute("position",new O.BufferAttribute(m,3)),b.setAttribute("uv",new O.BufferAttribute(g,2)),b.setIndex(new O.BufferAttribute(u,1)),b}function df(i){var n;const t=new O.TextureLoader().load((n=i==null?void 0:i.textureUrl)!=null?n:"//vrlab-static.ljcdn.com/release/web/arrow6.b6ce0c62.png");return t.wrapS=t.wrapT=O.RepeatWrapping,t.encoding=O.sRGBEncoding,new O.MeshBasicMaterial({color:16777215,map:t,transparent:!0,opacity:.8})}function Ps(i){return i!=null}const dr="v1.0.1",fr="GuideLinePlugin",Ci=`${fr}@${dr}`,ws=i=>`${Ci}--${i}`;class mr extends Lt{constructor(e){super(e);d(this,"state",{visible:!1,enabled:!0,disposed:!1});d(this,"data");d(this,"linesGroup");d(this,"disposedErrorLog",()=>{console.error(`${Ci} is disposed`)});d(this,"actionWhenEnabled",e=>{if(this.state.enabled)return e()});Object.assign(window,{[`__${fr}_DEBUG__`]:this})}async load(e,n,o=!0){const s=this.data?JSON.parse(JSON.stringify(this.data)):void 0,r=await this.formatData(e);this.hooks.emit("dataChange",r,s),this.data=r,this.linesGroup&&this.five.scene.remove(this.linesGroup);const a=this.getLinesGroup(r.routes);!a||(this.linesGroup=a,this.five.scene.add(a),this.handleVisible(this.state.visible),this.handleEnable(this.state.enabled),n&&this.setState(n),this.five.needsRender=!0,this.hooks.emit("dataLoaded",r),console.log(`${Ci} loaded`,r))}async formatData(e){return typeof e=="object"&&e!==null&&e.version&&e.data?e.data:e}async show(e){this.setState({visible:!0},e)}async hide(e){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={...this.state};this.state={...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)}handleEnable(e,n=!0){this.linesGroup&&(e?(this.five.scene.add(this.linesGroup),this.actionWhenEnabled(()=>this.hooks.emit("enable",{userAction:n}))):(this.five.scene.remove(this.linesGroup),this.hooks.emit("disable",{userAction:n})))}handleVisible(e,n=!0){this.linesGroup&&(e?(this.linesGroup.visible=!0,this.actionWhenEnabled(()=>this.hooks.emit("show",{userAction:n}))):(this.linesGroup.visible=!1,this.actionWhenEnabled(()=>this.hooks.emit("hide",{userAction:n}))))}handleDispose(){this.linesGroup&&this.five.scene.add(this.linesGroup)}getLinesGroup(e){const n=e.map(this.getLine.bind(this)).filter(Ps),o=new O.Group;if(o.name=ws("route-group"),n.length!==0)return o.add(...n),o}getLine(e){const n=new O.Group,o=e.panoIndexList.map(a=>{var l;return(l=this.five.work.observers[a])==null?void 0:l.standingPosition}).filter(Ps),s=uf(o,{skipPosition:!0,unitWidth:.6,unitHeight:.4});if(!s)return;const r=df({textureUrl:e.arrowTextureUrl});return s.forEach(a=>{const l=new O.Mesh(a,r);l.name=ws("route-line-mesh"),n.add(l)}),n}}d(mr,"lasestVersion",dr);const pr=i=>new mr(i);function Es(i){const t=Math.abs(Math.cos(i.latitude));return new O.Vector3(-Math.sin(i.longitude)*t,-Math.sin(i.latitude),-Math.cos(i.longitude)*t)}function ff(i,t){const e=Es(i),n=Es(t);return e.angleTo(n)}const mf=async i=>{try{i().then(()=>{},()=>{}).catch(()=>{})}catch{}},kn=Math.PI*2;function pf(i){return i>=0&&i<kn?i:(i%kn+kn)%kn}function gf(i){return{longitude:pf(-Math.atan2(i.x,-i.z)),latitude:-Math.asin(i.y/1)}}function vf(i,t,e,n){const o=-i/e,s=i;return o*n+s}function bf(i){return new Promise(t=>{setTimeout(()=>{t()},i)})}const gr="v1.0.6",vr="CruisePlugin",qn=`${vr}@${gr}`,Is=()=>{console.error(`${qn} is disposed`)},Af=()=>{console.warn(`${qn} is disabled`)},yf=()=>{console.error(`${qn} is disabled`)},vi=new Map;class Xi extends Lt{constructor(e){super(e);d(this,"state",{visible:!0,enabled:!0,disposed:!1,playing:!1,speed:1,config:{speedConfig:{rotateSpeed:.001,rotateSpeedUnit:"rad/ms",moveSpeed:.002,moveSpeedUnit:"m/ms"}}});d(this,"data");d(this,"privateState",{playing:!1,currentPlayQueue:[],currentPlayKeyframe:null,broke:!1,disposers:[]});d(this,"GuideLine");Object.assign(window,{[`__${vr}_DEBUG__`]:this});const n=this.setFiveLinearUpdateCamera.bind(this),o=this.setFiveOriginUpdateCamera.bind(this);this.hooks.on("play",n),this.hooks.on("broke",o),this.hooks.on("end",o),this.hooks.on("pause",o),this.privateState.disposers.push(()=>{this.hooks.off("play",n),this.hooks.off("broke",o),this.hooks.off("end",o),this.hooks.off("pause",o)})}async load(e,n,o){var h,f,u,m,g;if(this.state.disposed)return Is();this.privateState.fiveOriginGetProgress||(f=(h=this.five.controller)==null?void 0:h.cameraMotion)!=null&&f.getProgress||(await this.waitFiveLoaded(),this.privateState.fiveOriginGetProgress=(m=(u=this.five.controller)==null?void 0:u.cameraMotion)==null?void 0:m.getProgress),this.clear();const s=this.data?JSON.parse(JSON.stringify(this.data)):void 0,r=await this.formatData(e);this.data=r,this.hooks.emit("dataChange",r,s);let a=[],l;const c=this.data.keyframes.filter(v=>v.data.panoIndex!==void 0);c.filter((v,b)=>{var y;return v.data.panoIndex!==((y=c[b-1])==null?void 0:y.data.panoIndex)}).map(v=>v.data.panoIndex).forEach(v=>{var y,I;const b=(y=this.five.work.observers[v])==null?void 0:y.floorIndex;if(b!==void 0)if(l===b){const P=a.length-1;a[P]=[...(I=a[P])!=null?I:[],v]}else{l=b;const P=a.length;a[P]=[v]}}),this.GuideLine||(this.GuideLine=pr(this.five)),(g=this.GuideLine)==null||g.load({routes:a.map(v=>({panoIndexList:v}))}),this.setState({playing:!1}),this.handleVisible(this.state.visible),this.handleEnable(this.state.enabled),this.changePlayState(this.state.playing),this.changeSpeed(this.state.speed),n&&this.setState(n,{userAction:o}),console.log(`${qn} 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({...e,index:0})}pause(e){this.setState({playing:!1},e)}async show(e){this.setState({visible:!0},e)}async hide(e){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 Is();if(!this.state.enabled&&e.enabled!==!0&&e.disposed!==!0)return yf();const o={...this.state};this.state={...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})}async formatData(e){this.five.work||await 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:ut(),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{id:(c=s.uuid)!=null?c:ut(),moveIndex:r,stay:l,index:r,...s}})};if(o.panoIndexList){let s=[];const{moveEffect:r,moveToFirstPanoEffect:a}=o;return this.privateState.moveToFirstPanoEffect=a,o.panoIndexList.filter((l,c)=>l!==o.panoIndexList[c-1]).forEach((l,c)=>{const h=(()=>{var v,b,y,I;const f=o.panoIndexList[c+1];if(f===void 0)return;const u=(v=n[l])==null?void 0:v.position,m=(b=n[f])==null?void 0:b.position;if(!m||!u||((y=n[l])==null?void 0:y.floorIndex)!==((I=n[f])==null?void 0:I.floorIndex))return;const g=new O.Vector3().subVectors(m,u);return gf(g)})();o.moveType===void 0||o.moveType==="justMove"?s.push({moveIndex:c,stay:o.stay,data:{effect:"Move",panoIndex:l,moveEffect:r,...h!=null?h:{}}}):o.moveType==="moveAndRotate"&&(s.push({moveIndex:c,stay:o.stay,data:{effect:"Move",panoIndex:l,moveEffect:r}}),h&&s.push({moveIndex:c,stay:o.stay,data:{effect:"Rotate",panoIndex:l,...h}}))}),{keyframesId:ut(),keyframes:s.map((l,c)=>({id:ut(),index:c,...l}))}}else throw new Error("format error: data no keyframes or no panoIndexList")}handleEnable(e,n=!0){var o,s;e?((o=this.GuideLine)==null||o.enable(),this.hooks.emit("enable",{userAction:n})):((s=this.GuideLine)==null||s.disable(),this.changePlayState(!1,{userAction:n}),this.hooks.emit("disable",{userAction:n})),this.state.enabled=e}handleVisible(e,n=!0){var o,s;e?((o=this.GuideLine)==null||o.show(),this.actionIfStateIsEnabled(()=>this.hooks.emit("show",{userAction:n}))):((s=this.GuideLine)==null||s.hide(),this.actionIfStateIsEnabled(()=>this.hooks.emit("hide",{userAction:n}))),this.state.visible=e}changePlayState(e,n){this.actionIfStateIsEnabled(()=>{var o;return this.hooks.emit("playStateChange",e?"playing":"pause",{userAction:(o=n==null?void 0:n.userAction)!=null?o:!0})}),e?this.handlePlay(n):this.handlePause(n),this.state.playing=e}async handlePlay(e){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=ut();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 h=!1;const u=await(async()=>{var g,v;if((e==null?void 0:e.playFromIndex)!==void 0)return e.playFromIndex;if((e==null?void 0:e.playFromId)!==void 0)return(g=this.data)==null?void 0:g.keyframes.findIndex(b=>b.id===e.playFromId);if(c!=null&&c.keyframeId){const b=(v=this.data)==null?void 0:v.keyframes.find(y=>y.id===c.keyframeId);if(c!=null&&c.fiveState&&await this.move(c.fiveState,{moveEffect:s.moveToFirstPanoEffect}),b){if(b.data.effect==="Move")return b.index;if(b.data.effect==="Rotate"){const y=c.duration!==void 0?c.duration*(1-c.playedProgress):void 0;return await this.playKeyframe(b,{duration:y}),h=!0,b.index+1}}}})();this.clearPauseData();for(const g of l){if(s.broke||!o.playing||!s.playing||a!==s.playId)return;if(!(u!==void 0&&g.index<u))try{r.emit("playIndexChange",g.index,g),await this.playKeyframe(g,{moveEffect:h===!1?s.moveToFirstPanoEffect:void 0,duration:800}),g.stay&&await bf(g.stay),h===!1&&(h=!0)}catch{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}))}async playKeyframe(e,n){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){return this.five.once("gesture",e),this.five.once("modeChange",e),()=>{this.five.off("gesture",e),this.five.once("modeChange",e)}}async getPlayPromise(e,n){var s;const o=e.data;if(n.duration=(s=n==null?void 0:n.duration)!=null?s:e.start!==void 0&&e.end!==void 0?e.end-e.start:void 0,!!o)return new Promise((r,a)=>{let l=!1;this.addInterruptListener(()=>{if(!l)return this.hooks.emit("broke"),this.privateState.broke=!0,this.setState({playing:!1}),l=!0,a(new Error("play is interupted"))});try{if(l)return;const c=()=>{r(),l=!0};switch(o.effect){case"Move":this.move(o,n).then(c);break;case"Rotate":this.rotate(o,n).then(c);break;default:this.rotate(o,n).then(c)}}catch{}})}async actionPromiseQueue(){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())}async move(e,n){if(e.mode&&e.mode!==this.five.currentMode)await this.changeMode(e);else if(e.panoIndex!==this.five.panoIndex)await this.changePano(e,n);else return Promise.resolve()}async rotate(e,n){if(e.mode&&e.mode!==this.five.currentMode)await this.changeMode({mode:e.mode,panoIndex:e.panoIndex});else if(e.panoIndex&&e.panoIndex!==this.five.panoIndex)return await this.changePano(e,n);await this.updateCamera(e,n==null?void 0:n.duration)}async updateCamera(e,n=800){const{five:o,privateState:s,state:r}=this;let a=n;const l=(()=>{var u,m;const h=(u=r.config)==null?void 0:u.speedConfig,f=(m=e.rotateSpeed)!=null?m:h==null?void 0:h.rotateSpeed;if((h==null?void 0:h.rotateSpeedUnit)===void 0)return f;if(f!==void 0)return h.rotateSpeedUnit==="rad/ms"?f:f/1e3})();if(l){const h=this.five.getCurrentState();a=ff(h,e)/l}s.currentPlayKeyframe&&(s.currentPlayKeyframe.originDuration=a);const c=this.getSpeededDuration(a);return new Promise(h=>{mf(()=>o.updateCamera(e,c)),setTimeout(()=>h(),c)})}async changePano(e,n){var h;const{five:o,privateState:s,state:r}=this;if(typeof e.panoIndex!="number"||e.panoIndex===o.panoIndex)return;let a=(h=n==null?void 0:n.duration)!=null?h:800;const l=(()=>{var m,g;const f=(m=r.config)==null?void 0:m.speedConfig,u=(g=e.moveSpeed)!=null?g:f==null?void 0:f.moveSpeed;if((f==null?void 0:f.moveSpeedUnit)===void 0)return u;if(u!==void 0)return f.moveSpeedUnit==="m/ms"?u:u/1e3})();if(l&&typeof o.panoIndex=="number"&&typeof e.panoIndex=="number"){const f=o.work.observers[o.panoIndex].position,u=o.work.observers[e.panoIndex].position;a=f.distanceTo(u)/l}s.currentPlayKeyframe&&(s.currentPlayKeyframe.originDuration=a);const c=this.getSpeededDuration(a);return new Promise(f=>{var u,m,g;o.moveToPano(e.panoIndex,{latitude:e.latitude,longitude:e.longitude,fov:e.fov,duration:c,effect:(g=(m=n==null?void 0:n.moveEffect)!=null?m:(u=this.state.config)==null?void 0:u.moveEffect)!=null?g:e.moveEffect,moveCancelCallback:()=>f(),moveEndCallback:()=>f()})})}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{}}getSpeededDuration(e){return e/this.state.speed}getProgress(){return this.five.controller.cameraMotion.progress}async changeMode(e,n){e.mode&&e.mode!==this.five.currentMode&&await this.five.changeMode(e.mode,e,n)}forceInteruptUpdateCamera(){this.five.updateCamera({},0)}getPauseData(){var e,n;if((e=this.data)!=null&&e.keyframesId)return vi.get((n=this.data)==null?void 0:n.keyframesId)}setPauseData(){var e,n,o,s;if((e=this.data)!=null&&e.keyframesId)return vi.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 vi.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&&Af()}async waitFiveLoaded(){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-vf(1,n.startVelocity,n.duration,o)})}setFiveOriginUpdateCamera(){!this.privateState.fiveOriginGetProgress||(this.five.controller.cameraMotion.getProgress=this.privateState.fiveOriginGetProgress)}}d(Xi,"PluginVersion",gr);const Pf=i=>new Xi(i);exports.CSS3DRenderPlugin=Xn;exports.CameraMovementEffect=Js;exports.CameraMovementPlugin=yh;exports.CruisePlugin=Pf;exports.CruisePluginController=Xi;exports.DIRECTION=jt;exports.DISPLAY_STRATEGY_TYPE=Et;exports.FLOOR_PLAN_ATTACHED_TO=gt;exports.FLOOR_TYPE_MAP=ch;exports.GuideLinePlugin=pr;exports.ITEM_LABEL_PLUGIN_DISPLAY_STRATEGY_TYPE=It;exports.ItemLabelPlugin=Md;exports.Magnifier=$s;exports.MapviewFloorplanPlugin=Gc;exports.ModelChassisCompassPlugin=dh;exports.ModelEntryDoorGuidePlugin=ph;exports.ModelFloorplanPlugin=Nc;exports.ModelItemLabelPlugin=dd;exports.ModelRoomLabelPlugin=Ja;exports.ModelTVVideoPlugin=pd;exports.ModelViewPlugin=$r;exports.PaintBrush=_r;exports.PaintBrushTypeEnum=ht;exports.PanoCompassPlugin=Qh;exports.PanoCursorRaycasterPlugin=pa;exports.PanoDoorLabelPlugin=Yd;exports.PanoFloorplanRadarPlugin=ah;exports.PanoMeasurePlugin=Fu;exports.PanoRulerPlugin=xh;exports.PanoRulerProPlugin=Rh;exports.PanoSpatialTagPlugin=td;exports.ROOM_FETILE_TYPE_MAP=lh;exports.ROOM_TYPE_MAP=hh;exports.Rotation=et;exports.TopviewFloorplanPlugin=Qc;exports.itemLabelPluginServerParams=Sd;exports.modelItemLabelPluginServerParams=fd;exports.modelRoomLabelPluginServerParams=Ua;
|