@bimdata/viewer 2.8.0-beta.3 → 2.8.0-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -5469,7 +5469,7 @@ void main() {
|
|
|
5469
5469
|
`,Uv=class{constructor(t){this.viewer=t,this.config=t.config,this.state=t.state}destroy(){}},sa=new st,v9=new $a(0,0,0,"ZXY"),Noi=class extends Uv{constructor(t){super(t)}fovToZoomLevel(t){const e=Math.round((t-this.config.minFov)/(this.config.maxFov-this.config.minFov)*100);return Zi.clamp(e-2*(e-50),0,100)}zoomLevelToFov(t){return this.config.maxFov+t/100*(this.config.minFov-this.config.maxFov)}vFovToHFov(t){return Zi.radToDeg(2*Math.atan(Math.tan(Zi.degToRad(t)/2)*this.state.aspect))}hFovToVFov(t){return Zi.radToDeg(2*Math.atan(Math.tan(Zi.degToRad(t)/2)/this.state.aspect))}getAnimationProperties(t,e,i){const r=!vo(e),n=!vo(i),o={};let s=null;if(r){const a=this.viewer.getPosition(),l=Ioe(a.yaw,e.yaw);o.yaw={start:a.yaw,end:a.yaw+l},o.pitch={start:a.pitch,end:e.pitch},s=wI(t,Soe(a,e))}if(n){const a=this.viewer.getZoomLevel(),l=Math.abs(i-a);o.zoom={start:a,end:i},s===null&&(s=wI(t,Math.PI/4*l/100))}return s===null?typeof t=="number"?s=t:s=pI:s=Math.max(pI,s),{duration:s,properties:o}}getTransitionOptions(t){let e;const i=this.config.defaultTransition??x2.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){var e;if(!((e=this.state.textureData)!=null&&e.panoData))throw new Gi("Current adapter does not support texture coordinates or no texture has been loaded");const i=this.viewer.adapter.textureCoordsToSphericalCoords(t,this.state.textureData.panoData);return!v9.equals(this.viewer.renderer.panoramaPose)||!v9.equals(this.viewer.renderer.sphereCorrection)?(this.sphericalCoordsToVector3(i,sa),sa.applyEuler(this.viewer.renderer.panoramaPose),sa.applyEuler(this.viewer.renderer.sphereCorrection),this.vector3ToSphericalCoords(sa)):i}sphericalCoordsToTextureCoords(t){var e;if(!((e=this.state.textureData)!=null&&e.panoData))throw new Gi("Current adapter does not support texture coordinates or no texture has been loaded");return(!v9.equals(this.viewer.renderer.panoramaPose)||!v9.equals(this.viewer.renderer.sphereCorrection))&&(this.sphericalCoordsToVector3(t,sa),xI(sa,this.viewer.renderer.sphereCorrection),xI(sa,this.viewer.renderer.panoramaPose),t=this.vector3ToSphericalCoords(sa)),this.viewer.adapter.sphericalCoordsToTextureCoords(t,this.state.textureData.panoData)}sphericalCoordsToVector3(t,e,i=Yu){return e||(e=new st),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[Pd]);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,sa),this.vector3ToViewerCoords(sa)}isPointVisible(t){let e,i;if(t instanceof st)e=t,i=this.vector3ToViewerCoords(t);else if(yI(t))e=this.sphericalCoordsToVector3(t,sa),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 Gi("Position is missing 'yaw' or 'pitch'");return{yaw:Qa(t.yaw),pitch:Qa(t.pitch,!0)}}else return this.textureCoordsToSphericalCoords(t)}cleanSphereCorrection(t){return{pan:Qa(t?.pan||0),tilt:Qa(t?.tilt||0,!0),roll:Qa(t?.roll||0,!0,!1)}}cleanPanoramaPose(t){return{pan:Zi.degToRad(t?.poseHeading||0),tilt:Zi.degToRad(t?.posePitch||0),roll:Zi.degToRad(t?.poseRoll||0)}}cleanPanoramaOptions(t,e){return e!=null&&e.isEquirectangular&&(vo(t.zoom)&&!vo(e.initialFov)&&(t={...t,zoom:this.fovToZoomLevel(this.hFovToVFov(e.initialFov))}),vo(t.position)&&!vo(e.initialHeading)&&!vo(e.initialPitch)&&(t={...t,position:{yaw:Qa(e.initialHeading),pitch:Qa(e.initialPitch,!0)}})),t}},joi=`<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>
|
|
5470
5470
|
`,Voi=`<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>
|
|
5471
5471
|
`,y9=class vue{constructor(){this.$=vue.IDLE}is(...e){return e.some(i=>this.$&i)}set(e){this.$=e}add(e){this.$|=e}remove(e){this.$&=~e}};y9.IDLE=0,y9.CLICK=1,y9.MOVING=2;var Yr=y9,zoi=class extends Uv{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 Yr,this.keyHandler=new f9,this.resizeObserver=new ResizeObserver(Uoe(()=>this.viewer.autoSize(),50)),this.moveThreshold=woe*hn.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(Mv.type,this),this.viewer.addEventListener(Rv.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(Mv.type,this),this.viewer.removeEventListener(Rv.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 Mv.type:this.__applyMoveDelta();break;case Rv.type:this.__clearMoveDelta();break}if(!Roe(t,"."+Cv))switch(t.type){case"mousedown":this.__onMouseDown(t);break;case"touchstart":this.__onTouchStart(t);break;case"wheel":this.__onMouseWheel(t);break}}__onKeyDown(t){var e;if(this.config.mousewheelCtrlKey&&(this.data.ctrlKeyDown=t.key===go.Control,this.data.ctrlKeyDown&&(clearTimeout(this.data.ctrlZoomTimeout),this.viewer.overlay.hide(Ro.CTRL_ZOOM))),!this.viewer.dispatchEvent(new Bd(t.key,t))||!this.state.keyboardEnabled)return;const i=(e=this.config.keyboardActions)==null?void 0:e[t.key];if(typeof i=="function"){i(this.viewer,t),t.preventDefault();return}if(!(t.ctrlKey||t.altKey||t.shiftKey||t.metaKey)&&i&&!this.keyHandler.pending){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()}}__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(Yr.CLICK),this.data.startMouseX=t.clientX,this.data.startMouseY=t.clientY}__onMouseUp(t){this.step.is(Yr.CLICK,Yr.MOVING)&&this.__stopMove(t.clientX,t.clientY,t,t.button===2)}__onMouseMove(t){this.config.mousemove&&this.step.is(Yr.CLICK,Yr.MOVING)&&(t.preventDefault(),this.__doMove(t.clientX,t.clientY)),this.__handleObjectsEvents(t)}__onTouchStart(t){t.touches.length===1?(this.step.add(Yr.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},xoe))):t.touches.length===2&&(this.step.set(Yr.IDLE),this.__cancelLongTouch(),this.config.mousemove&&(this.__cancelTwoFingersOverlay(),this.__startMoveZoom(t),t.preventDefault()))}__onTouchEnd(t){if(this.__cancelLongTouch(),this.step.is(Yr.CLICK,Yr.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(Yr.CLICK)&&!this.data.twofingersTimeout&&(this.data.twofingersTimeout=setTimeout(()=>{this.viewer.overlay.show({id:Ro.TWO_FINGERS,image:joi,title:this.config.lang.twoFingers})},koe));else if(this.step.is(Yr.CLICK,Yr.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(Ro.TWO_FINGERS))}__onMouseWheel(t){if(!this.config.mousewheel||!t.deltaY)return;if(this.config.mousewheelCtrlKey&&!this.data.ctrlKeyDown){this.viewer.overlay.show({id:Ro.CTRL_ZOOM,image:Voi,title:this.config.lang.ctrlZoom}),clearTimeout(this.data.ctrlZoomTimeout),this.data.ctrlZoomTimeout=setTimeout(()=>this.viewer.overlay.hide(Ro.CTRL_ZOOM),Moe);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 Pv(t))}__resetMove(){this.step.set(Yr.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=AI(t);this.step.set(Yr.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,r=!1){this.step.is(Yr.CLICK)&&!this.__moveThresholdReached(t,e)&&this.__doClick(t,e,i,r),this.config.moveInertia&&(this.data.accumulatorFactor=Math.pow(this.config.moveInertia,.5)),this.__resetMove(),this.viewer.resetIdleTimer()}__doClick(t,e,i,r=!1){const n=this.viewer.container.getBoundingClientRect(),o=t-n.left,s=e-n.top,a=this.viewer.renderer.getIntersections({x:o,y:s}),l=a.find(c=>c.object.userData[Pd]);if(l){const c=this.viewer.dataHelper.vector3ToSphericalCoords(l.point),d={rightclick:r,originalEvent:i,target:s9(i),clientX:t,clientY:e,viewerX:o,viewerY:s,yaw:c.yaw,pitch:c.pitch,objects:a.map(u=>u.object).filter(u=>!u.userData[Pd])};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 dne(this.data.dblclickData)),clearTimeout(this.data.dblclickTimeout),this.data.dblclickTimeout=null,this.data.dblclickData=null):(this.viewer.dispatchEvent(new ane(d)),this.data.dblclickData=l9(d),this.data.dblclickTimeout=setTimeout(()=>{this.data.dblclickTimeout=null,this.data.dblclickData=null},Coe))}}__handleObjectsEvents(t){if(!joe(this.state.objectsObservers)&&t.composedPath().includes(this.viewer.container)){const e=Loe(this.viewer.container),i={x:t.clientX-e.x,y:t.clientY-e.y},r=this.viewer.renderer.getIntersections(i),n=(o,s,a)=>{this.viewer.dispatchEvent(new a(t,o,i,s))};for(const[o,s]of Object.entries(this.state.objectsObservers)){const a=r.find(l=>l.object.userData[o]);a?(s&&a.object!==s&&(n(s,o,PI),this.state.objectsObservers[o]=null),s?n(a.object,o,Qne):(this.state.objectsObservers[o]=a.object,n(a.object,o,Hne))):s&&(n(s,o,PI),this.state.objectsObservers[o]=null)}}}__doMove(t,e){if(this.step.is(Yr.CLICK)&&this.__moveThresholdReached(t,e))this.viewer.stopAll(),this.__resetMove(),this.step.set(Yr.MOVING),this.data.mouseX=t,this.data.mouseY=e,this.data.accumulatorFactor=this.config.moveInertia;else if(this.step.is(Yr.MOVING)){const i=(t-this.data.mouseX)*Math.cos(this.state.roll)-(e-this.data.mouseY)*Math.sin(this.state.roll),r=(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)*Zi.degToRad(this.state.hFov),pitch:this.config.moveSpeed*(r/this.state.size.height)*Zi.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(Yr.MOVING)){t.preventDefault();const e=AI(t);this.__doMove(e.center.x,e.center.y),this.data.moveDelta.zoom+=this.config.zoomSpeed*((e.distance-this.data.pinchDist)/hn.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}};Ti.enabled=!1;var b9=new nr,nse=new _r,sse=new n2,Hoi=class extends Uv{constructor(t){super(t),this.frustumNeedsUpdate=!0,this.renderer=new Yri(this.config.rendererParameters),this.renderer.setPixelRatio(hn.pixelRatio),this.renderer.outputColorSpace=zu,this.renderer.toneMapping=Xie,this.renderer.domElement.className="psv-canvas",this.renderer.domElement.style.background=this.config.canvasBackground,this.scene=new Vre,this.camera=new Ss(50,16/9,.1,2*Yu),this.camera.matrixAutoUpdate=!1;const e=new Is(new n3(Yu).scale(-1,1,1),new yv({opacity:0,transparent:!0,depthTest:!1,depthWrite:!1}));e.userData={[Pd]:!0},this.scene.add(e),this.raycaster=new m$t,this.frustum=new eI,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(Dv.type,this),this.viewer.addEventListener(nc.type,this),this.viewer.addEventListener(Bv.type,this),this.viewer.addEventListener(Iv.type,this),this.viewer.addEventListener(On.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(Dv.type,this),this.viewer.removeEventListener(nc.type,this),this.viewer.removeEventListener(Bv.type,this),this.viewer.removeEventListener(Iv.type,this),this.viewer.removeEventListener(On.type,this),super.destroy()}handleEvent(t){switch(t.type){case Dv.type:this.__onSizeUpdated();break;case nc.type:this.__onZoomUpdated();break;case Bv.type:this.__onPositionUpdated();break;case Iv.type:this.__onPositionUpdated();break;case On.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 Mv(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 Dne))}setTexture(t){this.meshContainer||(this.meshContainer=new v2,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 r=i.effect==="fade"||i.rotation,n=!vo(e.position),o=!vo(e.zoom),s=new MI(n?this.viewer.dataHelper.cleanPosition(e.position):void 0,e.zoom);this.viewer.dispatchEvent(s);const a=new v2,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,a),n&&!i.rotation){const h=this.viewer.getPosition(),f=new st(0,1,0);a.rotateOnWorldAxis(f,s.position.yaw-h.yaw);const A=new st(0,1,0).cross(this.camera.getWorldDirection(new st)).normalize();a.rotateOnWorldAxis(A,s.position.pitch-h.pitch)}a.add(l),this.scene.add(a),this.renderer.setRenderTarget(new vd),this.renderer.render(this.scene,this.camera),this.renderer.setRenderTarget(null);const{duration:c,properties:d}=this.viewer.dataHelper.getAnimationProperties(i.speed,i.rotation?s.position:null,r?s.zoomLevel:null),u=new p9({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"?Zi.mapLinear(h.opacity,0,.5,1,0):Zi.mapLinear(h.opacity,0,.5,1,4):(this.renderer.toneMappingExposure=i.effect==="black"?Zi.mapLinear(h.opacity,.5,1,0,1):Zi.mapLinear(h.opacity,.5,1,4,1),this.mesh.visible=!1,this.viewer.adapter.setTextureOpacity(l,1),o&&!r&&this.viewer.dynamics.zoom.setValue(s.zoomLevel));break}n&&i.rotation&&this.viewer.dynamics.position.setValue({yaw:h.yaw,pitch:h.pitch}),o&&r&&this.viewer.dynamics.zoom.setValue(h.zoom),this.viewer.needsUpdate()}});return u.then(h=>{a.remove(l),this.scene.remove(a),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){var e;b9.x=2*t.x/this.state.size.width-1,b9.y=-2*t.y/this.state.size.height+1,this.raycaster.setFromCamera(b9,this.camera);const i=this.raycaster.intersectObjects(this.scene.children,!0).filter(r=>r.object.visible).filter(r=>r.object.isMesh&&!!r.object.userData);return(e=this.customRenderer)!=null&&e.getIntersections&&i.push(...this.customRenderer.getIntersections(this.raycaster,b9)),i}isObjectVisible(t){if(!t)return!1;if(this.frustumNeedsUpdate&&(nse.multiplyMatrices(this.camera.projectionMatrix,this.camera.matrixWorldInverse),this.frustum.setFromProjectionMatrix(nse),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(),sse.copy(e.geometry.boundingBox).applyMatrix4(e.matrixWorld),this.frustum.intersectsBox(sse)}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=>{var r;(r=i.map)==null||r.dispose(),i.uniforms&&Object.values(i.uniforms).forEach(n=>{var o,s;(s=(o=n.value)==null?void 0:o.dispose)==null||s.call(o)}),i.dispose()};t.traverse(i=>{var r,n;(r=i.geometry)==null||r.dispose(),i.material&&(Array.isArray(i.material)?i.material.forEach(o=>{e(o)}):e(i.material)),i instanceof Vre||(n=i.dispose)==null||n.call(i),i!==t&&this.cleanScene(i)})}},qoi=class extends iI{load(t,e,i,r,n){const o=new Request(t,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"});fetch(o,{signal:n}).then(s=>{if(s.status===200||s.status===0){const a=s.body.getReader(),l=s.headers.get("Content-Length")||s.headers.get("X-File-Size"),c=l?parseInt(l):0,d=c!==0;let u=0;const h=new ReadableStream({start(f){A();function A(){a.read().then(({done:p,value:g})=>{if(p)f.close();else{u+=g.byteLength;const m=new ProgressEvent("progress",{lengthComputable:d,loaded:u,total:c});i(m),f.enqueue(g),A()}}).catch(p=>{r(p)})}}});return new Response(h)}else throw new Error(`fetch for "${s.url}" responded with ${s.status}: ${s.statusText}`)}).then(s=>s.blob()).then(s=>{e(s)}).catch(s=>{r(s)})}},Goi=class extends iI{load(t,e,i,r){const n=document.createElement("img");function o(){l(),e(this)}function s(c){if(l(),r!=null&&r.aborted){const d=new Error;d.name="AbortError",d.message="The operation was aborted.",i(d)}else i(c)}function a(){n.src=""}function l(){n.removeEventListener("load",o,!1),n.removeEventListener("error",s,!1),r?.removeEventListener("abort",a,!1)}return n.addEventListener("load",o,!1),n.addEventListener("error",s,!1),r?.addEventListener("abort",a,!1),!t.startsWith("data:")&&this.crossOrigin!==void 0&&(n.crossOrigin=this.crossOrigin),n.src=t,n}},Qoi=class extends Uv{constructor(t){super(t),this.abortCtrl={},this.fileLoader=new qoi,this.imageLoader=new Goi,this.config.withCredentials&&(this.fileLoader.setWithCredentials(!0),this.imageLoader.setCrossOrigin("use-credentials"))}destroy(){this.abortLoading(),super.destroy()}abortLoading(){Object.values(this.abortCtrl).forEach(t=>t.abort()),this.abortCtrl={}}loadFile(t,e,i){const r=M2.get(t,i);if(r){if(r instanceof Blob)return e?.(100),Promise.resolve(r);M2.remove(t,i)}return this.config.requestHeaders&&this.fileLoader.setRequestHeader(this.config.requestHeaders(t)),new Promise((n,o)=>{let s=0;e?.(s),this.fileLoader.load(t,a=>{s=100,e?.(s),M2.add(t,i,a),n(a)},a=>{if(a.lengthComputable){const l=a.loaded/a.total*100;l>s&&(s=l,e?.(s))}},a=>{o(a)},this.__getAbortSignal(i))})}loadImage(t,e,i){const r=M2.get(t,i);return r?(e?.(100),r instanceof Blob?this.blobToImage(r):Promise.resolve(r)):!e&&!this.config.requestHeaders?new Promise((n,o)=>{this.imageLoader.load(t,s=>{M2.add(t,i,s),n(s)},s=>{o(s)},this.__getAbortSignal(i))}):this.loadFile(t,e,i).then(n=>this.blobToImage(n))}blobToImage(t){return new Promise((e,i)=>{const r=document.createElement("img");r.onload=()=>{URL.revokeObjectURL(r.src),e(r)},r.onerror=i,r.src=URL.createObjectURL(t)})}preloadPanorama(t){return this.viewer.adapter.supportsPreload(t)?this.viewer.adapter.loadTexture(t,!1):Promise.reject(new Gi("Current adapter does not support preload"))}__getAbortSignal(t){var e;return t?((e=this.abortCtrl[t])!=null&&e.signal.aborted&&delete this.abortCtrl[t],this.abortCtrl[t]||(this.abortCtrl[t]=new AbortController),this.abortCtrl[t].signal):null}},Koi=class extends Uv{constructor(t){super(t),this.zoom=new kv(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 nc(e))},{defaultValue:this.viewer.config.defaultZoomLvl,min:0,max:100,wrap:!1}),this.position=new Yoe(e=>{this.viewer.dataHelper.sphericalCoordsToVector3(e,this.viewer.state.direction),this.viewer.dispatchEvent(new Bv(e))},{yaw:new kv(null,{defaultValue:this.config.defaultYaw,min:0,max:2*Math.PI,wrap:!0}),pitch:new kv(null,{defaultValue:this.config.defaultPitch,min:-Math.PI/2,max:Math.PI/2,wrap:!1})}),this.roll=new kv(e=>{this.viewer.state.roll=e,this.viewer.dispatchEvent(new Iv(e))},{defaultValue:0,min:-Math.PI,max:Math.PI,wrap:!1}),this.updateSpeeds()}updateSpeeds(){this.zoom.setSpeed(this.config.zoomSpeed*50),this.position.setSpeed(Zi.degToRad(this.config.moveSpeed*50)),this.roll.setSpeed(Zi.degToRad(this.config.moveSpeed*50))}update(t){this.zoom.update(t),this.position.update(t),this.roll.update(t)}},Zoi=class{constructor(){this.ready=!1,this.needsUpdate=!1,this.continuousUpdateCount=0,this.keyboardEnabled=!1,this.direction=new st(0,0,Yu),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}}},Woi=class extends tne{constructor(t){var e,i,r;if(super(),this.plugins={},this.children=[],this.parent=Toe(t.container),!this.parent)throw new Gi('"container" element not found.');this.parent[Pd]=this,this.container=document.createElement("div"),this.container.classList.add("psv-container"),this.parent.appendChild(this.container),Joe(this.parent),Woe(this.container,"core"),this.state=new Zoi,this.config=Ioi(t),this.__setSize(this.config.size),this.overlay=new Loi(this);try{hn.load()}catch(n){console.error(n),this.showError(this.config.lang.webglError);return}M2.init(),this.adapter=new this.config.adapter[0](this,this.config.adapter[1]),this.renderer=new Hoi(this),this.textureLoader=new Qoi(this),this.eventsHandler=new zoi(this),this.dataHelper=new Noi(this),this.dynamics=new Koi(this),(i=(e=this.adapter).init)==null||i.call(e),this.loader=new Doi(this),this.navbar=new Toi(this),this.panel=new _oi(this),this.notification=new Roi(this),this.autoSize(),this.setCursor(null),gI(hn.isTouchEnabled,n=>{n9(this.container,"psv--is-touch",n)}),this.config.plugins.forEach(([n,o])=>{this.plugins[n.id]=new n(this,o)});for(const n of Object.values(this.plugins))(r=n.init)==null||r.call(n);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(){var t,e,i,r,n,o;this.stopAll(),this.stopKeyboardControl(),this.exitFullscreen();for(const[s,a]of Object.entries(this.plugins))a.destroy(),delete this.plugins[s];this.children.slice().forEach(s=>s.destroy()),this.children.length=0,(t=this.eventsHandler)==null||t.destroy(),(e=this.renderer)==null||e.destroy(),(i=this.textureLoader)==null||i.destroy(),(r=this.dataHelper)==null||r.destroy(),(n=this.adapter)==null||n.destroy(),(o=this.dynamics)==null||o.destroy(),this.parent.removeChild(this.container),delete this.parent[Pd]}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 Sv)}resetIdleTimer(){this.state.idleTime=performance.now()}disableIdleTimer(){this.state.idleTime=-1}getPlugin(t){if(typeof t=="string")return this.plugins[t];{const e=SI(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 Foe(this.parent,hn.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 Dv(this.getSize())),this.navbar.autoSize())}setPanorama(t,e={}){var i;this.textureLoader.abortLoading(),(i=this.state.transitionAnimation)==null||i.cancel();const r=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;const n=s=>{if(Hoe(s))return!1;if(this.loader.hide(),this.state.loadingPromise=null,s)throw this.navbar.setCaption(null),this.showError(this.config.lang.loadError),console.error(s),this.dispatchEvent(new Mne(t,s)),s;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 Cne(t));const o=this.adapter.loadTexture(this.config.panorama,!0,e.panoData).then(s=>{if(s.panorama!==this.config.panorama)throw this.adapter.disposeTexture(s),vI();const a=this.dataHelper.cleanPanoramaOptions(e,s.panoData);return(!vo(a.zoom)||!vo(a.position))&&this.stopAll(),{textureData:s,cleanOptions:a}});return!r||!this.state.ready||!this.adapter.supportsTransition(this.config.panorama)?this.state.loadingPromise=o.then(({textureData:s,cleanOptions:a})=>{this.renderer.show(),this.renderer.setTexture(s),this.renderer.setPanoramaPose(s.panoData),this.renderer.setSphereCorrection(e.sphereCorrection),this.state.ready||this.init(),this.dispatchEvent(new C2(s)),vo(a.zoom)||this.zoom(a.zoom),vo(a.position)||this.rotate(a.position)}).then(()=>n(),s=>n(s)):this.state.loadingPromise=o.then(({textureData:s,cleanOptions:a})=>(this.loader.hide(),this.dispatchEvent(new C2(s)),this.state.transitionAnimation=this.renderer.transition(s,a,r),this.state.transitionAnimation)).then(s=>{if(this.state.transitionAnimation=null,this.dispatchEvent(new Ene(s)),!s)throw vI()}).then(()=>n(),s=>n(s)),this.state.loadingPromise}setOptions(t){const e={...this.config,...t};for(let[i,r]of Object.entries(t)){if(!(i in x2)){yo(`Unknown option ${i}`);continue}if(i in ose){yo(ose[i]);continue}switch(i in TI&&(r=TI[i](r,{rawConfig:e,defValue:x2[i]})),this.config[i]=r,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 nc(this.getZoomLevel()));break;case"keyboard":this.config.keyboard==="always"?this.startKeyboardControl():this.stopKeyboardControl();break}}this.needsUpdate(),this.dispatchEvent(new On(Object.keys(t)))}setOption(t,e){this.setOptions({[t]:e})}showError(t){this.overlay.show({id:Ro.ERROR,image:Uoi,title:t,dismissible:!1})}hideError(){this.overlay.hide(Ro.ERROR)}rotate(t){const e=new nne(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=yI(t),i=!vo(t.zoom),r=new MI(e?this.dataHelper.cleanPosition(t):void 0,t.zoom);if(this.dispatchEvent(r),r.defaultPrevented)return;this.stopAll();const{duration:n,properties:o}=this.dataHelper.getAnimationProperties(t.speed,r.position,r.zoomLevel);return n?(this.state.animation=new p9({properties:o,duration:n,easing:t.easing||"inOutSine",onTick:s=>{e&&this.dynamics.position.setValue({yaw:s.yaw,pitch:s.pitch}),i&&this.dynamics.zoom.setValue(s.zoom)}}),this.state.animation.then(()=>{this.state.animation=null,this.resetIdleTimer()}),this.state.animation):(e&&this.rotate(r.position),i&&this.zoom(r.zoomLevel),new p9(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!=null&&t[e]&&(/^[0-9.]+$/.test(t[e])&&(t[e]+="px"),this.parent.style[e]=t[e])})}enterFullscreen(){this.isFullscreenEnabled()||_oe(this.parent,hn.isIphone)}exitFullscreen(){this.isFullscreenEnabled()&&Ooe(hn.isIphone)}toggleFullscreen(){this.isFullscreenEnabled()?this.exitFullscreen():this.enterFullscreen()}startKeyboardControl(){this.state.keyboardEnabled=!0}stopKeyboardControl(){this.state.keyboardEnabled=!1}createTooltip(t){return new Ooi(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 Rv),this.disableIdleTimer(),this.stopAnimation()}};const Joi={class:"annotations-photosphere"},Xoi={__name:"AnnotationsPhotosphere",setup(t){const e=mt("$viewer"),{localContext:i}=e,r=i.viewer,n=r.viewer,o=n.renderer.renderer.domElement,s=Ik(),a=et(()=>s.value.filter(d=>!r.selectedStorey||d.z>=r.selectedStorey.absoluteElevation&&d.z<r.selectedStorey.absoluteTopElevation));n.addEventListener("render",()=>em(a));const l=(d,u)=>{const{x:h,y:f}=o.getBoundingClientRect(),{clientX:A,clientY:p}=u,g=n.dataHelper.viewerCoordsToSphericalCoords({x:A-h,y:p-f}),{textureX:m,textureY:w}=n.dataHelper.sphericalCoordsToTextureCoords(g);d.x=m,d.y=w},c=d=>{const u=n.dataHelper.textureCoordsToSphericalCoords({textureX:d.x,textureY:d.y}),h=n.dataHelper.sphericalCoordsToVector3(u),f=n.dataHelper.sphericalCoordsToViewerCoords(u),{width:A,height:p}=n.state.size;if(!(h.dot(n.state.direction)>0&&f.x>=0&&f.x<=A&&f.y>=0&&f.y<=p))return"display: none;";const{x:g,y:m}=f;return`left: ${g}px; top: ${m}px;`};return(d,u)=>(M(),_("div",Joi,[(M(!0),_(ct,null,Bt(a.value,h=>(M(),Z(Sk,{annotation:h,canvas:wt(o),style:se(c(h)),onAnnotationDrag:f=>l(h,f)},null,8,["annotation","canvas","style","onAnnotationDrag"]))),256))]))}},Yoi=z(Xoi,[["__scopeId","data-v-fd653bd2"]]),$oi={name:"ViewerPhotosphere",components:{Annotations:Yoi},data(){var t;const{settings:e}=this.$plugin;return{settings:e,model:null,photosphere:null,selectedStorey:null,loading:!1,modelHeaderShown:((t=this.$options.$cfg)==null?void 0:t.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 Woi({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(){var t;(t=this.viewer)==null||t.destroy(),this.localContextSubscriptions.forEach(e=>this.$viewer.localContext.hub.off(e))},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})=>{var i;e&&(this.photosphere=(i=e.plans[0])==null?void 0:i.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(){var t;[...this.$viewer.localContext.plugins.entries()].forEach(([,e])=>e.$show()),this.modelHeaderShown=((t=this.$options.$cfg)==null?void 0:t.modelLoader)!=="hidden"},async getSnapshot(){return{snapshot_type:"png",snapshot_data:this.viewer.renderer.renderer.domElement.toDataURL()}},async getViewpoint(){var t;const e=this.viewer.renderer.camera,i=this.viewer.getPosition(),{textureX:r,textureY:n}=this.viewer.dataHelper.sphericalCoordsToTextureCoords(i);return{order:6,originating_system:"photosphere",authoring_tool_id:this.photosphere?String(this.photosphere.id):void 0,models:this.$viewer.localContext.loadedModels.map(o=>o.id),perspective_camera:{camera_direction:{x:r,y:n,z:0},camera_up_vector:{x:0,y:0,z:0},camera_view_point:{x:0,y:0,z:((t=this.selectedStorey)==null?void 0:t.absoluteElevation)??0},field_of_view:e.fov}}},async setViewpoint(t){var e,i,r,n,o;const s=this.$viewer.state.getStoreyFromAbsoluteElevation(this.$viewer.localContext.loadedModels[0],(e=t?.perspective_camera)==null?void 0:e.camera_view_point.z);if(s&&s.uuid!==((i=this.selectedStorey)==null?void 0:i.uuid)){this.$viewer.localContext.selectStorey(s),await new Promise(h=>this.viewer.addEventListener("panorama-loaded",h,{once:!0}));const u=(r=s.plans.find(h=>h.plan.id===+t.authoring_tool_id))==null?void 0:r.plan;u&&(this.photosphere=u,await this.viewer.setPanorama(u.document.file,{transition:!1}))}const{x:a,y:l}=((n=t?.perspective_camera)==null?void 0:n.camera_direction)??{x:0,y:0};this.viewer.rotate({textureX:a,textureY:l});const c=(o=t?.perspective_camera)==null?void 0:o.field_of_view,d=this.viewer.dataHelper.fovToZoomLevel(c);d&&this.viewer.zoom(d)},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)}}},eni=$oi,tni={class:"bimdata-viewer-photosphere"},ini={ref:"canvas",class:"bimdata-viewer-photosphere__viewer__canvas"};function rni(t,e,i,r,n,o){const s=S("NoModelWindowPlaceHolder"),a=S("Annotations"),l=S("ModelsLoader");return M(),_("div",tni,[C("div",ini,null,512),!t.model&&!t.loading?(M(),Z(s,{key:0})):re("",!0),t.photoSphereViewerCreated?(M(),Z(a,{key:1})):re("",!0),t.settings.modelLoader!=="disabled"?At((M(),Z(l,{key:2,ref:"header",multi:!1},null,512)),[[Ht,t.modelHeaderShown]]):re("",!0)])}const oni=z(eni,[["render",rni],["__scopeId","data-v-6d247701"]]),nni="Photosphere Viewer",sni={window_label:nni},ani="Visionneuse Photosph\xE8re",lni={window_label:ani},cni={name:"photosphere",isViewer:!0,i18n:{en:sni,fr:lni},component:oni,window:{name:"photosphere",label:"photosphere.window_label",header:!1,plugins:["fullscreen"],icon:{imgUri:pW},modelTypes:["PHOTOSPHERE","PHOTOSPHERE_BUILDING"],multiModel:!1}},dni={setup(){const t=mt("$viewer"),e=mt("$plugin"),{apiClient:i,cloudId:r,projectId:n}=t.api,o=et(()=>t.localContext.loadedModels[0]),s=et(()=>t.localContext.selectedStorey),a=et(()=>t.localContext.viewer.photosphere),l=et(()=>{var u;return(u=s.value)==null?void 0:u.plans.find(h=>{var f;return h.plan.id===((f=a.value)==null?void 0:f.id)})});bt([o,()=>e.shown],([{type:u}={}])=>{u==="PHOTOSPHERE_BUILDING"?e.show():e.hide()},{immediate:!0});const c=u=>{o.value&&t.localContext.selectStorey(o.value.storeys.find(h=>h.uuid===u.uuid))},d=u=>{if(!u)return;const{viewer:h}=t.localContext,f=h.viewer;h.photosphere=u.plan,f.setPanorama(u.plan.document.file,{transition:!1})};return()=>Zr(Eie,{apiClient:i,space:{id:r},project:{id:n},model:o.value,storey:s.value,plan:l.value,selectable:!0,onStoreySelected:c,onPlanSelected:d})}},uni={name:"photosphereBuilding",component:dni,addToWindows:["photosphere"],sidePanel:{position:"right",width:400}};function hni(t={}){const e=[],i=[QJt,TIt,vSt,Plt,O$e,eot,yut,STt,lZe,Cot,Bat,u2t,bKe,Zvt,s3t,PGt,PRt,uLt,l2e,WJt,OFt,CJt,pJt,URt,cWe,_Gt,oQt,cni,uni,ZDt,cut,C$e,a6e,c6e,q2e,w6e,RDt,SXt],r=[aHt,Xgt,Zlt,uZe,vZt,dut,x$e];return i.filter(n=>t.default!==!1&&t[n.name]!==!1||t[n.name]).forEach(n=>e.push(n)),r.filter(n=>t[n.name]).forEach(n=>e.push(n)),e.forEach(n=>{n.settings=t[n.name]??{}}),new Map(e.map(n=>[n.name,n]))}var LI,ase;function pni(){if(ase)return LI;ase=1;function t(){this.__data__=[],this.size=0}return LI=t,LI}var FI,lse;function cse(){if(lse)return FI;lse=1;function t(e,i){return e===i||e!==e&&i!==i}return FI=t,FI}var _I,dse;function w9(){if(dse)return _I;dse=1;var t=cse();function e(i,r){for(var n=i.length;n--;)if(t(i[n][0],r))return n;return-1}return _I=e,_I}var OI,use;function fni(){if(use)return OI;use=1;var t=w9(),e=Array.prototype,i=e.splice;function r(n){var o=this.__data__,s=t(o,n);if(s<0)return!1;var a=o.length-1;return s==a?o.pop():i.call(o,s,1),--this.size,!0}return OI=r,OI}var UI,hse;function Ani(){if(hse)return UI;hse=1;var t=w9();function e(i){var r=this.__data__,n=t(r,i);return n<0?void 0:r[n][1]}return UI=e,UI}var NI,pse;function mni(){if(pse)return NI;pse=1;var t=w9();function e(i){return t(this.__data__,i)>-1}return NI=e,NI}var jI,fse;function gni(){if(fse)return jI;fse=1;var t=w9();function e(i,r){var n=this.__data__,o=t(n,i);return o<0?(++this.size,n.push([i,r])):n[o][1]=r,this}return jI=e,jI}var VI,Ase;function C9(){if(Ase)return VI;Ase=1;var t=pni(),e=fni(),i=Ani(),r=mni(),n=gni();function o(s){var a=-1,l=s==null?0:s.length;for(this.clear();++a<l;){var c=s[a];this.set(c[0],c[1])}}return o.prototype.clear=t,o.prototype.delete=e,o.prototype.get=i,o.prototype.has=r,o.prototype.set=n,VI=o,VI}var zI,mse;function vni(){if(mse)return zI;mse=1;var t=C9();function e(){this.__data__=new t,this.size=0}return zI=e,zI}var HI,gse;function yni(){if(gse)return HI;gse=1;function t(e){var i=this.__data__,r=i.delete(e);return this.size=i.size,r}return HI=t,HI}var qI,vse;function bni(){if(vse)return qI;vse=1;function t(e){return this.__data__.get(e)}return qI=t,qI}var GI,yse;function wni(){if(yse)return GI;yse=1;function t(e){return this.__data__.has(e)}return GI=t,GI}var QI,bse;function Nv(){if(bse)return QI;bse=1;function t(e){var i=typeof e;return e!=null&&(i=="object"||i=="function")}return QI=t,QI}var KI,wse;function Cse(){if(wse)return KI;wse=1;var t=km(),e=Nv(),i="[object AsyncFunction]",r="[object Function]",n="[object GeneratorFunction]",o="[object Proxy]";function s(a){if(!e(a))return!1;var l=t(a);return l==r||l==n||l==i||l==o}return KI=s,KI}var ZI,xse;function Cni(){if(xse)return ZI;xse=1;var t=xa(),e=t["__core-js_shared__"];return ZI=e,ZI}var WI,kse;function xni(){if(kse)return WI;kse=1;var t=Cni(),e=function(){var r=/[^.]+$/.exec(t&&t.keys&&t.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}();function i(r){return!!e&&e in r}return WI=i,WI}var JI,Mse;function Pse(){if(Mse)return JI;Mse=1;var t=Function.prototype,e=t.toString;function i(r){if(r!=null){try{return e.call(r)}catch{}try{return r+""}catch{}}return""}return JI=i,JI}var XI,Ese;function kni(){if(Ese)return XI;Ese=1;var t=Cse(),e=xni(),i=Nv(),r=Pse(),n=/[\\^$.*+?()[\]{}|]/g,o=/^\[object .+?Constructor\]$/,s=Function.prototype,a=Object.prototype,l=s.toString,c=a.hasOwnProperty,d=RegExp("^"+l.call(c).replace(n,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function u(h){if(!i(h)||e(h))return!1;var f=t(h)?d:o;return f.test(r(h))}return XI=u,XI}var YI,Bse;function Mni(){if(Bse)return YI;Bse=1;function t(e,i){return e?.[i]}return YI=t,YI}var $I,Ise;function eh(){if(Ise)return $I;Ise=1;var t=kni(),e=Mni();function i(r,n){var o=e(r,n);return t(o)?o:void 0}return $I=i,$I}var eS,Sse;function tS(){if(Sse)return eS;Sse=1;var t=eh(),e=xa(),i=t(e,"Map");return eS=i,eS}var iS,Tse;function x9(){if(Tse)return iS;Tse=1;var t=eh(),e=t(Object,"create");return iS=e,iS}var rS,Dse;function Pni(){if(Dse)return rS;Dse=1;var t=x9();function e(){this.__data__=t?t(null):{},this.size=0}return rS=e,rS}var oS,Rse;function Eni(){if(Rse)return oS;Rse=1;function t(e){var i=this.has(e)&&delete this.__data__[e];return this.size-=i?1:0,i}return oS=t,oS}var nS,Lse;function Bni(){if(Lse)return nS;Lse=1;var t=x9(),e="__lodash_hash_undefined__",i=Object.prototype,r=i.hasOwnProperty;function n(o){var s=this.__data__;if(t){var a=s[o];return a===e?void 0:a}return r.call(s,o)?s[o]:void 0}return nS=n,nS}var sS,Fse;function Ini(){if(Fse)return sS;Fse=1;var t=x9(),e=Object.prototype,i=e.hasOwnProperty;function r(n){var o=this.__data__;return t?o[n]!==void 0:i.call(o,n)}return sS=r,sS}var aS,_se;function Sni(){if(_se)return aS;_se=1;var t=x9(),e="__lodash_hash_undefined__";function i(r,n){var o=this.__data__;return this.size+=this.has(r)?0:1,o[r]=t&&n===void 0?e:n,this}return aS=i,aS}var lS,Ose;function Tni(){if(Ose)return lS;Ose=1;var t=Pni(),e=Eni(),i=Bni(),r=Ini(),n=Sni();function o(s){var a=-1,l=s==null?0:s.length;for(this.clear();++a<l;){var c=s[a];this.set(c[0],c[1])}}return o.prototype.clear=t,o.prototype.delete=e,o.prototype.get=i,o.prototype.has=r,o.prototype.set=n,lS=o,lS}var cS,Use;function Dni(){if(Use)return cS;Use=1;var t=Tni(),e=C9(),i=tS();function r(){this.size=0,this.__data__={hash:new t,map:new(i||e),string:new t}}return cS=r,cS}var dS,Nse;function Rni(){if(Nse)return dS;Nse=1;function t(e){var i=typeof e;return i=="string"||i=="number"||i=="symbol"||i=="boolean"?e!=="__proto__":e===null}return dS=t,dS}var uS,jse;function k9(){if(jse)return uS;jse=1;var t=Rni();function e(i,r){var n=i.__data__;return t(r)?n[typeof r=="string"?"string":"hash"]:n.map}return uS=e,uS}var hS,Vse;function Lni(){if(Vse)return hS;Vse=1;var t=k9();function e(i){var r=t(this,i).delete(i);return this.size-=r?1:0,r}return hS=e,hS}var pS,zse;function Fni(){if(zse)return pS;zse=1;var t=k9();function e(i){return t(this,i).get(i)}return pS=e,pS}var fS,Hse;function _ni(){if(Hse)return fS;Hse=1;var t=k9();function e(i){return t(this,i).has(i)}return fS=e,fS}var AS,qse;function Oni(){if(qse)return AS;qse=1;var t=k9();function e(i,r){var n=t(this,i),o=n.size;return n.set(i,r),this.size+=n.size==o?0:1,this}return AS=e,AS}var mS,Gse;function Uni(){if(Gse)return mS;Gse=1;var t=Dni(),e=Lni(),i=Fni(),r=_ni(),n=Oni();function o(s){var a=-1,l=s==null?0:s.length;for(this.clear();++a<l;){var c=s[a];this.set(c[0],c[1])}}return o.prototype.clear=t,o.prototype.delete=e,o.prototype.get=i,o.prototype.has=r,o.prototype.set=n,mS=o,mS}var gS,Qse;function Nni(){if(Qse)return gS;Qse=1;var t=C9(),e=tS(),i=Uni(),r=200;function n(o,s){var a=this.__data__;if(a instanceof t){var l=a.__data__;if(!e||l.length<r-1)return l.push([o,s]),this.size=++a.size,this;a=this.__data__=new i(l)}return a.set(o,s),this.size=a.size,this}return gS=n,gS}var vS,Kse;function jni(){if(Kse)return vS;Kse=1;var t=C9(),e=vni(),i=yni(),r=bni(),n=wni(),o=Nni();function s(a){var l=this.__data__=new t(a);this.size=l.size}return s.prototype.clear=e,s.prototype.delete=i,s.prototype.get=r,s.prototype.has=n,s.prototype.set=o,vS=s,vS}var yS,Zse;function Vni(){if(Zse)return yS;Zse=1;function t(e,i){for(var r=-1,n=e==null?0:e.length;++r<n&&i(e[r],r,e)!==!1;);return e}return yS=t,yS}var bS,Wse;function zni(){if(Wse)return bS;Wse=1;var t=eh(),e=function(){try{var i=t(Object,"defineProperty");return i({},"",{}),i}catch{}}();return bS=e,bS}var wS,Jse;function Xse(){if(Jse)return wS;Jse=1;var t=zni();function e(i,r,n){r=="__proto__"&&t?t(i,r,{configurable:!0,enumerable:!0,value:n,writable:!0}):i[r]=n}return wS=e,wS}var CS,Yse;function $se(){if(Yse)return CS;Yse=1;var t=Xse(),e=cse(),i=Object.prototype,r=i.hasOwnProperty;function n(o,s,a){var l=o[s];(!(r.call(o,s)&&e(l,a))||a===void 0&&!(s in o))&&t(o,s,a)}return CS=n,CS}var xS,eae;function M9(){if(eae)return xS;eae=1;var t=$se(),e=Xse();function i(r,n,o,s){var a=!o;o||(o={});for(var l=-1,c=n.length;++l<c;){var d=n[l],u=s?s(o[d],r[d],d,o,r):void 0;u===void 0&&(u=r[d]),a?e(o,d,u):t(o,d,u)}return o}return xS=i,xS}var kS,tae;function Hni(){if(tae)return kS;tae=1;function t(e,i){for(var r=-1,n=Array(e);++r<e;)n[r]=i(r);return n}return kS=t,kS}var MS,iae;function qni(){if(iae)return MS;iae=1;var t=km(),e=Oh(),i="[object Arguments]";function r(n){return e(n)&&t(n)==i}return MS=r,MS}var PS,rae;function Gni(){if(rae)return PS;rae=1;var t=qni(),e=Oh(),i=Object.prototype,r=i.hasOwnProperty,n=i.propertyIsEnumerable,o=t(function(){return arguments}())?t:function(s){return e(s)&&r.call(s,"callee")&&!n.call(s,"callee")};return PS=o,PS}var P9={exports:{}},ES,oae;function Qni(){if(oae)return ES;oae=1;function t(){return!1}return ES=t,ES}P9.exports;var nae;function sae(){return nae||(nae=1,function(t,e){var i=xa(),r=Qni(),n=e&&!e.nodeType&&e,o=n&&!0&&t&&!t.nodeType&&t,s=o&&o.exports===n,a=s?i.Buffer:void 0,l=a?a.isBuffer:void 0,c=l||r;t.exports=c}(P9,P9.exports)),P9.exports}var BS,aae;function Kni(){if(aae)return BS;aae=1;var t=9007199254740991,e=/^(?:0|[1-9]\d*)$/;function i(r,n){var o=typeof r;return n=n??t,!!n&&(o=="number"||o!="symbol"&&e.test(r))&&r>-1&&r%1==0&&r<n}return BS=i,BS}var IS,lae;function cae(){if(lae)return IS;lae=1;var t=9007199254740991;function e(i){return typeof i=="number"&&i>-1&&i%1==0&&i<=t}return IS=e,IS}var SS,dae;function Zni(){if(dae)return SS;dae=1;var t=km(),e=cae(),i=Oh(),r="[object Arguments]",n="[object Array]",o="[object Boolean]",s="[object Date]",a="[object Error]",l="[object Function]",c="[object Map]",d="[object Number]",u="[object Object]",h="[object RegExp]",f="[object Set]",A="[object String]",p="[object WeakMap]",g="[object ArrayBuffer]",m="[object DataView]",w="[object Float32Array]",y="[object Float64Array]",v="[object Int8Array]",x="[object Int16Array]",k="[object Int32Array]",P="[object Uint8Array]",E="[object Uint8ClampedArray]",B="[object Uint16Array]",I="[object Uint32Array]",T={};T[w]=T[y]=T[v]=T[x]=T[k]=T[P]=T[E]=T[B]=T[I]=!0,T[r]=T[n]=T[g]=T[o]=T[m]=T[s]=T[a]=T[l]=T[c]=T[d]=T[u]=T[h]=T[f]=T[A]=T[p]=!1;function L(O){return i(O)&&e(O.length)&&!!T[t(O)]}return SS=L,SS}var TS,uae;function DS(){if(uae)return TS;uae=1;function t(e){return function(i){return e(i)}}return TS=t,TS}var E9={exports:{}};E9.exports;var hae;function RS(){return hae||(hae=1,function(t,e){var i=xO(),r=e&&!e.nodeType&&e,n=r&&!0&&t&&!t.nodeType&&t,o=n&&n.exports===r,s=o&&i.process,a=function(){try{var l=n&&n.require&&n.require("util").types;return l||s&&s.binding&&s.binding("util")}catch{}}();t.exports=a}(E9,E9.exports)),E9.exports}var LS,pae;function Wni(){if(pae)return LS;pae=1;var t=Zni(),e=DS(),i=RS(),r=i&&i.isTypedArray,n=r?e(r):t;return LS=n,LS}var FS,fae;function Aae(){if(fae)return FS;fae=1;var t=Hni(),e=Gni(),i=O4(),r=sae(),n=Kni(),o=Wni(),s=Object.prototype,a=s.hasOwnProperty;function l(c,d){var u=i(c),h=!u&&e(c),f=!u&&!h&&r(c),A=!u&&!h&&!f&&o(c),p=u||h||f||A,g=p?t(c.length,String):[],m=g.length;for(var w in c)(d||a.call(c,w))&&!(p&&(w=="length"||f&&(w=="offset"||w=="parent")||A&&(w=="buffer"||w=="byteLength"||w=="byteOffset")||n(w,m)))&&g.push(w);return g}return FS=l,FS}var _S,mae;function OS(){if(mae)return _S;mae=1;var t=Object.prototype;function e(i){var r=i&&i.constructor,n=typeof r=="function"&&r.prototype||t;return i===n}return _S=e,_S}var US,gae;function vae(){if(gae)return US;gae=1;function t(e,i){return function(r){return e(i(r))}}return US=t,US}var NS,yae;function Jni(){if(yae)return NS;yae=1;var t=vae(),e=t(Object.keys,Object);return NS=e,NS}var jS,bae;function Xni(){if(bae)return jS;bae=1;var t=OS(),e=Jni(),i=Object.prototype,r=i.hasOwnProperty;function n(o){if(!t(o))return e(o);var s=[];for(var a in Object(o))r.call(o,a)&&a!="constructor"&&s.push(a);return s}return jS=n,jS}var VS,wae;function Cae(){if(wae)return VS;wae=1;var t=Cse(),e=cae();function i(r){return r!=null&&e(r.length)&&!t(r)}return VS=i,VS}var zS,xae;function HS(){if(xae)return zS;xae=1;var t=Aae(),e=Xni(),i=Cae();function r(n){return i(n)?t(n):e(n)}return zS=r,zS}var qS,kae;function Yni(){if(kae)return qS;kae=1;var t=M9(),e=HS();function i(r,n){return r&&t(n,e(n),r)}return qS=i,qS}var GS,Mae;function $ni(){if(Mae)return GS;Mae=1;function t(e){var i=[];if(e!=null)for(var r in Object(e))i.push(r);return i}return GS=t,GS}var QS,Pae;function esi(){if(Pae)return QS;Pae=1;var t=Nv(),e=OS(),i=$ni(),r=Object.prototype,n=r.hasOwnProperty;function o(s){if(!t(s))return i(s);var a=e(s),l=[];for(var c in s)c=="constructor"&&(a||!n.call(s,c))||l.push(c);return l}return QS=o,QS}var KS,Eae;function ZS(){if(Eae)return KS;Eae=1;var t=Aae(),e=esi(),i=Cae();function r(n){return i(n)?t(n,!0):e(n)}return KS=r,KS}var WS,Bae;function tsi(){if(Bae)return WS;Bae=1;var t=M9(),e=ZS();function i(r,n){return r&&t(n,e(n),r)}return WS=i,WS}var B9={exports:{}};B9.exports;var Iae;function isi(){return Iae||(Iae=1,function(t,e){var i=xa(),r=e&&!e.nodeType&&e,n=r&&!0&&t&&!t.nodeType&&t,o=n&&n.exports===r,s=o?i.Buffer:void 0,a=s?s.allocUnsafe:void 0;function l(c,d){if(d)return c.slice();var u=c.length,h=a?a(u):new c.constructor(u);return c.copy(h),h}t.exports=l}(B9,B9.exports)),B9.exports}var JS,Sae;function rsi(){if(Sae)return JS;Sae=1;function t(e,i){var r=-1,n=e.length;for(i||(i=Array(n));++r<n;)i[r]=e[r];return i}return JS=t,JS}var XS,Tae;function osi(){if(Tae)return XS;Tae=1;function t(e,i){for(var r=-1,n=e==null?0:e.length,o=0,s=[];++r<n;){var a=e[r];i(a,r,e)&&(s[o++]=a)}return s}return XS=t,XS}var YS,Dae;function Rae(){if(Dae)return YS;Dae=1;function t(){return[]}return YS=t,YS}var $S,Lae;function eT(){if(Lae)return $S;Lae=1;var t=osi(),e=Rae(),i=Object.prototype,r=i.propertyIsEnumerable,n=Object.getOwnPropertySymbols,o=n?function(s){return s==null?[]:(s=Object(s),t(n(s),function(a){return r.call(s,a)}))}:e;return $S=o,$S}var tT,Fae;function nsi(){if(Fae)return tT;Fae=1;var t=M9(),e=eT();function i(r,n){return t(r,e(r),n)}return tT=i,tT}var iT,_ae;function Oae(){if(_ae)return iT;_ae=1;function t(e,i){for(var r=-1,n=i.length,o=e.length;++r<n;)e[o+r]=i[r];return e}return iT=t,iT}var rT,Uae;function Nae(){if(Uae)return rT;Uae=1;var t=vae(),e=t(Object.getPrototypeOf,Object);return rT=e,rT}var oT,jae;function Vae(){if(jae)return oT;jae=1;var t=Oae(),e=Nae(),i=eT(),r=Rae(),n=Object.getOwnPropertySymbols,o=n?function(s){for(var a=[];s;)t(a,i(s)),s=e(s);return a}:r;return oT=o,oT}var nT,zae;function ssi(){if(zae)return nT;zae=1;var t=M9(),e=Vae();function i(r,n){return t(r,e(r),n)}return nT=i,nT}var sT,Hae;function qae(){if(Hae)return sT;Hae=1;var t=Oae(),e=O4();function i(r,n,o){var s=n(r);return e(r)?s:t(s,o(r))}return sT=i,sT}var aT,Gae;function asi(){if(Gae)return aT;Gae=1;var t=qae(),e=eT(),i=HS();function r(n){return t(n,i,e)}return aT=r,aT}var lT,Qae;function lsi(){if(Qae)return lT;Qae=1;var t=qae(),e=Vae(),i=ZS();function r(n){return t(n,i,e)}return lT=r,lT}var cT,Kae;function csi(){if(Kae)return cT;Kae=1;var t=eh(),e=xa(),i=t(e,"DataView");return cT=i,cT}var dT,Zae;function dsi(){if(Zae)return dT;Zae=1;var t=eh(),e=xa(),i=t(e,"Promise");return dT=i,dT}var uT,Wae;function usi(){if(Wae)return uT;Wae=1;var t=eh(),e=xa(),i=t(e,"Set");return uT=i,uT}var hT,Jae;function hsi(){if(Jae)return hT;Jae=1;var t=eh(),e=xa(),i=t(e,"WeakMap");return hT=i,hT}var pT,Xae;function fT(){if(Xae)return pT;Xae=1;var t=csi(),e=tS(),i=dsi(),r=usi(),n=hsi(),o=km(),s=Pse(),a="[object Map]",l="[object Object]",c="[object Promise]",d="[object Set]",u="[object WeakMap]",h="[object DataView]",f=s(t),A=s(e),p=s(i),g=s(r),m=s(n),w=o;return(t&&w(new t(new ArrayBuffer(1)))!=h||e&&w(new e)!=a||i&&w(i.resolve())!=c||r&&w(new r)!=d||n&&w(new n)!=u)&&(w=function(y){var v=o(y),x=v==l?y.constructor:void 0,k=x?s(x):"";if(k)switch(k){case f:return h;case A:return a;case p:return c;case g:return d;case m:return u}return v}),pT=w,pT}var AT,Yae;function psi(){if(Yae)return AT;Yae=1;var t=Object.prototype,e=t.hasOwnProperty;function i(r){var n=r.length,o=new r.constructor(n);return n&&typeof r[0]=="string"&&e.call(r,"index")&&(o.index=r.index,o.input=r.input),o}return AT=i,AT}var mT,$ae;function fsi(){if($ae)return mT;$ae=1;var t=xa(),e=t.Uint8Array;return mT=e,mT}var gT,ele;function vT(){if(ele)return gT;ele=1;var t=fsi();function e(i){var r=new i.constructor(i.byteLength);return new t(r).set(new t(i)),r}return gT=e,gT}var yT,tle;function Asi(){if(tle)return yT;tle=1;var t=vT();function e(i,r){var n=r?t(i.buffer):i.buffer;return new i.constructor(n,i.byteOffset,i.byteLength)}return yT=e,yT}var bT,ile;function msi(){if(ile)return bT;ile=1;var t=/\w*$/;function e(i){var r=new i.constructor(i.source,t.exec(i));return r.lastIndex=i.lastIndex,r}return bT=e,bT}var wT,rle;function gsi(){if(rle)return wT;rle=1;var t=_4(),e=t?t.prototype:void 0,i=e?e.valueOf:void 0;function r(n){return i?Object(i.call(n)):{}}return wT=r,wT}var CT,ole;function vsi(){if(ole)return CT;ole=1;var t=vT();function e(i,r){var n=r?t(i.buffer):i.buffer;return new i.constructor(n,i.byteOffset,i.length)}return CT=e,CT}var xT,nle;function ysi(){if(nle)return xT;nle=1;var t=vT(),e=Asi(),i=msi(),r=gsi(),n=vsi(),o="[object Boolean]",s="[object Date]",a="[object Map]",l="[object Number]",c="[object RegExp]",d="[object Set]",u="[object String]",h="[object Symbol]",f="[object ArrayBuffer]",A="[object DataView]",p="[object Float32Array]",g="[object Float64Array]",m="[object Int8Array]",w="[object Int16Array]",y="[object Int32Array]",v="[object Uint8Array]",x="[object Uint8ClampedArray]",k="[object Uint16Array]",P="[object Uint32Array]";function E(B,I,T){var L=B.constructor;switch(I){case f:return t(B);case o:case s:return new L(+B);case A:return e(B,T);case p:case g:case m:case w:case y:case v:case x:case k:case P:return n(B,T);case a:return new L;case l:case u:return new L(B);case c:return i(B);case d:return new L;case h:return r(B)}}return xT=E,xT}var kT,sle;function bsi(){if(sle)return kT;sle=1;var t=Nv(),e=Object.create,i=function(){function r(){}return function(n){if(!t(n))return{};if(e)return e(n);r.prototype=n;var o=new r;return r.prototype=void 0,o}}();return kT=i,kT}var MT,ale;function wsi(){if(ale)return MT;ale=1;var t=bsi(),e=Nae(),i=OS();function r(n){return typeof n.constructor=="function"&&!i(n)?t(e(n)):{}}return MT=r,MT}var PT,lle;function Csi(){if(lle)return PT;lle=1;var t=fT(),e=Oh(),i="[object Map]";function r(n){return e(n)&&t(n)==i}return PT=r,PT}var ET,cle;function xsi(){if(cle)return ET;cle=1;var t=Csi(),e=DS(),i=RS(),r=i&&i.isMap,n=r?e(r):t;return ET=n,ET}var BT,dle;function ksi(){if(dle)return BT;dle=1;var t=fT(),e=Oh(),i="[object Set]";function r(n){return e(n)&&t(n)==i}return BT=r,BT}var IT,ule;function Msi(){if(ule)return IT;ule=1;var t=ksi(),e=DS(),i=RS(),r=i&&i.isSet,n=r?e(r):t;return IT=n,IT}var ST,hle;function Psi(){if(hle)return ST;hle=1;var t=jni(),e=Vni(),i=$se(),r=Yni(),n=tsi(),o=isi(),s=rsi(),a=nsi(),l=ssi(),c=asi(),d=lsi(),u=fT(),h=psi(),f=ysi(),A=wsi(),p=O4(),g=sae(),m=xsi(),w=Nv(),y=Msi(),v=HS(),x=ZS(),k=1,P=2,E=4,B="[object Arguments]",I="[object Array]",T="[object Boolean]",L="[object Date]",O="[object Error]",U="[object Function]",H="[object GeneratorFunction]",N="[object Map]",W="[object Number]",J="[object Object]",te="[object RegExp]",de="[object Set]",Le="[object String]",we="[object Symbol]",Ue="[object WeakMap]",Ce="[object ArrayBuffer]",Te="[object DataView]",ze="[object Float32Array]",ne="[object Float64Array]",Ie="[object Int8Array]",ye="[object Int16Array]",Se="[object Int32Array]",Xe="[object Uint8Array]",Ye="[object Uint8ClampedArray]",ee="[object Uint16Array]",Q="[object Uint32Array]",ce={};ce[B]=ce[I]=ce[Ce]=ce[Te]=ce[T]=ce[L]=ce[ze]=ce[ne]=ce[Ie]=ce[ye]=ce[Se]=ce[N]=ce[W]=ce[J]=ce[te]=ce[de]=ce[Le]=ce[we]=ce[Xe]=ce[Ye]=ce[ee]=ce[Q]=!0,ce[O]=ce[U]=ce[Ue]=!1;function xe(ve,G,X,ie,q,j){var $,ge=G&k,Ee=G&P,ae=G&E;if(X&&($=q?X(ve,ie,q,j):X(ve)),$!==void 0)return $;if(!w(ve))return ve;var fe=p(ve);if(fe){if($=h(ve),!ge)return s(ve,$)}else{var Je=u(ve),Oe=Je==U||Je==H;if(g(ve))return o(ve,ge);if(Je==J||Je==B||Oe&&!q){if($=Ee||Oe?{}:A(ve),!ge)return Ee?l(ve,n($,ve)):a(ve,r($,ve))}else{if(!ce[Je])return q?ve:{};$=f(ve,Je,ge)}}j||(j=new t);var Be=j.get(ve);if(Be)return Be;j.set(ve,$),y(ve)?ve.forEach(function(dt){$.add(xe(dt,G,X,dt,ve,j))}):m(ve)&&ve.forEach(function(dt,Me){$.set(Me,xe(dt,G,X,Me,ve,j))});var $e=ae?Ee?d:c:Ee?x:v,Pe=fe?void 0:$e(ve);return e(Pe||ve,function(dt,Me){Pe&&(Me=dt,dt=ve[Me]),i($,Me,xe(dt,G,X,Me,ve,j))}),$}return ST=xe,ST}var TT,ple;function Esi(){if(ple)return TT;ple=1;var t=Psi(),e=1,i=4;function r(n){return t(n,e|i)}return TT=r,TT}var Bsi=Esi();const Isi=ym(Bsi);class Ssi{constructor(e={}){const{name:i,isViewer:r=!1,i18nTokenPrefix:n=null,i18n:o=null,addToWindows:s=[],window:a=null,component:l=null,initiallyShown:c=!0,button:d=null,sidePanel:u=null,startupScript:h=null,settings:f={},...A}=e;if(!i)throw new TypeError("Plugin must have a name.");A&&Object.assign(this,A),this.name=i,this.isViewer=r,this.i18nTokenPrefix=n,this.i18n=o,this.addToWindows=s,this.window=a,this.component=l,this.initiallyShown=c,d?this.button=new Tsi(d):u&&(this.sidePanel=new Dsi(u)),this.startupScript=h,this.settings=f}}class Tsi{constructor(e={}){const{position:i="left",stance:r=0,tooltip:n,content:o="free",keepOpen:s,icon:a,iconOpen:l,initiallyOpen:c=!1}=e;this.position=i,this.stance=r,this.tooltip=n,this.content=o,this.keepOpen=s,this.icon=a,this.iconOpen=l,this.initiallyOpen=c}}class Dsi{constructor(e={}){const{position:i="left",width:r=300}=e;this.position=i,this.width=r}}let Rsi=0;class Lsi extends Ssi{constructor(e={},i){var r;super(Isi(e)),this.localContext=i,this.id=Rsi++,this._shown=Ae(this.initiallyShown),this._isOpen=Ae(((r=this.button)==null?void 0:r.initiallyOpen)??!1),this._loading=Ae(!1),this._componentInstance=Ae(null),this.button&&(this._buttonText=Ae(this.button.text)),this.sidePanel&&(this._sidePanelWidth=Ae(Number.isFinite(this.sidePanel.width)?this.sidePanel.width:300))}get sidePanelWidth(){var e;return(e=this._sidePanelWidth)==null?void 0:e.value}set sidePanelWidth(e=300){if(this._sidePanelWidth){if(!Number.isFinite(e))throw new TypeError("[BIMDataViewer - PluginInstance] sidePanelWidth must be a finite number.");this._sidePanelWidth.value=e}}get shown(){return this._shown.value}show(){this._shown.value=!0}hide(){this._shown.value=!1}get loading(){return this._loading.value}async open(...e){this.isOpen||(await this._onOpenOrClose("open",...e),this._isOpen.value=!0,this.localContext.hub.emit("plugin-open",{name:this.name,plugin:this.componentInstance}),this.localContext.$viewer.globalContext.hub.emit("plugin-open",{name:this.name,plugin:this.componentInstance}))}async close(...e){this.isOpen&&(await this._onOpenOrClose("close",...e),this._isOpen.value=!1,this.localContext.hub.emit("plugin-close",{name:this.name,plugin:this.componentInstance}),this.localContext.$viewer.globalContext.hub.emit("plugin-close",{name:this.name,plugin:this.componentInstance}))}get isOpen(){return this._isOpen.value}_onOpenOrClose(e,...i){if(!this.component){console.warn(`Plugin ${this.name} does not have a component. It cannot be opened or closed.`);return}if(this.loading){console.log(`Plugin ${this.name} is loading. It cannot be opened or closed.`);return}if(typeof this.component[`on${qc(e)}`]!="function")return;const r=this.component[`on${qc(e)}`].call(this.componentInstance,...i);return typeof r?.then=="function"?(this._loading.value=!0,r.then(()=>{this._loading.value=!1})):r}get componentInstance(){return this._componentInstance.value}set componentInstance(e){this._componentInstance.value=e}get buttonText(){return this._buttonText.value}set buttonText(e){this._buttonText.value=e}}class Fsi{constructor(e={}){this.registeredPlugins=e!==!1?hni(e):new Map,this.cfg=e}getPluginInstance(e,i){return this.registeredPlugins.has(e)?new Lsi(this.registeredPlugins.get(e),i):(console.warn(`No plugin with name "${e}". You must register it before accessing it.`),null)}runPluginsScripts(e){this.registeredPlugins.forEach(i=>{var r;try{(r=i.startupScript)==null||r.call(i,e)}catch(n){console.error(`[Viewer] Failed to execute startupScript of plugin ${i.name}.`,n)}})}registerPlugin(e){if(this.registeredPlugins.has(e.name)&&console.warn(`[BIMDataViewer - PluginManager:registerPlugin] Plugin with name "${e.name}" is already registered. It will be overwritten.`),e.button&&e.sidePanel)throw new TypeError(`[BIMDataViewer - PluginManager:registerPlugin] Plugin "${e.name}" has both a button and a side panel. You should choose one or the other.`);this.registeredPlugins.set(e.name,e)}get pluginTranslations(){const e={};return this.registeredPlugins.forEach(i=>{if(i.i18n){const r=i.i18nTokenPrefix||i.name;Object.keys(i.i18n).forEach(n=>{e[n]||(e[n]={}),e[n][r]=i.i18n[n]})}}),e}}class _si{constructor({name:e,label:i,plugins:r=[],header:n=!0,icon:o,modelTypes:s=[],multiModel:a=!0,logoAndVersion:l=!1,defaultWindow:c=!1,displayedInWindowSelector:d=!0,noModel:u=!1}){this.name=e,this.label=i,this.plugins=r,this.header=n,this.icon=o,this.modelTypes=s,this.multiModel=a,this.logoAndVersion=l,this.default=c,this.displayedInWindowSelector=d,this.noModel=u}}class Osi{constructor(){this.registeredWindows=new Map,this.defaultWindow=null,this.windowContainers=zn([])}registerWindow(e){var i,r,n;if(!e)throw new TypeError("registerWindow - window is required.");if(e.plugins||(e.plugins=[]),!(typeof e.name=="string"&&(r=(i=e.plugins)==null?void 0:i.every)!=null&&r.call(i,s=>typeof s=="string")))throw new TypeError("registerWindow - Windows must have a name as string and window.plugins must be an array of plugin names as string.");if(this.registeredWindows.has(e.name))throw new Error(`A window with the name ${e.name} already exist. It must be unique.`);const o=new _si({name:e.name,label:e.label,plugins:[...e.plugins],header:e.header,icon:{imgUri:(n=e.icon)==null?void 0:n.imgUri},modelTypes:e.modelTypes,multiModel:e.multiModel??!0,logoAndVersion:e.logoAndVersion,defaultWindow:e.defaultWindow,displayedInWindowSelector:e.displayedInWindowSelector??!0,noModel:e.noModel??!1});return this.registeredWindows.set(o.name,o),o.default&&(this.defaultWindow&&(console.warn(`A window with the name ${this.defaultWindow.name} was already set as default and will be replaced by ${o.name}.`),this.defaultWindow.default=!1),this.defaultWindow=o),o}unregisterWindow(e){return this.registeredWindows.delete(e)}registerAndAddPluginsToWindows(e=[]){e.filter(i=>i.window&&!this.registeredWindows.has(i.window)).forEach(i=>{this.registerWindow(i.window).plugins.unshift(i.name)}),e.filter(i=>{var r;return((r=i.addToWindows)==null?void 0:r.length)>0}).forEach(i=>{i.addToWindows.forEach(r=>{const n=this.registeredWindows.get(r);n?n.plugins.push(i.name):console.warn(`[Viewer] Plugin with name ${i.name} can not be added to the window ${r} because it is not registered.`)})})}}const jv=15,DT=30,RT=19,Usi=29,I9=256,LT=I9+1+Usi,fle=2*LT+1,Vv=256,Nsi=7,Ale=16,mle=17,gle=18,FT=8*2,S9=-1,jsi=1,T9=2,Vsi=0,P2=0,vle=1,zsi=3,Un=4,aa=0,yle=1,D9=2,la=-2,Hsi=-3,E2=-5;function R9(t){return L9(t.map(([e,i])=>new Array(e).fill(i,0,e)))}function L9(t){return t.reduce((e,i)=>e.concat(Array.isArray(i)?L9(i):i),[])}const ble=[0,1,2,3].concat(...R9([[2,4],[2,5],[4,6],[4,7],[8,8],[8,9],[16,10],[16,11],[32,12],[32,13],[64,14],[64,15],[2,0],[1,16],[1,17],[2,18],[2,19],[4,20],[4,21],[8,22],[8,23],[16,24],[16,25],[32,26],[32,27],[64,28],[64,29]]));function mr(){const t=this;function e(n){const o=t.dyn_tree,s=t.stat_desc.static_tree,a=t.stat_desc.extra_bits,l=t.stat_desc.extra_base,c=t.stat_desc.max_length;let d,u,h,f,A,p,g=0;for(f=0;f<=jv;f++)n.bl_count[f]=0;for(o[n.heap[n.heap_max]*2+1]=0,d=n.heap_max+1;d<fle;d++)u=n.heap[d],f=o[o[u*2+1]*2+1]+1,f>c&&(f=c,g++),o[u*2+1]=f,!(u>t.max_code)&&(n.bl_count[f]++,A=0,u>=l&&(A=a[u-l]),p=o[u*2],n.opt_len+=p*(f+A),s&&(n.static_len+=p*(s[u*2+1]+A)));if(g!==0){do{for(f=c-1;n.bl_count[f]===0;)f--;n.bl_count[f]--,n.bl_count[f+1]+=2,n.bl_count[c]--,g-=2}while(g>0);for(f=c;f!==0;f--)for(u=n.bl_count[f];u!==0;)h=n.heap[--d],!(h>t.max_code)&&(o[h*2+1]!=f&&(n.opt_len+=(f-o[h*2+1])*o[h*2],o[h*2+1]=f),u--)}}function i(n,o){let s=0;do s|=n&1,n>>>=1,s<<=1;while(--o>0);return s>>>1}function r(n,o,s){const a=[];let l=0,c,d,u;for(c=1;c<=jv;c++)a[c]=l=l+s[c-1]<<1;for(d=0;d<=o;d++)u=n[d*2+1],u!==0&&(n[d*2]=i(a[u]++,u))}t.build_tree=function(n){const o=t.dyn_tree,s=t.stat_desc.static_tree,a=t.stat_desc.elems;let l,c,d=-1,u;for(n.heap_len=0,n.heap_max=fle,l=0;l<a;l++)o[l*2]!==0?(n.heap[++n.heap_len]=d=l,n.depth[l]=0):o[l*2+1]=0;for(;n.heap_len<2;)u=n.heap[++n.heap_len]=d<2?++d:0,o[u*2]=1,n.depth[u]=0,n.opt_len--,s&&(n.static_len-=s[u*2+1]);for(t.max_code=d,l=Math.floor(n.heap_len/2);l>=1;l--)n.pqdownheap(o,l);u=a;do l=n.heap[1],n.heap[1]=n.heap[n.heap_len--],n.pqdownheap(o,1),c=n.heap[1],n.heap[--n.heap_max]=l,n.heap[--n.heap_max]=c,o[u*2]=o[l*2]+o[c*2],n.depth[u]=Math.max(n.depth[l],n.depth[c])+1,o[l*2+1]=o[c*2+1]=u,n.heap[1]=u++,n.pqdownheap(o,1);while(n.heap_len>=2);n.heap[--n.heap_max]=n.heap[1],e(n),r(o,t.max_code,n.bl_count)}}mr._length_code=[0,1,2,3,4,5,6,7].concat(...R9([[2,8],[2,9],[2,10],[2,11],[4,12],[4,13],[4,14],[4,15],[8,16],[8,17],[8,18],[8,19],[16,20],[16,21],[16,22],[16,23],[32,24],[32,25],[32,26],[31,27],[1,28]])),mr.base_length=[0,1,2,3,4,5,6,7,8,10,12,14,16,20,24,28,32,40,48,56,64,80,96,112,128,160,192,224,0],mr.base_dist=[0,1,2,3,4,6,8,12,16,24,32,48,64,96,128,192,256,384,512,768,1024,1536,2048,3072,4096,6144,8192,12288,16384,24576],mr.d_code=function(t){return t<256?ble[t]:ble[256+(t>>>7)]},mr.extra_lbits=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],mr.extra_dbits=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],mr.extra_blbits=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],mr.bl_order=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];function Lo(t,e,i,r,n){const o=this;o.static_tree=t,o.extra_bits=e,o.extra_base=i,o.elems=r,o.max_length=n}const qsi=[12,140,76,204,44,172,108,236,28,156,92,220,60,188,124,252,2,130,66,194,34,162,98,226,18,146,82,210,50,178,114,242,10,138,74,202,42,170,106,234,26,154,90,218,58,186,122,250,6,134,70,198,38,166,102,230,22,150,86,214,54,182,118,246,14,142,78,206,46,174,110,238,30,158,94,222,62,190,126,254,1,129,65,193,33,161,97,225,17,145,81,209,49,177,113,241,9,137,73,201,41,169,105,233,25,153,89,217,57,185,121,249,5,133,69,197,37,165,101,229,21,149,85,213,53,181,117,245,13,141,77,205,45,173,109,237,29,157,93,221,61,189,125,253,19,275,147,403,83,339,211,467,51,307,179,435,115,371,243,499,11,267,139,395,75,331,203,459,43,299,171,427,107,363,235,491,27,283,155,411,91,347,219,475,59,315,187,443,123,379,251,507,7,263,135,391,71,327,199,455,39,295,167,423,103,359,231,487,23,279,151,407,87,343,215,471,55,311,183,439,119,375,247,503,15,271,143,399,79,335,207,463,47,303,175,431,111,367,239,495,31,287,159,415,95,351,223,479,63,319,191,447,127,383,255,511,0,64,32,96,16,80,48,112,8,72,40,104,24,88,56,120,4,68,36,100,20,84,52,116,3,131,67,195,35,163,99,227],Gsi=R9([[144,8],[112,9],[24,7],[8,8]]);Lo.static_ltree=L9(qsi.map((t,e)=>[t,Gsi[e]]));const Qsi=[0,16,8,24,4,20,12,28,2,18,10,26,6,22,14,30,1,17,9,25,5,21,13,29,3,19,11,27,7,23],Ksi=R9([[30,5]]);Lo.static_dtree=L9(Qsi.map((t,e)=>[t,Ksi[e]])),Lo.static_l_desc=new Lo(Lo.static_ltree,mr.extra_lbits,I9+1,LT,jv),Lo.static_d_desc=new Lo(Lo.static_dtree,mr.extra_dbits,0,DT,jv),Lo.static_bl_desc=new Lo(null,mr.extra_blbits,0,RT,Nsi);const Zsi=9,Wsi=8;function Ka(t,e,i,r,n){const o=this;o.good_length=t,o.max_lazy=e,o.nice_length=i,o.max_chain=r,o.func=n}const wle=0,F9=1,th=2,ca=[new Ka(0,0,0,0,wle),new Ka(4,4,8,4,F9),new Ka(4,5,16,8,F9),new Ka(4,6,32,32,F9),new Ka(4,4,16,16,th),new Ka(8,16,32,32,th),new Ka(8,16,128,128,th),new Ka(8,32,128,256,th),new Ka(32,128,258,1024,th),new Ka(32,258,258,4096,th)],_9=["need dictionary","stream end","","","stream error","data error","","buffer error","",""],da=0,O9=1,zv=2,U9=3,Jsi=32,_T=42,N9=113,Hv=666,OT=8,Xsi=0,UT=1,Ysi=2,kr=3,j9=258,as=j9+kr+1;function Cle(t,e,i,r){const n=t[e*2],o=t[i*2];return n<o||n==o&&r[e]<=r[i]}function $si(){const t=this;let e,i,r,n,o,s,a,l,c,d,u,h,f,A,p,g,m,w,y,v,x,k,P,E,B,I,T,L,O,U,H,N,W;const J=new mr,te=new mr,de=new mr;t.depth=[];let Le,we,Ue,Ce,Te,ze;t.bl_count=[],t.heap=[],H=[],N=[],W=[];function ne(){c=2*o,u[f-1]=0;for(let Me=0;Me<f-1;Me++)u[Me]=0;I=ca[T].max_lazy,O=ca[T].good_length,U=ca[T].nice_length,B=ca[T].max_chain,x=0,m=0,P=0,w=E=kr-1,v=0,h=0}function Ie(){let Me;for(Me=0;Me<LT;Me++)H[Me*2]=0;for(Me=0;Me<DT;Me++)N[Me*2]=0;for(Me=0;Me<RT;Me++)W[Me*2]=0;H[Vv*2]=1,t.opt_len=t.static_len=0,we=Ue=0}function ye(){J.dyn_tree=H,J.stat_desc=Lo.static_l_desc,te.dyn_tree=N,te.stat_desc=Lo.static_d_desc,de.dyn_tree=W,de.stat_desc=Lo.static_bl_desc,Te=0,ze=0,Ce=8,Ie()}t.pqdownheap=function(Me,Fe){const je=t.heap,qe=je[Fe];let Ze=Fe<<1;for(;Ze<=t.heap_len&&(Ze<t.heap_len&&Cle(Me,je[Ze+1],je[Ze],t.depth)&&Ze++,!Cle(Me,qe,je[Ze],t.depth));)je[Fe]=je[Ze],Fe=Ze,Ze<<=1;je[Fe]=qe};function Se(Me,Fe){let je=-1,qe,Ze=Me[0*2+1],pe=0,it=7,Re=4;Ze===0&&(it=138,Re=3),Me[(Fe+1)*2+1]=65535;for(let He=0;He<=Fe;He++)qe=Ze,Ze=Me[(He+1)*2+1],!(++pe<it&&qe==Ze)&&(pe<Re?W[qe*2]+=pe:qe!==0?(qe!=je&&W[qe*2]++,W[Ale*2]++):pe<=10?W[mle*2]++:W[gle*2]++,pe=0,je=qe,Ze===0?(it=138,Re=3):qe==Ze?(it=6,Re=3):(it=7,Re=4))}function Xe(){let Me;for(Se(H,J.max_code),Se(N,te.max_code),de.build_tree(t),Me=RT-1;Me>=3&&W[mr.bl_order[Me]*2+1]===0;Me--);return t.opt_len+=3*(Me+1)+5+5+4,Me}function Ye(Me){t.pending_buf[t.pending++]=Me}function ee(Me){Ye(Me&255),Ye(Me>>>8&255)}function Q(Me){Ye(Me>>8&255),Ye(Me&255&255)}function ce(Me,Fe){let je;const qe=Fe;ze>FT-qe?(je=Me,Te|=je<<ze&65535,ee(Te),Te=je>>>FT-ze,ze+=qe-FT):(Te|=Me<<ze&65535,ze+=qe)}function xe(Me,Fe){const je=Me*2;ce(Fe[je]&65535,Fe[je+1]&65535)}function ve(Me,Fe){let je,qe=-1,Ze,pe=Me[0*2+1],it=0,Re=7,He=4;for(pe===0&&(Re=138,He=3),je=0;je<=Fe;je++)if(Ze=pe,pe=Me[(je+1)*2+1],!(++it<Re&&Ze==pe)){if(it<He)do xe(Ze,W);while(--it!==0);else Ze!==0?(Ze!=qe&&(xe(Ze,W),it--),xe(Ale,W),ce(it-3,2)):it<=10?(xe(mle,W),ce(it-3,3)):(xe(gle,W),ce(it-11,7));it=0,qe=Ze,pe===0?(Re=138,He=3):Ze==pe?(Re=6,He=3):(Re=7,He=4)}}function G(Me,Fe,je){let qe;for(ce(Me-257,5),ce(Fe-1,5),ce(je-4,4),qe=0;qe<je;qe++)ce(W[mr.bl_order[qe]*2+1],3);ve(H,Me-1),ve(N,Fe-1)}function X(){ze==16?(ee(Te),Te=0,ze=0):ze>=8&&(Ye(Te&255),Te>>>=8,ze-=8)}function ie(){ce(UT<<1,3),xe(Vv,Lo.static_ltree),X(),1+Ce+10-ze<9&&(ce(UT<<1,3),xe(Vv,Lo.static_ltree),X()),Ce=7}function q(Me,Fe){let je,qe,Ze;if(t.dist_buf[we]=Me,t.lc_buf[we]=Fe&255,we++,Me===0?H[Fe*2]++:(Ue++,Me--,H[(mr._length_code[Fe]+I9+1)*2]++,N[mr.d_code(Me)*2]++),!(we&8191)&&T>2){for(je=we*8,qe=x-m,Ze=0;Ze<DT;Ze++)je+=N[Ze*2]*(5+mr.extra_dbits[Ze]);if(je>>>=3,Ue<Math.floor(we/2)&&je<Math.floor(qe/2))return!0}return we==Le-1}function j(Me,Fe){let je,qe,Ze=0,pe,it;if(we!==0)do je=t.dist_buf[Ze],qe=t.lc_buf[Ze],Ze++,je===0?xe(qe,Me):(pe=mr._length_code[qe],xe(pe+I9+1,Me),it=mr.extra_lbits[pe],it!==0&&(qe-=mr.base_length[pe],ce(qe,it)),je--,pe=mr.d_code(je),xe(pe,Fe),it=mr.extra_dbits[pe],it!==0&&(je-=mr.base_dist[pe],ce(je,it)));while(Ze<we);xe(Vv,Me),Ce=Me[Vv*2+1]}function $(){ze>8?ee(Te):ze>0&&Ye(Te&255),Te=0,ze=0}function ge(Me,Fe,je){$(),Ce=8,ee(Fe),ee(~Fe),t.pending_buf.set(l.subarray(Me,Me+Fe),t.pending),t.pending+=Fe}function Ee(Me,Fe,je){ce((Xsi<<1)+(je?1:0),3),ge(Me,Fe)}function ae(Me,Fe,je){let qe,Ze,pe=0;T>0?(J.build_tree(t),te.build_tree(t),pe=Xe(),qe=t.opt_len+3+7>>>3,Ze=t.static_len+3+7>>>3,Ze<=qe&&(qe=Ze)):qe=Ze=Fe+5,Fe+4<=qe&&Me!=-1?Ee(Me,Fe,je):Ze==qe?(ce((UT<<1)+(je?1:0),3),j(Lo.static_ltree,Lo.static_dtree)):(ce((Ysi<<1)+(je?1:0),3),G(J.max_code+1,te.max_code+1,pe+1),j(H,N)),Ie(),je&&$()}function fe(Me){ae(m>=0?m:-1,x-m,Me),m=x,e.flush_pending()}function Je(){let Me,Fe,je,qe;do{if(qe=c-P-x,qe===0&&x===0&&P===0)qe=o;else if(qe==-1)qe--;else if(x>=o+o-as){l.set(l.subarray(o,o+o),0),k-=o,x-=o,m-=o,Me=f,je=Me;do Fe=u[--je]&65535,u[je]=Fe>=o?Fe-o:0;while(--Me!==0);Me=o,je=Me;do Fe=d[--je]&65535,d[je]=Fe>=o?Fe-o:0;while(--Me!==0);qe+=o}if(e.avail_in===0)return;Me=e.read_buf(l,x+P,qe),P+=Me,P>=kr&&(h=l[x]&255,h=(h<<g^l[x+1]&255)&p)}while(P<as&&e.avail_in!==0)}function Oe(Me){let Fe=65535,je;for(Fe>r-5&&(Fe=r-5);;){if(P<=1){if(Je(),P===0&&Me==P2)return da;if(P===0)break}if(x+=P,P=0,je=m+Fe,(x===0||x>=je)&&(P=x-je,x=je,fe(!1),e.avail_out===0)||x-m>=o-as&&(fe(!1),e.avail_out===0))return da}return fe(Me==Un),e.avail_out===0?Me==Un?zv:da:Me==Un?U9:O9}function Be(Me){let Fe=B,je=x,qe,Ze,pe=E;const it=x>o-as?x-(o-as):0;let Re=U;const He=a,be=x+j9;let lt=l[je+pe-1],ht=l[je+pe];E>=O&&(Fe>>=2),Re>P&&(Re=P);do if(qe=Me,!(l[qe+pe]!=ht||l[qe+pe-1]!=lt||l[qe]!=l[je]||l[++qe]!=l[je+1])){je+=2,qe++;do;while(l[++je]==l[++qe]&&l[++je]==l[++qe]&&l[++je]==l[++qe]&&l[++je]==l[++qe]&&l[++je]==l[++qe]&&l[++je]==l[++qe]&&l[++je]==l[++qe]&&l[++je]==l[++qe]&&je<be);if(Ze=j9-(be-je),je=be-j9,Ze>pe){if(k=Me,pe=Ze,Ze>=Re)break;lt=l[je+pe-1],ht=l[je+pe]}}while((Me=d[Me&He]&65535)>it&&--Fe!==0);return pe<=P?pe:P}function $e(Me){let Fe=0,je;for(;;){if(P<as){if(Je(),P<as&&Me==P2)return da;if(P===0)break}if(P>=kr&&(h=(h<<g^l[x+(kr-1)]&255)&p,Fe=u[h]&65535,d[x&a]=u[h],u[h]=x),Fe!==0&&(x-Fe&65535)<=o-as&&L!=T9&&(w=Be(Fe)),w>=kr)if(je=q(x-k,w-kr),P-=w,w<=I&&P>=kr){w--;do x++,h=(h<<g^l[x+(kr-1)]&255)&p,Fe=u[h]&65535,d[x&a]=u[h],u[h]=x;while(--w!==0);x++}else x+=w,w=0,h=l[x]&255,h=(h<<g^l[x+1]&255)&p;else je=q(0,l[x]&255),P--,x++;if(je&&(fe(!1),e.avail_out===0))return da}return fe(Me==Un),e.avail_out===0?Me==Un?zv:da:Me==Un?U9:O9}function Pe(Me){let Fe=0,je,qe;for(;;){if(P<as){if(Je(),P<as&&Me==P2)return da;if(P===0)break}if(P>=kr&&(h=(h<<g^l[x+(kr-1)]&255)&p,Fe=u[h]&65535,d[x&a]=u[h],u[h]=x),E=w,y=k,w=kr-1,Fe!==0&&E<I&&(x-Fe&65535)<=o-as&&(L!=T9&&(w=Be(Fe)),w<=5&&(L==jsi||w==kr&&x-k>4096)&&(w=kr-1)),E>=kr&&w<=E){qe=x+P-kr,je=q(x-1-y,E-kr),P-=E-1,E-=2;do++x<=qe&&(h=(h<<g^l[x+(kr-1)]&255)&p,Fe=u[h]&65535,d[x&a]=u[h],u[h]=x);while(--E!==0);if(v=0,w=kr-1,x++,je&&(fe(!1),e.avail_out===0))return da}else if(v!==0){if(je=q(0,l[x-1]&255),je&&fe(!1),x++,P--,e.avail_out===0)return da}else v=1,x++,P--}return v!==0&&(je=q(0,l[x-1]&255),v=0),fe(Me==Un),e.avail_out===0?Me==Un?zv:da:Me==Un?U9:O9}function dt(Me){return Me.total_in=Me.total_out=0,Me.msg=null,t.pending=0,t.pending_out=0,i=N9,n=P2,ye(),ne(),aa}t.deflateInit=function(Me,Fe,je,qe,Ze,pe){return qe||(qe=OT),Ze||(Ze=Wsi),pe||(pe=Vsi),Me.msg=null,Fe==S9&&(Fe=6),Ze<1||Ze>Zsi||qe!=OT||je<9||je>15||Fe<0||Fe>9||pe<0||pe>T9?la:(Me.dstate=t,s=je,o=1<<s,a=o-1,A=Ze+7,f=1<<A,p=f-1,g=Math.floor((A+kr-1)/kr),l=new Uint8Array(o*2),d=[],u=[],Le=1<<Ze+6,t.pending_buf=new Uint8Array(Le*4),r=Le*4,t.dist_buf=new Uint16Array(Le),t.lc_buf=new Uint8Array(Le),T=Fe,L=pe,dt(Me))},t.deflateEnd=function(){return i!=_T&&i!=N9&&i!=Hv?la:(t.lc_buf=null,t.dist_buf=null,t.pending_buf=null,u=null,d=null,l=null,t.dstate=null,i==N9?Hsi:aa)},t.deflateParams=function(Me,Fe,je){let qe=aa;return Fe==S9&&(Fe=6),Fe<0||Fe>9||je<0||je>T9?la:(ca[T].func!=ca[Fe].func&&Me.total_in!==0&&(qe=Me.deflate(vle)),T!=Fe&&(T=Fe,I=ca[T].max_lazy,O=ca[T].good_length,U=ca[T].nice_length,B=ca[T].max_chain),L=je,qe)},t.deflateSetDictionary=function(Me,Fe,je){let qe=je,Ze,pe=0;if(!Fe||i!=_T)return la;if(qe<kr)return aa;for(qe>o-as&&(qe=o-as,pe=je-qe),l.set(Fe.subarray(pe,pe+qe),0),x=qe,m=qe,h=l[0]&255,h=(h<<g^l[1]&255)&p,Ze=0;Ze<=qe-kr;Ze++)h=(h<<g^l[Ze+(kr-1)]&255)&p,d[Ze&a]=u[h],u[h]=Ze;return aa},t.deflate=function(Me,Fe){let je,qe,Ze,pe,it;if(Fe>Un||Fe<0)return la;if(!Me.next_out||!Me.next_in&&Me.avail_in!==0||i==Hv&&Fe!=Un)return Me.msg=_9[D9-la],la;if(Me.avail_out===0)return Me.msg=_9[D9-E2],E2;if(e=Me,pe=n,n=Fe,i==_T&&(qe=OT+(s-8<<4)<<8,Ze=(T-1&255)>>1,Ze>3&&(Ze=3),qe|=Ze<<6,x!==0&&(qe|=Jsi),qe+=31-qe%31,i=N9,Q(qe)),t.pending!==0){if(e.flush_pending(),e.avail_out===0)return n=-1,aa}else if(e.avail_in===0&&Fe<=pe&&Fe!=Un)return e.msg=_9[D9-E2],E2;if(i==Hv&&e.avail_in!==0)return Me.msg=_9[D9-E2],E2;if(e.avail_in!==0||P!==0||Fe!=P2&&i!=Hv){switch(it=-1,ca[T].func){case wle:it=Oe(Fe);break;case F9:it=$e(Fe);break;case th:it=Pe(Fe);break}if((it==zv||it==U9)&&(i=Hv),it==da||it==zv)return e.avail_out===0&&(n=-1),aa;if(it==O9){if(Fe==vle)ie();else if(Ee(0,0,!1),Fe==zsi)for(je=0;je<f;je++)u[je]=0;if(e.flush_pending(),e.avail_out===0)return n=-1,aa}}return Fe!=Un?aa:yle}}function xle(){const t=this;t.next_in_index=0,t.next_out_index=0,t.avail_in=0,t.total_in=0,t.avail_out=0,t.total_out=0}xle.prototype={deflateInit(t,e){const i=this;return i.dstate=new $si,e||(e=jv),i.dstate.deflateInit(i,t,e)},deflate(t){const e=this;return e.dstate?e.dstate.deflate(e,t):la},deflateEnd(){const t=this;if(!t.dstate)return la;const e=t.dstate.deflateEnd();return t.dstate=null,e},deflateParams(t,e){const i=this;return i.dstate?i.dstate.deflateParams(i,t,e):la},deflateSetDictionary(t,e){const i=this;return i.dstate?i.dstate.deflateSetDictionary(i,t,e):la},read_buf(t,e,i){const r=this;let n=r.avail_in;return n>i&&(n=i),n===0?0:(r.avail_in-=n,t.set(r.next_in.subarray(r.next_in_index,r.next_in_index+n),e),r.next_in_index+=n,r.total_in+=n,n)},flush_pending(){const t=this;let e=t.dstate.pending;e>t.avail_out&&(e=t.avail_out),e!==0&&(t.next_out.set(t.dstate.pending_buf.subarray(t.dstate.pending_out,t.dstate.pending_out+e),t.next_out_index),t.next_out_index+=e,t.dstate.pending_out+=e,t.total_out+=e,t.avail_out-=e,t.dstate.pending-=e,t.dstate.pending===0&&(t.dstate.pending_out=0))}};function eai(t){const e=this,i=new xle,r=tai(t&&t.chunkSize?t.chunkSize:64*1024),n=P2,o=new Uint8Array(r);let s=t?t.level:S9;typeof s>"u"&&(s=S9),i.deflateInit(s),i.next_out=o,e.append=function(a,l){let c,d,u=0,h=0,f=0;const A=[];if(a.length){i.next_in_index=0,i.next_in=a,i.avail_in=a.length;do{if(i.next_out_index=0,i.avail_out=r,c=i.deflate(n),c!=aa)throw new Error("deflating: "+i.msg);i.next_out_index&&(i.next_out_index==r?A.push(new Uint8Array(o)):A.push(o.subarray(0,i.next_out_index))),f+=i.next_out_index,l&&i.next_in_index>0&&i.next_in_index!=u&&(l(i.next_in_index),u=i.next_in_index)}while(i.avail_in>0||i.avail_out===0);return A.length>1?(d=new Uint8Array(f),A.forEach(function(p){d.set(p,h),h+=p.length})):d=A[0]?new Uint8Array(A[0]):new Uint8Array,d}},e.flush=function(){let a,l,c=0,d=0;const u=[];do{if(i.next_out_index=0,i.avail_out=r,a=i.deflate(Un),a!=yle&&a!=aa)throw new Error("deflating: "+i.msg);r-i.avail_out>0&&u.push(o.slice(0,i.next_out_index)),d+=i.next_out_index}while(i.avail_in>0||i.avail_out===0);return i.deflateEnd(),l=new Uint8Array(d),u.forEach(function(h){l.set(h,c),c+=h.length}),l}}function tai(t){return t+5*(Math.floor(t/16383)+1)}const iai=15,Di=0,sc=1,rai=2,Nn=-2,gr=-3,kle=-4,ac=-5,ls=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],Mle=1440,oai=0,nai=4,sai=9,aai=5,lai=[96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,192,80,7,10,0,8,96,0,8,32,0,9,160,0,8,0,0,8,128,0,8,64,0,9,224,80,7,6,0,8,88,0,8,24,0,9,144,83,7,59,0,8,120,0,8,56,0,9,208,81,7,17,0,8,104,0,8,40,0,9,176,0,8,8,0,8,136,0,8,72,0,9,240,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,200,81,7,13,0,8,100,0,8,36,0,9,168,0,8,4,0,8,132,0,8,68,0,9,232,80,7,8,0,8,92,0,8,28,0,9,152,84,7,83,0,8,124,0,8,60,0,9,216,82,7,23,0,8,108,0,8,44,0,9,184,0,8,12,0,8,140,0,8,76,0,9,248,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,196,81,7,11,0,8,98,0,8,34,0,9,164,0,8,2,0,8,130,0,8,66,0,9,228,80,7,7,0,8,90,0,8,26,0,9,148,84,7,67,0,8,122,0,8,58,0,9,212,82,7,19,0,8,106,0,8,42,0,9,180,0,8,10,0,8,138,0,8,74,0,9,244,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,204,81,7,15,0,8,102,0,8,38,0,9,172,0,8,6,0,8,134,0,8,70,0,9,236,80,7,9,0,8,94,0,8,30,0,9,156,84,7,99,0,8,126,0,8,62,0,9,220,82,7,27,0,8,110,0,8,46,0,9,188,0,8,14,0,8,142,0,8,78,0,9,252,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,194,80,7,10,0,8,97,0,8,33,0,9,162,0,8,1,0,8,129,0,8,65,0,9,226,80,7,6,0,8,89,0,8,25,0,9,146,83,7,59,0,8,121,0,8,57,0,9,210,81,7,17,0,8,105,0,8,41,0,9,178,0,8,9,0,8,137,0,8,73,0,9,242,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,202,81,7,13,0,8,101,0,8,37,0,9,170,0,8,5,0,8,133,0,8,69,0,9,234,80,7,8,0,8,93,0,8,29,0,9,154,84,7,83,0,8,125,0,8,61,0,9,218,82,7,23,0,8,109,0,8,45,0,9,186,0,8,13,0,8,141,0,8,77,0,9,250,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,198,81,7,11,0,8,99,0,8,35,0,9,166,0,8,3,0,8,131,0,8,67,0,9,230,80,7,7,0,8,91,0,8,27,0,9,150,84,7,67,0,8,123,0,8,59,0,9,214,82,7,19,0,8,107,0,8,43,0,9,182,0,8,11,0,8,139,0,8,75,0,9,246,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,206,81,7,15,0,8,103,0,8,39,0,9,174,0,8,7,0,8,135,0,8,71,0,9,238,80,7,9,0,8,95,0,8,31,0,9,158,84,7,99,0,8,127,0,8,63,0,9,222,82,7,27,0,8,111,0,8,47,0,9,190,0,8,15,0,8,143,0,8,79,0,9,254,96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,193,80,7,10,0,8,96,0,8,32,0,9,161,0,8,0,0,8,128,0,8,64,0,9,225,80,7,6,0,8,88,0,8,24,0,9,145,83,7,59,0,8,120,0,8,56,0,9,209,81,7,17,0,8,104,0,8,40,0,9,177,0,8,8,0,8,136,0,8,72,0,9,241,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,201,81,7,13,0,8,100,0,8,36,0,9,169,0,8,4,0,8,132,0,8,68,0,9,233,80,7,8,0,8,92,0,8,28,0,9,153,84,7,83,0,8,124,0,8,60,0,9,217,82,7,23,0,8,108,0,8,44,0,9,185,0,8,12,0,8,140,0,8,76,0,9,249,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,197,81,7,11,0,8,98,0,8,34,0,9,165,0,8,2,0,8,130,0,8,66,0,9,229,80,7,7,0,8,90,0,8,26,0,9,149,84,7,67,0,8,122,0,8,58,0,9,213,82,7,19,0,8,106,0,8,42,0,9,181,0,8,10,0,8,138,0,8,74,0,9,245,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,205,81,7,15,0,8,102,0,8,38,0,9,173,0,8,6,0,8,134,0,8,70,0,9,237,80,7,9,0,8,94,0,8,30,0,9,157,84,7,99,0,8,126,0,8,62,0,9,221,82,7,27,0,8,110,0,8,46,0,9,189,0,8,14,0,8,142,0,8,78,0,9,253,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,195,80,7,10,0,8,97,0,8,33,0,9,163,0,8,1,0,8,129,0,8,65,0,9,227,80,7,6,0,8,89,0,8,25,0,9,147,83,7,59,0,8,121,0,8,57,0,9,211,81,7,17,0,8,105,0,8,41,0,9,179,0,8,9,0,8,137,0,8,73,0,9,243,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,203,81,7,13,0,8,101,0,8,37,0,9,171,0,8,5,0,8,133,0,8,69,0,9,235,80,7,8,0,8,93,0,8,29,0,9,155,84,7,83,0,8,125,0,8,61,0,9,219,82,7,23,0,8,109,0,8,45,0,9,187,0,8,13,0,8,141,0,8,77,0,9,251,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,199,81,7,11,0,8,99,0,8,35,0,9,167,0,8,3,0,8,131,0,8,67,0,9,231,80,7,7,0,8,91,0,8,27,0,9,151,84,7,67,0,8,123,0,8,59,0,9,215,82,7,19,0,8,107,0,8,43,0,9,183,0,8,11,0,8,139,0,8,75,0,9,247,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,207,81,7,15,0,8,103,0,8,39,0,9,175,0,8,7,0,8,135,0,8,71,0,9,239,80,7,9,0,8,95,0,8,31,0,9,159,84,7,99,0,8,127,0,8,63,0,9,223,82,7,27,0,8,111,0,8,47,0,9,191,0,8,15,0,8,143,0,8,79,0,9,255],cai=[80,5,1,87,5,257,83,5,17,91,5,4097,81,5,5,89,5,1025,85,5,65,93,5,16385,80,5,3,88,5,513,84,5,33,92,5,8193,82,5,9,90,5,2049,86,5,129,192,5,24577,80,5,2,87,5,385,83,5,25,91,5,6145,81,5,7,89,5,1537,85,5,97,93,5,24577,80,5,4,88,5,769,84,5,49,92,5,12289,82,5,13,90,5,3073,86,5,193,192,5,24577],dai=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],uai=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,112,112],hai=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],pai=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],Sd=15;function NT(){const t=this;let e,i,r,n,o,s;function a(c,d,u,h,f,A,p,g,m,w,y){let v,x,k,P,E,B,I,T,L,O,U,H,N,W,J;O=0,E=u;do r[c[d+O]]++,O++,E--;while(E!==0);if(r[0]==u)return p[0]=-1,g[0]=0,Di;for(T=g[0],B=1;B<=Sd&&r[B]===0;B++);for(I=B,T<B&&(T=B),E=Sd;E!==0&&r[E]===0;E--);for(k=E,T>E&&(T=E),g[0]=T,W=1<<B;B<E;B++,W<<=1)if((W-=r[B])<0)return gr;if((W-=r[E])<0)return gr;for(r[E]+=W,s[1]=B=0,O=1,N=2;--E!==0;)s[N]=B+=r[O],N++,O++;E=0,O=0;do(B=c[d+O])!==0&&(y[s[B]++]=E),O++;while(++E<u);for(u=s[k],s[0]=E=0,O=0,P=-1,H=-T,o[0]=0,U=0,J=0;I<=k;I++)for(v=r[I];v--!==0;){for(;I>H+T;){if(P++,H+=T,J=k-H,J=J>T?T:J,(x=1<<(B=I-H))>v+1&&(x-=v+1,N=I,B<J))for(;++B<J&&!((x<<=1)<=r[++N]);)x-=r[N];if(J=1<<B,w[0]+J>Mle)return gr;o[P]=U=w[0],w[0]+=J,P!==0?(s[P]=E,n[0]=B,n[1]=T,B=E>>>H-T,n[2]=U-o[P-1]-B,m.set(n,(o[P-1]+B)*3)):p[0]=U}for(n[1]=I-H,O>=u?n[0]=192:y[O]<h?(n[0]=y[O]<256?0:96,n[2]=y[O++]):(n[0]=A[y[O]-h]+16+64,n[2]=f[y[O++]-h]),x=1<<I-H,B=E>>>H;B<J;B+=x)m.set(n,(U+B)*3);for(B=1<<I-1;E&B;B>>>=1)E^=B;for(E^=B,L=(1<<H)-1;(E&L)!=s[P];)P--,H-=T,L=(1<<H)-1}return W!==0&&k!=1?ac:Di}function l(c){let d;for(e||(e=[],i=[],r=new Int32Array(Sd+1),n=[],o=new Int32Array(Sd),s=new Int32Array(Sd+1)),i.length<c&&(i=[]),d=0;d<c;d++)i[d]=0;for(d=0;d<Sd+1;d++)r[d]=0;for(d=0;d<3;d++)n[d]=0;o.set(r.subarray(0,Sd),0),s.set(r.subarray(0,Sd+1),0)}t.inflate_trees_bits=function(c,d,u,h,f){let A;return l(19),e[0]=0,A=a(c,0,19,19,null,null,u,d,h,e,i),A==gr?f.msg="oversubscribed dynamic bit lengths tree":(A==ac||d[0]===0)&&(f.msg="incomplete dynamic bit lengths tree",A=gr),A},t.inflate_trees_dynamic=function(c,d,u,h,f,A,p,g,m){let w;return l(288),e[0]=0,w=a(u,0,c,257,dai,uai,A,h,g,e,i),w!=Di||h[0]===0?(w==gr?m.msg="oversubscribed literal/length tree":w!=kle&&(m.msg="incomplete literal/length tree",w=gr),w):(l(288),w=a(u,c,d,0,hai,pai,p,f,g,e,i),w!=Di||f[0]===0&&c>257?(w==gr?m.msg="oversubscribed distance tree":w==ac?(m.msg="incomplete distance tree",w=gr):w!=kle&&(m.msg="empty distance tree with lengths",w=gr),w):Di)}}NT.inflate_trees_fixed=function(t,e,i,r){return t[0]=sai,e[0]=aai,i[0]=lai,r[0]=cai,Di};const V9=0,Ple=1,Ele=2,Ble=3,Ile=4,Sle=5,Tle=6,jT=7,Dle=8,z9=9;function fai(){const t=this;let e,i=0,r,n=0,o=0,s=0,a=0,l=0,c=0,d=0,u,h=0,f,A=0;function p(g,m,w,y,v,x,k,P){let E,B,I,T,L,O,U,H,N,W,J,te,de,Le,we,Ue;U=P.next_in_index,H=P.avail_in,L=k.bitb,O=k.bitk,N=k.write,W=N<k.read?k.read-N-1:k.end-N,J=ls[g],te=ls[m];do{for(;O<20;)H--,L|=(P.read_byte(U++)&255)<<O,O+=8;if(E=L&J,B=w,I=y,Ue=(I+E)*3,(T=B[Ue])===0){L>>=B[Ue+1],O-=B[Ue+1],k.win[N++]=B[Ue+2],W--;continue}do{if(L>>=B[Ue+1],O-=B[Ue+1],T&16){for(T&=15,de=B[Ue+2]+(L&ls[T]),L>>=T,O-=T;O<15;)H--,L|=(P.read_byte(U++)&255)<<O,O+=8;E=L&te,B=v,I=x,Ue=(I+E)*3,T=B[Ue];do if(L>>=B[Ue+1],O-=B[Ue+1],T&16){for(T&=15;O<T;)H--,L|=(P.read_byte(U++)&255)<<O,O+=8;if(Le=B[Ue+2]+(L&ls[T]),L>>=T,O-=T,W-=de,N>=Le)we=N-Le,N-we>0&&2>N-we?(k.win[N++]=k.win[we++],k.win[N++]=k.win[we++],de-=2):(k.win.set(k.win.subarray(we,we+2),N),N+=2,we+=2,de-=2);else{we=N-Le;do we+=k.end;while(we<0);if(T=k.end-we,de>T){if(de-=T,N-we>0&&T>N-we)do k.win[N++]=k.win[we++];while(--T!==0);else k.win.set(k.win.subarray(we,we+T),N),N+=T,we+=T,T=0;we=0}}if(N-we>0&&de>N-we)do k.win[N++]=k.win[we++];while(--de!==0);else k.win.set(k.win.subarray(we,we+de),N),N+=de,we+=de,de=0;break}else if(!(T&64))E+=B[Ue+2],E+=L&ls[T],Ue=(I+E)*3,T=B[Ue];else return P.msg="invalid distance code",de=P.avail_in-H,de=O>>3<de?O>>3:de,H+=de,U-=de,O-=de<<3,k.bitb=L,k.bitk=O,P.avail_in=H,P.total_in+=U-P.next_in_index,P.next_in_index=U,k.write=N,gr;while(!0);break}if(T&64)return T&32?(de=P.avail_in-H,de=O>>3<de?O>>3:de,H+=de,U-=de,O-=de<<3,k.bitb=L,k.bitk=O,P.avail_in=H,P.total_in+=U-P.next_in_index,P.next_in_index=U,k.write=N,sc):(P.msg="invalid literal/length code",de=P.avail_in-H,de=O>>3<de?O>>3:de,H+=de,U-=de,O-=de<<3,k.bitb=L,k.bitk=O,P.avail_in=H,P.total_in+=U-P.next_in_index,P.next_in_index=U,k.write=N,gr);if(E+=B[Ue+2],E+=L&ls[T],Ue=(I+E)*3,(T=B[Ue])===0){L>>=B[Ue+1],O-=B[Ue+1],k.win[N++]=B[Ue+2],W--;break}}while(!0)}while(W>=258&&H>=10);return de=P.avail_in-H,de=O>>3<de?O>>3:de,H+=de,U-=de,O-=de<<3,k.bitb=L,k.bitk=O,P.avail_in=H,P.total_in+=U-P.next_in_index,P.next_in_index=U,k.write=N,Di}t.init=function(g,m,w,y,v,x){e=V9,c=g,d=m,u=w,h=y,f=v,A=x,r=null},t.proc=function(g,m,w){let y,v,x,k=0,P=0,E=0,B,I,T,L;for(E=m.next_in_index,B=m.avail_in,k=g.bitb,P=g.bitk,I=g.write,T=I<g.read?g.read-I-1:g.end-I;;)switch(e){case V9:if(T>=258&&B>=10&&(g.bitb=k,g.bitk=P,m.avail_in=B,m.total_in+=E-m.next_in_index,m.next_in_index=E,g.write=I,w=p(c,d,u,h,f,A,g,m),E=m.next_in_index,B=m.avail_in,k=g.bitb,P=g.bitk,I=g.write,T=I<g.read?g.read-I-1:g.end-I,w!=Di)){e=w==sc?jT:z9;break}o=c,r=u,n=h,e=Ple;case Ple:for(y=o;P<y;){if(B!==0)w=Di;else return g.bitb=k,g.bitk=P,m.avail_in=B,m.total_in+=E-m.next_in_index,m.next_in_index=E,g.write=I,g.inflate_flush(m,w);B--,k|=(m.read_byte(E++)&255)<<P,P+=8}if(v=(n+(k&ls[y]))*3,k>>>=r[v+1],P-=r[v+1],x=r[v],x===0){s=r[v+2],e=Tle;break}if(x&16){a=x&15,i=r[v+2],e=Ele;break}if(!(x&64)){o=x,n=v/3+r[v+2];break}if(x&32){e=jT;break}return e=z9,m.msg="invalid literal/length code",w=gr,g.bitb=k,g.bitk=P,m.avail_in=B,m.total_in+=E-m.next_in_index,m.next_in_index=E,g.write=I,g.inflate_flush(m,w);case Ele:for(y=a;P<y;){if(B!==0)w=Di;else return g.bitb=k,g.bitk=P,m.avail_in=B,m.total_in+=E-m.next_in_index,m.next_in_index=E,g.write=I,g.inflate_flush(m,w);B--,k|=(m.read_byte(E++)&255)<<P,P+=8}i+=k&ls[y],k>>=y,P-=y,o=d,r=f,n=A,e=Ble;case Ble:for(y=o;P<y;){if(B!==0)w=Di;else return g.bitb=k,g.bitk=P,m.avail_in=B,m.total_in+=E-m.next_in_index,m.next_in_index=E,g.write=I,g.inflate_flush(m,w);B--,k|=(m.read_byte(E++)&255)<<P,P+=8}if(v=(n+(k&ls[y]))*3,k>>=r[v+1],P-=r[v+1],x=r[v],x&16){a=x&15,l=r[v+2],e=Ile;break}if(!(x&64)){o=x,n=v/3+r[v+2];break}return e=z9,m.msg="invalid distance code",w=gr,g.bitb=k,g.bitk=P,m.avail_in=B,m.total_in+=E-m.next_in_index,m.next_in_index=E,g.write=I,g.inflate_flush(m,w);case Ile:for(y=a;P<y;){if(B!==0)w=Di;else return g.bitb=k,g.bitk=P,m.avail_in=B,m.total_in+=E-m.next_in_index,m.next_in_index=E,g.write=I,g.inflate_flush(m,w);B--,k|=(m.read_byte(E++)&255)<<P,P+=8}l+=k&ls[y],k>>=y,P-=y,e=Sle;case Sle:for(L=I-l;L<0;)L+=g.end;for(;i!==0;){if(T===0&&(I==g.end&&g.read!==0&&(I=0,T=I<g.read?g.read-I-1:g.end-I),T===0&&(g.write=I,w=g.inflate_flush(m,w),I=g.write,T=I<g.read?g.read-I-1:g.end-I,I==g.end&&g.read!==0&&(I=0,T=I<g.read?g.read-I-1:g.end-I),T===0)))return g.bitb=k,g.bitk=P,m.avail_in=B,m.total_in+=E-m.next_in_index,m.next_in_index=E,g.write=I,g.inflate_flush(m,w);g.win[I++]=g.win[L++],T--,L==g.end&&(L=0),i--}e=V9;break;case Tle:if(T===0&&(I==g.end&&g.read!==0&&(I=0,T=I<g.read?g.read-I-1:g.end-I),T===0&&(g.write=I,w=g.inflate_flush(m,w),I=g.write,T=I<g.read?g.read-I-1:g.end-I,I==g.end&&g.read!==0&&(I=0,T=I<g.read?g.read-I-1:g.end-I),T===0)))return g.bitb=k,g.bitk=P,m.avail_in=B,m.total_in+=E-m.next_in_index,m.next_in_index=E,g.write=I,g.inflate_flush(m,w);w=Di,g.win[I++]=s,T--,e=V9;break;case jT:if(P>7&&(P-=8,B++,E--),g.write=I,w=g.inflate_flush(m,w),I=g.write,T=I<g.read?g.read-I-1:g.end-I,g.read!=g.write)return g.bitb=k,g.bitk=P,m.avail_in=B,m.total_in+=E-m.next_in_index,m.next_in_index=E,g.write=I,g.inflate_flush(m,w);e=Dle;case Dle:return w=sc,g.bitb=k,g.bitk=P,m.avail_in=B,m.total_in+=E-m.next_in_index,m.next_in_index=E,g.write=I,g.inflate_flush(m,w);case z9:return w=gr,g.bitb=k,g.bitk=P,m.avail_in=B,m.total_in+=E-m.next_in_index,m.next_in_index=E,g.write=I,g.inflate_flush(m,w);default:return w=Nn,g.bitb=k,g.bitk=P,m.avail_in=B,m.total_in+=E-m.next_in_index,m.next_in_index=E,g.write=I,g.inflate_flush(m,w)}},t.free=function(){}}const Rle=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],B2=0,VT=1,Lle=2,Fle=3,_le=4,Ole=5,H9=6,q9=7,Ule=8,ih=9;function Aai(t,e){const i=this;let r=B2,n=0,o=0,s=0,a;const l=[0],c=[0],d=new fai;let u=0,h=new Int32Array(Mle*3);const f=0,A=new NT;i.bitk=0,i.bitb=0,i.win=new Uint8Array(e),i.end=e,i.read=0,i.write=0,i.reset=function(p,g){g&&(g[0]=f),r==H9&&d.free(p),r=B2,i.bitk=0,i.bitb=0,i.read=i.write=0},i.reset(t,null),i.inflate_flush=function(p,g){let m,w,y;return w=p.next_out_index,y=i.read,m=(y<=i.write?i.write:i.end)-y,m>p.avail_out&&(m=p.avail_out),m!==0&&g==ac&&(g=Di),p.avail_out-=m,p.total_out+=m,p.next_out.set(i.win.subarray(y,y+m),w),w+=m,y+=m,y==i.end&&(y=0,i.write==i.end&&(i.write=0),m=i.write-y,m>p.avail_out&&(m=p.avail_out),m!==0&&g==ac&&(g=Di),p.avail_out-=m,p.total_out+=m,p.next_out.set(i.win.subarray(y,y+m),w),w+=m,y+=m),p.next_out_index=w,i.read=y,g},i.proc=function(p,g){let m,w,y,v,x,k,P,E;for(v=p.next_in_index,x=p.avail_in,w=i.bitb,y=i.bitk,k=i.write,P=k<i.read?i.read-k-1:i.end-k;;){let B,I,T,L,O,U,H,N;switch(r){case B2:for(;y<3;){if(x!==0)g=Di;else return i.bitb=w,i.bitk=y,p.avail_in=x,p.total_in+=v-p.next_in_index,p.next_in_index=v,i.write=k,i.inflate_flush(p,g);x--,w|=(p.read_byte(v++)&255)<<y,y+=8}switch(m=w&7,u=m&1,m>>>1){case 0:w>>>=3,y-=3,m=y&7,w>>>=m,y-=m,r=VT;break;case 1:B=[],I=[],T=[[]],L=[[]],NT.inflate_trees_fixed(B,I,T,L),d.init(B[0],I[0],T[0],0,L[0],0),w>>>=3,y-=3,r=H9;break;case 2:w>>>=3,y-=3,r=Fle;break;case 3:return w>>>=3,y-=3,r=ih,p.msg="invalid block type",g=gr,i.bitb=w,i.bitk=y,p.avail_in=x,p.total_in+=v-p.next_in_index,p.next_in_index=v,i.write=k,i.inflate_flush(p,g)}break;case VT:for(;y<32;){if(x!==0)g=Di;else return i.bitb=w,i.bitk=y,p.avail_in=x,p.total_in+=v-p.next_in_index,p.next_in_index=v,i.write=k,i.inflate_flush(p,g);x--,w|=(p.read_byte(v++)&255)<<y,y+=8}if((~w>>>16&65535)!=(w&65535))return r=ih,p.msg="invalid stored block lengths",g=gr,i.bitb=w,i.bitk=y,p.avail_in=x,p.total_in+=v-p.next_in_index,p.next_in_index=v,i.write=k,i.inflate_flush(p,g);n=w&65535,w=y=0,r=n!==0?Lle:u!==0?q9:B2;break;case Lle:if(x===0||P===0&&(k==i.end&&i.read!==0&&(k=0,P=k<i.read?i.read-k-1:i.end-k),P===0&&(i.write=k,g=i.inflate_flush(p,g),k=i.write,P=k<i.read?i.read-k-1:i.end-k,k==i.end&&i.read!==0&&(k=0,P=k<i.read?i.read-k-1:i.end-k),P===0)))return i.bitb=w,i.bitk=y,p.avail_in=x,p.total_in+=v-p.next_in_index,p.next_in_index=v,i.write=k,i.inflate_flush(p,g);if(g=Di,m=n,m>x&&(m=x),m>P&&(m=P),i.win.set(p.read_buf(v,m),k),v+=m,x-=m,k+=m,P-=m,(n-=m)!==0)break;r=u!==0?q9:B2;break;case Fle:for(;y<14;){if(x!==0)g=Di;else return i.bitb=w,i.bitk=y,p.avail_in=x,p.total_in+=v-p.next_in_index,p.next_in_index=v,i.write=k,i.inflate_flush(p,g);x--,w|=(p.read_byte(v++)&255)<<y,y+=8}if(o=m=w&16383,(m&31)>29||(m>>5&31)>29)return r=ih,p.msg="too many length or distance symbols",g=gr,i.bitb=w,i.bitk=y,p.avail_in=x,p.total_in+=v-p.next_in_index,p.next_in_index=v,i.write=k,i.inflate_flush(p,g);if(m=258+(m&31)+(m>>5&31),!a||a.length<m)a=[];else for(E=0;E<m;E++)a[E]=0;w>>>=14,y-=14,s=0,r=_le;case _le:for(;s<4+(o>>>10);){for(;y<3;){if(x!==0)g=Di;else return i.bitb=w,i.bitk=y,p.avail_in=x,p.total_in+=v-p.next_in_index,p.next_in_index=v,i.write=k,i.inflate_flush(p,g);x--,w|=(p.read_byte(v++)&255)<<y,y+=8}a[Rle[s++]]=w&7,w>>>=3,y-=3}for(;s<19;)a[Rle[s++]]=0;if(l[0]=7,m=A.inflate_trees_bits(a,l,c,h,p),m!=Di)return g=m,g==gr&&(a=null,r=ih),i.bitb=w,i.bitk=y,p.avail_in=x,p.total_in+=v-p.next_in_index,p.next_in_index=v,i.write=k,i.inflate_flush(p,g);s=0,r=Ole;case Ole:for(;m=o,!(s>=258+(m&31)+(m>>5&31));){let W,J;for(m=l[0];y<m;){if(x!==0)g=Di;else return i.bitb=w,i.bitk=y,p.avail_in=x,p.total_in+=v-p.next_in_index,p.next_in_index=v,i.write=k,i.inflate_flush(p,g);x--,w|=(p.read_byte(v++)&255)<<y,y+=8}if(m=h[(c[0]+(w&ls[m]))*3+1],J=h[(c[0]+(w&ls[m]))*3+2],J<16)w>>>=m,y-=m,a[s++]=J;else{for(E=J==18?7:J-14,W=J==18?11:3;y<m+E;){if(x!==0)g=Di;else return i.bitb=w,i.bitk=y,p.avail_in=x,p.total_in+=v-p.next_in_index,p.next_in_index=v,i.write=k,i.inflate_flush(p,g);x--,w|=(p.read_byte(v++)&255)<<y,y+=8}if(w>>>=m,y-=m,W+=w&ls[E],w>>>=E,y-=E,E=s,m=o,E+W>258+(m&31)+(m>>5&31)||J==16&&E<1)return a=null,r=ih,p.msg="invalid bit length repeat",g=gr,i.bitb=w,i.bitk=y,p.avail_in=x,p.total_in+=v-p.next_in_index,p.next_in_index=v,i.write=k,i.inflate_flush(p,g);J=J==16?a[E-1]:0;do a[E++]=J;while(--W!==0);s=E}}if(c[0]=-1,O=[],U=[],H=[],N=[],O[0]=9,U[0]=6,m=o,m=A.inflate_trees_dynamic(257+(m&31),1+(m>>5&31),a,O,U,H,N,h,p),m!=Di)return m==gr&&(a=null,r=ih),g=m,i.bitb=w,i.bitk=y,p.avail_in=x,p.total_in+=v-p.next_in_index,p.next_in_index=v,i.write=k,i.inflate_flush(p,g);d.init(O[0],U[0],h,H[0],h,N[0]),r=H9;case H9:if(i.bitb=w,i.bitk=y,p.avail_in=x,p.total_in+=v-p.next_in_index,p.next_in_index=v,i.write=k,(g=d.proc(i,p,g))!=sc)return i.inflate_flush(p,g);if(g=Di,d.free(p),v=p.next_in_index,x=p.avail_in,w=i.bitb,y=i.bitk,k=i.write,P=k<i.read?i.read-k-1:i.end-k,u===0){r=B2;break}r=q9;case q9:if(i.write=k,g=i.inflate_flush(p,g),k=i.write,P=k<i.read?i.read-k-1:i.end-k,i.read!=i.write)return i.bitb=w,i.bitk=y,p.avail_in=x,p.total_in+=v-p.next_in_index,p.next_in_index=v,i.write=k,i.inflate_flush(p,g);r=Ule;case Ule:return g=sc,i.bitb=w,i.bitk=y,p.avail_in=x,p.total_in+=v-p.next_in_index,p.next_in_index=v,i.write=k,i.inflate_flush(p,g);case ih:return g=gr,i.bitb=w,i.bitk=y,p.avail_in=x,p.total_in+=v-p.next_in_index,p.next_in_index=v,i.write=k,i.inflate_flush(p,g);default:return g=Nn,i.bitb=w,i.bitk=y,p.avail_in=x,p.total_in+=v-p.next_in_index,p.next_in_index=v,i.write=k,i.inflate_flush(p,g)}}},i.free=function(p){i.reset(p,null),i.win=null,h=null},i.set_dictionary=function(p,g,m){i.win.set(p.subarray(g,g+m),0),i.read=i.write=m},i.sync_point=function(){return r==VT?1:0}}const mai=32,gai=8,vai=0,Nle=1,jle=2,Vle=3,zle=4,Hle=5,zT=6,qv=7,qle=12,Td=13,yai=[0,0,255,255];function bai(){const t=this;t.mode=0,t.method=0,t.was=[0],t.need=0,t.marker=0,t.wbits=0;function e(i){return!i||!i.istate?Nn:(i.total_in=i.total_out=0,i.msg=null,i.istate.mode=qv,i.istate.blocks.reset(i,null),Di)}t.inflateEnd=function(i){return t.blocks&&t.blocks.free(i),t.blocks=null,Di},t.inflateInit=function(i,r){return i.msg=null,t.blocks=null,r<8||r>15?(t.inflateEnd(i),Nn):(t.wbits=r,i.istate.blocks=new Aai(i,1<<r),e(i),Di)},t.inflate=function(i,r){let n,o;if(!i||!i.istate||!i.next_in)return Nn;const s=i.istate;for(r=r==nai?ac:Di,n=ac;;)switch(s.mode){case vai:if(i.avail_in===0)return n;if(n=r,i.avail_in--,i.total_in++,((s.method=i.read_byte(i.next_in_index++))&15)!=gai){s.mode=Td,i.msg="unknown compression method",s.marker=5;break}if((s.method>>4)+8>s.wbits){s.mode=Td,i.msg="invalid win size",s.marker=5;break}s.mode=Nle;case Nle:if(i.avail_in===0)return n;if(n=r,i.avail_in--,i.total_in++,o=i.read_byte(i.next_in_index++)&255,((s.method<<8)+o)%31!==0){s.mode=Td,i.msg="incorrect header check",s.marker=5;break}if(!(o&mai)){s.mode=qv;break}s.mode=jle;case jle:if(i.avail_in===0)return n;n=r,i.avail_in--,i.total_in++,s.need=(i.read_byte(i.next_in_index++)&255)<<24&4278190080,s.mode=Vle;case Vle:if(i.avail_in===0)return n;n=r,i.avail_in--,i.total_in++,s.need+=(i.read_byte(i.next_in_index++)&255)<<16&16711680,s.mode=zle;case zle:if(i.avail_in===0)return n;n=r,i.avail_in--,i.total_in++,s.need+=(i.read_byte(i.next_in_index++)&255)<<8&65280,s.mode=Hle;case Hle:return i.avail_in===0?n:(n=r,i.avail_in--,i.total_in++,s.need+=i.read_byte(i.next_in_index++)&255,s.mode=zT,rai);case zT:return s.mode=Td,i.msg="need dictionary",s.marker=0,Nn;case qv:if(n=s.blocks.proc(i,n),n==gr){s.mode=Td,s.marker=0;break}if(n==Di&&(n=r),n!=sc)return n;n=r,s.blocks.reset(i,s.was),s.mode=qle;case qle:return i.avail_in=0,sc;case Td:return gr;default:return Nn}},t.inflateSetDictionary=function(i,r,n){let o=0,s=n;if(!i||!i.istate||i.istate.mode!=zT)return Nn;const a=i.istate;return s>=1<<a.wbits&&(s=(1<<a.wbits)-1,o=n-s),a.blocks.set_dictionary(r,o,s),a.mode=qv,Di},t.inflateSync=function(i){let r,n,o,s,a;if(!i||!i.istate)return Nn;const l=i.istate;if(l.mode!=Td&&(l.mode=Td,l.marker=0),(r=i.avail_in)===0)return ac;for(n=i.next_in_index,o=l.marker;r!==0&&o<4;)i.read_byte(n)==yai[o]?o++:i.read_byte(n)!==0?o=0:o=4-o,n++,r--;return i.total_in+=n-i.next_in_index,i.next_in_index=n,i.avail_in=r,l.marker=o,o!=4?gr:(s=i.total_in,a=i.total_out,e(i),i.total_in=s,i.total_out=a,l.mode=qv,Di)},t.inflateSyncPoint=function(i){return!i||!i.istate||!i.istate.blocks?Nn:i.istate.blocks.sync_point()}}function Gle(){}Gle.prototype={inflateInit(t){const e=this;return e.istate=new bai,t||(t=iai),e.istate.inflateInit(e,t)},inflate(t){const e=this;return e.istate?e.istate.inflate(e,t):Nn},inflateEnd(){const t=this;if(!t.istate)return Nn;const e=t.istate.inflateEnd(t);return t.istate=null,e},inflateSync(){const t=this;return t.istate?t.istate.inflateSync(t):Nn},inflateSetDictionary(t,e){const i=this;return i.istate?i.istate.inflateSetDictionary(i,t,e):Nn},read_byte(t){return this.next_in[t]},read_buf(t,e){return this.next_in.subarray(t,t+e)}};function wai(t){const e=this,i=new Gle,r=t&&t.chunkSize?Math.floor(t.chunkSize*2):128*1024,n=oai,o=new Uint8Array(r);let s=!1;i.inflateInit(),i.next_out=o,e.append=function(a,l){const c=[];let d,u,h=0,f=0,A=0;if(a.length!==0){i.next_in_index=0,i.next_in=a,i.avail_in=a.length;do{if(i.next_out_index=0,i.avail_out=r,i.avail_in===0&&!s&&(i.next_in_index=0,s=!0),d=i.inflate(n),s&&d===ac){if(i.avail_in!==0)throw new Error("inflating: bad input")}else if(d!==Di&&d!==sc)throw new Error("inflating: "+i.msg);if((s||d===sc)&&i.avail_in===a.length)throw new Error("inflating: bad input");i.next_out_index&&(i.next_out_index===r?c.push(new Uint8Array(o)):c.push(o.subarray(0,i.next_out_index))),A+=i.next_out_index,l&&i.next_in_index>0&&i.next_in_index!=h&&(l(i.next_in_index),h=i.next_in_index)}while(i.avail_in>0||i.avail_out===0);return c.length>1?(u=new Uint8Array(A),c.forEach(function(p){u.set(p,f),f+=p.length})):u=c[0]?new Uint8Array(c[0]):new Uint8Array,u}},e.flush=function(){i.inflateEnd()}}const rh=4294967295,Dd=65535,Cai=8,xai=0,kai=99,Mai=67324752,Pai=134695760,Qle=33639248,Eai=101010256,Kle=101075792,Bai=117853008,I2=22,HT=20,qT=56,Iai=1,Sai=39169,Tai=10,Dai=1,Rai=21589,Lai=28789,Fai=25461,_ai=6534,Zle=1,Oai=6,Wle=8,Jle=2048,Xle=16,Yle=16384,$le=73,ece="/",pn=void 0,Rd="undefined",Gv="function";class tce{constructor(e){return class extends TransformStream{constructor(i,r){const n=new e(r);super({transform(o,s){s.enqueue(n.append(o))},flush(o){const s=n.flush();s&&o.enqueue(s)}})}}}}const Uai=64;let ice=2;try{typeof navigator!=Rd&&navigator.hardwareConcurrency&&(ice=navigator.hardwareConcurrency)}catch{}const Nai={chunkSize:512*1024,maxWorkers:ice,terminateWorkerTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,workerScripts:pn,CompressionStreamNative:typeof CompressionStream!=Rd&&CompressionStream,DecompressionStreamNative:typeof DecompressionStream!=Rd&&DecompressionStream},Ld=Object.assign({},Nai);function jai(){return Ld}function Vai(t){return Math.max(t.chunkSize,Uai)}function GT(t){const{baseURL:e,chunkSize:i,maxWorkers:r,terminateWorkerTimeout:n,useCompressionStream:o,useWebWorkers:s,Deflate:a,Inflate:l,CompressionStream:c,DecompressionStream:d,workerScripts:u}=t;if(Fd("baseURL",e),Fd("chunkSize",i),Fd("maxWorkers",r),Fd("terminateWorkerTimeout",n),Fd("useCompressionStream",o),Fd("useWebWorkers",s),a&&(Ld.CompressionStream=new tce(a)),l&&(Ld.DecompressionStream=new tce(l)),Fd("CompressionStream",c),Fd("DecompressionStream",d),u!==pn){const{deflate:h,inflate:f}=u;if((h||f)&&(Ld.workerScripts||(Ld.workerScripts={})),h){if(!Array.isArray(h))throw new Error("workerScripts.deflate must be an array");Ld.workerScripts.deflate=h}if(f){if(!Array.isArray(f))throw new Error("workerScripts.inflate must be an array");Ld.workerScripts.inflate=f}}}function Fd(t,e){e!==pn&&(Ld[t]=e)}const QT={application:{"andrew-inset":"ez",annodex:"anx","atom+xml":"atom","atomcat+xml":"atomcat","atomserv+xml":"atomsrv",bbolin:"lin","cu-seeme":"cu","davmount+xml":"davmount",dsptype:"tsp",ecmascript:["es","ecma"],futuresplash:"spl",hta:"hta","java-archive":"jar","java-serialized-object":"ser","java-vm":"class",m3g:"m3g","mac-binhex40":"hqx",mathematica:["nb","ma","mb"],msaccess:"mdb",msword:["doc","dot","wiz"],mxf:"mxf",oda:"oda",ogg:"ogx",pdf:"pdf","pgp-keys":"key","pgp-signature":["asc","sig"],"pics-rules":"prf",postscript:["ps","ai","eps","epsi","epsf","eps2","eps3"],rar:"rar","rdf+xml":"rdf","rss+xml":"rss",rtf:"rtf","xhtml+xml":["xhtml","xht"],xml:["xml","xsl","xsd","xpdl"],"xspf+xml":"xspf",zip:"zip","vnd.android.package-archive":"apk","vnd.cinderella":"cdy","vnd.google-earth.kml+xml":"kml","vnd.google-earth.kmz":"kmz","vnd.mozilla.xul+xml":"xul","vnd.ms-excel":["xls","xlb","xlt","xlm","xla","xlc","xlw"],"vnd.ms-pki.seccat":"cat","vnd.ms-pki.stl":"stl","vnd.ms-powerpoint":["ppt","pps","pot","ppa","pwz"],"vnd.oasis.opendocument.chart":"odc","vnd.oasis.opendocument.database":"odb","vnd.oasis.opendocument.formula":"odf","vnd.oasis.opendocument.graphics":"odg","vnd.oasis.opendocument.graphics-template":"otg","vnd.oasis.opendocument.image":"odi","vnd.oasis.opendocument.presentation":"odp","vnd.oasis.opendocument.presentation-template":"otp","vnd.oasis.opendocument.spreadsheet":"ods","vnd.oasis.opendocument.spreadsheet-template":"ots","vnd.oasis.opendocument.text":"odt","vnd.oasis.opendocument.text-master":["odm","otm"],"vnd.oasis.opendocument.text-template":"ott","vnd.oasis.opendocument.text-web":"oth","vnd.openxmlformats-officedocument.spreadsheetml.sheet":"xlsx","vnd.openxmlformats-officedocument.spreadsheetml.template":"xltx","vnd.openxmlformats-officedocument.presentationml.presentation":"pptx","vnd.openxmlformats-officedocument.presentationml.slideshow":"ppsx","vnd.openxmlformats-officedocument.presentationml.template":"potx","vnd.openxmlformats-officedocument.wordprocessingml.document":"docx","vnd.openxmlformats-officedocument.wordprocessingml.template":"dotx","vnd.smaf":"mmf","vnd.stardivision.calc":"sdc","vnd.stardivision.chart":"sds","vnd.stardivision.draw":"sda","vnd.stardivision.impress":"sdd","vnd.stardivision.math":["sdf","smf"],"vnd.stardivision.writer":["sdw","vor"],"vnd.stardivision.writer-global":"sgl","vnd.sun.xml.calc":"sxc","vnd.sun.xml.calc.template":"stc","vnd.sun.xml.draw":"sxd","vnd.sun.xml.draw.template":"std","vnd.sun.xml.impress":"sxi","vnd.sun.xml.impress.template":"sti","vnd.sun.xml.math":"sxm","vnd.sun.xml.writer":"sxw","vnd.sun.xml.writer.global":"sxg","vnd.sun.xml.writer.template":"stw","vnd.symbian.install":["sis","sisx"],"vnd.visio":["vsd","vst","vss","vsw","vsdx","vssx","vstx","vssm","vstm"],"vnd.wap.wbxml":"wbxml","vnd.wap.wmlc":"wmlc","vnd.wap.wmlscriptc":"wmlsc","vnd.wordperfect":"wpd","vnd.wordperfect5.1":"wp5","x-123":"wk","x-7z-compressed":"7z","x-abiword":"abw","x-apple-diskimage":"dmg","x-bcpio":"bcpio","x-bittorrent":"torrent","x-cbr":["cbr","cba","cbt","cb7"],"x-cbz":"cbz","x-cdf":["cdf","cda"],"x-cdlink":"vcd","x-chess-pgn":"pgn","x-cpio":"cpio","x-csh":"csh","x-director":["dir","dxr","cst","cct","cxt","w3d","fgd","swa"],"x-dms":"dms","x-doom":"wad","x-dvi":"dvi","x-httpd-eruby":"rhtml","x-font":"pcf.Z","x-freemind":"mm","x-gnumeric":"gnumeric","x-go-sgf":"sgf","x-graphing-calculator":"gcf","x-gtar":["gtar","taz"],"x-hdf":"hdf","x-httpd-php":["phtml","pht","php"],"x-httpd-php-source":"phps","x-httpd-php3":"php3","x-httpd-php3-preprocessed":"php3p","x-httpd-php4":"php4","x-httpd-php5":"php5","x-ica":"ica","x-info":"info","x-internet-signup":["ins","isp"],"x-iphone":"iii","x-iso9660-image":"iso","x-java-jnlp-file":"jnlp","x-jmol":"jmz","x-killustrator":"kil","x-latex":"latex","x-lyx":"lyx","x-lzx":"lzx","x-maker":["frm","fb","fbdoc"],"x-ms-wmd":"wmd","x-msdos-program":["com","exe","bat","dll"],"x-netcdf":["nc"],"x-ns-proxy-autoconfig":["pac","dat"],"x-nwc":"nwc","x-object":"o","x-oz-application":"oza","x-pkcs7-certreqresp":"p7r","x-python-code":["pyc","pyo"],"x-qgis":["qgs","shp","shx"],"x-quicktimeplayer":"qtl","x-redhat-package-manager":["rpm","rpa"],"x-ruby":"rb","x-sh":"sh","x-shar":"shar","x-shockwave-flash":["swf","swfl"],"x-silverlight":"scr","x-stuffit":"sit","x-sv4cpio":"sv4cpio","x-sv4crc":"sv4crc","x-tar":"tar","x-tex-gf":"gf","x-tex-pk":"pk","x-texinfo":["texinfo","texi"],"x-trash":["~","%","bak","old","sik"],"x-ustar":"ustar","x-wais-source":"src","x-wingz":"wz","x-x509-ca-cert":["crt","der","cer"],"x-xcf":"xcf","x-xfig":"fig","x-xpinstall":"xpi",applixware:"aw","atomsvc+xml":"atomsvc","ccxml+xml":"ccxml","cdmi-capability":"cdmia","cdmi-container":"cdmic","cdmi-domain":"cdmid","cdmi-object":"cdmio","cdmi-queue":"cdmiq","docbook+xml":"dbk","dssc+der":"dssc","dssc+xml":"xdssc","emma+xml":"emma","epub+zip":"epub",exi:"exi","font-tdpfr":"pfr","gml+xml":"gml","gpx+xml":"gpx",gxf:"gxf",hyperstudio:"stk","inkml+xml":["ink","inkml"],ipfix:"ipfix","jsonml+json":"jsonml","lost+xml":"lostxml","mads+xml":"mads",marc:"mrc","marcxml+xml":"mrcx","mathml+xml":["mathml","mml"],mbox:"mbox","mediaservercontrol+xml":"mscml","metalink+xml":"metalink","metalink4+xml":"meta4","mets+xml":"mets","mods+xml":"mods",mp21:["m21","mp21"],mp4:"mp4s","oebps-package+xml":"opf","omdoc+xml":"omdoc",onenote:["onetoc","onetoc2","onetmp","onepkg"],oxps:"oxps","patch-ops-error+xml":"xer","pgp-encrypted":"pgp",pkcs10:"p10","pkcs7-mime":["p7m","p7c"],"pkcs7-signature":"p7s",pkcs8:"p8","pkix-attr-cert":"ac","pkix-crl":"crl","pkix-pkipath":"pkipath",pkixcmp:"pki","pls+xml":"pls","prs.cww":"cww","pskc+xml":"pskcxml","reginfo+xml":"rif","relax-ng-compact-syntax":"rnc","resource-lists+xml":"rl","resource-lists-diff+xml":"rld","rls-services+xml":"rs","rpki-ghostbusters":"gbr","rpki-manifest":"mft","rpki-roa":"roa","rsd+xml":"rsd","sbml+xml":"sbml","scvp-cv-request":"scq","scvp-cv-response":"scs","scvp-vp-request":"spq","scvp-vp-response":"spp",sdp:"sdp","set-payment-initiation":"setpay","set-registration-initiation":"setreg","shf+xml":"shf","sparql-query":"rq","sparql-results+xml":"srx",srgs:"gram","srgs+xml":"grxml","sru+xml":"sru","ssdl+xml":"ssdl","ssml+xml":"ssml","tei+xml":["tei","teicorpus"],"thraud+xml":"tfi","timestamped-data":"tsd","vnd.3gpp.pic-bw-large":"plb","vnd.3gpp.pic-bw-small":"psb","vnd.3gpp.pic-bw-var":"pvb","vnd.3gpp2.tcap":"tcap","vnd.3m.post-it-notes":"pwn","vnd.accpac.simply.aso":"aso","vnd.accpac.simply.imp":"imp","vnd.acucobol":"acu","vnd.acucorp":["atc","acutc"],"vnd.adobe.air-application-installer-package+zip":"air","vnd.adobe.formscentral.fcdt":"fcdt","vnd.adobe.fxp":["fxp","fxpl"],"vnd.adobe.xdp+xml":"xdp","vnd.adobe.xfdf":"xfdf","vnd.ahead.space":"ahead","vnd.airzip.filesecure.azf":"azf","vnd.airzip.filesecure.azs":"azs","vnd.amazon.ebook":"azw","vnd.americandynamics.acc":"acc","vnd.amiga.ami":"ami","vnd.anser-web-certificate-issue-initiation":"cii","vnd.anser-web-funds-transfer-initiation":"fti","vnd.antix.game-component":"atx","vnd.apple.installer+xml":"mpkg","vnd.apple.mpegurl":"m3u8","vnd.aristanetworks.swi":"swi","vnd.astraea-software.iota":"iota","vnd.audiograph":"aep","vnd.blueice.multipass":"mpm","vnd.bmi":"bmi","vnd.businessobjects":"rep","vnd.chemdraw+xml":"cdxml","vnd.chipnuts.karaoke-mmd":"mmd","vnd.claymore":"cla","vnd.cloanto.rp9":"rp9","vnd.clonk.c4group":["c4g","c4d","c4f","c4p","c4u"],"vnd.cluetrust.cartomobile-config":"c11amc","vnd.cluetrust.cartomobile-config-pkg":"c11amz","vnd.commonspace":"csp","vnd.contact.cmsg":"cdbcmsg","vnd.cosmocaller":"cmc","vnd.crick.clicker":"clkx","vnd.crick.clicker.keyboard":"clkk","vnd.crick.clicker.palette":"clkp","vnd.crick.clicker.template":"clkt","vnd.crick.clicker.wordbank":"clkw","vnd.criticaltools.wbs+xml":"wbs","vnd.ctc-posml":"pml","vnd.cups-ppd":"ppd","vnd.curl.car":"car","vnd.curl.pcurl":"pcurl","vnd.dart":"dart","vnd.data-vision.rdz":"rdz","vnd.dece.data":["uvf","uvvf","uvd","uvvd"],"vnd.dece.ttml+xml":["uvt","uvvt"],"vnd.dece.unspecified":["uvx","uvvx"],"vnd.dece.zip":["uvz","uvvz"],"vnd.denovo.fcselayout-link":"fe_launch","vnd.dna":"dna","vnd.dolby.mlp":"mlp","vnd.dpgraph":"dpg","vnd.dreamfactory":"dfac","vnd.ds-keypoint":"kpxx","vnd.dvb.ait":"ait","vnd.dvb.service":"svc","vnd.dynageo":"geo","vnd.ecowin.chart":"mag","vnd.enliven":"nml","vnd.epson.esf":"esf","vnd.epson.msf":"msf","vnd.epson.quickanime":"qam","vnd.epson.salt":"slt","vnd.epson.ssf":"ssf","vnd.eszigno3+xml":["es3","et3"],"vnd.ezpix-album":"ez2","vnd.ezpix-package":"ez3","vnd.fdf":"fdf","vnd.fdsn.mseed":"mseed","vnd.fdsn.seed":["seed","dataless"],"vnd.flographit":"gph","vnd.fluxtime.clip":"ftc","vnd.framemaker":["fm","frame","maker","book"],"vnd.frogans.fnc":"fnc","vnd.frogans.ltf":"ltf","vnd.fsc.weblaunch":"fsc","vnd.fujitsu.oasys":"oas","vnd.fujitsu.oasys2":"oa2","vnd.fujitsu.oasys3":"oa3","vnd.fujitsu.oasysgp":"fg5","vnd.fujitsu.oasysprs":"bh2","vnd.fujixerox.ddd":"ddd","vnd.fujixerox.docuworks":"xdw","vnd.fujixerox.docuworks.binder":"xbd","vnd.fuzzysheet":"fzs","vnd.genomatix.tuxedo":"txd","vnd.geogebra.file":"ggb","vnd.geogebra.tool":"ggt","vnd.geometry-explorer":["gex","gre"],"vnd.geonext":"gxt","vnd.geoplan":"g2w","vnd.geospace":"g3w","vnd.gmx":"gmx","vnd.grafeq":["gqf","gqs"],"vnd.groove-account":"gac","vnd.groove-help":"ghf","vnd.groove-identity-message":"gim","vnd.groove-injector":"grv","vnd.groove-tool-message":"gtm","vnd.groove-tool-template":"tpl","vnd.groove-vcard":"vcg","vnd.hal+xml":"hal","vnd.handheld-entertainment+xml":"zmm","vnd.hbci":"hbci","vnd.hhe.lesson-player":"les","vnd.hp-hpgl":"hpgl","vnd.hp-hpid":"hpid","vnd.hp-hps":"hps","vnd.hp-jlyt":"jlt","vnd.hp-pcl":"pcl","vnd.hp-pclxl":"pclxl","vnd.hydrostatix.sof-data":"sfd-hdstx","vnd.ibm.minipay":"mpy","vnd.ibm.modcap":["afp","listafp","list3820"],"vnd.ibm.rights-management":"irm","vnd.ibm.secure-container":"sc","vnd.iccprofile":["icc","icm"],"vnd.igloader":"igl","vnd.immervision-ivp":"ivp","vnd.immervision-ivu":"ivu","vnd.insors.igm":"igm","vnd.intercon.formnet":["xpw","xpx"],"vnd.intergeo":"i2g","vnd.intu.qbo":"qbo","vnd.intu.qfx":"qfx","vnd.ipunplugged.rcprofile":"rcprofile","vnd.irepository.package+xml":"irp","vnd.is-xpr":"xpr","vnd.isac.fcs":"fcs","vnd.jam":"jam","vnd.jcp.javame.midlet-rms":"rms","vnd.jisp":"jisp","vnd.joost.joda-archive":"joda","vnd.kahootz":["ktz","ktr"],"vnd.kde.karbon":"karbon","vnd.kde.kchart":"chrt","vnd.kde.kformula":"kfo","vnd.kde.kivio":"flw","vnd.kde.kontour":"kon","vnd.kde.kpresenter":["kpr","kpt"],"vnd.kde.kspread":"ksp","vnd.kde.kword":["kwd","kwt"],"vnd.kenameaapp":"htke","vnd.kidspiration":"kia","vnd.kinar":["kne","knp"],"vnd.koan":["skp","skd","skt","skm"],"vnd.kodak-descriptor":"sse","vnd.las.las+xml":"lasxml","vnd.llamagraphics.life-balance.desktop":"lbd","vnd.llamagraphics.life-balance.exchange+xml":"lbe","vnd.lotus-1-2-3":"123","vnd.lotus-approach":"apr","vnd.lotus-freelance":"pre","vnd.lotus-notes":"nsf","vnd.lotus-organizer":"org","vnd.lotus-screencam":"scm","vnd.lotus-wordpro":"lwp","vnd.macports.portpkg":"portpkg","vnd.mcd":"mcd","vnd.medcalcdata":"mc1","vnd.mediastation.cdkey":"cdkey","vnd.mfer":"mwf","vnd.mfmp":"mfm","vnd.micrografx.flo":"flo","vnd.micrografx.igx":"igx","vnd.mif":"mif","vnd.mobius.daf":"daf","vnd.mobius.dis":"dis","vnd.mobius.mbk":"mbk","vnd.mobius.mqy":"mqy","vnd.mobius.msl":"msl","vnd.mobius.plc":"plc","vnd.mobius.txf":"txf","vnd.mophun.application":"mpn","vnd.mophun.certificate":"mpc","vnd.ms-artgalry":"cil","vnd.ms-cab-compressed":"cab","vnd.ms-excel.addin.macroenabled.12":"xlam","vnd.ms-excel.sheet.binary.macroenabled.12":"xlsb","vnd.ms-excel.sheet.macroenabled.12":"xlsm","vnd.ms-excel.template.macroenabled.12":"xltm","vnd.ms-fontobject":"eot","vnd.ms-htmlhelp":"chm","vnd.ms-ims":"ims","vnd.ms-lrm":"lrm","vnd.ms-officetheme":"thmx","vnd.ms-powerpoint.addin.macroenabled.12":"ppam","vnd.ms-powerpoint.presentation.macroenabled.12":"pptm","vnd.ms-powerpoint.slide.macroenabled.12":"sldm","vnd.ms-powerpoint.slideshow.macroenabled.12":"ppsm","vnd.ms-powerpoint.template.macroenabled.12":"potm","vnd.ms-project":["mpp","mpt"],"vnd.ms-word.document.macroenabled.12":"docm","vnd.ms-word.template.macroenabled.12":"dotm","vnd.ms-works":["wps","wks","wcm","wdb"],"vnd.ms-wpl":"wpl","vnd.ms-xpsdocument":"xps","vnd.mseq":"mseq","vnd.musician":"mus","vnd.muvee.style":"msty","vnd.mynfc":"taglet","vnd.neurolanguage.nlu":"nlu","vnd.nitf":["ntf","nitf"],"vnd.noblenet-directory":"nnd","vnd.noblenet-sealer":"nns","vnd.noblenet-web":"nnw","vnd.nokia.n-gage.data":"ngdat","vnd.nokia.n-gage.symbian.install":"n-gage","vnd.nokia.radio-preset":"rpst","vnd.nokia.radio-presets":"rpss","vnd.novadigm.edm":"edm","vnd.novadigm.edx":"edx","vnd.novadigm.ext":"ext","vnd.oasis.opendocument.chart-template":"otc","vnd.oasis.opendocument.formula-template":"odft","vnd.oasis.opendocument.image-template":"oti","vnd.olpc-sugar":"xo","vnd.oma.dd2+xml":"dd2","vnd.openofficeorg.extension":"oxt","vnd.openxmlformats-officedocument.presentationml.slide":"sldx","vnd.osgeo.mapguide.package":"mgp","vnd.osgi.dp":"dp","vnd.osgi.subsystem":"esa","vnd.palm":["pdb","pqa","oprc"],"vnd.pawaafile":"paw","vnd.pg.format":"str","vnd.pg.osasli":"ei6","vnd.picsel":"efif","vnd.pmi.widget":"wg","vnd.pocketlearn":"plf","vnd.powerbuilder6":"pbd","vnd.previewsystems.box":"box","vnd.proteus.magazine":"mgz","vnd.publishare-delta-tree":"qps","vnd.pvi.ptid1":"ptid","vnd.quark.quarkxpress":["qxd","qxt","qwd","qwt","qxl","qxb"],"vnd.realvnc.bed":"bed","vnd.recordare.musicxml":"mxl","vnd.recordare.musicxml+xml":"musicxml","vnd.rig.cryptonote":"cryptonote","vnd.rn-realmedia":"rm","vnd.rn-realmedia-vbr":"rmvb","vnd.route66.link66+xml":"link66","vnd.sailingtracker.track":"st","vnd.seemail":"see","vnd.sema":"sema","vnd.semd":"semd","vnd.semf":"semf","vnd.shana.informed.formdata":"ifm","vnd.shana.informed.formtemplate":"itp","vnd.shana.informed.interchange":"iif","vnd.shana.informed.package":"ipk","vnd.simtech-mindmapper":["twd","twds"],"vnd.smart.teacher":"teacher","vnd.solent.sdkm+xml":["sdkm","sdkd"],"vnd.spotfire.dxp":"dxp","vnd.spotfire.sfs":"sfs","vnd.stepmania.package":"smzip","vnd.stepmania.stepchart":"sm","vnd.sus-calendar":["sus","susp"],"vnd.svd":"svd","vnd.syncml+xml":"xsm","vnd.syncml.dm+wbxml":"bdm","vnd.syncml.dm+xml":"xdm","vnd.tao.intent-module-archive":"tao","vnd.tcpdump.pcap":["pcap","cap","dmp"],"vnd.tmobile-livetv":"tmo","vnd.trid.tpt":"tpt","vnd.triscape.mxs":"mxs","vnd.trueapp":"tra","vnd.ufdl":["ufd","ufdl"],"vnd.uiq.theme":"utz","vnd.umajin":"umj","vnd.unity":"unityweb","vnd.uoml+xml":"uoml","vnd.vcx":"vcx","vnd.visionary":"vis","vnd.vsf":"vsf","vnd.webturbo":"wtb","vnd.wolfram.player":"nbp","vnd.wqd":"wqd","vnd.wt.stf":"stf","vnd.xara":"xar","vnd.xfdl":"xfdl","vnd.yamaha.hv-dic":"hvd","vnd.yamaha.hv-script":"hvs","vnd.yamaha.hv-voice":"hvp","vnd.yamaha.openscoreformat":"osf","vnd.yamaha.openscoreformat.osfpvg+xml":"osfpvg","vnd.yamaha.smaf-audio":"saf","vnd.yamaha.smaf-phrase":"spf","vnd.yellowriver-custom-menu":"cmp","vnd.zul":["zir","zirz"],"vnd.zzazz.deck+xml":"zaz","voicexml+xml":"vxml",widget:"wgt",winhlp:"hlp","wsdl+xml":"wsdl","wspolicy+xml":"wspolicy","x-ace-compressed":"ace","x-authorware-bin":["aab","x32","u32","vox"],"x-authorware-map":"aam","x-authorware-seg":"aas","x-blorb":["blb","blorb"],"x-bzip":"bz","x-bzip2":["bz2","boz"],"x-cfs-compressed":"cfs","x-chat":"chat","x-conference":"nsc","x-dgc-compressed":"dgc","x-dtbncx+xml":"ncx","x-dtbook+xml":"dtb","x-dtbresource+xml":"res","x-eva":"eva","x-font-bdf":"bdf","x-font-ghostscript":"gsf","x-font-linux-psf":"psf","x-font-pcf":"pcf","x-font-snf":"snf","x-font-ttf":["ttf","ttc"],"x-font-type1":["pfa","pfb","pfm","afm"],"x-freearc":"arc","x-gca-compressed":"gca","x-glulx":"ulx","x-gramps-xml":"gramps","x-install-instructions":"install","x-lzh-compressed":["lzh","lha"],"x-mie":"mie","x-mobipocket-ebook":["prc","mobi"],"x-ms-application":"application","x-ms-shortcut":"lnk","x-ms-xbap":"xbap","x-msbinder":"obd","x-mscardfile":"crd","x-msclip":"clp","application/x-ms-installer":"msi","x-msmediaview":["mvb","m13","m14"],"x-msmetafile":["wmf","wmz","emf","emz"],"x-msmoney":"mny","x-mspublisher":"pub","x-msschedule":"scd","x-msterminal":"trm","x-mswrite":"wri","x-nzb":"nzb","x-pkcs12":["p12","pfx"],"x-pkcs7-certificates":["p7b","spc"],"x-research-info-systems":"ris","x-silverlight-app":"xap","x-sql":"sql","x-stuffitx":"sitx","x-subrip":"srt","x-t3vm-image":"t3","x-tex-tfm":"tfm","x-tgif":"obj","x-xliff+xml":"xlf","x-xz":"xz","x-zmachine":["z1","z2","z3","z4","z5","z6","z7","z8"],"xaml+xml":"xaml","xcap-diff+xml":"xdf","xenc+xml":"xenc","xml-dtd":"dtd","xop+xml":"xop","xproc+xml":"xpl","xslt+xml":"xslt","xv+xml":["mxml","xhvml","xvml","xvm"],yang:"yang","yin+xml":"yin",envoy:"evy",fractals:"fif","internet-property-stream":"acx",olescript:"axs","vnd.ms-outlook":"msg","vnd.ms-pkicertstore":"sst","x-compress":"z","x-perfmon":["pma","pmc","pmr","pmw"],"ynd.ms-pkipko":"pko",gzip:["gz","tgz"],"smil+xml":["smi","smil"],"vnd.debian.binary-package":["deb","udeb"],"vnd.hzn-3d-crossword":"x3d","vnd.sqlite3":["db","sqlite","sqlite3","db-wal","sqlite-wal","db-shm","sqlite-shm"],"vnd.wap.sic":"sic","vnd.wap.slc":"slc","x-krita":["kra","krz"],"x-perl":["pm","pl"],yaml:["yaml","yml"]},audio:{amr:"amr","amr-wb":"awb",annodex:"axa",basic:["au","snd"],flac:"flac",midi:["mid","midi","kar","rmi"],mpeg:["mpga","mpega","mp3","m4a","mp2a","m2a","m3a"],mpegurl:"m3u",ogg:["oga","ogg","spx"],"prs.sid":"sid","x-aiff":"aifc","x-gsm":"gsm","x-ms-wma":"wma","x-ms-wax":"wax","x-pn-realaudio":"ram","x-realaudio":"ra","x-sd2":"sd2",adpcm:"adp",mp4:"mp4a",s3m:"s3m",silk:"sil","vnd.dece.audio":["uva","uvva"],"vnd.digital-winds":"eol","vnd.dra":"dra","vnd.dts":"dts","vnd.dts.hd":"dtshd","vnd.lucent.voice":"lvp","vnd.ms-playready.media.pya":"pya","vnd.nuera.ecelp4800":"ecelp4800","vnd.nuera.ecelp7470":"ecelp7470","vnd.nuera.ecelp9600":"ecelp9600","vnd.rip":"rip",webm:"weba","x-caf":"caf","x-matroska":"mka","x-pn-realaudio-plugin":"rmp",xm:"xm",aac:"aac",aiff:["aiff","aif","aff"],opus:"opus",wav:"wav"},chemical:{"x-alchemy":"alc","x-cache":["cac","cache"],"x-cache-csf":"csf","x-cactvs-binary":["cbin","cascii","ctab"],"x-cdx":"cdx","x-chem3d":"c3d","x-cif":"cif","x-cmdf":"cmdf","x-cml":"cml","x-compass":"cpa","x-crossfire":"bsd","x-csml":["csml","csm"],"x-ctx":"ctx","x-cxf":["cxf","cef"],"x-embl-dl-nucleotide":["emb","embl"],"x-gamess-input":["inp","gam","gamin"],"x-gaussian-checkpoint":["fch","fchk"],"x-gaussian-cube":"cub","x-gaussian-input":["gau","gjc","gjf"],"x-gaussian-log":"gal","x-gcg8-sequence":"gcg","x-genbank":"gen","x-hin":"hin","x-isostar":["istr","ist"],"x-jcamp-dx":["jdx","dx"],"x-kinemage":"kin","x-macmolecule":"mcm","x-macromodel-input":"mmod","x-mdl-molfile":"mol","x-mdl-rdfile":"rd","x-mdl-rxnfile":"rxn","x-mdl-sdfile":"sd","x-mdl-tgf":"tgf","x-mmcif":"mcif","x-mol2":"mol2","x-molconn-Z":"b","x-mopac-graph":"gpt","x-mopac-input":["mop","mopcrt","zmt"],"x-mopac-out":"moo","x-ncbi-asn1":"asn","x-ncbi-asn1-ascii":["prt","ent"],"x-ncbi-asn1-binary":"val","x-rosdal":"ros","x-swissprot":"sw","x-vamas-iso14976":"vms","x-vmd":"vmd","x-xtel":"xtel","x-xyz":"xyz"},font:{otf:"otf",woff:"woff",woff2:"woff2"},image:{gif:"gif",ief:"ief",jpeg:["jpeg","jpg","jpe","jfif","jfif-tbnl","jif"],pcx:"pcx",png:"png","svg+xml":["svg","svgz"],tiff:["tiff","tif"],"vnd.djvu":["djvu","djv"],"vnd.wap.wbmp":"wbmp","x-canon-cr2":"cr2","x-canon-crw":"crw","x-cmu-raster":"ras","x-coreldraw":"cdr","x-coreldrawpattern":"pat","x-coreldrawtemplate":"cdt","x-corelphotopaint":"cpt","x-epson-erf":"erf","x-icon":"ico","x-jg":"art","x-jng":"jng","x-nikon-nef":"nef","x-olympus-orf":"orf","x-portable-anymap":"pnm","x-portable-bitmap":"pbm","x-portable-graymap":"pgm","x-portable-pixmap":"ppm","x-rgb":"rgb","x-xbitmap":"xbm","x-xpixmap":"xpm","x-xwindowdump":"xwd",bmp:"bmp",cgm:"cgm",g3fax:"g3",ktx:"ktx","prs.btif":"btif",sgi:"sgi","vnd.dece.graphic":["uvi","uvvi","uvg","uvvg"],"vnd.dwg":"dwg","vnd.dxf":"dxf","vnd.fastbidsheet":"fbs","vnd.fpx":"fpx","vnd.fst":"fst","vnd.fujixerox.edmics-mmr":"mmr","vnd.fujixerox.edmics-rlc":"rlc","vnd.ms-modi":"mdi","vnd.ms-photo":"wdp","vnd.net-fpx":"npx","vnd.xiff":"xif",webp:"webp","x-3ds":"3ds","x-cmx":"cmx","x-freehand":["fh","fhc","fh4","fh5","fh7"],"x-pict":["pic","pct"],"x-tga":"tga","cis-cod":"cod",avif:"avifs",heic:["heif","heic"],pjpeg:["pjpg"],"vnd.adobe.photoshop":"psd","x-adobe-dng":"dng","x-fuji-raf":"raf","x-icns":"icns","x-kodak-dcr":"dcr","x-kodak-k25":"k25","x-kodak-kdc":"kdc","x-minolta-mrw":"mrw","x-panasonic-raw":["raw","rw2","rwl"],"x-pentax-pef":["pef","ptx"],"x-sigma-x3f":"x3f","x-sony-arw":"arw","x-sony-sr2":"sr2","x-sony-srf":"srf"},message:{rfc822:["eml","mime","mht","mhtml","nws"]},model:{iges:["igs","iges"],mesh:["msh","mesh","silo"],vrml:["wrl","vrml"],"x3d+vrml":["x3dv","x3dvz"],"x3d+xml":"x3dz","x3d+binary":["x3db","x3dbz"],"vnd.collada+xml":"dae","vnd.dwf":"dwf","vnd.gdl":"gdl","vnd.gtw":"gtw","vnd.mts":"mts","vnd.usdz+zip":"usdz","vnd.vtu":"vtu"},text:{"cache-manifest":["manifest","appcache"],calendar:["ics","icz","ifb"],css:"css",csv:"csv",h323:"323",html:["html","htm","shtml","stm"],iuls:"uls",plain:["txt","text","brf","conf","def","list","log","in","bas","diff","ksh"],richtext:"rtx",scriptlet:["sct","wsc"],texmacs:"tm","tab-separated-values":"tsv","vnd.sun.j2me.app-descriptor":"jad","vnd.wap.wml":"wml","vnd.wap.wmlscript":"wmls","x-bibtex":"bib","x-boo":"boo","x-c++hdr":["h++","hpp","hxx","hh"],"x-c++src":["c++","cpp","cxx","cc"],"x-component":"htc","x-dsrc":"d","x-diff":"patch","x-haskell":"hs","x-java":"java","x-literate-haskell":"lhs","x-moc":"moc","x-pascal":["p","pas","pp","inc"],"x-pcs-gcd":"gcd","x-python":"py","x-scala":"scala","x-setext":"etx","x-tcl":["tcl","tk"],"x-tex":["tex","ltx","sty","cls"],"x-vcalendar":"vcs","x-vcard":"vcf",n3:"n3","prs.lines.tag":"dsc",sgml:["sgml","sgm"],troff:["t","tr","roff","man","me","ms"],turtle:"ttl","uri-list":["uri","uris","urls"],vcard:"vcard","vnd.curl":"curl","vnd.curl.dcurl":"dcurl","vnd.curl.scurl":"scurl","vnd.curl.mcurl":"mcurl","vnd.dvb.subtitle":"sub","vnd.fly":"fly","vnd.fmi.flexstor":"flx","vnd.graphviz":"gv","vnd.in3d.3dml":"3dml","vnd.in3d.spot":"spot","x-asm":["s","asm"],"x-c":["c","h","dic"],"x-fortran":["f","for","f77","f90"],"x-opml":"opml","x-nfo":"nfo","x-sfv":"sfv","x-uuencode":"uu",webviewhtml:"htt",javascript:"js",json:"json",markdown:["md","markdown","mdown","markdn"],"vnd.wap.si":"si","vnd.wap.sl":"sl"},video:{avif:"avif","3gpp":"3gp",annodex:"axv",dl:"dl",dv:["dif","dv"],fli:"fli",gl:"gl",mpeg:["mpeg","mpg","mpe","m1v","m2v","mp2","mpa","mpv2"],mp4:["mp4","mp4v","mpg4"],quicktime:["qt","mov"],ogg:"ogv","vnd.mpegurl":["mxu","m4u"],"x-flv":"flv","x-la-asf":["lsf","lsx"],"x-mng":"mng","x-ms-asf":["asf","asx","asr"],"x-ms-wm":"wm","x-ms-wmv":"wmv","x-ms-wmx":"wmx","x-ms-wvx":"wvx","x-msvideo":"avi","x-sgi-movie":"movie","x-matroska":["mpv","mkv","mk3d","mks"],"3gpp2":"3g2",h261:"h261",h263:"h263",h264:"h264",jpeg:"jpgv",jpm:["jpm","jpgm"],mj2:["mj2","mjp2"],"vnd.dece.hd":["uvh","uvvh"],"vnd.dece.mobile":["uvm","uvvm"],"vnd.dece.pd":["uvp","uvvp"],"vnd.dece.sd":["uvs","uvvs"],"vnd.dece.video":["uvv","uvvv"],"vnd.dvb.file":"dvb","vnd.fvt":"fvt","vnd.ms-playready.media.pyv":"pyv","vnd.uvvu.mp4":["uvu","uvvu"],"vnd.vivo":"viv",webm:"webm","x-f4v":"f4v","x-m4v":"m4v","x-ms-vob":"vob","x-smv":"smv",mp2t:"ts"},"x-conference":{"x-cooltalk":"ice"},"x-world":{"x-vrml":["vrm","flr","wrz","xaf","xof"]}};(()=>{const t={};for(const e of Object.keys(QT))for(const i of Object.keys(QT[e])){const r=QT[e][i];if(typeof r=="string")t[r]=e+"/"+i;else for(let n=0;n<r.length;n++)t[r[n]]=e+"/"+i}return t})();const rce=[];for(let t=0;t<256;t++){let e=t;for(let i=0;i<8;i++)e&1?e=e>>>1^3988292384:e=e>>>1;rce[t]=e}class G9{constructor(e){this.crc=e||-1}append(e){let i=this.crc|0;for(let r=0,n=e.length|0;r<n;r++)i=i>>>8^rce[(i^e[r])&255];this.crc=i}get(){return~this.crc}}class oce extends TransformStream{constructor(){let e;const i=new G9;super({transform(r,n){i.append(r),n.enqueue(r)},flush(){const r=new Uint8Array(4);new DataView(r.buffer).setUint32(0,i.get()),e.value=r}}),e=this}}function zai(t){if(typeof TextEncoder==Rd){t=unescape(encodeURIComponent(t));const e=new Uint8Array(t.length);for(let i=0;i<e.length;i++)e[i]=t.charCodeAt(i);return e}else return new TextEncoder().encode(t)}const fn={concat(t,e){if(t.length===0||e.length===0)return t.concat(e);const i=t[t.length-1],r=fn.getPartial(i);return r===32?t.concat(e):fn._shiftRight(e,r,i|0,t.slice(0,t.length-1))},bitLength(t){const e=t.length;if(e===0)return 0;const i=t[e-1];return(e-1)*32+fn.getPartial(i)},clamp(t,e){if(t.length*32<e)return t;t=t.slice(0,Math.ceil(e/32));const i=t.length;return e=e&31,i>0&&e&&(t[i-1]=fn.partial(e,t[i-1]&2147483648>>e-1,1)),t},partial(t,e,i){return t===32?e:(i?e|0:e<<32-t)+t*1099511627776},getPartial(t){return Math.round(t/1099511627776)||32},_shiftRight(t,e,i,r){for(r===void 0&&(r=[]);e>=32;e-=32)r.push(i),i=0;if(e===0)return r.concat(t);for(let s=0;s<t.length;s++)r.push(i|t[s]>>>e),i=t[s]<<32-e;const n=t.length?t[t.length-1]:0,o=fn.getPartial(n);return r.push(fn.partial(e+o&31,e+o>32?i:r.pop(),1)),r}},Q9={bytes:{fromBits(t){const e=fn.bitLength(t)/8,i=new Uint8Array(e);let r;for(let n=0;n<e;n++)n&3||(r=t[n/4]),i[n]=r>>>24,r<<=8;return i},toBits(t){const e=[];let i,r=0;for(i=0;i<t.length;i++)r=r<<8|t[i],(i&3)===3&&(e.push(r),r=0);return i&3&&e.push(fn.partial(8*(i&3),r)),e}}},nce={};nce.sha1=class{constructor(t){const e=this;e.blockSize=512,e._init=[1732584193,4023233417,2562383102,271733878,3285377520],e._key=[1518500249,1859775393,2400959708,3395469782],t?(e._h=t._h.slice(0),e._buffer=t._buffer.slice(0),e._length=t._length):e.reset()}reset(){const t=this;return t._h=t._init.slice(0),t._buffer=[],t._length=0,t}update(t){const e=this;typeof t=="string"&&(t=Q9.utf8String.toBits(t));const i=e._buffer=fn.concat(e._buffer,t),r=e._length,n=e._length=r+fn.bitLength(t);if(n>9007199254740991)throw new Error("Cannot hash more than 2^53 - 1 bits");const o=new Uint32Array(i);let s=0;for(let a=e.blockSize+r-(e.blockSize+r&e.blockSize-1);a<=n;a+=e.blockSize)e._block(o.subarray(16*s,16*(s+1))),s+=1;return i.splice(0,16*s),e}finalize(){const t=this;let e=t._buffer;const i=t._h;e=fn.concat(e,[fn.partial(1,1)]);for(let r=e.length+2;r&15;r++)e.push(0);for(e.push(Math.floor(t._length/4294967296)),e.push(t._length|0);e.length;)t._block(e.splice(0,16));return t.reset(),i}_f(t,e,i,r){if(t<=19)return e&i|~e&r;if(t<=39)return e^i^r;if(t<=59)return e&i|e&r|i&r;if(t<=79)return e^i^r}_S(t,e){return e<<t|e>>>32-t}_block(t){const e=this,i=e._h,r=Array(80);for(let c=0;c<16;c++)r[c]=t[c];let n=i[0],o=i[1],s=i[2],a=i[3],l=i[4];for(let c=0;c<=79;c++){c>=16&&(r[c]=e._S(1,r[c-3]^r[c-8]^r[c-14]^r[c-16]));const d=e._S(5,n)+e._f(c,o,s,a)+l+r[c]+e._key[Math.floor(c/20)]|0;l=a,a=s,s=e._S(30,o),o=n,n=d}i[0]=i[0]+n|0,i[1]=i[1]+o|0,i[2]=i[2]+s|0,i[3]=i[3]+a|0,i[4]=i[4]+l|0}};const sce={};sce.aes=class{constructor(t){const e=this;e._tables=[[[],[],[],[],[]],[[],[],[],[],[]]],e._tables[0][0][0]||e._precompute();const i=e._tables[0][4],r=e._tables[1],n=t.length;let o,s,a,l=1;if(n!==4&&n!==6&&n!==8)throw new Error("invalid aes key size");for(e._key=[s=t.slice(0),a=[]],o=n;o<4*n+28;o++){let c=s[o-1];(o%n===0||n===8&&o%n===4)&&(c=i[c>>>24]<<24^i[c>>16&255]<<16^i[c>>8&255]<<8^i[c&255],o%n===0&&(c=c<<8^c>>>24^l<<24,l=l<<1^(l>>7)*283)),s[o]=s[o-n]^c}for(let c=0;o;c++,o--){const d=s[c&3?o:o-4];o<=4||c<4?a[c]=d:a[c]=r[0][i[d>>>24]]^r[1][i[d>>16&255]]^r[2][i[d>>8&255]]^r[3][i[d&255]]}}encrypt(t){return this._crypt(t,0)}decrypt(t){return this._crypt(t,1)}_precompute(){const t=this._tables[0],e=this._tables[1],i=t[4],r=e[4],n=[],o=[];let s,a,l,c;for(let d=0;d<256;d++)o[(n[d]=d<<1^(d>>7)*283)^d]=d;for(let d=s=0;!i[d];d^=a||1,s=o[s]||1){let u=s^s<<1^s<<2^s<<3^s<<4;u=u>>8^u&255^99,i[d]=u,r[u]=d,c=n[l=n[a=n[d]]];let h=c*16843009^l*65537^a*257^d*16843008,f=n[u]*257^u*16843008;for(let A=0;A<4;A++)t[A][d]=f=f<<24^f>>>8,e[A][u]=h=h<<24^h>>>8}for(let d=0;d<5;d++)t[d]=t[d].slice(0),e[d]=e[d].slice(0)}_crypt(t,e){if(t.length!==4)throw new Error("invalid aes block size");const i=this._key[e],r=i.length/4-2,n=[0,0,0,0],o=this._tables[e],s=o[0],a=o[1],l=o[2],c=o[3],d=o[4];let u=t[0]^i[0],h=t[e?3:1]^i[1],f=t[2]^i[2],A=t[e?1:3]^i[3],p=4,g,m,w;for(let y=0;y<r;y++)g=s[u>>>24]^a[h>>16&255]^l[f>>8&255]^c[A&255]^i[p],m=s[h>>>24]^a[f>>16&255]^l[A>>8&255]^c[u&255]^i[p+1],w=s[f>>>24]^a[A>>16&255]^l[u>>8&255]^c[h&255]^i[p+2],A=s[A>>>24]^a[u>>16&255]^l[h>>8&255]^c[f&255]^i[p+3],p+=4,u=g,h=m,f=w;for(let y=0;y<4;y++)n[e?3&-y:y]=d[u>>>24]<<24^d[h>>16&255]<<16^d[f>>8&255]<<8^d[A&255]^i[p++],g=u,u=h,h=f,f=A,A=g;return n}};const Hai={getRandomValues(t){const e=new Uint32Array(t.buffer),i=r=>{let n=987654321;const o=4294967295;return function(){return n=36969*(n&65535)+(n>>16)&o,r=18e3*(r&65535)+(r>>16)&o,(((n<<16)+r&o)/4294967296+.5)*(Math.random()>.5?1:-1)}};for(let r=0,n;r<t.length;r+=4){const o=i((n||Math.random())*4294967296);n=o()*987654071,e[r/4]=o()*4294967296|0}return t}},ace={};ace.ctrGladman=class{constructor(t,e){this._prf=t,this._initIv=e,this._iv=e}reset(){this._iv=this._initIv}update(t){return this.calculate(this._prf,t,this._iv)}incWord(t){if((t>>24&255)===255){let e=t>>16&255,i=t>>8&255,r=t&255;e===255?(e=0,i===255?(i=0,r===255?r=0:++r):++i):++e,t=0,t+=e<<16,t+=i<<8,t+=r}else t+=1<<24;return t}incCounter(t){(t[0]=this.incWord(t[0]))===0&&(t[1]=this.incWord(t[1]))}calculate(t,e,i){let r;if(!(r=e.length))return[];const n=fn.bitLength(e);for(let o=0;o<r;o+=4){this.incCounter(i);const s=t.encrypt(i);e[o]^=s[0],e[o+1]^=s[1],e[o+2]^=s[2],e[o+3]^=s[3]}return fn.clamp(e,n)}};const oh={importKey(t){return new oh.hmacSha1(Q9.bytes.toBits(t))},pbkdf2(t,e,i,r){if(i=i||1e4,r<0||i<0)throw new Error("invalid params to pbkdf2");const n=(r>>5)+1<<2;let o,s,a,l,c;const d=new ArrayBuffer(n),u=new DataView(d);let h=0;const f=fn;for(e=Q9.bytes.toBits(e),c=1;h<(n||1);c++){for(o=s=t.encrypt(f.concat(e,[c])),a=1;a<i;a++)for(s=t.encrypt(s),l=0;l<s.length;l++)o[l]^=s[l];for(a=0;h<(n||1)&&a<o.length;a++)u.setInt32(h,o[a]),h+=4}return d.slice(0,r/8)}};oh.hmacSha1=class{constructor(t){const e=this,i=e._hash=nce.sha1,r=[[],[]];e._baseHash=[new i,new i];const n=e._baseHash[0].blockSize/32;t.length>n&&(t=new i().update(t).finalize());for(let o=0;o<n;o++)r[0][o]=t[o]^909522486,r[1][o]=t[o]^1549556828;e._baseHash[0].update(r[0]),e._baseHash[1].update(r[1]),e._resultHash=new i(e._baseHash[0])}reset(){const t=this;t._resultHash=new t._hash(t._baseHash[0]),t._updated=!1}update(t){const e=this;e._updated=!0,e._resultHash.update(t)}digest(){const t=this,e=t._resultHash.finalize(),i=new t._hash(t._baseHash[1]).update(e).finalize();return t.reset(),i}encrypt(t){if(this._updated)throw new Error("encrypt on already updated hmac called!");return this.update(t),this.digest(t)}};const qai=typeof crypto!=Rd&&typeof crypto.getRandomValues==Gv,lce="Invalid password",cce="Invalid signature",KT="zipjs-abort-check-password";function dce(t){return qai?crypto.getRandomValues(t):Hai.getRandomValues(t)}const S2=16,Gai="raw",uce={name:"PBKDF2"},Qai={name:"HMAC"},Kai="SHA-1",Zai=Object.assign({hash:Qai},uce),ZT=Object.assign({iterations:1e3,hash:{name:Kai}},uce),Wai=["deriveBits"],Qv=[8,12,16],Kv=[16,24,32],_d=10,Jai=[0,0,0,0],K9=typeof crypto!=Rd,Zv=K9&&crypto.subtle,hce=K9&&typeof Zv!=Rd,Za=Q9.bytes,Xai=sce.aes,Yai=ace.ctrGladman,$ai=oh.hmacSha1;let pce=K9&&hce&&typeof Zv.importKey==Gv,fce=K9&&hce&&typeof Zv.deriveBits==Gv;class eli extends TransformStream{constructor({password:e,rawPassword:i,signed:r,encryptionStrength:n,checkPasswordOnly:o}){super({start(){Object.assign(this,{ready:new Promise(s=>this.resolveReady=s),password:gce(e,i),signed:r,strength:n-1,pending:new Uint8Array})},async transform(s,a){const l=this,{password:c,strength:d,resolveReady:u,ready:h}=l;c?(await ili(l,d,c,Ds(s,0,Qv[d]+2)),s=Ds(s,Qv[d]+2),o?a.error(new Error(KT)):u()):await h;const f=new Uint8Array(s.length-_d-(s.length-_d)%S2);a.enqueue(Ace(l,s,f,0,_d,!0))},async flush(s){const{signed:a,ctr:l,hmac:c,pending:d,ready:u}=this;if(c&&l){await u;const h=Ds(d,0,d.length-_d),f=Ds(d,d.length-_d);let A=new Uint8Array;if(h.length){const p=Jv(Za,h);c.update(p);const g=l.update(p);A=Wv(Za,g)}if(a){const p=Ds(Wv(Za,c.digest()),0,_d);for(let g=0;g<_d;g++)if(p[g]!=f[g])throw new Error(cce)}s.enqueue(A)}}})}}class tli extends TransformStream{constructor({password:e,rawPassword:i,encryptionStrength:r}){let n;super({start(){Object.assign(this,{ready:new Promise(o=>this.resolveReady=o),password:gce(e,i),strength:r-1,pending:new Uint8Array})},async transform(o,s){const a=this,{password:l,strength:c,resolveReady:d,ready:u}=a;let h=new Uint8Array;l?(h=await rli(a,c,l),d()):await u;const f=new Uint8Array(h.length+o.length-o.length%S2);f.set(h,0),s.enqueue(Ace(a,o,f,h.length,0))},async flush(o){const{ctr:s,hmac:a,pending:l,ready:c}=this;if(a&&s){await c;let d=new Uint8Array;if(l.length){const u=s.update(Jv(Za,l));a.update(u),d=Wv(Za,u)}n.signature=Wv(Za,a.digest()).slice(0,_d),o.enqueue(WT(d,n.signature))}}}),n=this}}function Ace(t,e,i,r,n,o){const{ctr:s,hmac:a,pending:l}=t,c=e.length-n;l.length&&(e=WT(l,e),i=sli(i,c-c%S2));let d;for(d=0;d<=c-S2;d+=S2){const u=Jv(Za,Ds(e,d,d+S2));o&&a.update(u);const h=s.update(u);o||a.update(h),i.set(Wv(Za,h),d+r)}return t.pending=Ds(e,d),i}async function ili(t,e,i,r){const n=await mce(t,e,i,Ds(r,0,Qv[e])),o=Ds(r,Qv[e]);if(n[0]!=o[0]||n[1]!=o[1])throw new Error(lce)}async function rli(t,e,i){const r=dce(new Uint8Array(Qv[e])),n=await mce(t,e,i,r);return WT(r,n)}async function mce(t,e,i,r){t.password=null;const n=await oli(Gai,i,Zai,!1,Wai),o=await nli(Object.assign({salt:r},ZT),n,8*(Kv[e]*2+2)),s=new Uint8Array(o),a=Jv(Za,Ds(s,0,Kv[e])),l=Jv(Za,Ds(s,Kv[e],Kv[e]*2)),c=Ds(s,Kv[e]*2);return Object.assign(t,{keys:{key:a,authentication:l,passwordVerification:c},ctr:new Yai(new Xai(a),Array.from(Jai)),hmac:new $ai(l)}),c}async function oli(t,e,i,r,n){if(pce)try{return await Zv.importKey(t,e,i,r,n)}catch{return pce=!1,oh.importKey(e)}else return oh.importKey(e)}async function nli(t,e,i){if(fce)try{return await Zv.deriveBits(t,e,i)}catch{return fce=!1,oh.pbkdf2(e,t.salt,ZT.iterations,i)}else return oh.pbkdf2(e,t.salt,ZT.iterations,i)}function gce(t,e){return e===pn?zai(t):e}function WT(t,e){let i=t;return t.length+e.length&&(i=new Uint8Array(t.length+e.length),i.set(t,0),i.set(e,t.length)),i}function sli(t,e){if(e&&e>t.length){const i=t;t=new Uint8Array(e),t.set(i,0)}return t}function Ds(t,e,i){return t.subarray(e,i)}function Wv(t,e){return t.fromBits(e)}function Jv(t,e){return t.toBits(e)}const T2=12;class ali extends TransformStream{constructor({password:e,passwordVerification:i,checkPasswordOnly:r}){super({start(){Object.assign(this,{password:e,passwordVerification:i}),bce(this,e)},transform(n,o){const s=this;if(s.password){const a=vce(s,n.subarray(0,T2));if(s.password=null,a[T2-1]!=s.passwordVerification)throw new Error(lce);n=n.subarray(T2)}r?o.error(new Error(KT)):o.enqueue(vce(s,n))}})}}class lli extends TransformStream{constructor({password:e,passwordVerification:i}){super({start(){Object.assign(this,{password:e,passwordVerification:i}),bce(this,e)},transform(r,n){const o=this;let s,a;if(o.password){o.password=null;const l=dce(new Uint8Array(T2));l[T2-1]=o.passwordVerification,s=new Uint8Array(r.length+l.length),s.set(yce(o,l),0),a=T2}else s=new Uint8Array(r.length),a=0;s.set(yce(o,r),a),n.enqueue(s)}})}}function vce(t,e){const i=new Uint8Array(e.length);for(let r=0;r<e.length;r++)i[r]=wce(t)^e[r],JT(t,i[r]);return i}function yce(t,e){const i=new Uint8Array(e.length);for(let r=0;r<e.length;r++)i[r]=wce(t)^e[r],JT(t,e[r]);return i}function bce(t,e){const i=[305419896,591751049,878082192];Object.assign(t,{keys:i,crcKey0:new G9(i[0]),crcKey2:new G9(i[2])});for(let r=0;r<e.length;r++)JT(t,e.charCodeAt(r))}function JT(t,e){let[i,r,n]=t.keys;t.crcKey0.append([e]),i=~t.crcKey0.get(),r=xce(Math.imul(xce(r+Cce(i)),134775813)+1),t.crcKey2.append([r>>>24]),n=~t.crcKey2.get(),t.keys=[i,r,n]}function wce(t){const e=t.keys[2]|2;return Cce(Math.imul(e,e^1)>>>8)}function Cce(t){return t&255}function xce(t){return t&4294967295}const kce="deflate-raw";class cli extends TransformStream{constructor(e,{chunkSize:i,CompressionStream:r,CompressionStreamNative:n}){super({});const{compressed:o,encrypted:s,useCompressionStream:a,zipCrypto:l,signed:c,level:d}=e,u=this;let h,f,A=Mce(super.readable);(!s||l)&&c&&(h=new oce,A=Wa(A,h)),o&&(A=Ece(A,a,{level:d,chunkSize:i},n,r)),s&&(l?A=Wa(A,new lli(e)):(f=new tli(e),A=Wa(A,f))),Pce(u,A,()=>{let p;s&&!l&&(p=f.signature),(!s||l)&&c&&(p=new DataView(h.value.buffer).getUint32(0)),u.signature=p})}}class dli extends TransformStream{constructor(e,{chunkSize:i,DecompressionStream:r,DecompressionStreamNative:n}){super({});const{zipCrypto:o,encrypted:s,signed:a,signature:l,compressed:c,useCompressionStream:d}=e;let u,h,f=Mce(super.readable);s&&(o?f=Wa(f,new ali(e)):(h=new eli(e),f=Wa(f,h))),c&&(f=Ece(f,d,{chunkSize:i},n,r)),(!s||o)&&a&&(u=new oce,f=Wa(f,u)),Pce(this,f,()=>{if((!s||o)&&a){const A=new DataView(u.value.buffer);if(l!=A.getUint32(0,!1))throw new Error(cce)}})}}function Mce(t){return Wa(t,new TransformStream({transform(e,i){e&&e.length&&i.enqueue(e)}}))}function Pce(t,e,i){e=Wa(e,new TransformStream({flush:i})),Object.defineProperty(t,"readable",{get(){return e}})}function Ece(t,e,i,r,n){try{const o=e&&r?r:n;t=Wa(t,new o(kce,i))}catch{if(e)try{t=Wa(t,new n(kce,i))}catch{return t}else return t}return t}function Wa(t,e){return t.pipeThrough(e)}const uli="message",hli="start",pli="pull",Bce="data",fli="ack",Ice="close",Ali="deflate",Sce="inflate";class mli extends TransformStream{constructor(e,i){super({});const r=this,{codecType:n}=e;let o;n.startsWith(Ali)?o=cli:n.startsWith(Sce)&&(o=dli);let s=0,a=0;const l=new o(e,i),c=super.readable,d=new TransformStream({transform(h,f){h&&h.length&&(a+=h.length,f.enqueue(h))},flush(){Object.assign(r,{inputSize:a})}}),u=new TransformStream({transform(h,f){h&&h.length&&(s+=h.length,f.enqueue(h))},flush(){const{signature:h}=l;Object.assign(r,{signature:h,outputSize:s,inputSize:a})}});Object.defineProperty(r,"readable",{get(){return c.pipeThrough(d).pipeThrough(l).pipeThrough(u)}})}}class gli extends TransformStream{constructor(e){let i;super({transform:r,flush(n){i&&i.length&&n.enqueue(i)}});function r(n,o){if(i){const s=new Uint8Array(i.length+n.length);s.set(i),s.set(n,i.length),n=s,i=null}n.length>e?(o.enqueue(n.slice(0,e)),r(n.slice(e),o)):i=n}}}let Tce=typeof Worker!=Rd;class XT{constructor(e,{readable:i,writable:r},{options:n,config:o,streamOptions:s,useWebWorkers:a,transferStreams:l,scripts:c},d){const{signal:u}=s;return Object.assign(e,{busy:!0,readable:i.pipeThrough(new gli(o.chunkSize)).pipeThrough(new vli(i,s),{signal:u}),writable:r,options:Object.assign({},n),scripts:c,transferStreams:l,terminate(){return new Promise(h=>{const{worker:f,busy:A}=e;f?(A?e.resolveTerminated=h:(f.terminate(),h()),e.interface=null):h()})},onTaskFinished(){const{resolveTerminated:h}=e;h&&(e.resolveTerminated=null,e.terminated=!0,e.worker.terminate(),h()),e.busy=!1,d(e)}}),(a&&Tce?yli:Dce)(e,o)}}class vli extends TransformStream{constructor(e,{onstart:i,onprogress:r,size:n,onend:o}){let s=0;super({async start(){i&&await YT(i,n)},async transform(a,l){s+=a.length,r&&await YT(r,s,n),l.enqueue(a)},async flush(){e.size=s,o&&await YT(o,s)}})}}async function YT(t,...e){try{await t(...e)}catch{}}function Dce(t,e){return{run:()=>bli(t,e)}}function yli(t,e){const{baseURL:i,chunkSize:r}=e;if(!t.interface){let n;try{n=xli(t.scripts[0],i,t)}catch{return Tce=!1,Dce(t,e)}Object.assign(t,{worker:n,interface:{run:()=>wli(t,{chunkSize:r})}})}return t.interface}async function bli({options:t,readable:e,writable:i,onTaskFinished:r},n){try{const o=new mli(t,n);await e.pipeThrough(o).pipeTo(i,{preventClose:!0,preventAbort:!0});const{signature:s,inputSize:a,outputSize:l}=o;return{signature:s,inputSize:a,outputSize:l}}finally{r()}}async function wli(t,e){let i,r;const n=new Promise((h,f)=>{i=h,r=f});Object.assign(t,{reader:null,writer:null,resolveResult:i,rejectResult:r,result:n});const{readable:o,options:s,scripts:a}=t,{writable:l,closed:c}=Cli(t.writable),d=Z9({type:hli,scripts:a.slice(1),options:s,config:e,readable:o,writable:l},t);d||Object.assign(t,{reader:o.getReader(),writer:l.getWriter()});const u=await n;return d||await l.getWriter().close(),await c,u}function Cli(t){let e;const i=new Promise(r=>e=r);return{writable:new WritableStream({async write(r){const n=t.getWriter();await n.ready,await n.write(r),n.releaseLock()},close(){e()},abort(r){return t.getWriter().abort(r)}}),closed:i}}let Rce=!0,Lce=!0;function xli(t,e,i){const r={type:"module"};let n,o;typeof t==Gv&&(t=t());try{n=new URL(t,e)}catch{n=t}if(Rce)try{o=new Worker(n)}catch{Rce=!1,o=new Worker(n,r)}else o=new Worker(n,r);return o.addEventListener(uli,s=>kli(s,i)),o}function Z9(t,{worker:e,writer:i,onTaskFinished:r,transferStreams:n}){try{const{value:o,readable:s,writable:a}=t,l=[];if(o&&(o.byteLength<o.buffer.byteLength?t.value=o.buffer.slice(0,o.byteLength):t.value=o.buffer,l.push(t.value)),n&&Lce?(s&&l.push(s),a&&l.push(a)):t.readable=t.writable=null,l.length)try{return e.postMessage(t,l),!0}catch{Lce=!1,t.readable=t.writable=null,e.postMessage(t)}else e.postMessage(t)}catch(o){throw i&&i.releaseLock(),r(),o}}async function kli({data:t},e){const{type:i,value:r,messageId:n,result:o,error:s}=t,{reader:a,writer:l,resolveResult:c,rejectResult:d,onTaskFinished:u}=e;try{if(s){const{message:f,stack:A,code:p,name:g}=s,m=new Error(f);Object.assign(m,{stack:A,code:p,name:g}),h(m)}else{if(i==pli){const{value:f,done:A}=await a.read();Z9({type:Bce,value:f,done:A,messageId:n},e)}i==Bce&&(await l.ready,await l.write(new Uint8Array(r)),Z9({type:fli,messageId:n},e)),i==Ice&&h(null,o)}}catch(f){Z9({type:Ice,messageId:n},e),h(f)}function h(f,A){f?d(f):c(A),l&&l.releaseLock(),u()}}let nh=[];const $T=[];let Fce=0;async function Mli(t,e){const{options:i,config:r}=e,{transferStreams:n,useWebWorkers:o,useCompressionStream:s,codecType:a,compressed:l,signed:c,encrypted:d}=i,{workerScripts:u,maxWorkers:h}=r;e.transferStreams=n||n===pn;const f=!l&&!c&&!d&&!e.transferStreams;return e.useWebWorkers=!f&&(o||o===pn&&r.useWebWorkers),e.scripts=e.useWebWorkers&&u?u[a]:[],i.useCompressionStream=s||s===pn&&r.useCompressionStream,(await A()).run();async function A(){const g=nh.find(m=>!m.busy);if(g)return _ce(g),new XT(g,t,e,p);if(nh.length<h){const m={indexWorker:Fce};return Fce++,nh.push(m),new XT(m,t,e,p)}else return new Promise(m=>$T.push({resolve:m,stream:t,workerOptions:e}))}function p(g){if($T.length){const[{resolve:m,stream:w,workerOptions:y}]=$T.splice(0,1);m(new XT(g,w,y,p))}else g.worker?(_ce(g),Pli(g,e)):nh=nh.filter(m=>m!=g)}}function Pli(t,e){const{config:i}=e,{terminateWorkerTimeout:r}=i;Number.isFinite(r)&&r>=0&&(t.terminated?t.terminated=!1:t.terminateTimeout=setTimeout(async()=>{nh=nh.filter(n=>n!=t);try{await t.terminate()}catch{}},r))}function _ce(t){const{terminateTimeout:e}=t;e&&(clearTimeout(e),t.terminateTimeout=null)}function Eli(t,e={}){const i=`const{Array:e,Object:t,Number:n,Math:r,Error:s,Uint8Array:i,Uint16Array:o,Uint32Array:c,Int32Array:f,Map:a,DataView:l,Promise:u,TextEncoder:w,crypto:h,postMessage:d,TransformStream:p,ReadableStream:y,WritableStream:m,CompressionStream:b,DecompressionStream:g}=self,k=void 0,v="undefined",S="function";class z{constructor(e){return class extends p{constructor(t,n){const r=new e(n);super({transform(e,t){t.enqueue(r.append(e))},flush(e){const t=r.flush();t&&e.enqueue(t)}})}}}}const C=[];for(let e=0;256>e;e++){let t=e;for(let e=0;8>e;e++)1&t?t=t>>>1^3988292384:t>>>=1;C[e]=t}class x{constructor(e){this.t=e||-1}append(e){let t=0|this.t;for(let n=0,r=0|e.length;r>n;n++)t=t>>>8^C[255&(t^e[n])];this.t=t}get(){return~this.t}}class A extends p{constructor(){let e;const t=new x;super({transform(e,n){t.append(e),n.enqueue(e)},flush(){const n=new i(4);new l(n.buffer).setUint32(0,t.get()),e.value=n}}),e=this}}const _={concat(e,t){if(0===e.length||0===t.length)return e.concat(t);const n=e[e.length-1],r=_.i(n);return 32===r?e.concat(t):_.o(t,r,0|n,e.slice(0,e.length-1))},l(e){const t=e.length;if(0===t)return 0;const n=e[t-1];return 32*(t-1)+_.i(n)},u(e,t){if(32*e.length<t)return e;const n=(e=e.slice(0,r.ceil(t/32))).length;return t&=31,n>0&&t&&(e[n-1]=_.h(t,e[n-1]&2147483648>>t-1,1)),e},h:(e,t,n)=>32===e?t:(n?0|t:t<<32-e)+1099511627776*e,i:e=>r.round(e/1099511627776)||32,o(e,t,n,r){for(void 0===r&&(r=[]);t>=32;t-=32)r.push(n),n=0;if(0===t)return r.concat(e);for(let s=0;s<e.length;s++)r.push(n|e[s]>>>t),n=e[s]<<32-t;const s=e.length?e[e.length-1]:0,i=_.i(s);return r.push(_.h(t+i&31,t+i>32?n:r.pop(),1)),r}},I={bytes:{p(e){const t=_.l(e)/8,n=new i(t);let r;for(let s=0;t>s;s++)3&s||(r=e[s/4]),n[s]=r>>>24,r<<=8;return n},m(e){const t=[];let n,r=0;for(n=0;n<e.length;n++)r=r<<8|e[n],3&~n||(t.push(r),r=0);return 3&n&&t.push(_.h(8*(3&n),r)),t}}},P=class{constructor(e){const t=this;t.blockSize=512,t.k=[1732584193,4023233417,2562383102,271733878,3285377520],t.v=[1518500249,1859775393,2400959708,3395469782],e?(t.S=e.S.slice(0),t.C=e.C.slice(0),t.A=e.A):t.reset()}reset(){const e=this;return e.S=e.k.slice(0),e.C=[],e.A=0,e}update(e){const t=this;"string"==typeof e&&(e=I._.m(e));const n=t.C=_.concat(t.C,e),r=t.A,i=t.A=r+_.l(e);if(i>9007199254740991)throw new s("Cannot hash more than 2^53 - 1 bits");const o=new c(n);let f=0;for(let e=t.blockSize+r-(t.blockSize+r&t.blockSize-1);i>=e;e+=t.blockSize)t.I(o.subarray(16*f,16*(f+1))),f+=1;return n.splice(0,16*f),t}P(){const e=this;let t=e.C;const n=e.S;t=_.concat(t,[_.h(1,1)]);for(let e=t.length+2;15&e;e++)t.push(0);for(t.push(r.floor(e.A/4294967296)),t.push(0|e.A);t.length;)e.I(t.splice(0,16));return e.reset(),n}D(e,t,n,r){return e>19?e>39?e>59?e>79?void 0:t^n^r:t&n|t&r|n&r:t^n^r:t&n|~t&r}V(e,t){return t<<e|t>>>32-e}I(t){const n=this,s=n.S,i=e(80);for(let e=0;16>e;e++)i[e]=t[e];let o=s[0],c=s[1],f=s[2],a=s[3],l=s[4];for(let e=0;79>=e;e++){16>e||(i[e]=n.V(1,i[e-3]^i[e-8]^i[e-14]^i[e-16]));const t=n.V(5,o)+n.D(e,c,f,a)+l+i[e]+n.v[r.floor(e/20)]|0;l=a,a=f,f=n.V(30,c),c=o,o=t}s[0]=s[0]+o|0,s[1]=s[1]+c|0,s[2]=s[2]+f|0,s[3]=s[3]+a|0,s[4]=s[4]+l|0}},D={getRandomValues(e){const t=new c(e.buffer),n=e=>{let t=987654321;const n=4294967295;return()=>(t=36969*(65535&t)+(t>>16)&n,(((t<<16)+(e=18e3*(65535&e)+(e>>16)&n)&n)/4294967296+.5)*(r.random()>.5?1:-1))};for(let s,i=0;i<e.length;i+=4){const e=n(4294967296*(s||r.random()));s=987654071*e(),t[i/4]=4294967296*e()|0}return e}},V={importKey:e=>new V.R(I.bytes.m(e)),B(e,t,n,r){if(n=n||1e4,0>r||0>n)throw new s("invalid params to pbkdf2");const i=1+(r>>5)<<2;let o,c,f,a,u;const w=new ArrayBuffer(i),h=new l(w);let d=0;const p=_;for(t=I.bytes.m(t),u=1;(i||1)>d;u++){for(o=c=e.encrypt(p.concat(t,[u])),f=1;n>f;f++)for(c=e.encrypt(c),a=0;a<c.length;a++)o[a]^=c[a];for(f=0;(i||1)>d&&f<o.length;f++)h.setInt32(d,o[f]),d+=4}return w.slice(0,r/8)},R:class{constructor(e){const t=this,n=t.M=P,r=[[],[]];t.U=[new n,new n];const s=t.U[0].blockSize/32;e.length>s&&(e=(new n).update(e).P());for(let t=0;s>t;t++)r[0][t]=909522486^e[t],r[1][t]=1549556828^e[t];t.U[0].update(r[0]),t.U[1].update(r[1]),t.K=new n(t.U[0])}reset(){const e=this;e.K=new e.M(e.U[0]),e.N=!1}update(e){this.N=!0,this.K.update(e)}digest(){const e=this,t=e.K.P(),n=new e.M(e.U[1]).update(t).P();return e.reset(),n}encrypt(e){if(this.N)throw new s("encrypt on already updated hmac called!");return this.update(e),this.digest(e)}}},R=typeof h!=v&&typeof h.getRandomValues==S,B="Invalid password",E="Invalid signature",M="zipjs-abort-check-password";function U(e){return R?h.getRandomValues(e):D.getRandomValues(e)}const K=16,N={name:"PBKDF2"},O=t.assign({hash:{name:"HMAC"}},N),T=t.assign({iterations:1e3,hash:{name:"SHA-1"}},N),W=["deriveBits"],j=[8,12,16],H=[16,24,32],L=10,F=[0,0,0,0],q=typeof h!=v,G=q&&h.subtle,J=q&&typeof G!=v,Q=I.bytes,X=class{constructor(e){const t=this;t.O=[[[],[],[],[],[]],[[],[],[],[],[]]],t.O[0][0][0]||t.T();const n=t.O[0][4],r=t.O[1],i=e.length;let o,c,f,a=1;if(4!==i&&6!==i&&8!==i)throw new s("invalid aes key size");for(t.v=[c=e.slice(0),f=[]],o=i;4*i+28>o;o++){let e=c[o-1];(o%i==0||8===i&&o%i==4)&&(e=n[e>>>24]<<24^n[e>>16&255]<<16^n[e>>8&255]<<8^n[255&e],o%i==0&&(e=e<<8^e>>>24^a<<24,a=a<<1^283*(a>>7))),c[o]=c[o-i]^e}for(let e=0;o;e++,o--){const t=c[3&e?o:o-4];f[e]=4>=o||4>e?t:r[0][n[t>>>24]]^r[1][n[t>>16&255]]^r[2][n[t>>8&255]]^r[3][n[255&t]]}}encrypt(e){return this.W(e,0)}decrypt(e){return this.W(e,1)}T(){const e=this.O[0],t=this.O[1],n=e[4],r=t[4],s=[],i=[];let o,c,f,a;for(let e=0;256>e;e++)i[(s[e]=e<<1^283*(e>>7))^e]=e;for(let l=o=0;!n[l];l^=c||1,o=i[o]||1){let i=o^o<<1^o<<2^o<<3^o<<4;i=i>>8^255&i^99,n[l]=i,r[i]=l,a=s[f=s[c=s[l]]];let u=16843009*a^65537*f^257*c^16843008*l,w=257*s[i]^16843008*i;for(let n=0;4>n;n++)e[n][l]=w=w<<24^w>>>8,t[n][i]=u=u<<24^u>>>8}for(let n=0;5>n;n++)e[n]=e[n].slice(0),t[n]=t[n].slice(0)}W(e,t){if(4!==e.length)throw new s("invalid aes block size");const n=this.v[t],r=n.length/4-2,i=[0,0,0,0],o=this.O[t],c=o[0],f=o[1],a=o[2],l=o[3],u=o[4];let w,h,d,p=e[0]^n[0],y=e[t?3:1]^n[1],m=e[2]^n[2],b=e[t?1:3]^n[3],g=4;for(let e=0;r>e;e++)w=c[p>>>24]^f[y>>16&255]^a[m>>8&255]^l[255&b]^n[g],h=c[y>>>24]^f[m>>16&255]^a[b>>8&255]^l[255&p]^n[g+1],d=c[m>>>24]^f[b>>16&255]^a[p>>8&255]^l[255&y]^n[g+2],b=c[b>>>24]^f[p>>16&255]^a[y>>8&255]^l[255&m]^n[g+3],g+=4,p=w,y=h,m=d;for(let e=0;4>e;e++)i[t?3&-e:e]=u[p>>>24]<<24^u[y>>16&255]<<16^u[m>>8&255]<<8^u[255&b]^n[g++],w=p,p=y,y=m,m=b,b=w;return i}},Y=class{constructor(e,t){this.j=e,this.H=t,this.L=t}reset(){this.L=this.H}update(e){return this.F(this.j,e,this.L)}q(e){if(255&~(e>>24))e+=1<<24;else{let t=e>>16&255,n=e>>8&255,r=255&e;255===t?(t=0,255===n?(n=0,255===r?r=0:++r):++n):++t,e=0,e+=t<<16,e+=n<<8,e+=r}return e}G(e){0===(e[0]=this.q(e[0]))&&(e[1]=this.q(e[1]))}F(e,t,n){let r;if(!(r=t.length))return[];const s=_.l(t);for(let s=0;r>s;s+=4){this.G(n);const r=e.encrypt(n);t[s]^=r[0],t[s+1]^=r[1],t[s+2]^=r[2],t[s+3]^=r[3]}return _.u(t,s)}},Z=V.R;let $=q&&J&&typeof G.importKey==S,ee=q&&J&&typeof G.deriveBits==S;class te extends p{constructor({password:e,rawPassword:n,signed:r,encryptionStrength:o,checkPasswordOnly:c}){super({start(){t.assign(this,{ready:new u((e=>this.J=e)),password:ie(e,n),signed:r,X:o-1,pending:new i})},async transform(e,t){const n=this,{password:r,X:o,J:f,ready:a}=n;r?(await(async(e,t,n,r)=>{const i=await se(e,t,n,ce(r,0,j[t])),o=ce(r,j[t]);if(i[0]!=o[0]||i[1]!=o[1])throw new s(B)})(n,o,r,ce(e,0,j[o]+2)),e=ce(e,j[o]+2),c?t.error(new s(M)):f()):await a;const l=new i(e.length-L-(e.length-L)%K);t.enqueue(re(n,e,l,0,L,!0))},async flush(e){const{signed:t,Y:n,Z:r,pending:o,ready:c}=this;if(r&&n){await c;const f=ce(o,0,o.length-L),a=ce(o,o.length-L);let l=new i;if(f.length){const e=ae(Q,f);r.update(e);const t=n.update(e);l=fe(Q,t)}if(t){const e=ce(fe(Q,r.digest()),0,L);for(let t=0;L>t;t++)if(e[t]!=a[t])throw new s(E)}e.enqueue(l)}}})}}class ne extends p{constructor({password:e,rawPassword:n,encryptionStrength:r}){let s;super({start(){t.assign(this,{ready:new u((e=>this.J=e)),password:ie(e,n),X:r-1,pending:new i})},async transform(e,t){const n=this,{password:r,X:s,J:o,ready:c}=n;let f=new i;r?(f=await(async(e,t,n)=>{const r=U(new i(j[t]));return oe(r,await se(e,t,n,r))})(n,s,r),o()):await c;const a=new i(f.length+e.length-e.length%K);a.set(f,0),t.enqueue(re(n,e,a,f.length,0))},async flush(e){const{Y:t,Z:n,pending:r,ready:o}=this;if(n&&t){await o;let c=new i;if(r.length){const e=t.update(ae(Q,r));n.update(e),c=fe(Q,e)}s.signature=fe(Q,n.digest()).slice(0,L),e.enqueue(oe(c,s.signature))}}}),s=this}}function re(e,t,n,r,s,o){const{Y:c,Z:f,pending:a}=e,l=t.length-s;let u;for(a.length&&(t=oe(a,t),n=((e,t)=>{if(t&&t>e.length){const n=e;(e=new i(t)).set(n,0)}return e})(n,l-l%K)),u=0;l-K>=u;u+=K){const e=ae(Q,ce(t,u,u+K));o&&f.update(e);const s=c.update(e);o||f.update(s),n.set(fe(Q,s),u+r)}return e.pending=ce(t,u),n}async function se(n,r,s,o){n.password=null;const c=await(async(e,t,n,r,s)=>{if(!$)return V.importKey(t);try{return await G.importKey("raw",t,n,!1,s)}catch(e){return $=!1,V.importKey(t)}})(0,s,O,0,W),f=await(async(e,t,n)=>{if(!ee)return V.B(t,e.salt,T.iterations,n);try{return await G.deriveBits(e,t,n)}catch(r){return ee=!1,V.B(t,e.salt,T.iterations,n)}})(t.assign({salt:o},T),c,8*(2*H[r]+2)),a=new i(f),l=ae(Q,ce(a,0,H[r])),u=ae(Q,ce(a,H[r],2*H[r])),w=ce(a,2*H[r]);return t.assign(n,{keys:{key:l,$:u,passwordVerification:w},Y:new Y(new X(l),e.from(F)),Z:new Z(u)}),w}function ie(e,t){return t===k?(e=>{if(typeof w==v){const t=new i((e=unescape(encodeURIComponent(e))).length);for(let n=0;n<t.length;n++)t[n]=e.charCodeAt(n);return t}return(new w).encode(e)})(e):t}function oe(e,t){let n=e;return e.length+t.length&&(n=new i(e.length+t.length),n.set(e,0),n.set(t,e.length)),n}function ce(e,t,n){return e.subarray(t,n)}function fe(e,t){return e.p(t)}function ae(e,t){return e.m(t)}class le extends p{constructor({password:e,passwordVerification:n,checkPasswordOnly:r}){super({start(){t.assign(this,{password:e,passwordVerification:n}),de(this,e)},transform(e,t){const n=this;if(n.password){const t=we(n,e.subarray(0,12));if(n.password=null,t[11]!=n.passwordVerification)throw new s(B);e=e.subarray(12)}r?t.error(new s(M)):t.enqueue(we(n,e))}})}}class ue extends p{constructor({password:e,passwordVerification:n}){super({start(){t.assign(this,{password:e,passwordVerification:n}),de(this,e)},transform(e,t){const n=this;let r,s;if(n.password){n.password=null;const t=U(new i(12));t[11]=n.passwordVerification,r=new i(e.length+t.length),r.set(he(n,t),0),s=12}else r=new i(e.length),s=0;r.set(he(n,e),s),t.enqueue(r)}})}}function we(e,t){const n=new i(t.length);for(let r=0;r<t.length;r++)n[r]=ye(e)^t[r],pe(e,n[r]);return n}function he(e,t){const n=new i(t.length);for(let r=0;r<t.length;r++)n[r]=ye(e)^t[r],pe(e,t[r]);return n}function de(e,n){const r=[305419896,591751049,878082192];t.assign(e,{keys:r,ee:new x(r[0]),te:new x(r[2])});for(let t=0;t<n.length;t++)pe(e,n.charCodeAt(t))}function pe(e,t){let[n,s,i]=e.keys;e.ee.append([t]),n=~e.ee.get(),s=be(r.imul(be(s+me(n)),134775813)+1),e.te.append([s>>>24]),i=~e.te.get(),e.keys=[n,s,i]}function ye(e){const t=2|e.keys[2];return me(r.imul(t,1^t)>>>8)}function me(e){return 255&e}function be(e){return 4294967295&e}const ge="deflate-raw";class ke extends p{constructor(e,{chunkSize:t,CompressionStream:n,CompressionStreamNative:r}){super({});const{compressed:s,encrypted:i,useCompressionStream:o,zipCrypto:c,signed:f,level:a}=e,u=this;let w,h,d=Se(super.readable);i&&!c||!f||(w=new A,d=xe(d,w)),s&&(d=Ce(d,o,{level:a,chunkSize:t},r,n)),i&&(c?d=xe(d,new ue(e)):(h=new ne(e),d=xe(d,h))),ze(u,d,(()=>{let e;i&&!c&&(e=h.signature),i&&!c||!f||(e=new l(w.value.buffer).getUint32(0)),u.signature=e}))}}class ve extends p{constructor(e,{chunkSize:t,DecompressionStream:n,DecompressionStreamNative:r}){super({});const{zipCrypto:i,encrypted:o,signed:c,signature:f,compressed:a,useCompressionStream:u}=e;let w,h,d=Se(super.readable);o&&(i?d=xe(d,new le(e)):(h=new te(e),d=xe(d,h))),a&&(d=Ce(d,u,{chunkSize:t},r,n)),o&&!i||!c||(w=new A,d=xe(d,w)),ze(this,d,(()=>{if((!o||i)&&c){const e=new l(w.value.buffer);if(f!=e.getUint32(0,!1))throw new s(E)}}))}}function Se(e){return xe(e,new p({transform(e,t){e&&e.length&&t.enqueue(e)}}))}function ze(e,n,r){n=xe(n,new p({flush:r})),t.defineProperty(e,"readable",{get:()=>n})}function Ce(e,t,n,r,s){try{e=xe(e,new(t&&r?r:s)(ge,n))}catch(r){if(!t)return e;try{e=xe(e,new s(ge,n))}catch(t){return e}}return e}function xe(e,t){return e.pipeThrough(t)}const Ae="data",_e="close";class Ie extends p{constructor(e,n){super({});const r=this,{codecType:s}=e;let i;s.startsWith("deflate")?i=ke:s.startsWith("inflate")&&(i=ve);let o=0,c=0;const f=new i(e,n),a=super.readable,l=new p({transform(e,t){e&&e.length&&(c+=e.length,t.enqueue(e))},flush(){t.assign(r,{inputSize:c})}}),u=new p({transform(e,t){e&&e.length&&(o+=e.length,t.enqueue(e))},flush(){const{signature:e}=f;t.assign(r,{signature:e,outputSize:o,inputSize:c})}});t.defineProperty(r,"readable",{get:()=>a.pipeThrough(l).pipeThrough(f).pipeThrough(u)})}}class Pe extends p{constructor(e){let t;super({transform:function n(r,s){if(t){const e=new i(t.length+r.length);e.set(t),e.set(r,t.length),r=e,t=null}r.length>e?(s.enqueue(r.slice(0,e)),n(r.slice(e),s)):t=r},flush(e){t&&t.length&&e.enqueue(t)}})}}const De=new a,Ve=new a;let Re,Be=0,Ee=!0;async function Me(e){try{const{options:t,scripts:r,config:s}=e;if(r&&r.length)try{Ee?importScripts.apply(k,r):await Ue(r)}catch(e){Ee=!1,await Ue(r)}self.initCodec&&self.initCodec(),s.CompressionStreamNative=self.CompressionStream,s.DecompressionStreamNative=self.DecompressionStream,self.Deflate&&(s.CompressionStream=new z(self.Deflate)),self.Inflate&&(s.DecompressionStream=new z(self.Inflate));const i={highWaterMark:1},o=e.readable||new y({async pull(e){const t=new u((e=>De.set(Be,e)));Ke({type:"pull",messageId:Be}),Be=(Be+1)%n.MAX_SAFE_INTEGER;const{value:r,done:s}=await t;e.enqueue(r),s&&e.close()}},i),c=e.writable||new m({async write(e){let t;const r=new u((e=>t=e));Ve.set(Be,t),Ke({type:Ae,value:e,messageId:Be}),Be=(Be+1)%n.MAX_SAFE_INTEGER,await r}},i),f=new Ie(t,s);Re=new AbortController;const{signal:a}=Re;await o.pipeThrough(f).pipeThrough(new Pe(s.chunkSize)).pipeTo(c,{signal:a,preventClose:!0,preventAbort:!0}),await c.getWriter().close();const{signature:l,inputSize:w,outputSize:h}=f;Ke({type:_e,result:{signature:l,inputSize:w,outputSize:h}})}catch(e){Ne(e)}}async function Ue(e){for(const t of e)await import(t)}function Ke(e){let{value:t}=e;if(t)if(t.length)try{t=new i(t),e.value=t.buffer,d(e,[e.value])}catch(t){d(e)}else d(e);else d(e)}function Ne(e=new s("Unknown error")){const{message:t,stack:n,code:r,name:i}=e;d({error:{message:t,stack:n,code:r,name:i}})}addEventListener("message",(({data:e})=>{const{type:t,messageId:n,value:r,done:s}=e;try{if("start"==t&&Me(e),t==Ae){const e=De.get(n);De.delete(n),e({value:new i(r),done:s})}if("ack"==t){const e=Ve.get(n);Ve.delete(n),e()}t==_e&&Re.abort()}catch(e){Ne(e)}}));const Oe=-2;function Te(t){return We(t.map((([t,n])=>new e(t).fill(n,0,t))))}function We(t){return t.reduce(((t,n)=>t.concat(e.isArray(n)?We(n):n)),[])}const je=[0,1,2,3].concat(...Te([[2,4],[2,5],[4,6],[4,7],[8,8],[8,9],[16,10],[16,11],[32,12],[32,13],[64,14],[64,15],[2,0],[1,16],[1,17],[2,18],[2,19],[4,20],[4,21],[8,22],[8,23],[16,24],[16,25],[32,26],[32,27],[64,28],[64,29]]));function He(){const e=this;function t(e,t){let n=0;do{n|=1&e,e>>>=1,n<<=1}while(--t>0);return n>>>1}e.ne=n=>{const s=e.re,i=e.ie.se,o=e.ie.oe;let c,f,a,l=-1;for(n.ce=0,n.fe=573,c=0;o>c;c++)0!==s[2*c]?(n.ae[++n.ce]=l=c,n.le[c]=0):s[2*c+1]=0;for(;2>n.ce;)a=n.ae[++n.ce]=2>l?++l:0,s[2*a]=1,n.le[a]=0,n.ue--,i&&(n.we-=i[2*a+1]);for(e.he=l,c=r.floor(n.ce/2);c>=1;c--)n.de(s,c);a=o;do{c=n.ae[1],n.ae[1]=n.ae[n.ce--],n.de(s,1),f=n.ae[1],n.ae[--n.fe]=c,n.ae[--n.fe]=f,s[2*a]=s[2*c]+s[2*f],n.le[a]=r.max(n.le[c],n.le[f])+1,s[2*c+1]=s[2*f+1]=a,n.ae[1]=a++,n.de(s,1)}while(n.ce>=2);n.ae[--n.fe]=n.ae[1],(t=>{const n=e.re,r=e.ie.se,s=e.ie.pe,i=e.ie.ye,o=e.ie.me;let c,f,a,l,u,w,h=0;for(l=0;15>=l;l++)t.be[l]=0;for(n[2*t.ae[t.fe]+1]=0,c=t.fe+1;573>c;c++)f=t.ae[c],l=n[2*n[2*f+1]+1]+1,l>o&&(l=o,h++),n[2*f+1]=l,f>e.he||(t.be[l]++,u=0,i>f||(u=s[f-i]),w=n[2*f],t.ue+=w*(l+u),r&&(t.we+=w*(r[2*f+1]+u)));if(0!==h){do{for(l=o-1;0===t.be[l];)l--;t.be[l]--,t.be[l+1]+=2,t.be[o]--,h-=2}while(h>0);for(l=o;0!==l;l--)for(f=t.be[l];0!==f;)a=t.ae[--c],a>e.he||(n[2*a+1]!=l&&(t.ue+=(l-n[2*a+1])*n[2*a],n[2*a+1]=l),f--)}})(n),((e,n,r)=>{const s=[];let i,o,c,f=0;for(i=1;15>=i;i++)s[i]=f=f+r[i-1]<<1;for(o=0;n>=o;o++)c=e[2*o+1],0!==c&&(e[2*o]=t(s[c]++,c))})(s,e.he,n.be)}}function Le(e,t,n,r,s){const i=this;i.se=e,i.pe=t,i.ye=n,i.oe=r,i.me=s}He.ge=[0,1,2,3,4,5,6,7].concat(...Te([[2,8],[2,9],[2,10],[2,11],[4,12],[4,13],[4,14],[4,15],[8,16],[8,17],[8,18],[8,19],[16,20],[16,21],[16,22],[16,23],[32,24],[32,25],[32,26],[31,27],[1,28]])),He.ke=[0,1,2,3,4,5,6,7,8,10,12,14,16,20,24,28,32,40,48,56,64,80,96,112,128,160,192,224,0],He.ve=[0,1,2,3,4,6,8,12,16,24,32,48,64,96,128,192,256,384,512,768,1024,1536,2048,3072,4096,6144,8192,12288,16384,24576],He.Se=e=>256>e?je[e]:je[256+(e>>>7)],He.ze=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],He.Ce=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],He.xe=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],He.Ae=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];const Fe=Te([[144,8],[112,9],[24,7],[8,8]]);Le._e=We([12,140,76,204,44,172,108,236,28,156,92,220,60,188,124,252,2,130,66,194,34,162,98,226,18,146,82,210,50,178,114,242,10,138,74,202,42,170,106,234,26,154,90,218,58,186,122,250,6,134,70,198,38,166,102,230,22,150,86,214,54,182,118,246,14,142,78,206,46,174,110,238,30,158,94,222,62,190,126,254,1,129,65,193,33,161,97,225,17,145,81,209,49,177,113,241,9,137,73,201,41,169,105,233,25,153,89,217,57,185,121,249,5,133,69,197,37,165,101,229,21,149,85,213,53,181,117,245,13,141,77,205,45,173,109,237,29,157,93,221,61,189,125,253,19,275,147,403,83,339,211,467,51,307,179,435,115,371,243,499,11,267,139,395,75,331,203,459,43,299,171,427,107,363,235,491,27,283,155,411,91,347,219,475,59,315,187,443,123,379,251,507,7,263,135,391,71,327,199,455,39,295,167,423,103,359,231,487,23,279,151,407,87,343,215,471,55,311,183,439,119,375,247,503,15,271,143,399,79,335,207,463,47,303,175,431,111,367,239,495,31,287,159,415,95,351,223,479,63,319,191,447,127,383,255,511,0,64,32,96,16,80,48,112,8,72,40,104,24,88,56,120,4,68,36,100,20,84,52,116,3,131,67,195,35,163,99,227].map(((e,t)=>[e,Fe[t]])));const qe=Te([[30,5]]);function Ge(e,t,n,r,s){const i=this;i.Ie=e,i.Pe=t,i.De=n,i.Ve=r,i.Re=s}Le.Be=We([0,16,8,24,4,20,12,28,2,18,10,26,6,22,14,30,1,17,9,25,5,21,13,29,3,19,11,27,7,23].map(((e,t)=>[e,qe[t]]))),Le.Ee=new Le(Le._e,He.ze,257,286,15),Le.Me=new Le(Le.Be,He.Ce,0,30,15),Le.Ue=new Le(null,He.xe,0,19,7);const Je=[new Ge(0,0,0,0,0),new Ge(4,4,8,4,1),new Ge(4,5,16,8,1),new Ge(4,6,32,32,1),new Ge(4,4,16,16,2),new Ge(8,16,32,32,2),new Ge(8,16,128,128,2),new Ge(8,32,128,256,2),new Ge(32,128,258,1024,2),new Ge(32,258,258,4096,2)],Qe=["need dictionary","stream end","","","stream error","data error","","buffer error","",""],Xe=113,Ye=666,Ze=262;function $e(e,t,n,r){const s=e[2*t],i=e[2*n];return i>s||s==i&&r[t]<=r[n]}function et(){const e=this;let t,n,s,c,f,a,l,u,w,h,d,p,y,m,b,g,k,v,S,z,C,x,A,_,I,P,D,V,R,B,E,M,U;const K=new He,N=new He,O=new He;let T,W,j,H,L,F;function q(){let t;for(t=0;286>t;t++)E[2*t]=0;for(t=0;30>t;t++)M[2*t]=0;for(t=0;19>t;t++)U[2*t]=0;E[512]=1,e.ue=e.we=0,W=j=0}function G(e,t){let n,r=-1,s=e[1],i=0,o=7,c=4;0===s&&(o=138,c=3),e[2*(t+1)+1]=65535;for(let f=0;t>=f;f++)n=s,s=e[2*(f+1)+1],++i<o&&n==s||(c>i?U[2*n]+=i:0!==n?(n!=r&&U[2*n]++,U[32]++):i>10?U[36]++:U[34]++,i=0,r=n,0===s?(o=138,c=3):n==s?(o=6,c=3):(o=7,c=4))}function J(t){e.Ke[e.pending++]=t}function Q(e){J(255&e),J(e>>>8&255)}function X(e,t){let n;const r=t;F>16-r?(n=e,L|=n<<F&65535,Q(L),L=n>>>16-F,F+=r-16):(L|=e<<F&65535,F+=r)}function Y(e,t){const n=2*e;X(65535&t[n],65535&t[n+1])}function Z(e,t){let n,r,s=-1,i=e[1],o=0,c=7,f=4;for(0===i&&(c=138,f=3),n=0;t>=n;n++)if(r=i,i=e[2*(n+1)+1],++o>=c||r!=i){if(f>o)do{Y(r,U)}while(0!=--o);else 0!==r?(r!=s&&(Y(r,U),o--),Y(16,U),X(o-3,2)):o>10?(Y(18,U),X(o-11,7)):(Y(17,U),X(o-3,3));o=0,s=r,0===i?(c=138,f=3):r==i?(c=6,f=3):(c=7,f=4)}}function $(){16==F?(Q(L),L=0,F=0):8>F||(J(255&L),L>>>=8,F-=8)}function ee(t,n){let s,i,o;if(e.Ne[W]=t,e.Oe[W]=255&n,W++,0===t?E[2*n]++:(j++,t--,E[2*(He.ge[n]+256+1)]++,M[2*He.Se(t)]++),!(8191&W)&&D>2){for(s=8*W,i=C-k,o=0;30>o;o++)s+=M[2*o]*(5+He.Ce[o]);if(s>>>=3,j<r.floor(W/2)&&s<r.floor(i/2))return!0}return W==T-1}function te(t,n){let r,s,i,o,c=0;if(0!==W)do{r=e.Ne[c],s=e.Oe[c],c++,0===r?Y(s,t):(i=He.ge[s],Y(i+256+1,t),o=He.ze[i],0!==o&&(s-=He.ke[i],X(s,o)),r--,i=He.Se(r),Y(i,n),o=He.Ce[i],0!==o&&(r-=He.ve[i],X(r,o)))}while(W>c);Y(256,t),H=t[513]}function ne(){F>8?Q(L):F>0&&J(255&L),L=0,F=0}function re(t,n,r){X(0+(r?1:0),3),((t,n)=>{ne(),H=8,Q(n),Q(~n),e.Ke.set(u.subarray(t,t+n),e.pending),e.pending+=n})(t,n)}function se(n){((t,n,r)=>{let s,i,o=0;D>0?(K.ne(e),N.ne(e),o=(()=>{let t;for(G(E,K.he),G(M,N.he),O.ne(e),t=18;t>=3&&0===U[2*He.Ae[t]+1];t--);return e.ue+=14+3*(t+1),t})(),s=e.ue+3+7>>>3,i=e.we+3+7>>>3,i>s||(s=i)):s=i=n+5,n+4>s||-1==t?i==s?(X(2+(r?1:0),3),te(Le._e,Le.Be)):(X(4+(r?1:0),3),((e,t,n)=>{let r;for(X(e-257,5),X(t-1,5),X(n-4,4),r=0;n>r;r++)X(U[2*He.Ae[r]+1],3);Z(E,e-1),Z(M,t-1)})(K.he+1,N.he+1,o+1),te(E,M)):re(t,n,r),q(),r&&ne()})(0>k?-1:k,C-k,n),k=C,t.Te()}function ie(){let e,n,r,s;do{if(s=w-A-C,0===s&&0===C&&0===A)s=f;else if(-1==s)s--;else if(C>=f+f-Ze){u.set(u.subarray(f,f+f),0),x-=f,C-=f,k-=f,e=y,r=e;do{n=65535&d[--r],d[r]=f>n?0:n-f}while(0!=--e);e=f,r=e;do{n=65535&h[--r],h[r]=f>n?0:n-f}while(0!=--e);s+=f}if(0===t.We)return;e=t.je(u,C+A,s),A+=e,3>A||(p=255&u[C],p=(p<<g^255&u[C+1])&b)}while(Ze>A&&0!==t.We)}function oe(e){let t,n,r=I,s=C,i=_;const o=C>f-Ze?C-(f-Ze):0;let c=B;const a=l,w=C+258;let d=u[s+i-1],p=u[s+i];R>_||(r>>=2),c>A&&(c=A);do{if(t=e,u[t+i]==p&&u[t+i-1]==d&&u[t]==u[s]&&u[++t]==u[s+1]){s+=2,t++;do{}while(u[++s]==u[++t]&&u[++s]==u[++t]&&u[++s]==u[++t]&&u[++s]==u[++t]&&u[++s]==u[++t]&&u[++s]==u[++t]&&u[++s]==u[++t]&&u[++s]==u[++t]&&w>s);if(n=258-(w-s),s=w-258,n>i){if(x=e,i=n,n>=c)break;d=u[s+i-1],p=u[s+i]}}}while((e=65535&h[e&a])>o&&0!=--r);return i>A?A:i}e.le=[],e.be=[],e.ae=[],E=[],M=[],U=[],e.de=(t,n)=>{const r=e.ae,s=r[n];let i=n<<1;for(;i<=e.ce&&(i<e.ce&&$e(t,r[i+1],r[i],e.le)&&i++,!$e(t,s,r[i],e.le));)r[n]=r[i],n=i,i<<=1;r[n]=s},e.He=(t,S,x,W,j,G)=>(W||(W=8),j||(j=8),G||(G=0),t.Le=null,-1==S&&(S=6),1>j||j>9||8!=W||9>x||x>15||0>S||S>9||0>G||G>2?Oe:(t.Fe=e,a=x,f=1<<a,l=f-1,m=j+7,y=1<<m,b=y-1,g=r.floor((m+3-1)/3),u=new i(2*f),h=[],d=[],T=1<<j+6,e.Ke=new i(4*T),s=4*T,e.Ne=new o(T),e.Oe=new i(T),D=S,V=G,(t=>(t.qe=t.Ge=0,t.Le=null,e.pending=0,e.Je=0,n=Xe,c=0,K.re=E,K.ie=Le.Ee,N.re=M,N.ie=Le.Me,O.re=U,O.ie=Le.Ue,L=0,F=0,H=8,q(),(()=>{w=2*f,d[y-1]=0;for(let e=0;y-1>e;e++)d[e]=0;P=Je[D].Pe,R=Je[D].Ie,B=Je[D].De,I=Je[D].Ve,C=0,k=0,A=0,v=_=2,z=0,p=0})(),0))(t))),e.Qe=()=>42!=n&&n!=Xe&&n!=Ye?Oe:(e.Oe=null,e.Ne=null,e.Ke=null,d=null,h=null,u=null,e.Fe=null,n==Xe?-3:0),e.Xe=(e,t,n)=>{let r=0;return-1==t&&(t=6),0>t||t>9||0>n||n>2?Oe:(Je[D].Re!=Je[t].Re&&0!==e.qe&&(r=e.Ye(1)),D!=t&&(D=t,P=Je[D].Pe,R=Je[D].Ie,B=Je[D].De,I=Je[D].Ve),V=n,r)},e.Ze=(e,t,r)=>{let s,i=r,o=0;if(!t||42!=n)return Oe;if(3>i)return 0;for(i>f-Ze&&(i=f-Ze,o=r-i),u.set(t.subarray(o,o+i),0),C=i,k=i,p=255&u[0],p=(p<<g^255&u[1])&b,s=0;i-3>=s;s++)p=(p<<g^255&u[s+2])&b,h[s&l]=d[p],d[p]=s;return 0},e.Ye=(r,i)=>{let o,w,m,I,R;if(i>4||0>i)return Oe;if(!r.$e||!r.et&&0!==r.We||n==Ye&&4!=i)return r.Le=Qe[4],Oe;if(0===r.tt)return r.Le=Qe[7],-5;var B;if(t=r,I=c,c=i,42==n&&(w=8+(a-8<<4)<<8,m=(D-1&255)>>1,m>3&&(m=3),w|=m<<6,0!==C&&(w|=32),w+=31-w%31,n=Xe,J((B=w)>>8&255),J(255&B)),0!==e.pending){if(t.Te(),0===t.tt)return c=-1,0}else if(0===t.We&&I>=i&&4!=i)return t.Le=Qe[7],-5;if(n==Ye&&0!==t.We)return r.Le=Qe[7],-5;if(0!==t.We||0!==A||0!=i&&n!=Ye){switch(R=-1,Je[D].Re){case 0:R=(e=>{let n,r=65535;for(r>s-5&&(r=s-5);;){if(1>=A){if(ie(),0===A&&0==e)return 0;if(0===A)break}if(C+=A,A=0,n=k+r,(0===C||C>=n)&&(A=C-n,C=n,se(!1),0===t.tt))return 0;if(C-k>=f-Ze&&(se(!1),0===t.tt))return 0}return se(4==e),0===t.tt?4==e?2:0:4==e?3:1})(i);break;case 1:R=(e=>{let n,r=0;for(;;){if(Ze>A){if(ie(),Ze>A&&0==e)return 0;if(0===A)break}if(3>A||(p=(p<<g^255&u[C+2])&b,r=65535&d[p],h[C&l]=d[p],d[p]=C),0===r||(C-r&65535)>f-Ze||2!=V&&(v=oe(r)),3>v)n=ee(0,255&u[C]),A--,C++;else if(n=ee(C-x,v-3),A-=v,v>P||3>A)C+=v,v=0,p=255&u[C],p=(p<<g^255&u[C+1])&b;else{v--;do{C++,p=(p<<g^255&u[C+2])&b,r=65535&d[p],h[C&l]=d[p],d[p]=C}while(0!=--v);C++}if(n&&(se(!1),0===t.tt))return 0}return se(4==e),0===t.tt?4==e?2:0:4==e?3:1})(i);break;case 2:R=(e=>{let n,r,s=0;for(;;){if(Ze>A){if(ie(),Ze>A&&0==e)return 0;if(0===A)break}if(3>A||(p=(p<<g^255&u[C+2])&b,s=65535&d[p],h[C&l]=d[p],d[p]=C),_=v,S=x,v=2,0!==s&&P>_&&f-Ze>=(C-s&65535)&&(2!=V&&(v=oe(s)),5>=v&&(1==V||3==v&&C-x>4096)&&(v=2)),3>_||v>_)if(0!==z){if(n=ee(0,255&u[C-1]),n&&se(!1),C++,A--,0===t.tt)return 0}else z=1,C++,A--;else{r=C+A-3,n=ee(C-1-S,_-3),A-=_-1,_-=2;do{++C>r||(p=(p<<g^255&u[C+2])&b,s=65535&d[p],h[C&l]=d[p],d[p]=C)}while(0!=--_);if(z=0,v=2,C++,n&&(se(!1),0===t.tt))return 0}}return 0!==z&&(n=ee(0,255&u[C-1]),z=0),se(4==e),0===t.tt?4==e?2:0:4==e?3:1})(i)}if(2!=R&&3!=R||(n=Ye),0==R||2==R)return 0===t.tt&&(c=-1),0;if(1==R){if(1==i)X(2,3),Y(256,Le._e),$(),9>1+H+10-F&&(X(2,3),Y(256,Le._e),$()),H=7;else if(re(0,0,!1),3==i)for(o=0;y>o;o++)d[o]=0;if(t.Te(),0===t.tt)return c=-1,0}}return 4!=i?0:1}}function tt(){const e=this;e.nt=0,e.rt=0,e.We=0,e.qe=0,e.tt=0,e.Ge=0}function nt(e){const t=new tt,n=(o=e&&e.chunkSize?e.chunkSize:65536)+5*(r.floor(o/16383)+1);var o;const c=new i(n);let f=e?e.level:-1;void 0===f&&(f=-1),t.He(f),t.$e=c,this.append=(e,r)=>{let o,f,a=0,l=0,u=0;const w=[];if(e.length){t.nt=0,t.et=e,t.We=e.length;do{if(t.rt=0,t.tt=n,o=t.Ye(0),0!=o)throw new s("deflating: "+t.Le);t.rt&&(t.rt==n?w.push(new i(c)):w.push(c.subarray(0,t.rt))),u+=t.rt,r&&t.nt>0&&t.nt!=a&&(r(t.nt),a=t.nt)}while(t.We>0||0===t.tt);return w.length>1?(f=new i(u),w.forEach((e=>{f.set(e,l),l+=e.length}))):f=w[0]?new i(w[0]):new i,f}},this.flush=()=>{let e,r,o=0,f=0;const a=[];do{if(t.rt=0,t.tt=n,e=t.Ye(4),1!=e&&0!=e)throw new s("deflating: "+t.Le);n-t.tt>0&&a.push(c.slice(0,t.rt)),f+=t.rt}while(t.We>0||0===t.tt);return t.Qe(),r=new i(f),a.forEach((e=>{r.set(e,o),o+=e.length})),r}}tt.prototype={He(e,t){const n=this;return n.Fe=new et,t||(t=15),n.Fe.He(n,e,t)},Ye(e){const t=this;return t.Fe?t.Fe.Ye(t,e):Oe},Qe(){const e=this;if(!e.Fe)return Oe;const t=e.Fe.Qe();return e.Fe=null,t},Xe(e,t){const n=this;return n.Fe?n.Fe.Xe(n,e,t):Oe},Ze(e,t){const n=this;return n.Fe?n.Fe.Ze(n,e,t):Oe},je(e,t,n){const r=this;let s=r.We;return s>n&&(s=n),0===s?0:(r.We-=s,e.set(r.et.subarray(r.nt,r.nt+s),t),r.nt+=s,r.qe+=s,s)},Te(){const e=this;let t=e.Fe.pending;t>e.tt&&(t=e.tt),0!==t&&(e.$e.set(e.Fe.Ke.subarray(e.Fe.Je,e.Fe.Je+t),e.rt),e.rt+=t,e.Fe.Je+=t,e.Ge+=t,e.tt-=t,e.Fe.pending-=t,0===e.Fe.pending&&(e.Fe.Je=0))}};const rt=-2,st=-3,it=-5,ot=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],ct=[96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,192,80,7,10,0,8,96,0,8,32,0,9,160,0,8,0,0,8,128,0,8,64,0,9,224,80,7,6,0,8,88,0,8,24,0,9,144,83,7,59,0,8,120,0,8,56,0,9,208,81,7,17,0,8,104,0,8,40,0,9,176,0,8,8,0,8,136,0,8,72,0,9,240,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,200,81,7,13,0,8,100,0,8,36,0,9,168,0,8,4,0,8,132,0,8,68,0,9,232,80,7,8,0,8,92,0,8,28,0,9,152,84,7,83,0,8,124,0,8,60,0,9,216,82,7,23,0,8,108,0,8,44,0,9,184,0,8,12,0,8,140,0,8,76,0,9,248,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,196,81,7,11,0,8,98,0,8,34,0,9,164,0,8,2,0,8,130,0,8,66,0,9,228,80,7,7,0,8,90,0,8,26,0,9,148,84,7,67,0,8,122,0,8,58,0,9,212,82,7,19,0,8,106,0,8,42,0,9,180,0,8,10,0,8,138,0,8,74,0,9,244,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,204,81,7,15,0,8,102,0,8,38,0,9,172,0,8,6,0,8,134,0,8,70,0,9,236,80,7,9,0,8,94,0,8,30,0,9,156,84,7,99,0,8,126,0,8,62,0,9,220,82,7,27,0,8,110,0,8,46,0,9,188,0,8,14,0,8,142,0,8,78,0,9,252,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,194,80,7,10,0,8,97,0,8,33,0,9,162,0,8,1,0,8,129,0,8,65,0,9,226,80,7,6,0,8,89,0,8,25,0,9,146,83,7,59,0,8,121,0,8,57,0,9,210,81,7,17,0,8,105,0,8,41,0,9,178,0,8,9,0,8,137,0,8,73,0,9,242,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,202,81,7,13,0,8,101,0,8,37,0,9,170,0,8,5,0,8,133,0,8,69,0,9,234,80,7,8,0,8,93,0,8,29,0,9,154,84,7,83,0,8,125,0,8,61,0,9,218,82,7,23,0,8,109,0,8,45,0,9,186,0,8,13,0,8,141,0,8,77,0,9,250,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,198,81,7,11,0,8,99,0,8,35,0,9,166,0,8,3,0,8,131,0,8,67,0,9,230,80,7,7,0,8,91,0,8,27,0,9,150,84,7,67,0,8,123,0,8,59,0,9,214,82,7,19,0,8,107,0,8,43,0,9,182,0,8,11,0,8,139,0,8,75,0,9,246,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,206,81,7,15,0,8,103,0,8,39,0,9,174,0,8,7,0,8,135,0,8,71,0,9,238,80,7,9,0,8,95,0,8,31,0,9,158,84,7,99,0,8,127,0,8,63,0,9,222,82,7,27,0,8,111,0,8,47,0,9,190,0,8,15,0,8,143,0,8,79,0,9,254,96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,193,80,7,10,0,8,96,0,8,32,0,9,161,0,8,0,0,8,128,0,8,64,0,9,225,80,7,6,0,8,88,0,8,24,0,9,145,83,7,59,0,8,120,0,8,56,0,9,209,81,7,17,0,8,104,0,8,40,0,9,177,0,8,8,0,8,136,0,8,72,0,9,241,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,201,81,7,13,0,8,100,0,8,36,0,9,169,0,8,4,0,8,132,0,8,68,0,9,233,80,7,8,0,8,92,0,8,28,0,9,153,84,7,83,0,8,124,0,8,60,0,9,217,82,7,23,0,8,108,0,8,44,0,9,185,0,8,12,0,8,140,0,8,76,0,9,249,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,197,81,7,11,0,8,98,0,8,34,0,9,165,0,8,2,0,8,130,0,8,66,0,9,229,80,7,7,0,8,90,0,8,26,0,9,149,84,7,67,0,8,122,0,8,58,0,9,213,82,7,19,0,8,106,0,8,42,0,9,181,0,8,10,0,8,138,0,8,74,0,9,245,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,205,81,7,15,0,8,102,0,8,38,0,9,173,0,8,6,0,8,134,0,8,70,0,9,237,80,7,9,0,8,94,0,8,30,0,9,157,84,7,99,0,8,126,0,8,62,0,9,221,82,7,27,0,8,110,0,8,46,0,9,189,0,8,14,0,8,142,0,8,78,0,9,253,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,195,80,7,10,0,8,97,0,8,33,0,9,163,0,8,1,0,8,129,0,8,65,0,9,227,80,7,6,0,8,89,0,8,25,0,9,147,83,7,59,0,8,121,0,8,57,0,9,211,81,7,17,0,8,105,0,8,41,0,9,179,0,8,9,0,8,137,0,8,73,0,9,243,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,203,81,7,13,0,8,101,0,8,37,0,9,171,0,8,5,0,8,133,0,8,69,0,9,235,80,7,8,0,8,93,0,8,29,0,9,155,84,7,83,0,8,125,0,8,61,0,9,219,82,7,23,0,8,109,0,8,45,0,9,187,0,8,13,0,8,141,0,8,77,0,9,251,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,199,81,7,11,0,8,99,0,8,35,0,9,167,0,8,3,0,8,131,0,8,67,0,9,231,80,7,7,0,8,91,0,8,27,0,9,151,84,7,67,0,8,123,0,8,59,0,9,215,82,7,19,0,8,107,0,8,43,0,9,183,0,8,11,0,8,139,0,8,75,0,9,247,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,207,81,7,15,0,8,103,0,8,39,0,9,175,0,8,7,0,8,135,0,8,71,0,9,239,80,7,9,0,8,95,0,8,31,0,9,159,84,7,99,0,8,127,0,8,63,0,9,223,82,7,27,0,8,111,0,8,47,0,9,191,0,8,15,0,8,143,0,8,79,0,9,255],ft=[80,5,1,87,5,257,83,5,17,91,5,4097,81,5,5,89,5,1025,85,5,65,93,5,16385,80,5,3,88,5,513,84,5,33,92,5,8193,82,5,9,90,5,2049,86,5,129,192,5,24577,80,5,2,87,5,385,83,5,25,91,5,6145,81,5,7,89,5,1537,85,5,97,93,5,24577,80,5,4,88,5,769,84,5,49,92,5,12289,82,5,13,90,5,3073,86,5,193,192,5,24577],at=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],lt=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,112,112],ut=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],wt=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];function ht(){let e,t,n,r,s,i;function o(e,t,o,c,f,a,l,u,w,h,d){let p,y,m,b,g,k,v,S,z,C,x,A,_,I,P;C=0,g=o;do{n[e[t+C]]++,C++,g--}while(0!==g);if(n[0]==o)return l[0]=-1,u[0]=0,0;for(S=u[0],k=1;15>=k&&0===n[k];k++);for(v=k,k>S&&(S=k),g=15;0!==g&&0===n[g];g--);for(m=g,S>g&&(S=g),u[0]=S,I=1<<k;g>k;k++,I<<=1)if(0>(I-=n[k]))return st;if(0>(I-=n[g]))return st;for(n[g]+=I,i[1]=k=0,C=1,_=2;0!=--g;)i[_]=k+=n[C],_++,C++;g=0,C=0;do{0!==(k=e[t+C])&&(d[i[k]++]=g),C++}while(++g<o);for(o=i[m],i[0]=g=0,C=0,b=-1,A=-S,s[0]=0,x=0,P=0;m>=v;v++)for(p=n[v];0!=p--;){for(;v>A+S;){if(b++,A+=S,P=m-A,P=P>S?S:P,(y=1<<(k=v-A))>p+1&&(y-=p+1,_=v,P>k))for(;++k<P&&(y<<=1)>n[++_];)y-=n[_];if(P=1<<k,h[0]+P>1440)return st;s[b]=x=h[0],h[0]+=P,0!==b?(i[b]=g,r[0]=k,r[1]=S,k=g>>>A-S,r[2]=x-s[b-1]-k,w.set(r,3*(s[b-1]+k))):l[0]=x}for(r[1]=v-A,o>C?d[C]<c?(r[0]=256>d[C]?0:96,r[2]=d[C++]):(r[0]=a[d[C]-c]+16+64,r[2]=f[d[C++]-c]):r[0]=192,y=1<<v-A,k=g>>>A;P>k;k+=y)w.set(r,3*(x+k));for(k=1<<v-1;g&k;k>>>=1)g^=k;for(g^=k,z=(1<<A)-1;(g&z)!=i[b];)b--,A-=S,z=(1<<A)-1}return 0!==I&&1!=m?it:0}function c(o){let c;for(e||(e=[],t=[],n=new f(16),r=[],s=new f(15),i=new f(16)),t.length<o&&(t=[]),c=0;o>c;c++)t[c]=0;for(c=0;16>c;c++)n[c]=0;for(c=0;3>c;c++)r[c]=0;s.set(n.subarray(0,15),0),i.set(n.subarray(0,16),0)}this.st=(n,r,s,i,f)=>{let a;return c(19),e[0]=0,a=o(n,0,19,19,null,null,s,r,i,e,t),a==st?f.Le="oversubscribed dynamic bit lengths tree":a!=it&&0!==r[0]||(f.Le="incomplete dynamic bit lengths tree",a=st),a},this.it=(n,r,s,i,f,a,l,u,w)=>{let h;return c(288),e[0]=0,h=o(s,0,n,257,at,lt,a,i,u,e,t),0!=h||0===i[0]?(h==st?w.Le="oversubscribed literal/length tree":-4!=h&&(w.Le="incomplete literal/length tree",h=st),h):(c(288),h=o(s,n,r,0,ut,wt,l,f,u,e,t),0!=h||0===f[0]&&n>257?(h==st?w.Le="oversubscribed distance tree":h==it?(w.Le="incomplete distance tree",h=st):-4!=h&&(w.Le="empty distance tree with lengths",h=st),h):0)}}function dt(){const e=this;let t,n,r,s,i=0,o=0,c=0,f=0,a=0,l=0,u=0,w=0,h=0,d=0;function p(e,t,n,r,s,i,o,c){let f,a,l,u,w,h,d,p,y,m,b,g,k,v,S,z;d=c.nt,p=c.We,w=o.ot,h=o.ct,y=o.write,m=y<o.read?o.read-y-1:o.end-y,b=ot[e],g=ot[t];do{for(;20>h;)p--,w|=(255&c.ft(d++))<<h,h+=8;if(f=w&b,a=n,l=r,z=3*(l+f),0!==(u=a[z]))for(;;){if(w>>=a[z+1],h-=a[z+1],16&u){for(u&=15,k=a[z+2]+(w&ot[u]),w>>=u,h-=u;15>h;)p--,w|=(255&c.ft(d++))<<h,h+=8;for(f=w&g,a=s,l=i,z=3*(l+f),u=a[z];;){if(w>>=a[z+1],h-=a[z+1],16&u){for(u&=15;u>h;)p--,w|=(255&c.ft(d++))<<h,h+=8;if(v=a[z+2]+(w&ot[u]),w>>=u,h-=u,m-=k,v>y){S=y-v;do{S+=o.end}while(0>S);if(u=o.end-S,k>u){if(k-=u,y-S>0&&u>y-S)do{o.lt[y++]=o.lt[S++]}while(0!=--u);else o.lt.set(o.lt.subarray(S,S+u),y),y+=u,S+=u,u=0;S=0}}else S=y-v,y-S>0&&2>y-S?(o.lt[y++]=o.lt[S++],o.lt[y++]=o.lt[S++],k-=2):(o.lt.set(o.lt.subarray(S,S+2),y),y+=2,S+=2,k-=2);if(y-S>0&&k>y-S)do{o.lt[y++]=o.lt[S++]}while(0!=--k);else o.lt.set(o.lt.subarray(S,S+k),y),y+=k,S+=k,k=0;break}if(64&u)return c.Le="invalid distance code",k=c.We-p,k=k>h>>3?h>>3:k,p+=k,d-=k,h-=k<<3,o.ot=w,o.ct=h,c.We=p,c.qe+=d-c.nt,c.nt=d,o.write=y,st;f+=a[z+2],f+=w&ot[u],z=3*(l+f),u=a[z]}break}if(64&u)return 32&u?(k=c.We-p,k=k>h>>3?h>>3:k,p+=k,d-=k,h-=k<<3,o.ot=w,o.ct=h,c.We=p,c.qe+=d-c.nt,c.nt=d,o.write=y,1):(c.Le="invalid literal/length code",k=c.We-p,k=k>h>>3?h>>3:k,p+=k,d-=k,h-=k<<3,o.ot=w,o.ct=h,c.We=p,c.qe+=d-c.nt,c.nt=d,o.write=y,st);if(f+=a[z+2],f+=w&ot[u],z=3*(l+f),0===(u=a[z])){w>>=a[z+1],h-=a[z+1],o.lt[y++]=a[z+2],m--;break}}else w>>=a[z+1],h-=a[z+1],o.lt[y++]=a[z+2],m--}while(m>=258&&p>=10);return k=c.We-p,k=k>h>>3?h>>3:k,p+=k,d-=k,h-=k<<3,o.ot=w,o.ct=h,c.We=p,c.qe+=d-c.nt,c.nt=d,o.write=y,0}e.init=(e,i,o,c,f,a)=>{t=0,u=e,w=i,r=o,h=c,s=f,d=a,n=null},e.ut=(e,y,m)=>{let b,g,k,v,S,z,C,x=0,A=0,_=0;for(_=y.nt,v=y.We,x=e.ot,A=e.ct,S=e.write,z=S<e.read?e.read-S-1:e.end-S;;)switch(t){case 0:if(z>=258&&v>=10&&(e.ot=x,e.ct=A,y.We=v,y.qe+=_-y.nt,y.nt=_,e.write=S,m=p(u,w,r,h,s,d,e,y),_=y.nt,v=y.We,x=e.ot,A=e.ct,S=e.write,z=S<e.read?e.read-S-1:e.end-S,0!=m)){t=1==m?7:9;break}c=u,n=r,o=h,t=1;case 1:for(b=c;b>A;){if(0===v)return e.ot=x,e.ct=A,y.We=v,y.qe+=_-y.nt,y.nt=_,e.write=S,e.wt(y,m);m=0,v--,x|=(255&y.ft(_++))<<A,A+=8}if(g=3*(o+(x&ot[b])),x>>>=n[g+1],A-=n[g+1],k=n[g],0===k){f=n[g+2],t=6;break}if(16&k){a=15&k,i=n[g+2],t=2;break}if(!(64&k)){c=k,o=g/3+n[g+2];break}if(32&k){t=7;break}return t=9,y.Le="invalid literal/length code",m=st,e.ot=x,e.ct=A,y.We=v,y.qe+=_-y.nt,y.nt=_,e.write=S,e.wt(y,m);case 2:for(b=a;b>A;){if(0===v)return e.ot=x,e.ct=A,y.We=v,y.qe+=_-y.nt,y.nt=_,e.write=S,e.wt(y,m);m=0,v--,x|=(255&y.ft(_++))<<A,A+=8}i+=x&ot[b],x>>=b,A-=b,c=w,n=s,o=d,t=3;case 3:for(b=c;b>A;){if(0===v)return e.ot=x,e.ct=A,y.We=v,y.qe+=_-y.nt,y.nt=_,e.write=S,e.wt(y,m);m=0,v--,x|=(255&y.ft(_++))<<A,A+=8}if(g=3*(o+(x&ot[b])),x>>=n[g+1],A-=n[g+1],k=n[g],16&k){a=15&k,l=n[g+2],t=4;break}if(!(64&k)){c=k,o=g/3+n[g+2];break}return t=9,y.Le="invalid distance code",m=st,e.ot=x,e.ct=A,y.We=v,y.qe+=_-y.nt,y.nt=_,e.write=S,e.wt(y,m);case 4:for(b=a;b>A;){if(0===v)return e.ot=x,e.ct=A,y.We=v,y.qe+=_-y.nt,y.nt=_,e.write=S,e.wt(y,m);m=0,v--,x|=(255&y.ft(_++))<<A,A+=8}l+=x&ot[b],x>>=b,A-=b,t=5;case 5:for(C=S-l;0>C;)C+=e.end;for(;0!==i;){if(0===z&&(S==e.end&&0!==e.read&&(S=0,z=S<e.read?e.read-S-1:e.end-S),0===z&&(e.write=S,m=e.wt(y,m),S=e.write,z=S<e.read?e.read-S-1:e.end-S,S==e.end&&0!==e.read&&(S=0,z=S<e.read?e.read-S-1:e.end-S),0===z)))return e.ot=x,e.ct=A,y.We=v,y.qe+=_-y.nt,y.nt=_,e.write=S,e.wt(y,m);e.lt[S++]=e.lt[C++],z--,C==e.end&&(C=0),i--}t=0;break;case 6:if(0===z&&(S==e.end&&0!==e.read&&(S=0,z=S<e.read?e.read-S-1:e.end-S),0===z&&(e.write=S,m=e.wt(y,m),S=e.write,z=S<e.read?e.read-S-1:e.end-S,S==e.end&&0!==e.read&&(S=0,z=S<e.read?e.read-S-1:e.end-S),0===z)))return e.ot=x,e.ct=A,y.We=v,y.qe+=_-y.nt,y.nt=_,e.write=S,e.wt(y,m);m=0,e.lt[S++]=f,z--,t=0;break;case 7:if(A>7&&(A-=8,v++,_--),e.write=S,m=e.wt(y,m),S=e.write,z=S<e.read?e.read-S-1:e.end-S,e.read!=e.write)return e.ot=x,e.ct=A,y.We=v,y.qe+=_-y.nt,y.nt=_,e.write=S,e.wt(y,m);t=8;case 8:return m=1,e.ot=x,e.ct=A,y.We=v,y.qe+=_-y.nt,y.nt=_,e.write=S,e.wt(y,m);case 9:return m=st,e.ot=x,e.ct=A,y.We=v,y.qe+=_-y.nt,y.nt=_,e.write=S,e.wt(y,m);default:return m=rt,e.ot=x,e.ct=A,y.We=v,y.qe+=_-y.nt,y.nt=_,e.write=S,e.wt(y,m)}},e.ht=()=>{}}ht.dt=(e,t,n,r)=>(e[0]=9,t[0]=5,n[0]=ct,r[0]=ft,0);const pt=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];function yt(e,t){const n=this;let r,s=0,o=0,c=0,a=0;const l=[0],u=[0],w=new dt;let h=0,d=new f(4320);const p=new ht;n.ct=0,n.ot=0,n.lt=new i(t),n.end=t,n.read=0,n.write=0,n.reset=(e,t)=>{t&&(t[0]=0),6==s&&w.ht(e),s=0,n.ct=0,n.ot=0,n.read=n.write=0},n.reset(e,null),n.wt=(e,t)=>{let r,s,i;return s=e.rt,i=n.read,r=(i>n.write?n.end:n.write)-i,r>e.tt&&(r=e.tt),0!==r&&t==it&&(t=0),e.tt-=r,e.Ge+=r,e.$e.set(n.lt.subarray(i,i+r),s),s+=r,i+=r,i==n.end&&(i=0,n.write==n.end&&(n.write=0),r=n.write-i,r>e.tt&&(r=e.tt),0!==r&&t==it&&(t=0),e.tt-=r,e.Ge+=r,e.$e.set(n.lt.subarray(i,i+r),s),s+=r,i+=r),e.rt=s,n.read=i,t},n.ut=(e,t)=>{let i,f,y,m,b,g,k,v;for(m=e.nt,b=e.We,f=n.ot,y=n.ct,g=n.write,k=g<n.read?n.read-g-1:n.end-g;;){let S,z,C,x,A,_,I,P;switch(s){case 0:for(;3>y;){if(0===b)return n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t);t=0,b--,f|=(255&e.ft(m++))<<y,y+=8}switch(i=7&f,h=1&i,i>>>1){case 0:f>>>=3,y-=3,i=7&y,f>>>=i,y-=i,s=1;break;case 1:S=[],z=[],C=[[]],x=[[]],ht.dt(S,z,C,x),w.init(S[0],z[0],C[0],0,x[0],0),f>>>=3,y-=3,s=6;break;case 2:f>>>=3,y-=3,s=3;break;case 3:return f>>>=3,y-=3,s=9,e.Le="invalid block type",t=st,n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t)}break;case 1:for(;32>y;){if(0===b)return n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t);t=0,b--,f|=(255&e.ft(m++))<<y,y+=8}if((~f>>>16&65535)!=(65535&f))return s=9,e.Le="invalid stored block lengths",t=st,n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t);o=65535&f,f=y=0,s=0!==o?2:0!==h?7:0;break;case 2:if(0===b)return n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t);if(0===k&&(g==n.end&&0!==n.read&&(g=0,k=g<n.read?n.read-g-1:n.end-g),0===k&&(n.write=g,t=n.wt(e,t),g=n.write,k=g<n.read?n.read-g-1:n.end-g,g==n.end&&0!==n.read&&(g=0,k=g<n.read?n.read-g-1:n.end-g),0===k)))return n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t);if(t=0,i=o,i>b&&(i=b),i>k&&(i=k),n.lt.set(e.je(m,i),g),m+=i,b-=i,g+=i,k-=i,0!=(o-=i))break;s=0!==h?7:0;break;case 3:for(;14>y;){if(0===b)return n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t);t=0,b--,f|=(255&e.ft(m++))<<y,y+=8}if(c=i=16383&f,(31&i)>29||(i>>5&31)>29)return s=9,e.Le="too many length or distance symbols",t=st,n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t);if(i=258+(31&i)+(i>>5&31),!r||r.length<i)r=[];else for(v=0;i>v;v++)r[v]=0;f>>>=14,y-=14,a=0,s=4;case 4:for(;4+(c>>>10)>a;){for(;3>y;){if(0===b)return n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t);t=0,b--,f|=(255&e.ft(m++))<<y,y+=8}r[pt[a++]]=7&f,f>>>=3,y-=3}for(;19>a;)r[pt[a++]]=0;if(l[0]=7,i=p.st(r,l,u,d,e),0!=i)return(t=i)==st&&(r=null,s=9),n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t);a=0,s=5;case 5:for(;i=c,258+(31&i)+(i>>5&31)>a;){let o,w;for(i=l[0];i>y;){if(0===b)return n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t);t=0,b--,f|=(255&e.ft(m++))<<y,y+=8}if(i=d[3*(u[0]+(f&ot[i]))+1],w=d[3*(u[0]+(f&ot[i]))+2],16>w)f>>>=i,y-=i,r[a++]=w;else{for(v=18==w?7:w-14,o=18==w?11:3;i+v>y;){if(0===b)return n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t);t=0,b--,f|=(255&e.ft(m++))<<y,y+=8}if(f>>>=i,y-=i,o+=f&ot[v],f>>>=v,y-=v,v=a,i=c,v+o>258+(31&i)+(i>>5&31)||16==w&&1>v)return r=null,s=9,e.Le="invalid bit length repeat",t=st,n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t);w=16==w?r[v-1]:0;do{r[v++]=w}while(0!=--o);a=v}}if(u[0]=-1,A=[],_=[],I=[],P=[],A[0]=9,_[0]=6,i=c,i=p.it(257+(31&i),1+(i>>5&31),r,A,_,I,P,d,e),0!=i)return i==st&&(r=null,s=9),t=i,n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t);w.init(A[0],_[0],d,I[0],d,P[0]),s=6;case 6:if(n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,1!=(t=w.ut(n,e,t)))return n.wt(e,t);if(t=0,w.ht(e),m=e.nt,b=e.We,f=n.ot,y=n.ct,g=n.write,k=g<n.read?n.read-g-1:n.end-g,0===h){s=0;break}s=7;case 7:if(n.write=g,t=n.wt(e,t),g=n.write,k=g<n.read?n.read-g-1:n.end-g,n.read!=n.write)return n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t);s=8;case 8:return t=1,n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t);case 9:return t=st,n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t);default:return t=rt,n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t)}}},n.ht=e=>{n.reset(e,null),n.lt=null,d=null},n.yt=(e,t,r)=>{n.lt.set(e.subarray(t,t+r),0),n.read=n.write=r},n.bt=()=>1==s?1:0}const mt=13,bt=[0,0,255,255];function gt(){const e=this;function t(e){return e&&e.gt?(e.qe=e.Ge=0,e.Le=null,e.gt.mode=7,e.gt.kt.reset(e,null),0):rt}e.mode=0,e.method=0,e.vt=[0],e.St=0,e.marker=0,e.zt=0,e.Ct=t=>(e.kt&&e.kt.ht(t),e.kt=null,0),e.xt=(n,r)=>(n.Le=null,e.kt=null,8>r||r>15?(e.Ct(n),rt):(e.zt=r,n.gt.kt=new yt(n,1<<r),t(n),0)),e.At=(e,t)=>{let n,r;if(!e||!e.gt||!e.et)return rt;const s=e.gt;for(t=4==t?it:0,n=it;;)switch(s.mode){case 0:if(0===e.We)return n;if(n=t,e.We--,e.qe++,8!=(15&(s.method=e.ft(e.nt++)))){s.mode=mt,e.Le="unknown compression method",s.marker=5;break}if(8+(s.method>>4)>s.zt){s.mode=mt,e.Le="invalid win size",s.marker=5;break}s.mode=1;case 1:if(0===e.We)return n;if(n=t,e.We--,e.qe++,r=255&e.ft(e.nt++),((s.method<<8)+r)%31!=0){s.mode=mt,e.Le="incorrect header check",s.marker=5;break}if(!(32&r)){s.mode=7;break}s.mode=2;case 2:if(0===e.We)return n;n=t,e.We--,e.qe++,s.St=(255&e.ft(e.nt++))<<24&4278190080,s.mode=3;case 3:if(0===e.We)return n;n=t,e.We--,e.qe++,s.St+=(255&e.ft(e.nt++))<<16&16711680,s.mode=4;case 4:if(0===e.We)return n;n=t,e.We--,e.qe++,s.St+=(255&e.ft(e.nt++))<<8&65280,s.mode=5;case 5:return 0===e.We?n:(n=t,e.We--,e.qe++,s.St+=255&e.ft(e.nt++),s.mode=6,2);case 6:return s.mode=mt,e.Le="need dictionary",s.marker=0,rt;case 7:if(n=s.kt.ut(e,n),n==st){s.mode=mt,s.marker=0;break}if(0==n&&(n=t),1!=n)return n;n=t,s.kt.reset(e,s.vt),s.mode=12;case 12:return e.We=0,1;case mt:return st;default:return rt}},e._t=(e,t,n)=>{let r=0,s=n;if(!e||!e.gt||6!=e.gt.mode)return rt;const i=e.gt;return s<1<<i.zt||(s=(1<<i.zt)-1,r=n-s),i.kt.yt(t,r,s),i.mode=7,0},e.It=e=>{let n,r,s,i,o;if(!e||!e.gt)return rt;const c=e.gt;if(c.mode!=mt&&(c.mode=mt,c.marker=0),0===(n=e.We))return it;for(r=e.nt,s=c.marker;0!==n&&4>s;)e.ft(r)==bt[s]?s++:s=0!==e.ft(r)?0:4-s,r++,n--;return e.qe+=r-e.nt,e.nt=r,e.We=n,c.marker=s,4!=s?st:(i=e.qe,o=e.Ge,t(e),e.qe=i,e.Ge=o,c.mode=7,0)},e.Pt=e=>e&&e.gt&&e.gt.kt?e.gt.kt.bt():rt}function kt(){}function vt(e){const t=new kt,n=e&&e.chunkSize?r.floor(2*e.chunkSize):131072,o=new i(n);let c=!1;t.xt(),t.$e=o,this.append=(e,r)=>{const f=[];let a,l,u=0,w=0,h=0;if(0!==e.length){t.nt=0,t.et=e,t.We=e.length;do{if(t.rt=0,t.tt=n,0!==t.We||c||(t.nt=0,c=!0),a=t.At(0),c&&a===it){if(0!==t.We)throw new s("inflating: bad input")}else if(0!==a&&1!==a)throw new s("inflating: "+t.Le);if((c||1===a)&&t.We===e.length)throw new s("inflating: bad input");t.rt&&(t.rt===n?f.push(new i(o)):f.push(o.subarray(0,t.rt))),h+=t.rt,r&&t.nt>0&&t.nt!=u&&(r(t.nt),u=t.nt)}while(t.We>0||0===t.tt);return f.length>1?(l=new i(h),f.forEach((e=>{l.set(e,w),w+=e.length}))):l=f[0]?new i(f[0]):new i,l}},this.flush=()=>{t.Ct()}}kt.prototype={xt(e){const t=this;return t.gt=new gt,e||(e=15),t.gt.xt(t,e)},At(e){const t=this;return t.gt?t.gt.At(t,e):rt},Ct(){const e=this;if(!e.gt)return rt;const t=e.gt.Ct(e);return e.gt=null,t},It(){const e=this;return e.gt?e.gt.It(e):rt},_t(e,t){const n=this;return n.gt?n.gt._t(n,e,t):rt},ft(e){return this.et[e]},je(e,t){return this.et.subarray(e,e+t)}},self.initCodec=()=>{self.Deflate=nt,self.Inflate=vt};
|
|
5472
|
-
`,r=()=>e.useDataURI?"data:text/javascript,"+encodeURIComponent(i):URL.createObjectURL(new Blob([i],{type:"text/javascript"}));t({workerScripts:{inflate:[r],deflate:[r]}})}const Bli="Writer iterator completed too soon",Ili="Content-Type",Sli=64*1024,Oce="writable";class eD{constructor(){this.size=0}init(){this.initialized=!0}}class Uce extends eD{get readable(){const e=this,{chunkSize:i=Sli}=e,r=new ReadableStream({start(){this.chunkOffset=0},async pull(n){const{offset:o=0,size:s,diskNumberStart:a}=r,{chunkOffset:l}=this;n.enqueue(await Qo(e,o+l,Math.min(i,s-l),a)),l+i>s?n.close():this.chunkOffset+=i}});return r}}class Nce extends Uce{constructor(e){super(),Object.assign(this,{blob:e,size:e.size})}async readUint8Array(e,i){const r=this,n=e+i;let o=await(e||n<r.size?r.blob.slice(e,n):r.blob).arrayBuffer();return o.byteLength>i&&(o=o.slice(e,n)),new Uint8Array(o)}}class jce extends eD{constructor(e){super();const i=this,r=new TransformStream,n=[];e&&n.push([Ili,e]),Object.defineProperty(i,Oce,{get(){return r.writable}}),i.blob=new Response(r.readable,{headers:n}).blob()}getData(){return this.blob}}class Tli extends jce{constructor(e){super(e),Object.assign(this,{encoding:e,utf8:!e||e.toLowerCase()=="utf-8"})}async getData(){const{encoding:e,utf8:i}=this,r=await super.getData();if(r.text&&i)return r.text();{const n=new FileReader;return new Promise((o,s)=>{Object.assign(n,{onload:({target:a})=>o(a.result),onerror:()=>s(n.error)}),n.readAsText(r,e)})}}}class Dli extends Uce{constructor(e){super(),this.readers=e}async init(){const e=this,{readers:i}=e;e.lastDiskNumber=0,e.lastDiskOffset=0,await Promise.all(i.map(async(r,n)=>{await r.init(),n!=i.length-1&&(e.lastDiskOffset+=r.size),e.size+=r.size})),super.init()}async readUint8Array(e,i,r=0){const n=this,{readers:o}=this;let s,a=r;a==-1&&(a=o.length-1);let l=e;for(;l>=o[a].size;)l-=o[a].size,a++;const c=o[a],d=c.size;if(l+i<=d)s=await Qo(c,l,i);else{const u=d-l;s=new Uint8Array(i),s.set(await Qo(c,l,u)),s.set(await n.readUint8Array(e+u,i-u,r),u)}return n.lastDiskNumber=Math.max(a,n.lastDiskNumber),s}}class Vce extends eD{constructor(e,i=4294967295){super();const r=this;Object.assign(r,{diskNumber:0,diskOffset:0,size:0,maxSize:i,availableSize:i});let n,o,s;const a=new WritableStream({async write(d){const{availableSize:u}=r;if(s)d.length>=u?(await l(d.slice(0,u)),await c(),r.diskOffset+=n.size,r.diskNumber++,s=null,await this.write(d.slice(u))):await l(d);else{const{value:h,done:f}=await e.next();if(f&&!h)throw new Error(Bli);n=h,n.size=0,n.maxSize&&(r.maxSize=n.maxSize),r.availableSize=r.maxSize,await W9(n),o=h.writable,s=o.getWriter(),await this.write(d)}},async close(){await s.ready,await c()}});Object.defineProperty(r,Oce,{get(){return a}});async function l(d){const u=d.length;u&&(await s.ready,await s.write(d),n.size+=u,r.size+=u,r.availableSize-=u)}async function c(){o.size=n.size,await s.close()}}}async function W9(t,e){if(t.init&&!t.initialized)await t.init(e);else return Promise.resolve()}function Rli(t){return Array.isArray(t)&&(t=new Dli(t)),t instanceof ReadableStream&&(t={readable:t}),t}function Lli(t){t.writable===pn&&typeof t.next==Gv&&(t=new Vce(t)),t instanceof WritableStream&&(t={writable:t});const{writable:e}=t;return e.size===pn&&(e.size=0),t instanceof Vce||Object.assign(t,{diskNumber:0,diskOffset:0,availableSize:1/0,maxSize:1/0}),t}function Qo(t,e,i,r){return t.readUint8Array(e,i,r)}const zce="\0\u263A\u263B\u2665\u2666\u2663\u2660\u2022\u25D8\u25CB\u25D9\u2642\u2640\u266A\u266B\u263C\u25BA\u25C4\u2195\u203C\xB6\xA7\u25AC\u21A8\u2191\u2193\u2192\u2190\u221F\u2194\u25B2\u25BC !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u2302\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\xEC\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\xFF\xD6\xDC\xA2\xA3\xA5\u20A7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\u2310\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0 ".split(""),Fli=zce.length==256;function _li(t){if(Fli){let e="";for(let i=0;i<t.length;i++)e+=zce[t[i]];return e}else return new TextDecoder().decode(t)}function J9(t,e){return e&&e.trim().toLowerCase()=="cp437"?_li(t):new TextDecoder(e).decode(t)}const Hce="filename",qce="rawFilename",Gce="comment",Qce="rawComment",Kce="uncompressedSize",Zce="compressedSize",Wce="offset",tD="diskNumberStart",iD="lastModDate",rD="rawLastModDate",Jce="lastAccessDate",Oli="rawLastAccessDate",Xce="creationDate",Uli="rawCreationDate",Nli="internalFileAttribute",jli="internalFileAttributes",Vli="externalFileAttribute",zli="externalFileAttributes",Hli="msDosCompatible",qli="zip64",Gli="encrypted",Qli="version",Kli="versionMadeBy",Zli="zipCrypto",Wli="directory",Jli="executable",Xli=[Hce,qce,Zce,Kce,iD,rD,Gce,Qce,Jce,Xce,Wce,tD,tD,Nli,jli,Vli,zli,Hli,qli,Gli,Qli,Kli,Zli,Wli,Jli,"bitFlag","signature","filenameUTF8","commentUTF8","compressionMethod","extraField","rawExtraField","extraFieldZip64","extraFieldUnicodePath","extraFieldUnicodeComment","extraFieldAES","extraFieldNTFS","extraFieldExtendedTimestamp"];class Yce{constructor(e){Xli.forEach(i=>this[i]=e[i])}}const oD="File format is not recognized",Yli="End of central directory not found",$li="End of Zip64 central directory locator not found",eci="Central directory header not found",tci="Local file header not found",ici="Zip64 extra field not found",rci="File contains encrypted entry",oci="Encryption method not supported",$ce="Compression method not supported",ede="Split zip file",tde="utf-8",ide="cp437",nci=[[Kce,rh],[Zce,rh],[Wce,rh],[tD,Dd]],sci={[Dd]:{getValue:Hr,bytes:4},[rh]:{getValue:X9,bytes:8}};class aci{constructor(e,i={}){Object.assign(this,{reader:Rli(e),options:i,config:jai()})}async*getEntriesGenerator(e={}){const i=this;let{reader:r}=i;const{config:n}=i;if(await W9(r),(r.size===pn||!r.readUint8Array)&&(r=new Nce(await new Response(r.readable).blob()),await W9(r)),r.size<I2)throw new Error(oD);r.chunkSize=Vai(n);const o=await pci(r,Eai,r.size,I2,Dd*16);if(!o){const I=await Qo(r,0,4),T=wo(I);throw Hr(T)==Pai?new Error(ede):new Error(Yli)}const s=wo(o);let a=Hr(s,12),l=Hr(s,16);const c=o.offset,d=bo(s,20),u=c+I2+d;let h=bo(s,4);const f=r.lastDiskNumber||0;let A=bo(s,6),p=bo(s,8),g=0,m=0;if(l==rh||a==rh||p==Dd||A==Dd){const I=await Qo(r,o.offset-HT,HT),T=wo(I);if(Hr(T,0)==Bai){l=X9(T,8);let L=await Qo(r,l,qT,-1),O=wo(L);const U=o.offset-HT-qT;if(Hr(O,0)!=Kle&&l!=U){const H=l;l=U,g=l-H,L=await Qo(r,l,qT,-1),O=wo(L)}if(Hr(O,0)!=Kle)throw new Error($li);h==Dd&&(h=Hr(O,16)),A==Dd&&(A=Hr(O,20)),p==Dd&&(p=X9(O,32)),a==rh&&(a=X9(O,40)),l-=a}}if(l>=r.size&&(g=r.size-l-a-I2,l=r.size-a-I2),f!=h)throw new Error(ede);if(l<0)throw new Error(oD);let w=0,y=await Qo(r,l,a,A),v=wo(y);if(a){const I=o.offset-a;if(Hr(v,w)!=Qle&&l!=I){const T=l;l=I,g+=l-T,y=await Qo(r,l,a,A),v=wo(y)}}const x=o.offset-l-(r.lastDiskOffset||0);if(a!=x&&x>=0&&(a=x,y=await Qo(r,l,a,A),v=wo(y)),l<0||l>=r.size)throw new Error(oD);const k=An(i,e,"filenameEncoding"),P=An(i,e,"commentEncoding");for(let I=0;I<p;I++){const T=new lci(r,n,i.options);if(Hr(v,w)!=Qle)throw new Error(eci);rde(T,v,w+6);const L=!!T.bitFlag.languageEncodingFlag,O=w+46,U=O+T.filenameLength,H=U+T.extraFieldLength,N=bo(v,w+4),W=N>>8==0,J=N>>8==3,te=y.subarray(O,U),de=bo(v,w+32),Le=H+de,we=y.subarray(H,Le),Ue=L,Ce=L,Te=Hr(v,w+38),ze=W&&(D2(v,w+38)&Xle)==Xle||J&&(Te>>16&Yle)==Yle||te.length&&te[te.length-1]==ece.charCodeAt(0),ne=J&&(Te>>16&$le)==$le,Ie=Hr(v,w+42)+g;Object.assign(T,{versionMadeBy:N,msDosCompatible:W,compressedSize:0,uncompressedSize:0,commentLength:de,directory:ze,offset:Ie,diskNumberStart:bo(v,w+34),internalFileAttributes:bo(v,w+36),externalFileAttributes:Te,rawFilename:te,filenameUTF8:Ue,commentUTF8:Ce,rawExtraField:y.subarray(U,H),executable:ne}),T.internalFileAttribute=T.internalFileAttributes,T.externalFileAttribute=T.externalFileAttributes;const ye=An(i,e,"decodeText")||J9,Se=Ue?tde:k||ide,Xe=Ce?tde:P||ide;let Ye=ye(te,Se);Ye===pn&&(Ye=J9(te,Se));let ee=ye(we,Xe);ee===pn&&(ee=J9(we,Xe)),Object.assign(T,{rawComment:we,filename:Ye,comment:ee,directory:ze||Ye.endsWith(ece)}),m=Math.max(Ie,m),ode(T,T,v,w+6),T.zipCrypto=T.encrypted&&!T.extraFieldAES;const Q=new Yce(T);Q.getData=(xe,ve)=>T.getData(xe,Q,ve),w=Le;const{onprogress:ce}=e;if(ce)try{await ce(I+1,p,new Yce(T))}catch{}yield Q}const E=An(i,e,"extractPrependedData"),B=An(i,e,"extractAppendedData");return E&&(i.prependedData=m>0?await Qo(r,0,m):new Uint8Array),i.comment=d?await Qo(r,c+I2,d):new Uint8Array,B&&(i.appendedData=u<r.size?await Qo(r,u,r.size-u):new Uint8Array),!0}async getEntries(e={}){const i=[];for await(const r of this.getEntriesGenerator(e))i.push(r);return i}async close(){}}class lci{constructor(e,i,r){Object.assign(this,{reader:e,config:i,options:r})}async getData(e,i,r={}){const n=this,{reader:o,offset:s,diskNumberStart:a,extraFieldAES:l,compressionMethod:c,config:d,bitFlag:u,signature:h,rawLastModDate:f,uncompressedSize:A,compressedSize:p}=n,g=i.localDirectory={},m=await Qo(o,s,30,a),w=wo(m);let y=An(n,r,"password"),v=An(n,r,"rawPassword");const x=An(n,r,"passThrough");if(y=y&&y.length&&y,v=v&&v.length&&v,l&&l.originalCompressionMethod!=kai)throw new Error($ce);if(c!=xai&&c!=Cai&&!x)throw new Error($ce);if(Hr(w,0)!=Mai)throw new Error(tci);rde(g,w,4),g.rawExtraField=g.extraFieldLength?await Qo(o,s+30+g.filenameLength,g.extraFieldLength,a):new Uint8Array,ode(n,g,w,4,!0),Object.assign(i,{lastAccessDate:g.lastAccessDate,creationDate:g.creationDate});const k=n.encrypted&&g.encrypted&&!x,P=k&&!l;if(x||(i.zipCrypto=P),k){if(!P&&l.strength===pn)throw new Error(oci);if(!y&&!v)throw new Error(rci)}const E=s+30+g.filenameLength+g.extraFieldLength,B=p,I=o.readable;Object.assign(I,{diskNumberStart:a,offset:E,size:B});const T=An(n,r,"signal"),L=An(n,r,"checkPasswordOnly");L&&(e=new WritableStream),e=Lli(e),await W9(e,x?p:A);const{writable:O}=e,{onstart:U,onprogress:H,onend:N}=r,W={options:{codecType:Sce,password:y,rawPassword:v,zipCrypto:P,encryptionStrength:l&&l.strength,signed:An(n,r,"checkSignature")&&!x,passwordVerification:P&&(u.dataDescriptor?f>>>8&255:h>>>24&255),signature:h,compressed:c!=0&&!x,encrypted:n.encrypted&&!x,useWebWorkers:An(n,r,"useWebWorkers"),useCompressionStream:An(n,r,"useCompressionStream"),transferStreams:An(n,r,"transferStreams"),checkPasswordOnly:L},config:d,streamOptions:{signal:T,size:B,onstart:U,onprogress:H,onend:N}};let J=0;try{({outputSize:J}=await Mli({readable:I,writable:O},W))}catch(te){if(!L||te.message!=KT)throw te}finally{const te=An(n,r,"preventClose");O.size+=J,!te&&!O.locked&&await O.getWriter().close()}return L?pn:e.getData?e.getData():O}}function rde(t,e,i){const r=t.rawBitFlag=bo(e,i+2),n=(r&Zle)==Zle,o=Hr(e,i+6);Object.assign(t,{encrypted:n,version:bo(e,i),bitFlag:{level:(r&Oai)>>1,dataDescriptor:(r&Wle)==Wle,languageEncodingFlag:(r&Jle)==Jle},rawLastModDate:o,lastModDate:fci(o),filenameLength:bo(e,i+22),extraFieldLength:bo(e,i+24)})}function ode(t,e,i,r,n){const{rawExtraField:o}=e,s=e.extraField=new Map,a=wo(new Uint8Array(o));let l=0;try{for(;l<o.length;){const m=bo(a,l),w=bo(a,l+2);s.set(m,{type:m,data:o.slice(l+4,l+4+w)}),l+=4+w}}catch{}const c=bo(i,r+4);Object.assign(e,{signature:Hr(i,r+10),uncompressedSize:Hr(i,r+18),compressedSize:Hr(i,r+14)});const d=s.get(Iai);d&&(cci(d,e),e.extraFieldZip64=d);const u=s.get(Lai);u&&(nde(u,Hce,qce,e,t),e.extraFieldUnicodePath=u);const h=s.get(Fai);h&&(nde(h,Gce,Qce,e,t),e.extraFieldUnicodeComment=h);const f=s.get(Sai);f?(dci(f,e,c),e.extraFieldAES=f):e.compressionMethod=c;const A=s.get(Tai);A&&(uci(A,e),e.extraFieldNTFS=A);const p=s.get(Rai);p&&(hci(p,e,n),e.extraFieldExtendedTimestamp=p);const g=s.get(_ai);g&&(e.extraFieldUSDZ=g)}function cci(t,e){e.zip64=!0;const i=wo(t.data),r=nci.filter(([n,o])=>e[n]==o);for(let n=0,o=0;n<r.length;n++){const[s,a]=r[n];if(e[s]==a){const l=sci[a];e[s]=t[s]=l.getValue(i,o),o+=l.bytes}else if(t[s])throw new Error(ici)}}function nde(t,e,i,r,n){const o=wo(t.data),s=new G9;s.append(n[i]);const a=wo(new Uint8Array(4));a.setUint32(0,s.get(),!0);const l=Hr(o,1);Object.assign(t,{version:D2(o,0),[e]:J9(t.data.subarray(5)),valid:!n.bitFlag.languageEncodingFlag&&l==Hr(a,0)}),t.valid&&(r[e]=t[e],r[e+"UTF8"]=!0)}function dci(t,e,i){const r=wo(t.data),n=D2(r,4);Object.assign(t,{vendorVersion:D2(r,0),vendorId:D2(r,2),strength:n,originalCompressionMethod:i,compressionMethod:bo(r,5)}),e.compressionMethod=t.compressionMethod}function uci(t,e){const i=wo(t.data);let r=4,n;try{for(;r<t.data.length&&!n;){const o=bo(i,r),s=bo(i,r+2);o==Dai&&(n=t.data.slice(r+4,r+4+s)),r+=4+s}}catch{}try{if(n&&n.length==24){const o=wo(n),s=o.getBigUint64(0,!0),a=o.getBigUint64(8,!0),l=o.getBigUint64(16,!0);Object.assign(t,{rawLastModDate:s,rawLastAccessDate:a,rawCreationDate:l});const c=nD(s),d=nD(a),u=nD(l),h={lastModDate:c,lastAccessDate:d,creationDate:u};Object.assign(t,h),Object.assign(e,h)}}catch{}}function hci(t,e,i){const r=wo(t.data),n=D2(r,0),o=[],s=[];i?((n&1)==1&&(o.push(iD),s.push(rD)),(n&2)==2&&(o.push(Jce),s.push(Oli)),(n&4)==4&&(o.push(Xce),s.push(Uli))):t.data.length>=5&&(o.push(iD),s.push(rD));let a=1;o.forEach((l,c)=>{if(t.data.length>=a+4){const d=Hr(r,a);e[l]=t[l]=new Date(d*1e3);const u=s[c];t[u]=d}a+=4})}async function pci(t,e,i,r,n){const o=new Uint8Array(4),s=wo(o);Aci(s,0,e);const a=r+n;return await l(r)||await l(Math.min(a,i));async function l(c){const d=i-c,u=await Qo(t,d,c);for(let h=u.length-r;h>=0;h--)if(u[h]==o[0]&&u[h+1]==o[1]&&u[h+2]==o[2]&&u[h+3]==o[3])return{offset:d+h,buffer:u.slice(h,h+r).buffer}}}function An(t,e,i){return e[i]===pn?t.options[i]:e[i]}function fci(t){const e=(t&4294901760)>>16,i=t&65535;try{return new Date(1980+((e&65024)>>9),((e&480)>>5)-1,e&31,(i&63488)>>11,(i&2016)>>5,(i&31)*2,0)}catch{}}function nD(t){return new Date(Number(t/BigInt(1e4)-BigInt(116444736e5)))}function D2(t,e){return t.getUint8(e)}function bo(t,e){return t.getUint16(e,!0)}function Hr(t,e){return t.getUint32(e,!0)}function X9(t,e){return Number(t.getBigUint64(e,!0))}function Aci(t,e,i){t.setUint32(e,i,!0)}function wo(t){return new DataView(t.buffer)}let sde;try{sde=import.meta.url}catch{}GT({baseURL:sde}),Eli(GT),GT({Deflate:eai,Inflate:wai});function mci(t){return{getDetailedExtensions(e){return[]},getExtensions(e){return[]},getFullTopics(e,i,r,n,o,s,a){return[]},getTopics(e,i,r,n){return[]}}}function gci(t){return{checkProjectAccess(e,i){return{has_read_permission:!0,has_write_permission:!1,has_admin_permission:!1,token_scopes:["bcf:read","document:read","model:read"],usable_scopes:["bcf:read","document:read","model:read"],user_role:50,user:null}},getProjectDMSTree(e,i){return{}},getDocumentHistories(e,i,r){return[]},getProjectUsers(e,i){return[]}}}function vci(t){const e=t,i=e.units.reduce((d,u)=>(u.conversion_baseunit=e.units[u.conversion_baseunit_index],delete u.conversion_baseunit_index,d[u.id]=u,d),{}),r=e.definitions.reduce((d,u)=>(u.unit=e.units[u.unit_id],delete u.unit_id,d[u.id]=u,d),{}),n=e.property_sets.reduce((d,u)=>(u.properties.forEach(h=>{h.definition=e.definitions[h.def_id],delete h.def_id}),d[u.id]=u,d),{}),o=e.classifications.reduce((d,u)=>(u.name=u.type,u.title=u.description,d[u.id]=u,d),{}),s=e.layers.reduce((d,u)=>(u.elements=[],d[u.id]=u,d),{}),a=e.systems.reduce((d,u)=>(u.elements=[],d[u.uuid]=u,d),{}),l={};l.materials_data=e.materials.materials_data.reduce((d,u)=>(u.property_sets=u.psets.map(h=>e.property_sets[h]),delete u.psets,delete u.step_id,d[u.id]=u,d),{}),l.list_components=e.materials.list_components.reduce((d,u)=>(u.material=e.materials.materials_data[u.material],u.option=e.materials.options[u.material_option],d[u.id]=u,delete u.id,d),{}),l.options=e.materials.options.reduce((d,u)=>(u.list_components=u.material_list.map(h=>e.materials.list_components[h]),d[u.id]=u,d),{});const c={};return e.elements.forEach(d=>{d.attributes=e.property_sets[d.attributes],d.property_sets=d.psets.map(u=>e.property_sets[u]),delete d.psets,d.classifications=d.classifications.map(u=>e.classifications[u]),d.systems=d.systems.map(u=>{const h=e.systems[u];return h.elements.push(d.uuid),h}),d.layers=d.layers.map(u=>{const h=e.layers[u];return h.elements.push(d.uuid),h}),d.material_list=d.material_list.map(u=>e.materials.list_components[u]),c[d.uuid]=d}),{units:i,definitions:r,property_sets:n,classifications:o,layers:s,systems:a,materials:l,elements:c}}function yci(t){const e={};return Object.values(t).forEach(i=>{e[i.uuid]={},e[i.uuid].attributes={},i.attributes.properties.forEach(r=>{e[i.uuid].attributes[r.definition.name]=r.value}),i.property_sets.forEach(r=>{e[i.uuid][r.name]={},r.properties.forEach(n=>{e[i.uuid][r.name][n.definition.name]=n.value})})}),e}function bci(t){return Object.values(t).forEach(e=>{e.formattedRawElements=vci(e.rawElements)}),{getModels(e,i,r,n,o){let s=Object.values(t).map(a=>a.model);return s=s.filter(a=>!(a.type==="PDF"&&a.parent_id)),r?.length>0&&(s=s.filter(a=>r.includes(a.source))),n?.length>0&&(s=s.filter(a=>n.includes(a.status))),o?.length>0&&(s=s.filter(a=>o.includes(a.type))),s},getModel(e,i,r){return t[i].model},getTileset(e,i,r,n){console.warn("[BIMData Viewer] Offline Warning: `getTileset` is not available in offline mode.")},getBuildings(e,i,r){return t[i].buildings},getBuildingPlanPositioning(e,i,r,n,o){const s=this.getBuilding(i,n,o,e).plans.find(a=>a.plan.id===r);return{translation_x:s.translation_x,translation_y:s.translation_y,rotate_z:s.rotate_z,scale:s.scale,opacity:s.opacity}},getBuilding(e,i,r,n){return t[i].buildings.find(o=>o.uuid===n)},getModelClassifications(e,i,r){return Object.values(t[i].formattedRawElements.classifications)},listClassificationElementRelations(e,i,r){return Object.values(t[i].formattedRawElements.elements).flatMap(n=>n.classifications.map(o=>({element_uuid:n.uuid,classification_id:o.id})))},getElementsFromClassification(e,i,r,n){return t[r].formattedRawElements.classifications[i].elements},getDrawings(e,i,r){return t[i].drawings},getDrawing(e,i,r,n){return this.getDrawings(e,r,n).find(o=>o.id===i)},getElements(e,i,r,n,o,s){return Object.values(t[i].formattedRawElements.elements).filter(a=>s?a.type===s:n?a.classifications.some(l=>l.name===n):o?a.classifications.some(l=>l.notation===o):!0)},getElementLinkedDocuments(e,i,r){return console.warn("[BIMData Viewer] Offline Warning: `getElementLinkedDocuments` is not available in offline mode."),[]},async getRawElements(e,i,r,n,o,s){return t[i].rawElements},getSimpleElements(e,i,r,n,o,s){const a=this.getElements(e,i,r,n,o,s);return yci(a)},getClassificationsOfElement(e,i,r,n){return this.getElement(e,r,n,i).classifications},getDocumentsOfElement(e,i,r,n){return console.warn("[BIMData Viewer] Offline Warning: `getDocumentsOfElement` is not available in offline mode."),[]},getMaterials(e,i,r,n){return this.getElement(e,r,n,i).material_list.map(o=>o.material)},getMaterial(e,i,r,n,o){return this.getMaterials(e,i,n,o).find(s=>s.id===r)},getElementPropertySets(e,i,r,n){return this.getElement(e,r,n,i).property_sets},getElementPropertySet(e,i,r,n,o){return this.getElementPropertySets(e,i,n,o).find(s=>s.id===r)},getElementPropertySetProperties(e,i,r,n,o){return this.getElementPropertySet(e,i,o,r,n).properties},getElementPropertySetProperty(e,i,r,n,o,s){return this.getElementPropertySetProperties(e,i,n,o,s).find(a=>a.id===r)},getElementPropertySetPropertyDefinitions(e,i,r,n,o,s){return[this.getElementPropertySetProperty(e,i,o,r,n,s).definition]},getElementPropertySetPropertyDefinition(e,i,r,n,o,s,a){const l=this.getElementPropertySetProperty(e,i,s,n,o,a).definition;return l.id===r?l:void 0},getElementPropertySetPropertyDefinitionUnits(e,i,r,n,o,s,a){return[this.getElementPropertySetPropertyDefinition(e,i,s,r,n,o,a).unit]},getElementPropertySetPropertyDefinitionUnit(e,i,r,n,o,s,a,l){const c=this.getElementPropertySetPropertyDefinition(e,i,a,n,o,s,l).unit;return c.id===r?c:void 0},getElement(e,i,r,n){return t[i].formattedRawElements.elements[n]},getSimpleElement(e,i,r,n){return this.getSimpleElements(e,i,r)[n]},getLayers(e,i,r){return Object.values(t[i].formattedRawElements.layers)},getLayer(e,i,r,n){return this.getLayers(e,r,n).find(o=>o.id===i)},getModelMaterials(e,i,r){return Object.values(t[i].formattedRawElements.materials.materials_data)},getModelMaterial(e,i,r,n){return this.getModelMaterials(e,r,n).find(o=>o.id===i)},getProcessorHandlers(e,i,r){return console.warn("[BIMData Viewer] Offline Warning: `getProcessorHandlers` is not available in offline mode."),[]},getProcessorHandler(e,i,r,n){console.warn("[BIMData Viewer] Offline Warning: `getProcessorHandler` is not available in offline mode.")},getModelProperties(e,i,r){return t[i].properties},getModelProperty(e,i,r,n){return t[r].properties.find(o=>o.id===i)},getModelPropertyDefinitions(e,i,r){return Object.values(t[i].formattedRawElements.definitions)},getModelPropertyDefinition(e,i,r,n){return this.getModelPropertyDefinitions(e,r,n).find(o=>o.id===i)},getPropertySets(e,i,r){return Object.values(t[i].formattedRawElements.property_sets)},getPropertySet(e,i,r,n){return this.getPropertySets(e,r,n).find(o=>o.id===i)},getSpaces(e,i,r){return t[i].spaces},getSpace(e,i,r,n){return t[r].spaces.find(o=>o.id===i)},getStoreys(e,i,r){return t[i].storeys},getStoreyPlanPositioning(e,i,r,n,o){const s=this.getStorey(e,r,n,o).plans.find(a=>a.plan.id===i);return{translation_x:s.translation_x,translation_y:s.translation_y,rotate_z:s.rotate_z,scale:s.scale,opacity:s.opacity}},getStorey(e,i,r,n){return t[i].storeys.find(o=>o.uuid===n)},getSystems(e,i,r){return Object.values(t[i].formattedRawElements.systems)},getSystem(e,i,r,n){return this.getSystems(e,i,r).find(o=>o.uuid===n)},getModelUnits(e,i,r){return Object.values(t[i].formattedRawElements.units)},getModelUnit(e,i,r,n){return this.getModelUnits(e,r,n).find(o=>o.id===i)},getZones(e,i,r,n){return t[i].zones.filter(o=>n?o.color===n:!0)},getZone(e,i,r,n){return t[r].zones.find(o=>o.id===i)},getZoneSpaces(e,i,r,n){return this.getZone(e,n,i,r).spaces},getZoneSpace(e,i,r,n,o){return this.getZoneSpaces(e,r,n,o).find(s=>s.id===i)}}}async function wci(t){const e=t.find(r=>r.filename==="data.json"),i=await e?.getData(new Tli);return i?JSON.parse(i):null}async function Xv(t,e,i){const r=t.find(o=>o.filename===`${e.id}/${i}`),n=await r?.getData(new jce);return n?URL.createObjectURL(n):null}async function Cci(t,e){await Promise.all([Xv(t,e,"document_file").then(i=>e.document&&(e.document.file=i)),Xv(t,e,"structure_file").then(i=>e.structure_file=i),Xv(t,e,"map_file").then(i=>e.map_file=i),Xv(t,e,"binary_2d_file").then(i=>e.binary_2d_file=i),...e.xkt_files.map((i,r)=>Xv(t,e,`xkt_file_v${i.version}`).then(n=>e.xkt_files[r]={version:i.version,file:n}))])}async function xci(t){const e=await new aci(new Nce(t)).getEntries(),i=await wci(e);return await Promise.all(Object.values(i).flatMap(({model:r,buildings:n,storeys:o})=>[r].concat(r.children).concat(n.flatMap(s=>s.plans).map(s=>s.plan)).concat(o.flatMap(s=>s.plans).map(s=>s.plan))).map(r=>Cci(e,r))),i}function sD(t,e,i){return new Proxy(t[i],{get:function(r,n){if(e[n])return e[n];throw new Error(`[BIMData Viewer] Offline Error: method \`${i}.${n}\` is not mocked.`)}})}async function kci(t,e,i){var r,n,o;typeof t=="string"&&(t=await fetch(t).then(d=>d.blob()));const s=await xci(t),a=mci(),l=gci(),c=bci(s);return Object.assign(a,(r=i.methods)==null?void 0:r.bcfApi),Object.assign(l,(n=i.methods)==null?void 0:n.collaborationApi),Object.assign(c,(o=i.methods)==null?void 0:o.modelApi),Object.assign({},e,{bcfApi:sD(e,a,"bcfApi"),collaborationApi:sD(e,l,"collaborationApi"),modelApi:sD(e,c,"modelApi")})}class Mci{constructor(e={}){const{apiUrl:i,archiveUrl:r,pdfBackendUrl:n,cloudId:o,projectId:s,accessToken:a,offline:l}=e;this.apiUrl=i,this.archiveUrl=r,this.pdfBackendUrl=n,this.cloudId=o,this.projectId=s,this._accessToken=a,this.offline=l??{enabled:!1};const c=TE.makeBIMDataApiClient({apiUrl:i,accessToken:a});this.apiClient=c,this.ready=Promise.resolve(),this.getModelsPromise=null,Object.assign(c,{BcfApi:function(){return console.warn("[BIMData Viewer] DEPRECATED - API - please use `apiClient.bcfApi` instead of `new apiClient.BcfApi()`."),c.bcfApi},CollaborationApi:function(){return console.warn("[BIMData Viewer] DEPRECATED - API - please use `apiClient.collaborationApi` instead of `new apiClient.CollaborationApi()`."),c.collaborationApi},ModelApi:function(){return console.warn("[BIMData Viewer] DEPRECATED - API - please use `apiClient.modelApi` instead of `new apiClient.ModelApi()`."),c.modelApi},IfcApi:function(){return console.warn("[BIMData Viewer] DEPRECATED - API - please use `apiClient.modelApi` instead of `new apiClient.IfcApi()`."),new Proxy(c.modelApi,{get:function(d,u,h){const f=u.replace("Deprecated","").replace("Ifc","Model");return Reflect.get(d,f,h)}})}})}get accessToken(){return this._accessToken}set accessToken(e){this._accessToken=e,this.apiClient.accessToken=e}async getAvailableModels(e=null,i=!1){return i&&(this.getModelsPromise=null),this.getModelsPromise||(this.getModelsPromise=this.apiClient.modelApi.getModels(this.cloudId,this.projectId)),(await this.getModelsPromise).filter(r=>e?.includes(r.type)??!0)}getModel(e){const{cloudId:i,projectId:r,apiClient:n}=this;return n.modelApi.getModel(i,e,r)}getIfc(e){return console.warn("[BIMData Viewer] DEPRECATED - API - please use the `getModel` method instead of `getIfc`."),this.getModel(e)}async getModelStructure(e){const i=(await(await fetch(e.structure_file)).json())[0];return Gc(i),i}getIfcStructure(e){return console.warn("[BIMData Viewer] DEPRECATED - API - please use the getModelStructure method instead of getIfcStructure."),this.getModelStructure(e)}async getRawElements(e){const{cloudId:i,projectId:r,apiClient:n}=this,o=await n.modelApi.getRawElements(i,e,r);o.units.forEach(a=>{a.conversion_baseunit=o.units[a.conversion_baseunit_index],delete a.conversion_baseunit_index}),o.definitions.forEach(a=>{a.unit=o.units[a.unit_id],delete a.unit_id}),o.property_sets.forEach(a=>{a.properties.forEach(l=>{l.definition=o.definitions[l.def_id],delete l.def_id})});const s={};return o.elements.forEach(a=>{a.attributes=o.property_sets[a.attributes],a.property_sets=a.psets.map(l=>o.property_sets[l]),Object.assign(a,{get propertySets(){return console.warn("propertySets is deprecated, please use property_sets instead."),a.property_sets}}),delete a.psets,a.classifications=a.classifications.map(l=>o.classifications[l]),a.systems=a.systems.map(l=>o.systems[l]),a.layers=a.layers.map(l=>o.layers[l]),s[a.uuid]=a}),s}getStoreys(e){const{cloudId:i,projectId:r,apiClient:n}=this;return n.modelApi.getStoreys(i,e,r)}createModel(e){const{cloudId:i,projectId:r,apiClient:n}=this;return n.modelApi.createModel(i,r,{document_id:e})}async waitForModelProcess(e){const i=["C","E","X"];return i.includes(e.status)?e:new Promise((r,n)=>{const o=setInterval(async()=>{try{let s=await this.getModel(e.id);i.includes(s.status)&&(clearInterval(o),r(s))}catch(s){clearInterval(o),n(s)}},1e3)})}async createStoreyPlan(e,i,r){const{cloudId:n,projectId:o,apiClient:s}=this,a=await this.createModel(r);return await s.modelApi.createStoreyPlan(n,e,o,i,{id:a.id}),a}deleteStoreyPlan(e,i,r){const{cloudId:n,projectId:o,apiClient:s}=this;return s.modelApi.deleteStoreyPlan(n,r,e,o,i)}updatePlanPositioning(e,i,r,n){const{cloudId:o,projectId:s,apiClient:a}=this;return a.modelApi.updateStoreyPlanPositioning(o,r,e,s,i,n)}async enableOfflineMode(e,i={}){let r;this.ready=new Promise(n=>r=n),this.apiClient=await kci(e,this.apiClient,i),this.offline.enabled=!0,r()}disableOfflineMode(){this.offline.enabled&&(this.apiClient=TE.makeBIMDataApiClient({apiUrl:this.apiUrl,accessToken:this.accessToken}),this.offline.enabled=!1)}}function Pci(t){const e=[{methodName:"selectObjects",property:"selected",value:!0,eventName:"objects-selected",exlusiveIndex:1},{methodName:"deselectObjects",property:"selected",value:!1,eventName:"objects-deselected"},{methodName:"highlightObjects",property:"highlighted",value:!0,eventName:"objects-highlighted"},{methodName:"unhighlightObjects",property:"highlighted",value:!1,eventName:"objects-unhighlighted"},{methodName:"showObjects",property:"visible",value:!0,eventName:"objects-shown"},{methodName:"hideObjects",property:"visible",value:!1,eventName:"objects-hidden"},{methodName:"xrayObjects",property:"xrayed",value:!0,eventName:"objects-xrayed"},{methodName:"unxrayObjects",property:"xrayed",value:!1,eventName:"objects-unxrayed"},{methodName:"setObjectsPickable",property:"pickable",value:!0,eventName:"objects-pickable"},{methodName:"setObjectsUnpickable",property:"pickable",value:!1,eventName:"objects-unpickable"}],i=e.reduce((n,o)=>(n[o.methodName]=function(s,a){r(this,o,a);const{property:l,value:c}=o,d=[];for(const u of s){const h=t.get(u);try{h[l]=c,d.push(h)}catch{console.warn(`object with id ${u} does not exist`)}}this.hub.emit(o.eventName,{objects:d,options:{...a}})},n[`${o.methodName}ByUuids`]=function(s,a){r(this,o,a);const{property:l,value:c}=o,d=s.map(u=>this.uuidsMap.get(u)).filter(u=>u?.length>0).flatMap(u=>u.map(h=>(h[l]=c,h)));this.hub.emit(o.eventName,{objects:d,options:{...a}})},n),{}),r=(n,o,s)=>{if(o.exlusiveIndex!==void 0&&s!=null&&s.exclusive){const a=e[o.exlusiveIndex],{property:l,value:c}=o;n[a.methodName](n.objects.filter(d=>d[l]===c).map(d=>d.id),{options:{...s}})}};return{...i,colorizeObjects(n,o,s){const a=[];for(const l of n)try{const c=t.get(l);c.color=o,a.push(c)}catch{console.warn(`object with id ${l} does not exist`)}this.hub.emit("objects-colorized",{objects:a,color:o,options:{...s}})},colorizeObjectsByUuids(n,o,s){const a=n.flatMap(l=>this.uuidsMap.get(l));this.colorizeObjects(a.map(l=>l.id),o,s)},get objects(){return Array.from(t.values())},get objectsIds(){return this.objects.map(n=>n.id)},get objectsUuids(){return Array.from(new Set(this.objects.map(n=>n.uuid)))},get objectsMap(){return t}}}const Eci=Object.freeze({EXA:10**18,PETA:10**15,TERA:10**12,GIGA:10**9,MEGA:10**6,KILO:10**3,HECTO:10**2,DECA:10,DECI:10**-1,CENTI:10**-2,MILLI:10**-3,MICRO:10**-6,NANO:10**-9,PICO:10**-12,FEMTO:10**-15,ATTO:10**-18});async function Bci(t,e,i){async function r(d,u){try{const h=(await t.apiClient.modelApi.getElement(t.cloudId,i,t.projectId,d)).attributes.properties.find(f=>f.definition.name===u);if(h){const f=h.definition.unit;if(f){const{name:A,prefix:p}=f;A!=="METRE"&&console.warn(`[Viewer] Elevation unit other that "METRE" are not supported. Unit "${A}" fallback to "METRE".`);const g=Eci[p];return g===void 0&&console.warn(`[Viewer] Elevation unit prefix "${p}" is unknown and will be ignored.`),(h.value??0)*(g??1)}else return h.value??0}}catch(h){console.warn(`[Models] Cannot get elevation of object with uuid ${d}: ${h}`)}return 0}const n=new Map,o=new Map,s=new Map;function a(){const d=new Set(e.map(u=>{var h,f;return(f=(h=u.object)==null?void 0:h.site)==null?void 0:f.uuid}).filter(Boolean));return P4(d,10,(u,h)=>{r(u,"RefElevation").then(f=>{n.set(u,f),h()},h)})}function l(){const d=new Set(e.map(u=>{var h,f;return(f=(h=u.object)==null?void 0:h.building)==null?void 0:f.uuid}).filter(Boolean));return P4(d,10,(u,h)=>{r(u,"ElevationOfRefHeight").then(f=>{o.set(u,f),h()},h)})}function c(){return P4(e,10,(d,u)=>{r(d.uuid,"Elevation").then(h=>{s.set(d.uuid,h),u()},u)})}await Promise.all([a(),l(),c()]),e.forEach((d,u)=>{var h,f,A,p;const g=s.get(d.uuid)??u;d.elevation=g;const m=o.get((f=(h=d.object)==null?void 0:h.building)==null?void 0:f.uuid);if(m==null){const w=n.get((p=(A=d.object)==null?void 0:A.site)==null?void 0:p.uuid)??0;d.absoluteElevation=g+w}else d.absoluteElevation=g+m}),e.forEach((d,u)=>{var h,f;d.topElevation=((h=e[u+1])==null?void 0:h.elevation)??1/0,d.absoluteTopElevation=((f=e[u+1])==null?void 0:f.absoluteElevation)??1/0})}async function Ici(t,e,i){e.every(r=>r.bimdata_elevation!==null&&r.bimdata_elevation!==void 0)?(e.forEach(r=>{r.elevation=r.bimdata_elevation,r.absoluteElevation=r.bimdata_elevation}),e.forEach((r,n)=>{var o,s;r.topElevation=((o=e[n+1])==null?void 0:o.elevation)??1/0,r.absoluteTopElevation=((s=e[n+1])==null?void 0:s.absoluteElevation)??1/0})):await Bci(t,e,i)}class fD{constructor(e){const{archived:i,binary_2d_file:r,children:n,created_at:o,creator:s,document:a,document_id:l,errors:c,gltf_file:d,id:u,layout_name:h,map_file:f,name:A,north_vector:p,page_number:g,parent_id:m,preview_file:w,project_id:y,recommanded_2d_angle:v,size_ratio:x,source:k,status:P,structure_file:E,systems_file:B,type:I,updated_at:T,version:L,viewer_360_file:O,warnings:U,world_position:H,xkt_file:N,xkt_files:W}=e;this.id=u,this.name=A,this.type=I,this.archived=i,this.binary_2d_file=r,this.children=n?.map(J=>new fD(J))??[],this.created_at=o,this.creator=s,this.document=a,this.document_id=l,this.errors=c,this.gltf_file=d,this.map_file=f,this.north_vector=p,this.page_number=g,this.parent_id=m,this.preview_file=w,this.project_id=y,this.recommanded_2d_angle=v,this.size_ratio=x,this.source=k,this.status=P,this.structure_file=E,this.systems_file=B,this.updated_at=T,this.version=L,this.viewer_360_file=O,this.warnings=U,this.world_position=H,this.xkt_file=N,this.xkt_files=W,this.layout_name=h}}class ade{constructor(e,i,r,n){this.model=i,this.storey=r,this.index=n,this.key=`${r.key}-${e.plan.id}-${n}`,this.translation_x=e.translation_x??0,this.translation_y=e.translation_y??0,this.rotate_z=e.rotate_z??0,this.scale=e.scale??1,this.opacity=e.opacity??1,this.plan=e.plan}}class Sci{constructor(e,i){this.model=i;const{name:r,uuid:n,plans:o,plans_unreachable_count:s,bimdata_elevation:a}=e;this.name=r,this.uuid=n,this.bimdata_elevation=a,this.key=`${i.id}-${this.uuid}`,this.plans_unreachable_count=s,this.plans=o.map((l,c)=>new ade(l,i,this,c)),this.object=i.uuids.get(this.uuid),this.objects=null,this.elevation=null,this.absoluteElevation=null,this.topElevation=null,this.absoluteTopElevation=null}get uuids(){return new Map([...this.objects.values()].map(e=>[e.uuid,e]))}}class AD extends Bx{constructor(e,i){super(e,i,"zone");const{id:r,uuid:n,name:o,created_at:s,updated_at:a,parent_id:l,order:c,zones:d=[],spaces:u=[],color:h,storey_uuid:f}=e;this.id=r,this.uuid=n,this.name=o,this.created_at=s,this.updated_at=a,this.parent_id=l,this.order=c,this.zones=d.map(A=>new AD(A,i)),this.spaces=u,this.color=h,this.storey_uuid=f}getContainedSpaces(){const e=Array.from(this.spaces);for(const i of this.zones)e.push(...i.getContainedSpaces());return e}get area(){return this.getContainedSpaces().filter(e=>e.geometry).reduce((e,i)=>e+Tci(i.geometry),0)}get perimeter(){return this.getContainedSpaces().filter(e=>e.geometry).reduce((e,i)=>e+Dci(i.geometry),0)}}function Tci(t){let e=0;const i=t.length;for(let r=0;r<i;r++){const n=(r+1)%i;e+=t[r].x*t[n].y,e-=t[n].x*t[r].y}return Math.abs(e)/2}function Dci(t){let e=0;const i=t.length;for(let r=0;r<i;r++){const n=(r+1)%i;e+=Math.sqrt(Math.pow(t[n].x-t[r].x,2)+Math.pow(t[n].y-t[r].y,2))}return e}class Rci extends fD{constructor(e,i,{structure:r,zones:n,systems:o,storeys:s}={}){var a,l;if(super(i),this._stateObjectMap=e,this.uuids=new Map,r){const u=qj(r,this,e),h=Jlt(u);this.structure=u,this.objects=h,h.forEach(f=>{f.uuid&&this.uuids.set(f.uuid,f)})}else this.structure=null,this.objects=[];this.zones=[],this.setZones(n??[]),o?.forEach(u=>{const h=new Bx(u,this,"system");this.uuids.set(h.uuid,h),e.set(h.id,h),this.objects.unshift(h)}),this.storeys=s?.map(u=>new Sci(u,this)).sort(Hc("order",!1))??[];const c=new Map(this.storeys.map(u=>[u.uuid,new Set])),d=this.type==="DWG"?"layout":"storey";for(const u of this.objects)u.type!==d&&c.has((a=u[d])==null?void 0:a.uuid)&&c.get((l=u[d])==null?void 0:l.uuid).add(u);for(const u of this.storeys){const h=c.get(u.uuid);u.objects=h?[...h.values()]:[]}this.objects.forEach(u=>{var h,f;u.parent=this.uuids.get((h=u.parent)==null?void 0:h.uuid),u.children=(f=u.children)==null?void 0:f.map(A=>this.uuids.get(A.uuid)).filter(Boolean)})}setZones(e=[]){this.zones.forEach(i=>{this._stateObjectMap.delete(i.id),this.uuids.delete(i.uuid),this.objects.splice(this.objects.indexOf(i),1)}),this.zones=e.map(i=>{const r=new AD(i,this);return this._stateObjectMap.set(r.id,r),this.uuids.set(r.uuid,r),this.objects.unshift(r),r})}}const Lci=(t,e,i)=>{const{api:r}=i;async function n(o){if(typeof o=="string"&&(console.warn(`[State] 'loadModel' called with id ${o} as string and parsed as integer.`),o=parseInt(o)),t.get(o))return console.warn(`[State] 'loadModel' called with id ${o}}, model already loaded.`),t.get(o);const s=[r.apiClient.modelApi.getZones(r.cloudId,o,r.projectId),r.apiClient.modelApi.getSystems(r.cloudId,o,r.projectId),r.getStoreys(o)],a=await r.getModel(o);a.parent_id&&!t.get(a.parent_id)&&await n(a.parent_id),a.structure_file&&s.push(r.getModelStructure(a));const[l,c,d,u]=await Promise.all(s),h=new Rci(e,a,{structure:u,zones:l,systems:c,storeys:d});return await Ici(r,h.storeys,h.id),t.set(o,h),h}return{get models(){return Array.from(t.values())},get ifcs(){return console.warn("[BIMData Viewer] DEPRECATED - State model - please use the models instead of ifcs."),Array.from(t.values()).filter(o=>!o.type||o.type==="IFC")},get modelsMap(){return t},get ifcsMap(){return console.warn("[BIMData Viewer] DEPRECATED - State model - please use the modelsMap instead of ifcsMap."),new Map([...t].filter(([,o])=>!o.type||o.type==="IFC"))},async loadModels(o){const s=await Promise.allSettled(o.map(n));s.filter(l=>l.status==="rejected").forEach(l=>console.error(l.reason));const a=s.filter(l=>l.status==="fulfilled").map(l=>l.value);if(a.length>0){const l=a.filter(c=>!c.type||c.type==="IFC");l.length&&this.hub.emit("ifcs-loaded",{ifcs:l}),this.hub.emit("models-loaded",{models:a}),i.globalContext.hub.emit("models-loaded",{models:a}),this.hub.emit("objects-added",{objects:a.flatMap(c=>c.objects)})}return a},loadIfcs(o){return console.warn("[BIMData Viewer] DEPRECATED - State model - please use the loadModels method instead of loadIfcs."),this.loadModels(o)},unloadModels(o){const s=[],a=[];if(o.forEach(l=>{const c=t.get(l);c?(t.delete(l),c.objects.map(d=>(a.push(d),d.id)).forEach(d=>e.delete(d)),s.push(c)):console.warn(`[State] Cannot unload model with id ${l} because it is not loaded.`)}),a.length>0&&this.hub.emit("objects-removed",{objects:a}),s.length>0){const l=s.filter(c=>!c.type||c.type==="IFC");l.length&&this.hub.emit("ifcs-unloaded",{ifcs:l}),this.hub.emit("models-unloaded",{models:s})}return s},unloadIfcs(o){return console.warn("[BIMData Viewer] DEPRECATED - State model - please use the unloadModels method instead of unloadIfcs."),this.unloadModels(o)},getStoreyFromAbsoluteElevation(o,s){var a;if(!o.storeys)return null;for(let l=0;l<o.storeys.length;l++)if(s>=o.storeys[l].absoluteElevation&&s<(((a=o.storeys[l+1])==null?void 0:a.absoluteElevation)??1/0))return o.storeys[l];return o.storeys[0]}}};function Fci(t){return{async createPlan(e,i,r,n){const o=await t.api.createStoreyPlan(e.id,i.uuid,r.id);await t.api.updatePlanPositioning(e.id,i.uuid,o.id,n);const s=new ade({...n,plan:o},e,i,e.storeys.length);return i.plans.push(s),this.hub.emit("plan-created",{plan:s}),s},async updatePlan(e){const i=await t.api.updatePlanPositioning(e.model.id,e.storey.uuid,e.plan.id,e);return Object.assign(e,i),this.hub.emit("plan-updated",{plan:e}),e},async deletePlan(e){await t.api.deleteStoreyPlan(e.model.id,e.storey.uuid,e.plan.id),e.storey.plans=e.storey.plans.filter(i=>i.key!==e.key),this.hub.emit("plan-deleted",{plan:e})}}}const _ci=(t,e)=>{const i={getObjectsByUuids(r){return r.flatMap(n=>this.uuidsMap.get(n))},getObject(r){return console.warn("[BIMData Viewer] DEPRECATED - State - `getObject` is deprecated, use `objectsMap.get` instead."),e.get(r)},getIfc(r){return console.warn("[BIMData Viewer] DEPRECATED - State - `getIfc` is deprecated, use `modelsMap.get` instead."),t.get(r)},get colorizedObjects(){return Array.from(e.values()).filter(r=>!!r.color)},get colorizedObjectsIds(){return this.colorizedObjects.map(r=>r.id)},get colorizedObjectsUuids(){return Array.from(new Set(this.colorizedObjects.map(r=>r.uuid)))},getObjectsOfType(r){return Array.from(e.values()).filter(n=>n.type===r)},getTypesOf(r){typeof r.map>"u"&&(r=[...r]);const n=new Set;return r.forEach(o=>{const s=e.get(o);s&&s.type&&n.add(s.type)}),Array.from(n).sort()},getObjectsWithTheSameTypeAs(r){const n=this.getTypesOf(r);return[...e.values()].filter(o=>n.includes(o.type))}};return Oci.forEach(r=>{Object.defineProperty(i,r.name,{get(){return Array.from(e.values()).filter(n=>n[r.property]===r.value).map(n=>Object.freeze(Object.defineProperties({},Object.getOwnPropertyDescriptors(n))))}}),Object.defineProperty(i,`${r.name}Ids`,{get(){return this[r.name].map(Uci)}}),Object.defineProperty(i,`${r.name}Uuids`,{get(){return Array.from(new Set(this[r.name].map(Nci)))}})}),i},Oci=[{name:"selectedObjects",property:"selected",value:!0},{name:"deselectedObjects",property:"selected",value:!1},{name:"highlightedObjects",property:"highlighted",value:!0},{name:"unhighlightedObjects",property:"highlighted",value:!1},{name:"visibleObjects",property:"visible",value:!0},{name:"unvisibleObjects",property:"visible",value:!1},{name:"xrayedObjects",property:"xrayed",value:!0},{name:"unxrayedObjects",property:"xrayed",value:!1},{name:"pickableObjects",property:"pickable",value:!0},{name:"unpickableObjects",property:"pickable",value:!1}];function Uci(t){return t.id}function Nci(t){return t.uuid}function aD(t,e,i){var r;return(r=t.mixins)!=null&&r.some(n=>n[i])||(t.mixins?t.mixins[t.mixins.length]=e:t.mixins=[e]),t}const lde=Symbol("annotation-mixin-id");function jci(){let t=0;const e=new Map;return{get annotations(){return Array.from(e.values())},addAnnotation({x:i=0,y:r=0,z:n=0,draggable:o=!0,grabberSelector:s,component:a={render(){}},props:l={}}={},c){const d=this,u=t++,h={get id(){return u},get x(){return i},set x(f){i=f,d.hub.emit("annotation-updated",{annotation:h})},get y(){return r},set y(f){r=f,d.hub.emit("annotation-updated",{annotation:h})},get z(){return n},set z(f){n=f,d.hub.emit("annotation-updated",{annotation:h})},draggable:o,grabberSelector:s,component:a,props:l};return aD(h.component,{[lde]:!0,inject:["$viewer"]},lde),e.set(u,h),this.hub.emit("annotation-added",{annotation:h,options:c}),h},removeAnnotation(i,r){return e.has(i.id)?(e.delete(i.id),this.hub.emit("annotation-removed",{annotation:i,options:r}),!0):!1},clearAnnotations(){e.forEach(i=>this.removeAnnotation(i))}}}function Vci(t){const e=new Map,i=new Map,r={uuidsMap:{get(n){const o=[];return e.forEach(s=>{const a=s.uuids.get(n);a&&o.push(a)}),o}},hub:new Rc};return[Lci(e,i,t),Pci(i),Fci(t),jci(),_ci(e,i)].forEach(n=>Object.defineProperties(r,Object.getOwnPropertyDescriptors(n))),r}function zci(t){if(t?.type==="container")Qci(t);else if(t?.type==="zone")Gci(t);else throw new TypeError("AREAS CORE - Layout first child must be a zone or a container.");return Hci(t),t}function Hci(t){const e=new Set,i=new Set;for(let r of t)if(r.id!=null)if(r.type==="zone"){if(e.has(r.id))throw new Error("AREAS CORE - Cannot add the same zone id twice.");e.add(r.id)}else{if(i.has(r.id))throw new Error("AREAS CORE - Cannot add the same container id twice.");i.add(r.id)}}function qci(t){cde(t.layout,"zone",t.zoneIdManager),cde(t.layout,"container",t.containerIdManager)}function cde(t,e,i){const r=[...t].filter(n=>n.type===e);r.map(n=>n.id).filter(n=>n!=null).forEach(n=>i.add(n)),r.filter(n=>n.id===void 0||n.id===null).forEach(n=>{n.id=i.nextId()})}function Gci(t){if(typeof t!="object")throw new TypeError("AREAS CORE - Invalid zone. Zone must be an object.");if(t?.type!=="zone")throw new TypeError('AREAS CORE - Invalid zone. A zone must be of type "zone".');return t}function Qci(t){var e,i;if(typeof t!="object")throw new TypeError("AREAS CORE - Invalid container. A container must be an object.");if(t?.type!=="container")throw new TypeError('AREAS CORE - Invalid container. Container must be of type "container".');if(t!=null&&t.direction&&!["row","column"].includes(t.direction))throw new TypeError('AREAS CORE - Invalid container. Container direction must be of type "row" or "column".');if(((e=t?.children)==null?void 0:e.length)<2)throw new TypeError("AREAS CORE - Invalid container. Container children must have at least 2 children.");if(((i=t?.children)==null?void 0:i.reduce((r,n)=>r+n?.ratio,0))!==100)throw new TypeError("AREAS CORE - Invalid container. The sum of container children ratios must be equal to 100.");return t}function dde(t){var e;return(e=t.children)!=null&&e.length&&t.children.forEach(i=>{Object.defineProperty(i,Symbol.iterator,{value:dde(i),configurable:!0})}),function*(){var i;if(yield t,(i=t.children)!=null&&i.length)for(let r of t.children)yield*r}}function R2(t){return Object.defineProperty(t,Symbol.iterator,{value:dde(t),configurable:!0}),t}function ude(){let t=1;const e=new Set;return{nextId(){for(;!this.isIdAvailable(t);)t++;return e.add(t),t},isIdAvailable(i){return!e.has(i)},add(i){return this.isIdAvailable(i)?(e.add(i),i):!1}}}function hde(t){var e;if(!t)return;const i=Object.assign({},t);return((e=t.children)==null?void 0:e.length)>0&&(i.children=t.children.map(hde)),i}function Kci(t){return e=>{const i=t.getZone(e);if(!i)return!1;const r=t.getParent(i);if(!r)throw new Error("AREAS CORE - Cannot delete root Zone");const n=r.children.indexOf(i);if(r.children.length>2){const o=r.children[n-1],s=r.children[n+1];n===0?s.ratio+=i.ratio:n===r.children.length-1?o.ratio+=i.ratio:(o.ratio+=Math.floor(i.ratio/2),s.ratio+=Math.ceil(i.ratio/2)),r.children=r.children.filter(a=>a.type!=="zone"||a.id!==e)}else{const o=r.children[n===1?0:1];o.ratio=r.ratio;const s=t.getParent(r);if(s){const a=s.children.indexOf(r);s.children.splice(a,1,o)}else t.layout=o}return!0}}var Zci=Kci;function Wci(t){return()=>pde(t.layout,[t.layout])}function pde(t,e=[]){var i;return(i=t.children)==null||i.forEach(r=>{e.push(r),r.type==="container"&&pde(r,e)}),e}var Jci=Wci;function Xci(t){return e=>{if(!e)throw new TypeError("AREAS CORE - fail to get parent: container child is null or undefined");return t.layout.type==="zone"?null:fde(t.layout,e)}}function fde(t,e){for(let i of t.children){if(i===e)return t;if(i.type==="container"){const r=fde(i,e);if(r)return r}}return null}var Yci=Xci;function $ci(t){return e=>t.layout.type==="zone"?t.layout.id===e?t.layout:null:Ade(t.layout,e)}function Ade(t,e){for(let i of t.children)if(i.type==="zone"){if(i.id===e)return i}else{const r=Ade(i,e);if(r)return r}return null}var edi=$ci;function tdi(t){return(e,i)=>{if(typeof i!="number")throw new TypeError("AREAS CORE - resize value must be a number.");const r=t.getParent(e),n=r.children.findIndex(s=>s===e);if(n===-1)return!1;const o=r.children[n+1];if(o){const s=e.ratio+o.ratio;let a=e.ratio+i;return a=a<0?0:a,a=a>s?s:a,e.ratio=a,o.ratio=s-a,!0}else return!1}}var idi=tdi;function rdi(t){return(e,i=50,r="row",n=!0,o=null)=>{const s=t.getZone(e);if(!s)throw new Error(`AREAS CORE - fail to split zone ${e}: zone does not exist.`);if(typeof i!="number"||i<0||i>100)throw new TypeError(`AREAS CORE - fail to split zone: invalid ratio ${i}, ratio should be a number between 0 and 100.`);if(r!=="row"&&r!=="column")throw new TypeError(`AREAS CORE - fail to split zone: invalid direction ${r}, direction should be 'row' or 'column'.`);const a=t.getParent(s),l=R2({id:t.zoneIdManager.nextId(),type:"zone",...o});if(a){const c=a.children.findIndex(d=>d===s);if(a.direction===r)n?(l.ratio=Math.floor(s.ratio*(100-i)/100),s.ratio=Math.ceil(s.ratio*i/100),a.children.splice(c,1,s,l)):(l.ratio=Math.floor(s.ratio*i/100),s.ratio=Math.ceil(s.ratio*(100-i)/100),a.children.splice(c,1,l,s));else{const d=R2({id:t.containerIdManager.nextId(),type:"container",direction:r,ratio:s.ratio});n?(l.ratio=Math.floor(100-i),s.ratio=Math.ceil(i),d.children=[s,l]):(l.ratio=Math.floor(i),s.ratio=Math.ceil(100-i),d.children=[l,s]),a.children.splice(c,1,d)}}else{const c=R2({id:t.containerIdManager.nextId(),type:"container",direction:r});n?(l.ratio=Math.floor(100-i),s.ratio=Math.ceil(i),c.children=[s,l]):(l.ratio=Math.floor(i),s.ratio=Math.ceil(100-i),c.children=[l,s]),t._layout=c}return l}}var odi=rdi;function ndi(t){return(e=50,i="row",r=!0,n=null)=>{const o=t.layout;if(typeof e!="number"||e<0||e>100)throw new TypeError(`AREAS CORE - fail to split layout: invalid ratio ${e}, ratio should be a number between 0 and 100.`);if(i!=="row"&&i!=="column")throw new TypeError(`AREAS CORE - fail to split layout: invalid direction ${i}, direction should be 'row' or 'column'.`);const s=R2({id:t.zoneIdManager.nextId(),type:"zone",...n}),a=R2({id:t.containerIdManager.nextId(),type:"container",direction:i});return r?(s.ratio=Math.floor(100-e),o.ratio=Math.ceil(e),a.children=[o,s]):(s.ratio=Math.floor(e),o.ratio=Math.ceil(100-e),a.children=[s,o]),t._layout=a,s}}var sdi=ndi;function adi(t){return(e,i)=>{const r=t.getZone(e),n=t.getZone(i);if(!r)throw new Error(`AREAS CORE - fail to swap zone ${e}: zone does not exist.`);if(!n)throw new Error(`AREAS CORE - fail to swap to zone ${i}: zone does not exist.`);const o=t.getParent(r),s=t.getParent(n),a=o.children.indexOf(r),l=s.children.indexOf(n),c=r.ratio,d=n.ratio;r.ratio=d,n.ratio=c,o.children[a]=n,s.children[l]=r}}var ldi=adi;function cdi(t){const e={_layout:null,get layout(){return this._layout},set layout(i){i||(i={type:"zone"}),R2(i),zci(i),this._layout=i,qci(e)},zoneIdManager:ude(),containerIdManager:ude()};return e.layout=t,e.deleteZone=Zci(e),e.getNodes=Jci(e),e.getParent=Yci(e),e.getZone=edi(e),e.resize=idi(e),e.splitZone=odi(e),e.splitLayout=sdi(e),e.swapZones=ldi(e),e}var ddi=cdi;function mde(t=1,e=0,i=100){return Math.min(Math.max(e,t),i)}function gde(t,e){const i=t.getParent(e);if(i){const{width:r,height:n}=gde(t,i),o=i.children.length-1;return i.direction==="column"?{width:r,height:Math.max(0,(n-o*t.separatorSize)*(e.ratio/100))}:{width:Math.max(0,(r-o*t.separatorSize)*(e.ratio/100)),height:n}}else return{width:t.width,height:t.height}}function vde(t,e,i){const{width:r,height:n}=gde(t,e),o=e.children.length-1;if(e.direction==="column"){const s=1-o*t.separatorSize/n;return{height:`${mde(i.ratio*s,0,100)}%`,width:"100%"}}else{const s=1-o*t.separatorSize/r;return{height:"100%",width:`${mde(i.ratio*s,0,100)}%`}}}function udi(t,e){const i={ref:t.contentManager.getRef(e.id),id:`zone-${e.id}`,class:"areas-zone",style:{flexGrow:0,overflow:"hidden"},key:e.id},r=t.getParent(e);if(r){const{width:n,height:o}=vde(t,r,e);i.style={width:n,height:o}}else i.style={height:"100%"};return t.vue.h("div",i)}var lD=udi;function hdi(t,e,i){const{separatorSize:r,separatorDetectionMargin:n,separatorDetectionZIndex:o}=t,s=e.direction==="column",a={ref:`separator-${e.id}-${i+1}`,class:"areas-separator",style:{[s?"height":"width"]:`${r}px`,backgroundColor:"var(--areas-separator-color, black)",flexShrink:0,position:"relative"}},l=s?"ns-resize":"ew-resize",c=t.vue.h("div",{style:{position:"absolute",[s?"height":"width"]:`${n*2}px`,[s?"width":"height"]:"100%",[s?"top":"left"]:`${-n+r/2}px`,zIndex:o,cursor:l},onMousedown:d=>pdi(t,e,i,d,l)});return t.vue.h("div",a,t.resizable?[c]:null)}function pdi(t,e,i,r,n){r.preventDefault(),r.stopPropagation(),document.body.style.cursor=n;const o=a=>fdi(t,e,i,a),s=()=>Adi(o,s);document.addEventListener("mousemove",o),document.addEventListener("mouseup",s)}function fdi(t,e,i,r){const n=e.children[i],o=e.direction==="column"?"height":"width",s=t.root.$refs[`separator-${e.id}-${i+1}`].getBoundingClientRect(),{separatorSize:a}=t,l=(e.direction==="column"?r.clientY-s.y:r.clientX-s.x)-a/2,c=t.root.$refs[`container-${e.id}`].getBoundingClientRect()[o],d=l/c*100;t.resize(n,d)}function Adi(t,e){document.removeEventListener("mousemove",t),document.removeEventListener("mouseup",e),document.body.style.cursor=""}var mdi=hdi;function cD(t,e){const i={ref:`container-${e.id}`,id:`container-${e.id}`,class:"areas-container",style:{height:"100%",display:"flex",flexDirection:e.direction}},r=t.getParent(e);if(r){const{width:s,height:a}=vde(t,r,e);i.style.width=s,i.style.height=a}const n=e.children.length-1,o=e.children.map((s,a)=>a<=n-1?[s.type==="zone"?lD(t,s):cD(t,s),mdi(t,e,a)]:s.type==="zone"?lD(t,s):cD(t,s));return t.vue.h("div",i,[o])}var gdi=cD;function vdi(t){const e=new Map,i=new Map,r=new Map;e.set("default",{component:{render(){return t.vue.h("div","Default component")}}});function n(o){return o&&!e.has(o)&&(console.warn(`[AREAS] Content with name ${o} is not registered, fallback to 'default'.`),o="default"),e.get(o)}return{registerContent(o,s){e.set(o,{name:o,component:s})},renderContent(o){return[...o].filter(s=>s.type==="zone").forEach(s=>{i.set(s.id,Object.assign({},n(s.content??"default"),{ref:t.vue.ref(null),options:{zoneId:s.id,...s.options,key:s.id},name:s.content??"default"}))}),t.vue.h("div",{style:{display:"none"}},[...i.values()].map(s=>t.vue.h(s.component,{...s.options,ref:s.ref})))},link(){[...r.entries()].forEach(([o,s])=>{const a=i.get(o);if(!a)return;const l=a.ref.value.$el,c=s.value;for(;c.lastChild;)c.removeChild(c.lastChild);c.appendChild(l)})},getElementZoneId(o){var s;for(const[a,l]of[...r.entries()])if((s=l.value)!=null&&s.contains(o))return a;return null},getRef(o){let s=r.get(o);return s||(s=t.vue.ref(null),r.set(o,s)),s},deleteZoneContent(o){i.delete(o),r.delete(o)},clean(){i.clear(),r.clear()}}}var ydi=vdi;function bdi(t,e,i){const r=e.ref(0),n=e.ref(0),{separatorSize:o=2,separatorDetectionMargin:s=10,separatorDetectionZIndex:a=2,resizable:l=!0}=i??{},c=e.ref(!!l),d={vue:e,core:t,zones:e.ref([]),get resizable(){return c.value},set resizable(h){c.value=h},get width(){return r.value},get height(){return n.value},get separatorSize(){return o},get separatorDetectionMargin(){return s},get separatorDetectionZIndex(){return a},getParent(h){return this.core.getParent(h)},async coreLayoutSync(h=!1){this.layout&&(h?this.layout.value=this.core.layout:e.triggerRef(this.layout),await e.nextTick(),this.contentManager.link())},resize(h,f){this.core.resize(h,f),e.triggerRef(this.layout)},async split(h,f,A,p,g){const m=this.core.splitZone(h,f,A,p,g);return await this.coreLayoutSync(this.zones.value.length===1),m},async splitLayout(h,f,A,p){const g=this.core.splitLayout(h,f,A,p);return await this.coreLayoutSync(!0),g},async delete(h){let f=!1;const A=this.core.getZone(h);if(A){const g=this.core.getParent(A);f=g?.children.length===2&&this.core.getParent(g)===null}this.contentManager.deleteZoneContent(h);const p=this.core.deleteZone(h);return await this.coreLayoutSync(f),p},async swap(h,f){const A=this.core.swapZones(h,f);return await this.coreLayoutSync(),A},destroy(){var h;(h=this.resizeObserver)==null||h.disconnect()},root:null,get component(){return this.layout=e.shallowRef(t.layout),e.watch(this.layout,h=>{this.zones.value=[...h].filter(f=>f.type==="zone")},{immediate:!0}),{created(){d.root=this},mounted(){const{width:h,height:f}=this.$el.getBoundingClientRect();r.value=h,n.value=f,d.resizeObserver=new ResizeObserver(A=>A.forEach(p=>{const{width:g,height:m}=p.target.getBoundingClientRect();r.value=g,n.value=m})),d.resizeObserver.observe(this.$el),d.contentManager.link()},render(){return e.h("div",{class:"areas-root"},[d.contentManager.renderContent(d.layout.value),u(d.layout.value)])}}}};d.contentManager=ydi(d);function u(h){return h.type==="zone"?lD(d,h):gdi(d,h)}return d}var wdi=bdi;function Cdi(t,e=null,i=null){const r=ddi(e),n=wdi(r,t,i);return Object.freeze({core:r,renderer:n,destroy(){n.destroy()},swap(o,s){return this.renderer.swap(o,s)},split(o,s,a,l,c){return this.renderer.split(o,s,a,l,c)},splitLayout(o,s,a,l){return this.renderer.splitLayout(o,s,a,l)},delete(o){return this.renderer.delete(o)},registerContent(o,s){this.renderer.contentManager.registerContent(o,s)},getElementZoneId(o){return this.renderer.contentManager.getElementZoneId(o)},get layout(){return hde(this.core.layout)},set layout(o){this.core.layout=o,this.renderer.contentManager.clean(),this.renderer.coreLayoutSync(!0)},get component(){return this.renderer.component},get resizable(){return this.renderer.resizable},set resizable(o){this.renderer.resizable=o}})}var xdi=Cdi;function kdi(t){return Array.isArray(t?.children)?bde(t):yde(t)}function yde(t,e=100){return{type:"zone",ratio:e,options:typeof t=="string"?{windowName:t}:t}}function bde(t,e=100){return{type:"container",ratio:e,direction:t.direction,children:t.children.map((i,r)=>Array.isArray(i?.children)?bde(i,t.ratios[r]):yde(i,t.ratios[r]))}}function Mdi(t,e,i=!0){return t.type==="zone"?wde(t,e,i):Cde(t,e,i)}function wde(t,e,i=!0){var r,n;const o=e.get(t.id);if(!o)throw new Error(`[Layout parser] Local context with id ${t.id} not found`);return{windowName:((r=o.window)==null?void 0:r.name)??null,windowState:{modelIds:o.loadedModelIds,viewpoint:(i||void 0)&&o.viewer&&o.getViewpoint(),storey:(n=o.selectedStorey)==null?void 0:n.key}}}function Cde(t,e,i=!0){return{direction:t.direction,ratios:t.children.map(r=>r.ratio),children:t.children.map(r=>r.type==="zone"?wde(r,e,i):Cde(r,e,i))}}const Pdi={props:{text:{type:String,default:""}},emits:["close"]},Edi={class:"success-modal"},Bdi={class:"success-modal__close"},Idi={class:"success-modal__title"},Sdi={class:"success-modal__title--icon"},Tdi={class:"success-modal__text"},Ddi={class:"success-modal__button"};function Rdi(t,e,i,r,n,o){const s=S("BIMDataIconClose"),a=S("BIMDataPieSpinner"),l=S("BIMDataIconSuccess"),c=S("BIMDataButton");return M(),_("div",Edi,[C("div",Bdi,[D(a,{delay:5,onStop:e[1]||(e[1]=d=>t.$emit("close"))},{default:V(()=>[D(s,{class:"icon-close",size:"xxxs",onClick:e[0]||(e[0]=d=>t.$emit("close"))})]),_:1})]),C("div",Idi,[C("h2",null,K(t.$t("modal.success")),1),C("span",Sdi,[D(l,{class:"fill-primary"})])]),C("div",Tdi,K(i.text||t.$t("modal.success")),1),C("div",Ddi,[D(c,{class:"bimdata-btn__fill bimdata-btn__fill--primary bimdata-btn__radius",onClick:e[2]||(e[2]=d=>t.$emit("close"))},{default:V(()=>[ot(K(t.$t("modal.button")),1)]),_:1})])])}const Ldi=z(Pdi,[["render",Rdi],["__scopeId","data-v-79d3a107"]]),xde=Symbol("modal-mixin-id"),Fdi={inject:["$viewer"],data(){return{modals:[]}},computed:{notBlocking(){var t;return((t=this.modal)==null?void 0:t.blocking)===!1},modal(){return this.modals.length?this.modals[0]:null},positionning(){var t;if(!((t=this.modal)!=null&&t.positions))return;const e=this.modal.positions;return{top:e.top?`${e.top}`:"0",right:e.right?`${e.right}`:"0",bottom:e.bottom?`${e.bottom} `:"0",left:e.left?`${e.left}`:"0"}}},created(){document.addEventListener("keydown",e=>{this.notBlocking&&e.key==="Escape"&&this.clearModal()});const t=this;this.mixin={[xde]:!0,beforeCreate(){!this._.setupState.$viewer&&(this.$plugin=t.$plugin,this.$viewer=t.$viewer)}}},methods:{pushModal(t,e={},{display:i="full",positions:r,blocking:n=!0,exclusive:o=!1}={}){o&&(this.modals=[]),this.inject$viewerRecursively(t),this.modals.push({component:ma(t),props:e,display:i,positions:r,blocking:n})},clearModal(){this.modals.shift()},clearModals(){this.modals=[]},inject$viewerRecursively(t){aD(t,this.mixin,xde),t.components&&Object.values(t.components).forEach(e=>this.inject$viewerRecursively(e))},getModal(t){const e={success:Ldi};if(Object.keys(e).includes(t))return e[t];console.warn(`Modal name unknown : ${t}`)}}},_di={class:"bimdata-modal-manager__content"};function Odi(t,e,i,r,n,o){const s=pi("click-away");return o.modal?(M(),_("div",{key:0,class:le(["bimdata-modal-manager",{full:o.modal.display==="full",banner:o.modal.display==="banner"}]),style:se(o.positionning),onClick:e[0]||(e[0]=ft(a=>o.notBlocking?o.clearModal():null,["self"]))},[At((M(),_("div",_di,[(M(),Z(br(o.modal.component),xn(o.modal.props,{onClose:o.clearModal}),null,16,["onClose"]))])),[[s,()=>o.notBlocking?o.clearModal():null,"mousedown"]])],6)):re("",!0)}const kde=z(Fdi,[["render",Odi]]),Udi={props:{plugin:{type:Object,required:!0}},setup(t){const e=mt("$viewer"),{plugin:i}=t;ur("$plugin",i),Mde(i.component,e.localContext,i)}},dD=Symbol("plugin-mixin-id");function Mde(t,e,i,r=!0){var n;if((n=t.mixins)!=null&&n.some(s=>s[dD]))return;const o={[dD]:!0,beforeCreate(){!this._.setupState.$viewer&&(this.$plugin=i,this.$viewer=e.$viewer),Object.defineProperties(this,{$isOpen:{get(){return i.isOpen}},$loading:{get(){return i.loading}},$shown:{get(){return i.shown}}}),r&&(i.componentInstance=this,i.isViewer&&(e.viewer=this))},methods:{$open(...s){i.open(...s)},$close(...s){i.close(...s)},$show(){i.show()},$hide(){i.hide()}}};r&&(o.props={plugin:{type:Object,required:!0}},o.provide={pluginInstance:i},o.created=function(){e.hub.emit("plugin-created",{name:i.name,plugin:this}),e.$viewer.globalContext.hub.emit("plugin-created",{name:i.name,plugin:this})},o.unmounted=function(){e.hub.emit("plugin-destroyed",{name:i.name,plugin:this}),e.$viewer.globalContext.hub.emit("plugin-destroyed",{name:i.name,plugin:this})}),aD(t,o,dD),t.components&&Object.values(t.components).forEach(s=>Mde(s,e,i,!1))}function Ndi(t,e,i,r,n,o){return At((M(),Z(br(i.plugin.component),{class:"plugin-component-instance-container",plugin:i.plugin},null,8,["plugin"])),[[Ht,i.plugin.shown]])}const Yv=z(Udi,[["render",Ndi]]),jdi={components:{PluginComponentInstanceContainer:Yv},props:{plugin:{type:Object,required:!0,validator(t){return t.sidePanel.width?typeof t.sidePanel.width=="number":t.sidePanel}}}};function Vdi(t,e,i,r,n,o){const s=S("PluginComponentInstanceContainer");return At((M(),_("div",{class:"side-panel",style:se(`
|
|
5472
|
+
`,r=()=>e.useDataURI?"data:text/javascript,"+encodeURIComponent(i):URL.createObjectURL(new Blob([i],{type:"text/javascript"}));t({workerScripts:{inflate:[r],deflate:[r]}})}const Bli="Writer iterator completed too soon",Ili="Content-Type",Sli=64*1024,Oce="writable";class eD{constructor(){this.size=0}init(){this.initialized=!0}}class Uce extends eD{get readable(){const e=this,{chunkSize:i=Sli}=e,r=new ReadableStream({start(){this.chunkOffset=0},async pull(n){const{offset:o=0,size:s,diskNumberStart:a}=r,{chunkOffset:l}=this;n.enqueue(await Qo(e,o+l,Math.min(i,s-l),a)),l+i>s?n.close():this.chunkOffset+=i}});return r}}class Nce extends Uce{constructor(e){super(),Object.assign(this,{blob:e,size:e.size})}async readUint8Array(e,i){const r=this,n=e+i;let o=await(e||n<r.size?r.blob.slice(e,n):r.blob).arrayBuffer();return o.byteLength>i&&(o=o.slice(e,n)),new Uint8Array(o)}}class jce extends eD{constructor(e){super();const i=this,r=new TransformStream,n=[];e&&n.push([Ili,e]),Object.defineProperty(i,Oce,{get(){return r.writable}}),i.blob=new Response(r.readable,{headers:n}).blob()}getData(){return this.blob}}class Tli extends jce{constructor(e){super(e),Object.assign(this,{encoding:e,utf8:!e||e.toLowerCase()=="utf-8"})}async getData(){const{encoding:e,utf8:i}=this,r=await super.getData();if(r.text&&i)return r.text();{const n=new FileReader;return new Promise((o,s)=>{Object.assign(n,{onload:({target:a})=>o(a.result),onerror:()=>s(n.error)}),n.readAsText(r,e)})}}}class Dli extends Uce{constructor(e){super(),this.readers=e}async init(){const e=this,{readers:i}=e;e.lastDiskNumber=0,e.lastDiskOffset=0,await Promise.all(i.map(async(r,n)=>{await r.init(),n!=i.length-1&&(e.lastDiskOffset+=r.size),e.size+=r.size})),super.init()}async readUint8Array(e,i,r=0){const n=this,{readers:o}=this;let s,a=r;a==-1&&(a=o.length-1);let l=e;for(;l>=o[a].size;)l-=o[a].size,a++;const c=o[a],d=c.size;if(l+i<=d)s=await Qo(c,l,i);else{const u=d-l;s=new Uint8Array(i),s.set(await Qo(c,l,u)),s.set(await n.readUint8Array(e+u,i-u,r),u)}return n.lastDiskNumber=Math.max(a,n.lastDiskNumber),s}}class Vce extends eD{constructor(e,i=4294967295){super();const r=this;Object.assign(r,{diskNumber:0,diskOffset:0,size:0,maxSize:i,availableSize:i});let n,o,s;const a=new WritableStream({async write(d){const{availableSize:u}=r;if(s)d.length>=u?(await l(d.slice(0,u)),await c(),r.diskOffset+=n.size,r.diskNumber++,s=null,await this.write(d.slice(u))):await l(d);else{const{value:h,done:f}=await e.next();if(f&&!h)throw new Error(Bli);n=h,n.size=0,n.maxSize&&(r.maxSize=n.maxSize),r.availableSize=r.maxSize,await W9(n),o=h.writable,s=o.getWriter(),await this.write(d)}},async close(){await s.ready,await c()}});Object.defineProperty(r,Oce,{get(){return a}});async function l(d){const u=d.length;u&&(await s.ready,await s.write(d),n.size+=u,r.size+=u,r.availableSize-=u)}async function c(){o.size=n.size,await s.close()}}}async function W9(t,e){if(t.init&&!t.initialized)await t.init(e);else return Promise.resolve()}function Rli(t){return Array.isArray(t)&&(t=new Dli(t)),t instanceof ReadableStream&&(t={readable:t}),t}function Lli(t){t.writable===pn&&typeof t.next==Gv&&(t=new Vce(t)),t instanceof WritableStream&&(t={writable:t});const{writable:e}=t;return e.size===pn&&(e.size=0),t instanceof Vce||Object.assign(t,{diskNumber:0,diskOffset:0,availableSize:1/0,maxSize:1/0}),t}function Qo(t,e,i,r){return t.readUint8Array(e,i,r)}const zce="\0\u263A\u263B\u2665\u2666\u2663\u2660\u2022\u25D8\u25CB\u25D9\u2642\u2640\u266A\u266B\u263C\u25BA\u25C4\u2195\u203C\xB6\xA7\u25AC\u21A8\u2191\u2193\u2192\u2190\u221F\u2194\u25B2\u25BC !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u2302\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\xEC\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\xFF\xD6\xDC\xA2\xA3\xA5\u20A7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\u2310\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0 ".split(""),Fli=zce.length==256;function _li(t){if(Fli){let e="";for(let i=0;i<t.length;i++)e+=zce[t[i]];return e}else return new TextDecoder().decode(t)}function J9(t,e){return e&&e.trim().toLowerCase()=="cp437"?_li(t):new TextDecoder(e).decode(t)}const Hce="filename",qce="rawFilename",Gce="comment",Qce="rawComment",Kce="uncompressedSize",Zce="compressedSize",Wce="offset",tD="diskNumberStart",iD="lastModDate",rD="rawLastModDate",Jce="lastAccessDate",Oli="rawLastAccessDate",Xce="creationDate",Uli="rawCreationDate",Nli="internalFileAttribute",jli="internalFileAttributes",Vli="externalFileAttribute",zli="externalFileAttributes",Hli="msDosCompatible",qli="zip64",Gli="encrypted",Qli="version",Kli="versionMadeBy",Zli="zipCrypto",Wli="directory",Jli="executable",Xli=[Hce,qce,Zce,Kce,iD,rD,Gce,Qce,Jce,Xce,Wce,tD,tD,Nli,jli,Vli,zli,Hli,qli,Gli,Qli,Kli,Zli,Wli,Jli,"bitFlag","signature","filenameUTF8","commentUTF8","compressionMethod","extraField","rawExtraField","extraFieldZip64","extraFieldUnicodePath","extraFieldUnicodeComment","extraFieldAES","extraFieldNTFS","extraFieldExtendedTimestamp"];class Yce{constructor(e){Xli.forEach(i=>this[i]=e[i])}}const oD="File format is not recognized",Yli="End of central directory not found",$li="End of Zip64 central directory locator not found",eci="Central directory header not found",tci="Local file header not found",ici="Zip64 extra field not found",rci="File contains encrypted entry",oci="Encryption method not supported",$ce="Compression method not supported",ede="Split zip file",tde="utf-8",ide="cp437",nci=[[Kce,rh],[Zce,rh],[Wce,rh],[tD,Dd]],sci={[Dd]:{getValue:Hr,bytes:4},[rh]:{getValue:X9,bytes:8}};class aci{constructor(e,i={}){Object.assign(this,{reader:Rli(e),options:i,config:jai()})}async*getEntriesGenerator(e={}){const i=this;let{reader:r}=i;const{config:n}=i;if(await W9(r),(r.size===pn||!r.readUint8Array)&&(r=new Nce(await new Response(r.readable).blob()),await W9(r)),r.size<I2)throw new Error(oD);r.chunkSize=Vai(n);const o=await pci(r,Eai,r.size,I2,Dd*16);if(!o){const I=await Qo(r,0,4),T=wo(I);throw Hr(T)==Pai?new Error(ede):new Error(Yli)}const s=wo(o);let a=Hr(s,12),l=Hr(s,16);const c=o.offset,d=bo(s,20),u=c+I2+d;let h=bo(s,4);const f=r.lastDiskNumber||0;let A=bo(s,6),p=bo(s,8),g=0,m=0;if(l==rh||a==rh||p==Dd||A==Dd){const I=await Qo(r,o.offset-HT,HT),T=wo(I);if(Hr(T,0)==Bai){l=X9(T,8);let L=await Qo(r,l,qT,-1),O=wo(L);const U=o.offset-HT-qT;if(Hr(O,0)!=Kle&&l!=U){const H=l;l=U,g=l-H,L=await Qo(r,l,qT,-1),O=wo(L)}if(Hr(O,0)!=Kle)throw new Error($li);h==Dd&&(h=Hr(O,16)),A==Dd&&(A=Hr(O,20)),p==Dd&&(p=X9(O,32)),a==rh&&(a=X9(O,40)),l-=a}}if(l>=r.size&&(g=r.size-l-a-I2,l=r.size-a-I2),f!=h)throw new Error(ede);if(l<0)throw new Error(oD);let w=0,y=await Qo(r,l,a,A),v=wo(y);if(a){const I=o.offset-a;if(Hr(v,w)!=Qle&&l!=I){const T=l;l=I,g+=l-T,y=await Qo(r,l,a,A),v=wo(y)}}const x=o.offset-l-(r.lastDiskOffset||0);if(a!=x&&x>=0&&(a=x,y=await Qo(r,l,a,A),v=wo(y)),l<0||l>=r.size)throw new Error(oD);const k=An(i,e,"filenameEncoding"),P=An(i,e,"commentEncoding");for(let I=0;I<p;I++){const T=new lci(r,n,i.options);if(Hr(v,w)!=Qle)throw new Error(eci);rde(T,v,w+6);const L=!!T.bitFlag.languageEncodingFlag,O=w+46,U=O+T.filenameLength,H=U+T.extraFieldLength,N=bo(v,w+4),W=N>>8==0,J=N>>8==3,te=y.subarray(O,U),de=bo(v,w+32),Le=H+de,we=y.subarray(H,Le),Ue=L,Ce=L,Te=Hr(v,w+38),ze=W&&(D2(v,w+38)&Xle)==Xle||J&&(Te>>16&Yle)==Yle||te.length&&te[te.length-1]==ece.charCodeAt(0),ne=J&&(Te>>16&$le)==$le,Ie=Hr(v,w+42)+g;Object.assign(T,{versionMadeBy:N,msDosCompatible:W,compressedSize:0,uncompressedSize:0,commentLength:de,directory:ze,offset:Ie,diskNumberStart:bo(v,w+34),internalFileAttributes:bo(v,w+36),externalFileAttributes:Te,rawFilename:te,filenameUTF8:Ue,commentUTF8:Ce,rawExtraField:y.subarray(U,H),executable:ne}),T.internalFileAttribute=T.internalFileAttributes,T.externalFileAttribute=T.externalFileAttributes;const ye=An(i,e,"decodeText")||J9,Se=Ue?tde:k||ide,Xe=Ce?tde:P||ide;let Ye=ye(te,Se);Ye===pn&&(Ye=J9(te,Se));let ee=ye(we,Xe);ee===pn&&(ee=J9(we,Xe)),Object.assign(T,{rawComment:we,filename:Ye,comment:ee,directory:ze||Ye.endsWith(ece)}),m=Math.max(Ie,m),ode(T,T,v,w+6),T.zipCrypto=T.encrypted&&!T.extraFieldAES;const Q=new Yce(T);Q.getData=(xe,ve)=>T.getData(xe,Q,ve),w=Le;const{onprogress:ce}=e;if(ce)try{await ce(I+1,p,new Yce(T))}catch{}yield Q}const E=An(i,e,"extractPrependedData"),B=An(i,e,"extractAppendedData");return E&&(i.prependedData=m>0?await Qo(r,0,m):new Uint8Array),i.comment=d?await Qo(r,c+I2,d):new Uint8Array,B&&(i.appendedData=u<r.size?await Qo(r,u,r.size-u):new Uint8Array),!0}async getEntries(e={}){const i=[];for await(const r of this.getEntriesGenerator(e))i.push(r);return i}async close(){}}class lci{constructor(e,i,r){Object.assign(this,{reader:e,config:i,options:r})}async getData(e,i,r={}){const n=this,{reader:o,offset:s,diskNumberStart:a,extraFieldAES:l,compressionMethod:c,config:d,bitFlag:u,signature:h,rawLastModDate:f,uncompressedSize:A,compressedSize:p}=n,g=i.localDirectory={},m=await Qo(o,s,30,a),w=wo(m);let y=An(n,r,"password"),v=An(n,r,"rawPassword");const x=An(n,r,"passThrough");if(y=y&&y.length&&y,v=v&&v.length&&v,l&&l.originalCompressionMethod!=kai)throw new Error($ce);if(c!=xai&&c!=Cai&&!x)throw new Error($ce);if(Hr(w,0)!=Mai)throw new Error(tci);rde(g,w,4),g.rawExtraField=g.extraFieldLength?await Qo(o,s+30+g.filenameLength,g.extraFieldLength,a):new Uint8Array,ode(n,g,w,4,!0),Object.assign(i,{lastAccessDate:g.lastAccessDate,creationDate:g.creationDate});const k=n.encrypted&&g.encrypted&&!x,P=k&&!l;if(x||(i.zipCrypto=P),k){if(!P&&l.strength===pn)throw new Error(oci);if(!y&&!v)throw new Error(rci)}const E=s+30+g.filenameLength+g.extraFieldLength,B=p,I=o.readable;Object.assign(I,{diskNumberStart:a,offset:E,size:B});const T=An(n,r,"signal"),L=An(n,r,"checkPasswordOnly");L&&(e=new WritableStream),e=Lli(e),await W9(e,x?p:A);const{writable:O}=e,{onstart:U,onprogress:H,onend:N}=r,W={options:{codecType:Sce,password:y,rawPassword:v,zipCrypto:P,encryptionStrength:l&&l.strength,signed:An(n,r,"checkSignature")&&!x,passwordVerification:P&&(u.dataDescriptor?f>>>8&255:h>>>24&255),signature:h,compressed:c!=0&&!x,encrypted:n.encrypted&&!x,useWebWorkers:An(n,r,"useWebWorkers"),useCompressionStream:An(n,r,"useCompressionStream"),transferStreams:An(n,r,"transferStreams"),checkPasswordOnly:L},config:d,streamOptions:{signal:T,size:B,onstart:U,onprogress:H,onend:N}};let J=0;try{({outputSize:J}=await Mli({readable:I,writable:O},W))}catch(te){if(!L||te.message!=KT)throw te}finally{const te=An(n,r,"preventClose");O.size+=J,!te&&!O.locked&&await O.getWriter().close()}return L?pn:e.getData?e.getData():O}}function rde(t,e,i){const r=t.rawBitFlag=bo(e,i+2),n=(r&Zle)==Zle,o=Hr(e,i+6);Object.assign(t,{encrypted:n,version:bo(e,i),bitFlag:{level:(r&Oai)>>1,dataDescriptor:(r&Wle)==Wle,languageEncodingFlag:(r&Jle)==Jle},rawLastModDate:o,lastModDate:fci(o),filenameLength:bo(e,i+22),extraFieldLength:bo(e,i+24)})}function ode(t,e,i,r,n){const{rawExtraField:o}=e,s=e.extraField=new Map,a=wo(new Uint8Array(o));let l=0;try{for(;l<o.length;){const m=bo(a,l),w=bo(a,l+2);s.set(m,{type:m,data:o.slice(l+4,l+4+w)}),l+=4+w}}catch{}const c=bo(i,r+4);Object.assign(e,{signature:Hr(i,r+10),uncompressedSize:Hr(i,r+18),compressedSize:Hr(i,r+14)});const d=s.get(Iai);d&&(cci(d,e),e.extraFieldZip64=d);const u=s.get(Lai);u&&(nde(u,Hce,qce,e,t),e.extraFieldUnicodePath=u);const h=s.get(Fai);h&&(nde(h,Gce,Qce,e,t),e.extraFieldUnicodeComment=h);const f=s.get(Sai);f?(dci(f,e,c),e.extraFieldAES=f):e.compressionMethod=c;const A=s.get(Tai);A&&(uci(A,e),e.extraFieldNTFS=A);const p=s.get(Rai);p&&(hci(p,e,n),e.extraFieldExtendedTimestamp=p);const g=s.get(_ai);g&&(e.extraFieldUSDZ=g)}function cci(t,e){e.zip64=!0;const i=wo(t.data),r=nci.filter(([n,o])=>e[n]==o);for(let n=0,o=0;n<r.length;n++){const[s,a]=r[n];if(e[s]==a){const l=sci[a];e[s]=t[s]=l.getValue(i,o),o+=l.bytes}else if(t[s])throw new Error(ici)}}function nde(t,e,i,r,n){const o=wo(t.data),s=new G9;s.append(n[i]);const a=wo(new Uint8Array(4));a.setUint32(0,s.get(),!0);const l=Hr(o,1);Object.assign(t,{version:D2(o,0),[e]:J9(t.data.subarray(5)),valid:!n.bitFlag.languageEncodingFlag&&l==Hr(a,0)}),t.valid&&(r[e]=t[e],r[e+"UTF8"]=!0)}function dci(t,e,i){const r=wo(t.data),n=D2(r,4);Object.assign(t,{vendorVersion:D2(r,0),vendorId:D2(r,2),strength:n,originalCompressionMethod:i,compressionMethod:bo(r,5)}),e.compressionMethod=t.compressionMethod}function uci(t,e){const i=wo(t.data);let r=4,n;try{for(;r<t.data.length&&!n;){const o=bo(i,r),s=bo(i,r+2);o==Dai&&(n=t.data.slice(r+4,r+4+s)),r+=4+s}}catch{}try{if(n&&n.length==24){const o=wo(n),s=o.getBigUint64(0,!0),a=o.getBigUint64(8,!0),l=o.getBigUint64(16,!0);Object.assign(t,{rawLastModDate:s,rawLastAccessDate:a,rawCreationDate:l});const c=nD(s),d=nD(a),u=nD(l),h={lastModDate:c,lastAccessDate:d,creationDate:u};Object.assign(t,h),Object.assign(e,h)}}catch{}}function hci(t,e,i){const r=wo(t.data),n=D2(r,0),o=[],s=[];i?((n&1)==1&&(o.push(iD),s.push(rD)),(n&2)==2&&(o.push(Jce),s.push(Oli)),(n&4)==4&&(o.push(Xce),s.push(Uli))):t.data.length>=5&&(o.push(iD),s.push(rD));let a=1;o.forEach((l,c)=>{if(t.data.length>=a+4){const d=Hr(r,a);e[l]=t[l]=new Date(d*1e3);const u=s[c];t[u]=d}a+=4})}async function pci(t,e,i,r,n){const o=new Uint8Array(4),s=wo(o);Aci(s,0,e);const a=r+n;return await l(r)||await l(Math.min(a,i));async function l(c){const d=i-c,u=await Qo(t,d,c);for(let h=u.length-r;h>=0;h--)if(u[h]==o[0]&&u[h+1]==o[1]&&u[h+2]==o[2]&&u[h+3]==o[3])return{offset:d+h,buffer:u.slice(h,h+r).buffer}}}function An(t,e,i){return e[i]===pn?t.options[i]:e[i]}function fci(t){const e=(t&4294901760)>>16,i=t&65535;try{return new Date(1980+((e&65024)>>9),((e&480)>>5)-1,e&31,(i&63488)>>11,(i&2016)>>5,(i&31)*2,0)}catch{}}function nD(t){return new Date(Number(t/BigInt(1e4)-BigInt(116444736e5)))}function D2(t,e){return t.getUint8(e)}function bo(t,e){return t.getUint16(e,!0)}function Hr(t,e){return t.getUint32(e,!0)}function X9(t,e){return Number(t.getBigUint64(e,!0))}function Aci(t,e,i){t.setUint32(e,i,!0)}function wo(t){return new DataView(t.buffer)}let sde;try{sde=import.meta.url}catch{}GT({baseURL:sde}),Eli(GT),GT({Deflate:eai,Inflate:wai});function mci(t){return{getDetailedExtensions(e){return[]},getExtensions(e){return[]},getFullTopics(e,i,r,n,o,s,a){return[]},getTopics(e,i,r,n){return[]}}}function gci(t){return{checkProjectAccess(e,i){return{has_read_permission:!0,has_write_permission:!1,has_admin_permission:!1,token_scopes:["bcf:read","document:read","model:read"],usable_scopes:["bcf:read","document:read","model:read"],user_role:50,user:null}},getProjectDMSTree(e,i){return{}},getDocumentHistories(e,i,r){return[]},getProjectUsers(e,i){return[]}}}function vci(t){const e=t,i=e.units.reduce((d,u)=>(u.conversion_baseunit=e.units[u.conversion_baseunit_index],delete u.conversion_baseunit_index,d[u.id]=u,d),{}),r=e.definitions.reduce((d,u)=>(u.unit=e.units[u.unit_id],delete u.unit_id,d[u.id]=u,d),{}),n=e.property_sets.reduce((d,u)=>(u.properties.forEach(h=>{h.definition=e.definitions[h.def_id],delete h.def_id}),d[u.id]=u,d),{}),o=e.classifications.reduce((d,u)=>(u.name=u.type,u.title=u.description,d[u.id]=u,d),{}),s=e.layers.reduce((d,u)=>(u.elements=[],d[u.id]=u,d),{}),a=e.systems.reduce((d,u)=>(u.elements=[],d[u.uuid]=u,d),{}),l={};l.materials_data=e.materials.materials_data.reduce((d,u)=>(u.property_sets=u.psets.map(h=>e.property_sets[h]),delete u.psets,delete u.step_id,d[u.id]=u,d),{}),l.list_components=e.materials.list_components.reduce((d,u)=>(u.material=e.materials.materials_data[u.material],u.option=e.materials.options[u.material_option],d[u.id]=u,delete u.id,d),{}),l.options=e.materials.options.reduce((d,u)=>(u.list_components=u.material_list.map(h=>e.materials.list_components[h]),d[u.id]=u,d),{});const c={};return e.elements.forEach(d=>{d.attributes=e.property_sets[d.attributes],d.property_sets=d.psets.map(u=>e.property_sets[u]),delete d.psets,d.classifications=d.classifications.map(u=>e.classifications[u]),d.systems=d.systems.map(u=>{const h=e.systems[u];return h.elements.push(d.uuid),h}),d.layers=d.layers.map(u=>{const h=e.layers[u];return h.elements.push(d.uuid),h}),d.material_list=d.material_list.map(u=>e.materials.list_components[u]),c[d.uuid]=d}),{units:i,definitions:r,property_sets:n,classifications:o,layers:s,systems:a,materials:l,elements:c}}function yci(t){const e={};return Object.values(t).forEach(i=>{e[i.uuid]={},e[i.uuid].attributes={},i.attributes.properties.forEach(r=>{e[i.uuid].attributes[r.definition.name]=r.value}),i.property_sets.forEach(r=>{e[i.uuid][r.name]={},r.properties.forEach(n=>{e[i.uuid][r.name][n.definition.name]=n.value})})}),e}function bci(t){return Object.values(t).forEach(e=>{e.formattedRawElements=vci(e.rawElements)}),{getModels(e,i,r,n,o){let s=Object.values(t).map(a=>a.model);return s=s.filter(a=>!(a.type==="PDF"&&a.parent_id)),r?.length>0&&(s=s.filter(a=>r.includes(a.source))),n?.length>0&&(s=s.filter(a=>n.includes(a.status))),o?.length>0&&(s=s.filter(a=>o.includes(a.type))),s},getModel(e,i,r){return t[i].model},getTileset(e,i,r,n){console.warn("[BIMData Viewer] Offline Warning: `getTileset` is not available in offline mode.")},getBuildings(e,i,r){return t[i].buildings},getBuildingPlanPositioning(e,i,r,n,o){const s=this.getBuilding(i,n,o,e).plans.find(a=>a.plan.id===r);return{translation_x:s.translation_x,translation_y:s.translation_y,rotate_z:s.rotate_z,scale:s.scale,opacity:s.opacity}},getBuilding(e,i,r,n){return t[i].buildings.find(o=>o.uuid===n)},getModelClassifications(e,i,r){return Object.values(t[i].formattedRawElements.classifications)},listClassificationElementRelations(e,i,r){return Object.values(t[i].formattedRawElements.elements).flatMap(n=>n.classifications.map(o=>({element_uuid:n.uuid,classification_id:o.id})))},getElementsFromClassification(e,i,r,n){return t[r].formattedRawElements.classifications[i].elements},getDrawings(e,i,r){return t[i].drawings},getDrawing(e,i,r,n){return this.getDrawings(e,r,n).find(o=>o.id===i)},getElements(e,i,r,n,o,s){return Object.values(t[i].formattedRawElements.elements).filter(a=>s?a.type===s:n?a.classifications.some(l=>l.name===n):o?a.classifications.some(l=>l.notation===o):!0)},getElementLinkedDocuments(e,i,r){return console.warn("[BIMData Viewer] Offline Warning: `getElementLinkedDocuments` is not available in offline mode."),[]},async getRawElements(e,i,r,n,o,s){return t[i].rawElements},getSimpleElements(e,i,r,n,o,s){const a=this.getElements(e,i,r,n,o,s);return yci(a)},getClassificationsOfElement(e,i,r,n){return this.getElement(e,r,n,i).classifications},getDocumentsOfElement(e,i,r,n){return console.warn("[BIMData Viewer] Offline Warning: `getDocumentsOfElement` is not available in offline mode."),[]},getMaterials(e,i,r,n){return this.getElement(e,r,n,i).material_list.map(o=>o.material)},getMaterial(e,i,r,n,o){return this.getMaterials(e,i,n,o).find(s=>s.id===r)},getElementPropertySets(e,i,r,n){return this.getElement(e,r,n,i).property_sets},getElementPropertySet(e,i,r,n,o){return this.getElementPropertySets(e,i,n,o).find(s=>s.id===r)},getElementPropertySetProperties(e,i,r,n,o){return this.getElementPropertySet(e,i,o,r,n).properties},getElementPropertySetProperty(e,i,r,n,o,s){return this.getElementPropertySetProperties(e,i,n,o,s).find(a=>a.id===r)},getElementPropertySetPropertyDefinitions(e,i,r,n,o,s){return[this.getElementPropertySetProperty(e,i,o,r,n,s).definition]},getElementPropertySetPropertyDefinition(e,i,r,n,o,s,a){const l=this.getElementPropertySetProperty(e,i,s,n,o,a).definition;return l.id===r?l:void 0},getElementPropertySetPropertyDefinitionUnits(e,i,r,n,o,s,a){return[this.getElementPropertySetPropertyDefinition(e,i,s,r,n,o,a).unit]},getElementPropertySetPropertyDefinitionUnit(e,i,r,n,o,s,a,l){const c=this.getElementPropertySetPropertyDefinition(e,i,a,n,o,s,l).unit;return c.id===r?c:void 0},getElement(e,i,r,n){return t[i].formattedRawElements.elements[n]},getSimpleElement(e,i,r,n){return this.getSimpleElements(e,i,r)[n]},getLayers(e,i,r){return Object.values(t[i].formattedRawElements.layers)},getLayer(e,i,r,n){return this.getLayers(e,r,n).find(o=>o.id===i)},getModelMaterials(e,i,r){return Object.values(t[i].formattedRawElements.materials.materials_data)},getModelMaterial(e,i,r,n){return this.getModelMaterials(e,r,n).find(o=>o.id===i)},getProcessorHandlers(e,i,r){return console.warn("[BIMData Viewer] Offline Warning: `getProcessorHandlers` is not available in offline mode."),[]},getProcessorHandler(e,i,r,n){console.warn("[BIMData Viewer] Offline Warning: `getProcessorHandler` is not available in offline mode.")},getModelProperties(e,i,r){return t[i].properties},getModelProperty(e,i,r,n){return t[r].properties.find(o=>o.id===i)},getModelPropertyDefinitions(e,i,r){return Object.values(t[i].formattedRawElements.definitions)},getModelPropertyDefinition(e,i,r,n){return this.getModelPropertyDefinitions(e,r,n).find(o=>o.id===i)},getPropertySets(e,i,r){return Object.values(t[i].formattedRawElements.property_sets)},getPropertySet(e,i,r,n){return this.getPropertySets(e,r,n).find(o=>o.id===i)},getSpaces(e,i,r){return t[i].spaces},getSpace(e,i,r,n){return t[r].spaces.find(o=>o.id===i)},getStoreys(e,i,r){return t[i].storeys},getStoreyPlanPositioning(e,i,r,n,o){const s=this.getStorey(e,r,n,o).plans.find(a=>a.plan.id===i);return{translation_x:s.translation_x,translation_y:s.translation_y,rotate_z:s.rotate_z,scale:s.scale,opacity:s.opacity}},getStorey(e,i,r,n){return t[i].storeys.find(o=>o.uuid===n)},getSystems(e,i,r){return Object.values(t[i].formattedRawElements.systems)},getSystem(e,i,r,n){return this.getSystems(e,i,r).find(o=>o.uuid===n)},getModelUnits(e,i,r){return Object.values(t[i].formattedRawElements.units)},getModelUnit(e,i,r,n){return this.getModelUnits(e,r,n).find(o=>o.id===i)},getZones(e,i,r,n){return t[i].zones.filter(o=>n?o.color===n:!0)},getZone(e,i,r,n){return t[r].zones.find(o=>o.id===i)},getZoneSpaces(e,i,r,n){return this.getZone(e,n,i,r).spaces},getZoneSpace(e,i,r,n,o){return this.getZoneSpaces(e,r,n,o).find(s=>s.id===i)}}}async function wci(t){const e=t.find(r=>r.filename==="data.json"),i=await e?.getData(new Tli);return i?JSON.parse(i):null}async function Xv(t,e,i){const r=t.find(o=>o.filename===`${e.id}/${i}`),n=await r?.getData(new jce);return n?URL.createObjectURL(n):null}async function Cci(t,e){await Promise.all([Xv(t,e,"document_file").then(i=>e.document&&(e.document.file=i)),Xv(t,e,"structure_file").then(i=>e.structure_file=i),Xv(t,e,"map_file").then(i=>e.map_file=i),Xv(t,e,"binary_2d_file").then(i=>e.binary_2d_file=i),...e.xkt_files.map((i,r)=>Xv(t,e,`xkt_file_v${i.version}`).then(n=>e.xkt_files[r]={version:i.version,file:n}))])}async function xci(t){const e=await new aci(new Nce(t)).getEntries(),i=await wci(e);return await Promise.all(Object.values(i).flatMap(({model:r,buildings:n=[],storeys:o=[]})=>[r].concat(r.children).concat(n.flatMap(s=>s.plans).map(s=>s.plan)).concat(o.flatMap(s=>s.plans).map(s=>s.plan))).map(r=>Cci(e,r))),i}function sD(t,e,i){return new Proxy(t[i],{get:function(r,n){if(e[n])return e[n];throw new Error(`[BIMData Viewer] Offline Error: method \`${i}.${n}\` is not mocked.`)}})}async function kci(t,e,i){var r,n,o;typeof t=="string"&&(t=await fetch(t).then(d=>d.blob()));const s=await xci(t),a=mci(),l=gci(),c=bci(s);return Object.assign(a,(r=i.methods)==null?void 0:r.bcfApi),Object.assign(l,(n=i.methods)==null?void 0:n.collaborationApi),Object.assign(c,(o=i.methods)==null?void 0:o.modelApi),Object.assign({},e,{bcfApi:sD(e,a,"bcfApi"),collaborationApi:sD(e,l,"collaborationApi"),modelApi:sD(e,c,"modelApi")})}class Mci{constructor(e={}){const{apiUrl:i,archiveUrl:r,pdfBackendUrl:n,cloudId:o,projectId:s,accessToken:a,offline:l}=e;this.apiUrl=i,this.archiveUrl=r,this.pdfBackendUrl=n,this.cloudId=o,this.projectId=s,this._accessToken=a,this.offline=l??{enabled:!1};const c=TE.makeBIMDataApiClient({apiUrl:i,accessToken:a});this.apiClient=c,this.ready=Promise.resolve(),this.getModelsPromise=null,Object.assign(c,{BcfApi:function(){return console.warn("[BIMData Viewer] DEPRECATED - API - please use `apiClient.bcfApi` instead of `new apiClient.BcfApi()`."),c.bcfApi},CollaborationApi:function(){return console.warn("[BIMData Viewer] DEPRECATED - API - please use `apiClient.collaborationApi` instead of `new apiClient.CollaborationApi()`."),c.collaborationApi},ModelApi:function(){return console.warn("[BIMData Viewer] DEPRECATED - API - please use `apiClient.modelApi` instead of `new apiClient.ModelApi()`."),c.modelApi},IfcApi:function(){return console.warn("[BIMData Viewer] DEPRECATED - API - please use `apiClient.modelApi` instead of `new apiClient.IfcApi()`."),new Proxy(c.modelApi,{get:function(d,u,h){const f=u.replace("Deprecated","").replace("Ifc","Model");return Reflect.get(d,f,h)}})}})}get accessToken(){return this._accessToken}set accessToken(e){this._accessToken=e,this.apiClient.accessToken=e}async getAvailableModels(e=null,i=!1){return i&&(this.getModelsPromise=null),this.getModelsPromise||(this.getModelsPromise=this.apiClient.modelApi.getModels(this.cloudId,this.projectId)),(await this.getModelsPromise).filter(r=>e?.includes(r.type)??!0)}getModel(e){const{cloudId:i,projectId:r,apiClient:n}=this;return n.modelApi.getModel(i,e,r)}getIfc(e){return console.warn("[BIMData Viewer] DEPRECATED - API - please use the `getModel` method instead of `getIfc`."),this.getModel(e)}async getModelStructure(e){const i=(await(await fetch(e.structure_file)).json())[0];return Gc(i),i}getIfcStructure(e){return console.warn("[BIMData Viewer] DEPRECATED - API - please use the getModelStructure method instead of getIfcStructure."),this.getModelStructure(e)}async getRawElements(e){const{cloudId:i,projectId:r,apiClient:n}=this,o=await n.modelApi.getRawElements(i,e,r);o.units.forEach(a=>{a.conversion_baseunit=o.units[a.conversion_baseunit_index],delete a.conversion_baseunit_index}),o.definitions.forEach(a=>{a.unit=o.units[a.unit_id],delete a.unit_id}),o.property_sets.forEach(a=>{a.properties.forEach(l=>{l.definition=o.definitions[l.def_id],delete l.def_id})});const s={};return o.elements.forEach(a=>{a.attributes=o.property_sets[a.attributes],a.property_sets=a.psets.map(l=>o.property_sets[l]),Object.assign(a,{get propertySets(){return console.warn("propertySets is deprecated, please use property_sets instead."),a.property_sets}}),delete a.psets,a.classifications=a.classifications.map(l=>o.classifications[l]),a.systems=a.systems.map(l=>o.systems[l]),a.layers=a.layers.map(l=>o.layers[l]),s[a.uuid]=a}),s}getStoreys(e){const{cloudId:i,projectId:r,apiClient:n}=this;return n.modelApi.getStoreys(i,e,r)}createModel(e){const{cloudId:i,projectId:r,apiClient:n}=this;return n.modelApi.createModel(i,r,{document_id:e})}async waitForModelProcess(e){const i=["C","E","X"];return i.includes(e.status)?e:new Promise((r,n)=>{const o=setInterval(async()=>{try{let s=await this.getModel(e.id);i.includes(s.status)&&(clearInterval(o),r(s))}catch(s){clearInterval(o),n(s)}},1e3)})}async createStoreyPlan(e,i,r){const{cloudId:n,projectId:o,apiClient:s}=this,a=await this.createModel(r);return await s.modelApi.createStoreyPlan(n,e,o,i,{id:a.id}),a}deleteStoreyPlan(e,i,r){const{cloudId:n,projectId:o,apiClient:s}=this;return s.modelApi.deleteStoreyPlan(n,r,e,o,i)}updatePlanPositioning(e,i,r,n){const{cloudId:o,projectId:s,apiClient:a}=this;return a.modelApi.updateStoreyPlanPositioning(o,r,e,s,i,n)}async enableOfflineMode(e,i={}){let r;this.ready=new Promise(n=>r=n),this.apiClient=await kci(e,this.apiClient,i),this.offline.enabled=!0,r()}disableOfflineMode(){this.offline.enabled&&(this.apiClient=TE.makeBIMDataApiClient({apiUrl:this.apiUrl,accessToken:this.accessToken}),this.offline.enabled=!1)}}function Pci(t){const e=[{methodName:"selectObjects",property:"selected",value:!0,eventName:"objects-selected",exlusiveIndex:1},{methodName:"deselectObjects",property:"selected",value:!1,eventName:"objects-deselected"},{methodName:"highlightObjects",property:"highlighted",value:!0,eventName:"objects-highlighted"},{methodName:"unhighlightObjects",property:"highlighted",value:!1,eventName:"objects-unhighlighted"},{methodName:"showObjects",property:"visible",value:!0,eventName:"objects-shown"},{methodName:"hideObjects",property:"visible",value:!1,eventName:"objects-hidden"},{methodName:"xrayObjects",property:"xrayed",value:!0,eventName:"objects-xrayed"},{methodName:"unxrayObjects",property:"xrayed",value:!1,eventName:"objects-unxrayed"},{methodName:"setObjectsPickable",property:"pickable",value:!0,eventName:"objects-pickable"},{methodName:"setObjectsUnpickable",property:"pickable",value:!1,eventName:"objects-unpickable"}],i=e.reduce((n,o)=>(n[o.methodName]=function(s,a){r(this,o,a);const{property:l,value:c}=o,d=[];for(const u of s){const h=t.get(u);try{h[l]=c,d.push(h)}catch{console.warn(`object with id ${u} does not exist`)}}this.hub.emit(o.eventName,{objects:d,options:{...a}})},n[`${o.methodName}ByUuids`]=function(s,a){r(this,o,a);const{property:l,value:c}=o,d=s.map(u=>this.uuidsMap.get(u)).filter(u=>u?.length>0).flatMap(u=>u.map(h=>(h[l]=c,h)));this.hub.emit(o.eventName,{objects:d,options:{...a}})},n),{}),r=(n,o,s)=>{if(o.exlusiveIndex!==void 0&&s!=null&&s.exclusive){const a=e[o.exlusiveIndex],{property:l,value:c}=o;n[a.methodName](n.objects.filter(d=>d[l]===c).map(d=>d.id),{options:{...s}})}};return{...i,colorizeObjects(n,o,s){const a=[];for(const l of n)try{const c=t.get(l);c.color=o,a.push(c)}catch{console.warn(`object with id ${l} does not exist`)}this.hub.emit("objects-colorized",{objects:a,color:o,options:{...s}})},colorizeObjectsByUuids(n,o,s){const a=n.flatMap(l=>this.uuidsMap.get(l));this.colorizeObjects(a.map(l=>l.id),o,s)},get objects(){return Array.from(t.values())},get objectsIds(){return this.objects.map(n=>n.id)},get objectsUuids(){return Array.from(new Set(this.objects.map(n=>n.uuid)))},get objectsMap(){return t}}}const Eci=Object.freeze({EXA:10**18,PETA:10**15,TERA:10**12,GIGA:10**9,MEGA:10**6,KILO:10**3,HECTO:10**2,DECA:10,DECI:10**-1,CENTI:10**-2,MILLI:10**-3,MICRO:10**-6,NANO:10**-9,PICO:10**-12,FEMTO:10**-15,ATTO:10**-18});async function Bci(t,e,i){async function r(d,u){try{const h=(await t.apiClient.modelApi.getElement(t.cloudId,i,t.projectId,d)).attributes.properties.find(f=>f.definition.name===u);if(h){const f=h.definition.unit;if(f){const{name:A,prefix:p}=f;A!=="METRE"&&console.warn(`[Viewer] Elevation unit other that "METRE" are not supported. Unit "${A}" fallback to "METRE".`);const g=Eci[p];return g===void 0&&console.warn(`[Viewer] Elevation unit prefix "${p}" is unknown and will be ignored.`),(h.value??0)*(g??1)}else return h.value??0}}catch(h){console.warn(`[Models] Cannot get elevation of object with uuid ${d}: ${h}`)}return 0}const n=new Map,o=new Map,s=new Map;function a(){const d=new Set(e.map(u=>{var h,f;return(f=(h=u.object)==null?void 0:h.site)==null?void 0:f.uuid}).filter(Boolean));return P4(d,10,(u,h)=>{r(u,"RefElevation").then(f=>{n.set(u,f),h()},h)})}function l(){const d=new Set(e.map(u=>{var h,f;return(f=(h=u.object)==null?void 0:h.building)==null?void 0:f.uuid}).filter(Boolean));return P4(d,10,(u,h)=>{r(u,"ElevationOfRefHeight").then(f=>{o.set(u,f),h()},h)})}function c(){return P4(e,10,(d,u)=>{r(d.uuid,"Elevation").then(h=>{s.set(d.uuid,h),u()},u)})}await Promise.all([a(),l(),c()]),e.forEach((d,u)=>{var h,f,A,p;const g=s.get(d.uuid)??u;d.elevation=g;const m=o.get((f=(h=d.object)==null?void 0:h.building)==null?void 0:f.uuid);if(m==null){const w=n.get((p=(A=d.object)==null?void 0:A.site)==null?void 0:p.uuid)??0;d.absoluteElevation=g+w}else d.absoluteElevation=g+m}),e.forEach((d,u)=>{var h,f;d.topElevation=((h=e[u+1])==null?void 0:h.elevation)??1/0,d.absoluteTopElevation=((f=e[u+1])==null?void 0:f.absoluteElevation)??1/0})}async function Ici(t,e,i){e.every(r=>r.bimdata_elevation!==null&&r.bimdata_elevation!==void 0)?(e.forEach(r=>{r.elevation=r.bimdata_elevation,r.absoluteElevation=r.bimdata_elevation}),e.forEach((r,n)=>{var o,s;r.topElevation=((o=e[n+1])==null?void 0:o.elevation)??1/0,r.absoluteTopElevation=((s=e[n+1])==null?void 0:s.absoluteElevation)??1/0})):await Bci(t,e,i)}class fD{constructor(e){const{archived:i,binary_2d_file:r,children:n,created_at:o,creator:s,document:a,document_id:l,errors:c,gltf_file:d,id:u,layout_name:h,map_file:f,name:A,north_vector:p,page_number:g,parent_id:m,preview_file:w,project_id:y,recommanded_2d_angle:v,size_ratio:x,source:k,status:P,structure_file:E,systems_file:B,type:I,updated_at:T,version:L,viewer_360_file:O,warnings:U,world_position:H,xkt_file:N,xkt_files:W}=e;this.id=u,this.name=A,this.type=I,this.archived=i,this.binary_2d_file=r,this.children=n?.map(J=>new fD(J))??[],this.created_at=o,this.creator=s,this.document=a,this.document_id=l,this.errors=c,this.gltf_file=d,this.map_file=f,this.north_vector=p,this.page_number=g,this.parent_id=m,this.preview_file=w,this.project_id=y,this.recommanded_2d_angle=v,this.size_ratio=x,this.source=k,this.status=P,this.structure_file=E,this.systems_file=B,this.updated_at=T,this.version=L,this.viewer_360_file=O,this.warnings=U,this.world_position=H,this.xkt_file=N,this.xkt_files=W,this.layout_name=h}}class ade{constructor(e,i,r,n){this.model=i,this.storey=r,this.index=n,this.key=`${r.key}-${e.plan.id}-${n}`,this.translation_x=e.translation_x??0,this.translation_y=e.translation_y??0,this.rotate_z=e.rotate_z??0,this.scale=e.scale??1,this.opacity=e.opacity??1,this.plan=e.plan}}class Sci{constructor(e,i){this.model=i;const{name:r,uuid:n,plans:o,plans_unreachable_count:s,bimdata_elevation:a}=e;this.name=r,this.uuid=n,this.bimdata_elevation=a,this.key=`${i.id}-${this.uuid}`,this.plans_unreachable_count=s,this.plans=o.map((l,c)=>new ade(l,i,this,c)),this.object=i.uuids.get(this.uuid),this.objects=null,this.elevation=null,this.absoluteElevation=null,this.topElevation=null,this.absoluteTopElevation=null}get uuids(){return new Map([...this.objects.values()].map(e=>[e.uuid,e]))}}class AD extends Bx{constructor(e,i){super(e,i,"zone");const{id:r,uuid:n,name:o,created_at:s,updated_at:a,parent_id:l,order:c,zones:d=[],spaces:u=[],color:h,storey_uuid:f}=e;this.id=r,this.uuid=n,this.name=o,this.created_at=s,this.updated_at=a,this.parent_id=l,this.order=c,this.zones=d.map(A=>new AD(A,i)),this.spaces=u,this.color=h,this.storey_uuid=f}getContainedSpaces(){const e=Array.from(this.spaces);for(const i of this.zones)e.push(...i.getContainedSpaces());return e}get area(){return this.getContainedSpaces().filter(e=>e.geometry).reduce((e,i)=>e+Tci(i.geometry),0)}get perimeter(){return this.getContainedSpaces().filter(e=>e.geometry).reduce((e,i)=>e+Dci(i.geometry),0)}}function Tci(t){let e=0;const i=t.length;for(let r=0;r<i;r++){const n=(r+1)%i;e+=t[r].x*t[n].y,e-=t[n].x*t[r].y}return Math.abs(e)/2}function Dci(t){let e=0;const i=t.length;for(let r=0;r<i;r++){const n=(r+1)%i;e+=Math.sqrt(Math.pow(t[n].x-t[r].x,2)+Math.pow(t[n].y-t[r].y,2))}return e}class Rci extends fD{constructor(e,i,{structure:r,zones:n,systems:o,storeys:s}={}){var a,l;if(super(i),this._stateObjectMap=e,this.uuids=new Map,r){const u=qj(r,this,e),h=Jlt(u);this.structure=u,this.objects=h,h.forEach(f=>{f.uuid&&this.uuids.set(f.uuid,f)})}else this.structure=null,this.objects=[];this.zones=[],this.setZones(n??[]),o?.forEach(u=>{const h=new Bx(u,this,"system");this.uuids.set(h.uuid,h),e.set(h.id,h),this.objects.unshift(h)}),this.storeys=s?.map(u=>new Sci(u,this)).sort(Hc("order",!1))??[];const c=new Map(this.storeys.map(u=>[u.uuid,new Set])),d=this.type==="DWG"?"layout":"storey";for(const u of this.objects)u.type!==d&&c.has((a=u[d])==null?void 0:a.uuid)&&c.get((l=u[d])==null?void 0:l.uuid).add(u);for(const u of this.storeys){const h=c.get(u.uuid);u.objects=h?[...h.values()]:[]}this.objects.forEach(u=>{var h,f;u.parent=this.uuids.get((h=u.parent)==null?void 0:h.uuid),u.children=(f=u.children)==null?void 0:f.map(A=>this.uuids.get(A.uuid)).filter(Boolean)})}setZones(e=[]){this.zones.forEach(i=>{this._stateObjectMap.delete(i.id),this.uuids.delete(i.uuid),this.objects.splice(this.objects.indexOf(i),1)}),this.zones=e.map(i=>{const r=new AD(i,this);return this._stateObjectMap.set(r.id,r),this.uuids.set(r.uuid,r),this.objects.unshift(r),r})}}const Lci=(t,e,i)=>{const{api:r}=i;async function n(o){if(typeof o=="string"&&(console.warn(`[State] 'loadModel' called with id ${o} as string and parsed as integer.`),o=parseInt(o)),t.get(o))return console.warn(`[State] 'loadModel' called with id ${o}}, model already loaded.`),t.get(o);const s=[r.apiClient.modelApi.getZones(r.cloudId,o,r.projectId),r.apiClient.modelApi.getSystems(r.cloudId,o,r.projectId),r.getStoreys(o)],a=await r.getModel(o);a.parent_id&&!t.get(a.parent_id)&&await n(a.parent_id),a.structure_file&&s.push(r.getModelStructure(a));const[l,c,d,u]=await Promise.all(s),h=new Rci(e,a,{structure:u,zones:l,systems:c,storeys:d});return await Ici(r,h.storeys,h.id),t.set(o,h),h}return{get models(){return Array.from(t.values())},get ifcs(){return console.warn("[BIMData Viewer] DEPRECATED - State model - please use the models instead of ifcs."),Array.from(t.values()).filter(o=>!o.type||o.type==="IFC")},get modelsMap(){return t},get ifcsMap(){return console.warn("[BIMData Viewer] DEPRECATED - State model - please use the modelsMap instead of ifcsMap."),new Map([...t].filter(([,o])=>!o.type||o.type==="IFC"))},async loadModels(o){const s=await Promise.allSettled(o.map(n));s.filter(l=>l.status==="rejected").forEach(l=>console.error(l.reason));const a=s.filter(l=>l.status==="fulfilled").map(l=>l.value);if(a.length>0){const l=a.filter(c=>!c.type||c.type==="IFC");l.length&&this.hub.emit("ifcs-loaded",{ifcs:l}),this.hub.emit("models-loaded",{models:a}),i.globalContext.hub.emit("models-loaded",{models:a}),this.hub.emit("objects-added",{objects:a.flatMap(c=>c.objects)})}return a},loadIfcs(o){return console.warn("[BIMData Viewer] DEPRECATED - State model - please use the loadModels method instead of loadIfcs."),this.loadModels(o)},unloadModels(o){const s=[],a=[];if(o.forEach(l=>{const c=t.get(l);c?(t.delete(l),c.objects.map(d=>(a.push(d),d.id)).forEach(d=>e.delete(d)),s.push(c)):console.warn(`[State] Cannot unload model with id ${l} because it is not loaded.`)}),a.length>0&&this.hub.emit("objects-removed",{objects:a}),s.length>0){const l=s.filter(c=>!c.type||c.type==="IFC");l.length&&this.hub.emit("ifcs-unloaded",{ifcs:l}),this.hub.emit("models-unloaded",{models:s})}return s},unloadIfcs(o){return console.warn("[BIMData Viewer] DEPRECATED - State model - please use the unloadModels method instead of unloadIfcs."),this.unloadModels(o)},getStoreyFromAbsoluteElevation(o,s){var a;if(!o.storeys)return null;for(let l=0;l<o.storeys.length;l++)if(s>=o.storeys[l].absoluteElevation&&s<(((a=o.storeys[l+1])==null?void 0:a.absoluteElevation)??1/0))return o.storeys[l];return o.storeys[0]}}};function Fci(t){return{async createPlan(e,i,r,n){const o=await t.api.createStoreyPlan(e.id,i.uuid,r.id);await t.api.updatePlanPositioning(e.id,i.uuid,o.id,n);const s=new ade({...n,plan:o},e,i,e.storeys.length);return i.plans.push(s),this.hub.emit("plan-created",{plan:s}),s},async updatePlan(e){const i=await t.api.updatePlanPositioning(e.model.id,e.storey.uuid,e.plan.id,e);return Object.assign(e,i),this.hub.emit("plan-updated",{plan:e}),e},async deletePlan(e){await t.api.deleteStoreyPlan(e.model.id,e.storey.uuid,e.plan.id),e.storey.plans=e.storey.plans.filter(i=>i.key!==e.key),this.hub.emit("plan-deleted",{plan:e})}}}const _ci=(t,e)=>{const i={getObjectsByUuids(r){return r.flatMap(n=>this.uuidsMap.get(n))},getObject(r){return console.warn("[BIMData Viewer] DEPRECATED - State - `getObject` is deprecated, use `objectsMap.get` instead."),e.get(r)},getIfc(r){return console.warn("[BIMData Viewer] DEPRECATED - State - `getIfc` is deprecated, use `modelsMap.get` instead."),t.get(r)},get colorizedObjects(){return Array.from(e.values()).filter(r=>!!r.color)},get colorizedObjectsIds(){return this.colorizedObjects.map(r=>r.id)},get colorizedObjectsUuids(){return Array.from(new Set(this.colorizedObjects.map(r=>r.uuid)))},getObjectsOfType(r){return Array.from(e.values()).filter(n=>n.type===r)},getTypesOf(r){typeof r.map>"u"&&(r=[...r]);const n=new Set;return r.forEach(o=>{const s=e.get(o);s&&s.type&&n.add(s.type)}),Array.from(n).sort()},getObjectsWithTheSameTypeAs(r){const n=this.getTypesOf(r);return[...e.values()].filter(o=>n.includes(o.type))}};return Oci.forEach(r=>{Object.defineProperty(i,r.name,{get(){return Array.from(e.values()).filter(n=>n[r.property]===r.value).map(n=>Object.freeze(Object.defineProperties({},Object.getOwnPropertyDescriptors(n))))}}),Object.defineProperty(i,`${r.name}Ids`,{get(){return this[r.name].map(Uci)}}),Object.defineProperty(i,`${r.name}Uuids`,{get(){return Array.from(new Set(this[r.name].map(Nci)))}})}),i},Oci=[{name:"selectedObjects",property:"selected",value:!0},{name:"deselectedObjects",property:"selected",value:!1},{name:"highlightedObjects",property:"highlighted",value:!0},{name:"unhighlightedObjects",property:"highlighted",value:!1},{name:"visibleObjects",property:"visible",value:!0},{name:"unvisibleObjects",property:"visible",value:!1},{name:"xrayedObjects",property:"xrayed",value:!0},{name:"unxrayedObjects",property:"xrayed",value:!1},{name:"pickableObjects",property:"pickable",value:!0},{name:"unpickableObjects",property:"pickable",value:!1}];function Uci(t){return t.id}function Nci(t){return t.uuid}function aD(t,e,i){var r;return(r=t.mixins)!=null&&r.some(n=>n[i])||(t.mixins?t.mixins[t.mixins.length]=e:t.mixins=[e]),t}const lde=Symbol("annotation-mixin-id");function jci(){let t=0;const e=new Map;return{get annotations(){return Array.from(e.values())},addAnnotation({x:i=0,y:r=0,z:n=0,draggable:o=!0,grabberSelector:s,component:a={render(){}},props:l={}}={},c){const d=this,u=t++,h={get id(){return u},get x(){return i},set x(f){i=f,d.hub.emit("annotation-updated",{annotation:h})},get y(){return r},set y(f){r=f,d.hub.emit("annotation-updated",{annotation:h})},get z(){return n},set z(f){n=f,d.hub.emit("annotation-updated",{annotation:h})},draggable:o,grabberSelector:s,component:a,props:l};return aD(h.component,{[lde]:!0,inject:["$viewer"]},lde),e.set(u,h),this.hub.emit("annotation-added",{annotation:h,options:c}),h},removeAnnotation(i,r){return e.has(i.id)?(e.delete(i.id),this.hub.emit("annotation-removed",{annotation:i,options:r}),!0):!1},clearAnnotations(){e.forEach(i=>this.removeAnnotation(i))}}}function Vci(t){const e=new Map,i=new Map,r={uuidsMap:{get(n){const o=[];return e.forEach(s=>{const a=s.uuids.get(n);a&&o.push(a)}),o}},hub:new Rc};return[Lci(e,i,t),Pci(i),Fci(t),jci(),_ci(e,i)].forEach(n=>Object.defineProperties(r,Object.getOwnPropertyDescriptors(n))),r}function zci(t){if(t?.type==="container")Qci(t);else if(t?.type==="zone")Gci(t);else throw new TypeError("AREAS CORE - Layout first child must be a zone or a container.");return Hci(t),t}function Hci(t){const e=new Set,i=new Set;for(let r of t)if(r.id!=null)if(r.type==="zone"){if(e.has(r.id))throw new Error("AREAS CORE - Cannot add the same zone id twice.");e.add(r.id)}else{if(i.has(r.id))throw new Error("AREAS CORE - Cannot add the same container id twice.");i.add(r.id)}}function qci(t){cde(t.layout,"zone",t.zoneIdManager),cde(t.layout,"container",t.containerIdManager)}function cde(t,e,i){const r=[...t].filter(n=>n.type===e);r.map(n=>n.id).filter(n=>n!=null).forEach(n=>i.add(n)),r.filter(n=>n.id===void 0||n.id===null).forEach(n=>{n.id=i.nextId()})}function Gci(t){if(typeof t!="object")throw new TypeError("AREAS CORE - Invalid zone. Zone must be an object.");if(t?.type!=="zone")throw new TypeError('AREAS CORE - Invalid zone. A zone must be of type "zone".');return t}function Qci(t){var e,i;if(typeof t!="object")throw new TypeError("AREAS CORE - Invalid container. A container must be an object.");if(t?.type!=="container")throw new TypeError('AREAS CORE - Invalid container. Container must be of type "container".');if(t!=null&&t.direction&&!["row","column"].includes(t.direction))throw new TypeError('AREAS CORE - Invalid container. Container direction must be of type "row" or "column".');if(((e=t?.children)==null?void 0:e.length)<2)throw new TypeError("AREAS CORE - Invalid container. Container children must have at least 2 children.");if(((i=t?.children)==null?void 0:i.reduce((r,n)=>r+n?.ratio,0))!==100)throw new TypeError("AREAS CORE - Invalid container. The sum of container children ratios must be equal to 100.");return t}function dde(t){var e;return(e=t.children)!=null&&e.length&&t.children.forEach(i=>{Object.defineProperty(i,Symbol.iterator,{value:dde(i),configurable:!0})}),function*(){var i;if(yield t,(i=t.children)!=null&&i.length)for(let r of t.children)yield*r}}function R2(t){return Object.defineProperty(t,Symbol.iterator,{value:dde(t),configurable:!0}),t}function ude(){let t=1;const e=new Set;return{nextId(){for(;!this.isIdAvailable(t);)t++;return e.add(t),t},isIdAvailable(i){return!e.has(i)},add(i){return this.isIdAvailable(i)?(e.add(i),i):!1}}}function hde(t){var e;if(!t)return;const i=Object.assign({},t);return((e=t.children)==null?void 0:e.length)>0&&(i.children=t.children.map(hde)),i}function Kci(t){return e=>{const i=t.getZone(e);if(!i)return!1;const r=t.getParent(i);if(!r)throw new Error("AREAS CORE - Cannot delete root Zone");const n=r.children.indexOf(i);if(r.children.length>2){const o=r.children[n-1],s=r.children[n+1];n===0?s.ratio+=i.ratio:n===r.children.length-1?o.ratio+=i.ratio:(o.ratio+=Math.floor(i.ratio/2),s.ratio+=Math.ceil(i.ratio/2)),r.children=r.children.filter(a=>a.type!=="zone"||a.id!==e)}else{const o=r.children[n===1?0:1];o.ratio=r.ratio;const s=t.getParent(r);if(s){const a=s.children.indexOf(r);s.children.splice(a,1,o)}else t.layout=o}return!0}}var Zci=Kci;function Wci(t){return()=>pde(t.layout,[t.layout])}function pde(t,e=[]){var i;return(i=t.children)==null||i.forEach(r=>{e.push(r),r.type==="container"&&pde(r,e)}),e}var Jci=Wci;function Xci(t){return e=>{if(!e)throw new TypeError("AREAS CORE - fail to get parent: container child is null or undefined");return t.layout.type==="zone"?null:fde(t.layout,e)}}function fde(t,e){for(let i of t.children){if(i===e)return t;if(i.type==="container"){const r=fde(i,e);if(r)return r}}return null}var Yci=Xci;function $ci(t){return e=>t.layout.type==="zone"?t.layout.id===e?t.layout:null:Ade(t.layout,e)}function Ade(t,e){for(let i of t.children)if(i.type==="zone"){if(i.id===e)return i}else{const r=Ade(i,e);if(r)return r}return null}var edi=$ci;function tdi(t){return(e,i)=>{if(typeof i!="number")throw new TypeError("AREAS CORE - resize value must be a number.");const r=t.getParent(e),n=r.children.findIndex(s=>s===e);if(n===-1)return!1;const o=r.children[n+1];if(o){const s=e.ratio+o.ratio;let a=e.ratio+i;return a=a<0?0:a,a=a>s?s:a,e.ratio=a,o.ratio=s-a,!0}else return!1}}var idi=tdi;function rdi(t){return(e,i=50,r="row",n=!0,o=null)=>{const s=t.getZone(e);if(!s)throw new Error(`AREAS CORE - fail to split zone ${e}: zone does not exist.`);if(typeof i!="number"||i<0||i>100)throw new TypeError(`AREAS CORE - fail to split zone: invalid ratio ${i}, ratio should be a number between 0 and 100.`);if(r!=="row"&&r!=="column")throw new TypeError(`AREAS CORE - fail to split zone: invalid direction ${r}, direction should be 'row' or 'column'.`);const a=t.getParent(s),l=R2({id:t.zoneIdManager.nextId(),type:"zone",...o});if(a){const c=a.children.findIndex(d=>d===s);if(a.direction===r)n?(l.ratio=Math.floor(s.ratio*(100-i)/100),s.ratio=Math.ceil(s.ratio*i/100),a.children.splice(c,1,s,l)):(l.ratio=Math.floor(s.ratio*i/100),s.ratio=Math.ceil(s.ratio*(100-i)/100),a.children.splice(c,1,l,s));else{const d=R2({id:t.containerIdManager.nextId(),type:"container",direction:r,ratio:s.ratio});n?(l.ratio=Math.floor(100-i),s.ratio=Math.ceil(i),d.children=[s,l]):(l.ratio=Math.floor(i),s.ratio=Math.ceil(100-i),d.children=[l,s]),a.children.splice(c,1,d)}}else{const c=R2({id:t.containerIdManager.nextId(),type:"container",direction:r});n?(l.ratio=Math.floor(100-i),s.ratio=Math.ceil(i),c.children=[s,l]):(l.ratio=Math.floor(i),s.ratio=Math.ceil(100-i),c.children=[l,s]),t._layout=c}return l}}var odi=rdi;function ndi(t){return(e=50,i="row",r=!0,n=null)=>{const o=t.layout;if(typeof e!="number"||e<0||e>100)throw new TypeError(`AREAS CORE - fail to split layout: invalid ratio ${e}, ratio should be a number between 0 and 100.`);if(i!=="row"&&i!=="column")throw new TypeError(`AREAS CORE - fail to split layout: invalid direction ${i}, direction should be 'row' or 'column'.`);const s=R2({id:t.zoneIdManager.nextId(),type:"zone",...n}),a=R2({id:t.containerIdManager.nextId(),type:"container",direction:i});return r?(s.ratio=Math.floor(100-e),o.ratio=Math.ceil(e),a.children=[o,s]):(s.ratio=Math.floor(e),o.ratio=Math.ceil(100-e),a.children=[s,o]),t._layout=a,s}}var sdi=ndi;function adi(t){return(e,i)=>{const r=t.getZone(e),n=t.getZone(i);if(!r)throw new Error(`AREAS CORE - fail to swap zone ${e}: zone does not exist.`);if(!n)throw new Error(`AREAS CORE - fail to swap to zone ${i}: zone does not exist.`);const o=t.getParent(r),s=t.getParent(n),a=o.children.indexOf(r),l=s.children.indexOf(n),c=r.ratio,d=n.ratio;r.ratio=d,n.ratio=c,o.children[a]=n,s.children[l]=r}}var ldi=adi;function cdi(t){const e={_layout:null,get layout(){return this._layout},set layout(i){i||(i={type:"zone"}),R2(i),zci(i),this._layout=i,qci(e)},zoneIdManager:ude(),containerIdManager:ude()};return e.layout=t,e.deleteZone=Zci(e),e.getNodes=Jci(e),e.getParent=Yci(e),e.getZone=edi(e),e.resize=idi(e),e.splitZone=odi(e),e.splitLayout=sdi(e),e.swapZones=ldi(e),e}var ddi=cdi;function mde(t=1,e=0,i=100){return Math.min(Math.max(e,t),i)}function gde(t,e){const i=t.getParent(e);if(i){const{width:r,height:n}=gde(t,i),o=i.children.length-1;return i.direction==="column"?{width:r,height:Math.max(0,(n-o*t.separatorSize)*(e.ratio/100))}:{width:Math.max(0,(r-o*t.separatorSize)*(e.ratio/100)),height:n}}else return{width:t.width,height:t.height}}function vde(t,e,i){const{width:r,height:n}=gde(t,e),o=e.children.length-1;if(e.direction==="column"){const s=1-o*t.separatorSize/n;return{height:`${mde(i.ratio*s,0,100)}%`,width:"100%"}}else{const s=1-o*t.separatorSize/r;return{height:"100%",width:`${mde(i.ratio*s,0,100)}%`}}}function udi(t,e){const i={ref:t.contentManager.getRef(e.id),id:`zone-${e.id}`,class:"areas-zone",style:{flexGrow:0,overflow:"hidden"},key:e.id},r=t.getParent(e);if(r){const{width:n,height:o}=vde(t,r,e);i.style={width:n,height:o}}else i.style={height:"100%"};return t.vue.h("div",i)}var lD=udi;function hdi(t,e,i){const{separatorSize:r,separatorDetectionMargin:n,separatorDetectionZIndex:o}=t,s=e.direction==="column",a={ref:`separator-${e.id}-${i+1}`,class:"areas-separator",style:{[s?"height":"width"]:`${r}px`,backgroundColor:"var(--areas-separator-color, black)",flexShrink:0,position:"relative"}},l=s?"ns-resize":"ew-resize",c=t.vue.h("div",{style:{position:"absolute",[s?"height":"width"]:`${n*2}px`,[s?"width":"height"]:"100%",[s?"top":"left"]:`${-n+r/2}px`,zIndex:o,cursor:l},onMousedown:d=>pdi(t,e,i,d,l)});return t.vue.h("div",a,t.resizable?[c]:null)}function pdi(t,e,i,r,n){r.preventDefault(),r.stopPropagation(),document.body.style.cursor=n;const o=a=>fdi(t,e,i,a),s=()=>Adi(o,s);document.addEventListener("mousemove",o),document.addEventListener("mouseup",s)}function fdi(t,e,i,r){const n=e.children[i],o=e.direction==="column"?"height":"width",s=t.root.$refs[`separator-${e.id}-${i+1}`].getBoundingClientRect(),{separatorSize:a}=t,l=(e.direction==="column"?r.clientY-s.y:r.clientX-s.x)-a/2,c=t.root.$refs[`container-${e.id}`].getBoundingClientRect()[o],d=l/c*100;t.resize(n,d)}function Adi(t,e){document.removeEventListener("mousemove",t),document.removeEventListener("mouseup",e),document.body.style.cursor=""}var mdi=hdi;function cD(t,e){const i={ref:`container-${e.id}`,id:`container-${e.id}`,class:"areas-container",style:{height:"100%",display:"flex",flexDirection:e.direction}},r=t.getParent(e);if(r){const{width:s,height:a}=vde(t,r,e);i.style.width=s,i.style.height=a}const n=e.children.length-1,o=e.children.map((s,a)=>a<=n-1?[s.type==="zone"?lD(t,s):cD(t,s),mdi(t,e,a)]:s.type==="zone"?lD(t,s):cD(t,s));return t.vue.h("div",i,[o])}var gdi=cD;function vdi(t){const e=new Map,i=new Map,r=new Map;e.set("default",{component:{render(){return t.vue.h("div","Default component")}}});function n(o){return o&&!e.has(o)&&(console.warn(`[AREAS] Content with name ${o} is not registered, fallback to 'default'.`),o="default"),e.get(o)}return{registerContent(o,s){e.set(o,{name:o,component:s})},renderContent(o){return[...o].filter(s=>s.type==="zone").forEach(s=>{i.set(s.id,Object.assign({},n(s.content??"default"),{ref:t.vue.ref(null),options:{zoneId:s.id,...s.options,key:s.id},name:s.content??"default"}))}),t.vue.h("div",{style:{display:"none"}},[...i.values()].map(s=>t.vue.h(s.component,{...s.options,ref:s.ref})))},link(){[...r.entries()].forEach(([o,s])=>{const a=i.get(o);if(!a)return;const l=a.ref.value.$el,c=s.value;for(;c.lastChild;)c.removeChild(c.lastChild);c.appendChild(l)})},getElementZoneId(o){var s;for(const[a,l]of[...r.entries()])if((s=l.value)!=null&&s.contains(o))return a;return null},getRef(o){let s=r.get(o);return s||(s=t.vue.ref(null),r.set(o,s)),s},deleteZoneContent(o){i.delete(o),r.delete(o)},clean(){i.clear(),r.clear()}}}var ydi=vdi;function bdi(t,e,i){const r=e.ref(0),n=e.ref(0),{separatorSize:o=2,separatorDetectionMargin:s=10,separatorDetectionZIndex:a=2,resizable:l=!0}=i??{},c=e.ref(!!l),d={vue:e,core:t,zones:e.ref([]),get resizable(){return c.value},set resizable(h){c.value=h},get width(){return r.value},get height(){return n.value},get separatorSize(){return o},get separatorDetectionMargin(){return s},get separatorDetectionZIndex(){return a},getParent(h){return this.core.getParent(h)},async coreLayoutSync(h=!1){this.layout&&(h?this.layout.value=this.core.layout:e.triggerRef(this.layout),await e.nextTick(),this.contentManager.link())},resize(h,f){this.core.resize(h,f),e.triggerRef(this.layout)},async split(h,f,A,p,g){const m=this.core.splitZone(h,f,A,p,g);return await this.coreLayoutSync(this.zones.value.length===1),m},async splitLayout(h,f,A,p){const g=this.core.splitLayout(h,f,A,p);return await this.coreLayoutSync(!0),g},async delete(h){let f=!1;const A=this.core.getZone(h);if(A){const g=this.core.getParent(A);f=g?.children.length===2&&this.core.getParent(g)===null}this.contentManager.deleteZoneContent(h);const p=this.core.deleteZone(h);return await this.coreLayoutSync(f),p},async swap(h,f){const A=this.core.swapZones(h,f);return await this.coreLayoutSync(),A},destroy(){var h;(h=this.resizeObserver)==null||h.disconnect()},root:null,get component(){return this.layout=e.shallowRef(t.layout),e.watch(this.layout,h=>{this.zones.value=[...h].filter(f=>f.type==="zone")},{immediate:!0}),{created(){d.root=this},mounted(){const{width:h,height:f}=this.$el.getBoundingClientRect();r.value=h,n.value=f,d.resizeObserver=new ResizeObserver(A=>A.forEach(p=>{const{width:g,height:m}=p.target.getBoundingClientRect();r.value=g,n.value=m})),d.resizeObserver.observe(this.$el),d.contentManager.link()},render(){return e.h("div",{class:"areas-root"},[d.contentManager.renderContent(d.layout.value),u(d.layout.value)])}}}};d.contentManager=ydi(d);function u(h){return h.type==="zone"?lD(d,h):gdi(d,h)}return d}var wdi=bdi;function Cdi(t,e=null,i=null){const r=ddi(e),n=wdi(r,t,i);return Object.freeze({core:r,renderer:n,destroy(){n.destroy()},swap(o,s){return this.renderer.swap(o,s)},split(o,s,a,l,c){return this.renderer.split(o,s,a,l,c)},splitLayout(o,s,a,l){return this.renderer.splitLayout(o,s,a,l)},delete(o){return this.renderer.delete(o)},registerContent(o,s){this.renderer.contentManager.registerContent(o,s)},getElementZoneId(o){return this.renderer.contentManager.getElementZoneId(o)},get layout(){return hde(this.core.layout)},set layout(o){this.core.layout=o,this.renderer.contentManager.clean(),this.renderer.coreLayoutSync(!0)},get component(){return this.renderer.component},get resizable(){return this.renderer.resizable},set resizable(o){this.renderer.resizable=o}})}var xdi=Cdi;function kdi(t){return Array.isArray(t?.children)?bde(t):yde(t)}function yde(t,e=100){return{type:"zone",ratio:e,options:typeof t=="string"?{windowName:t}:t}}function bde(t,e=100){return{type:"container",ratio:e,direction:t.direction,children:t.children.map((i,r)=>Array.isArray(i?.children)?bde(i,t.ratios[r]):yde(i,t.ratios[r]))}}function Mdi(t,e,i=!0){return t.type==="zone"?wde(t,e,i):Cde(t,e,i)}function wde(t,e,i=!0){var r,n;const o=e.get(t.id);if(!o)throw new Error(`[Layout parser] Local context with id ${t.id} not found`);return{windowName:((r=o.window)==null?void 0:r.name)??null,windowState:{modelIds:o.loadedModelIds,viewpoint:(i||void 0)&&o.viewer&&o.getViewpoint(),storey:(n=o.selectedStorey)==null?void 0:n.key}}}function Cde(t,e,i=!0){return{direction:t.direction,ratios:t.children.map(r=>r.ratio),children:t.children.map(r=>r.type==="zone"?wde(r,e,i):Cde(r,e,i))}}const Pdi={props:{text:{type:String,default:""}},emits:["close"]},Edi={class:"success-modal"},Bdi={class:"success-modal__close"},Idi={class:"success-modal__title"},Sdi={class:"success-modal__title--icon"},Tdi={class:"success-modal__text"},Ddi={class:"success-modal__button"};function Rdi(t,e,i,r,n,o){const s=S("BIMDataIconClose"),a=S("BIMDataPieSpinner"),l=S("BIMDataIconSuccess"),c=S("BIMDataButton");return M(),_("div",Edi,[C("div",Bdi,[D(a,{delay:5,onStop:e[1]||(e[1]=d=>t.$emit("close"))},{default:V(()=>[D(s,{class:"icon-close",size:"xxxs",onClick:e[0]||(e[0]=d=>t.$emit("close"))})]),_:1})]),C("div",Idi,[C("h2",null,K(t.$t("modal.success")),1),C("span",Sdi,[D(l,{class:"fill-primary"})])]),C("div",Tdi,K(i.text||t.$t("modal.success")),1),C("div",Ddi,[D(c,{class:"bimdata-btn__fill bimdata-btn__fill--primary bimdata-btn__radius",onClick:e[2]||(e[2]=d=>t.$emit("close"))},{default:V(()=>[ot(K(t.$t("modal.button")),1)]),_:1})])])}const Ldi=z(Pdi,[["render",Rdi],["__scopeId","data-v-79d3a107"]]),xde=Symbol("modal-mixin-id"),Fdi={inject:["$viewer"],data(){return{modals:[]}},computed:{notBlocking(){var t;return((t=this.modal)==null?void 0:t.blocking)===!1},modal(){return this.modals.length?this.modals[0]:null},positionning(){var t;if(!((t=this.modal)!=null&&t.positions))return;const e=this.modal.positions;return{top:e.top?`${e.top}`:"0",right:e.right?`${e.right}`:"0",bottom:e.bottom?`${e.bottom} `:"0",left:e.left?`${e.left}`:"0"}}},created(){document.addEventListener("keydown",e=>{this.notBlocking&&e.key==="Escape"&&this.clearModal()});const t=this;this.mixin={[xde]:!0,beforeCreate(){!this._.setupState.$viewer&&(this.$plugin=t.$plugin,this.$viewer=t.$viewer)}}},methods:{pushModal(t,e={},{display:i="full",positions:r,blocking:n=!0,exclusive:o=!1}={}){o&&(this.modals=[]),this.inject$viewerRecursively(t),this.modals.push({component:ma(t),props:e,display:i,positions:r,blocking:n})},clearModal(){this.modals.shift()},clearModals(){this.modals=[]},inject$viewerRecursively(t){aD(t,this.mixin,xde),t.components&&Object.values(t.components).forEach(e=>this.inject$viewerRecursively(e))},getModal(t){const e={success:Ldi};if(Object.keys(e).includes(t))return e[t];console.warn(`Modal name unknown : ${t}`)}}},_di={class:"bimdata-modal-manager__content"};function Odi(t,e,i,r,n,o){const s=pi("click-away");return o.modal?(M(),_("div",{key:0,class:le(["bimdata-modal-manager",{full:o.modal.display==="full",banner:o.modal.display==="banner"}]),style:se(o.positionning),onClick:e[0]||(e[0]=ft(a=>o.notBlocking?o.clearModal():null,["self"]))},[At((M(),_("div",_di,[(M(),Z(br(o.modal.component),xn(o.modal.props,{onClose:o.clearModal}),null,16,["onClose"]))])),[[s,()=>o.notBlocking?o.clearModal():null,"mousedown"]])],6)):re("",!0)}const kde=z(Fdi,[["render",Odi]]),Udi={props:{plugin:{type:Object,required:!0}},setup(t){const e=mt("$viewer"),{plugin:i}=t;ur("$plugin",i),Mde(i.component,e.localContext,i)}},dD=Symbol("plugin-mixin-id");function Mde(t,e,i,r=!0){var n;if((n=t.mixins)!=null&&n.some(s=>s[dD]))return;const o={[dD]:!0,beforeCreate(){!this._.setupState.$viewer&&(this.$plugin=i,this.$viewer=e.$viewer),Object.defineProperties(this,{$isOpen:{get(){return i.isOpen}},$loading:{get(){return i.loading}},$shown:{get(){return i.shown}}}),r&&(i.componentInstance=this,i.isViewer&&(e.viewer=this))},methods:{$open(...s){i.open(...s)},$close(...s){i.close(...s)},$show(){i.show()},$hide(){i.hide()}}};r&&(o.props={plugin:{type:Object,required:!0}},o.provide={pluginInstance:i},o.created=function(){e.hub.emit("plugin-created",{name:i.name,plugin:this}),e.$viewer.globalContext.hub.emit("plugin-created",{name:i.name,plugin:this})},o.unmounted=function(){e.hub.emit("plugin-destroyed",{name:i.name,plugin:this}),e.$viewer.globalContext.hub.emit("plugin-destroyed",{name:i.name,plugin:this})}),aD(t,o,dD),t.components&&Object.values(t.components).forEach(s=>Mde(s,e,i,!1))}function Ndi(t,e,i,r,n,o){return At((M(),Z(br(i.plugin.component),{class:"plugin-component-instance-container",plugin:i.plugin},null,8,["plugin"])),[[Ht,i.plugin.shown]])}const Yv=z(Udi,[["render",Ndi]]),jdi={components:{PluginComponentInstanceContainer:Yv},props:{plugin:{type:Object,required:!0,validator(t){return t.sidePanel.width?typeof t.sidePanel.width=="number":t.sidePanel}}}};function Vdi(t,e,i,r,n,o){const s=S("PluginComponentInstanceContainer");return At((M(),_("div",{class:"side-panel",style:se(`
|
|
5473
5473
|
--side-panel-width: ${i.plugin.sidePanelWidth}px;
|
|
5474
5474
|
${i.plugin.sidePanel.position==="left"?"border-right":"border-left"}: 1px solid var(--color-silver);
|
|
5475
5475
|
`)},[D(s,{plugin:i.plugin,style:{height:"100%"}},null,8,["plugin"])],4)),[[Ht,i.plugin.shown]])}const zdi=z(jdi,[["render",Vdi],["__scopeId","data-v-ced3f116"]]),Hdi={props:{name:{type:String,default:"box"},content:{type:String,default:""},width:{type:[Number,String],default:20},height:{type:[Number,String],default:20},color:{type:String,default:"currentColor"},x:{type:[Number,String],default:20},y:{type:[Number,String],default:20}},computed:{viewBox(){return`0 0 ${this.x} ${this.y}`}}},qdi=["width","height","viewBox","aria-labelledby","fill"],Gdi=["innerHTML"];function Qdi(t,e,i,r,n,o){return M(),_("svg",{xmlns:"http://www.w3.org/2000/svg",width:i.width,height:i.height,viewBox:o.viewBox,"aria-labelledby":i.name,fill:i.color,role:"presentation"},[C("g",{innerHTML:i.content},null,8,Gdi)],8,qdi)}const Kdi=z(Hdi,[["render",Qdi]]),Zdi=["src"],Wdi={__name:"PluginIcon",props:{plugin:{type:Object,required:!0},isOpen:{type:Boolean,required:!0}},setup(t){const e=t,i=fr(null);return ml(()=>{e.isOpen&&e.plugin.button.iconOpen?i.value=e.plugin.button.iconOpen:e.plugin.button.icon?i.value=e.plugin.button.icon:i.value={component:"BIMDataIcon",options:{name:"default",size:"m"}}}),(r,n)=>i.value.imgUri?(M(),_("img",{key:0,src:i.value.imgUri,style:{"max-width":"40px","max-height":"40px"}},null,8,Zdi)):i.value.svgPath?(M(),Z(Kdi,xn({key:1},i.value.options,{content:i.value.svgPath}),null,16,["content"])):i.value.component?(M(),Z(br(i.value.component),_s(xn({key:2},i.value.options)),null,16)):re("",!0)}},Jdi={key:0,class:"tools-menu__info"},Xdi={class:"window"},Ydi={class:"plugins-as-button__content"},$di={class:"plugins-as-button__panel__header"},eui={class:"panel__content"},tui={__name:"PluginAsButton",props:{plugin:{type:Object,required:!0},active:{type:Boolean,required:!0},position:{type:String,required:!0,validator(t){return["right","left"].includes(t)}}},emits:["focus"],setup(t,{emit:e}){const i=e,r=mt("$viewer"),{localContext:n}=r,o=t,{active:s}=Ky(o),a=o.plugin,l=et(()=>a.isOpen),c=et(()=>a.buttonText),d=et(()=>o.active?2:1);function u(){l.value&&i("focus")}function h(){l.value?a.close():a.open()}function f(){Br(()=>{l.value&&!a.button.keepOpen&&!a.loading&&a.close()})}return(A,p)=>{const g=S("BIMDataSpinner"),m=S("BIMDataButton"),w=S("BIMDataTooltip"),y=pi("click-away");return At((M(),_("div",{class:"plugins-as-button",style:se({zIndex:d.value,position:wt(a).button.content==="simple"?"relative":null})},[C("div",{class:"tools-menu m-b-12",onMouseenter:u},[D(w,{ref:"tooltip",class:le({open:l.value}),text:wt(a).button.tooltip?A.$t(wt(a).button.tooltip):wt(a).name,position:t.position==="left"?"right":"left",disabled:l.value},{default:V(()=>[D(m,{width:"45px",height:"45px",fill:"",icon:"",color:"default",class:le({focus:wt(s)}),"data-test":`plugin-${wt(a).name}`,onClick:p[0]||(p[0]=v=>h())},{default:V(()=>[c.value?(M(),_("span",Jdi,K(wt(vrt)(c.value,wt(a).button.truncateSize||4)),1)):re("",!0),wt(a).loading?(M(),Z(g,{key:1})):(M(),Z(Wdi,{key:2,plugin:wt(a),"is-open":l.value},null,8,["plugin","is-open"]))]),_:1},8,["class","data-test"])]),_:1},8,["class","text","position","disabled"])],32),C("div",Xdi,[D(mi,{name:`slide-fade-${t.position}`},{default:V(()=>[At(C("span",Ydi,[wt(a).button.content==="panel"?(M(),_("div",{key:0,class:le(["plugins-as-button__submenu",`plugins-as-button__submenu--${t.position==="right"?"left":"right"}__panel`])},[C("div",$di,K(wt(a).button.tooltip?A.$t(wt(a).button.tooltip):wt(a).name),1),C("div",eui,[D(Yv,{plugin:wt(a)},null,8,["plugin"])])],2)):(M(),Z(Yv,{key:1,class:le(["plugins-as-button__submenu",`plugins-as-button__submenu--${t.position==="right"?"left":"right"}__${wt(a).button.content||"free"}`]),plugin:wt(a)},null,8,["class","plugin"]))],512),[[Ht,l.value]])]),_:1},8,["name"])])],4)),[[y,f]])}}},iui={__name:"SideColumn",props:{plugins:{type:Array,default:()=>[]},position:{type:String,required:!0,validator(t){return["right","left"].includes(t)}}},setup(t){const e=t,i=fr(null);return(r,n)=>(M(),_("div",{class:le(["side-column",`side-column--${e.position}`])},[(M(!0),_(ct,null,Bt(e.plugins,o=>(M(),_(ct,{key:o.name},[o.button.content==="none"?(M(),Z(Yv,{key:0,plugin:o,onMouseenter:s=>i.value=o},null,8,["plugin","onMouseenter"])):At((M(),Z(tui,{key:1,plugin:o,position:e.position,active:i.value===o,onFocus:s=>i.value=o},null,8,["plugin","position","active","onFocus"])),[[Ht,o.shown]])],64))),128))],2))}},rui=z(iui,[["__scopeId","data-v-f11ec0c8"]]),oui={},nui={width:"23",height:"22",viewBox:"0 0 23 22",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function sui(t,e){return M(),_("svg",nui,e[0]||(e[0]=[C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M-1.39472e-07 10.1037L3.19075 13.2944L6.3815 10.1037L4.25434 10.1037L4.25434 5.31755C4.25434 5.17754 4.30509 4.94384 4.42614 4.77572C4.47895 4.70237 4.54133 4.64599 4.62063 4.60508C4.69908 4.56461 4.83161 4.51987 5.05202 4.51987L11.1676 4.51987L11.1676 2.3927L5.05202 2.3927C3.96087 2.3927 3.17625 2.87117 2.69987 3.5328C2.26254 4.14021 2.12717 4.83714 2.12717 5.31755L2.12717 10.1037L-1.39472e-07 10.1037Z",fill:"currentColor"},null,-1),C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M23 11.9657L19.8092 8.7749L16.6185 11.9657L18.7457 11.9657L18.7457 16.7518C18.7457 16.8918 18.6949 17.1255 18.5739 17.2936C18.521 17.367 18.4587 17.4233 18.3794 17.4643C18.3009 17.5047 18.1684 17.5495 17.948 17.5495L11.8324 17.5495L11.8324 19.6766L17.948 19.6766C19.0391 19.6766 19.8238 19.1982 20.3001 18.5365C20.7375 17.9291 20.8728 17.2322 20.8728 16.7518L20.8728 11.9657L23 11.9657Z",fill:"currentColor"},null,-1),C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0 15.6879C0 14.9536 0.595228 14.3584 1.32948 14.3584H8.24277C8.97703 14.3584 9.57225 14.9536 9.57225 15.6879V19.9422C9.57225 20.6765 8.97703 21.2717 8.24277 21.2717H1.32948C0.595228 21.2717 0 20.6765 0 19.9422V15.6879ZM1.59538 15.9538V19.6763H7.97688V15.9538H1.59538Z",fill:"currentColor"},null,-1),C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M13.2948 1.32948C13.2948 0.595229 13.89 0 14.6243 0H21.5376C22.2718 0 22.8671 0.595228 22.8671 1.32948V5.58382C22.8671 6.31807 22.2718 6.91329 21.5376 6.91329H14.6243C13.89 6.91329 13.2948 6.31807 13.2948 5.58382V1.32948ZM14.8902 1.59538V5.31792H21.2717V1.59538H14.8902Z",fill:"currentColor"},null,-1)]))}const aui=z(oui,[["render",sui]]),lui={props:{color:{type:String,default:"currentColor"},size:{type:Number,default:1}}},cui=["width","height"],dui=["fill"];function uui(t,e,i,r,n,o){return M(),_("svg",{width:23*i.size,height:28*i.size,viewBox:"0 0 23 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},[C("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M7.81498 1.39408C7.83109 1.39042 7.84845 1.38833 7.86714 1.38833H8.34975C8.73313 1.38833 9.04391 1.07754 9.04391 0.694167C9.04391 0.310789 8.73313 0 8.34975 0H7.86714C7.74418 0 7.62361 0.0138267 7.5072 0.0402917C7.18421 0.113723 6.96548 0.401367 6.96677 0.719361C6.64878 0.718068 6.36114 0.936792 6.28771 1.25978C6.26124 1.37619 6.24741 1.49677 6.24741 1.61972V2.10233C6.24741 2.48571 6.5582 2.7965 6.94158 2.7965C7.32496 2.7965 7.63575 2.48571 7.63575 2.10233V1.61972C7.63575 1.60103 7.63783 1.58368 7.64149 1.56756C7.65339 1.51525 7.65903 1.46297 7.65892 1.4115C7.71038 1.41162 7.76266 1.40597 7.81498 1.39408ZM10.7628 0C10.3794 0 10.0686 0.310789 10.0686 0.694167C10.0686 1.07754 10.3794 1.38833 10.7628 1.38833H11.728C12.1114 1.38833 12.4222 1.07754 12.4222 0.694167C12.4222 0.310789 12.1114 0 11.728 0H10.7628ZM14.1411 0C13.7577 0 13.4469 0.310789 13.4469 0.694167C13.4469 1.07754 13.7577 1.38833 14.1411 1.38833H15.1063C15.4897 1.38833 15.8005 1.07754 15.8005 0.694167C15.8005 0.310789 15.4897 0 15.1063 0H14.1411ZM17.5194 0C17.136 0 16.8252 0.310789 16.8252 0.694167C16.8252 1.07754 17.136 1.38833 17.5194 1.38833H18.4846C18.868 1.38833 19.1788 1.07754 19.1788 0.694167C19.1788 0.310789 18.868 0 18.4846 0H17.5194ZM20.8976 0C20.5143 0 20.2035 0.310789 20.2035 0.694167C20.2035 1.07754 20.5143 1.38833 20.8976 1.38833H21.3803C21.3989 1.38833 21.4163 1.39042 21.4324 1.39408C21.4847 1.40597 21.537 1.41162 21.5885 1.4115C21.5884 1.46297 21.594 1.51525 21.6059 1.56756C21.6096 1.58368 21.6116 1.60103 21.6116 1.61972V2.10233C21.6116 2.48571 21.9224 2.7965 22.3058 2.7965C22.6892 2.7965 23 2.48571 23 2.10233V1.61972C23 1.49677 22.9861 1.37619 22.9597 1.25978C22.8863 0.936791 22.5986 0.718068 22.2806 0.719361C22.2819 0.401367 22.0632 0.113723 21.7402 0.0402916C21.6238 0.0138267 21.5032 0 21.3803 0H20.8976ZM23 4.51539C23 4.13201 22.6892 3.82122 22.3058 3.82122C21.9224 3.82122 21.6116 4.13201 21.6116 4.51539V5.48061C21.6116 5.86399 21.9224 6.17478 22.3058 6.17478C22.6892 6.17478 23 5.86399 23 5.48061V4.51539ZM23 7.89367C23 7.51029 22.6892 7.1995 22.3058 7.1995C21.9224 7.1995 21.6116 7.51029 21.6116 7.89367V8.85889C21.6116 9.24227 21.9224 9.55306 22.3058 9.55306C22.6892 9.55306 23 9.24227 23 8.85889V7.89367ZM23 11.2719C23 10.8886 22.6892 10.5778 22.3058 10.5778C21.9224 10.5778 21.6116 10.8886 21.6116 11.2719V12.2372C21.6116 12.6205 21.9224 12.9313 22.3058 12.9313C22.6892 12.9313 23 12.6205 23 12.2372V11.2719ZM23 14.6502C23 14.2669 22.6892 13.9561 22.3058 13.9561C21.9224 13.9561 21.6116 14.2669 21.6116 14.6502V15.1328C21.6116 15.1515 21.6096 15.1689 21.6059 15.185C21.594 15.2373 21.5884 15.2896 21.5885 15.3411C21.537 15.3409 21.4847 15.3466 21.4324 15.3585C21.4163 15.3621 21.3989 15.3642 21.3803 15.3642H20.8976C20.5143 15.3642 20.2035 15.675 20.2035 16.0584C20.2035 16.4418 20.5143 16.7526 20.8976 16.7526H21.3803C21.5032 16.7526 21.6238 16.7387 21.7402 16.7123C22.0632 16.6388 22.2819 16.3512 22.2806 16.0332C22.5986 16.0345 22.8863 15.8158 22.9597 15.4928C22.9861 15.3764 23 15.2558 23 15.1328V14.6502ZM14.6474 13.9116C14.2294 13.4884 13.7764 13.3132 13.2767 13.5451C13.1394 13.6088 13.0164 13.7642 12.965 13.9976C12.9404 14.1092 12.9387 14.2154 12.952 14.2991C12.9615 14.3593 12.9761 14.3926 12.9832 14.4062L13.3718 14.7996C13.6232 15.0542 13.6207 15.4644 13.3661 15.7158C13.1116 15.9673 12.7014 15.9648 12.4499 15.7102L11.1619 14.4063C11.0696 14.3373 10.7782 14.256 10.4038 14.5402C10.265 14.6456 10.1892 14.8021 10.164 15.0159C10.146 15.1695 10.1586 15.3254 10.1806 15.4503L11.5483 16.8349C11.7998 17.0894 11.7973 17.4997 11.5427 17.7511C11.2881 18.0026 10.8779 18.0001 10.6265 17.7455L8.84977 15.9469C8.73834 15.8341 8.59086 15.7372 8.44955 15.7103C8.34989 15.6913 8.17941 15.6888 7.92486 15.922C7.40908 16.3944 7.60249 16.7531 7.61982 16.7853C7.62079 16.7871 7.62121 16.7879 7.62092 16.7876L8.36876 17.5446L8.36898 17.5449L9.63136 18.8228C9.88282 19.0774 9.8803 19.4876 9.62574 19.7391C9.37117 19.9905 8.96096 19.988 8.7095 19.7335L7.50459 18.5137C7.39104 18.4504 7.3071 18.431 7.25026 18.426C7.18448 18.4203 7.12354 18.4313 7.05978 18.4573C6.91636 18.5159 6.79333 18.6313 6.65652 18.7691C6.4611 19.004 6.42638 19.1929 6.43343 19.3189C6.44127 19.4591 6.50463 19.5852 6.59048 19.673L9.52673 22.586C9.77984 22.8371 9.78249 23.2456 9.53265 23.4999C9.2828 23.7543 8.87438 23.759 8.61876 23.5104L8.22865 23.1311V23.623C8.24763 24.1981 8.60657 24.7179 9.15357 25.1243C9.71443 25.541 10.3301 25.7301 10.6198 25.7301H14.6969C15.587 25.6238 16.1129 25.3237 16.2057 25.252C17.6012 24.1569 18.629 22.8236 18.9789 22.282C19.965 20.0757 18.9393 18.2565 18.341 17.6508L14.6474 13.9116ZM6.93288 21.8379V23.6327L6.93312 23.6505C6.96401 24.7762 7.65626 25.6261 8.38077 26.1644C9.09398 26.6943 9.97451 27.0259 10.6198 27.0259H14.7343C14.7585 27.0259 14.7826 27.0245 14.8067 27.0218C15.9128 26.8974 16.6893 26.5178 17.0025 26.2739L17.0044 26.2724C18.5682 25.0455 19.7067 23.557 20.0979 22.9372C20.1134 22.9127 20.1272 22.8871 20.1393 22.8607C21.4417 20.0111 20.126 17.614 19.2629 16.7402L17.6781 15.1359V6.01643C17.6781 4.8663 16.7457 3.93393 15.5956 3.93393H2.0825C0.932367 3.93393 0 4.8663 0 6.01643V19.5295C0 20.6797 0.932368 21.612 2.0825 21.612H6.70519L6.93288 21.8379ZM5.13682 19.2982H2.31389V6.24782H15.3642V12.8096C14.7425 12.2755 13.8096 11.8694 12.7314 12.3697C12.2925 12.5733 12.0053 12.926 11.8384 13.2984C11.1789 12.8743 10.2855 13.0031 9.62023 13.5082C9.24833 13.7906 9.04821 14.1549 8.94823 14.5061C8.86696 14.4778 8.7815 14.4544 8.69206 14.4374C8.15818 14.3357 7.58059 14.4801 7.04965 14.9664C6.21364 15.7322 6.13093 16.6828 6.43561 17.319C6.09639 17.4901 5.85345 17.7375 5.73648 17.8566L5.71719 17.8762C5.70638 17.8871 5.69596 17.8985 5.68595 17.9101C5.31058 18.3486 5.1343 18.8291 5.13682 19.2982Z",fill:i.color},null,8,dui)],8,cui)}const Pde=z(lui,[["render",uui]]),hui="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFoAAABaCAYAAAA4qEECAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAkhSURBVHgB7Z3NbhvXFcfPvRTkWg5QdqW2aRAaTbMokHKUOpLQTahNYdMGTD2BqSewuuvO1BNYWnZl+QmkAIWoeqPRpoioGBrKbRAgATQGkiDJJgyQSIli3pNz5oMcUqT4oRnxXkk/QCA5M6Q4/7nzn3vOuXcIYBjW9N8LYCASDAPF2CMrl0uDYRgltPW3vMUP6vDGfTAMo4RWdfGAH4VQRTAMo4QWgL4/o7BMsw9jhA5sI+O9EJA2zT6METq0jRDT7MMYoRu2EWKYfRghdItthBhmH0YI3W4bISbZhxFCn7CNEIPsQ3uhO9pGiEH2ob3Q3WwjxBT7SFRoPq2t2UIGzkBX2wgxxD4SE9qaubuIhzcOEI8PsjP5g2GybidtA22lMAcIq41FhthHIkJbs/kiAj4GgWFLy1DWbc26dTs3wMc0bQOhhlBfrO6U517slrerlY0FpdQCrXB5tQn2kYjQiNCxhamUGKjl+baBtpBqan/nPyvRdS92N1eFwDmvdRtgH2OgKdbs7YzC+nK7wFGcDzddelh4573b2/j9r9hmbNAUAQlAO16UUj5pX/4KX1n/rzyrwiUkBQnwzZefOZNv/JGOosh5C9hjRf2f/6s8+wAuKUO36KPn7xYlitq1W8/Xu23DvvnT8cSvr40ffufYdg0uMUMJ/dPzv65B0L+lC5I9/u7eHCSM9V5QxhLwZrhMAlbpQug6uxsOaM7AQh/tWRmp5EF02c91NfXatBP7zlqz93J0QbwvUBYjXcVOuGRP3DtZCi6Q2jGw0LhnpY99oRs7Pi7Vb8SUE5s1eF21o4kSAjyEAREIS05lowSaMZx1fGSRbYhHHJUJxNL4LecpxAR36xDlFpxIJKFNwjugqPUyEjL05clOggtu67YOWdq8Tq07ke7dsHgiq9Rewya8iFAty4kfV7pdTL3+NsADgaJIu5OJrHIpYpzTRWxthD7ZkikiFLjQr1DB+9fAa+Uh6FDYPgUakEg/ehgmf/825UYg571AtVqtbM5/9flnffs+b/v1F5/+a/L1t24KIQKxxW8nX/8T0PJtGDGJZu+y03e/tabzpZ7bUhKKRC76r9AlkRdgSOTEtUVgLw+gU3aRWzuMmMSEpuzdQ/ZaFPCo57YoGr0LL1F0Bhx7vSYUNA8Up1Ejnz8qkhR6hVsnpzdP287POaMVvGk1jouXF8BEctZ8oRx1di+x7N3+TnmZHpZ7bafq8n1BfTbvOeIqxAQFL0+RAx3vBfX5R5zdG3nNkETOeU+oK8dJfYgJOjNsCs8bF1PKhWdhhGhQnBX+KS0w/nyFCIIb7+OFBSNEA6ExA8mhTcbQuBH/pqJtKYvxUqMo0/Da947p+WwtWzQHGNmZ/B5K2MOU2sKjib1OwxV4zIh1614ODEBLoRFTXG+0EFUJFS56vXIYexL2hf0DcXeLx4zwgRh23Mh5MrR1eDv9w0QBpaDM2c8rTuXZOsSAlSuk8eg4R2qv71c2l7xl0/deolBrwUAZ6h+n1vwgB7kL53L4HhwIO06LYeui/XssBAc/9e2zBFMDCR0VFw8pSyYpnUlBRlwityCahQWQiv4P55pe1TiSxDqJTAeiWinP8+q/zOZdymmU1NF1HnCzAjHBESZ9tu1HmRLoLLKHFb2n0B3F5b32EqzoColLECOcq8jO3LE5oZ+dzj9BgTVUlGsWyk2NiSoojiLZ8ZrBiAS5jRxdoog9zN7/cGOJrIltic+gHCJnGAcXvaPQp4vbBKm6Ut2JP7HOeWhKNHHatCj4n5LIQol5Z7fs8nrKCtYoAilaM3eoOAsuefnj4PvYkACcpOILc+vSwURvCN2vuM3/A6vkobGVsKIEX3b+z37lGz7eLbdEjVQ+m0MQW5QZfBx+P75wvtjdTCTvHFhIieqRpc5b9BZ9zJq+U0AhH/YlbuNzocYVZ0iYj7sMI+Adp57HlKqL+9T809ySkxI5JLCQInQbFN+gTXTqKMDEsT3mVMrr78zk6cyAAglYaLkIdYO3UYpbmwsjImgtsV34euGXynqJHEANkXM3dJatChKZe0KedbzY2eChWvy3QKLflyw4nC56Et0pnQnqmadsEIqLq1RM/qBdlxMXw75Fp9d4eJ0Di3m44FCprdSxNfcQN8qp3bueogtR4IgskX60JgSW0SzHDSBulL4Dlm6iX3QL8SxjSHGjDBWCt4sOh+M5en7hWjW15pxSqjSsuFHOnCYNRL+QeOWwmNA6Hx3CmTrun/JznpUVZ23xvLiqsJwTV0KfE1dCnxNXQp8TRlwMOxFcIDP8XKYgt/ffjZfR+qHz0b9t0AjthPb7rvJ9fi6l2u7exfJEzkTeRxGcCvMRLv3dBI3QTmgWmfK5peA5P9rR9ZTBLViz9wQVbdM8YcUUjPNoIcWi13JPn6WlHTqMvfNDW544Tx4rWqZGXBxGbh1UfF0nB7C8tGtKbfXxDhd8D86Ek4PwWN2EcVmDOmjLyFs0l4ggMhWiJyhsvm8HQmq5sSgln+Ar0cdBGh1aeHR1Z2PKu9GJd++N/rKA8vrY0/DGKMCtW3PP1mqeYQhPMgqEc0l4h75lY7gXAi7u75S9WqE/L1E+ak40amzExWM6ePJB2IPhg8h3roERoWXAghKXg9I+tdSWeyq5UmAjLRveGIX/eLgEHl1f82bSst+jPBCRZoSgbBgh2swzjPL1559uT/7h7TTpNNtciv4gmkr5k07v+cp1f/zdG2+9JKGLJ9eiu3+GKXVxoKV1hLA11FFmQWHf81v8cSqCa3yWV4Kiyo+YOPzHZb9fyBVXXBIGnYCpwzTk09A415EGnl7RS8Bw9H+9Lt4EjdFWaB4nTb2FGnfTuk3c927Lyff3AJXRvWCrdfZOKeENC+aJ+948laB1N+awhLflpLAcNEdroVM3xtcj04z5xicH2en8mt+K/eEHTJxzyJNC6340k525s9X5vkkh6FKSSatqSif0v1F3YB9dMcA2GO2FbrOPE5hgG4z2Qnu9D6G65KvRNWV4mBk/D9LNPgyxDcYIobvZhym2wRghdGf7MMc2GHN+lKzdPgyyDcYYodvtwyTbYIwRutU+zLINxqyfQg3twzDbYIwSOrQP02zDSPjWEmAg5g1ypEIrGMgvJG+j0Idlmd0AAAAASUVORK5CYII=",uD=document.createElement("img");uD.src=hui,uD.style.cursor="grabbing";function pui({dataTransferType:t="areas_zone-id",getData:e=()=>null,onDropCB:i=()=>{}}={}){const r=Ae(!1),n=Ae(!1);function o(u){u.dataTransfer.types.includes(t)&&(u.preventDefault(),u.dataTransfer.dropEffect="move")}function s(){n.value=!1}function a(u){r.value=!0,u.dataTransfer.setData(t,e()),u.dataTransfer.effectAllowed="move",u.dataTransfer.setDragImage(uD,45,45)}function l(){r.value=!1}function c(u){n.value=!1;const h=parseInt(u.dataTransfer.getData(t),10);i?.(h)}function d(u){u.dataTransfer.types.includes(t)&&(n.value=!0)}return{dragging:r,dragover:n,onDragOver:o,onDragLeave:s,onDragStart:a,onDragEnd:l,onDrop:c,onDragEnter:d}}const fui=["draggable"],Aui={class:"layout-settings__header"},mui={key:0,class:"layout-settings__swap"},gui={key:1,class:"layout-settings__split"},vui={class:"layout-settings__split__text"},yui={class:"layout-settings__split__text"},bui={key:2,class:"layout-settings__buttons"},wui={__name:"LayoutSettings",setup(t){const e=mt("$viewer"),{localContext:i}=e,r=et(()=>i.window),n=et(()=>e.globalContext.localContexts.length>1),o=et(()=>e.layout.settings.swap),s=et(()=>e.layout.settings.full);function a(){e.layout.settings.swap=!e.layout.settings.swap}function l(){i.loadWindow(null),e.layout.settings.edit=!1}function c(){i.close()}function d(k="row"){e.globalContext.open({localContextId:i.id,ratio:50,direction:k})}function u(){d(),e.layout.settings.edit=!1}function h(){d("column"),e.layout.settings.edit=!1}bt(()=>e.globalContext.localContexts.length,k=>{var P;k===1&&e.layout.settings.edit&&((P=e.globalContext.localContexts[0].window)==null?void 0:P.header)===!1&&(e.layout.settings.edit=!1)});const{dragging:f,dragover:A,onDragOver:p,onDragLeave:g,onDragStart:m,onDragEnd:w,onDrop:y,onDragEnter:v}=pui({getData:()=>String(i.id),onDropCB:k=>{Number.isNaN(k)||e.globalContext.swap(k,i.id)}}),x=et(()=>e.layout.settings.swap);return(k,P)=>{const E=S("BIMDataIconWindowRight"),B=S("BIMDataButton"),I=S("BIMDataIconWindowBottom"),T=S("BIMDataIconDelete"),L=S("BIMDataTooltip");return M(),_("div",{class:le(["layout-settings",{"layout-settings--swap":o.value,"layout-settings--dragging":wt(f),"layout-settings--dragover":wt(A)}]),draggable:x.value,onDragover:P[0]||(P[0]=(...O)=>wt(p)&&wt(p)(...O)),onDragleave:P[1]||(P[1]=(...O)=>wt(g)&&wt(g)(...O)),onDragenter:P[2]||(P[2]=(...O)=>wt(v)&&wt(v)(...O)),onDragstart:P[3]||(P[3]=ft((...O)=>wt(m)&&wt(m)(...O),["self"])),onDrop:P[4]||(P[4]=(...O)=>wt(y)&&wt(y)(...O)),onDragend:P[5]||(P[5]=(...O)=>wt(w)&&wt(w)(...O))},[C("div",Aui,K(k.$t(o.value?"window-manager.swap":"window-manager.description"))+". ",1),o.value?(M(),_("div",mui,[D(Pde,{color:"#ffffff",size:2})])):(M(),_("div",gui,[D(B,{color:"default",fill:"",square:"",icon:"",height:"50px",style:{padding:"var(--spacing-unit)"},onClick:u},{default:V(()=>[D(E),C("span",vui,K(k.$t("window-manager.vertical")),1)]),_:1}),D(B,{color:"default",fill:"",square:"",icon:"",height:"50px",style:{padding:"var(--spacing-unit)"},onClick:h},{default:V(()=>[D(I),C("span",yui,K(k.$t("window-manager.horizontal")),1)]),_:1})])),s.value?(M(),_("div",bui,[n.value?(M(),Z(L,{key:0,text:k.$t("window-manager.delete"),position:"left"},{default:V(()=>[D(B,{disabled:o.value,fill:"",square:"",icon:"",color:"default",width:"50px",height:"50px",onClick:c},{default:V(()=>[D(T,{fill:"",color:"high"})]),_:1},8,["disabled"])]),_:1},8,["text"])):re("",!0),n.value?(M(),Z(L,{key:1,text:k.$t("window-manager.swap_tooltip"),position:"left"},{default:V(()=>[D(B,{fill:"",square:"",icon:"",color:o.value?"secondary":"default",width:"50px",height:"50px",onClick:a},{default:V(()=>[D(Pde)]),_:1},8,["color"])]),_:1},8,["text"])):re("",!0),r.value?(M(),Z(L,{key:2,text:k.$t("window-manager.change"),position:"left"},{default:V(()=>[D(B,{disabled:o.value,fill:"",square:"",icon:"",color:"default",width:"50px",height:"50px",onClick:l},{default:V(()=>[D(aui)]),_:1},8,["disabled"])]),_:1},8,["text"])):re("",!0)])):re("",!0)],42,fui)}}};function Cui(t,e=()=>{}){const i=Ae(0),r=Ae(0),n=Ae(0),o=Ae(0),s=l=>{l.forEach(c=>{const{width:d,height:u,x:h,y:f}=c.target.getBoundingClientRect();i.value=d,r.value=u,n.value=h,o.value=f,e?.({width:i.value,height:r.value,x:n.value,y:o.value})})},a=new ResizeObserver(s);return Ei(()=>{a.observe(t.value)}),ar(()=>a.disconnect()),{width:i,height:r,x:n,y:o}}class xui extends A_{constructor(e){super(e);const{width:i,height:r,x:n,y:o}=Cui(this.templateRef,s=>this.hub.emit("context-resize",s));this._resolution=Ae(1),this._width=i,this._height=r,this._x=n,this._y=o}get width(){return this._width.value}get height(){return this._height.value}get x(){return this._x.value}get y(){return this._y.value}get resolution(){return this._resolution.value}set resolution(e){this._resolution.value=e}}class kui extends xui{constructor(e){super(e),this.viewer=null,this._annotationMode=Ae(!1)}get annotationMode(){return this._annotationMode.value}async getSnapshot(){if(!this.viewer)throw new Error("[localContext.getSnapshot] Error: no viewer registered in this localContext.");await this.hideUI();const e=await this.viewer.getSnapshot();return await this.showUI(),e}getViewpoint(e){if(!this.viewer)throw new Error("[localContext.getViewpoint] Error: no viewer registered in this localContext.");return this.viewer.getViewpoint(e)}setViewpoint(e,i){if(!this.viewer)throw new Error("[localContext.setViewpoint] Error: no viewer registered in this localContext.");this.viewer.setViewpoint(e,i)}startAnnotationMode(e){if(!this.viewer)throw new Error("[localContext.startAnnotationMode] Error: no viewer registered in this localContext.");if(!this.annotationMode)return this._annotationMode.value=!0,this.viewer.startAnnotationMode(e)}stopAnnotationMode(){if(!this.viewer)throw new Error("[localContext.stopAnnotationMode] Error: no viewer registered in this localContext.");this._annotationMode.value=!1,this.viewer.stopAnnotationMode()}fitView(e){if(!this.viewer)throw new Error("[localContext.fitView] Error: no viewer registered in this localContext.");this.viewer.fitView(e)}async showUI(){if(!this.viewer)throw new Error("[localContext.showUI] Error: no viewer registered in this localContext.");this.pluginComponentInstances.forEach(e=>e.$show()),this.viewer.showUI(),await Br()}async hideUI({exceptions:e=[]}={}){if(!this.viewer)throw new Error("[localContext.hideUI] Error: no viewer registered in this localContext.");e.push(this.viewer.$plugin.name),[...this.pluginComponentInstances.entries()].filter(([i])=>!e.includes(i)).forEach(([,i])=>i.$hide()),this.viewer.hideUI(),await Br()}}class Mui extends kui{constructor(e){super(e),this.modelTypes=null,this.multiModel=!0,this._loadedModels=fr([]),this._loadingModelIds=Ae([]),this._selectedStorey=fr(null),this._shownPlans=fr([]),this._loadedModelIds=et(()=>this._loadedModels.value.map(i=>i.id)),this._automaticFirstModelsLoading=!1,this._globalContextSubscription=null,ar(()=>{e.globalContext.hub.off(this._globalContextSubscription)})}get loadedModels(){return this._loadedModels.value}get loadingModelIds(){return this._loadingModelIds.value}get loadedModelIds(){return this._loadedModelIds.value}get selectedStorey(){return this._selectedStorey.value}async loadModels(e,i={}){var r;const n=this._$viewer;if(!Array.isArray(e))throw new Error("[BIMDataViewer - Local State] loadModels requires an array of model ids.");this.multiModel||(e.length>1&&(e=[e[0]]),this.loadedModels.length>0&&this.unloadModels(this.loadedModelIds)),this.loadingModelIds.push(...e),this.hub.emit("models-loading",{ids:e});const o=[],s=[];for(const l of e)this.loadedModelIds.includes(l)||(n.state.modelsMap.has(l)?o.push(n.state.modelsMap.get(l)):s.push(l));o.push(...await n.state.loadModels(s)),this._loadingModelIds.value=this.loadingModelIds.filter(l=>!e.includes(l));const a=o.filter(l=>{var c;return((c=this.modelTypes)==null?void 0:c.includes(l.type))??!0});if(a.forEach(l=>{l.status!=="C"&&console.warn(`[BIMDataViewer - Local State] Model with id ${l.id} has an uncompleted status, loading may fail`)}),a.length!==0&&(this._loadedModels.value=[...this.loadedModels,...a],await((r=this.viewer)==null?void 0:r.loadModels(a)),this.hub.emit("models-loaded",{models:a}),n.globalContext.hub.emit("models-loaded",{models:a,emitter:this})),i!=null&&i.viewpoint&&this.viewer&&this.setViewpoint(i.viewpoint),i!=null&&i.storey){const l=a.flatMap(c=>c.storeys).find(c=>c.key===i.storey);l&&this.selectStorey(l)}return a}unloadModels(e){var i;const{loadedModels:r,$viewer:n}=this;if(!Array.isArray(e))throw new Error("[BIMDataViewer - Local State] unloadModels requires an array of ids.");const o=e.map(s=>n.state.modelsMap.get(s)).filter(Boolean);return o.length===0?!1:(this._loadedModels.value=r.filter(s=>!o.includes(s)),(i=this.viewer)==null||i.unloadModels(o),this.selectedStorey&&o.some(s=>s.storeys.some(a=>a.key===this.selectedStorey.key))&&this.selectStorey(null),this.hub.emit("models-unloaded",{models:o}),n.globalContext.hub.emit("models-unloaded",{models:o,emitter:this}),o)}get automaticFirstModelsLoading(){return this._automaticFirstModelsLoading}set automaticFirstModelsLoading(e){this._automaticFirstModelsLoading=e,e?this._onAutomaticFirstModelsLoading():this._$viewer.globalContext.hub.off(this._globalContextSubscription)}async _onAutomaticFirstModelsLoading(){const{_loadedModels:e,_loadingModelIds:i,$viewer:r}=this,n=r.globalContext.loadedModels.filter(a=>{var l;return((l=this.modelTypes)==null?void 0:l.includes(a.type))??!0});n.length>0&&this.loadModels(n.map(a=>a.id)),r.globalContext.hub.off(this._globalContextSubscription);const o=a=>{a=a.filter(l=>{var c;return((c=this.modelTypes)==null?void 0:c.includes(l.type))??!0}),a.length>0&&e.value.length===0&&i.value.length===0&&this.loadModels(a.map(l=>l.id))};await Br();let s=!0;this._globalContextSubscription=r.globalContext.hub.on("models-loaded",({models:a,emitter:l})=>{!s&&l===this||o(a)},{getLastEvent:!0}),s=!1}selectStorey(e,i=!0){this._selectedStorey.value=e,this.shownPlans.length>0&&this.shownPlans.forEach(r=>this.hidePlan(r)),i&&e?.plans.length>0&&e.plans.forEach(r=>this.showPlan(r)),this.hub.emit("storey-selected",{storey:e})}get shownPlans(){return this._shownPlans.value}showPlan(e){return this._shownPlans.value.some(i=>i.key===e.key)?!1:(this._shownPlans.value=[...this._shownPlans.value,e],this.hub.emit("plan-shown",{plan:e}),!0)}hidePlan(e){return this._shownPlans.value.some(i=>i.key===e.key)?(this._shownPlans.value=this._shownPlans.value.filter(i=>i.key!==e.key),this.hub.emit("plan-hidden",{plan:e}),!0):!1}}class Pui extends Mui{constructor(e,i){super(e),this.id=i,this._window=fr(null),this.pluginInstances=new Map,ar(()=>{this.unloadWindow()})}get $viewer(){const e=this;return new Proxy(this._$viewer,{get(i,r,n){return r==="localContext"?e:Reflect.get(i,r,n)}})}get pluginComponentInstances(){return new Map([...this.pluginInstances.values()].filter(e=>e.componentInstance).map(e=>[e.name,e.componentInstance]))}get plugins(){return this.pluginComponentInstances}get window(){return this._window.value}unloadWindow(){if(!this.window)return!1;const e=this.window,i=this.window.name;return this.pluginInstances.clear(),this._window.value=null,this.loadedModelIds.length>0&&this.unloadModels(this.loadedModelIds),this.automaticFirstModelsLoading=!1,this._$viewer.globalContext.hub.emit("window-close",{window:e,name:i,localContext:this}),!0}async loadWindow(e=null,i=null){const r=!!this.window;if(this.unloadWindow(),e===null)return null;if(r&&await Br(),!this.$viewer.windowManager.registeredWindows.has(e)){const l=`Cannot load window with name "${e}" because it is not registered.`;return console.warn(l),null}this._window.value=this.$viewer.windowManager.registeredWindows.get(e);const n=Array.from(this.window.plugins??[]);this.pluginInstances.clear(),n.map(l=>this.$viewer.pluginManager.getPluginInstance(l,this)).filter(Boolean).sort(({button:{stance:l=0}={}},{button:{stance:c=0}={}})=>l-c).forEach(l=>this.pluginInstances.set(l.name,l)),this.modelTypes=Array.isArray(this.window.modelTypes)?this.window.modelTypes:null,this.multiModel=this.window.multiModel??!0,this._loadedModels.value=[],this._loadingModelIds.value=[];const{modelIds:o,viewpoint:s,storey:a}=i??{};return this.window.noModel!==!0&&(o?.length>0?(this.automaticFirstModelsLoading=!1,this.loadModels(o,{viewpoint:s,storey:a})):this.automaticFirstModelsLoading=!0),this._$viewer.globalContext.hub.emit("window-open",{window:this.window,name:this.window.name,localContext:this}),this.window}close(){return this._$viewer.globalContext.close(this.id)}getPlugin(e){return console.warn("[BIMData Viewer] DEPRECATED - Ambigous name. Do not use localContext.getPlugin(name), use the localContext.pluginComponentInstances Map instead."),this.pluginComponentInstances.get(e)}}const Eui={name:"WindowContainer",components:{PluginComponentInstanceContainer:Yv,LayoutSettings:wui,SidePanel:zdi,SideColumn:rui,ModalManager:kde},inject:["$viewer"],props:{windowName:{type:String,default:null},windowState:{type:Object,default:null},zoneId:{type:Number,required:!0}},setup(t){const e=mt("$viewer"),{globalContext:i}=e,r=new Pui(e,t.zoneId);ur("$viewer",r.$viewer);const{templateRef:n}=r,o=()=>{n.value&&(n.value.scrollTop=0,n.value.scrollLeft=0)};Ei(()=>{n.value.addEventListener("scroll",o,{passive:!0})});const s=()=>{i.activeLocalContext=r},a=()=>{i.activeLocalContext===r&&(i.activeLocalContext=null)},l=et(()=>{var d;const u=[];let h=null,f=null;const A=[],p=[],g=[];return r.window?g.push(...r.pluginInstances.values()):((d=e.windowManager.defaultWindow)==null?void 0:d.plugins.length)>0&&g.push(...e.windowManager.defaultWindow.plugins.map(m=>e.pluginManager.getPluginInstance(m,this)).filter(Boolean).sort(({button:{stance:m=0}={}},{button:{stance:w=0}={}})=>m-w)),g.forEach(m=>{!m.button&&!m.sidePanel?m.isViewer?u.unshift(m):u.push(m):m.sidePanel?m.sidePanel.position==="left"?(h&&console.warn(`[BIMDataViewer - WindowContainer] Window ${r.window.name}, Multiple left side panels are not supported. Only the last one will be displayed.`),h=m):m.sidePanel.position==="right"&&(f&&console.warn(`[BIMDataViewer - WindowContainer] Window ${r.window.name}, Multiple right side panels are not supported. Only the last one will be displayed.`),f=m):m.button.position==="left"?A.push(m):m.button.position==="right"&&p.push(m)}),u.reverse(),{free:u,leftSidePanel:h,rightSidePanel:f,leftButtonColumn:A,rightButtonColumn:p}});r.loadWindow(t.windowName,t.windowState);const c=et(()=>{const d=l.value.leftSidePanel,u=d!=null&&d.shown?d.sidePanel.width:0,h=l.value.rightSidePanel,f=h!=null&&h.shown?h.sidePanel.width:0;return r.width-u-f});return{onMouseEnter:s,onMouseLeave:a,templateRef:n,modalManagerTemplateRef:r.modalManagerTemplateRef,windowPlugins:l,layoutSettingsDisplayed:et(()=>e.layout.settings.edit),spinner:et(()=>r.spinner),loading:et(()=>r.loading),width:et(()=>r.width),height:et(()=>r.height),resolution:et(()=>r.resolution),localContext:r,centerWidth:c}},created(){this.$viewer.windowManager.windowContainers.push(this)},unmounted(){const t=this.$viewer.windowManager.windowContainers.indexOf(this);t!==-1&&this.$viewer.windowManager.windowContainers.splice(t,1)}},Bui={class:"window-container__content"},Iui={class:"window-container__content__center"},Sui={key:0,class:"global-spinner",style:{"z-index":"2"}},Tui={key:1,class:"window-container__layout-settings",style:{"z-index":"5"}};function Dui(t,e,i,r,n,o){const s=S("ModalManager"),a=S("SidePanel"),l=S("PluginComponentInstanceContainer"),c=S("SideColumn"),d=S("BIMDataSpinner"),u=S("LayoutSettings");return M(),_("div",{ref:"templateRef",class:"window-container",style:se(`
|
|
@@ -5477,5 +5477,5 @@ void main() {
|
|
|
5477
5477
|
--bimdata-local-context-width: ${r.width}px;
|
|
5478
5478
|
--bimdata-local-context-center-width: ${r.centerWidth}px;
|
|
5479
5479
|
--bimdata-local-context-resolution: ${r.resolution};
|
|
5480
|
-
`),onMouseenter:e[0]||(e[0]=(...h)=>r.onMouseEnter&&r.onMouseEnter(...h)),onMouseleave:e[1]||(e[1]=(...h)=>r.onMouseLeave&&r.onMouseLeave(...h))},[D(s,{ref:"modalManagerTemplateRef"},null,512),C("div",Bui,[r.windowPlugins.leftSidePanel?(M(),Z(a,{key:0,plugin:r.windowPlugins.leftSidePanel},null,8,["plugin"])):re("",!0),C("div",Iui,[(M(!0),_(ct,null,Bt(r.windowPlugins.free,h=>(M(),Z(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:r.windowPlugins.leftButtonColumn},null,8,["plugins"]),D(c,{position:"right",plugins:r.windowPlugins.rightButtonColumn},null,8,["plugins"])]),r.windowPlugins.rightSidePanel?(M(),Z(a,{key:1,plugin:r.windowPlugins.rightSidePanel},null,8,["plugin"])):re("",!0)]),r.loading?(M(),_("div",Sui,[r.spinner&&r.spinner.component?(M(),Z(br(r.spinner.component),_s(xn({key:0},r.spinner.props)),null,16)):(M(),Z(d,{key:1,size:"20px",border:"3px"}))])):re("",!0),r.layoutSettingsDisplayed?(M(),_("div",Tui,[D(u)])):re("",!0)],36)}const Rui=z(Eui,[["render",Dui]]);class Lui{constructor(e=!0){const i=xdi(YF,null,{resizable:e});i.registerContent("default",Rui),this.settings=zn({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?kdi(e):null}copy(e,i=!0){return Mdi(this.areas.layout,e,i)}open({ratio:e,direction:i,insertAfter:r,windowName:n=null,windowState:o=null,localContextId:s=null}={}){const a=n?{options:{windowName:n,windowState:o}}:null;return s===null?this.areas.splitLayout(e,i,r,a):this.areas.split(s,e,i,r,a)}swap(e,i){return this.areas.swap(e,i)}close(e){return this.areas.delete(e)}compare(e,i){var r,n;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((r=e.windowState)==null?void 0:r.modelIds),s=new Set((n=i.windowState)==null?void 0:n.modelIds);return o.size===s.size&&[...o].every(a=>s.has(a))}return e.windowName||i.windowName||e.direction!==i.direction||e.children.length!==i.children.length?!1:e.children.every((o,s)=>this.compare(o,i.children[s]))}}const Fui="2.8.0-beta.3",_ui={version:Fui};class Oui{constructor({plugins:e,api:i,ui:r,locale:n="fr"}){this.pluginManager=new Fsi(e),this.windowManager=new Osi,this.windowManager.registerAndAddPluginsToWindows([...this.pluginManager.registeredPlugins.values()]),this.api=new Mci(i),this.globalContext=new r2e(this),this.state=Vci(this),this.shortcutManager=jue(this.state),this.uiSettings=r||{},this.i18n=new t2e(n),this._contextMenu=null,this.layout=new Lui(this.uiSettings.resizable!==!1),this.localContext=null,window.$viewer=this}get version(){return _ui.version}get locale(){return this.i18n.locale}get contextMenu(){return this._contextMenu||Uue}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 Uui(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 Nui=Object.freeze({25:"GUEST",50:"USER",100:"ADMIN"}),L2=Object.freeze({READ:"read",WRITE:"write"});function Ede(t){const e={};return t.forEach(i=>{const[r,n]=i.split(":");e[r]?e[r].push(n):e[r]=[n]}),e}const jui={token_scopes:[],usable_scopes:[],user_role:25};function Bde(t=jui){var e,i,r,n,o,s;const a=Ede(t.token_scopes),l=Ede(t.usable_scopes);return{..._j(t),tokenScopes:a,usableScopes:l,userRole:Nui[t.user_role],user:t.user?_j(t.user):null,hasBcfReadPermission:((e=l.bcf)==null?void 0:e.includes(L2.READ))??!1,hasBcfWritePermission:((i=l.bcf)==null?void 0:i.includes(L2.WRITE))??!1,hasModelReadPermission:((r=l.model)==null?void 0:r.includes(L2.READ))??!1,hasModelWritePermission:((n=l.model)==null?void 0:n.includes(L2.WRITE))??!1,hasDocReadPermission:((o=l.document)==null?void 0:o.includes(L2.READ))??!1,hasDocWritePermission:((s=l.document)==null?void 0:s.includes(L2.WRITE))??!1}}const Vui={BcfFilters:{filtersButton:"Filter",filtersTitle:"Filter",priorityLabel:"Priorit\xE4t",statusLabel:"Status",assignedToLabel:"Zugewiesen an",creatorsLabel:"Erstellt von",tagsLabel:"Tags",resetButton:"Zur\xFCcksetzen",searchButton:"Suchen",undefined:"Nicht definiert",datePlaceholder:"Erstellungsdatum"},BcfSettings:{goBackButton:"Zur\xFCck",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"}}},zui={BcfComponents:Vui},Hui={BcfFilters:{filtersButton:"Filters",filtersTitle:"Filters",priorityLabel:"Priority",statusLabel:"Status",assignedToLabel:"Assigned to",creatorsLabel:"Created by",tagsLabel:"Tags",resetButton:"Reset",searchButton:"Search",undefined:"Not defined",datePlaceholder:"Creation date"},BcfSettings:{goBackButton:"Back",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"},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"},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"}}},qui={BcfComponents:Hui},Gui={BcfFilters:{filtersButton:"Filtros",filtersTitle:"Filtros",priorityLabel:"Prioridad",statusLabel:"Estado",assignedToLabel:"Asignado a",creatorsLabel:"Creado por",tagsLabel:"Etiquetas:",resetButton:"Restablecer",searchButton:"Buscar en",undefined:"No definido",datePlaceholder:"Fecha de creaci\xF3n"},BcfSettings:{goBackButton:"Volver",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"}}},Qui={BcfComponents:Gui},Kui={BcfFilters:{filtersButton:"Filtres",filtersTitle:"Filtres",priorityLabel:"Priorit\xE9",statusLabel:"Statut",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:{goBackButton:"Retour",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"},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"},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"}}},Zui={BcfComponents:Kui},Wui={BcfFilters:{filtersButton:"Filtri",filtersTitle:"Filtri",priorityLabel:"Priorit\xE0",statusLabel:"Stato",datePlaceholder:"Data di creazione",assignedToLabel:"Assegnato a",creatorsLabel:"Creato da",tagsLabel:"Etichette",resetButton:"Ripristina",searchButton:"Cerca",undefined:"Non definito"},BcfSettings:{goBackButton:"Indietro",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"}}},Jui={BcfComponents:Wui},Xui={de:zui,en:qui,es:Qui,fr:Zui,it:Jui},Yui=({apiClient:t,fetchUsers:e,i18nPlugin:i}={})=>({install(r){t?Yi.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(Xui).forEach(([n,o])=>{i.global.mergeLocaleMessage(n,o)}):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(x4e).forEach(([n,o])=>{r.component(n,o)})}}),$ui={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"}},ehi={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"},thi={BuildingMaker:$ui,FileManager:ehi},ihi={t:{back:"Back",cancel:"Cancel",create:"Create",delete:"Delete",download:"Download",finish:"Finish",rename:"Rename",search:"Search",see:"View",storey:"Storey",validate:"Validate"}},rhi={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"}},ohi={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"},nhi={title:"Meta-Building Structure",tab:{structure:"Structure",zones:"Zones",equipments:"Equipments"},StoreySelector:{placeholder:"Select a storey"}},shi={title:"Photosphere Building"},ahi={BIMDataComponents:ihi,BuildingMaker:rhi,FileManager:ohi,MetaBuildingStructure:nhi,PhotosphereBuilding:shi},lhi={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"}},chi={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"},dhi={BuildingMaker:lhi,FileManager:chi},uhi={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"}},hhi={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"}},phi={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"},fhi={title:"Structure M\xE9ta-Building",tab:{structure:"Structure",zones:"Zones",equipments:"\xC9quipements"},StoreySelector:{placeholder:"S\xE9lectionner un \xE9tage"}},Ahi={title:"Photosph\xE8re Building"},mhi={BIMDataComponents:uhi,BuildingMaker:hhi,FileManager:phi,MetaBuildingStructure:fhi,PhotosphereBuilding:Ahi},ghi={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"}},vhi={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"},yhi={BuildingMaker:ghi,FileManager:vhi},bhi={de:thi,en:ahi,es:dhi,fr:mhi,it:yhi},whi=({i18nPlugin:t}={})=>({install(e){t?Object.entries(bhi).forEach(([i,r])=>{t.global.mergeLocaleMessage(i,r)}):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(nHt).forEach(([i,r])=>{e.component(i,r)})}}),Chi={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(r=>r===t)||e.value()},window.addEventListener("mousedown",t.clickAwayHandler,!0)},unmounted(t){window.removeEventListener("mousedown",t.clickAwayHandler,!0),delete t.clickAwayHandler}},xhi=Object.freeze(Object.defineProperty({__proto__:null,BIMDataClickAway:Ca,BIMDataClickInputAway:Chi},Symbol.toStringTag,{value:"Module"})),khi=t=>({install(e){Object.entries(pGe).forEach(([i,r])=>{e.component(i,r)}),Object.entries(xhi).forEach(([i,r])=>e.directive(i.split("BIMData")[1],r))}}),Mhi={name:"LiWrapper",render(){return Zr("li",this.$slots.default())}};function Phi(t,e){var i=new Set([]);return t.forEach(r=>{e.has(r)||i.add(r)}),i}const Ja=_o("id"),Ehi=({contextMenu:t,objects:e=[],state:i=t.$viewer.state,pictos:r})=>[{name:"selectAll",get group(){return t.groupPositions.select},position:1,get label(){return t.$t("context_menu.select_all")},get picto(){return r.get(this.name)},execute:()=>i.selectObjects(e.filter(fa(Ci("visible"),Hd("selected"))).map(Ja)),predicate:()=>e.some(fa(Ci("visible"),Hd("selected")))},{name:"deselectAll",get group(){return t.groupPositions.select},position:2,get label(){return t.$t("context_menu.deselect_all")},get picto(){return r.get(this.name)},execute:()=>i.deselectObjects(e.filter(Ci("selected")).map(Ja)),predicate:()=>e.some(Ci("selected"))},{name:"selectSimilar",get group(){return t.groupPositions.select},position:3,get label(){return t.$t("context_menu.select_similar")},get picto(){return r.get(this.name)},execute(){const n=e.filter(o=>o.visible&&o.type===this.selectedObject.type&&o.id!==this.selectedObject.id).map(Ja);i.selectObjects(n)},selectedObject:null,predicate(){const n=e.filter(fa(Ci("visible"),Ci("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(Ci("selected")).map(Ja)),o=new Set(e.filter(Ci("visible")).map(Ja));i.selectObjects(Array.from(Phi(o,n)),{exclusive:!0})},predicate:()=>e.some(fa(Hd("selected"),Ci("visible")))&&e.some(fa(Ci("selected"),Ci("visible")))},{name:"showAll",get group(){return t.groupPositions.visibility},position:1,get label(){return t.$t("context_menu.show_all")},get picto(){return r.get(this.name)},execute:()=>i.showObjects(e.filter(Hd("visible")).map(Ja)),predicate:()=>e.some(Hd("visible"))},{name:"hide",get group(){return t.groupPositions.visibility},position:2,get label(){return t.$t("context_menu.hide")},get picto(){return r.get(this.name)},objectsToHide:null,execute(){const n=this.objectsToHide.filter(Ci("selected"));n.length>0&&i.deselectObjects(n.map(Ja)),i.hideObjects(this.objectsToHide.map(Ja))},predicate(){return this.objectsToHide=e.filter(fa(Ci("selected"),Ci("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(Ci("visible"));n.some(Ci("selected"))&&i.deselectObjects(n.filter(Ci("selected")).map(Ja)),i.hideObjects(n.map(Ja))},predicate:()=>e.some(Ci("visible"))}].filter(n=>n.predicate()),Bhi={components:{LiWrapper:Mhi},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 r=new Map;return i&&this.$viewer.shortcutManager.getShortcuts(i).forEach(n=>r.set(n.name,n.key)),Ehi({contextMenu:this,objects:t,state:e,pictos:r})},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((r,n)=>(r.position=r.position||0,n.position=n.position||0,r.position-n.position)));const e=[...t.keys()].sort((i,r)=>i-r).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}}},Ihi={key:0,class:"separator"},Shi={class:"menu-text"},Thi={key:1,class:"menu-picto"},Dhi={key:0,class:"context-menu__spinner"};function Rhi(t,e,i,r,n,o){const s=S("BIMDataIconChevron"),a=S("LiWrapper"),l=S("BIMDataSpinner"),c=pi("click-away");return n.displayed&&(n.currentCommands.length||n.asyncPredicateRunning)?At((M(),_("ul",{key:0,class:"bimdata-list context-menu",style:se(o.position)},[(M(!0),_(ct,null,Bt(n.currentCommands,(d,u)=>(M(),Z(a,{key:d.label,class:"context-menu__element",onClick:h=>o.executeCommand(d)},{default:V(()=>[o.isGroupIntersection(u)?(M(),_("div",Ihi)):re("",!0),C("div",Shi,K(d.label),1),!d.component&&d.picto?(M(),_("span",Thi,K(d.picto),1)):d.component?(M(),Z(s,{key:2,size:"xxs",class:"fill-primary"})):re("",!0)]),_:2},1032,["onClick"]))),128)),n.asyncPredicateRunning?(M(),_("li",Dhi,[D(l)])):re("",!0)],4)),[[c,o.away]]):re("",!0)}const Lhi=z(Bhi,[["render",Rhi],["__scopeId","data-v-5b87d4a3"]]),Fhi={name:"ViewerHeader",inject:["$viewer"],props:{visible:{type:Boolean,default:!0}},setup(){const t=mt("$viewer"),e=zn(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)},r=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:et(()=>Array.from(e.values()).filter(n=>n.position==="right").sort((n,o)=>n.order-o.order).map(n=>n.component)),headerLeftContentComponents:et(()=>Array.from(e.values()).filter(n=>n.position==="left").sort((n,o)=>n.order-o.order).map(n=>n.component)),addContent:i,removeContent:r}}},_hi={class:"viewer-header"},Ohi={class:"viewer-header__content"},Uhi={class:"viewer-header__content__left"},Nhi={class:"viewer-header__content__right"},jhi={key:0,class:"m-l-6 flex items-center"},Vhi={key:1,class:"viewer-header__version"};function zhi(t,e,i,r,n,o){const s=S("BIMDataIllustration");return At((M(),_("div",_hi,[C("div",Ohi,[C("div",Uhi,[(M(!0),_(ct,null,Bt(r.headerLeftContentComponents,a=>(M(),Z(br(a),{key:a.name}))),128))]),C("div",Nhi,[(M(!0),_(ct,null,Bt(r.headerRightContentComponents,a=>(M(),Z(br(a),{key:a.name}))),128))])]),r.logo||r.version?(M(),_("div",jhi,[r.logo?(M(),Z(s,{key:0,name:"logo",width:"30px",height:"30px"})):re("",!0),r.version?(M(),_("div",Vhi,K(r.version),1)):re("",!0)])):re("",!0)],512)),[[Ht,i.visible]])}const Hhi=z(Fhi,[["render",zhi],["__scopeId","data-v-5c9ea6b6"]]),qhi={emits:["resize"],setup(t,{emit:e}){return{onResizerMousedown:i=>{i.preventDefault();let r=i.clientX;const n=s=>{s.preventDefault();const a=s.clientX-r;r=s.clientX,e("resize",a)},o=s=>{s.preventDefault(),window.removeEventListener("mousemove",n),window.removeEventListener("mouseup",o)};window.addEventListener("mousemove",n),window.addEventListener("mouseup",o)}}}},Ghi={class:"bimdata-separator"};function Qhi(t,e,i,r,n,o){return M(),_("div",Ghi,[e[1]||(e[1]=C("div",{class:"bimdata-separator__line"},null,-1)),C("div",{class:"bimdata-separator__resizer",onMousedown:e[0]||(e[0]=(...s)=>r.onResizerMousedown&&r.onResizerMousedown(...s))},null,32)])}const Khi=z(qhi,[["render",Qhi],["__scopeId","data-v-79a3b3af"]]),Zhi={components:{Separator:Khi},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=Ae(null),i=Ae(t.sidePanel.width??400),r=(n,o=1)=>{const s=i.value+n*o;i.value=Math.max(0,s)};return bt(()=>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:r}}},Whi={class:"bimdata-global-side-panel__component"};function Jhi(t,e,i,r,n,o){const s=S("Separator");return M(),_("div",{class:"bimdata-global-side-panel",style:se(`width: ${r.width}px`)},[i.sidePanel.resizable&&i.position==="right"?(M(),Z(s,{key:0,onResize:e[0]||(e[0]=a=>r.onResize(a,-1))})):re("",!0),C("div",Whi,[(M(),Z(br(i.sidePanel.component),{ref:"componentInstance"},null,512))]),i.sidePanel.resizable&&i.position==="left"?(M(),Z(s,{key:1,onResize:e[1]||(e[1]=a=>r.onResize(a))})):re("",!0)],4)}const Xhi=z(Zhi,[["render",Jhi],["__scopeId","data-v-82d0d4cb"]]),Yhi={name:"BimdataViewer",components:{ContextMenu:Lhi,ViewerHeader:Hhi,ModalManager:kde,GlobalSidePanel:Xhi},setup(){const t=mt("$viewer"),{globalContext:e,shortcutManager:i}=t;ar(()=>{i&&i.destroy(),e.hub.clear()}),Ei(()=>{t.pluginManager.runPluginsScripts(t)});const r=et(()=>{var f;return t.uiSettings.bimdataLogo!==!1&&(e.localContexts.length!==1||((f=e.localContexts[0].window)==null?void 0:f.logoAndVersion))}),n=et(()=>{var f;return t.uiSettings.version!==!1&&(e.localContexts.length!==1||(f=e.localContexts[0].window)!=null&&f.logoAndVersion)?t.version:null}),o=et(()=>e.leftSidePanel),s=et(()=>e.rightSidePanel),a=et(()=>{var f;const A=t.uiSettings.header!==!1,p=e.localContexts.length===1&&((f=e.localContexts[0].window)==null?void 0:f.header)===!1,g=!!(o.value||s.value);return A&&(!p||g)}),l=t.uiSettings.contextMenu!==!1,c=Ae(null);function d(f){l&&c.value.open(f)}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:a,viewerTemplateRef:e.templateRef,modalManagerTemplateRef:e.modalManagerTemplateRef,headerTemplateRef:e.headerTemplateRef,contextMenuTemplateRef:c,contextMenuEnabled:l,bimdataLogoOnSingleWindow:r,viewerVersionOnSingleWindow:n,version:t.version,loading:et(()=>e.loading),spinner:et(()=>e.spinner),leftSidePanel:o,rightSidePanel:s}}},$hi={key:1,class:"global-spinner",style:{"z-index":"3"}},epi={key:2,class:"viewer__logo"},tpi={key:1,class:"version m-t-6"};function ipi(t,e,i,r,n,o){const s=S("ModalManager"),a=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-scrollbar",onContextmenu:e[0]||(e[0]=(...h)=>r.onContextMenu&&r.onContextMenu(...h)),onMouseenter:e[1]||(e[1]=(...h)=>r.onMouseenter&&r.onMouseenter(...h)),onMouseleave:e[2]||(e[2]=(...h)=>r.onMouseleave&&r.onMouseleave(...h))},[D(s,{ref:"modalManagerTemplateRef"},null,512),r.contextMenuEnabled?(M(),Z(a,{key:0,ref:"contextMenuTemplateRef"},null,512)):re("",!0),D(l,{ref:"headerTemplateRef",visible:r.isHeaderVisible},null,8,["visible"]),C("div",{class:"bimdata-viewer__content",style:se(r.isHeaderVisible?"height: calc(100% - var(--bimdata-viewer-header-height, 40px))":"height: 100%")},[r.leftSidePanel?(M(),Z(c,{key:0,"side-panel":r.leftSidePanel,position:"left"},null,8,["side-panel"])):re("",!0),(M(),Z(br(r.Layout),{style:"height: 100%; flex-grow: 1;"})),r.rightSidePanel?(M(),Z(c,{key:1,"side-panel":r.rightSidePanel,position:"right"},null,8,["side-panel"])):re("",!0)],4),r.loading?(M(),_("div",$hi,[r.spinner&&r.spinner.component?(M(),Z(br(r.spinner.component),_s(xn({key:0},r.spinner.props)),null,16)):(M(),Z(d,{key:1,size:"40px",border:"5px"}))])):re("",!0),!r.isHeaderVisible&&(r.bimdataLogoOnSingleWindow||r.viewerVersionOnSingleWindow)?(M(),_("div",epi,[r.bimdataLogoOnSingleWindow?(M(),Z(u,{key:0,name:"logo"})):re("",!0),r.viewerVersionOnSingleWindow?(M(),_("div",tpi,K(r.version),1)):re("",!0)])):re("",!0)],544)}const rpi=z(Yhi,[["render",ipi]]),opi=["src"],npi={class:"bimdata-models__header"},spi={key:0,class:"bimdata-models__header__loader"},api={class:"bimdata-models__header__picto"},lpi={class:"bimdata-models__header__name"},cpi={key:0,class:"bimdata-models__header__name--empty"},dpi={key:1,class:"bimdata-models__header__name--empty"},upi={key:3},hpi=["onMousemove","onClick"],Ide={__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=mt("$viewer"),r=Ae(),n=Ae(0),o=Ae(0),s=Ae(),a=fr([]),l=Ae(!1),c=et(()=>i.localContext.loadedModels),d=et(()=>i.localContext.loadedModelIds),u=et(()=>i.localContext.loadingModelIds),h=et(()=>i.localContext.multiModel),f=et(()=>(e.customFilter?a.value.filter(e.customFilter):a.value).map(k=>c.value.find(P=>{var E;return((E=P.document)==null?void 0:E.head_id)!=null&&P.document.head_id===k.document.id})??k)),A=k=>d.value.includes(k),p=k=>u.value.includes(k),g=et(()=>{var k;const{x:P,y:E}=((k=s.value)==null?void 0:k.getBoundingClientRect())??{x:0,y:0};return`top:${o.value-E}px; left:${n.value-P}px;`}),m=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]))},w=k=>{switch(k){case"C":return"success";case"E":return"failed";case"P":case"I":return"sandglass"}},y=(k,P)=>{k!=null&&k.viewer_360_file&&(n.value=P.clientX,o.value=P.clientY),r.value=k?.viewer_360_file},v=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(P=>i.state.models.some(E=>E.archived)||!P.archived).sort(Hc("updated_at",!1))}catch(P){console.error("[Models] Cannot get project models. Error: ",P)}finally{l.value=!1}return[]},x=k=>{var P;return((P=k.children)==null?void 0:P.some(E=>A(E.id)))??!1};return v(i.localContext.modelTypes).then(k=>{a.value=k}),(k,P)=>{const E=S("BIMDataSpinner"),B=S("BIMDataIconModel3D"),I=S("BIMDataTextbox"),T=S("BIMDataCheckbox"),L=S("BIMDataRadio"),O=S("BIMDataIcon"),U=S("BIMDataDropdownList");return M(),_("div",{ref_key:"templateRef",ref:s,class:le(["bimdata-models",{"bimdata-models--window-positioning":t.windowPositioning}])},[r.value?(M(),_("div",{key:0,class:"bimdata-models__preview",style:se(g.value)},[C("img",{src:r.value},null,8,opi)],4)):re("",!0),D(U,{style:se(`--bimdata-models-width: ${t.width};`),width:t.width,list:f.value,"element-key":"id","per-page":40,loading:l.value,class:"bimdata-models__list",disabled:f.value.length===0,onElementClick:m},{header:V(({isOpen:H})=>[C("div",npi,[l.value||u.value.length>0?(M(),_("div",spi,[D(E)])):(M(),_(ct,{key:1},[C("div",api,[D(B)]),C("div",{class:le(["bimdata-models__header__number bimdata-info-length",{"bimdata-models__header__number--empty":d.value.length===0}])},[C("span",null,K(d.value.length),1)],2),C("div",lpi,[f.value.length===0?(M(),_("span",cpi,K(k.$t("model.no_model")),1)):d.value.length===0?(M(),_("span",dpi,K(k.$t("model.no_loaded_model")),1)):d.value.length===1?(M(),Z(I,{key:2,text:c.value[0].name,tooltip:!H},null,8,["text","tooltip"])):d.value.length>1?(M(),_("span",upi,K(k.$t("model.selected_models")),1)):re("",!0)])],64))])]),element:V(({element:H,close:N})=>[C("div",{class:"bimdata-models__model",onMousemove:W=>t.preview&&y(H,W),onMouseout:P[0]||(P[0]=W=>t.preview&&y()),onClick:()=>{!h.value&&!A(H.id)&&N()}},[h.value?(M(),Z(T,{key:0,"model-value":A(H.id)||x(H),disabled:H.status!=="C"||u.value.length>0},null,8,["model-value","disabled"])):(M(),Z(L,{key:1,"model-value":A(H.id)||x(H),disabled:H.status!=="C"||u.value.length>0},null,8,["model-value","disabled"])),D(O,{margin:"0 calc(var(--spacing-unit) / 2)",name:w(H.status),size:"xs",class:le({"fill-success":H.status==="C","fill-high":H.status==="E"})},null,8,["name","class"]),D(I,{class:le({"bimdata-models__model__name":!0,"bimdata-models__model__name--disabled":H.status!=="C"||u.value.length>0}),text:H.name,width:`calc(100% -
|
|
5480
|
+
`),onMouseenter:e[0]||(e[0]=(...h)=>r.onMouseEnter&&r.onMouseEnter(...h)),onMouseleave:e[1]||(e[1]=(...h)=>r.onMouseLeave&&r.onMouseLeave(...h))},[D(s,{ref:"modalManagerTemplateRef"},null,512),C("div",Bui,[r.windowPlugins.leftSidePanel?(M(),Z(a,{key:0,plugin:r.windowPlugins.leftSidePanel},null,8,["plugin"])):re("",!0),C("div",Iui,[(M(!0),_(ct,null,Bt(r.windowPlugins.free,h=>(M(),Z(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:r.windowPlugins.leftButtonColumn},null,8,["plugins"]),D(c,{position:"right",plugins:r.windowPlugins.rightButtonColumn},null,8,["plugins"])]),r.windowPlugins.rightSidePanel?(M(),Z(a,{key:1,plugin:r.windowPlugins.rightSidePanel},null,8,["plugin"])):re("",!0)]),r.loading?(M(),_("div",Sui,[r.spinner&&r.spinner.component?(M(),Z(br(r.spinner.component),_s(xn({key:0},r.spinner.props)),null,16)):(M(),Z(d,{key:1,size:"20px",border:"3px"}))])):re("",!0),r.layoutSettingsDisplayed?(M(),_("div",Tui,[D(u)])):re("",!0)],36)}const Rui=z(Eui,[["render",Dui]]);class Lui{constructor(e=!0){const i=xdi(YF,null,{resizable:e});i.registerContent("default",Rui),this.settings=zn({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?kdi(e):null}copy(e,i=!0){return Mdi(this.areas.layout,e,i)}open({ratio:e,direction:i,insertAfter:r,windowName:n=null,windowState:o=null,localContextId:s=null}={}){const a=n?{options:{windowName:n,windowState:o}}:null;return s===null?this.areas.splitLayout(e,i,r,a):this.areas.split(s,e,i,r,a)}swap(e,i){return this.areas.swap(e,i)}close(e){return this.areas.delete(e)}compare(e,i){var r,n;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((r=e.windowState)==null?void 0:r.modelIds),s=new Set((n=i.windowState)==null?void 0:n.modelIds);return o.size===s.size&&[...o].every(a=>s.has(a))}return e.windowName||i.windowName||e.direction!==i.direction||e.children.length!==i.children.length?!1:e.children.every((o,s)=>this.compare(o,i.children[s]))}}const Fui="2.8.0-beta.4",_ui={version:Fui};class Oui{constructor({plugins:e,api:i,ui:r,locale:n="fr"}){this.pluginManager=new Fsi(e),this.windowManager=new Osi,this.windowManager.registerAndAddPluginsToWindows([...this.pluginManager.registeredPlugins.values()]),this.api=new Mci(i),this.globalContext=new r2e(this),this.state=Vci(this),this.shortcutManager=jue(this.state),this.uiSettings=r||{},this.i18n=new t2e(n),this._contextMenu=null,this.layout=new Lui(this.uiSettings.resizable!==!1),this.localContext=null,window.$viewer=this}get version(){return _ui.version}get locale(){return this.i18n.locale}get contextMenu(){return this._contextMenu||Uue}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 Uui(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 Nui=Object.freeze({25:"GUEST",50:"USER",100:"ADMIN"}),L2=Object.freeze({READ:"read",WRITE:"write"});function Ede(t){const e={};return t.forEach(i=>{const[r,n]=i.split(":");e[r]?e[r].push(n):e[r]=[n]}),e}const jui={token_scopes:[],usable_scopes:[],user_role:25};function Bde(t=jui){var e,i,r,n,o,s;const a=Ede(t.token_scopes),l=Ede(t.usable_scopes);return{..._j(t),tokenScopes:a,usableScopes:l,userRole:Nui[t.user_role],user:t.user?_j(t.user):null,hasBcfReadPermission:((e=l.bcf)==null?void 0:e.includes(L2.READ))??!1,hasBcfWritePermission:((i=l.bcf)==null?void 0:i.includes(L2.WRITE))??!1,hasModelReadPermission:((r=l.model)==null?void 0:r.includes(L2.READ))??!1,hasModelWritePermission:((n=l.model)==null?void 0:n.includes(L2.WRITE))??!1,hasDocReadPermission:((o=l.document)==null?void 0:o.includes(L2.READ))??!1,hasDocWritePermission:((s=l.document)==null?void 0:s.includes(L2.WRITE))??!1}}const Vui={BcfFilters:{filtersButton:"Filter",filtersTitle:"Filter",priorityLabel:"Priorit\xE4t",statusLabel:"Status",assignedToLabel:"Zugewiesen an",creatorsLabel:"Erstellt von",tagsLabel:"Tags",resetButton:"Zur\xFCcksetzen",searchButton:"Suchen",undefined:"Nicht definiert",datePlaceholder:"Erstellungsdatum"},BcfSettings:{goBackButton:"Zur\xFCck",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"}}},zui={BcfComponents:Vui},Hui={BcfFilters:{filtersButton:"Filters",filtersTitle:"Filters",priorityLabel:"Priority",statusLabel:"Status",assignedToLabel:"Assigned to",creatorsLabel:"Created by",tagsLabel:"Tags",resetButton:"Reset",searchButton:"Search",undefined:"Not defined",datePlaceholder:"Creation date"},BcfSettings:{goBackButton:"Back",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"},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"},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"}}},qui={BcfComponents:Hui},Gui={BcfFilters:{filtersButton:"Filtros",filtersTitle:"Filtros",priorityLabel:"Prioridad",statusLabel:"Estado",assignedToLabel:"Asignado a",creatorsLabel:"Creado por",tagsLabel:"Etiquetas:",resetButton:"Restablecer",searchButton:"Buscar en",undefined:"No definido",datePlaceholder:"Fecha de creaci\xF3n"},BcfSettings:{goBackButton:"Volver",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"}}},Qui={BcfComponents:Gui},Kui={BcfFilters:{filtersButton:"Filtres",filtersTitle:"Filtres",priorityLabel:"Priorit\xE9",statusLabel:"Statut",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:{goBackButton:"Retour",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"},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"},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"}}},Zui={BcfComponents:Kui},Wui={BcfFilters:{filtersButton:"Filtri",filtersTitle:"Filtri",priorityLabel:"Priorit\xE0",statusLabel:"Stato",datePlaceholder:"Data di creazione",assignedToLabel:"Assegnato a",creatorsLabel:"Creato da",tagsLabel:"Etichette",resetButton:"Ripristina",searchButton:"Cerca",undefined:"Non definito"},BcfSettings:{goBackButton:"Indietro",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"}}},Jui={BcfComponents:Wui},Xui={de:zui,en:qui,es:Qui,fr:Zui,it:Jui},Yui=({apiClient:t,fetchUsers:e,i18nPlugin:i}={})=>({install(r){t?Yi.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(Xui).forEach(([n,o])=>{i.global.mergeLocaleMessage(n,o)}):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(x4e).forEach(([n,o])=>{r.component(n,o)})}}),$ui={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"}},ehi={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"},thi={BuildingMaker:$ui,FileManager:ehi},ihi={t:{back:"Back",cancel:"Cancel",create:"Create",delete:"Delete",download:"Download",finish:"Finish",rename:"Rename",search:"Search",see:"View",storey:"Storey",validate:"Validate"}},rhi={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"}},ohi={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"},nhi={title:"Meta-Building Structure",tab:{structure:"Structure",zones:"Zones",equipments:"Equipments"},StoreySelector:{placeholder:"Select a storey"}},shi={title:"Photosphere Building"},ahi={BIMDataComponents:ihi,BuildingMaker:rhi,FileManager:ohi,MetaBuildingStructure:nhi,PhotosphereBuilding:shi},lhi={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"}},chi={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"},dhi={BuildingMaker:lhi,FileManager:chi},uhi={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"}},hhi={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"}},phi={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"},fhi={title:"Structure M\xE9ta-Building",tab:{structure:"Structure",zones:"Zones",equipments:"\xC9quipements"},StoreySelector:{placeholder:"S\xE9lectionner un \xE9tage"}},Ahi={title:"Photosph\xE8re Building"},mhi={BIMDataComponents:uhi,BuildingMaker:hhi,FileManager:phi,MetaBuildingStructure:fhi,PhotosphereBuilding:Ahi},ghi={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"}},vhi={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"},yhi={BuildingMaker:ghi,FileManager:vhi},bhi={de:thi,en:ahi,es:dhi,fr:mhi,it:yhi},whi=({i18nPlugin:t}={})=>({install(e){t?Object.entries(bhi).forEach(([i,r])=>{t.global.mergeLocaleMessage(i,r)}):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(nHt).forEach(([i,r])=>{e.component(i,r)})}}),Chi={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(r=>r===t)||e.value()},window.addEventListener("mousedown",t.clickAwayHandler,!0)},unmounted(t){window.removeEventListener("mousedown",t.clickAwayHandler,!0),delete t.clickAwayHandler}},xhi=Object.freeze(Object.defineProperty({__proto__:null,BIMDataClickAway:Ca,BIMDataClickInputAway:Chi},Symbol.toStringTag,{value:"Module"})),khi=t=>({install(e){Object.entries(pGe).forEach(([i,r])=>{e.component(i,r)}),Object.entries(xhi).forEach(([i,r])=>e.directive(i.split("BIMData")[1],r))}}),Mhi={name:"LiWrapper",render(){return Zr("li",this.$slots.default())}};function Phi(t,e){var i=new Set([]);return t.forEach(r=>{e.has(r)||i.add(r)}),i}const Ja=_o("id"),Ehi=({contextMenu:t,objects:e=[],state:i=t.$viewer.state,pictos:r})=>[{name:"selectAll",get group(){return t.groupPositions.select},position:1,get label(){return t.$t("context_menu.select_all")},get picto(){return r.get(this.name)},execute:()=>i.selectObjects(e.filter(fa(Ci("visible"),Hd("selected"))).map(Ja)),predicate:()=>e.some(fa(Ci("visible"),Hd("selected")))},{name:"deselectAll",get group(){return t.groupPositions.select},position:2,get label(){return t.$t("context_menu.deselect_all")},get picto(){return r.get(this.name)},execute:()=>i.deselectObjects(e.filter(Ci("selected")).map(Ja)),predicate:()=>e.some(Ci("selected"))},{name:"selectSimilar",get group(){return t.groupPositions.select},position:3,get label(){return t.$t("context_menu.select_similar")},get picto(){return r.get(this.name)},execute(){const n=e.filter(o=>o.visible&&o.type===this.selectedObject.type&&o.id!==this.selectedObject.id).map(Ja);i.selectObjects(n)},selectedObject:null,predicate(){const n=e.filter(fa(Ci("visible"),Ci("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(Ci("selected")).map(Ja)),o=new Set(e.filter(Ci("visible")).map(Ja));i.selectObjects(Array.from(Phi(o,n)),{exclusive:!0})},predicate:()=>e.some(fa(Hd("selected"),Ci("visible")))&&e.some(fa(Ci("selected"),Ci("visible")))},{name:"showAll",get group(){return t.groupPositions.visibility},position:1,get label(){return t.$t("context_menu.show_all")},get picto(){return r.get(this.name)},execute:()=>i.showObjects(e.filter(Hd("visible")).map(Ja)),predicate:()=>e.some(Hd("visible"))},{name:"hide",get group(){return t.groupPositions.visibility},position:2,get label(){return t.$t("context_menu.hide")},get picto(){return r.get(this.name)},objectsToHide:null,execute(){const n=this.objectsToHide.filter(Ci("selected"));n.length>0&&i.deselectObjects(n.map(Ja)),i.hideObjects(this.objectsToHide.map(Ja))},predicate(){return this.objectsToHide=e.filter(fa(Ci("selected"),Ci("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(Ci("visible"));n.some(Ci("selected"))&&i.deselectObjects(n.filter(Ci("selected")).map(Ja)),i.hideObjects(n.map(Ja))},predicate:()=>e.some(Ci("visible"))}].filter(n=>n.predicate()),Bhi={components:{LiWrapper:Mhi},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 r=new Map;return i&&this.$viewer.shortcutManager.getShortcuts(i).forEach(n=>r.set(n.name,n.key)),Ehi({contextMenu:this,objects:t,state:e,pictos:r})},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((r,n)=>(r.position=r.position||0,n.position=n.position||0,r.position-n.position)));const e=[...t.keys()].sort((i,r)=>i-r).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}}},Ihi={key:0,class:"separator"},Shi={class:"menu-text"},Thi={key:1,class:"menu-picto"},Dhi={key:0,class:"context-menu__spinner"};function Rhi(t,e,i,r,n,o){const s=S("BIMDataIconChevron"),a=S("LiWrapper"),l=S("BIMDataSpinner"),c=pi("click-away");return n.displayed&&(n.currentCommands.length||n.asyncPredicateRunning)?At((M(),_("ul",{key:0,class:"bimdata-list context-menu",style:se(o.position)},[(M(!0),_(ct,null,Bt(n.currentCommands,(d,u)=>(M(),Z(a,{key:d.label,class:"context-menu__element",onClick:h=>o.executeCommand(d)},{default:V(()=>[o.isGroupIntersection(u)?(M(),_("div",Ihi)):re("",!0),C("div",Shi,K(d.label),1),!d.component&&d.picto?(M(),_("span",Thi,K(d.picto),1)):d.component?(M(),Z(s,{key:2,size:"xxs",class:"fill-primary"})):re("",!0)]),_:2},1032,["onClick"]))),128)),n.asyncPredicateRunning?(M(),_("li",Dhi,[D(l)])):re("",!0)],4)),[[c,o.away]]):re("",!0)}const Lhi=z(Bhi,[["render",Rhi],["__scopeId","data-v-5b87d4a3"]]),Fhi={name:"ViewerHeader",inject:["$viewer"],props:{visible:{type:Boolean,default:!0}},setup(){const t=mt("$viewer"),e=zn(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)},r=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:et(()=>Array.from(e.values()).filter(n=>n.position==="right").sort((n,o)=>n.order-o.order).map(n=>n.component)),headerLeftContentComponents:et(()=>Array.from(e.values()).filter(n=>n.position==="left").sort((n,o)=>n.order-o.order).map(n=>n.component)),addContent:i,removeContent:r}}},_hi={class:"viewer-header"},Ohi={class:"viewer-header__content"},Uhi={class:"viewer-header__content__left"},Nhi={class:"viewer-header__content__right"},jhi={key:0,class:"m-l-6 flex items-center"},Vhi={key:1,class:"viewer-header__version"};function zhi(t,e,i,r,n,o){const s=S("BIMDataIllustration");return At((M(),_("div",_hi,[C("div",Ohi,[C("div",Uhi,[(M(!0),_(ct,null,Bt(r.headerLeftContentComponents,a=>(M(),Z(br(a),{key:a.name}))),128))]),C("div",Nhi,[(M(!0),_(ct,null,Bt(r.headerRightContentComponents,a=>(M(),Z(br(a),{key:a.name}))),128))])]),r.logo||r.version?(M(),_("div",jhi,[r.logo?(M(),Z(s,{key:0,name:"logo",width:"30px",height:"30px"})):re("",!0),r.version?(M(),_("div",Vhi,K(r.version),1)):re("",!0)])):re("",!0)],512)),[[Ht,i.visible]])}const Hhi=z(Fhi,[["render",zhi],["__scopeId","data-v-5c9ea6b6"]]),qhi={emits:["resize"],setup(t,{emit:e}){return{onResizerMousedown:i=>{i.preventDefault();let r=i.clientX;const n=s=>{s.preventDefault();const a=s.clientX-r;r=s.clientX,e("resize",a)},o=s=>{s.preventDefault(),window.removeEventListener("mousemove",n),window.removeEventListener("mouseup",o)};window.addEventListener("mousemove",n),window.addEventListener("mouseup",o)}}}},Ghi={class:"bimdata-separator"};function Qhi(t,e,i,r,n,o){return M(),_("div",Ghi,[e[1]||(e[1]=C("div",{class:"bimdata-separator__line"},null,-1)),C("div",{class:"bimdata-separator__resizer",onMousedown:e[0]||(e[0]=(...s)=>r.onResizerMousedown&&r.onResizerMousedown(...s))},null,32)])}const Khi=z(qhi,[["render",Qhi],["__scopeId","data-v-79a3b3af"]]),Zhi={components:{Separator:Khi},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=Ae(null),i=Ae(t.sidePanel.width??400),r=(n,o=1)=>{const s=i.value+n*o;i.value=Math.max(0,s)};return bt(()=>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:r}}},Whi={class:"bimdata-global-side-panel__component"};function Jhi(t,e,i,r,n,o){const s=S("Separator");return M(),_("div",{class:"bimdata-global-side-panel",style:se(`width: ${r.width}px`)},[i.sidePanel.resizable&&i.position==="right"?(M(),Z(s,{key:0,onResize:e[0]||(e[0]=a=>r.onResize(a,-1))})):re("",!0),C("div",Whi,[(M(),Z(br(i.sidePanel.component),{ref:"componentInstance"},null,512))]),i.sidePanel.resizable&&i.position==="left"?(M(),Z(s,{key:1,onResize:e[1]||(e[1]=a=>r.onResize(a))})):re("",!0)],4)}const Xhi=z(Zhi,[["render",Jhi],["__scopeId","data-v-82d0d4cb"]]),Yhi={name:"BimdataViewer",components:{ContextMenu:Lhi,ViewerHeader:Hhi,ModalManager:kde,GlobalSidePanel:Xhi},setup(){const t=mt("$viewer"),{globalContext:e,shortcutManager:i}=t;ar(()=>{i&&i.destroy(),e.hub.clear()}),Ei(()=>{t.pluginManager.runPluginsScripts(t)});const r=et(()=>{var f;return t.uiSettings.bimdataLogo!==!1&&(e.localContexts.length!==1||((f=e.localContexts[0].window)==null?void 0:f.logoAndVersion))}),n=et(()=>{var f;return t.uiSettings.version!==!1&&(e.localContexts.length!==1||(f=e.localContexts[0].window)!=null&&f.logoAndVersion)?t.version:null}),o=et(()=>e.leftSidePanel),s=et(()=>e.rightSidePanel),a=et(()=>{var f;const A=t.uiSettings.header!==!1,p=e.localContexts.length===1&&((f=e.localContexts[0].window)==null?void 0:f.header)===!1,g=!!(o.value||s.value);return A&&(!p||g)}),l=t.uiSettings.contextMenu!==!1,c=Ae(null);function d(f){l&&c.value.open(f)}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:a,viewerTemplateRef:e.templateRef,modalManagerTemplateRef:e.modalManagerTemplateRef,headerTemplateRef:e.headerTemplateRef,contextMenuTemplateRef:c,contextMenuEnabled:l,bimdataLogoOnSingleWindow:r,viewerVersionOnSingleWindow:n,version:t.version,loading:et(()=>e.loading),spinner:et(()=>e.spinner),leftSidePanel:o,rightSidePanel:s}}},$hi={key:1,class:"global-spinner",style:{"z-index":"3"}},epi={key:2,class:"viewer__logo"},tpi={key:1,class:"version m-t-6"};function ipi(t,e,i,r,n,o){const s=S("ModalManager"),a=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-scrollbar",onContextmenu:e[0]||(e[0]=(...h)=>r.onContextMenu&&r.onContextMenu(...h)),onMouseenter:e[1]||(e[1]=(...h)=>r.onMouseenter&&r.onMouseenter(...h)),onMouseleave:e[2]||(e[2]=(...h)=>r.onMouseleave&&r.onMouseleave(...h))},[D(s,{ref:"modalManagerTemplateRef"},null,512),r.contextMenuEnabled?(M(),Z(a,{key:0,ref:"contextMenuTemplateRef"},null,512)):re("",!0),D(l,{ref:"headerTemplateRef",visible:r.isHeaderVisible},null,8,["visible"]),C("div",{class:"bimdata-viewer__content",style:se(r.isHeaderVisible?"height: calc(100% - var(--bimdata-viewer-header-height, 40px))":"height: 100%")},[r.leftSidePanel?(M(),Z(c,{key:0,"side-panel":r.leftSidePanel,position:"left"},null,8,["side-panel"])):re("",!0),(M(),Z(br(r.Layout),{style:"height: 100%; flex-grow: 1;"})),r.rightSidePanel?(M(),Z(c,{key:1,"side-panel":r.rightSidePanel,position:"right"},null,8,["side-panel"])):re("",!0)],4),r.loading?(M(),_("div",$hi,[r.spinner&&r.spinner.component?(M(),Z(br(r.spinner.component),_s(xn({key:0},r.spinner.props)),null,16)):(M(),Z(d,{key:1,size:"40px",border:"5px"}))])):re("",!0),!r.isHeaderVisible&&(r.bimdataLogoOnSingleWindow||r.viewerVersionOnSingleWindow)?(M(),_("div",epi,[r.bimdataLogoOnSingleWindow?(M(),Z(u,{key:0,name:"logo"})):re("",!0),r.viewerVersionOnSingleWindow?(M(),_("div",tpi,K(r.version),1)):re("",!0)])):re("",!0)],544)}const rpi=z(Yhi,[["render",ipi]]),opi=["src"],npi={class:"bimdata-models__header"},spi={key:0,class:"bimdata-models__header__loader"},api={class:"bimdata-models__header__picto"},lpi={class:"bimdata-models__header__name"},cpi={key:0,class:"bimdata-models__header__name--empty"},dpi={key:1,class:"bimdata-models__header__name--empty"},upi={key:3},hpi=["onMousemove","onClick"],Ide={__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=mt("$viewer"),r=Ae(),n=Ae(0),o=Ae(0),s=Ae(),a=fr([]),l=Ae(!1),c=et(()=>i.localContext.loadedModels),d=et(()=>i.localContext.loadedModelIds),u=et(()=>i.localContext.loadingModelIds),h=et(()=>i.localContext.multiModel),f=et(()=>(e.customFilter?a.value.filter(e.customFilter):a.value).map(k=>c.value.find(P=>{var E;return((E=P.document)==null?void 0:E.head_id)!=null&&P.document.head_id===k.document.id})??k)),A=k=>d.value.includes(k),p=k=>u.value.includes(k),g=et(()=>{var k;const{x:P,y:E}=((k=s.value)==null?void 0:k.getBoundingClientRect())??{x:0,y:0};return`top:${o.value-E}px; left:${n.value-P}px;`}),m=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]))},w=k=>{switch(k){case"C":return"success";case"E":return"failed";case"P":case"I":return"sandglass"}},y=(k,P)=>{k!=null&&k.viewer_360_file&&(n.value=P.clientX,o.value=P.clientY),r.value=k?.viewer_360_file},v=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(P=>i.state.models.some(E=>E.archived)||!P.archived).sort(Hc("updated_at",!1))}catch(P){console.error("[Models] Cannot get project models. Error: ",P)}finally{l.value=!1}return[]},x=k=>{var P;return((P=k.children)==null?void 0:P.some(E=>A(E.id)))??!1};return v(i.localContext.modelTypes).then(k=>{a.value=k}),(k,P)=>{const E=S("BIMDataSpinner"),B=S("BIMDataIconModel3D"),I=S("BIMDataTextbox"),T=S("BIMDataCheckbox"),L=S("BIMDataRadio"),O=S("BIMDataIcon"),U=S("BIMDataDropdownList");return M(),_("div",{ref_key:"templateRef",ref:s,class:le(["bimdata-models",{"bimdata-models--window-positioning":t.windowPositioning}])},[r.value?(M(),_("div",{key:0,class:"bimdata-models__preview",style:se(g.value)},[C("img",{src:r.value},null,8,opi)],4)):re("",!0),D(U,{style:se(`--bimdata-models-width: ${t.width};`),width:t.width,list:f.value,"element-key":"id","per-page":40,loading:l.value,class:"bimdata-models__list",disabled:f.value.length===0,onElementClick:m},{header:V(({isOpen:H})=>[C("div",npi,[l.value||u.value.length>0?(M(),_("div",spi,[D(E)])):(M(),_(ct,{key:1},[C("div",api,[D(B)]),C("div",{class:le(["bimdata-models__header__number bimdata-info-length",{"bimdata-models__header__number--empty":d.value.length===0}])},[C("span",null,K(d.value.length),1)],2),C("div",lpi,[f.value.length===0?(M(),_("span",cpi,K(k.$t("model.no_model")),1)):d.value.length===0?(M(),_("span",dpi,K(k.$t("model.no_loaded_model")),1)):d.value.length===1?(M(),Z(I,{key:2,text:c.value[0].name,tooltip:!H},null,8,["text","tooltip"])):d.value.length>1?(M(),_("span",upi,K(k.$t("model.selected_models")),1)):re("",!0)])],64))])]),element:V(({element:H,close:N})=>[C("div",{class:"bimdata-models__model",onMousemove:W=>t.preview&&y(H,W),onMouseout:P[0]||(P[0]=W=>t.preview&&y()),onClick:()=>{!h.value&&!A(H.id)&&N()}},[h.value?(M(),Z(T,{key:0,"model-value":A(H.id)||x(H),disabled:H.status!=="C"||u.value.length>0},null,8,["model-value","disabled"])):(M(),Z(L,{key:1,"model-value":A(H.id)||x(H),disabled:H.status!=="C"||u.value.length>0},null,8,["model-value","disabled"])),D(O,{margin:"0 calc(var(--spacing-unit) / 2)",name:w(H.status),size:"xs",class:le({"fill-success":H.status==="C","fill-high":H.status==="E"})},null,8,["name","class"]),D(I,{class:le({"bimdata-models__model__name":!0,"bimdata-models__model__name--disabled":H.status!=="C"||u.value.length>0}),text:H.name,width:`calc(100% -
|
|
5481
5481
|
${h.value?13:23}px - 2 * 6px - 16px)`},null,8,["class","text","width"]),H.document&&!H.document.is_head_version?(M(),Z(O,{key:2,name:"versioning",fill:"",color:"default",size:"xs",margin:"0 0 0 6px"})):re("",!0)],40,hpi),p(H.id)?(M(),Z(E,{key:0,class:"bimdata-models__model__spinner"})):re("",!0)]),_:1},8,["style","width","list","loading","disabled"])],2)}}},ppi={data(){return{shown:!1}},mounted(){setTimeout(()=>{this.shown=!0},500)}};function fpi(t,e,i,r,n,o){const s=S("BIMDataIllustration");return M(),_("div",{class:"bimdata__no-model",style:se({"--no-model--opacity":n.shown?1:0})},[D(s,{name:"emptyViewer",x:"90",y:"90"}),C("span",null,K(t.$t("model.select_model")),1)],4)}const Sde=z(ppi,[["render",fpi],["__scopeId","data-v-5ffd9bc0"]]);window.BIMDataViewerVue=YF;class Api{constructor(e={}){var i,r;const{api:n={},ui:o}=e;this.uiCfg=o,n.apiUrl||(console.info("[BIMData Viewer] INFO - Viewer config - `apiUrl` not set, use 'https://api.bimdata.io' by default."),n.apiUrl="https://api.bimdata.io"),n.archiveUrl||(console.info("[BIMData Viewer] INFO - Viewer config - `archiveUrl` not set, use 'https://archive.bimdata.io' by default."),n.archiveUrl="https://archive.bimdata.io"),n.pdfBackendUrl||(console.info("[BIMData Viewer] INFO - Viewer config - `pdfBackendUrl` not set, use 'https://pdf-backend.bimdata.io' by default."),n.pdfBackendUrl="https://pdf-backend.bimdata.io"),n.ifcIds&&(console.warn("[BIMData Viewer] DEPRECATED - Viewer config - please use the `modelIds` property instead of `ifcIds`."),n.modelIds===void 0&&(n.modelIds=n.ifcIds)),n.modelIds||(n.modelIds=[]),(i=n.offline)!=null&&i.dataFile&&(n.offline.data=n.offline.dataFile),this.$viewer=new Oui(e),(r=n.offline)!=null&&r.enabled?this.$viewer.api.enableOfflineMode(n.offline.data,n.offline.options).then(()=>this.state.loadModels(n.modelIds)):(this.$viewer.globalContext.loadingProcessStart(),this.state.loadModels(n.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"){var r;const{$viewer:n}=this;await n.api.ready;try{const u=await n.api.apiClient.collaborationApi.checkProjectAccess(n.api.cloudId,n.api.projectId);n.api.permissions=Bde(u)}catch{n.api.permissions=Bde()}const o=this.api.accessToken,{i18n:s}=n;s.registerTranslations(n.pluginManager.pluginTranslations),n.layout.apply(i);const a={i18n:s.i18nVuePlugin,data(){return{accessToken:o}},render(){return Zr(rpi,{style:"height: 100%"})}},l=w4(a).use(s.i18nVuePlugin).use(khi()).use(whi({i18nPlugin:s.i18nVuePlugin})).use(Yui({apiClient:n.api.apiClient,i18nPlugin:s.i18nVuePlugin}));l.provide("$viewer",n),l.component("BIMDataModelLoader",Ide),l.component("BIMDataNoModelWindowPlaceHolder",Sde),l.component("BIMDataStoreySelector",Dk),l.component("ModelsLoader",Ide),l.component("NoModelWindowPlaceHolder",Sde);const c=e instanceof HTMLElement?e:document.querySelector(e);c&&(c.style.height="100%");const d=l.mount(e);return d.$viewer=n,Uui(d.$el,(r=this.uiCfg)==null?void 0:r.style),typeof window<"u"&&(window.bimdataViewer=d),this.vueApp=l,d}destroy(){var e;(e=this.vueApp)==null||e.unmount()}setLocale(e){if(!f_.includes(e))throw new Error(`Viewer available locales are ${f_.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 Tde=(t={})=>new Api(t);window.makeBIMDataViewer=Tde;export{Tde as default};
|