@bimdata/viewer 2.14.0-beta.2 → 2.14.0-beta.3

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.
@@ -5526,7 +5526,7 @@ void main() {
5526
5526
  `,this.viewer.addEventListener(oa.type,this),this.__updateContent(),this.hide()}destroy(){this.viewer.removeEventListener(oa.type,this),super.destroy()}handleEvent(t){t instanceof oa&&t.containsOptions("loadingImg","loadingTxt","lang")&&this.__updateContent()}setProgress(t){this.container.classList.remove("psv-loader--undefined");const e=oo.clamp(t,0,99.999)/100*Math.PI*2,i=this.size/2,o=i,n=this.thickness/2+this.border,r=(this.size-this.thickness)/2-this.border,a=Math.sin(e)*r+i,s=-Math.cos(e)*r+i,l=t>50?"1":"0";this.canvas.querySelector("path").setAttributeNS(null,"d",`M ${o} ${n} A ${r} ${r} 0 ${l} 1 ${a} ${s}`)}showUndefined(){this.show(),this.setProgress(25),this.container.classList.add("psv-loader--undefined")}__updateContent(){const t=this.loader.querySelector(".psv-loader-image, .psv-loader-text");t&&this.loader.removeChild(t);let e;if(this.viewer.config.loadingImg?(e=document.createElement("img"),e.className="psv-loader-image",e.src=this.viewer.config.loadingImg):this.viewer.config.loadingTxt!==null&&(e=document.createElement("div"),e.className="psv-loader-text",e.innerHTML=this.viewer.config.loadingTxt||this.viewer.config.lang.loading),e){const i=Math.round(Math.sqrt(2*Math.pow(this.size/2-this.thickness/2-this.border,2)));e.style.maxWidth=i+"px",e.style.maxHeight=i+"px",this.loader.appendChild(e)}}},rpi=class extends Uh{constructor(t){super(t,{className:"psv-notification"}),this.state={visible:!1,contentId:null,timeout:null},this.content=document.createElement("div"),this.content.className="psv-notification-content",this.container.appendChild(this.content),this.content.addEventListener("click",()=>this.hide())}isVisible(t){return this.state.visible&&(!t||!this.state.contentId||this.state.contentId===t)}toggle(){throw new $i("Notification cannot be toggled")}show(t){this.state.timeout&&(clearTimeout(this.state.timeout),this.state.timeout=null),typeof t=="string"&&(t={content:t}),this.state.contentId=t.id||null,this.content.innerHTML=t.content,this.container.classList.add("psv-notification--visible"),this.state.visible=!0,this.viewer.dispatchEvent(new d4(this.state.contentId)),t.timeout&&(this.state.timeout=setTimeout(()=>this.hide(this.state.contentId),t.timeout))}hide(t){if(this.isVisible(t)){const e=this.state.contentId;this.container.classList.remove("psv-notification--visible"),this.state.visible=!1,this.state.contentId=null,this.viewer.dispatchEvent(new a4(e))}}},npi=class extends Uh{constructor(t){super(t,{className:`psv-overlay ${t4}`}),this.state={visible:!1,contentId:null,dismissible:!0},this.image=document.createElement("div"),this.image.className="psv-overlay-image",this.container.appendChild(this.image),this.title=document.createElement("div"),this.title.className="psv-overlay-title",this.container.appendChild(this.title),this.text=document.createElement("div"),this.text.className="psv-overlay-text",this.container.appendChild(this.text),this.container.addEventListener("click",this),this.viewer.addEventListener(ru.type,this),super.hide()}destroy(){this.viewer.removeEventListener(ru.type,this),super.destroy()}handleEvent(t){t.type==="click"?this.isVisible()&&this.state.dismissible&&(this.hide(),t.stopPropagation()):t instanceof ru&&this.isVisible()&&this.state.dismissible&&t.matches(Sr.Escape)&&(this.hide(),t.preventDefault())}isVisible(t){return this.state.visible&&(!t||!this.state.contentId||this.state.contentId===t)}toggle(){throw new $i("Overlay cannot be toggled")}show(t){typeof t=="string"&&(t={title:t}),this.state.contentId=t.id||null,this.state.dismissible=t.dismissible!==!1,this.image.innerHTML=t.image||"",this.title.innerHTML=t.title||"",this.text.innerHTML=t.text||"",super.show(),this.viewer.dispatchEvent(new Oue(this.state.contentId))}hide(t){if(this.isVisible(t)){const e=this.state.contentId;super.hide(),this.state.contentId=null,this.viewer.dispatchEvent(new gue(e))}}},api=200,zR="psv-panel-content--no-interaction",spi=class extends Uh{constructor(t){super(t,{className:`psv-panel ${t4}`}),this.state={visible:!1,contentId:null,mouseX:0,mouseY:0,mousedown:!1,clickHandler:null,keyHandler:null,width:{}};const e=document.createElement("div");e.className="psv-panel-resizer",this.container.appendChild(e);const i=document.createElement("div");i.className="psv-panel-close-button",i.innerHTML=Ts.close,i.title=t.config.lang.close,this.container.appendChild(i),this.content=document.createElement("div"),this.content.className="psv-panel-content",this.container.appendChild(this.content),i.addEventListener("click",()=>this.hide()),e.addEventListener("mousedown",this),e.addEventListener("touchstart",this),this.viewer.container.addEventListener("mouseup",this),this.viewer.container.addEventListener("touchend",this),this.viewer.container.addEventListener("mousemove",this),this.viewer.container.addEventListener("touchmove",this),this.viewer.addEventListener(ru.type,this)}destroy(){this.viewer.removeEventListener(ru.type,this),this.viewer.container.removeEventListener("mousemove",this),this.viewer.container.removeEventListener("touchmove",this),this.viewer.container.removeEventListener("mouseup",this),this.viewer.container.removeEventListener("touchend",this),super.destroy()}handleEvent(t){switch(t.type){case"mousedown":this.__onMouseDown(t);break;case"touchstart":this.__onTouchStart(t);break;case"mousemove":this.__onMouseMove(t);break;case"touchmove":this.__onTouchMove(t);break;case"mouseup":this.__onMouseUp(t);break;case"touchend":this.__onTouchEnd(t);break;case ru.type:this.__onKeyPress(t);break}}isVisible(t){return this.state.visible&&(!t||!this.state.contentId||this.state.contentId===t)}toggle(){throw new $i("Panel cannot be toggled")}show(t){typeof t=="string"&&(t={content:t});const e=this.isVisible(t.id);this.state.contentId=t.id||null,this.state.visible=!0,this.state.clickHandler&&(this.content.removeEventListener("click",this.state.clickHandler),this.content.removeEventListener("keydown",this.state.keyHandler),this.state.clickHandler=null,this.state.keyHandler=null),t.id&&this.state.width[t.id]?this.container.style.width=this.state.width[t.id]:t.width?this.container.style.width=t.width:this.container.style.width=null,this.content.innerHTML=t.content,this.content.scrollTop=0,this.container.classList.add("psv-panel--open"),gb(this.content,"psv-panel-content--no-margin",t.noMargin===!0),t.clickHandler&&(this.state.clickHandler=i=>{t.clickHandler(mb(i))},this.state.keyHandler=i=>{i.key===Sr.Enter&&t.clickHandler(mb(i))},this.content.addEventListener("click",this.state.clickHandler),this.content.addEventListener("keydown",this.state.keyHandler),e||setTimeout(()=>{this.content.querySelector("a,button,[tabindex]")?.focus()},300)),this.viewer.dispatchEvent(new nu(this.state.contentId))}hide(t){if(this.isVisible(t)){const e=this.state.contentId;this.state.visible=!1,this.state.contentId=null,this.content.innerHTML=null,this.container.classList.remove("psv-panel--open"),this.state.clickHandler&&(this.content.removeEventListener("click",this.state.clickHandler),this.content.removeEventListener("keydown",this.state.keyHandler),this.state.clickHandler=null,this.state.keyHandler=null),this.viewer.dispatchEvent(new ou(e))}}__onMouseDown(t){t.stopPropagation(),this.__startResize(t.clientX,t.clientY)}__onTouchStart(t){if(t.stopPropagation(),t.touches.length===1){const e=t.touches[0];this.__startResize(e.clientX,e.clientY)}}__onMouseUp(t){this.state.mousedown&&(t.stopPropagation(),this.state.mousedown=!1,this.content.classList.remove(zR))}__onTouchEnd(t){this.state.mousedown&&(t.stopPropagation(),t.touches.length===0&&(this.state.mousedown=!1,this.content.classList.remove(zR)))}__onMouseMove(t){this.state.mousedown&&(t.stopPropagation(),this.__resize(t.clientX,t.clientY))}__onTouchMove(t){if(this.state.mousedown){const e=t.touches[0];this.__resize(e.clientX,e.clientY)}}__onKeyPress(t){this.isVisible()&&t.matches(Sr.Escape)&&(this.hide(),t.preventDefault())}__startResize(t,e){this.state.mouseX=t,this.state.mouseY=e,this.state.mousedown=!0,this.content.classList.add(zR)}__resize(t,e){const i=t,o=e,n=Math.max(api,this.container.offsetWidth-(i-this.state.mouseX))+"px";this.state.contentId&&(this.state.width[this.state.contentId]=n),this.container.style.width=n,this.state.mouseX=i,this.state.mouseY=o}},lpi=class extends Uh{constructor(t,e){super(t,{className:"psv-tooltip"}),this.state={visible:!0,arrow:0,border:0,state:0,width:0,height:0,pos:"",config:null,data:null,hideTimeout:null},this.content=document.createElement("div"),this.content.className="psv-tooltip-content",this.container.appendChild(this.content),this.arrow=document.createElement("div"),this.arrow.className="psv-tooltip-arrow",this.container.appendChild(this.arrow),this.container.addEventListener("transitionend",this),this.container.addEventListener("touchdown",i=>i.stopPropagation()),this.container.addEventListener("mousedown",i=>i.stopPropagation()),this.container.style.top="-1000px",this.container.style.left="-1000px",this.show(e)}handleEvent(t){t.type==="transitionend"&&this.__onTransitionEnd(t)}destroy(){clearTimeout(this.state.hideTimeout),delete this.state.data,super.destroy()}toggle(){throw new $i("Tooltip cannot be toggled")}show(t){if(this.state.state!==0)throw new $i("Initialized tooltip cannot be re-initialized");t.className&&xR(this.container,t.className),t.style&&Object.assign(this.container.style,t.style),this.state.state=3,this.update(t.content,t),this.state.data=t.data,this.state.state=1,this.viewer.dispatchEvent(new jue(this,this.state.data)),this.__waitImages()}update(t,e){this.content.innerHTML=t;const i=this.container.getBoundingClientRect();this.state.width=i.right-i.left,this.state.height=i.bottom-i.top,this.state.arrow=parseInt(vl(this.arrow,"border-top-width"),10),this.state.border=parseInt(vl(this.container,"border-top-left-radius"),10),this.move(e??this.state.config),this.__waitImages()}move(t){if(this.state.state!==1&&this.state.state!==3)throw new $i("Uninitialized tooltip cannot be moved");t.box=t.box??this.state.config?.box??{width:0,height:0},this.state.config=t;const e=this.container,i=this.arrow,o={posClass:Jde(t.position,{allowCenter:!1,cssOrder:!1})||["top","center"],width:this.state.width,height:this.state.height,top:0,left:0,arrowTop:0,arrowLeft:0};this.__computeTooltipPosition(o,t);let n=null,r=null;if(o.top<0?n="bottom":o.top+o.height>this.viewer.state.size.height&&(n="top"),o.left<0?r="right":o.left+o.width>this.viewer.state.size.width&&(r="left"),r||n){const s=SR(o.posClass);n&&(o.posClass[s?0:1]=n),r&&(o.posClass[s?1:0]=r),this.__computeTooltipPosition(o,t)}e.style.top=o.top+"px",e.style.left=o.left+"px",i.style.top=o.arrowTop+"px",i.style.left=o.arrowLeft+"px";const a=o.posClass.join("-");a!==this.state.pos&&(e.classList.remove(`psv-tooltip--${this.state.pos}`),this.state.pos=a,e.classList.add(`psv-tooltip--${this.state.pos}`))}hide(){this.container.classList.remove("psv-tooltip--visible"),this.state.state=2,this.viewer.dispatchEvent(new yue(this.state.data));const t=parseFloat(vl(this.container,"transition-duration"));this.state.hideTimeout=setTimeout(()=>{this.destroy()},t*2)}__onTransitionEnd(t){if(t.propertyName==="transform")switch(this.state.state){case 1:this.container.classList.add("psv-tooltip--visible"),this.state.state=3;break;case 2:this.state.state=0,this.destroy();break}}__computeTooltipPosition(t,e){const i=this.state.arrow,o=e.top,n=t.height,r=e.left,a=t.width,s=i+this.state.border,l=e.box.width/2+i*2,c=e.box.height/2+i*2;switch(t.posClass.join("-")){case"top-left":t.top=o-c-n,t.left=r+s-a,t.arrowTop=n,t.arrowLeft=a-s-i;break;case"top-center":t.top=o-c-n,t.left=r-a/2,t.arrowTop=n,t.arrowLeft=a/2-i;break;case"top-right":t.top=o-c-n,t.left=r-s,t.arrowTop=n,t.arrowLeft=i;break;case"bottom-left":t.top=o+c,t.left=r+s-a,t.arrowTop=-i*2,t.arrowLeft=a-s-i;break;case"bottom-center":t.top=o+c,t.left=r-a/2,t.arrowTop=-i*2,t.arrowLeft=a/2-i;break;case"bottom-right":t.top=o+c,t.left=r-s,t.arrowTop=-i*2,t.arrowLeft=i;break;case"left-top":t.top=o+s-n,t.left=r-l-a,t.arrowTop=n-s-i,t.arrowLeft=a;break;case"center-left":t.top=o-n/2,t.left=r-l-a,t.arrowTop=n/2-i,t.arrowLeft=a;break;case"left-bottom":t.top=o-s,t.left=r-l-a,t.arrowTop=i,t.arrowLeft=a;break;case"right-top":t.top=o+s-n,t.left=r+l,t.arrowTop=n-s-i,t.arrowLeft=-i*2;break;case"center-right":t.top=o-n/2,t.left=r+l,t.arrowTop=n/2-i,t.arrowLeft=-i*2;break;case"right-bottom":t.top=o-s,t.left=r+l,t.arrowTop=i,t.arrowLeft=-i*2;break}}__waitImages(){const t=this.content.querySelectorAll("img");if(t.length>0){const e=[];t.forEach(i=>{i.complete||e.push(new Promise(o=>{i.onload=o,i.onerror=o}))}),e.length&&Promise.all(e).then(()=>{if(this.state.state===1||this.state.state===3){const i=this.container.getBoundingClientRect();this.state.width=i.right-i.left,this.state.height=i.bottom-i.top,this.move(this.state.config)}})}}},cpi=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="15 15 70 70"><path fill="currentColor" d="M50,16.2c-18.6,0-33.8,15.1-33.8,33.8S31.4,83.7,50,83.7S83.8,68.6,83.8,50S68.6,16.2,50,16.2z M50,80.2c-16.7,0-30.2-13.6-30.2-30.2S33.3,19.7,50,19.7S80.3,33.3,80.3,50S66.7,80.2,50,80.2z"/><rect fill="currentColor" x="48" y="31.7" width="4" height="28"/><rect fill="currentColor" x="48" y="63.2" width="4" height="5"/><!--Created by Shastry from the Noun Project--></svg>
5527
5527
  `,g4=class{constructor(t){this.viewer=t,this.config=t.config,this.state=t.state}destroy(){}},Rs=new it,Sb=new Ml(0,0,0,"ZXY"),dpi=class extends g4{constructor(t){super(t)}fovToZoomLevel(t){const e=Math.round((t-this.config.minFov)/(this.config.maxFov-this.config.minFov)*100);return oo.clamp(e-2*(e-50),0,100)}zoomLevelToFov(t){return this.config.maxFov+t/100*(this.config.minFov-this.config.maxFov)}vFovToHFov(t){return oo.radToDeg(2*Math.atan(Math.tan(oo.degToRad(t)/2)*this.state.aspect))}hFovToVFov(t){return oo.radToDeg(2*Math.atan(Math.tan(oo.degToRad(t)/2)/this.state.aspect))}getAnimationProperties(t,e,i){const o=!Tr(e),n=!Tr(i),r={};let a=null;if(o){const s=this.viewer.getPosition(),l=Tde(s.yaw,e.yaw);r.yaw={start:s.yaw,end:s.yaw+l},r.pitch={start:s.pitch,end:e.pitch},a=TR(t,Rde(s,e))}if(n){const s=this.viewer.getZoomLevel(),l=Math.abs(i-s);r.zoom={start:s,end:i},a===null&&(a=TR(t,Math.PI/4*l/100))}return a===null?typeof t=="number"?a=t:a=CR:a=Math.max(CR,a),{duration:a,properties:r}}getTransitionOptions(t){let e;const i=this.config.defaultTransition??F2.defaultTransition;return t.transition===!1||t.transition===null?e=null:t.transition===!0?e={...i}:typeof t.transition=="object"?e={...i,...t.transition}:e=this.config.defaultTransition,e}textureCoordsToSphericalCoords(t){if(!this.state.textureData?.panoData)throw new $i("Current adapter does not support texture coordinates or no texture has been loaded");const e=this.viewer.adapter.textureCoordsToSphericalCoords(t,this.state.textureData.panoData);return!Sb.equals(this.viewer.renderer.panoramaPose)||!Sb.equals(this.viewer.renderer.sphereCorrection)?(this.sphericalCoordsToVector3(e,Rs),Rs.applyEuler(this.viewer.renderer.panoramaPose),Rs.applyEuler(this.viewer.renderer.sphereCorrection),this.vector3ToSphericalCoords(Rs)):e}sphericalCoordsToTextureCoords(t){if(!this.state.textureData?.panoData)throw new $i("Current adapter does not support texture coordinates or no texture has been loaded");return(!Sb.equals(this.viewer.renderer.panoramaPose)||!Sb.equals(this.viewer.renderer.sphereCorrection))&&(this.sphericalCoordsToVector3(t,Rs),DR(Rs,this.viewer.renderer.sphereCorrection),DR(Rs,this.viewer.renderer.panoramaPose),t=this.vector3ToSphericalCoords(Rs)),this.viewer.adapter.sphericalCoordsToTextureCoords(t,this.state.textureData.panoData)}sphericalCoordsToVector3(t,e,i=Oh){return e||(e=new it),e.x=i*-Math.cos(t.pitch)*Math.sin(t.yaw),e.y=i*Math.sin(t.pitch),e.z=i*Math.cos(t.pitch)*Math.cos(t.yaw),e}vector3ToSphericalCoords(t){const e=Math.acos(t.y/Math.sqrt(t.x*t.x+t.y*t.y+t.z*t.z)),i=Math.atan2(t.x,t.z);return{yaw:i<0?-i:Math.PI*2-i,pitch:Math.PI/2-e}}viewerCoordsToVector3(t){const e=this.viewer.renderer.getIntersections(t).filter(i=>i.object.userData[tu]);return e.length?e[0].point:null}viewerCoordsToSphericalCoords(t){const e=this.viewerCoordsToVector3(t);return e?this.vector3ToSphericalCoords(e):null}vector3ToViewerCoords(t){const e=t.clone();return e.project(this.viewer.renderer.camera),{x:Math.round((e.x+1)/2*this.state.size.width),y:Math.round((1-e.y)/2*this.state.size.height)}}sphericalCoordsToViewerCoords(t){return this.sphericalCoordsToVector3(t,Rs),this.vector3ToViewerCoords(Rs)}isPointVisible(t){let e,i;if(t instanceof it)e=t,i=this.vector3ToViewerCoords(t);else if(IR(t))e=this.sphericalCoordsToVector3(t,Rs),i=this.vector3ToViewerCoords(e);else return!1;return e.dot(this.viewer.state.direction)>0&&i.x>=0&&i.x<=this.viewer.state.size.width&&i.y>=0&&i.y<=this.viewer.state.size.height}cleanPosition(t){if("yaw"in t||"pitch"in t){if(!("yaw"in t)||!("pitch"in t))throw new $i("Position is missing 'yaw' or 'pitch'");return{yaw:yl(t.yaw),pitch:yl(t.pitch,!0)}}else return this.textureCoordsToSphericalCoords(t)}cleanSphereCorrection(t){return{pan:yl(t?.pan||0),tilt:yl(t?.tilt||0,!0),roll:yl(t?.roll||0,!0,!1)}}cleanPanoramaPose(t){return{pan:oo.degToRad(t?.poseHeading||0),tilt:oo.degToRad(t?.posePitch||0),roll:oo.degToRad(t?.poseRoll||0)}}cleanPanoramaOptions(t,e){return e?.isEquirectangular&&(Tr(t.zoom)&&!Tr(e.initialFov)&&(t={...t,zoom:this.fovToZoomLevel(this.hFovToVFov(e.initialFov))}),Tr(t.position)&&!Tr(e.initialHeading)&&!Tr(e.initialPitch)&&(t={...t,position:{yaw:yl(e.initialHeading),pitch:yl(e.initialPitch,!0)}})),t}},upi=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path fill="currentColor" d="M33.38 33.2a1.96 1.96 0 0 0 1.5-3.23 10.61 10.61 0 0 1 7.18-17.51c.7-.06 1.31-.49 1.61-1.12a13.02 13.02 0 0 1 11.74-7.43c7.14 0 12.96 5.8 12.96 12.9 0 3.07-1.1 6.05-3.1 8.38-.7.82-.61 2.05.21 2.76.83.7 2.07.6 2.78-.22a16.77 16.77 0 0 0 4.04-10.91C72.3 7.54 64.72 0 55.4 0a16.98 16.98 0 0 0-14.79 8.7 14.6 14.6 0 0 0-12.23 14.36c0 3.46 1.25 6.82 3.5 9.45.4.45.94.69 1.5.69m45.74 43.55a22.13 22.13 0 0 1-5.23 12.4c-4 4.55-9.53 6.86-16.42 6.86-12.6 0-20.1-10.8-20.17-10.91a1.82 1.82 0 0 0-.08-.1c-5.3-6.83-14.55-23.82-17.27-28.87-.05-.1 0-.21.02-.23a6.3 6.3 0 0 1 8.24 1.85l9.38 12.59a1.97 1.97 0 0 0 3.54-1.17V25.34a4 4 0 0 1 1.19-2.87 3.32 3.32 0 0 1 2.4-.95c1.88.05 3.4 1.82 3.4 3.94v24.32a1.96 1.96 0 0 0 3.93 0v-33.1a3.5 3.5 0 0 1 7 0v35.39a1.96 1.96 0 0 0 3.93 0v-.44c.05-2.05 1.6-3.7 3.49-3.7 1.93 0 3.5 1.7 3.5 3.82v5.63c0 .24.04.48.13.71l.1.26a1.97 1.97 0 0 0 3.76-.37c.33-1.78 1.77-3.07 3.43-3.07 1.9 0 3.45 1.67 3.5 3.74l-1.77 18.1zM77.39 51c-1.25 0-2.45.32-3.5.9v-.15c0-4.27-3.33-7.74-7.42-7.74-1.26 0-2.45.33-3.5.9V16.69a7.42 7.42 0 0 0-14.85 0v1.86a7 7 0 0 0-3.28-.94 7.21 7.21 0 0 0-5.26 2.07 7.92 7.92 0 0 0-2.38 5.67v37.9l-5.83-7.82a10.2 10.2 0 0 0-13.35-2.92 4.1 4.1 0 0 0-1.53 5.48C20 64.52 28.74 80.45 34.07 87.34c.72 1.04 9.02 12.59 23.4 12.59 7.96 0 14.66-2.84 19.38-8.2a26.06 26.06 0 0 0 6.18-14.6l1.78-18.2v-.2c0-4.26-3.32-7.73-7.42-7.73z"/><!--Created by AomAm from the Noun Project--></svg>
5528
5528
  `,hpi=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="10 17 79 79"><path fill="currentColor" d="M38.1 29.27c-.24 0-.44.2-.44.45v10.7a.45.45 0 00.9 0v-10.7c0-.25-.2-.45-.45-.45zm10.2 26.66a11.54 11.54 0 01-8.48-6.14.45.45 0 10-.8.41 12.45 12.45 0 009.22 6.62.45.45 0 00.07-.9zm24.55-13.08a23.04 23.04 0 00-22.56-23v7.07l-.01.05a2.83 2.83 0 012.39 2.78v14.03l.09-.02h8.84v-9.22a.45.45 0 11.9 0v9.22h10.35v-.9zm0 27.33V44.66H62.5c-.02 2.01-.52 4-1.47 5.76a.45.45 0 01-.61.18.45.45 0 01-.19-.61 11.54 11.54 0 001.36-5.33h-8.83l-.1-.01a2.83 2.83 0 01-2.83 2.84h-.04-.04a2.83 2.83 0 01-2.83-2.83v-14.9a2.82 2.82 0 012.47-2.8v-7.11a23.04 23.04 0 00-22.57 23v.91h14.72V29.88a8.2 8.2 0 015.02-7.57c.22-.1.5.01.59.24.1.23-.01.5-.24.6a7.3 7.3 0 00-4.47 6.73v13.88h3.9a.45.45 0 110 .9h-3.9v.15a7.32 7.32 0 0011.23 6.17.45.45 0 01.49.76 8.22 8.22 0 01-12.62-6.93v-.15H26.82v25.52a23.04 23.04 0 0023.01 23.01 23.04 23.04 0 0023.02-23.01zm1.8-27.33v27.33A24.85 24.85 0 0149.84 95a24.85 24.85 0 01-24.82-24.82V42.85a24.85 24.85 0 0124.82-24.82 24.85 24.85 0 0124.83 24.82zM57.98 29.88v9.36a.45.45 0 11-.9 0v-9.36a7.28 7.28 0 00-3.4-6.17.45.45 0 01.49-.76 8.18 8.18 0 013.8 6.93z"/><!-- Created by Icon Island from the Noun Project --></svg>
5529
- `,Tb=class tAe{constructor(){this.$=tAe.IDLE}is(...e){return e.some(i=>this.$&i)}set(e){this.$=e}add(e){this.$|=e}remove(e){this.$&=~e}};Tb.IDLE=0,Tb.CLICK=1,Tb.MOVING=2;var pr=Tb,ppi=class extends g4{constructor(t){super(t),this.data={startMouseX:0,startMouseY:0,mouseX:0,mouseY:0,pinchDist:0,moveDelta:{yaw:0,pitch:0,zoom:0},accumulatorFactor:0,ctrlKeyDown:!1,dblclickData:null,dblclickTimeout:null,longtouchTimeout:null,twofingersTimeout:null,ctrlZoomTimeout:null},this.step=new pr,this.keyHandler=new Mb,this.resizeObserver=new ResizeObserver(jde(()=>this.viewer.autoSize(),50)),this.moveThreshold=xde*Fn.pixelRatio}init(){window.addEventListener("keydown",this,{passive:!1}),window.addEventListener("keyup",this),this.viewer.container.addEventListener("mousedown",this),window.addEventListener("mousemove",this,{passive:!1}),window.addEventListener("mouseup",this),this.viewer.container.addEventListener("touchstart",this,{passive:!1}),window.addEventListener("touchmove",this,{passive:!1}),window.addEventListener("touchend",this,{passive:!1}),this.viewer.container.addEventListener("wheel",this,{passive:!1}),document.addEventListener("fullscreenchange",this),this.resizeObserver.observe(this.viewer.container),this.viewer.addEventListener(r4.type,this),this.viewer.addEventListener(h4.type,this)}destroy(){window.removeEventListener("keydown",this),window.removeEventListener("keyup",this),this.viewer.container.removeEventListener("mousedown",this),window.removeEventListener("mousemove",this),window.removeEventListener("mouseup",this),this.viewer.container.removeEventListener("touchstart",this),window.removeEventListener("touchmove",this),window.removeEventListener("touchend",this),this.viewer.container.removeEventListener("wheel",this),document.removeEventListener("fullscreenchange",this),this.resizeObserver.disconnect(),this.viewer.removeEventListener(r4.type,this),this.viewer.removeEventListener(h4.type,this),clearTimeout(this.data.dblclickTimeout),clearTimeout(this.data.longtouchTimeout),clearTimeout(this.data.twofingersTimeout),clearTimeout(this.data.ctrlZoomTimeout),super.destroy()}handleEvent(t){switch(t.type){case"keydown":this.__onKeyDown(t);break;case"keyup":this.__onKeyUp();break;case"mousemove":this.__onMouseMove(t);break;case"mouseup":this.__onMouseUp(t);break;case"touchmove":this.__onTouchMove(t);break;case"touchend":this.__onTouchEnd(t);break;case"fullscreenchange":this.__onFullscreenChange();break;case r4.type:this.__applyMoveDelta();break;case h4.type:this.__clearMoveDelta();break}if(!_de(t,"."+t4))switch(t.type){case"mousedown":this.__onMouseDown(t);break;case"touchstart":this.__onTouchStart(t);break;case"wheel":this.__onMouseWheel(t);break}}__onKeyDown(t){if(this.config.mousewheelCtrlKey&&(this.data.ctrlKeyDown=t.key===Sr.Control,this.data.ctrlKeyDown&&(clearTimeout(this.data.ctrlZoomTimeout),this.viewer.overlay.hide(Gr.CTRL_ZOOM))),!!this.viewer.dispatchEvent(new ru(t.key,t))&&!(!this.state.keyboardEnabled||!this.config.keyboardActions||this.keyHandler.pending)){for(const[e,i]of Object.entries(this.config.keyboardActions))if(MR(t,e)){if(typeof i=="function")i(this.viewer,t);else{switch(i!=="ZOOM_IN"&&i!=="ZOOM_OUT"&&this.viewer.stopAll(),i){case"ROTATE_UP":this.viewer.dynamics.position.roll({pitch:!1});break;case"ROTATE_DOWN":this.viewer.dynamics.position.roll({pitch:!0});break;case"ROTATE_RIGHT":this.viewer.dynamics.position.roll({yaw:!1});break;case"ROTATE_LEFT":this.viewer.dynamics.position.roll({yaw:!0});break;case"ZOOM_IN":this.viewer.dynamics.zoom.roll(!1);break;case"ZOOM_OUT":this.viewer.dynamics.zoom.roll(!0);break}this.keyHandler.down(i)}t.preventDefault();return}}}__onKeyUp(){this.data.ctrlKeyDown=!1,this.state.keyboardEnabled&&this.keyHandler.up(t=>{t==="ZOOM_IN"||t==="ZOOM_OUT"?this.viewer.dynamics.zoom.stop():(this.viewer.dynamics.position.stop(),this.viewer.resetIdleTimer())})}__onMouseDown(t){this.step.add(pr.CLICK),this.data.startMouseX=t.clientX,this.data.startMouseY=t.clientY,this.config.mousemove&&t.preventDefault()}__onMouseUp(t){this.step.is(pr.CLICK,pr.MOVING)&&this.__stopMove(t.clientX,t.clientY,t,t.button===2)}__onMouseMove(t){this.config.mousemove&&this.step.is(pr.CLICK,pr.MOVING)&&(t.preventDefault(),this.__doMove(t.clientX,t.clientY)),this.__handleObjectsEvents(t)}__onTouchStart(t){t.touches.length===1?(this.step.add(pr.CLICK),this.data.startMouseX=t.touches[0].clientX,this.data.startMouseY=t.touches[0].clientY,this.data.longtouchTimeout||(this.data.longtouchTimeout=setTimeout(()=>{const e=t.touches[0];this.__stopMove(e.clientX,e.clientY,t,!0),this.data.longtouchTimeout=null},Mde))):t.touches.length===2&&(this.step.set(pr.IDLE),this.__cancelLongTouch(),this.config.mousemove&&(this.__cancelTwoFingersOverlay(),this.__startMoveZoom(t),t.preventDefault()))}__onTouchEnd(t){if(this.__cancelLongTouch(),this.step.is(pr.CLICK,pr.MOVING)){if(t.preventDefault(),this.__cancelTwoFingersOverlay(),t.touches.length===1)this.__stopMove(this.data.mouseX,this.data.mouseY);else if(t.touches.length===0){const e=t.changedTouches[0];this.__stopMove(e.clientX,e.clientY,t)}}}__onTouchMove(t){if(this.__cancelLongTouch(),!!this.config.mousemove)if(t.touches.length===1){if(this.config.touchmoveTwoFingers)this.step.is(pr.CLICK)&&!this.data.twofingersTimeout&&(this.data.twofingersTimeout=setTimeout(()=>{this.viewer.overlay.show({id:Gr.TWO_FINGERS,image:upi,title:this.config.lang.twoFingers})},Bde));else if(this.step.is(pr.CLICK,pr.MOVING)){t.preventDefault();const e=t.touches[0];this.__doMove(e.clientX,e.clientY)}}else this.__doMoveZoom(t),this.__cancelTwoFingersOverlay()}__cancelLongTouch(){this.data.longtouchTimeout&&(clearTimeout(this.data.longtouchTimeout),this.data.longtouchTimeout=null)}__cancelTwoFingersOverlay(){this.config.touchmoveTwoFingers&&(this.data.twofingersTimeout&&(clearTimeout(this.data.twofingersTimeout),this.data.twofingersTimeout=null),this.viewer.overlay.hide(Gr.TWO_FINGERS))}__onMouseWheel(t){if(!this.config.mousewheel||!t.deltaY)return;if(this.config.mousewheelCtrlKey&&!this.data.ctrlKeyDown){this.viewer.overlay.show({id:Gr.CTRL_ZOOM,image:hpi,title:this.config.lang.ctrlZoom}),clearTimeout(this.data.ctrlZoomTimeout),this.data.ctrlZoomTimeout=setTimeout(()=>this.viewer.overlay.hide(Gr.CTRL_ZOOM),Ede);return}t.preventDefault(),t.stopPropagation();const e=t.deltaY/Math.abs(t.deltaY)*5*this.config.zoomSpeed;e!==0&&this.viewer.dynamics.zoom.step(-e,5)}__onFullscreenChange(){const t=this.viewer.isFullscreenEnabled();this.config.keyboard==="fullscreen"&&(t?this.viewer.startKeyboardControl():this.viewer.stopKeyboardControl()),this.viewer.dispatchEvent(new n4(t))}__resetMove(){this.step.set(pr.IDLE),this.data.mouseX=0,this.data.mouseY=0,this.data.startMouseX=0,this.data.startMouseY=0}__startMoveZoom(t){this.viewer.stopAll(),this.__resetMove();const e=kR(t);this.step.set(pr.MOVING),this.data.accumulatorFactor=this.config.moveInertia,{distance:this.data.pinchDist,center:{x:this.data.mouseX,y:this.data.mouseY}}=e}__stopMove(t,e,i,o=!1){this.step.is(pr.CLICK)&&!this.__moveThresholdReached(t,e)&&this.__doClick(t,e,i,o),this.config.moveInertia&&(this.data.accumulatorFactor=Math.pow(this.config.moveInertia,.5)),this.__resetMove(),this.viewer.resetIdleTimer()}__doClick(t,e,i,o=!1){const n=this.viewer.container.getBoundingClientRect(),r=t-n.left,a=e-n.top,s=this.viewer.renderer.getIntersections({x:r,y:a}),l=s.find(c=>c.object.userData[tu]);if(l){const c=this.viewer.dataHelper.vector3ToSphericalCoords(l.point),d={rightclick:o,originalEvent:i,target:mb(i),clientX:t,clientY:e,viewerX:r,viewerY:a,yaw:c.yaw,pitch:c.pitch,objects:s.map(u=>u.object).filter(u=>!u.userData[tu])};try{const u=this.viewer.dataHelper.sphericalCoordsToTextureCoords(d);Object.assign(d,u)}catch{}this.data.dblclickTimeout?(Math.abs(this.data.dblclickData.clientX-d.clientX)<this.moveThreshold&&Math.abs(this.data.dblclickData.clientY-d.clientY)<this.moveThreshold&&this.viewer.dispatchEvent(new hue(this.data.dblclickData)),clearTimeout(this.data.dblclickTimeout),this.data.dblclickTimeout=null,this.data.dblclickData=null):(this.viewer.dispatchEvent(new cue(d)),this.data.dblclickData=yb(d),this.data.dblclickTimeout=setTimeout(()=>{this.data.dblclickTimeout=null,this.data.dblclickData=null},kde))}}__handleObjectsEvents(t){if(!Vde(this.state.objectsObservers)&&t.composedPath().includes(this.viewer.container)){const e=Fde(this.viewer.container),i={x:t.clientX-e.x,y:t.clientY-e.y},o=this.viewer.renderer.getIntersections(i),n=(r,a,s)=>{this.viewer.dispatchEvent(new s(t,r,i,a))};for(const[r,a]of Object.entries(this.state.objectsObservers)){const s=o.find(l=>l.object.userData[r]);s?(a&&s.object!==a&&(n(a,r,FR),this.state.objectsObservers[r]=null),a?n(s.object,r,Jue):(this.state.objectsObservers[r]=s.object,n(s.object,r,Que))):a&&(n(a,r,FR),this.state.objectsObservers[r]=null)}}}__doMove(t,e){if(this.step.is(pr.CLICK)&&this.__moveThresholdReached(t,e))this.viewer.stopAll(),this.__resetMove(),this.step.set(pr.MOVING),this.data.mouseX=t,this.data.mouseY=e,this.data.accumulatorFactor=this.config.moveInertia;else if(this.step.is(pr.MOVING)){const i=(t-this.data.mouseX)*Math.cos(this.state.roll)-(e-this.data.mouseY)*Math.sin(this.state.roll),o=(e-this.data.mouseY)*Math.cos(this.state.roll)+(t-this.data.mouseX)*Math.sin(this.state.roll),n={yaw:this.config.moveSpeed*(i/this.state.size.width)*oo.degToRad(this.state.hFov),pitch:this.config.moveSpeed*(o/this.state.size.height)*oo.degToRad(this.state.vFov)};this.data.moveDelta.yaw+=n.yaw,this.data.moveDelta.pitch+=n.pitch,this.data.mouseX=t,this.data.mouseY=e}}__moveThresholdReached(t,e){return Math.abs(t-this.data.startMouseX)>=this.moveThreshold||Math.abs(e-this.data.startMouseY)>=this.moveThreshold}__doMoveZoom(t){if(this.step.is(pr.MOVING)){t.preventDefault();const e=kR(t);this.__doMove(e.center.x,e.center.y),this.data.moveDelta.zoom+=this.config.zoomSpeed*((e.distance-this.data.pinchDist)/Fn.pixelRatio),this.data.pinchDist=e.distance}}__applyMoveDelta(){if(Math.abs(this.data.moveDelta.yaw)>0||Math.abs(this.data.moveDelta.pitch)>0){const t=this.viewer.getPosition();this.viewer.rotate({yaw:t.yaw-this.data.moveDelta.yaw*(1-this.config.moveInertia),pitch:t.pitch+this.data.moveDelta.pitch*(1-this.config.moveInertia)}),this.data.moveDelta.yaw*=this.data.accumulatorFactor,this.data.moveDelta.pitch*=this.data.accumulatorFactor,Math.abs(this.data.moveDelta.yaw)<=.001&&(this.data.moveDelta.yaw=0),Math.abs(this.data.moveDelta.pitch)<=.001&&(this.data.moveDelta.pitch=0)}if(Math.abs(this.data.moveDelta.zoom)>0){const t=this.viewer.getZoomLevel();this.viewer.zoom(t+this.data.moveDelta.zoom*(1-this.config.moveInertia)),this.data.moveDelta.zoom*=this.config.moveInertia,Math.abs(this.data.moveDelta.zoom)<=.001&&(this.data.moveDelta.zoom=0)}}__clearMoveDelta(){this.data.moveDelta.yaw=0,this.data.moveDelta.pitch=0,this.data.moveDelta.zoom=0}};Li.enabled=!1;var Rb=new ro,lhe=new ar,che=new m2,fpi=class extends g4{constructor(t){super(t),this.frustumNeedsUpdate=!0,this.renderer=new xhi(this.config.rendererParameters),this.renderer.setPixelRatio(Fn.pixelRatio),this.renderer.outputColorSpace=Eh,this.renderer.toneMapping=tce,this.renderer.domElement.className="psv-canvas",this.renderer.domElement.style.background=this.config.canvasBackground,this.scene=new Vce,this.camera=new Xa(50,16/9,.1,2*Oh),this.camera.matrixAutoUpdate=!1;const e=new Ya(new F4(Oh).scale(-1,1,1),new X3({opacity:0,transparent:!0,depthTest:!1,depthWrite:!1}));e.userData={[tu]:!0},this.scene.add(e),this.raycaster=new jsi,this.frustum=new dR,this.container=document.createElement("div"),this.container.className="psv-canvas-container",this.container.appendChild(this.renderer.domElement),this.viewer.container.appendChild(this.container),this.container.addEventListener("contextmenu",i=>i.preventDefault()),this.viewer.addEventListener(u4.type,this),this.viewer.addEventListener(Dc.type,this),this.viewer.addEventListener(s4.type,this),this.viewer.addEventListener(l4.type,this),this.viewer.addEventListener(oa.type,this),this.hide()}get panoramaPose(){return this.mesh.rotation}get sphereCorrection(){return this.meshContainer.rotation}init(){this.show(),this.renderer.setAnimationLoop(t=>this.__renderLoop(t))}destroy(){this.renderer.setAnimationLoop(null),this.cleanScene(this.scene),this.renderer.dispose(),this.viewer.container.removeChild(this.container),this.viewer.removeEventListener(u4.type,this),this.viewer.removeEventListener(Dc.type,this),this.viewer.removeEventListener(s4.type,this),this.viewer.removeEventListener(l4.type,this),this.viewer.removeEventListener(oa.type,this),super.destroy()}handleEvent(t){switch(t.type){case u4.type:this.__onSizeUpdated();break;case Dc.type:this.__onZoomUpdated();break;case s4.type:this.__onPositionUpdated();break;case l4.type:this.__onPositionUpdated();break;case oa.type:t.containsOptions("fisheye")&&this.__onPositionUpdated(),t.containsOptions("canvasBackground")&&(this.renderer.domElement.style.background=this.config.canvasBackground);break}}hide(){this.container.style.opacity="0"}show(){this.container.style.opacity="1"}setCustomRenderer(t){t?this.customRenderer=t(this.renderer):this.customRenderer=null,this.viewer.needsUpdate()}__onSizeUpdated(){this.renderer.setSize(this.state.size.width,this.state.size.height),this.camera.aspect=this.state.aspect,this.camera.updateProjectionMatrix(),this.viewer.needsUpdate(),this.frustumNeedsUpdate=!0}__onZoomUpdated(){this.camera.fov=this.state.vFov,this.camera.updateProjectionMatrix(),this.viewer.needsUpdate(),this.frustumNeedsUpdate=!0}__onPositionUpdated(){this.camera.position.set(0,0,0),this.camera.lookAt(this.state.direction),this.config.fisheye&&this.camera.position.copy(this.state.direction).multiplyScalar(this.config.fisheye/2).negate(),this.camera.rotateZ(-this.state.roll),this.camera.updateMatrix(),this.camera.updateMatrixWorld(),this.viewer.needsUpdate(),this.frustumNeedsUpdate=!0}__renderLoop(t){const e=this.timestamp?t-this.timestamp:0;this.timestamp=t,this.viewer.dispatchEvent(new r4(t,e)),this.viewer.dynamics.update(e),(this.state.needsUpdate||this.state.continuousUpdateCount>0)&&(this.state.needsUpdate=!1,(this.customRenderer||this.renderer).render(this.scene,this.camera),this.viewer.dispatchEvent(new Lue))}setTexture(t){this.meshContainer||(this.meshContainer=new S2,this.scene.add(this.meshContainer)),this.state.textureData&&this.viewer.adapter.disposeTexture(this.state.textureData),this.mesh&&(this.meshContainer.remove(this.mesh),this.viewer.adapter.disposeMesh(this.mesh)),this.mesh=this.viewer.adapter.createMesh(t.panoData),this.viewer.adapter.setTexture(this.mesh,t,!1),this.meshContainer.add(this.mesh),this.state.textureData=t,this.viewer.needsUpdate()}setPanoramaPose(t,e=this.mesh){const i=this.viewer.dataHelper.cleanPanoramaPose(t);e.rotation.set(i.tilt,i.pan,i.roll,"YXZ")}setSphereCorrection(t,e=this.meshContainer){const i=this.viewer.dataHelper.cleanSphereCorrection(t);e.rotation.set(i.tilt,i.pan,i.roll,"YXZ")}transition(t,e,i){const o=i.effect==="fade"||i.rotation,n=!Tr(e.position),r=!Tr(e.zoom),a=new _R(n?this.viewer.dataHelper.cleanPosition(e.position):void 0,e.zoom);this.viewer.dispatchEvent(a);const s=new S2,l=this.viewer.adapter.createMesh(t.panoData);if(this.viewer.adapter.setTexture(l,t,!0),this.viewer.adapter.setTextureOpacity(l,0),this.setPanoramaPose(t.panoData,l),this.setSphereCorrection(e.sphereCorrection,s),n&&!i.rotation){const h=this.viewer.getPosition(),p=new it(0,1,0);s.rotateOnWorldAxis(p,a.position.yaw-h.yaw);const A=new it(0,1,0).cross(this.camera.getWorldDirection(new it)).normalize();s.rotateOnWorldAxis(A,a.position.pitch-h.pitch)}s.add(l),this.scene.add(s),this.renderer.setRenderTarget(new Gd),this.renderer.render(this.scene,this.camera),this.renderer.setRenderTarget(null);const{duration:c,properties:d}=this.viewer.dataHelper.getAnimationProperties(i.speed,i.rotation?a.position:null,o?a.zoomLevel:null),u=new kb({properties:{...d,opacity:{start:0,end:1}},duration:c,easing:"inOutCubic",onTick:h=>{switch(i.effect){case"fade":this.viewer.adapter.setTextureOpacity(l,h.opacity);break;case"black":case"white":h.opacity<.5?this.renderer.toneMappingExposure=i.effect==="black"?oo.mapLinear(h.opacity,0,.5,1,0):oo.mapLinear(h.opacity,0,.5,1,5):(this.renderer.toneMappingExposure=i.effect==="black"?oo.mapLinear(h.opacity,.5,1,0,1):oo.mapLinear(h.opacity,.5,1,5,1),this.mesh.visible=!1,this.viewer.adapter.setTextureOpacity(l,1),r&&!o&&this.viewer.dynamics.zoom.setValue(a.zoomLevel));break}n&&i.rotation&&this.viewer.dynamics.position.setValue({yaw:h.yaw,pitch:h.pitch}),r&&o&&this.viewer.dynamics.zoom.setValue(h.zoom),this.viewer.needsUpdate()}});return u.then(h=>{s.remove(l),this.scene.remove(s),h?(this.viewer.adapter.disposeTexture(this.state.textureData),this.meshContainer.remove(this.mesh),this.viewer.adapter.disposeMesh(this.mesh),this.mesh=l,this.meshContainer.add(l),this.state.textureData=t,this.setPanoramaPose(t.panoData),this.setSphereCorrection(e.sphereCorrection),n&&!i.rotation&&this.viewer.rotate(e.position)):(this.viewer.adapter.disposeTexture(t),this.viewer.adapter.disposeMesh(l))}),u}getIntersections(t){Rb.x=2*t.x/this.state.size.width-1,Rb.y=-2*t.y/this.state.size.height+1,this.raycaster.setFromCamera(Rb,this.camera);const e=this.raycaster.intersectObjects(this.scene.children,!0).filter(i=>i.object.visible).filter(i=>i.object.isMesh&&!!i.object.userData);return this.customRenderer?.getIntersections&&e.push(...this.customRenderer.getIntersections(this.raycaster,Rb)),e}isObjectVisible(t){if(!t)return!1;if(this.frustumNeedsUpdate&&(lhe.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),this.frustum.setFromProjectionMatrix(lhe),this.frustumNeedsUpdate=!1),t.isVector3)return this.frustum.containsPoint(t);if(t.isMesh&&t.geometry){const e=t;return e.geometry.boundingBox||e.geometry.computeBoundingBox(),che.copy(e.geometry.boundingBox).applyMatrix4(e.matrixWorld),this.frustum.intersectsBox(che)}else return t.isObject3D?this.frustum.intersectsObject(t):!1}addObject(t){this.scene.add(t)}removeObject(t){this.scene.remove(t)}cleanScene(t){const e=i=>{i.map?.dispose(),i.uniforms&&Object.values(i.uniforms).forEach(o=>{o.value?.dispose?.()}),i.dispose()};t.traverse(i=>{i.geometry?.dispose(),i.material&&(Array.isArray(i.material)?i.material.forEach(o=>{e(o)}):e(i.material)),i instanceof Vce||i.dispose?.(),i!==t&&this.cleanScene(i)})}},Api=class extends Osi{constructor(){super(...arguments),this._abortController=new AbortController}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}load(t,e,i,o){const n=this._abortController.signal,r=super.load(t,l=>{s(),e(l)},i,l=>{if(s(),n.aborted){const c=new Error;c.name="AbortError",c.message="The operation was aborted.",o(c)}else o(l)});function a(){r.src=""}function s(){n.removeEventListener("abort",a,!1)}return n.addEventListener("abort",a,!1),r}},gpi=class extends g4{constructor(t){super(t),this.fileLoader=new Fsi,this.fileLoader.setResponseType("blob"),this.imageLoader=new Api}destroy(){this.abortLoading(),super.destroy()}abortLoading(){this.fileLoader.abort?.(),this.imageLoader.abort()}loadFile(t,e,i){const o=U2.get(t,i);if(o){if(o instanceof Blob)return e?.(100),Promise.resolve(o);U2.remove(t,i)}this.config.requestHeaders&&this.fileLoader.setRequestHeader(this.config.requestHeaders(t)),this.fileLoader.setWithCredentials(this.config.withCredentials(t));let n=0;return e?.(n),this.fileLoader.loadAsync(t,r=>{if(r.lengthComputable){const a=r.loaded/r.total*100;a>n&&(n=a,e?.(n))}}).then(r=>(n=100,e?.(n),U2.add(t,i,r),r))}loadImage(t,e,i){const o=U2.get(t,i);return o?(e?.(100),o instanceof Blob?this.blobToImage(o):Promise.resolve(o)):!e&&!this.config.requestHeaders?(this.imageLoader.setWithCredentials(this.config.withCredentials(t)),this.imageLoader.loadAsync(t).then(n=>(U2.add(t,i,n),n))):this.loadFile(t,e,i).then(n=>this.blobToImage(n))}blobToImage(t){return new Promise((e,i)=>{const o=document.createElement("img");o.onload=()=>{URL.revokeObjectURL(o.src),e(o)},o.onerror=i,o.src=URL.createObjectURL(t)})}preloadPanorama(t){return this.viewer.adapter.supportsPreload(t)?this.viewer.adapter.loadTexture(t,!1):Promise.reject(new $i("Current adapter does not support preload"))}dispatchProgress(t){this.viewer.loader.setProgress(t),this.viewer.dispatchEvent(new Cue(Math.round(t)))}},mpi=class extends g4{constructor(t){super(t),this.zoom=new o4(e=>{this.viewer.state.vFov=this.viewer.dataHelper.zoomLevelToFov(e),this.viewer.state.hFov=this.viewer.dataHelper.vFovToHFov(this.viewer.state.vFov),this.viewer.dispatchEvent(new Dc(e))},{defaultValue:this.viewer.config.defaultZoomLvl,min:0,max:100,wrap:!1}),this.position=new eue(e=>{this.viewer.dataHelper.sphericalCoordsToVector3(e,this.viewer.state.direction),this.viewer.dispatchEvent(new s4(e))},{yaw:new o4(null,{defaultValue:this.config.defaultYaw,min:0,max:2*Math.PI,wrap:!0}),pitch:new o4(null,{defaultValue:this.config.defaultPitch,min:-Math.PI/2,max:Math.PI/2,wrap:!1})}),this.roll=new o4(e=>{this.viewer.state.roll=e,this.viewer.dispatchEvent(new l4(e))},{defaultValue:0,min:-Math.PI,max:Math.PI,wrap:!1}),this.updateSpeeds()}updateSpeeds(){this.zoom.setSpeed(this.config.zoomSpeed*50),this.position.setSpeed(oo.degToRad(this.config.moveSpeed*50)),this.roll.setSpeed(oo.degToRad(this.config.moveSpeed*50))}update(t){this.zoom.update(t),this.position.update(t),this.roll.update(t)}},vpi=class{constructor(){this.ready=!1,this.needsUpdate=!1,this.continuousUpdateCount=0,this.keyboardEnabled=!1,this.direction=new it(0,0,Oh),this.roll=0,this.vFov=60,this.hFov=60,this.aspect=1,this.animation=null,this.transitionAnimation=null,this.loadingPromise=null,this.idleTime=-1,this.objectsObservers={},this.size={width:0,height:0}}},ypi=class extends oue{constructor(t){if(super(),this.plugins={},this.children=[],this.parent=Dde(t.container),!this.parent)throw new $i('"container" element not found.');this.parent[tu]=this,this.container=document.createElement("div"),this.container.classList.add("psv-container"),this.parent.appendChild(this.container),Xde(this.parent),Yde(this.container,"core"),this.state=new vpi,this.config=epi(t),this.__setSize(this.config.size),this.overlay=new npi(this);try{Fn.load()}catch(e){console.error(e),this.showError(this.config.lang.webglError);return}U2.init(),this.adapter=new this.config.adapter[0](this,this.config.adapter[1]),this.renderer=new fpi(this),this.textureLoader=new gpi(this),this.eventsHandler=new ppi(this),this.dataHelper=new dpi(this),this.dynamics=new mpi(this),this.adapter.init?.(),this.loader=new opi(this),this.navbar=new ipi(this),this.panel=new spi(this),this.notification=new rpi(this),this.autoSize(),this.setCursor(null),ER(Fn.isTouchEnabled,e=>{gb(this.container,"psv--is-touch",e)}),this.config.plugins.forEach(([e,i])=>{this.plugins[e.id]=new e(this,i)});for(const e of Object.values(this.plugins))e.init?.();this.config.navbar&&this.navbar.setButtons(this.config.navbar),this.state.loadingPromise||(this.config.panorama?this.setPanorama(this.config.panorama,{sphereCorrection:this.config.sphereCorrection,panoData:this.config.panoData}):this.loader.show())}destroy(){this.stopAll(),this.stopKeyboardControl(),this.exitFullscreen();for(const[t,e]of Object.entries(this.plugins))e.destroy(),delete this.plugins[t];this.children.slice().forEach(t=>t.destroy()),this.children.length=0,this.eventsHandler?.destroy(),this.renderer?.destroy(),this.textureLoader?.destroy(),this.dataHelper?.destroy(),this.adapter?.destroy(),this.dynamics?.destroy(),this.parent.removeChild(this.container),delete this.parent[tu]}init(){this.eventsHandler.init(),this.renderer.init(),this.config.navbar&&this.navbar.show(),this.config.keyboard==="always"&&this.startKeyboardControl(),this.resetIdleTimer(),this.state.ready=!0,this.dispatchEvent(new c4)}resetIdleTimer(){this.state.idleTime=performance.now()}disableIdleTimer(){this.state.idleTime=-1}getPlugin(t){if(typeof t=="string")return this.plugins[t];{const e=jR(t);return e?this.plugins[e.id]:null}}getPosition(){return this.dataHelper.cleanPosition(this.dynamics.position.current)}getZoomLevel(){return this.dynamics.zoom.current}getSize(){return{...this.state.size}}isFullscreenEnabled(){return Ode(this.parent,Fn.isIphone)}needsUpdate(){this.state.needsUpdate=!0}needsContinuousUpdate(t){t?this.state.continuousUpdateCount++:this.state.continuousUpdateCount>0&&this.state.continuousUpdateCount--}autoSize(){(this.container.clientWidth!==this.state.size.width||this.container.clientHeight!==this.state.size.height)&&(this.state.size.width=Math.round(this.container.clientWidth),this.state.size.height=Math.round(this.container.clientHeight),this.state.aspect=this.state.size.width/this.state.size.height,this.state.hFov=this.dataHelper.vFovToHFov(this.state.vFov),this.dispatchEvent(new u4(this.getSize())),this.navbar.autoSize())}setPanorama(t,e={}){this.textureLoader.abortLoading(),this.state.transitionAnimation?.cancel();const i=this.dataHelper.getTransitionOptions(e);e.showLoader===void 0&&(e.showLoader=!0),e.caption===void 0&&(e.caption=this.config.caption),e.description===void 0&&(e.description=this.config.description),!e.panoData&&typeof this.config.panoData=="function"&&(e.panoData=this.config.panoData),this.hideError(),this.resetIdleTimer(),this.config.panorama=t,this.config.caption=e.caption,this.config.description=e.description,this.config.sphereCorrection=e.sphereCorrection,(typeof this.config.panoData!="function"||typeof e.panoData=="function")&&(this.config.panoData=e.panoData);const o=r=>{if(Qde(r))return!1;if(this.loader.hide(),this.state.loadingPromise=null,r)throw this.navbar.setCaption(null),this.showError(this.config.lang.loadError),console.error(r),this.dispatchEvent(new Eue(t,r)),r;return this.navbar.setCaption(this.config.caption),!0};this.navbar.setCaption(`<em>${this.config.lang.loading}</em>`),(e.showLoader||!this.state.ready)&&this.loader.show(),this.dispatchEvent(new kue(t));const n=this.adapter.loadTexture(this.config.panorama,!0,e.panoData).then(r=>{if(r.panorama!==this.config.panorama)throw this.adapter.disposeTexture(r),PR();const a=this.dataHelper.cleanPanoramaOptions(e,r.panoData);return(!Tr(a.zoom)||!Tr(a.position))&&this.stopAll(),{textureData:r,cleanOptions:a}});return!i||!this.state.ready||!this.adapter.supportsTransition(this.config.panorama)?this.state.loadingPromise=n.then(({textureData:r,cleanOptions:a})=>{this.renderer.show(),this.renderer.setTexture(r),this.renderer.setPanoramaPose(r.panoData),this.renderer.setSphereCorrection(e.sphereCorrection),this.state.ready||this.init(),this.dispatchEvent(new _2(r)),Tr(a.zoom)||this.zoom(a.zoom),Tr(a.position)||this.rotate(a.position)}).then(()=>o(),r=>o(r)):this.state.loadingPromise=n.then(({textureData:r,cleanOptions:a})=>(this.loader.hide(),this.dispatchEvent(new _2(r)),this.state.transitionAnimation=this.renderer.transition(r,a,i),this.state.transitionAnimation)).then(r=>{if(this.state.transitionAnimation=null,this.dispatchEvent(new Iue(r)),!r)throw PR()}).then(()=>o(),r=>o(r)),this.state.loadingPromise}setOptions(t){const e={...this.config,...t};for(let[i,o]of Object.entries(t)){if(!(i in F2)){Kr(`Unknown option ${i}`);continue}if(i in she){Kr(she[i]);continue}switch(i in HR&&(o=HR[i](o,{rawConfig:e,defValue:F2[i]})),this.config[i]=o,i){case"mousemove":this.state.cursorOverride||this.setCursor(null);break;case"caption":this.navbar.setCaption(this.config.caption);break;case"size":this.resize(this.config.size);break;case"sphereCorrection":this.renderer.setSphereCorrection(this.config.sphereCorrection);break;case"navbar":case"lang":this.navbar.setButtons(this.config.navbar);break;case"moveSpeed":case"zoomSpeed":this.dynamics.updateSpeeds();break;case"minFov":case"maxFov":this.dynamics.zoom.setValue(this.dataHelper.fovToZoomLevel(this.state.vFov)),this.dispatchEvent(new Dc(this.getZoomLevel()));break;case"keyboard":this.config.keyboard==="always"?this.startKeyboardControl():this.stopKeyboardControl();break}}this.needsUpdate(),this.dispatchEvent(new oa(Object.keys(t)))}setOption(t,e){this.setOptions({[t]:e})}showError(t){this.overlay.show({id:Gr.ERROR,image:cpi,title:t,dismissible:!1})}hideError(){this.overlay.hide(Gr.ERROR)}rotate(t){const e=new sue(this.dataHelper.cleanPosition(t));this.dispatchEvent(e),!e.defaultPrevented&&this.dynamics.position.setValue(e.position)}zoom(t){this.dynamics.zoom.setValue(t)}zoomIn(t=1){this.dynamics.zoom.step(t)}zoomOut(t=1){this.dynamics.zoom.step(-t)}animate(t){const e=IR(t),i=!Tr(t.zoom),o=new _R(e?this.dataHelper.cleanPosition(t):void 0,t.zoom);if(this.dispatchEvent(o),o.defaultPrevented)return;this.stopAll();const{duration:n,properties:r}=this.dataHelper.getAnimationProperties(t.speed,o.position,o.zoomLevel);return n?(this.state.animation=new kb({properties:r,duration:n,easing:t.easing||"inOutSine",onTick:a=>{e&&this.dynamics.position.setValue({yaw:a.yaw,pitch:a.pitch}),i&&this.dynamics.zoom.setValue(a.zoom)}}),this.state.animation.then(()=>{this.state.animation=null,this.resetIdleTimer()}),this.state.animation):(e&&this.rotate(o.position),i&&this.zoom(o.zoomLevel),new kb(null))}stopAnimation(){return this.state.animation?(this.state.animation.cancel(),this.state.animation):Promise.resolve()}resize(t){this.__setSize(t),this.autoSize()}__setSize(t){["width","height"].forEach(e=>{t?.[e]&&(/^[0-9.]+$/.test(t[e])&&(t[e]+="px"),this.parent.style[e]=t[e])})}enterFullscreen(){this.isFullscreenEnabled()||Ude(this.parent,Fn.isIphone)}exitFullscreen(){this.isFullscreenEnabled()&&Nde(Fn.isIphone)}toggleFullscreen(){this.isFullscreenEnabled()?this.exitFullscreen():this.enterFullscreen()}startKeyboardControl(){this.state.keyboardEnabled=!0}stopKeyboardControl(){this.state.keyboardEnabled=!1}createTooltip(t){return new lpi(this,t)}setCursor(t){this.state.cursorOverride=t,t?this.container.style.cursor=t:this.container.style.cursor=this.config.mousemove?"move":"default"}observeObjects(t){this.state.objectsObservers[t]||(this.state.objectsObservers[t]=null)}unobserveObjects(t){delete this.state.objectsObservers[t]}stopAll(){return this.dispatchEvent(new h4),this.disableIdleTimer(),this.stopAnimation()}};const bpi={class:"annotations-photosphere"},wpi={__name:"AnnotationsPhotosphere",setup(t){const e=ht("$viewer"),{localContext:i}=e,o=i.viewer,n=o.viewer,r=n.renderer.renderer.domElement,a=vE(),s=Oe(()=>a.value.filter(d=>!o.selectedStorey||d.z>=o.selectedStorey.absoluteElevation&&d.z<o.selectedStorey.absoluteTopElevation));n.addEventListener("render",()=>op(s));const l=(d,u)=>{const{x:h,y:p}=r.getBoundingClientRect(),{clientX:A,clientY:f}=u,m=n.dataHelper.viewerCoordsToSphericalCoords({x:A-h,y:f-p}),{textureX:g,textureY:y}=n.dataHelper.sphericalCoordsToTextureCoords(m);d.x=g,d.y=y},c=d=>{const u=n.dataHelper.textureCoordsToSphericalCoords({textureX:d.x,textureY:d.y}),h=n.dataHelper.sphericalCoordsToVector3(u),p=n.dataHelper.sphericalCoordsToViewerCoords(u),{width:A,height:f}=n.state.size;if(!(h.dot(n.state.direction)>0&&p.x>=0&&p.x<=A&&p.y>=0&&p.y<=f))return"display: none;";const{x:m,y:g}=p;return`left: ${m}px; top: ${g}px;`};return(d,u)=>(M(),_("div",bpi,[(M(!0),_(tt,null,Bt(s.value,h=>(M(),J(yE,{annotation:h,canvas:at(r),style:ce(c(h)),onAnnotationDrag:p=>l(h,p)},null,8,["annotation","canvas","style","onAnnotationDrag"]))),256))]))}},Cpi=j(wpi,[["__scopeId","data-v-fd653bd2"]]),xpi={name:"ViewerPhotosphere",components:{Annotations:Cpi},data(){const{settings:t}=this.$plugin;return{settings:t,model:null,photosphere:null,selectedStorey:null,loading:!1,modelHeaderShown:this.$options.$cfg?.modelLoader!=="hidden",annotationMode:!1,markerId:1,localContextSubscriptions:[],photoSphereViewerCreated:!1}},watch:{loading(t){t?this.$viewer.localContext.loadingProcessStart():this.$viewer.localContext.loadingProcessEnd()}},created(){this.isMounted=new Promise(t=>{this.setMounted=t})},mounted(){const t=new ypi({loadingImg:null,loadingTxt:null,container:this.$refs.canvas,touchmoveTwoFingers:!0,navbar:null,defaultZoomLvl:0,rendererParameters:{alpha:!0,antialias:!0,preserveDrawingBuffer:!0}});t.renderer.renderer.preserveDrawingBuffer=!0,this.viewer=t,this.photoSphereViewerCreated=!0,this.setMounted()},unmounted(){this.viewer?.destroy(),this.localContextSubscriptions.forEach(t=>this.$viewer.localContext.hub.off(t))},methods:{async loadModels([t]){this.$viewer.localContext.hub.off(this.metaBuildingLocalContextSub),this.loading=!0,await this.isMounted,this.model&&this.unloadModels(),this.model=t,t.type==="PHOTOSPHERE_BUILDING"?(this.metaBuildingLocalContextSub=this.$viewer.localContext.hub.on("storey-selected",async({storey:e})=>{e&&(this.photosphere=e.plans[0]?.plan,this.photosphere&&await this.viewer.setPanorama(this.photosphere.document.file,{transition:!1}),this.selectedStorey=e)},{getLastEvent:!0}),this.$viewer.localContext.selectStorey(t.storeys[0])):(this.photosphere=t,await this.viewer.setPanorama(t.document.file,{transition:!1})),this.loading=!1,this.$viewer.localContext.hub.emit("photosphere-model-loaded",{model:t,plugin:this}),this.$viewer.globalContext.hub.emit("photosphere-model-loaded",{model:t,plugin:this})},unloadModels(){this.$viewer.localContext.hub.emit("photosphere-model-unloaded",{model:this.model,plugin:this}),this.$viewer.globalContext.hub.emit("photosphere-model-unloaded",{model:this.model,plugin:this}),this.selectedStorey=null,this.model=null},hideUI(){[...this.$viewer.localContext.plugins.entries()].forEach(([,t])=>t.$hide()),this.modelHeaderShown=!1},showUI(){[...this.$viewer.localContext.plugins.entries()].forEach(([,t])=>t.$show()),this.modelHeaderShown=this.$options.$cfg?.modelLoader!=="hidden"},async getSnapshot(){return{snapshot_type:"png",snapshot_data:this.viewer.renderer.renderer.domElement.toDataURL()}},async getViewpoint(){const t=this.viewer.renderer.camera,e=this.viewer.getPosition(),{textureX:i,textureY:o}=this.viewer.dataHelper.sphericalCoordsToTextureCoords(e);return{order:6,originating_system:"photosphere",authoring_tool_id:this.photosphere?String(this.photosphere.id):void 0,models:this.$viewer.localContext.loadedModels.map(n=>n.id),perspective_camera:{camera_direction:{x:i,y:o,z:0},camera_up_vector:{x:0,y:0,z:0},camera_view_point:{x:0,y:0,z:this.selectedStorey?.absoluteElevation??0},field_of_view:t.fov}}},async setViewpoint(t){const e=this.$viewer.state.getStoreyFromAbsoluteElevation(this.$viewer.localContext.loadedModels[0],t?.perspective_camera?.camera_view_point.z);if(e&&e.uuid!==this.selectedStorey?.uuid){this.$viewer.localContext.selectStorey(e),await new Promise(s=>this.viewer.addEventListener("panorama-loaded",s,{once:!0}));const a=e.plans.find(s=>s.plan.id===+t.authoring_tool_id)?.plan;a&&(this.photosphere=a,await this.viewer.setPanorama(a.document.file,{transition:!1}))}const{x:i,y:o}=t?.perspective_camera?.camera_direction??{x:0,y:0};this.viewer.rotate({textureX:i,textureY:o});const n=t?.perspective_camera?.field_of_view,r=this.viewer.dataHelper.fovToZoomLevel(n);r&&this.viewer.zoom(r)},startAnnotationMode(t){this.annotationMode||(this.annotationMode=!0,this.annotationListener=({data:e})=>{const i=this.selectedStorey;t({x:e.textureX,y:e.textureY,z:i?.absoluteElevation??0,models:this.$viewer.localContext.loadedModels,storey:i})},this.canvasCursor=this.viewer.renderer.renderer.domElement.style.cursor,this.viewer.renderer.renderer.domElement.style.cursor="copy",this.viewer.addEventListener("click",this.annotationListener))},stopAnnotationMode(){this.annotationMode&&(this.viewer.removeEventListener("click",this.annotationListener),this.annotationMode=!1,this.viewer.renderer.renderer.domElement.style.cursor=this.canvasCursor)}}},kpi=xpi,Mpi={class:"bimdata-viewer-photosphere"},Bpi={ref:"canvas",class:"bimdata-viewer-photosphere__viewer__canvas"};function Epi(t,e,i,o,n,r){const a=S("NoModelWindowPlaceHolder"),s=S("Annotations"),l=S("ModelsLoader");return M(),_("div",Mpi,[b("div",Bpi,null,512),!t.model&&!t.loading?(M(),J(a,{key:0})):ie("",!0),t.photoSphereViewerCreated?(M(),J(s,{key:1})):ie("",!0),t.settings.modelLoader!=="disabled"?yt((M(),J(l,{key:2,ref:"header",multi:!1},null,512)),[[zt,t.modelHeaderShown]]):ie("",!0)])}const Ppi=j(kpi,[["render",Epi],["__scopeId","data-v-d5fe6555"]]),Ipi="Photosphere Viewer",Spi={window_label:Ipi},Tpi="Visionneuse Photosph\xE8re",Rpi={window_label:Tpi},Dpi="data:image/svg+xml,%3csvg%20width='23'%20height='23'%20viewBox='0%200%2023%2023'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M4.19485%207.90625L10.5819%201.79688V5.97245V7.90625H4.19485ZM21.3153%202.3C21.3153%201.035%2020.2453%200%2018.9228%200H9.30458L2.09094%206.9V20.7C2.09094%2021.965%203.17261%2023%204.49549%2023H18.9348C20.2573%2023%2021.3273%2021.965%2021.3273%2020.7L21.3153%202.3Z'%20class='fill-primary'%20fill='%232F374A'%20/%3e%3cpath%20d='M0%2013C0%2012.4477%200.468066%2012%201.04545%2012H21.9545C22.5319%2012%2023%2012.4477%2023%2013V20C23%2020.5523%2022.5319%2021%2021.9545%2021H1.04545C0.468066%2021%200%2020.5523%200%2020V13Z'%20fill='%23009B9D'%20/%3e%3cpath%20d='M4.79347%2019.9225C4.26792%2019.9225%203.79985%2019.8383%203.38926%2019.67C2.98102%2019.4994%202.65842%2019.2655%202.42145%2018.9681C2.18683%2018.6685%202.066%2018.3231%202.05896%2017.9317H3.59338C3.60277%2018.0956%203.66025%2018.24%203.76583%2018.3646C3.87376%2018.487%204.01687%2018.5822%204.19519%2018.6499C4.3735%2018.7177%204.5741%2018.7516%204.79699%2018.7516C5.02927%2018.7516%205.23456%2018.7134%205.41287%2018.6368C5.59118%2018.5603%205.73078%2018.4542%205.83167%2018.3187C5.93256%2018.1831%205.983%2018.0268%205.983%2017.8497C5.983%2017.6704%205.92904%2017.5118%205.82111%2017.3741C5.71553%2017.2341%205.56303%2017.1248%205.3636%2017.0461C5.16652%2016.9674%204.9319%2016.928%204.65974%2016.928H3.98755V15.885H4.65974C4.88967%2015.885%205.09261%2015.8479%205.26858%2015.7735C5.44689%2015.6992%205.58532%2015.5964%205.68386%2015.4652C5.7824%2015.3318%205.83167%2015.1766%205.83167%2014.9995C5.83167%2014.8311%205.78827%2014.6835%205.70146%2014.5567C5.61699%2014.4277%205.49734%2014.3271%205.34249%2014.255C5.18998%2014.1828%205.01167%2014.1467%204.80755%2014.1467C4.60108%2014.1467%204.41221%2014.1817%204.24094%2014.2517C4.06966%2014.3195%203.93241%2014.4168%203.82918%2014.5436C3.72594%2014.6704%203.67081%2014.8191%203.66377%2014.9896H2.20325C2.21029%2014.6026%202.32877%2014.2615%202.5587%2013.9663C2.78863%2013.6711%203.09833%2013.4405%203.4878%2013.2743C3.87962%2013.1059%204.32188%2013.0217%204.81459%2013.0217C5.31198%2013.0217%205.74721%2013.1059%206.12025%2013.2743C6.4933%2013.4426%206.78306%2013.67%206.98953%2013.9565C7.19834%2014.2407%207.30157%2014.56%207.29923%2014.9142C7.30157%2015.2903%207.17605%2015.6041%206.92266%2015.8555C6.67162%2016.107%206.34432%2016.2666%205.94077%2016.3344V16.3868C6.47101%2016.4503%206.87456%2016.6219%207.15142%2016.9018C7.43062%2017.1795%207.56904%2017.5271%207.5667%2017.9448C7.56904%2018.3274%207.45056%2018.6674%207.21124%2018.9648C6.97428%2019.2622%206.64698%2019.4961%206.22935%2019.6667C5.81173%2019.8372%205.3331%2019.9225%204.79347%2019.9225Z'%20fill='white'%20/%3e%3cpath%20d='M11.4283%2019.9225C11.0576%2019.9203%2010.6998%2019.8624%2010.3549%2019.7487C10.0123%2019.635%209.70498%2019.4502%209.43281%2019.1944C9.16065%2018.9386%208.9448%2018.5997%208.78526%2018.1776C8.62806%2017.7556%208.54947%2017.2374%208.54947%2016.623C8.55181%2016.0589%208.62103%2015.5549%208.75711%2015.111C8.89553%2014.6649%209.09261%2014.2867%209.34835%2013.9762C9.60643%2013.6657%209.91496%2013.4295%2010.2739%2013.2677C10.6329%2013.1037%2011.0353%2013.0217%2011.4811%2013.0217C11.962%2013.0217%2012.3867%2013.1092%2012.7551%2013.2841C13.1234%2013.4569%2013.419%2013.6919%2013.6419%2013.9893C13.8672%2014.2867%2014.0032%2014.6201%2014.0502%2014.9896H12.5474C12.4888%2014.7557%2012.3656%2014.572%2012.1779%2014.4386C11.9902%2014.3052%2011.7579%2014.2386%2011.4811%2014.2386C11.0118%2014.2386%2010.6552%2014.4288%2010.4112%2014.8092C10.1695%2015.1897%2010.0463%2015.7068%2010.0417%2016.3606H10.0909C10.1989%2016.1616%2010.3443%2015.9922%2010.5273%2015.8522C10.7127%2015.7101%2010.9227%2015.6019%2011.1573%2015.5275C11.3942%2015.451%2011.6441%2015.4127%2011.9069%2015.4127C12.3339%2015.4127%2012.714%2015.5068%2013.0472%2015.6948C13.3803%2015.8807%2013.6431%2016.1365%2013.8355%2016.4623C14.0279%2016.7881%2014.1241%2017.1609%2014.1241%2017.5807C14.1241%2018.0355%2014.0103%2018.44%2013.7827%2018.7943C13.5575%2019.1485%2013.2419%2019.4262%2012.836%2019.6273C12.4324%2019.8263%2011.9632%2019.9247%2011.4283%2019.9225ZM11.4212%2018.8074C11.6559%2018.8074%2011.8658%2018.7549%2012.0512%2018.6499C12.2365%2018.545%2012.382%2018.4029%2012.4876%2018.2236C12.5932%2018.0443%2012.646%2017.8431%2012.646%2017.6201C12.646%2017.397%2012.5932%2017.197%2012.4876%2017.0199C12.3844%2016.8427%2012.2412%2016.7017%2012.0582%2016.5968C11.8752%2016.4918%2011.6664%2016.4393%2011.4318%2016.4393C11.2558%2016.4393%2011.0928%2016.4699%2010.9426%2016.5312C10.7948%2016.5924%2010.6646%2016.6777%2010.552%2016.787C10.4417%2016.8963%2010.3549%2017.0231%2010.2915%2017.1675C10.2282%2017.3096%2010.1965%2017.4615%2010.1965%2017.6234C10.1965%2017.8398%2010.2493%2018.0377%2010.3549%2018.217C10.4628%2018.3963%2010.6083%2018.5395%2010.7913%2018.6467C10.9766%2018.7538%2011.1866%2018.8074%2011.4212%2018.8074Z'%20fill='white'%20/%3e%3cpath%20d='M18.0305%2019.9783C17.4252%2019.9761%2016.9043%2019.8372%2016.4679%2019.5617C16.0339%2019.2862%2015.6996%2018.8872%2015.4649%2018.3646C15.2327%2017.842%2015.1177%2017.2134%2015.12%2016.4787C15.12%2015.7462%2015.2362%2015.1219%2015.4684%2014.6059C15.7031%2014.0899%2016.0374%2013.6974%2016.4715%2013.4284C16.9079%2013.1573%2017.4275%2013.0217%2018.0305%2013.0217C18.6335%2013.0217%2019.152%2013.1573%2019.5861%2013.4284C20.0224%2013.6996%2020.358%2014.0931%2020.5926%2014.6092C20.8272%2015.123%2020.9433%2015.7462%2020.941%2016.4787C20.941%2017.2156%2020.8237%2017.8453%2020.5891%2018.3679C20.3568%2018.8905%2020.0236%2019.2895%2019.5896%2019.565C19.1555%2019.8405%2018.6358%2019.9783%2018.0305%2019.9783ZM18.0305%2018.8008C18.4434%2018.8008%2018.7731%2018.6073%2019.0194%2018.2203C19.2658%2017.8333%2019.3878%2017.2527%2019.3855%2016.4787C19.3855%2015.9692%2019.3291%2015.545%2019.2165%2015.2061C19.1063%2014.8672%2018.9491%2014.6125%2018.7449%2014.4419C18.5432%2014.2713%2018.305%2014.1861%2018.0305%2014.1861C17.6199%2014.1861%2017.2915%2014.3774%2017.0451%2014.76C16.7988%2015.1427%2016.6744%2015.7156%2016.6721%2016.4787C16.6721%2016.9947%2016.7272%2017.4255%2016.8375%2017.7709C16.9501%2018.1142%2017.1085%2018.3722%2017.3126%2018.545C17.5167%2018.7155%2017.756%2018.8008%2018.0305%2018.8008Z'%20fill='white'%20/%3e%3c/svg%3e",Lpi={name:"photosphere",isViewer:!0,i18n:{en:Spi,fr:Rpi},component:Ppi,window:{name:"photosphere",label:"photosphere.window_label",header:!1,plugins:["fullscreen"],icon:{imgUri:Dpi},modelTypes:["PHOTOSPHERE","PHOTOSPHERE_BUILDING"],multiModel:!1}},_pi={setup(){const t=ht("$viewer"),e=ht("$plugin"),{apiClient:i,cloudId:o,projectId:n}=t.api,r=Oe(()=>t.localContext.loadedModels[0]),a=Oe(()=>t.localContext.selectedStorey),s=Oe(()=>t.localContext.viewer.photosphere),l=Oe(()=>a.value?.plans.find(u=>u.plan.id===s.value?.id));ft([r,()=>e.shown],([{type:u}={}])=>{u==="PHOTOSPHERE_BUILDING"?e.show():e.hide()},{immediate:!0});const c=u=>{r.value&&t.localContext.selectStorey(r.value.storeys.find(h=>h.uuid===u.uuid))},d=u=>{if(!u)return;const{viewer:h}=t.localContext,p=h.viewer;h.photosphere=u.plan,p.setPanorama(u.plan.document.file,{transition:!1})};return()=>Qo(Tle,{apiClient:i,space:{id:o},project:{id:n},model:r.value,storey:a.value,plan:l.value,selectable:!0,onStoreySelected:c,onPlanSelected:d})}},Fpi={name:"photosphereBuilding",component:_pi,addToWindows:["photosphere"],sidePanel:{position:"right",width:400}},Opi={props:{color:{type:String,required:!0}}},Upi=["fill"];function Npi(t,e,i,o,n,r){return M(),_("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:i.color,xmlns:"http://www.w3.org/2000/svg"},[...e[0]||(e[0]=[tn('<rect width="3" height="3"></rect><rect y="9" width="3" height="3"></rect><rect x="9" width="3" height="3"></rect><rect x="9" y="9" width="3" height="3"></rect><rect x="3" y="1" width="6" height="1"></rect><rect x="3" y="10" width="6" height="1"></rect><rect x="11" y="3" width="6" height="1" transform="rotate(90 11 3)"></rect><rect x="2" y="3" width="6" height="1" transform="rotate(90 2 3)"></rect>',8)])],8,Upi)}const dhe=j(Opi,[["render",Npi]]),jpi={class:"bimdata-label-list"},Hpi={class:"bimdata-label-list__classes"},Vpi={class:"bimdata-label-list__classes__title"},zpi={class:"bimdata-label-list__classes__list"},qpi={class:"bimdata-label-list__labels"},Qpi={class:"bimdata-label-list__labels__title"},Gpi=["onClick","onMouseover"],Kpi={__name:"LabelList",setup(t){const e=ht("state"),i=Oe(()=>e.classes),o=Oe(()=>e.labels),n=a=>{e.selectedClass=a},r=a=>e.labels.filter(s=>!s.deleted).filter(s=>s.name===a.name).indexOf(a);return(a,s)=>{const l=S("BIMDataIconPlus"),c=S("BIMDataButton");return M(),_("div",jpi,[b("div",Hpi,[b("div",Vpi,[b("div",null,q(a.$t("label.classes.title")),1),s[2]||(s[2]=We(" \xA0 ",-1)),b("div",null,"("+q(a.$t("label.classes.description"))+")",1)]),b("ul",zpi,[(M(!0),_(tt,null,Bt(i.value,d=>(M(),_("li",{key:d.name,class:le({active:at(e).selectedClass?.name===d.name})},[b("div",null,[D(dhe,{color:`#${d.color}`,class:"m-r-18"},null,8,["color"]),b("span",null,q(d.name),1)]),D(c,{color:"primary",outline:"",radius:"",icon:"",width:"20px",height:"20px",onClick:u=>n(d)},{default:N(()=>[D(l,{customSize:6})]),_:1},8,["onClick"])],2))),128))])]),b("div",qpi,[b("div",Qpi,[b("div",null,q(a.$t("label.labels.title")),1),s[3]||(s[3]=We(" \xA0 ",-1)),b("div",null,"("+q(a.$t("label.labels.description"))+")",1)]),b("ul",{class:"bimdata-label-list__classes__list",onClick:s[1]||(s[1]=d=>at(e).selectedLabel=null)},[(M(!0),_(tt,null,Bt(o.value.filter(d=>!d.deleted),d=>(M(),_("li",{class:le({highlighted:at(e).highlightedLabel===d,active:at(e).selectedLabel===d}),onClick:vt(u=>at(e).selectedLabel=d,["stop"]),style:{cursor:"pointer"},onMouseover:u=>at(e).highlightedLabel=d,onMouseleave:s[0]||(s[0]=u=>at(e).highlightedLabel=null)},[b("div",null,[D(dhe,{color:`#${d.color}`,class:"m-r-18"},null,8,["color"]),b("span",null,q(d.name)+"-"+q(r(d)),1)])],42,Gpi))),256))])])])}}},Jpi=j(Kpi,[["__scopeId","data-v-70b81c34"]]),Zpi={},Wpi={width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Ypi(t,e){return M(),_("svg",Wpi,[...e[0]||(e[0]=[b("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.176395 0.13889C0.342301 -0.00852533 0.584825 -0.0419546 0.786658 0.0547728L21.6969 10.0759C21.9052 10.1757 22.0251 10.3924 21.9956 10.6155C21.966 10.8386 21.7935 11.019 21.566 11.0647L12.0932 12.9697L9.57365 21.6158C9.51015 21.8337 9.31 21.9881 9.07635 21.9993C8.8427 22.0106 8.6277 21.8763 8.54214 21.6655L0.03777 0.720195C-0.0446022 0.517321 0.0104881 0.286306 0.176395 0.13889Z",fill:"#2F374A"},null,-1)])])}const Xpi=j(Zpi,[["render",Ypi]]),$pi={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e1i=["fill"],t1i={__name:"Rectangle",props:{disabled:{type:Boolean,default:!1}},setup(t){return(e,i)=>(M(),_("svg",$pi,[b("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0 0H20V20H0V0ZM2.5 2.5V17.5H17.5V2.5H2.5Z",fill:t.disabled?"var(--color-silver)":"var(--color-primary)"},null,8,e1i)]))}},i1i={class:"bimdata-label-viewer-draw-tools"},o1i={__name:"LabelDrawTools",props:{activeTool:{type:String,default:null}},setup(t){const e=ht("state");return(i,o)=>{const n=S("BIMDataIconArrow"),r=S("BIMDataButton");return M(),_("div",i1i,[D(r,{color:"primary",ghost:"",radius:"",icon:"",class:"bimdata-label-viewer-draw-tools__back",onClick:o[0]||(o[0]=a=>i.$emit("back"))},{default:N(()=>[D(n,{size:"xs",fill:"",color:"default"})]),_:1}),o[3]||(o[3]=b("div",{class:"bimdata-label-viewer-draw-tools__separator"},null,-1)),D(r,{color:t.activeTool===null?"secondary":"primary",ghost:t.activeTool!==null,fill:t.activeTool===null,radius:"",icon:"",class:"bimdata-label-viewer-draw-tools__pointer",onClick:o[1]||(o[1]=a=>i.$emit("tool-click",null))},{default:N(()=>[D(Xpi)]),_:1},8,["color","ghost","fill"]),D(r,{color:t.activeTool==="rectangle"?"secondary":"primary",ghost:t.activeTool!=="rectangle",fill:t.activeTool==="rectangle",radius:"",icon:"",class:"bimdata-label-viewer-draw-tools__rectangle",disabled:at(e).selectedClass===null,onClick:o[2]||(o[2]=a=>i.$emit("tool-click",t.activeTool==="rectangle"?null:"rectangle"))},{default:N(()=>[D(t1i,{disabled:at(e).selectedClass===null},null,8,["disabled"])]),_:1},8,["color","ghost","fill","disabled"])])}}},r1i=j(o1i,[["__scopeId","data-v-423df785"]]),n1i={class:"bimdata-label-viewer__model-selector"},a1i={class:"bimdata-label-viewer__model-selector__select"},s1i={class:"bimdata-label-viewer__model-selector__select__text"},l1i={key:1},c1i={__name:"ModelSelector",props:{currentModelIndex:{type:Number,default:0},modelCount:{type:Number,required:!0},loading:{type:Boolean,default:!1}},emits:["previous","next","validate"],setup(t){return(e,i)=>{const o=S("BIMDataIconChevron"),n=S("BIMDataButton"),r=S("BIMDataSpinner");return M(),_("div",n1i,[b("div",a1i,[D(n,{ghost:"",rounded:"",icon:"",width:"30px",height:"30px",onClick:i[0]||(i[0]=a=>e.$emit("previous")),disabled:t.currentModelIndex<=0},{default:N(()=>[D(o,{size:"xxxs",rotate:180})]),_:1},8,["disabled"]),b("div",s1i,[t.loading?(M(),J(r,{key:0})):(M(),_("span",l1i,q(t.currentModelIndex+1)+"/"+q(t.modelCount),1))]),D(n,{ghost:"",rounded:"",icon:"",width:"30px",height:"30px",onClick:i[1]||(i[1]=a=>e.$emit("next")),disabled:t.currentModelIndex+1>=t.modelCount},{default:N(()=>[D(o,{size:"xxxs"})]),_:1},8,["disabled"])]),D(n,{color:"secondary",fill:"",radius:"",width:"87px",height:"32px",style:{"border-radius":"17px"},onClick:i[2]||(i[2]=a=>e.$emit("validate"))},{default:N(()=>[We(q(e.$t("global.validate")),1)]),_:1})])}}},d1i=j(c1i,[["__scopeId","data-v-13384e53"]]),u1i={},h1i={width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function p1i(t,e){return M(),_("svg",h1i,[...e[0]||(e[0]=[b("path",{d:"M19.8667 21.5L12.5167 14.15C11.9333 14.6167 11.2625 14.9861 10.5042 15.2583C9.74583 15.5306 8.93889 15.6667 8.08333 15.6667C5.96389 15.6667 4.17014 14.9326 2.70208 13.4646C1.23403 11.9965 0.5 10.2028 0.5 8.08333C0.5 5.96389 1.23403 4.17014 2.70208 2.70208C4.17014 1.23403 5.96389 0.5 8.08333 0.5C10.2028 0.5 11.9965 1.23403 13.4646 2.70208C14.9326 4.17014 15.6667 5.96389 15.6667 8.08333C15.6667 8.93889 15.5306 9.74583 15.2583 10.5042C14.9861 11.2625 14.6167 11.9333 14.15 12.5167L21.5 19.8667L19.8667 21.5ZM8.08333 13.3333C9.54167 13.3333 10.7812 12.8229 11.8021 11.8021C12.8229 10.7812 13.3333 9.54167 13.3333 8.08333C13.3333 6.625 12.8229 5.38542 11.8021 4.36458C10.7812 3.34375 9.54167 2.83333 8.08333 2.83333C6.625 2.83333 5.38542 3.34375 4.36458 4.36458C3.34375 5.38542 2.83333 6.625 2.83333 8.08333C2.83333 9.54167 3.34375 10.7812 4.36458 11.8021C5.38542 12.8229 6.625 13.3333 8.08333 13.3333ZM6.91667 11.5833V9.25H4.58333V6.91667H6.91667V4.58333H9.25V6.91667H11.5833V9.25H9.25V11.5833H6.91667Z",fill:"#2F374A"},null,-1)])])}const f1i=j(u1i,[["render",p1i]]),A1i={},g1i={width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function m1i(t,e){return M(),_("svg",g1i,[...e[0]||(e[0]=[b("path",{d:"M19.8667 21.5L12.5167 14.15C11.9333 14.6167 11.2625 14.9861 10.5042 15.2583C9.74583 15.5306 8.93889 15.6667 8.08333 15.6667C5.96389 15.6667 4.17014 14.9326 2.70208 13.4646C1.23403 11.9965 0.5 10.2028 0.5 8.08333C0.5 5.96389 1.23403 4.17014 2.70208 2.70208C4.17014 1.23403 5.96389 0.5 8.08333 0.5C10.2028 0.5 11.9965 1.23403 13.4646 2.70208C14.9326 4.17014 15.6667 5.96389 15.6667 8.08333C15.6667 8.93889 15.5306 9.74583 15.2583 10.5042C14.9861 11.2625 14.6167 11.9333 14.15 12.5167L21.5 19.8667L19.8667 21.5ZM8.08333 13.3333C9.54167 13.3333 10.7812 12.8229 11.8021 11.8021C12.8229 10.7812 13.3333 9.54167 13.3333 8.08333C13.3333 6.625 12.8229 5.38542 11.8021 4.36458C10.7812 3.34375 9.54167 2.83333 8.08333 2.83333C6.625 2.83333 5.38542 3.34375 4.36458 4.36458C3.34375 5.38542 2.83333 6.625 2.83333 8.08333C2.83333 9.54167 3.34375 10.7812 4.36458 11.8021C5.38542 12.8229 6.625 13.3333 8.08333 13.3333ZM5.16667 9.25V6.91667H11V9.25H5.16667Z",fill:"#2F374A"},null,-1)])])}const v1i=j(A1i,[["render",m1i]]);function y1i(t,e=()=>{}){const i=ht("state"),o=ht("$viewer");let n=null,r=null;const a=de(null),s=Oe(()=>i.selectedLabel&&a.value===null),l=Oe(()=>a.value!==null&&!s.value);li(()=>{r=t.value,r.engine.ui.rotatable=!1,r.plugins.pen.pathLineWidth=2,n=b1i(r,i,l)}),Ti(()=>{n?.()}),ft(()=>o.localContext.loadedModels,()=>{i.selectedLabel=null,i.highlightedLabel=null,i.labels.forEach(d=>d.path?.destroy())}),ft(()=>i.selectedClass,(d,u)=>{d&&(i.selectedLabel=null,u?r.plugins.pen.primaryColor=Number.parseInt(d.color,16):a.value="rectangle")}),ft(()=>i.labels.length,()=>{if(!r)return;const{pen:d}=r.plugins;for(const u of i.labels.filter(h=>!h.deleted))u.geometry&&!u.path&&(d.primaryColor=Number.parseInt(u.color,16),u.path=d.draw(u.geometry))},{immediate:!0}),ft(s,d=>{const{pen:u}=r.plugins;d?(u.path=i.selectedLabel.path,u.path.previousPoints=u.path.points,u.startRectangleEditing()):(u.stopRectangleEditing(),u.path=null)});let c=null;return ft(l,d=>{const{pen:u}=r.plugins;d?(u.drawMode="rectangle",u.primaryColor=Number.parseInt(i.selectedClass.color,16),u.startDrawing(),c=u.on("add",({path:h})=>e(h))):(u.stopDrawing(),s.value||(u.path=null),u.off(c))}),ft(()=>i.selectedLabel,(d,u)=>{if(u&&d){const{pen:h}=r.plugins;h.stopRectangleEditing(),h.path=d.path,h.startRectangleEditing()}else d&&(a.value=null,i.selectedClass=null)}),ft(()=>i.highlightedLabel,(d,u)=>{if(u?.path&&(u.path.object.getShape().style.fillOpacity=.2),!d)return;let h=d.parent;for(;h;)h.expanded=!0,h=h.parent;d.path&&(d.path.object.getShape().style.fillOpacity=.3)}),{drawMode:a}}function b1i(t,e,i,o){const n=t.viewer.canvas.parentElement,r=t.viewer.ui.on("click",({object:s})=>{if(!i.value)if(s){const l=e.labels.filter(c=>!c.deleted).find(c=>c.path.object.id===s.id);if(!l)return;e.selectedLabel=l}else i.value||(e.selectedLabel=null)}),a=t.viewer.ui.on("mousemove",({object:s})=>{if(!i.value)if(s){n.style.cursor="pointer";const l=e.labels.filter(c=>!c.deleted).find(c=>c.path.object.id===s.id);if(!l)return;e.highlightedLabel=l}else n.style.cursor="default",e.highlightedLabel=null});return()=>{t.viewer.ui.off(r),t.viewer.ui.off(a)}}const w1i={__name:"Marker",props:{label:{type:Object,required:!0}},setup(t,{expose:e}){const i=t,o=ht("state"),n=`#${i.label.color}`,r=o.labels.filter(l=>l.name===i.label.name),a=`${i.label.name}-${r.indexOf(i.label)}`,s=zo({x:0,y:0});return e({label:i.label,position:s}),(l,c)=>yt((M(),_("div",{class:"bimdata-label__marker",style:ce({left:s.x+"px",top:s.y+"px",backgroundColor:n}),ref:d=>{t.label.marker=d}},q(a),4)),[[zt,at(o).selectedLabel!==t.label]])}};let C1i=0;class uhe{constructor(e,i,o=null,n=null,r=null){this.name=e,this.color=i,this.geometry=o,this.path=n,this.apiId=r,this.id=C1i++,this.marker=de(null),this.deleted=!1}getTopLeftPosition(){const e=this.path?.points??this.geometry,i=Math.min(...e.map(n=>n.x)),o=Math.min(...e.map(n=>n.y));return{x:i,y:o}}hasBeenModified(){if(!this.path||!this.geometry)return!1;if(this.path.points.length!==this.geometry.length)return!0;for(let e=0;e<this.path.points.length;e++){const i=this.path.points[e],o=this.geometry[e];if(i.x!==o.x||i.y!==o.y)return!0}return!1}}function x1i(t){const e=de(null),i=()=>{const n=e.value;n&&n.forEach(r=>{const a=r.label;if(!a||!a.marker)return;const s=a.getTopLeftPosition(),l=t.value.engine.camera.getCanvasPosition(s);r.position.x=l.x-1,r.position.y=l.y-1})};li(()=>{t.value.engine.camera.on("update",()=>i()),t.value.engine.scene.on("object-update",()=>i())});const o=ht("state");return ft(()=>o.labels,()=>{so(()=>i())}),{markersRef:e,updateMarkersPosition:i}}const k1i={class:"bimdata-label-viewer"},M1i={class:"bimdata-label-viewer__markers"},B1i={class:"bimdata-label-viewer__right-tools"},E1i={key:0,class:"bimdata-label-viewer__unsaved-changes-modal"},P1i={class:"bimdata-label-viewer__unsaved-changes-modal__content"},I1i={class:"bimdata-label-viewer__unsaved-changes-modal__content__icon"},S1i={class:"bimdata-label-viewer__unsaved-changes-modal__content__title"},T1i={class:"bimdata-label-viewer__unsaved-changes-modal__content__text"},R1i={class:"bimdata-label-viewer__unsaved-changes-modal__content__buttons"},D1i={__name:"LabelViewer",setup(t){const e=bi(null),i=de(!1),o=ht("$viewer"),n=ht("state"),r=ht("service"),a=Oe(()=>o.localContext.loadingModelIds.length>0);ft(()=>o.localContext.loadedModels[0],(R,F)=>{F&&e.value?.unloadModels([F.id]),R&&e.value?.loadModels([R])},{immediate:!0});const s=Oe(()=>r.projectModels.length),l=Oe(()=>{if(s.value===0)return 0;const R=o.localContext.loadedModels[0];return R?r.projectModels.findIndex(F=>F.id===R.id):0}),{markersRef:c,updateMarkersPosition:d}=x1i(e),u=R=>{const F=n.selectedClass;if(!F){console.warn("No class selected for the label.");return}const U=new uhe(F.name,F.color,null,R);n.labels.push(U),so(()=>d())},{drawMode:h}=y1i(e,u),p=R=>{R.apiId?R.deleted=!0:n.labels=n.labels.filter(F=>F.id!==R.id),R.path.destroy(),R.path=null};let A=null;document.addEventListener("keydown",A=R=>{if(R.key==="Escape"&&(h.value=null,n.selectedClass=null,n.selectedLabel=null),(R.key==="Delete"||R.key==="Backspace")&&n.selectedLabel){const F=n.selectedLabel;n.selectedLabel=null,p(F)}}),Ti(()=>{document.removeEventListener("keydown",A)});const f=R=>{h.value=R},m=()=>{h.value=null},g=()=>{e.value.engine.camera.zoomIn()},y=()=>{e.value.engine.camera.zoomOut()},v=()=>{const R=o.localContext.loadedModels[0];r.saveLabels(R.id,n.labels),r.loadNextModel()},w=()=>n.labels.some(R=>!R.apiId||R.deleted||R.hasBeenModified());let x=null;const k=()=>{if(w()){i.value=!0,x=B;return}B()},B=()=>{const R=r.projectModels[l.value-1];R&&o.localContext.loadModels([R.id]),h.value=null},P=()=>{if(w()){i.value=!0,x=E;return}E()},E=()=>{const R=r.projectModels[l.value+1];R&&o.localContext.loadModels([R.id]),h.value=null},T=()=>{i.value=!1},I=()=>{x?.(),i.value=!1};return(R,F)=>{const U=S("BIMDataButton"),z=S("BIMDataIconWarning");return M(),_("div",k1i,[D(S3,{ref_key:"viewer",ref:e,enablePenPlugin:!0},null,512),b("div",M1i,[(M(!0),_(tt,null,Bt(at(n).labels.filter(H=>!H.deleted),H=>(M(),J(w1i,{key:H.id,label:H,ref_for:!0,ref_key:"markersRef",ref:c},null,8,["label"]))),128))]),D(r1i,{onBack:m,onToolClick:f,class:"bimdata-label-viewer__left-tools",activeTool:at(h)},null,8,["activeTool"]),b("div",B1i,[D(d1i,{class:"bimdata-label-viewer__right-tools__model-selector",modelCount:s.value,currentModelIndex:l.value,loading:a.value,onValidate:v,onPrevious:k,onNext:P},null,8,["modelCount","currentModelIndex","loading"]),D(U,{class:"bimdata-label-viewer__right-tools__button--1",color:"default",fill:"",radius:"",icon:"",width:"50px",height:"50px",style:{"border-radius":"6px"},onClick:g},{default:N(()=>[D(f1i)]),_:1}),D(U,{class:"bimdata-label-viewer__right-tools__button--2",color:"default",fill:"",radius:"",icon:"",width:"50px",height:"50px",style:{"border-radius":"6px"},onClick:y},{default:N(()=>[D(v1i)]),_:1})]),i.value?(M(),_("div",E1i,[b("div",P1i,[b("div",I1i,[D(z,{size:"m",fill:"",color:"high"})]),b("div",S1i,q(R.$t("global.warning"))+"! ",1),b("div",T1i,q(R.$t("label.unsaved-changes")),1),b("div",R1i,[D(U,{color:"primary",ghost:"",radius:"",onClick:T,width:"120px"},{default:N(()=>[We(q(R.$t("global.cancel")),1)]),_:1}),D(U,{color:"high",fill:"",radius:"",onClick:I,width:"120px"},{default:N(()=>[We(q(R.$t("global.ok")),1)]),_:1})])])])):ie("",!0)])}}},L1i=j(D1i,[["__scopeId","data-v-d495d63a"]]),_1i=[{name:"Class test 1",color:"76ffd6"},{name:"Class test 2",color:"ff64da"},{name:"Class test 3",color:"e1ff25"}];class F1i{constructor(){this.$viewer=ht("$viewer");const e=ht("$plugin");let i=Array.isArray(e.settings?.classes)?e.settings.classes:null;i&&(i.length===0||!i.every(o=>typeof o.name=="string"&&typeof o.color=="string"&&o.color.length===6&&[...o.color].every(n=>/[0-9a-fA-F]/.test(n))))&&(console.warn("[BIMDataLabel - Service] Invalid classes provided to the plugin. Using default classes instead. Expected format: [{ name: string, color: string (6 hex characters) }]"),i=null),this.loading=de(!1),this.classes=i??_1i,this._projectModels=de([]),this.getAvailableModels().then(o=>{if(this._projectModels.value=o,o.length>0){const{localContext:n}=this.$viewer;n.loadedModels.length===0&&n.loadingModelIds.length===0&&n.loadModels([o[0].id])}})}get projectModels(){return this._projectModels.value}getClasses(){return Promise.resolve(this.classes)}async getLabels(e){if(!e)throw new TypeError("[BIMDataViewer - Label.Service] modelId is required to get labels.");const{apiClient:i,cloudId:o,projectId:n}=this.$viewer.api;try{return(await i.modelApi.getLabels(o,e,n)).map(r=>new uhe(r.name,r.color,r.geometry,null,r.id))}catch(r){return console.error("[BIMDataViewer - Label.Service] Cannot get labels for modelId: ",e,". Error: ",r),[]}}saveLabels(e,i){if(!e)throw new TypeError("[BIMDataViewer - Label.Service] modelId is required to save labels.");const o=[],n=[],r=[];for(const d of i)d.apiId===null?o.push(d):d.deleted?n.push(d):d.hasBeenModified()&&r.push(d);const{apiClient:a,cloudId:s,projectId:l}=this.$viewer.api,c=[];return o.length>0&&c.push(...o.map(d=>a.modelApi.createLabel(s,e,l,{name:d.name,color:d.color,geometry:d.path.points}))),n.length>0&&c.push(...n.map(d=>a.modelApi.deleteLabel(s,d.apiId,e,l))),r.length>0&&c.push(...r.map(d=>a.modelApi.updateLabel(s,d.apiId,e,l,{geometry:d.path.points}))),Promise.all(c)}loadNextModel(){const{localContext:e}=this.$viewer,i=this.projectModels.findIndex(o=>o.id===e.loadedModels[0]?.id);if(i<this.projectModels.length-1){const o=this.projectModels[i+1];e.loadModels([o.id])}}async getAvailableModels(){const{api:e,state:i,localContext:o}=this.$viewer;this.loading.value=!0;try{return(await e.apiClient.modelApi.getModels(e.cloudId,e.projectId,void 0,void 0,o.modelTypes)).filter(n=>i.models.some(r=>r.archived)||!n.archived).sort($s("updated_at",!1))}catch(n){console.error("[BIMDataLabel - Service] Cannot get project models. Error: ",n)}finally{this.loading.value=!1}return[]}}const O1i={class:"bimdata-label"},U1i={__name:"BIMDataLabel",setup(t){const e=new F1i,i=zo({classes:[],selectedClass:null,labels:[],selectedLabel:null,highlightedLabel:null});window.state=i,zi("state",i),zi("service",e),e.getClasses().then(n=>{i.classes=n});const o=ht("$viewer");return ft(()=>o.localContext.loadedModels[0],async n=>{if(n)try{o.localContext.loadingProcessStart(),i.labels=await e.getLabels(n.id),i.selectedLabel=null,i.highlightedLabel=null}finally{o.localContext.loadingProcessEnd()}},{immediate:!0}),(n,r)=>(M(),_("div",O1i,[D(Jpi,{class:"bimdata-label__list"}),D(L1i,{class:"bimdata-label__viewer"})]))}},N1i=j(U1i,[["__scopeId","data-v-5813dd8b"]]),j1i={},H1i={title:"Classes",description:"Equipment categories"},V1i={title:"Labels",description:"Created equipment"},z1i={classes:H1i,labels:V1i,"unsaved-changes":"You have unsaved changes. Are you sure you want to leave without validating them ?"},q1i={},Q1i={title:"Classes",description:"Cat\xE9gories d'\xE9quipements"},G1i={title:"Labels",description:"Equipements cr\xE9\xE9s"},K1i={classes:Q1i,labels:G1i,"unsaved-changes":"Vous avez des modifications non enregistr\xE9es. \xCAtes-vous s\xFBr de vouloir quitter sans les valider ?"},J1i={name:"label",i18n:{de:j1i,en:z1i,es:q1i,fr:K1i},component:N1i,window:{name:"label",header:!1,displayedInWindowSelector:!1,modelTypes:["JPEG","PNG"],multiModel:!1}},Z1i={},W1i={width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Y1i(t,e){return M(),_("svg",W1i,[...e[0]||(e[0]=[b("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M5 0H7V2H5V0ZM3 8H5V10H3V8ZM10 3H8V5H10V3ZM0 5H2V7H0V5ZM2 10H0V12H2V10ZM20 5H22V7H20V5ZM22 10H20V12H22V10ZM0 15H2V17H0V15ZM2 20H0V22H2V20ZM10 0H12V2H10V0ZM7 22V20H5V22H7ZM12 20V22H10V20H12ZM17 0H15V2H17V0ZM20 0H22V2H20V0ZM11 6H13V8H11V6ZM9.70711 16.0711C9.31658 15.6806 9.31658 15.0474 9.70711 14.6569L14.6569 9.70711C15.0474 9.31659 15.6805 9.31659 16.0711 9.70711L24.5563 18.1924C24.9469 18.5829 24.9469 19.2161 24.5563 19.6066L19.6066 24.5564C19.2161 24.9469 18.5829 24.9469 18.1924 24.5564L9.70711 16.0711ZM12.5355 16.0711C12.145 15.6806 12.145 15.0474 12.5355 14.6569L14.6569 12.5355C15.0474 12.145 15.6805 12.145 16.0711 12.5355L17.4853 13.9498C17.8758 14.3403 17.8758 14.9734 17.4853 15.364L15.364 17.4853C14.9734 17.8758 14.3403 17.8758 13.9497 17.4853L12.5355 16.0711ZM8 13V11H6V13H8Z",fill:"#2F374A"},null,-1)])])}const X1i=j(Z1i,[["render",Y1i]]),$1i="Plan cleaning",e0i={tooltip:$1i},t0i="Nettoyage de plan",i0i={tooltip:t0i},o0i={name:"plan-mask-button",i18n:{en:e0i,fr:i0i},addToWindows:["plan"],button:{tooltip:"plan-mask-button.tooltip",position:"right",content:"free",icon:{component:X1i}},component:{render(){return null},setup(){const t=ht("$viewer"),e=ht("$plugin");Da(()=>{t.localContext.loadedModels.length===1?e.shown||e.show():e.shown&&e.hide()})},onOpen(){const t=this.$viewer.globalContext.layout;this.$viewer.globalContext.hub.emit("plan-mask:open",t);const e=this.$viewer.localContext.loadedModels[0];let i=e.id;if(e.type==="METABUILDING"){const n=this.$viewer.localContext.selectedStorey?.plans[0]?.plan.id;n!==void 0&&(i=n)}const o=this.$viewer.localContext.selectedStorey?.key;this.$viewer.globalContext.layout={windowName:"plan-mask",windowState:{modelIds:[i],storey:o}}}}},r0i={},n0i={width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function a0i(t,e){return M(),_("svg",n0i,[...e[0]||(e[0]=[b("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M5 0H7V2H5V0ZM3 8H5V10H3V8ZM10 3H8V5H10V3ZM0 5H2V7H0V5ZM2 10H0V12H2V10ZM20 5H22V7H20V5ZM22 10H20V12H22V10ZM0 15H2V17H0V15ZM2 20H0V22H2V20ZM10 0H12V2H10V0ZM7 22V20H5V22H7ZM12 20V22H10V20H12ZM17 0H15V2H17V0ZM20 0H22V2H20V0ZM11 6H13V8H11V6ZM9.70711 16.0711C9.31658 15.6806 9.31658 15.0474 9.70711 14.6569L14.6569 9.70711C15.0474 9.31659 15.6805 9.31659 16.0711 9.70711L24.5563 18.1924C24.9469 18.5829 24.9469 19.2161 24.5563 19.6066L19.6066 24.5564C19.2161 24.9469 18.5829 24.9469 18.1924 24.5564L9.70711 16.0711ZM12.5355 16.0711C12.145 15.6806 12.145 15.0474 12.5355 14.6569L14.6569 12.5355C15.0474 12.145 15.6805 12.145 16.0711 12.5355L17.4853 13.9498C17.8758 14.3403 17.8758 14.9734 17.4853 15.364L15.364 17.4853C14.9734 17.8758 14.3403 17.8758 13.9497 17.4853L12.5355 16.0711ZM8 13V11H6V13H8Z",fill:"#2F374A"},null,-1)])])}const s0i=j(r0i,[["render",a0i]]),l0i={class:"bimdata-plan-mask__header"},c0i={class:"bimdata-plan-mask__header__texts"},d0i={class:"bimdata-plan-mask__header__texts__title"},u0i={class:"bimdata-plan-mask__header__texts__model"},h0i={class:"bimdata-plan-mask__header__buttons"},p0i={__name:"PlanMaskHeader",setup(t){const e=ht("$viewer"),i=ht("state"),o=ht("service"),n=Oe(()=>i.newCropPathByModelId.size===0&&i.newFiltersByModelId.size===0),r=de(!1),a=Oe(()=>e.localContext.loadedModels.length===0);let s=null;e.globalContext.hub.once("plan-mask:open",(u=null)=>{s=u},{getLastEvent:!0});const l=Oe(()=>e.localContext.loadedModels[0]),c=()=>{e.globalContext.layout=s},d=async()=>{r.value=!0,await o.savePlanMasks(i),delete s.windowState.viewpoint,e.globalContext.layout=s};return(u,h)=>{const p=S("BIMDataButton"),A=S("BIMDataSpinner");return M(),_("div",l0i,[b("div",c0i,[D(s0i,{class:"m-x-6"}),b("span",d0i,q(u.$t("plan-mask.title")),1),h[0]||(h[0]=b("span",{class:"m-x-12"},"-",-1)),b("span",u0i,q(l.value?l.value.name:`... ${u.$t("global.loading")}`),1)]),b("div",h0i,[D(p,{color:"high",fill:"",radius:"",class:"m-x-6",width:"120px",onClick:c},{default:N(()=>[We(q(u.$t("global.cancel")),1)]),_:1}),D(p,{color:"primary",fill:"",radius:"",class:"m-x-6",width:"120px",disabled:n.value,onClick:d},{default:N(()=>[r.value||a.value?(M(),J(A,{key:0})):(M(),_(tt,{key:1},[We(q(u.$t("global.done")),1)],64))]),_:1},8,["disabled"])])])}}},f0i=j(p0i,[["__scopeId","data-v-5f535646"]]),A0i={},g0i={width:"13",height:"17",viewBox:"0 0 13 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function m0i(t,e){return M(),_("svg",g0i,[...e[0]||(e[0]=[b("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.0205887 0.760241C-0.0369001 0.612234 0.0293064 0.447777 0.177996 0.369239L0.794439 0.0436382C0.943129 -0.0348991 1.13191 -0.00512553 1.24327 0.114426C2.20441 1.14624 3.98875 2.45304 5.91415 3.77084C6.67376 4.29074 7.45537 4.81236 8.20995 5.31594C9.3481 6.0755 10.4248 6.79402 11.2717 7.40369C12.7916 8.49791 13.1419 9.88267 12.9535 11.1463C12.784 12.2835 12.1812 13.3235 11.6281 13.9998L12.22 14.9378C12.3183 15.0935 12.26 15.2927 12.0898 15.3826L9.11031 16.9563C8.94008 17.0462 8.72242 16.9929 8.62414 16.8371L8.0322 15.8992C7.11546 15.9992 5.82958 15.9568 4.66823 15.5225C3.3779 15.04 2.24219 14.0701 1.96637 12.3187C1.82059 11.393 1.68028 10.2545 1.53148 9.04694C1.41992 8.14169 1.30358 7.19767 1.17658 6.27549C0.876924 4.09967 0.517281 2.039 0.0205887 0.760241ZM1.10889 1.88952C1.4235 3.12855 1.67045 4.65216 1.8828 6.19409C2.01281 7.13806 2.12977 8.08803 2.24122 8.99317C2.38829 10.1877 2.52577 11.3043 2.67091 12.2258C2.90528 13.714 3.84317 14.5105 4.93756 14.9197C6.05334 15.337 7.33156 15.3476 8.16398 15.225C8.30978 15.2035 8.45493 15.2666 8.52877 15.3836L9.06263 16.2296L11.4257 14.9814L10.8918 14.1355C10.818 14.0185 10.8308 13.8719 10.924 13.7671C11.4563 13.1689 12.0853 12.1509 12.2483 11.0582C12.408 9.98654 12.1231 8.84526 10.8315 7.91546C9.99174 7.31094 8.93656 6.60686 7.80965 5.85492C7.05354 5.3504 6.26503 4.82427 5.48775 4.29227C4.0633 3.31734 2.67549 2.32196 1.63764 1.42496L6.84795 9.68113C7.39973 9.55339 7.99902 9.7688 8.29767 10.242C8.65803 10.813 8.44417 11.5432 7.82001 11.8729C7.19585 12.2026 6.39774 12.0069 6.03738 11.4359C5.73868 10.9626 5.83449 10.38 6.23147 10.0067L1.10889 1.88952Z",fill:"#2F374A"},null,-1)])])}const v0i=j(A0i,[["render",m0i]]);function y0i(t,e){const i=ht("state"),{newFiltersByModelId:o}=i,n=de(!1),r=de(100),a=de(100),s=de(1),l=Oe({get:()=>Math.round(s.value*100),set:y=>{s.value=y/100}}),c=Oe(()=>n.value===!1&&r.value===100&&a.value===100&&s.value===1),d=de(!1);ft(e,y=>{if(d.value=!1,!y?.mask_2d)return;const v=y.mask_2d;n.value=v.grayscale??!1,r.value=v.brightness??100,a.value=v.contrast??100,s.value=v.opacity??1},{immediate:!0});const u=de(!1),h=()=>{u.value=!1},p=()=>{const y=o.get(e.value?.id);if(y)n.value=y.grayscale??!1,r.value=y.brightness??100,a.value=y.contrast??100,s.value=y.opacity??1;else{const v=e.value?.mask_2d;n.value=v?.grayscale??!1,r.value=v?.brightness??100,a.value=v?.contrast??100,s.value=v?.opacity??1}d.value=!1,u.value=!1},A=Oe(()=>{if(!e.value)return!1;if(!o.has(e.value?.id)){const v=e.value.mask_2d;return v?(v.grayscale??!1)!==n.value||(v.brightness??100)!==r.value||(v.contrast??100)!==a.value||(v.opacity??1)!==s.value:n.value!==!1||r.value!==100||a.value!==100||s.value!==1}const y=o.get(e.value?.id);return y&&((y.grayscale??!1)!==n.value||(y.brightness??100)!==r.value||(y.contrast??100)!==a.value||(y.opacity??1)!==s.value)}),f=()=>{d.value===!1?d.value=!0:A.value?u.value=!0:d.value=!1};ft([n,r,a,s],()=>{if(!e.value)return;const y=e.value.parent?.document??e.value.document,v=t.value.plugins.bitmaps,w=v.bitmaps.find(x=>x.document.id===y.id);w&&(w.tempMask===void 0&&(w.tempMask=null),c.value?w.tempMask&&(w.tempMask.crop_path?(w.tempMask.grayscale=void 0,w.tempMask.brightness=void 0,w.tempMask.contrast=void 0,w.tempMask.opacity=void 0):w.tempMask=null):(w.tempMask||(w.tempMask={}),w.tempMask.grayscale=n.value!==!1?n.value:void 0,w.tempMask.brightness=r.value!==100?r.value:void 0,w.tempMask.contrast=a.value!==100?a.value:void 0,w.tempMask.opacity=s.value!==1?s.value:void 0),v.draw())},{immediate:!0});const m=()=>{n.value=!1,r.value=100,a.value=100,s.value=1};function g(y={}){return y.grayscale=n.value!==!1?n.value:void 0,y.brightness=r.value!==100?r.value:void 0,y.contrast=a.value!==100?a.value:void 0,y.opacity=s.value!==1?s.value:void 0,y}return{parametersDisplayed:d,onDisplayParametersClick:f,warningModelDisplayed:u,unsavedChanges:A,allFiltersDefault:c,onModalCancel:h,onModalOk:p,grayscale:n,brightness:r,contrast:a,opacity:l,onResetParametersClick:m,onApplyParametersClick:()=>{if(!e.value)return;const y=c.value,v=o.get(e.value.id);v?y?e.value.mask_2d?o.set(e.value.id,null):o.delete(e.value.id):g(v):y?e.value.mask_2d&&o.set(e.value.id,null):o.set(e.value.id,g()),d.value=!1}}}function b0i(){const t=de(null),e=(o="path")=>{t.value===o?t.value=null:t.value=o},i=o=>{o.key==="Escape"&&(t.value=null)};return document.addEventListener("keydown",i),Ti(()=>{document.removeEventListener("keydown",i)}),{drawMode:t,onDrawClick:e}}function w0i(t,e,i){const o=ht("state"),{newCropPathByModelId:n}=o;let r=null;ft(i,c=>{const{pen:d}=t.value.plugins;d.primaryColor=8840,c!==null?(d.drawMode=c,d.startDrawing(),r=d.once("add",({path:u})=>{i.value=null,n.set(e.value.id,u.points.slice()),setTimeout(()=>u.destroy(),0)})):(d.stopDrawing(),d.path=null,d.off(r))});const a=()=>{e.value.mask_2d?n.set(e.value.id,null):n.delete(e.value.id)},s=Oe(()=>{if(!e.value)return null;if(n.has(e.value.id))return n.get(e.value.id);if(e.value.mask_2d?.crop_path)return e.value.mask_2d.crop_path.map(c=>({x:c[0],y:c[1]}))});let l=null;return ft(s,c=>{if(l?.destroy(),c){const{pen:d}=t.value.plugins;d.primaryColor=16711680,l=d.draw(c)}},{immediate:!0}),{currentCropPath:s,onDeleteClick:a}}function C0i(t){const e=ht("$viewer"),i=Oe(()=>e.localContext.loadedModels[0]);ft(i,r=>{r&&t.value?.loadModels([r])},{immediate:!0});const o=Oe(()=>t.value?.pdfPages??[]),n=Oe(()=>t.value?.pdfPageIndex??0);return{model:i,pdfPages:o,pdfPageIndex:n,setPdfPage:r=>{t.value?.setPdfPage(r)}}}const x0i={class:"bimdata-plan-mask__viewer"},k0i={key:0,class:"bimdata-plan-mask__viewer__options"},M0i={class:"bimdata-plan-mask__viewer__options__buttons"},B0i={key:0,class:"bimdata-plan-mask__viewer__options__parameters"},E0i={key:0,class:"bimdata-plan-mask__viewer__options__parameters__warning"},P0i={class:"bimdata-plan-mask__viewer__options__parameters__warning__icon"},I0i={class:"bimdata-plan-mask__viewer__options__parameters__warning__title"},S0i={class:"bimdata-plan-mask__viewer__options__parameters__warning__text"},T0i={class:"bimdata-plan-mask__viewer__options__parameters__warning__buttons"},R0i={class:"bimdata-plan-mask__viewer__options__parameters__title"},D0i={class:"bimdata-plan-mask__viewer__options__parameters__parameter--toggle"},L0i={class:"bimdata-plan-mask__viewer__options__parameters__parameter--range"},_0i={class:"bimdata-plan-mask__viewer__options__parameters__parameter--range"},F0i={class:"bimdata-plan-mask__viewer__options__parameters__parameter--range"},O0i={class:"bimdata-plan-mask__viewer__options__parameters__buttons"},U0i={__name:"PlanMaskViewer",setup(t){const e=bi(null),{drawMode:i,onDrawClick:o}=b0i(),{model:n,pdfPages:r,pdfPageIndex:a,setPdfPage:s}=C0i(e),{currentCropPath:l,onDeleteClick:c}=w0i(e,n,i),{parametersDisplayed:d,onDisplayParametersClick:u,warningModelDisplayed:h,onModalCancel:p,onModalOk:A,unsavedChanges:f,allFiltersDefault:m,grayscale:g,brightness:y,contrast:v,opacity:w,onResetParametersClick:x,onApplyParametersClick:k}=y0i(e,n);return(B,P)=>{const E=S("BIMDataIconParameters"),T=S("BIMDataButton"),I=S("BIMDataIconDelete"),R=S("BIMDataIconWarning"),F=S("BIMDataToggle"),U=S("BIMDataSlider");return M(),_("div",x0i,[at(n)?(M(),_("div",k0i,[b("div",M0i,[D(T,{fill:"",square:"",icon:"",onClick:at(u),color:at(d)?"secondary":"default"},{default:N(()=>[D(E,{fill:"",size:"xs"})]),_:1},8,["onClick","color"]),at(l)?(M(),J(T,{key:1,fill:"",square:"",icon:"",onClick:P[2]||(P[2]=z=>at(c)())},{default:N(()=>[D(I,{fill:"",color:"high",size:"xs"})]),_:1})):(M(),_(tt,{key:0},[D(T,{color:at(i)==="rectangle"?"secondary":"default",fill:"",square:"",icon:"",onClick:P[0]||(P[0]=z=>at(o)("rectangle"))},{default:N(()=>[...P[7]||(P[7]=[b("div",{class:"bimdata-plan-mask__viewer__rectangle-icon"},null,-1)])]),_:1},8,["color"]),D(T,{color:at(i)==="path"?"secondary":"default",fill:"",square:"",icon:"",onClick:P[1]||(P[1]=z=>at(o)("path"))},{default:N(()=>[D(v0i)]),_:1},8,["color"])],64))]),at(d)?(M(),_("div",B0i,[at(h)?(M(),_("div",E0i,[b("div",P0i,[D(R,{size:"m",fill:"",color:"high"})]),b("div",I0i,q(B.$t("global.warning"))+"! ",1),b("div",S0i,q(B.$t("plan-mask.parameters.warning_text")),1),b("div",T0i,[D(T,{color:"primary",ghost:"",radius:"",onClick:at(p),width:"120px"},{default:N(()=>[We(q(B.$t("global.cancel")),1)]),_:1},8,["onClick"]),D(T,{color:"high",fill:"",radius:"",onClick:at(A),width:"120px"},{default:N(()=>[We(q(B.$t("global.ok")),1)]),_:1},8,["onClick"])])])):(M(),_(tt,{key:1},[b("div",R0i,[D(E,{fill:"",size:"xs"}),b("span",null,q(B.$t("plan-mask.parameters.title")),1)]),b("div",D0i,[b("span",null,q(B.$t("plan-mask.parameters.grayscale")),1),D(F,{modelValue:at(g),"onUpdate:modelValue":P[3]||(P[3]=z=>fo(g)?g.value=z:null)},null,8,["modelValue"])]),b("div",L0i,[b("div",null,q(B.$t("plan-mask.parameters.brightness"))+" : "+q(at(y))+"% ",1),D(U,{modelValue:at(y),"onUpdate:modelValue":P[4]||(P[4]=z=>fo(y)?y.value=z:null),min:0,max:200,step:1},null,8,["modelValue"])]),b("div",_0i,[b("div",null,q(B.$t("plan-mask.parameters.contrast"))+" : "+q(at(v))+"% ",1),D(U,{modelValue:at(v),"onUpdate:modelValue":P[5]||(P[5]=z=>fo(v)?v.value=z:null),min:0,max:200,step:1},null,8,["modelValue"])]),b("div",F0i,[b("div",null,q(B.$t("plan-mask.parameters.opacity"))+" : "+q(at(w))+"%",1),D(U,{modelValue:at(w),"onUpdate:modelValue":P[6]||(P[6]=z=>fo(w)?w.value=z:null),min:0,max:100,step:1},null,8,["modelValue"])]),b("div",O0i,[D(T,{color:"primary",outline:"",radius:"",width:"135px",height:"36px",disabled:at(m),onClick:at(x)},{default:N(()=>[We(q(B.$t("global.reset")),1)]),_:1},8,["disabled","onClick"]),D(T,{color:"primary",fill:"",radius:"",width:"135px",height:"36px",disabled:!at(f),onClick:at(k)},{default:N(()=>[We(q(B.$t("global.apply")),1)]),_:1},8,["disabled","onClick"])])],64))])):ie("",!0)])):ie("",!0),D(S3,{ref_key:"viewer",ref:e,enablePenPlugin:"",enablePlanMask:!1,ignoreCropPathWhileFitView:""},{default:N(()=>[at(r).length>0?(M(),J(lS,{key:0,pages:at(r),index:at(a),onInput:at(s),onPrev:at(s),onNext:at(s)},null,8,["pages","index","onInput","onPrev","onNext"])):ie("",!0)]),_:1},512)])}}},N0i=j(U0i,[["__scopeId","data-v-c240912b"]]);class j0i{constructor(e){this.$viewer=e}async savePlanMasks(e){const{$viewer:i}=this,{newCropPathByModelId:o,newFiltersByModelId:n}=e,r=[...Array.from(new Set(o.keys())),...Array.from(new Set(n.keys()))],a=new Map;for(const s of r){const l=o.get(s),c=n.get(s),d=i.state.modelsMap.get(s);if(!d){console.warn(`[Plan Mask] Model with ID ${s} not found in state.modelsMap`);continue}if(d.mask_2d&&l===null&&c===null){a.set(s,null);continue}const u={};o.has(s)&&(u.crop_path=l?.map(h=>[h.x,h.y])??null),n.has(s)&&(u.grayscale=c?.grayscale??!1,u.contrast=c?.contrast??100,u.brightness=c?.brightness??100,u.opacity=c?.opacity??1),a.set(s,u)}try{const{apiClient:s,cloudId:l,projectId:c}=i.api;await Promise.all(Array.from(a.entries()).map(async([d,u])=>{if(u===null)await s.modelApi.deleteMask2D(l,d,c),S8(i.state,d,null);else if(i.state.modelsMap.get(d).mask_2d){const h=await s.modelApi.updateMask2D(l,d,c,u);S8(i.state,d,h)}else{const h=await s.modelApi.createMask2D(l,d,c,u);S8(i.state,d,h)}}))}catch(s){console.error(`[Plan Mask] Impossible to save the masks of the models : ${Array.from(a.keys()).join(", ")}`,s)}}}const H0i={class:"bimdata-plan-mask"},V0i={__name:"PlanMask",setup(t){const e=zo({newCropPathByModelId:new Map,newFiltersByModelId:new Map});zi("state",e);const i=new j0i(ht("$viewer"));return zi("service",i),(o,n)=>(M(),_("div",H0i,[D(f0i),D(N0i,{class:"bimdata-plan-mask__content__viewer"})]))}},z0i=j(V0i,[["__scopeId","data-v-8df06378"]]),q0i="Targeted Display",Q0i={title:"Adjust image",grayscale:"Grayscale",brightness:"Brightness",contrast:"Contrast",opacity:"Opacity",warning_text:"You have unsaved changes, are you sure you want to quit?"},G0i={title:q0i,parameters:Q0i},K0i="Affichage Cibl\xE9",J0i={title:"Ajuster l'image",grayscale:"Niveaux de gris",brightness:"Luminosit\xE9",contrast:"Contraste",opacity:"Opacit\xE9",warning_text:"Vous avez des modifications non enregistr\xE9es, \xEAtes-vous s\xFBr de vouloir quitter ?"},Z0i={title:K0i,parameters:J0i},W0i={name:"plan-mask",i18n:{en:G0i,fr:Z0i},component:z0i,window:{name:"plan-mask",header:!1,displayedInWindowSelector:!1,modelTypes:["PDF","JPEG","PNG","METABUILDING"],multiModel:!1}};function hhe(t=()=>{},e=()=>{},i=null){const o=de(!1),n=de(i),r=zo({x:0,y:0});function a(c){if((e?.(c)??!0)===!1)return;o.value=!0;const{x:d,y:u}=n.value.getBoundingClientRect();r.x=c.clientX-d,r.y=c.clientY-u,document.addEventListener("mouseup",s),document.addEventListener("mousemove",l)}function s(){document.removeEventListener("mousemove",l),o.value=!1}function l(c){t?.(c)}return li(()=>n.value.addEventListener("mousedown",a)),as(()=>n.value.removeEventListener("mousedown",a)),{grabbing:o,templateRef:n,startPosition:r}}const Y0i=["attrs"],X0i={key:0,width:"140",height:"140",viewBox:"0 0 140 140",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{position:"absolute",transform:"translate(-50%, -50%)","pointer-events":"none"}},$0i=["d","fill"],efi=["width","viewBox"],tfi=["x2"],ifi=["x2","stroke-dasharray"],ofi=["opacity"],rfi={key:3,width:"6",height:"6",viewBox:"0 0 6 6",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{position:"absolute",transform:"translate(-50%, -50%)","pointer-events":"none"}},nfi=25,afi={__name:"Rotation2D",props:{canvasPosition:{type:Object,required:!0},position:{type:Object,required:!0}},emits:["marker-move"],setup(t,{emit:e}){const i=ht("$viewer").localContext.viewer.viewer,o=i.canvas.parentElement.style,n=o.cursor,r=e,a=t,s=zo({x:a.canvasPosition.x,y:a.canvasPosition.y}),l=Oe(()=>({x:s.x-a.canvasPosition.x,y:s.y-a.canvasPosition.y})),c=Oe(()=>{const{x:F,y:U}=l.value;return Math.sqrt(F*F+U*U)}),d=Oe(()=>{const{x:F,y:U}=l.value;return Math.atan2(U,F)*(180/Math.PI)}),{grabbing:u,templateRef:h}=hhe(F=>{const{clientX:U,clientY:z}=F,{x:H,y:W}=i.canvas.getBoundingClientRect(),{x:Y,y:$}=i.camera.getPosition({x:U-H,y:z-W});s.x=U-H,s.y=z-W,r("marker-move",{x:Y,y:$})},F=>{F.stopPropagation(),F.preventDefault()}),p=Oe(()=>{const{x:F,y:U}=a.canvasPosition,{x:z,y:H}=k;return Math.atan2(H-U,z-F)*(180/Math.PI)}),A=Oe(()=>{const{x:F,y:U}=a.canvasPosition,{x:z,y:H}=k,W=z-F,Y=H-U,$=68/Math.sqrt(W*W+Y*Y);return{x:W*$,y:Y*$}}),f=Oe(()=>{const{x:F,y:U}=l.value,z=68/Math.sqrt(F*F+U*U);return{x:F*z+70,y:U*z+70}}),m=Oe(()=>{const{x:F,y:U}=f.value;return Math.atan2(U-70,F-70)});function g(F,U,z){return`url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="${U}" height="${z}" viewBox="0 0 ${U} ${z}">${F}</svg>')`}const y=Oe(()=>`${g(`<path d="M19.7004 2.28955L19.2674 1.53955L18.8344 2.28955L14.9856 8.95583L14.5526 9.70583H15.4186H18.1325V16.507V17.007H18.6325H19.9023H20.4023V16.507V9.70583H23.1162H23.9822L23.5492 8.95583L19.7004 2.28955ZM18.8344 37.0733L19.2674 37.8233L19.7004 37.0733L23.5492 30.407L23.9822 29.657H23.1162H20.4023V22.8558V22.3558H19.9023H18.6325H18.1325V22.8558V29.657H15.4186H14.5526L14.9856 30.407L18.8344 37.0733Z" fill="black" stroke="white" transform="rotate(${m.value*(180/Math.PI)})" transform-origin="center" />`,39,39)} 20 20, auto`);ft(y,F=>{o.cursor=F},{immediate:!0}),ft(u,F=>{F?o.cursor="crosshair":o.cursor=y.value});const v=Oe(()=>{const{x:F,y:U}=A.value,z=Math.atan2(U,F);let H=m.value-z;return H<-Math.PI?H+=2*Math.PI:H>Math.PI&&(H-=2*Math.PI),H});let w=0;const{grabbing:x,startPosition:k}=hhe(()=>{const F=-(v.value/Math.PI)*180;i.camera.rotate(F-w,a.position),w=F},F=>{if(F.shiftKey)return!1;F.stopPropagation(),F.preventDefault()},i.canvas);ft(x,F=>{F?(i.ui.rotatable=!1,i.ui.translatable=!1,i.ui.scallable=!1):(w=0,i.ui.rotatable=!0,i.ui.translatable=!0,i.ui.scallable=!0)});const B=de(!1),P=Oe(()=>B.value&&x.value);i.ui.on("mousemove",({canvasPosition:F,altKey:U})=>{const{x:z,y:H}=F;if(!x.value||U){s.x=z,s.y=H,B.value=!1;return}const W={x:z-a.canvasPosition.x,y:H-a.canvasPosition.y},Y=Math.atan2(W.y,W.x),$=Math.round(Y/(Math.PI/4))*(Math.PI/4),fe=Math.cos($)*Math.sqrt(W.x*W.x+W.y*W.y),Me=Math.sin($)*Math.sqrt(W.x*W.x+W.y*W.y);Math.sqrt((fe-W.x)*(fe-W.x)+(Me-W.y)*(Me-W.y))<nfi?(s.x=a.canvasPosition.x+fe,s.y=a.canvasPosition.y+Me,B.value=!0):(s.x=z,s.y=H,B.value=!1)});const E=Oe(()=>v.value>0?1:0),T=de(!1),I=de("grab");let R=null;return ft(T,F=>{F&&!R?R=setInterval(()=>{T.value&&(I.value=I.value==="grab"?"grabbing":"grab")},500):!F&&R&&(clearInterval(R),R=null,I.value="grab")}),Ti(()=>{o.cursor=n}),(F,U)=>(M(),_(tt,null,[(M(),_("svg",{attrs:F.$attrs,width:"140",height:"140",viewBox:"0 0 140 140",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{position:"absolute",transform:"translate(-50%, -50%)","pointer-events":"none"}},[...U[2]||(U[2]=[b("circle",{cx:"70",cy:"70",r:"68",stroke:"#2F374A","stroke-width":"2"},null,-1)])],8,Y0i)),at(x)?(M(),_("svg",X0i,[b("path",{d:`
5529
+ `,Tb=class tAe{constructor(){this.$=tAe.IDLE}is(...e){return e.some(i=>this.$&i)}set(e){this.$=e}add(e){this.$|=e}remove(e){this.$&=~e}};Tb.IDLE=0,Tb.CLICK=1,Tb.MOVING=2;var pr=Tb,ppi=class extends g4{constructor(t){super(t),this.data={startMouseX:0,startMouseY:0,mouseX:0,mouseY:0,pinchDist:0,moveDelta:{yaw:0,pitch:0,zoom:0},accumulatorFactor:0,ctrlKeyDown:!1,dblclickData:null,dblclickTimeout:null,longtouchTimeout:null,twofingersTimeout:null,ctrlZoomTimeout:null},this.step=new pr,this.keyHandler=new Mb,this.resizeObserver=new ResizeObserver(jde(()=>this.viewer.autoSize(),50)),this.moveThreshold=xde*Fn.pixelRatio}init(){window.addEventListener("keydown",this,{passive:!1}),window.addEventListener("keyup",this),this.viewer.container.addEventListener("mousedown",this),window.addEventListener("mousemove",this,{passive:!1}),window.addEventListener("mouseup",this),this.viewer.container.addEventListener("touchstart",this,{passive:!1}),window.addEventListener("touchmove",this,{passive:!1}),window.addEventListener("touchend",this,{passive:!1}),this.viewer.container.addEventListener("wheel",this,{passive:!1}),document.addEventListener("fullscreenchange",this),this.resizeObserver.observe(this.viewer.container),this.viewer.addEventListener(r4.type,this),this.viewer.addEventListener(h4.type,this)}destroy(){window.removeEventListener("keydown",this),window.removeEventListener("keyup",this),this.viewer.container.removeEventListener("mousedown",this),window.removeEventListener("mousemove",this),window.removeEventListener("mouseup",this),this.viewer.container.removeEventListener("touchstart",this),window.removeEventListener("touchmove",this),window.removeEventListener("touchend",this),this.viewer.container.removeEventListener("wheel",this),document.removeEventListener("fullscreenchange",this),this.resizeObserver.disconnect(),this.viewer.removeEventListener(r4.type,this),this.viewer.removeEventListener(h4.type,this),clearTimeout(this.data.dblclickTimeout),clearTimeout(this.data.longtouchTimeout),clearTimeout(this.data.twofingersTimeout),clearTimeout(this.data.ctrlZoomTimeout),super.destroy()}handleEvent(t){switch(t.type){case"keydown":this.__onKeyDown(t);break;case"keyup":this.__onKeyUp();break;case"mousemove":this.__onMouseMove(t);break;case"mouseup":this.__onMouseUp(t);break;case"touchmove":this.__onTouchMove(t);break;case"touchend":this.__onTouchEnd(t);break;case"fullscreenchange":this.__onFullscreenChange();break;case r4.type:this.__applyMoveDelta();break;case h4.type:this.__clearMoveDelta();break}if(!_de(t,"."+t4))switch(t.type){case"mousedown":this.__onMouseDown(t);break;case"touchstart":this.__onTouchStart(t);break;case"wheel":this.__onMouseWheel(t);break}}__onKeyDown(t){if(this.config.mousewheelCtrlKey&&(this.data.ctrlKeyDown=t.key===Sr.Control,this.data.ctrlKeyDown&&(clearTimeout(this.data.ctrlZoomTimeout),this.viewer.overlay.hide(Gr.CTRL_ZOOM))),!!this.viewer.dispatchEvent(new ru(t.key,t))&&!(!this.state.keyboardEnabled||!this.config.keyboardActions||this.keyHandler.pending)){for(const[e,i]of Object.entries(this.config.keyboardActions))if(MR(t,e)){if(typeof i=="function")i(this.viewer,t);else{switch(i!=="ZOOM_IN"&&i!=="ZOOM_OUT"&&this.viewer.stopAll(),i){case"ROTATE_UP":this.viewer.dynamics.position.roll({pitch:!1});break;case"ROTATE_DOWN":this.viewer.dynamics.position.roll({pitch:!0});break;case"ROTATE_RIGHT":this.viewer.dynamics.position.roll({yaw:!1});break;case"ROTATE_LEFT":this.viewer.dynamics.position.roll({yaw:!0});break;case"ZOOM_IN":this.viewer.dynamics.zoom.roll(!1);break;case"ZOOM_OUT":this.viewer.dynamics.zoom.roll(!0);break}this.keyHandler.down(i)}t.preventDefault();return}}}__onKeyUp(){this.data.ctrlKeyDown=!1,this.state.keyboardEnabled&&this.keyHandler.up(t=>{t==="ZOOM_IN"||t==="ZOOM_OUT"?this.viewer.dynamics.zoom.stop():(this.viewer.dynamics.position.stop(),this.viewer.resetIdleTimer())})}__onMouseDown(t){this.step.add(pr.CLICK),this.data.startMouseX=t.clientX,this.data.startMouseY=t.clientY,this.config.mousemove&&t.preventDefault()}__onMouseUp(t){this.step.is(pr.CLICK,pr.MOVING)&&this.__stopMove(t.clientX,t.clientY,t,t.button===2)}__onMouseMove(t){this.config.mousemove&&this.step.is(pr.CLICK,pr.MOVING)&&(t.preventDefault(),this.__doMove(t.clientX,t.clientY)),this.__handleObjectsEvents(t)}__onTouchStart(t){t.touches.length===1?(this.step.add(pr.CLICK),this.data.startMouseX=t.touches[0].clientX,this.data.startMouseY=t.touches[0].clientY,this.data.longtouchTimeout||(this.data.longtouchTimeout=setTimeout(()=>{const e=t.touches[0];this.__stopMove(e.clientX,e.clientY,t,!0),this.data.longtouchTimeout=null},Mde))):t.touches.length===2&&(this.step.set(pr.IDLE),this.__cancelLongTouch(),this.config.mousemove&&(this.__cancelTwoFingersOverlay(),this.__startMoveZoom(t),t.preventDefault()))}__onTouchEnd(t){if(this.__cancelLongTouch(),this.step.is(pr.CLICK,pr.MOVING)){if(t.preventDefault(),this.__cancelTwoFingersOverlay(),t.touches.length===1)this.__stopMove(this.data.mouseX,this.data.mouseY);else if(t.touches.length===0){const e=t.changedTouches[0];this.__stopMove(e.clientX,e.clientY,t)}}}__onTouchMove(t){if(this.__cancelLongTouch(),!!this.config.mousemove)if(t.touches.length===1){if(this.config.touchmoveTwoFingers)this.step.is(pr.CLICK)&&!this.data.twofingersTimeout&&(this.data.twofingersTimeout=setTimeout(()=>{this.viewer.overlay.show({id:Gr.TWO_FINGERS,image:upi,title:this.config.lang.twoFingers})},Bde));else if(this.step.is(pr.CLICK,pr.MOVING)){t.preventDefault();const e=t.touches[0];this.__doMove(e.clientX,e.clientY)}}else this.__doMoveZoom(t),this.__cancelTwoFingersOverlay()}__cancelLongTouch(){this.data.longtouchTimeout&&(clearTimeout(this.data.longtouchTimeout),this.data.longtouchTimeout=null)}__cancelTwoFingersOverlay(){this.config.touchmoveTwoFingers&&(this.data.twofingersTimeout&&(clearTimeout(this.data.twofingersTimeout),this.data.twofingersTimeout=null),this.viewer.overlay.hide(Gr.TWO_FINGERS))}__onMouseWheel(t){if(!this.config.mousewheel||!t.deltaY)return;if(this.config.mousewheelCtrlKey&&!this.data.ctrlKeyDown){this.viewer.overlay.show({id:Gr.CTRL_ZOOM,image:hpi,title:this.config.lang.ctrlZoom}),clearTimeout(this.data.ctrlZoomTimeout),this.data.ctrlZoomTimeout=setTimeout(()=>this.viewer.overlay.hide(Gr.CTRL_ZOOM),Ede);return}t.preventDefault(),t.stopPropagation();const e=t.deltaY/Math.abs(t.deltaY)*5*this.config.zoomSpeed;e!==0&&this.viewer.dynamics.zoom.step(-e,5)}__onFullscreenChange(){const t=this.viewer.isFullscreenEnabled();this.config.keyboard==="fullscreen"&&(t?this.viewer.startKeyboardControl():this.viewer.stopKeyboardControl()),this.viewer.dispatchEvent(new n4(t))}__resetMove(){this.step.set(pr.IDLE),this.data.mouseX=0,this.data.mouseY=0,this.data.startMouseX=0,this.data.startMouseY=0}__startMoveZoom(t){this.viewer.stopAll(),this.__resetMove();const e=kR(t);this.step.set(pr.MOVING),this.data.accumulatorFactor=this.config.moveInertia,{distance:this.data.pinchDist,center:{x:this.data.mouseX,y:this.data.mouseY}}=e}__stopMove(t,e,i,o=!1){this.step.is(pr.CLICK)&&!this.__moveThresholdReached(t,e)&&this.__doClick(t,e,i,o),this.config.moveInertia&&(this.data.accumulatorFactor=Math.pow(this.config.moveInertia,.5)),this.__resetMove(),this.viewer.resetIdleTimer()}__doClick(t,e,i,o=!1){const n=this.viewer.container.getBoundingClientRect(),r=t-n.left,a=e-n.top,s=this.viewer.renderer.getIntersections({x:r,y:a}),l=s.find(c=>c.object.userData[tu]);if(l){const c=this.viewer.dataHelper.vector3ToSphericalCoords(l.point),d={rightclick:o,originalEvent:i,target:mb(i),clientX:t,clientY:e,viewerX:r,viewerY:a,yaw:c.yaw,pitch:c.pitch,objects:s.map(u=>u.object).filter(u=>!u.userData[tu])};try{const u=this.viewer.dataHelper.sphericalCoordsToTextureCoords(d);Object.assign(d,u)}catch{}this.data.dblclickTimeout?(Math.abs(this.data.dblclickData.clientX-d.clientX)<this.moveThreshold&&Math.abs(this.data.dblclickData.clientY-d.clientY)<this.moveThreshold&&this.viewer.dispatchEvent(new hue(this.data.dblclickData)),clearTimeout(this.data.dblclickTimeout),this.data.dblclickTimeout=null,this.data.dblclickData=null):(this.viewer.dispatchEvent(new cue(d)),this.data.dblclickData=yb(d),this.data.dblclickTimeout=setTimeout(()=>{this.data.dblclickTimeout=null,this.data.dblclickData=null},kde))}}__handleObjectsEvents(t){if(!Vde(this.state.objectsObservers)&&t.composedPath().includes(this.viewer.container)){const e=Fde(this.viewer.container),i={x:t.clientX-e.x,y:t.clientY-e.y},o=this.viewer.renderer.getIntersections(i),n=(r,a,s)=>{this.viewer.dispatchEvent(new s(t,r,i,a))};for(const[r,a]of Object.entries(this.state.objectsObservers)){const s=o.find(l=>l.object.userData[r]);s?(a&&s.object!==a&&(n(a,r,FR),this.state.objectsObservers[r]=null),a?n(s.object,r,Jue):(this.state.objectsObservers[r]=s.object,n(s.object,r,Que))):a&&(n(a,r,FR),this.state.objectsObservers[r]=null)}}}__doMove(t,e){if(this.step.is(pr.CLICK)&&this.__moveThresholdReached(t,e))this.viewer.stopAll(),this.__resetMove(),this.step.set(pr.MOVING),this.data.mouseX=t,this.data.mouseY=e,this.data.accumulatorFactor=this.config.moveInertia;else if(this.step.is(pr.MOVING)){const i=(t-this.data.mouseX)*Math.cos(this.state.roll)-(e-this.data.mouseY)*Math.sin(this.state.roll),o=(e-this.data.mouseY)*Math.cos(this.state.roll)+(t-this.data.mouseX)*Math.sin(this.state.roll),n={yaw:this.config.moveSpeed*(i/this.state.size.width)*oo.degToRad(this.state.hFov),pitch:this.config.moveSpeed*(o/this.state.size.height)*oo.degToRad(this.state.vFov)};this.data.moveDelta.yaw+=n.yaw,this.data.moveDelta.pitch+=n.pitch,this.data.mouseX=t,this.data.mouseY=e}}__moveThresholdReached(t,e){return Math.abs(t-this.data.startMouseX)>=this.moveThreshold||Math.abs(e-this.data.startMouseY)>=this.moveThreshold}__doMoveZoom(t){if(this.step.is(pr.MOVING)){t.preventDefault();const e=kR(t);this.__doMove(e.center.x,e.center.y),this.data.moveDelta.zoom+=this.config.zoomSpeed*((e.distance-this.data.pinchDist)/Fn.pixelRatio),this.data.pinchDist=e.distance}}__applyMoveDelta(){if(Math.abs(this.data.moveDelta.yaw)>0||Math.abs(this.data.moveDelta.pitch)>0){const t=this.viewer.getPosition();this.viewer.rotate({yaw:t.yaw-this.data.moveDelta.yaw*(1-this.config.moveInertia),pitch:t.pitch+this.data.moveDelta.pitch*(1-this.config.moveInertia)}),this.data.moveDelta.yaw*=this.data.accumulatorFactor,this.data.moveDelta.pitch*=this.data.accumulatorFactor,Math.abs(this.data.moveDelta.yaw)<=.001&&(this.data.moveDelta.yaw=0),Math.abs(this.data.moveDelta.pitch)<=.001&&(this.data.moveDelta.pitch=0)}if(Math.abs(this.data.moveDelta.zoom)>0){const t=this.viewer.getZoomLevel();this.viewer.zoom(t+this.data.moveDelta.zoom*(1-this.config.moveInertia)),this.data.moveDelta.zoom*=this.config.moveInertia,Math.abs(this.data.moveDelta.zoom)<=.001&&(this.data.moveDelta.zoom=0)}}__clearMoveDelta(){this.data.moveDelta.yaw=0,this.data.moveDelta.pitch=0,this.data.moveDelta.zoom=0}};Li.enabled=!1;var Rb=new ro,lhe=new ar,che=new m2,fpi=class extends g4{constructor(t){super(t),this.frustumNeedsUpdate=!0,this.renderer=new xhi(this.config.rendererParameters),this.renderer.setPixelRatio(Fn.pixelRatio),this.renderer.outputColorSpace=Eh,this.renderer.toneMapping=tce,this.renderer.domElement.className="psv-canvas",this.renderer.domElement.style.background=this.config.canvasBackground,this.scene=new Vce,this.camera=new Xa(50,16/9,.1,2*Oh),this.camera.matrixAutoUpdate=!1;const e=new Ya(new F4(Oh).scale(-1,1,1),new X3({opacity:0,transparent:!0,depthTest:!1,depthWrite:!1}));e.userData={[tu]:!0},this.scene.add(e),this.raycaster=new jsi,this.frustum=new dR,this.container=document.createElement("div"),this.container.className="psv-canvas-container",this.container.appendChild(this.renderer.domElement),this.viewer.container.appendChild(this.container),this.container.addEventListener("contextmenu",i=>i.preventDefault()),this.viewer.addEventListener(u4.type,this),this.viewer.addEventListener(Dc.type,this),this.viewer.addEventListener(s4.type,this),this.viewer.addEventListener(l4.type,this),this.viewer.addEventListener(oa.type,this),this.hide()}get panoramaPose(){return this.mesh.rotation}get sphereCorrection(){return this.meshContainer.rotation}init(){this.show(),this.renderer.setAnimationLoop(t=>this.__renderLoop(t))}destroy(){this.renderer.setAnimationLoop(null),this.cleanScene(this.scene),this.renderer.dispose(),this.viewer.container.removeChild(this.container),this.viewer.removeEventListener(u4.type,this),this.viewer.removeEventListener(Dc.type,this),this.viewer.removeEventListener(s4.type,this),this.viewer.removeEventListener(l4.type,this),this.viewer.removeEventListener(oa.type,this),super.destroy()}handleEvent(t){switch(t.type){case u4.type:this.__onSizeUpdated();break;case Dc.type:this.__onZoomUpdated();break;case s4.type:this.__onPositionUpdated();break;case l4.type:this.__onPositionUpdated();break;case oa.type:t.containsOptions("fisheye")&&this.__onPositionUpdated(),t.containsOptions("canvasBackground")&&(this.renderer.domElement.style.background=this.config.canvasBackground);break}}hide(){this.container.style.opacity="0"}show(){this.container.style.opacity="1"}setCustomRenderer(t){t?this.customRenderer=t(this.renderer):this.customRenderer=null,this.viewer.needsUpdate()}__onSizeUpdated(){this.renderer.setSize(this.state.size.width,this.state.size.height),this.camera.aspect=this.state.aspect,this.camera.updateProjectionMatrix(),this.viewer.needsUpdate(),this.frustumNeedsUpdate=!0}__onZoomUpdated(){this.camera.fov=this.state.vFov,this.camera.updateProjectionMatrix(),this.viewer.needsUpdate(),this.frustumNeedsUpdate=!0}__onPositionUpdated(){this.camera.position.set(0,0,0),this.camera.lookAt(this.state.direction),this.config.fisheye&&this.camera.position.copy(this.state.direction).multiplyScalar(this.config.fisheye/2).negate(),this.camera.rotateZ(-this.state.roll),this.camera.updateMatrix(),this.camera.updateMatrixWorld(),this.viewer.needsUpdate(),this.frustumNeedsUpdate=!0}__renderLoop(t){const e=this.timestamp?t-this.timestamp:0;this.timestamp=t,this.viewer.dispatchEvent(new r4(t,e)),this.viewer.dynamics.update(e),(this.state.needsUpdate||this.state.continuousUpdateCount>0)&&(this.state.needsUpdate=!1,(this.customRenderer||this.renderer).render(this.scene,this.camera),this.viewer.dispatchEvent(new Lue))}setTexture(t){this.meshContainer||(this.meshContainer=new S2,this.scene.add(this.meshContainer)),this.state.textureData&&this.viewer.adapter.disposeTexture(this.state.textureData),this.mesh&&(this.meshContainer.remove(this.mesh),this.viewer.adapter.disposeMesh(this.mesh)),this.mesh=this.viewer.adapter.createMesh(t.panoData),this.viewer.adapter.setTexture(this.mesh,t,!1),this.meshContainer.add(this.mesh),this.state.textureData=t,this.viewer.needsUpdate()}setPanoramaPose(t,e=this.mesh){const i=this.viewer.dataHelper.cleanPanoramaPose(t);e.rotation.set(i.tilt,i.pan,i.roll,"YXZ")}setSphereCorrection(t,e=this.meshContainer){const i=this.viewer.dataHelper.cleanSphereCorrection(t);e.rotation.set(i.tilt,i.pan,i.roll,"YXZ")}transition(t,e,i){const o=i.effect==="fade"||i.rotation,n=!Tr(e.position),r=!Tr(e.zoom),a=new _R(n?this.viewer.dataHelper.cleanPosition(e.position):void 0,e.zoom);this.viewer.dispatchEvent(a);const s=new S2,l=this.viewer.adapter.createMesh(t.panoData);if(this.viewer.adapter.setTexture(l,t,!0),this.viewer.adapter.setTextureOpacity(l,0),this.setPanoramaPose(t.panoData,l),this.setSphereCorrection(e.sphereCorrection,s),n&&!i.rotation){const h=this.viewer.getPosition(),p=new it(0,1,0);s.rotateOnWorldAxis(p,a.position.yaw-h.yaw);const A=new it(0,1,0).cross(this.camera.getWorldDirection(new it)).normalize();s.rotateOnWorldAxis(A,a.position.pitch-h.pitch)}s.add(l),this.scene.add(s),this.renderer.setRenderTarget(new Gd),this.renderer.render(this.scene,this.camera),this.renderer.setRenderTarget(null);const{duration:c,properties:d}=this.viewer.dataHelper.getAnimationProperties(i.speed,i.rotation?a.position:null,o?a.zoomLevel:null),u=new kb({properties:{...d,opacity:{start:0,end:1}},duration:c,easing:"inOutCubic",onTick:h=>{switch(i.effect){case"fade":this.viewer.adapter.setTextureOpacity(l,h.opacity);break;case"black":case"white":h.opacity<.5?this.renderer.toneMappingExposure=i.effect==="black"?oo.mapLinear(h.opacity,0,.5,1,0):oo.mapLinear(h.opacity,0,.5,1,5):(this.renderer.toneMappingExposure=i.effect==="black"?oo.mapLinear(h.opacity,.5,1,0,1):oo.mapLinear(h.opacity,.5,1,5,1),this.mesh.visible=!1,this.viewer.adapter.setTextureOpacity(l,1),r&&!o&&this.viewer.dynamics.zoom.setValue(a.zoomLevel));break}n&&i.rotation&&this.viewer.dynamics.position.setValue({yaw:h.yaw,pitch:h.pitch}),r&&o&&this.viewer.dynamics.zoom.setValue(h.zoom),this.viewer.needsUpdate()}});return u.then(h=>{s.remove(l),this.scene.remove(s),h?(this.viewer.adapter.disposeTexture(this.state.textureData),this.meshContainer.remove(this.mesh),this.viewer.adapter.disposeMesh(this.mesh),this.mesh=l,this.meshContainer.add(l),this.state.textureData=t,this.setPanoramaPose(t.panoData),this.setSphereCorrection(e.sphereCorrection),n&&!i.rotation&&this.viewer.rotate(e.position)):(this.viewer.adapter.disposeTexture(t),this.viewer.adapter.disposeMesh(l))}),u}getIntersections(t){Rb.x=2*t.x/this.state.size.width-1,Rb.y=-2*t.y/this.state.size.height+1,this.raycaster.setFromCamera(Rb,this.camera);const e=this.raycaster.intersectObjects(this.scene.children,!0).filter(i=>i.object.visible).filter(i=>i.object.isMesh&&!!i.object.userData);return this.customRenderer?.getIntersections&&e.push(...this.customRenderer.getIntersections(this.raycaster,Rb)),e}isObjectVisible(t){if(!t)return!1;if(this.frustumNeedsUpdate&&(lhe.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),this.frustum.setFromProjectionMatrix(lhe),this.frustumNeedsUpdate=!1),t.isVector3)return this.frustum.containsPoint(t);if(t.isMesh&&t.geometry){const e=t;return e.geometry.boundingBox||e.geometry.computeBoundingBox(),che.copy(e.geometry.boundingBox).applyMatrix4(e.matrixWorld),this.frustum.intersectsBox(che)}else return t.isObject3D?this.frustum.intersectsObject(t):!1}addObject(t){this.scene.add(t)}removeObject(t){this.scene.remove(t)}cleanScene(t){const e=i=>{i.map?.dispose(),i.uniforms&&Object.values(i.uniforms).forEach(o=>{o.value?.dispose?.()}),i.dispose()};t.traverse(i=>{i.geometry?.dispose(),i.material&&(Array.isArray(i.material)?i.material.forEach(o=>{e(o)}):e(i.material)),i instanceof Vce||i.dispose?.(),i!==t&&this.cleanScene(i)})}},Api=class extends Osi{constructor(){super(...arguments),this._abortController=new AbortController}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}load(t,e,i,o){const n=this._abortController.signal,r=super.load(t,l=>{s(),e(l)},i,l=>{if(s(),n.aborted){const c=new Error;c.name="AbortError",c.message="The operation was aborted.",o(c)}else o(l)});function a(){r.src=""}function s(){n.removeEventListener("abort",a,!1)}return n.addEventListener("abort",a,!1),r}},gpi=class extends g4{constructor(t){super(t),this.fileLoader=new Fsi,this.fileLoader.setResponseType("blob"),this.imageLoader=new Api}destroy(){this.abortLoading(),super.destroy()}abortLoading(){this.fileLoader.abort?.(),this.imageLoader.abort()}loadFile(t,e,i){const o=U2.get(t,i);if(o){if(o instanceof Blob)return e?.(100),Promise.resolve(o);U2.remove(t,i)}this.config.requestHeaders&&this.fileLoader.setRequestHeader(this.config.requestHeaders(t)),this.fileLoader.setWithCredentials(this.config.withCredentials(t));let n=0;return e?.(n),this.fileLoader.loadAsync(t,r=>{if(r.lengthComputable){const a=r.loaded/r.total*100;a>n&&(n=a,e?.(n))}}).then(r=>(n=100,e?.(n),U2.add(t,i,r),r))}loadImage(t,e,i){const o=U2.get(t,i);return o?(e?.(100),o instanceof Blob?this.blobToImage(o):Promise.resolve(o)):!e&&!this.config.requestHeaders?(this.imageLoader.setWithCredentials(this.config.withCredentials(t)),this.imageLoader.loadAsync(t).then(n=>(U2.add(t,i,n),n))):this.loadFile(t,e,i).then(n=>this.blobToImage(n))}blobToImage(t){return new Promise((e,i)=>{const o=document.createElement("img");o.onload=()=>{URL.revokeObjectURL(o.src),e(o)},o.onerror=i,o.src=URL.createObjectURL(t)})}preloadPanorama(t){return this.viewer.adapter.supportsPreload(t)?this.viewer.adapter.loadTexture(t,!1):Promise.reject(new $i("Current adapter does not support preload"))}dispatchProgress(t){this.viewer.loader.setProgress(t),this.viewer.dispatchEvent(new Cue(Math.round(t)))}},mpi=class extends g4{constructor(t){super(t),this.zoom=new o4(e=>{this.viewer.state.vFov=this.viewer.dataHelper.zoomLevelToFov(e),this.viewer.state.hFov=this.viewer.dataHelper.vFovToHFov(this.viewer.state.vFov),this.viewer.dispatchEvent(new Dc(e))},{defaultValue:this.viewer.config.defaultZoomLvl,min:0,max:100,wrap:!1}),this.position=new eue(e=>{this.viewer.dataHelper.sphericalCoordsToVector3(e,this.viewer.state.direction),this.viewer.dispatchEvent(new s4(e))},{yaw:new o4(null,{defaultValue:this.config.defaultYaw,min:0,max:2*Math.PI,wrap:!0}),pitch:new o4(null,{defaultValue:this.config.defaultPitch,min:-Math.PI/2,max:Math.PI/2,wrap:!1})}),this.roll=new o4(e=>{this.viewer.state.roll=e,this.viewer.dispatchEvent(new l4(e))},{defaultValue:0,min:-Math.PI,max:Math.PI,wrap:!1}),this.updateSpeeds()}updateSpeeds(){this.zoom.setSpeed(this.config.zoomSpeed*50),this.position.setSpeed(oo.degToRad(this.config.moveSpeed*50)),this.roll.setSpeed(oo.degToRad(this.config.moveSpeed*50))}update(t){this.zoom.update(t),this.position.update(t),this.roll.update(t)}},vpi=class{constructor(){this.ready=!1,this.needsUpdate=!1,this.continuousUpdateCount=0,this.keyboardEnabled=!1,this.direction=new it(0,0,Oh),this.roll=0,this.vFov=60,this.hFov=60,this.aspect=1,this.animation=null,this.transitionAnimation=null,this.loadingPromise=null,this.idleTime=-1,this.objectsObservers={},this.size={width:0,height:0}}},ypi=class extends oue{constructor(t){if(super(),this.plugins={},this.children=[],this.parent=Dde(t.container),!this.parent)throw new $i('"container" element not found.');this.parent[tu]=this,this.container=document.createElement("div"),this.container.classList.add("psv-container"),this.parent.appendChild(this.container),Xde(this.parent),Yde(this.container,"core"),this.state=new vpi,this.config=epi(t),this.__setSize(this.config.size),this.overlay=new npi(this);try{Fn.load()}catch(e){console.error(e),this.showError(this.config.lang.webglError);return}U2.init(),this.adapter=new this.config.adapter[0](this,this.config.adapter[1]),this.renderer=new fpi(this),this.textureLoader=new gpi(this),this.eventsHandler=new ppi(this),this.dataHelper=new dpi(this),this.dynamics=new mpi(this),this.adapter.init?.(),this.loader=new opi(this),this.navbar=new ipi(this),this.panel=new spi(this),this.notification=new rpi(this),this.autoSize(),this.setCursor(null),ER(Fn.isTouchEnabled,e=>{gb(this.container,"psv--is-touch",e)}),this.config.plugins.forEach(([e,i])=>{this.plugins[e.id]=new e(this,i)});for(const e of Object.values(this.plugins))e.init?.();this.config.navbar&&this.navbar.setButtons(this.config.navbar),this.state.loadingPromise||(this.config.panorama?this.setPanorama(this.config.panorama,{sphereCorrection:this.config.sphereCorrection,panoData:this.config.panoData}):this.loader.show())}destroy(){this.stopAll(),this.stopKeyboardControl(),this.exitFullscreen();for(const[t,e]of Object.entries(this.plugins))e.destroy(),delete this.plugins[t];this.children.slice().forEach(t=>t.destroy()),this.children.length=0,this.eventsHandler?.destroy(),this.renderer?.destroy(),this.textureLoader?.destroy(),this.dataHelper?.destroy(),this.adapter?.destroy(),this.dynamics?.destroy(),this.parent.removeChild(this.container),delete this.parent[tu]}init(){this.eventsHandler.init(),this.renderer.init(),this.config.navbar&&this.navbar.show(),this.config.keyboard==="always"&&this.startKeyboardControl(),this.resetIdleTimer(),this.state.ready=!0,this.dispatchEvent(new c4)}resetIdleTimer(){this.state.idleTime=performance.now()}disableIdleTimer(){this.state.idleTime=-1}getPlugin(t){if(typeof t=="string")return this.plugins[t];{const e=jR(t);return e?this.plugins[e.id]:null}}getPosition(){return this.dataHelper.cleanPosition(this.dynamics.position.current)}getZoomLevel(){return this.dynamics.zoom.current}getSize(){return{...this.state.size}}isFullscreenEnabled(){return Ode(this.parent,Fn.isIphone)}needsUpdate(){this.state.needsUpdate=!0}needsContinuousUpdate(t){t?this.state.continuousUpdateCount++:this.state.continuousUpdateCount>0&&this.state.continuousUpdateCount--}autoSize(){(this.container.clientWidth!==this.state.size.width||this.container.clientHeight!==this.state.size.height)&&(this.state.size.width=Math.round(this.container.clientWidth),this.state.size.height=Math.round(this.container.clientHeight),this.state.aspect=this.state.size.width/this.state.size.height,this.state.hFov=this.dataHelper.vFovToHFov(this.state.vFov),this.dispatchEvent(new u4(this.getSize())),this.navbar.autoSize())}setPanorama(t,e={}){this.textureLoader.abortLoading(),this.state.transitionAnimation?.cancel();const i=this.dataHelper.getTransitionOptions(e);e.showLoader===void 0&&(e.showLoader=!0),e.caption===void 0&&(e.caption=this.config.caption),e.description===void 0&&(e.description=this.config.description),!e.panoData&&typeof this.config.panoData=="function"&&(e.panoData=this.config.panoData),this.hideError(),this.resetIdleTimer(),this.config.panorama=t,this.config.caption=e.caption,this.config.description=e.description,this.config.sphereCorrection=e.sphereCorrection,(typeof this.config.panoData!="function"||typeof e.panoData=="function")&&(this.config.panoData=e.panoData);const o=r=>{if(Qde(r))return!1;if(this.loader.hide(),this.state.loadingPromise=null,r)throw this.navbar.setCaption(null),this.showError(this.config.lang.loadError),console.error(r),this.dispatchEvent(new Eue(t,r)),r;return this.navbar.setCaption(this.config.caption),!0};this.navbar.setCaption(`<em>${this.config.lang.loading}</em>`),(e.showLoader||!this.state.ready)&&this.loader.show(),this.dispatchEvent(new kue(t));const n=this.adapter.loadTexture(this.config.panorama,!0,e.panoData).then(r=>{if(r.panorama!==this.config.panorama)throw this.adapter.disposeTexture(r),PR();const a=this.dataHelper.cleanPanoramaOptions(e,r.panoData);return(!Tr(a.zoom)||!Tr(a.position))&&this.stopAll(),{textureData:r,cleanOptions:a}});return!i||!this.state.ready||!this.adapter.supportsTransition(this.config.panorama)?this.state.loadingPromise=n.then(({textureData:r,cleanOptions:a})=>{this.renderer.show(),this.renderer.setTexture(r),this.renderer.setPanoramaPose(r.panoData),this.renderer.setSphereCorrection(e.sphereCorrection),this.state.ready||this.init(),this.dispatchEvent(new _2(r)),Tr(a.zoom)||this.zoom(a.zoom),Tr(a.position)||this.rotate(a.position)}).then(()=>o(),r=>o(r)):this.state.loadingPromise=n.then(({textureData:r,cleanOptions:a})=>(this.loader.hide(),this.dispatchEvent(new _2(r)),this.state.transitionAnimation=this.renderer.transition(r,a,i),this.state.transitionAnimation)).then(r=>{if(this.state.transitionAnimation=null,this.dispatchEvent(new Iue(r)),!r)throw PR()}).then(()=>o(),r=>o(r)),this.state.loadingPromise}setOptions(t){const e={...this.config,...t};for(let[i,o]of Object.entries(t)){if(!(i in F2)){Kr(`Unknown option ${i}`);continue}if(i in she){Kr(she[i]);continue}switch(i in HR&&(o=HR[i](o,{rawConfig:e,defValue:F2[i]})),this.config[i]=o,i){case"mousemove":this.state.cursorOverride||this.setCursor(null);break;case"caption":this.navbar.setCaption(this.config.caption);break;case"size":this.resize(this.config.size);break;case"sphereCorrection":this.renderer.setSphereCorrection(this.config.sphereCorrection);break;case"navbar":case"lang":this.navbar.setButtons(this.config.navbar);break;case"moveSpeed":case"zoomSpeed":this.dynamics.updateSpeeds();break;case"minFov":case"maxFov":this.dynamics.zoom.setValue(this.dataHelper.fovToZoomLevel(this.state.vFov)),this.dispatchEvent(new Dc(this.getZoomLevel()));break;case"keyboard":this.config.keyboard==="always"?this.startKeyboardControl():this.stopKeyboardControl();break}}this.needsUpdate(),this.dispatchEvent(new oa(Object.keys(t)))}setOption(t,e){this.setOptions({[t]:e})}showError(t){this.overlay.show({id:Gr.ERROR,image:cpi,title:t,dismissible:!1})}hideError(){this.overlay.hide(Gr.ERROR)}rotate(t){const e=new sue(this.dataHelper.cleanPosition(t));this.dispatchEvent(e),!e.defaultPrevented&&this.dynamics.position.setValue(e.position)}zoom(t){this.dynamics.zoom.setValue(t)}zoomIn(t=1){this.dynamics.zoom.step(t)}zoomOut(t=1){this.dynamics.zoom.step(-t)}animate(t){const e=IR(t),i=!Tr(t.zoom),o=new _R(e?this.dataHelper.cleanPosition(t):void 0,t.zoom);if(this.dispatchEvent(o),o.defaultPrevented)return;this.stopAll();const{duration:n,properties:r}=this.dataHelper.getAnimationProperties(t.speed,o.position,o.zoomLevel);return n?(this.state.animation=new kb({properties:r,duration:n,easing:t.easing||"inOutSine",onTick:a=>{e&&this.dynamics.position.setValue({yaw:a.yaw,pitch:a.pitch}),i&&this.dynamics.zoom.setValue(a.zoom)}}),this.state.animation.then(()=>{this.state.animation=null,this.resetIdleTimer()}),this.state.animation):(e&&this.rotate(o.position),i&&this.zoom(o.zoomLevel),new kb(null))}stopAnimation(){return this.state.animation?(this.state.animation.cancel(),this.state.animation):Promise.resolve()}resize(t){this.__setSize(t),this.autoSize()}__setSize(t){["width","height"].forEach(e=>{t?.[e]&&(/^[0-9.]+$/.test(t[e])&&(t[e]+="px"),this.parent.style[e]=t[e])})}enterFullscreen(){this.isFullscreenEnabled()||Ude(this.parent,Fn.isIphone)}exitFullscreen(){this.isFullscreenEnabled()&&Nde(Fn.isIphone)}toggleFullscreen(){this.isFullscreenEnabled()?this.exitFullscreen():this.enterFullscreen()}startKeyboardControl(){this.state.keyboardEnabled=!0}stopKeyboardControl(){this.state.keyboardEnabled=!1}createTooltip(t){return new lpi(this,t)}setCursor(t){this.state.cursorOverride=t,t?this.container.style.cursor=t:this.container.style.cursor=this.config.mousemove?"move":"default"}observeObjects(t){this.state.objectsObservers[t]||(this.state.objectsObservers[t]=null)}unobserveObjects(t){delete this.state.objectsObservers[t]}stopAll(){return this.dispatchEvent(new h4),this.disableIdleTimer(),this.stopAnimation()}};const bpi={class:"annotations-photosphere"},wpi={__name:"AnnotationsPhotosphere",setup(t){const e=ht("$viewer"),{localContext:i}=e,o=i.viewer,n=o.viewer,r=n.renderer.renderer.domElement,a=vE(),s=Oe(()=>a.value.filter(d=>!o.selectedStorey||d.z>=o.selectedStorey.absoluteElevation&&d.z<o.selectedStorey.absoluteTopElevation));n.addEventListener("render",()=>op(s));const l=(d,u)=>{const{x:h,y:p}=r.getBoundingClientRect(),{clientX:A,clientY:f}=u,m=n.dataHelper.viewerCoordsToSphericalCoords({x:A-h,y:f-p}),{textureX:g,textureY:y}=n.dataHelper.sphericalCoordsToTextureCoords(m);d.x=g,d.y=y},c=d=>{const u=n.dataHelper.textureCoordsToSphericalCoords({textureX:d.x,textureY:d.y}),h=n.dataHelper.sphericalCoordsToVector3(u),p=n.dataHelper.sphericalCoordsToViewerCoords(u),{width:A,height:f}=n.state.size;if(!(h.dot(n.state.direction)>0&&p.x>=0&&p.x<=A&&p.y>=0&&p.y<=f))return"display: none;";const{x:m,y:g}=p;return`left: ${m}px; top: ${g}px;`};return(d,u)=>(M(),_("div",bpi,[(M(!0),_(tt,null,Bt(s.value,h=>(M(),J(yE,{annotation:h,canvas:at(r),style:ce(c(h)),onAnnotationDrag:p=>l(h,p)},null,8,["annotation","canvas","style","onAnnotationDrag"]))),256))]))}},Cpi=j(wpi,[["__scopeId","data-v-fd653bd2"]]),xpi={name:"ViewerPhotosphere",components:{Annotations:Cpi},data(){const{settings:t}=this.$plugin;return{settings:t,model:null,photosphere:null,selectedStorey:null,loading:!1,modelHeaderShown:this.$options.$cfg?.modelLoader!=="hidden",annotationMode:!1,markerId:1,localContextSubscriptions:[],photoSphereViewerCreated:!1}},watch:{loading(t){t?this.$viewer.localContext.loadingProcessStart():this.$viewer.localContext.loadingProcessEnd()}},created(){this.isMounted=new Promise(t=>{this.setMounted=t})},mounted(){const t=new ypi({loadingImg:null,loadingTxt:null,container:this.$refs.canvas,touchmoveTwoFingers:!0,navbar:null,defaultZoomLvl:0,rendererParameters:{alpha:!0,antialias:!0,preserveDrawingBuffer:!0}});t.renderer.renderer.preserveDrawingBuffer=!0,this.viewer=t,this.photoSphereViewerCreated=!0,this.setMounted()},unmounted(){this.viewer?.destroy(),this.localContextSubscriptions.forEach(t=>this.$viewer.localContext.hub.off(t))},methods:{async loadModels([t]){this.$viewer.localContext.hub.off(this.metaBuildingLocalContextSub),this.loading=!0,await this.isMounted,this.model&&this.unloadModels(),this.model=t,t.type==="PHOTOSPHERE_BUILDING"?(this.metaBuildingLocalContextSub=this.$viewer.localContext.hub.on("storey-selected",async({storey:e})=>{e&&(this.photosphere=e.plans[0]?.plan,this.photosphere&&await this.viewer.setPanorama(this.photosphere.document.file,{transition:!1}),this.selectedStorey=e)},{getLastEvent:!0}),this.$viewer.localContext.selectStorey(t.storeys[0])):(this.photosphere=t,await this.viewer.setPanorama(t.document.file,{transition:!1})),this.loading=!1,this.$viewer.localContext.hub.emit("photosphere-model-loaded",{model:t,plugin:this}),this.$viewer.globalContext.hub.emit("photosphere-model-loaded",{model:t,plugin:this})},unloadModels(){this.$viewer.localContext.hub.emit("photosphere-model-unloaded",{model:this.model,plugin:this}),this.$viewer.globalContext.hub.emit("photosphere-model-unloaded",{model:this.model,plugin:this}),this.selectedStorey=null,this.model=null},hideUI(){[...this.$viewer.localContext.plugins.entries()].forEach(([,t])=>t.$hide()),this.modelHeaderShown=!1},showUI(){[...this.$viewer.localContext.plugins.entries()].forEach(([,t])=>t.$show()),this.modelHeaderShown=this.$options.$cfg?.modelLoader!=="hidden"},async getSnapshot(){return{snapshot_type:"png",snapshot_data:this.viewer.renderer.renderer.domElement.toDataURL()}},async getViewpoint(){const t=this.viewer.renderer.camera,e=this.viewer.getPosition(),{textureX:i,textureY:o}=this.viewer.dataHelper.sphericalCoordsToTextureCoords(e);return{order:6,originating_system:"photosphere",authoring_tool_id:this.photosphere?String(this.photosphere.id):void 0,models:this.$viewer.localContext.loadedModels.map(n=>n.id),perspective_camera:{camera_direction:{x:i,y:o,z:0},camera_up_vector:{x:0,y:0,z:0},camera_view_point:{x:0,y:0,z:this.selectedStorey?.absoluteElevation??0},field_of_view:t.fov}}},async setViewpoint(t){const e=this.$viewer.state.getStoreyFromAbsoluteElevation(this.$viewer.localContext.loadedModels[0],t?.perspective_camera?.camera_view_point.z);if(e&&e.uuid!==this.selectedStorey?.uuid){this.$viewer.localContext.selectStorey(e),await new Promise(s=>this.viewer.addEventListener("panorama-loaded",s,{once:!0}));const a=e.plans.find(s=>s.plan.id===+t.authoring_tool_id)?.plan;a&&(this.photosphere=a,await this.viewer.setPanorama(a.document.file,{transition:!1}))}const{x:i,y:o}=t?.perspective_camera?.camera_direction??{x:0,y:0};this.viewer.rotate({textureX:i,textureY:o});const n=t?.perspective_camera?.field_of_view,r=this.viewer.dataHelper.fovToZoomLevel(n);r&&this.viewer.zoom(r)},startAnnotationMode(t){this.annotationMode||(this.annotationMode=!0,this.annotationListener=({data:e})=>{const i=this.selectedStorey;t({x:e.textureX,y:e.textureY,z:i?.absoluteElevation??0,models:this.$viewer.localContext.loadedModels,storey:i})},this.canvasCursor=this.viewer.renderer.renderer.domElement.style.cursor,this.viewer.renderer.renderer.domElement.style.cursor="copy",this.viewer.addEventListener("click",this.annotationListener))},stopAnnotationMode(){this.annotationMode&&(this.viewer.removeEventListener("click",this.annotationListener),this.annotationMode=!1,this.viewer.renderer.renderer.domElement.style.cursor=this.canvasCursor)}}},kpi=xpi,Mpi={class:"bimdata-viewer-photosphere"},Bpi={ref:"canvas",class:"bimdata-viewer-photosphere__viewer__canvas"};function Epi(t,e,i,o,n,r){const a=S("NoModelWindowPlaceHolder"),s=S("Annotations"),l=S("ModelsLoader");return M(),_("div",Mpi,[b("div",Bpi,null,512),!t.model&&!t.loading?(M(),J(a,{key:0})):ie("",!0),t.photoSphereViewerCreated?(M(),J(s,{key:1})):ie("",!0),t.settings.modelLoader!=="disabled"?yt((M(),J(l,{key:2,ref:"header",multi:!1},null,512)),[[zt,t.modelHeaderShown]]):ie("",!0)])}const Ppi=j(kpi,[["render",Epi],["__scopeId","data-v-d5fe6555"]]),Ipi="Photosphere Viewer",Spi={window_label:Ipi},Tpi="Visionneuse Photosph\xE8re",Rpi={window_label:Tpi},Dpi="data:image/svg+xml,%3csvg%20width='23'%20height='23'%20viewBox='0%200%2023%2023'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M4.19485%207.90625L10.5819%201.79688V5.97245V7.90625H4.19485ZM21.3153%202.3C21.3153%201.035%2020.2453%200%2018.9228%200H9.30458L2.09094%206.9V20.7C2.09094%2021.965%203.17261%2023%204.49549%2023H18.9348C20.2573%2023%2021.3273%2021.965%2021.3273%2020.7L21.3153%202.3Z'%20class='fill-primary'%20fill='%232F374A'%20/%3e%3cpath%20d='M0%2013C0%2012.4477%200.468066%2012%201.04545%2012H21.9545C22.5319%2012%2023%2012.4477%2023%2013V20C23%2020.5523%2022.5319%2021%2021.9545%2021H1.04545C0.468066%2021%200%2020.5523%200%2020V13Z'%20fill='%23009B9D'%20/%3e%3cpath%20d='M4.79347%2019.9225C4.26792%2019.9225%203.79985%2019.8383%203.38926%2019.67C2.98102%2019.4994%202.65842%2019.2655%202.42145%2018.9681C2.18683%2018.6685%202.066%2018.3231%202.05896%2017.9317H3.59338C3.60277%2018.0956%203.66025%2018.24%203.76583%2018.3646C3.87376%2018.487%204.01687%2018.5822%204.19519%2018.6499C4.3735%2018.7177%204.5741%2018.7516%204.79699%2018.7516C5.02927%2018.7516%205.23456%2018.7134%205.41287%2018.6368C5.59118%2018.5603%205.73078%2018.4542%205.83167%2018.3187C5.93256%2018.1831%205.983%2018.0268%205.983%2017.8497C5.983%2017.6704%205.92904%2017.5118%205.82111%2017.3741C5.71553%2017.2341%205.56303%2017.1248%205.3636%2017.0461C5.16652%2016.9674%204.9319%2016.928%204.65974%2016.928H3.98755V15.885H4.65974C4.88967%2015.885%205.09261%2015.8479%205.26858%2015.7735C5.44689%2015.6992%205.58532%2015.5964%205.68386%2015.4652C5.7824%2015.3318%205.83167%2015.1766%205.83167%2014.9995C5.83167%2014.8311%205.78827%2014.6835%205.70146%2014.5567C5.61699%2014.4277%205.49734%2014.3271%205.34249%2014.255C5.18998%2014.1828%205.01167%2014.1467%204.80755%2014.1467C4.60108%2014.1467%204.41221%2014.1817%204.24094%2014.2517C4.06966%2014.3195%203.93241%2014.4168%203.82918%2014.5436C3.72594%2014.6704%203.67081%2014.8191%203.66377%2014.9896H2.20325C2.21029%2014.6026%202.32877%2014.2615%202.5587%2013.9663C2.78863%2013.6711%203.09833%2013.4405%203.4878%2013.2743C3.87962%2013.1059%204.32188%2013.0217%204.81459%2013.0217C5.31198%2013.0217%205.74721%2013.1059%206.12025%2013.2743C6.4933%2013.4426%206.78306%2013.67%206.98953%2013.9565C7.19834%2014.2407%207.30157%2014.56%207.29923%2014.9142C7.30157%2015.2903%207.17605%2015.6041%206.92266%2015.8555C6.67162%2016.107%206.34432%2016.2666%205.94077%2016.3344V16.3868C6.47101%2016.4503%206.87456%2016.6219%207.15142%2016.9018C7.43062%2017.1795%207.56904%2017.5271%207.5667%2017.9448C7.56904%2018.3274%207.45056%2018.6674%207.21124%2018.9648C6.97428%2019.2622%206.64698%2019.4961%206.22935%2019.6667C5.81173%2019.8372%205.3331%2019.9225%204.79347%2019.9225Z'%20fill='white'%20/%3e%3cpath%20d='M11.4283%2019.9225C11.0576%2019.9203%2010.6998%2019.8624%2010.3549%2019.7487C10.0123%2019.635%209.70498%2019.4502%209.43281%2019.1944C9.16065%2018.9386%208.9448%2018.5997%208.78526%2018.1776C8.62806%2017.7556%208.54947%2017.2374%208.54947%2016.623C8.55181%2016.0589%208.62103%2015.5549%208.75711%2015.111C8.89553%2014.6649%209.09261%2014.2867%209.34835%2013.9762C9.60643%2013.6657%209.91496%2013.4295%2010.2739%2013.2677C10.6329%2013.1037%2011.0353%2013.0217%2011.4811%2013.0217C11.962%2013.0217%2012.3867%2013.1092%2012.7551%2013.2841C13.1234%2013.4569%2013.419%2013.6919%2013.6419%2013.9893C13.8672%2014.2867%2014.0032%2014.6201%2014.0502%2014.9896H12.5474C12.4888%2014.7557%2012.3656%2014.572%2012.1779%2014.4386C11.9902%2014.3052%2011.7579%2014.2386%2011.4811%2014.2386C11.0118%2014.2386%2010.6552%2014.4288%2010.4112%2014.8092C10.1695%2015.1897%2010.0463%2015.7068%2010.0417%2016.3606H10.0909C10.1989%2016.1616%2010.3443%2015.9922%2010.5273%2015.8522C10.7127%2015.7101%2010.9227%2015.6019%2011.1573%2015.5275C11.3942%2015.451%2011.6441%2015.4127%2011.9069%2015.4127C12.3339%2015.4127%2012.714%2015.5068%2013.0472%2015.6948C13.3803%2015.8807%2013.6431%2016.1365%2013.8355%2016.4623C14.0279%2016.7881%2014.1241%2017.1609%2014.1241%2017.5807C14.1241%2018.0355%2014.0103%2018.44%2013.7827%2018.7943C13.5575%2019.1485%2013.2419%2019.4262%2012.836%2019.6273C12.4324%2019.8263%2011.9632%2019.9247%2011.4283%2019.9225ZM11.4212%2018.8074C11.6559%2018.8074%2011.8658%2018.7549%2012.0512%2018.6499C12.2365%2018.545%2012.382%2018.4029%2012.4876%2018.2236C12.5932%2018.0443%2012.646%2017.8431%2012.646%2017.6201C12.646%2017.397%2012.5932%2017.197%2012.4876%2017.0199C12.3844%2016.8427%2012.2412%2016.7017%2012.0582%2016.5968C11.8752%2016.4918%2011.6664%2016.4393%2011.4318%2016.4393C11.2558%2016.4393%2011.0928%2016.4699%2010.9426%2016.5312C10.7948%2016.5924%2010.6646%2016.6777%2010.552%2016.787C10.4417%2016.8963%2010.3549%2017.0231%2010.2915%2017.1675C10.2282%2017.3096%2010.1965%2017.4615%2010.1965%2017.6234C10.1965%2017.8398%2010.2493%2018.0377%2010.3549%2018.217C10.4628%2018.3963%2010.6083%2018.5395%2010.7913%2018.6467C10.9766%2018.7538%2011.1866%2018.8074%2011.4212%2018.8074Z'%20fill='white'%20/%3e%3cpath%20d='M18.0305%2019.9783C17.4252%2019.9761%2016.9043%2019.8372%2016.4679%2019.5617C16.0339%2019.2862%2015.6996%2018.8872%2015.4649%2018.3646C15.2327%2017.842%2015.1177%2017.2134%2015.12%2016.4787C15.12%2015.7462%2015.2362%2015.1219%2015.4684%2014.6059C15.7031%2014.0899%2016.0374%2013.6974%2016.4715%2013.4284C16.9079%2013.1573%2017.4275%2013.0217%2018.0305%2013.0217C18.6335%2013.0217%2019.152%2013.1573%2019.5861%2013.4284C20.0224%2013.6996%2020.358%2014.0931%2020.5926%2014.6092C20.8272%2015.123%2020.9433%2015.7462%2020.941%2016.4787C20.941%2017.2156%2020.8237%2017.8453%2020.5891%2018.3679C20.3568%2018.8905%2020.0236%2019.2895%2019.5896%2019.565C19.1555%2019.8405%2018.6358%2019.9783%2018.0305%2019.9783ZM18.0305%2018.8008C18.4434%2018.8008%2018.7731%2018.6073%2019.0194%2018.2203C19.2658%2017.8333%2019.3878%2017.2527%2019.3855%2016.4787C19.3855%2015.9692%2019.3291%2015.545%2019.2165%2015.2061C19.1063%2014.8672%2018.9491%2014.6125%2018.7449%2014.4419C18.5432%2014.2713%2018.305%2014.1861%2018.0305%2014.1861C17.6199%2014.1861%2017.2915%2014.3774%2017.0451%2014.76C16.7988%2015.1427%2016.6744%2015.7156%2016.6721%2016.4787C16.6721%2016.9947%2016.7272%2017.4255%2016.8375%2017.7709C16.9501%2018.1142%2017.1085%2018.3722%2017.3126%2018.545C17.5167%2018.7155%2017.756%2018.8008%2018.0305%2018.8008Z'%20fill='white'%20/%3e%3c/svg%3e",Lpi={name:"photosphere",isViewer:!0,i18n:{en:Spi,fr:Rpi},component:Ppi,window:{name:"photosphere",label:"photosphere.window_label",header:!1,plugins:["fullscreen"],icon:{imgUri:Dpi},modelTypes:["PHOTOSPHERE","PHOTOSPHERE_BUILDING"],multiModel:!1}},_pi={setup(){const t=ht("$viewer"),e=ht("$plugin"),{apiClient:i,cloudId:o,projectId:n}=t.api,r=Oe(()=>t.localContext.loadedModels[0]),a=Oe(()=>t.localContext.selectedStorey),s=Oe(()=>t.localContext.viewer.photosphere),l=Oe(()=>a.value?.plans.find(u=>u.plan.id===s.value?.id));ft([r,()=>e.shown],([{type:u}={}])=>{u==="PHOTOSPHERE_BUILDING"?e.show():e.hide()},{immediate:!0});const c=u=>{r.value&&t.localContext.selectStorey(r.value.storeys.find(h=>h.uuid===u.uuid))},d=u=>{if(!u)return;const{viewer:h}=t.localContext,p=h.viewer;h.photosphere=u.plan,p.setPanorama(u.plan.document.file,{transition:!1})};return()=>Qo(Tle,{apiClient:i,space:{id:o},project:{id:n},model:r.value,storey:a.value,plan:l.value,selectable:!0,onStoreySelected:c,onPlanSelected:d})}},Fpi={name:"photosphereBuilding",component:_pi,addToWindows:["photosphere"],sidePanel:{position:"right",width:400}},Opi={props:{color:{type:String,required:!0}}},Upi=["fill"];function Npi(t,e,i,o,n,r){return M(),_("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:i.color,xmlns:"http://www.w3.org/2000/svg"},[...e[0]||(e[0]=[tn('<rect width="3" height="3"></rect><rect y="9" width="3" height="3"></rect><rect x="9" width="3" height="3"></rect><rect x="9" y="9" width="3" height="3"></rect><rect x="3" y="1" width="6" height="1"></rect><rect x="3" y="10" width="6" height="1"></rect><rect x="11" y="3" width="6" height="1" transform="rotate(90 11 3)"></rect><rect x="2" y="3" width="6" height="1" transform="rotate(90 2 3)"></rect>',8)])],8,Upi)}const dhe=j(Opi,[["render",Npi]]),jpi={class:"bimdata-label-list"},Hpi={class:"bimdata-label-list__classes"},Vpi={class:"bimdata-label-list__classes__title"},zpi={class:"bimdata-label-list__classes__list"},qpi={class:"bimdata-label-list__labels"},Qpi={class:"bimdata-label-list__labels__title"},Gpi=["onClick","onMouseover"],Kpi={__name:"LabelList",setup(t){const e=ht("state"),i=Oe(()=>e.classes),o=Oe(()=>e.labels),n=a=>{e.selectedClass=a},r=a=>e.labels.filter(s=>!s.deleted).filter(s=>s.name===a.name).indexOf(a);return(a,s)=>{const l=S("BIMDataIconPlus"),c=S("BIMDataButton");return M(),_("div",jpi,[b("div",Hpi,[b("div",Vpi,[b("div",null,q(a.$t("label.classes.title")),1),s[2]||(s[2]=We(" \xA0 ",-1)),b("div",null,"("+q(a.$t("label.classes.description"))+")",1)]),b("ul",zpi,[(M(!0),_(tt,null,Bt(i.value,d=>(M(),_("li",{key:d.name,class:le({active:at(e).selectedClass?.name===d.name})},[b("div",null,[D(dhe,{color:`#${d.color}`,class:"m-r-18"},null,8,["color"]),b("span",null,q(d.name),1)]),D(c,{color:"primary",outline:"",radius:"",icon:"",width:"20px",height:"20px",onClick:u=>n(d)},{default:N(()=>[D(l,{customSize:6})]),_:1},8,["onClick"])],2))),128))])]),b("div",qpi,[b("div",Qpi,[b("div",null,q(a.$t("label.labels.title")),1),s[3]||(s[3]=We(" \xA0 ",-1)),b("div",null,"("+q(a.$t("label.labels.description"))+")",1)]),b("ul",{class:"bimdata-label-list__classes__list",onClick:s[1]||(s[1]=d=>at(e).selectedLabel=null)},[(M(!0),_(tt,null,Bt(o.value.filter(d=>!d.deleted),d=>(M(),_("li",{class:le({highlighted:at(e).highlightedLabel===d,active:at(e).selectedLabel===d}),onClick:vt(u=>at(e).selectedLabel=d,["stop"]),style:{cursor:"pointer"},onMouseover:u=>at(e).highlightedLabel=d,onMouseleave:s[0]||(s[0]=u=>at(e).highlightedLabel=null)},[b("div",null,[D(dhe,{color:`#${d.color}`,class:"m-r-18"},null,8,["color"]),b("span",null,q(d.name)+"-"+q(r(d)),1)])],42,Gpi))),256))])])])}}},Jpi=j(Kpi,[["__scopeId","data-v-70b81c34"]]),Zpi={},Wpi={width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Ypi(t,e){return M(),_("svg",Wpi,[...e[0]||(e[0]=[b("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.176395 0.13889C0.342301 -0.00852533 0.584825 -0.0419546 0.786658 0.0547728L21.6969 10.0759C21.9052 10.1757 22.0251 10.3924 21.9956 10.6155C21.966 10.8386 21.7935 11.019 21.566 11.0647L12.0932 12.9697L9.57365 21.6158C9.51015 21.8337 9.31 21.9881 9.07635 21.9993C8.8427 22.0106 8.6277 21.8763 8.54214 21.6655L0.03777 0.720195C-0.0446022 0.517321 0.0104881 0.286306 0.176395 0.13889Z",fill:"#2F374A"},null,-1)])])}const Xpi=j(Zpi,[["render",Ypi]]),$pi={width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e1i=["fill"],t1i={__name:"Rectangle",props:{disabled:{type:Boolean,default:!1}},setup(t){return(e,i)=>(M(),_("svg",$pi,[b("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0 0H20V20H0V0ZM2.5 2.5V17.5H17.5V2.5H2.5Z",fill:t.disabled?"var(--color-silver)":"var(--color-primary)"},null,8,e1i)]))}},i1i={class:"bimdata-label-viewer-draw-tools"},o1i={__name:"LabelDrawTools",props:{activeTool:{type:String,default:null}},setup(t){const e=ht("state");return(i,o)=>{const n=S("BIMDataIconArrow"),r=S("BIMDataButton");return M(),_("div",i1i,[D(r,{color:"primary",ghost:"",radius:"",icon:"",class:"bimdata-label-viewer-draw-tools__back",onClick:o[0]||(o[0]=a=>i.$emit("back"))},{default:N(()=>[D(n,{size:"xs",fill:"",color:"default"})]),_:1}),o[3]||(o[3]=b("div",{class:"bimdata-label-viewer-draw-tools__separator"},null,-1)),D(r,{color:t.activeTool===null?"secondary":"primary",ghost:t.activeTool!==null,fill:t.activeTool===null,radius:"",icon:"",class:"bimdata-label-viewer-draw-tools__pointer",onClick:o[1]||(o[1]=a=>i.$emit("tool-click",null))},{default:N(()=>[D(Xpi)]),_:1},8,["color","ghost","fill"]),D(r,{color:t.activeTool==="rectangle"?"secondary":"primary",ghost:t.activeTool!=="rectangle",fill:t.activeTool==="rectangle",radius:"",icon:"",class:"bimdata-label-viewer-draw-tools__rectangle",disabled:at(e).selectedClass===null,onClick:o[2]||(o[2]=a=>i.$emit("tool-click",t.activeTool==="rectangle"?null:"rectangle"))},{default:N(()=>[D(t1i,{disabled:at(e).selectedClass===null},null,8,["disabled"])]),_:1},8,["color","ghost","fill","disabled"])])}}},r1i=j(o1i,[["__scopeId","data-v-423df785"]]),n1i={class:"bimdata-label-viewer__model-selector"},a1i={class:"bimdata-label-viewer__model-selector__select"},s1i={class:"bimdata-label-viewer__model-selector__select__text"},l1i={key:1},c1i={__name:"ModelSelector",props:{currentModelIndex:{type:Number,default:0},modelCount:{type:Number,required:!0},loading:{type:Boolean,default:!1}},emits:["previous","next","validate"],setup(t){return(e,i)=>{const o=S("BIMDataIconChevron"),n=S("BIMDataButton"),r=S("BIMDataSpinner");return M(),_("div",n1i,[b("div",a1i,[D(n,{ghost:"",rounded:"",icon:"",width:"30px",height:"30px",onClick:i[0]||(i[0]=a=>e.$emit("previous")),disabled:t.currentModelIndex<=0},{default:N(()=>[D(o,{size:"xxxs",rotate:180})]),_:1},8,["disabled"]),b("div",s1i,[t.loading?(M(),J(r,{key:0})):(M(),_("span",l1i,q(t.currentModelIndex+1)+"/"+q(t.modelCount),1))]),D(n,{ghost:"",rounded:"",icon:"",width:"30px",height:"30px",onClick:i[1]||(i[1]=a=>e.$emit("next")),disabled:t.currentModelIndex+1>=t.modelCount},{default:N(()=>[D(o,{size:"xxxs"})]),_:1},8,["disabled"])]),D(n,{color:"secondary",fill:"",radius:"",width:"87px",height:"32px",style:{"border-radius":"17px"},onClick:i[2]||(i[2]=a=>e.$emit("validate"))},{default:N(()=>[We(q(e.$t("global.validate")),1)]),_:1})])}}},d1i=j(c1i,[["__scopeId","data-v-13384e53"]]),u1i={},h1i={width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function p1i(t,e){return M(),_("svg",h1i,[...e[0]||(e[0]=[b("path",{d:"M19.8667 21.5L12.5167 14.15C11.9333 14.6167 11.2625 14.9861 10.5042 15.2583C9.74583 15.5306 8.93889 15.6667 8.08333 15.6667C5.96389 15.6667 4.17014 14.9326 2.70208 13.4646C1.23403 11.9965 0.5 10.2028 0.5 8.08333C0.5 5.96389 1.23403 4.17014 2.70208 2.70208C4.17014 1.23403 5.96389 0.5 8.08333 0.5C10.2028 0.5 11.9965 1.23403 13.4646 2.70208C14.9326 4.17014 15.6667 5.96389 15.6667 8.08333C15.6667 8.93889 15.5306 9.74583 15.2583 10.5042C14.9861 11.2625 14.6167 11.9333 14.15 12.5167L21.5 19.8667L19.8667 21.5ZM8.08333 13.3333C9.54167 13.3333 10.7812 12.8229 11.8021 11.8021C12.8229 10.7812 13.3333 9.54167 13.3333 8.08333C13.3333 6.625 12.8229 5.38542 11.8021 4.36458C10.7812 3.34375 9.54167 2.83333 8.08333 2.83333C6.625 2.83333 5.38542 3.34375 4.36458 4.36458C3.34375 5.38542 2.83333 6.625 2.83333 8.08333C2.83333 9.54167 3.34375 10.7812 4.36458 11.8021C5.38542 12.8229 6.625 13.3333 8.08333 13.3333ZM6.91667 11.5833V9.25H4.58333V6.91667H6.91667V4.58333H9.25V6.91667H11.5833V9.25H9.25V11.5833H6.91667Z",fill:"#2F374A"},null,-1)])])}const f1i=j(u1i,[["render",p1i]]),A1i={},g1i={width:"22",height:"22",viewBox:"0 0 22 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function m1i(t,e){return M(),_("svg",g1i,[...e[0]||(e[0]=[b("path",{d:"M19.8667 21.5L12.5167 14.15C11.9333 14.6167 11.2625 14.9861 10.5042 15.2583C9.74583 15.5306 8.93889 15.6667 8.08333 15.6667C5.96389 15.6667 4.17014 14.9326 2.70208 13.4646C1.23403 11.9965 0.5 10.2028 0.5 8.08333C0.5 5.96389 1.23403 4.17014 2.70208 2.70208C4.17014 1.23403 5.96389 0.5 8.08333 0.5C10.2028 0.5 11.9965 1.23403 13.4646 2.70208C14.9326 4.17014 15.6667 5.96389 15.6667 8.08333C15.6667 8.93889 15.5306 9.74583 15.2583 10.5042C14.9861 11.2625 14.6167 11.9333 14.15 12.5167L21.5 19.8667L19.8667 21.5ZM8.08333 13.3333C9.54167 13.3333 10.7812 12.8229 11.8021 11.8021C12.8229 10.7812 13.3333 9.54167 13.3333 8.08333C13.3333 6.625 12.8229 5.38542 11.8021 4.36458C10.7812 3.34375 9.54167 2.83333 8.08333 2.83333C6.625 2.83333 5.38542 3.34375 4.36458 4.36458C3.34375 5.38542 2.83333 6.625 2.83333 8.08333C2.83333 9.54167 3.34375 10.7812 4.36458 11.8021C5.38542 12.8229 6.625 13.3333 8.08333 13.3333ZM5.16667 9.25V6.91667H11V9.25H5.16667Z",fill:"#2F374A"},null,-1)])])}const v1i=j(A1i,[["render",m1i]]);function y1i(t,e=()=>{}){const i=ht("state"),o=ht("$viewer");let n=null,r=null;const a=de(null),s=Oe(()=>i.selectedLabel&&a.value===null),l=Oe(()=>a.value!==null&&!s.value);li(()=>{r=t.value,r.engine.ui.rotatable=!1,r.plugins.pen.pathLineWidth=2,n=b1i(r,i,l)}),Ti(()=>{n?.()}),ft(()=>o.localContext.loadedModels,()=>{i.selectedLabel=null,i.highlightedLabel=null,i.labels.forEach(d=>d.path?.destroy())}),ft(()=>i.selectedClass,(d,u)=>{d&&(i.selectedLabel=null,u?r.plugins.pen.primaryColor=Number.parseInt(d.color,16):a.value="rectangle")}),ft(()=>i.labels.length,()=>{if(!r)return;const{pen:d}=r.plugins;for(const u of i.labels.filter(h=>!h.deleted))u.geometry&&!u.path&&(d.primaryColor=Number.parseInt(u.color,16),u.path=d.draw(u.geometry))},{immediate:!0}),ft(s,d=>{const{pen:u}=r.plugins;d?(u.path=i.selectedLabel.path,u.path.previousPoints=u.path.points,u.startRectangleEditing()):(u.stopRectangleEditing(),u.path=null)});let c=null;return ft(l,d=>{const{pen:u}=r.plugins;d?(u.drawMode="rectangle",u.primaryColor=Number.parseInt(i.selectedClass.color,16),u.startDrawing(),c=u.on("add",({path:h})=>e(h))):(u.stopDrawing(),s.value||(u.path=null),u.off(c))}),ft(()=>i.selectedLabel,(d,u)=>{if(u&&d){const{pen:h}=r.plugins;h.stopRectangleEditing(),h.path=d.path,h.startRectangleEditing()}else d&&(a.value=null,i.selectedClass=null)}),ft(()=>i.highlightedLabel,(d,u)=>{if(u?.path&&(u.path.object.getShape().style.fillOpacity=.2),!d)return;let h=d.parent;for(;h;)h.expanded=!0,h=h.parent;d.path&&(d.path.object.getShape().style.fillOpacity=.3)}),{drawMode:a}}function b1i(t,e,i,o){const n=t.viewer.canvas.parentElement,r=t.viewer.ui.on("click",({object:s})=>{if(!i.value)if(s){const l=e.labels.filter(c=>!c.deleted).find(c=>c.path.object.id===s.id);if(!l)return;e.selectedLabel=l}else i.value||(e.selectedLabel=null)}),a=t.viewer.ui.on("mousemove",({object:s})=>{if(!i.value)if(s){n.style.cursor="pointer";const l=e.labels.filter(c=>!c.deleted).find(c=>c.path.object.id===s.id);if(!l)return;e.highlightedLabel=l}else n.style.cursor="default",e.highlightedLabel=null});return()=>{t.viewer.ui.off(r),t.viewer.ui.off(a)}}const w1i={__name:"Marker",props:{label:{type:Object,required:!0}},setup(t,{expose:e}){const i=t,o=ht("state"),n=`#${i.label.color}`,r=o.labels.filter(l=>l.name===i.label.name),a=`${i.label.name}-${r.indexOf(i.label)}`,s=zo({x:0,y:0});return e({label:i.label,position:s}),(l,c)=>yt((M(),_("div",{class:"bimdata-label__marker",style:ce({left:s.x+"px",top:s.y+"px",backgroundColor:n}),ref:d=>{t.label.marker=d}},q(a),4)),[[zt,at(o).selectedLabel!==t.label]])}};let C1i=0;class uhe{constructor(e,i,o=null,n=null,r=null){this.name=e,this.color=i,this.geometry=o,this.path=n,this.apiId=r,this.id=C1i++,this.marker=de(null),this.deleted=!1}getTopLeftPosition(){const e=this.path?.points??this.geometry,i=Math.min(...e.map(n=>n.x)),o=Math.min(...e.map(n=>n.y));return{x:i,y:o}}hasBeenModified(){if(!this.path||!this.geometry)return!1;if(this.path.points.length!==this.geometry.length)return!0;for(let e=0;e<this.path.points.length;e++){const i=this.path.points[e],o=this.geometry[e];if(i.x!==o.x||i.y!==o.y)return!0}return!1}}function x1i(t){const e=de(null),i=()=>{const n=e.value;n&&n.forEach(r=>{const a=r.label;if(!a||!a.marker)return;const s=a.getTopLeftPosition(),l=t.value.engine.camera.getCanvasPosition(s);r.position.x=l.x-1,r.position.y=l.y-1})};li(()=>{t.value.engine.camera.on("update",()=>i()),t.value.engine.scene.on("object-update",()=>i())});const o=ht("state");return ft(()=>o.labels,()=>{so(()=>i())}),{markersRef:e,updateMarkersPosition:i}}const k1i={class:"bimdata-label-viewer"},M1i={class:"bimdata-label-viewer__markers"},B1i={class:"bimdata-label-viewer__right-tools"},E1i={key:0,class:"bimdata-label-viewer__unsaved-changes-modal"},P1i={class:"bimdata-label-viewer__unsaved-changes-modal__content"},I1i={class:"bimdata-label-viewer__unsaved-changes-modal__content__icon"},S1i={class:"bimdata-label-viewer__unsaved-changes-modal__content__title"},T1i={class:"bimdata-label-viewer__unsaved-changes-modal__content__text"},R1i={class:"bimdata-label-viewer__unsaved-changes-modal__content__buttons"},D1i={__name:"LabelViewer",setup(t){const e=bi(null),i=de(!1),o=ht("$viewer"),n=ht("state"),r=ht("service"),a=Oe(()=>o.localContext.loadingModelIds.length>0);ft(()=>o.localContext.loadedModels[0],(R,F)=>{F&&e.value?.unloadModels([F.id]),R&&e.value?.loadModels([R])},{immediate:!0});const s=Oe(()=>r.projectModels.length),l=Oe(()=>{if(s.value===0)return 0;const R=o.localContext.loadedModels[0];return R?r.projectModels.findIndex(F=>F.id===R.id):0}),{markersRef:c,updateMarkersPosition:d}=x1i(e),u=R=>{const F=n.selectedClass;if(!F){console.warn("No class selected for the label.");return}const U=new uhe(F.name,F.color,null,R);n.labels.push(U),so(()=>d())},{drawMode:h}=y1i(e,u),p=R=>{R.apiId?R.deleted=!0:n.labels=n.labels.filter(F=>F.id!==R.id),R.path.destroy(),R.path=null};let A=null;document.addEventListener("keydown",A=R=>{if(R.key==="Escape"&&(h.value=null,n.selectedClass=null,n.selectedLabel=null),(R.key==="Delete"||R.key==="Backspace")&&n.selectedLabel){const F=n.selectedLabel;n.selectedLabel=null,p(F)}}),Ti(()=>{document.removeEventListener("keydown",A)});const f=R=>{h.value=R},m=()=>{h.value=null},g=()=>{e.value.engine.camera.zoomIn()},y=()=>{e.value.engine.camera.zoomOut()},v=()=>{const R=o.localContext.loadedModels[0];r.saveLabels(R.id,n.labels),r.loadNextModel()},w=()=>n.labels.some(R=>!R.apiId||R.deleted||R.hasBeenModified());let x=null;const k=()=>{if(w()){i.value=!0,x=B;return}B()},B=()=>{const R=r.projectModels[l.value-1];R&&o.localContext.loadModels([R.id]),h.value=null},P=()=>{if(w()){i.value=!0,x=E;return}E()},E=()=>{const R=r.projectModels[l.value+1];R&&o.localContext.loadModels([R.id]),h.value=null},T=()=>{i.value=!1},I=()=>{x?.(),i.value=!1};return(R,F)=>{const U=S("BIMDataButton"),z=S("BIMDataIconWarning");return M(),_("div",k1i,[D(S3,{ref_key:"viewer",ref:e,enablePenPlugin:!0},null,512),b("div",M1i,[(M(!0),_(tt,null,Bt(at(n).labels.filter(H=>!H.deleted),H=>(M(),J(w1i,{key:H.id,label:H,ref_for:!0,ref_key:"markersRef",ref:c},null,8,["label"]))),128))]),D(r1i,{onBack:m,onToolClick:f,class:"bimdata-label-viewer__left-tools",activeTool:at(h)},null,8,["activeTool"]),b("div",B1i,[D(d1i,{class:"bimdata-label-viewer__right-tools__model-selector",modelCount:s.value,currentModelIndex:l.value,loading:a.value,onValidate:v,onPrevious:k,onNext:P},null,8,["modelCount","currentModelIndex","loading"]),D(U,{class:"bimdata-label-viewer__right-tools__button--1",color:"default",fill:"",radius:"",icon:"",width:"50px",height:"50px",style:{"border-radius":"6px"},onClick:g},{default:N(()=>[D(f1i)]),_:1}),D(U,{class:"bimdata-label-viewer__right-tools__button--2",color:"default",fill:"",radius:"",icon:"",width:"50px",height:"50px",style:{"border-radius":"6px"},onClick:y},{default:N(()=>[D(v1i)]),_:1})]),i.value?(M(),_("div",E1i,[b("div",P1i,[b("div",I1i,[D(z,{size:"m",fill:"",color:"high"})]),b("div",S1i,q(R.$t("global.warning"))+"! ",1),b("div",T1i,q(R.$t("label.unsaved-changes")),1),b("div",R1i,[D(U,{color:"primary",ghost:"",radius:"",onClick:T,width:"120px"},{default:N(()=>[We(q(R.$t("global.cancel")),1)]),_:1}),D(U,{color:"high",fill:"",radius:"",onClick:I,width:"120px"},{default:N(()=>[We(q(R.$t("global.ok")),1)]),_:1})])])])):ie("",!0)])}}},L1i=j(D1i,[["__scopeId","data-v-d495d63a"]]),_1i=[{name:"Dallage",color:"e57373"},{name:"Mur",color:"f06292"},{name:"Plancher",color:"ba68c8"},{name:"Balcon",color:"9575cd"},{name:"Ferme",color:"7986cb"},{name:"Escalier",color:"64b5f6"},{name:"Parement de fa\xE7ade",color:"4dd0e1"},{name:"Mur rideau",color:"4db6ac"},{name:"Bardage",color:"81c784"},{name:"Fen\xEAtre ext\xE9rieure",color:"aed581"},{name:"Occultation mobile ext\xE9rieure",color:"dce775"},{name:"Couverture en petits \xE9l\xE9ments",color:"fff176"},{name:"Couverture en plaque",color:"ffd54f"},{name:"Etanch\xE9it\xE9",color:"ffb74d"},{name:"Chemin\xE9e",color:"a1887f"},{name:"Cloison fixe",color:"90a4ae"},{name:"Porte int\xE9rieure",color:"f44336"},{name:"Faux plafond",color:"e91e63"},{name:"Protection contre les chutes",color:"9c27b0"},{name:"Chaudi\xE8re",color:"673ab7"},{name:"PAC \xE0 compression \xE9lectrique",color:"3f51b5"},{name:"Centrale de Traitement d'Air (CTA)",color:"2196f3"},{name:"Ventilation m\xE9canique",color:"00bcd4"},{name:"Entr\xE9e d'air",color:"009688"},{name:"Stockage ECS",color:"4caf50"},{name:"Ballon \xE9lectrique",color:"8bc34a"},{name:"Adoucisseur",color:"cddc39"},{name:"Receveur sanitaire",color:"ffeb3b"},{name:"TGBT",color:"ffc107"},{name:"Transformateur",color:"ff9800"},{name:"Luminaire",color:"795548"},{name:"Eclairage de s\xE9curit\xE9",color:"607d8b"},{name:"Interphonie",color:"b71c1c"},{name:"Compteur \xE9lectrique",color:"880e4f"},{name:"Compteur d'eau",color:"4a148c"},{name:"Compteur de gaz",color:"1a237e"},{name:"Ascenseur",color:"01579b"},{name:"Monte-charge",color:"004d40"}];class F1i{constructor(){this.$viewer=ht("$viewer");const e=ht("$plugin");let i=Array.isArray(e.settings?.classes)?e.settings.classes:null;i&&(i.length===0||!i.every(o=>typeof o.name=="string"&&typeof o.color=="string"&&o.color.length===6&&[...o.color].every(n=>/[0-9a-fA-F]/.test(n))))&&(console.warn("[BIMDataLabel - Service] Invalid classes provided to the plugin. Using default classes instead. Expected format: [{ name: string, color: string (6 hex characters) }]"),i=null),this.loading=de(!1),this.classes=i??_1i,this._projectModels=de([]),this.getAvailableModels().then(o=>{if(this._projectModels.value=o,o.length>0){const{localContext:n}=this.$viewer;n.loadedModels.length===0&&n.loadingModelIds.length===0&&n.loadModels([o[0].id])}})}get projectModels(){return this._projectModels.value}getClasses(){return Promise.resolve(this.classes)}async getLabels(e){if(!e)throw new TypeError("[BIMDataViewer - Label.Service] modelId is required to get labels.");const{apiClient:i,cloudId:o,projectId:n}=this.$viewer.api;try{return(await i.modelApi.getLabels(o,e,n)).map(r=>new uhe(r.name,r.color,r.geometry,null,r.id))}catch(r){return console.error("[BIMDataViewer - Label.Service] Cannot get labels for modelId: ",e,". Error: ",r),[]}}saveLabels(e,i){if(!e)throw new TypeError("[BIMDataViewer - Label.Service] modelId is required to save labels.");const o=[],n=[],r=[];for(const d of i)d.apiId===null?o.push(d):d.deleted?n.push(d):d.hasBeenModified()&&r.push(d);const{apiClient:a,cloudId:s,projectId:l}=this.$viewer.api,c=[];return o.length>0&&c.push(...o.map(d=>a.modelApi.createLabel(s,e,l,{name:d.name,color:d.color,geometry:d.path.points}))),n.length>0&&c.push(...n.map(d=>a.modelApi.deleteLabel(s,d.apiId,e,l))),r.length>0&&c.push(...r.map(d=>a.modelApi.updateLabel(s,d.apiId,e,l,{geometry:d.path.points}))),Promise.all(c)}loadNextModel(){const{localContext:e}=this.$viewer,i=this.projectModels.findIndex(o=>o.id===e.loadedModels[0]?.id);if(i<this.projectModels.length-1){const o=this.projectModels[i+1];e.loadModels([o.id])}}async getAvailableModels(){const{api:e,state:i,localContext:o}=this.$viewer;this.loading.value=!0;try{return(await e.apiClient.modelApi.getModels(e.cloudId,e.projectId,void 0,void 0,o.modelTypes)).filter(n=>i.models.some(r=>r.archived)||!n.archived).sort($s("updated_at",!1))}catch(n){console.error("[BIMDataLabel - Service] Cannot get project models. Error: ",n)}finally{this.loading.value=!1}return[]}}const O1i={class:"bimdata-label"},U1i={__name:"BIMDataLabel",setup(t){const e=new F1i,i=zo({classes:[],selectedClass:null,labels:[],selectedLabel:null,highlightedLabel:null});window.state=i,zi("state",i),zi("service",e),e.getClasses().then(n=>{i.classes=n});const o=ht("$viewer");return ft(()=>o.localContext.loadedModels[0],async n=>{if(n)try{o.localContext.loadingProcessStart(),i.labels=await e.getLabels(n.id),i.selectedLabel=null,i.highlightedLabel=null}finally{o.localContext.loadingProcessEnd()}},{immediate:!0}),(n,r)=>(M(),_("div",O1i,[D(Jpi,{class:"bimdata-label__list"}),D(L1i,{class:"bimdata-label__viewer"})]))}},N1i=j(U1i,[["__scopeId","data-v-5813dd8b"]]),j1i={},H1i={title:"Classes",description:"Equipment categories"},V1i={title:"Labels",description:"Created equipment"},z1i={classes:H1i,labels:V1i,"unsaved-changes":"You have unsaved changes. Are you sure you want to leave without validating them ?"},q1i={},Q1i={title:"Classes",description:"Cat\xE9gories d'\xE9quipements"},G1i={title:"Labels",description:"Equipements cr\xE9\xE9s"},K1i={classes:Q1i,labels:G1i,"unsaved-changes":"Vous avez des modifications non enregistr\xE9es. \xCAtes-vous s\xFBr de vouloir quitter sans les valider ?"},J1i={name:"label",i18n:{de:j1i,en:z1i,es:q1i,fr:K1i},component:N1i,window:{name:"label",header:!1,displayedInWindowSelector:!1,modelTypes:["JPEG","PNG"],multiModel:!1}},Z1i={},W1i={width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function Y1i(t,e){return M(),_("svg",W1i,[...e[0]||(e[0]=[b("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M5 0H7V2H5V0ZM3 8H5V10H3V8ZM10 3H8V5H10V3ZM0 5H2V7H0V5ZM2 10H0V12H2V10ZM20 5H22V7H20V5ZM22 10H20V12H22V10ZM0 15H2V17H0V15ZM2 20H0V22H2V20ZM10 0H12V2H10V0ZM7 22V20H5V22H7ZM12 20V22H10V20H12ZM17 0H15V2H17V0ZM20 0H22V2H20V0ZM11 6H13V8H11V6ZM9.70711 16.0711C9.31658 15.6806 9.31658 15.0474 9.70711 14.6569L14.6569 9.70711C15.0474 9.31659 15.6805 9.31659 16.0711 9.70711L24.5563 18.1924C24.9469 18.5829 24.9469 19.2161 24.5563 19.6066L19.6066 24.5564C19.2161 24.9469 18.5829 24.9469 18.1924 24.5564L9.70711 16.0711ZM12.5355 16.0711C12.145 15.6806 12.145 15.0474 12.5355 14.6569L14.6569 12.5355C15.0474 12.145 15.6805 12.145 16.0711 12.5355L17.4853 13.9498C17.8758 14.3403 17.8758 14.9734 17.4853 15.364L15.364 17.4853C14.9734 17.8758 14.3403 17.8758 13.9497 17.4853L12.5355 16.0711ZM8 13V11H6V13H8Z",fill:"#2F374A"},null,-1)])])}const X1i=j(Z1i,[["render",Y1i]]),$1i="Plan cleaning",e0i={tooltip:$1i},t0i="Nettoyage de plan",i0i={tooltip:t0i},o0i={name:"plan-mask-button",i18n:{en:e0i,fr:i0i},addToWindows:["plan"],button:{tooltip:"plan-mask-button.tooltip",position:"right",content:"free",icon:{component:X1i}},component:{render(){return null},setup(){const t=ht("$viewer"),e=ht("$plugin");Da(()=>{t.localContext.loadedModels.length===1?e.shown||e.show():e.shown&&e.hide()})},onOpen(){const t=this.$viewer.globalContext.layout;this.$viewer.globalContext.hub.emit("plan-mask:open",t);const e=this.$viewer.localContext.loadedModels[0];let i=e.id;if(e.type==="METABUILDING"){const n=this.$viewer.localContext.selectedStorey?.plans[0]?.plan.id;n!==void 0&&(i=n)}const o=this.$viewer.localContext.selectedStorey?.key;this.$viewer.globalContext.layout={windowName:"plan-mask",windowState:{modelIds:[i],storey:o}}}}},r0i={},n0i={width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function a0i(t,e){return M(),_("svg",n0i,[...e[0]||(e[0]=[b("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M5 0H7V2H5V0ZM3 8H5V10H3V8ZM10 3H8V5H10V3ZM0 5H2V7H0V5ZM2 10H0V12H2V10ZM20 5H22V7H20V5ZM22 10H20V12H22V10ZM0 15H2V17H0V15ZM2 20H0V22H2V20ZM10 0H12V2H10V0ZM7 22V20H5V22H7ZM12 20V22H10V20H12ZM17 0H15V2H17V0ZM20 0H22V2H20V0ZM11 6H13V8H11V6ZM9.70711 16.0711C9.31658 15.6806 9.31658 15.0474 9.70711 14.6569L14.6569 9.70711C15.0474 9.31659 15.6805 9.31659 16.0711 9.70711L24.5563 18.1924C24.9469 18.5829 24.9469 19.2161 24.5563 19.6066L19.6066 24.5564C19.2161 24.9469 18.5829 24.9469 18.1924 24.5564L9.70711 16.0711ZM12.5355 16.0711C12.145 15.6806 12.145 15.0474 12.5355 14.6569L14.6569 12.5355C15.0474 12.145 15.6805 12.145 16.0711 12.5355L17.4853 13.9498C17.8758 14.3403 17.8758 14.9734 17.4853 15.364L15.364 17.4853C14.9734 17.8758 14.3403 17.8758 13.9497 17.4853L12.5355 16.0711ZM8 13V11H6V13H8Z",fill:"#2F374A"},null,-1)])])}const s0i=j(r0i,[["render",a0i]]),l0i={class:"bimdata-plan-mask__header"},c0i={class:"bimdata-plan-mask__header__texts"},d0i={class:"bimdata-plan-mask__header__texts__title"},u0i={class:"bimdata-plan-mask__header__texts__model"},h0i={class:"bimdata-plan-mask__header__buttons"},p0i={__name:"PlanMaskHeader",setup(t){const e=ht("$viewer"),i=ht("state"),o=ht("service"),n=Oe(()=>i.newCropPathByModelId.size===0&&i.newFiltersByModelId.size===0),r=de(!1),a=Oe(()=>e.localContext.loadedModels.length===0);let s=null;e.globalContext.hub.once("plan-mask:open",(u=null)=>{s=u},{getLastEvent:!0});const l=Oe(()=>e.localContext.loadedModels[0]),c=()=>{e.globalContext.layout=s},d=async()=>{r.value=!0,await o.savePlanMasks(i),delete s.windowState.viewpoint,e.globalContext.layout=s};return(u,h)=>{const p=S("BIMDataButton"),A=S("BIMDataSpinner");return M(),_("div",l0i,[b("div",c0i,[D(s0i,{class:"m-x-6"}),b("span",d0i,q(u.$t("plan-mask.title")),1),h[0]||(h[0]=b("span",{class:"m-x-12"},"-",-1)),b("span",u0i,q(l.value?l.value.name:`... ${u.$t("global.loading")}`),1)]),b("div",h0i,[D(p,{color:"high",fill:"",radius:"",class:"m-x-6",width:"120px",onClick:c},{default:N(()=>[We(q(u.$t("global.cancel")),1)]),_:1}),D(p,{color:"primary",fill:"",radius:"",class:"m-x-6",width:"120px",disabled:n.value,onClick:d},{default:N(()=>[r.value||a.value?(M(),J(A,{key:0})):(M(),_(tt,{key:1},[We(q(u.$t("global.done")),1)],64))]),_:1},8,["disabled"])])])}}},f0i=j(p0i,[["__scopeId","data-v-5f535646"]]),A0i={},g0i={width:"13",height:"17",viewBox:"0 0 13 17",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function m0i(t,e){return M(),_("svg",g0i,[...e[0]||(e[0]=[b("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.0205887 0.760241C-0.0369001 0.612234 0.0293064 0.447777 0.177996 0.369239L0.794439 0.0436382C0.943129 -0.0348991 1.13191 -0.00512553 1.24327 0.114426C2.20441 1.14624 3.98875 2.45304 5.91415 3.77084C6.67376 4.29074 7.45537 4.81236 8.20995 5.31594C9.3481 6.0755 10.4248 6.79402 11.2717 7.40369C12.7916 8.49791 13.1419 9.88267 12.9535 11.1463C12.784 12.2835 12.1812 13.3235 11.6281 13.9998L12.22 14.9378C12.3183 15.0935 12.26 15.2927 12.0898 15.3826L9.11031 16.9563C8.94008 17.0462 8.72242 16.9929 8.62414 16.8371L8.0322 15.8992C7.11546 15.9992 5.82958 15.9568 4.66823 15.5225C3.3779 15.04 2.24219 14.0701 1.96637 12.3187C1.82059 11.393 1.68028 10.2545 1.53148 9.04694C1.41992 8.14169 1.30358 7.19767 1.17658 6.27549C0.876924 4.09967 0.517281 2.039 0.0205887 0.760241ZM1.10889 1.88952C1.4235 3.12855 1.67045 4.65216 1.8828 6.19409C2.01281 7.13806 2.12977 8.08803 2.24122 8.99317C2.38829 10.1877 2.52577 11.3043 2.67091 12.2258C2.90528 13.714 3.84317 14.5105 4.93756 14.9197C6.05334 15.337 7.33156 15.3476 8.16398 15.225C8.30978 15.2035 8.45493 15.2666 8.52877 15.3836L9.06263 16.2296L11.4257 14.9814L10.8918 14.1355C10.818 14.0185 10.8308 13.8719 10.924 13.7671C11.4563 13.1689 12.0853 12.1509 12.2483 11.0582C12.408 9.98654 12.1231 8.84526 10.8315 7.91546C9.99174 7.31094 8.93656 6.60686 7.80965 5.85492C7.05354 5.3504 6.26503 4.82427 5.48775 4.29227C4.0633 3.31734 2.67549 2.32196 1.63764 1.42496L6.84795 9.68113C7.39973 9.55339 7.99902 9.7688 8.29767 10.242C8.65803 10.813 8.44417 11.5432 7.82001 11.8729C7.19585 12.2026 6.39774 12.0069 6.03738 11.4359C5.73868 10.9626 5.83449 10.38 6.23147 10.0067L1.10889 1.88952Z",fill:"#2F374A"},null,-1)])])}const v0i=j(A0i,[["render",m0i]]);function y0i(t,e){const i=ht("state"),{newFiltersByModelId:o}=i,n=de(!1),r=de(100),a=de(100),s=de(1),l=Oe({get:()=>Math.round(s.value*100),set:y=>{s.value=y/100}}),c=Oe(()=>n.value===!1&&r.value===100&&a.value===100&&s.value===1),d=de(!1);ft(e,y=>{if(d.value=!1,!y?.mask_2d)return;const v=y.mask_2d;n.value=v.grayscale??!1,r.value=v.brightness??100,a.value=v.contrast??100,s.value=v.opacity??1},{immediate:!0});const u=de(!1),h=()=>{u.value=!1},p=()=>{const y=o.get(e.value?.id);if(y)n.value=y.grayscale??!1,r.value=y.brightness??100,a.value=y.contrast??100,s.value=y.opacity??1;else{const v=e.value?.mask_2d;n.value=v?.grayscale??!1,r.value=v?.brightness??100,a.value=v?.contrast??100,s.value=v?.opacity??1}d.value=!1,u.value=!1},A=Oe(()=>{if(!e.value)return!1;if(!o.has(e.value?.id)){const v=e.value.mask_2d;return v?(v.grayscale??!1)!==n.value||(v.brightness??100)!==r.value||(v.contrast??100)!==a.value||(v.opacity??1)!==s.value:n.value!==!1||r.value!==100||a.value!==100||s.value!==1}const y=o.get(e.value?.id);return y&&((y.grayscale??!1)!==n.value||(y.brightness??100)!==r.value||(y.contrast??100)!==a.value||(y.opacity??1)!==s.value)}),f=()=>{d.value===!1?d.value=!0:A.value?u.value=!0:d.value=!1};ft([n,r,a,s],()=>{if(!e.value)return;const y=e.value.parent?.document??e.value.document,v=t.value.plugins.bitmaps,w=v.bitmaps.find(x=>x.document.id===y.id);w&&(w.tempMask===void 0&&(w.tempMask=null),c.value?w.tempMask&&(w.tempMask.crop_path?(w.tempMask.grayscale=void 0,w.tempMask.brightness=void 0,w.tempMask.contrast=void 0,w.tempMask.opacity=void 0):w.tempMask=null):(w.tempMask||(w.tempMask={}),w.tempMask.grayscale=n.value!==!1?n.value:void 0,w.tempMask.brightness=r.value!==100?r.value:void 0,w.tempMask.contrast=a.value!==100?a.value:void 0,w.tempMask.opacity=s.value!==1?s.value:void 0),v.draw())},{immediate:!0});const m=()=>{n.value=!1,r.value=100,a.value=100,s.value=1};function g(y={}){return y.grayscale=n.value!==!1?n.value:void 0,y.brightness=r.value!==100?r.value:void 0,y.contrast=a.value!==100?a.value:void 0,y.opacity=s.value!==1?s.value:void 0,y}return{parametersDisplayed:d,onDisplayParametersClick:f,warningModelDisplayed:u,unsavedChanges:A,allFiltersDefault:c,onModalCancel:h,onModalOk:p,grayscale:n,brightness:r,contrast:a,opacity:l,onResetParametersClick:m,onApplyParametersClick:()=>{if(!e.value)return;const y=c.value,v=o.get(e.value.id);v?y?e.value.mask_2d?o.set(e.value.id,null):o.delete(e.value.id):g(v):y?e.value.mask_2d&&o.set(e.value.id,null):o.set(e.value.id,g()),d.value=!1}}}function b0i(){const t=de(null),e=(o="path")=>{t.value===o?t.value=null:t.value=o},i=o=>{o.key==="Escape"&&(t.value=null)};return document.addEventListener("keydown",i),Ti(()=>{document.removeEventListener("keydown",i)}),{drawMode:t,onDrawClick:e}}function w0i(t,e,i){const o=ht("state"),{newCropPathByModelId:n}=o;let r=null;ft(i,c=>{const{pen:d}=t.value.plugins;d.primaryColor=8840,c!==null?(d.drawMode=c,d.startDrawing(),r=d.once("add",({path:u})=>{i.value=null,n.set(e.value.id,u.points.slice()),setTimeout(()=>u.destroy(),0)})):(d.stopDrawing(),d.path=null,d.off(r))});const a=()=>{e.value.mask_2d?n.set(e.value.id,null):n.delete(e.value.id)},s=Oe(()=>{if(!e.value)return null;if(n.has(e.value.id))return n.get(e.value.id);if(e.value.mask_2d?.crop_path)return e.value.mask_2d.crop_path.map(c=>({x:c[0],y:c[1]}))});let l=null;return ft(s,c=>{if(l?.destroy(),c){const{pen:d}=t.value.plugins;d.primaryColor=16711680,l=d.draw(c)}},{immediate:!0}),{currentCropPath:s,onDeleteClick:a}}function C0i(t){const e=ht("$viewer"),i=Oe(()=>e.localContext.loadedModels[0]);ft(i,r=>{r&&t.value?.loadModels([r])},{immediate:!0});const o=Oe(()=>t.value?.pdfPages??[]),n=Oe(()=>t.value?.pdfPageIndex??0);return{model:i,pdfPages:o,pdfPageIndex:n,setPdfPage:r=>{t.value?.setPdfPage(r)}}}const x0i={class:"bimdata-plan-mask__viewer"},k0i={key:0,class:"bimdata-plan-mask__viewer__options"},M0i={class:"bimdata-plan-mask__viewer__options__buttons"},B0i={key:0,class:"bimdata-plan-mask__viewer__options__parameters"},E0i={key:0,class:"bimdata-plan-mask__viewer__options__parameters__warning"},P0i={class:"bimdata-plan-mask__viewer__options__parameters__warning__icon"},I0i={class:"bimdata-plan-mask__viewer__options__parameters__warning__title"},S0i={class:"bimdata-plan-mask__viewer__options__parameters__warning__text"},T0i={class:"bimdata-plan-mask__viewer__options__parameters__warning__buttons"},R0i={class:"bimdata-plan-mask__viewer__options__parameters__title"},D0i={class:"bimdata-plan-mask__viewer__options__parameters__parameter--toggle"},L0i={class:"bimdata-plan-mask__viewer__options__parameters__parameter--range"},_0i={class:"bimdata-plan-mask__viewer__options__parameters__parameter--range"},F0i={class:"bimdata-plan-mask__viewer__options__parameters__parameter--range"},O0i={class:"bimdata-plan-mask__viewer__options__parameters__buttons"},U0i={__name:"PlanMaskViewer",setup(t){const e=bi(null),{drawMode:i,onDrawClick:o}=b0i(),{model:n,pdfPages:r,pdfPageIndex:a,setPdfPage:s}=C0i(e),{currentCropPath:l,onDeleteClick:c}=w0i(e,n,i),{parametersDisplayed:d,onDisplayParametersClick:u,warningModelDisplayed:h,onModalCancel:p,onModalOk:A,unsavedChanges:f,allFiltersDefault:m,grayscale:g,brightness:y,contrast:v,opacity:w,onResetParametersClick:x,onApplyParametersClick:k}=y0i(e,n);return(B,P)=>{const E=S("BIMDataIconParameters"),T=S("BIMDataButton"),I=S("BIMDataIconDelete"),R=S("BIMDataIconWarning"),F=S("BIMDataToggle"),U=S("BIMDataSlider");return M(),_("div",x0i,[at(n)?(M(),_("div",k0i,[b("div",M0i,[D(T,{fill:"",square:"",icon:"",onClick:at(u),color:at(d)?"secondary":"default"},{default:N(()=>[D(E,{fill:"",size:"xs"})]),_:1},8,["onClick","color"]),at(l)?(M(),J(T,{key:1,fill:"",square:"",icon:"",onClick:P[2]||(P[2]=z=>at(c)())},{default:N(()=>[D(I,{fill:"",color:"high",size:"xs"})]),_:1})):(M(),_(tt,{key:0},[D(T,{color:at(i)==="rectangle"?"secondary":"default",fill:"",square:"",icon:"",onClick:P[0]||(P[0]=z=>at(o)("rectangle"))},{default:N(()=>[...P[7]||(P[7]=[b("div",{class:"bimdata-plan-mask__viewer__rectangle-icon"},null,-1)])]),_:1},8,["color"]),D(T,{color:at(i)==="path"?"secondary":"default",fill:"",square:"",icon:"",onClick:P[1]||(P[1]=z=>at(o)("path"))},{default:N(()=>[D(v0i)]),_:1},8,["color"])],64))]),at(d)?(M(),_("div",B0i,[at(h)?(M(),_("div",E0i,[b("div",P0i,[D(R,{size:"m",fill:"",color:"high"})]),b("div",I0i,q(B.$t("global.warning"))+"! ",1),b("div",S0i,q(B.$t("plan-mask.parameters.warning_text")),1),b("div",T0i,[D(T,{color:"primary",ghost:"",radius:"",onClick:at(p),width:"120px"},{default:N(()=>[We(q(B.$t("global.cancel")),1)]),_:1},8,["onClick"]),D(T,{color:"high",fill:"",radius:"",onClick:at(A),width:"120px"},{default:N(()=>[We(q(B.$t("global.ok")),1)]),_:1},8,["onClick"])])])):(M(),_(tt,{key:1},[b("div",R0i,[D(E,{fill:"",size:"xs"}),b("span",null,q(B.$t("plan-mask.parameters.title")),1)]),b("div",D0i,[b("span",null,q(B.$t("plan-mask.parameters.grayscale")),1),D(F,{modelValue:at(g),"onUpdate:modelValue":P[3]||(P[3]=z=>fo(g)?g.value=z:null)},null,8,["modelValue"])]),b("div",L0i,[b("div",null,q(B.$t("plan-mask.parameters.brightness"))+" : "+q(at(y))+"% ",1),D(U,{modelValue:at(y),"onUpdate:modelValue":P[4]||(P[4]=z=>fo(y)?y.value=z:null),min:0,max:200,step:1},null,8,["modelValue"])]),b("div",_0i,[b("div",null,q(B.$t("plan-mask.parameters.contrast"))+" : "+q(at(v))+"% ",1),D(U,{modelValue:at(v),"onUpdate:modelValue":P[5]||(P[5]=z=>fo(v)?v.value=z:null),min:0,max:200,step:1},null,8,["modelValue"])]),b("div",F0i,[b("div",null,q(B.$t("plan-mask.parameters.opacity"))+" : "+q(at(w))+"%",1),D(U,{modelValue:at(w),"onUpdate:modelValue":P[6]||(P[6]=z=>fo(w)?w.value=z:null),min:0,max:100,step:1},null,8,["modelValue"])]),b("div",O0i,[D(T,{color:"primary",outline:"",radius:"",width:"135px",height:"36px",disabled:at(m),onClick:at(x)},{default:N(()=>[We(q(B.$t("global.reset")),1)]),_:1},8,["disabled","onClick"]),D(T,{color:"primary",fill:"",radius:"",width:"135px",height:"36px",disabled:!at(f),onClick:at(k)},{default:N(()=>[We(q(B.$t("global.apply")),1)]),_:1},8,["disabled","onClick"])])],64))])):ie("",!0)])):ie("",!0),D(S3,{ref_key:"viewer",ref:e,enablePenPlugin:"",enablePlanMask:!1,ignoreCropPathWhileFitView:""},{default:N(()=>[at(r).length>0?(M(),J(lS,{key:0,pages:at(r),index:at(a),onInput:at(s),onPrev:at(s),onNext:at(s)},null,8,["pages","index","onInput","onPrev","onNext"])):ie("",!0)]),_:1},512)])}}},N0i=j(U0i,[["__scopeId","data-v-c240912b"]]);class j0i{constructor(e){this.$viewer=e}async savePlanMasks(e){const{$viewer:i}=this,{newCropPathByModelId:o,newFiltersByModelId:n}=e,r=[...Array.from(new Set(o.keys())),...Array.from(new Set(n.keys()))],a=new Map;for(const s of r){const l=o.get(s),c=n.get(s),d=i.state.modelsMap.get(s);if(!d){console.warn(`[Plan Mask] Model with ID ${s} not found in state.modelsMap`);continue}if(d.mask_2d&&l===null&&c===null){a.set(s,null);continue}const u={};o.has(s)&&(u.crop_path=l?.map(h=>[h.x,h.y])??null),n.has(s)&&(u.grayscale=c?.grayscale??!1,u.contrast=c?.contrast??100,u.brightness=c?.brightness??100,u.opacity=c?.opacity??1),a.set(s,u)}try{const{apiClient:s,cloudId:l,projectId:c}=i.api;await Promise.all(Array.from(a.entries()).map(async([d,u])=>{if(u===null)await s.modelApi.deleteMask2D(l,d,c),S8(i.state,d,null);else if(i.state.modelsMap.get(d).mask_2d){const h=await s.modelApi.updateMask2D(l,d,c,u);S8(i.state,d,h)}else{const h=await s.modelApi.createMask2D(l,d,c,u);S8(i.state,d,h)}}))}catch(s){console.error(`[Plan Mask] Impossible to save the masks of the models : ${Array.from(a.keys()).join(", ")}`,s)}}}const H0i={class:"bimdata-plan-mask"},V0i={__name:"PlanMask",setup(t){const e=zo({newCropPathByModelId:new Map,newFiltersByModelId:new Map});zi("state",e);const i=new j0i(ht("$viewer"));return zi("service",i),(o,n)=>(M(),_("div",H0i,[D(f0i),D(N0i,{class:"bimdata-plan-mask__content__viewer"})]))}},z0i=j(V0i,[["__scopeId","data-v-8df06378"]]),q0i="Targeted Display",Q0i={title:"Adjust image",grayscale:"Grayscale",brightness:"Brightness",contrast:"Contrast",opacity:"Opacity",warning_text:"You have unsaved changes, are you sure you want to quit?"},G0i={title:q0i,parameters:Q0i},K0i="Affichage Cibl\xE9",J0i={title:"Ajuster l'image",grayscale:"Niveaux de gris",brightness:"Luminosit\xE9",contrast:"Contraste",opacity:"Opacit\xE9",warning_text:"Vous avez des modifications non enregistr\xE9es, \xEAtes-vous s\xFBr de vouloir quitter ?"},Z0i={title:K0i,parameters:J0i},W0i={name:"plan-mask",i18n:{en:G0i,fr:Z0i},component:z0i,window:{name:"plan-mask",header:!1,displayedInWindowSelector:!1,modelTypes:["PDF","JPEG","PNG","METABUILDING"],multiModel:!1}};function hhe(t=()=>{},e=()=>{},i=null){const o=de(!1),n=de(i),r=zo({x:0,y:0});function a(c){if((e?.(c)??!0)===!1)return;o.value=!0;const{x:d,y:u}=n.value.getBoundingClientRect();r.x=c.clientX-d,r.y=c.clientY-u,document.addEventListener("mouseup",s),document.addEventListener("mousemove",l)}function s(){document.removeEventListener("mousemove",l),o.value=!1}function l(c){t?.(c)}return li(()=>n.value.addEventListener("mousedown",a)),as(()=>n.value.removeEventListener("mousedown",a)),{grabbing:o,templateRef:n,startPosition:r}}const Y0i=["attrs"],X0i={key:0,width:"140",height:"140",viewBox:"0 0 140 140",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{position:"absolute",transform:"translate(-50%, -50%)","pointer-events":"none"}},$0i=["d","fill"],efi=["width","viewBox"],tfi=["x2"],ifi=["x2","stroke-dasharray"],ofi=["opacity"],rfi={key:3,width:"6",height:"6",viewBox:"0 0 6 6",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{position:"absolute",transform:"translate(-50%, -50%)","pointer-events":"none"}},nfi=25,afi={__name:"Rotation2D",props:{canvasPosition:{type:Object,required:!0},position:{type:Object,required:!0}},emits:["marker-move"],setup(t,{emit:e}){const i=ht("$viewer").localContext.viewer.viewer,o=i.canvas.parentElement.style,n=o.cursor,r=e,a=t,s=zo({x:a.canvasPosition.x,y:a.canvasPosition.y}),l=Oe(()=>({x:s.x-a.canvasPosition.x,y:s.y-a.canvasPosition.y})),c=Oe(()=>{const{x:F,y:U}=l.value;return Math.sqrt(F*F+U*U)}),d=Oe(()=>{const{x:F,y:U}=l.value;return Math.atan2(U,F)*(180/Math.PI)}),{grabbing:u,templateRef:h}=hhe(F=>{const{clientX:U,clientY:z}=F,{x:H,y:W}=i.canvas.getBoundingClientRect(),{x:Y,y:$}=i.camera.getPosition({x:U-H,y:z-W});s.x=U-H,s.y=z-W,r("marker-move",{x:Y,y:$})},F=>{F.stopPropagation(),F.preventDefault()}),p=Oe(()=>{const{x:F,y:U}=a.canvasPosition,{x:z,y:H}=k;return Math.atan2(H-U,z-F)*(180/Math.PI)}),A=Oe(()=>{const{x:F,y:U}=a.canvasPosition,{x:z,y:H}=k,W=z-F,Y=H-U,$=68/Math.sqrt(W*W+Y*Y);return{x:W*$,y:Y*$}}),f=Oe(()=>{const{x:F,y:U}=l.value,z=68/Math.sqrt(F*F+U*U);return{x:F*z+70,y:U*z+70}}),m=Oe(()=>{const{x:F,y:U}=f.value;return Math.atan2(U-70,F-70)});function g(F,U,z){return`url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="${U}" height="${z}" viewBox="0 0 ${U} ${z}">${F}</svg>')`}const y=Oe(()=>`${g(`<path d="M19.7004 2.28955L19.2674 1.53955L18.8344 2.28955L14.9856 8.95583L14.5526 9.70583H15.4186H18.1325V16.507V17.007H18.6325H19.9023H20.4023V16.507V9.70583H23.1162H23.9822L23.5492 8.95583L19.7004 2.28955ZM18.8344 37.0733L19.2674 37.8233L19.7004 37.0733L23.5492 30.407L23.9822 29.657H23.1162H20.4023V22.8558V22.3558H19.9023H18.6325H18.1325V22.8558V29.657H15.4186H14.5526L14.9856 30.407L18.8344 37.0733Z" fill="black" stroke="white" transform="rotate(${m.value*(180/Math.PI)})" transform-origin="center" />`,39,39)} 20 20, auto`);ft(y,F=>{o.cursor=F},{immediate:!0}),ft(u,F=>{F?o.cursor="crosshair":o.cursor=y.value});const v=Oe(()=>{const{x:F,y:U}=A.value,z=Math.atan2(U,F);let H=m.value-z;return H<-Math.PI?H+=2*Math.PI:H>Math.PI&&(H-=2*Math.PI),H});let w=0;const{grabbing:x,startPosition:k}=hhe(()=>{const F=-(v.value/Math.PI)*180;i.camera.rotate(F-w,a.position),w=F},F=>{if(F.shiftKey)return!1;F.stopPropagation(),F.preventDefault()},i.canvas);ft(x,F=>{F?(i.ui.rotatable=!1,i.ui.translatable=!1,i.ui.scallable=!1):(w=0,i.ui.rotatable=!0,i.ui.translatable=!0,i.ui.scallable=!0)});const B=de(!1),P=Oe(()=>B.value&&x.value);i.ui.on("mousemove",({canvasPosition:F,altKey:U})=>{const{x:z,y:H}=F;if(!x.value||U){s.x=z,s.y=H,B.value=!1;return}const W={x:z-a.canvasPosition.x,y:H-a.canvasPosition.y},Y=Math.atan2(W.y,W.x),$=Math.round(Y/(Math.PI/4))*(Math.PI/4),fe=Math.cos($)*Math.sqrt(W.x*W.x+W.y*W.y),Me=Math.sin($)*Math.sqrt(W.x*W.x+W.y*W.y);Math.sqrt((fe-W.x)*(fe-W.x)+(Me-W.y)*(Me-W.y))<nfi?(s.x=a.canvasPosition.x+fe,s.y=a.canvasPosition.y+Me,B.value=!0):(s.x=z,s.y=H,B.value=!1)});const E=Oe(()=>v.value>0?1:0),T=de(!1),I=de("grab");let R=null;return ft(T,F=>{F&&!R?R=setInterval(()=>{T.value&&(I.value=I.value==="grab"?"grabbing":"grab")},500):!F&&R&&(clearInterval(R),R=null,I.value="grab")}),Ti(()=>{o.cursor=n}),(F,U)=>(M(),_(tt,null,[(M(),_("svg",{attrs:F.$attrs,width:"140",height:"140",viewBox:"0 0 140 140",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{position:"absolute",transform:"translate(-50%, -50%)","pointer-events":"none"}},[...U[2]||(U[2]=[b("circle",{cx:"70",cy:"70",r:"68",stroke:"#2F374A","stroke-width":"2"},null,-1)])],8,Y0i)),at(x)?(M(),_("svg",X0i,[b("path",{d:`
5530
5530
  m${f.value.x+","+f.value.y}
5531
5531
  L70,70
5532
5532
  l${A.value.x+","+A.value.y}
@@ -5540,5 +5540,5 @@ void main() {
5540
5540
  --bimdata-local-context-width: ${o.width}px;
5541
5541
  --bimdata-local-context-center-width: ${o.centerWidth}px;
5542
5542
  --bimdata-local-context-resolution: ${o.resolution};
5543
- `),onMouseenter:e[0]||(e[0]=(...h)=>o.onMouseEnter&&o.onMouseEnter(...h)),onMouseleave:e[1]||(e[1]=(...h)=>o.onMouseLeave&&o.onMouseLeave(...h))},[D(a,{ref:"modalManagerTemplateRef"},null,512),b("div",a4i,[o.windowPlugins.leftSidePanel?(M(),J(s,{key:0,plugin:o.windowPlugins.leftSidePanel},null,8,["plugin"])):ie("",!0),b("div",s4i,[(M(!0),_(tt,null,Bt(o.windowPlugins.free,h=>(M(),J(l,{key:h.name,class:le({"window-container__content__center__viewer":h.isViewer}),plugin:h},null,8,["class","plugin"]))),128)),D(c,{position:"left",plugins:o.windowPlugins.leftButtonColumn},null,8,["plugins"]),D(c,{position:"right",plugins:o.windowPlugins.rightButtonColumn},null,8,["plugins"])]),o.windowPlugins.rightSidePanel?(M(),J(s,{key:1,plugin:o.windowPlugins.rightSidePanel},null,8,["plugin"])):ie("",!0)]),o.loading?(M(),_("div",l4i,[o.spinner&&o.spinner.component?(M(),J(Mo(o.spinner.component),Ta(wn({key:0},o.spinner.props)),null,16)):(M(),J(d,{key:1,size:"20px",border:"3px"}))])):ie("",!0),o.layoutSettingsDisplayed?(M(),_("div",c4i,[D(u)])):ie("",!0)],36)}const u4i=j(n4i,[["render",d4i],["__scopeId","data-v-3ed35f9c"]]);class h4i{constructor(e=!0){const i=$vi(Zj,null,{resizable:e});i.registerContent("default",u4i),this.settings=$r({edit:!1,swap:!1,full:!1}),this.areas=i}get resizable(){return this.areas.resizable}set resizable(e){this.areas.resizable=e}apply(e=null){this.areas.layout=e?e3i(e):null}copy(e,i=!0){return t3i(this.areas.layout,e,i)}open({ratio:e,direction:i,insertAfter:o,windowName:n=null,windowState:r=null,localContextId:a=null}={}){const s=n?{options:{windowName:n,windowState:r}}:null;return a===null?this.areas.splitLayout(e,i,o,s):this.areas.split(a,e,i,o,s)}swap(e,i){return this.areas.swap(e,i)}close(e){return this.areas.delete(e)}compare(e,i){if(!e&&!i)return!0;if(!e||!i)return!1;if(typeof e=="string"&&typeof i=="string")return e===i;if(typeof e=="string"||typeof i=="string")return!1;if(e.windowName&&i.windowName){if(e.windowName!==i.windowName)return!1;const o=new Set(e.windowState?.modelIds),n=new Set(i.windowState?.modelIds);return o.size===n.size&&[...o].every(r=>n.has(r))}return e.windowName||i.windowName||e.direction!==i.direction||e.children.length!==i.children.length?!1:e.children.every((o,n)=>this.compare(o,i.children[n]))}}const p4i="2.14.0-beta.2",f4i={version:p4i};let A4i=1;class g4i{constructor({plugins:e,api:i,ui:o,locale:n="fr"}){this.instanceId=A4i++,this.pluginManager=new zAi(e),this.windowManager=new QAi,this.windowManager.registerAndAddPluginsToWindows([...this.pluginManager.registeredPlugins.values()]),this.api=new svi(i),this.globalContext=new D5e(this),this.state=vvi(this),this.shortcutManager=xAe(this.state),this.uiSettings=o||{},this.i18n=new T5e(n),this._contextMenu=null,this.layout=new h4i(this.uiSettings.resizable!==!1),this._darkTheme=de(o?.darkTheme??!1),this.localContext=null,window.$viewer=this}get darkTheme(){return this._darkTheme.value}set darkTheme(e){this._darkTheme.value=e}get version(){return f4i.version}get locale(){return this.i18n.locale}get contextMenu(){return this._contextMenu||wAe}set contextMenu(e){this._contextMenu=e}get registeredWindows(){return[...this.windowManager.registeredWindows.keys()]}get registeredPlugins(){return[...this.pluginManager.registeredPlugins.keys()]}get pluginsCfg(){return this.pluginManager.cfg}registerPlugin(e){this.pluginManager.registerPlugin(e),this.windowManager.registerAndAddPluginsToWindows([e])}}function m4i(t,e={}){e.backgroundColor&&(t.style.setProperty("--bimdata-viewer-background-color",e.backgroundColor),e.backgroundColor==="transparent"&&t.style.setProperty("--areas-separator-color","transparent")),e.colorPrimary&&t.style.setProperty("--color-primary",e.colorPrimary),e.colorPrimaryLighter&&t.style.setProperty("--color-primary-lighter",e.colorPrimaryLighter),e.colorPrimaryLight&&t.style.setProperty("--color-primary-light",e.colorPrimaryLight),e.colorPrimaryDark&&t.style.setProperty("--color-primary-dark",e.colorPrimaryDark),e.colorSecondary&&t.style.setProperty("--color-secondary",e.colorSecondary),e.colorSecondaryLighter&&t.style.setProperty("--color-secondary-lighter",e.colorSecondaryLighter),e.colorSecondaryLight&&t.style.setProperty("--color-secondary-light",e.colorSecondaryLight),e.colorSecondaryDark&&t.style.setProperty("--color-secondary-dark",e.colorSecondaryDark),e.colorSilverLight&&t.style.setProperty("--color-silver-light",e.colorSilverLight),e.colorSilver&&t.style.setProperty("--color-silver",e.colorSilver),e.colorSilverDark&&t.style.setProperty("--color-silver-dark",e.colorSilverDark),e.colorGraniteLight&&t.style.setProperty("--color-granite-light",e.colorGraniteLight),e.colorGranite&&t.style.setProperty("--color-granite",e.colorGranite),e.colorSuccess&&t.style.setProperty("--color-success",e.colorSuccess),e.colorSuccessLighter&&t.style.setProperty("--color-success-Lighter",e.colorSuccessLighter),e.colorSuccessLight&&t.style.setProperty("--color-success-Light",e.colorSuccessLight),e.colorSuccessDark&&t.style.setProperty("--color-success-Dark",e.colorSuccessDark),e.colorWarning&&t.style.setProperty("--color-warning",e.colorWarning),e.colorWarningLighter&&t.style.setProperty("--color-warning-Lighter",e.colorWarningLighter),e.colorWarningLight&&t.style.setProperty("--color-warning-Light",e.colorWarningLight),e.colorWarningDark&&t.style.setProperty("--color-warning-Dark",e.colorWarningDark),e.colorHigh&&t.style.setProperty("--color-high",e.colorHigh),e.colorHighLighter&&t.style.setProperty("--color-high-lighter",e.colorHighLighter),e.colorHighLight&&t.style.setProperty("--color-high-light",e.colorHighLight),e.colorHighDark&&t.style.setProperty("--color-high-dark",e.colorHighDark),e.colorText&&t.style.setProperty("--color-text",e.colorText),(!e.backgroundColor||e.backgroundColor!=="transparent")&&t.style.setProperty("--areas-separator-color","rgba(216, 216, 216, 1)"),e.headerHeight!=null&&t.style.setProperty("--bimdata-viewer-header-height",e.headerHeight),t.style.setProperty("--areas-background-color","transparent")}const v4i=Object.freeze({25:"GUEST",50:"USER",100:"ADMIN"}),q2=Object.freeze({READ:"read",WRITE:"write"});function rfe(t){const e={};return t.forEach(i=>{const[o,n]=i.split(":");e[o]?e[o].push(n):e[o]=[n]}),e}const y4i={token_scopes:[],usable_scopes:[],user_role:25};function nfe(t=y4i){const e=rfe(t.token_scopes),i=rfe(t.usable_scopes);return{...QQ(t),tokenScopes:e,usableScopes:i,userRole:v4i[t.user_role],user:t.user?QQ(t.user):null,hasBcfReadPermission:i.bcf?.includes(q2.READ)??!1,hasBcfWritePermission:i.bcf?.includes(q2.WRITE)??!1,hasModelReadPermission:i.model?.includes(q2.READ)??!1,hasModelWritePermission:i.model?.includes(q2.WRITE)??!1,hasDocReadPermission:i.document?.includes(q2.READ)??!1,hasDocWritePermission:i.document?.includes(q2.WRITE)??!1}}const b4i={back:"Zur\xFCck",BcfFilters:{filtersButton:"Filter",filtersTitle:"Filter",priorityLabel:"Priorit\xE4t",statusLabel:"Status",stageLabel:"Phase",assignedToLabel:"Zugewiesen an",creatorsLabel:"Erstellt von",tagsLabel:"Tags",resetButton:"Zur\xFCcksetzen",searchButton:"Suchen",undefined:"Nicht definiert",datePlaceholder:"Erstellungsdatum"},BcfSettings:{title:"BCF-Parameter",text:"Erstellen, f\xFCllen und listen Sie die BCF-Einstellungen auf, die Sie f\xFCr dieses Projekt haben m\xF6chten.",validateButton:"Die BCF-Parameter anerkennen"},BcfStatistics:{emptyText:"F\xFCgen Sie Fragen hinzu, um zugeh\xF6rige Statistiken hier anzuzeigen.",issues:"Probleme",extension:{Priority:"Priorit\xE4t",PriorityNotDefined:"Keine Priorit\xE4t",PriorityTitle:"Priorit\xE4ten",Status:"Status",StatusNotDefined:"Kein Status",StatusTitle:"Status"}},BcfTopicCard:{priority:"Priorit\xE4t",noPriority:"Keine",assignedTo:"Zugewiesen an",elements:"Elemente",notSpecified:"Nicht definiert",see:"Anzeigen"},BcfTopicCreationCard:{text:"Ein neues BCF-Thema erstellen",createBcfSideTitle:"Ein Problem melden"},BcfTopicForm:{dragDropImageText:"Bitte w\xE4hlen Sie eine Datei aus.",addObjectButton:"Objekt",addAnnotationButton:"Annotation",annotationButtonTooltip:"Zu diesem Thema gibt es derzeit keine Ansichten.",addPictureButton:"F\xFCgen Sie ein Bild hinzu.",titlePlaceholder:"Titel *",titleErrorMessage:"Titel fehlt",typeLabel:"Typ",priorityLabel:"Priorit\xE4t",statusLabel:"Status",stageLabel:"Phase",assignedToLabel:"Zugewiesen an",dueDateLabel:"F\xE4lligkeitsdatum (TT.MM.JJJJ)",descriptionLabel:"Beschreibung",labelsLabel:"Tags",createButton:"Best\xE4tigen",updateButton:"\xC4nderungen \xFCbernehmen",modalText:"Sie sind dabei, die Bearbeitung der Ausgabe {Name} zu beenden, aber es gibt noch ungespeicherte \xC4nderungen.",cancelButton:"\xC4nderungen verwerfen",continueButton:"\xC4nderungen fortsetzen",createTitle:"Ein Problem melden",dragDropImageTextTablet:"Foto machen",takeSnapshot:"Mach einen Schnappschuss",importFile:"Eine Datei importieren",searchPlaceholder:"Suchen",emptySearch:"kein Ergebnis"},BcfTopicOverview:{openViewer:"Im Viewer \xF6ffnen",openViewerNoModels:"Es sind keine Vorlagen zur Ansicht bereit",elements:"{count} Elemente",noElements:"kein Element",type:"Typ",noTypeSpecified:"Kein Typ angegeben",description:"Beschreibung",noDescriptionProvided:"Keine Beschreibung angegeben",assignedTo:"Zugeteilt an",notAssigned:"Nicht zugewiesen",dueDate:"F\xE4lligkeitsdatum",noDueDate:"Kein F\xE4lligkeitsdatum",informations:"Informationen",status:"Status",noStatusSpecified:"Kein Status angegeben",stage:"Phase",noStageProvided:"Keine Phase angegeben",priority:"Priorit\xE4t",priorityNotDefined:"Nicht definiert",tags:"Tags",noTags:"Keine Tags",commentButton:"Ein Kommentar ver\xF6ffentlichen",deleteText:"Sie l\xF6schen jetzt {Name}",deleteBcfButton:"Dieses BCF l\xF6schen",keepBcfButton:"Dieses BCF beibehalten",author:"Autor"},BcfTopicsTable:{headers:{index:"#",priority:"Priorit\xE4t",status:"Status",title:"Titel",creator:"Autor",date:"Datum"}},BcfTopicActionsCell:{seeButton:"Anzeigen"},BcfTopicComments:{commentButton:"Ein Kommentar verfassen",commentLabel:"Ein Kommentar verfassen",commentText:"Kommentar",cancelButton:"Abbrechen",publishButton:"Ver\xF6ffentlichen",commentsText:"Kommentare",deleteCommentText:"Diesen Kommentar l\xF6schen?",deleteButton:"L\xF6schen",takeSnapshot:"Mach einen Schnappschuss"},BcfTopicPriorityCell:{noPriority:"Keine"},SettingCard:{addButton:"ein Element hinzuf\xFCgen",cancelButton:"Abbrechen",validateButton:"Best\xE4tigen",deleteExtensionText:"Diesen Parameter l\xF6schen",deleteButton:"L\xF6schen",title:{Priority:"Priorit\xE4ten",Label:"Tags",Status:"Status",Type:"Typen",Stage:"Phasen"},input:{Priority:"Eine neue Priorit\xE4t hinzuf\xFCgen",Label:"Ein neues Etikett hinzuf\xFCgen",Status:"Einen neuen Status hinzuf\xFCgen",Type:"Einen neuen Typ hinzuf\xFCgen",Stage:"Eine neue Phase hinzuf\xFCgen"},text:{Priority:"Liste der Priorit\xE4ten",Label:"Liste von Tags",Status:"Liste der Status",Type:"Liste der Typen",Stage:"Liste der Phasen"}}},w4i={BcfComponents:b4i},C4i={back:"Back",BcfFilters:{filtersButton:"Filters",filtersTitle:"Filters",priorityLabel:"Priority",statusLabel:"Status",stageLabel:"Stage",assignedToLabel:"Assigned to",creatorsLabel:"Created by",tagsLabel:"Tags",resetButton:"Reset",searchButton:"Search",undefined:"Not defined",datePlaceholder:"Creation date"},BcfSettings:{title:"BCF Settings",text:"Create, enter in, and list the BCF settings you would like to have for this project",validateButton:"Validate BCF settings"},BcfStatistics:{emptyText:"Add BCF Topics to start to have some stats here.",issues:"issues",extension:{Priority:"Priority",PriorityNotDefined:"No priority",PriorityTitle:"Priorities",Status:"Status",StatusNotDefined:"No status",StatusTitle:"Status"}},BcfTopicCard:{priority:"Priority",noPriority:"None",assignedTo:"Assigned to",elements:"Elements",notSpecified:"Not specified",see:"See"},BcfTopicCreationCard:{text:"Create a new BCF topic",createBcfSideTitle:"Report a problem"},BcfTopicForm:{dragDropImageText:"Please select a file",addObjectButton:"Object",addAnnotationButton:"Annotation",annotationButtonTooltip:"This topic has no viewpoint",addPictureButton:"Add a picture",titlePlaceholder:"Title *",titleErrorMessage:"Missing title",typeLabel:"Type",priorityLabel:"Priority",statusLabel:"Status",stageLabel:"Stage",assignedToLabel:"Assigned to",dueDateLabel:"Due date",descriptionLabel:"Description",labelsLabel:"Tags",createButton:"Validate",updateButton:"Modify this BCF",modalText:"You are about to quit editing issue {name} but there are unsaved changes.",cancelButton:"Discard changes",continueButton:"Continue editing",createTitle:"Report a problem",dragDropImageTextTablet:"Take a picture",takeSnapshot:"Take a snapshot",importFile:"Import a file",searchPlaceholder:"Search",emptySearch:"No result",documentsLabel:"Add a file",documentsCount:"Files - {count} selected files",validateDocuments:"Validate"},BcfTopicOverview:{openViewer:"Open in viewer",openViewerNoModels:"No model to open",elements:"{count} Elements",noElements:"No element",type:"Type",noTypeSpecified:"No type specified",description:"Description",noDescriptionProvided:"No description provided",assignedTo:"Assigned to",notAssigned:"Not assigned",dueDate:"Due date",noDueDate:"No due date",informations:"Informations",status:"Status",noStatusSpecified:"No status specified",stage:"Stage",noStageProvided:"No stage provided",priority:"Priority",priorityNotDefined:"Not defined",tags:"Tags",noTags:"No tags",commentButton:"Post a comment",deleteText:"You are about to delete {name}",deleteBcfButton:"Delete this BCF",keepBcfButton:"Keep this BCF",author:"Author"},BcfTopicsTable:{headers:{index:"#",priority:"Priority",status:"Status",title:"Title",creator:"Author",date:"Date"}},BcfTopicActionsCell:{seeButton:"See"},BcfTopicComments:{commentButton:"Post a comment",commentLabel:"Post a comment",commentText:"Comment",cancelButton:"Cancel",publishButton:"Publish",commentsText:"Comments",deleteCommentText:"Delete this comment ?",deleteButton:"Delete",takeSnapshot:"Take a snapshot",edited:"edited"},BcfTopicPriorityCell:{noPriority:"None"},SettingCard:{addButton:"add an element",cancelButton:"Cancel",validateButton:"Validate",deleteExtensionText:"Remove this setting",deleteButton:"Delete",title:{Priority:"Priorities",Label:"Labels",Status:"Status",Type:"Types",Stage:"Stages"},input:{Priority:"Add a new priority",Label:"Add a new label",Status:"Add new status",Type:"Add a new type",Stage:"Add a new stage"},text:{Priority:"Priority list",Label:"Labels list",Status:"Status list",Type:"Type list",Stage:"Stage list"}}},x4i={BcfComponents:C4i},k4i={back:"Volver",BcfFilters:{filtersButton:"Filtros",filtersTitle:"Filtros",priorityLabel:"Prioridad",statusLabel:"Estado",stageLabel:"Fase",assignedToLabel:"Asignado a",creatorsLabel:"Creado por",tagsLabel:"Etiquetas:",resetButton:"Restablecer",searchButton:"Buscar en",undefined:"No definido",datePlaceholder:"Fecha de creaci\xF3n"},BcfSettings:{title:"Par\xE1metros del BCF",text:"Cree, rellene y enumere los par\xE1metros del BCF que desea tener en este proyecto",validateButton:"Validar los par\xE1metros del BCF"},BcfStatistics:{emptyText:"A\xF1ada preguntas para ver las estad\xEDsticas asociadas aqu\xED.",issues:"problemas",extension:{Priority:"Prioridad",PriorityNotDefined:"Sin prioridad",PriorityTitle:"Prioridades",Status:"Estado",StatusNotDefined:"Sin estado",StatusTitle:"Estatutos"}},BcfTopicCard:{priority:"Prioridad",noPriority:"Sin",assignedTo:"Asignado a",elements:"Elementos",notSpecified:"No definido",see:"Ver"},BcfTopicCreationCard:{text:"Crear un nuevo tema BCF",createBcfSideTitle:"Informar de un problema"},BcfTopicForm:{dragDropImageText:"Seleccione un archivo",addObjectButton:"Objeto",addAnnotationButton:"Anotaci\xF3n",annotationButtonTooltip:"Actualmente este tema no posee ning\xFAn punto de vista",addPictureButton:"A\xF1adir una imagen",titlePlaceholder:"T\xEDtulo *",titleErrorMessage:"Falta el t\xEDtulo",typeLabel:"Tipo",priorityLabel:"Prioridad",statusLabel:"Estado",stageLabel:"Fase",assignedToLabel:"Asignado a",dueDateLabel:"Fecha de vencimiento (DD/MM/AAAA)",descriptionLabel:"Descripci\xF3n",labelsLabel:"Etiquetas",createButton:"Validar",updateButton:"Modificar este BCF",modalText:"Est\xE1 a punto de salir de la edici\xF3n del problema de {name} pero hay cambios sin guardar.",cancelButton:"Cancelar los cambios",continueButton:"Continuar con los cambios",createTitle:"Informar de un problema",dragDropImageTextTablet:"Tomar una fotograf\xEDa",takeSnapshot:"Tomar un snapshot",importFile:"Importar un archivo",searchPlaceholder:"Buscar",emptySearch:"No hay resultados"},BcfTopicOverview:{openViewer:"Abrir en el visor",openViewerNoModels:"No hay ning\xFAn modelo listo para la visualizaci\xF3n",elements:"{count} Elementos",noElements:"Ning\xFAn elemento",type:"Tipo",noTypeSpecified:"No se especifica el tipo",description:"Descripci\xF3n",noDescriptionProvided:"No hay descripci\xF3n",assignedTo:"Asignado a",notAssigned:"No asignado",dueDate:"Plazo",noDueDate:"Sin fecha de vencimiento",informations:"Informaci\xF3n",status:"Estado",noStatusSpecified:"No se especifica el estado",stage:"Fase",noStageProvided:"No se indica ninguna fase",priority:"Prioridad",priorityNotDefined:"No definido",tags:"Etiquetas",noTags:"Sin etiquetas",commentButton:"Publicar un comentario",deleteText:"Est\xE1s a punto de borrar {name}",deleteBcfButton:"Borrar este BCF",keepBcfButton:"Mantenga este BCF",author:"Autor"},BcfTopicsTable:{headers:{index:"#",priority:"Prioridad",status:"Estado",title:"T\xEDtulo",creator:"Autor",date:"Fecha"}},BcfTopicActionsCell:{seeButton:"Ver"},BcfTopicComments:{commentButton:"Publicar un comentario",commentLabel:"Publicar un comentario",commentText:"Comentario",cancelButton:"Cancelar",publishButton:"Publicar",commentsText:"comentarios",deleteCommentText:"\xBFBorrar este comentario?",deleteButton:"Borrar",takeSnapshot:"Tomar un snapshot"},BcfTopicPriorityCell:{noPriority:"Sin"},SettingCard:{addButton:"a\xF1adir un elemento",cancelButton:"Cancelar",validateButton:"Validar",deleteExtensionText:"Borrar esta configuraci\xF3n",deleteButton:"Borrar",title:{Priority:"Prioridades",Label:"Etiquetas:",Status:"Estatutos",Type:"Tipos",Stage:"Fases"},input:{Priority:"A\xF1adir una nueva prioridad",Label:"A\xF1adir una nueva etiqueta",Status:"A\xF1adir un nuevo estado",Type:"A\xF1adir un nuevo tipo",Stage:"A\xF1adir una nueva fase"},text:{Priority:"Lista de prioridades",Label:"Lista de etiquetas",Status:"Lista de estatutos",Type:"Lista de tipos",Stage:"Lista de fases"}}},M4i={BcfComponents:k4i},B4i={back:"Retour",BcfFilters:{filtersButton:"Filtres",filtersTitle:"Filtres",priorityLabel:"Priorit\xE9",statusLabel:"Statut",stageLabel:"Phase",assignedToLabel:"Assign\xE9 \xE0",creatorsLabel:"Cr\xE9\xE9 par",tagsLabel:"Tags",resetButton:"R\xE9initialiser",searchButton:"Rechercher",undefined:"Non d\xE9fini",datePlaceholder:"Date de cr\xE9ation"},BcfSettings:{title:"Param\xE8tres BCF",text:"Cr\xE9ez, renseignez et listez les param\xE8tres BCF que vous souhaitez avoir sur ce projet",validateButton:"Valider les param\xE8tres BCF"},BcfStatistics:{emptyText:"Ajoutez des questions pour voir les statistiques associ\xE9es ici.",issues:"probl\xE8mes",extension:{Priority:"Priorit\xE9",PriorityNotDefined:"Aucune priorit\xE9",PriorityTitle:"Priorit\xE9s",Status:"Statut",StatusNotDefined:"Aucun statut",StatusTitle:"Statuts"}},BcfTopicCard:{priority:"Priorit\xE9",noPriority:"Aucune",assignedTo:"Assign\xE9 \xE0",elements:"{n} \xC9lements",notSpecified:"Non d\xE9fini",see:"Voir"},BcfTopicCreationCard:{text:"Cr\xE9er un nouveau topic BCF",createBcfSideTitle:"Signaler un probl\xE8me"},BcfTopicForm:{dragDropImageText:"Veuillez s\xE9lectionner un fichier",addObjectButton:"Objet",addAnnotationButton:"Annotation",annotationButtonTooltip:"Ce topic ne poss\xE8de actuellement aucun point de vue",addPictureButton:"Ajouter une image",titlePlaceholder:"Titre *",titleErrorMessage:"Titre manquant",typeLabel:"Type",priorityLabel:"Priorit\xE9",statusLabel:"Statut",stageLabel:"Phase",assignedToLabel:"Assign\xE9 \xE0",dueDateLabel:"Date d'\xE9ch\xE9ance",descriptionLabel:"Description",labelsLabel:"Tags",createButton:"Valider",updateButton:"Modifier ce BCF",modalText:"Vous \xEAtes sur le point de quitter l'\xE9dition de l'issue {name} mais il y'a des modifications non enregistr\xE9es.",cancelButton:"Annuler les modifications",continueButton:"Continuer les modifications",createTitle:"Signaler un probl\xE8me",dragDropImageTextTablet:"Prendre une photo",takeSnapshot:"Prendre un snapshot",importFile:"Importer un fichier",searchPlaceholder:"Rechercher",emptySearch:"Pas de r\xE9sultat",documentsLabel:"Documents",documentsCount:"Documents - {count} documents s\xE9lectionn\xE9s",validateDocuments:"Valider"},BcfTopicOverview:{openViewer:"Ouvrir dans le viewer",openViewerNoModels:"Il n'y a aucun mod\xE8le pr\xEAt pour une visualisation",elements:"{count} \xC9lements",noElements:"Aucun \xE9l\xE9ment concern\xE9",type:"Type",noTypeSpecified:"Pas de type sp\xE9cifi\xE9",description:"Description",noDescriptionProvided:"Pas de description renseign\xE9e",assignedTo:"Assign\xE9 \xE0",notAssigned:"Non assign\xE9",dueDate:"\xC9ch\xE9ance",noDueDate:"Pas de date d'\xE9ch\xE9ance",informations:"Informations",status:"Statut",noStatusSpecified:"Pas de statut sp\xE9cifi\xE9",stage:"Phase",noStageProvided:"Pas de phase renseign\xE9e",priority:"Priorit\xE9",priorityNotDefined:"Non d\xE9fini",tags:"Tags",noTags:"Pas de tags",commentButton:"Poster un commentaire",deleteText:"Vous \xEAtes sur le point de supprimer {name}",deleteBcfButton:"Supprimer ce BCF",keepBcfButton:"Conserver ce BCF",author:"Auteur"},BcfTopicsTable:{headers:{index:"#",priority:"Priorit\xE9",status:"Statut",title:"Titre",creator:"Auteur",date:"Date"}},BcfTopicActionsCell:{seeButton:"Voir"},BcfTopicComments:{commentButton:"Poster un commentaire",commentLabel:"Poster un commentaire",commentText:"Commentaire",cancelButton:"Annuler",publishButton:"Publier",commentsText:"commentaires",deleteCommentText:"Supprimer ce commentaire ?",deleteButton:"Supprimer",takeSnapshot:"Prendre un snapshot",edited:"edit\xE9"},BcfTopicPriorityCell:{noPriority:"Aucune"},SettingCard:{addButton:"ajouter un \xE9l\xE9ment",cancelButton:"Annuler",validateButton:"Valider",deleteExtensionText:"Supprimmer ce param\xE8tre",deleteButton:"Supprimer",title:{Priority:"Priorit\xE9s",Label:"Tags",Status:"Statuts",Type:"Types",Stage:"Phases"},input:{Priority:"Ajouter une nouvelle priorit\xE9",Label:"Ajouter un nouveau label",Status:"Ajouter un nouveau statut",Type:"Ajouter un nouveau type",Stage:"Ajouter une nouvelle phase"},text:{Priority:"Liste des priorit\xE9s",Label:"Liste des tags",Status:"Liste des statuts",Type:"Liste des types",Stage:"Liste des phases"}}},E4i={BcfComponents:B4i},P4i={back:"Indietro",BcfFilters:{filtersButton:"Filtri",filtersTitle:"Filtri",priorityLabel:"Priorit\xE0",statusLabel:"Stato",stageLabel:"Fase",datePlaceholder:"Data di creazione",assignedToLabel:"Assegnato a",creatorsLabel:"Creato da",tagsLabel:"Etichette",resetButton:"Ripristina",searchButton:"Cerca",undefined:"Non definito"},BcfSettings:{title:"Parametri BCF",text:"Creare, notificare e elencare i parametri BCF che si desidera avere su questo progetto",validateButton:"Conferma i parametri BCF"},BcfStatistics:{emptyText:"Aggiungi delle domande per vedere le statistiche associate qui.",issues:"problemi",extension:{Priority:"Priorit\xE0",PriorityNotDefined:"Nessuna priorit\xE0",PriorityTitle:"Priorit\xE0",Status:"Stato",StatusNotDefined:"Nessuno stato",StatusTitle:"Stati"}},BcfTopicCard:{priority:"Priorit\xE0",noPriority:"Nessuno",assignedTo:"Assegnato a",elements:"Elementi",noElements:"0 elementi",notSpecified:"Non definito",see:"Visualizza"},BcfTopicCreationCard:{text:"Crea un nuovo topic BCF",createBcfSideTitle:"Segnala un problema"},BcfTopicForm:{dragDropImageText:"Selezionare un file",addObjectButton:"Oggetto",addAnnotationButton:"Annotazione",annotationButtonTooltip:"Attualmente questo argomento non presenta alcun punto di vista",addPictureButton:"Aggiungere un'immagine",titlePlaceholder:"Titolo *",titleErrorMessage:"Titolo mancante",typeLabel:"Tipo",priorityLabel:"Priorit\xE0",statusLabel:"Stato",stageLabel:"Fase",assignedToLabel:"Assegnato a",dueDateLabel:"Data di scadenza",descriptionLabel:"Descrizione",labelsLabel:"Tag",createButton:"Conferma",updateButton:"Modificare questo BCF",modalText:"State per abbandonare la modifica di {name} ma ci sono modifiche non salvate.",cancelButton:"Annullare le modifiche",continueButton:"Continuare le modifiche",createTitle:"Segnala un problema"},BcfTopicOverview:{openViewer:"Apri nel visualizzatore",openViewerNoModels:"Non esistono modelli pronti per la visualizzazione",elements:"{count} Elementi",noElements:"Nessun elemento",type:"Tipo",noTypeSpecified:"Nessun tipo specificato",description:"Descrizione",noDescriptionProvided:"Nessuna descrizione inserita",assignedTo:"Assegnato a",notAssigned:"Non assegnato",dueDate:"Scadenza",noDueDate:"Nessuna data di scadenza",informations:"Informazioni",status:"Stato",noStatusSpecified:"Nessuno stato specificato",stage:"Fase",noStageProvided:"Nessuna fase inserita",priority:"Priorit\xE0",priorityNotDefined:"Non definita",tags:"Etichette",noTags:"Nessuna etichetta",commentButton:"Pubblica un commento",deleteText:"Stai per eliminare {name}",deleteBcfButton:"Elimina questo BCF",keepBcfButton:"Conserva questo BCF",author:"Autore"},BcfTopicsTable:{headers:{index:"#",priority:"Priorit\xE0",status:"Stato",title:"Titolo",creator:"Autore",date:"Data"}},BcfTopicActionsCell:{seeButton:"Visualizza"},BcfTopicComments:{commentButton:"Pubblica un commento",commentLabel:"Pubblica un commento",commentText:"Commento",cancelButton:"Annulla",publishButton:"Pubblica",commentsText:"commenti",deleteCommentText:"Eliminare questo commento?",deleteButton:"Elimina"},BcfTopicPriorityCell:{noPriority:"Nessuno"},SettingCard:{addButton:"aggiungi un elemento",cancelButton:"Annulla",validateButton:"Conferma",deleteExtensionText:"Elimina questo parametro",deleteButton:"Elimina",title:{Priority:"Priorit\xE0",Label:"Etichette",Status:"Stati",Type:"Tipi",Stage:"Fasi"},input:{Priority:"Aggiungi una nuova priorit\xE0",Label:"Aggiungi una nuova etichetta",Status:"Aggiungi un nuovo stato",Type:"Aggiungi un nuovo tipo",Stage:"Aggiungi una nuova fase"},text:{Priority:"Elenco delle priorit\xE0",Label:"Elenco delle etichette",Status:"Elenco degli stati",Type:"Elenco dei tipi",Stage:"Elenco delle fasi"}}},I4i={BcfComponents:P4i},S4i={de:w4i,en:x4i,es:M4i,fr:E4i,it:I4i},T4i=({apiClient:t,fetchUsers:e,i18nPlugin:i}={})=>({install(o){t?Ui.setup({apiClient:t,fetchUsers:e}):console.error("[BCF Components Plugin] No api client provided. You must provide an api client for the components to work properly."),i?Object.entries(S4i).forEach(([n,r])=>{i.global.mergeLocaleMessage(n,r)}):console.warn("[BCF Components Plugin] No i18n instance provided. You should either provide an i18n instance or define your own translations in order have text displayed properly."),Object.entries(lbe).forEach(([n,r])=>{o.component(n,r)})}}),R4i={title:"Building Maker",back:"Zur\xFCck",list:{text:"Erstellen und bearbeiten Sie die Etagen und laden Sie anschlie\xDFend Ihre PDFs herunter.",createButton:"Neues Projekt",updateButton:"Umbenennen",deleteButton:"L\xF6schen"},form:{text:"Erstellen und bearbeiten Sie die Etagen und laden Sie anschlie\xDFend Ihre PDFs herunter.",input:"Name des Geb\xE4udes",error:"Ung\xFCltiger Name",createButton:"Erstellen",updateButton:"Best\xE4tigen"},view:{addStoreyButton:"Etage",addPlanButton:"Grundriss",closeButton:"Fertigstellen",submitFilesButton:"Best\xE4tigen"},storeyForm:{title:"Neue Etage",input:"Name",error:"Ung\xFCltiger Name",cancelButton:"Abbrechen",submitButton:"Best\xE4tigen"}},D4i={creationFormTitle:"Ordner erstellen",renameFormPlaceholder:"Datei- / Ordnernam",nameInputPlaceholder:"Ordnername",emptyFolder:"Dieser Ordner ist leer",newFolderSuccess:"Neuer Ordner erstellt",renameFolderSuccess:"Umbenannter Ordner",deleteFolderSuccess:"Ordner gel\xF6scht",newFileSuccess:"Datei hinzugef\xFCgt",renameFileSuccess:"Umbenannte Datei",deleteFileSuccess:"Datei gel\xF6scht",nameInputErrorMessage:"Ung\xFCltiger name",cancel:"Abbrechen",submit:"Best\xE4tigen",buttonText:"Neuer Ordner",addFileButtonText:"Datei laden",rename:"Umbenennen",view:"Sehen",download:"Herunterladen",delete:"L\xF6schen",deleteTitle:"Dateien l\xF6schen",deleteDetail:"Sie sind im Begriff, die folgenden Dateien / Ordner endg\xFCltig zu l\xF6schen"},L4i={BuildingMaker:R4i,FileManager:D4i},_4i={t:{back:"Back",cancel:"Cancel",create:"Create",delete:"Delete",download:"Download",finish:"Finish",rename:"Rename",search:"Search",see:"View",storey:"Storey",validate:"Validate"}},F4i={title:"Building Maker",list:{text:"Create and edit storeys, then download your PDFs.",new:"New project"},form:{input:"Building name",error:"Invalid"},view:{addStorey:"Add Storey",addFile:"Add File",addPlan:"Add Plan"},storeyForm:{title:"New storey",input:"Name",error:"Invalid name"}},O4i={creationFormTitle:"Create folder",renameFormPlaceholder:"Folder/File name",nameInputPlaceholder:"Folder name",emptyFolder:"This folder is empty",newFolderSuccess:"New folder created",renameFolderSuccess:"Folder renamed",deleteFolderSuccess:"Folder deleted",newFileSuccess:"File added",renameFileSuccess:"File renamed",deleteFileSuccess:"File deleted",nameInputErrorMessage:"Invalid name",buttonText:"New folder",addFileButtonText:"Upload a file",deleteTitle:"Deleting Files",deleteDetail:"You are about to permanently delete the following files / folders",dmsRoot:"Root of the project's DMS",pdfPageSelectorTitle:"Select a page"},U4i={title:"Meta-Building Structure",tab:{structure:"Structure",zones:"Zones",equipments:"Equipments"},StoreySelector:{placeholder:"Select a storey"}},N4i={title:"Photosphere Building"},j4i={BIMDataComponents:_4i,BuildingMaker:F4i,FileManager:O4i,MetaBuildingStructure:U4i,PhotosphereBuilding:N4i},H4i={title:"Building Maker",back:"Vuelta",list:{text:"Cree y edite los pisos despu\xE9s cargue los PDF.",createButton:"Nuevo proyecto",updateButton:"Renombrar",deleteButton:"Suprimir"},form:{text:"Cree y edite los pisos despu\xE9s cargue los PDF.",input:"Nombre del edificio",error:"Nombre no v\xE1lido",createButton:"Crear",updateButton:"Validar"},view:{addStoreyButton:"Piso",addPlanButton:"Plano",closeButton:"Terminar",submitFilesButton:"Validar"},storeyForm:{title:"Nuevo piso",input:"Nombre",error:"Nombre no v\xE1lido",cancelButton:"Anular",submitButton:"Validar"}},V4i={creationFormTitle:"Crear un archivo",renameFormPlaceholder:"Nombre de archivo / carpeta",nameInputPlaceholder:"Nombre de la carpeta",emptyFolder:"Esta carpeta est\xE1 vac\xEDa",newFolderSuccess:"Nueva carpeta creada",renameFolderSuccess:"Carpeta renombrada",deleteFolderSuccess:"Carpeta eliminada",newFileSuccess:"Archivo agregado",renameFileSuccess:"Archivo renombrado",deleteFileSuccess:"Archivo eliminado",nameInputErrorMessage:"Nombre inv\xE1lida",cancel:"Cancelar",submit:"Validar",buttonText:"Carpeta nueva",addFileButtonText:"Cargar un archivo",rename:"Renombrar",view:"Ver",download:"Descargar",delete:"Borrar",deleteTitle:"Eliminar archivos",deleteDetail:"Est\xE1 a punto de eliminar permanentemente los siguientes archivos / carpetas"},z4i={BuildingMaker:H4i,FileManager:V4i},q4i={t:{back:"Retour",cancel:"Annuler",create:"Cr\xE9er",delete:"Supprimer",download:"T\xE9l\xE9charger",finish:"Terminer",rename:"Renommer",search:"Rechercher",see:"Voir",storey:"\xC9tage",validate:"Valider"}},Q4i={title:"Building Maker",list:{text:"Cr\xE9ez et \xE9ditez les \xE9tages puis t\xE9l\xE9chagez vos PDF.",new:"Nouveau projet"},form:{input:"Nom du b\xE2timent",error:"Nom invalide"},view:{addStorey:"Ajouter un \xC9tage",addFile:"Ajouter un fichier",addPlan:"Ajouter un plan"},storeyForm:{title:"Nouvel \xE9tage",input:"Nom",error:"Nom invalide"}},G4i={creationFormTitle:"Cr\xE9er un dossier",renameFormPlaceholder:"Nom du fichier/dosier",nameInputPlaceholder:"Nom du dossier",emptyFolder:"Ce dossier est vide",newFolderSuccess:"Nouveau dossier cr\xE9\xE9",renameFolderSuccess:"Dossier renomm\xE9",deleteFolderSuccess:"Dossier supprim\xE9",newFileSuccess:"Fichier ajout\xE9",renameFileSuccess:"Fichier renomm\xE9",deleteFileSuccess:"Fichier supprim\xE9",nameInputErrorMessage:"Nom invalide",buttonText:"Nouveau dossier",addFileButtonText:"Charger un fichier",deleteTitle:"Supression de fichiers",deleteDetail:"Vous \xEAtes sur le point de supprimer d\xE9finitivement les fichiers/dossiers suivants",dmsRoot:"Racine de la GED du projet",pdfPageSelectorTitle:"S\xE9lectionner une page"},K4i={title:"Structure M\xE9ta-Building",tab:{structure:"Structure",zones:"Zones",equipments:"\xC9quipements"},StoreySelector:{placeholder:"S\xE9lectionner un \xE9tage"}},J4i={title:"Photosph\xE8re Building"},Z4i={BIMDataComponents:q4i,BuildingMaker:Q4i,FileManager:G4i,MetaBuildingStructure:K4i,PhotosphereBuilding:J4i},W4i={title:"Building Maker",back:"Reso",list:{text:"Crea e modifica i piani e poi scarica i tuoi PDF.",createButton:"Nuovo progetto",updateButton:"Rinominare",deleteButton:"Eliminare"},form:{text:"Crea e modifica i piani e poi scarica i tuoi PDF.",input:"Nome della costruzione",error:"Nome non corretto",createButton:"Creare",updateButton:"Convalidare"},view:{addStoreyButton:"Piano",addPlanButton:"Mappa",closeButton:"Finire",submitFilesButton:"Convalidare"},storeyForm:{title:"Nuovo piano",input:"Nome",error:"Nome non corretto",cancelButton:"Annullare",submitButton:"Convalidare"}},Y4i={creationFormTitle:"Crea una cartella",renameFormPlaceholder:"Nome file/cartella",nameInputPlaceholder:"Nome della cartella",emptyFolder:"Questa cartella \xE8 vuota",newFolderSuccess:"Nuova cartella creata",renameFolderSuccess:"Cartella rinominata",deleteFolderSuccess:"Cartella eliminata",newFileSuccess:"File aggiunto",renameFileSuccess:"File rinominato",deleteFileSuccess:"File cancellato",nameInputErrorMessage:"Nome non valido",cancel:"Annulla",submit:"Invia",buttonText:"Nuova cartella",addFileButtonText:"Carica un file",rename:"Rinominare",view:"Vedere",download:"Scaricare",delete:"Cancellare",deleteTitle:"Eliminazione di file",deleteDetail:"Stai per eliminare definitivamente i seguenti file/cartelle"},X4i={BuildingMaker:W4i,FileManager:Y4i},$4i={de:L4i,en:j4i,es:z4i,fr:Z4i,it:X4i},e5i=({i18nPlugin:t}={})=>({install(e){t?Object.entries($4i).forEach(([i,o])=>{t.global.mergeLocaleMessage(i,o)}):console.warn("[BIMData Components Plugin] No i18n instance provided. You should either provide an i18n instance or define your own translations in order have text displayed properly."),Object.entries(RYt).forEach(([i,o])=>{e.component(i,o)})}}),t5i={beforeMount(t,e){if(typeof e.value!="function")throw Error(`click away directive needs function, got ${typeof e.value}`);t.clickAwayHandler=i=>{(i.path||i.composedPath&&i.composedPath()).find(o=>o===t)||e.value()},window.addEventListener("mousedown",t.clickAwayHandler,!0)},unmounted(t){window.removeEventListener("mousedown",t.clickAwayHandler,!0),delete t.clickAwayHandler}},i5i=Object.freeze(Object.defineProperty({__proto__:null,BIMDataClickAway:Zs,BIMDataClickInputAway:t5i},Symbol.toStringTag,{value:"Module"})),o5i=t=>({install(e){Object.entries(XYe).forEach(([i,o])=>{e.component(i,o)}),Object.entries(i5i).forEach(([i,o])=>e.directive(i.split("BIMData")[1],o))}}),r5i={name:"LiWrapper",render(){return Qo("li",this.$slots.default())}};function n5i(t,e){var i=new Set([]);return t.forEach(o=>{e.has(o)||i.add(o)}),i}const xl=Wr("id"),a5i=({contextMenu:t,objects:e=[],state:i=t.$viewer.state,pictos:o})=>[{name:"selectAll",get group(){return t.groupPositions.select},position:1,get label(){return t.$t("context_menu.select_all")},get picto(){return o.get(this.name)},execute:()=>i.selectObjects(e.filter(Fs(Ei("visible"),Au("selected"))).map(xl)),predicate:()=>e.some(Fs(Ei("visible"),Au("selected")))},{name:"deselectAll",get group(){return t.groupPositions.select},position:2,get label(){return t.$t("context_menu.deselect_all")},get picto(){return o.get(this.name)},execute:()=>i.deselectObjects(e.filter(Ei("selected")).map(xl)),predicate:()=>e.some(Ei("selected"))},{name:"selectSimilar",get group(){return t.groupPositions.select},position:3,get label(){return t.$t("context_menu.select_similar")},get picto(){return o.get(this.name)},execute(){const n=e.filter(r=>r.visible&&r.type===this.selectedObject.type&&r.id!==this.selectedObject.id).map(xl);i.selectObjects(n)},selectedObject:null,predicate(){const n=e.filter(Fs(Ei("visible"),Ei("selected")));return n.length===1&&n[0].type!==void 0?(this.selectedObject=n[0],!0):(this.selectedObject=null,!1)}},{name:"reverseSelection",get label(){return t.$t("context_menu.reverse_selection")},get group(){return t.groupPositions.select},position:4,execute:()=>{const n=new Set(e.filter(Ei("selected")).map(xl)),r=new Set(e.filter(Ei("visible")).map(xl));i.selectObjects(Array.from(n5i(r,n)),{exclusive:!0})},predicate:()=>e.some(Fs(Au("selected"),Ei("visible")))&&e.some(Fs(Ei("selected"),Ei("visible")))},{name:"showAll",get group(){return t.groupPositions.visibility},position:1,get label(){return t.$t("context_menu.show_all")},get picto(){return o.get(this.name)},execute:()=>i.showObjects(e.filter(Au("visible")).map(xl)),predicate:()=>e.some(Au("visible"))},{name:"hide",get group(){return t.groupPositions.visibility},position:2,get label(){return t.$t("context_menu.hide")},get picto(){return o.get(this.name)},objectsToHide:null,execute(){const n=this.objectsToHide.filter(Ei("selected"));n.length>0&&i.deselectObjects(n.map(xl)),i.hideObjects(this.objectsToHide.map(xl))},predicate(){return this.objectsToHide=e.filter(Fs(Ei("selected"),Ei("visible"))),this.objectsToHide.length>0}},{name:"hideAll",get group(){return t.groupPositions.visibility},position:3,get label(){return t.$t("context_menu.hide_all")},execute:()=>{const n=e.filter(Ei("visible"));n.some(Ei("selected"))&&i.deselectObjects(n.filter(Ei("selected")).map(xl)),i.hideObjects(n.map(xl))},predicate:()=>e.some(Ei("visible"))}].filter(n=>n.predicate()),s5i={components:{LiWrapper:r5i},inject:["$viewer"],data(){return{defaultPrevented:!1,displayed:!1,top:null,bottom:null,left:null,width:200,nextCommandId:1,currentCommands:[],contextCommands:[],registeredCommands:[],groupPositions:{select:10,visibility:20},asyncPredicateRunning:!1}},computed:{position(){return{top:this.top?this.top+"px":"unset",bottom:this.bottom?this.bottom+"px":"unset",left:this.left+"px",width:this.width+"px"}}},watch:{displayed(t){t?document.addEventListener("keydown",this.onKeyDown):document.removeEventListener("keydown",this.onKeyDown)}},created(){this.$viewer.contextMenu=this,this.asyncPredicates=new Set},methods:{onKeyDown(t){t.key==="Escape"&&this.away()},setPosition(t){const e=(document.fullscreenElement?document.fullscreenElement:this.$parent.$el).getBoundingClientRect();this.left=t.clientX-e.left,this.top=t.clientY-e.top,this.left+this.width>e.width&&(this.left=this.left-this.width),t.clientY>e.top+e.height/2?(this.bottom=e.height-this.top,this.top=null):this.bottom=null},typeCheckCommand(t={}){let e=null;if((!t.execute||typeof t.execute!="function")&!t.component&&(e="Cannot register context menu command. A command must have an execute function or a component property."),t.label||(e="Cannot register context menu command. A command must have a label."),e)throw console.error(e),new Error(e);return t.id=this.nextCommandId++,t},open(t){this.currentCommands=[],this.setPosition(t),this.originEvent=t,t.preventDefault(),this.setCurrentCommands(),this.groupCurrentCommands(),this.defaultPrevented=!1,this.displayed=!0,document.fullscreenElement?(this.$el.parentElement.removeChild(this.$el),this.adoptiveParent=document.fullscreenElement,this.adoptiveParent.appendChild(this.$el)):this.adoptiveParent&&this.adoptiveParent!==this.$viewer.globalContext.el&&(this.adoptiveParent.removeChild(this.$el),this.$viewer.globalContext.el.appendChild(this.$el),this.adoptiveParent=null)},setCurrentCommands(){this.asyncPredicates.clear(),this.asyncPredicateRunning=!1,this.defaultPrevented||this.registeredCommands.forEach(async t=>{if(typeof t.predicate=="function"){const e=t.predicate(this.$viewer.globalContext.activeLocalContext);if(e===!0)this.currentCommands.push(t);else if(typeof e?.then=="function"){this.asyncPredicates.add(e),this.asyncPredicateRunning=!0;const i=await e;this.asyncPredicates.has(e)&&(this.asyncPredicates.delete(e),this.asyncPredicateRunning=this.asyncPredicates.size>0,i===!0&&this.currentCommands.push(t))}}else this.currentCommands.push(t)}),this.currentCommands.push(...this.contextCommands),this.contextCommands=[]},getDefaultCommands({objects:t=[],state:e=this.$viewer.state,context:i=null}){const o=new Map;return i&&this.$viewer.shortcutManager.getShortcuts(i).forEach(n=>o.set(n.name,n.key)),a5i({contextMenu:this,objects:t,state:e,pictos:o})},executeCommand(t){if(t.execute&&(t.execute(this.originEvent),this.displayed=!1),t.component&&!t.menu)throw new Error("Command with component property must have a `menu` property")},away(){this.displayed=!1},groupCurrentCommands(){const t=new Map;this.currentCommands.forEach(i=>{(i.group===null||i.group===void 0)&&(i.group=0),t.has(i.group)?t.get(i.group).push(i):t.set(i.group,[i])}),t.forEach(i=>i.sort((o,n)=>(o.position=o.position||0,n.position=n.position||0,o.position-n.position)));const e=[...t.keys()].sort((i,o)=>i-o).map(i=>t.get(i)).flat();this.currentCommands=e},isGroupIntersection(t){if(t===0)return!1;const e=this.currentCommands[t-1],i=this.currentCommands[t];return e.group<i.group},registerContextCommand(t){const e=this.typeCheckCommand(t);return this.contextCommands.push(e),t.id},registerCommand(t){const e=this.typeCheckCommand(t);return this.registeredCommands.push(e),t.id},unregisterCommand(t){return this.registeredCommands.find(e=>e.id===t)?(this.registeredCommands=this.registeredCommands.filter(e=>e.id!==t),!0):!1},preventDefault(){this.defaultPrevented=!0}}},l5i={key:0,class:"separator"},c5i={class:"menu-text"},d5i={key:1,class:"menu-picto"},u5i={key:0,class:"context-menu__spinner"};function h5i(t,e,i,o,n,r){const a=S("BIMDataIconChevron"),s=S("LiWrapper"),l=S("BIMDataSpinner"),c=ci("click-away");return n.displayed&&(n.currentCommands.length||n.asyncPredicateRunning)?yt((M(),_("ul",{key:0,class:"bimdata-list context-menu",style:ce(r.position)},[(M(!0),_(tt,null,Bt(n.currentCommands,(d,u)=>(M(),J(s,{key:d.label,class:"context-menu__element",onClick:h=>r.executeCommand(d)},{default:N(()=>[r.isGroupIntersection(u)?(M(),_("div",l5i)):ie("",!0),b("div",c5i,q(d.label),1),!d.component&&d.picto?(M(),_("span",d5i,q(d.picto),1)):d.component?(M(),J(a,{key:2,size:"xxs",class:"fill-primary"})):ie("",!0)]),_:2},1032,["onClick"]))),128)),n.asyncPredicateRunning?(M(),_("li",u5i,[D(l)])):ie("",!0)],4)),[[c,r.away]]):ie("",!0)}const p5i=j(s5i,[["render",h5i],["__scopeId","data-v-5b87d4a3"]]),f5i={name:"ViewerHeader",inject:["$viewer"],props:{visible:{type:Boolean,default:!0}},setup(){const t=ht("$viewer"),e=$r(new Map),i=n=>{if(!n.name)throw new TypeError("[Viewer Header] Content must have a name");if(e.has(n.name))throw new Error(`[Viewer Header] Content with name ${n.name} already exists`);e.set(n.name,n)},o=n=>e.has(n)?(e.delete(n),!0):!1;return{logo:t.uiSettings.bimdataLogo!==!1,version:t.uiSettings.version!==!1?t.version:null,headerContent:e,headerRightContentComponents:Oe(()=>Array.from(e.values()).filter(n=>n.position==="right").sort((n,r)=>n.order-r.order).map(n=>n.component)),headerLeftContentComponents:Oe(()=>Array.from(e.values()).filter(n=>n.position==="left").sort((n,r)=>n.order-r.order).map(n=>n.component)),addContent:i,removeContent:o}}},A5i={class:"viewer-header"},g5i={class:"viewer-header__content"},m5i={class:"viewer-header__content__left"},v5i={class:"viewer-header__content__right"},y5i={key:0,class:"m-l-6 flex items-center"},b5i={key:1,class:"viewer-header__version"};function w5i(t,e,i,o,n,r){const a=S("BIMDataIllustration");return yt((M(),_("div",A5i,[b("div",g5i,[b("div",m5i,[(M(!0),_(tt,null,Bt(o.headerLeftContentComponents,s=>(M(),J(Mo(s),{key:s.name}))),128))]),b("div",v5i,[(M(!0),_(tt,null,Bt(o.headerRightContentComponents,s=>(M(),J(Mo(s),{key:s.name}))),128))])]),o.logo||o.version?(M(),_("div",y5i,[o.logo?(M(),J(a,{key:0,name:"logo",width:"30px",height:"30px"})):ie("",!0),o.version?(M(),_("div",b5i,q(o.version),1)):ie("",!0)])):ie("",!0)],512)),[[zt,i.visible]])}const C5i=j(f5i,[["render",w5i],["__scopeId","data-v-5c9ea6b6"]]),x5i={emits:["resize"],setup(t,{emit:e}){return{onResizerMousedown:i=>{i.preventDefault();let o=i.clientX;const n=a=>{a.preventDefault();const s=a.clientX-o;o=a.clientX,e("resize",s)},r=a=>{a.preventDefault(),window.removeEventListener("mousemove",n),window.removeEventListener("mouseup",r)};window.addEventListener("mousemove",n),window.addEventListener("mouseup",r)}}}},k5i={class:"bimdata-separator"};function M5i(t,e,i,o,n,r){return M(),_("div",k5i,[e[1]||(e[1]=b("div",{class:"bimdata-separator__line"},null,-1)),b("div",{class:"bimdata-separator__resizer",onMousedown:e[0]||(e[0]=(...a)=>o.onResizerMousedown&&o.onResizerMousedown(...a))},null,32)])}const B5i=j(x5i,[["render",M5i],["__scopeId","data-v-79a3b3af"]]),E5i={components:{Separator:B5i},props:{position:{type:String,required:!0,validator(t){return["left","right"].includes(t)}},sidePanel:{type:Object,required:!0,validator(t){if(t.width&&(typeof t.width!="number"||t.width<0))return console.error(`[GlobalSidePanel] sidePanel.width must be a strictly positive number, received ${typeof t.width}`),!1;const e=typeof t?.component=="object";return e||console.error("[GlobalSidePanel] sidePanel must have a component property"),e}}},setup(t){const e=de(null),i=de(t.sidePanel.width??400),o=(n,r=1)=>{const a=i.value+n*r;i.value=Math.max(0,a)};return ft(()=>t.sidePanel,()=>{Object.defineProperty(t.sidePanel,"width",{get(){return i.value},set(n){if(typeof n!="number"||n<=0){console.error(`[GlobalSidePanel] sidePanel.width must be a strictly positive number, received ${typeof n}`);return}i.value=n}}),Object.defineProperty(t.sidePanel,"componentInstance",{get(){return e.value},enumerable:!0})},{immediate:!0}),{componentInstance:e,width:i,onResize:o}}},P5i={class:"bimdata-global-side-panel__component"};function I5i(t,e,i,o,n,r){const a=S("Separator");return M(),_("div",{class:"bimdata-global-side-panel",style:ce(`width: ${o.width}px`)},[i.sidePanel.resizable&&i.position==="right"?(M(),J(a,{key:0,onResize:e[0]||(e[0]=s=>o.onResize(s,-1))})):ie("",!0),b("div",P5i,[(M(),J(Mo(i.sidePanel.component),{ref:"componentInstance"},null,512))]),i.sidePanel.resizable&&i.position==="left"?(M(),J(a,{key:1,onResize:e[1]||(e[1]=s=>o.onResize(s))})):ie("",!0)],4)}const S5i=j(E5i,[["render",I5i],["__scopeId","data-v-82d0d4cb"]]),T5i={name:"BimdataViewer",components:{ContextMenu:p5i,ViewerHeader:C5i,ModalManager:tfe,GlobalSidePanel:S5i},setup(){const t=ht("$viewer"),{globalContext:e,shortcutManager:i}=t;Ti(()=>{i&&i.destroy(),e.hub.clear()}),li(()=>{t.pluginManager.runPluginsScripts(t)});const o=Oe(()=>t.uiSettings.bimdataLogo!==!1&&(e.localContexts.length!==1||e.localContexts[0].window?.logoAndVersion)),n=Oe(()=>t.uiSettings.version!==!1&&(e.localContexts.length!==1||e.localContexts[0].window?.logoAndVersion)?t.version:null),r=Oe(()=>e.leftSidePanel),a=Oe(()=>e.rightSidePanel),s=Oe(()=>{const p=t.uiSettings.header!==!1,A=e.localContexts.length===1&&e.localContexts[0].window?.header===!1,f=!!(r.value||a.value);return p&&(!A||f)}),l=t.uiSettings.contextMenu!==!1,c=de(null);function d(p){l&&c.value.open(p)}function u(){t.shortcutManager.active=!0}function h(){t.shortcutManager.active=!1}return{Layout:t.layout.areas.component,onContextMenu:d,onMouseenter:u,onMouseleave:h,isHeaderVisible:s,viewerTemplateRef:e.templateRef,modalManagerTemplateRef:e.modalManagerTemplateRef,headerTemplateRef:e.headerTemplateRef,contextMenuTemplateRef:c,contextMenuEnabled:l,bimdataLogoOnSingleWindow:o,viewerVersionOnSingleWindow:n,version:t.version,loading:Oe(()=>e.loading),spinner:Oe(()=>e.spinner),leftSidePanel:r,rightSidePanel:a}}},R5i={key:1,class:"bimdata-context-loading-overlay",style:{"z-index":"3"}},D5i={key:2,class:"viewer__logo"},L5i={key:1,class:"version m-t-6"};function _5i(t,e,i,o,n,r){const a=S("ModalManager"),s=S("ContextMenu"),l=S("ViewerHeader"),c=S("GlobalSidePanel"),d=S("BIMDataSpinner"),u=S("BIMDataIllustration");return M(),_("div",{id:"bimdata-viewer",ref:"viewerTemplateRef",class:"bimdata-viewer bimdata-design-system bimdata-scrollbar",onContextmenu:e[0]||(e[0]=(...h)=>o.onContextMenu&&o.onContextMenu(...h)),onMouseenter:e[1]||(e[1]=(...h)=>o.onMouseenter&&o.onMouseenter(...h)),onMouseleave:e[2]||(e[2]=(...h)=>o.onMouseleave&&o.onMouseleave(...h))},[D(a,{ref:"modalManagerTemplateRef"},null,512),o.contextMenuEnabled?(M(),J(s,{key:0,ref:"contextMenuTemplateRef"},null,512)):ie("",!0),D(l,{ref:"headerTemplateRef",visible:o.isHeaderVisible},null,8,["visible"]),b("div",{class:"bimdata-viewer__content",style:ce(o.isHeaderVisible?"height: calc(100% - var(--bimdata-viewer-header-height, 40px))":"height: 100%")},[o.leftSidePanel?(M(),J(c,{key:0,"side-panel":o.leftSidePanel,position:"left"},null,8,["side-panel"])):ie("",!0),(M(),J(Mo(o.Layout),{style:"height: 100%; flex-grow: 1;"})),o.rightSidePanel?(M(),J(c,{key:1,"side-panel":o.rightSidePanel,position:"right"},null,8,["side-panel"])):ie("",!0)],4),o.loading?(M(),_("div",R5i,[o.spinner&&o.spinner.component?(M(),J(Mo(o.spinner.component),Ta(wn({key:0},o.spinner.props)),null,16)):(M(),J(d,{key:1,size:"40px",border:"5px"}))])):ie("",!0),!o.isHeaderVisible&&(o.bimdataLogoOnSingleWindow||o.viewerVersionOnSingleWindow)?(M(),_("div",D5i,[o.bimdataLogoOnSingleWindow?(M(),J(u,{key:0,name:"logo"})):ie("",!0),o.viewerVersionOnSingleWindow?(M(),_("div",L5i,q(o.version),1)):ie("",!0)])):ie("",!0)],544)}const F5i=j(T5i,[["render",_5i],["__scopeId","data-v-0c1c941a"]]),O5i=["src"],U5i={class:"bimdata-models__header"},N5i={key:0,class:"bimdata-models__header__loader"},j5i={class:"bimdata-models__header__picto"},H5i={class:"bimdata-models__header__name"},V5i={key:0,class:"bimdata-models__header__name--empty"},z5i={key:1,class:"bimdata-models__header__name--empty"},q5i={key:3},Q5i=["onMousemove","onClick"],G5i={__name:"Models",props:{preview:{type:Boolean,default:!1},windowPositioning:{type:Boolean,default:!0},customFilter:{type:Function,default:null},width:{type:String,default:"350px"}},setup(t){const e=t,i=ht("$viewer"),o=de(),n=de(0),r=de(0),a=de(),s=bi([]),l=de(!1),c=Oe(()=>i.localContext.loadedModels),d=Oe(()=>i.localContext.loadedModelIds),u=Oe(()=>i.localContext.loadingModelIds),h=Oe(()=>i.localContext.multiModel),p=Oe(()=>(e.customFilter?s.value.filter(e.customFilter):s.value).map(k=>c.value.find(B=>B.document?.head_id!=null&&B.document.head_id===k.document.id)??k)),A=k=>d.value.includes(k),f=k=>u.value.includes(k),m=Oe(()=>{const{x:k,y:B}=a.value?.getBoundingClientRect()??{x:0,y:0};return`top:${r.value-B}px; left:${n.value-k}px;`}),g=k=>{!h.value&&A(k.id)||u.value.length>0||(i.localContext.loadedModelIds.includes(k.id)?i.localContext.unloadModels([k.id]):i.localContext.loadModels([k.id]))},y=k=>{switch(k){case"C":return"success";case"E":return"failed";case"P":case"I":return"sandglass"}},v=(k,B)=>{k?.viewer_360_file&&(n.value=B.clientX,r.value=B.clientY),o.value=k?.viewer_360_file},w=async k=>{l.value=!0;try{return(await i.api.apiClient.modelApi.getModels(i.api.cloudId,i.api.projectId,void 0,void 0,k)).filter(B=>i.state.models.some(P=>P.archived)||!B.archived).sort($s("updated_at",!1))}catch(B){console.error("[Models] Cannot get project models. Error: ",B)}finally{l.value=!1}return[]},x=k=>k.children?.some(B=>A(B.id))??!1;return w(i.localContext.modelTypes).then(k=>{s.value=k}),(k,B)=>{const P=S("BIMDataSpinner"),E=S("BIMDataIconModel3D"),T=S("BIMDataTextbox"),I=S("BIMDataCheckbox"),R=S("BIMDataRadio"),F=S("BIMDataIcon"),U=S("BIMDataDropdownList");return M(),_("div",{ref_key:"templateRef",ref:a,class:le(["bimdata-models",{"bimdata-models--window-positioning":t.windowPositioning}])},[o.value?(M(),_("div",{key:0,class:"bimdata-models__preview",style:ce(m.value)},[b("img",{src:o.value},null,8,O5i)],4)):ie("",!0),D(U,{style:ce(`--bimdata-models-width: ${t.width};`),width:t.width,list:p.value,"element-key":"id","per-page":40,loading:l.value,class:"bimdata-models__list",disabled:p.value.length===0,onElementClick:g},{header:N(({isOpen:z})=>[b("div",U5i,[l.value||u.value.length>0?(M(),_("div",N5i,[D(P)])):(M(),_(tt,{key:1},[b("div",j5i,[D(E)]),b("div",{class:le(["bimdata-models__header__number bimdata-info-length",{"bimdata-models__header__number--empty":d.value.length===0}])},[b("span",null,q(d.value.length),1)],2),b("div",H5i,[p.value.length===0?(M(),_("span",V5i,q(k.$t("model.no_model")),1)):d.value.length===0?(M(),_("span",z5i,q(k.$t("model.no_loaded_model")),1)):d.value.length===1?(M(),J(T,{key:2,text:c.value[0].name,tooltip:!z},null,8,["text","tooltip"])):d.value.length>1?(M(),_("span",q5i,q(k.$t("model.selected_models")),1)):ie("",!0)])],64))])]),element:N(({element:z,close:H})=>[b("div",{class:"bimdata-models__model",onMousemove:W=>t.preview&&v(z,W),onMouseout:B[0]||(B[0]=W=>t.preview&&v()),onClick:()=>{!h.value&&!A(z.id)&&H()}},[h.value?(M(),J(I,{key:0,"model-value":A(z.id)||x(z),disabled:z.status!=="C"||u.value.length>0},null,8,["model-value","disabled"])):(M(),J(R,{key:1,"model-value":A(z.id)||x(z),disabled:z.status!=="C"||u.value.length>0},null,8,["model-value","disabled"])),D(F,{margin:"0 calc(var(--spacing-unit) / 2)",name:y(z.status),size:"xs",class:le({"fill-success":z.status==="C","fill-high":z.status==="E"})},null,8,["name","class"]),D(T,{class:le({"bimdata-models__model__name":!0,"bimdata-models__model__name--disabled":z.status!=="C"||u.value.length>0}),text:z.name,width:`calc(100% -
5543
+ `),onMouseenter:e[0]||(e[0]=(...h)=>o.onMouseEnter&&o.onMouseEnter(...h)),onMouseleave:e[1]||(e[1]=(...h)=>o.onMouseLeave&&o.onMouseLeave(...h))},[D(a,{ref:"modalManagerTemplateRef"},null,512),b("div",a4i,[o.windowPlugins.leftSidePanel?(M(),J(s,{key:0,plugin:o.windowPlugins.leftSidePanel},null,8,["plugin"])):ie("",!0),b("div",s4i,[(M(!0),_(tt,null,Bt(o.windowPlugins.free,h=>(M(),J(l,{key:h.name,class:le({"window-container__content__center__viewer":h.isViewer}),plugin:h},null,8,["class","plugin"]))),128)),D(c,{position:"left",plugins:o.windowPlugins.leftButtonColumn},null,8,["plugins"]),D(c,{position:"right",plugins:o.windowPlugins.rightButtonColumn},null,8,["plugins"])]),o.windowPlugins.rightSidePanel?(M(),J(s,{key:1,plugin:o.windowPlugins.rightSidePanel},null,8,["plugin"])):ie("",!0)]),o.loading?(M(),_("div",l4i,[o.spinner&&o.spinner.component?(M(),J(Mo(o.spinner.component),Ta(wn({key:0},o.spinner.props)),null,16)):(M(),J(d,{key:1,size:"20px",border:"3px"}))])):ie("",!0),o.layoutSettingsDisplayed?(M(),_("div",c4i,[D(u)])):ie("",!0)],36)}const u4i=j(n4i,[["render",d4i],["__scopeId","data-v-3ed35f9c"]]);class h4i{constructor(e=!0){const i=$vi(Zj,null,{resizable:e});i.registerContent("default",u4i),this.settings=$r({edit:!1,swap:!1,full:!1}),this.areas=i}get resizable(){return this.areas.resizable}set resizable(e){this.areas.resizable=e}apply(e=null){this.areas.layout=e?e3i(e):null}copy(e,i=!0){return t3i(this.areas.layout,e,i)}open({ratio:e,direction:i,insertAfter:o,windowName:n=null,windowState:r=null,localContextId:a=null}={}){const s=n?{options:{windowName:n,windowState:r}}:null;return a===null?this.areas.splitLayout(e,i,o,s):this.areas.split(a,e,i,o,s)}swap(e,i){return this.areas.swap(e,i)}close(e){return this.areas.delete(e)}compare(e,i){if(!e&&!i)return!0;if(!e||!i)return!1;if(typeof e=="string"&&typeof i=="string")return e===i;if(typeof e=="string"||typeof i=="string")return!1;if(e.windowName&&i.windowName){if(e.windowName!==i.windowName)return!1;const o=new Set(e.windowState?.modelIds),n=new Set(i.windowState?.modelIds);return o.size===n.size&&[...o].every(r=>n.has(r))}return e.windowName||i.windowName||e.direction!==i.direction||e.children.length!==i.children.length?!1:e.children.every((o,n)=>this.compare(o,i.children[n]))}}const p4i="2.14.0-beta.3",f4i={version:p4i};let A4i=1;class g4i{constructor({plugins:e,api:i,ui:o,locale:n="fr"}){this.instanceId=A4i++,this.pluginManager=new zAi(e),this.windowManager=new QAi,this.windowManager.registerAndAddPluginsToWindows([...this.pluginManager.registeredPlugins.values()]),this.api=new svi(i),this.globalContext=new D5e(this),this.state=vvi(this),this.shortcutManager=xAe(this.state),this.uiSettings=o||{},this.i18n=new T5e(n),this._contextMenu=null,this.layout=new h4i(this.uiSettings.resizable!==!1),this._darkTheme=de(o?.darkTheme??!1),this.localContext=null,window.$viewer=this}get darkTheme(){return this._darkTheme.value}set darkTheme(e){this._darkTheme.value=e}get version(){return f4i.version}get locale(){return this.i18n.locale}get contextMenu(){return this._contextMenu||wAe}set contextMenu(e){this._contextMenu=e}get registeredWindows(){return[...this.windowManager.registeredWindows.keys()]}get registeredPlugins(){return[...this.pluginManager.registeredPlugins.keys()]}get pluginsCfg(){return this.pluginManager.cfg}registerPlugin(e){this.pluginManager.registerPlugin(e),this.windowManager.registerAndAddPluginsToWindows([e])}}function m4i(t,e={}){e.backgroundColor&&(t.style.setProperty("--bimdata-viewer-background-color",e.backgroundColor),e.backgroundColor==="transparent"&&t.style.setProperty("--areas-separator-color","transparent")),e.colorPrimary&&t.style.setProperty("--color-primary",e.colorPrimary),e.colorPrimaryLighter&&t.style.setProperty("--color-primary-lighter",e.colorPrimaryLighter),e.colorPrimaryLight&&t.style.setProperty("--color-primary-light",e.colorPrimaryLight),e.colorPrimaryDark&&t.style.setProperty("--color-primary-dark",e.colorPrimaryDark),e.colorSecondary&&t.style.setProperty("--color-secondary",e.colorSecondary),e.colorSecondaryLighter&&t.style.setProperty("--color-secondary-lighter",e.colorSecondaryLighter),e.colorSecondaryLight&&t.style.setProperty("--color-secondary-light",e.colorSecondaryLight),e.colorSecondaryDark&&t.style.setProperty("--color-secondary-dark",e.colorSecondaryDark),e.colorSilverLight&&t.style.setProperty("--color-silver-light",e.colorSilverLight),e.colorSilver&&t.style.setProperty("--color-silver",e.colorSilver),e.colorSilverDark&&t.style.setProperty("--color-silver-dark",e.colorSilverDark),e.colorGraniteLight&&t.style.setProperty("--color-granite-light",e.colorGraniteLight),e.colorGranite&&t.style.setProperty("--color-granite",e.colorGranite),e.colorSuccess&&t.style.setProperty("--color-success",e.colorSuccess),e.colorSuccessLighter&&t.style.setProperty("--color-success-Lighter",e.colorSuccessLighter),e.colorSuccessLight&&t.style.setProperty("--color-success-Light",e.colorSuccessLight),e.colorSuccessDark&&t.style.setProperty("--color-success-Dark",e.colorSuccessDark),e.colorWarning&&t.style.setProperty("--color-warning",e.colorWarning),e.colorWarningLighter&&t.style.setProperty("--color-warning-Lighter",e.colorWarningLighter),e.colorWarningLight&&t.style.setProperty("--color-warning-Light",e.colorWarningLight),e.colorWarningDark&&t.style.setProperty("--color-warning-Dark",e.colorWarningDark),e.colorHigh&&t.style.setProperty("--color-high",e.colorHigh),e.colorHighLighter&&t.style.setProperty("--color-high-lighter",e.colorHighLighter),e.colorHighLight&&t.style.setProperty("--color-high-light",e.colorHighLight),e.colorHighDark&&t.style.setProperty("--color-high-dark",e.colorHighDark),e.colorText&&t.style.setProperty("--color-text",e.colorText),(!e.backgroundColor||e.backgroundColor!=="transparent")&&t.style.setProperty("--areas-separator-color","rgba(216, 216, 216, 1)"),e.headerHeight!=null&&t.style.setProperty("--bimdata-viewer-header-height",e.headerHeight),t.style.setProperty("--areas-background-color","transparent")}const v4i=Object.freeze({25:"GUEST",50:"USER",100:"ADMIN"}),q2=Object.freeze({READ:"read",WRITE:"write"});function rfe(t){const e={};return t.forEach(i=>{const[o,n]=i.split(":");e[o]?e[o].push(n):e[o]=[n]}),e}const y4i={token_scopes:[],usable_scopes:[],user_role:25};function nfe(t=y4i){const e=rfe(t.token_scopes),i=rfe(t.usable_scopes);return{...QQ(t),tokenScopes:e,usableScopes:i,userRole:v4i[t.user_role],user:t.user?QQ(t.user):null,hasBcfReadPermission:i.bcf?.includes(q2.READ)??!1,hasBcfWritePermission:i.bcf?.includes(q2.WRITE)??!1,hasModelReadPermission:i.model?.includes(q2.READ)??!1,hasModelWritePermission:i.model?.includes(q2.WRITE)??!1,hasDocReadPermission:i.document?.includes(q2.READ)??!1,hasDocWritePermission:i.document?.includes(q2.WRITE)??!1}}const b4i={back:"Zur\xFCck",BcfFilters:{filtersButton:"Filter",filtersTitle:"Filter",priorityLabel:"Priorit\xE4t",statusLabel:"Status",stageLabel:"Phase",assignedToLabel:"Zugewiesen an",creatorsLabel:"Erstellt von",tagsLabel:"Tags",resetButton:"Zur\xFCcksetzen",searchButton:"Suchen",undefined:"Nicht definiert",datePlaceholder:"Erstellungsdatum"},BcfSettings:{title:"BCF-Parameter",text:"Erstellen, f\xFCllen und listen Sie die BCF-Einstellungen auf, die Sie f\xFCr dieses Projekt haben m\xF6chten.",validateButton:"Die BCF-Parameter anerkennen"},BcfStatistics:{emptyText:"F\xFCgen Sie Fragen hinzu, um zugeh\xF6rige Statistiken hier anzuzeigen.",issues:"Probleme",extension:{Priority:"Priorit\xE4t",PriorityNotDefined:"Keine Priorit\xE4t",PriorityTitle:"Priorit\xE4ten",Status:"Status",StatusNotDefined:"Kein Status",StatusTitle:"Status"}},BcfTopicCard:{priority:"Priorit\xE4t",noPriority:"Keine",assignedTo:"Zugewiesen an",elements:"Elemente",notSpecified:"Nicht definiert",see:"Anzeigen"},BcfTopicCreationCard:{text:"Ein neues BCF-Thema erstellen",createBcfSideTitle:"Ein Problem melden"},BcfTopicForm:{dragDropImageText:"Bitte w\xE4hlen Sie eine Datei aus.",addObjectButton:"Objekt",addAnnotationButton:"Annotation",annotationButtonTooltip:"Zu diesem Thema gibt es derzeit keine Ansichten.",addPictureButton:"F\xFCgen Sie ein Bild hinzu.",titlePlaceholder:"Titel *",titleErrorMessage:"Titel fehlt",typeLabel:"Typ",priorityLabel:"Priorit\xE4t",statusLabel:"Status",stageLabel:"Phase",assignedToLabel:"Zugewiesen an",dueDateLabel:"F\xE4lligkeitsdatum (TT.MM.JJJJ)",descriptionLabel:"Beschreibung",labelsLabel:"Tags",createButton:"Best\xE4tigen",updateButton:"\xC4nderungen \xFCbernehmen",modalText:"Sie sind dabei, die Bearbeitung der Ausgabe {Name} zu beenden, aber es gibt noch ungespeicherte \xC4nderungen.",cancelButton:"\xC4nderungen verwerfen",continueButton:"\xC4nderungen fortsetzen",createTitle:"Ein Problem melden",dragDropImageTextTablet:"Foto machen",takeSnapshot:"Mach einen Schnappschuss",importFile:"Eine Datei importieren",searchPlaceholder:"Suchen",emptySearch:"kein Ergebnis"},BcfTopicOverview:{openViewer:"Im Viewer \xF6ffnen",openViewerNoModels:"Es sind keine Vorlagen zur Ansicht bereit",elements:"{count} Elemente",noElements:"kein Element",type:"Typ",noTypeSpecified:"Kein Typ angegeben",description:"Beschreibung",noDescriptionProvided:"Keine Beschreibung angegeben",assignedTo:"Zugeteilt an",notAssigned:"Nicht zugewiesen",dueDate:"F\xE4lligkeitsdatum",noDueDate:"Kein F\xE4lligkeitsdatum",informations:"Informationen",status:"Status",noStatusSpecified:"Kein Status angegeben",stage:"Phase",noStageProvided:"Keine Phase angegeben",priority:"Priorit\xE4t",priorityNotDefined:"Nicht definiert",tags:"Tags",noTags:"Keine Tags",commentButton:"Ein Kommentar ver\xF6ffentlichen",deleteText:"Sie l\xF6schen jetzt {Name}",deleteBcfButton:"Dieses BCF l\xF6schen",keepBcfButton:"Dieses BCF beibehalten",author:"Autor"},BcfTopicsTable:{headers:{index:"#",priority:"Priorit\xE4t",status:"Status",title:"Titel",creator:"Autor",date:"Datum"}},BcfTopicActionsCell:{seeButton:"Anzeigen"},BcfTopicComments:{commentButton:"Ein Kommentar verfassen",commentLabel:"Ein Kommentar verfassen",commentText:"Kommentar",cancelButton:"Abbrechen",publishButton:"Ver\xF6ffentlichen",commentsText:"Kommentare",deleteCommentText:"Diesen Kommentar l\xF6schen?",deleteButton:"L\xF6schen",takeSnapshot:"Mach einen Schnappschuss"},BcfTopicPriorityCell:{noPriority:"Keine"},SettingCard:{addButton:"ein Element hinzuf\xFCgen",cancelButton:"Abbrechen",validateButton:"Best\xE4tigen",deleteExtensionText:"Diesen Parameter l\xF6schen",deleteButton:"L\xF6schen",title:{Priority:"Priorit\xE4ten",Label:"Tags",Status:"Status",Type:"Typen",Stage:"Phasen"},input:{Priority:"Eine neue Priorit\xE4t hinzuf\xFCgen",Label:"Ein neues Etikett hinzuf\xFCgen",Status:"Einen neuen Status hinzuf\xFCgen",Type:"Einen neuen Typ hinzuf\xFCgen",Stage:"Eine neue Phase hinzuf\xFCgen"},text:{Priority:"Liste der Priorit\xE4ten",Label:"Liste von Tags",Status:"Liste der Status",Type:"Liste der Typen",Stage:"Liste der Phasen"}}},w4i={BcfComponents:b4i},C4i={back:"Back",BcfFilters:{filtersButton:"Filters",filtersTitle:"Filters",priorityLabel:"Priority",statusLabel:"Status",stageLabel:"Stage",assignedToLabel:"Assigned to",creatorsLabel:"Created by",tagsLabel:"Tags",resetButton:"Reset",searchButton:"Search",undefined:"Not defined",datePlaceholder:"Creation date"},BcfSettings:{title:"BCF Settings",text:"Create, enter in, and list the BCF settings you would like to have for this project",validateButton:"Validate BCF settings"},BcfStatistics:{emptyText:"Add BCF Topics to start to have some stats here.",issues:"issues",extension:{Priority:"Priority",PriorityNotDefined:"No priority",PriorityTitle:"Priorities",Status:"Status",StatusNotDefined:"No status",StatusTitle:"Status"}},BcfTopicCard:{priority:"Priority",noPriority:"None",assignedTo:"Assigned to",elements:"Elements",notSpecified:"Not specified",see:"See"},BcfTopicCreationCard:{text:"Create a new BCF topic",createBcfSideTitle:"Report a problem"},BcfTopicForm:{dragDropImageText:"Please select a file",addObjectButton:"Object",addAnnotationButton:"Annotation",annotationButtonTooltip:"This topic has no viewpoint",addPictureButton:"Add a picture",titlePlaceholder:"Title *",titleErrorMessage:"Missing title",typeLabel:"Type",priorityLabel:"Priority",statusLabel:"Status",stageLabel:"Stage",assignedToLabel:"Assigned to",dueDateLabel:"Due date",descriptionLabel:"Description",labelsLabel:"Tags",createButton:"Validate",updateButton:"Modify this BCF",modalText:"You are about to quit editing issue {name} but there are unsaved changes.",cancelButton:"Discard changes",continueButton:"Continue editing",createTitle:"Report a problem",dragDropImageTextTablet:"Take a picture",takeSnapshot:"Take a snapshot",importFile:"Import a file",searchPlaceholder:"Search",emptySearch:"No result",documentsLabel:"Add a file",documentsCount:"Files - {count} selected files",validateDocuments:"Validate"},BcfTopicOverview:{openViewer:"Open in viewer",openViewerNoModels:"No model to open",elements:"{count} Elements",noElements:"No element",type:"Type",noTypeSpecified:"No type specified",description:"Description",noDescriptionProvided:"No description provided",assignedTo:"Assigned to",notAssigned:"Not assigned",dueDate:"Due date",noDueDate:"No due date",informations:"Informations",status:"Status",noStatusSpecified:"No status specified",stage:"Stage",noStageProvided:"No stage provided",priority:"Priority",priorityNotDefined:"Not defined",tags:"Tags",noTags:"No tags",commentButton:"Post a comment",deleteText:"You are about to delete {name}",deleteBcfButton:"Delete this BCF",keepBcfButton:"Keep this BCF",author:"Author"},BcfTopicsTable:{headers:{index:"#",priority:"Priority",status:"Status",title:"Title",creator:"Author",date:"Date"}},BcfTopicActionsCell:{seeButton:"See"},BcfTopicComments:{commentButton:"Post a comment",commentLabel:"Post a comment",commentText:"Comment",cancelButton:"Cancel",publishButton:"Publish",commentsText:"Comments",deleteCommentText:"Delete this comment ?",deleteButton:"Delete",takeSnapshot:"Take a snapshot",edited:"edited"},BcfTopicPriorityCell:{noPriority:"None"},SettingCard:{addButton:"add an element",cancelButton:"Cancel",validateButton:"Validate",deleteExtensionText:"Remove this setting",deleteButton:"Delete",title:{Priority:"Priorities",Label:"Labels",Status:"Status",Type:"Types",Stage:"Stages"},input:{Priority:"Add a new priority",Label:"Add a new label",Status:"Add new status",Type:"Add a new type",Stage:"Add a new stage"},text:{Priority:"Priority list",Label:"Labels list",Status:"Status list",Type:"Type list",Stage:"Stage list"}}},x4i={BcfComponents:C4i},k4i={back:"Volver",BcfFilters:{filtersButton:"Filtros",filtersTitle:"Filtros",priorityLabel:"Prioridad",statusLabel:"Estado",stageLabel:"Fase",assignedToLabel:"Asignado a",creatorsLabel:"Creado por",tagsLabel:"Etiquetas:",resetButton:"Restablecer",searchButton:"Buscar en",undefined:"No definido",datePlaceholder:"Fecha de creaci\xF3n"},BcfSettings:{title:"Par\xE1metros del BCF",text:"Cree, rellene y enumere los par\xE1metros del BCF que desea tener en este proyecto",validateButton:"Validar los par\xE1metros del BCF"},BcfStatistics:{emptyText:"A\xF1ada preguntas para ver las estad\xEDsticas asociadas aqu\xED.",issues:"problemas",extension:{Priority:"Prioridad",PriorityNotDefined:"Sin prioridad",PriorityTitle:"Prioridades",Status:"Estado",StatusNotDefined:"Sin estado",StatusTitle:"Estatutos"}},BcfTopicCard:{priority:"Prioridad",noPriority:"Sin",assignedTo:"Asignado a",elements:"Elementos",notSpecified:"No definido",see:"Ver"},BcfTopicCreationCard:{text:"Crear un nuevo tema BCF",createBcfSideTitle:"Informar de un problema"},BcfTopicForm:{dragDropImageText:"Seleccione un archivo",addObjectButton:"Objeto",addAnnotationButton:"Anotaci\xF3n",annotationButtonTooltip:"Actualmente este tema no posee ning\xFAn punto de vista",addPictureButton:"A\xF1adir una imagen",titlePlaceholder:"T\xEDtulo *",titleErrorMessage:"Falta el t\xEDtulo",typeLabel:"Tipo",priorityLabel:"Prioridad",statusLabel:"Estado",stageLabel:"Fase",assignedToLabel:"Asignado a",dueDateLabel:"Fecha de vencimiento (DD/MM/AAAA)",descriptionLabel:"Descripci\xF3n",labelsLabel:"Etiquetas",createButton:"Validar",updateButton:"Modificar este BCF",modalText:"Est\xE1 a punto de salir de la edici\xF3n del problema de {name} pero hay cambios sin guardar.",cancelButton:"Cancelar los cambios",continueButton:"Continuar con los cambios",createTitle:"Informar de un problema",dragDropImageTextTablet:"Tomar una fotograf\xEDa",takeSnapshot:"Tomar un snapshot",importFile:"Importar un archivo",searchPlaceholder:"Buscar",emptySearch:"No hay resultados"},BcfTopicOverview:{openViewer:"Abrir en el visor",openViewerNoModels:"No hay ning\xFAn modelo listo para la visualizaci\xF3n",elements:"{count} Elementos",noElements:"Ning\xFAn elemento",type:"Tipo",noTypeSpecified:"No se especifica el tipo",description:"Descripci\xF3n",noDescriptionProvided:"No hay descripci\xF3n",assignedTo:"Asignado a",notAssigned:"No asignado",dueDate:"Plazo",noDueDate:"Sin fecha de vencimiento",informations:"Informaci\xF3n",status:"Estado",noStatusSpecified:"No se especifica el estado",stage:"Fase",noStageProvided:"No se indica ninguna fase",priority:"Prioridad",priorityNotDefined:"No definido",tags:"Etiquetas",noTags:"Sin etiquetas",commentButton:"Publicar un comentario",deleteText:"Est\xE1s a punto de borrar {name}",deleteBcfButton:"Borrar este BCF",keepBcfButton:"Mantenga este BCF",author:"Autor"},BcfTopicsTable:{headers:{index:"#",priority:"Prioridad",status:"Estado",title:"T\xEDtulo",creator:"Autor",date:"Fecha"}},BcfTopicActionsCell:{seeButton:"Ver"},BcfTopicComments:{commentButton:"Publicar un comentario",commentLabel:"Publicar un comentario",commentText:"Comentario",cancelButton:"Cancelar",publishButton:"Publicar",commentsText:"comentarios",deleteCommentText:"\xBFBorrar este comentario?",deleteButton:"Borrar",takeSnapshot:"Tomar un snapshot"},BcfTopicPriorityCell:{noPriority:"Sin"},SettingCard:{addButton:"a\xF1adir un elemento",cancelButton:"Cancelar",validateButton:"Validar",deleteExtensionText:"Borrar esta configuraci\xF3n",deleteButton:"Borrar",title:{Priority:"Prioridades",Label:"Etiquetas:",Status:"Estatutos",Type:"Tipos",Stage:"Fases"},input:{Priority:"A\xF1adir una nueva prioridad",Label:"A\xF1adir una nueva etiqueta",Status:"A\xF1adir un nuevo estado",Type:"A\xF1adir un nuevo tipo",Stage:"A\xF1adir una nueva fase"},text:{Priority:"Lista de prioridades",Label:"Lista de etiquetas",Status:"Lista de estatutos",Type:"Lista de tipos",Stage:"Lista de fases"}}},M4i={BcfComponents:k4i},B4i={back:"Retour",BcfFilters:{filtersButton:"Filtres",filtersTitle:"Filtres",priorityLabel:"Priorit\xE9",statusLabel:"Statut",stageLabel:"Phase",assignedToLabel:"Assign\xE9 \xE0",creatorsLabel:"Cr\xE9\xE9 par",tagsLabel:"Tags",resetButton:"R\xE9initialiser",searchButton:"Rechercher",undefined:"Non d\xE9fini",datePlaceholder:"Date de cr\xE9ation"},BcfSettings:{title:"Param\xE8tres BCF",text:"Cr\xE9ez, renseignez et listez les param\xE8tres BCF que vous souhaitez avoir sur ce projet",validateButton:"Valider les param\xE8tres BCF"},BcfStatistics:{emptyText:"Ajoutez des questions pour voir les statistiques associ\xE9es ici.",issues:"probl\xE8mes",extension:{Priority:"Priorit\xE9",PriorityNotDefined:"Aucune priorit\xE9",PriorityTitle:"Priorit\xE9s",Status:"Statut",StatusNotDefined:"Aucun statut",StatusTitle:"Statuts"}},BcfTopicCard:{priority:"Priorit\xE9",noPriority:"Aucune",assignedTo:"Assign\xE9 \xE0",elements:"{n} \xC9lements",notSpecified:"Non d\xE9fini",see:"Voir"},BcfTopicCreationCard:{text:"Cr\xE9er un nouveau topic BCF",createBcfSideTitle:"Signaler un probl\xE8me"},BcfTopicForm:{dragDropImageText:"Veuillez s\xE9lectionner un fichier",addObjectButton:"Objet",addAnnotationButton:"Annotation",annotationButtonTooltip:"Ce topic ne poss\xE8de actuellement aucun point de vue",addPictureButton:"Ajouter une image",titlePlaceholder:"Titre *",titleErrorMessage:"Titre manquant",typeLabel:"Type",priorityLabel:"Priorit\xE9",statusLabel:"Statut",stageLabel:"Phase",assignedToLabel:"Assign\xE9 \xE0",dueDateLabel:"Date d'\xE9ch\xE9ance",descriptionLabel:"Description",labelsLabel:"Tags",createButton:"Valider",updateButton:"Modifier ce BCF",modalText:"Vous \xEAtes sur le point de quitter l'\xE9dition de l'issue {name} mais il y'a des modifications non enregistr\xE9es.",cancelButton:"Annuler les modifications",continueButton:"Continuer les modifications",createTitle:"Signaler un probl\xE8me",dragDropImageTextTablet:"Prendre une photo",takeSnapshot:"Prendre un snapshot",importFile:"Importer un fichier",searchPlaceholder:"Rechercher",emptySearch:"Pas de r\xE9sultat",documentsLabel:"Documents",documentsCount:"Documents - {count} documents s\xE9lectionn\xE9s",validateDocuments:"Valider"},BcfTopicOverview:{openViewer:"Ouvrir dans le viewer",openViewerNoModels:"Il n'y a aucun mod\xE8le pr\xEAt pour une visualisation",elements:"{count} \xC9lements",noElements:"Aucun \xE9l\xE9ment concern\xE9",type:"Type",noTypeSpecified:"Pas de type sp\xE9cifi\xE9",description:"Description",noDescriptionProvided:"Pas de description renseign\xE9e",assignedTo:"Assign\xE9 \xE0",notAssigned:"Non assign\xE9",dueDate:"\xC9ch\xE9ance",noDueDate:"Pas de date d'\xE9ch\xE9ance",informations:"Informations",status:"Statut",noStatusSpecified:"Pas de statut sp\xE9cifi\xE9",stage:"Phase",noStageProvided:"Pas de phase renseign\xE9e",priority:"Priorit\xE9",priorityNotDefined:"Non d\xE9fini",tags:"Tags",noTags:"Pas de tags",commentButton:"Poster un commentaire",deleteText:"Vous \xEAtes sur le point de supprimer {name}",deleteBcfButton:"Supprimer ce BCF",keepBcfButton:"Conserver ce BCF",author:"Auteur"},BcfTopicsTable:{headers:{index:"#",priority:"Priorit\xE9",status:"Statut",title:"Titre",creator:"Auteur",date:"Date"}},BcfTopicActionsCell:{seeButton:"Voir"},BcfTopicComments:{commentButton:"Poster un commentaire",commentLabel:"Poster un commentaire",commentText:"Commentaire",cancelButton:"Annuler",publishButton:"Publier",commentsText:"commentaires",deleteCommentText:"Supprimer ce commentaire ?",deleteButton:"Supprimer",takeSnapshot:"Prendre un snapshot",edited:"edit\xE9"},BcfTopicPriorityCell:{noPriority:"Aucune"},SettingCard:{addButton:"ajouter un \xE9l\xE9ment",cancelButton:"Annuler",validateButton:"Valider",deleteExtensionText:"Supprimmer ce param\xE8tre",deleteButton:"Supprimer",title:{Priority:"Priorit\xE9s",Label:"Tags",Status:"Statuts",Type:"Types",Stage:"Phases"},input:{Priority:"Ajouter une nouvelle priorit\xE9",Label:"Ajouter un nouveau label",Status:"Ajouter un nouveau statut",Type:"Ajouter un nouveau type",Stage:"Ajouter une nouvelle phase"},text:{Priority:"Liste des priorit\xE9s",Label:"Liste des tags",Status:"Liste des statuts",Type:"Liste des types",Stage:"Liste des phases"}}},E4i={BcfComponents:B4i},P4i={back:"Indietro",BcfFilters:{filtersButton:"Filtri",filtersTitle:"Filtri",priorityLabel:"Priorit\xE0",statusLabel:"Stato",stageLabel:"Fase",datePlaceholder:"Data di creazione",assignedToLabel:"Assegnato a",creatorsLabel:"Creato da",tagsLabel:"Etichette",resetButton:"Ripristina",searchButton:"Cerca",undefined:"Non definito"},BcfSettings:{title:"Parametri BCF",text:"Creare, notificare e elencare i parametri BCF che si desidera avere su questo progetto",validateButton:"Conferma i parametri BCF"},BcfStatistics:{emptyText:"Aggiungi delle domande per vedere le statistiche associate qui.",issues:"problemi",extension:{Priority:"Priorit\xE0",PriorityNotDefined:"Nessuna priorit\xE0",PriorityTitle:"Priorit\xE0",Status:"Stato",StatusNotDefined:"Nessuno stato",StatusTitle:"Stati"}},BcfTopicCard:{priority:"Priorit\xE0",noPriority:"Nessuno",assignedTo:"Assegnato a",elements:"Elementi",noElements:"0 elementi",notSpecified:"Non definito",see:"Visualizza"},BcfTopicCreationCard:{text:"Crea un nuovo topic BCF",createBcfSideTitle:"Segnala un problema"},BcfTopicForm:{dragDropImageText:"Selezionare un file",addObjectButton:"Oggetto",addAnnotationButton:"Annotazione",annotationButtonTooltip:"Attualmente questo argomento non presenta alcun punto di vista",addPictureButton:"Aggiungere un'immagine",titlePlaceholder:"Titolo *",titleErrorMessage:"Titolo mancante",typeLabel:"Tipo",priorityLabel:"Priorit\xE0",statusLabel:"Stato",stageLabel:"Fase",assignedToLabel:"Assegnato a",dueDateLabel:"Data di scadenza",descriptionLabel:"Descrizione",labelsLabel:"Tag",createButton:"Conferma",updateButton:"Modificare questo BCF",modalText:"State per abbandonare la modifica di {name} ma ci sono modifiche non salvate.",cancelButton:"Annullare le modifiche",continueButton:"Continuare le modifiche",createTitle:"Segnala un problema"},BcfTopicOverview:{openViewer:"Apri nel visualizzatore",openViewerNoModels:"Non esistono modelli pronti per la visualizzazione",elements:"{count} Elementi",noElements:"Nessun elemento",type:"Tipo",noTypeSpecified:"Nessun tipo specificato",description:"Descrizione",noDescriptionProvided:"Nessuna descrizione inserita",assignedTo:"Assegnato a",notAssigned:"Non assegnato",dueDate:"Scadenza",noDueDate:"Nessuna data di scadenza",informations:"Informazioni",status:"Stato",noStatusSpecified:"Nessuno stato specificato",stage:"Fase",noStageProvided:"Nessuna fase inserita",priority:"Priorit\xE0",priorityNotDefined:"Non definita",tags:"Etichette",noTags:"Nessuna etichetta",commentButton:"Pubblica un commento",deleteText:"Stai per eliminare {name}",deleteBcfButton:"Elimina questo BCF",keepBcfButton:"Conserva questo BCF",author:"Autore"},BcfTopicsTable:{headers:{index:"#",priority:"Priorit\xE0",status:"Stato",title:"Titolo",creator:"Autore",date:"Data"}},BcfTopicActionsCell:{seeButton:"Visualizza"},BcfTopicComments:{commentButton:"Pubblica un commento",commentLabel:"Pubblica un commento",commentText:"Commento",cancelButton:"Annulla",publishButton:"Pubblica",commentsText:"commenti",deleteCommentText:"Eliminare questo commento?",deleteButton:"Elimina"},BcfTopicPriorityCell:{noPriority:"Nessuno"},SettingCard:{addButton:"aggiungi un elemento",cancelButton:"Annulla",validateButton:"Conferma",deleteExtensionText:"Elimina questo parametro",deleteButton:"Elimina",title:{Priority:"Priorit\xE0",Label:"Etichette",Status:"Stati",Type:"Tipi",Stage:"Fasi"},input:{Priority:"Aggiungi una nuova priorit\xE0",Label:"Aggiungi una nuova etichetta",Status:"Aggiungi un nuovo stato",Type:"Aggiungi un nuovo tipo",Stage:"Aggiungi una nuova fase"},text:{Priority:"Elenco delle priorit\xE0",Label:"Elenco delle etichette",Status:"Elenco degli stati",Type:"Elenco dei tipi",Stage:"Elenco delle fasi"}}},I4i={BcfComponents:P4i},S4i={de:w4i,en:x4i,es:M4i,fr:E4i,it:I4i},T4i=({apiClient:t,fetchUsers:e,i18nPlugin:i}={})=>({install(o){t?Ui.setup({apiClient:t,fetchUsers:e}):console.error("[BCF Components Plugin] No api client provided. You must provide an api client for the components to work properly."),i?Object.entries(S4i).forEach(([n,r])=>{i.global.mergeLocaleMessage(n,r)}):console.warn("[BCF Components Plugin] No i18n instance provided. You should either provide an i18n instance or define your own translations in order have text displayed properly."),Object.entries(lbe).forEach(([n,r])=>{o.component(n,r)})}}),R4i={title:"Building Maker",back:"Zur\xFCck",list:{text:"Erstellen und bearbeiten Sie die Etagen und laden Sie anschlie\xDFend Ihre PDFs herunter.",createButton:"Neues Projekt",updateButton:"Umbenennen",deleteButton:"L\xF6schen"},form:{text:"Erstellen und bearbeiten Sie die Etagen und laden Sie anschlie\xDFend Ihre PDFs herunter.",input:"Name des Geb\xE4udes",error:"Ung\xFCltiger Name",createButton:"Erstellen",updateButton:"Best\xE4tigen"},view:{addStoreyButton:"Etage",addPlanButton:"Grundriss",closeButton:"Fertigstellen",submitFilesButton:"Best\xE4tigen"},storeyForm:{title:"Neue Etage",input:"Name",error:"Ung\xFCltiger Name",cancelButton:"Abbrechen",submitButton:"Best\xE4tigen"}},D4i={creationFormTitle:"Ordner erstellen",renameFormPlaceholder:"Datei- / Ordnernam",nameInputPlaceholder:"Ordnername",emptyFolder:"Dieser Ordner ist leer",newFolderSuccess:"Neuer Ordner erstellt",renameFolderSuccess:"Umbenannter Ordner",deleteFolderSuccess:"Ordner gel\xF6scht",newFileSuccess:"Datei hinzugef\xFCgt",renameFileSuccess:"Umbenannte Datei",deleteFileSuccess:"Datei gel\xF6scht",nameInputErrorMessage:"Ung\xFCltiger name",cancel:"Abbrechen",submit:"Best\xE4tigen",buttonText:"Neuer Ordner",addFileButtonText:"Datei laden",rename:"Umbenennen",view:"Sehen",download:"Herunterladen",delete:"L\xF6schen",deleteTitle:"Dateien l\xF6schen",deleteDetail:"Sie sind im Begriff, die folgenden Dateien / Ordner endg\xFCltig zu l\xF6schen"},L4i={BuildingMaker:R4i,FileManager:D4i},_4i={t:{back:"Back",cancel:"Cancel",create:"Create",delete:"Delete",download:"Download",finish:"Finish",rename:"Rename",search:"Search",see:"View",storey:"Storey",validate:"Validate"}},F4i={title:"Building Maker",list:{text:"Create and edit storeys, then download your PDFs.",new:"New project"},form:{input:"Building name",error:"Invalid"},view:{addStorey:"Add Storey",addFile:"Add File",addPlan:"Add Plan"},storeyForm:{title:"New storey",input:"Name",error:"Invalid name"}},O4i={creationFormTitle:"Create folder",renameFormPlaceholder:"Folder/File name",nameInputPlaceholder:"Folder name",emptyFolder:"This folder is empty",newFolderSuccess:"New folder created",renameFolderSuccess:"Folder renamed",deleteFolderSuccess:"Folder deleted",newFileSuccess:"File added",renameFileSuccess:"File renamed",deleteFileSuccess:"File deleted",nameInputErrorMessage:"Invalid name",buttonText:"New folder",addFileButtonText:"Upload a file",deleteTitle:"Deleting Files",deleteDetail:"You are about to permanently delete the following files / folders",dmsRoot:"Root of the project's DMS",pdfPageSelectorTitle:"Select a page"},U4i={title:"Meta-Building Structure",tab:{structure:"Structure",zones:"Zones",equipments:"Equipments"},StoreySelector:{placeholder:"Select a storey"}},N4i={title:"Photosphere Building"},j4i={BIMDataComponents:_4i,BuildingMaker:F4i,FileManager:O4i,MetaBuildingStructure:U4i,PhotosphereBuilding:N4i},H4i={title:"Building Maker",back:"Vuelta",list:{text:"Cree y edite los pisos despu\xE9s cargue los PDF.",createButton:"Nuevo proyecto",updateButton:"Renombrar",deleteButton:"Suprimir"},form:{text:"Cree y edite los pisos despu\xE9s cargue los PDF.",input:"Nombre del edificio",error:"Nombre no v\xE1lido",createButton:"Crear",updateButton:"Validar"},view:{addStoreyButton:"Piso",addPlanButton:"Plano",closeButton:"Terminar",submitFilesButton:"Validar"},storeyForm:{title:"Nuevo piso",input:"Nombre",error:"Nombre no v\xE1lido",cancelButton:"Anular",submitButton:"Validar"}},V4i={creationFormTitle:"Crear un archivo",renameFormPlaceholder:"Nombre de archivo / carpeta",nameInputPlaceholder:"Nombre de la carpeta",emptyFolder:"Esta carpeta est\xE1 vac\xEDa",newFolderSuccess:"Nueva carpeta creada",renameFolderSuccess:"Carpeta renombrada",deleteFolderSuccess:"Carpeta eliminada",newFileSuccess:"Archivo agregado",renameFileSuccess:"Archivo renombrado",deleteFileSuccess:"Archivo eliminado",nameInputErrorMessage:"Nombre inv\xE1lida",cancel:"Cancelar",submit:"Validar",buttonText:"Carpeta nueva",addFileButtonText:"Cargar un archivo",rename:"Renombrar",view:"Ver",download:"Descargar",delete:"Borrar",deleteTitle:"Eliminar archivos",deleteDetail:"Est\xE1 a punto de eliminar permanentemente los siguientes archivos / carpetas"},z4i={BuildingMaker:H4i,FileManager:V4i},q4i={t:{back:"Retour",cancel:"Annuler",create:"Cr\xE9er",delete:"Supprimer",download:"T\xE9l\xE9charger",finish:"Terminer",rename:"Renommer",search:"Rechercher",see:"Voir",storey:"\xC9tage",validate:"Valider"}},Q4i={title:"Building Maker",list:{text:"Cr\xE9ez et \xE9ditez les \xE9tages puis t\xE9l\xE9chagez vos PDF.",new:"Nouveau projet"},form:{input:"Nom du b\xE2timent",error:"Nom invalide"},view:{addStorey:"Ajouter un \xC9tage",addFile:"Ajouter un fichier",addPlan:"Ajouter un plan"},storeyForm:{title:"Nouvel \xE9tage",input:"Nom",error:"Nom invalide"}},G4i={creationFormTitle:"Cr\xE9er un dossier",renameFormPlaceholder:"Nom du fichier/dosier",nameInputPlaceholder:"Nom du dossier",emptyFolder:"Ce dossier est vide",newFolderSuccess:"Nouveau dossier cr\xE9\xE9",renameFolderSuccess:"Dossier renomm\xE9",deleteFolderSuccess:"Dossier supprim\xE9",newFileSuccess:"Fichier ajout\xE9",renameFileSuccess:"Fichier renomm\xE9",deleteFileSuccess:"Fichier supprim\xE9",nameInputErrorMessage:"Nom invalide",buttonText:"Nouveau dossier",addFileButtonText:"Charger un fichier",deleteTitle:"Supression de fichiers",deleteDetail:"Vous \xEAtes sur le point de supprimer d\xE9finitivement les fichiers/dossiers suivants",dmsRoot:"Racine de la GED du projet",pdfPageSelectorTitle:"S\xE9lectionner une page"},K4i={title:"Structure M\xE9ta-Building",tab:{structure:"Structure",zones:"Zones",equipments:"\xC9quipements"},StoreySelector:{placeholder:"S\xE9lectionner un \xE9tage"}},J4i={title:"Photosph\xE8re Building"},Z4i={BIMDataComponents:q4i,BuildingMaker:Q4i,FileManager:G4i,MetaBuildingStructure:K4i,PhotosphereBuilding:J4i},W4i={title:"Building Maker",back:"Reso",list:{text:"Crea e modifica i piani e poi scarica i tuoi PDF.",createButton:"Nuovo progetto",updateButton:"Rinominare",deleteButton:"Eliminare"},form:{text:"Crea e modifica i piani e poi scarica i tuoi PDF.",input:"Nome della costruzione",error:"Nome non corretto",createButton:"Creare",updateButton:"Convalidare"},view:{addStoreyButton:"Piano",addPlanButton:"Mappa",closeButton:"Finire",submitFilesButton:"Convalidare"},storeyForm:{title:"Nuovo piano",input:"Nome",error:"Nome non corretto",cancelButton:"Annullare",submitButton:"Convalidare"}},Y4i={creationFormTitle:"Crea una cartella",renameFormPlaceholder:"Nome file/cartella",nameInputPlaceholder:"Nome della cartella",emptyFolder:"Questa cartella \xE8 vuota",newFolderSuccess:"Nuova cartella creata",renameFolderSuccess:"Cartella rinominata",deleteFolderSuccess:"Cartella eliminata",newFileSuccess:"File aggiunto",renameFileSuccess:"File rinominato",deleteFileSuccess:"File cancellato",nameInputErrorMessage:"Nome non valido",cancel:"Annulla",submit:"Invia",buttonText:"Nuova cartella",addFileButtonText:"Carica un file",rename:"Rinominare",view:"Vedere",download:"Scaricare",delete:"Cancellare",deleteTitle:"Eliminazione di file",deleteDetail:"Stai per eliminare definitivamente i seguenti file/cartelle"},X4i={BuildingMaker:W4i,FileManager:Y4i},$4i={de:L4i,en:j4i,es:z4i,fr:Z4i,it:X4i},e5i=({i18nPlugin:t}={})=>({install(e){t?Object.entries($4i).forEach(([i,o])=>{t.global.mergeLocaleMessage(i,o)}):console.warn("[BIMData Components Plugin] No i18n instance provided. You should either provide an i18n instance or define your own translations in order have text displayed properly."),Object.entries(RYt).forEach(([i,o])=>{e.component(i,o)})}}),t5i={beforeMount(t,e){if(typeof e.value!="function")throw Error(`click away directive needs function, got ${typeof e.value}`);t.clickAwayHandler=i=>{(i.path||i.composedPath&&i.composedPath()).find(o=>o===t)||e.value()},window.addEventListener("mousedown",t.clickAwayHandler,!0)},unmounted(t){window.removeEventListener("mousedown",t.clickAwayHandler,!0),delete t.clickAwayHandler}},i5i=Object.freeze(Object.defineProperty({__proto__:null,BIMDataClickAway:Zs,BIMDataClickInputAway:t5i},Symbol.toStringTag,{value:"Module"})),o5i=t=>({install(e){Object.entries(XYe).forEach(([i,o])=>{e.component(i,o)}),Object.entries(i5i).forEach(([i,o])=>e.directive(i.split("BIMData")[1],o))}}),r5i={name:"LiWrapper",render(){return Qo("li",this.$slots.default())}};function n5i(t,e){var i=new Set([]);return t.forEach(o=>{e.has(o)||i.add(o)}),i}const xl=Wr("id"),a5i=({contextMenu:t,objects:e=[],state:i=t.$viewer.state,pictos:o})=>[{name:"selectAll",get group(){return t.groupPositions.select},position:1,get label(){return t.$t("context_menu.select_all")},get picto(){return o.get(this.name)},execute:()=>i.selectObjects(e.filter(Fs(Ei("visible"),Au("selected"))).map(xl)),predicate:()=>e.some(Fs(Ei("visible"),Au("selected")))},{name:"deselectAll",get group(){return t.groupPositions.select},position:2,get label(){return t.$t("context_menu.deselect_all")},get picto(){return o.get(this.name)},execute:()=>i.deselectObjects(e.filter(Ei("selected")).map(xl)),predicate:()=>e.some(Ei("selected"))},{name:"selectSimilar",get group(){return t.groupPositions.select},position:3,get label(){return t.$t("context_menu.select_similar")},get picto(){return o.get(this.name)},execute(){const n=e.filter(r=>r.visible&&r.type===this.selectedObject.type&&r.id!==this.selectedObject.id).map(xl);i.selectObjects(n)},selectedObject:null,predicate(){const n=e.filter(Fs(Ei("visible"),Ei("selected")));return n.length===1&&n[0].type!==void 0?(this.selectedObject=n[0],!0):(this.selectedObject=null,!1)}},{name:"reverseSelection",get label(){return t.$t("context_menu.reverse_selection")},get group(){return t.groupPositions.select},position:4,execute:()=>{const n=new Set(e.filter(Ei("selected")).map(xl)),r=new Set(e.filter(Ei("visible")).map(xl));i.selectObjects(Array.from(n5i(r,n)),{exclusive:!0})},predicate:()=>e.some(Fs(Au("selected"),Ei("visible")))&&e.some(Fs(Ei("selected"),Ei("visible")))},{name:"showAll",get group(){return t.groupPositions.visibility},position:1,get label(){return t.$t("context_menu.show_all")},get picto(){return o.get(this.name)},execute:()=>i.showObjects(e.filter(Au("visible")).map(xl)),predicate:()=>e.some(Au("visible"))},{name:"hide",get group(){return t.groupPositions.visibility},position:2,get label(){return t.$t("context_menu.hide")},get picto(){return o.get(this.name)},objectsToHide:null,execute(){const n=this.objectsToHide.filter(Ei("selected"));n.length>0&&i.deselectObjects(n.map(xl)),i.hideObjects(this.objectsToHide.map(xl))},predicate(){return this.objectsToHide=e.filter(Fs(Ei("selected"),Ei("visible"))),this.objectsToHide.length>0}},{name:"hideAll",get group(){return t.groupPositions.visibility},position:3,get label(){return t.$t("context_menu.hide_all")},execute:()=>{const n=e.filter(Ei("visible"));n.some(Ei("selected"))&&i.deselectObjects(n.filter(Ei("selected")).map(xl)),i.hideObjects(n.map(xl))},predicate:()=>e.some(Ei("visible"))}].filter(n=>n.predicate()),s5i={components:{LiWrapper:r5i},inject:["$viewer"],data(){return{defaultPrevented:!1,displayed:!1,top:null,bottom:null,left:null,width:200,nextCommandId:1,currentCommands:[],contextCommands:[],registeredCommands:[],groupPositions:{select:10,visibility:20},asyncPredicateRunning:!1}},computed:{position(){return{top:this.top?this.top+"px":"unset",bottom:this.bottom?this.bottom+"px":"unset",left:this.left+"px",width:this.width+"px"}}},watch:{displayed(t){t?document.addEventListener("keydown",this.onKeyDown):document.removeEventListener("keydown",this.onKeyDown)}},created(){this.$viewer.contextMenu=this,this.asyncPredicates=new Set},methods:{onKeyDown(t){t.key==="Escape"&&this.away()},setPosition(t){const e=(document.fullscreenElement?document.fullscreenElement:this.$parent.$el).getBoundingClientRect();this.left=t.clientX-e.left,this.top=t.clientY-e.top,this.left+this.width>e.width&&(this.left=this.left-this.width),t.clientY>e.top+e.height/2?(this.bottom=e.height-this.top,this.top=null):this.bottom=null},typeCheckCommand(t={}){let e=null;if((!t.execute||typeof t.execute!="function")&!t.component&&(e="Cannot register context menu command. A command must have an execute function or a component property."),t.label||(e="Cannot register context menu command. A command must have a label."),e)throw console.error(e),new Error(e);return t.id=this.nextCommandId++,t},open(t){this.currentCommands=[],this.setPosition(t),this.originEvent=t,t.preventDefault(),this.setCurrentCommands(),this.groupCurrentCommands(),this.defaultPrevented=!1,this.displayed=!0,document.fullscreenElement?(this.$el.parentElement.removeChild(this.$el),this.adoptiveParent=document.fullscreenElement,this.adoptiveParent.appendChild(this.$el)):this.adoptiveParent&&this.adoptiveParent!==this.$viewer.globalContext.el&&(this.adoptiveParent.removeChild(this.$el),this.$viewer.globalContext.el.appendChild(this.$el),this.adoptiveParent=null)},setCurrentCommands(){this.asyncPredicates.clear(),this.asyncPredicateRunning=!1,this.defaultPrevented||this.registeredCommands.forEach(async t=>{if(typeof t.predicate=="function"){const e=t.predicate(this.$viewer.globalContext.activeLocalContext);if(e===!0)this.currentCommands.push(t);else if(typeof e?.then=="function"){this.asyncPredicates.add(e),this.asyncPredicateRunning=!0;const i=await e;this.asyncPredicates.has(e)&&(this.asyncPredicates.delete(e),this.asyncPredicateRunning=this.asyncPredicates.size>0,i===!0&&this.currentCommands.push(t))}}else this.currentCommands.push(t)}),this.currentCommands.push(...this.contextCommands),this.contextCommands=[]},getDefaultCommands({objects:t=[],state:e=this.$viewer.state,context:i=null}){const o=new Map;return i&&this.$viewer.shortcutManager.getShortcuts(i).forEach(n=>o.set(n.name,n.key)),a5i({contextMenu:this,objects:t,state:e,pictos:o})},executeCommand(t){if(t.execute&&(t.execute(this.originEvent),this.displayed=!1),t.component&&!t.menu)throw new Error("Command with component property must have a `menu` property")},away(){this.displayed=!1},groupCurrentCommands(){const t=new Map;this.currentCommands.forEach(i=>{(i.group===null||i.group===void 0)&&(i.group=0),t.has(i.group)?t.get(i.group).push(i):t.set(i.group,[i])}),t.forEach(i=>i.sort((o,n)=>(o.position=o.position||0,n.position=n.position||0,o.position-n.position)));const e=[...t.keys()].sort((i,o)=>i-o).map(i=>t.get(i)).flat();this.currentCommands=e},isGroupIntersection(t){if(t===0)return!1;const e=this.currentCommands[t-1],i=this.currentCommands[t];return e.group<i.group},registerContextCommand(t){const e=this.typeCheckCommand(t);return this.contextCommands.push(e),t.id},registerCommand(t){const e=this.typeCheckCommand(t);return this.registeredCommands.push(e),t.id},unregisterCommand(t){return this.registeredCommands.find(e=>e.id===t)?(this.registeredCommands=this.registeredCommands.filter(e=>e.id!==t),!0):!1},preventDefault(){this.defaultPrevented=!0}}},l5i={key:0,class:"separator"},c5i={class:"menu-text"},d5i={key:1,class:"menu-picto"},u5i={key:0,class:"context-menu__spinner"};function h5i(t,e,i,o,n,r){const a=S("BIMDataIconChevron"),s=S("LiWrapper"),l=S("BIMDataSpinner"),c=ci("click-away");return n.displayed&&(n.currentCommands.length||n.asyncPredicateRunning)?yt((M(),_("ul",{key:0,class:"bimdata-list context-menu",style:ce(r.position)},[(M(!0),_(tt,null,Bt(n.currentCommands,(d,u)=>(M(),J(s,{key:d.label,class:"context-menu__element",onClick:h=>r.executeCommand(d)},{default:N(()=>[r.isGroupIntersection(u)?(M(),_("div",l5i)):ie("",!0),b("div",c5i,q(d.label),1),!d.component&&d.picto?(M(),_("span",d5i,q(d.picto),1)):d.component?(M(),J(a,{key:2,size:"xxs",class:"fill-primary"})):ie("",!0)]),_:2},1032,["onClick"]))),128)),n.asyncPredicateRunning?(M(),_("li",u5i,[D(l)])):ie("",!0)],4)),[[c,r.away]]):ie("",!0)}const p5i=j(s5i,[["render",h5i],["__scopeId","data-v-5b87d4a3"]]),f5i={name:"ViewerHeader",inject:["$viewer"],props:{visible:{type:Boolean,default:!0}},setup(){const t=ht("$viewer"),e=$r(new Map),i=n=>{if(!n.name)throw new TypeError("[Viewer Header] Content must have a name");if(e.has(n.name))throw new Error(`[Viewer Header] Content with name ${n.name} already exists`);e.set(n.name,n)},o=n=>e.has(n)?(e.delete(n),!0):!1;return{logo:t.uiSettings.bimdataLogo!==!1,version:t.uiSettings.version!==!1?t.version:null,headerContent:e,headerRightContentComponents:Oe(()=>Array.from(e.values()).filter(n=>n.position==="right").sort((n,r)=>n.order-r.order).map(n=>n.component)),headerLeftContentComponents:Oe(()=>Array.from(e.values()).filter(n=>n.position==="left").sort((n,r)=>n.order-r.order).map(n=>n.component)),addContent:i,removeContent:o}}},A5i={class:"viewer-header"},g5i={class:"viewer-header__content"},m5i={class:"viewer-header__content__left"},v5i={class:"viewer-header__content__right"},y5i={key:0,class:"m-l-6 flex items-center"},b5i={key:1,class:"viewer-header__version"};function w5i(t,e,i,o,n,r){const a=S("BIMDataIllustration");return yt((M(),_("div",A5i,[b("div",g5i,[b("div",m5i,[(M(!0),_(tt,null,Bt(o.headerLeftContentComponents,s=>(M(),J(Mo(s),{key:s.name}))),128))]),b("div",v5i,[(M(!0),_(tt,null,Bt(o.headerRightContentComponents,s=>(M(),J(Mo(s),{key:s.name}))),128))])]),o.logo||o.version?(M(),_("div",y5i,[o.logo?(M(),J(a,{key:0,name:"logo",width:"30px",height:"30px"})):ie("",!0),o.version?(M(),_("div",b5i,q(o.version),1)):ie("",!0)])):ie("",!0)],512)),[[zt,i.visible]])}const C5i=j(f5i,[["render",w5i],["__scopeId","data-v-5c9ea6b6"]]),x5i={emits:["resize"],setup(t,{emit:e}){return{onResizerMousedown:i=>{i.preventDefault();let o=i.clientX;const n=a=>{a.preventDefault();const s=a.clientX-o;o=a.clientX,e("resize",s)},r=a=>{a.preventDefault(),window.removeEventListener("mousemove",n),window.removeEventListener("mouseup",r)};window.addEventListener("mousemove",n),window.addEventListener("mouseup",r)}}}},k5i={class:"bimdata-separator"};function M5i(t,e,i,o,n,r){return M(),_("div",k5i,[e[1]||(e[1]=b("div",{class:"bimdata-separator__line"},null,-1)),b("div",{class:"bimdata-separator__resizer",onMousedown:e[0]||(e[0]=(...a)=>o.onResizerMousedown&&o.onResizerMousedown(...a))},null,32)])}const B5i=j(x5i,[["render",M5i],["__scopeId","data-v-79a3b3af"]]),E5i={components:{Separator:B5i},props:{position:{type:String,required:!0,validator(t){return["left","right"].includes(t)}},sidePanel:{type:Object,required:!0,validator(t){if(t.width&&(typeof t.width!="number"||t.width<0))return console.error(`[GlobalSidePanel] sidePanel.width must be a strictly positive number, received ${typeof t.width}`),!1;const e=typeof t?.component=="object";return e||console.error("[GlobalSidePanel] sidePanel must have a component property"),e}}},setup(t){const e=de(null),i=de(t.sidePanel.width??400),o=(n,r=1)=>{const a=i.value+n*r;i.value=Math.max(0,a)};return ft(()=>t.sidePanel,()=>{Object.defineProperty(t.sidePanel,"width",{get(){return i.value},set(n){if(typeof n!="number"||n<=0){console.error(`[GlobalSidePanel] sidePanel.width must be a strictly positive number, received ${typeof n}`);return}i.value=n}}),Object.defineProperty(t.sidePanel,"componentInstance",{get(){return e.value},enumerable:!0})},{immediate:!0}),{componentInstance:e,width:i,onResize:o}}},P5i={class:"bimdata-global-side-panel__component"};function I5i(t,e,i,o,n,r){const a=S("Separator");return M(),_("div",{class:"bimdata-global-side-panel",style:ce(`width: ${o.width}px`)},[i.sidePanel.resizable&&i.position==="right"?(M(),J(a,{key:0,onResize:e[0]||(e[0]=s=>o.onResize(s,-1))})):ie("",!0),b("div",P5i,[(M(),J(Mo(i.sidePanel.component),{ref:"componentInstance"},null,512))]),i.sidePanel.resizable&&i.position==="left"?(M(),J(a,{key:1,onResize:e[1]||(e[1]=s=>o.onResize(s))})):ie("",!0)],4)}const S5i=j(E5i,[["render",I5i],["__scopeId","data-v-82d0d4cb"]]),T5i={name:"BimdataViewer",components:{ContextMenu:p5i,ViewerHeader:C5i,ModalManager:tfe,GlobalSidePanel:S5i},setup(){const t=ht("$viewer"),{globalContext:e,shortcutManager:i}=t;Ti(()=>{i&&i.destroy(),e.hub.clear()}),li(()=>{t.pluginManager.runPluginsScripts(t)});const o=Oe(()=>t.uiSettings.bimdataLogo!==!1&&(e.localContexts.length!==1||e.localContexts[0].window?.logoAndVersion)),n=Oe(()=>t.uiSettings.version!==!1&&(e.localContexts.length!==1||e.localContexts[0].window?.logoAndVersion)?t.version:null),r=Oe(()=>e.leftSidePanel),a=Oe(()=>e.rightSidePanel),s=Oe(()=>{const p=t.uiSettings.header!==!1,A=e.localContexts.length===1&&e.localContexts[0].window?.header===!1,f=!!(r.value||a.value);return p&&(!A||f)}),l=t.uiSettings.contextMenu!==!1,c=de(null);function d(p){l&&c.value.open(p)}function u(){t.shortcutManager.active=!0}function h(){t.shortcutManager.active=!1}return{Layout:t.layout.areas.component,onContextMenu:d,onMouseenter:u,onMouseleave:h,isHeaderVisible:s,viewerTemplateRef:e.templateRef,modalManagerTemplateRef:e.modalManagerTemplateRef,headerTemplateRef:e.headerTemplateRef,contextMenuTemplateRef:c,contextMenuEnabled:l,bimdataLogoOnSingleWindow:o,viewerVersionOnSingleWindow:n,version:t.version,loading:Oe(()=>e.loading),spinner:Oe(()=>e.spinner),leftSidePanel:r,rightSidePanel:a}}},R5i={key:1,class:"bimdata-context-loading-overlay",style:{"z-index":"3"}},D5i={key:2,class:"viewer__logo"},L5i={key:1,class:"version m-t-6"};function _5i(t,e,i,o,n,r){const a=S("ModalManager"),s=S("ContextMenu"),l=S("ViewerHeader"),c=S("GlobalSidePanel"),d=S("BIMDataSpinner"),u=S("BIMDataIllustration");return M(),_("div",{id:"bimdata-viewer",ref:"viewerTemplateRef",class:"bimdata-viewer bimdata-design-system bimdata-scrollbar",onContextmenu:e[0]||(e[0]=(...h)=>o.onContextMenu&&o.onContextMenu(...h)),onMouseenter:e[1]||(e[1]=(...h)=>o.onMouseenter&&o.onMouseenter(...h)),onMouseleave:e[2]||(e[2]=(...h)=>o.onMouseleave&&o.onMouseleave(...h))},[D(a,{ref:"modalManagerTemplateRef"},null,512),o.contextMenuEnabled?(M(),J(s,{key:0,ref:"contextMenuTemplateRef"},null,512)):ie("",!0),D(l,{ref:"headerTemplateRef",visible:o.isHeaderVisible},null,8,["visible"]),b("div",{class:"bimdata-viewer__content",style:ce(o.isHeaderVisible?"height: calc(100% - var(--bimdata-viewer-header-height, 40px))":"height: 100%")},[o.leftSidePanel?(M(),J(c,{key:0,"side-panel":o.leftSidePanel,position:"left"},null,8,["side-panel"])):ie("",!0),(M(),J(Mo(o.Layout),{style:"height: 100%; flex-grow: 1;"})),o.rightSidePanel?(M(),J(c,{key:1,"side-panel":o.rightSidePanel,position:"right"},null,8,["side-panel"])):ie("",!0)],4),o.loading?(M(),_("div",R5i,[o.spinner&&o.spinner.component?(M(),J(Mo(o.spinner.component),Ta(wn({key:0},o.spinner.props)),null,16)):(M(),J(d,{key:1,size:"40px",border:"5px"}))])):ie("",!0),!o.isHeaderVisible&&(o.bimdataLogoOnSingleWindow||o.viewerVersionOnSingleWindow)?(M(),_("div",D5i,[o.bimdataLogoOnSingleWindow?(M(),J(u,{key:0,name:"logo"})):ie("",!0),o.viewerVersionOnSingleWindow?(M(),_("div",L5i,q(o.version),1)):ie("",!0)])):ie("",!0)],544)}const F5i=j(T5i,[["render",_5i],["__scopeId","data-v-0c1c941a"]]),O5i=["src"],U5i={class:"bimdata-models__header"},N5i={key:0,class:"bimdata-models__header__loader"},j5i={class:"bimdata-models__header__picto"},H5i={class:"bimdata-models__header__name"},V5i={key:0,class:"bimdata-models__header__name--empty"},z5i={key:1,class:"bimdata-models__header__name--empty"},q5i={key:3},Q5i=["onMousemove","onClick"],G5i={__name:"Models",props:{preview:{type:Boolean,default:!1},windowPositioning:{type:Boolean,default:!0},customFilter:{type:Function,default:null},width:{type:String,default:"350px"}},setup(t){const e=t,i=ht("$viewer"),o=de(),n=de(0),r=de(0),a=de(),s=bi([]),l=de(!1),c=Oe(()=>i.localContext.loadedModels),d=Oe(()=>i.localContext.loadedModelIds),u=Oe(()=>i.localContext.loadingModelIds),h=Oe(()=>i.localContext.multiModel),p=Oe(()=>(e.customFilter?s.value.filter(e.customFilter):s.value).map(k=>c.value.find(B=>B.document?.head_id!=null&&B.document.head_id===k.document.id)??k)),A=k=>d.value.includes(k),f=k=>u.value.includes(k),m=Oe(()=>{const{x:k,y:B}=a.value?.getBoundingClientRect()??{x:0,y:0};return`top:${r.value-B}px; left:${n.value-k}px;`}),g=k=>{!h.value&&A(k.id)||u.value.length>0||(i.localContext.loadedModelIds.includes(k.id)?i.localContext.unloadModels([k.id]):i.localContext.loadModels([k.id]))},y=k=>{switch(k){case"C":return"success";case"E":return"failed";case"P":case"I":return"sandglass"}},v=(k,B)=>{k?.viewer_360_file&&(n.value=B.clientX,r.value=B.clientY),o.value=k?.viewer_360_file},w=async k=>{l.value=!0;try{return(await i.api.apiClient.modelApi.getModels(i.api.cloudId,i.api.projectId,void 0,void 0,k)).filter(B=>i.state.models.some(P=>P.archived)||!B.archived).sort($s("updated_at",!1))}catch(B){console.error("[Models] Cannot get project models. Error: ",B)}finally{l.value=!1}return[]},x=k=>k.children?.some(B=>A(B.id))??!1;return w(i.localContext.modelTypes).then(k=>{s.value=k}),(k,B)=>{const P=S("BIMDataSpinner"),E=S("BIMDataIconModel3D"),T=S("BIMDataTextbox"),I=S("BIMDataCheckbox"),R=S("BIMDataRadio"),F=S("BIMDataIcon"),U=S("BIMDataDropdownList");return M(),_("div",{ref_key:"templateRef",ref:a,class:le(["bimdata-models",{"bimdata-models--window-positioning":t.windowPositioning}])},[o.value?(M(),_("div",{key:0,class:"bimdata-models__preview",style:ce(m.value)},[b("img",{src:o.value},null,8,O5i)],4)):ie("",!0),D(U,{style:ce(`--bimdata-models-width: ${t.width};`),width:t.width,list:p.value,"element-key":"id","per-page":40,loading:l.value,class:"bimdata-models__list",disabled:p.value.length===0,onElementClick:g},{header:N(({isOpen:z})=>[b("div",U5i,[l.value||u.value.length>0?(M(),_("div",N5i,[D(P)])):(M(),_(tt,{key:1},[b("div",j5i,[D(E)]),b("div",{class:le(["bimdata-models__header__number bimdata-info-length",{"bimdata-models__header__number--empty":d.value.length===0}])},[b("span",null,q(d.value.length),1)],2),b("div",H5i,[p.value.length===0?(M(),_("span",V5i,q(k.$t("model.no_model")),1)):d.value.length===0?(M(),_("span",z5i,q(k.$t("model.no_loaded_model")),1)):d.value.length===1?(M(),J(T,{key:2,text:c.value[0].name,tooltip:!z},null,8,["text","tooltip"])):d.value.length>1?(M(),_("span",q5i,q(k.$t("model.selected_models")),1)):ie("",!0)])],64))])]),element:N(({element:z,close:H})=>[b("div",{class:"bimdata-models__model",onMousemove:W=>t.preview&&v(z,W),onMouseout:B[0]||(B[0]=W=>t.preview&&v()),onClick:()=>{!h.value&&!A(z.id)&&H()}},[h.value?(M(),J(I,{key:0,"model-value":A(z.id)||x(z),disabled:z.status!=="C"||u.value.length>0},null,8,["model-value","disabled"])):(M(),J(R,{key:1,"model-value":A(z.id)||x(z),disabled:z.status!=="C"||u.value.length>0},null,8,["model-value","disabled"])),D(F,{margin:"0 calc(var(--spacing-unit) / 2)",name:y(z.status),size:"xs",class:le({"fill-success":z.status==="C","fill-high":z.status==="E"})},null,8,["name","class"]),D(T,{class:le({"bimdata-models__model__name":!0,"bimdata-models__model__name--disabled":z.status!=="C"||u.value.length>0}),text:z.name,width:`calc(100% -
5544
5544
  ${h.value?13:23}px - 2 * 6px - 16px)`},null,8,["class","text","width"]),z.document&&!z.document.is_head_version?(M(),J(F,{key:2,name:"versioning",fill:"",color:"default",size:"xs",margin:"0 0 0 6px"})):ie("",!0)],40,Q5i),f(z.id)?(M(),J(P,{key:0,class:"bimdata-models__model__spinner"})):ie("",!0)]),_:1},8,["style","width","list","loading","disabled"])],2)}}},afe=j(G5i,[["__scopeId","data-v-34c2cf79"]]),K5i="data:image/svg+xml,%3csvg%20width='16'%20height='21'%20viewBox='0%200%2016%2021'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M7.47193%202.76644C7.65699%202.84439%207.77716%203.02565%207.777%203.22661L7.77339%207.94624C7.77318%208.22238%207.54916%208.44655%207.27301%208.44693L2.4192%208.45366C2.21569%208.45394%202.03258%208.33085%201.95617%208.1424C1.87975%207.95394%201.92528%207.73773%202.07129%207.59566L6.92872%202.86931C7.0729%202.72902%207.28688%202.6885%207.47193%202.76644ZM3.65141%207.45195L6.77378%207.44762L6.7761%204.41157L3.65141%207.45195ZM5.81657%200.893911L6.02338%200.893274L13.3879%200.870595C14.679%200.866619%2015.7208%201.91642%2015.722%203.20083L15.2221%203.20237L15.722%203.20052L15.722%203.20083L15.745%2017.8999L15.745%2017.9002C15.7462%2019.1846%2014.7063%2020.2408%2013.4153%2020.2448L2.35929%2020.2788C1.07114%2020.2828%200.0171799%2019.2362%200.0159721%2017.9486L0.00563138%206.92409L0.00543684%206.71668L0.152103%206.56972L5.67032%201.04045L5.81657%200.893911ZM6.23113%201.89264L1.00582%207.12841L1.01597%2017.9455C1.01666%2018.6791%201.62068%2019.2811%202.35835%2019.2788L13.4143%2019.2448C14.1484%2019.2425%2014.7456%2018.6402%2014.745%2017.9035C14.745%2017.9034%2014.745%2017.9033%2014.745%2017.9033L14.722%203.20423L14.722%203.20391C14.7213%202.46716%2014.123%201.86833%2013.3888%201.87059L6.23113%201.89264Z'%20fill='%232F374A'/%3e%3c/svg%3e",J5i=["src"],Z5i={key:0,class:"bimdata-multi-model-loader__header-container"},W5i={key:0,class:"bimdata-multi-model-loader__header__loader"},Y5i={class:"bimdata-multi-model-loader__header__picto"},X5i=["src"],$5i={class:"bimdata-multi-model-loader__header__name"},e6i={key:0,class:"bimdata-multi-model-loader__header__name--empty"},t6i={key:1,class:"bimdata-multi-model-loader__header__name--empty"},i6i={key:3},o6i={key:1,class:"bimdata-multi-model-loader__main"},r6i=["onMousemove","onClick"],n6i={__name:"BIMDataMultiModelLoader",props:{preview:{type:Boolean,default:!1},windowPositioning:{type:Boolean,default:!0},customFilter:{type:Function,default:null},width:{type:String,default:"350px"}},setup(t){const e=t,i=ht("$viewer"),o=de(),n=de(0),r=de(0),a=de(),s=bi([]),l=de(!1),c=de(!0),d=R=>{R.key==="Escape"?c.value=!0:R.key==="Enter"&&P()};ft(c,R=>{R?(window.removeEventListener("keydown",d),v.clear(),y.clear(),o.value=null):window.addEventListener("keydown",d)});const u=Oe(()=>i.localContext.loadedModels),h=Oe(()=>i.localContext.loadedModelIds),p=Oe(()=>i.localContext.loadingModelIds),A=Oe(()=>i.localContext.multiModel),f=Oe(()=>(e.customFilter?s.value.filter(e.customFilter):s.value).map(R=>u.value.find(F=>F.document?.head_id!=null&&F.document.head_id===R.document.id)??R)),m=R=>h.value.includes(R),g=R=>p.value.includes(R),y=$r(new Set),v=$r(new Set),w=R=>R.children?.some(F=>m(F.id))??!1,x=R=>(m(R.id)||w(R)||y.has(R))&&!v.has(R),k=Oe(()=>{const{x:R,y:F}=a.value.getBoundingClientRect();return`top:${r.value-F}px; left:${n.value-R}px;`}),B=R=>{R.status==="C"&&(!A.value&&m(R.id)||(m(R.id)?v.has(R)?v.delete(R):v.add(R):y.has(R)?y.delete(R):y.add(R)))},P=()=>{y.size>0&&i.localContext.loadModels(Array.from(y).map(R=>R.id)),v.size>0&&i.localContext.unloadModels(Array.from(v).map(R=>R.id)),c.value=!0},E=R=>{switch(R){case"C":return"success";case"E":return"failed";case"P":case"I":return"sandglass"}},T=R=>R.document&&!R.document.is_head_version,I=(R,F)=>{!e.preview||c.value||(R?.viewer_360_file&&(n.value=F.clientX,r.value=F.clientY),o.value=R?.viewer_360_file)};return(async R=>{l.value=!0;try{return(await i.api.apiClient.modelApi.getModels(i.api.cloudId,i.api.projectId,void 0,void 0,R)).filter(F=>i.state.models.some(U=>U.archived)||!F.archived).sort($s("updated_at",!1))}catch(F){console.error("[Models] Cannot get project models. Error: ",F)}finally{l.value=!1}return[]})(i.localContext.modelTypes).then(R=>{s.value=R}),(R,F)=>{const U=S("BIMDataSpinner"),z=S("BIMDataTextbox"),H=S("BIMDataIconChevron"),W=S("BIMDataButton"),Y=S("BIMDataIconFileIfcPolychrome"),$=S("BIMDataCheckbox"),fe=S("BIMDataRadio"),Me=S("BIMDataIcon"),Se=S("BIMDataPaginatedList"),qe=ci("click-away");return M(),_("div",{ref_key:"templateRef",ref:a,class:le(["bimdata-multi-model-loader",{"bimdata-multi-model-loader--window-positioning":t.windowPositioning}])},[o.value?(M(),_("div",{key:0,class:"bimdata-multi-model-loader__preview",style:ce(k.value)},[b("img",{src:o.value},null,8,J5i)],4)):ie("",!0),D(pi,{name:"fade",mode:"out-in"},{default:N(()=>[c.value?(M(),_("div",Z5i,[gt(R.$slots,"left",{},void 0,!0),b("div",{class:"bimdata-multi-model-loader__header",onClick:F[0]||(F[0]=Qe=>c.value=!1)},[l.value||p.value.length>0?(M(),_("div",W5i,[D(U)])):(M(),_(tt,{key:1},[b("div",Y5i,[b("img",{src:at(K5i),alt:"file icon"},null,8,X5i)]),b("div",{class:le(["bimdata-multi-model-loader__header__number bimdata-info-length",{"bimdata-multi-model-loader__header__number--empty":h.value.length===0}])},[b("span",null,q(h.value.length),1)],2),b("div",$5i,[f.value.length===0?(M(),_("span",e6i,q(R.$t("model.no_model")),1)):h.value.length===0?(M(),_("span",t6i,q(R.$t("model.no_loaded_model")),1)):h.value.length===1?(M(),J(z,{key:2,text:u.value[0].name,tooltip:c.value,width:"233px"},null,8,["text","tooltip"])):h.value.length>1?(M(),_("span",i6i,q(R.$t("model.selected_models")),1)):ie("",!0)]),D(W,{color:"default",icon:"",radius:"",fill:"",width:"21px",height:"21px"},{default:N(()=>[D(H,{size:"xxxs"})]),_:1})],64))]),gt(R.$slots,"right",{},void 0,!0)])):yt((M(),_("div",o6i,[D(Se,{list:f.value,"per-page":10},{element:N(({element:Qe})=>[b("div",{class:le(["bimdata-multi-model-loader__main__model",{"bimdata-multi-model-loader__main__model--disabled":Qe.status!=="C"}]),onMousemove:Ce=>I(Qe,Ce),onMouseout:F[1]||(F[1]=Ce=>I()),onClick:Ce=>B(Qe)},[D(Y,{fill:"",color:"default",size:"xs"}),A.value?(M(),J($,{key:0,"model-value":x(Qe),disabled:Qe.status!=="C"},null,8,["model-value","disabled"])):(M(),J(fe,{key:1,"model-value":x(Qe),disabled:Qe.status!=="C"},null,8,["model-value","disabled"])),D(z,{class:le({"bimdata-multi-model-loader__main__model__name":!0,"bimdata-multi-model-loader__main__model__name--disabled":Qe.status!=="C"}),text:Qe.name,width:T(Qe)?"333px":"363px"},null,8,["class","text","width"]),T(Qe)?(M(),J(Me,{key:2,name:"versioning",fill:"",color:"default",size:"xs",margin:"0 0 0 6px"})):ie("",!0),g(Qe.id)?(M(),J(U,{key:3,class:"bimdata-multi-model-loader__main__model__spinner"})):(M(),J(Me,{key:4,name:E(Qe.status),size:"xs",class:le({"fill-success":Qe.status==="C","fill-high":Qe.status==="E"})},null,8,["name","class"]))],42,r6i)]),_:1},8,["list"]),D(W,{class:"bimdata-multi-model-loader__main__validate",width:"93px",color:"primary",fill:"",radius:"",disabled:at(y).size===0&&at(v).size===0,onClick:P},{default:N(()=>[We(q(R.$t("global.validate")),1)]),_:1},8,["disabled"])])),[[qe,()=>c.value=!0]])]),_:3})],2)}}},a6i=j(n6i,[["__scopeId","data-v-44e6af66"]]),s6i={data(){return{shown:!1}},mounted(){setTimeout(()=>{this.shown=!0},500)}};function l6i(t,e,i,o,n,r){const a=S("BIMDataIllustration");return M(),_("div",{class:"bimdata__no-model",style:ce({"--no-model--opacity":n.shown?1:0})},[D(a,{name:"emptyViewer",x:"90",y:"90"}),b("span",null,q(t.$t("model.select_model")),1)],4)}const sfe=j(s6i,[["render",l6i],["__scopeId","data-v-5ffd9bc0"]]);window.BIMDataViewerVue=Zj;class c6i{constructor(e={}){const{api:i={},ui:o}=e;this.uiCfg=o,i.apiUrl||(console.info("[BIMData Viewer] INFO - Viewer config - `apiUrl` not set, use 'https://api.bimdata.io' by default."),i.apiUrl="https://api.bimdata.io"),i.archiveUrl||(console.info("[BIMData Viewer] INFO - Viewer config - `archiveUrl` not set, use 'https://archive.bimdata.io' by default."),i.archiveUrl="https://archive.bimdata.io"),i.pdfBackendUrl||(console.info("[BIMData Viewer] INFO - Viewer config - `pdfBackendUrl` not set, use 'https://pdf-backend.bimdata.io' by default."),i.pdfBackendUrl="https://pdf-backend.bimdata.io"),i.ifcIds&&(console.warn("[BIMData Viewer] DEPRECATED - Viewer config - please use the `modelIds` property instead of `ifcIds`."),i.modelIds===void 0&&(i.modelIds=i.ifcIds)),i.modelIds||(i.modelIds=[]),i.offline?.dataFile&&(i.offline.data=i.offline.dataFile),this.$viewer=new g4i(e),i.offline?.enabled?this.$viewer.api.enableOfflineMode(i.offline.data,i.offline.options).then(()=>this.state.loadModels(i.modelIds)):(this.$viewer.globalContext.loadingProcessStart(),this.state.loadModels(i.modelIds).finally(()=>this.$viewer.globalContext.loadingProcessEnd())),this.vueApp=null}get state(){return this.$viewer.state}get api(){return this.$viewer.api}async mount(e,i="3d"){const{$viewer:o}=this;await o.api.ready;try{const d=await o.api.apiClient.collaborationApi.checkProjectAccess(o.api.cloudId,o.api.projectId);o.api.permissions=nfe(d)}catch{o.api.permissions=nfe()}const n=this.api.accessToken,{i18n:r}=o;r.registerTranslations(o.pluginManager.pluginTranslations),o.layout.apply(i);const a={i18n:r.i18nVuePlugin,data(){return{accessToken:n}},render(){return Qo(F5i,{style:"height: 100%"})}},s=Mm(a).use(r.i18nVuePlugin).use(o5i()).use(e5i({i18nPlugin:r.i18nVuePlugin})).use(T4i({apiClient:o.api.apiClient,i18nPlugin:r.i18nVuePlugin}));s.provide("$viewer",o),s.provide("BIMDATA_DESIGN_SYSTEM_DARK_THEME",Oe(()=>o.darkTheme)),s.component("BIMDataModelLoader",afe),s.component("BIMDataMultiModelLoader",a6i),s.component("BIMDataNoModelWindowPlaceHolder",sfe),s.component("BIMDataStoreySelector",wE),s.component("ModelsLoader",afe),s.component("NoModelWindowPlaceHolder",sfe);const l=e instanceof HTMLElement?e:document.querySelector(e);l&&(l.style.height="100%");const c=s.mount(e);return c.$viewer=o,m4i(c.$el,this.uiCfg?.style),typeof window<"u"&&(window.bimdataViewer=c),this.vueApp=s,c}destroy(){this.vueApp?.unmount()}setLocale(e){if(!uH.includes(e))throw new Error(`Viewer available locales are ${uH.join(", ")}.`);this.$viewer.i18n.locale=e}registerPlugin(e){this.$viewer.registerPlugin(e)}registerWindow(e){return this.$viewer.windowManager.registerWindow(e)}unregisterWindow(e){return this.$viewer.windowManager.unregisterWindow(e)}setAccessToken(e){this.api.accessToken=e}async loadModels(e){this.$viewer.globalContext.loadingProcessStart();const i=await this.state.loadModels(e);return this.$viewer.globalContext.loadingProcessEnd(),i}loadIfcs(e){return console.warn("[BIMData Viewer] DEPRECATED - Viewer - please use the loadModels method instead of loadIfcs."),this.loadModels(e)}}const lfe=(t={})=>new c6i(t);window.makeBIMDataViewer=lfe;export{lfe as default};