diff --git a/examples/AngleMeasurement/index.html b/examples/AngleMeasurement/index.html index 202f04b74..66368a7e3 100644 --- a/examples/AngleMeasurement/index.html +++ b/examples/AngleMeasurement/index.html @@ -58,9 +58,9 @@ - - - + + + diff --git a/examples/AreaMeasurement/index.html b/examples/AreaMeasurement/index.html index 70e0bd341..c1febedc3 100644 --- a/examples/AreaMeasurement/index.html +++ b/examples/AreaMeasurement/index.html @@ -58,11 +58,11 @@ - + - - + + diff --git a/examples/BCFTopics/index.html b/examples/BCFTopics/index.html index 08da11da9..e9ac34907 100644 --- a/examples/BCFTopics/index.html +++ b/examples/BCFTopics/index.html @@ -40,10 +40,11 @@ } - + - + + diff --git a/examples/BoundingBoxer/index.html b/examples/BoundingBoxer/index.html index 87f160757..4ab3e0f87 100644 --- a/examples/BoundingBoxer/index.html +++ b/examples/BoundingBoxer/index.html @@ -58,11 +58,11 @@ - + - + diff --git a/examples/Civil3DNavigator/index.html b/examples/Civil3DNavigator/index.html index c17fac9a6..568d4958b 100644 --- a/examples/Civil3DNavigator/index.html +++ b/examples/Civil3DNavigator/index.html @@ -58,11 +58,11 @@ - - + + - + diff --git a/examples/CivilCrossSectionNavigator/index.html b/examples/CivilCrossSectionNavigator/index.html index cc7926cf4..6a69834c7 100644 --- a/examples/CivilCrossSectionNavigator/index.html +++ b/examples/CivilCrossSectionNavigator/index.html @@ -76,11 +76,11 @@ - - + + - - + + diff --git a/examples/CivilElevationNavigator/index.html b/examples/CivilElevationNavigator/index.html index 001243047..5424a8a31 100644 --- a/examples/CivilElevationNavigator/index.html +++ b/examples/CivilElevationNavigator/index.html @@ -77,11 +77,11 @@ - - - + + + - + diff --git a/examples/CivilPlanNavigator/index.html b/examples/CivilPlanNavigator/index.html index 684d4a5bf..3a75ef028 100644 --- a/examples/CivilPlanNavigator/index.html +++ b/examples/CivilPlanNavigator/index.html @@ -66,11 +66,11 @@ - - - + + + - + diff --git a/examples/Classifier/index.html b/examples/Classifier/index.html index e284958cf..4f1b4f37a 100644 --- a/examples/Classifier/index.html +++ b/examples/Classifier/index.html @@ -58,11 +58,11 @@ - + - + diff --git a/examples/ClipEdges/index.html b/examples/ClipEdges/index.html index 103787ef9..028fba07d 100644 --- a/examples/ClipEdges/index.html +++ b/examples/ClipEdges/index.html @@ -58,12 +58,12 @@ - + - - + + diff --git a/examples/Clipper/index.html b/examples/Clipper/index.html index 7e8b3be86..f4a9d4dbe 100644 --- a/examples/Clipper/index.html +++ b/examples/Clipper/index.html @@ -58,11 +58,11 @@ - + - + diff --git a/examples/Cullers/index.html b/examples/Cullers/index.html index b6fe55a30..decb4eeaf 100644 --- a/examples/Cullers/index.html +++ b/examples/Cullers/index.html @@ -58,10 +58,10 @@ - + - + diff --git a/examples/EdgeMeasurement/index.html b/examples/EdgeMeasurement/index.html index f4ea1bdcf..b04ec9363 100644 --- a/examples/EdgeMeasurement/index.html +++ b/examples/EdgeMeasurement/index.html @@ -58,11 +58,11 @@ - + - - + + diff --git a/examples/Exploder/index.html b/examples/Exploder/index.html index a5e61ddc3..78129c22f 100644 --- a/examples/Exploder/index.html +++ b/examples/Exploder/index.html @@ -58,11 +58,11 @@ - + - + diff --git a/examples/FaceMeasurement/index.html b/examples/FaceMeasurement/index.html index 4cef65ae3..44d95b078 100644 --- a/examples/FaceMeasurement/index.html +++ b/examples/FaceMeasurement/index.html @@ -58,11 +58,11 @@ - + - - + + diff --git a/examples/FragmentsManager/index.html b/examples/FragmentsManager/index.html index b371112a9..8fc781f3f 100644 --- a/examples/FragmentsManager/index.html +++ b/examples/FragmentsManager/index.html @@ -58,10 +58,10 @@ - + - + diff --git a/examples/Grids/index.html b/examples/Grids/index.html index 8dc20e971..8462fccee 100644 --- a/examples/Grids/index.html +++ b/examples/Grids/index.html @@ -64,8 +64,8 @@ - - + + diff --git a/examples/Hider/index.html b/examples/Hider/index.html index 9d694804e..f36ece94b 100644 --- a/examples/Hider/index.html +++ b/examples/Hider/index.html @@ -58,11 +58,11 @@ - + - + diff --git a/examples/Highlighter/index.html b/examples/Highlighter/index.html index 670b04905..c71e0ba13 100644 --- a/examples/Highlighter/index.html +++ b/examples/Highlighter/index.html @@ -58,9 +58,9 @@ - - - + + + diff --git a/examples/IfcGeometryTiler/index.html b/examples/IfcGeometryTiler/index.html index a45ba0b8b..8376c54f0 100644 --- a/examples/IfcGeometryTiler/index.html +++ b/examples/IfcGeometryTiler/index.html @@ -58,11 +58,11 @@ - + - + diff --git a/examples/IfcJsonExporter/index.html b/examples/IfcJsonExporter/index.html index 64b2647ba..7f9f66853 100644 --- a/examples/IfcJsonExporter/index.html +++ b/examples/IfcJsonExporter/index.html @@ -58,11 +58,11 @@ - + - + diff --git a/examples/IfcLoader/index.html b/examples/IfcLoader/index.html index f0576983f..bc2690d2d 100644 --- a/examples/IfcLoader/index.html +++ b/examples/IfcLoader/index.html @@ -58,11 +58,11 @@ - + - + diff --git a/examples/IfcPropertiesManager/index.html b/examples/IfcPropertiesManager/index.html index 294299a42..38b5d3acb 100644 --- a/examples/IfcPropertiesManager/index.html +++ b/examples/IfcPropertiesManager/index.html @@ -6,9 +6,9 @@ Ifc Properties Manager - + - + diff --git a/examples/IfcPropertiesTiler/index.html b/examples/IfcPropertiesTiler/index.html index 3735b0d01..72fa24d67 100644 --- a/examples/IfcPropertiesTiler/index.html +++ b/examples/IfcPropertiesTiler/index.html @@ -58,11 +58,11 @@ - + - + diff --git a/examples/IfcRelationsIndexer/index.html b/examples/IfcRelationsIndexer/index.html index 77919fa71..94677deec 100644 --- a/examples/IfcRelationsIndexer/index.html +++ b/examples/IfcRelationsIndexer/index.html @@ -58,11 +58,12 @@ - + - + + diff --git a/examples/IfcStreamer/index.html b/examples/IfcStreamer/index.html index 9ec8cc719..399ef183d 100644 --- a/examples/IfcStreamer/index.html +++ b/examples/IfcStreamer/index.html @@ -58,11 +58,11 @@ - + - - + + diff --git a/examples/LengthMeasurement/index.html b/examples/LengthMeasurement/index.html index b3b57c997..b836f7d3c 100644 --- a/examples/LengthMeasurement/index.html +++ b/examples/LengthMeasurement/index.html @@ -58,12 +58,12 @@ - + - + - + diff --git a/examples/Marker/index.html b/examples/Marker/index.html index c0c11522f..cb1b0cbec 100644 --- a/examples/Marker/index.html +++ b/examples/Marker/index.html @@ -58,9 +58,9 @@ - - - + + + diff --git a/examples/MeasurementUtils/index.html b/examples/MeasurementUtils/index.html index 848054247..526dceeda 100644 --- a/examples/MeasurementUtils/index.html +++ b/examples/MeasurementUtils/index.html @@ -58,10 +58,10 @@ - + - + diff --git a/examples/MiniMap/index.html b/examples/MiniMap/index.html index b1666cc82..af925142f 100644 --- a/examples/MiniMap/index.html +++ b/examples/MiniMap/index.html @@ -64,11 +64,11 @@ - + - + diff --git a/examples/OrthoPerspectiveCamera/index.html b/examples/OrthoPerspectiveCamera/index.html index c18987e49..9ad422359 100644 --- a/examples/OrthoPerspectiveCamera/index.html +++ b/examples/OrthoPerspectiveCamera/index.html @@ -58,11 +58,11 @@ - + - + diff --git a/examples/Plans/index.html b/examples/Plans/index.html index 1ae0ae098..d9e1d4c17 100644 --- a/examples/Plans/index.html +++ b/examples/Plans/index.html @@ -58,9 +58,9 @@ - - - + + + diff --git a/examples/PostproductionRenderer/index.html b/examples/PostproductionRenderer/index.html index 0c256a5a9..f1b791af0 100644 --- a/examples/PostproductionRenderer/index.html +++ b/examples/PostproductionRenderer/index.html @@ -58,12 +58,12 @@ - + - - + + diff --git a/examples/Raycasters/index.html b/examples/Raycasters/index.html index 29699ed6c..86cd2f1dd 100644 --- a/examples/Raycasters/index.html +++ b/examples/Raycasters/index.html @@ -58,10 +58,10 @@ - + - + diff --git a/examples/Sections/index.html b/examples/Sections/index.html index 3f619f779..d46577b18 100644 --- a/examples/Sections/index.html +++ b/examples/Sections/index.html @@ -58,12 +58,12 @@ - - + + - + diff --git a/examples/ShadowDropper/index.html b/examples/ShadowDropper/index.html index 0457e4bb9..e46c5e89c 100644 --- a/examples/ShadowDropper/index.html +++ b/examples/ShadowDropper/index.html @@ -58,12 +58,12 @@ - - + + - + diff --git a/examples/ShadowedScene/index.html b/examples/ShadowedScene/index.html index 33470d1e1..73201da6b 100644 --- a/examples/ShadowedScene/index.html +++ b/examples/ShadowedScene/index.html @@ -64,10 +64,10 @@ - + - + diff --git a/examples/VolumeMeasurement/index.html b/examples/VolumeMeasurement/index.html index aad2b220a..b3e45a1ba 100644 --- a/examples/VolumeMeasurement/index.html +++ b/examples/VolumeMeasurement/index.html @@ -58,11 +58,11 @@ - + - - + + diff --git a/examples/Worlds/index.html b/examples/Worlds/index.html index d50b22f56..2f14e00d7 100644 --- a/examples/Worlds/index.html +++ b/examples/Worlds/index.html @@ -58,9 +58,9 @@ - + - + diff --git a/examples/assets/angleMeasurement.js b/examples/assets/angleMeasurement.js index 67aa3df23..3ccb56577 100644 --- a/examples/assets/angleMeasurement.js +++ b/examples/assets/angleMeasurement.js @@ -1 +1 @@ -import{B as c,M as d,a as l}from"./web-ifc-api-CgBULNZm.js";import{o as m,a as i,L as w,N as p,l as u}from"./index-c9A1IUGD.js";import{$ as b,a as f}from"./index-UqY4hWbC.js";import{S as g}from"./stats.min-GTpOrGrX.js";import"./_commonjsHelpers-Cpj98o6Y.js";const r=document.getElementById("container"),o=new m,y=o.get(i),e=y.create();e.scene=new w(o);e.renderer=new b(o,r);e.camera=new p(o);o.init();e.camera.controls.setLookAt(5,5,5,0,0,0);e.scene.setup();const h=o.get(u);h.create(e);e.scene.three.background=null;const k=new c(3,3,3),B=new d({color:"#6528D7"}),a=new l(k,B);a.position.set(0,1.5,0);e.scene.three.add(a);e.meshes.add(a);const t=o.get(f);t.world=e;t.enabled=!0;r.ondblclick=()=>t.create();window.onkeydown=s=>{(s.code==="Delete"||s.code==="Backspace")&&t.deleteAll()};const n=new g;n.showPanel(2);document.body.append(n.dom);n.dom.style.left="0px";n.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>n.begin());e.renderer.onAfterUpdate.add(()=>n.end()); +import{B as c,M as d,a as l}from"./web-ifc-api-JuXSH2nk.js";import{o as m,a as i,M as w,N as p,h as u}from"./index-DtdmE_hK.js";import{$ as b,a as f}from"./index-Cm7YlCft.js";import{S as g}from"./stats.min-GTpOrGrX.js";import"./_commonjsHelpers-Cpj98o6Y.js";const r=document.getElementById("container"),o=new m,h=o.get(i),e=h.create();e.scene=new w(o);e.renderer=new b(o,r);e.camera=new p(o);o.init();e.camera.controls.setLookAt(5,5,5,0,0,0);e.scene.setup();const y=o.get(u);y.create(e);e.scene.three.background=null;const M=new c(3,3,3),k=new d({color:"#6528D7"}),a=new l(M,k);a.position.set(0,1.5,0);e.scene.three.add(a);e.meshes.add(a);const t=o.get(f);t.world=e;t.enabled=!0;r.ondblclick=()=>t.create();window.onkeydown=s=>{(s.code==="Delete"||s.code==="Backspace")&&t.deleteAll()};const n=new g;n.showPanel(2);document.body.append(n.dom);n.dom.style.left="0px";n.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>n.begin());e.renderer.onAfterUpdate.add(()=>n.end()); diff --git a/examples/assets/areaMeasurement.js b/examples/assets/areaMeasurement.js index eabf3c563..66a8936f5 100644 --- a/examples/assets/areaMeasurement.js +++ b/examples/assets/areaMeasurement.js @@ -1 +1 @@ -import{B as c,M as d,a as l}from"./web-ifc-api-CgBULNZm.js";import{S as m}from"./stats.min-GTpOrGrX.js";import{o as i,a as w,L as p,N as u,l as b}from"./index-c9A1IUGD.js";import{$ as f,J as g}from"./index-UqY4hWbC.js";import"./_commonjsHelpers-Cpj98o6Y.js";const a=document.getElementById("container"),n=new i,y=n.get(w),e=y.create();e.scene=new p(n);e.renderer=new f(n,a);e.camera=new u(n);n.init();e.camera.controls.setLookAt(5,5,5,0,0,0);e.scene.setup();const h=n.get(b);h.create(e);e.scene.three.background=null;const k=new c(3,3,3),B=new d({color:"#6528D7"}),s=new l(k,B);s.position.set(0,1.5,0);e.scene.three.add(s);e.meshes.add(s);const t=n.get(g);t.world=e;t.enabled=!0;a.ondblclick=()=>t.create();a.oncontextmenu=()=>t.endCreation();window.onkeydown=r=>{(r.code==="Delete"||r.code==="Backspace")&&t.deleteAll()};const o=new m;o.showPanel(2);document.body.append(o.dom);o.dom.style.left="0px";o.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>o.begin());e.renderer.onAfterUpdate.add(()=>o.end()); +import{B as c,M as d,a as m}from"./web-ifc-api-JuXSH2nk.js";import{S as l}from"./stats.min-GTpOrGrX.js";import{o as i,a as w,M as p,N as u,h as b}from"./index-DtdmE_hK.js";import{$ as f,J as h}from"./index-Cm7YlCft.js";import"./_commonjsHelpers-Cpj98o6Y.js";const a=document.getElementById("container"),n=new i,g=n.get(w),e=g.create();e.scene=new p(n);e.renderer=new f(n,a);e.camera=new u(n);n.init();e.camera.controls.setLookAt(5,5,5,0,0,0);e.scene.setup();const y=n.get(b);y.create(e);e.scene.three.background=null;const M=new c(3,3,3),k=new d({color:"#6528D7"}),s=new m(M,k);s.position.set(0,1.5,0);e.scene.three.add(s);e.meshes.add(s);const t=n.get(h);t.world=e;t.enabled=!0;a.ondblclick=()=>t.create();a.oncontextmenu=()=>t.endCreation();window.onkeydown=r=>{(r.code==="Delete"||r.code==="Backspace")&&t.deleteAll()};const o=new l;o.showPanel(2);document.body.append(o.dom);o.dom.style.left="0px";o.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>o.begin());e.renderer.onAfterUpdate.add(()=>o.end()); diff --git a/examples/assets/bCFTopics.js b/examples/assets/bCFTopics.js index 69d32ed71..c21b28412 100644 --- a/examples/assets/bCFTopics.js +++ b/examples/assets/bCFTopics.js @@ -1,74 +1,13 @@ -var A=Object.defineProperty;var I=(n,s,e)=>s in n?A(n,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[s]=e;var i=(n,s,e)=>(I(n,typeof s!="symbol"?s+"":s,e),e);import{C as h,V as W,z as Z,D as O,A as T,W as z,h as C,N as V,at as k,Q as G,a as j,bb as H}from"./web-ifc-api-CgBULNZm.js";import{d as N,R as y,m as x}from"./index-CqPyogbW.js";import{B as L,E as l,D as E,S as g,C as $,a as Q,W as q,I as J,b as K,F as X,c as Y,V as ee}from"./index-PN7JV3bA.js";import"./_commonjsHelpers-Cpj98o6Y.js";class te extends L{constructor(){super(...arguments);i(this,"onAfterUpdate",new l);i(this,"onBeforeUpdate",new l);i(this,"onDisposed",new l);i(this,"onResize",new l);i(this,"onClippingPlanesUpdated",new l);i(this,"clippingPlanes",[])}updateClippingPlanes(){this.onClippingPlanesUpdated.trigger()}setPlane(e,t,o){t.isLocal=o;const r=this.clippingPlanes.indexOf(t);e&&r===-1?this.clippingPlanes.push(t):!e&&r>-1&&this.clippingPlanes.splice(r,1),this.three.clippingPlanes=this.clippingPlanes.filter(c=>!c.isLocal)}}class ie extends L{constructor(e){super(e);i(this,"onDisposed",new l);i(this,"directionalLights",new Map);i(this,"ambientLights",new Map)}dispose(){const e=this.components.get(E);for(const t of this.three.children){const o=t;o.geometry&&e.destroy(o)}for(const[,t]of this.directionalLights)t.removeFromParent(),t.target.removeFromParent(),t.dispose();for(const[,t]of this.ambientLights)t.removeFromParent(),t.dispose();this.three.children=[],this.onDisposed.trigger(),this.onDisposed.reset()}}class se extends ie{constructor(e){super(e);i(this,"isSetup",!1);i(this,"three");i(this,"onSetup",new l);i(this,"config",{directionalLight:{color:new h("white"),intensity:1.5,position:new W(5,10,3)},ambientLight:{color:new h("white"),intensity:1}});this.three=new Z,this.three.background=new h(2107698)}setup(e){this.config={...this.config,...e};const t=new O(this.config.directionalLight.color,this.config.directionalLight.intensity);t.position.copy(this.config.directionalLight.position);const o=new T(this.config.ambientLight.color,this.config.ambientLight.intensity);this.three.add(t,o),this.directionalLights.set(t.uuid,t),this.ambientLights.set(o.uuid,o),this.isSetup=!0,this.onSetup.trigger(this)}}class ne extends te{constructor(e,t,o){super(e);i(this,"enabled",!0);i(this,"container");i(this,"three");i(this,"_canvas");i(this,"_parameters");i(this,"_resizeObserver",null);i(this,"onContainerUpdated",new l);i(this,"_resizing",!1);i(this,"resize",e=>{if(this._resizing)return;this._resizing=!0,this.onContainerUpdated.trigger();const t=e?e.x:this.container.clientWidth,o=e?e.y:this.container.clientHeight;this.three.setSize(t,o),this.onResize.trigger(new C(t,o)),this._resizing=!1});i(this,"resizeEvent",()=>{this.resize()});i(this,"onContextLost",e=>{e.preventDefault(),this.enabled=!1});i(this,"onContextBack",()=>{this.three.setRenderTarget(null),this.three.dispose(),this.three=new z({canvas:this._canvas,antialias:!0,alpha:!0,...this._parameters}),this.enabled=!0});this.container=t,this._parameters=o,this.three=new z({antialias:!0,alpha:!0,...o}),this.three.setPixelRatio(Math.min(window.devicePixelRatio,2)),this.setupRenderer(),this.setupEvents(!0),this.resize(),this._canvas=this.three.domElement;const r=this.three.getContext(),{canvas:c}=r;c.addEventListener("webglcontextlost",this.onContextLost,!1),c.addEventListener("webglcontextrestored",this.onContextBack,!1)}update(){if(!this.enabled||!this.currentWorld)return;this.onBeforeUpdate.trigger(this);const e=this.currentWorld.scene.three,t=this.currentWorld.camera.three;this.three.render(e,t),this.onAfterUpdate.trigger(this)}dispose(){this.enabled=!1,this.setupEvents(!1),this.three.domElement.remove(),this.three.forceContextLoss(),this.three.dispose(),this.onResize.reset(),this.onAfterUpdate.reset(),this.onBeforeUpdate.reset(),this.onDisposed.trigger(),this.onDisposed.reset()}getSize(){return new C(this.three.domElement.clientWidth,this.three.domElement.clientHeight)}setupEvents(e){const t=this.three.domElement.parentElement;if(!t)throw new Error("This renderer needs to have an HTML container!");this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null),window.removeEventListener("resize",this.resizeEvent),e&&(this._resizeObserver=new ResizeObserver(this.resizeEvent),this._resizeObserver.observe(t),window.addEventListener("resize",this.resizeEvent))}setupRenderer(){this.three.localClippingEnabled=!0,this.container&&this.container.appendChild(this.three.domElement),this.onContainerUpdated.trigger()}}class oe{constructor(s,e,t){i(this,"onDisposed",new l);i(this,"world");i(this,"components");i(this,"three");i(this,"_fade",3);i(this,"updateZoom",()=>{this.world.camera instanceof g&&(this.material.uniforms.uZoom.value=this.world.camera.three.zoom)});this.world=e;const{color:o,size1:r,size2:c,distance:R}=t;this.components=s;const M=new V(2,2,1,1),U=new k({side:G,uniforms:{uSize1:{value:r},uSize2:{value:c},uColor:{value:o},uDistance:{value:R},uFade:{value:this._fade},uZoom:{value:1}},transparent:!0,vertexShader:` - - varying vec3 worldPosition; - - uniform float uDistance; - - void main() { - - vec3 pos = position.xzy * uDistance; - pos.xz += cameraPosition.xz; - - worldPosition = pos; - - gl_Position = projectionMatrix * modelViewMatrix * vec4(pos, 1.0); - - } - `,fragmentShader:` - - varying vec3 worldPosition; - - uniform float uZoom; - uniform float uFade; - uniform float uSize1; - uniform float uSize2; - uniform vec3 uColor; - uniform float uDistance; - - - - float getGrid(float size) { - - vec2 r = worldPosition.xz / size; - - - vec2 grid = abs(fract(r - 0.5) - 0.5) / fwidth(r); - float line = min(grid.x, grid.y); - - - return 1.0 - min(line, 1.0); - } - - void main() { - - - float d = 1.0 - min(distance(cameraPosition.xz, worldPosition.xz) / uDistance, 1.0); - - float g1 = getGrid(uSize1); - float g2 = getGrid(uSize2); - - // Ortho camera fades the grid away when zooming out - float minZoom = step(0.2, uZoom); - float zoomFactor = pow(min(uZoom, 1.), 2.) * minZoom; - - gl_FragColor = vec4(uColor.rgb, mix(g2, g1, g1) * pow(d, uFade)); - gl_FragColor.a = mix(0.5 * gl_FragColor.a, gl_FragColor.a, g2) * zoomFactor; - - if ( gl_FragColor.a <= 0.0 ) discard; - - - } - - `,extensions:{derivatives:!0}});this.three=new j(M,U),this.three.frustumCulled=!1,e.scene.three.add(this.three),this.setupEvents(!0)}get visible(){return this.three.visible}set visible(s){s?this.world.scene.three.add(this.three):this.three.removeFromParent()}get material(){return this.three.material}get fade(){return this._fade===3}set fade(s){this._fade=s?3:0,this.material.uniforms.uFade.value=this._fade}dispose(){this.setupEvents(!1),this.components.get(E).destroy(this.three),this.onDisposed.trigger(),this.onDisposed.reset(),this.world=null,this.components=null}setupEvents(s){if(this.world.isDisposing||!(this.world.camera instanceof g))return;const e=this.world.camera.controls;s?e.addEventListener("update",this.updateZoom):e.removeEventListener("update",this.updateZoom)}}const m=class m extends ${constructor(e){super(e);i(this,"list",new Map);i(this,"config",{color:new h(12303291),size1:1,size2:10,distance:500});i(this,"onDisposed",new l);i(this,"enabled",!0);e.add(m.uuid,this)}create(e){if(this.list.has(e.uuid))throw new Error("This world already has a grid!");const t=new oe(this.components,e,this.config);return this.list.set(e.uuid,t),e.onDisposed.add(()=>{this.delete(e)}),t}delete(e){const t=this.list.get(e.uuid);t&&t.dispose(),this.list.delete(e.uuid)}dispose(){for(const[e,t]of this.list)t.dispose();this.list.clear(),this.onDisposed.trigger(),this.onDisposed.reset()}};i(m,"uuid","d1e814d5-b81c-4452-87a2-f039375e0489");let f=m;N.init();const a=new Q,re=a.get(q),d=re.create(),D=new se(a);D.setup();d.scene=D;d.scene.three.add(new H(10));const u=document.createElement("bim-viewport"),P=new ne(a,u);d.renderer=P;const S=new g(a);d.camera=S;u.addEventListener("resize",()=>{P.resize(),S.updateAspect()});const w=document.createElement("bim-grid");w.floating=!0;u.append(w);const ae=a.get(f);ae.create(d);a.init();const _=a.get(J);await _.setup();const ce=a.get(K),le=a.get(X);le.onFragmentsLoaded.add(async n=>{d.scene.three.add(n),n.hasProperties&&await ce.process(n);for(const s of n.items)d.meshes.add(s.mesh)});const de=async n=>{const s=[];for(const e of n){const o=await(await fetch(e)).arrayBuffer(),r=new Uint8Array(o),c=await _.load(r);s.push(c)}return s},he=await de(["https://thatopen.github.io/engine_components/resources/small.ifc"]),pe=he[0],p=a.get(Y);p.setup({types:new Set([...p.config.types,"Information","Coordination"]),statuses:new Set(["Active","In Progress","Done","In Review","Closed"]),users:new Set(["juan.hoyos4@gmail.com"])});const me=a.get(ee);w.layouts={main:{template:` +import{bb as I}from"./web-ifc-api-JuXSH2nk.js";import{d as S,R as f,m as w}from"./index-CqPyogbW.js";import{C as F,W as B,S as D,I as P,a as x,F as A,B as E,V as L}from"./index-BICSFNrK.js";import{S as M,a as R,G as T}from"./index-M03DNf7F.js";import"./_commonjsHelpers-Cpj98o6Y.js";S.init();const e=new F,j=e.get(B),n=j.create(),u=new M(e);u.setup();n.scene=u;n.scene.three.add(new I(10));const s=document.createElement("bim-viewport"),b=new R(e,s);n.renderer=b;const g=new D(e);n.camera=g;s.addEventListener("resize",()=>{b.resize(),g.updateAspect()});const l=document.createElement("bim-grid");l.floating=!0;s.append(l);const G=e.get(T);G.create(n);e.init();const y=e.get(P);await y.setup();const V=e.get(x),k=e.get(A);k.onFragmentsLoaded.add(async t=>{n.scene.three.add(t),t.hasProperties&&await V.process(t);for(const o of t.items)n.meshes.add(o.mesh)});const W=async t=>{const o=[];for(const i of t){const r=await(await fetch(i)).arrayBuffer(),c=new Uint8Array(r),m=await y.load(c);o.push(m)}return o},z=await W(["https://thatopen.github.io/engine_components/resources/small.ifc"]),H=z[0],a=e.get(E);a.setup({types:new Set([...a.config.types,"Information","Coordination"]),statuses:new Set(["Active","In Progress","Done","In Review","Closed"]),users:new Set(["juan.hoyos4@gmail.com"])});const U=e.get(L);l.layouts={main:{template:` "empty topicPanel" 1fr /1fr 22rem - `,elements:{}}};const ue=async n=>{const s={viewpoints:[],topics:[]};for(const e of n){const o=await(await fetch(e)).arrayBuffer(),{viewpoints:r,topics:c}=await p.load(new Uint8Array(o),d);s.viewpoints.push(...r),s.topics.push(...c)}return s};await ue([]);const v=p.create({title:"Missing information",description:"It seems these elements are badly defined.",dueDate:new Date("08-01-2020"),type:"Clash",priority:"Major",stage:"Design",labels:new Set(["Architecture","Cost Estimation"]),assignedTo:"juan.hoyos4@gmail.com"}),b=me.create(d,{title:"Custom Viewpoint"});b.addComponentsFromMap(pe.getFragmentMap([186]));v.viewpoints.add(b.guid);const F=v.createComment("What if we talk about this next meeting?");F.author="juan.hoyos4@gmail.com";v.createComment("Hi there! I agree.");F.viewpoint=b;const ge=y.create(()=>x` + `,elements:{}}};const $=async t=>{const o={viewpoints:[],topics:[]};for(const i of t){const r=await(await fetch(i)).arrayBuffer(),{viewpoints:c,topics:m}=await a.load(new Uint8Array(r),n);o.viewpoints.push(...c),o.topics.push(...m)}return o};await $([]);const p=a.create({title:"Missing information",description:"It seems these elements are badly defined.",dueDate:new Date("08-01-2020"),type:"Clash",priority:"Major",stage:"Design",labels:new Set(["Architecture","Cost Estimation"]),assignedTo:"juan.hoyos4@gmail.com"}),d=U.create(n,{title:"Custom Viewpoint"});d.addComponentsFromMap(H.getFragmentMap([186]));p.viewpoints.add(d.guid);const h=p.createComment("What if we talk about this next meeting?");h.author="juan.hoyos4@gmail.com";p.createComment("Hi there! I agree.");h.viewpoint=d;const N=f.create(()=>w` - `),fe=y.create(()=>x` + `),_=f.create(()=>w`
@@ -78,8 +17,8 @@ var A=Object.defineProperty;var I=(n,s,e)=>s in n?A(n,s,{enumerable:!0,configura - `),B=document.getElementById("app");B.layouts={main:{template:` + `),v=document.getElementById("app");v.layouts={main:{template:` "leftPanel viewport" 2fr "leftPanel bottomPanel" 1fr / 25rem 1fr - `,elements:{leftPanel:ge,viewport:u,bottomPanel:fe}}};B.layout="main"; + `,elements:{leftPanel:N,viewport:s,bottomPanel:_}}};v.layout="main"; diff --git a/examples/assets/boundingBoxer.js b/examples/assets/boundingBoxer.js index e20bee7e2..edb948db0 100644 --- a/examples/assets/boundingBoxer.js +++ b/examples/assets/boundingBoxer.js @@ -1,4 +1,4 @@ -import"./web-ifc-api-CgBULNZm.js";import{S as c}from"./stats.min-GTpOrGrX.js";import{d as l,R as a,m as r}from"./index-CqPyogbW.js";import{o as d,a as m,L as p,M as b,N as u,l as f,_ as g,h}from"./index-c9A1IUGD.js";import"./_commonjsHelpers-Cpj98o6Y.js";const w=document.getElementById("container"),t=new d,y=t.get(m),e=y.create();e.scene=new p(t);e.renderer=new b(t,w);e.camera=new u(t);t.init();e.camera.controls.setLookAt(12,6,8,0,0,-10);e.scene.setup();const B=t.get(f);B.create(e);e.scene.three.background=null;const L=t.get(g),v=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),x=await v.arrayBuffer(),k=new Uint8Array(x),i=L.load(k);e.scene.three.add(i);const s=t.get(h);s.add(i);const M=s.getMesh();s.reset();const n=new c;n.showPanel(2);document.body.append(n.dom);n.dom.style.left="0px";n.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>n.begin());e.renderer.onAfterUpdate.add(()=>n.end());l.init();const o=a.create(()=>r` +import"./web-ifc-api-JuXSH2nk.js";import{S as c}from"./stats.min-GTpOrGrX.js";import{d as l,R as a,m as r}from"./index-CqPyogbW.js";import{o as d,a as m,M as p,v as b,N as u,h as g,_ as f,m as h}from"./index-DtdmE_hK.js";import"./_commonjsHelpers-Cpj98o6Y.js";const w=document.getElementById("container"),t=new d,y=t.get(m),e=y.create();e.scene=new p(t);e.renderer=new b(t,w);e.camera=new u(t);t.init();e.camera.controls.setLookAt(12,6,8,0,0,-10);e.scene.setup();const v=t.get(g);v.create(e);e.scene.three.background=null;const B=t.get(f),x=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),k=await x.arrayBuffer(),L=new Uint8Array(k),i=B.load(L);e.scene.three.add(i);const s=t.get(h);s.add(i);const M=s.getMesh();s.reset();const n=new c;n.showPanel(2);document.body.append(n.dom);n.dom.style.left="0px";n.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>n.begin());e.renderer.onAfterUpdate.add(()=>n.end());l.init();const o=a.create(()=>r` diff --git a/examples/assets/civil3DNavigator.js b/examples/assets/civil3DNavigator.js index ae7710303..077e2abdd 100644 --- a/examples/assets/civil3DNavigator.js +++ b/examples/assets/civil3DNavigator.js @@ -1 +1 @@ -import{r as i,S as l}from"./web-ifc-api-CgBULNZm.js";import{o as p,a as m,L as h,N as f,l as g,_ as u,c as w}from"./index-c9A1IUGD.js";import{S as y}from"./stats.min-GTpOrGrX.js";import{X as b,q as L}from"./index-UqY4hWbC.js";import"./_commonjsHelpers-Cpj98o6Y.js";const d=document.getElementById("container"),t=new p,S=t.get(m),e=S.create();e.scene=new h(t);e.renderer=new b(t,d);e.camera=new f(t);t.init();e.scene.setup();e.camera.controls.setLookAt(5,5,5,0,0,0);d.appendChild(e.renderer.three2D.domElement);const U=t.get(g);U.create(e);e.scene.three.background=null;const _=t.get(u),v=await fetch("https://thatopen.github.io/engine_components/resources/road.frag"),A=await v.arrayBuffer(),B=new Uint8Array(A),r=await _.load(B);e.scene.three.add(r);const E=await fetch("https://thatopen.github.io/engine_components/resources/road.json");r.setLocalProperties(await E.json());const a=t.get(L);a.world=e;a.draw(r);const I=t.get(w),s=I.create(e);s.threshold=10;for(const o of r.children)o instanceof i&&s.add(o);s.needsUpdate=!0;e.camera.controls.addEventListener("sleep",()=>{s.needsUpdate=!0});const c=new l(void 0,20);a.onHighlight.add(({point:o})=>{c.center.copy(o),e.camera.controls.fitToSphere(c,!0)});const n=new y;n.showPanel(2);document.body.append(n.dom);n.dom.style.left="0px";n.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>n.begin());e.renderer.onAfterUpdate.add(()=>n.end()); +import{r as i,S as p}from"./web-ifc-api-JuXSH2nk.js";import{o as l,a as m,M as h,N as f,h as g,_ as u,c as w}from"./index-DtdmE_hK.js";import{S as y}from"./stats.min-GTpOrGrX.js";import{X as b,q as S}from"./index-Cm7YlCft.js";import"./_commonjsHelpers-Cpj98o6Y.js";const d=document.getElementById("container"),t=new l,U=t.get(m),e=U.create();e.scene=new h(t);e.renderer=new b(t,d);e.camera=new f(t);t.init();e.scene.setup();e.camera.controls.setLookAt(5,5,5,0,0,0);d.appendChild(e.renderer.three2D.domElement);const _=t.get(g);_.create(e);e.scene.three.background=null;const v=t.get(u),A=await fetch("https://thatopen.github.io/engine_components/resources/road.frag"),B=await A.arrayBuffer(),E=new Uint8Array(B),r=await v.load(E);e.scene.three.add(r);const I=await fetch("https://thatopen.github.io/engine_components/resources/road.json");r.setLocalProperties(await I.json());const a=t.get(S);a.world=e;a.draw(r);const L=t.get(w),s=L.create(e);s.threshold=10;for(const o of r.children)o instanceof i&&s.add(o);s.needsUpdate=!0;e.camera.controls.addEventListener("sleep",()=>{s.needsUpdate=!0});const c=new p(void 0,20);a.onHighlight.add(({point:o})=>{c.center.copy(o),e.camera.controls.fitToSphere(c,!0)});const n=new y;n.showPanel(2);document.body.append(n.dom);n.dom.style.left="0px";n.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>n.begin());e.renderer.onAfterUpdate.add(()=>n.end()); diff --git a/examples/assets/civilCrossSectionNavigator.js b/examples/assets/civilCrossSectionNavigator.js index 9da657a08..20c6bfd52 100644 --- a/examples/assets/civilCrossSectionNavigator.js +++ b/examples/assets/civilCrossSectionNavigator.js @@ -1 +1 @@ -import{C as M,L as B}from"./web-ifc-api-CgBULNZm.js";import{o as E,a as L,L as S,i as k,l as D,_ as v,b as x}from"./index-c9A1IUGD.js";import{d as I}from"./index-CqPyogbW.js";import{Z as A}from"./index-B32RnVzG.js";import{S as C}from"./stats.min-GTpOrGrX.js";import{X as Z,Z as _,q as P,Q as U,K as j}from"./index-UqY4hWbC.js";import"./_commonjsHelpers-Cpj98o6Y.js";I.init();A.init();const y=document.getElementById("container"),e=new E,q=e.get(L),t=q.create();t.scene=new S(e);t.renderer=new Z(e,y);t.camera=new k(e);e.init();t.scene.setup();t.camera.controls.setLookAt(5,5,5,0,0,0);y.appendChild(t.renderer.three2D.domElement);const H=e.get(D);H.create(t);t.scene.three.background=null;const b=e.get(v),K=await fetch("https://thatopen.github.io/engine_components/resources/road.frag"),N=await K.arrayBuffer(),Q=new Uint8Array(N),d=b.load(Q);t.scene.three.add(d);const W=await fetch("https://thatopen.github.io/engine_components/resources/road.json");d.setLocalProperties(await W.json());const f=document.getElementById("scene-2d-left");f.components=e;if(!f.world)throw new Error("World not found!");const c=e.get(_);c.world=f.world;await c.draw(d);const l=e.get(P);l.world=t;l.draw(d);const g=document.getElementById("scene-2d-right");g.components=e;if(!g.world)throw new Error("World not found!");const h=e.get(U);h.world=g.world;h.world3D=t;c.onMarkerChange.add(({alignment:o,percentage:n,type:r,curve:s})=>{if(l.setMarker(o,n,r),r==="select"){const i=s.alignment.absolute[s.index].mesh,m=o.getPointAt(n,"absolute");h.set(i,m)}});c.onHighlight.add(({mesh:o})=>{l.highlighter.select(o);const n=o.curve.index,r=o.curve.alignment.absolute[n];r.mesh.geometry.computeBoundingSphere();const s=r.mesh.geometry.boundingSphere;s&&t.camera.controls.fitToSphere(s,!0)});c.onMarkerHidden.add(({type:o})=>{l.hideMarker(o)});const p=e.get(x);p.byEntity(d);const X=p.list,w=e.get(j),u=w.styles.list;for(const o in X.entities){const n=p.find({entities:[o]}),r=new M(Math.random(),Math.random(),Math.random()),s=new B({color:r});w.styles.create(o,new Set,g.world,s);for(const i in n){const m=b.list.get(i);m&&(u[o].fragments[i]=new Set(n[i]),u[o].meshes.add(m.mesh))}}w.update(!0);const a=new C;a.showPanel(2);document.body.append(a.dom);a.dom.style.left="0px";a.dom.style.zIndex="unset";t.renderer.onBeforeUpdate.add(()=>a.begin());t.renderer.onAfterUpdate.add(()=>a.end()); +import{C as M,L as B}from"./web-ifc-api-JuXSH2nk.js";import{o as E,a as S,M as k,n as D,h as v,_ as x,b as I}from"./index-DtdmE_hK.js";import{d as L}from"./index-CqPyogbW.js";import{Z as A}from"./index-Cb0EycFm.js";import{S as C}from"./stats.min-GTpOrGrX.js";import{X as Z,Z as _,q as P,Q as U,K as j}from"./index-Cm7YlCft.js";import"./_commonjsHelpers-Cpj98o6Y.js";L.init();A.init();const y=document.getElementById("container"),e=new E,q=e.get(S),t=q.create();t.scene=new k(e);t.renderer=new Z(e,y);t.camera=new D(e);e.init();t.scene.setup();t.camera.controls.setLookAt(5,5,5,0,0,0);y.appendChild(t.renderer.three2D.domElement);const H=e.get(v);H.create(t);t.scene.three.background=null;const b=e.get(x),K=await fetch("https://thatopen.github.io/engine_components/resources/road.frag"),N=await K.arrayBuffer(),Q=new Uint8Array(N),i=b.load(Q);t.scene.three.add(i);const W=await fetch("https://thatopen.github.io/engine_components/resources/road.json");i.setLocalProperties(await W.json());const f=document.getElementById("scene-2d-left");f.components=e;if(!f.world)throw new Error("World not found!");const c=e.get(_);c.world=f.world;await c.draw(i);const l=e.get(P);l.world=t;l.draw(i);const g=document.getElementById("scene-2d-right");g.components=e;if(!g.world)throw new Error("World not found!");const h=e.get(U);h.world=g.world;h.world3D=t;c.onMarkerChange.add(({alignment:o,percentage:n,type:r,curve:s})=>{if(l.setMarker(o,n,r),r==="select"){const d=s.alignment.absolute[s.index].mesh,m=o.getPointAt(n,"absolute");h.set(d,m)}});c.onHighlight.add(({mesh:o})=>{l.highlighter.select(o);const n=o.curve.index,r=o.curve.alignment.absolute[n];r.mesh.geometry.computeBoundingSphere();const s=r.mesh.geometry.boundingSphere;s&&t.camera.controls.fitToSphere(s,!0)});c.onMarkerHidden.add(({type:o})=>{l.hideMarker(o)});const p=e.get(I);p.byEntity(i);const X=p.list,w=e.get(j),u=w.styles.list;for(const o in X.entities){const n=p.find({entities:[o]}),r=new M(Math.random(),Math.random(),Math.random()),s=new B({color:r});w.styles.create(o,new Set,g.world,s);for(const d in n){const m=b.list.get(d);m&&(u[o].fragments[d]=new Set(n[d]),u[o].meshes.add(m.mesh))}}w.update(!0);const a=new C;a.showPanel(2);document.body.append(a.dom);a.dom.style.left="0px";a.dom.style.zIndex="unset";t.renderer.onBeforeUpdate.add(()=>a.begin());t.renderer.onAfterUpdate.add(()=>a.end()); diff --git a/examples/assets/civilElevationNavigator.js b/examples/assets/civilElevationNavigator.js index 65752e45b..370c4c72d 100644 --- a/examples/assets/civilElevationNavigator.js +++ b/examples/assets/civilElevationNavigator.js @@ -1 +1 @@ -import"./web-ifc-api-CgBULNZm.js";import{o as y,a as S,L as b,i as B,l as k,_ as E}from"./index-c9A1IUGD.js";import{X as A,q as I,Z as L,d as M}from"./index-UqY4hWbC.js";import{d as Z}from"./index-CqPyogbW.js";import{Z as x}from"./index-B32RnVzG.js";import{S as C}from"./stats.min-GTpOrGrX.js";import"./_commonjsHelpers-Cpj98o6Y.js";Z.init();x.init();const f=document.getElementById("container"),t=new y,D=t.get(S),e=D.create();e.scene=new b(t);e.renderer=new A(t,f);e.camera=new B(t);t.init();e.scene.setup();e.camera.controls.setLookAt(5,5,5,0,0,0);f.appendChild(e.renderer.three2D.domElement);const U=t.get(k);U.create(e);e.scene.three.background=null;const X=t.get(E),_=await fetch("https://thatopen.github.io/engine_components/resources/road.frag"),q=await _.arrayBuffer(),z=new Uint8Array(q),c=X.load(z);e.scene.three.add(c);const i=t.get(I);i.world=e;i.draw(c);const g=document.getElementById("scene-2d-left");g.components=t;if(!g.world)throw new Error("World not found!");const l=new L(t);l.world=g.world;l.draw(c);const a=document.getElementById("scene-2d-right");a.components=t;if(!a.world)throw new Error("World not found!");const s=t.get(M);s.world=a.world;s.draw(c);l.onMarkerChange.add(({alignment:r,percentage:d})=>{s.setMarker(r,d,"hover"),i.setMarker(r,d,"hover")});l.onHighlight.add(({mesh:r,point:d})=>{const{index:v,alignment:h}=r.curve,m=h.getPercentageAt(d,"horizontal");if(m===null)return;const{curve:n}=h.getCurveAt(m,"vertical");if(s.highlighter.select(n.mesh),s.setMarker(n.alignment,m,"select"),a.world){n.mesh.geometry.boundingSphere||n.mesh.geometry.computeBoundingSphere();const w=n.mesh.geometry.boundingSphere.clone();w.radius*=1.5,a.world.camera.controls.fitToSphere(w,!0)}i.highlighter.select(r);const p=r.curve.alignment.absolute[v];p.mesh.geometry.computeBoundingSphere();const u=p.mesh.geometry.boundingSphere;u&&e.camera.controls.fitToSphere(u,!0)});const o=new C;o.showPanel(2);document.body.append(o.dom);o.dom.style.left="0px";o.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>o.begin());e.renderer.onAfterUpdate.add(()=>o.end()); +import"./web-ifc-api-JuXSH2nk.js";import{o as y,a as S,M as b,n as B,h as k,_ as E}from"./index-DtdmE_hK.js";import{X as M,q as A,Z as I,d as Z}from"./index-Cm7YlCft.js";import{d as x}from"./index-CqPyogbW.js";import{Z as C}from"./index-Cb0EycFm.js";import{S as D}from"./stats.min-GTpOrGrX.js";import"./_commonjsHelpers-Cpj98o6Y.js";x.init();C.init();const f=document.getElementById("container"),t=new y,U=t.get(S),e=U.create();e.scene=new b(t);e.renderer=new M(t,f);e.camera=new B(t);t.init();e.scene.setup();e.camera.controls.setLookAt(5,5,5,0,0,0);f.appendChild(e.renderer.three2D.domElement);const X=t.get(k);X.create(e);e.scene.three.background=null;const _=t.get(E),q=await fetch("https://thatopen.github.io/engine_components/resources/road.frag"),z=await q.arrayBuffer(),L=new Uint8Array(z),c=_.load(L);e.scene.three.add(c);const i=t.get(A);i.world=e;i.draw(c);const g=document.getElementById("scene-2d-left");g.components=t;if(!g.world)throw new Error("World not found!");const l=new I(t);l.world=g.world;l.draw(c);const a=document.getElementById("scene-2d-right");a.components=t;if(!a.world)throw new Error("World not found!");const s=t.get(Z);s.world=a.world;s.draw(c);l.onMarkerChange.add(({alignment:r,percentage:d})=>{s.setMarker(r,d,"hover"),i.setMarker(r,d,"hover")});l.onHighlight.add(({mesh:r,point:d})=>{const{index:v,alignment:h}=r.curve,m=h.getPercentageAt(d,"horizontal");if(m===null)return;const{curve:n}=h.getCurveAt(m,"vertical");if(s.highlighter.select(n.mesh),s.setMarker(n.alignment,m,"select"),a.world){n.mesh.geometry.boundingSphere||n.mesh.geometry.computeBoundingSphere();const w=n.mesh.geometry.boundingSphere.clone();w.radius*=1.5,a.world.camera.controls.fitToSphere(w,!0)}i.highlighter.select(r);const p=r.curve.alignment.absolute[v];p.mesh.geometry.computeBoundingSphere();const u=p.mesh.geometry.boundingSphere;u&&e.camera.controls.fitToSphere(u,!0)});const o=new D;o.showPanel(2);document.body.append(o.dom);o.dom.style.left="0px";o.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>o.begin());e.renderer.onAfterUpdate.add(()=>o.end()); diff --git a/examples/assets/civilPlanNavigator.js b/examples/assets/civilPlanNavigator.js index 9a1059dd4..83b5fdf77 100644 --- a/examples/assets/civilPlanNavigator.js +++ b/examples/assets/civilPlanNavigator.js @@ -1 +1 @@ -import"./web-ifc-api-CgBULNZm.js";import{o as p,a as g,L as u,i as f,l as h,_ as w}from"./index-c9A1IUGD.js";import{X as y,q as b,Z as v}from"./index-UqY4hWbC.js";import{d as B}from"./index-CqPyogbW.js";import{Z as S}from"./index-B32RnVzG.js";import{S as x}from"./stats.min-GTpOrGrX.js";import"./_commonjsHelpers-Cpj98o6Y.js";B.init();S.init();const i=document.getElementById("container"),t=new p,Z=t.get(g),e=Z.create();e.scene=new u(t);e.renderer=new y(t,i);e.camera=new f(t);t.init();e.scene.setup();e.camera.controls.setLookAt(5,5,5,0,0,0);i.appendChild(e.renderer.three2D.domElement);const A=t.get(h);A.create(e);e.scene.three.background=null;const E=t.get(w),I=await fetch("https://thatopen.github.io/engine_components/resources/road.frag"),L=await I.arrayBuffer(),U=new Uint8Array(L),r=E.load(U);e.scene.three.add(r);const a=t.get(b);a.world=e;a.draw(r);const m=document.getElementById("scene-2d"),s=t.get(v);m.components=t;s.world=m.world;await s.draw(r);s.onHighlight.add(({mesh:o})=>{a.highlighter.select(o);const l=o.curve.index,d=o.curve.alignment.absolute[l];d.mesh.geometry.computeBoundingSphere();const c=d.mesh.geometry.boundingSphere;c&&e.camera.controls.fitToSphere(c,!0)});const n=new x;n.showPanel(2);document.body.append(n.dom);n.dom.style.left="0px";n.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>n.begin());e.renderer.onAfterUpdate.add(()=>n.end()); +import"./web-ifc-api-JuXSH2nk.js";import{o as p,a as g,M as h,n as u,h as f,_ as w}from"./index-DtdmE_hK.js";import{X as y,q as b,Z as v}from"./index-Cm7YlCft.js";import{d as B}from"./index-CqPyogbW.js";import{Z as S}from"./index-Cb0EycFm.js";import{S as x}from"./stats.min-GTpOrGrX.js";import"./_commonjsHelpers-Cpj98o6Y.js";B.init();S.init();const i=document.getElementById("container"),t=new p,Z=t.get(g),e=Z.create();e.scene=new h(t);e.renderer=new y(t,i);e.camera=new u(t);t.init();e.scene.setup();e.camera.controls.setLookAt(5,5,5,0,0,0);i.appendChild(e.renderer.three2D.domElement);const A=t.get(f);A.create(e);e.scene.three.background=null;const E=t.get(w),I=await fetch("https://thatopen.github.io/engine_components/resources/road.frag"),U=await I.arrayBuffer(),_=new Uint8Array(U),r=E.load(_);e.scene.three.add(r);const a=t.get(b);a.world=e;a.draw(r);const m=document.getElementById("scene-2d"),s=t.get(v);m.components=t;s.world=m.world;await s.draw(r);s.onHighlight.add(({mesh:o})=>{a.highlighter.select(o);const l=o.curve.index,d=o.curve.alignment.absolute[l];d.mesh.geometry.computeBoundingSphere();const c=d.mesh.geometry.boundingSphere;c&&e.camera.controls.fitToSphere(c,!0)});const n=new x;n.showPanel(2);document.body.append(n.dom);n.dom.style.left="0px";n.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>n.begin());e.renderer.onAfterUpdate.add(()=>n.end()); diff --git a/examples/assets/classifier.js b/examples/assets/classifier.js index 24fede89e..abfbd40a8 100644 --- a/examples/assets/classifier.js +++ b/examples/assets/classifier.js @@ -1,4 +1,4 @@ -import{a3 as d,C as m}from"./web-ifc-api-CgBULNZm.js";import{S as u}from"./stats.min-GTpOrGrX.js";import{d as b,R as a,m as c}from"./index-CqPyogbW.js";import{o as p,a as f,L as C,M as w,N as I,l as g,_ as y,b as L}from"./index-c9A1IUGD.js";import"./_commonjsHelpers-Cpj98o6Y.js";const A=document.getElementById("container"),s=new p,E=s.get(f),t=E.create();t.scene=new C(s);t.renderer=new w(s,A);t.camera=new I(s);s.init();t.camera.controls.setLookAt(12,6,8,0,0,-10);t.scene.setup();const R=s.get(g);R.create(t);t.scene.three.background=null;const F=new y(s),N=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),S=await N.arrayBuffer(),h=new Uint8Array(S),l=F.load(h);t.scene.three.add(l);const o=s.get(L);o.byEntity(l);o.byIfcRel(l,d,"storeys");o.byModel(l.uuid,l);const T=o.find({entities:["IFCWALLSTANDARDCASE"]}),$=o.find({entities:["IFCSLAB"]}),M=o.find({entities:["IFCMEMBER","IFCPLATE"]}),U=o.find({entities:["IFCFURNISHINGELEMENT"]}),v=o.find({entities:["IFCDOOR"]}),B=o.find({models:[l.uuid]}),i=new u;i.showPanel(2);document.body.append(i.dom);i.dom.style.left="0px";i.dom.style.zIndex="unset";t.renderer.onBeforeUpdate.add(()=>i.begin());t.renderer.onAfterUpdate.add(()=>i.end());b.init();const e=new m,r=a.create(()=>c` +import{a3 as d,C as m}from"./web-ifc-api-JuXSH2nk.js";import{S as u}from"./stats.min-GTpOrGrX.js";import{d as b,R as a,m as c}from"./index-CqPyogbW.js";import{o as p,a as f,M as C,v as w,N as I,h as g,_ as y,b as A}from"./index-DtdmE_hK.js";import"./_commonjsHelpers-Cpj98o6Y.js";const E=document.getElementById("container"),s=new p,L=s.get(f),t=L.create();t.scene=new C(s);t.renderer=new w(s,E);t.camera=new I(s);s.init();t.camera.controls.setLookAt(12,6,8,0,0,-10);t.scene.setup();const R=s.get(g);R.create(t);t.scene.three.background=null;const h=new y(s),F=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),N=await F.arrayBuffer(),S=new Uint8Array(N),l=h.load(S);t.scene.three.add(l);const o=s.get(A);o.byEntity(l);o.byIfcRel(l,d,"storeys");o.byModel(l.uuid,l);const T=o.find({entities:["IFCWALLSTANDARDCASE"]}),v=o.find({entities:["IFCSLAB"]}),$=o.find({entities:["IFCMEMBER","IFCPLATE"]}),M=o.find({entities:["IFCFURNISHINGELEMENT"]}),U=o.find({entities:["IFCDOOR"]}),B=o.find({models:[l.uuid]}),i=new u;i.showPanel(2);document.body.append(i.dom);i.dom.style.left="0px";i.dom.style.zIndex="unset";t.renderer.onBeforeUpdate.add(()=>i.begin());t.renderer.onAfterUpdate.add(()=>i.end());b.init();const e=new m,r=a.create(()=>c` @@ -9,22 +9,22 @@ import{a3 as d,C as m}from"./web-ifc-api-CgBULNZm.js";import{S as u}from"./stats + @input="${({target:n})=>{e.set(n.color),o.setColor(v,e)}}"> + @input="${({target:n})=>{e.set(n.color),o.setColor($,e)}}"> + @input="${({target:n})=>{e.set(n.color),o.setColor(M,e)}}"> + @input="${({target:n})=>{e.set(n.color),o.setColor(U,e)}}"> {n.enabled&&n.create(e)};window.onkeydown=t=>{(t.code==="Delete"||t.code==="Backspace")&&n.enabled&&n.delete(e)};const s=new f;s.showPanel(2);document.body.append(s.dom);s.dom.style.left="0px";s.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>s.begin());e.renderer.onAfterUpdate.add(()=>s.end());k.init();const i=m.create(()=>p` +import{B as w,M as y,a as d,b as c,L as b}from"./web-ifc-api-JuXSH2nk.js";import{S as f}from"./stats.min-GTpOrGrX.js";import{d as k,R as m,m as p}from"./index-CqPyogbW.js";import{o as x,a as v,M as P,N as $,h as B,t as I,l as L}from"./index-DtdmE_hK.js";import{$ as C,K as D,c as z}from"./index-Cm7YlCft.js";import"./_commonjsHelpers-Cpj98o6Y.js";const u=document.getElementById("container"),o=new x,E=o.get(v),e=E.create();e.scene=new P(o);e.renderer=new C(o,u);e.camera=new $(o);e.renderer.postproduction.enabled=!0;e.renderer.postproduction.customEffects.outlineEnabled=!0;o.init();e.camera.controls.setLookAt(12,6,8,0,0,-10);e.scene.setup();const h=o.get(B);h.config.color.setHex(6710886);const S=h.create(e);e.renderer.postproduction.customEffects.excludedMeshes.push(S.three);e.scene.three.background=null;const M=new w(3,3,3),g=new y({color:"#6528D7"}),a=new d(M,g);a.position.set(-2,1.5,0);e.scene.three.add(a);e.meshes.add(a);const l=new d(M,g);l.position.set(2,1.5,0);e.scene.three.add(l);e.meshes.add(l);const R=o.get(I);R.get(e);const n=o.get(L);n.enabled=!0;const r=o.get(D);n.Type=z;const A=new c({color:"lightblue",side:2}),O=new b({color:"blue"}),F=new c({color:"blue",opacity:.5,side:2,transparent:!0});r.styles.create("Red lines",new Set([a]),e,O,A,F);const G=new c({color:"salmon",side:2}),K=new b({color:"red"}),N=new c({color:"red",opacity:.5,side:2,transparent:!0});r.styles.create("Blue lines",new Set([l]),e,K,G,N);u.ondblclick=()=>{n.enabled&&n.create(e)};window.onkeydown=t=>{(t.code==="Delete"||t.code==="Backspace")&&n.enabled&&n.delete(e)};const s=new f;s.showPanel(2);document.body.append(s.dom);s.dom.style.left="0px";s.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>s.begin());e.renderer.onAfterUpdate.add(()=>s.end());k.init();const i=m.create(()=>p` diff --git a/examples/assets/clipper.js b/examples/assets/clipper.js index 6e60fa58e..5cf04ec75 100644 --- a/examples/assets/clipper.js +++ b/examples/assets/clipper.js @@ -1,4 +1,4 @@ -import{B as r,M as m,a as d}from"./web-ifc-api-CgBULNZm.js";import{S as p}from"./stats.min-GTpOrGrX.js";import{d as u,R as s,m as c}from"./index-CqPyogbW.js";import{o as h,a as g,L as k,M as w,N as y,K as M,d as f}from"./index-c9A1IUGD.js";import"./_commonjsHelpers-Cpj98o6Y.js";const b=document.getElementById("container"),a=new h,v=a.get(g),e=v.create();e.scene=new k(a);e.renderer=new w(a,b);e.camera=new y(a);a.init();e.camera.controls.setLookAt(10,10,10,0,0,0);e.scene.setup();e.scene.three.background=null;const x=new r(3,3,3),$=new m({color:"#6528D7"}),o=new d(x,$);o.position.set(0,1.5,0);e.scene.three.add(o);e.meshes.add(o);const P=a.get(M);P.get(e);const t=a.get(f);t.enabled=!0;b.ondblclick=()=>{t.enabled&&t.create(e)};window.onkeydown=n=>{(n.code==="Delete"||n.code==="Backspace")&&t.enabled&&t.delete(e)};const l=new p;l.showPanel(2);document.body.append(l.dom);l.dom.style.left="0px";l.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>l.begin());e.renderer.onAfterUpdate.add(()=>l.end());u.init();const i=s.create(()=>c` +import{B as r,M as m,a as d}from"./web-ifc-api-JuXSH2nk.js";import{S as p}from"./stats.min-GTpOrGrX.js";import{d as u,R as s,m as c}from"./index-CqPyogbW.js";import{o as h,a as g,M as k,v as w,N as v,t as y,l as M}from"./index-DtdmE_hK.js";import"./_commonjsHelpers-Cpj98o6Y.js";const b=document.getElementById("container"),a=new h,f=a.get(g),e=f.create();e.scene=new k(a);e.renderer=new w(a,b);e.camera=new v(a);a.init();e.camera.controls.setLookAt(10,10,10,0,0,0);e.scene.setup();e.scene.three.background=null;const x=new r(3,3,3),$=new m({color:"#6528D7"}),o=new d(x,$);o.position.set(0,1.5,0);e.scene.three.add(o);e.meshes.add(o);const P=a.get(y);P.get(e);const t=a.get(M);t.enabled=!0;b.ondblclick=()=>{t.enabled&&t.create(e)};window.onkeydown=n=>{(n.code==="Delete"||n.code==="Backspace")&&t.enabled&&t.delete(e)};const l=new p;l.showPanel(2);document.body.append(l.dom);l.dom.style.left="0px";l.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>l.begin());e.renderer.onAfterUpdate.add(()=>l.end());u.init();const i=s.create(()=>c` diff --git a/examples/assets/cullers.js b/examples/assets/cullers.js index e6290f6d5..e50826661 100644 --- a/examples/assets/cullers.js +++ b/examples/assets/cullers.js @@ -1 +1 @@ -import{B as c,ad as l,a as i}from"./web-ifc-api-CgBULNZm.js";import{S as m}from"./stats.min-GTpOrGrX.js";import{o as p,a as u,L as y,M as b,N as g,l as f,c as w}from"./index-c9A1IUGD.js";import"./_commonjsHelpers-Cpj98o6Y.js";const h=document.getElementById("container"),t=new p,M=t.get(u),e=M.create();e.scene=new y(t);e.renderer=new b(t,h);e.camera=new g(t);t.init();e.camera.controls.setLookAt(13,13,13,0,0,0);e.scene.setup();const x=t.get(f);x.create(e);e.scene.three.background=null;const L=t.get(w),o=L.create(e);o.threshold=200;o.renderDebugFrame=!0;const s=o.renderer.domElement;document.body.appendChild(s);s.style.position="fixed";s.style.left="0";s.style.bottom="0";s.style.visibility="collapse";const B=new c(2,2,2),U=new l({color:"#6528D7"});function d(a){return Math.random()*a}function E(){for(let a=0;a<300;a++){const n=new i(B,U);n.position.x=d(10),n.position.y=d(10),n.position.z=d(10),n.updateMatrix(),e.scene.three.add(n),o.add(n)}}E();o.needsUpdate=!0;e.camera.controls.addEventListener("controlend",()=>{o.needsUpdate=!0});const r=new m;r.showPanel(2);document.body.append(r.dom);r.dom.style.left="0px";r.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>r.begin());e.renderer.onAfterUpdate.add(()=>r.end()); +import{B as c,ad as l,a as i}from"./web-ifc-api-JuXSH2nk.js";import{S as m}from"./stats.min-GTpOrGrX.js";import{o as p,a as u,M as y,v as b,N as g,h as f,c as h}from"./index-DtdmE_hK.js";import"./_commonjsHelpers-Cpj98o6Y.js";const w=document.getElementById("container"),t=new p,M=t.get(u),e=M.create();e.scene=new y(t);e.renderer=new b(t,w);e.camera=new g(t);t.init();e.camera.controls.setLookAt(13,13,13,0,0,0);e.scene.setup();const x=t.get(f);x.create(e);e.scene.three.background=null;const v=t.get(h),o=v.create(e);o.threshold=200;o.renderDebugFrame=!0;const s=o.renderer.domElement;document.body.appendChild(s);s.style.position="fixed";s.style.left="0";s.style.bottom="0";s.style.visibility="collapse";const B=new c(2,2,2),U=new l({color:"#6528D7"});function d(a){return Math.random()*a}function E(){for(let a=0;a<300;a++){const n=new i(B,U);n.position.x=d(10),n.position.y=d(10),n.position.z=d(10),n.updateMatrix(),e.scene.three.add(n),o.add(n)}}E();o.needsUpdate=!0;e.camera.controls.addEventListener("controlend",()=>{o.needsUpdate=!0});const r=new m;r.showPanel(2);document.body.append(r.dom);r.dom.style.left="0px";r.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>r.begin());e.renderer.onAfterUpdate.add(()=>r.end()); diff --git a/examples/assets/edgeMeasurement.js b/examples/assets/edgeMeasurement.js index a37c27c89..282b86a28 100644 --- a/examples/assets/edgeMeasurement.js +++ b/examples/assets/edgeMeasurement.js @@ -1 +1 @@ -import{a as c}from"./web-ifc-api-CgBULNZm.js";import{S as i}from"./stats.min-GTpOrGrX.js";import{o as l,a as m,L as f,N as w,l as p,_ as g}from"./index-c9A1IUGD.js";import{$ as h,n as u}from"./index-UqY4hWbC.js";import"./_commonjsHelpers-Cpj98o6Y.js";const r=document.getElementById("container"),t=new l,y=t.get(m),e=y.create();e.scene=new f(t);e.renderer=new h(t,r);e.camera=new w(t);t.init();e.camera.controls.setLookAt(5,5,5,0,0,0);e.scene.setup();const b=t.get(p);b.create(e);e.scene.three.background=null;const L=new g(t),k=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),A=await k.arrayBuffer(),B=new Uint8Array(A),d=L.load(B);e.scene.three.add(d);for(const o of d.children)o instanceof c&&e.meshes.add(o);const n=t.get(u);n.world=e;n.enabled=!0;r.ondblclick=()=>n.create();let a;window.addEventListener("keydown",o=>{o.code==="KeyO"?n.delete():o.code==="KeyS"?(a=n.get(),n.deleteAll()):o.code==="KeyL"&&a&&n.set(a)});const s=new i;s.showPanel(2);document.body.append(s.dom);s.dom.style.left="0px";s.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>s.begin());e.renderer.onAfterUpdate.add(()=>s.end()); +import{a as c}from"./web-ifc-api-JuXSH2nk.js";import{S as i}from"./stats.min-GTpOrGrX.js";import{o as l,a as m,M as f,N as w,h as p,_ as h}from"./index-DtdmE_hK.js";import{$ as g,n as u}from"./index-Cm7YlCft.js";import"./_commonjsHelpers-Cpj98o6Y.js";const r=document.getElementById("container"),t=new l,y=t.get(m),e=y.create();e.scene=new f(t);e.renderer=new g(t,r);e.camera=new w(t);t.init();e.camera.controls.setLookAt(5,5,5,0,0,0);e.scene.setup();const b=t.get(p);b.create(e);e.scene.three.background=null;const k=new h(t),A=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),B=await A.arrayBuffer(),K=new Uint8Array(B),d=k.load(K);e.scene.three.add(d);for(const o of d.children)o instanceof c&&e.meshes.add(o);const n=t.get(u);n.world=e;n.enabled=!0;r.ondblclick=()=>n.create();let a;window.addEventListener("keydown",o=>{o.code==="KeyO"?n.delete():o.code==="KeyS"?(a=n.get(),n.deleteAll()):o.code==="KeyL"&&a&&n.set(a)});const s=new i;s.showPanel(2);document.body.append(s.dom);s.dom.style.left="0px";s.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>s.begin());e.renderer.onAfterUpdate.add(()=>s.end()); diff --git a/examples/assets/exploder.js b/examples/assets/exploder.js index 7a4bb8dfe..4b5b597ce 100644 --- a/examples/assets/exploder.js +++ b/examples/assets/exploder.js @@ -1,4 +1,4 @@ -import{av as l}from"./web-ifc-api-CgBULNZm.js";import{S as d}from"./stats.min-GTpOrGrX.js";import{d as m,R as a,m as i}from"./index-CqPyogbW.js";import{o as p,a as b,L as u,M as g,N as f,l as h,_ as w,J as y,y as x,b as L}from"./index-c9A1IUGD.js";import"./_commonjsHelpers-Cpj98o6Y.js";const v=document.getElementById("container"),e=new p,S=e.get(b),t=S.create();t.scene=new u(e);t.renderer=new g(e,v);t.camera=new f(e);e.init();t.camera.controls.setLookAt(12,6,8,0,0,-10);t.scene.setup();const k=e.get(h);k.create(t);t.scene.three.background=null;const I=new w(e),R=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),_=await R.arrayBuffer(),B=new Uint8Array(_),s=I.load(B);t.scene.three.add(s);const E=await fetch("https://thatopen.github.io/engine_components/resources/small.json");s.setLocalProperties(await E.json());const r=e.get(y),M=await fetch("https://thatopen.github.io/engine_components/resources/small-relations.json"),N=r.getRelationsMapFromJSON(await M.text());r.setRelationMap(s,N);const U=e.get(x),j=e.get(L);await j.bySpatialStructure(s,{isolate:new Set([l])});const n=new d;n.showPanel(2);document.body.append(n.dom);n.dom.style.left="0px";n.dom.style.zIndex="unset";t.renderer.onBeforeUpdate.add(()=>n.begin());t.renderer.onAfterUpdate.add(()=>n.end());m.init();const o=a.create(()=>i` +import{av as l}from"./web-ifc-api-JuXSH2nk.js";import{S as d}from"./stats.min-GTpOrGrX.js";import{d as m,R as a,m as i}from"./index-CqPyogbW.js";import{o as p,a as b,M as u,v as g,N as h,h as w,_ as f,x,w as v,b as y}from"./index-DtdmE_hK.js";import"./_commonjsHelpers-Cpj98o6Y.js";const S=document.getElementById("container"),e=new p,L=e.get(b),t=L.create();t.scene=new u(e);t.renderer=new g(e,S);t.camera=new h(e);e.init();t.camera.controls.setLookAt(12,6,8,0,0,-10);t.scene.setup();const k=e.get(w);k.create(t);t.scene.three.background=null;const I=new f(e),R=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),_=await R.arrayBuffer(),B=new Uint8Array(_),s=I.load(B);t.scene.three.add(s);const E=await fetch("https://thatopen.github.io/engine_components/resources/small.json");s.setLocalProperties(await E.json());const r=e.get(x),M=await fetch("https://thatopen.github.io/engine_components/resources/small-relations.json"),N=r.getRelationsMapFromJSON(await M.text());r.setRelationMap(s,N);const U=e.get(v),j=e.get(y);await j.bySpatialStructure(s,{isolate:new Set([l])});const n=new d;n.showPanel(2);document.body.append(n.dom);n.dom.style.left="0px";n.dom.style.zIndex="unset";t.renderer.onBeforeUpdate.add(()=>n.begin());t.renderer.onAfterUpdate.add(()=>n.end());m.init();const o=a.create(()=>i` n.create();let a;window.addEventListener("keydown",o=>{o.code==="KeyO"?n.delete():o.code==="KeyS"?(a=n.get(),n.deleteAll()):o.code==="KeyL"&&a&&n.set(a)});const s=new i;s.showPanel(2);document.body.append(s.dom);s.dom.style.left="0px";s.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>s.begin());e.renderer.onAfterUpdate.add(()=>s.end()); +import{a as c}from"./web-ifc-api-JuXSH2nk.js";import{S as i}from"./stats.min-GTpOrGrX.js";import{o as l,a as m,M as f,N as w,h as p,_ as h}from"./index-DtdmE_hK.js";import{$ as g,t as u}from"./index-Cm7YlCft.js";import"./_commonjsHelpers-Cpj98o6Y.js";const r=document.getElementById("container"),t=new l,y=t.get(m),e=y.create();e.scene=new f(t);e.renderer=new g(t,r);e.camera=new w(t);t.init();e.camera.controls.setLookAt(5,5,5,0,0,0);e.scene.setup();const b=t.get(p);b.create(e);e.scene.three.background=null;const k=new h(t),A=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),B=await A.arrayBuffer(),K=new Uint8Array(B),d=k.load(K);e.scene.three.add(d);for(const o of d.children)o instanceof c&&e.meshes.add(o);const n=t.get(u);n.world=e;n.enabled=!0;r.ondblclick=()=>n.create();let a;window.addEventListener("keydown",o=>{o.code==="KeyO"?n.delete():o.code==="KeyS"?(a=n.get(),n.deleteAll()):o.code==="KeyL"&&a&&n.set(a)});const s=new i;s.showPanel(2);document.body.append(s.dom);s.dom.style.left="0px";s.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>s.begin());e.renderer.onAfterUpdate.add(()=>s.end()); diff --git a/examples/assets/fragmentsManager.js b/examples/assets/fragmentsManager.js index da120656c..1ffe5ea0a 100644 --- a/examples/assets/fragmentsManager.js +++ b/examples/assets/fragmentsManager.js @@ -1,4 +1,4 @@ -import"./web-ifc-api-CgBULNZm.js";import{S as u}from"./stats.min-GTpOrGrX.js";import{o as p,a as b,L as g,M as f,N as w,l as h,_ as y}from"./index-c9A1IUGD.js";import{d as L,R as l,m as d}from"./index-CqPyogbW.js";import"./_commonjsHelpers-Cpj98o6Y.js";const k=document.getElementById("container"),n=new p,v=n.get(b),e=v.create();e.scene=new g(n);e.renderer=new f(n,k);e.camera=new w(n);n.init();e.camera.controls.setLookAt(12,6,8,0,0,-10);e.scene.setup();const x=n.get(h);x.create(e);e.scene.three.background=null;const s=n.get(y);let m="";async function F(){if(s.groups.size)return;const t=await(await fetch("https://thatopen.github.io/engine_components/resources/small.frag")).arrayBuffer(),c=new Uint8Array(t),r=s.load(c);e.scene.three.add(r),m=r.uuid}function U(o){const t=document.createElement("a");t.href=URL.createObjectURL(o),t.download=o.name,document.body.appendChild(t),t.click(),t.remove()}function B(){if(!s.groups.size)return;const o=s.groups.get(m);if(!o)return;const t=s.export(o),c=new Blob([t]),r=new File([c],"small.frag");U(r)}function R(){s.dispose()}const a=new u;a.showPanel(2);document.body.append(a.dom);a.dom.style.left="0px";a.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>a.begin());e.renderer.onAfterUpdate.add(()=>a.end());L.init();const i=l.create(()=>d` +import"./web-ifc-api-JuXSH2nk.js";import{S as u}from"./stats.min-GTpOrGrX.js";import{o as p,a as b,M as g,v as f,N as w,h,_ as y}from"./index-DtdmE_hK.js";import{d as k,R as l,m as d}from"./index-CqPyogbW.js";import"./_commonjsHelpers-Cpj98o6Y.js";const v=document.getElementById("container"),n=new p,L=n.get(b),e=L.create();e.scene=new g(n);e.renderer=new f(n,v);e.camera=new w(n);n.init();e.camera.controls.setLookAt(12,6,8,0,0,-10);e.scene.setup();const x=n.get(h);x.create(e);e.scene.three.background=null;const s=n.get(y);let m="";async function F(){if(s.groups.size)return;const t=await(await fetch("https://thatopen.github.io/engine_components/resources/small.frag")).arrayBuffer(),c=new Uint8Array(t),r=s.load(c);e.scene.three.add(r),m=r.uuid}function U(o){const t=document.createElement("a");t.href=URL.createObjectURL(o),t.download=o.name,document.body.appendChild(t),t.click(),t.remove()}function B(){if(!s.groups.size)return;const o=s.groups.get(m);if(!o)return;const t=s.export(o),c=new Blob([t]),r=new File([c],"small.frag");U(r)}function R(){s.dispose()}const a=new u;a.showPanel(2);document.body.append(a.dom);a.dom.style.left="0px";a.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>a.begin());e.renderer.onAfterUpdate.add(()=>a.end());k.init();const i=l.create(()=>d` diff --git a/examples/assets/grids.js b/examples/assets/grids.js index 35b95ddd1..737f490db 100644 --- a/examples/assets/grids.js +++ b/examples/assets/grids.js @@ -1 +1 @@ -import{a as t,B as s}from"./web-ifc-api-CgBULNZm.js";import{o as r,a,L as d,M as c,N as l,l as m}from"./index-c9A1IUGD.js";const w=document.getElementById("container"),n=new r,i=n.get(a),e=i.create();e.scene=new d(n);e.renderer=new c(n,w);e.camera=new l(n);n.init();const g=new t(new s);e.scene.three.add(g);e.scene.three.background=null;const p=n.get(m),u=p.create(e);console.log(u);const o=new Stats;o.showPanel(2);document.body.append(o.dom);o.dom.style.left="0px";o.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>o.begin());e.renderer.onAfterUpdate.add(()=>o.end()); +import{a as t,B as s}from"./web-ifc-api-JuXSH2nk.js";import{o as r,a,M as d,v as c,N as m,h as l}from"./index-DtdmE_hK.js";const w=document.getElementById("container"),n=new r,i=n.get(a),e=i.create();e.scene=new d(n);e.renderer=new c(n,w);e.camera=new m(n);n.init();const g=new t(new s);e.scene.three.add(g);e.scene.three.background=null;const p=n.get(l),h=p.create(e);console.log(h);const o=new Stats;o.showPanel(2);document.body.append(o.dom);o.dom.style.left="0px";o.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>o.begin());e.renderer.onAfterUpdate.add(()=>o.end()); diff --git a/examples/assets/hider.js b/examples/assets/hider.js index 686682454..5e78a22bf 100644 --- a/examples/assets/hider.js +++ b/examples/assets/hider.js @@ -1,4 +1,4 @@ -import{av as S}from"./web-ifc-api-CgBULNZm.js";import{S as k}from"./stats.min-GTpOrGrX.js";import{d as x,R as r,m as l}from"./index-CqPyogbW.js";import{o as v,a as L,L as F,M as C,N as I,l as M,_ as N,J as _,m as j,b as R}from"./index-c9A1IUGD.js";import"./_commonjsHelpers-Cpj98o6Y.js";const $=document.getElementById("container"),e=new v,B=e.get(L),t=B.create();t.scene=new F(e);t.renderer=new C(e,$);t.camera=new I(e);e.init();t.camera.controls.setLookAt(12,6,8,0,0,-10);t.scene.setup();const E=e.get(M);E.create(t);t.scene.three.background=null;const b=e.get(N),O=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),U=await O.arrayBuffer(),A=new Uint8Array(U),i=b.load(A);t.scene.three.add(i);const J=await fetch("https://thatopen.github.io/engine_components/resources/small.json");i.setLocalProperties(await J.json());const d=e.get(_),q=await fetch("https://thatopen.github.io/engine_components/resources/small-relations.json"),D=d.getRelationsMapFromJSON(await q.text());d.setRelationMap(i,D);const f=e.get(j),s=e.get(R);s.byEntity(i);await s.bySpatialStructure(i,{isolate:new Set([S])});const a=new k;a.showPanel(2);document.body.append(a.dom);a.dom.style.left="0px";a.dom.style.zIndex="unset";t.renderer.onBeforeUpdate.add(()=>a.begin());t.renderer.onAfterUpdate.add(()=>a.end());x.init();const g={},P=Object.keys(s.list.spatialStructures);for(const n of P)g[n]=!0;const h={},T=Object.keys(s.list.entities);for(const n of T)h[n]=!0;const o=r.create(()=>l` +import{av as S}from"./web-ifc-api-JuXSH2nk.js";import{S as k}from"./stats.min-GTpOrGrX.js";import{d as x,R as r,m as l}from"./index-CqPyogbW.js";import{o as v,a as I,M as F,v as C,N as L,h as M,_ as N,x as _,I as j,b as R}from"./index-DtdmE_hK.js";import"./_commonjsHelpers-Cpj98o6Y.js";const $=document.getElementById("container"),e=new v,B=e.get(I),t=B.create();t.scene=new F(e);t.renderer=new C(e,$);t.camera=new L(e);e.init();t.camera.controls.setLookAt(12,6,8,0,0,-10);t.scene.setup();const E=e.get(M);E.create(t);t.scene.three.background=null;const b=e.get(N),O=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),U=await O.arrayBuffer(),A=new Uint8Array(U),i=b.load(A);t.scene.three.add(i);const q=await fetch("https://thatopen.github.io/engine_components/resources/small.json");i.setLocalProperties(await q.json());const d=e.get(_),D=await fetch("https://thatopen.github.io/engine_components/resources/small-relations.json"),P=d.getRelationsMapFromJSON(await D.text());d.setRelationMap(i,P);const f=e.get(j),s=e.get(R);s.byEntity(i);await s.bySpatialStructure(i,{isolate:new Set([S])});const a=new k;a.showPanel(2);document.body.append(a.dom);a.dom.style.left="0px";a.dom.style.zIndex="unset";t.renderer.onBeforeUpdate.add(()=>a.begin());t.renderer.onAfterUpdate.add(()=>a.end());x.init();const g={},T=Object.keys(s.list.spatialStructures);for(const n of T)g[n]=!0;const h={},z=Object.keys(s.list.entities);for(const n of z)h[n]=!0;const o=r.create(()=>l` @@ -9,16 +9,16 @@ import{av as S}from"./web-ifc-api-CgBULNZm.js";import{S as k}from"./stats.min-GT - `);document.body.append(o);const z=o.querySelector("bim-panel-section[name='Floors']"),G=o.querySelector("bim-panel-section[name='Categories']");for(const n in g){const m=r.create(()=>l` + `);document.body.append(o);const G=o.querySelector("bim-panel-section[name='Floors']"),H=o.querySelector("bim-panel-section[name='Categories']");for(const n in g){const m=r.create(()=>l` - `);z.append(m)}for(const n in h){const m=r.create(()=>l` + `);G.append(m)}for(const n in h){const m=r.create(()=>l` - `);G.append(m)}const H=r.create(()=>l` + `);H.append(m)}const J=r.create(()=>l` - `);document.body.append(H); + `);document.body.append(J); diff --git a/examples/assets/highlighter.js b/examples/assets/highlighter.js index 0f1e7ab0a..a0284e5e6 100644 --- a/examples/assets/highlighter.js +++ b/examples/assets/highlighter.js @@ -1 +1 @@ -import{b as s}from"./web-ifc-api-CgBULNZm.js";import{o as c,a as d,L as l,N as i,l as m,_ as p}from"./index-c9A1IUGD.js";import{$ as u,r as g,W as f}from"./index-UqY4hWbC.js";import{S as h}from"./stats.min-GTpOrGrX.js";import"./_commonjsHelpers-Cpj98o6Y.js";const w=document.getElementById("container"),t=new c,b=t.get(d),e=b.create();e.scene=new l(t);e.renderer=new u(t,w);e.camera=new i(t);t.init();e.renderer.postproduction.enabled=!0;e.camera.controls.setLookAt(12,6,8,0,0,-10);e.scene.setup();const x=t.get(m),y=x.create(e);e.renderer.postproduction.customEffects.excludedMeshes.push(y.three);e.scene.three.background=null;const B=new p(t),A=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),L=await A.arrayBuffer(),M=new Uint8Array(L),S=B.load(M);e.scene.three.add(S);const r=t.get(g);r.setup({world:e});r.zoomToSelection=!0;const n=t.get(f);n.world=e;n.enabled=!0;n.create("example",new s({color:12382500,transparent:!0,opacity:.5}));r.events.select.onHighlight.add(a=>{n.clear("example"),n.add("example",a)});r.events.select.onClear.add(()=>{n.clear("example")});const o=new h;o.showPanel(2);document.body.append(o.dom);o.dom.style.left="0px";o.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>o.begin());e.renderer.onAfterUpdate.add(()=>o.end()); +import{b as s}from"./web-ifc-api-JuXSH2nk.js";import{o as c,a as d,M as l,N as i,h as m,_ as p}from"./index-DtdmE_hK.js";import{$ as u,r as h,W as g}from"./index-Cm7YlCft.js";import{S as f}from"./stats.min-GTpOrGrX.js";import"./_commonjsHelpers-Cpj98o6Y.js";const w=document.getElementById("container"),t=new c,b=t.get(d),e=b.create();e.scene=new l(t);e.renderer=new u(t,w);e.camera=new i(t);t.init();e.renderer.postproduction.enabled=!0;e.camera.controls.setLookAt(12,6,8,0,0,-10);e.scene.setup();const x=t.get(m),y=x.create(e);e.renderer.postproduction.customEffects.excludedMeshes.push(y.three);e.scene.three.background=null;const M=new p(t),B=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),A=await B.arrayBuffer(),S=new Uint8Array(A),U=M.load(S);e.scene.three.add(U);const r=t.get(h);r.setup({world:e});r.zoomToSelection=!0;const n=t.get(g);n.world=e;n.enabled=!0;n.create("example",new s({color:12382500,transparent:!0,opacity:.5}));r.events.select.onHighlight.add(a=>{n.clear("example"),n.add("example",a)});r.events.select.onClear.add(()=>{n.clear("example")});const o=new f;o.showPanel(2);document.body.append(o.dom);o.dom.style.left="0px";o.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>o.begin());e.renderer.onAfterUpdate.add(()=>o.end()); diff --git a/examples/assets/ifcGeometryTiler.js b/examples/assets/ifcGeometryTiler.js index 04e257b7c..164503314 100644 --- a/examples/assets/ifcGeometryTiler.js +++ b/examples/assets/ifcGeometryTiler.js @@ -1,4 +1,4 @@ -import"./web-ifc-api-CgBULNZm.js";import{S as w}from"./stats.min-GTpOrGrX.js";import{d as h,R as b,m as g}from"./index-CqPyogbW.js";import{o as y,a as L,L as F,M as B,N as I,l as S,_ as U,w as k}from"./index-c9A1IUGD.js";import"./_commonjsHelpers-Cpj98o6Y.js";const v=document.getElementById("container"),a=new y,A=a.get(L),t=A.create();t.scene=new F(a);t.renderer=new B(a,v);t.camera=new I(a);a.init();t.camera.controls.setLookAt(12,6,8,0,0,-10);t.scene.setup();const D=a.get(S);D.create(t);t.scene.three.background=null;const R=new U(a),N=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),_=await N.arrayBuffer(),j=new Uint8Array(_),x=R.load(j);t.scene.three.add(x);const i=a.get(k),z={path:"https://unpkg.com/web-ifc@0.0.57/",absolute:!0};i.settings.wasm=z;i.settings.minGeometrySize=20;i.settings.minAssetsSize=1e3;let l=[],f={},u=1;i.onGeometryStreamed.add(e=>{const{buffer:s,data:n}=e,o=`small.ifc-processed-geometries-${u}`;for(const c in n){const p=n[c];p.geometryFile=o,f[c]=p}l.push({name:o,bits:[s]}),u++});let d=[];i.onAssetStreamed.add(e=>{d=[...d,...e]});i.onIfcLoaded.add(e=>{l.push({name:"small.ifc-processed-global",bits:[e]})});function C(e,...s){const n=new File(s,e),o=document.createElement("a"),c=URL.createObjectURL(n);o.href=c,o.download=n.name,o.click(),URL.revokeObjectURL(c)}async function G(e){for(const{name:s,bits:n}of e)C(s,...n),await new Promise(o=>{setTimeout(o,100)})}i.onProgress.add(e=>{e===1&&setTimeout(async()=>{const s={geometries:f,assets:d,globalDataFileId:"small.ifc-processed-global"};l.push({name:"small.ifc-processed.json",bits:[JSON.stringify(s)]}),await G(l),d=[],f={},l=[],u=1})});async function O(){const s=await(await fetch("https://thatopen.github.io/engine_components/resources/small.ifc")).arrayBuffer(),n=new Uint8Array(s);await i.streamFromBuffer(n)}const r=new w;r.showPanel(2);document.body.append(r.dom);r.dom.style.left="0px";r.dom.style.zIndex="unset";t.renderer.onBeforeUpdate.add(()=>r.begin());t.renderer.onAfterUpdate.add(()=>r.end());h.init();const m=b.create(()=>g` +import"./web-ifc-api-JuXSH2nk.js";import{S as w}from"./stats.min-GTpOrGrX.js";import{d as h,R as b,m as g}from"./index-CqPyogbW.js";import{o as y,a as F,M as L,v,N as B,h as I,_ as S,F as U}from"./index-DtdmE_hK.js";import"./_commonjsHelpers-Cpj98o6Y.js";const k=document.getElementById("container"),a=new y,A=a.get(F),t=A.create();t.scene=new L(a);t.renderer=new v(a,k);t.camera=new B(a);a.init();t.camera.controls.setLookAt(12,6,8,0,0,-10);t.scene.setup();const D=a.get(I);D.create(t);t.scene.three.background=null;const R=new S(a),N=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),_=await N.arrayBuffer(),j=new Uint8Array(_),x=R.load(j);t.scene.three.add(x);const i=a.get(U),z={path:"https://unpkg.com/web-ifc@0.0.57/",absolute:!0};i.settings.wasm=z;i.settings.minGeometrySize=20;i.settings.minAssetsSize=1e3;let l=[],f={},u=1;i.onGeometryStreamed.add(e=>{const{buffer:s,data:n}=e,o=`small.ifc-processed-geometries-${u}`;for(const c in n){const p=n[c];p.geometryFile=o,f[c]=p}l.push({name:o,bits:[s]}),u++});let d=[];i.onAssetStreamed.add(e=>{d=[...d,...e]});i.onIfcLoaded.add(e=>{l.push({name:"small.ifc-processed-global",bits:[e]})});function C(e,...s){const n=new File(s,e),o=document.createElement("a"),c=URL.createObjectURL(n);o.href=c,o.download=n.name,o.click(),URL.revokeObjectURL(c)}async function G(e){for(const{name:s,bits:n}of e)C(s,...n),await new Promise(o=>{setTimeout(o,100)})}i.onProgress.add(e=>{e===1&&setTimeout(async()=>{const s={geometries:f,assets:d,globalDataFileId:"small.ifc-processed-global"};l.push({name:"small.ifc-processed.json",bits:[JSON.stringify(s)]}),await G(l),d=[],f={},l=[],u=1})});async function O(){const s=await(await fetch("https://thatopen.github.io/engine_components/resources/small.ifc")).arrayBuffer(),n=new Uint8Array(s);await i.streamFromBuffer(n)}const r=new w;r.showPanel(2);document.body.append(r.dom);r.dom.style.left="0px";r.dom.style.zIndex="unset";t.renderer.onBeforeUpdate.add(()=>r.begin());t.renderer.onAfterUpdate.add(()=>r.end());h.init();const m=b.create(()=>g` diff --git a/examples/assets/ifcJsonExporter.js b/examples/assets/ifcJsonExporter.js index 91729a483..18d31cb78 100644 --- a/examples/assets/ifcJsonExporter.js +++ b/examples/assets/ifcJsonExporter.js @@ -1,4 +1,4 @@ -import{ac as m}from"./web-ifc-api-CgBULNZm.js";import{S as b}from"./stats.min-GTpOrGrX.js";import{d as f,R as c,m as i}from"./index-CqPyogbW.js";import{o as u,a as w,L as g,M as h,N as y,l as L,_ as k,p as x}from"./index-c9A1IUGD.js";import"./_commonjsHelpers-Cpj98o6Y.js";const I=document.getElementById("container"),t=new u,U=t.get(w),e=U.create();e.scene=new g(t);e.renderer=new h(t,I);e.camera=new y(t);t.init();e.camera.controls.setLookAt(12,6,8,0,0,-10);e.scene.setup();const v=t.get(L);v.create(e);e.scene.three.background=null;const B=new k(t),O=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),R=await O.arrayBuffer(),S=new Uint8Array(R),A=B.load(S);e.scene.three.add(A);const N=t.get(x),a=new m;a.SetWasmPath("https://unpkg.com/web-ifc@0.0.57/",!0);await a.Init();const j=await fetch("https://thatopen.github.io/engine_components/resources/small.ifc"),E=await j.arrayBuffer(),F=new Uint8Array(E),_=a.OpenModel(F),n=new b;n.showPanel(2);document.body.append(n.dom);n.dom.style.left="0px";n.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>n.begin());e.renderer.onAfterUpdate.add(()=>n.end());f.init();const s=c.create(()=>i` +import{ac as m}from"./web-ifc-api-JuXSH2nk.js";import{S as b}from"./stats.min-GTpOrGrX.js";import{d as f,R as c,m as i}from"./index-CqPyogbW.js";import{o as u,a as g,M as w,v as h,N as y,h as v,_ as k,g as x}from"./index-DtdmE_hK.js";import"./_commonjsHelpers-Cpj98o6Y.js";const I=document.getElementById("container"),t=new u,L=t.get(g),e=L.create();e.scene=new w(t);e.renderer=new h(t,I);e.camera=new y(t);t.init();e.camera.controls.setLookAt(12,6,8,0,0,-10);e.scene.setup();const U=t.get(v);U.create(e);e.scene.three.background=null;const B=new k(t),O=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),R=await O.arrayBuffer(),S=new Uint8Array(R),A=B.load(S);e.scene.three.add(A);const N=t.get(x),a=new m;a.SetWasmPath("https://unpkg.com/web-ifc@0.0.57/",!0);await a.Init();const j=await fetch("https://thatopen.github.io/engine_components/resources/small.ifc"),E=await j.arrayBuffer(),F=new Uint8Array(E),_=a.OpenModel(F),n=new b;n.showPanel(2);document.body.append(n.dom);n.dom.style.left="0px";n.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>n.begin());e.renderer.onAfterUpdate.add(()=>n.end());f.init();const s=c.create(()=>i` diff --git a/examples/assets/ifcLoader.js b/examples/assets/ifcLoader.js index 7ad463b61..e7f35d814 100644 --- a/examples/assets/ifcLoader.js +++ b/examples/assets/ifcLoader.js @@ -1,10 +1,10 @@ -import{bd as b,be as u,bf as f}from"./web-ifc-api-CgBULNZm.js";import{d as g,R as m,m as p}from"./index-CqPyogbW.js";import{S as w}from"./stats.min-GTpOrGrX.js";import{o as I,a as y,L,M as C,N,l as E,_ as F,E as R}from"./index-c9A1IUGD.js";import"./_commonjsHelpers-Cpj98o6Y.js";const h=document.getElementById("container"),o=new I,O=o.get(y),t=O.create();t.scene=new L(o);t.renderer=new C(o,h);t.camera=new N(o);o.init();t.camera.controls.setLookAt(12,6,8,0,0,-10);t.scene.setup();const x=o.get(E);x.create(t);t.scene.three.background=null;const a=o.get(F),c=o.get(R);await c.setup();const k=[b,u,f];for(const e of k)c.settings.excludedCategories.add(e);c.settings.webIfc.COORDINATE_TO_ORIGIN=!0;async function v(){const n=await(await fetch("https://thatopen.github.io/engine_components/resources/small.ifc")).arrayBuffer(),i=new Uint8Array(n),l=await c.load(i);l.name="example",t.scene.three.add(l)}a.onFragmentsLoaded.add(e=>{console.log(e)});function d(e){const n=document.createElement("a");n.href=URL.createObjectURL(e),n.download=e.name,document.body.appendChild(n),n.click(),n.remove()}async function A(){if(!a.groups.size)return;const e=Array.from(a.groups.values())[0],n=a.export(e);d(new File([new Blob([n])],"small.frag"));const i=e.getLocalProperties();i&&d(new File([JSON.stringify(i)],"small.json"))}function B(){a.dispose()}const s=new w;s.showPanel(2);document.body.append(s.dom);s.dom.style.left="0px";s.dom.style.zIndex="unset";t.renderer.onBeforeUpdate.add(()=>s.begin());t.renderer.onAfterUpdate.add(()=>s.end());g.init();const r=m.create(()=>p` +import{bf as b,bg as u,bh as f}from"./web-ifc-api-JuXSH2nk.js";import{d as g,R as m,m as p}from"./index-CqPyogbW.js";import{S as w}from"./stats.min-GTpOrGrX.js";import{o as I,a as y,M as h,v as C,N,h as F,_ as L,e as R}from"./index-DtdmE_hK.js";import"./_commonjsHelpers-Cpj98o6Y.js";const E=document.getElementById("container"),o=new I,O=o.get(y),t=O.create();t.scene=new h(o);t.renderer=new C(o,E);t.camera=new N(o);o.init();t.camera.controls.setLookAt(12,6,8,0,0,-10);t.scene.setup();const v=o.get(F);v.create(t);t.scene.three.background=null;const a=o.get(L),c=o.get(R);await c.setup();const x=[b,u,f];for(const e of x)c.settings.excludedCategories.add(e);c.settings.webIfc.COORDINATE_TO_ORIGIN=!0;async function k(){const n=await(await fetch("https://thatopen.github.io/engine_components/resources/small.ifc")).arrayBuffer(),i=new Uint8Array(n),l=await c.load(i);l.name="example",t.scene.three.add(l)}a.onFragmentsLoaded.add(e=>{console.log(e)});function d(e){const n=document.createElement("a");n.href=URL.createObjectURL(e),n.download=e.name,document.body.appendChild(n),n.click(),n.remove()}async function A(){if(!a.groups.size)return;const e=Array.from(a.groups.values())[0],n=a.export(e);d(new File([new Blob([n])],"small.frag"));const i=e.getLocalProperties();i&&d(new File([JSON.stringify(i)],"small.json"))}function B(){a.dispose()}const s=new w;s.showPanel(2);document.body.append(s.dom);s.dom.style.left="0px";s.dom.style.zIndex="unset";t.renderer.onBeforeUpdate.add(()=>s.begin());t.renderer.onAfterUpdate.add(()=>s.end());g.init();const r=m.create(()=>p` + @click="${()=>{k()}}"> l in d?m(d,l,{enumerable:!0,configurable:!0,writable:!0,value:e}):d[l]=e;var c=(d,l,e)=>(O(d,typeof l!="symbol"?l+"":l,e),e);import{ai as p,aj as I,i as x,ak as M,bc as D}from"./web-ifc-api-CgBULNZm.js";import{C as A,E as w,d as v,b as N,I as F,U as L,a as B}from"./index-PN7JV3bA.js";import"./_commonjsHelpers-Cpj98o6Y.js";const f=class f extends A{constructor(e){super(e);c(this,"onDisposed",new w);c(this,"onRequestFile",new w);c(this,"ifcToExport",null);c(this,"onElementToPset",new w);c(this,"onPropToPset",new w);c(this,"onPsetRemoved",new w);c(this,"onDataChanged",new w);c(this,"wasm",{path:"/",absolute:!1});c(this,"enabled",!0);c(this,"attributeListeners",{});c(this,"selectedModel");c(this,"changeMap",{});this.components.add(f.uuid,this)}dispose(){this.selectedModel=void 0,this.attributeListeners={},this.changeMap={},this.onElementToPset.reset(),this.onPropToPset.reset(),this.onPsetRemoved.reset(),this.onDataChanged.reset(),this.onDisposed.trigger(f.uuid),this.onDisposed.reset()}static getIFCSchema(e){const t=e.ifcMetadata.schema;if(!t)throw new Error("IFC Schema not found");return t.startsWith("IFC2X3")?"IFC2X3":t.startsWith("IFC4")&&t.replace("IFC4","")===""?"IFC4":t.startsWith("IFC4X3")?"IFC4X3":t}async setData(e,...t){for(const s of t){const{expressID:n}=s;(!n||n===-1)&&(s.expressID=this.getNewExpressID(e)),await e.setProperties(s.expressID,s),this.registerChange(e,n)}}async newPset(e,t,s){const n=f.getIFCSchema(e),{ownerHistoryHandle:r}=await this.getOwnerHistory(e),i=this.newGUID(e),o=new p[n].IfcLabel(t),a=s?new p[n].IfcText(s):null,u=new p[n].IfcPropertySet(i,r,o,a,[]);u.expressID=this.getNewExpressID(e);const P=this.newGUID(e),y=new p[n].IfcRelDefinesByProperties(P,r,null,null,[],new I(u.expressID));return y.expressID=this.getNewExpressID(e),await this.setData(e,u,y),{pset:u,rel:y}}async removePset(e,...t){for(const s of t){const n=await e.getProperties(s);if((n==null?void 0:n.type)!==x)continue;const r=await v.getPsetRel(e,s);if(r&&(await e.setProperties(r,null),this.registerChange(e,r)),n){for(const i of n.HasProperties)await e.setProperties(i.value,null);await e.setProperties(s,null),this.onPsetRemoved.trigger({model:e,psetID:s}),this.registerChange(e,s)}}}newSingleStringProperty(e,t,s,n){return this.newSingleProperty(e,t,s,n)}newSingleNumericProperty(e,t,s,n){return this.newSingleProperty(e,t,s,n)}newSingleBooleanProperty(e,t,s,n){return this.newSingleProperty(e,t,s,n)}async removePsetProp(e,t,s){const n=await e.getProperties(t),r=await e.getProperties(s);!n||!r||n.type===x&&r&&(n.HasProperties=n.HasProperties.filter(i=>i.value!==s),await e.setProperties(s,null),this.registerChange(e,t,s))}async addElementToPset(e,t,...s){const n=await v.getPsetRel(e,t);if(!n)return;const r=await e.getProperties(n);if(!r)return;for(const o of s){const a=new I(o);r.RelatedObjects.push(a),this.onElementToPset.trigger({model:e,psetID:t,elementID:o})}this.registerChange(e,t);const i=this.components.get(N);for(const o of s)try{i.addEntityRelations(e,o,"IsDefinedBy",t)}catch{}}async addPropToPset(e,t,...s){const n=await e.getProperties(t);if(n){for(const r of s){if(n.HasProperties.includes(r))continue;const i=new I(r);n.HasProperties.push(i),this.onPropToPset.trigger({model:e,psetID:t,propID:r})}this.registerChange(e,t)}}async saveToIfc(e,t){const s=this.components.get(F),n=s.webIfc,r=await s.readIfcFile(t),i=this.changeMap[e.uuid]??[];for(const a of i){const u=await e.getProperties(a);if(u)try{n.WriteLine(r,u)}catch{}else try{n.DeleteLine(r,a)}catch{}}const o=n.SaveModel(r);return s.webIfc.CloseModel(r),s.cleanUp(),o}async getEntityRef(e,t){const s=await e.getAllPropertiesOfType(t);if(!s)return null;const n=[];for(const r in s){const i=new I(Number(r));n.push(i)}return n}async setAttributeListener(e,t,s){this.attributeListeners[e.uuid]||(this.attributeListeners[e.uuid]={});const n=this.attributeListeners[e.uuid][t]?this.attributeListeners[e.uuid][t][s]:null;if(n)return n;const r=await e.getProperties(t);if(!r)throw new Error(`Entity with expressID ${t} doesn't exists.`);const i=r[s];if(Array.isArray(i)||!i)throw new Error(`Attribute ${s} is array or null, and it can't have a listener.`);const o=i.value;if(o===void 0||o==null)throw new Error(`Attribute ${s} has a badly defined handle.`);const a=new w;return Object.defineProperty(r[s],"value",{get(){return this._value},async set(u){this._value=u,a.trigger(u)}}),r[s].value=o,this.attributeListeners[e.uuid][t]||(this.attributeListeners[e.uuid][t]={}),this.attributeListeners[e.uuid][t][s]=a,a}getNewExpressID(e){return e.ifcMetadata.maxExpressID++,e.ifcMetadata.maxExpressID}newGUID(e){const t=f.getIFCSchema(e);return new p[t].IfcGloballyUniqueId(L.create())}async getOwnerHistory(e){const t=await e.getAllPropertiesOfType(M);if(!t)throw new Error("No OwnerHistory was found.");const s=Object.keys(t).map(i=>parseInt(i,10)),n=t[s[0]],r=new I(n.expressID);return{ownerHistory:n,ownerHistoryHandle:r}}registerChange(e,...t){this.changeMap[e.uuid]||(this.changeMap[e.uuid]=new Set);for(const s of t)this.changeMap[e.uuid].add(s),this.onDataChanged.trigger({model:e,expressID:s})}async newSingleProperty(e,t,s,n){const r=f.getIFCSchema(e),i=new p[r].IfcIdentifier(s),o=new p[r][t](n),a=new p[r].IfcPropertySingleValue(i,null,o,null);return a.expressID=this.getNewExpressID(e),await this.setData(e,a),a}};c(f,"uuid","58c2d9f0-183c-48d6-a402-dfcf5b9a34df");let b=f;const T=new B,R=T.get(F);await R.setup();const G=await fetch("https://thatopen.github.io/engine_components/resources/small.ifc"),S=await G.arrayBuffer(),h=await R.load(new Uint8Array(S)),g=T.get(b),{pset:H}=await g.newPset(h,"CalculatedQuantities"),W=await g.newSingleNumericProperty(h,"IfcReal","Volume",12.25);await g.addPropToPset(h,H.expressID,W.expressID);await g.addElementToPset(h,H.expressID,186);const C=await h.getProperties(186);C&&(C.Name.value="New Wall Name",await g.setData(h,C));const j=new D.IfcTask(new D.IfcGloballyUniqueId(L.create()),null,null,null,null,null,null,null,null,new D.IfcBoolean(!1),null,null,null);await g.setData(h,j);const k=await g.saveToIfc(h,new Uint8Array(S)),U=new File([k],"small-modified.ifc"),E=document.createElement("a");E.href=URL.createObjectURL(U);E.download=U.name;URL.revokeObjectURL(E.href); +import{bc as a}from"./web-ifc-api-JuXSH2nk.js";import{C as f,I as u,c as w,U as m}from"./index-BICSFNrK.js";import"./_commonjsHelpers-Cpj98o6Y.js";const s=new f,l=s.get(u);await l.setup();const p=await fetch("https://thatopen.github.io/engine_components/resources/small.ifc"),i=await p.arrayBuffer(),e=await l.load(new Uint8Array(i)),t=s.get(w),{pset:r}=await t.newPset(e,"CalculatedQuantities"),d=await t.newSingleNumericProperty(e,"IfcReal","Volume",12.25);await t.addPropToPset(e,r.expressID,d.expressID);await t.addElementToPset(e,r.expressID,186);const n=await e.getProperties(186);n&&(n.Name.value="New Wall Name",await t.setData(e,n));const I=new a.IfcTask(new a.IfcGloballyUniqueId(m.create()),null,null,null,null,null,null,null,null,new a.IfcBoolean(!1),null,null,null);await t.setData(e,I);const U=await t.saveToIfc(e,new Uint8Array(i)),c=new File([U],"small-modified.ifc"),o=document.createElement("a");o.href=URL.createObjectURL(c);o.download=c.name;URL.revokeObjectURL(o.href); diff --git a/examples/assets/ifcPropertiesTiler.js b/examples/assets/ifcPropertiesTiler.js index 5569adba8..6bb8074ce 100644 --- a/examples/assets/ifcPropertiesTiler.js +++ b/examples/assets/ifcPropertiesTiler.js @@ -1,18 +1,18 @@ -import"./web-ifc-api-CgBULNZm.js";import{S as b}from"./stats.min-GTpOrGrX.js";import{d as g,R as f,m as u}from"./index-CqPyogbW.js";import{o as w,a as y,L as h,M as B,N as L,l as F,_ as R,g as S,J as U}from"./index-c9A1IUGD.js";import"./_commonjsHelpers-Cpj98o6Y.js";const k=document.getElementById("container"),n=new w,v=n.get(y),s=v.create();s.scene=new h(n);s.renderer=new B(n,k);s.camera=new L(n);n.init();s.camera.controls.setLookAt(12,6,8,0,0,-10);s.scene.setup();const x=n.get(F);x.create(s);s.scene.three.background=null;const I=new R(n),A=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),O=await A.arrayBuffer(),P=new Uint8Array(O),j=I.load(P);s.scene.three.add(j);function J(e,o){const t=new File([o],e),a=document.createElement("a"),p=URL.createObjectURL(t);a.href=p,a.download=t.name,a.click(),URL.revokeObjectURL(p)}async function N(e){for(const{name:o,bits:t}of e)J(o,t),await new Promise(a=>{setTimeout(a,100)})}const c=n.get(S);c.settings.wasm={path:"https://unpkg.com/web-ifc@0.0.57/",absolute:!0};const r={types:{},ids:{},indexesFile:"small.ifc-processed-properties-indexes"};let l=0;const d=[];c.onPropertiesStreamed.add(async e=>{r.types[e.type]||(r.types[e.type]=[]),r.types[e.type].push(l);for(const a in e.data)r.ids[a]=l;const o=`small.ifc-processed-properties-${l}`,t=new Blob([JSON.stringify(e.data)]);d.push({bits:t,name:o}),l++});c.onProgress.add(async e=>{console.log(e)});c.onIndicesStreamed.add(async e=>{d.push({name:"small.ifc-processed-properties.json",bits:new Blob([JSON.stringify(r)])});const t=n.get(U).serializeRelations(e);d.push({name:"small.ifc-processed-properties-indexes",bits:new Blob([t])}),await N(d)});async function _(){const o=await(await fetch("https://thatopen.github.io/engine_components/resources/small.ifc")).arrayBuffer(),t=new Uint8Array(o);await c.streamFromBuffer(t)}const i=new b;i.showPanel(2);document.body.append(i.dom);i.dom.style.left="0px";i.dom.style.zIndex="unset";s.renderer.onBeforeUpdate.add(()=>i.begin());s.renderer.onAfterUpdate.add(()=>i.end());g.init();const m=f.create(()=>u` +import"./web-ifc-api-JuXSH2nk.js";import{S as b}from"./stats.min-GTpOrGrX.js";import{d as w,R as f,m as u}from"./index-CqPyogbW.js";import{o as y,a as g,M as h,v as B,N as F,h as L,_ as v,i as x,x as R}from"./index-DtdmE_hK.js";import"./_commonjsHelpers-Cpj98o6Y.js";const S=document.getElementById("container"),n=new y,U=n.get(g),s=U.create();s.scene=new h(n);s.renderer=new B(n,S);s.camera=new F(n);n.init();s.camera.controls.setLookAt(12,6,8,0,0,-10);s.scene.setup();const k=n.get(L);k.create(s);s.scene.three.background=null;const I=new v(n),A=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),N=await A.arrayBuffer(),P=new Uint8Array(N),j=I.load(P);s.scene.three.add(j);function O(e,o){const t=new File([o],e),a=document.createElement("a"),p=URL.createObjectURL(t);a.href=p,a.download=t.name,a.click(),URL.revokeObjectURL(p)}async function _(e){for(const{name:o,bits:t}of e)O(o,t),await new Promise(a=>{setTimeout(a,100)})}const c=n.get(x);c.settings.wasm={path:"https://unpkg.com/web-ifc@0.0.57/",absolute:!0};const r={types:{},ids:{},indexesFile:"small.ifc-processed-properties-indexes"};let l=0;const d=[];c.onPropertiesStreamed.add(async e=>{r.types[e.type]||(r.types[e.type]=[]),r.types[e.type].push(l);for(const a in e.data)r.ids[a]=l;const o=`small.ifc-processed-properties-${l}`,t=new Blob([JSON.stringify(e.data)]);d.push({bits:t,name:o}),l++});c.onProgress.add(async e=>{console.log(e)});c.onIndicesStreamed.add(async e=>{d.push({name:"small.ifc-processed-properties.json",bits:new Blob([JSON.stringify(r)])});const t=n.get(R).serializeRelations(e);d.push({name:"small.ifc-processed-properties-indexes",bits:new Blob([t])}),await _(d)});async function z(){const o=await(await fetch("https://thatopen.github.io/engine_components/resources/small.ifc")).arrayBuffer(),t=new Uint8Array(o);await c.streamFromBuffer(t)}const i=new b;i.showPanel(2);document.body.append(i.dom);i.dom.style.left="0px";i.dom.style.zIndex="unset";s.renderer.onBeforeUpdate.add(()=>i.begin());s.renderer.onAfterUpdate.add(()=>i.end());w.init();const m=f.create(()=>u` + @click="${()=>{z()}}"> - `);document.body.append(m);const z=f.create(()=>u` + `);document.body.append(m);const T=f.create(()=>u` - `);document.body.append(z); + `);document.body.append(T); diff --git a/examples/assets/ifcRelationsIndexer.js b/examples/assets/ifcRelationsIndexer.js index 7a8d7d0a5..85631771a 100644 --- a/examples/assets/ifcRelationsIndexer.js +++ b/examples/assets/ifcRelationsIndexer.js @@ -1,17 +1,22 @@ -import"./web-ifc-api-CgBULNZm.js";import{S as f}from"./stats.min-GTpOrGrX.js";import{d as b,R as m,m as u}from"./index-CqPyogbW.js";import{o as w,a as y,L as h,M as R,N as I,l as E,E as S,J as L,f as x}from"./index-c9A1IUGD.js";import"./_commonjsHelpers-Cpj98o6Y.js";const B=document.getElementById("container"),o=new w,M=o.get(y),n=M.create();n.scene=new h(o);n.renderer=new R(o,B);n.camera=new I(o);o.init();n.camera.controls.setLookAt(12,6,8,0,0,-10);n.scene.setup();const P=o.get(E);P.create(n);n.scene.three.background=null;const g=o.get(S);await g.setup();const U=await fetch("https://thatopen.github.io/engine_components/resources/small.ifc"),k=await U.arrayBuffer(),v=new Uint8Array(k),e=await g.load(v);n.scene.three.add(e);const t=o.get(L);await t.process(e);const p=t.getEntityRelations(e,6518,"IsDefinedBy");if(p)for(const s of p){const r=await e.getProperties(s);console.log(r),await x.getPsetProps(e,s,async l=>{const i=await e.getProperties(l);console.log(i)})}const j=(s,r)=>{const l=new File([s],r),i=document.createElement("a");i.href=URL.createObjectURL(l),i.download=l.name,i.click(),URL.revokeObjectURL(i.href)},A=t.serializeModelRelations(e);console.log(A);const C=t.serializeAllRelations();delete t.relationMaps[e.uuid];const D=await fetch("https://thatopen.github.io/engine_components/resources/small-relations.json"),J=t.getRelationsMapFromJSON(await D.text());t.setRelationMap(e,J);const d=t.getEntityRelations(e,6518,"ContainedInStructure");if(d&&d[0]){const s=await e.getProperties(d[0]);console.log(s)}const N=t.getEntitiesWithRelation(e,"ContainedInStructure",138);console.log(`IfcBuildingStorey 138 has the following IfcElement: ${[...N]}`);const O=t.getEntitiesWithRelation(e,"ContainsElements",186);console.log(`IfcElement 186 is located inside IfcBuildingStorey ${[...O][0]}`);const $=t.getEntitiesWithRelation(e,"IsDefinedBy",303);console.log(`${[...$]} are defined by IfcPropertySet 303`);const a=new f;a.showPanel(2);document.body.append(a.dom);a.dom.style.left="0px";a.dom.style.zIndex="unset";n.renderer.onBeforeUpdate.add(()=>a.begin());n.renderer.onAfterUpdate.add(()=>a.end());b.init();const c=m.create(()=>u` +import{ak as D,bc as r,aj as L,bd as P,a0 as I}from"./web-ifc-api-JuXSH2nk.js";import{S as x}from"./stats.min-GTpOrGrX.js";import{d as U,R as w,m as g}from"./index-CqPyogbW.js";import{C,W as O,S as v,I as F,a as k,b as A,c as y,U as j}from"./index-BICSFNrK.js";import{S as B,a as M,G as N}from"./index-M03DNf7F.js";import"./_commonjsHelpers-Cpj98o6Y.js";const W=document.getElementById("container"),s=new C,T=s.get(O),a=T.create();a.scene=new B(s);a.renderer=new M(s,W);a.camera=new v(s);s.init();a.camera.controls.setLookAt(12,6,8,0,0,-10);a.scene.setup();const $=s.get(N);$.create(a);a.scene.three.background=null;const R=s.get(F);await R.setup();const z=await fetch("https://thatopen.github.io/engine_components/resources/small.ifc"),G=await z.arrayBuffer(),S=new Uint8Array(G),e=await R.load(S);a.scene.three.add(e);const t=s.get(k);await t.process(e);const u=t.getEntityRelations(e,6518,"IsDefinedBy");if(u)for(const n of u){const i=await e.getProperties(n);console.log(i),await A.getPsetProps(e,n,async l=>{const o=await e.getProperties(l);console.log(o)})}const H=(n,i)=>{const l=new File([n],i),o=document.createElement("a");o.href=URL.createObjectURL(l),o.download=l.name,o.click(),URL.revokeObjectURL(o.href)},J=t.serializeModelRelations(e);console.log(J);const V=t.serializeAllRelations();delete t.relationMaps[e.uuid];const Y=await fetch("https://thatopen.github.io/engine_components/resources/small-relations.json"),_=t.getRelationsMapFromJSON(await Y.text());t.setRelationMap(e,_);const p=t.getEntityRelations(e,6518,"ContainedInStructure");if(p&&p[0]){const n=await e.getProperties(p[0]);console.log(n)}const q=t.getEntitiesWithRelation(e,"ContainedInStructure",138);console.log(`IfcBuildingStorey 138 has the following IfcElement: ${[...q]}`);const X=t.getEntitiesWithRelation(e,"ContainsElements",186);console.log(`IfcElement 186 is located inside IfcBuildingStorey ${[...X][0]}`);const K=t.getEntitiesWithRelation(e,"IsDefinedBy",303);console.log(`${[...K]} are defined by IfcPropertySet 303`);const m=s.get(y),b=await m.getEntityRef(e,D),h=new r.IfcPropertySingleValue(new r.IfcIdentifier("Property Name"),null,new r.IfcLabel("Property Value"),null);await m.setData(e,h);const f=new r.IfcPropertySet(new r.IfcGloballyUniqueId(j.create()),b?b[0]:null,new r.IfcLabel("My New Pset!"),null,[new L(h.expressID)]);await m.setData(e,f);const E=await e.getAllPropertiesOfType(P),Q=Object.values(E).map(n=>n.expressID);t.addEntitiesRelation(e,f.expressID,{type:I,inv:"DefinesOcurrence"},...Q);for(const n in E)t.addEntitiesRelation(e,Number(n),{type:I,inv:"IsDefinedBy"},f.expressID);const c=new x;c.showPanel(2);document.body.append(c.dom);c.dom.style.left="0px";c.dom.style.zIndex="unset";a.renderer.onBeforeUpdate.add(()=>c.begin());a.renderer.onAfterUpdate.add(()=>c.end());U.init();const d=w.create(()=>g` + @click="${async()=>{H(V,"relations-index-all.json")}}"> + + + - `);document.body.append(c);const F=m.create(()=>u` + `);document.body.append(d);const Z=w.create(()=>g` + @click="${()=>{d.classList.contains("options-menu-visible")?d.classList.remove("options-menu-visible"):d.classList.add("options-menu-visible")}}"> - `);document.body.append(F); + `);document.body.append(Z); diff --git a/examples/assets/ifcStreamer.js b/examples/assets/ifcStreamer.js index 1fcf6940c..c6fa68839 100644 --- a/examples/assets/ifcStreamer.js +++ b/examples/assets/ifcStreamer.js @@ -1 +1 @@ -import"./web-ifc-api-CgBULNZm.js";import{S as i}from"./stats.min-GTpOrGrX.js";import{o as l,a as m,L as p,M as u,N as w,l as g}from"./index-c9A1IUGD.js";import{s as h}from"./index-UqY4hWbC.js";import"./_commonjsHelpers-Cpj98o6Y.js";const f=document.getElementById("container"),o=new l,b=o.get(m),e=b.create();e.scene=new p(o);e.renderer=new u(o,f);e.camera=new w(o);o.init();e.scene.setup();e.camera.controls.setLookAt(12,6,8,0,0,-10);const y=o.get(g);y.create(e);e.scene.three.background=null;const t=o.get(h);t.world=e;t.dbCleaner.enabled=!0;t.url="https://thatopen.github.io/engine_components/resources/streaming/";async function D(s,r){const c=await(await fetch(s)).json();let a;a=await(await fetch(r)).json();const d=await t.load(c,!0,a);console.log(d)}await D("https://thatopen.github.io/engine_components/resources/streaming/small.ifc-processed.json","https://thatopen.github.io/engine_components/resources/streaming/small.ifc-processed-properties.json");e.camera.controls.addEventListener("sleep",()=>{t.culler.needsUpdate=!0});t.useCache=!0;t.culler.threshold=10;t.culler.maxHiddenTime=1e3;t.culler.maxLostTime=3e3;const n=new i;n.showPanel(2);document.body.append(n.dom);n.dom.style.left="0px";n.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>n.begin());e.renderer.onAfterUpdate.add(()=>n.end()); +import"./web-ifc-api-JuXSH2nk.js";import{S as i}from"./stats.min-GTpOrGrX.js";import{o as l,a as m,M as p,v as u,N as h,h as w}from"./index-DtdmE_hK.js";import{s as g}from"./index-Cm7YlCft.js";import"./_commonjsHelpers-Cpj98o6Y.js";const f=document.getElementById("container"),o=new l,b=o.get(m),e=b.create();e.scene=new p(o);e.renderer=new u(o,f);e.camera=new h(o);o.init();e.scene.setup();e.camera.controls.setLookAt(12,6,8,0,0,-10);const y=o.get(w);y.create(e);e.scene.three.background=null;const t=o.get(g);t.world=e;t.dbCleaner.enabled=!0;t.url="https://thatopen.github.io/engine_components/resources/streaming/";async function D(s,r){const c=await(await fetch(s)).json();let a;a=await(await fetch(r)).json();const d=await t.load(c,!0,a);console.log(d)}await D("https://thatopen.github.io/engine_components/resources/streaming/small.ifc-processed.json","https://thatopen.github.io/engine_components/resources/streaming/small.ifc-processed-properties.json");e.camera.controls.addEventListener("sleep",()=>{t.culler.needsUpdate=!0});t.useCache=!0;t.culler.threshold=10;t.culler.maxHiddenTime=1e3;t.culler.maxLostTime=3e3;const n=new i;n.showPanel(2);document.body.append(n.dom);n.dom.style.left="0px";n.dom.style.zIndex="unset";e.renderer.onBeforeUpdate.add(()=>n.begin());e.renderer.onAfterUpdate.add(()=>n.end()); diff --git a/examples/assets/index-BICSFNrK.js b/examples/assets/index-BICSFNrK.js new file mode 100644 index 000000000..498d79534 --- /dev/null +++ b/examples/assets/index-BICSFNrK.js @@ -0,0 +1,162 @@ +var io=Object.defineProperty;var no=(c,e,t)=>e in c?io(c,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):c[e]=t;var y=(c,e,t)=>(no(c,typeof e!="symbol"?e+"":e,t),t);import{d as Fs,V as W,h as _e,y as pn,s as ue,T as ms,S as gi,c as Ft,t as Nt,ba as ro,Q as Ti,a$ as Yn,a as st,b0 as oo,J as ao,e as Ss,x as En,P as Lr,aw as co,w as lo,ax as Jt,ay as ho,u as In,am as uo,z as fo,W as po,ap as Eo,b as $e,r as oi,az as Si,C as mn,O as ai,E as Io,L as Mr,K as xt,B as Lt,H as Vn,aA as Ms,au as pe,aB as mo,aC as es,N as vr,X as Co,Y as _i,Z as Cn,_ as gn,$ as Tn,a0 as Ns,a1 as _n,a2 as An,a3 as Ai,a4 as Rn,a5 as yn,a6 as On,a7 as Fn,a8 as Sn,a9 as wn,be as Nn,j as go,i as Zi,ai as jt,b1 as To,ag as bs,aF as _o,aG as Ao,aH as Ro,aI as yo,aJ as Oo,aK as Fo,I as xr,aD as Dr,aE as Ur,av as Br,b2 as So,b3 as wo,b4 as No,b5 as bo,ac as Gn,ad as Hn,ae as Po,af as Lo,ah as Mo,aj as he,ak as vo,aa as xo,ab as Do}from"./web-ifc-api-JuXSH2nk.js";import{c as vs,g as Uo}from"./_commonjsHelpers-Cpj98o6Y.js";const kr=0,Bo=1,ko=2,Wn=2,wi=1.25,Xn=1,ni=6*4+4+4,Ri=65535,zo=Math.pow(2,-24),Ni=Symbol("SKIP_GENERATION");function Yo(c){return c.index?c.index.count:c.attributes.position.count}function Ke(c){return Yo(c)/3}function Vo(c,e=ArrayBuffer){return c>65535?new Uint32Array(new e(4*c)):new Uint16Array(new e(2*c))}function Go(c,e){if(!c.index){const t=c.attributes.position.count,s=e.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer,i=Vo(t,s);c.setIndex(new Fs(i,1));for(let n=0;no-a);for(let o=0;on.offset-r.offset),s=t[t.length-1];s.count=Math.min(e-s.offset,s.count);let i=0;return t.forEach(({count:n})=>i+=n),e!==i}function Tt(c,e,t){return t.min.x=e[c],t.min.y=e[c+1],t.min.z=e[c+2],t.max.x=e[c+3],t.max.y=e[c+4],t.max.z=e[c+5],t}function Wo(c){c[0]=c[1]=c[2]=1/0,c[3]=c[4]=c[5]=-1/0}function Zn(c){let e=-1,t=-1/0;for(let s=0;s<3;s++){const i=c[s+3]-c[s];i>t&&(t=i,e=s)}return e}function $n(c,e){e.set(c)}function jn(c,e,t){let s,i;for(let n=0;n<3;n++){const r=n+3;s=c[n],i=e[n],t[n]=si?s:i}}function xs(c,e,t){for(let s=0;s<3;s++){const i=e[c+2*s],n=e[c+2*s+1],r=i-n,o=i+n;rt[s+3]&&(t[s+3]=o)}}function ss(c){const e=c[3]-c[0],t=c[4]-c[1],s=c[5]-c[2];return 2*(e*t+t*s+s*e)}function bi(c,e,t,s,i=null){let n=1/0,r=1/0,o=1/0,a=-1/0,l=-1/0,h=-1/0,u=1/0,d=1/0,f=1/0,I=-1/0,p=-1/0,m=-1/0;const E=i!==null;for(let _=e*6,A=(e+t)*6;_a&&(a=w),E&&TI&&(I=T);const L=c[_+2],N=c[_+3],M=L-N,z=L+N;Ml&&(l=z),E&&Lp&&(p=L);const O=c[_+4],P=c[_+5],C=O-P,v=O+P;Ch&&(h=v),E&&Om&&(m=O)}s[0]=n,s[1]=r,s[2]=o,s[3]=a,s[4]=l,s[5]=h,E&&(i[0]=u,i[1]=d,i[2]=f,i[3]=I,i[4]=p,i[5]=m)}function Xo(c,e,t,s){let i=1/0,n=1/0,r=1/0,o=-1/0,a=-1/0,l=-1/0;for(let h=e*6,u=(e+t)*6;ho&&(o=d);const f=c[h+2];fa&&(a=f);const I=c[h+4];Il&&(l=I)}s[0]=i,s[1]=n,s[2]=r,s[3]=o,s[4]=a,s[5]=l}function Zo(c,e){Wo(e);const t=c.attributes.position,s=c.index?c.index.array:null,i=Ke(c),n=new Float32Array(i*6),r=t.normalized,o=t.array,a=t.offset||0;let l=3;t.isInterleavedBufferAttribute&&(l=t.data.stride);const h=["getX","getY","getZ"];for(let u=0;uF&&(F=A),T>F&&(F=T);const w=(F-R)/2,L=E*2;n[f+L+0]=R+w,n[f+L+1]=w+(Math.abs(R)+w)*zo,Re[E+3]&&(e[E+3]=F)}}return n}const le=32,$o=(c,e)=>c.candidate-e.candidate,Ee=new Array(le).fill().map(()=>({count:0,bounds:new Float32Array(6),rightCacheBounds:new Float32Array(6),leftCacheBounds:new Float32Array(6),candidate:0})),Ds=new Float32Array(6);function jo(c,e,t,s,i,n){let r=-1,o=0;if(n===kr)r=Zn(e),r!==-1&&(o=(e[r]+e[r+3])/2);else if(n===Bo)r=Zn(c),r!==-1&&(o=Qo(t,s,i,r));else if(n===ko){const a=ss(c);let l=wi*i;const h=s*6,u=(s+i)*6;for(let d=0;d<3;d++){const f=e[d],m=(e[d+3]-f)/le;if(i=w.candidate?xs(T,t,w.rightCacheBounds):(xs(T,t,w.leftCacheBounds),w.count++)}}for(let T=0;T=le&&(F=le-1);const w=Ee[F];w.count++,xs(A,t,w.bounds)}const E=Ee[le-1];$n(E.bounds,E.rightCacheBounds);for(let A=le-2;A>=0;A--){const T=Ee[A],R=Ee[A+1];jn(T.bounds,R.rightCacheBounds,T.rightCacheBounds)}let _=0;for(let A=0;A=a;)o--;if(r=a;)o--;if(r2**16,i=s?4:2,n=e?new SharedArrayBuffer(t*i):new ArrayBuffer(t*i),r=s?new Uint32Array(n):new Uint16Array(n);for(let o=0,a=r.length;o=i&&(u=!0,n&&(console.warn(`MeshBVH: Max depth of ${i} reached when generating BVH. Consider increasing maxDepth.`),console.warn(t))),F<=r||L>=i)return _(R+F),T.offset=R,T.count=F,T;const N=jo(T.boundingData,w,I,R,F,o);if(N.axis===-1)return _(R+F),T.offset=R,T.count=F,T;const M=p(h,s,I,R,F,N);if(M===R||M===R+F)_(R+F),T.offset=R,T.count=F;else{T.splitAxis=N.axis;const z=new Us,O=R,P=M-R;T.left=z,z.boundingData=new Float32Array(6),bi(I,O,P,z.boundingData,f),A(z,O,P,f,L+1);const C=new Us,v=M,$=F-P;T.right=C,C.boundingData=new Float32Array(6),bi(I,v,$,C.boundingData,f),A(C,v,$,f,L+1)}return T}}function ea(c,e){const t=c.geometry;e.indirect&&(c._indirectBuffer=Jo(t,e.useSharedArrayBuffer),Ho(t)&&!e.verbose&&console.warn('MeshBVH: Provided geometry contains groups that do not fully span the vertex contents while using the "indirect" option. BVH may incorrectly report intersections on unrendered portions of the geometry.')),c._indirectBuffer||Go(t,e);const s=ta(c,e);let i,n,r;const o=[],a=e.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer;for(let u=0;uMath.pow(2,32))throw new Error("MeshBVH: Cannot store child pointer greater than 32 bits.");return n[f+6]=T/4,T=h(T,_),n[f+7]=A,T}}}class de{constructor(){this.min=1/0,this.max=-1/0}setFromPointsField(e,t){let s=1/0,i=-1/0;for(let n=0,r=e.length;ni?a:i}this.min=s,this.max=i}setFromPoints(e,t){let s=1/0,i=-1/0;for(let n=0,r=t.length;ni?a:i}this.min=s,this.max=i}isSeparated(e){return this.min>e.max||e.min>this.max}}de.prototype.setFromBox=function(){const c=new W;return function(t,s){const i=s.min,n=s.max;let r=1/0,o=-1/0;for(let a=0;a<=1;a++)for(let l=0;l<=1;l++)for(let h=0;h<=1;h++){c.x=i.x*a+n.x*(1-a),c.y=i.y*l+n.y*(1-l),c.z=i.z*h+n.z*(1-h);const u=t.dot(c);r=Math.min(u,r),o=Math.max(u,o)}this.min=r,this.max=o}}();const sa=function(){const c=new W,e=new W,t=new W;return function(i,n,r){const o=i.start,a=c,l=n.start,h=e;t.subVectors(o,l),c.subVectors(i.end,i.start),e.subVectors(n.end,n.start);const u=t.dot(h),d=h.dot(a),f=h.dot(h),I=t.dot(a),m=a.dot(a)*f-d*d;let E,_;m!==0?E=(u*d-I*f)/m:E=0,_=(u+E*d)/f,r.x=E,r.y=_}}(),bn=function(){const c=new _e,e=new W,t=new W;return function(i,n,r,o){sa(i,n,c);let a=c.x,l=c.y;if(a>=0&&a<=1&&l>=0&&l<=1){i.at(a,r),n.at(l,o);return}else if(a>=0&&a<=1){l<0?n.at(0,o):n.at(1,o),i.closestPointToPoint(o,!0,r);return}else if(l>=0&&l<=1){a<0?i.at(0,r):i.at(1,r),n.closestPointToPoint(r,!0,o);return}else{let h;a<0?h=i.start:h=i.end;let u;l<0?u=n.start:u=n.end;const d=e,f=t;if(i.closestPointToPoint(u,!0,e),n.closestPointToPoint(h,!0,t),d.distanceToSquared(u)<=f.distanceToSquared(h)){r.copy(d),o.copy(u);return}else{r.copy(h),o.copy(f);return}}}}(),ia=function(){const c=new W,e=new W,t=new pn,s=new ue;return function(n,r){const{radius:o,center:a}=n,{a:l,b:h,c:u}=r;if(s.start=l,s.end=h,s.closestPointToPoint(a,!0,c).distanceTo(a)<=o||(s.start=l,s.end=u,s.closestPointToPoint(a,!0,c).distanceTo(a)<=o)||(s.start=h,s.end=u,s.closestPointToPoint(a,!0,c).distanceTo(a)<=o))return!0;const p=r.getPlane(t);if(Math.abs(p.distanceToPoint(a))<=o){const E=p.projectPoint(a,e);if(r.containsPoint(E))return!0}return!1}}(),na=1e-15;function Pi(c){return Math.abs(c)new W),this.satBounds=new Array(4).fill().map(()=>new de),this.points=[this.a,this.b,this.c],this.sphere=new gi,this.plane=new pn,this.needsUpdate=!0}intersectsSphere(e){return ia(e,this)}update(){const e=this.a,t=this.b,s=this.c,i=this.points,n=this.satAxes,r=this.satBounds,o=n[0],a=r[0];this.getNormal(o),a.setFromPoints(o,i);const l=n[1],h=r[1];l.subVectors(e,t),h.setFromPoints(l,i);const u=n[2],d=r[2];u.subVectors(t,s),d.setFromPoints(u,i);const f=n[3],I=r[3];f.subVectors(s,e),I.setFromPoints(f,i),this.sphere.setFromPoints(this.points),this.plane.setFromNormalAndCoplanarPoint(o,e),this.needsUpdate=!1}}ee.prototype.closestPointToSegment=function(){const c=new W,e=new W,t=new ue;return function(i,n=null,r=null){const{start:o,end:a}=i,l=this.points;let h,u=1/0;for(let d=0;d<3;d++){const f=(d+1)%3;t.start.copy(l[d]),t.end.copy(l[f]),bn(t,i,c,e),h=c.distanceToSquared(e),h=2){(T===1?E.start:E.end).copy(f),A=2;break}if(A++,A===2&&T===-1)break}}return A}return function(m,E=null,_=!1){this.needsUpdate&&this.update(),m.isExtendedTriangle?m.needsUpdate&&m.update():(c.copy(m),c.update(),m=c);const A=this.plane,T=m.plane;if(Math.abs(A.normal.dot(T.normal))>1-1e-10){const R=this.satBounds,F=this.satAxes;t[0]=m.a,t[1]=m.b,t[2]=m.c;for(let N=0;N<4;N++){const M=R[N],z=F[N];if(s.setFromPoints(z,t),M.isSeparated(s))return!1}const w=m.satBounds,L=m.satAxes;e[0]=this.a,e[1]=this.b,e[2]=this.c;for(let N=0;N<4;N++){const M=w[N],z=L[N];if(s.setFromPoints(z,e),M.isSeparated(s))return!1}for(let N=0;N<4;N++){const M=F[N];for(let z=0;z<4;z++){const O=L[z];if(n.crossVectors(M,O),s.setFromPoints(n,e),i.setFromPoints(n,t),s.isSeparated(i))return!1}}return E&&(_||console.warn("ExtendedTriangle.intersectsTriangle: Triangles are coplanar which does not support an output edge. Setting edge to 0, 0, 0."),E.start.set(0,0,0),E.end.set(0,0,0)),!0}else{const R=I(this,T,u);if(R===1&&m.containsPoint(u.end))return E&&(E.start.copy(u.end),E.end.copy(u.end)),!0;if(R!==2)return!1;const F=I(m,A,d);if(F===1&&this.containsPoint(d.end))return E&&(E.start.copy(d.end),E.end.copy(d.end)),!0;if(F!==2)return!1;if(u.delta(o),d.delta(a),o.dot(a)<0){let P=d.start;d.start=d.end,d.end=P}const w=u.start.dot(o),L=u.end.dot(o),N=d.start.dot(o),M=d.end.dot(o),z=L0?E.start.copy(u.start):E.start.copy(d.start),l.subVectors(u.end,d.end),l.dot(o)<0?E.end.copy(u.end):E.end.copy(d.end)),!0)}}}();ee.prototype.distanceToPoint=function(){const c=new W;return function(t){return this.closestPointToPoint(t,c),t.distanceTo(c)}}();ee.prototype.distanceToTriangle=function(){const c=new W,e=new W,t=["a","b","c"],s=new ue,i=new ue;return function(r,o=null,a=null){const l=o||a?s:null;if(this.intersectsTriangle(r,l))return(o||a)&&(o&&l.getCenter(o),a&&l.getCenter(a)),0;let h=1/0;for(let u=0;u<3;u++){let d;const f=t[u],I=r[f];this.closestPointToPoint(I,c),d=I.distanceToSquared(c),dnew W),this.satAxes=new Array(3).fill().map(()=>new W),this.satBounds=new Array(3).fill().map(()=>new de),this.alignedSatBounds=new Array(3).fill().map(()=>new de),this.needsUpdate=!1,e&&this.min.copy(e),t&&this.max.copy(t),s&&this.matrix.copy(s)}set(e,t,s){this.min.copy(e),this.max.copy(t),this.matrix.copy(s),this.needsUpdate=!0}copy(e){this.min.copy(e.min),this.max.copy(e.max),this.matrix.copy(e.matrix),this.needsUpdate=!0}}Ut.prototype.update=function(){return function(){const e=this.matrix,t=this.min,s=this.max,i=this.points;for(let l=0;l<=1;l++)for(let h=0;h<=1;h++)for(let u=0;u<=1;u++){const d=1*l|2*h|4*u,f=i[d];f.x=l?s.x:t.x,f.y=h?s.y:t.y,f.z=u?s.z:t.z,f.applyMatrix4(e)}const n=this.satBounds,r=this.satAxes,o=i[0];for(let l=0;l<3;l++){const h=r[l],u=n[l],d=1<new ue),t=new Array(12).fill().map(()=>new ue),s=new W,i=new W;return function(r,o=0,a=null,l=null){if(this.needsUpdate&&this.update(),this.intersectsBox(r))return(a||l)&&(r.getCenter(i),this.closestPointToPoint(i,s),r.closestPointToPoint(s,i),a&&a.copy(s),l&&l.copy(i)),0;const h=o*o,u=r.min,d=r.max,f=this.points;let I=1/0;for(let m=0;m<8;m++){const E=f[m];i.copy(E).clamp(u,d);const _=E.distanceToSquared(i);if(_new ee)}}const Ht=new ra;function zt(c,e){return e[c+15]===65535}function Yt(c,e){return e[c+6]}function Wt(c,e){return e[c+14]}function Xt(c){return c+8}function Zt(c,e){return e[c+6]}function Vr(c,e){return e[c+7]}class oa{constructor(){this.float32Array=null,this.uint16Array=null,this.uint32Array=null;const e=[];let t=null;this.setBuffer=s=>{t&&e.push(t),t=s,this.float32Array=new Float32Array(s),this.uint16Array=new Uint16Array(s),this.uint32Array=new Uint32Array(s)},this.clearBuffer=()=>{t=null,this.float32Array=null,this.uint16Array=null,this.uint32Array=null,e.length!==0&&this.setBuffer(e.pop())}}}const mt=new oa;let Te,We;const Pe=[],Bs=new Pn(()=>new Nt);function aa(c,e,t,s,i,n){Te=Bs.getPrimitive(),We=Bs.getPrimitive(),Pe.push(Te,We),mt.setBuffer(c._roots[e]);const r=$i(0,c.geometry,t,s,i,n);mt.clearBuffer(),Bs.releasePrimitive(Te),Bs.releasePrimitive(We),Pe.pop(),Pe.pop();const o=Pe.length;return o>0&&(We=Pe[o-1],Te=Pe[o-2]),r}function $i(c,e,t,s,i=null,n=0,r=0){const{float32Array:o,uint16Array:a,uint32Array:l}=mt;let h=c*2;if(zt(h,a)){const d=Yt(c,l),f=Wt(h,a);return Tt(c,o,Te),s(d,f,!1,r,n+c,Te)}else{let M=function(O){const{uint16Array:P,uint32Array:C}=mt;let v=O*2;for(;!zt(v,P);)O=Xt(O),v=O*2;return Yt(O,C)},z=function(O){const{uint16Array:P,uint32Array:C}=mt;let v=O*2;for(;!zt(v,P);)O=Zt(O,C),v=O*2;return Yt(O,C)+Wt(v,P)};const d=Xt(c),f=Zt(c,l);let I=d,p=f,m,E,_,A;if(i&&(_=Te,A=We,Tt(I,o,_),Tt(p,o,A),m=i(_),E=i(A),E(is.copy(e).clamp(h.min,h.max),is.distanceToSquared(e)),intersectsBounds:(h,u,d)=>d{h.closestPointToPoint(e,is);const d=e.distanceToSquared(is);return d0&&l.normal.multiplyScalar(-1));const h={a:n,b:r,c:o,normal:new W,materialIndex:0};ms.getNormal(Le,Me,ve,h.normal),l.face=h,l.faceIndex=n}return l}function yi(c,e,t,s,i){const n=s*3;let r=n+0,o=n+1,a=n+2;const l=c.index;c.index&&(r=l.getX(r),o=l.getX(o),a=l.getX(a));const{position:h,normal:u,uv:d,uv1:f}=c.attributes,I=ha(t,h,u,d,f,r,o,a,e);return I?(I.faceIndex=s,i&&i.push(I),I):null}function St(c,e,t,s){const i=c.a,n=c.b,r=c.c;let o=e,a=e+1,l=e+2;t&&(o=t.getX(o),a=t.getX(a),l=t.getX(l)),i.x=s.getX(o),i.y=s.getY(o),i.z=s.getZ(o),n.x=s.getX(a),n.y=s.getY(a),n.z=s.getZ(a),r.x=s.getX(l),r.y=s.getY(l),r.z=s.getZ(l)}function ua(c,e,t,s,i,n){const{geometry:r,_indirectBuffer:o}=c;for(let a=s,l=s+i;aF&&(F=O),Pw&&(w=P),CL&&(L=C)}return a[d+0]!==A||a[d+1]!==T||a[d+2]!==R||a[d+3]!==F||a[d+4]!==w||a[d+5]!==L?(a[d+0]=A,a[d+1]=T,a[d+2]=R,a[d+3]=F,a[d+4]=w,a[d+5]=L,!0):!1}else{const E=d+8,_=r[d+6],A=E+f,T=_+f;let R=I,F=!1,w=!1;e?R||(F=e.has(A),w=e.has(T),R=!F&&!w):(F=!0,w=!0);const L=R||F,N=R||w;let M=!1;L&&(M=u(E,f,R));let z=!1;N&&(z=u(_,f,R));const O=M||z;if(O)for(let P=0;P<3;P++){const C=E+P,v=_+P,$=a[C],Y=a[C+3],q=a[v],G=a[v+3];a[d+P]=$G?Y:G}return O}}}const Jn=new Nt;function Ae(c,e,t,s){return Tt(c,e,Jn),t.intersectBox(Jn,s)}function Ea(c,e,t,s,i,n){const{geometry:r,_indirectBuffer:o}=c;for(let a=s,l=s+i;a=0;let f,I;d?(f=Xt(c),I=Zt(c,r)):(f=Zt(c,r),I=Xt(c));const m=Ae(f,i,s,er)?Qi(f,e,t,s):null;if(m){const A=m.point[h];if(d?A<=i[I+l]:A>=i[I+l+3])return m}const _=Ae(I,i,s,er)?Qi(I,e,t,s):null;return m&&_?m.distance<=_.distance?m:_:m||_||null}}const Gs=new Nt,xe=new ee,De=new ee,ns=new Ft,sr=new Ut,Hs=new Ut;function _a(c,e,t,s){mt.setBuffer(c._roots[e]);const i=Ki(0,c,t,s);return mt.clearBuffer(),i}function Ki(c,e,t,s,i=null){const{float32Array:n,uint16Array:r,uint32Array:o}=mt;let a=c*2;if(i===null&&(t.boundingBox||t.computeBoundingBox(),sr.set(t.boundingBox.min,t.boundingBox.max,s),i=sr),zt(a,r)){const h=e.geometry,u=h.index,d=h.attributes.position,f=t.index,I=t.attributes.position,p=Yt(c,o),m=Wt(a,r);if(ns.copy(s).invert(),t.boundsTree)return Tt(c,n,Hs),Hs.matrix.copy(ns),Hs.needsUpdate=!0,t.boundsTree.shapecast({intersectsBounds:_=>Hs.intersectsBox(_),intersectsTriangle:_=>{_.a.applyMatrix4(s),_.b.applyMatrix4(s),_.c.applyMatrix4(s),_.needsUpdate=!0;for(let A=p*3,T=(m+p)*3;AMi.distanceToBox(R),intersectsBounds:(R,F,w)=>w<_&&w{if(e.boundsTree)return e.boundsTree.shapecast({boundsTraverseOrder:L=>rs.distanceToBox(L),intersectsBounds:(L,N,M)=>M<_&&M{for(let M=L,z=L+N;MF&&(F=C),vw&&(w=v),$L&&(L=$)}}return a[d+0]!==A||a[d+1]!==T||a[d+2]!==R||a[d+3]!==F||a[d+4]!==w||a[d+5]!==L?(a[d+0]=A,a[d+1]=T,a[d+2]=R,a[d+3]=F,a[d+4]=w,a[d+5]=L,!0):!1}else{const E=d+8,_=r[d+6],A=E+f,T=_+f;let R=I,F=!1,w=!1;e?R||(F=e.has(A),w=e.has(T),R=!F&&!w):(F=!0,w=!0);const L=R||F,N=R||w;let M=!1;L&&(M=u(E,f,R));let z=!1;N&&(z=u(_,f,R));const O=M||z;if(O)for(let P=0;P<3;P++){const C=E+P,v=_+P,$=a[C],Y=a[C+3],q=a[v],G=a[v+3];a[d+P]=$G?Y:G}return O}}}const ir=new W;function wa(c,e,t,s,i){mt.setBuffer(c._roots[e]),qi(0,c,t,s,i),mt.clearBuffer()}function qi(c,e,t,s,i){const{float32Array:n,uint16Array:r,uint32Array:o}=mt,a=c*2;if(zt(a,r)){const h=Yt(c,o),u=Wt(a,r);Ea(e,t,s,h,u,i)}else{const h=Xt(c);Ae(h,n,s,ir)&&qi(h,e,t,s,i);const u=Zt(c,o);Ae(u,n,s,ir)&&qi(u,e,t,s,i)}}const nr=new W,Na=["x","y","z"];function ba(c,e,t,s){mt.setBuffer(c._roots[e]);const i=Ji(0,c,t,s);return mt.clearBuffer(),i}function Ji(c,e,t,s){const{float32Array:i,uint16Array:n,uint32Array:r}=mt;let o=c*2;if(zt(o,n)){const l=Yt(c,r),h=Wt(o,n);return Ia(e,t,s,l,h)}else{const l=Vr(c,r),h=Na[l],d=s.direction[h]>=0;let f,I;d?(f=Xt(c),I=Zt(c,r)):(f=Zt(c,r),I=Xt(c));const m=Ae(f,i,s,nr)?Ji(f,e,t,s):null;if(m){const A=m.point[h];if(d?A<=i[I+l]:A>=i[I+l+3])return m}const _=Ae(I,i,s,nr)?Ji(I,e,t,s):null;return m&&_?m.distance<=_.distance?m:_:m||_||null}}const Xs=new Nt,Ue=new ee,Be=new ee,os=new Ft,rr=new Ut,Zs=new Ut;function Pa(c,e,t,s){mt.setBuffer(c._roots[e]);const i=tn(0,c,t,s);return mt.clearBuffer(),i}function tn(c,e,t,s,i=null){const{float32Array:n,uint16Array:r,uint32Array:o}=mt;let a=c*2;if(i===null&&(t.boundingBox||t.computeBoundingBox(),rr.set(t.boundingBox.min,t.boundingBox.max,s),i=rr),zt(a,r)){const h=e.geometry,u=h.index,d=h.attributes.position,f=t.index,I=t.attributes.position,p=Yt(c,o),m=Wt(a,r);if(os.copy(s).invert(),t.boundsTree)return Tt(c,n,Zs),Zs.matrix.copy(os),Zs.needsUpdate=!0,t.boundsTree.shapecast({intersectsBounds:_=>Zs.intersectsBox(_),intersectsTriangle:_=>{_.a.applyMatrix4(s),_.b.applyMatrix4(s),_.c.applyMatrix4(s),_.needsUpdate=!0;for(let A=p,T=m+p;Avi.distanceToBox(R),intersectsBounds:(R,F,w)=>w<_&&w{if(e.boundsTree){const w=e.boundsTree;return w.shapecast({boundsTraverseOrder:L=>as.distanceToBox(L),intersectsBounds:(L,N,M)=>M<_&&M{for(let M=L,z=L+N;Mnew Nt),ke=new Nt,ze=new Nt,xi=new Nt,Di=new Nt;let Ui=!1;function Ba(c,e,t,s){if(Ui)throw new Error("MeshBVH: Recursive calls to bvhcast not supported.");Ui=!0;const i=c._roots,n=e._roots;let r,o=0,a=0;const l=new Ft().copy(t).invert();for(let h=0,u=i.length;ha.slice()),index:r.array.slice(),indirectBuffer:n?n.slice():null}:o={roots:i,index:r.array,indirectBuffer:n},o}static deserialize(e,t,s={}){s={setIndex:!0,indirect:!!e.indirectBuffer,...s};const{index:i,roots:n,indirectBuffer:r}=e,o=new Ln(t,{...s,[Ni]:!0});if(o._roots=n,o._indirectBuffer=r||null,s.setIndex){const a=t.getIndex();if(a===null){const l=new Fs(e.index,1,!1);t.setIndex(l)}else a.array!==i&&(a.array.set(i),a.needsUpdate=!0)}return o}get indirect(){return!!this._indirectBuffer}constructor(e,t={}){if(e.isBufferGeometry){if(e.index&&e.index.isInterleavedBufferAttribute)throw new Error("MeshBVH: InterleavedBufferAttribute is not supported for the index attribute.")}else throw new Error("MeshBVH: Only BufferGeometries are supported.");if(t=Object.assign({strategy:kr,maxDepth:40,maxLeafTris:10,verbose:!0,useSharedArrayBuffer:!1,setBoundingBox:!0,onProgress:null,indirect:!1,[Ni]:!1},t),t.useSharedArrayBuffer&&!Ua())throw new Error("MeshBVH: SharedArrayBuffer is not available.");this.geometry=e,this._roots=null,this._indirectBuffer=null,t[Ni]||(ea(this,t),!e.boundingBox&&t.setBoundingBox&&(e.boundingBox=this.getBoundingBox(new Nt)));const{_indirectBuffer:s}=this;this.resolveTriangleIndex=t.indirect?i=>s[i]:i=>i}refit(e=null){return(this.indirect?Sa:pa)(this,e)}traverse(e,t=0){const s=this._roots[t],i=new Uint32Array(s),n=new Uint16Array(s);r(0);function r(o,a=0){const l=o*2,h=n[l+15]===Ri;if(h){const u=i[o+6],d=n[l+14];e(a,h,new Float32Array(s,o*4,6),u,d)}else{const u=o+ni/4,d=i[o+6],f=i[o+7];e(a,h,new Float32Array(s,o*4,6),f)||(r(u,a+1),r(d,a+1))}}}raycast(e,t=Yn){const s=this._roots,i=this.geometry,n=[],r=t.isMaterial,o=Array.isArray(t),a=i.groups,l=r?t.side:t,h=this.indirect?wa:Ca;for(let u=0,d=s.length;uu(d,f,I,p,m)?!0:s(d,f,this,o,I,p,t)}else r||(o?r=(u,d,f,I)=>s(u,d,this,o,f,I,t):r=(u,d,f)=>f);let a=!1,l=0;const h=this._roots;for(let u=0,d=h.length;u{const p=this.resolveTriangleIndex(I);St(r,p*3,o,a)}:I=>{St(r,I*3,o,a)},h=Ht.getPrimitive(),u=e.geometry.index,d=e.geometry.attributes.position,f=e.indirect?I=>{const p=e.resolveTriangleIndex(I);St(h,p*3,u,d)}:I=>{St(h,I*3,u,d)};if(n){const I=(p,m,E,_,A,T,R,F)=>{for(let w=E,L=E+_;wjs.intersectsBox(s),intersectsTriangle:s=>js.intersectsTriangle(s)})}intersectsSphere(e){return this.shapecast({intersectsBounds:t=>e.intersectsBox(t),intersectsTriangle:t=>t.intersectsSphere(e)})}closestPointToGeometry(e,t,s={},i={},n=0,r=1/0){return(this.indirect?Da:Fa)(this,e,t,s,i,n,r)}closestPointToPoint(e,t={},s=0,i=1/0){return ca(this,e,t,s,i)}getBoundingBox(e){return e.makeEmpty(),this._roots.forEach(s=>{Tt(0,new Float32Array(s),or),e.union(or)}),e}}function ar(c,e,t){return c===null||(c.point.applyMatrix4(e.matrixWorld),c.distance=c.point.distanceTo(t.ray.origin),c.object=e,c.distancet.far)?null:c}const Bi=new oo,cr=new Ft,ka=st.prototype.raycast;function za(c,e){if(this.geometry.boundsTree){if(this.material===void 0)return;cr.copy(this.matrixWorld).invert(),Bi.copy(c.ray).applyMatrix4(cr);const t=this.geometry.boundsTree;if(c.firstHitOnly===!0){const s=ar(t.raycastFirst(Bi,this.material),this,c);s&&e.push(s)}else{const s=t.raycast(Bi,this.material);for(let i=0,n=s.length;i{const t=this.handlers.slice(0);for(const s of t)s(e)});y(this,"handlers",[])}add(e){this.handlers.push(e)}remove(e){this.handlers=this.handlers.filter(t=>t!==e)}reset(){this.handlers.length=0}}class Ga{constructor(){y(this,"trigger",async e=>{const t=this.handlers.slice(0);for(const s of t)await s(e)});y(this,"handlers",[])}add(e){this.handlers.push(e)}remove(e){this.handlers=this.handlers.filter(t=>t!==e)}reset(){this.handlers.length=0}}class Mn{constructor(e){y(this,"isDisposeable",()=>"dispose"in this&&"onDisposed"in this);y(this,"isResizeable",()=>"resize"in this&&"getSize"in this);y(this,"isUpdateable",()=>"onAfterUpdate"in this&&"onBeforeUpdate"in this&&"update"in this);y(this,"isHideable",()=>"visible"in this);y(this,"isConfigurable",()=>"setup"in this&&"config"in this&&"onSetup"in this);this.components=e}}class Bt extends Mn{}class Ha extends Mn{constructor(t){super(t);y(this,"worlds",new Map);y(this,"onWorldChanged",new et);y(this,"currentWorld",null);this.onWorldChanged.add(({world:s,action:i})=>{i==="removed"&&this.worlds.delete(s.uuid)})}}class Wa extends Ha{constructor(){super(...arguments);y(this,"hasCameraControls",()=>"controls"in this)}}const _s=class _s extends Bt{constructor(t){super(t);y(this,"_disposedComponents",new Set);y(this,"enabled",!0);t.add(_s.uuid,this)}get(){return this._disposedComponents}destroy(t,s=!0,i=!0){t.removeFromParent();const n=t;n.dispose&&n.dispose(),this.disposeGeometryAndMaterials(t,s),i&&n.children&&n.children.length&&this.disposeChildren(n),t.children.length=0}disposeGeometry(t){t.boundsTree&&t.disposeBoundsTree&&t.disposeBoundsTree(),t.dispose()}disposeGeometryAndMaterials(t,s){const i=t;i.geometry&&this.disposeGeometry(i.geometry),s&&i.material&&_s.disposeMaterial(i),i.material=[],i.geometry=null}disposeChildren(t){for(const s of t.children)this.destroy(s)}static disposeMaterial(t){if(t.material)if(Array.isArray(t.material))for(const s of t.material)s.dispose();else t.material.dispose()}};y(_s,"uuid","76e9cd8e-ad8f-4753-9ef6-cbc60f7247fe");let je=_s;class Xe extends Set{constructor(t){super(t);y(this,"onItemAdded",new et);y(this,"onItemDeleted",new et);y(this,"onCleared",new et);y(this,"guard",()=>!0)}clear(){super.clear(),this.onCleared.trigger()}add(...t){for(const s of t)this.has(s)||!this.guard(s)||(super.add(s),this.onItemAdded||(this.onItemAdded=new et),this.onItemAdded.trigger(s));return this}delete(t){const s=super.delete(t);return s&&this.onItemDeleted.trigger(),s}dispose(){this.clear(),this.onItemAdded.reset(),this.onItemDeleted.reset(),this.onCleared.reset()}}class Re extends Map{constructor(t){super(t);y(this,"onItemSet",new et);y(this,"onItemUpdated",new et);y(this,"onItemDeleted",new et);y(this,"onCleared",new et);y(this,"guard",()=>!0)}clear(){super.clear(),this.onCleared.trigger()}set(t,s){const i=this.has(t);if(!(this.guard??(()=>!0))(t,s))return this;const o=super.set(t,s);return i?(this.onItemUpdated||(this.onItemUpdated=new et),this.onItemUpdated.trigger({key:t,value:s})):(this.onItemSet||(this.onItemSet=new et),this.onItemSet.trigger({key:t,value:s})),o}delete(t){const s=super.delete(t);return s&&this.onItemDeleted.trigger(t),s}dispose(){this.clear(),this.onItemSet.reset(),this.onItemDeleted.reset(),this.onCleared.reset()}}class lr{static isTransparent(e){return e.transparent&&e.opacity<1}}const yt=class yt{static create(){const e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,s=Math.random()*4294967295|0,i=Math.random()*4294967295|0;return`${yt._lut[e&255]+yt._lut[e>>8&255]+yt._lut[e>>16&255]+yt._lut[e>>24&255]}-${yt._lut[t&255]}${yt._lut[t>>8&255]}-${yt._lut[t>>16&15|64]}${yt._lut[t>>24&255]}-${yt._lut[s&63|128]}${yt._lut[s>>8&255]}-${yt._lut[s>>16&255]}${yt._lut[s>>24&255]}${yt._lut[i&255]}${yt._lut[i>>8&255]}${yt._lut[i>>16&255]}${yt._lut[i>>24&255]}`.toLowerCase()}static validate(e){if(!yt._pattern.test(e))throw new Error(`${e} is not a valid UUID v4. + +- If you're the tool creator, you can take one from https://www.uuidgenerator.net/. + +- If you're using a platform tool, verify the uuid isn't misspelled or contact the tool creator.`)}};y(yt,"_pattern",/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-4[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}$/),y(yt,"_lut",["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"]);let fe=yt;const ui=class ui{constructor(){y(this,"onDisposed",new et);y(this,"list",new Map);y(this,"enabled",!1);y(this,"_clock");y(this,"update",()=>{if(!this.enabled)return;const e=this._clock.getDelta();for(const[t,s]of this.list)s.enabled&&s.isUpdateable()&&s.update(e);requestAnimationFrame(this.update)});this._clock=new ao,ui.setupBVH()}add(e,t){if(this.list.has(e))throw new Error("You're trying to add a component that already exists in the components instance. Use Components.get() instead.");fe.validate(e),this.list.set(e,t)}get(e){const t=e.uuid;if(!this.list.has(t)){const s=new e(this);return this.list.has(t)||this.add(t,s),s}return this.list.get(t)}init(){this.enabled=!0,this._clock.start(),this.update()}dispose(){this.enabled=!1;for(const[e,t]of this.list)t.enabled=!1,t.isDisposeable()&&t.dispose();this._clock.stop(),this.onDisposed.trigger(),this.onDisposed.reset()}static setupBVH(){Ss.prototype.computeBoundsTree=Ya,Ss.prototype.disposeBoundsTree=Va,st.prototype.raycast=za}};y(ui,"release","2.2.6");let en=ui;class Xa extends Mn{constructor(){super(...arguments);y(this,"meshes",new Set);y(this,"onAfterUpdate",new et);y(this,"onBeforeUpdate",new et);y(this,"onDisposed",new et);y(this,"isDisposing",!1);y(this,"enabled",!0);y(this,"uuid",fe.create());y(this,"name");y(this,"_scene");y(this,"_camera");y(this,"_renderer",null)}get scene(){if(!this._scene)throw new Error("No scene initialized!");return this._scene}set scene(t){this._scene=t,t.worlds.set(this.uuid,this),t.currentWorld=this,t.onWorldChanged.trigger({world:this,action:"added"})}get camera(){if(!this._camera)throw new Error("No camera initialized!");return this._camera}set camera(t){this._camera=t,t.worlds.set(this.uuid,this),t.currentWorld=this,t.onWorldChanged.trigger({world:this,action:"added"})}get renderer(){return this._renderer}set renderer(t){this._renderer=t,t&&(t.worlds.set(this.uuid,this),t.currentWorld=this,t.onWorldChanged.trigger({world:this,action:"added"}))}update(t){this.enabled&&(!this._scene||!this._camera||(this.scene.currentWorld=this,this.camera.currentWorld=this,this.renderer&&(this.renderer.currentWorld=this),this.onBeforeUpdate.trigger(),this.scene.isUpdateable()&&this.scene.update(t),this.camera.isUpdateable()&&this.camera.update(t),this.renderer&&this.renderer.update(t),this.onAfterUpdate.trigger()))}dispose(t=!0){if(this.enabled=!1,this.isDisposing=!0,this.scene.onWorldChanged.trigger({world:this,action:"removed"}),this.camera.onWorldChanged.trigger({world:this,action:"removed"}),this.renderer&&this.renderer.onWorldChanged.trigger({world:this,action:"removed"}),t){const s=this.components.get(je);this.scene.dispose(),this.camera.isDisposeable()&&this.camera.dispose(),this.renderer&&this.renderer.dispose();for(const i of this.meshes)s.destroy(i);this.meshes.clear()}this._scene=null,this._camera=null,this._renderer=null,this.onDisposed.trigger()}}/*! + * camera-controls + * https://github.com/yomotsu/camera-controls + * (c) 2017 @yomotsu + * Released under the MIT License. + */const at={LEFT:1,RIGHT:2,MIDDLE:4},V=Object.freeze({NONE:0,ROTATE:1,TRUCK:2,OFFSET:4,DOLLY:8,ZOOM:16,TOUCH_ROTATE:32,TOUCH_TRUCK:64,TOUCH_OFFSET:128,TOUCH_DOLLY:256,TOUCH_ZOOM:512,TOUCH_DOLLY_TRUCK:1024,TOUCH_DOLLY_OFFSET:2048,TOUCH_DOLLY_ROTATE:4096,TOUCH_ZOOM_TRUCK:8192,TOUCH_ZOOM_OFFSET:16384,TOUCH_ZOOM_ROTATE:32768}),Ye={NONE:0,IN:1,OUT:-1};function Oe(c){return c.isPerspectiveCamera}function me(c){return c.isOrthographicCamera}const Ve=Math.PI*2,hr=Math.PI/2,Gr=1e-5,cs=Math.PI/180;function Kt(c,e,t){return Math.max(e,Math.min(t,c))}function It(c,e=Gr){return Math.abs(c)0==f>h&&(f=h,t.value=(f-h)/n),f}function dr(c,e,t,s,i=1/0,n,r){s=Math.max(1e-4,s);const o=2/s,a=o*n,l=1/(1+a+.48*a*a+.235*a*a*a);let h=e.x,u=e.y,d=e.z,f=c.x-h,I=c.y-u,p=c.z-d;const m=h,E=u,_=d,A=i*s,T=A*A,R=f*f+I*I+p*p;if(R>T){const v=Math.sqrt(R);f=f/v*A,I=I/v*A,p=p/v*A}h=c.x-f,u=c.y-I,d=c.z-p;const F=(t.x+o*f)*n,w=(t.y+o*I)*n,L=(t.z+o*p)*n;t.x=(t.x-o*F)*l,t.y=(t.y-o*w)*l,t.z=(t.z-o*L)*l,r.x=h+(f+F)*l,r.y=u+(I+w)*l,r.z=d+(p+L)*l;const N=m-c.x,M=E-c.y,z=_-c.z,O=r.x-m,P=r.y-E,C=r.z-_;return N*O+M*P+z*C>0&&(r.x=m,r.y=E,r.z=_,t.x=(r.x-m)/n,t.y=(r.y-E)/n,t.z=(r.z-_)/n),r}function ki(c,e){e.set(0,0),c.forEach(t=>{e.x+=t.clientX,e.y+=t.clientY}),e.x/=c.length,e.y/=c.length}function zi(c,e){return me(c)?(console.warn(`${e} is not supported in OrthographicCamera`),!0):!1}class Za{constructor(){this._listeners={}}addEventListener(e,t){const s=this._listeners;s[e]===void 0&&(s[e]=[]),s[e].indexOf(t)===-1&&s[e].push(t)}hasEventListener(e,t){const s=this._listeners;return s[e]!==void 0&&s[e].indexOf(t)!==-1}removeEventListener(e,t){const i=this._listeners[e];if(i!==void 0){const n=i.indexOf(t);n!==-1&&i.splice(n,1)}}removeAllEventListeners(e){if(!e){this._listeners={};return}Array.isArray(this._listeners[e])&&(this._listeners[e].length=0)}dispatchEvent(e){const s=this._listeners[e.type];if(s!==void 0){e.target=this;const i=s.slice(0);for(let n=0,r=i.length;n{},this._enabled=!0,this._state=V.NONE,this._viewport=null,this._changedDolly=0,this._changedZoom=0,this._hasRested=!0,this._boundaryEnclosesCamera=!1,this._needsUpdate=!0,this._updatedLastTime=!1,this._elementRect=new DOMRect,this._isDragging=!1,this._dragNeedsUpdate=!0,this._activePointers=[],this._lockedPointer=null,this._interactiveArea=new DOMRect(0,0,1,1),this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._isUserControllingOffset=!1,this._isUserControllingZoom=!1,this._lastDollyDirection=Ye.NONE,this._thetaVelocity={value:0},this._phiVelocity={value:0},this._radiusVelocity={value:0},this._targetVelocity=new ot.Vector3,this._focalOffsetVelocity=new ot.Vector3,this._zoomVelocity={value:0},this._truckInternal=(T,R,F)=>{let w,L;if(Oe(this._camera)){const N=ct.copy(this._camera.position).sub(this._target),M=this._camera.getEffectiveFOV()*cs,z=N.length()*Math.tan(M*.5);w=this.truckSpeed*T*z/this._elementRect.height,L=this.truckSpeed*R*z/this._elementRect.height}else if(me(this._camera)){const N=this._camera;w=T*(N.right-N.left)/N.zoom/this._elementRect.width,L=R*(N.top-N.bottom)/N.zoom/this._elementRect.height}else return;this.verticalDragToForward?(F?this.setFocalOffset(this._focalOffsetEnd.x+w,this._focalOffsetEnd.y,this._focalOffsetEnd.z,!0):this.truck(w,0,!0),this.forward(-L,!0)):F?this.setFocalOffset(this._focalOffsetEnd.x+w,this._focalOffsetEnd.y+L,this._focalOffsetEnd.z,!0):this.truck(w,L,!0)},this._rotateInternal=(T,R)=>{const F=Ve*this.azimuthRotateSpeed*T/this._elementRect.height,w=Ve*this.polarRotateSpeed*R/this._elementRect.height;this.rotate(F,w,!0)},this._dollyInternal=(T,R,F)=>{const w=Math.pow(.95,-T*this.dollySpeed),L=this._sphericalEnd.radius,N=this._sphericalEnd.radius*w,M=Kt(N,this.minDistance,this.maxDistance),z=M-N;this.infinityDolly&&this.dollyToCursor?this._dollyToNoClamp(N,!0):this.infinityDolly&&!this.dollyToCursor?(this.dollyInFixed(z,!0),this._dollyToNoClamp(M,!0)):this._dollyToNoClamp(M,!0),this.dollyToCursor&&(this._changedDolly+=(this.infinityDolly?N:M)-L,this._dollyControlCoord.set(R,F)),this._lastDollyDirection=Math.sign(-T)},this._zoomInternal=(T,R,F)=>{const w=Math.pow(.95,T*this.dollySpeed),L=this._zoom,N=this._zoom*w;this.zoomTo(N,!0),this.dollyToCursor&&(this._changedZoom+=N-L,this._dollyControlCoord.set(R,F))},typeof ot>"u"&&console.error("camera-controls: `THREE` is undefined. You must first run `CameraControls.install( { THREE: THREE } )`. Check the docs for further information."),this._camera=e,this._yAxisUpSpace=new ot.Quaternion().setFromUnitVectors(this._camera.up,qs),this._yAxisUpSpaceInverse=this._yAxisUpSpace.clone().invert(),this._state=V.NONE,this._target=new ot.Vector3,this._targetEnd=this._target.clone(),this._focalOffset=new ot.Vector3,this._focalOffsetEnd=this._focalOffset.clone(),this._spherical=new ot.Spherical().setFromVector3(ct.copy(this._camera.position).applyQuaternion(this._yAxisUpSpace)),this._sphericalEnd=this._spherical.clone(),this._lastDistance=this._spherical.radius,this._zoom=this._camera.zoom,this._zoomEnd=this._zoom,this._lastZoom=this._zoom,this._nearPlaneCorners=[new ot.Vector3,new ot.Vector3,new ot.Vector3,new ot.Vector3],this._updateNearPlaneCorners(),this._boundary=new ot.Box3(new ot.Vector3(-1/0,-1/0,-1/0),new ot.Vector3(1/0,1/0,1/0)),this._cameraUp0=this._camera.up.clone(),this._target0=this._target.clone(),this._position0=this._camera.position.clone(),this._zoom0=this._zoom,this._focalOffset0=this._focalOffset.clone(),this._dollyControlCoord=new ot.Vector2,this.mouseButtons={left:V.ROTATE,middle:V.DOLLY,right:V.TRUCK,wheel:Oe(this._camera)?V.DOLLY:me(this._camera)?V.ZOOM:V.NONE},this.touches={one:V.TOUCH_ROTATE,two:Oe(this._camera)?V.TOUCH_DOLLY_TRUCK:me(this._camera)?V.TOUCH_ZOOM_TRUCK:V.NONE,three:V.TOUCH_TRUCK};const s=new ot.Vector2,i=new ot.Vector2,n=new ot.Vector2,r=T=>{if(!this._enabled||!this._domElement)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const w=this._domElement.getBoundingClientRect(),L=T.clientX/w.width,N=T.clientY/w.height;if(Lthis._interactiveArea.right||Nthis._interactiveArea.bottom)return}const R=T.pointerType!=="mouse"?null:(T.buttons&at.LEFT)===at.LEFT?at.LEFT:(T.buttons&at.MIDDLE)===at.MIDDLE?at.MIDDLE:(T.buttons&at.RIGHT)===at.RIGHT?at.RIGHT:null;if(R!==null){const w=this._findPointerByMouseButton(R);w&&this._disposePointer(w)}if((T.buttons&at.LEFT)===at.LEFT&&this._lockedPointer)return;const F={pointerId:T.pointerId,clientX:T.clientX,clientY:T.clientY,deltaX:0,deltaY:0,mouseButton:R};this._activePointers.push(F),this._domElement.ownerDocument.removeEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",h),this._domElement.ownerDocument.addEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.addEventListener("pointerup",h),this._isDragging=!0,p(T)},o=T=>{if(!this._enabled||!this._domElement||this._lockedPointer)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const w=this._domElement.getBoundingClientRect(),L=T.clientX/w.width,N=T.clientY/w.height;if(Lthis._interactiveArea.right||Nthis._interactiveArea.bottom)return}const R=(T.buttons&at.LEFT)===at.LEFT?at.LEFT:(T.buttons&at.MIDDLE)===at.MIDDLE?at.MIDDLE:(T.buttons&at.RIGHT)===at.RIGHT?at.RIGHT:null;if(R!==null){const w=this._findPointerByMouseButton(R);w&&this._disposePointer(w)}const F={pointerId:1,clientX:T.clientX,clientY:T.clientY,deltaX:0,deltaY:0,mouseButton:(T.buttons&at.LEFT)===at.LEFT?at.LEFT:(T.buttons&at.MIDDLE)===at.LEFT?at.MIDDLE:(T.buttons&at.RIGHT)===at.LEFT?at.RIGHT:null};this._activePointers.push(F),this._domElement.ownerDocument.removeEventListener("mousemove",l),this._domElement.ownerDocument.removeEventListener("mouseup",u),this._domElement.ownerDocument.addEventListener("mousemove",l),this._domElement.ownerDocument.addEventListener("mouseup",u),this._isDragging=!0,p(T)},a=T=>{T.cancelable&&T.preventDefault();const R=T.pointerId,F=this._lockedPointer||this._findPointerById(R);if(F){if(F.clientX=T.clientX,F.clientY=T.clientY,F.deltaX=T.movementX,F.deltaY=T.movementY,this._state=0,T.pointerType==="touch")switch(this._activePointers.length){case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else(!this._isDragging&&this._lockedPointer||this._isDragging&&(T.buttons&at.LEFT)===at.LEFT)&&(this._state=this._state|this.mouseButtons.left),this._isDragging&&(T.buttons&at.MIDDLE)===at.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),this._isDragging&&(T.buttons&at.RIGHT)===at.RIGHT&&(this._state=this._state|this.mouseButtons.right);m()}},l=T=>{const R=this._lockedPointer||this._findPointerById(1);R&&(R.clientX=T.clientX,R.clientY=T.clientY,R.deltaX=T.movementX,R.deltaY=T.movementY,this._state=0,(this._lockedPointer||(T.buttons&at.LEFT)===at.LEFT)&&(this._state=this._state|this.mouseButtons.left),(T.buttons&at.MIDDLE)===at.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),(T.buttons&at.RIGHT)===at.RIGHT&&(this._state=this._state|this.mouseButtons.right),m())},h=T=>{const R=this._findPointerById(T.pointerId);if(!(R&&R===this._lockedPointer)){if(R&&this._disposePointer(R),T.pointerType==="touch")switch(this._activePointers.length){case 0:this._state=V.NONE;break;case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else this._state=V.NONE;E()}},u=()=>{const T=this._findPointerById(1);T&&T===this._lockedPointer||(T&&this._disposePointer(T),this._state=V.NONE,E())};let d=-1;const f=T=>{if(!this._domElement||!this._enabled||this.mouseButtons.wheel===V.NONE)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const N=this._domElement.getBoundingClientRect(),M=T.clientX/N.width,z=T.clientY/N.height;if(Mthis._interactiveArea.right||zthis._interactiveArea.bottom)return}if(T.preventDefault(),this.dollyToCursor||this.mouseButtons.wheel===V.ROTATE||this.mouseButtons.wheel===V.TRUCK){const N=performance.now();d-N<1e3&&this._getClientRect(this._elementRect),d=N}const R=ja?-1:-3,F=T.deltaMode===1?T.deltaY/R:T.deltaY/(R*10),w=this.dollyToCursor?(T.clientX-this._elementRect.x)/this._elementRect.width*2-1:0,L=this.dollyToCursor?(T.clientY-this._elementRect.y)/this._elementRect.height*-2+1:0;switch(this.mouseButtons.wheel){case V.ROTATE:{this._rotateInternal(T.deltaX,T.deltaY),this._isUserControllingRotate=!0;break}case V.TRUCK:{this._truckInternal(T.deltaX,T.deltaY,!1),this._isUserControllingTruck=!0;break}case V.OFFSET:{this._truckInternal(T.deltaX,T.deltaY,!0),this._isUserControllingOffset=!0;break}case V.DOLLY:{this._dollyInternal(-F,w,L),this._isUserControllingDolly=!0;break}case V.ZOOM:{this._zoomInternal(-F,w,L),this._isUserControllingZoom=!0;break}}this.dispatchEvent({type:"control"})},I=T=>{if(!(!this._domElement||!this._enabled)){if(this.mouseButtons.right===vt.ACTION.NONE){const R=T instanceof PointerEvent?T.pointerId:(T instanceof MouseEvent,0),F=this._findPointerById(R);F&&this._disposePointer(F),this._domElement.ownerDocument.removeEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",h),this._domElement.ownerDocument.removeEventListener("mousemove",l),this._domElement.ownerDocument.removeEventListener("mouseup",u);return}T.preventDefault()}},p=T=>{if(!this._enabled)return;if(ki(this._activePointers,kt),this._getClientRect(this._elementRect),s.copy(kt),i.copy(kt),this._activePointers.length>=2){const F=kt.x-this._activePointers[1].clientX,w=kt.y-this._activePointers[1].clientY,L=Math.sqrt(F*F+w*w);n.set(0,L);const N=(this._activePointers[0].clientX+this._activePointers[1].clientX)*.5,M=(this._activePointers[0].clientY+this._activePointers[1].clientY)*.5;i.set(N,M)}if(this._state=0,!T)this._lockedPointer&&(this._state=this._state|this.mouseButtons.left);else if("pointerType"in T&&T.pointerType==="touch")switch(this._activePointers.length){case 1:this._state=this.touches.one;break;case 2:this._state=this.touches.two;break;case 3:this._state=this.touches.three;break}else!this._lockedPointer&&(T.buttons&at.LEFT)===at.LEFT&&(this._state=this._state|this.mouseButtons.left),(T.buttons&at.MIDDLE)===at.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),(T.buttons&at.RIGHT)===at.RIGHT&&(this._state=this._state|this.mouseButtons.right);((this._state&V.ROTATE)===V.ROTATE||(this._state&V.TOUCH_ROTATE)===V.TOUCH_ROTATE||(this._state&V.TOUCH_DOLLY_ROTATE)===V.TOUCH_DOLLY_ROTATE||(this._state&V.TOUCH_ZOOM_ROTATE)===V.TOUCH_ZOOM_ROTATE)&&(this._sphericalEnd.theta=this._spherical.theta,this._sphericalEnd.phi=this._spherical.phi,this._thetaVelocity.value=0,this._phiVelocity.value=0),((this._state&V.TRUCK)===V.TRUCK||(this._state&V.TOUCH_TRUCK)===V.TOUCH_TRUCK||(this._state&V.TOUCH_DOLLY_TRUCK)===V.TOUCH_DOLLY_TRUCK||(this._state&V.TOUCH_ZOOM_TRUCK)===V.TOUCH_ZOOM_TRUCK)&&(this._targetEnd.copy(this._target),this._targetVelocity.set(0,0,0)),((this._state&V.DOLLY)===V.DOLLY||(this._state&V.TOUCH_DOLLY)===V.TOUCH_DOLLY||(this._state&V.TOUCH_DOLLY_TRUCK)===V.TOUCH_DOLLY_TRUCK||(this._state&V.TOUCH_DOLLY_OFFSET)===V.TOUCH_DOLLY_OFFSET||(this._state&V.TOUCH_DOLLY_ROTATE)===V.TOUCH_DOLLY_ROTATE)&&(this._sphericalEnd.radius=this._spherical.radius,this._radiusVelocity.value=0),((this._state&V.ZOOM)===V.ZOOM||(this._state&V.TOUCH_ZOOM)===V.TOUCH_ZOOM||(this._state&V.TOUCH_ZOOM_TRUCK)===V.TOUCH_ZOOM_TRUCK||(this._state&V.TOUCH_ZOOM_OFFSET)===V.TOUCH_ZOOM_OFFSET||(this._state&V.TOUCH_ZOOM_ROTATE)===V.TOUCH_ZOOM_ROTATE)&&(this._zoomEnd=this._zoom,this._zoomVelocity.value=0),((this._state&V.OFFSET)===V.OFFSET||(this._state&V.TOUCH_OFFSET)===V.TOUCH_OFFSET||(this._state&V.TOUCH_DOLLY_OFFSET)===V.TOUCH_DOLLY_OFFSET||(this._state&V.TOUCH_ZOOM_OFFSET)===V.TOUCH_ZOOM_OFFSET)&&(this._focalOffsetEnd.copy(this._focalOffset),this._focalOffsetVelocity.set(0,0,0)),this.dispatchEvent({type:"controlstart"})},m=()=>{if(!this._enabled||!this._dragNeedsUpdate)return;this._dragNeedsUpdate=!1,ki(this._activePointers,kt);const R=this._domElement&&document.pointerLockElement===this._domElement?this._lockedPointer||this._activePointers[0]:null,F=R?-R.deltaX:i.x-kt.x,w=R?-R.deltaY:i.y-kt.y;if(i.copy(kt),((this._state&V.ROTATE)===V.ROTATE||(this._state&V.TOUCH_ROTATE)===V.TOUCH_ROTATE||(this._state&V.TOUCH_DOLLY_ROTATE)===V.TOUCH_DOLLY_ROTATE||(this._state&V.TOUCH_ZOOM_ROTATE)===V.TOUCH_ZOOM_ROTATE)&&(this._rotateInternal(F,w),this._isUserControllingRotate=!0),(this._state&V.DOLLY)===V.DOLLY||(this._state&V.ZOOM)===V.ZOOM){const L=this.dollyToCursor?(s.x-this._elementRect.x)/this._elementRect.width*2-1:0,N=this.dollyToCursor?(s.y-this._elementRect.y)/this._elementRect.height*-2+1:0,M=this.dollyDragInverted?-1:1;(this._state&V.DOLLY)===V.DOLLY?(this._dollyInternal(M*w*Ks,L,N),this._isUserControllingDolly=!0):(this._zoomInternal(M*w*Ks,L,N),this._isUserControllingZoom=!0)}if((this._state&V.TOUCH_DOLLY)===V.TOUCH_DOLLY||(this._state&V.TOUCH_ZOOM)===V.TOUCH_ZOOM||(this._state&V.TOUCH_DOLLY_TRUCK)===V.TOUCH_DOLLY_TRUCK||(this._state&V.TOUCH_ZOOM_TRUCK)===V.TOUCH_ZOOM_TRUCK||(this._state&V.TOUCH_DOLLY_OFFSET)===V.TOUCH_DOLLY_OFFSET||(this._state&V.TOUCH_ZOOM_OFFSET)===V.TOUCH_ZOOM_OFFSET||(this._state&V.TOUCH_DOLLY_ROTATE)===V.TOUCH_DOLLY_ROTATE||(this._state&V.TOUCH_ZOOM_ROTATE)===V.TOUCH_ZOOM_ROTATE){const L=kt.x-this._activePointers[1].clientX,N=kt.y-this._activePointers[1].clientY,M=Math.sqrt(L*L+N*N),z=n.y-M;n.set(0,M);const O=this.dollyToCursor?(i.x-this._elementRect.x)/this._elementRect.width*2-1:0,P=this.dollyToCursor?(i.y-this._elementRect.y)/this._elementRect.height*-2+1:0;(this._state&V.TOUCH_DOLLY)===V.TOUCH_DOLLY||(this._state&V.TOUCH_DOLLY_ROTATE)===V.TOUCH_DOLLY_ROTATE||(this._state&V.TOUCH_DOLLY_TRUCK)===V.TOUCH_DOLLY_TRUCK||(this._state&V.TOUCH_DOLLY_OFFSET)===V.TOUCH_DOLLY_OFFSET?(this._dollyInternal(z*Ks,O,P),this._isUserControllingDolly=!0):(this._zoomInternal(z*Ks,O,P),this._isUserControllingZoom=!0)}((this._state&V.TRUCK)===V.TRUCK||(this._state&V.TOUCH_TRUCK)===V.TOUCH_TRUCK||(this._state&V.TOUCH_DOLLY_TRUCK)===V.TOUCH_DOLLY_TRUCK||(this._state&V.TOUCH_ZOOM_TRUCK)===V.TOUCH_ZOOM_TRUCK)&&(this._truckInternal(F,w,!1),this._isUserControllingTruck=!0),((this._state&V.OFFSET)===V.OFFSET||(this._state&V.TOUCH_OFFSET)===V.TOUCH_OFFSET||(this._state&V.TOUCH_DOLLY_OFFSET)===V.TOUCH_DOLLY_OFFSET||(this._state&V.TOUCH_ZOOM_OFFSET)===V.TOUCH_ZOOM_OFFSET)&&(this._truckInternal(F,w,!0),this._isUserControllingOffset=!0),this.dispatchEvent({type:"control"})},E=()=>{ki(this._activePointers,kt),i.copy(kt),this._dragNeedsUpdate=!1,(this._activePointers.length===0||this._activePointers.length===1&&this._activePointers[0]===this._lockedPointer)&&(this._isDragging=!1),this._activePointers.length===0&&this._domElement&&(this._domElement.ownerDocument.removeEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.removeEventListener("mousemove",l),this._domElement.ownerDocument.removeEventListener("pointerup",h),this._domElement.ownerDocument.removeEventListener("mouseup",u),this.dispatchEvent({type:"controlend"}))};this.lockPointer=()=>{!this._enabled||!this._domElement||(this.cancel(),this._lockedPointer={pointerId:-1,clientX:0,clientY:0,deltaX:0,deltaY:0,mouseButton:null},this._activePointers.push(this._lockedPointer),this._domElement.ownerDocument.removeEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",h),this._domElement.requestPointerLock(),this._domElement.ownerDocument.addEventListener("pointerlockchange",_),this._domElement.ownerDocument.addEventListener("pointerlockerror",A),this._domElement.ownerDocument.addEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.addEventListener("pointerup",h),p())},this.unlockPointer=()=>{this._lockedPointer!==null&&(this._disposePointer(this._lockedPointer),this._lockedPointer=null),document.exitPointerLock(),this.cancel(),this._domElement&&(this._domElement.ownerDocument.removeEventListener("pointerlockchange",_),this._domElement.ownerDocument.removeEventListener("pointerlockerror",A))};const _=()=>{this._domElement&&this._domElement.ownerDocument.pointerLockElement===this._domElement||this.unlockPointer()},A=()=>{this.unlockPointer()};this._addAllEventListeners=T=>{this._domElement=T,this._domElement.style.touchAction="none",this._domElement.style.userSelect="none",this._domElement.style.webkitUserSelect="none",this._domElement.addEventListener("pointerdown",r),Qa&&this._domElement.addEventListener("mousedown",o),this._domElement.addEventListener("pointercancel",h),this._domElement.addEventListener("wheel",f,{passive:!1}),this._domElement.addEventListener("contextmenu",I)},this._removeAllEventListeners=()=>{this._domElement&&(this._domElement.style.touchAction="",this._domElement.style.userSelect="",this._domElement.style.webkitUserSelect="",this._domElement.removeEventListener("pointerdown",r),this._domElement.removeEventListener("mousedown",o),this._domElement.removeEventListener("pointercancel",h),this._domElement.removeEventListener("wheel",f,{passive:!1}),this._domElement.removeEventListener("contextmenu",I),this._domElement.ownerDocument.removeEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.removeEventListener("mousemove",l),this._domElement.ownerDocument.removeEventListener("pointerup",h),this._domElement.ownerDocument.removeEventListener("mouseup",u),this._domElement.ownerDocument.removeEventListener("pointerlockchange",_),this._domElement.ownerDocument.removeEventListener("pointerlockerror",A))},this.cancel=()=>{this._state!==V.NONE&&(this._state=V.NONE,this._activePointers.length=0,E())},t&&this.connect(t),this.update(0)}get camera(){return this._camera}set camera(e){this._camera=e,this.updateCameraUp(),this._camera.updateProjectionMatrix(),this._updateNearPlaneCorners(),this._needsUpdate=!0}get enabled(){return this._enabled}set enabled(e){this._enabled=e,this._domElement&&(e?(this._domElement.style.touchAction="none",this._domElement.style.userSelect="none",this._domElement.style.webkitUserSelect="none"):(this.cancel(),this._domElement.style.touchAction="",this._domElement.style.userSelect="",this._domElement.style.webkitUserSelect=""))}get active(){return!this._hasRested}get currentAction(){return this._state}get distance(){return this._spherical.radius}set distance(e){this._spherical.radius===e&&this._sphericalEnd.radius===e||(this._spherical.radius=e,this._sphericalEnd.radius=e,this._needsUpdate=!0)}get azimuthAngle(){return this._spherical.theta}set azimuthAngle(e){this._spherical.theta===e&&this._sphericalEnd.theta===e||(this._spherical.theta=e,this._sphericalEnd.theta=e,this._needsUpdate=!0)}get polarAngle(){return this._spherical.phi}set polarAngle(e){this._spherical.phi===e&&this._sphericalEnd.phi===e||(this._spherical.phi=e,this._sphericalEnd.phi=e,this._needsUpdate=!0)}get boundaryEnclosesCamera(){return this._boundaryEnclosesCamera}set boundaryEnclosesCamera(e){this._boundaryEnclosesCamera=e,this._needsUpdate=!0}set interactiveArea(e){this._interactiveArea.width=Kt(e.width,0,1),this._interactiveArea.height=Kt(e.height,0,1),this._interactiveArea.x=Kt(e.x,0,1-this._interactiveArea.width),this._interactiveArea.y=Kt(e.y,0,1-this._interactiveArea.height)}addEventListener(e,t){super.addEventListener(e,t)}removeEventListener(e,t){super.removeEventListener(e,t)}rotate(e,t,s=!1){return this.rotateTo(this._sphericalEnd.theta+e,this._sphericalEnd.phi+t,s)}rotateAzimuthTo(e,t=!1){return this.rotateTo(e,this._sphericalEnd.phi,t)}rotatePolarTo(e,t=!1){return this.rotateTo(this._sphericalEnd.theta,e,t)}rotateTo(e,t,s=!1){this._isUserControllingRotate=!1;const i=Kt(e,this.minAzimuthAngle,this.maxAzimuthAngle),n=Kt(t,this.minPolarAngle,this.maxPolarAngle);this._sphericalEnd.theta=i,this._sphericalEnd.phi=n,this._sphericalEnd.makeSafe(),this._needsUpdate=!0,s||(this._spherical.theta=this._sphericalEnd.theta,this._spherical.phi=this._sphericalEnd.phi);const r=!s||ft(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&ft(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold);return this._createOnRestPromise(r)}dolly(e,t=!1){return this.dollyTo(this._sphericalEnd.radius-e,t)}dollyTo(e,t=!1){return this._isUserControllingDolly=!1,this._lastDollyDirection=Ye.NONE,this._changedDolly=0,this._dollyToNoClamp(Kt(e,this.minDistance,this.maxDistance),t)}_dollyToNoClamp(e,t=!1){const s=this._sphericalEnd.radius;if(this.colliderMeshes.length>=1){const r=this._collisionTest(),o=ft(r,this._spherical.radius);if(!(s>e)&&o)return Promise.resolve();this._sphericalEnd.radius=Math.min(e,r)}else this._sphericalEnd.radius=e;this._needsUpdate=!0,t||(this._spherical.radius=this._sphericalEnd.radius);const n=!t||ft(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(n)}dollyInFixed(e,t=!1){this._targetEnd.add(this._getCameraDirection(us).multiplyScalar(e)),t||this._target.copy(this._targetEnd);const s=!t||ft(this._target.x,this._targetEnd.x,this.restThreshold)&&ft(this._target.y,this._targetEnd.y,this.restThreshold)&&ft(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(s)}zoom(e,t=!1){return this.zoomTo(this._zoomEnd+e,t)}zoomTo(e,t=!1){this._isUserControllingZoom=!1,this._zoomEnd=Kt(e,this.minZoom,this.maxZoom),this._needsUpdate=!0,t||(this._zoom=this._zoomEnd);const s=!t||ft(this._zoom,this._zoomEnd,this.restThreshold);return this._changedZoom=0,this._createOnRestPromise(s)}pan(e,t,s=!1){return console.warn("`pan` has been renamed to `truck`"),this.truck(e,t,s)}truck(e,t,s=!1){this._camera.updateMatrix(),ne.setFromMatrixColumn(this._camera.matrix,0),re.setFromMatrixColumn(this._camera.matrix,1),ne.multiplyScalar(e),re.multiplyScalar(-t);const i=ct.copy(ne).add(re),n=ut.copy(this._targetEnd).add(i);return this.moveTo(n.x,n.y,n.z,s)}forward(e,t=!1){ct.setFromMatrixColumn(this._camera.matrix,0),ct.crossVectors(this._camera.up,ct),ct.multiplyScalar(e);const s=ut.copy(this._targetEnd).add(ct);return this.moveTo(s.x,s.y,s.z,t)}elevate(e,t=!1){return ct.copy(this._camera.up).multiplyScalar(e),this.moveTo(this._targetEnd.x+ct.x,this._targetEnd.y+ct.y,this._targetEnd.z+ct.z,t)}moveTo(e,t,s,i=!1){this._isUserControllingTruck=!1;const n=ct.set(e,t,s).sub(this._targetEnd);this._encloseToBoundary(this._targetEnd,n,this.boundaryFriction),this._needsUpdate=!0,i||this._target.copy(this._targetEnd);const r=!i||ft(this._target.x,this._targetEnd.x,this.restThreshold)&&ft(this._target.y,this._targetEnd.y,this.restThreshold)&&ft(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(r)}lookInDirectionOf(e,t,s,i=!1){const o=ct.set(e,t,s).sub(this._targetEnd).normalize().multiplyScalar(-this._sphericalEnd.radius);return this.setPosition(o.x,o.y,o.z,i)}fitToBox(e,t,{cover:s=!1,paddingLeft:i=0,paddingRight:n=0,paddingBottom:r=0,paddingTop:o=0}={}){const a=[],l=e.isBox3?He.copy(e):He.setFromObject(e);l.isEmpty()&&(console.warn("camera-controls: fitTo() cannot be used with an empty box. Aborting"),Promise.resolve());const h=ur(this._sphericalEnd.theta,hr),u=ur(this._sphericalEnd.phi,hr);a.push(this.rotateTo(h,u,t));const d=ct.setFromSpherical(this._sphericalEnd).normalize(),f=mr.setFromUnitVectors(d,Yi),I=ft(Math.abs(d.y),1);I&&f.multiply(Gi.setFromAxisAngle(qs,h)),f.multiply(this._yAxisUpSpaceInverse);const p=Ir.makeEmpty();ut.copy(l.min).applyQuaternion(f),p.expandByPoint(ut),ut.copy(l.min).setX(l.max.x).applyQuaternion(f),p.expandByPoint(ut),ut.copy(l.min).setY(l.max.y).applyQuaternion(f),p.expandByPoint(ut),ut.copy(l.max).setZ(l.min.z).applyQuaternion(f),p.expandByPoint(ut),ut.copy(l.min).setZ(l.max.z).applyQuaternion(f),p.expandByPoint(ut),ut.copy(l.max).setY(l.min.y).applyQuaternion(f),p.expandByPoint(ut),ut.copy(l.max).setX(l.min.x).applyQuaternion(f),p.expandByPoint(ut),ut.copy(l.max).applyQuaternion(f),p.expandByPoint(ut),p.min.x-=i,p.min.y-=r,p.max.x+=n,p.max.y+=o,f.setFromUnitVectors(Yi,d),I&&f.premultiply(Gi.invert()),f.premultiply(this._yAxisUpSpace);const m=p.getSize(ct),E=p.getCenter(ut).applyQuaternion(f);if(Oe(this._camera)){const _=this.getDistanceToFitBox(m.x,m.y,m.z,s);a.push(this.moveTo(E.x,E.y,E.z,t)),a.push(this.dollyTo(_,t)),a.push(this.setFocalOffset(0,0,0,t))}else if(me(this._camera)){const _=this._camera,A=_.right-_.left,T=_.top-_.bottom,R=s?Math.max(A/m.x,T/m.y):Math.min(A/m.x,T/m.y);a.push(this.moveTo(E.x,E.y,E.z,t)),a.push(this.zoomTo(R,t)),a.push(this.setFocalOffset(0,0,0,t))}return Promise.all(a)}fitToSphere(e,t){const s=[],n=e instanceof ot.Sphere?Vi.copy(e):vt.createBoundingSphere(e,Vi);if(s.push(this.moveTo(n.center.x,n.center.y,n.center.z,t)),Oe(this._camera)){const r=this.getDistanceToFitSphere(n.radius);s.push(this.dollyTo(r,t))}else if(me(this._camera)){const r=this._camera.right-this._camera.left,o=this._camera.top-this._camera.bottom,a=2*n.radius,l=Math.min(r/a,o/a);s.push(this.zoomTo(l,t))}return s.push(this.setFocalOffset(0,0,0,t)),Promise.all(s)}setLookAt(e,t,s,i,n,r,o=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=Ye.NONE,this._changedDolly=0;const a=ut.set(i,n,r),l=ct.set(e,t,s);this._targetEnd.copy(a),this._sphericalEnd.setFromVector3(l.sub(a).applyQuaternion(this._yAxisUpSpace)),this.normalizeRotations(),this._needsUpdate=!0,o||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));const h=!o||ft(this._target.x,this._targetEnd.x,this.restThreshold)&&ft(this._target.y,this._targetEnd.y,this.restThreshold)&&ft(this._target.z,this._targetEnd.z,this.restThreshold)&&ft(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&ft(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&ft(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(h)}lerpLookAt(e,t,s,i,n,r,o,a,l,h,u,d,f,I=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=Ye.NONE,this._changedDolly=0;const p=ct.set(i,n,r),m=ut.set(e,t,s);Gt.setFromVector3(m.sub(p).applyQuaternion(this._yAxisUpSpace));const E=Ge.set(h,u,d),_=ut.set(o,a,l);ds.setFromVector3(_.sub(E).applyQuaternion(this._yAxisUpSpace)),this._targetEnd.copy(p.lerp(E,f));const A=ds.theta-Gt.theta,T=ds.phi-Gt.phi,R=ds.radius-Gt.radius;this._sphericalEnd.set(Gt.radius+R*f,Gt.phi+T*f,Gt.theta+A*f),this.normalizeRotations(),this._needsUpdate=!0,I||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));const F=!I||ft(this._target.x,this._targetEnd.x,this.restThreshold)&&ft(this._target.y,this._targetEnd.y,this.restThreshold)&&ft(this._target.z,this._targetEnd.z,this.restThreshold)&&ft(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&ft(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&ft(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(F)}setPosition(e,t,s,i=!1){return this.setLookAt(e,t,s,this._targetEnd.x,this._targetEnd.y,this._targetEnd.z,i)}setTarget(e,t,s,i=!1){const n=this.getPosition(ct),r=this.setLookAt(n.x,n.y,n.z,e,t,s,i);return this._sphericalEnd.phi=Kt(this._sphericalEnd.phi,this.minPolarAngle,this.maxPolarAngle),r}setFocalOffset(e,t,s,i=!1){this._isUserControllingOffset=!1,this._focalOffsetEnd.set(e,t,s),this._needsUpdate=!0,i||this._focalOffset.copy(this._focalOffsetEnd);const n=!i||ft(this._focalOffset.x,this._focalOffsetEnd.x,this.restThreshold)&&ft(this._focalOffset.y,this._focalOffsetEnd.y,this.restThreshold)&&ft(this._focalOffset.z,this._focalOffsetEnd.z,this.restThreshold);return this._createOnRestPromise(n)}setOrbitPoint(e,t,s){this._camera.updateMatrixWorld(),ne.setFromMatrixColumn(this._camera.matrixWorldInverse,0),re.setFromMatrixColumn(this._camera.matrixWorldInverse,1),Fe.setFromMatrixColumn(this._camera.matrixWorldInverse,2);const i=ct.set(e,t,s),n=i.distanceTo(this._camera.position),r=i.sub(this._camera.position);ne.multiplyScalar(r.x),re.multiplyScalar(r.y),Fe.multiplyScalar(r.z),ct.copy(ne).add(re).add(Fe),ct.z=ct.z+n,this.dollyTo(n,!1),this.setFocalOffset(-ct.x,ct.y,-ct.z,!1),this.moveTo(e,t,s,!1)}setBoundary(e){if(!e){this._boundary.min.set(-1/0,-1/0,-1/0),this._boundary.max.set(1/0,1/0,1/0),this._needsUpdate=!0;return}this._boundary.copy(e),this._boundary.clampPoint(this._targetEnd,this._targetEnd),this._needsUpdate=!0}setViewport(e,t,s,i){if(e===null){this._viewport=null;return}this._viewport=this._viewport||new ot.Vector4,typeof e=="number"?this._viewport.set(e,t,s,i):this._viewport.copy(e)}getDistanceToFitBox(e,t,s,i=!1){if(zi(this._camera,"getDistanceToFitBox"))return this._spherical.radius;const n=e/t,r=this._camera.getEffectiveFOV()*cs,o=this._camera.aspect;return((i?n>o:nt.pointerId===e)}_findPointerByMouseButton(e){return this._activePointers.find(t=>t.mouseButton===e)}_disposePointer(e){this._activePointers.splice(this._activePointers.indexOf(e),1)}_encloseToBoundary(e,t,s){const i=t.lengthSq();if(i===0)return e;const n=ut.copy(t).add(e),o=this._boundary.clampPoint(n,Ge).sub(n),a=o.lengthSq();if(a===0)return e.add(t);if(a===i)return e;if(s===0)return e.add(t).add(o);{const l=1+s*a/t.dot(o);return e.add(ut.copy(t).multiplyScalar(l)).add(o.multiplyScalar(1-s))}}_updateNearPlaneCorners(){if(Oe(this._camera)){const e=this._camera,t=e.near,s=e.getEffectiveFOV()*cs,i=Math.tan(s*.5)*t,n=i*e.aspect;this._nearPlaneCorners[0].set(-n,-i,0),this._nearPlaneCorners[1].set(n,-i,0),this._nearPlaneCorners[2].set(n,i,0),this._nearPlaneCorners[3].set(-n,i,0)}else if(me(this._camera)){const e=this._camera,t=1/e.zoom,s=e.left*t,i=e.right*t,n=e.top*t,r=e.bottom*t;this._nearPlaneCorners[0].set(s,n,0),this._nearPlaneCorners[1].set(i,n,0),this._nearPlaneCorners[2].set(i,r,0),this._nearPlaneCorners[3].set(s,r,0)}}_collisionTest(){let e=1/0;if(!(this.colliderMeshes.length>=1)||zi(this._camera,"_collisionTest"))return e;const s=this._getTargetDirection(us);Hi.lookAt(fr,s,this._camera.up);for(let i=0;i<4;i++){const n=ut.copy(this._nearPlaneCorners[i]);n.applyMatrix4(Hi);const r=Ge.addVectors(this._target,n);Js.set(r,s),Js.far=this._spherical.radius+1;const o=Js.intersectObjects(this.colliderMeshes);o.length!==0&&o[0].distance{const s=()=>{this.removeEventListener("rest",s),t()};this.addEventListener("rest",s)}))}_addAllEventListeners(e){}_removeAllEventListeners(){}get dampingFactor(){return console.warn(".dampingFactor has been deprecated. use smoothTime (in seconds) instead."),0}set dampingFactor(e){console.warn(".dampingFactor has been deprecated. use smoothTime (in seconds) instead.")}get draggingDampingFactor(){return console.warn(".draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead."),0}set draggingDampingFactor(e){console.warn(".draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead.")}static createBoundingSphere(e,t=new ot.Sphere){const s=t,i=s.center;He.makeEmpty(),e.traverseVisible(r=>{r.isMesh&&He.expandByObject(r)}),He.getCenter(i);let n=0;return e.traverseVisible(r=>{if(!r.isMesh)return;const o=r,a=o.geometry.clone();a.applyMatrix4(o.matrixWorld);const h=a.attributes.position;for(let u=0,d=h.count;u{var t;if(!(!this.currentWorld||!this.currentWorld.renderer)){if(this.three instanceof En){this.onAspectUpdated.trigger();return}if((t=this.currentWorld.renderer)!=null&&t.isResizeable()){const s=this.currentWorld.renderer.getSize();this.three.aspect=s.width/s.height,this.three.updateProjectionMatrix(),this.onAspectUpdated.trigger()}}});this.three=this.setupCamera(),this.setupEvents(!0),this.onWorldChanged.add(({action:s,world:i})=>{if(s==="added"){const n=this.newCameraControls();this._allControls.set(i.uuid,n)}if(s==="removed"){const n=this._allControls.get(i.uuid);n&&(n.dispose(),this._allControls.delete(i.uuid))}})}get controls(){if(!this.currentWorld)throw new Error("This camera needs a world to work!");const t=this._allControls.get(this.currentWorld.uuid);if(!t)throw new Error("Controls not found!");return t}get enabled(){return this.currentWorld===null?!1:this.controls.enabled}set enabled(t){this.currentWorld!==null&&(this.controls.enabled=t)}dispose(){this.setupEvents(!1),this.onAspectUpdated.reset(),this.onBeforeUpdate.reset(),this.onAfterUpdate.reset(),this.three.removeFromParent(),this.onDisposed.trigger(),this.onDisposed.reset();for(const[t,s]of this._allControls)s.dispose()}update(t){this.enabled&&(this.onBeforeUpdate.trigger(this),this.controls.update(t),this.onAfterUpdate.trigger(this))}setupCamera(){const t=window.innerWidth/window.innerHeight,s=new Lr(60,t,1,1e3);return s.position.set(50,50,50),s.lookAt(new W(0,0,0)),s}newCameraControls(){if(!this.currentWorld)throw new Error("This camera needs a world to work!");if(!this.currentWorld.renderer)throw new Error("This camera needs a renderer to work!");vt.install({THREE:vn.getSubsetOfThree()});const{domElement:t}=this.currentWorld.renderer.three,s=new vt(this.three,t);return s.smoothTime=.2,s.dollyToCursor=!0,s.infinityDolly=!0,s.minDistance=6,s}setupEvents(t){t?window.addEventListener("resize",this.updateAspect):window.removeEventListener("resize",this.updateAspect)}static getSubsetOfThree(){return{MOUSE:co,Vector2:_e,Vector3:W,Vector4:lo,Quaternion:Jt,Matrix4:Ft,Spherical:ho,Box3:Nt,Sphere:gi,Raycaster:In,MathUtils:uo}}}const di=class di extends Bt{constructor(t){super(t);y(this,"onAfterUpdate",new et);y(this,"onBeforeUpdate",new et);y(this,"onDisposed",new et);y(this,"onWorldCreated",new et);y(this,"onWorldDeleted",new et);y(this,"list",new Map);y(this,"enabled",!0);t.add(di.uuid,this)}create(){const t=new Xa(this.components),s=t.uuid;if(this.list.has(s))throw new Error("There is already a world with this name!");return this.list.set(s,t),this.onWorldCreated.trigger(t),t}delete(t){if(!this.list.has(t.uuid))throw new Error("The provided world is not found in the list!");const s=t.uuid;this.list.delete(t.uuid),t.dispose(),this.onWorldDeleted.trigger(s)}dispose(){this.enabled=!1;for(const[t,s]of this.list)s.dispose();this.list.clear(),this.onDisposed.trigger()}update(t){if(this.enabled)for(const[s,i]of this.list)i.update(t)}};y(di,"uuid","fdb61dc4-2ec1-4966-b83d-54ea795fad4a");let sn=di;function Ka(c,e,t,s){return new Promise((i,n)=>{function r(){const o=c.clientWaitSync(e,t,0);if(o===c.WAIT_FAILED){n();return}if(o===c.TIMEOUT_EXPIRED){setTimeout(r,s);return}i()}r()})}async function qa(c,e,t,s,i,n,r){const o=c.fenceSync(c.SYNC_GPU_COMMANDS_COMPLETE,0);c.flush(),await Ka(c,o,0,10),c.deleteSync(o),c.bindBuffer(e,t),c.getBufferSubData(e,s,i,n,r),c.bindBuffer(e,null)}async function Ja(c,e,t,s,i,n,r,o){const a=c.createBuffer();return c.bindBuffer(c.PIXEL_PACK_BUFFER,a),c.bufferData(c.PIXEL_PACK_BUFFER,o.byteLength,c.STREAM_READ),c.readPixels(e,t,s,i,n,r,0),c.bindBuffer(c.PIXEL_PACK_BUFFER,null),await qa(c,c.PIXEL_PACK_BUFFER,a,0,o),c.deleteBuffer(a),o}class tc{constructor(e,t,s){y(this,"onDisposed",new et);y(this,"onViewUpdated",new Ga);y(this,"enabled",!0);y(this,"needsUpdate",!1);y(this,"renderDebugFrame",!1);y(this,"components");y(this,"world");y(this,"renderer");y(this,"autoUpdate",!0);y(this,"updateInterval",1e3);y(this,"worker");y(this,"scene",new fo);y(this,"_width",512);y(this,"_height",512);y(this,"_availableColor",1);y(this,"renderTarget");y(this,"bufferSize");y(this,"_buffer");y(this,"_isWorkerBusy",!1);y(this,"updateVisibility",async e=>{if(!this.enabled||!this.needsUpdate&&!e||this._isWorkerBusy)return;this._isWorkerBusy=!0;const t=this.world.camera.three;t.updateMatrix(),this.renderer.setSize(this._width,this._height),this.renderer.setRenderTarget(this.renderTarget),this.renderer.render(this.scene,t);const s=this.renderer.getContext();await Ja(s,0,0,this._width,this._height,s.RGBA,s.UNSIGNED_BYTE,this._buffer),this.renderer.setRenderTarget(null),this.renderDebugFrame&&this.renderer.render(this.scene,t),this.worker.postMessage({buffer:this._buffer}),this.needsUpdate=!1});if(!t.renderer)throw new Error("The given world must have a renderer!");this.components=e,this.applySettings(s),this.world=t,this.renderer=new po,this.renderTarget=new Eo(this._width,this._height),this.bufferSize=this._width*this._height*4,this._buffer=new Uint8Array(this.bufferSize),this.renderer.clippingPlanes=t.renderer.clippingPlanes;const i=` + addEventListener("message", (event) => { + const { buffer } = event.data; + const colors = new Map(); + for (let i = 0; i < buffer.length; i += 4) { + const r = buffer[i]; + const g = buffer[i + 1]; + const b = buffer[i + 2]; + const code = "" + r + "-" + g + "-" + b; + if(colors.has(code)) { + colors.set(code, colors.get(code) + 1); + } else { + colors.set(code, 1); + } + } + postMessage({ colors }); + }); + `,n=new Blob([i],{type:"application/javascript"});this.worker=new Worker(URL.createObjectURL(n))}dispose(){this.enabled=!1;for(const e of this.scene.children)e.removeFromParent();this.onViewUpdated.reset(),this.worker.terminate(),this.renderer.forceContextLoss(),this.renderer.dispose(),this.renderTarget.dispose(),this._buffer=null,this.onDisposed.reset()}getAvailableColor(){let e=BigInt(this._availableColor.toString());const t=[];do t.unshift(Number(e%256n)),e/=256n;while(e);for(;t.length!==3;)t.unshift(0);const[s,i,n]=t,r=`${s}-${i}-${n}`;return{r:s,g:i,b:n,code:r}}increaseColor(){if(this._availableColor===256*256*256){console.warn("Color can't be increased over 256 x 256 x 256!");return}this._availableColor++}decreaseColor(){if(this._availableColor===1){console.warn("Color can't be decreased under 0!");return}this._availableColor--}applySettings(e){e&&(e.updateInterval!==void 0&&(this.updateInterval=e.updateInterval),e.height!==void 0&&(this._height=e.height),e.width!==void 0&&(this._width=e.width),e.autoUpdate!==void 0&&(this.autoUpdate=e.autoUpdate))}}class ec extends tc{constructor(t,s,i){super(t,s,i);y(this,"onViewUpdated",new et);y(this,"threshold",100);y(this,"colorMeshes",new Map);y(this,"isProcessing",!1);y(this,"_interval",null);y(this,"_colorCodeMeshMap",new Map);y(this,"_meshIDColorCodeMap",new Map);y(this,"_currentVisibleMeshes",new Set);y(this,"_recentlyHiddenMeshes",new Set);y(this,"_intervalID",null);y(this,"_transparentMat",new $e({transparent:!0,opacity:0}));y(this,"handleWorkerMessage",async t=>{if(this.isProcessing)return;const s=t.data.colors;this._recentlyHiddenMeshes=new Set(this._currentVisibleMeshes),this._currentVisibleMeshes.clear();for(const[i,n]of s){if(n{this.isProcessing||await this.updateVisibility()},this.updateInterval)),this.onViewUpdated.add(({seen:n,unseen:r})=>{for(const o of n)o.visible=!0;for(const o of r)o.visible=!1})}dispose(){super.dispose(),this._intervalID!==null&&(window.clearInterval(this._intervalID),this._intervalID=null),this._interval!==null&&(window.clearInterval(this._interval),this._intervalID=null),this._currentVisibleMeshes.clear(),this._recentlyHiddenMeshes.clear(),this._meshIDColorCodeMap.clear(),this._transparentMat.dispose(),this._colorCodeMeshMap.clear();const t=this.components.get(je);for(const s in this.colorMeshes){const i=this.colorMeshes.get(s);i&&t.destroy(i,!0)}this.colorMeshes.clear()}add(t){if(!this.enabled)return;if(this.isProcessing){console.log("Culler processing not finished yet.");return}this.isProcessing=!0;const s=t instanceof oi,{geometry:i,material:n}=t,{colorMaterial:r,code:o}=this.getAvailableMaterial();let a;if(Array.isArray(n)){let u=!0;const d=[];for(const f of n)lr.isTransparent(f)?d.push(this._transparentMat):(u=!1,d.push(r));if(u){r.dispose(),this.isProcessing=!1;return}a=d}else if(lr.isTransparent(n)){r.dispose(),this.isProcessing=!1;return}else a=r;this._colorCodeMeshMap.set(o,t),this._meshIDColorCodeMap.set(t.uuid,o);const l=s?t.count:1,h=new oi(i,a,l);s?h.instanceMatrix=t.instanceMatrix:h.setMatrixAt(0,new Ft),t.visible=!1,t.updateWorldMatrix(!0,!1),h.applyMatrix4(t.matrixWorld),h.updateMatrix(),this.scene.add(h),this.colorMeshes.set(t.uuid,h),this.increaseColor(),this.isProcessing=!1}remove(t){if(this.isProcessing){console.log("Culler processing not finished yet.");return}this.isProcessing=!0;const s=this.components.get(je);this._currentVisibleMeshes.delete(t),this._recentlyHiddenMeshes.delete(t);const i=this.colorMeshes.get(t.uuid),n=this._meshIDColorCodeMap.get(t.uuid);if(!i||!n){this.isProcessing=!1;return}this._colorCodeMeshMap.delete(n),this._meshIDColorCodeMap.delete(t.uuid),this.colorMeshes.delete(t.uuid),i.geometry=void 0,i.material=[],s.destroy(i,!0),this._recentlyHiddenMeshes.delete(t),this._currentVisibleMeshes.delete(t),this.isProcessing=!1}updateInstanced(t){for(const s of t){const i=this.colorMeshes.get(s.uuid);i&&(i.count=s.count)}}getAvailableMaterial(){const{r:t,g:s,b:i,code:n}=this.getAvailableColor(),r=Si.enabled;Si.enabled=!1;const o=new mn(`rgb(${t}, ${s}, ${i})`);if(!this.world.renderer)throw new Error("Renderer not found in the world!");const a=this.world.renderer.clippingPlanes,l=new $e({color:o,clippingPlanes:a,side:Ti});return Si.enabled=r,{colorMaterial:l,code:n}}}const As=class As extends Bt{constructor(t){super(t);y(this,"onDisposed",new et);y(this,"_enabled",!0);y(this,"list",new Map);t.add(As.uuid,this)}get enabled(){return this._enabled}set enabled(t){this._enabled=t;for(const[s,i]of this.list)i.enabled=t}create(t,s){if(this.list.has(t.uuid))return this.list.get(t.uuid);const i=new ec(this.components,t,s);return this.list.set(t.uuid,i),i}delete(t){const s=this.list.get(t.uuid);s&&s.dispose(),this.list.delete(t.uuid)}dispose(){this.enabled=!1,this.onDisposed.trigger(As.uuid),this.onDisposed.reset();for(const[t,s]of this.list)s.dispose();this.list.clear()}updateInstanced(t){for(const[,s]of this.list)s.updateInstanced(t)}};y(As,"uuid","69f2a50d-c266-44fc-b1bd-fa4d34be89e6");let nn=As;class sc{constructor(e){y(this,"_event");y(this,"_position",new _e);y(this,"onDisposed",new et);y(this,"updateMouseInfo",e=>{this._event=e});this.dom=e,this.setupEvents(!0)}get position(){if(this._event){const e=this.dom.getBoundingClientRect();this._position.x=this.getPositionX(e,this._event),this._position.y=this.getPositionY(e,this._event)}return this._position}dispose(){this.setupEvents(!1),this.onDisposed.trigger(),this.onDisposed.reset()}getPositionY(e,t){return-((t.clientY-e.top)/(e.bottom-e.top))*2+1}getPositionX(e,t){return(t.clientX-e.left)/(e.right-e.left)*2-1}setupEvents(e){e?this.dom.addEventListener("pointermove",this.updateMouseInfo):this.dom.removeEventListener("pointermove",this.updateMouseInfo)}}class ic{constructor(e,t){y(this,"enabled",!0);y(this,"components");y(this,"onDisposed",new et);y(this,"mouse");y(this,"three",new In);y(this,"world");const s=t.renderer;if(!s)throw new Error("A renderer is needed for the raycaster to work!");this.world=t,this.mouse=new sc(s.three.domElement),this.components=e}dispose(){this.mouse.dispose(),this.onDisposed.trigger(),this.onDisposed.reset()}castRay(e=Array.from(this.world.meshes)){if(!this.world)throw new Error("A world is needed to cast rays!");const t=this.world.camera.three;return this.three.setFromCamera(this.mouse.position,t),this.intersect(e)}castRayFromVector(e,t,s=Array.from(this.world.meshes)){return this.three.set(e,t),this.intersect(s)}intersect(e=Array.from(this.world.meshes)){const t=this.three.intersectObjects(e),s=this.filterClippingPlanes(t);return s.length>0?s[0]:null}filterClippingPlanes(e){if(!this.world.renderer)throw new Error("Renderer not found!");const t=this.world.renderer.three;if(!t.clippingPlanes)return e;const s=t.clippingPlanes;return e.length<=0||!s||(s==null?void 0:s.length)<=0?e:e.filter(i=>s.every(n=>n.distanceToPoint(i.point)>0))}}const fi=class fi extends Bt{constructor(t){super(t);y(this,"enabled",!0);y(this,"list",new Map);y(this,"onDisposed",new et);t.add(fi.uuid,this)}get(t){if(this.list.has(t.uuid))return this.list.get(t.uuid);const s=new ic(this.components,t);return this.list.set(t.uuid,s),t.onDisposed.add(()=>{this.delete(t)}),s}delete(t){const s=this.list.get(t.uuid);s&&s.dispose(),this.list.delete(t.uuid)}dispose(){for(const[t,s]of this.list)s.dispose();this.list.clear(),this.onDisposed.trigger()}};y(fi,"uuid","d5d8bdf0-db25-4952-b951-b643af207ace");let ws=fi;const Se=new In,Mt=new W,Ie=new W,Ct=new Jt,Cr={X:new W(1,0,0),Y:new W(0,1,0),Z:new W(0,0,1)},Wi={type:"change"},gr={type:"mouseDown"},Tr={type:"mouseUp",mode:null},_r={type:"objectChange"};class nc extends ai{constructor(e,t){super(),t===void 0&&(console.warn('THREE.TransformControls: The second parameter "domElement" is now mandatory.'),t=document),this.isTransformControls=!0,this.visible=!1,this.domElement=t,this.domElement.style.touchAction="none";const s=new hc;this._gizmo=s,this.add(s);const i=new uc;this._plane=i,this.add(i);const n=this;function r(_,A){let T=A;Object.defineProperty(n,_,{get:function(){return T!==void 0?T:A},set:function(R){T!==R&&(T=R,i[_]=R,s[_]=R,n.dispatchEvent({type:_+"-changed",value:R}),n.dispatchEvent(Wi))}}),n[_]=A,i[_]=A,s[_]=A}r("camera",e),r("object",void 0),r("enabled",!0),r("axis",null),r("mode","translate"),r("translationSnap",null),r("rotationSnap",null),r("scaleSnap",null),r("space","world"),r("size",1),r("dragging",!1),r("showX",!0),r("showY",!0),r("showZ",!0);const o=new W,a=new W,l=new Jt,h=new Jt,u=new W,d=new Jt,f=new W,I=new W,p=new W,m=0,E=new W;r("worldPosition",o),r("worldPositionStart",a),r("worldQuaternion",l),r("worldQuaternionStart",h),r("cameraPosition",u),r("cameraQuaternion",d),r("pointStart",f),r("pointEnd",I),r("rotationAxis",p),r("rotationAngle",m),r("eye",E),this._offset=new W,this._startNorm=new W,this._endNorm=new W,this._cameraScale=new W,this._parentPosition=new W,this._parentQuaternion=new Jt,this._parentQuaternionInv=new Jt,this._parentScale=new W,this._worldScaleStart=new W,this._worldQuaternionInv=new Jt,this._worldScale=new W,this._positionStart=new W,this._quaternionStart=new Jt,this._scaleStart=new W,this._getPointer=rc.bind(this),this._onPointerDown=ac.bind(this),this._onPointerHover=oc.bind(this),this._onPointerMove=cc.bind(this),this._onPointerUp=lc.bind(this),this.domElement.addEventListener("pointerdown",this._onPointerDown),this.domElement.addEventListener("pointermove",this._onPointerHover),this.domElement.addEventListener("pointerup",this._onPointerUp)}updateMatrixWorld(){this.object!==void 0&&(this.object.updateMatrixWorld(),this.object.parent===null?console.error("TransformControls: The attached 3D object must be a part of the scene graph."):this.object.parent.matrixWorld.decompose(this._parentPosition,this._parentQuaternion,this._parentScale),this.object.matrixWorld.decompose(this.worldPosition,this.worldQuaternion,this._worldScale),this._parentQuaternionInv.copy(this._parentQuaternion).invert(),this._worldQuaternionInv.copy(this.worldQuaternion).invert()),this.camera.updateMatrixWorld(),this.camera.matrixWorld.decompose(this.cameraPosition,this.cameraQuaternion,this._cameraScale),this.camera.isOrthographicCamera?this.camera.getWorldDirection(this.eye).negate():this.eye.copy(this.cameraPosition).sub(this.worldPosition).normalize(),super.updateMatrixWorld(this)}pointerHover(e){if(this.object===void 0||this.dragging===!0)return;Se.setFromCamera(e,this.camera);const t=Xi(this._gizmo.picker[this.mode],Se);t?this.axis=t.object.name:this.axis=null}pointerDown(e){if(!(this.object===void 0||this.dragging===!0||e.button!==0)&&this.axis!==null){Se.setFromCamera(e,this.camera);const t=Xi(this._plane,Se,!0);t&&(this.object.updateMatrixWorld(),this.object.parent.updateMatrixWorld(),this._positionStart.copy(this.object.position),this._quaternionStart.copy(this.object.quaternion),this._scaleStart.copy(this.object.scale),this.object.matrixWorld.decompose(this.worldPositionStart,this.worldQuaternionStart,this._worldScaleStart),this.pointStart.copy(t.point).sub(this.worldPositionStart)),this.dragging=!0,gr.mode=this.mode,this.dispatchEvent(gr)}}pointerMove(e){const t=this.axis,s=this.mode,i=this.object;let n=this.space;if(s==="scale"?n="local":(t==="E"||t==="XYZE"||t==="XYZ")&&(n="world"),i===void 0||t===null||this.dragging===!1||e.button!==-1)return;Se.setFromCamera(e,this.camera);const r=Xi(this._plane,Se,!0);if(r){if(this.pointEnd.copy(r.point).sub(this.worldPositionStart),s==="translate")this._offset.copy(this.pointEnd).sub(this.pointStart),n==="local"&&t!=="XYZ"&&this._offset.applyQuaternion(this._worldQuaternionInv),t.indexOf("X")===-1&&(this._offset.x=0),t.indexOf("Y")===-1&&(this._offset.y=0),t.indexOf("Z")===-1&&(this._offset.z=0),n==="local"&&t!=="XYZ"?this._offset.applyQuaternion(this._quaternionStart).divide(this._parentScale):this._offset.applyQuaternion(this._parentQuaternionInv).divide(this._parentScale),i.position.copy(this._offset).add(this._positionStart),this.translationSnap&&(n==="local"&&(i.position.applyQuaternion(Ct.copy(this._quaternionStart).invert()),t.search("X")!==-1&&(i.position.x=Math.round(i.position.x/this.translationSnap)*this.translationSnap),t.search("Y")!==-1&&(i.position.y=Math.round(i.position.y/this.translationSnap)*this.translationSnap),t.search("Z")!==-1&&(i.position.z=Math.round(i.position.z/this.translationSnap)*this.translationSnap),i.position.applyQuaternion(this._quaternionStart)),n==="world"&&(i.parent&&i.position.add(Mt.setFromMatrixPosition(i.parent.matrixWorld)),t.search("X")!==-1&&(i.position.x=Math.round(i.position.x/this.translationSnap)*this.translationSnap),t.search("Y")!==-1&&(i.position.y=Math.round(i.position.y/this.translationSnap)*this.translationSnap),t.search("Z")!==-1&&(i.position.z=Math.round(i.position.z/this.translationSnap)*this.translationSnap),i.parent&&i.position.sub(Mt.setFromMatrixPosition(i.parent.matrixWorld))));else if(s==="scale"){if(t.search("XYZ")!==-1){let o=this.pointEnd.length()/this.pointStart.length();this.pointEnd.dot(this.pointStart)<0&&(o*=-1),Ie.set(o,o,o)}else Mt.copy(this.pointStart),Ie.copy(this.pointEnd),Mt.applyQuaternion(this._worldQuaternionInv),Ie.applyQuaternion(this._worldQuaternionInv),Ie.divide(Mt),t.search("X")===-1&&(Ie.x=1),t.search("Y")===-1&&(Ie.y=1),t.search("Z")===-1&&(Ie.z=1);i.scale.copy(this._scaleStart).multiply(Ie),this.scaleSnap&&(t.search("X")!==-1&&(i.scale.x=Math.round(i.scale.x/this.scaleSnap)*this.scaleSnap||this.scaleSnap),t.search("Y")!==-1&&(i.scale.y=Math.round(i.scale.y/this.scaleSnap)*this.scaleSnap||this.scaleSnap),t.search("Z")!==-1&&(i.scale.z=Math.round(i.scale.z/this.scaleSnap)*this.scaleSnap||this.scaleSnap))}else if(s==="rotate"){this._offset.copy(this.pointEnd).sub(this.pointStart);const o=20/this.worldPosition.distanceTo(Mt.setFromMatrixPosition(this.camera.matrixWorld));let a=!1;t==="XYZE"?(this.rotationAxis.copy(this._offset).cross(this.eye).normalize(),this.rotationAngle=this._offset.dot(Mt.copy(this.rotationAxis).cross(this.eye))*o):(t==="X"||t==="Y"||t==="Z")&&(this.rotationAxis.copy(Cr[t]),Mt.copy(Cr[t]),n==="local"&&Mt.applyQuaternion(this.worldQuaternion),Mt.cross(this.eye),Mt.length()===0?a=!0:this.rotationAngle=this._offset.dot(Mt.normalize())*o),(t==="E"||a)&&(this.rotationAxis.copy(this.eye),this.rotationAngle=this.pointEnd.angleTo(this.pointStart),this._startNorm.copy(this.pointStart).normalize(),this._endNorm.copy(this.pointEnd).normalize(),this.rotationAngle*=this._endNorm.cross(this._startNorm).dot(this.eye)<0?1:-1),this.rotationSnap&&(this.rotationAngle=Math.round(this.rotationAngle/this.rotationSnap)*this.rotationSnap),n==="local"&&t!=="E"&&t!=="XYZE"?(i.quaternion.copy(this._quaternionStart),i.quaternion.multiply(Ct.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this._parentQuaternionInv),i.quaternion.copy(Ct.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),i.quaternion.multiply(this._quaternionStart).normalize())}this.dispatchEvent(Wi),this.dispatchEvent(_r)}}pointerUp(e){e.button===0&&(this.dragging&&this.axis!==null&&(Tr.mode=this.mode,this.dispatchEvent(Tr)),this.dragging=!1,this.axis=null)}dispose(){this.domElement.removeEventListener("pointerdown",this._onPointerDown),this.domElement.removeEventListener("pointermove",this._onPointerHover),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.domElement.removeEventListener("pointerup",this._onPointerUp),this.traverse(function(e){e.geometry&&e.geometry.dispose(),e.material&&e.material.dispose()})}attach(e){return this.object=e,this.visible=!0,this}detach(){return this.object=void 0,this.visible=!1,this.axis=null,this}reset(){this.enabled&&this.dragging&&(this.object.position.copy(this._positionStart),this.object.quaternion.copy(this._quaternionStart),this.object.scale.copy(this._scaleStart),this.dispatchEvent(Wi),this.dispatchEvent(_r),this.pointStart.copy(this.pointEnd))}getRaycaster(){return Se}getMode(){return this.mode}setMode(e){this.mode=e}setTranslationSnap(e){this.translationSnap=e}setRotationSnap(e){this.rotationSnap=e}setScaleSnap(e){this.scaleSnap=e}setSize(e){this.size=e}setSpace(e){this.space=e}}function rc(c){if(this.domElement.ownerDocument.pointerLockElement)return{x:0,y:0,button:c.button};{const e=this.domElement.getBoundingClientRect();return{x:(c.clientX-e.left)/e.width*2-1,y:-(c.clientY-e.top)/e.height*2+1,button:c.button}}}function oc(c){if(this.enabled)switch(c.pointerType){case"mouse":case"pen":this.pointerHover(this._getPointer(c));break}}function ac(c){this.enabled&&(document.pointerLockElement||this.domElement.setPointerCapture(c.pointerId),this.domElement.addEventListener("pointermove",this._onPointerMove),this.pointerHover(this._getPointer(c)),this.pointerDown(this._getPointer(c)))}function cc(c){this.enabled&&this.pointerMove(this._getPointer(c))}function lc(c){this.enabled&&(this.domElement.releasePointerCapture(c.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.pointerUp(this._getPointer(c)))}function Xi(c,e,t){const s=e.intersectObject(c,!0);for(let i=0;i.9&&(r.visible=!1)),this.axis==="Y"&&(Ct.setFromEuler(ti.set(0,0,Math.PI/2)),r.quaternion.copy(s).multiply(Ct),Math.abs(pt.copy(we).applyQuaternion(s).dot(this.eye))>.9&&(r.visible=!1)),this.axis==="Z"&&(Ct.setFromEuler(ti.set(0,Math.PI/2,0)),r.quaternion.copy(s).multiply(Ct),Math.abs(pt.copy(gs).applyQuaternion(s).dot(this.eye))>.9&&(r.visible=!1)),this.axis==="XYZE"&&(Ct.setFromEuler(ti.set(0,Math.PI/2,0)),pt.copy(this.rotationAxis),r.quaternion.setFromRotationMatrix(Rr.lookAt(Ar,pt,we)),r.quaternion.multiply(Ct),r.visible=this.dragging),this.axis==="E"&&(r.visible=!1)):r.name==="START"?(r.position.copy(this.worldPositionStart),r.visible=this.dragging):r.name==="END"?(r.position.copy(this.worldPosition),r.visible=this.dragging):r.name==="DELTA"?(r.position.copy(this.worldPositionStart),r.quaternion.copy(this.worldQuaternionStart),Mt.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),Mt.applyQuaternion(this.worldQuaternionStart.clone().invert()),r.scale.copy(Mt),r.visible=this.dragging):(r.quaternion.copy(s),this.dragging?r.position.copy(this.worldPositionStart):r.position.copy(this.worldPosition),this.axis&&(r.visible=this.axis.search(r.name)!==-1));continue}r.quaternion.copy(s),this.mode==="translate"||this.mode==="scale"?(r.name==="X"&&Math.abs(pt.copy(Cs).applyQuaternion(s).dot(this.eye))>.99&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name==="Y"&&Math.abs(pt.copy(we).applyQuaternion(s).dot(this.eye))>.99&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name==="Z"&&Math.abs(pt.copy(gs).applyQuaternion(s).dot(this.eye))>.99&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name==="XY"&&Math.abs(pt.copy(gs).applyQuaternion(s).dot(this.eye))<.2&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name==="YZ"&&Math.abs(pt.copy(Cs).applyQuaternion(s).dot(this.eye))<.2&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1),r.name==="XZ"&&Math.abs(pt.copy(we).applyQuaternion(s).dot(this.eye))<.2&&(r.scale.set(1e-10,1e-10,1e-10),r.visible=!1)):this.mode==="rotate"&&(ei.copy(s),pt.copy(this.eye).applyQuaternion(Ct.copy(s).invert()),r.name.search("E")!==-1&&r.quaternion.setFromRotationMatrix(Rr.lookAt(this.eye,Ar,we)),r.name==="X"&&(Ct.setFromAxisAngle(Cs,Math.atan2(-pt.y,pt.z)),Ct.multiplyQuaternions(ei,Ct),r.quaternion.copy(Ct)),r.name==="Y"&&(Ct.setFromAxisAngle(we,Math.atan2(pt.x,pt.z)),Ct.multiplyQuaternions(ei,Ct),r.quaternion.copy(Ct)),r.name==="Z"&&(Ct.setFromAxisAngle(gs,Math.atan2(pt.y,pt.x)),Ct.multiplyQuaternions(ei,Ct),r.quaternion.copy(Ct))),r.visible=r.visible&&(r.name.indexOf("X")===-1||this.showX),r.visible=r.visible&&(r.name.indexOf("Y")===-1||this.showY),r.visible=r.visible&&(r.name.indexOf("Z")===-1||this.showZ),r.visible=r.visible&&(r.name.indexOf("E")===-1||this.showX&&this.showY&&this.showZ),r.material._color=r.material._color||r.material.color.clone(),r.material._opacity=r.material._opacity||r.material.opacity,r.material.color.copy(r.material._color),r.material.opacity=r.material._opacity,this.enabled&&this.axis&&(r.name===this.axis||this.axis.split("").some(function(a){return r.name===a}))&&(r.material.color.setHex(16776960),r.material.opacity=1)}super.updateMatrixWorld(e)}}class uc extends st{constructor(){super(new vr(1e5,1e5,2,2),new $e({visible:!1,wireframe:!0,side:Ti,transparent:!0,opacity:.1,toneMapped:!1})),this.isTransformControlsPlane=!0,this.type="TransformControlsPlane"}updateMatrixWorld(e){let t=this.space;switch(this.position.copy(this.worldPosition),this.mode==="scale"&&(t="local"),si.copy(Cs).applyQuaternion(t==="local"?this.worldQuaternion:ri),fs.copy(we).applyQuaternion(t==="local"?this.worldQuaternion:ri),ps.copy(gs).applyQuaternion(t==="local"?this.worldQuaternion:ri),pt.copy(fs),this.mode){case"translate":case"scale":switch(this.axis){case"X":pt.copy(this.eye).cross(si),oe.copy(si).cross(pt);break;case"Y":pt.copy(this.eye).cross(fs),oe.copy(fs).cross(pt);break;case"Z":pt.copy(this.eye).cross(ps),oe.copy(ps).cross(pt);break;case"XY":oe.copy(ps);break;case"YZ":oe.copy(si);break;case"XZ":pt.copy(ps),oe.copy(fs);break;case"XYZ":case"E":oe.set(0,0,0);break}break;case"rotate":default:oe.set(0,0,0)}oe.length()===0?this.quaternion.copy(this.cameraQuaternion):(yr.lookAt(Mt.set(0,0,0),oe,pt),this.quaternion.setFromRotationMatrix(yr)),super.updateMatrixWorld(e)}}class xn{constructor(e,t,s,i,n,r=5,o=!0){y(this,"onDraggingStarted",new et);y(this,"onDraggingEnded",new et);y(this,"onDisposed",new et);y(this,"normal");y(this,"origin");y(this,"three",new pn);y(this,"components");y(this,"world");y(this,"type","default");y(this,"_helper");y(this,"_visible",!0);y(this,"_enabled",!0);y(this,"_controlsActive",!1);y(this,"_arrowBoundBox",new st);y(this,"_planeMesh");y(this,"_controls");y(this,"_hiddenMaterial",new $e({visible:!1}));y(this,"update",()=>{this._enabled&&this.three.setFromNormalAndCoplanarPoint(this.normal,this._helper.position)});y(this,"changeDrag",e=>{this._visible=!e.value,this.preventCameraMovement(),this.notifyDraggingChanged(e)});if(this.components=e,this.world=t,!t.renderer)throw new Error("The given world must have a renderer!");this.normal=i,this.origin=s,t.renderer.setPlane(!0,this.three),this._planeMesh=xn.newPlaneMesh(r,n),this._helper=this.newHelper(),this._controls=this.newTransformControls(),this.three.setFromNormalAndCoplanarPoint(i,s),o&&this.toggleControls(!0)}get enabled(){return this._enabled}set enabled(e){if(!this.world.renderer)throw new Error("No renderer found for clipping plane!");this._enabled=e,this.world.renderer.setPlane(e,this.three)}get visible(){return this._visible}set visible(e){this._visible=e,this._controls.visible=e,this._helper.visible=e,this.toggleControls(e)}get meshes(){return[this._planeMesh,this._arrowBoundBox]}get planeMaterial(){return this._planeMesh.material}set planeMaterial(e){this._planeMesh.material=e}get size(){return this._planeMesh.scale.x}set size(e){this._planeMesh.scale.set(e,e,e)}get helper(){return this._helper}setFromNormalAndCoplanarPoint(e,t){this.reset(),this.normal.equals(e)||(this.normal.copy(e),this._helper.lookAt(e)),this.origin.copy(t),this._helper.position.copy(t),this._helper.updateMatrix(),this.update()}dispose(){this._enabled=!1,this.onDraggingStarted.reset(),this.onDraggingEnded.reset(),this._helper.removeFromParent(),this.world.renderer&&this.world.renderer.setPlane(!1,this.three),this._arrowBoundBox.removeFromParent(),this._arrowBoundBox.geometry.dispose(),this._planeMesh.geometry.dispose(),this._controls.removeFromParent(),this._controls.dispose(),this.onDisposed.trigger(),this.onDisposed.reset()}reset(){const e=new W(1,0,0),t=new W;this.normal.equals(e)||(this.normal.copy(e),this._helper.lookAt(e)),this.origin.copy(t),this._helper.position.copy(t),this._helper.updateMatrix()}toggleControls(e){if(e){if(this._controlsActive)return;this._controls.addEventListener("change",this.update),this._controls.addEventListener("dragging-changed",this.changeDrag)}else this._controls.removeEventListener("change",this.update),this._controls.removeEventListener("dragging-changed",this.changeDrag);this._controlsActive=e}newTransformControls(){if(!this.world.renderer)throw new Error("No renderer found for clipping plane!");const e=this.world.camera.three,t=this.world.renderer.three.domElement,s=new nc(e,t);return this.initializeControls(s),this.world.scene.three.add(s),s}initializeControls(e){e.attach(this._helper),e.showX=!1,e.showY=!1,e.setSpace("local"),this.createArrowBoundingBox(),e.children[0].children[0].add(this._arrowBoundBox)}createArrowBoundingBox(){this._arrowBoundBox.geometry=new xt(.18,.18,1.2),this._arrowBoundBox.material=this._hiddenMaterial,this._arrowBoundBox.rotateX(Math.PI/2),this._arrowBoundBox.updateMatrix(),this._arrowBoundBox.geometry.applyMatrix4(this._arrowBoundBox.matrix)}notifyDraggingChanged(e){e.value?this.onDraggingStarted.trigger():this.onDraggingEnded.trigger()}preventCameraMovement(){this.world.camera.enabled=this._visible}newHelper(){const e=new ai;return e.lookAt(this.normal),e.position.copy(this.origin),this._planeMesh.position.z+=.01,e.add(this._planeMesh),this.world.scene.three.add(e),e}static newPlaneMesh(e,t){const s=new vr(1),i=new st(s,t);return i.scale.set(e,e,e),i}}const Rs=class Rs extends Bt{constructor(t){super(t);y(this,"onBeforeDrag",new et);y(this,"onAfterDrag",new et);y(this,"onBeforeCreate",new et);y(this,"onBeforeCancel",new et);y(this,"onAfterCancel",new et);y(this,"onBeforeDelete",new et);y(this,"onAfterCreate",new et);y(this,"onAfterDelete",new et);y(this,"onDisposed",new et);y(this,"orthogonalY",!1);y(this,"toleranceOrthogonalY",.7);y(this,"Type",xn);y(this,"list",[]);y(this,"_material",new $e({color:12255487,side:Ti,transparent:!0,opacity:.2}));y(this,"_size",5);y(this,"_enabled",!1);y(this,"_visible",!0);y(this,"_onStartDragging",()=>{this.onBeforeDrag.trigger()});y(this,"_onEndDragging",()=>{this.onAfterDrag.trigger()});this.components.add(Rs.uuid,this)}get enabled(){return this._enabled}set enabled(t){this._enabled=t;for(const s of this.list)s.enabled=t;this.updateMaterialsAndPlanes()}get visible(){return this._visible}set visible(t){this._visible=t;for(const s of this.list)s.visible=t}get material(){return this._material}set material(t){this._material=t;for(const s of this.list)s.planeMaterial=t}get size(){return this._size}set size(t){this._size=t;for(const s of this.list)s.size=t}dispose(){this._enabled=!1;for(const t of this.list)t.dispose();this.list.length=0,this._material.dispose(),this.onBeforeCreate.reset(),this.onBeforeCancel.reset(),this.onBeforeDelete.reset(),this.onBeforeDrag.reset(),this.onAfterCreate.reset(),this.onAfterCancel.reset(),this.onAfterDelete.reset(),this.onAfterDrag.reset(),this.onDisposed.trigger(Rs.uuid),this.onDisposed.reset()}create(t){const n=this.components.get(ws).get(t).castRay();return n?this.createPlaneFromIntersection(t,n):null}createFromNormalAndCoplanarPoint(t,s,i){const n=this.newPlane(t,i,s);return this.updateMaterialsAndPlanes(),n}delete(t,s){s||(s=this.pickPlane(t)),s&&this.deletePlane(s)}deleteAll(t){const s=[...this.list];for(const i of s)if(!t||t.has(i.type)){this.delete(i.world,i);const n=this.list.indexOf(i);n!==-1&&this.list.splice(n,1)}}deletePlane(t){const s=this.list.indexOf(t);if(s!==-1){if(this.list.splice(s,1),!t.world.renderer)throw new Error("Renderer not found for this plane's world!");t.world.renderer.setPlane(!1,t.three),t.dispose(),this.updateMaterialsAndPlanes(),this.onAfterDelete.trigger(t)}}pickPlane(t){const i=this.components.get(ws).get(t),n=this.getAllPlaneMeshes(),r=i.castRay(n);if(r){const o=r.object;return this.list.find(a=>a.meshes.includes(o))}}getAllPlaneMeshes(){const t=[];for(const s of this.list)t.push(...s.meshes);return t}createPlaneFromIntersection(t,s){var a;if(!t.renderer)throw new Error("The given world must have a renderer!");const i=s.point.distanceTo(new W(0,0,0)),n=(a=s.face)==null?void 0:a.normal;if(!i||!n)return null;const r=this.getWorldNormal(s,n),o=this.newPlane(t,s.point,r.negate());return o.visible=this._visible,o.size=this._size,t.renderer.setPlane(!0,o.three),this.updateMaterialsAndPlanes(),o}getWorldNormal(t,s){const i=t.object;let n=t.object.matrixWorld.clone();if(i instanceof oi&&t.instanceId!==void 0){const l=new Ft;i.getMatrixAt(t.instanceId,l),n=l.multiply(n)}const o=new Co().getNormalMatrix(n),a=s.clone().applyMatrix3(o).normalize();return this.normalizePlaneDirectionY(a),a}normalizePlaneDirectionY(t){this.orthogonalY&&(t.y>this.toleranceOrthogonalY&&(t.x=0,t.y=1,t.z=0),t.y<-this.toleranceOrthogonalY&&(t.x=0,t.y=-1,t.z=0))}newPlane(t,s,i){const n=new this.Type(this.components,t,s,i,this._material);return n.onDraggingStarted.add(this._onStartDragging),n.onDraggingEnded.add(this._onEndDragging),this.list.push(n),this.onAfterCreate.trigger(n),n}updateMaterialsAndPlanes(){const t=this.components.get(sn);for(const[s,i]of t.list){if(!i.renderer)continue;i.renderer.updateClippingPlanes();const{clippingPlanes:n}=i.renderer;for(const r of i.meshes)if(r.material)if(Array.isArray(r.material))for(const o of r.material)o.clippingPlanes=n;else r.material.clippingPlanes=n}}};y(Rs,"uuid","66290bc5-18c4-4cd1-9379-2e17a0617611");let rn=Rs;class dc{constructor(e){y(this,"enabled",!1);y(this,"id","FirstPerson");this.camera=e}set(e){if(this.enabled=e,e){if(this.camera.projection.current!=="Perspective"){this.camera.set("Orbit");return}this.setupFirstPersonCamera()}}setupFirstPersonCamera(){const e=this.camera.controls,t=new W;e.distance--,e.getPosition(t),e.minDistance=1,e.maxDistance=1,e.distance=1,e.moveTo(t.x,t.y,t.z),e.truckSpeed=50,e.mouseButtons.wheel=vt.ACTION.DOLLY,e.touches.two=vt.ACTION.TOUCH_ZOOM_TRUCK}}class fc{constructor(e){y(this,"enabled",!0);y(this,"id","Orbit");this.camera=e,this.activateOrbitControls()}set(e){this.enabled=e,e&&this.activateOrbitControls()}activateOrbitControls(){const e=this.camera.controls;e.minDistance=1,e.maxDistance=300;const t=new W;e.getPosition(t);const s=t.length();e.distance=s,e.truckSpeed=2;const{rotation:i}=this.camera.three,n=new W(0,0,-1).applyEuler(i),r=t.addScaledVector(n,s);e.moveTo(r.x,r.y,r.z)}}class pc{constructor(e){y(this,"enabled",!1);y(this,"id","Plan");y(this,"mouseAction1");y(this,"mouseAction2");y(this,"mouseInitialized",!1);y(this,"defaultAzimuthSpeed");y(this,"defaultPolarSpeed");this.camera=e,this.defaultAzimuthSpeed=e.controls.azimuthRotateSpeed,this.defaultPolarSpeed=e.controls.polarRotateSpeed}set(e){this.enabled=e;const t=this.camera.controls;t.azimuthRotateSpeed=e?0:this.defaultAzimuthSpeed,t.polarRotateSpeed=e?0:this.defaultPolarSpeed,this.mouseInitialized||(this.mouseAction1=t.touches.one,this.mouseAction2=t.touches.two,this.mouseInitialized=!0),e?(t.mouseButtons.left=vt.ACTION.TRUCK,t.touches.one=vt.ACTION.TOUCH_TRUCK,t.touches.two=vt.ACTION.TOUCH_ZOOM):(t.mouseButtons.left=vt.ACTION.ROTATE,t.touches.one=this.mouseAction1,t.touches.two=this.mouseAction2)}}class Ec{constructor(e){y(this,"onChanged",new et);y(this,"current","Perspective");y(this,"camera");y(this,"matchOrthoDistanceEnabled",!1);y(this,"_component");y(this,"_previousDistance",-1);this._component=e,this.camera=e.three}async set(e){this.current!==e&&(e==="Orthographic"?this.setOrthoCamera():await this.setPerspectiveCamera(),this.onChanged.trigger(this.camera))}async toggle(){const t=this.current==="Perspective"?"Orthographic":"Perspective";await this.set(t)}setOrthoCamera(){if(this._component.mode===null||this._component.mode.id==="FirstPerson")return;this._previousDistance=this._component.controls.distance,this._component.controls.distance=200;const e=this.getPerspectiveDims();if(!e)return;const{width:t,height:s}=e;this.setupOrthoCamera(s,t),this.camera=this._component.threeOrtho,this.current="Orthographic"}getPerspectiveDims(){const e=this._component.currentWorld;if(!e||!e.renderer)return null;const t=new W;this._component.threePersp.getWorldDirection(t);const s=new W;this._component.controls.getTarget(s);const n=s.clone().sub(this._component.threePersp.position).dot(t),r=e.renderer.getSize(),o=r.x/r.y,a=this._component.threePersp,l=n*2*Math.atan(a.fov*(Math.PI/180)/2);return{width:l*o,height:l}}setupOrthoCamera(e,t){this._component.controls.mouseButtons.wheel=vt.ACTION.ZOOM,this._component.controls.mouseButtons.middle=vt.ACTION.ZOOM;const s=this._component.threePersp,i=this._component.threeOrtho;i.zoom=1,i.left=t/-2,i.right=t/2,i.top=e/2,i.bottom=e/-2,i.updateProjectionMatrix(),i.position.copy(s.position),i.quaternion.copy(s.quaternion),this._component.controls.camera=i}getDistance(){const e=this._component.threePersp,t=this._component.threeOrtho;return(t.top-t.bottom)/t.zoom/(2*Math.atan(e.fov*(Math.PI/180)/2))}async setPerspectiveCamera(){this._component.controls.mouseButtons.wheel=vt.ACTION.DOLLY,this._component.controls.mouseButtons.middle=vt.ACTION.DOLLY;const e=this._component.threePersp,t=this._component.threeOrtho;e.position.copy(t.position),e.quaternion.copy(t.quaternion),this._component.controls.mouseButtons.wheel=vt.ACTION.DOLLY,this.matchOrthoDistanceEnabled?this._component.controls.distance=this.getDistance():this._component.controls.distance=this._previousDistance,await this._component.controls.zoomTo(1),e.updateProjectionMatrix(),this._component.controls.camera=e,this.camera=e,this.current="Perspective"}}class Ic extends vn{constructor(t){super(t);y(this,"projection");y(this,"threeOrtho");y(this,"threePersp");y(this,"_userInputButtons",{});y(this,"_frustumSize",50);y(this,"_navigationModes",new Map);y(this,"_mode",null);y(this,"previousSize",null);this.threePersp=this.three,this.threeOrtho=this.newOrthoCamera(),this.projection=new Ec(this),this.onAspectUpdated.add(()=>{this.setOrthoPerspCameraAspect()}),this.projection.onChanged.add(s=>{this.three=s,this.updateAspect()}),this.onWorldChanged.add(({action:s})=>{s==="added"&&(this._navigationModes.clear(),this._navigationModes.set("Orbit",new fc(this)),this._navigationModes.set("FirstPerson",new dc(this)),this._navigationModes.set("Plan",new pc(this)),this._mode=this._navigationModes.get("Orbit"),this.mode.set(!0,{preventTargetAdjustment:!0}),this.currentWorld&&this.currentWorld.renderer&&(this.previousSize=this.currentWorld.renderer.getSize().clone()))})}get mode(){if(!this._mode)throw new Error("Mode not found, camera not initialized");return this._mode}dispose(){super.dispose(),this.threeOrtho.removeFromParent()}set(t){if(this.mode!==null&&this.mode.id!==t){if(this.mode.set(!1),!this._navigationModes.has(t))throw new Error("The specified mode does not exist!");this._mode=this._navigationModes.get(t),this.mode.set(!0)}}async fit(t,s=1.5){if(!this.enabled)return;const i=Number.MAX_VALUE,n=Number.MIN_VALUE,r=new W(i,i,i),o=new W(n,n,n);for(const f of t){const I=new Nt().setFromObject(f);I.min.xo.x&&(o.x=I.max.x),I.max.y>o.y&&(o.y=I.max.y),I.max.z>o.z&&(o.z=I.max.z)}const a=new Nt(r,o),l=new W;a.getSize(l);const h=new W;a.getCenter(h);const u=Math.max(l.x,l.y,l.z)*s,d=new gi(h,u);await this.controls.fitToSphere(d,!0)}setUserInput(t){t?this.enableUserInput():this.disableUserInput()}disableUserInput(){this._userInputButtons.left=this.controls.mouseButtons.left,this._userInputButtons.right=this.controls.mouseButtons.right,this._userInputButtons.middle=this.controls.mouseButtons.middle,this._userInputButtons.wheel=this.controls.mouseButtons.wheel,this.controls.mouseButtons.left=0,this.controls.mouseButtons.right=0,this.controls.mouseButtons.middle=0,this.controls.mouseButtons.wheel=0}enableUserInput(){Object.keys(this._userInputButtons).length!==0&&(this.controls.mouseButtons.left=this._userInputButtons.left,this.controls.mouseButtons.right=this._userInputButtons.right,this.controls.mouseButtons.middle=this._userInputButtons.middle,this.controls.mouseButtons.wheel=this._userInputButtons.wheel)}newOrthoCamera(){const t=window.innerWidth/window.innerHeight;return new En(this._frustumSize*t/-2,this._frustumSize*t/2,this._frustumSize/2,this._frustumSize/-2,.1,1e3)}setOrthoPerspCameraAspect(){if(!this.currentWorld||!this.currentWorld.renderer||!this.previousSize)return;const t=this.currentWorld.renderer.getSize(),s=this.threeOrtho.top,i=this.threeOrtho.right,n=t.y/this.previousSize.y,r=t.x/this.previousSize.x,o=s*n,a=i*r;this.threeOrtho.left=-a,this.threeOrtho.right=a,this.threeOrtho.top=o,this.threeOrtho.bottom=-o,this.threeOrtho.updateProjectionMatrix(),this.previousSize.copy(t)}}const Or=new Map([[_i,{forRelated:"Decomposes",forRelating:"IsDecomposedBy"}],[Cn,{forRelated:"HasAssociations",forRelating:"AssociatedTo"}],[gn,{forRelated:"HasAssociations",forRelating:"ClassificationForObjects"}],[Tn,{forRelated:"HasAssignments",forRelating:"IsGroupedBy"}],[Ns,{forRelated:"IsDefinedBy",forRelating:"DefinesOcurrence"}],[_n,{forRelated:"IsTypedBy",forRelating:"Types"}],[An,{forRelated:"IsDefinedBy",forRelating:"Defines"}],[Ai,{forRelated:"ContainedInStructure",forRelating:"ContainsElements"}],[Rn,{forRelated:"AssignedToFlowElement",forRelating:"HasControlElements"}],[yn,{forRelated:"ConnectedFrom",forRelating:"ConnectedTo"}],[On,{forRelated:"HasAssignments",forRelating:"ReferencedBy"}],[Fn,{forRelated:"HasContext",forRelating:"Declares"}],[Sn,{forRelated:"HasAssignments",forRelating:"Controls"}],[wn,{forRelated:"Nests",forRelating:"IsNestedBy"}],[Nn,{forRelated:"HasAssociations",forRelating:"DocumentRefForObjects"}]]),Wr={950732822:"IFCURIREFERENCE",4075327185:"IFCTIME",1209108979:"IFCTEMPERATURERATEOFCHANGEMEASURE",3457685358:"IFCSOUNDPRESSURELEVELMEASURE",4157543285:"IFCSOUNDPOWERLEVELMEASURE",2798247006:"IFCPROPERTYSETDEFINITIONSET",1790229001:"IFCPOSITIVEINTEGER",525895558:"IFCNONNEGATIVELENGTHMEASURE",1774176899:"IFCLINEINDEX",1275358634:"IFCLANGUAGEID",2541165894:"IFCDURATION",3701338814:"IFCDAYINWEEKNUMBER",2195413836:"IFCDATETIME",937566702:"IFCDATE",1683019596:"IFCCARDINALPOINTREFERENCE",2314439260:"IFCBINARY",1500781891:"IFCAREADENSITYMEASURE",3683503648:"IFCARCINDEX",4065007721:"IFCYEARNUMBER",1718600412:"IFCWARPINGMOMENTMEASURE",51269191:"IFCWARPINGCONSTANTMEASURE",2593997549:"IFCVOLUMETRICFLOWRATEMEASURE",3458127941:"IFCVOLUMEMEASURE",3345633955:"IFCVAPORPERMEABILITYMEASURE",1278329552:"IFCTORQUEMEASURE",2591213694:"IFCTIMESTAMP",2726807636:"IFCTIMEMEASURE",743184107:"IFCTHERMODYNAMICTEMPERATUREMEASURE",2016195849:"IFCTHERMALTRANSMITTANCEMEASURE",857959152:"IFCTHERMALRESISTANCEMEASURE",2281867870:"IFCTHERMALEXPANSIONCOEFFICIENTMEASURE",2645777649:"IFCTHERMALCONDUCTIVITYMEASURE",232962298:"IFCTHERMALADMITTANCEMEASURE",296282323:"IFCTEXTTRANSFORMATION",603696268:"IFCTEXTFONTNAME",3490877962:"IFCTEXTDECORATION",1460886941:"IFCTEXTALIGNMENT",2801250643:"IFCTEXT",58845555:"IFCTEMPERATUREGRADIENTMEASURE",361837227:"IFCSPECULARROUGHNESS",2757832317:"IFCSPECULAREXPONENT",3477203348:"IFCSPECIFICHEATCAPACITYMEASURE",993287707:"IFCSOUNDPRESSUREMEASURE",846465480:"IFCSOUNDPOWERMEASURE",3471399674:"IFCSOLIDANGLEMEASURE",408310005:"IFCSHEARMODULUSMEASURE",2190458107:"IFCSECTIONALAREAINTEGRALMEASURE",3467162246:"IFCSECTIONMODULUSMEASURE",2766185779:"IFCSECONDINMINUTE",3211557302:"IFCROTATIONALSTIFFNESSMEASURE",1755127002:"IFCROTATIONALMASSMEASURE",2133746277:"IFCROTATIONALFREQUENCYMEASURE",200335297:"IFCREAL",96294661:"IFCRATIOMEASURE",3972513137:"IFCRADIOACTIVITYMEASURE",3665567075:"IFCPRESSUREMEASURE",2169031380:"IFCPRESENTABLETEXT",1364037233:"IFCPOWERMEASURE",1245737093:"IFCPOSITIVERATIOMEASURE",3054510233:"IFCPOSITIVEPLANEANGLEMEASURE",2815919920:"IFCPOSITIVELENGTHMEASURE",4042175685:"IFCPLANEANGLEMEASURE",2642773653:"IFCPLANARFORCEMEASURE",2260317790:"IFCPARAMETERVALUE",929793134:"IFCPHMEASURE",2395907400:"IFCNUMERICMEASURE",2095195183:"IFCNORMALISEDRATIOMEASURE",765770214:"IFCMONTHINYEARNUMBER",2615040989:"IFCMONETARYMEASURE",3114022597:"IFCMOMENTOFINERTIAMEASURE",1648970520:"IFCMOLECULARWEIGHTMEASURE",3177669450:"IFCMOISTUREDIFFUSIVITYMEASURE",1753493141:"IFCMODULUSOFSUBGRADEREACTIONMEASURE",1052454078:"IFCMODULUSOFROTATIONALSUBGRADEREACTIONMEASURE",2173214787:"IFCMODULUSOFLINEARSUBGRADEREACTIONMEASURE",3341486342:"IFCMODULUSOFELASTICITYMEASURE",102610177:"IFCMINUTEINHOUR",3531705166:"IFCMASSPERLENGTHMEASURE",3124614049:"IFCMASSMEASURE",4017473158:"IFCMASSFLOWRATEMEASURE",1477762836:"IFCMASSDENSITYMEASURE",2486716878:"IFCMAGNETICFLUXMEASURE",286949696:"IFCMAGNETICFLUXDENSITYMEASURE",151039812:"IFCLUMINOUSINTENSITYMEASURE",2755797622:"IFCLUMINOUSINTENSITYDISTRIBUTIONMEASURE",2095003142:"IFCLUMINOUSFLUXMEASURE",503418787:"IFCLOGICAL",3086160713:"IFCLINEARVELOCITYMEASURE",1307019551:"IFCLINEARSTIFFNESSMEASURE",2128979029:"IFCLINEARMOMENTMEASURE",191860431:"IFCLINEARFORCEMEASURE",1243674935:"IFCLENGTHMEASURE",3258342251:"IFCLABEL",2054016361:"IFCKINEMATICVISCOSITYMEASURE",3192672207:"IFCISOTHERMALMOISTURECAPACITYMEASURE",3686016028:"IFCIONCONCENTRATIONMEASURE",3809634241:"IFCINTEGERCOUNTRATEMEASURE",1939436016:"IFCINTEGER",2679005408:"IFCINDUCTANCEMEASURE",3358199106:"IFCILLUMINANCEMEASURE",983778844:"IFCIDENTIFIER",2589826445:"IFCHOURINDAY",1158859006:"IFCHEATINGVALUEMEASURE",3113092358:"IFCHEATFLUXDENSITYMEASURE",3064340077:"IFCGLOBALLYUNIQUEID",3044325142:"IFCFREQUENCYMEASURE",1361398929:"IFCFORCEMEASURE",2590844177:"IFCFONTWEIGHT",2715512545:"IFCFONTVARIANT",1102727119:"IFCFONTSTYLE",2078135608:"IFCENERGYMEASURE",2506197118:"IFCELECTRICVOLTAGEMEASURE",2951915441:"IFCELECTRICRESISTANCEMEASURE",3790457270:"IFCELECTRICCURRENTMEASURE",2093906313:"IFCELECTRICCONDUCTANCEMEASURE",3818826038:"IFCELECTRICCHARGEMEASURE",1827137117:"IFCELECTRICCAPACITANCEMEASURE",69416015:"IFCDYNAMICVISCOSITYMEASURE",524656162:"IFCDOSEEQUIVALENTMEASURE",4134073009:"IFCDIMENSIONCOUNT",1514641115:"IFCDESCRIPTIVEMEASURE",300323983:"IFCDAYLIGHTSAVINGHOUR",86635668:"IFCDAYINMONTHNUMBER",94842927:"IFCCURVATUREMEASURE",1778710042:"IFCCOUNTMEASURE",3238673880:"IFCCONTEXTDEPENDENTMEASURE",3812528620:"IFCCOMPOUNDPLANEANGLEMEASURE",2991860651:"IFCCOMPLEXNUMBER",1867003952:"IFCBOXALIGNMENT",2735952531:"IFCBOOLEAN",2650437152:"IFCAREAMEASURE",632304761:"IFCANGULARVELOCITYMEASURE",360377573:"IFCAMOUNTOFSUBSTANCEMEASURE",4182062534:"IFCACCELERATIONMEASURE",3699917729:"IFCABSORBEDDOSEMEASURE",1971632696:"IFCGEOSLICE",2680139844:"IFCGEOMODEL",24726584:"IFCELECTRICFLOWTREATMENTDEVICE",3693000487:"IFCDISTRIBUTIONBOARD",3460952963:"IFCCONVEYORSEGMENT",3999819293:"IFCCAISSONFOUNDATION",3314249567:"IFCBOREHOLE",4196446775:"IFCBEARING",325726236:"IFCALIGNMENT",3425753595:"IFCTRACKELEMENT",991950508:"IFCSIGNAL",3798194928:"IFCREINFORCEDSOIL",3290496277:"IFCRAIL",1383356374:"IFCPAVEMENT",2182337498:"IFCNAVIGATIONELEMENT",234836483:"IFCMOORINGDEVICE",2078563270:"IFCMOBILETELECOMMUNICATIONSAPPLIANCE",1638804497:"IFCLIQUIDTERMINAL",1154579445:"IFCLINEARPOSITIONINGELEMENT",2696325953:"IFCKERB",2713699986:"IFCGEOTECHNICALASSEMBLY",2142170206:"IFCELECTRICFLOWTREATMENTDEVICETYPE",3376911765:"IFCEARTHWORKSFILL",1077100507:"IFCEARTHWORKSELEMENT",3071239417:"IFCEARTHWORKSCUT",479945903:"IFCDISTRIBUTIONBOARDTYPE",3426335179:"IFCDEEPFOUNDATION",1502416096:"IFCCOURSE",2940368186:"IFCCONVEYORSEGMENTTYPE",3203706013:"IFCCAISSONFOUNDATIONTYPE",3862327254:"IFCBUILTSYSTEM",1876633798:"IFCBUILTELEMENT",963979645:"IFCBRIDGEPART",644574406:"IFCBRIDGE",3649138523:"IFCBEARINGTYPE",1662888072:"IFCALIGNMENTVERTICAL",317615605:"IFCALIGNMENTSEGMENT",1545765605:"IFCALIGNMENTHORIZONTAL",4266260250:"IFCALIGNMENTCANT",3956297820:"IFCVIBRATIONDAMPERTYPE",1530820697:"IFCVIBRATIONDAMPER",840318589:"IFCVEHICLE",1953115116:"IFCTRANSPORTATIONDEVICE",618700268:"IFCTRACKELEMENTTYPE",2281632017:"IFCTENDONCONDUITTYPE",3663046924:"IFCTENDONCONDUIT",42703149:"IFCSINESPIRAL",1894708472:"IFCSIGNALTYPE",3599934289:"IFCSIGNTYPE",33720170:"IFCSIGN",1027922057:"IFCSEVENTHORDERPOLYNOMIALSPIRAL",544395925:"IFCSEGMENTEDREFERENCECURVE",3649235739:"IFCSECONDORDERPOLYNOMIALSPIRAL",550521510:"IFCROADPART",146592293:"IFCROAD",3818125796:"IFCRELADHERESTOELEMENT",4021432810:"IFCREFERENT",1891881377:"IFCRAILWAYPART",3992365140:"IFCRAILWAY",1763565496:"IFCRAILTYPE",1946335990:"IFCPOSITIONINGELEMENT",514975943:"IFCPAVEMENTTYPE",506776471:"IFCNAVIGATIONELEMENTTYPE",710110818:"IFCMOORINGDEVICETYPE",1950438474:"IFCMOBILETELECOMMUNICATIONSAPPLIANCETYPE",976884017:"IFCMARINEPART",525669439:"IFCMARINEFACILITY",1770583370:"IFCLIQUIDTERMINALTYPE",2176059722:"IFCLINEARELEMENT",679976338:"IFCKERBTYPE",3948183225:"IFCIMPACTPROTECTIONDEVICETYPE",2568555532:"IFCIMPACTPROTECTIONDEVICE",2898700619:"IFCGRADIENTCURVE",1594536857:"IFCGEOTECHNICALSTRATUM",4230923436:"IFCGEOTECHNICALELEMENT",4228831410:"IFCFACILITYPARTCOMMON",1310830890:"IFCFACILITYPART",24185140:"IFCFACILITY",4234616927:"IFCDIRECTRIXDERIVEDREFERENCESWEPTAREASOLID",1306400036:"IFCDEEPFOUNDATIONTYPE",4189326743:"IFCCOURSETYPE",2000195564:"IFCCOSINESPIRAL",3497074424:"IFCCLOTHOID",1626504194:"IFCBUILTELEMENTTYPE",3651464721:"IFCVEHICLETYPE",1229763772:"IFCTRIANGULATEDIRREGULARNETWORK",3665877780:"IFCTRANSPORTATIONDEVICETYPE",782932809:"IFCTHIRDORDERPOLYNOMIALSPIRAL",2735484536:"IFCSPIRAL",1356537516:"IFCSECTIONEDSURFACE",1290935644:"IFCSECTIONEDSOLIDHORIZONTAL",1862484736:"IFCSECTIONEDSOLID",1441486842:"IFCRELPOSITIONS",1033248425:"IFCRELASSOCIATESPROFILEDEF",3381221214:"IFCPOLYNOMIALCURVE",2485787929:"IFCOFFSETCURVEBYDISTANCES",590820931:"IFCOFFSETCURVE",3465909080:"IFCINDEXEDPOLYGONALTEXTUREMAP",593015953:"IFCDIRECTRIXCURVESWEPTAREASOLID",4212018352:"IFCCURVESEGMENT",3425423356:"IFCAXIS2PLACEMENTLINEAR",823603102:"IFCSEGMENT",2165702409:"IFCPOINTBYDISTANCEEXPRESSION",182550632:"IFCOPENCROSSPROFILEDEF",388784114:"IFCLINEARPLACEMENT",536804194:"IFCALIGNMENTHORIZONTALSEGMENT",3752311538:"IFCALIGNMENTCANTSEGMENT",1010789467:"IFCTEXTURECOORDINATEINDICESWITHVOIDS",222769930:"IFCTEXTURECOORDINATEINDICES",2691318326:"IFCQUANTITYNUMBER",3633395639:"IFCALIGNMENTVERTICALSEGMENT",2879124712:"IFCALIGNMENTPARAMETERSEGMENT",25142252:"IFCCONTROLLER",3087945054:"IFCALARM",4288193352:"IFCACTUATOR",630975310:"IFCUNITARYCONTROLELEMENT",4086658281:"IFCSENSOR",2295281155:"IFCPROTECTIVEDEVICETRIPPINGUNIT",182646315:"IFCFLOWINSTRUMENT",1426591983:"IFCFIRESUPPRESSIONTERMINAL",819412036:"IFCFILTER",3415622556:"IFCFAN",1003880860:"IFCELECTRICTIMECONTROL",402227799:"IFCELECTRICMOTOR",264262732:"IFCELECTRICGENERATOR",3310460725:"IFCELECTRICFLOWSTORAGEDEVICE",862014818:"IFCELECTRICDISTRIBUTIONBOARD",1904799276:"IFCELECTRICAPPLIANCE",1360408905:"IFCDUCTSILENCER",3518393246:"IFCDUCTSEGMENT",342316401:"IFCDUCTFITTING",562808652:"IFCDISTRIBUTIONCIRCUIT",4074379575:"IFCDAMPER",3640358203:"IFCCOOLINGTOWER",4136498852:"IFCCOOLEDBEAM",2272882330:"IFCCONDENSER",3571504051:"IFCCOMPRESSOR",3221913625:"IFCCOMMUNICATIONSAPPLIANCE",639361253:"IFCCOIL",3902619387:"IFCCHILLER",4217484030:"IFCCABLESEGMENT",1051757585:"IFCCABLEFITTING",3758799889:"IFCCABLECARRIERSEGMENT",635142910:"IFCCABLECARRIERFITTING",2938176219:"IFCBURNER",32344328:"IFCBOILER",2906023776:"IFCBEAMSTANDARDCASE",277319702:"IFCAUDIOVISUALAPPLIANCE",2056796094:"IFCAIRTOAIRHEATRECOVERY",177149247:"IFCAIRTERMINALBOX",1634111441:"IFCAIRTERMINAL",486154966:"IFCWINDOWSTANDARDCASE",4237592921:"IFCWASTETERMINAL",4156078855:"IFCWALLELEMENTEDCASE",4207607924:"IFCVALVE",4292641817:"IFCUNITARYEQUIPMENT",3179687236:"IFCUNITARYCONTROLELEMENTTYPE",3026737570:"IFCTUBEBUNDLE",3825984169:"IFCTRANSFORMER",812556717:"IFCTANK",1162798199:"IFCSWITCHINGDEVICE",385403989:"IFCSTRUCTURALLOADCASE",1404847402:"IFCSTACKTERMINAL",1999602285:"IFCSPACEHEATER",3420628829:"IFCSOLARDEVICE",3027962421:"IFCSLABSTANDARDCASE",3127900445:"IFCSLABELEMENTEDCASE",1329646415:"IFCSHADINGDEVICE",3053780830:"IFCSANITARYTERMINAL",2572171363:"IFCREINFORCINGBARTYPE",1232101972:"IFCRATIONALBSPLINECURVEWITHKNOTS",90941305:"IFCPUMP",655969474:"IFCPROTECTIVEDEVICETRIPPINGUNITTYPE",738039164:"IFCPROTECTIVEDEVICE",1156407060:"IFCPLATESTANDARDCASE",3612865200:"IFCPIPESEGMENT",310824031:"IFCPIPEFITTING",3694346114:"IFCOUTLET",144952367:"IFCOUTERBOUNDARYCURVE",2474470126:"IFCMOTORCONNECTION",1911478936:"IFCMEMBERSTANDARDCASE",1437502449:"IFCMEDICALDEVICE",629592764:"IFCLIGHTFIXTURE",76236018:"IFCLAMP",2176052936:"IFCJUNCTIONBOX",4175244083:"IFCINTERCEPTOR",2068733104:"IFCHUMIDIFIER",3319311131:"IFCHEATEXCHANGER",2188021234:"IFCFLOWMETER",1209101575:"IFCEXTERNALSPATIALELEMENT",484807127:"IFCEVAPORATOR",3747195512:"IFCEVAPORATIVECOOLER",2814081492:"IFCENGINE",2417008758:"IFCELECTRICDISTRIBUTIONBOARDTYPE",3242481149:"IFCDOORSTANDARDCASE",3205830791:"IFCDISTRIBUTIONSYSTEM",400855858:"IFCCOMMUNICATIONSAPPLIANCETYPE",905975707:"IFCCOLUMNSTANDARDCASE",1677625105:"IFCCIVILELEMENT",3296154744:"IFCCHIMNEY",2674252688:"IFCCABLEFITTINGTYPE",2188180465:"IFCBURNERTYPE",1177604601:"IFCBUILDINGSYSTEM",39481116:"IFCBUILDINGELEMENTPARTTYPE",1136057603:"IFCBOUNDARYCURVE",2461110595:"IFCBSPLINECURVEWITHKNOTS",1532957894:"IFCAUDIOVISUALAPPLIANCETYPE",4088093105:"IFCWORKCALENDAR",4009809668:"IFCWINDOWTYPE",926996030:"IFCVOIDINGFEATURE",2391383451:"IFCVIBRATIONISOLATOR",2415094496:"IFCTENDONTYPE",3081323446:"IFCTENDONANCHORTYPE",413509423:"IFCSYSTEMFURNITUREELEMENT",3101698114:"IFCSURFACEFEATURE",3657597509:"IFCSTRUCTURALSURFACEACTION",2757150158:"IFCSTRUCTURALCURVEREACTION",1004757350:"IFCSTRUCTURALCURVEACTION",338393293:"IFCSTAIRTYPE",1072016465:"IFCSOLARDEVICETYPE",4074543187:"IFCSHADINGDEVICETYPE",2157484638:"IFCSEAMCURVE",2781568857:"IFCROOFTYPE",2310774935:"IFCREINFORCINGMESHTYPE",964333572:"IFCREINFORCINGELEMENTTYPE",683857671:"IFCRATIONALBSPLINESURFACEWITHKNOTS",1469900589:"IFCRAMPTYPE",2839578677:"IFCPOLYGONALFACESET",1158309216:"IFCPILETYPE",3079942009:"IFCOPENINGSTANDARDCASE",1114901282:"IFCMEDICALDEVICETYPE",3113134337:"IFCINTERSECTIONCURVE",3946677679:"IFCINTERCEPTORTYPE",2571569899:"IFCINDEXEDPOLYCURVE",3493046030:"IFCGEOGRAPHICELEMENT",1509553395:"IFCFURNITURE",1893162501:"IFCFOOTINGTYPE",2853485674:"IFCEXTERNALSPATIALSTRUCTUREELEMENT",4148101412:"IFCEVENT",132023988:"IFCENGINETYPE",2397081782:"IFCELEMENTASSEMBLYTYPE",2323601079:"IFCDOORTYPE",1213902940:"IFCCYLINDRICALSURFACE",1525564444:"IFCCONSTRUCTIONPRODUCTRESOURCETYPE",4105962743:"IFCCONSTRUCTIONMATERIALRESOURCETYPE",2185764099:"IFCCONSTRUCTIONEQUIPMENTRESOURCETYPE",15328376:"IFCCOMPOSITECURVEONSURFACE",3875453745:"IFCCOMPLEXPROPERTYTEMPLATE",3893394355:"IFCCIVILELEMENTTYPE",2197970202:"IFCCHIMNEYTYPE",167062518:"IFCBSPLINESURFACEWITHKNOTS",2887950389:"IFCBSPLINESURFACE",2603310189:"IFCADVANCEDBREPWITHVOIDS",1635779807:"IFCADVANCEDBREP",2916149573:"IFCTRIANGULATEDFACESET",1935646853:"IFCTOROIDALSURFACE",2387106220:"IFCTESSELLATEDFACESET",3206491090:"IFCTASKTYPE",699246055:"IFCSURFACECURVE",4095615324:"IFCSUBCONTRACTRESOURCETYPE",603775116:"IFCSTRUCTURALSURFACEREACTION",4015995234:"IFCSPHERICALSURFACE",2481509218:"IFCSPATIALZONETYPE",463610769:"IFCSPATIALZONE",710998568:"IFCSPATIALELEMENTTYPE",1412071761:"IFCSPATIALELEMENT",3663146110:"IFCSIMPLEPROPERTYTEMPLATE",3243963512:"IFCREVOLVEDAREASOLIDTAPERED",816062949:"IFCREPARAMETRISEDCOMPOSITECURVESEGMENT",1521410863:"IFCRELSPACEBOUNDARY2NDLEVEL",3523091289:"IFCRELSPACEBOUNDARY1STLEVEL",427948657:"IFCRELINTERFERESELEMENTS",307848117:"IFCRELDEFINESBYTEMPLATE",1462361463:"IFCRELDEFINESBYOBJECT",2565941209:"IFCRELDECLARES",1027710054:"IFCRELASSIGNSTOGROUPBYFACTOR",3521284610:"IFCPROPERTYTEMPLATE",492091185:"IFCPROPERTYSETTEMPLATE",653396225:"IFCPROJECTLIBRARY",569719735:"IFCPROCEDURETYPE",3967405729:"IFCPREDEFINEDPROPERTYSET",1682466193:"IFCPCURVE",428585644:"IFCLABORRESOURCETYPE",2294589976:"IFCINDEXEDPOLYGONALFACEWITHVOIDS",178912537:"IFCINDEXEDPOLYGONALFACE",4095422895:"IFCGEOGRAPHICELEMENTTYPE",2652556860:"IFCFIXEDREFERENCESWEPTAREASOLID",2804161546:"IFCEXTRUDEDAREASOLIDTAPERED",4024345920:"IFCEVENTTYPE",2629017746:"IFCCURVEBOUNDEDSURFACE",1815067380:"IFCCREWRESOURCETYPE",3419103109:"IFCCONTEXT",2574617495:"IFCCONSTRUCTIONRESOURCETYPE",2059837836:"IFCCARTESIANPOINTLIST3D",1675464909:"IFCCARTESIANPOINTLIST2D",574549367:"IFCCARTESIANPOINTLIST",3406155212:"IFCADVANCEDFACE",3698973494:"IFCTYPERESOURCE",3736923433:"IFCTYPEPROCESS",901063453:"IFCTESSELLATEDITEM",1096409881:"IFCSWEPTDISKSOLIDPOLYGONAL",1042787934:"IFCRESOURCETIME",1608871552:"IFCRESOURCECONSTRAINTRELATIONSHIP",2943643501:"IFCRESOURCEAPPROVALRELATIONSHIP",2090586900:"IFCQUANTITYSET",1482703590:"IFCPROPERTYTEMPLATEDEFINITION",3778827333:"IFCPREDEFINEDPROPERTIES",2998442950:"IFCMIRROREDPROFILEDEF",853536259:"IFCMATERIALRELATIONSHIP",3404854881:"IFCMATERIALPROFILESETUSAGETAPERING",3079605661:"IFCMATERIALPROFILESETUSAGE",2852063980:"IFCMATERIALCONSTITUENTSET",3708119e3:"IFCMATERIALCONSTITUENT",1585845231:"IFCLAGTIME",2133299955:"IFCINDEXEDTRIANGLETEXTUREMAP",1437953363:"IFCINDEXEDTEXTUREMAP",3570813810:"IFCINDEXEDCOLOURMAP",1437805879:"IFCEXTERNALREFERENCERELATIONSHIP",297599258:"IFCEXTENDEDPROPERTIES",211053100:"IFCEVENTTIME",2713554722:"IFCCONVERSIONBASEDUNITWITHOFFSET",3285139300:"IFCCOLOURRGBLIST",1236880293:"IFCWORKTIME",1199560280:"IFCTIMEPERIOD",3611470254:"IFCTEXTUREVERTEXLIST",2771591690:"IFCTASKTIMERECURRING",1549132990:"IFCTASKTIME",2043862942:"IFCTABLECOLUMN",2934153892:"IFCSURFACEREINFORCEMENTAREA",609421318:"IFCSTRUCTURALLOADORRESULT",3478079324:"IFCSTRUCTURALLOADCONFIGURATION",1054537805:"IFCSCHEDULINGTIME",2439245199:"IFCRESOURCELEVELRELATIONSHIP",2433181523:"IFCREFERENCE",3915482550:"IFCRECURRENCEPATTERN",986844984:"IFCPROPERTYABSTRACTION",3843373140:"IFCPROJECTEDCRS",677532197:"IFCPRESENTATIONITEM",1507914824:"IFCMATERIALUSAGEDEFINITION",552965576:"IFCMATERIALPROFILEWITHOFFSETS",164193824:"IFCMATERIALPROFILESET",2235152071:"IFCMATERIALPROFILE",1847252529:"IFCMATERIALLAYERWITHOFFSETS",760658860:"IFCMATERIALDEFINITION",3057273783:"IFCMAPCONVERSION",4294318154:"IFCEXTERNALINFORMATION",1466758467:"IFCCOORDINATEREFERENCESYSTEM",1785450214:"IFCCOORDINATEOPERATION",775493141:"IFCCONNECTIONVOLUMEGEOMETRY",979691226:"IFCREINFORCINGBAR",3700593921:"IFCELECTRICDISTRIBUTIONPOINT",1062813311:"IFCDISTRIBUTIONCONTROLELEMENT",1052013943:"IFCDISTRIBUTIONCHAMBERELEMENT",578613899:"IFCCONTROLLERTYPE",2454782716:"IFCCHAMFEREDGEFEATURE",753842376:"IFCBEAM",3001207471:"IFCALARMTYPE",2874132201:"IFCACTUATORTYPE",3304561284:"IFCWINDOW",3512223829:"IFCWALLSTANDARDCASE",2391406946:"IFCWALL",3313531582:"IFCVIBRATIONISOLATORTYPE",2347447852:"IFCTENDONANCHOR",3824725483:"IFCTENDON",2515109513:"IFCSTRUCTURALANALYSISMODEL",4252922144:"IFCSTAIRFLIGHT",331165859:"IFCSTAIR",1529196076:"IFCSLAB",1783015770:"IFCSENSORTYPE",1376911519:"IFCROUNDEDEDGEFEATURE",2016517767:"IFCROOF",2320036040:"IFCREINFORCINGMESH",3027567501:"IFCREINFORCINGELEMENT",3055160366:"IFCRATIONALBEZIERCURVE",3283111854:"IFCRAMPFLIGHT",3024970846:"IFCRAMP",2262370178:"IFCRAILING",3171933400:"IFCPLATE",1687234759:"IFCPILE",1073191201:"IFCMEMBER",900683007:"IFCFOOTING",3508470533:"IFCFLOWTREATMENTDEVICE",2223149337:"IFCFLOWTERMINAL",707683696:"IFCFLOWSTORAGEDEVICE",987401354:"IFCFLOWSEGMENT",3132237377:"IFCFLOWMOVINGDEVICE",4037862832:"IFCFLOWINSTRUMENTTYPE",4278956645:"IFCFLOWFITTING",2058353004:"IFCFLOWCONTROLLER",4222183408:"IFCFIRESUPPRESSIONTERMINALTYPE",1810631287:"IFCFILTERTYPE",346874300:"IFCFANTYPE",1658829314:"IFCENERGYCONVERSIONDEVICE",857184966:"IFCELECTRICALELEMENT",1634875225:"IFCELECTRICALCIRCUIT",712377611:"IFCELECTRICTIMECONTROLTYPE",1217240411:"IFCELECTRICMOTORTYPE",1365060375:"IFCELECTRICHEATERTYPE",1534661035:"IFCELECTRICGENERATORTYPE",3277789161:"IFCELECTRICFLOWSTORAGEDEVICETYPE",663422040:"IFCELECTRICAPPLIANCETYPE",855621170:"IFCEDGEFEATURE",2030761528:"IFCDUCTSILENCERTYPE",3760055223:"IFCDUCTSEGMENTTYPE",869906466:"IFCDUCTFITTINGTYPE",395920057:"IFCDOOR",3041715199:"IFCDISTRIBUTIONPORT",3040386961:"IFCDISTRIBUTIONFLOWELEMENT",1945004755:"IFCDISTRIBUTIONELEMENT",2063403501:"IFCDISTRIBUTIONCONTROLELEMENTTYPE",1599208980:"IFCDISTRIBUTIONCHAMBERELEMENTTYPE",2635815018:"IFCDISCRETEACCESSORYTYPE",1335981549:"IFCDISCRETEACCESSORY",4147604152:"IFCDIAMETERDIMENSION",3961806047:"IFCDAMPERTYPE",3495092785:"IFCCURTAINWALL",1973544240:"IFCCOVERING",2954562838:"IFCCOOLINGTOWERTYPE",335055490:"IFCCOOLEDBEAMTYPE",488727124:"IFCCONSTRUCTIONPRODUCTRESOURCE",1060000209:"IFCCONSTRUCTIONMATERIALRESOURCE",3898045240:"IFCCONSTRUCTIONEQUIPMENTRESOURCE",1163958913:"IFCCONDITIONCRITERION",2188551683:"IFCCONDITION",2816379211:"IFCCONDENSERTYPE",3850581409:"IFCCOMPRESSORTYPE",843113511:"IFCCOLUMN",2301859152:"IFCCOILTYPE",2611217952:"IFCCIRCLE",2951183804:"IFCCHILLERTYPE",1285652485:"IFCCABLESEGMENTTYPE",3293546465:"IFCCABLECARRIERSEGMENTTYPE",395041908:"IFCCABLECARRIERFITTINGTYPE",1909888760:"IFCBUILDINGELEMENTPROXYTYPE",1095909175:"IFCBUILDINGELEMENTPROXY",2979338954:"IFCBUILDINGELEMENTPART",52481810:"IFCBUILDINGELEMENTCOMPONENT",3299480353:"IFCBUILDINGELEMENT",231477066:"IFCBOILERTYPE",1916977116:"IFCBEZIERCURVE",819618141:"IFCBEAMTYPE",1967976161:"IFCBSPLINECURVE",3460190687:"IFCASSET",2470393545:"IFCANGULARDIMENSION",1871374353:"IFCAIRTOAIRHEATRECOVERYTYPE",3352864051:"IFCAIRTERMINALTYPE",1411407467:"IFCAIRTERMINALBOXTYPE",3821786052:"IFCACTIONREQUEST",1213861670:"IFC2DCOMPOSITECURVE",1033361043:"IFCZONE",3342526732:"IFCWORKSCHEDULE",4218914973:"IFCWORKPLAN",1028945134:"IFCWORKCONTROL",1133259667:"IFCWASTETERMINALTYPE",1898987631:"IFCWALLTYPE",2769231204:"IFCVIRTUALELEMENT",728799441:"IFCVALVETYPE",1911125066:"IFCUNITARYEQUIPMENTTYPE",1600972822:"IFCTUBEBUNDLETYPE",3593883385:"IFCTRIMMEDCURVE",1620046519:"IFCTRANSPORTELEMENT",1692211062:"IFCTRANSFORMERTYPE",1637806684:"IFCTIMESERIESSCHEDULE",5716631:"IFCTANKTYPE",2254336722:"IFCSYSTEM",2315554128:"IFCSWITCHINGDEVICETYPE",148013059:"IFCSUBCONTRACTRESOURCE",1975003073:"IFCSTRUCTURALSURFACECONNECTION",2986769608:"IFCSTRUCTURALRESULTGROUP",1235345126:"IFCSTRUCTURALPOINTREACTION",734778138:"IFCSTRUCTURALPOINTCONNECTION",2082059205:"IFCSTRUCTURALPOINTACTION",3987759626:"IFCSTRUCTURALPLANARACTIONVARYING",1621171031:"IFCSTRUCTURALPLANARACTION",1252848954:"IFCSTRUCTURALLOADGROUP",1721250024:"IFCSTRUCTURALLINEARACTIONVARYING",1807405624:"IFCSTRUCTURALLINEARACTION",2445595289:"IFCSTRUCTURALCURVEMEMBERVARYING",214636428:"IFCSTRUCTURALCURVEMEMBER",4243806635:"IFCSTRUCTURALCURVECONNECTION",1179482911:"IFCSTRUCTURALCONNECTION",682877961:"IFCSTRUCTURALACTION",1039846685:"IFCSTAIRFLIGHTTYPE",3112655638:"IFCSTACKTERMINALTYPE",3812236995:"IFCSPACETYPE",652456506:"IFCSPACEPROGRAM",1305183839:"IFCSPACEHEATERTYPE",3856911033:"IFCSPACE",2533589738:"IFCSLABTYPE",4097777520:"IFCSITE",4105383287:"IFCSERVICELIFE",3517283431:"IFCSCHEDULETIMECONTROL",1768891740:"IFCSANITARYTERMINALTYPE",2863920197:"IFCRELASSIGNSTASKS",160246688:"IFCRELAGGREGATES",2324767716:"IFCRAMPFLIGHTTYPE",2893384427:"IFCRAILINGTYPE",3248260540:"IFCRADIUSDIMENSION",2250791053:"IFCPUMPTYPE",1842657554:"IFCPROTECTIVEDEVICETYPE",3651124850:"IFCPROJECTIONELEMENT",3642467123:"IFCPROJECTORDERRECORD",2904328755:"IFCPROJECTORDER",2744685151:"IFCPROCEDURE",3740093272:"IFCPORT",3724593414:"IFCPOLYLINE",4017108033:"IFCPLATETYPE",4231323485:"IFCPIPESEGMENTTYPE",804291784:"IFCPIPEFITTINGTYPE",3327091369:"IFCPERMIT",2382730787:"IFCPERFORMANCEHISTORY",2837617999:"IFCOUTLETTYPE",3425660407:"IFCORDERACTION",3588315303:"IFCOPENINGELEMENT",4143007308:"IFCOCCUPANT",1916936684:"IFCMOVE",977012517:"IFCMOTORCONNECTIONTYPE",3181161470:"IFCMEMBERTYPE",2108223431:"IFCMECHANICALFASTENERTYPE",377706215:"IFCMECHANICALFASTENER",2506943328:"IFCLINEARDIMENSION",1161773419:"IFCLIGHTFIXTURETYPE",1051575348:"IFCLAMPTYPE",3827777499:"IFCLABORRESOURCE",4288270099:"IFCJUNCTIONBOXTYPE",2391368822:"IFCINVENTORY",1806887404:"IFCHUMIDIFIERTYPE",1251058090:"IFCHEATEXCHANGERTYPE",2706460486:"IFCGROUP",3009204131:"IFCGRID",200128114:"IFCGASTERMINALTYPE",814719939:"IFCFURNITURESTANDARD",263784265:"IFCFURNISHINGELEMENT",3009222698:"IFCFLOWTREATMENTDEVICETYPE",2297155007:"IFCFLOWTERMINALTYPE",1339347760:"IFCFLOWSTORAGEDEVICETYPE",1834744321:"IFCFLOWSEGMENTTYPE",1482959167:"IFCFLOWMOVINGDEVICETYPE",3815607619:"IFCFLOWMETERTYPE",3198132628:"IFCFLOWFITTINGTYPE",3907093117:"IFCFLOWCONTROLLERTYPE",1287392070:"IFCFEATUREELEMENTSUBTRACTION",2143335405:"IFCFEATUREELEMENTADDITION",2827207264:"IFCFEATUREELEMENT",2489546625:"IFCFASTENERTYPE",647756555:"IFCFASTENER",3737207727:"IFCFACETEDBREPWITHVOIDS",807026263:"IFCFACETEDBREP",3390157468:"IFCEVAPORATORTYPE",3174744832:"IFCEVAPORATIVECOOLERTYPE",3272907226:"IFCEQUIPMENTSTANDARD",1962604670:"IFCEQUIPMENTELEMENT",2107101300:"IFCENERGYCONVERSIONDEVICETYPE",1704287377:"IFCELLIPSE",2590856083:"IFCELEMENTCOMPONENTTYPE",1623761950:"IFCELEMENTCOMPONENT",4123344466:"IFCELEMENTASSEMBLY",1758889154:"IFCELEMENT",360485395:"IFCELECTRICALBASEPROPERTIES",3849074793:"IFCDISTRIBUTIONFLOWELEMENTTYPE",3256556792:"IFCDISTRIBUTIONELEMENTTYPE",681481545:"IFCDIMENSIONCURVEDIRECTEDCALLOUT",1457835157:"IFCCURTAINWALLTYPE",3295246426:"IFCCREWRESOURCE",1916426348:"IFCCOVERINGTYPE",1419761937:"IFCCOSTSCHEDULE",3895139033:"IFCCOSTITEM",3293443760:"IFCCONTROL",2559216714:"IFCCONSTRUCTIONRESOURCE",2510884976:"IFCCONIC",3732776249:"IFCCOMPOSITECURVE",300633059:"IFCCOLUMNTYPE",2937912522:"IFCCIRCLEHOLLOWPROFILEDEF",3124254112:"IFCBUILDINGSTOREY",1950629157:"IFCBUILDINGELEMENTTYPE",4031249490:"IFCBUILDING",1260505505:"IFCBOUNDEDCURVE",3649129432:"IFCBOOLEANCLIPPINGRESULT",1334484129:"IFCBLOCK",3207858831:"IFCASYMMETRICISHAPEPROFILEDEF",1674181508:"IFCANNOTATION",2296667514:"IFCACTOR",2097647324:"IFCTRANSPORTELEMENTTYPE",3473067441:"IFCTASK",1580310250:"IFCSYSTEMFURNITUREELEMENTTYPE",4124788165:"IFCSURFACEOFREVOLUTION",2809605785:"IFCSURFACEOFLINEAREXTRUSION",2028607225:"IFCSURFACECURVESWEPTAREASOLID",4070609034:"IFCSTRUCTUREDDIMENSIONCALLOUT",2218152070:"IFCSTRUCTURALSURFACEMEMBERVARYING",3979015343:"IFCSTRUCTURALSURFACEMEMBER",3689010777:"IFCSTRUCTURALREACTION",530289379:"IFCSTRUCTURALMEMBER",3136571912:"IFCSTRUCTURALITEM",3544373492:"IFCSTRUCTURALACTIVITY",451544542:"IFCSPHERE",3893378262:"IFCSPATIALSTRUCTUREELEMENTTYPE",2706606064:"IFCSPATIALSTRUCTUREELEMENT",3626867408:"IFCRIGHTCIRCULARCYLINDER",4158566097:"IFCRIGHTCIRCULARCONE",1856042241:"IFCREVOLVEDAREASOLID",2914609552:"IFCRESOURCE",1401173127:"IFCRELVOIDSELEMENT",3451746338:"IFCRELSPACEBOUNDARY",366585022:"IFCRELSERVICESBUILDINGS",4122056220:"IFCRELSEQUENCE",1058617721:"IFCRELSCHEDULESCOSTITEMS",1245217292:"IFCRELREFERENCEDINSPATIALSTRUCTURE",750771296:"IFCRELPROJECTSELEMENT",202636808:"IFCRELOVERRIDESPROPERTIES",2051452291:"IFCRELOCCUPIESSPACES",3268803585:"IFCRELNESTS",4189434867:"IFCRELINTERACTIONREQUIREMENTS",279856033:"IFCRELFLOWCONTROLELEMENTS",3940055652:"IFCRELFILLSELEMENT",781010003:"IFCRELDEFINESBYTYPE",4186316022:"IFCRELDEFINESBYPROPERTIES",693640335:"IFCRELDEFINES",2551354335:"IFCRELDECOMPOSES",2802773753:"IFCRELCOVERSSPACES",886880790:"IFCRELCOVERSBLDGELEMENTS",3242617779:"IFCRELCONTAINEDINSPATIALSTRUCTURE",3678494232:"IFCRELCONNECTSWITHREALIZINGELEMENTS",504942748:"IFCRELCONNECTSWITHECCENTRICITY",1638771189:"IFCRELCONNECTSSTRUCTURALMEMBER",3912681535:"IFCRELCONNECTSSTRUCTURALELEMENT",2127690289:"IFCRELCONNECTSSTRUCTURALACTIVITY",3190031847:"IFCRELCONNECTSPORTS",4201705270:"IFCRELCONNECTSPORTTOELEMENT",3945020480:"IFCRELCONNECTSPATHELEMENTS",1204542856:"IFCRELCONNECTSELEMENTS",826625072:"IFCRELCONNECTS",2851387026:"IFCRELASSOCIATESPROFILEPROPERTIES",2655215786:"IFCRELASSOCIATESMATERIAL",3840914261:"IFCRELASSOCIATESLIBRARY",982818633:"IFCRELASSOCIATESDOCUMENT",2728634034:"IFCRELASSOCIATESCONSTRAINT",919958153:"IFCRELASSOCIATESCLASSIFICATION",4095574036:"IFCRELASSOCIATESAPPROVAL",1327628568:"IFCRELASSOCIATESAPPLIEDVALUE",1865459582:"IFCRELASSOCIATES",205026976:"IFCRELASSIGNSTORESOURCE",3372526763:"IFCRELASSIGNSTOPROJECTORDER",2857406711:"IFCRELASSIGNSTOPRODUCT",4278684876:"IFCRELASSIGNSTOPROCESS",1307041759:"IFCRELASSIGNSTOGROUP",2495723537:"IFCRELASSIGNSTOCONTROL",1683148259:"IFCRELASSIGNSTOACTOR",3939117080:"IFCRELASSIGNS",3454111270:"IFCRECTANGULARTRIMMEDSURFACE",2798486643:"IFCRECTANGULARPYRAMID",2770003689:"IFCRECTANGLEHOLLOWPROFILEDEF",3219374653:"IFCPROXY",1451395588:"IFCPROPERTYSET",4194566429:"IFCPROJECTIONCURVE",103090709:"IFCPROJECT",4208778838:"IFCPRODUCT",2945172077:"IFCPROCESS",220341763:"IFCPLANE",603570806:"IFCPLANARBOX",3566463478:"IFCPERMEABLECOVERINGPROPERTIES",3505215534:"IFCOFFSETCURVE3D",3388369263:"IFCOFFSETCURVE2D",3888040117:"IFCOBJECT",1425443689:"IFCMANIFOLDSOLIDBREP",1281925730:"IFCLINE",572779678:"IFCLSHAPEPROFILEDEF",1484403080:"IFCISHAPEPROFILEDEF",987898635:"IFCGEOMETRICCURVESET",1268542332:"IFCFURNITURETYPE",4238390223:"IFCFURNISHINGELEMENTTYPE",3455213021:"IFCFLUIDFLOWPROPERTIES",315944413:"IFCFILLAREASTYLETILES",4203026998:"IFCFILLAREASTYLETILESYMBOLWITHSTYLE",374418227:"IFCFILLAREASTYLEHATCHING",2047409740:"IFCFACEBASEDSURFACEMODEL",477187591:"IFCEXTRUDEDAREASOLID",80994333:"IFCENERGYPROPERTIES",2835456948:"IFCELLIPSEPROFILEDEF",2777663545:"IFCELEMENTARYSURFACE",339256511:"IFCELEMENTTYPE",1883228015:"IFCELEMENTQUANTITY",1472233963:"IFCEDGELOOP",4006246654:"IFCDRAUGHTINGPREDEFINEDCURVEFONT",445594917:"IFCDRAUGHTINGPREDEFINEDCOLOUR",3073041342:"IFCDRAUGHTINGCALLOUT",526551008:"IFCDOORSTYLE",1714330368:"IFCDOORPANELPROPERTIES",2963535650:"IFCDOORLININGPROPERTIES",32440307:"IFCDIRECTION",4054601972:"IFCDIMENSIONCURVETERMINATOR",606661476:"IFCDIMENSIONCURVE",693772133:"IFCDEFINEDSYMBOL",2827736869:"IFCCURVEBOUNDEDPLANE",2601014836:"IFCCURVE",2147822146:"IFCCSGSOLID",2506170314:"IFCCSGPRIMITIVE3D",194851669:"IFCCRANERAILFSHAPEPROFILEDEF",4133800736:"IFCCRANERAILASHAPEPROFILEDEF",2485617015:"IFCCOMPOSITECURVESEGMENT",2205249479:"IFCCLOSEDSHELL",1383045692:"IFCCIRCLEPROFILEDEF",1416205885:"IFCCARTESIANTRANSFORMATIONOPERATOR3DNONUNIFORM",3331915920:"IFCCARTESIANTRANSFORMATIONOPERATOR3D",3486308946:"IFCCARTESIANTRANSFORMATIONOPERATOR2DNONUNIFORM",3749851601:"IFCCARTESIANTRANSFORMATIONOPERATOR2D",59481748:"IFCCARTESIANTRANSFORMATIONOPERATOR",1123145078:"IFCCARTESIANPOINT",2898889636:"IFCCSHAPEPROFILEDEF",2713105998:"IFCBOXEDHALFSPACE",2581212453:"IFCBOUNDINGBOX",4182860854:"IFCBOUNDEDSURFACE",2736907675:"IFCBOOLEANRESULT",2740243338:"IFCAXIS2PLACEMENT3D",3125803723:"IFCAXIS2PLACEMENT2D",4261334040:"IFCAXIS1PLACEMENT",1302238472:"IFCANNOTATIONSURFACE",2265737646:"IFCANNOTATIONFILLAREAOCCURRENCE",669184980:"IFCANNOTATIONFILLAREA",3288037868:"IFCANNOTATIONCURVEOCCURRENCE",2543172580:"IFCZSHAPEPROFILEDEF",1299126871:"IFCWINDOWSTYLE",512836454:"IFCWINDOWPANELPROPERTIES",336235671:"IFCWINDOWLININGPROPERTIES",2759199220:"IFCVERTEXLOOP",1417489154:"IFCVECTOR",427810014:"IFCUSHAPEPROFILEDEF",2347495698:"IFCTYPEPRODUCT",1628702193:"IFCTYPEOBJECT",1345879162:"IFCTWODIRECTIONREPEATFACTOR",2715220739:"IFCTRAPEZIUMPROFILEDEF",3124975700:"IFCTEXTLITERALWITHEXTENT",4282788508:"IFCTEXTLITERAL",3028897424:"IFCTERMINATORSYMBOL",3071757647:"IFCTSHAPEPROFILEDEF",230924584:"IFCSWEPTSURFACE",1260650574:"IFCSWEPTDISKSOLID",2247615214:"IFCSWEPTAREASOLID",1878645084:"IFCSURFACESTYLERENDERING",2513912981:"IFCSURFACE",2233826070:"IFCSUBEDGE",3653947884:"IFCSTRUCTURALSTEELPROFILEPROPERTIES",3843319758:"IFCSTRUCTURALPROFILEPROPERTIES",1190533807:"IFCSTRUCTURALLOADSINGLEFORCEWARPING",1597423693:"IFCSTRUCTURALLOADSINGLEFORCE",1973038258:"IFCSTRUCTURALLOADSINGLEDISPLACEMENTDISTORTION",2473145415:"IFCSTRUCTURALLOADSINGLEDISPLACEMENT",2668620305:"IFCSTRUCTURALLOADPLANARFORCE",1595516126:"IFCSTRUCTURALLOADLINEARFORCE",390701378:"IFCSPACETHERMALLOADPROPERTIES",1202362311:"IFCSOUNDVALUE",2485662743:"IFCSOUNDPROPERTIES",723233188:"IFCSOLIDMODEL",2609359061:"IFCSLIPPAGECONNECTIONCONDITION",4124623270:"IFCSHELLBASEDSURFACEMODEL",2411513650:"IFCSERVICELIFEFACTOR",1509187699:"IFCSECTIONEDSPINE",2778083089:"IFCROUNDEDRECTANGLEPROFILEDEF",478536968:"IFCRELATIONSHIP",3765753017:"IFCREINFORCEMENTDEFINITIONPROPERTIES",3413951693:"IFCREGULARTIMESERIES",3615266464:"IFCRECTANGLEPROFILEDEF",110355661:"IFCPROPERTYTABLEVALUE",3650150729:"IFCPROPERTYSINGLEVALUE",3357820518:"IFCPROPERTYSETDEFINITION",941946838:"IFCPROPERTYREFERENCEVALUE",2752243245:"IFCPROPERTYLISTVALUE",4166981789:"IFCPROPERTYENUMERATEDVALUE",1680319473:"IFCPROPERTYDEFINITION",871118103:"IFCPROPERTYBOUNDEDVALUE",673634403:"IFCPRODUCTDEFINITIONSHAPE",179317114:"IFCPREDEFINEDPOINTMARKERSYMBOL",433424934:"IFCPREDEFINEDDIMENSIONSYMBOL",2559016684:"IFCPREDEFINEDCURVEFONT",759155922:"IFCPREDEFINEDCOLOUR",2775532180:"IFCPOLYGONALBOUNDEDHALFSPACE",2924175390:"IFCPOLYLOOP",1423911732:"IFCPOINTONSURFACE",4022376103:"IFCPOINTONCURVE",2067069095:"IFCPOINT",1663979128:"IFCPLANAREXTENT",2004835150:"IFCPLACEMENT",597895409:"IFCPIXELTEXTURE",3021840470:"IFCPHYSICALCOMPLEXQUANTITY",2519244187:"IFCPATH",2529465313:"IFCPARAMETERIZEDPROFILEDEF",1029017970:"IFCORIENTEDEDGE",2665983363:"IFCOPENSHELL",2833995503:"IFCONEDIRECTIONREPEATFACTOR",219451334:"IFCOBJECTDEFINITION",1430189142:"IFCMECHANICALCONCRETEMATERIALPROPERTIES",2022407955:"IFCMATERIALDEFINITIONREPRESENTATION",2347385850:"IFCMAPPEDITEM",1008929658:"IFCLOOP",2624227202:"IFCLOCALPLACEMENT",3422422726:"IFCLIGHTSOURCESPOT",1520743889:"IFCLIGHTSOURCEPOSITIONAL",4266656042:"IFCLIGHTSOURCEGONIOMETRIC",2604431987:"IFCLIGHTSOURCEDIRECTIONAL",125510826:"IFCLIGHTSOURCEAMBIENT",1402838566:"IFCLIGHTSOURCE",3741457305:"IFCIRREGULARTIMESERIES",3905492369:"IFCIMAGETEXTURE",2445078500:"IFCHYGROSCOPICMATERIALPROPERTIES",812098782:"IFCHALFSPACESOLID",178086475:"IFCGRIDPLACEMENT",3590301190:"IFCGEOMETRICSET",4142052618:"IFCGEOMETRICREPRESENTATIONSUBCONTEXT",2453401579:"IFCGEOMETRICREPRESENTATIONITEM",3448662350:"IFCGEOMETRICREPRESENTATIONCONTEXT",1446786286:"IFCGENERALPROFILEPROPERTIES",803998398:"IFCGENERALMATERIALPROPERTIES",3857492461:"IFCFUELPROPERTIES",738692330:"IFCFILLAREASTYLE",4219587988:"IFCFAILURECONNECTIONCONDITION",3008276851:"IFCFACESURFACE",803316827:"IFCFACEOUTERBOUND",1809719519:"IFCFACEBOUND",2556980723:"IFCFACE",1860660968:"IFCEXTENDEDMATERIALPROPERTIES",476780140:"IFCEDGECURVE",3900360178:"IFCEDGE",4170525392:"IFCDRAUGHTINGPREDEFINEDTEXTFONT",3732053477:"IFCDOCUMENTREFERENCE",1694125774:"IFCDIMENSIONPAIR",2273265877:"IFCDIMENSIONCALLOUTRELATIONSHIP",3632507154:"IFCDERIVEDPROFILEDEF",3800577675:"IFCCURVESTYLE",2889183280:"IFCCONVERSIONBASEDUNIT",3050246964:"IFCCONTEXTDEPENDENTUNIT",45288368:"IFCCONNECTIONPOINTECCENTRICITY",1981873012:"IFCCONNECTIONCURVEGEOMETRY",370225590:"IFCCONNECTEDFACESET",1485152156:"IFCCOMPOSITEPROFILEDEF",2542286263:"IFCCOMPLEXPROPERTY",776857604:"IFCCOLOURRGB",647927063:"IFCCLASSIFICATIONREFERENCE",3150382593:"IFCCENTERLINEPROFILEDEF",616511568:"IFCBLOBTEXTURE",2705031697:"IFCARBITRARYPROFILEDEFWITHVOIDS",1310608509:"IFCARBITRARYOPENPROFILEDEF",3798115385:"IFCARBITRARYCLOSEDPROFILEDEF",2297822566:"IFCANNOTATIONTEXTOCCURRENCE",3612888222:"IFCANNOTATIONSYMBOLOCCURRENCE",962685235:"IFCANNOTATIONSURFACEOCCURRENCE",2442683028:"IFCANNOTATIONOCCURRENCE",1065908215:"IFCWATERPROPERTIES",891718957:"IFCVIRTUALGRIDINTERSECTION",1907098498:"IFCVERTEXPOINT",3304826586:"IFCVERTEXBASEDTEXTUREMAP",2799835756:"IFCVERTEX",180925521:"IFCUNITASSIGNMENT",1735638870:"IFCTOPOLOGYREPRESENTATION",1377556343:"IFCTOPOLOGICALREPRESENTATIONITEM",581633288:"IFCTIMESERIESVALUE",1718945513:"IFCTIMESERIESREFERENCERELATIONSHIP",3101149627:"IFCTIMESERIES",3317419933:"IFCTHERMALMATERIALPROPERTIES",1210645708:"IFCTEXTUREVERTEX",2552916305:"IFCTEXTUREMAP",1742049831:"IFCTEXTURECOORDINATEGENERATOR",280115917:"IFCTEXTURECOORDINATE",1484833681:"IFCTEXTSTYLEWITHBOXCHARACTERISTICS",1640371178:"IFCTEXTSTYLETEXTMODEL",2636378356:"IFCTEXTSTYLEFORDEFINEDFONT",1983826977:"IFCTEXTSTYLEFONTMODEL",1447204868:"IFCTEXTSTYLE",912023232:"IFCTELECOMADDRESS",531007025:"IFCTABLEROW",985171141:"IFCTABLE",1290481447:"IFCSYMBOLSTYLE",626085974:"IFCSURFACETEXTURE",1351298697:"IFCSURFACESTYLEWITHTEXTURES",846575682:"IFCSURFACESTYLESHADING",1607154358:"IFCSURFACESTYLEREFRACTION",3303107099:"IFCSURFACESTYLELIGHTING",1300840506:"IFCSURFACESTYLE",3049322572:"IFCSTYLEDREPRESENTATION",3958052878:"IFCSTYLEDITEM",2830218821:"IFCSTYLEMODEL",3408363356:"IFCSTRUCTURALLOADTEMPERATURE",2525727697:"IFCSTRUCTURALLOADSTATIC",2162789131:"IFCSTRUCTURALLOAD",2273995522:"IFCSTRUCTURALCONNECTIONCONDITION",3692461612:"IFCSIMPLEPROPERTY",4240577450:"IFCSHAPEREPRESENTATION",3982875396:"IFCSHAPEMODEL",867548509:"IFCSHAPEASPECT",4165799628:"IFCSECTIONREINFORCEMENTPROPERTIES",2042790032:"IFCSECTIONPROPERTIES",448429030:"IFCSIUNIT",2341007311:"IFCROOT",3679540991:"IFCRIBPLATEPROFILEPROPERTIES",1660063152:"IFCREPRESENTATIONMAP",3008791417:"IFCREPRESENTATIONITEM",3377609919:"IFCREPRESENTATIONCONTEXT",1076942058:"IFCREPRESENTATION",1222501353:"IFCRELAXATION",1580146022:"IFCREINFORCEMENTBARPROPERTIES",2692823254:"IFCREFERENCESVALUEDOCUMENT",825690147:"IFCQUANTITYWEIGHT",2405470396:"IFCQUANTITYVOLUME",3252649465:"IFCQUANTITYTIME",931644368:"IFCQUANTITYLENGTH",2093928680:"IFCQUANTITYCOUNT",2044713172:"IFCQUANTITYAREA",3710013099:"IFCPROPERTYENUMERATION",148025276:"IFCPROPERTYDEPENDENCYRELATIONSHIP",3896028662:"IFCPROPERTYCONSTRAINTRELATIONSHIP",2598011224:"IFCPROPERTY",2802850158:"IFCPROFILEPROPERTIES",3958567839:"IFCPROFILEDEF",2267347899:"IFCPRODUCTSOFCOMBUSTIONPROPERTIES",2095639259:"IFCPRODUCTREPRESENTATION",2417041796:"IFCPRESENTATIONSTYLEASSIGNMENT",3119450353:"IFCPRESENTATIONSTYLE",1304840413:"IFCPRESENTATIONLAYERWITHSTYLE",2022622350:"IFCPRESENTATIONLAYERASSIGNMENT",1775413392:"IFCPREDEFINEDTEXTFONT",3213052703:"IFCPREDEFINEDTERMINATORSYMBOL",990879717:"IFCPREDEFINEDSYMBOL",3727388367:"IFCPREDEFINEDITEM",3355820592:"IFCPOSTALADDRESS",2226359599:"IFCPHYSICALSIMPLEQUANTITY",2483315170:"IFCPHYSICALQUANTITY",101040310:"IFCPERSONANDORGANIZATION",2077209135:"IFCPERSON",1207048766:"IFCOWNERHISTORY",1411181986:"IFCORGANIZATIONRELATIONSHIP",4251960020:"IFCORGANIZATION",1227763645:"IFCOPTICALMATERIALPROPERTIES",2251480897:"IFCOBJECTIVE",3701648758:"IFCOBJECTPLACEMENT",1918398963:"IFCNAMEDUNIT",2706619895:"IFCMONETARYUNIT",3368373690:"IFCMETRIC",677618848:"IFCMECHANICALSTEELMATERIALPROPERTIES",4256014907:"IFCMECHANICALMATERIALPROPERTIES",2597039031:"IFCMEASUREWITHUNIT",3265635763:"IFCMATERIALPROPERTIES",2199411900:"IFCMATERIALLIST",1303795690:"IFCMATERIALLAYERSETUSAGE",3303938423:"IFCMATERIALLAYERSET",248100487:"IFCMATERIALLAYER",1847130766:"IFCMATERIALCLASSIFICATIONRELATIONSHIP",1838606355:"IFCMATERIAL",30780891:"IFCLOCALTIME",1566485204:"IFCLIGHTINTENSITYDISTRIBUTION",4162380809:"IFCLIGHTDISTRIBUTIONDATA",3452421091:"IFCLIBRARYREFERENCE",2655187982:"IFCLIBRARYINFORMATION",3020489413:"IFCIRREGULARTIMESERIESVALUE",852622518:"IFCGRIDAXIS",3548104201:"IFCEXTERNALLYDEFINEDTEXTFONT",3207319532:"IFCEXTERNALLYDEFINEDSYMBOL",1040185647:"IFCEXTERNALLYDEFINEDSURFACESTYLE",2242383968:"IFCEXTERNALLYDEFINEDHATCHSTYLE",3200245327:"IFCEXTERNALREFERENCE",1648886627:"IFCENVIRONMENTALIMPACTVALUE",3796139169:"IFCDRAUGHTINGCALLOUTRELATIONSHIP",770865208:"IFCDOCUMENTINFORMATIONRELATIONSHIP",1154170062:"IFCDOCUMENTINFORMATION",1376555844:"IFCDOCUMENTELECTRONICFORMAT",2949456006:"IFCDIMENSIONALEXPONENTS",1045800335:"IFCDERIVEDUNITELEMENT",1765591967:"IFCDERIVEDUNIT",1072939445:"IFCDATEANDTIME",3510044353:"IFCCURVESTYLEFONTPATTERN",2367409068:"IFCCURVESTYLEFONTANDSCALING",1105321065:"IFCCURVESTYLEFONT",539742890:"IFCCURRENCYRELATIONSHIP",602808272:"IFCCOSTVALUE",1065062679:"IFCCOORDINATEDUNIVERSALTIMEOFFSET",347226245:"IFCCONSTRAINTRELATIONSHIP",613356794:"IFCCONSTRAINTCLASSIFICATIONRELATIONSHIP",1658513725:"IFCCONSTRAINTAGGREGATIONRELATIONSHIP",1959218052:"IFCCONSTRAINT",2732653382:"IFCCONNECTIONSURFACEGEOMETRY",4257277454:"IFCCONNECTIONPORTGEOMETRY",2614616156:"IFCCONNECTIONPOINTGEOMETRY",2859738748:"IFCCONNECTIONGEOMETRY",3264961684:"IFCCOLOURSPECIFICATION",3639012971:"IFCCLASSIFICATIONNOTATIONFACET",938368621:"IFCCLASSIFICATIONNOTATION",1098599126:"IFCCLASSIFICATIONITEMRELATIONSHIP",1767535486:"IFCCLASSIFICATIONITEM",747523909:"IFCCLASSIFICATION",622194075:"IFCCALENDARDATE",2069777674:"IFCBOUNDARYNODECONDITIONWARPING",1387855156:"IFCBOUNDARYNODECONDITION",3367102660:"IFCBOUNDARYFACECONDITION",1560379544:"IFCBOUNDARYEDGECONDITION",4037036970:"IFCBOUNDARYCONDITION",3869604511:"IFCAPPROVALRELATIONSHIP",390851274:"IFCAPPROVALPROPERTYRELATIONSHIP",2080292479:"IFCAPPROVALACTORRELATIONSHIP",130549933:"IFCAPPROVAL",1110488051:"IFCAPPLIEDVALUERELATIONSHIP",411424972:"IFCAPPLIEDVALUE",639542469:"IFCAPPLICATION",618182010:"IFCADDRESS",3630933823:"IFCACTORROLE",599546466:"FILE_DESCRIPTION",1390159747:"FILE_NAME",1109904537:"FILE_SCHEMA"};class Ze{static async getUnits(e){var r,o,a;const{IFCUNITASSIGNMENT:t}=jt,s=await e.getAllPropertiesOfType(t);if(!s)return 1;const i=Object.keys(s),n=s[parseInt(i[0],10)];for(const l of n.Units){if(l.value===void 0||l.value===null)continue;const h=await e.getProperties(l.value);if(!h||!h.UnitType||!h.UnitType.value||h.UnitType.value!=="LENGTHUNIT")continue;let d=1,f=1;return h.Name.value==="METRE"&&(f=1),h.Name.value==="FOOT"&&(f=.3048),((r=h.Prefix)==null?void 0:r.value)==="MILLI"?d=.001:((o=h.Prefix)==null?void 0:o.value)==="CENTI"?d=.01:((a=h.Prefix)==null?void 0:a.value)==="DECI"&&(d=.1),f*d}return 1}static async findItemByGuid(e,t){var i;const s=e.getAllPropertiesIDs();for(const n of s){const r=await e.getProperties(n);if(r&&((i=r.GlobalId)==null?void 0:i.value)===t)return r}return null}static async getRelationMap(e,t,s){var a;const n=s??(async()=>{}),r={},o=e.getAllPropertiesIDs();for(const l of o){const h=await e.getProperties(l);if(!h)continue;const u=h.type===t,d=Object.keys(h).find(E=>E.startsWith("Relating")),f=Object.keys(h).find(E=>E.startsWith("Related"));if(!(u&&d&&f))continue;const I=await e.getProperties((a=h[d])==null?void 0:a.value),p=h[f];if(!I||!p||!(p&&Array.isArray(p)))continue;const m=p.map(E=>E.value);await n(I.expressID,m),r[I.expressID]=m}return r}static async getQsetQuantities(e,t,s){const n=s??(()=>{}),r=await e.getProperties(t);return!r||r.type!==go?null:(r.Quantities??[{}]).map(l=>(l.value&&n(l.value),l.value)).filter(l=>l!==null)}static async getPsetProps(e,t,s){const n=s??(()=>{}),r=await e.getProperties(t);return!r||r.type!==Zi?null:(r.HasProperties??[{}]).map(l=>(l.value&&n(l.value),l.value)).filter(l=>l!==null)}static async getPsetRel(e,t){var o;if(!await e.getProperties(t))return null;const i=await e.getAllPropertiesOfType(Ns);if(!i)return null;const n=Object.values(i);let r=null;for(const a of n)((o=a.RelatingPropertyDefinition)==null?void 0:o.value)===t&&(r=a.expressID);return r}static async getQsetRel(e,t){return Ze.getPsetRel(e,t)}static async getEntityName(e,t){var r;const s=await e.getProperties(t);if(!s)return{key:null,name:null};const i=Object.keys(s).find(o=>o.endsWith("Name"))??null,n=i?(r=s[i])==null?void 0:r.value:null;return{key:i,name:n}}static async getQuantityValue(e,t){const s=await e.getProperties(t);if(!s)return{key:null,value:null};const i=Object.keys(s).find(r=>r.endsWith("Value"))??null;let n;return i===null||s[i]===void 0||s[i]===null?n=null:n=s[i].value,{key:i,value:n}}static isRel(e){return Wr[e].startsWith("IFCREL")}static async attributeExists(e,t,s){const i=await e.getProperties(t);return i?Object.keys(i).includes(s):!1}static async groupEntitiesByType(e,t){var i;const s=new Map;for(const n of t){const r=await e.getProperties(n);if(!r)continue;const o=r.type;s.get(o)||s.set(o,new Set),(i=s.get(o))==null||i.add(n)}return s}}class mc{constructor(){y(this,"factor",1);y(this,"complement",1)}apply(e){const s=this.getScaleMatrix().multiply(e);e.copy(s)}setUp(e){var n,r,o;this.factor=1;const t=this.getLengthUnits(e);if(!t)return;const s=t==null,i=t.Name===void 0||t.Name===null;s||i||(t.Name.value==="FOOT"&&(this.factor=.3048),((n=t.Prefix)==null?void 0:n.value)==="MILLI"?this.complement=.001:((r=t.Prefix)==null?void 0:r.value)==="CENTI"?this.complement=.01:((o=t.Prefix)==null?void 0:o.value)==="DECI"&&(this.complement=.01))}getLengthUnits(e){try{const s=e.GetLineIDsWithType(0,To).get(0),i=e.GetLine(0,s);for(const n of i.Units){if(!n||n.value===null||n.value===void 0)continue;const r=e.GetLine(0,n.value);if(r.UnitType&&r.UnitType.value==="LENGTHUNIT")return r}return null}catch{return console.log("Could not get units"),null}}getScaleMatrix(){const e=this.factor;return new Ft().fromArray([e,0,0,0,0,e,0,0,0,0,e,0,0,0,0,1])}}class Cc{constructor(){y(this,"itemsByFloor",{});y(this,"_units",new mc)}setUp(e){this._units.setUp(e),this.cleanUp();try{const t=e.GetLineIDsWithType(0,Ai),s=new Set,i=e.GetLineIDsWithType(0,bs);for(let l=0;l0&&!o.has(r))continue;if(this.settings.excludedCategories.has(r))continue;const a=this.webIfc.GetLineIDsWithType(0,r),l=a.size();for(let h=0;h{this.getMesh(r,s)});for(const r of this._visitedFragments){const{index:o,fragment:a}=r[1];s.keyFragments.set(o,a.id)}for(const r of s.items){const o=this._fragmentInstances.get(r.id);if(!o)throw new Error("Fragment not found!");const a=[];for(const[l,h]of o)a.push(h);r.add(a)}const n=this.webIfc.GetCoordinationMatrix(0);return s.coordinationMatrix.fromArray(n),s.civilData=this._civil.read(this.webIfc),s}getMesh(t,s){const i=t.geometries.size(),n=t.expressID;for(let r=0;ro.value!==i),await t.setProperties(i,null),this.registerChange(t,s,i))}addElementToPset(t,s,...i){this.components.get(Qe).addEntitiesRelation(t,s,{type:Ns,inv:"IsDefinedBy"},...i)}async addPropToPset(t,s,...i){const n=await t.getProperties(s);if(n){for(const r of i){if(n.HasProperties.includes(r))continue;const o=new he(r);n.HasProperties.push(o),this.onPropToPset.trigger({model:t,psetID:s,propID:r})}this.registerChange(t,s)}}async createIfcRel(t,s,i,n){const r=Oc[s];if(!r)throw new Error(`IfcPropertiesManager: ${r} is unsoported.`);const o=t.ifcMetadata.schema,a=yc[r],l=jt[o][r];if(!(a&&l))throw new Error(`IfcPropertiesManager: ${r} is unsoported.`);const h=[new jt[o].IfcGloballyUniqueId(fe.create())],{related:u,relating:d}=a,I=[...new Set(n)].map(E=>new he(E)),p=(E,_)=>{for(let A=E;A<_-1;A++)h.push(null)};uparseInt(o,10)),n=s[i[0]],r=new he(n.expressID);return{ownerHistory:n,ownerHistoryHandle:r}}registerChange(t,...s){this.changeMap[t.uuid]||(this.changeMap[t.uuid]=new Set);for(const i of s)this.changeMap[t.uuid].add(i),this.onDataChanged.trigger({model:t,expressID:i})}async newSingleProperty(t,s,i,n){const r=ge.getIFCSchema(t),o=new jt[r].IfcIdentifier(i),a=new jt[r][s](n),l=new jt[r].IfcPropertySingleValue(o,null,a,null);return l.expressID=this.getNewExpressID(t),await this.setData(t,l),l}};y(ge,"uuid","58c2d9f0-183c-48d6-a402-dfcf5b9a34df");let cn=ge;const Os=class Os extends Bt{constructor(t){super(t);y(this,"onDisposed",new et);y(this,"onRelationsIndexed",new et);y(this,"relationMaps",{});y(this,"enabled",!0);y(this,"_relToAttributesMap",Or);y(this,"_inverseAttributes",["IsDecomposedBy","Decomposes","AssociatedTo","HasAssociations","ClassificationForObjects","IsGroupedBy","HasAssignments","IsDefinedBy","DefinesOcurrence","IsTypedBy","Types","Defines","ContainedInStructure","ContainsElements","HasControlElements","AssignedToFlowElement","ConnectedTo","ConnectedFrom","ReferencedBy","Declares","HasContext","Controls","IsNestedBy","Nests","DocumentRefForObjects"]);y(this,"_ifcRels",[_i,Cn,gn,Tn,Ns,_n,An,Ai,Rn,yn,On,Fn,Sn,wn,Nn]);y(this,"onFragmentsDisposed",t=>{delete this.relationMaps[t.groupID]});y(this,"_changeMap",{});y(this,"onEntitiesRelated",new et);this.components.add(Os.uuid,this),t.get(gt).onFragmentsDisposed.add(this.onFragmentsDisposed)}indexRelations(t,s,i,n){const r=Object.keys(s).find(u=>u.startsWith("Relating")),o=Object.keys(s).find(u=>u.startsWith("Related"));if(!(r&&o))return;const a=s[r].value,l=s[o].map(u=>u.value),h=this.getAttributeIndex(n);if(h!==null){let u=t.get(a);u||(u=new Map,t.set(a,u));let d=u.get(h);d||(d=[],u.set(h,d)),d.push(...l)}for(const u of l){const d=this.getAttributeIndex(i);if(d===null)continue;let f=t.get(u);f||(f=new Map,t.set(u,f));let I=f.get(d);I||(I=[],f.set(d,I)),I.push(a)}}getAttributeIndex(t){const s=this._inverseAttributes.indexOf(t);return s===-1?null:s}setRelationMap(t,s){this.relationMaps[t.uuid]=s,this.onRelationsIndexed.trigger({modelID:t.uuid,relationsMap:s})}async process(t){if(!t.hasProperties)throw new Error("FragmentsGroup properties not found");let s=this.relationMaps[t.uuid];if(s)return s;s=new Map;for(const i of this._ifcRels){const n=await t.getAllPropertiesOfType(i);if(!n)continue;const r=this._relToAttributesMap.get(i);if(!r)continue;const{forRelated:o,forRelating:a}=r;for(const l in n){const h=n[l];this.indexRelations(s,h,o,a)}}return this.setRelationMap(t,s),s}async processFromWebIfc(t,s){const i=new Map;for(const n of this._ifcRels){const r=this._relToAttributesMap.get(n);if(!r)continue;const{forRelated:o,forRelating:a}=r,l=t.GetLineIDsWithType(s,n);for(let h=0;hE.startsWith("Related")),m=I.find(E=>E.startsWith("Relating"));if(!(p&&m))continue;f[p]=[...u].map(E=>new he(E)),f[m]=new he(l),await s.setData(n,f)}else{const f=await s.createIfcRel(n,o,l,[...u]);if(!f)continue;h.relID=f.expressID}}}}addEntitiesRelation(t,s,i,...n){const{type:r,inv:o}=i,a=this.relationMaps[t.uuid];if(!a||!this._ifcRels.includes(r))return;const l=Or.get(r);if(!l)return;const{forRelated:h,forRelating:u}=l;if(!(h===o||u===o))return;let d=this._changeMap[t.uuid];d||(d=new Re,this._changeMap[t.uuid]=d);const f=u===o?[s]:n,I=h===o?[s]:n;let p=d.get(r);p||(p=new Re,p.onItemSet.add(()=>this.onEntitiesRelated.trigger({invAttribute:o,relType:r,relatingIDs:f,relatedIDs:I})),p.onItemUpdated.add(()=>this.onEntitiesRelated.trigger({invAttribute:o,relType:r,relatingIDs:f,relatedIDs:I})),d.set(r,p));for(const m of f){let E=p.get(m);E||(E={related:new Xe},p.set(m,E)),E.related.add(...I)}for(const m of f){let E=a.get(m);E||(E=new Map,a.set(m,E));const _=this.getAttributeIndex(u);if(_!==null){let A=E.get(_);A||(A=[],E.set(_,A)),A.push(...I)}}for(const m of I){let E=a.get(m);E||(E=new Map,a.set(m,E));const _=this.getAttributeIndex(h);if(_===null)continue;let A=E.get(_);A||(A=[],E.set(_,A)),A.push(...f)}}getEntityChildren(t,s,i=new Set){if(i.add(s),this.relationMaps[t.uuid]===void 0)throw new Error("The provided model has no indices. You have to generate them first.");const r=this.getEntityRelations(t,s,"IsDecomposedBy");if(r)for(const a of r)this.getEntityChildren(t,a,i);const o=this.getEntityRelations(t,s,"ContainsElements");if(o)for(const a of o)this.getEntityChildren(t,a,i);return i}};y(Os,"uuid","23a889ab-83b3-44a4-8bee-ead83438370b");let Qe=Os;const Ei=class Ei extends Bt{constructor(t){super(t);y(this,"onDisposed",new et);y(this,"onFragmentsLoaded",new et);y(this,"onFragmentsDisposed",new et);y(this,"list",new Re);y(this,"groups",new Re);y(this,"baseCoordinationModel","");y(this,"baseCoordinationMatrix",new Ft);y(this,"enabled",!0);y(this,"_loader",new xo);this.components.add(Ei.uuid,this)}get meshes(){const t=[];for(const[s,i]of this.list)t.push(i.mesh);return t}dispose(){for(const[t,s]of this.groups)s.dispose(!0);this.baseCoordinationModel="",this.groups.clear(),this.list.clear(),this.onFragmentsLoaded.reset(),this.onFragmentsDisposed.reset(),this.onDisposed.trigger(),this.onDisposed.reset()}disposeGroup(t){const{uuid:s}=t,i=[];for(const n of t.items)i.push(n.id),this.list.delete(n.id);t.dispose(!0),this.groups.delete(t.uuid),this.groups.size===0&&(this.baseCoordinationModel="",this.baseCoordinationMatrix=new Ft),this.onFragmentsDisposed.trigger({groupID:s,fragmentIDs:i})}load(t,s){const n={...{coordinate:!0},...s},{coordinate:r,name:o,properties:a,relationsMap:l}=n,h=this._loader.import(t);s&&(h.isStreamed=s.isStreamed||!1),o&&(h.name=o);for(const u of h.items)u.group=h,this.list.set(u.id,u);return r&&this.coordinate([h]),this.groups.set(h.uuid,h),a&&h.setLocalProperties(a),l&&this.components.get(Qe).setRelationMap(h,l),this.onFragmentsLoaded.trigger(h),h}export(t){return this._loader.export(t)}getModelIdMap(t){const s={};for(const i in t){const n=this.list.get(i);if(!(n&&n.group))continue;const r=n.group;r.uuid in s||(s[r.uuid]=new Set);const o=t[i];for(const a of o)s[r.uuid].add(a)}return s}modelIdToFragmentIdMap(t){let s={};for(const i in t){const n=this.groups.get(i);if(!n)continue;const r=t[i],o=n.getFragmentMap(r);s={...s,...o}}return s}guidToFragmentIdMap(t){const s={};for(const[n,r]of this.groups){n in s||(s[n]=new Set);for(const o of t){const a=r.globalToExpressIDs.get(o);a&&s[n].add(a)}}return this.modelIdToFragmentIdMap(s)}coordinate(t=Array.from(this.groups.values())){if(this.baseCoordinationModel.length===0){const i=t.pop();if(!i)return;this.baseCoordinationModel=i.uuid,this.baseCoordinationMatrix=i.coordinationMatrix.clone()}if(t.length)for(const i of t)i.coordinationMatrix.equals(this.baseCoordinationMatrix)||(i.position.set(0,0,0),i.rotation.set(0,0,0),i.scale.set(1,1,1),i.updateMatrix(),this.applyBaseCoordinateSystem(i,i.coordinationMatrix))}applyBaseCoordinateSystem(t,s){s&&t.applyMatrix4(s.clone().invert()),t.applyMatrix4(this.baseCoordinationMatrix)}clone(t,s){const i=t.cloneGroup(s);this.groups.set(i.uuid,i);for(const n of i.items)this.list.set(n.id,n);return i}};y(Ei,"uuid","fef46874-46a3-461b-8c44-2922ab77c806");let gt=Ei;function ii(c){throw new Error('Could not dynamically require "'+c+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Xr={exports:{}};/*! + +JSZip v3.10.1 - A JavaScript class for generating and reading zip files + + +(c) 2009-2016 Stuart Knightley +Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/main/LICENSE.markdown. + +JSZip uses the library pako released under the MIT license : +https://github.com/nodeca/pako/blob/main/LICENSE +*/(function(c,e){(function(t){c.exports=t()})(function(){return function t(s,i,n){function r(l,h){if(!i[l]){if(!s[l]){var u=typeof ii=="function"&ⅈif(!h&&u)return u(l,!0);if(o)return o(l,!0);var d=new Error("Cannot find module '"+l+"'");throw d.code="MODULE_NOT_FOUND",d}var f=i[l]={exports:{}};s[l][0].call(f.exports,function(I){var p=s[l][1][I];return r(p||I)},f,f.exports,t,s,i,n)}return i[l].exports}for(var o=typeof ii=="function"&&ii,a=0;a>2,f=(3&l)<<4|h>>4,I=1>6:64,p=2>4,h=(15&d)<<4|(f=o.indexOf(a.charAt(p++)))>>2,u=(3&f)<<6|(I=o.indexOf(a.charAt(p++))),_[m++]=l,f!==64&&(_[m++]=h),I!==64&&(_[m++]=u);return _}},{"./support":30,"./utils":32}],2:[function(t,s,i){var n=t("./external"),r=t("./stream/DataWorker"),o=t("./stream/Crc32Probe"),a=t("./stream/DataLengthProbe");function l(h,u,d,f,I){this.compressedSize=h,this.uncompressedSize=u,this.crc32=d,this.compression=f,this.compressedContent=I}l.prototype={getContentWorker:function(){var h=new r(n.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new a("data_length")),u=this;return h.on("end",function(){if(this.streamInfo.data_length!==u.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),h},getCompressedWorker:function(){return new r(n.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},l.createWorkerFrom=function(h,u,d){return h.pipe(new o).pipe(new a("uncompressedSize")).pipe(u.compressWorker(d)).pipe(new a("compressedSize")).withStreamInfo("compression",u)},s.exports=l},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(t,s,i){var n=t("./stream/GenericWorker");i.STORE={magic:"\0\0",compressWorker:function(){return new n("STORE compression")},uncompressWorker:function(){return new n("STORE decompression")}},i.DEFLATE=t("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(t,s,i){var n=t("./utils"),r=function(){for(var o,a=[],l=0;l<256;l++){o=l;for(var h=0;h<8;h++)o=1&o?3988292384^o>>>1:o>>>1;a[l]=o}return a}();s.exports=function(o,a){return o!==void 0&&o.length?n.getTypeOf(o)!=="string"?function(l,h,u,d){var f=r,I=d+u;l^=-1;for(var p=d;p>>8^f[255&(l^h[p])];return-1^l}(0|a,o,o.length,0):function(l,h,u,d){var f=r,I=d+u;l^=-1;for(var p=d;p>>8^f[255&(l^h.charCodeAt(p))];return-1^l}(0|a,o,o.length,0):0}},{"./utils":32}],5:[function(t,s,i){i.base64=!1,i.binary=!1,i.dir=!1,i.createFolders=!0,i.date=null,i.compression=null,i.compressionOptions=null,i.comment=null,i.unixPermissions=null,i.dosPermissions=null},{}],6:[function(t,s,i){var n=null;n=typeof Promise<"u"?Promise:t("lie"),s.exports={Promise:n}},{lie:37}],7:[function(t,s,i){var n=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",r=t("pako"),o=t("./utils"),a=t("./stream/GenericWorker"),l=n?"uint8array":"array";function h(u,d){a.call(this,"FlateWorker/"+u),this._pako=null,this._pakoAction=u,this._pakoOptions=d,this.meta={}}i.magic="\b\0",o.inherits(h,a),h.prototype.processChunk=function(u){this.meta=u.meta,this._pako===null&&this._createPako(),this._pako.push(o.transformTo(l,u.data),!1)},h.prototype.flush=function(){a.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},h.prototype.cleanUp=function(){a.prototype.cleanUp.call(this),this._pako=null},h.prototype._createPako=function(){this._pako=new r[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var u=this;this._pako.onData=function(d){u.push({data:d,meta:u.meta})}},i.compressWorker=function(u){return new h("Deflate",u)},i.uncompressWorker=function(){return new h("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(t,s,i){function n(f,I){var p,m="";for(p=0;p>>=8;return m}function r(f,I,p,m,E,_){var A,T,R=f.file,F=f.compression,w=_!==l.utf8encode,L=o.transformTo("string",_(R.name)),N=o.transformTo("string",l.utf8encode(R.name)),M=R.comment,z=o.transformTo("string",_(M)),O=o.transformTo("string",l.utf8encode(M)),P=N.length!==R.name.length,C=O.length!==M.length,v="",$="",Y="",q=R.dir,G=R.date,it={crc32:0,compressedSize:0,uncompressedSize:0};I&&!p||(it.crc32=f.crc32,it.compressedSize=f.compressedSize,it.uncompressedSize=f.uncompressedSize);var B=0;I&&(B|=8),w||!P&&!C||(B|=2048);var U=0,nt=0;q&&(U|=16),E==="UNIX"?(nt=798,U|=function(K,_t){var Pt=K;return K||(Pt=_t?16893:33204),(65535&Pt)<<16}(R.unixPermissions,q)):(nt=20,U|=function(K){return 63&(K||0)}(R.dosPermissions)),A=G.getUTCHours(),A<<=6,A|=G.getUTCMinutes(),A<<=5,A|=G.getUTCSeconds()/2,T=G.getUTCFullYear()-1980,T<<=4,T|=G.getUTCMonth()+1,T<<=5,T|=G.getUTCDate(),P&&($=n(1,1)+n(h(L),4)+N,v+="up"+n($.length,2)+$),C&&(Y=n(1,1)+n(h(z),4)+O,v+="uc"+n(Y.length,2)+Y);var J="";return J+=` +\0`,J+=n(B,2),J+=F.magic,J+=n(A,2),J+=n(T,2),J+=n(it.crc32,4),J+=n(it.compressedSize,4),J+=n(it.uncompressedSize,4),J+=n(L.length,2),J+=n(v.length,2),{fileRecord:u.LOCAL_FILE_HEADER+J+L+v,dirRecord:u.CENTRAL_FILE_HEADER+n(nt,2)+J+n(z.length,2)+"\0\0\0\0"+n(U,4)+n(m,4)+L+v+z}}var o=t("../utils"),a=t("../stream/GenericWorker"),l=t("../utf8"),h=t("../crc32"),u=t("../signature");function d(f,I,p,m){a.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=I,this.zipPlatform=p,this.encodeFileName=m,this.streamFiles=f,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}o.inherits(d,a),d.prototype.push=function(f){var I=f.meta.percent||0,p=this.entriesCount,m=this._sources.length;this.accumulate?this.contentBuffer.push(f):(this.bytesWritten+=f.data.length,a.prototype.push.call(this,{data:f.data,meta:{currentFile:this.currentFile,percent:p?(I+100*(p-m-1))/p:100}}))},d.prototype.openedSource=function(f){this.currentSourceOffset=this.bytesWritten,this.currentFile=f.file.name;var I=this.streamFiles&&!f.file.dir;if(I){var p=r(f,I,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:p.fileRecord,meta:{percent:0}})}else this.accumulate=!0},d.prototype.closedSource=function(f){this.accumulate=!1;var I=this.streamFiles&&!f.file.dir,p=r(f,I,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(p.dirRecord),I)this.push({data:function(m){return u.DATA_DESCRIPTOR+n(m.crc32,4)+n(m.compressedSize,4)+n(m.uncompressedSize,4)}(f),meta:{percent:100}});else for(this.push({data:p.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},d.prototype.flush=function(){for(var f=this.bytesWritten,I=0;I=this.index;a--)l=(l<<8)+this.byteAt(a);return this.index+=o,l},readString:function(o){return n.transformTo("string",this.readData(o))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var o=this.readInt(4);return new Date(Date.UTC(1980+(o>>25&127),(o>>21&15)-1,o>>16&31,o>>11&31,o>>5&63,(31&o)<<1))}},s.exports=r},{"../utils":32}],19:[function(t,s,i){var n=t("./Uint8ArrayReader");function r(o){n.call(this,o)}t("../utils").inherits(r,n),r.prototype.readData=function(o){this.checkOffset(o);var a=this.data.slice(this.zero+this.index,this.zero+this.index+o);return this.index+=o,a},s.exports=r},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(t,s,i){var n=t("./DataReader");function r(o){n.call(this,o)}t("../utils").inherits(r,n),r.prototype.byteAt=function(o){return this.data.charCodeAt(this.zero+o)},r.prototype.lastIndexOfSignature=function(o){return this.data.lastIndexOf(o)-this.zero},r.prototype.readAndCheckSignature=function(o){return o===this.readData(4)},r.prototype.readData=function(o){this.checkOffset(o);var a=this.data.slice(this.zero+this.index,this.zero+this.index+o);return this.index+=o,a},s.exports=r},{"../utils":32,"./DataReader":18}],21:[function(t,s,i){var n=t("./ArrayReader");function r(o){n.call(this,o)}t("../utils").inherits(r,n),r.prototype.readData=function(o){if(this.checkOffset(o),o===0)return new Uint8Array(0);var a=this.data.subarray(this.zero+this.index,this.zero+this.index+o);return this.index+=o,a},s.exports=r},{"../utils":32,"./ArrayReader":17}],22:[function(t,s,i){var n=t("../utils"),r=t("../support"),o=t("./ArrayReader"),a=t("./StringReader"),l=t("./NodeBufferReader"),h=t("./Uint8ArrayReader");s.exports=function(u){var d=n.getTypeOf(u);return n.checkSupport(d),d!=="string"||r.uint8array?d==="nodebuffer"?new l(u):r.uint8array?new h(n.transformTo("uint8array",u)):new o(n.transformTo("array",u)):new a(u)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(t,s,i){i.LOCAL_FILE_HEADER="PK",i.CENTRAL_FILE_HEADER="PK",i.CENTRAL_DIRECTORY_END="PK",i.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",i.ZIP64_CENTRAL_DIRECTORY_END="PK",i.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(t,s,i){var n=t("./GenericWorker"),r=t("../utils");function o(a){n.call(this,"ConvertWorker to "+a),this.destType=a}r.inherits(o,n),o.prototype.processChunk=function(a){this.push({data:r.transformTo(this.destType,a.data),meta:a.meta})},s.exports=o},{"../utils":32,"./GenericWorker":28}],25:[function(t,s,i){var n=t("./GenericWorker"),r=t("../crc32");function o(){n.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}t("../utils").inherits(o,n),o.prototype.processChunk=function(a){this.streamInfo.crc32=r(a.data,this.streamInfo.crc32||0),this.push(a)},s.exports=o},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(t,s,i){var n=t("../utils"),r=t("./GenericWorker");function o(a){r.call(this,"DataLengthProbe for "+a),this.propName=a,this.withStreamInfo(a,0)}n.inherits(o,r),o.prototype.processChunk=function(a){if(a){var l=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=l+a.data.length}r.prototype.processChunk.call(this,a)},s.exports=o},{"../utils":32,"./GenericWorker":28}],27:[function(t,s,i){var n=t("../utils"),r=t("./GenericWorker");function o(a){r.call(this,"DataWorker");var l=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,a.then(function(h){l.dataIsReady=!0,l.data=h,l.max=h&&h.length||0,l.type=n.getTypeOf(h),l.isPaused||l._tickAndRepeat()},function(h){l.error(h)})}n.inherits(o,r),o.prototype.cleanUp=function(){r.prototype.cleanUp.call(this),this.data=null},o.prototype.resume=function(){return!!r.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,n.delay(this._tickAndRepeat,[],this)),!0)},o.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(n.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},o.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var a=null,l=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":a=this.data.substring(this.index,l);break;case"uint8array":a=this.data.subarray(this.index,l);break;case"array":case"nodebuffer":a=this.data.slice(this.index,l)}return this.index=l,this.push({data:a,meta:{percent:this.max?this.index/this.max*100:0}})},s.exports=o},{"../utils":32,"./GenericWorker":28}],28:[function(t,s,i){function n(r){this.name=r||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}n.prototype={push:function(r){this.emit("data",r)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(r){this.emit("error",r)}return!0},error:function(r){return!this.isFinished&&(this.isPaused?this.generatedError=r:(this.isFinished=!0,this.emit("error",r),this.previous&&this.previous.error(r),this.cleanUp()),!0)},on:function(r,o){return this._listeners[r].push(o),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(r,o){if(this._listeners[r])for(var a=0;a "+r:r}},s.exports=n},{}],29:[function(t,s,i){var n=t("../utils"),r=t("./ConvertWorker"),o=t("./GenericWorker"),a=t("../base64"),l=t("../support"),h=t("../external"),u=null;if(l.nodestream)try{u=t("../nodejs/NodejsStreamOutputAdapter")}catch{}function d(I,p){return new h.Promise(function(m,E){var _=[],A=I._internalType,T=I._outputType,R=I._mimeType;I.on("data",function(F,w){_.push(F),p&&p(w)}).on("error",function(F){_=[],E(F)}).on("end",function(){try{var F=function(w,L,N){switch(w){case"blob":return n.newBlob(n.transformTo("arraybuffer",L),N);case"base64":return a.encode(L);default:return n.transformTo(w,L)}}(T,function(w,L){var N,M=0,z=null,O=0;for(N=0;N"u")i.blob=!1;else{var n=new ArrayBuffer(0);try{i.blob=new Blob([n],{type:"application/zip"}).size===0}catch{try{var r=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);r.append(n),i.blob=r.getBlob("application/zip").size===0}catch{i.blob=!1}}}try{i.nodestream=!!t("readable-stream").Readable}catch{i.nodestream=!1}},{"readable-stream":16}],31:[function(t,s,i){for(var n=t("./utils"),r=t("./support"),o=t("./nodejsUtils"),a=t("./stream/GenericWorker"),l=new Array(256),h=0;h<256;h++)l[h]=252<=h?6:248<=h?5:240<=h?4:224<=h?3:192<=h?2:1;l[254]=l[254]=1;function u(){a.call(this,"utf-8 decode"),this.leftOver=null}function d(){a.call(this,"utf-8 encode")}i.utf8encode=function(f){return r.nodebuffer?o.newBufferFrom(f,"utf-8"):function(I){var p,m,E,_,A,T=I.length,R=0;for(_=0;_>>6:(m<65536?p[A++]=224|m>>>12:(p[A++]=240|m>>>18,p[A++]=128|m>>>12&63),p[A++]=128|m>>>6&63),p[A++]=128|63&m);return p}(f)},i.utf8decode=function(f){return r.nodebuffer?n.transformTo("nodebuffer",f).toString("utf-8"):function(I){var p,m,E,_,A=I.length,T=new Array(2*A);for(p=m=0;p>10&1023,T[m++]=56320|1023&E)}return T.length!==m&&(T.subarray?T=T.subarray(0,m):T.length=m),n.applyFromCharCode(T)}(f=n.transformTo(r.uint8array?"uint8array":"array",f))},n.inherits(u,a),u.prototype.processChunk=function(f){var I=n.transformTo(r.uint8array?"uint8array":"array",f.data);if(this.leftOver&&this.leftOver.length){if(r.uint8array){var p=I;(I=new Uint8Array(p.length+this.leftOver.length)).set(this.leftOver,0),I.set(p,this.leftOver.length)}else I=this.leftOver.concat(I);this.leftOver=null}var m=function(_,A){var T;for((A=A||_.length)>_.length&&(A=_.length),T=A-1;0<=T&&(192&_[T])==128;)T--;return T<0||T===0?A:T+l[_[T]]>A?T:A}(I),E=I;m!==I.length&&(r.uint8array?(E=I.subarray(0,m),this.leftOver=I.subarray(m,I.length)):(E=I.slice(0,m),this.leftOver=I.slice(m,I.length))),this.push({data:i.utf8decode(E),meta:f.meta})},u.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:i.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},i.Utf8DecodeWorker=u,n.inherits(d,a),d.prototype.processChunk=function(f){this.push({data:i.utf8encode(f.data),meta:f.meta})},i.Utf8EncodeWorker=d},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(t,s,i){var n=t("./support"),r=t("./base64"),o=t("./nodejsUtils"),a=t("./external");function l(p){return p}function h(p,m){for(var E=0;E>8;this.dir=!!(16&this.externalFileAttributes),f==0&&(this.dosPermissions=63&this.externalFileAttributes),f==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var f=n(this.extraFields[1].value);this.uncompressedSize===r.MAX_VALUE_32BITS&&(this.uncompressedSize=f.readInt(8)),this.compressedSize===r.MAX_VALUE_32BITS&&(this.compressedSize=f.readInt(8)),this.localHeaderOffset===r.MAX_VALUE_32BITS&&(this.localHeaderOffset=f.readInt(8)),this.diskNumberStart===r.MAX_VALUE_32BITS&&(this.diskNumberStart=f.readInt(4))}},readExtraFields:function(f){var I,p,m,E=f.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});f.index+4>>6:(f<65536?d[m++]=224|f>>>12:(d[m++]=240|f>>>18,d[m++]=128|f>>>12&63),d[m++]=128|f>>>6&63),d[m++]=128|63&f);return d},i.buf2binstring=function(u){return h(u,u.length)},i.binstring2buf=function(u){for(var d=new n.Buf8(u.length),f=0,I=d.length;f>10&1023,_[I++]=56320|1023&p)}return h(_,I)},i.utf8border=function(u,d){var f;for((d=d||u.length)>u.length&&(d=u.length),f=d-1;0<=f&&(192&u[f])==128;)f--;return f<0||f===0?d:f+a[u[f]]>d?f:d}},{"./common":41}],43:[function(t,s,i){s.exports=function(n,r,o,a){for(var l=65535&n|0,h=n>>>16&65535|0,u=0;o!==0;){for(o-=u=2e3>>1:r>>>1;o[a]=r}return o}();s.exports=function(r,o,a,l){var h=n,u=l+a;r^=-1;for(var d=l;d>>8^h[255&(r^o[d])];return-1^r}},{}],46:[function(t,s,i){var n,r=t("../utils/common"),o=t("./trees"),a=t("./adler32"),l=t("./crc32"),h=t("./messages"),u=0,d=4,f=0,I=-2,p=-1,m=4,E=2,_=8,A=9,T=286,R=30,F=19,w=2*T+1,L=15,N=3,M=258,z=M+N+1,O=42,P=113,C=1,v=2,$=3,Y=4;function q(g,H){return g.msg=h[H],H}function G(g){return(g<<1)-(4g.avail_out&&(k=g.avail_out),k!==0&&(r.arraySet(g.output,H.pending_buf,H.pending_out,k,g.next_out),g.next_out+=k,H.pending_out+=k,g.total_out+=k,g.avail_out-=k,H.pending-=k,H.pending===0&&(H.pending_out=0))}function U(g,H){o._tr_flush_block(g,0<=g.block_start?g.block_start:-1,g.strstart-g.block_start,H),g.block_start=g.strstart,B(g.strm)}function nt(g,H){g.pending_buf[g.pending++]=H}function J(g,H){g.pending_buf[g.pending++]=H>>>8&255,g.pending_buf[g.pending++]=255&H}function K(g,H){var k,b,S=g.max_chain_length,x=g.strstart,X=g.prev_length,Z=g.nice_match,D=g.strstart>g.w_size-z?g.strstart-(g.w_size-z):0,j=g.window,tt=g.w_mask,Q=g.prev,rt=g.strstart+M,Et=j[x+X-1],ht=j[x+X];g.prev_length>=g.good_match&&(S>>=2),Z>g.lookahead&&(Z=g.lookahead);do if(j[(k=H)+X]===ht&&j[k+X-1]===Et&&j[k]===j[x]&&j[++k]===j[x+1]){x+=2,k++;do;while(j[++x]===j[++k]&&j[++x]===j[++k]&&j[++x]===j[++k]&&j[++x]===j[++k]&&j[++x]===j[++k]&&j[++x]===j[++k]&&j[++x]===j[++k]&&j[++x]===j[++k]&&xD&&--S!=0);return X<=g.lookahead?X:g.lookahead}function _t(g){var H,k,b,S,x,X,Z,D,j,tt,Q=g.w_size;do{if(S=g.window_size-g.lookahead-g.strstart,g.strstart>=Q+(Q-z)){for(r.arraySet(g.window,g.window,Q,Q,0),g.match_start-=Q,g.strstart-=Q,g.block_start-=Q,H=k=g.hash_size;b=g.head[--H],g.head[H]=Q<=b?b-Q:0,--k;);for(H=k=Q;b=g.prev[--H],g.prev[H]=Q<=b?b-Q:0,--k;);S+=Q}if(g.strm.avail_in===0)break;if(X=g.strm,Z=g.window,D=g.strstart+g.lookahead,j=S,tt=void 0,tt=X.avail_in,j=N)for(x=g.strstart-g.insert,g.ins_h=g.window[x],g.ins_h=(g.ins_h<=N&&(g.ins_h=(g.ins_h<=N)if(b=o._tr_tally(g,g.strstart-g.match_start,g.match_length-N),g.lookahead-=g.match_length,g.match_length<=g.max_lazy_match&&g.lookahead>=N){for(g.match_length--;g.strstart++,g.ins_h=(g.ins_h<=N&&(g.ins_h=(g.ins_h<=N&&g.match_length<=g.prev_length){for(S=g.strstart+g.lookahead-N,b=o._tr_tally(g,g.strstart-1-g.prev_match,g.prev_length-N),g.lookahead-=g.prev_length-1,g.prev_length-=2;++g.strstart<=S&&(g.ins_h=(g.ins_h<g.pending_buf_size-5&&(k=g.pending_buf_size-5);;){if(g.lookahead<=1){if(_t(g),g.lookahead===0&&H===u)return C;if(g.lookahead===0)break}g.strstart+=g.lookahead,g.lookahead=0;var b=g.block_start+k;if((g.strstart===0||g.strstart>=b)&&(g.lookahead=g.strstart-b,g.strstart=b,U(g,!1),g.strm.avail_out===0)||g.strstart-g.block_start>=g.w_size-z&&(U(g,!1),g.strm.avail_out===0))return C}return g.insert=0,H===d?(U(g,!0),g.strm.avail_out===0?$:Y):(g.strstart>g.block_start&&(U(g,!1),g.strm.avail_out),C)}),new dt(4,4,8,4,Pt),new dt(4,5,16,8,Pt),new dt(4,6,32,32,Pt),new dt(4,4,16,16,lt),new dt(8,16,32,32,lt),new dt(8,16,128,128,lt),new dt(8,32,128,256,lt),new dt(32,128,258,1024,lt),new dt(32,258,258,4096,lt)],i.deflateInit=function(g,H){return $t(g,H,_,15,8,0)},i.deflateInit2=$t,i.deflateReset=se,i.deflateResetKeep=At,i.deflateSetHeader=function(g,H){return g&&g.state?g.state.wrap!==2?I:(g.state.gzhead=H,f):I},i.deflate=function(g,H){var k,b,S,x;if(!g||!g.state||5>8&255),nt(b,b.gzhead.time>>16&255),nt(b,b.gzhead.time>>24&255),nt(b,b.level===9?2:2<=b.strategy||b.level<2?4:0),nt(b,255&b.gzhead.os),b.gzhead.extra&&b.gzhead.extra.length&&(nt(b,255&b.gzhead.extra.length),nt(b,b.gzhead.extra.length>>8&255)),b.gzhead.hcrc&&(g.adler=l(g.adler,b.pending_buf,b.pending,0)),b.gzindex=0,b.status=69):(nt(b,0),nt(b,0),nt(b,0),nt(b,0),nt(b,0),nt(b,b.level===9?2:2<=b.strategy||b.level<2?4:0),nt(b,3),b.status=P);else{var X=_+(b.w_bits-8<<4)<<8;X|=(2<=b.strategy||b.level<2?0:b.level<6?1:b.level===6?2:3)<<6,b.strstart!==0&&(X|=32),X+=31-X%31,b.status=P,J(b,X),b.strstart!==0&&(J(b,g.adler>>>16),J(b,65535&g.adler)),g.adler=1}if(b.status===69)if(b.gzhead.extra){for(S=b.pending;b.gzindex<(65535&b.gzhead.extra.length)&&(b.pending!==b.pending_buf_size||(b.gzhead.hcrc&&b.pending>S&&(g.adler=l(g.adler,b.pending_buf,b.pending-S,S)),B(g),S=b.pending,b.pending!==b.pending_buf_size));)nt(b,255&b.gzhead.extra[b.gzindex]),b.gzindex++;b.gzhead.hcrc&&b.pending>S&&(g.adler=l(g.adler,b.pending_buf,b.pending-S,S)),b.gzindex===b.gzhead.extra.length&&(b.gzindex=0,b.status=73)}else b.status=73;if(b.status===73)if(b.gzhead.name){S=b.pending;do{if(b.pending===b.pending_buf_size&&(b.gzhead.hcrc&&b.pending>S&&(g.adler=l(g.adler,b.pending_buf,b.pending-S,S)),B(g),S=b.pending,b.pending===b.pending_buf_size)){x=1;break}x=b.gzindexS&&(g.adler=l(g.adler,b.pending_buf,b.pending-S,S)),x===0&&(b.gzindex=0,b.status=91)}else b.status=91;if(b.status===91)if(b.gzhead.comment){S=b.pending;do{if(b.pending===b.pending_buf_size&&(b.gzhead.hcrc&&b.pending>S&&(g.adler=l(g.adler,b.pending_buf,b.pending-S,S)),B(g),S=b.pending,b.pending===b.pending_buf_size)){x=1;break}x=b.gzindexS&&(g.adler=l(g.adler,b.pending_buf,b.pending-S,S)),x===0&&(b.status=103)}else b.status=103;if(b.status===103&&(b.gzhead.hcrc?(b.pending+2>b.pending_buf_size&&B(g),b.pending+2<=b.pending_buf_size&&(nt(b,255&g.adler),nt(b,g.adler>>8&255),g.adler=0,b.status=P)):b.status=P),b.pending!==0){if(B(g),g.avail_out===0)return b.last_flush=-1,f}else if(g.avail_in===0&&G(H)<=G(k)&&H!==d)return q(g,-5);if(b.status===666&&g.avail_in!==0)return q(g,-5);if(g.avail_in!==0||b.lookahead!==0||H!==u&&b.status!==666){var Z=b.strategy===2?function(D,j){for(var tt;;){if(D.lookahead===0&&(_t(D),D.lookahead===0)){if(j===u)return C;break}if(D.match_length=0,tt=o._tr_tally(D,0,D.window[D.strstart]),D.lookahead--,D.strstart++,tt&&(U(D,!1),D.strm.avail_out===0))return C}return D.insert=0,j===d?(U(D,!0),D.strm.avail_out===0?$:Y):D.last_lit&&(U(D,!1),D.strm.avail_out===0)?C:v}(b,H):b.strategy===3?function(D,j){for(var tt,Q,rt,Et,ht=D.window;;){if(D.lookahead<=M){if(_t(D),D.lookahead<=M&&j===u)return C;if(D.lookahead===0)break}if(D.match_length=0,D.lookahead>=N&&0D.lookahead&&(D.match_length=D.lookahead)}if(D.match_length>=N?(tt=o._tr_tally(D,1,D.match_length-N),D.lookahead-=D.match_length,D.strstart+=D.match_length,D.match_length=0):(tt=o._tr_tally(D,0,D.window[D.strstart]),D.lookahead--,D.strstart++),tt&&(U(D,!1),D.strm.avail_out===0))return C}return D.insert=0,j===d?(U(D,!0),D.strm.avail_out===0?$:Y):D.last_lit&&(U(D,!1),D.strm.avail_out===0)?C:v}(b,H):n[b.level].func(b,H);if(Z!==$&&Z!==Y||(b.status=666),Z===C||Z===$)return g.avail_out===0&&(b.last_flush=-1),f;if(Z===v&&(H===1?o._tr_align(b):H!==5&&(o._tr_stored_block(b,0,0,!1),H===3&&(it(b.head),b.lookahead===0&&(b.strstart=0,b.block_start=0,b.insert=0))),B(g),g.avail_out===0))return b.last_flush=-1,f}return H!==d?f:b.wrap<=0?1:(b.wrap===2?(nt(b,255&g.adler),nt(b,g.adler>>8&255),nt(b,g.adler>>16&255),nt(b,g.adler>>24&255),nt(b,255&g.total_in),nt(b,g.total_in>>8&255),nt(b,g.total_in>>16&255),nt(b,g.total_in>>24&255)):(J(b,g.adler>>>16),J(b,65535&g.adler)),B(g),0=k.w_size&&(x===0&&(it(k.head),k.strstart=0,k.block_start=0,k.insert=0),j=new r.Buf8(k.w_size),r.arraySet(j,H,tt-k.w_size,k.w_size,0),H=j,tt=k.w_size),X=g.avail_in,Z=g.next_in,D=g.input,g.avail_in=tt,g.next_in=0,g.input=H,_t(k);k.lookahead>=N;){for(b=k.strstart,S=k.lookahead-(N-1);k.ins_h=(k.ins_h<>>=N=L>>>24,A-=N,(N=L>>>16&255)===0)v[h++]=65535&L;else{if(!(16&N)){if(!(64&N)){L=T[(65535&L)+(_&(1<>>=N,A-=N),A<15&&(_+=C[a++]<>>=N=L>>>24,A-=N,!(16&(N=L>>>16&255))){if(!(64&N)){L=R[(65535&L)+(_&(1<>>=N,A-=N,(N=h-u)>3,_&=(1<<(A-=M<<3))-1,n.next_in=a,n.next_out=h,n.avail_in=a>>24&255)+(O>>>8&65280)+((65280&O)<<8)+((255&O)<<24)}function _(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function A(O){var P;return O&&O.state?(P=O.state,O.total_in=O.total_out=P.total=0,O.msg="",P.wrap&&(O.adler=1&P.wrap),P.mode=I,P.last=0,P.havedict=0,P.dmax=32768,P.head=null,P.hold=0,P.bits=0,P.lencode=P.lendyn=new n.Buf32(p),P.distcode=P.distdyn=new n.Buf32(m),P.sane=1,P.back=-1,d):f}function T(O){var P;return O&&O.state?((P=O.state).wsize=0,P.whave=0,P.wnext=0,A(O)):f}function R(O,P){var C,v;return O&&O.state?(v=O.state,P<0?(C=0,P=-P):(C=1+(P>>4),P<48&&(P&=15)),P&&(P<8||15=Y.wsize?(n.arraySet(Y.window,P,C-Y.wsize,Y.wsize,0),Y.wnext=0,Y.whave=Y.wsize):(v<($=Y.wsize-Y.wnext)&&($=v),n.arraySet(Y.window,P,C-v,$,Y.wnext),(v-=$)?(n.arraySet(Y.window,P,C-v,v,0),Y.wnext=v,Y.whave=Y.wsize):(Y.wnext+=$,Y.wnext===Y.wsize&&(Y.wnext=0),Y.whave>>8&255,C.check=o(C.check,x,2,0),U=B=0,C.mode=2;break}if(C.flags=0,C.head&&(C.head.done=!1),!(1&C.wrap)||(((255&B)<<8)+(B>>8))%31){O.msg="incorrect header check",C.mode=30;break}if((15&B)!=8){O.msg="unknown compression method",C.mode=30;break}if(U-=4,g=8+(15&(B>>>=4)),C.wbits===0)C.wbits=g;else if(g>C.wbits){O.msg="invalid window size",C.mode=30;break}C.dmax=1<>8&1),512&C.flags&&(x[0]=255&B,x[1]=B>>>8&255,C.check=o(C.check,x,2,0)),U=B=0,C.mode=3;case 3:for(;U<32;){if(G===0)break t;G--,B+=v[Y++]<>>8&255,x[2]=B>>>16&255,x[3]=B>>>24&255,C.check=o(C.check,x,4,0)),U=B=0,C.mode=4;case 4:for(;U<16;){if(G===0)break t;G--,B+=v[Y++]<>8),512&C.flags&&(x[0]=255&B,x[1]=B>>>8&255,C.check=o(C.check,x,2,0)),U=B=0,C.mode=5;case 5:if(1024&C.flags){for(;U<16;){if(G===0)break t;G--,B+=v[Y++]<>>8&255,C.check=o(C.check,x,2,0)),U=B=0}else C.head&&(C.head.extra=null);C.mode=6;case 6:if(1024&C.flags&&(G<(K=C.length)&&(K=G),K&&(C.head&&(g=C.head.extra_len-C.length,C.head.extra||(C.head.extra=new Array(C.head.extra_len)),n.arraySet(C.head.extra,v,Y,K,g)),512&C.flags&&(C.check=o(C.check,v,K,Y)),G-=K,Y+=K,C.length-=K),C.length))break t;C.length=0,C.mode=7;case 7:if(2048&C.flags){if(G===0)break t;for(K=0;g=v[Y+K++],C.head&&g&&C.length<65536&&(C.head.name+=String.fromCharCode(g)),g&&K>9&1,C.head.done=!0),O.adler=C.check=0,C.mode=12;break;case 10:for(;U<32;){if(G===0)break t;G--,B+=v[Y++]<>>=7&U,U-=7&U,C.mode=27;break}for(;U<3;){if(G===0)break t;G--,B+=v[Y++]<>>=1)){case 0:C.mode=14;break;case 1:if(M(C),C.mode=20,P!==6)break;B>>>=2,U-=2;break t;case 2:C.mode=17;break;case 3:O.msg="invalid block type",C.mode=30}B>>>=2,U-=2;break;case 14:for(B>>>=7&U,U-=7&U;U<32;){if(G===0)break t;G--,B+=v[Y++]<>>16^65535)){O.msg="invalid stored block lengths",C.mode=30;break}if(C.length=65535&B,U=B=0,C.mode=15,P===6)break t;case 15:C.mode=16;case 16:if(K=C.length){if(G>>=5,U-=5,C.ndist=1+(31&B),B>>>=5,U-=5,C.ncode=4+(15&B),B>>>=4,U-=4,286>>=3,U-=3}for(;C.have<19;)C.lens[X[C.have++]]=0;if(C.lencode=C.lendyn,C.lenbits=7,k={bits:C.lenbits},H=l(0,C.lens,0,19,C.lencode,0,C.work,k),C.lenbits=k.bits,H){O.msg="invalid code lengths set",C.mode=30;break}C.have=0,C.mode=19;case 19:for(;C.have>>16&255,wt=65535&S,!((lt=S>>>24)<=U);){if(G===0)break t;G--,B+=v[Y++]<>>=lt,U-=lt,C.lens[C.have++]=wt;else{if(wt===16){for(b=lt+2;U>>=lt,U-=lt,C.have===0){O.msg="invalid bit length repeat",C.mode=30;break}g=C.lens[C.have-1],K=3+(3&B),B>>>=2,U-=2}else if(wt===17){for(b=lt+3;U>>=lt)),B>>>=3,U-=3}else{for(b=lt+7;U>>=lt)),B>>>=7,U-=7}if(C.have+K>C.nlen+C.ndist){O.msg="invalid bit length repeat",C.mode=30;break}for(;K--;)C.lens[C.have++]=g}}if(C.mode===30)break;if(C.lens[256]===0){O.msg="invalid code -- missing end-of-block",C.mode=30;break}if(C.lenbits=9,k={bits:C.lenbits},H=l(h,C.lens,0,C.nlen,C.lencode,0,C.work,k),C.lenbits=k.bits,H){O.msg="invalid literal/lengths set",C.mode=30;break}if(C.distbits=6,C.distcode=C.distdyn,k={bits:C.distbits},H=l(u,C.lens,C.nlen,C.ndist,C.distcode,0,C.work,k),C.distbits=k.bits,H){O.msg="invalid distances set",C.mode=30;break}if(C.mode=20,P===6)break t;case 20:C.mode=21;case 21:if(6<=G&&258<=it){O.next_out=q,O.avail_out=it,O.next_in=Y,O.avail_in=G,C.hold=B,C.bits=U,a(O,J),q=O.next_out,$=O.output,it=O.avail_out,Y=O.next_in,v=O.input,G=O.avail_in,B=C.hold,U=C.bits,C.mode===12&&(C.back=-1);break}for(C.back=0;dt=(S=C.lencode[B&(1<>>16&255,wt=65535&S,!((lt=S>>>24)<=U);){if(G===0)break t;G--,B+=v[Y++]<>At)])>>>16&255,wt=65535&S,!(At+(lt=S>>>24)<=U);){if(G===0)break t;G--,B+=v[Y++]<>>=At,U-=At,C.back+=At}if(B>>>=lt,U-=lt,C.back+=lt,C.length=wt,dt===0){C.mode=26;break}if(32&dt){C.back=-1,C.mode=12;break}if(64&dt){O.msg="invalid literal/length code",C.mode=30;break}C.extra=15&dt,C.mode=22;case 22:if(C.extra){for(b=C.extra;U>>=C.extra,U-=C.extra,C.back+=C.extra}C.was=C.length,C.mode=23;case 23:for(;dt=(S=C.distcode[B&(1<>>16&255,wt=65535&S,!((lt=S>>>24)<=U);){if(G===0)break t;G--,B+=v[Y++]<>At)])>>>16&255,wt=65535&S,!(At+(lt=S>>>24)<=U);){if(G===0)break t;G--,B+=v[Y++]<>>=At,U-=At,C.back+=At}if(B>>>=lt,U-=lt,C.back+=lt,64&dt){O.msg="invalid distance code",C.mode=30;break}C.offset=wt,C.extra=15&dt,C.mode=24;case 24:if(C.extra){for(b=C.extra;U>>=C.extra,U-=C.extra,C.back+=C.extra}if(C.offset>C.dmax){O.msg="invalid distance too far back",C.mode=30;break}C.mode=25;case 25:if(it===0)break t;if(K=J-it,C.offset>K){if((K=C.offset-K)>C.whave&&C.sane){O.msg="invalid distance too far back",C.mode=30;break}_t=K>C.wnext?(K-=C.wnext,C.wsize-K):C.wnext-K,K>C.length&&(K=C.length),Pt=C.window}else Pt=$,_t=q-C.offset,K=C.length;for(itw?(N=_t[Pt+m[P]],U[nt+m[P]]):(N=96,0),_=1<>q)+(A-=_)]=L<<24|N<<16|M|0,A!==0;);for(_=1<>=1;if(_!==0?(B&=_-1,B+=_):B=0,P++,--J[O]==0){if(O===v)break;O=u[d+m[P]]}if($>>7)]}function nt(S,x){S.pending_buf[S.pending++]=255&x,S.pending_buf[S.pending++]=x>>>8&255}function J(S,x,X){S.bi_valid>E-X?(S.bi_buf|=x<>E-S.bi_valid,S.bi_valid+=X-E):(S.bi_buf|=x<>>=1,X<<=1,0<--x;);return X>>>1}function Pt(S,x,X){var Z,D,j=new Array(m+1),tt=0;for(Z=1;Z<=m;Z++)j[Z]=tt=tt+X[Z-1]<<1;for(D=0;D<=x;D++){var Q=S[2*D+1];Q!==0&&(S[2*D]=_t(j[Q]++,Q))}}function lt(S){var x;for(x=0;x>1;1<=X;X--)At(S,j,X);for(D=rt;X=S.heap[1],S.heap[1]=S.heap[S.heap_len--],At(S,j,1),Z=S.heap[1],S.heap[--S.heap_max]=X,S.heap[--S.heap_max]=Z,j[2*D]=j[2*X]+j[2*Z],S.depth[D]=(S.depth[X]>=S.depth[Z]?S.depth[X]:S.depth[Z])+1,j[2*X+1]=j[2*Z+1]=D,S.heap[1]=D++,At(S,j,1),2<=S.heap_len;);S.heap[--S.heap_max]=S.heap[1],function(ht,Vt){var qe,ie,Je,Rt,Ps,Fi,ce=Vt.dyn_tree,kn=Vt.max_code,to=Vt.stat_desc.static_tree,eo=Vt.stat_desc.has_stree,so=Vt.stat_desc.extra_bits,zn=Vt.stat_desc.extra_base,ts=Vt.stat_desc.max_length,Ls=0;for(Rt=0;Rt<=m;Rt++)ht.bl_count[Rt]=0;for(ce[2*ht.heap[ht.heap_max]+1]=0,qe=ht.heap_max+1;qe>=7;D>>=1)if(1&Et&&Q.dyn_ltree[2*rt]!==0)return r;if(Q.dyn_ltree[18]!==0||Q.dyn_ltree[20]!==0||Q.dyn_ltree[26]!==0)return o;for(rt=32;rt>>3,(j=S.static_len+3+7>>>3)<=D&&(D=j)):D=j=X+5,X+4<=D&&x!==-1?b(S,x,X,Z):S.strategy===4||j===D?(J(S,2+(Z?1:0),3),se(S,z,O)):(J(S,4+(Z?1:0),3),function(Q,rt,Et,ht){var Vt;for(J(Q,rt-257,5),J(Q,Et-1,5),J(Q,ht-4,4),Vt=0;Vt>>8&255,S.pending_buf[S.d_buf+2*S.last_lit+1]=255&x,S.pending_buf[S.l_buf+S.last_lit]=255&X,S.last_lit++,x===0?S.dyn_ltree[2*X]++:(S.matches++,x--,S.dyn_ltree[2*(C[X]+u+1)]++,S.dyn_dtree[2*U(x)]++),S.last_lit===S.lit_bufsize-1},i._tr_align=function(S){J(S,2,3),K(S,A,z),function(x){x.bi_valid===16?(nt(x,x.bi_buf),x.bi_buf=0,x.bi_valid=0):8<=x.bi_valid&&(x.pending_buf[x.pending++]=255&x.bi_buf,x.bi_buf>>=8,x.bi_valid-=8)}(S)}},{"../utils/common":41}],53:[function(t,s,i){s.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(t,s,i){(function(n){(function(r,o){if(!r.setImmediate){var a,l,h,u,d=1,f={},I=!1,p=r.document,m=Object.getPrototypeOf&&Object.getPrototypeOf(r);m=m&&m.setTimeout?m:r,a={}.toString.call(r.process)==="[object process]"?function(T){process.nextTick(function(){_(T)})}:function(){if(r.postMessage&&!r.importScripts){var T=!0,R=r.onmessage;return r.onmessage=function(){T=!1},r.postMessage("","*"),r.onmessage=R,T}}()?(u="setImmediate$"+Math.random()+"$",r.addEventListener?r.addEventListener("message",A,!1):r.attachEvent("onmessage",A),function(T){r.postMessage(u+T,"*")}):r.MessageChannel?((h=new MessageChannel).port1.onmessage=function(T){_(T.data)},function(T){h.port2.postMessage(T)}):p&&"onreadystatechange"in p.createElement("script")?(l=p.documentElement,function(T){var R=p.createElement("script");R.onreadystatechange=function(){_(T),R.onreadystatechange=null,l.removeChild(R),R=null},l.appendChild(R)}):function(T){setTimeout(_,0,T)},m.setImmediate=function(T){typeof T!="function"&&(T=new Function(""+T));for(var R=new Array(arguments.length-1),F=0;F"u"?n===void 0?this:n:self)}).call(this,typeof vs<"u"?vs:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(Xr);var Fc=Xr.exports;const Fr=Uo(Fc);var Dn={},Oi={};(function(c){const e=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",t=e+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",s="["+e+"]["+t+"]*",i=new RegExp("^"+s+"$"),n=function(o,a){const l=[];let h=a.exec(o);for(;h;){const u=[];u.startIndex=a.lastIndex-h[0].length;const d=h.length;for(let f=0;f"u")};c.isExist=function(o){return typeof o<"u"},c.isEmptyObject=function(o){return Object.keys(o).length===0},c.merge=function(o,a,l){if(a){const h=Object.keys(a),u=h.length;for(let d=0;d"&&c[n]!==" "&&c[n]!==" "&&c[n]!==` +`&&c[n]!=="\r";n++)a+=c[n];if(a=a.trim(),a[a.length-1]==="/"&&(a=a.substring(0,a.length-1),n--),!xc(a)){let u;return a.trim().length===0?u="Invalid space after '<'.":u="Tag '"+a+"' is an invalid name.",Ot("InvalidTag",u,Dt(c,n))}const l=bc(c,n);if(l===!1)return Ot("InvalidAttr","Attributes for '"+a+"' have open quote.",Dt(c,n));let h=l.value;if(n=l.index,h[h.length-1]==="/"){const u=n-h.length;h=h.substring(0,h.length-1);const d=br(h,e);if(d===!0)s=!0;else return Ot(d.err.code,d.err.msg,Dt(c,u+d.err.line))}else if(o)if(l.tagClosed){if(h.trim().length>0)return Ot("InvalidTag","Closing tag '"+a+"' can't have attributes or invalid starting.",Dt(c,r));if(t.length===0)return Ot("InvalidTag","Closing tag '"+a+"' has not been opened.",Dt(c,r));{const u=t.pop();if(a!==u.tagName){let d=Dt(c,u.tagStartPos);return Ot("InvalidTag","Expected closing tag '"+u.tagName+"' (opened in line "+d.line+", col "+d.col+") instead of closing tag '"+a+"'.",Dt(c,r))}t.length==0&&(i=!0)}}else return Ot("InvalidTag","Closing tag '"+a+"' doesn't have proper closing.",Dt(c,n));else{const u=br(h,e);if(u!==!0)return Ot(u.err.code,u.err.msg,Dt(c,n-h.length+u.err.line));if(i===!0)return Ot("InvalidXml","Multiple possible root nodes found.",Dt(c,n));e.unpairedTags.indexOf(a)!==-1||t.push({tagName:a,tagStartPos:r}),s=!0}for(n++;n0)return Ot("InvalidXml","Invalid '"+JSON.stringify(t.map(n=>n.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return Ot("InvalidXml","Start tag expected.",1);return!0};function Sr(c){return c===" "||c===" "||c===` +`||c==="\r"}function wr(c,e){const t=e;for(;e5&&s==="xml")return Ot("InvalidXml","XML declaration allowed only at the start of the document.",Dt(c,e));if(c[e]=="?"&&c[e+1]==">"){e++;break}else continue}return e}function Nr(c,e){if(c.length>e+5&&c[e+1]==="-"&&c[e+2]==="-"){for(e+=3;e"){e+=2;break}}else if(c.length>e+8&&c[e+1]==="D"&&c[e+2]==="O"&&c[e+3]==="C"&&c[e+4]==="T"&&c[e+5]==="Y"&&c[e+6]==="P"&&c[e+7]==="E"){let t=1;for(e+=8;e"&&(t--,t===0))break}else if(c.length>e+9&&c[e+1]==="["&&c[e+2]==="C"&&c[e+3]==="D"&&c[e+4]==="A"&&c[e+5]==="T"&&c[e+6]==="A"&&c[e+7]==="["){for(e+=8;e"){e+=2;break}}return e}const wc='"',Nc="'";function bc(c,e){let t="",s="",i=!1;for(;e"&&s===""){i=!0;break}t+=c[e]}return s!==""?!1:{value:t,index:e,tagClosed:i}}const Pc=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function br(c,e){const t=Un.getAllMatches(c,Pc),s={};for(let i=0;i!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(c,e,t){return c}},Dc=function(c){return Object.assign({},Zr,c)};Bn.buildOptions=Dc;Bn.defaultOptions=Zr;class Uc{constructor(e){this.tagname=e,this.child=[],this[":@"]={}}add(e,t){e==="__proto__"&&(e="#__proto__"),this.child.push({[e]:t})}addChild(e){e.tagname==="__proto__"&&(e.tagname="#__proto__"),e[":@"]&&Object.keys(e[":@"]).length>0?this.child.push({[e.tagname]:e.child,":@":e[":@"]}):this.child.push({[e.tagname]:e.child})}}var Bc=Uc;const kc=Oi;function zc(c,e){const t={};if(c[e+3]==="O"&&c[e+4]==="C"&&c[e+5]==="T"&&c[e+6]==="Y"&&c[e+7]==="P"&&c[e+8]==="E"){e=e+9;let s=1,i=!1,n=!1,r="";for(;e"){if(n?c[e-1]==="-"&&c[e-2]==="-"&&(n=!1,s--):s--,s===0)break}else c[e]==="["?i=!0:r+=c[e];if(s!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:t,i:e}}function Yc(c,e){let t="";for(;e0&&i&&t[2]!==".")return c;if(!e.leadingZeros&&n.length>0&&!i&&t[1]!==".")return c;{const a=Number(t),l=""+a;return l.search(/[eE]/)!==-1||o?e.eNotation?a:c:t.indexOf(".")!==-1?l==="0"&&r===""||l===r||i&&l==="-"+r?a:c:n?r===l||i+r===l?a:c:t===l||t===i+l?a:c}}else return c}}function Jc(c){return c&&c.indexOf(".")!==-1&&(c=c.replace(/0+$/,""),c==="."?c="0":c[0]==="."?c="0"+c:c[c.length-1]==="."&&(c=c.substr(0,c.length-1))),c}var tl=qc;const $r=Oi,Is=Bc,el=$c,sl=tl;let il=class{constructor(e){this.options=e,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"Â¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(t,s)=>String.fromCharCode(Number.parseInt(s,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(t,s)=>String.fromCharCode(Number.parseInt(s,16))}},this.addExternalEntities=nl,this.parseXml=ll,this.parseTextData=rl,this.resolveNameSpace=ol,this.buildAttributesMap=cl,this.isItStopNode=fl,this.replaceEntitiesValue=ul,this.readStopNodeData=El,this.saveTextToParentTag=dl,this.addChild=hl}};function nl(c){const e=Object.keys(c);for(let t=0;t0)){r||(c=this.replaceEntitiesValue(c));const o=this.options.tagValueProcessor(e,c,t,i,n);return o==null?c:typeof o!=typeof c||o!==c?o:this.options.trimValues?hn(c,this.options.parseTagValue,this.options.numberParseOptions):c.trim()===c?hn(c,this.options.parseTagValue,this.options.numberParseOptions):c}}function ol(c){if(this.options.removeNSPrefix){const e=c.split(":"),t=c.charAt(0)==="/"?"/":"";if(e[0]==="xmlns")return"";e.length===2&&(c=t+e[1])}return c}const al=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function cl(c,e,t){if(!this.options.ignoreAttributes&&typeof c=="string"){const s=$r.getAllMatches(c,al),i=s.length,n={};for(let r=0;r",n,"Closing Tag is not closed.");let a=c.substring(n+2,o).trim();if(this.options.removeNSPrefix){const u=a.indexOf(":");u!==-1&&(a=a.substr(u+1))}this.options.transformTagName&&(a=this.options.transformTagName(a)),t&&(s=this.saveTextToParentTag(s,t,i));const l=i.substring(i.lastIndexOf(".")+1);if(a&&this.options.unpairedTags.indexOf(a)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: `);let h=0;l&&this.options.unpairedTags.indexOf(l)!==-1?(h=i.lastIndexOf(".",i.lastIndexOf(".")-1),this.tagsNodeStack.pop()):h=i.lastIndexOf("."),i=i.substring(0,h),t=this.tagsNodeStack.pop(),s="",n=o}else if(c[n+1]==="?"){let o=ln(c,n,!1,"?>");if(!o)throw new Error("Pi Tag is not closed.");if(s=this.saveTextToParentTag(s,t,i),!(this.options.ignoreDeclaration&&o.tagName==="?xml"||this.options.ignorePiTags)){const a=new Is(o.tagName);a.add(this.options.textNodeName,""),o.tagName!==o.tagExp&&o.attrExpPresent&&(a[":@"]=this.buildAttributesMap(o.tagExp,i,o.tagName)),this.addChild(t,a,i)}n=o.closeIndex+1}else if(c.substr(n+1,3)==="!--"){const o=be(c,"-->",n+4,"Comment is not closed.");if(this.options.commentPropName){const a=c.substring(n+4,o-2);s=this.saveTextToParentTag(s,t,i),t.add(this.options.commentPropName,[{[this.options.textNodeName]:a}])}n=o}else if(c.substr(n+1,2)==="!D"){const o=el(c,n);this.docTypeEntities=o.entities,n=o.i}else if(c.substr(n+1,2)==="!["){const o=be(c,"]]>",n,"CDATA is not closed.")-2,a=c.substring(n+9,o);s=this.saveTextToParentTag(s,t,i);let l=this.parseTextData(a,t.tagname,i,!0,!1,!0,!0);l==null&&(l=""),this.options.cdataPropName?t.add(this.options.cdataPropName,[{[this.options.textNodeName]:a}]):t.add(this.options.textNodeName,l),n=o+2}else{let o=ln(c,n,this.options.removeNSPrefix),a=o.tagName;const l=o.rawTagName;let h=o.tagExp,u=o.attrExpPresent,d=o.closeIndex;this.options.transformTagName&&(a=this.options.transformTagName(a)),t&&s&&t.tagname!=="!xml"&&(s=this.saveTextToParentTag(s,t,i,!1));const f=t;if(f&&this.options.unpairedTags.indexOf(f.tagname)!==-1&&(t=this.tagsNodeStack.pop(),i=i.substring(0,i.lastIndexOf("."))),a!==e.tagname&&(i+=i?"."+a:a),this.isItStopNode(this.options.stopNodes,i,a)){let I="";if(h.length>0&&h.lastIndexOf("/")===h.length-1)a[a.length-1]==="/"?(a=a.substr(0,a.length-1),i=i.substr(0,i.length-1),h=a):h=h.substr(0,h.length-1),n=o.closeIndex;else if(this.options.unpairedTags.indexOf(a)!==-1)n=o.closeIndex;else{const m=this.readStopNodeData(c,l,d+1);if(!m)throw new Error(`Unexpected end of ${l}`);n=m.i,I=m.tagContent}const p=new Is(a);a!==h&&u&&(p[":@"]=this.buildAttributesMap(h,i,a)),I&&(I=this.parseTextData(I,a,i,!0,u,!0,!0)),i=i.substr(0,i.lastIndexOf(".")),p.add(this.options.textNodeName,I),this.addChild(t,p,i)}else{if(h.length>0&&h.lastIndexOf("/")===h.length-1){a[a.length-1]==="/"?(a=a.substr(0,a.length-1),i=i.substr(0,i.length-1),h=a):h=h.substr(0,h.length-1),this.options.transformTagName&&(a=this.options.transformTagName(a));const I=new Is(a);a!==h&&u&&(I[":@"]=this.buildAttributesMap(h,i,a)),this.addChild(t,I,i),i=i.substr(0,i.lastIndexOf("."))}else{const I=new Is(a);this.tagsNodeStack.push(t),a!==h&&u&&(I[":@"]=this.buildAttributesMap(h,i,a)),this.addChild(t,I,i),t=I}s="",n=d}}else s+=c[n];return e.child};function hl(c,e,t){const s=this.options.updateTag(e.tagname,t,e[":@"]);s===!1||(typeof s=="string"&&(e.tagname=s),c.addChild(e))}const ul=function(c){if(this.options.processEntities){for(let e in this.docTypeEntities){const t=this.docTypeEntities[e];c=c.replace(t.regx,t.val)}for(let e in this.lastEntities){const t=this.lastEntities[e];c=c.replace(t.regex,t.val)}if(this.options.htmlEntities)for(let e in this.htmlEntities){const t=this.htmlEntities[e];c=c.replace(t.regex,t.val)}c=c.replace(this.ampEntity.regex,this.ampEntity.val)}return c};function dl(c,e,t,s){return c&&(s===void 0&&(s=Object.keys(e.child).length===0),c=this.parseTextData(c,e.tagname,t,!1,e[":@"]?Object.keys(e[":@"]).length!==0:!1,s),c!==void 0&&c!==""&&e.add(this.options.textNodeName,c),c=""),c}function fl(c,e,t){const s="*."+t;for(const i in c){const n=c[i];if(s===n||e===n)return!0}return!1}function pl(c,e,t=">"){let s,i="";for(let n=e;n",t,`${e} is not closed`);if(c.substring(t+2,n).trim()===e&&(i--,i===0))return{tagContent:c.substring(s,t),i:n};t=n}else if(c[t+1]==="?")t=be(c,"?>",t+1,"StopNode is not closed.");else if(c.substr(t+1,3)==="!--")t=be(c,"-->",t+3,"StopNode is not closed.");else if(c.substr(t+1,2)==="![")t=be(c,"]]>",t,"StopNode is not closed.")-2;else{const n=ln(c,t,">");n&&((n&&n.tagName)===e&&n.tagExp[n.tagExp.length-1]!=="/"&&i++,t=n.closeIndex)}}function hn(c,e,t){if(e&&typeof c=="string"){const s=c.trim();return s==="true"?!0:s==="false"?!1:sl(c,t)}else return $r.isExist(c)?c:""}var Il=il,jr={};function ml(c,e){return Qr(c,e)}function Qr(c,e,t){let s;const i={};for(let n=0;n0&&(i[e.textNodeName]=s):s!==void 0&&(i[e.textNodeName]=s),i}function Cl(c){const e=Object.keys(c);for(let t=0;t0&&(t=Sl),Kr(c,e,"",t)}function Kr(c,e,t,s){let i="",n=!1;for(let r=0;r`,n=!1;continue}else if(a===e.commentPropName){i+=s+``,n=!0;continue}else if(a[0]==="?"){const I=Pr(o[":@"],e),p=a==="?xml"?"":s;let m=o[a][0][e.textNodeName];m=m.length!==0?" "+m:"",i+=p+`<${a}${m}${I}?>`,n=!0;continue}let h=s;h!==""&&(h+=e.indentBy);const u=Pr(o[":@"],e),d=s+`<${a}${u}`,f=Kr(o[a],e,l,h);e.unpairedTags.indexOf(a)!==-1?e.suppressUnpairedNode?i+=d+">":i+=d+"/>":(!f||f.length===0)&&e.suppressEmptyNode?i+=d+"/>":f&&f.endsWith(">")?i+=d+`>${f}${s}`:(i+=d+">",f&&s!==""&&(f.includes("/>")||f.includes("`),n=!0}return i}function Nl(c){const e=Object.keys(c);for(let t=0;t0&&e.processEntities)for(let t=0;t","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("'","g"),val:"'"},{regex:new RegExp('"',"g"),val:"""}],processEntities:!0,stopNodes:[],oneListGroup:!1};function ye(c){this.options=Object.assign({},Ml,c),this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=Dl),this.processTextOrObjNode=vl,this.options.format?(this.indentate=xl,this.tagEndChar=`> +`,this.newLine=` +`):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}ye.prototype.build=function(c){return this.options.preserveOrder?Ll(c,this.options):(Array.isArray(c)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(c={[this.options.arrayNodeName]:c}),this.j2x(c,0).val)};ye.prototype.j2x=function(c,e){let t="",s="";for(let i in c)if(Object.prototype.hasOwnProperty.call(c,i))if(typeof c[i]>"u")this.isAttribute(i)&&(s+="");else if(c[i]===null)this.isAttribute(i)?s+="":i[0]==="?"?s+=this.indentate(e)+"<"+i+"?"+this.tagEndChar:s+=this.indentate(e)+"<"+i+"/"+this.tagEndChar;else if(c[i]instanceof Date)s+=this.buildTextValNode(c[i],i,"",e);else if(typeof c[i]!="object"){const n=this.isAttribute(i);if(n)t+=this.buildAttrPairStr(n,""+c[i]);else if(i===this.options.textNodeName){let r=this.options.tagValueProcessor(i,""+c[i]);s+=this.replaceEntitiesValue(r)}else s+=this.buildTextValNode(c[i],i,"",e)}else if(Array.isArray(c[i])){const n=c[i].length;let r="",o="";for(let a=0;a"u"))if(l===null)i[0]==="?"?s+=this.indentate(e)+"<"+i+"?"+this.tagEndChar:s+=this.indentate(e)+"<"+i+"/"+this.tagEndChar;else if(typeof l=="object")if(this.options.oneListGroup){const h=this.j2x(l,e+1);r+=h.val,this.options.attributesGroupName&&l.hasOwnProperty(this.options.attributesGroupName)&&(o+=h.attrStr)}else r+=this.processTextOrObjNode(l,i,e);else if(this.options.oneListGroup){let h=this.options.tagValueProcessor(i,l);h=this.replaceEntitiesValue(h),r+=h}else r+=this.buildTextValNode(l,i,"",e)}this.options.oneListGroup&&(r=this.buildObjectNode(r,i,o,e)),s+=r}else if(this.options.attributesGroupName&&i===this.options.attributesGroupName){const n=Object.keys(c[i]),r=n.length;for(let o=0;o"+c+i:this.options.commentPropName!==!1&&e===this.options.commentPropName&&n.length===0?this.indentate(s)+``+this.newLine:this.indentate(s)+"<"+e+t+n+this.tagEndChar+c+this.indentate(s)+i}};ye.prototype.closeTag=function(c){let e="";return this.options.unpairedTags.indexOf(c)!==-1?this.options.suppressUnpairedNode||(e="/"):this.options.suppressEmptyNode?e="/":e=`>`+this.newLine;if(this.options.commentPropName!==!1&&e===this.options.commentPropName)return this.indentate(s)+``+this.newLine;if(e[0]==="?")return this.indentate(s)+"<"+e+t+"?"+this.tagEndChar;{let i=this.options.tagValueProcessor(e,c);return i=this.replaceEntitiesValue(i),i===""?this.indentate(s)+"<"+e+t+this.closeTag(e)+this.tagEndChar:this.indentate(s)+"<"+e+t+">"+i+"0&&this.options.processEntities)for(let e=0;e`);let t=null;this.modifiedDate&&(t=`${this.modifiedDate.toISOString()}`);let s=null;return this.modifiedAuthor&&(s=`${this.modifiedAuthor}`),` + + ${this.date.toISOString()} + ${this.author} + ${this.comment} + ${e??""} + ${s??""} + ${t??""} + + `}}const ae=class ae{constructor(e){y(this,"guid",fe.create());y(this,"title",ae.default.title);y(this,"creationDate",new Date);y(this,"creationAuthor","");y(this,"viewpoints",new Xe);y(this,"relatedTopics",new Xe);y(this,"comments",new Re);y(this,"customData",{});y(this,"description");y(this,"serverAssignedId");y(this,"dueDate");y(this,"modifiedAuthor");y(this,"modifiedDate");y(this,"index");y(this,"_type",ae.default.type);y(this,"_status",ae.default.status);y(this,"_priority",ae.default.priority);y(this,"_stage",ae.default.priority);y(this,"_assignedTo",ae.default.assignedTo);y(this,"_labels",ae.default.labels);y(this,"_components");this._components=e;const t=e.get(bt);this.creationAuthor=t.config.author,this.relatedTopics.guard=s=>s!==this.guid}set type(e){const t=this._components.get(bt),{strict:s,types:i}=t.config;(!s||i.has(e))&&(this._type=e)}get type(){return this._type}set status(e){const t=this._components.get(bt),{strict:s,statuses:i}=t.config;(!s||i.has(e))&&(this._status=e)}get status(){return this._status}set priority(e){const t=this._components.get(bt);if(e){const{strict:s,priorities:i}=t.config;if(!(s?i.has(e):!0))return;this._priority=e}else this._priority=e}get priority(){return this._priority}set stage(e){const t=this._components.get(bt);if(e){const{strict:s,stages:i}=t.config;if(!(s?i.has(e):!0))return;this._stage=e}else this._stage=e}get stage(){return this._stage}set assignedTo(e){const t=this._components.get(bt);if(e){const{strict:s,users:i}=t.config;if(!(s?i.has(e):!0))return;this._assignedTo=e}else this._assignedTo=e}get assignedTo(){return this._assignedTo}set labels(e){const t=this._components.get(bt),{strict:s,labels:i}=t.config;if(s){const n=new Set;for(const r of e)(!s||i.has(r))&&n.add(r);this._labels=n}else this._labels=e}get labels(){return this._labels}get _managerVersion(){return this._components.get(bt).config.version}set(e){const t=e,s=this;for(const n in e){if(n==="guid")continue;const r=t[n];n in this&&(s[n]=r)}return this._components.get(bt).list.set(this.guid,this),this}createComment(e,t){const s=new un(this._components,e);return s.viewpoint=t,s.topic=this,this.comments.set(s.guid,s),s}createLabelTags(e=this._managerVersion){let t="Labels";e==="2.1"&&(t="Labels"),e==="3"&&(t="Label");let s=[...this.labels].map(i=>`<${t}>${i}`).join(` +`);for(const i in this.customData){const n=this.customData[i];typeof n=="string"&&(s+=` +<${t}>${n}`)}return e==="2.1"?s:e==="3"?s.length!==0?` +${s} +`:"":s}createCommentTags(e=this._managerVersion){const t=[...this.comments.values()].map(s=>s.serialize()).join(` +`);return e==="2.1"?t:e==="3"?t.length!==0?` +${t} +`:"":t}createViewpointTags(e=this._managerVersion){let t="Viewpoints";e==="2.1"&&(t="Viewpoints"),e==="3"&&(t="ViewPoint");const s=this._components.get(te),n=[...this.viewpoints].map(r=>s.list.get(r)).filter(r=>r).map(r=>`<${t} Guid="${r.guid}"> + ${r.guid}.bcfv + ${r.guid}.jpeg + + `).join(` +`);return e==="2.1"?n:e==="3"?n.length!==0?` +${n} +`:"":n}createRelatedTopicTags(e=this._managerVersion){const t=[...this.relatedTopics].map(s=>` + `).join(` +`);return e==="2.1"?t:e==="3"?t.length!==0?` +${t} +`:"":t}serialize(){const e=this._managerVersion;let t=null;this.serverAssignedId&&(t=`ServerAssignedId="${this.serverAssignedId}"`);let s=null;this.priority&&(s=`${this.priority}`);let i=null;this.index&&e==="2.1"&&(i=`${this.index}`);let n=null;this.modifiedDate&&(n=`${this.modifiedDate.toISOString()}`);let r=null;this.modifiedAuthor&&(r=`${this.modifiedAuthor}`);let o=null;this.dueDate&&(o=`${this.dueDate.toISOString()}`);let a=null;this.assignedTo&&(a=`${this.assignedTo}`);let l=null;this.description&&(l=`${this.description}`);let h=null;this.stage&&(h=`${this.stage}`);const u=this.createCommentTags(e),d=this.createViewpointTags(e),f=this.createLabelTags(e),I=this.createRelatedTopicTags(e);return` + + + + ${this.title} + ${this.creationDate.toISOString()} + ${this.creationAuthor} + ${s??""} + ${i??""} + ${n??""} + ${r??""} + ${o??""} + ${a??""} + ${l??""} + ${h??""} + ${f} + ${I} + ${e==="3"?u:""} + ${e==="3"?d:""} + + ${e==="2.1"?u:""} + ${e==="2.1"?d:""} + + `}};y(ae,"default",{title:"BCF Topic",type:"Issue",status:"Active",labels:new Set});let li=ae;const Vl=(c,e)=>{if(e.trim()==="")return;const t=bt.xmlParser.parse(e).Extensions;if(!t)return;const{Priorities:s,TopicStatuses:i,TopicTypes:n,Users:r}=t;if(s&&s.Priority){const o=Array.isArray(s.Priority)?s.Priority:[s.Priority];for(const a of o)c.config.priorities.add(a)}if(i&&i.TopicStatus){const o=Array.isArray(i.TopicStatus)?i.TopicStatus:[i.TopicStatus];for(const a of o)c.config.statuses.add(a)}if(n&&n.TopicType){const o=Array.isArray(n.TopicType)?n.TopicType:[n.TopicType];for(const a of o)c.config.types.add(a)}if(r&&r.User){const o=Array.isArray(r.User)?r.User:[r.User];for(const a of o)c.config.users.add(a)}},Ne=class Ne extends Bt{constructor(){super(...arguments);y(this,"enabled",!1);y(this,"config",{author:"jhon.doe@example.com",version:"2.1",types:new Set(["Clash","Failure","Fault","Inquiry","Issue","Remark","Request"]),statuses:new Set(["Active","In Progress","Done","In Review","Closed"]),priorities:new Set(["On hold","Minor","Normal","Major","Critical"]),labels:new Set,stages:new Set,users:new Set,includeSelectionTag:!1,updateExtensionsOnImport:!0,strict:!1,includeAllExtensionsOnExport:!0,fallbackVersionOnImport:"2.1",ignoreIncompleteTopicsOnImport:!1});y(this,"list",new Re);y(this,"onSetup",new et);y(this,"isSetup",!1);y(this,"onBCFImported",new et);y(this,"onDisposed",new et)}setup(t){this.isSetup||(this.config={...this.config,...t},this.isSetup=!0,this.enabled=!0,this.onSetup.trigger())}create(t){const s=new li(this.components);return t&&(s.guid=t.guid??s.guid,s.set(t)),this.list.set(s.guid,s),s}dispose(){this.list.dispose(),this.onDisposed.trigger(),this.onDisposed.reset()}get usedTypes(){const t=[...this.list].map(([s,i])=>i.type);return new Set(t)}get usedStatuses(){const t=[...this.list].map(([s,i])=>i.status);return new Set(t)}get usedPriorities(){const t=[...this.list].map(([s,i])=>i.priority).filter(s=>s);return new Set(t)}get usedStages(){const t=[...this.list].map(([s,i])=>i.stage).filter(s=>s);return new Set(t)}get usedUsers(){const t=[];for(const[s,i]of this.list){t.push(i.creationAuthor),i.assignedTo&&t.push(i.assignedTo),i.modifiedAuthor&&t.push(i.modifiedAuthor);for(const[n,r]of i.comments)t.push(r.author),r.modifiedAuthor&&t.push(r.modifiedAuthor)}return new Set(t)}get usedLabels(){const t=[];for(const[s,i]of this.list)t.push(...i.labels);return new Set(t)}updateExtensions(){for(const[t,s]of this.list){for(const i of s.labels)this.config.labels.add(i);this.config.types.add(s.type),s.priority&&this.config.priorities.add(s.priority),s.stage&&this.config.stages.add(s.stage),this.config.statuses.add(s.status),this.config.users.add(s.creationAuthor),s.assignedTo&&this.config.users.add(s.assignedTo),s.modifiedAuthor&&this.config.users.add(s.modifiedAuthor);for(const[i,n]of s.comments)this.config.users.add(n.author),n.modifiedAuthor&&this.config.users.add(n.modifiedAuthor)}}updateViewpointReferences(){const t=this.components.get(te);for(const[s,i]of this.list)for(const n of i.viewpoints)t.list.has(n)||i.viewpoints.delete(n)}async export(t=this.list.values()){const s=new Fr;s.file("bcf.version",` + + `),s.file("bcf.extensions",this.serializeExtensions());const n=await(await fetch("https://thatopen.github.io/engine_components/resources/favicon.ico")).blob(),r=this.components.get(te);for(const a of t){const l=s.folder(a.guid);l.file("markup.bcf",a.serialize());for(const h of a.viewpoints){const u=r.list.get(h);u&&(l.file(`${h}.jpeg`,n,{binary:!0}),l.file(`${h}.bcfv`,await u.serialize()))}}return await s.generateAsync({type:"blob"})}serializeExtensions(){const t=[...this.config.types].map(a=>`${a}`).join(` +`),s=[...this.config.statuses].map(a=>`${a}`).join(` +`),i=[...this.config.priorities].map(a=>`${a}`).join(` +`),n=[...this.config.labels].map(a=>`${a}`).join(` +`),r=[...this.config.stages].map(a=>`${a}`).join(` +`),o=[...this.config.users].map(a=>`${a}`).join(` +`);return` + + + ${t.length!==0?` +${t} +`:""} + ${s.length!==0?` +${s} +`:""} + ${i.length!==0?` +${i} +`:""} + ${n.length!==0?` +${n} +`:""} + ${r.length!==0?` +${r} +`:""} + ${o.length!==0?` +${o} +`:""} + + `}processMarkupComment(t){const{Guid:s,Date:i,Author:n,Comment:r,Viewpoint:o}=t;if(!(s&&i&&n&&(un||o)))return null;const a=this.components.get(te),l=new un(this.components,r??"");return l.guid=s,l.date=new Date(i),l.author=n,l.viewpoint=o!=null&&o.Guid?a.list.get(o.Guid):void 0,l.modifiedAuthor=t.ModifiedAuthor,l.modifiedDate=t.ModifiedDate?new Date(t.ModifiedDate):void 0,l}getMarkupComments(t,s){var o;let i;if(s==="2.1"&&(i=t.Comment),s==="3"&&(i=(o=t.Topic.Comments)==null?void 0:o.Comment),!i)return[];i=Array.isArray(i)?i:[i];const n=i.map(a=>this.processMarkupComment(a)).filter(a=>a);return Array.isArray(n)?n:[n]}getMarkupLabels(t,s){var r;let i;return s==="2.1"&&(i=t.Topic.Labels),s==="3"&&(i=(r=t.Topic.Labels)==null?void 0:r.Label),i?Array.isArray(i)?i:[i]:[]}getMarkupViewpoints(t,s){var n;let i;return s==="2.1"&&(i=t.Viewpoints),s==="3"&&(i=(n=t.Topic.Viewpoints)==null?void 0:n.ViewPoint),i?(i=Array.isArray(i)?i:[i],i):[]}getMarkupRelatedTopics(t,s){var r;let i;return s==="2.1"&&(i=t.Topic.RelatedTopic),s==="3"&&(i=(r=t.Topic.RelatedTopics)==null?void 0:r.RelatedTopic),i?(Array.isArray(i)?i:[i]).map(o=>o.Guid):[]}async load(t,s){var _;const{fallbackVersionOnImport:i,ignoreIncompleteTopicsOnImport:n,updateExtensionsOnImport:r}=this.config,o=new Fr;await o.loadAsync(t);const a=Object.values(o.files);let l=i;const h=a.find(A=>A.name.endsWith(".version"));if(h){const A=await h.async("string"),T=Ne.xmlParser.parse(A).Version.VersionId;l=String(T)}if(!(l&&(l==="2.1"||l==="3")))throw new Error(`BCFTopics: ${l} is not supported.`);const u=a.find(A=>A.name.endsWith(".extensions"));if(r&&u){const A=await u.async("string");Vl(this,A)}const d=[],f=this.components.get(te),I=a.filter(A=>A.name.endsWith(".bcfv"));for(const A of I){const T=await A.async("string"),R=Ne.xmlParser.parse(T).VisualizationInfo;if(!R){console.warn("Missing VisualizationInfo in Viewpoint");continue}const F={},{Guid:w,ClippingPlanes:L,Components:N,OrthogonalCamera:M,PerspectiveCamera:z}=R;if(w&&(F.guid=w),N){const{Selection:P,Visibility:C}=N;if(P&&P.Component){const $=Array.isArray(P.Component)?P.Component:[P.Component];F.selectionComponents=$.map(Y=>Y.IfcGuid).filter(Y=>Y)}if(C&&"DefaultVisibility"in C&&(F.defaultVisibility=C.DefaultVisibility),C&&C.Exceptions&&"Component"in C.Exceptions){const{Component:$}=C.Exceptions,Y=Array.isArray($)?$:[$];F.exceptionComponents=Y.map(q=>q.IfcGuid).filter(q=>q)}let v;l==="2.1"&&(v=N.ViewSetupHints),l==="3"&&(v=(_=N.Visibility)==null?void 0:_.ViewSetupHints),v&&("OpeningsVisible"in v&&(F.openingsVisible=v.OpeningsVisible),"SpacesVisible"in v&&(F.spacesVisible=v.SpacesVisible),"SpaceBoundariesVisible"in v&&(F.spaceBoundariesVisible=v.SpaceBoundariesVisible))}if(M||z){const P=R.PerspectiveCamera??R.OrthogonalCamera,{CameraViewPoint:C,CameraDirection:v}=P,$=new W(Number(C.X),Number(C.Z),Number(-C.Y)),Y=new W(Number(v.X),Number(v.Z),Number(-v.Y)),q={position:{x:$.x,y:$.y,z:$.z},direction:{x:Y.x,y:Y.y,z:Y.z},aspectRatio:"AspectRatio"in P?P.AspectRatio:1};"ViewToWorldScale"in P&&(F.camera={...q,viewToWorldScale:P.ViewToWorldScale}),"FieldOfView"in P&&(F.camera={...q,fov:P.FieldOfView})}const O=new Jr(this.components,s,{data:F,setCamera:!1});if(N){const{Coloring:P}=N;if(P&&P.Color){const C=Array.isArray(P.Color)?P.Color:[P.Color];for(const v of C){const{Color:$,Component:Y}=v,G=(Array.isArray(Y)?Y:[Y]).map(it=>it.IfcGuid);O.componentColors.set($,G)}}}if(d.push(O),L){const P=this.components.get(rn),C=Array.isArray(L.ClippingPlane)?L.ClippingPlane:[L.ClippingPlane];for(const v of C){const{Location:$,Direction:Y}=v;if(!($&&Y))continue;const q=new W($.X,$.Z,-$.Y),G=new W(Y.X,-Y.Z,Y.Y),it=P.createFromNormalAndCoplanarPoint(s,G,q);it.visible=!1,it.enabled=!1,O.clippingPlanes.add(it)}}}const p={},m=[],E=a.filter(A=>A.name.endsWith(".bcf"));for(const A of E){const T=await A.async("string"),R=Ne.xmlParser.parse(T).Markup,F=R.Topic,{Guid:w,TopicType:L,TopicStatus:N,Title:M,CreationDate:z,CreationAuthor:O}=F;if(n&&!(w&&L&&N&&M&&z&&O))continue;const P=new li(this.components);P.guid=w??P.guid;const C=this.getMarkupRelatedTopics(R,l);p[P.guid]=new Set(C),P.type=L??P.type,P.status=N??P.status,P.title=M??P.title,P.creationDate=z?new Date(z):P.creationDate,P.creationAuthor=O??P.creationAuthor,P.serverAssignedId=F.ServerAssignedId,P.priority=F.Priority,P.index=F.Index,P.modifiedDate=F.ModifiedDate?new Date(F.ModifiedDate):void 0,P.modifiedAuthor=F.ModifiedAuthor,P.dueDate=F.DueDate?new Date(F.DueDate):void 0,P.assignedTo=F.AssignedTo,P.description=F.Description,P.stage=F.Stage;const v=this.getMarkupLabels(R,l);for(const q of v)P.labels.add(q);const $=this.getMarkupComments(R,l);for(const q of $)P.comments.set(q.guid,q);const Y=this.getMarkupViewpoints(R,l);for(const q of Y){if(!(q&&q.Guid))continue;const G=f.list.get(q.Guid);G&&P.viewpoints.add(G.guid)}this.list.set(P.guid,P),m.push(P)}for(const A in p){const T=this.list.get(A);if(!T)continue;const R=p[A];for(const F of R)T.relatedTopics.add(F)}return this.onBCFImported.trigger(m),{viewpoints:d,topics:m}}};y(Ne,"uuid","de977976-e4f6-4e4f-a01a-204727839802"),y(Ne,"xmlParser",new Yl.XMLParser({allowBooleanAttributes:!0,attributeNamePrefix:"",ignoreAttributes:!1,ignoreDeclaration:!0,ignorePiTags:!0,numberParseOptions:{leadingZeros:!0,hex:!0},parseAttributeValue:!0,preserveOrder:!1,processEntities:!1,removeNSPrefix:!0,trimValues:!0}));let bt=Ne;const qt=class qt extends Bt{constructor(t){super(t);y(this,"enabled",!0);y(this,"onDisposed",new et);y(this,"_absoluteMin");y(this,"_absoluteMax");y(this,"_meshes",[]);this.components.add(qt.uuid,this),this._absoluteMin=qt.newBound(!0),this._absoluteMax=qt.newBound(!1)}static getDimensions(t){const{min:s,max:i}=t,n=Math.abs(i.x-s.x),r=Math.abs(i.y-s.y),o=Math.abs(i.z-s.z),a=new W;return a.subVectors(i,s).divideScalar(2).add(s),{width:n,height:r,depth:o,center:a}}static newBound(t){const s=t?1:-1;return new W(s*Number.MAX_VALUE,s*Number.MAX_VALUE,s*Number.MAX_VALUE)}static getBounds(t,s,i){const n=i||this.newBound(!1),r=s||this.newBound(!0);for(const o of t)o.xn.x&&(n.x=o.x),o.y>n.y&&(n.y=o.y),o.z>n.z&&(n.z=o.z);return new Nt(s,i)}dispose(){const t=this.components.get(je);for(const s of this._meshes)t.destroy(s);this._meshes=[],this.onDisposed.trigger(qt.uuid),this.onDisposed.reset()}get(){const t=this._absoluteMin.clone(),s=this._absoluteMax.clone();return new Nt(t,s)}getSphere(){const t=this._absoluteMin.clone(),s=this._absoluteMax.clone(),i=Math.abs((s.x-t.x)/2),n=Math.abs((s.y-t.y)/2),r=Math.abs((s.z-t.z)/2),o=new W(t.x+i,t.y+n,t.z+r),a=o.distanceTo(t);return new gi(o,a)}getMesh(){const t=new Nt(this._absoluteMin,this._absoluteMax),s=qt.getDimensions(t),{width:i,height:n,depth:r,center:o}=s,a=new Lt(i,n,r),l=new st(a);return this._meshes.push(l),l.position.copy(o),l}reset(){this._absoluteMin=qt.newBound(!0),this._absoluteMax=qt.newBound(!1)}add(t){for(const s of t.items)this.addMesh(s.mesh)}addMesh(t,s){if(!t.geometry.index)return;const i=qt.getFragmentBounds(t);t.updateMatrixWorld();const n=t.matrixWorld,r=new Ft,o=t instanceof oi,a=new Set;if(t instanceof Do){s||(s=t.fragment.ids);for(const l of s){const h=t.fragment.getInstancesIDs(l);if(h)for(const u of h)a.add(u)}}else a.add(0);for(const l of a){const h=i.min.clone(),u=i.max.clone();o&&(t.getMatrixAt(l,r),h.applyMatrix4(r),u.applyMatrix4(r)),h.applyMatrix4(n),u.applyMatrix4(n),h.xthis._absoluteMax.x&&(this._absoluteMax.x=h.x),h.y>this._absoluteMax.y&&(this._absoluteMax.y=h.y),h.z>this._absoluteMax.z&&(this._absoluteMax.z=h.z),u.x>this._absoluteMax.x&&(this._absoluteMax.x=u.x),u.y>this._absoluteMax.y&&(this._absoluteMax.y=u.y),u.z>this._absoluteMax.z&&(this._absoluteMax.z=u.z),u.xo.x&&(o.x=u),d>o.y&&(o.y=d),f>o.z&&(o.z=f)}return new Nt(r,o)}};y(qt,"uuid","d1444724-dba6-4cdd-a0c7-68ee1450d166");let dn=qt;const Ii=class Ii extends Bt{constructor(t){super(t);y(this,"enabled",!0);y(this,"list",{});y(this,"onDisposed",new et);y(this,"onFragmentsDisposed",t=>{const{groupID:s,fragmentIDs:i}=t;for(const n in this.list){const r=this.list[n],o=Object.keys(r);if(o.includes(s))delete r[s],Object.values(r).length===0&&delete this.list[n];else for(const a of o){const l=r[a];for(const h of i)delete l.map[h];Object.values(l).length===0&&delete r[a]}}});t.add(Ii.uuid,this),t.get(gt).onFragmentsDisposed.add(this.onFragmentsDisposed)}dispose(){this.list={},this.components.get(gt).onFragmentsDisposed.remove(this.onFragmentsDisposed),this.onDisposed.trigger(),this.onDisposed.reset()}remove(t){for(const s in this.list){const i=this.list[s];for(const n in i){const r=i[n];delete r.map[t]}}}find(t){const s=this.components.get(gt);if(!t){const o={};for(const[a,l]of s.list)o[a]=new Set(l.ids);return o}const i=Object.keys(t).length,n={};for(const o in t){const a=t[o];if(!this.list[o]){console.warn(`Classification ${o} does not exist.`);continue}for(const l of a){const h=this.list[o][l];if(h)for(const u in h.map){n[u]||(n[u]=new Map);for(const d of h.map[u]){const f=n[u].get(d);f===void 0?n[u].set(d,1):n[u].set(d,f+1)}}}}const r={};for(const o in n){const a=n[o];for(const[l,h]of a){if(h===void 0)throw new Error("Malformed fragments map!");h===i&&(r[o]||(r[o]=new Set),r[o].add(l))}}return r}byModel(t,s){this.list.models||(this.list.models={});const i=this.list.models;i[t]||(i[t]={map:{},id:null,name:t});const n=i[t];for(const[r,o]of s.data){const a=o[0];for(const l of a){const h=s.keyFragments.get(l);h&&(n.map[h]||(n.map[h]=new Set),n.map[h].add(r))}}}async byPredefinedType(t){var n;this.list.predefinedTypes||(this.list.predefinedTypes={});const s=this.list.predefinedTypes,i=t.getAllPropertiesIDs();for(const r of i){const o=await t.getProperties(r);if(!o)continue;const a=String((n=o.PredefinedType)==null?void 0:n.value).toUpperCase();s[a]||(s[a]={map:{},id:null,name:a});const l=s[a];for(const[h,u]of t.data){const d=u[0];for(const f of d){const I=t.keyFragments.get(f);if(!I)throw new Error("Fragment ID not found!");l.map[I]||(l.map[I]=new Set),l.map[I].add(o.expressID)}}}}byEntity(t){this.list.entities||(this.list.entities={});for(const[s,i]of t.data){const r=i[1][1],o=Wr[r];this.saveItem(t,"entities",o,s)}}async byIfcRel(t,s,i){Ze.isRel(s)&&await Ze.getRelationMap(t,s,async(n,r)=>{const{name:o}=await Ze.getEntityName(t,n);for(const a of r)this.saveItem(t,i,o??"NO REL NAME",a)})}async bySpatialStructure(t,s={}){var l,h;const i=this.components.get(Qe),n=i.relationMaps[t.uuid];if(!n)throw new Error(`Classifier: model relations of ${t.name||t.uuid} have to exists to group by spatial structure.`);const r="spatialStructures",a=s.useProperties===void 0||s.useProperties;for(const[u]of n){if(s.isolate){const p=t.data.get(u);if(!p)continue;const m=p[1][1];if(m===void 0||!s.isolate.has(m))continue}const d=i.getEntityRelations(t,u,"Decomposes");if(d)for(const p of d){let m=p.toString();if(a){const E=await t.getProperties(p);if(!E)continue;m=(l=E.Name)==null?void 0:l.value}this.saveItem(t,r,m,u,p)}const f=i.getEntityRelations(t,u,"ContainsElements");if(!f)continue;let I=u.toString();if(a){const p=await t.getProperties(u);if(!p)continue;I=(h=p.Name)==null?void 0:h.value}for(const p of f){this.saveItem(t,r,I,p,u);const m=i.getEntityRelations(t,Number(p),"IsDecomposedBy");if(m)for(const E of m)this.saveItem(t,r,I,E,u)}}}setColor(t,s,i=!1){const n=this.components.get(gt);for(const r in t){const o=n.list.get(r);if(!o)continue;const a=t[r];o.setColor(s,a,i)}}resetColor(t){const s=this.components.get(gt);for(const i in t){const n=s.list.get(i);if(!n)continue;const r=t[i];n.resetColor(r)}}saveItem(t,s,i,n,r=null){this.list[s]||(this.list[s]={});const o=t.data.get(n);if(o)for(const a of o[0]){const l=t.keyFragments.get(a);if(l){const h=this.list[s];h[i]||(h[i]={map:{},id:r,name:i}),h[i].map[l]||(h[i].map[l]=new Set),h[i].map[l].add(n)}}}};y(Ii,"uuid","e25a7f3c-46c4-4a14-9d3d-5115f24ebeb7");let hi=Ii;const mi=class mi extends Bt{constructor(t){super(t);y(this,"enabled",!0);this.components.add(mi.uuid,this)}set(t,s){const i=this.components.get(gt);if(!s){for(const[n,r]of i.list)r&&(r.setVisibility(t),this.updateCulledVisibility(r));return}for(const n in s){const r=s[n],o=i.list.get(n);o&&(o.setVisibility(t,r),this.updateCulledVisibility(o))}}isolate(t){this.set(!1),this.set(!0,t)}updateCulledVisibility(t){const s=this.components.get(nn);for(const[i,n]of s.list){const r=n.colorMeshes.get(t.id);r&&(r.count=t.mesh.count)}}};y(mi,"uuid","dd9ccf2d-8a21-4821-b7f6-2949add16a29");let fn=mi;class Jr{constructor(e,t,s){y(this,"title");y(this,"guid",fe.create());y(this,"clippingPlanes",new Xe);y(this,"camera",{aspectRatio:0,fov:0,direction:{x:0,y:0,z:80},position:{x:0,y:0,z:0}});y(this,"exceptionComponents",new Xe);y(this,"selectionComponents",new Xe);y(this,"componentColors",new Re);y(this,"spacesVisible",!1);y(this,"spaceBoundariesVisible",!1);y(this,"openingsVisible",!1);y(this,"defaultVisibility",!0);y(this,"_components");y(this,"world");const i={setCamera:!0,...s},{data:n,setCamera:r}=i;this._components=e,this.world=t,n&&(this.guid=n.guid??this.guid,this.set(n)),r&&this.updateCamera()}get _selectionModelIdMap(){const e=this._components.get(gt),t={};for(const[s,i]of e.groups){s in t||(t[s]=new Set);for(const n of this.selectionComponents){const r=i.globalToExpressIDs.get(n);r&&t[s].add(r)}}return t}get _exceptionModelIdMap(){const e=this._components.get(gt),t={};for(const[s,i]of e.groups){s in t||(t[s]=new Set);for(const n of this.exceptionComponents){const r=i.globalToExpressIDs.get(n);r&&t[s].add(r)}}return t}get selection(){return this._components.get(gt).modelIdToFragmentIdMap(this._selectionModelIdMap)}get exception(){return this._components.get(gt).modelIdToFragmentIdMap(this._exceptionModelIdMap)}get projection(){return"fov"in this.camera?"Perspective":"Orthographic"}get position(){const e=this._components.get(gt),{position:t}=this.camera,{x:s,y:i,z:n}=t,r=new W(s,i,n);return e.applyBaseCoordinateSystem(r,new Ft),r}get direction(){const{direction:e}=this.camera,{x:t,y:s,z:i}=e;return new W(t,s,i)}get _managerVersion(){return this._components.get(bt).config.version}get topics(){return[...this._components.get(bt).list.values()].filter(i=>i.viewpoints.has(this.guid))}async addComponentsFromMap(e){var i;const t=this._components.get(gt);for(const n in e){const r=t.list.get(n);if(!(r&&r.group))continue;const o=r.group,a=e[n];for(const l of a){const h=await o.getProperties(l);if(!h)continue;const u=(i=h.GlobalId)==null?void 0:i.value;u&&this.selectionComponents.add(u)}}this._components.get(te).list.set(this.guid,this)}set(e){const t=e,s=this;for(const n in e){if(n==="guid")continue;const r=t[n];n in this&&(s[n]=r)}return this._components.get(te).list.set(this.guid,this),this}async go(e=!0){const{camera:t}=this.world;if(!t.hasCameraControls())throw new Error("Viewpoint: the world's camera need controls to set the viewpoint.");t instanceof Ic&&t.projection.set(this.projection);const s=this.position,i=this.direction;let n={x:s.x+i.x*80,y:s.y+i.y*80,z:s.z+i.z*80};const r=this.selection;if(Object.keys(r).length===0){const h=this._components.get(ws).get(this.world).castRayFromVector(s,this.direction);h&&(n=h.point)}else{const a=this._components.get(dn);a.reset(),a.addFragmentIdMap(r),n=a.getSphere().center,a.reset()}const o=this._components.get(fn);o.set(this.defaultVisibility),o.set(!this.defaultVisibility,this.exception),o.set(!0,r),await t.controls.setLookAt(s.x,s.y,s.z,n.x,n.y,n.z,e)}updateCamera(){const{camera:e,renderer:t}=this.world;if(!t)throw new Error("Viewpoint: the world needs to have a renderer!");if(!e.hasCameraControls())throw new Error("Viewpoint: world's camera need camera controls!");const s=new W;e.controls.getPosition(s);const i=e.three,n=new W(0,0,-1).applyEuler(i.rotation),{width:r,height:o}=t.getSize();let a=r/o;Number.isNaN(a)&&(a=1);const l=this._components.get(gt);s.applyMatrix4(l.baseCoordinationMatrix.clone().invert());const h={aspectRatio:a,position:{x:s.x,y:s.y,z:s.z},direction:{x:n.x,y:n.y,z:n.z}};i instanceof Lr?this.camera={...h,fov:i.fov}:i instanceof En&&(this.camera={...h,viewToWorldScale:i.top-i.bottom}),this._components.get(te).list.set(this.guid,this)}colorize(){const e=this._components.get(te),t=this._components.get(gt),s=this._components.get(hi);for(const[i,n]of this.componentColors){const r=t.guidToFragmentIdMap(n),o=new mn(`#${i}`);s.setColor(r,o,e.config.overwriteColors)}}resetColors(){const e=this._components.get(gt),t=this._components.get(hi);for(const[s,i]of this.componentColors){const n=e.guidToFragmentIdMap(i);t.resetColor(n)}}async createComponentTags(e){var n,r;const t=this._components.get(gt),s=this._components.get(bt);let i="";if(s.config.includeSelectionTag){const o=e==="selection"?this._selectionModelIdMap:this._exceptionModelIdMap;for(const a in o){const l=t.groups.get(a);if(!l)continue;const h=o[a];for(const u of h){const d=await l.getProperties(u);if(!d)continue;const f=(n=d.GlobalId)==null?void 0:n.value;if(!f)continue;const I=(r=d.Tag)==null?void 0:r.value;let p=null;I&&(p=`AuthoringToolId="${I}"`),i+=` +`}}}else i=[...this.selectionComponents].map(o=>``).join(` +`);return i}async serialize(e=this._managerVersion){const t=this._components.get(gt),s=this.position;s.applyMatrix4(t.baseCoordinationMatrix.clone().invert());const i=this.direction;i.normalize();const n=new Ft().makeRotationX(Math.PI/2),r=i.clone().applyMatrix4(n);r.normalize();const o=` + ${s.x} + ${-s.z} + ${s.y} + `,a=` + ${i.x} + ${-i.z} + ${i.y} + `,l=` + ${r.x} + ${-r.z} + ${r.y} + `,h=`${this.camera.aspectRatio}`;let u="";"viewToWorld"in this.camera?u=` + ${o} + ${a} + ${l} + ${h} + ${this.camera.viewToWorld} + `:"fov"in this.camera&&(u=` + ${o} + ${a} + ${l} + ${h} + ${this.camera.fov} + `);const d=``,f=(await this.createComponentTags("selection")).trim(),I=(await this.createComponentTags("exception")).trim();return` + + + ${e==="2.1"?d:""} + ${f.length!==0?`${f}`:""} + + ${e==="3"?d:""} + ${I.length!==0?`${I}`:""} + + + ${u} + `}}const Ci=class Ci extends Bt{constructor(t){super(t);y(this,"enabled",!0);y(this,"list",new Re);y(this,"isSetup",!1);y(this,"onSetup",new et);y(this,"config",{overwriteColors:!1});y(this,"onDisposed",new et);t.add(Ci.uuid,this)}create(t,s){const i=new Jr(this.components,t,{data:s});return s||this.list.set(i.guid,i),i}setup(){}dispose(){this.list.dispose(),this.onDisposed.trigger(),this.onDisposed.reset()}};y(Ci,"uuid","ee867824-a796-408d-8aa0-4e5962a83c66");let te=Ci;export{bt as B,en as C,je as D,et as E,gt as F,an as I,vn as S,fe as U,te as V,sn as W,Qe as a,Ze as b,cn as c,Ha as d,Bt as e}; diff --git a/examples/assets/index-B32RnVzG.js b/examples/assets/index-Cb0EycFm.js similarity index 97% rename from examples/assets/index-B32RnVzG.js rename to examples/assets/index-Cb0EycFm.js index e5360bc88..974810ccd 100644 --- a/examples/assets/index-B32RnVzG.js +++ b/examples/assets/index-Cb0EycFm.js @@ -1,4 +1,4 @@ -import{e as De,t as fn,a as gn,L as Ur,i as Vr,_ as Ht,J as at,E as Wr,b as Gr,m as Uo,P as qr,R as Yr,l as Xr,X as di}from"./index-c9A1IUGD.js";import{V as vn,c as Si,G as zn,F as Jr,L as Qr,d as Fn,e as Zr,f as Kr,P as ti,g as ye,D as ta,A as ea,C as ze,O as ia,h as na,I as oa,R as sa,i as Vo,j as Wo,k as ra,l as Go,m as aa,n as la,o as qo,p as Yo,q as ca}from"./web-ifc-api-CgBULNZm.js";import{X as da,r as ua,$ as L}from"./index-UqY4hWbC.js";var ha=Object.defineProperty,pa=(e,t,i)=>t in e?ha(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,It=(e,t,i)=>(pa(e,typeof t!="symbol"?t+"":t,i),i);const Jt=Math.min,ht=Math.max,ui=Math.round,$t=e=>({x:e,y:e}),ma={left:"right",right:"left",bottom:"top",top:"bottom"},ba={start:"end",end:"start"};function Hn(e,t,i){return ht(e,Jt(t,i))}function Fe(e,t){return typeof e=="function"?e(t):e}function mt(e){return e.split("-")[0]}function ki(e){return e.split("-")[1]}function Xo(e){return e==="x"?"y":"x"}function Jo(e){return e==="y"?"height":"width"}function Rt(e){return["top","bottom"].includes(mt(e))?"y":"x"}function Qo(e){return Xo(Rt(e))}function fa(e,t,i){i===void 0&&(i=!1);const n=ki(e),o=Qo(e),s=Jo(o);let r=o==="x"?n===(i?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(r=hi(r)),[r,hi(r)]}function ga(e){const t=hi(e);return[Ki(e),t,Ki(t)]}function Ki(e){return e.replace(/start|end/g,t=>ba[t])}function va(e,t,i){const n=["left","right"],o=["right","left"],s=["top","bottom"],r=["bottom","top"];switch(e){case"top":case"bottom":return i?t?o:n:t?n:o;case"left":case"right":return t?s:r;default:return[]}}function ya(e,t,i,n){const o=ki(e);let s=va(mt(e),i==="start",n);return o&&(s=s.map(r=>r+"-"+o),t&&(s=s.concat(s.map(Ki)))),s}function hi(e){return e.replace(/left|right|bottom|top/g,t=>ma[t])}function _a(e){return{top:0,right:0,bottom:0,left:0,...e}}function Zo(e){return typeof e!="number"?_a(e):{top:e,right:e,bottom:e,left:e}}function Qt(e){const{x:t,y:i,width:n,height:o}=e;return{width:n,height:o,top:i,left:t,right:t+n,bottom:i+o,x:t,y:i}}function Bn(e,t,i){let{reference:n,floating:o}=e;const s=Rt(t),r=Qo(t),a=Jo(r),l=mt(t),d=s==="y",u=n.x+n.width/2-o.width/2,c=n.y+n.height/2-o.height/2,h=n[a]/2-o[a]/2;let p;switch(l){case"top":p={x:u,y:n.y-o.height};break;case"bottom":p={x:u,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:c};break;case"left":p={x:n.x-o.width,y:c};break;default:p={x:n.x,y:n.y}}switch(ki(t)){case"start":p[r]-=h*(i&&d?-1:1);break;case"end":p[r]+=h*(i&&d?-1:1);break}return p}const xa=async(e,t,i)=>{const{placement:n="bottom",strategy:o="absolute",middleware:s=[],platform:r}=i,a=s.filter(Boolean),l=await(r.isRTL==null?void 0:r.isRTL(t));let d=await r.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:c}=Bn(d,n,l),h=n,p={},g=0;for(let _=0;_j<=0)){var k,U;const j=(((k=s.flip)==null?void 0:k.index)||0)+1,ct=A[j];if(ct)return{data:{index:j,overflows:S},reset:{placement:ct}};let it=(U=S.filter(nt=>nt.overflows[0]<=0).sort((nt,q)=>nt.overflows[1]-q.overflows[1])[0])==null?void 0:U.placement;if(!it)switch(p){case"bestFit":{var vt;const nt=(vt=S.filter(q=>{if(C){const ot=Rt(q.placement);return ot===y||ot==="y"}return!0}).map(q=>[q.placement,q.overflows.filter(ot=>ot>0).reduce((ot,ge)=>ot+ge,0)]).sort((q,ot)=>q[1]-ot[1])[0])==null?void 0:vt[0];nt&&(it=nt);break}case"initialPlacement":it=a;break}if(o!==it)return{reset:{placement:it}}}return{}}}};function ts(e){const t=Jt(...e.map(s=>s.left)),i=Jt(...e.map(s=>s.top)),n=ht(...e.map(s=>s.right)),o=ht(...e.map(s=>s.bottom));return{x:t,y:i,width:n-t,height:o-i}}function $a(e){const t=e.slice().sort((o,s)=>o.y-s.y),i=[];let n=null;for(let o=0;on.height/2?i.push([s]):i[i.length-1].push(s),n=s}return i.map(o=>Qt(ts(o)))}const Ca=function(e){return e===void 0&&(e={}),{name:"inline",options:e,async fn(t){const{placement:i,elements:n,rects:o,platform:s,strategy:r}=t,{padding:a=2,x:l,y:d}=Fe(e,t),u=Array.from(await(s.getClientRects==null?void 0:s.getClientRects(n.reference))||[]),c=$a(u),h=Qt(ts(u)),p=Zo(a);function g(){if(c.length===2&&c[0].left>c[1].right&&l!=null&&d!=null)return c.find(v=>l>v.left-p.left&&lv.top-p.top&&d=2){if(Rt(i)==="y"){const S=c[0],k=c[c.length-1],U=mt(i)==="top",vt=S.top,j=k.bottom,ct=U?S.left:k.left,it=U?S.right:k.right,nt=it-ct,q=j-vt;return{top:vt,bottom:j,left:ct,right:it,width:nt,height:q,x:ct,y:vt}}const v=mt(i)==="left",f=ht(...c.map(S=>S.right)),y=Jt(...c.map(S=>S.left)),x=c.filter(S=>v?S.left===y:S.right===f),w=x[0].top,E=x[x.length-1].bottom,C=y,A=f,N=A-C,$=E-w;return{top:w,bottom:E,left:C,right:A,width:N,height:$,x:C,y:w}}return h}const _=await s.getElementRects({reference:{getBoundingClientRect:g},floating:n.floating,strategy:r});return o.reference.x!==_.reference.x||o.reference.y!==_.reference.y||o.reference.width!==_.reference.width||o.reference.height!==_.reference.height?{reset:{rects:_}}:{}}}};async function Ea(e,t){const{placement:i,platform:n,elements:o}=e,s=await(n.isRTL==null?void 0:n.isRTL(o.floating)),r=mt(i),a=ki(i),l=Rt(i)==="y",d=["left","top"].includes(r)?-1:1,u=s&&l?-1:1,c=Fe(t,e);let{mainAxis:h,crossAxis:p,alignmentAxis:g}=typeof c=="number"?{mainAxis:c,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...c};return a&&typeof g=="number"&&(p=a==="end"?g*-1:g),l?{x:p*u,y:h*d}:{x:h*d,y:p*u}}const es=function(e){return{name:"offset",options:e,async fn(t){var i,n;const{x:o,y:s,placement:r,middlewareData:a}=t,l=await Ea(t,e);return r===((i=a.offset)==null?void 0:i.placement)&&(n=a.arrow)!=null&&n.alignmentOffset?{}:{x:o+l.x,y:s+l.y,data:{...l,placement:r}}}}},Aa=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:i,y:n,placement:o}=t,{mainAxis:s=!0,crossAxis:r=!1,limiter:a={fn:v=>{let{x:f,y}=v;return{x:f,y}}},...l}=Fe(e,t),d={x:i,y:n},u=await Ko(t,l),c=Rt(mt(o)),h=Xo(c);let p=d[h],g=d[c];if(s){const v=h==="y"?"top":"left",f=h==="y"?"bottom":"right",y=p+u[v],x=p-u[f];p=Hn(y,p,x)}if(r){const v=c==="y"?"top":"left",f=c==="y"?"bottom":"right",y=g+u[v],x=g-u[f];g=Hn(y,g,x)}const _=a.fn({...t,[h]:p,[c]:g});return{..._,data:{x:_.x-i,y:_.y-n}}}}};function Ct(e){return is(e)?(e.nodeName||"").toLowerCase():"#document"}function V(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function At(e){var t;return(t=(is(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function is(e){return e instanceof Node||e instanceof V(e).Node}function st(e){return e instanceof Element||e instanceof V(e).Element}function rt(e){return e instanceof HTMLElement||e instanceof V(e).HTMLElement}function Un(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof V(e).ShadowRoot}function He(e){const{overflow:t,overflowX:i,overflowY:n,display:o}=X(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+i)&&!["inline","contents"].includes(o)}function Sa(e){return["table","td","th"].includes(Ct(e))}function ka(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function yn(e){const t=_n(),i=st(e)?X(e):e;return i.transform!=="none"||i.perspective!=="none"||(i.containerType?i.containerType!=="normal":!1)||!t&&(i.backdropFilter?i.backdropFilter!=="none":!1)||!t&&(i.filter?i.filter!=="none":!1)||["transform","perspective","filter"].some(n=>(i.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(i.contain||"").includes(n))}function Oa(e){let t=Zt(e);for(;rt(t)&&!Oi(t);){if(yn(t))return t;if(ka(t))return null;t=Zt(t)}return null}function _n(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Oi(e){return["html","body","#document"].includes(Ct(e))}function X(e){return V(e).getComputedStyle(e)}function Ti(e){return st(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Zt(e){if(Ct(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Un(e)&&e.host||At(e);return Un(t)?t.host:t}function ns(e){const t=Zt(e);return Oi(t)?e.ownerDocument?e.ownerDocument.body:e.body:rt(t)&&He(t)?t:ns(t)}function tn(e,t,i){var n;t===void 0&&(t=[]),i===void 0&&(i=!0);const o=ns(e),s=o===((n=e.ownerDocument)==null?void 0:n.body),r=V(o);if(s){const a=Ta(r);return t.concat(r,r.visualViewport||[],He(o)?o:[],a&&i?tn(a):[])}return t.concat(o,tn(o,[],i))}function Ta(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function os(e){const t=X(e);let i=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=rt(e),s=o?e.offsetWidth:i,r=o?e.offsetHeight:n,a=ui(i)!==s||ui(n)!==r;return a&&(i=s,n=r),{width:i,height:n,$:a}}function ss(e){return st(e)?e:e.contextElement}function Yt(e){const t=ss(e);if(!rt(t))return $t(1);const i=t.getBoundingClientRect(),{width:n,height:o,$:s}=os(t);let r=(s?ui(i.width):i.width)/n,a=(s?ui(i.height):i.height)/o;return(!r||!Number.isFinite(r))&&(r=1),(!a||!Number.isFinite(a))&&(a=1),{x:r,y:a}}const Ia=$t(0);function rs(e){const t=V(e);return!_n()||!t.visualViewport?Ia:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Na(e,t,i){return t===void 0&&(t=!1),!i||t&&i!==V(e)?!1:t}function ke(e,t,i,n){t===void 0&&(t=!1),i===void 0&&(i=!1);const o=e.getBoundingClientRect(),s=ss(e);let r=$t(1);t&&(n?st(n)&&(r=Yt(n)):r=Yt(e));const a=Na(s,i,n)?rs(s):$t(0);let l=(o.left+a.x)/r.x,d=(o.top+a.y)/r.y,u=o.width/r.x,c=o.height/r.y;if(s){const h=V(s),p=n&&st(n)?V(n):n;let g=h,_=g.frameElement;for(;_&&n&&p!==g;){const v=Yt(_),f=_.getBoundingClientRect(),y=X(_),x=f.left+(_.clientLeft+parseFloat(y.paddingLeft))*v.x,w=f.top+(_.clientTop+parseFloat(y.paddingTop))*v.y;l*=v.x,d*=v.y,u*=v.x,c*=v.y,l+=x,d+=w,g=V(_),_=g.frameElement}}return Qt({width:u,height:c,x:l,y:d})}const Pa=[":popover-open",":modal"];function as(e){return Pa.some(t=>{try{return e.matches(t)}catch{return!1}})}function Ma(e){let{elements:t,rect:i,offsetParent:n,strategy:o}=e;const s=o==="fixed",r=At(n),a=t?as(t.floating):!1;if(n===r||a&&s)return i;let l={scrollLeft:0,scrollTop:0},d=$t(1);const u=$t(0),c=rt(n);if((c||!c&&!s)&&((Ct(n)!=="body"||He(r))&&(l=Ti(n)),rt(n))){const h=ke(n);d=Yt(n),u.x=h.x+n.clientLeft,u.y=h.y+n.clientTop}return{width:i.width*d.x,height:i.height*d.y,x:i.x*d.x-l.scrollLeft*d.x+u.x,y:i.y*d.y-l.scrollTop*d.y+u.y}}function La(e){return Array.from(e.getClientRects())}function ls(e){return ke(At(e)).left+Ti(e).scrollLeft}function ja(e){const t=At(e),i=Ti(e),n=e.ownerDocument.body,o=ht(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=ht(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let r=-i.scrollLeft+ls(e);const a=-i.scrollTop;return X(n).direction==="rtl"&&(r+=ht(t.clientWidth,n.clientWidth)-o),{width:o,height:s,x:r,y:a}}function Ra(e,t){const i=V(e),n=At(e),o=i.visualViewport;let s=n.clientWidth,r=n.clientHeight,a=0,l=0;if(o){s=o.width,r=o.height;const d=_n();(!d||d&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:s,height:r,x:a,y:l}}function Da(e,t){const i=ke(e,!0,t==="fixed"),n=i.top+e.clientTop,o=i.left+e.clientLeft,s=rt(e)?Yt(e):$t(1),r=e.clientWidth*s.x,a=e.clientHeight*s.y,l=o*s.x,d=n*s.y;return{width:r,height:a,x:l,y:d}}function Vn(e,t,i){let n;if(t==="viewport")n=Ra(e,i);else if(t==="document")n=ja(At(e));else if(st(t))n=Da(t,i);else{const o=rs(e);n={...t,x:t.x-o.x,y:t.y-o.y}}return Qt(n)}function cs(e,t){const i=Zt(e);return i===t||!st(i)||Oi(i)?!1:X(i).position==="fixed"||cs(i,t)}function za(e,t){const i=t.get(e);if(i)return i;let n=tn(e,[],!1).filter(a=>st(a)&&Ct(a)!=="body"),o=null;const s=X(e).position==="fixed";let r=s?Zt(e):e;for(;st(r)&&!Oi(r);){const a=X(r),l=yn(r);!l&&a.position==="fixed"&&(o=null),(s?!l&&!o:!l&&a.position==="static"&&o&&["absolute","fixed"].includes(o.position)||He(r)&&!l&&cs(e,r))?n=n.filter(d=>d!==r):o=a,r=Zt(r)}return t.set(e,n),n}function Fa(e){let{element:t,boundary:i,rootBoundary:n,strategy:o}=e;const s=[...i==="clippingAncestors"?za(t,this._c):[].concat(i),n],r=s[0],a=s.reduce((l,d)=>{const u=Vn(t,d,o);return l.top=ht(u.top,l.top),l.right=Jt(u.right,l.right),l.bottom=Jt(u.bottom,l.bottom),l.left=ht(u.left,l.left),l},Vn(t,r,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function Ha(e){const{width:t,height:i}=os(e);return{width:t,height:i}}function Ba(e,t,i){const n=rt(t),o=At(t),s=i==="fixed",r=ke(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const l=$t(0);if(n||!n&&!s)if((Ct(t)!=="body"||He(o))&&(a=Ti(t)),n){const c=ke(t,!0,s,t);l.x=c.x+t.clientLeft,l.y=c.y+t.clientTop}else o&&(l.x=ls(o));const d=r.left+a.scrollLeft-l.x,u=r.top+a.scrollTop-l.y;return{x:d,y:u,width:r.width,height:r.height}}function Wn(e,t){return!rt(e)||X(e).position==="fixed"?null:t?t(e):e.offsetParent}function ds(e,t){const i=V(e);if(!rt(e)||as(e))return i;let n=Wn(e,t);for(;n&&Sa(n)&&X(n).position==="static";)n=Wn(n,t);return n&&(Ct(n)==="html"||Ct(n)==="body"&&X(n).position==="static"&&!yn(n))?i:n||Oa(e)||i}const Ua=async function(e){const t=this.getOffsetParent||ds,i=this.getDimensions;return{reference:Ba(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,...await i(e.floating)}}};function Va(e){return X(e).direction==="rtl"}const Wa={convertOffsetParentRelativeRectToViewportRelativeRect:Ma,getDocumentElement:At,getClippingRect:Fa,getOffsetParent:ds,getElementRects:Ua,getClientRects:La,getDimensions:Ha,getScale:Yt,isElement:st,isRTL:Va},us=Aa,hs=wa,ps=Ca,ms=(e,t,i)=>{const n=new Map,o={platform:Wa,...i},s={...o.platform,_c:n};return xa(e,t,{...o,platform:s})};/** +import{L as Re,d as fn,a as gn,M as Ur,n as Vr,_ as Ht,x as at,e as Wr,b as Gr,I as Uo,f as qr,u as Yr,z as di,h as Xr}from"./index-DtdmE_hK.js";import{V as vn,c as Si,G as zn,F as Jr,L as Qr,d as Fn,e as Zr,f as Kr,P as ti,g as ye,D as ta,A as ea,C as ze,O as ia,h as na,I as oa,R as sa,i as Vo,j as Wo,k as ra,l as Go,m as aa,n as la,o as qo,p as Yo,q as ca}from"./web-ifc-api-JuXSH2nk.js";import{X as da,r as ua,$ as L}from"./index-Cm7YlCft.js";var ha=Object.defineProperty,pa=(e,t,i)=>t in e?ha(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,It=(e,t,i)=>(pa(e,typeof t!="symbol"?t+"":t,i),i);const Jt=Math.min,ht=Math.max,ui=Math.round,$t=e=>({x:e,y:e}),ma={left:"right",right:"left",bottom:"top",top:"bottom"},ba={start:"end",end:"start"};function Hn(e,t,i){return ht(e,Jt(t,i))}function Fe(e,t){return typeof e=="function"?e(t):e}function mt(e){return e.split("-")[0]}function ki(e){return e.split("-")[1]}function Xo(e){return e==="x"?"y":"x"}function Jo(e){return e==="y"?"height":"width"}function Dt(e){return["top","bottom"].includes(mt(e))?"y":"x"}function Qo(e){return Xo(Dt(e))}function fa(e,t,i){i===void 0&&(i=!1);const n=ki(e),o=Qo(e),s=Jo(o);let r=o==="x"?n===(i?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[s]>t.floating[s]&&(r=hi(r)),[r,hi(r)]}function ga(e){const t=hi(e);return[Ki(e),t,Ki(t)]}function Ki(e){return e.replace(/start|end/g,t=>ba[t])}function va(e,t,i){const n=["left","right"],o=["right","left"],s=["top","bottom"],r=["bottom","top"];switch(e){case"top":case"bottom":return i?t?o:n:t?n:o;case"left":case"right":return t?s:r;default:return[]}}function ya(e,t,i,n){const o=ki(e);let s=va(mt(e),i==="start",n);return o&&(s=s.map(r=>r+"-"+o),t&&(s=s.concat(s.map(Ki)))),s}function hi(e){return e.replace(/left|right|bottom|top/g,t=>ma[t])}function _a(e){return{top:0,right:0,bottom:0,left:0,...e}}function Zo(e){return typeof e!="number"?_a(e):{top:e,right:e,bottom:e,left:e}}function Qt(e){const{x:t,y:i,width:n,height:o}=e;return{width:n,height:o,top:i,left:t,right:t+n,bottom:i+o,x:t,y:i}}function Bn(e,t,i){let{reference:n,floating:o}=e;const s=Dt(t),r=Qo(t),a=Jo(r),l=mt(t),d=s==="y",u=n.x+n.width/2-o.width/2,c=n.y+n.height/2-o.height/2,h=n[a]/2-o[a]/2;let p;switch(l){case"top":p={x:u,y:n.y-o.height};break;case"bottom":p={x:u,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:c};break;case"left":p={x:n.x-o.width,y:c};break;default:p={x:n.x,y:n.y}}switch(ki(t)){case"start":p[r]-=h*(i&&d?-1:1);break;case"end":p[r]+=h*(i&&d?-1:1);break}return p}const xa=async(e,t,i)=>{const{placement:n="bottom",strategy:o="absolute",middleware:s=[],platform:r}=i,a=s.filter(Boolean),l=await(r.isRTL==null?void 0:r.isRTL(t));let d=await r.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:c}=Bn(d,n,l),h=n,p={},g=0;for(let _=0;_j<=0)){var k,U;const j=(((k=s.flip)==null?void 0:k.index)||0)+1,ct=A[j];if(ct)return{data:{index:j,overflows:S},reset:{placement:ct}};let it=(U=S.filter(nt=>nt.overflows[0]<=0).sort((nt,q)=>nt.overflows[1]-q.overflows[1])[0])==null?void 0:U.placement;if(!it)switch(p){case"bestFit":{var vt;const nt=(vt=S.filter(q=>{if(C){const ot=Dt(q.placement);return ot===y||ot==="y"}return!0}).map(q=>[q.placement,q.overflows.filter(ot=>ot>0).reduce((ot,ge)=>ot+ge,0)]).sort((q,ot)=>q[1]-ot[1])[0])==null?void 0:vt[0];nt&&(it=nt);break}case"initialPlacement":it=a;break}if(o!==it)return{reset:{placement:it}}}return{}}}};function ts(e){const t=Jt(...e.map(s=>s.left)),i=Jt(...e.map(s=>s.top)),n=ht(...e.map(s=>s.right)),o=ht(...e.map(s=>s.bottom));return{x:t,y:i,width:n-t,height:o-i}}function $a(e){const t=e.slice().sort((o,s)=>o.y-s.y),i=[];let n=null;for(let o=0;on.height/2?i.push([s]):i[i.length-1].push(s),n=s}return i.map(o=>Qt(ts(o)))}const Ca=function(e){return e===void 0&&(e={}),{name:"inline",options:e,async fn(t){const{placement:i,elements:n,rects:o,platform:s,strategy:r}=t,{padding:a=2,x:l,y:d}=Fe(e,t),u=Array.from(await(s.getClientRects==null?void 0:s.getClientRects(n.reference))||[]),c=$a(u),h=Qt(ts(u)),p=Zo(a);function g(){if(c.length===2&&c[0].left>c[1].right&&l!=null&&d!=null)return c.find(v=>l>v.left-p.left&&lv.top-p.top&&d=2){if(Dt(i)==="y"){const S=c[0],k=c[c.length-1],U=mt(i)==="top",vt=S.top,j=k.bottom,ct=U?S.left:k.left,it=U?S.right:k.right,nt=it-ct,q=j-vt;return{top:vt,bottom:j,left:ct,right:it,width:nt,height:q,x:ct,y:vt}}const v=mt(i)==="left",f=ht(...c.map(S=>S.right)),y=Jt(...c.map(S=>S.left)),x=c.filter(S=>v?S.left===y:S.right===f),w=x[0].top,E=x[x.length-1].bottom,C=y,A=f,N=A-C,$=E-w;return{top:w,bottom:E,left:C,right:A,width:N,height:$,x:C,y:w}}return h}const _=await s.getElementRects({reference:{getBoundingClientRect:g},floating:n.floating,strategy:r});return o.reference.x!==_.reference.x||o.reference.y!==_.reference.y||o.reference.width!==_.reference.width||o.reference.height!==_.reference.height?{reset:{rects:_}}:{}}}};async function Ea(e,t){const{placement:i,platform:n,elements:o}=e,s=await(n.isRTL==null?void 0:n.isRTL(o.floating)),r=mt(i),a=ki(i),l=Dt(i)==="y",d=["left","top"].includes(r)?-1:1,u=s&&l?-1:1,c=Fe(t,e);let{mainAxis:h,crossAxis:p,alignmentAxis:g}=typeof c=="number"?{mainAxis:c,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...c};return a&&typeof g=="number"&&(p=a==="end"?g*-1:g),l?{x:p*u,y:h*d}:{x:h*d,y:p*u}}const es=function(e){return{name:"offset",options:e,async fn(t){var i,n;const{x:o,y:s,placement:r,middlewareData:a}=t,l=await Ea(t,e);return r===((i=a.offset)==null?void 0:i.placement)&&(n=a.arrow)!=null&&n.alignmentOffset?{}:{x:o+l.x,y:s+l.y,data:{...l,placement:r}}}}},Aa=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:i,y:n,placement:o}=t,{mainAxis:s=!0,crossAxis:r=!1,limiter:a={fn:v=>{let{x:f,y}=v;return{x:f,y}}},...l}=Fe(e,t),d={x:i,y:n},u=await Ko(t,l),c=Dt(mt(o)),h=Xo(c);let p=d[h],g=d[c];if(s){const v=h==="y"?"top":"left",f=h==="y"?"bottom":"right",y=p+u[v],x=p-u[f];p=Hn(y,p,x)}if(r){const v=c==="y"?"top":"left",f=c==="y"?"bottom":"right",y=g+u[v],x=g-u[f];g=Hn(y,g,x)}const _=a.fn({...t,[h]:p,[c]:g});return{..._,data:{x:_.x-i,y:_.y-n}}}}};function Ct(e){return is(e)?(e.nodeName||"").toLowerCase():"#document"}function V(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function At(e){var t;return(t=(is(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function is(e){return e instanceof Node||e instanceof V(e).Node}function st(e){return e instanceof Element||e instanceof V(e).Element}function rt(e){return e instanceof HTMLElement||e instanceof V(e).HTMLElement}function Un(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof V(e).ShadowRoot}function He(e){const{overflow:t,overflowX:i,overflowY:n,display:o}=X(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+i)&&!["inline","contents"].includes(o)}function Sa(e){return["table","td","th"].includes(Ct(e))}function ka(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function yn(e){const t=_n(),i=st(e)?X(e):e;return i.transform!=="none"||i.perspective!=="none"||(i.containerType?i.containerType!=="normal":!1)||!t&&(i.backdropFilter?i.backdropFilter!=="none":!1)||!t&&(i.filter?i.filter!=="none":!1)||["transform","perspective","filter"].some(n=>(i.willChange||"").includes(n))||["paint","layout","strict","content"].some(n=>(i.contain||"").includes(n))}function Oa(e){let t=Zt(e);for(;rt(t)&&!Oi(t);){if(yn(t))return t;if(ka(t))return null;t=Zt(t)}return null}function _n(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Oi(e){return["html","body","#document"].includes(Ct(e))}function X(e){return V(e).getComputedStyle(e)}function Ti(e){return st(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Zt(e){if(Ct(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Un(e)&&e.host||At(e);return Un(t)?t.host:t}function ns(e){const t=Zt(e);return Oi(t)?e.ownerDocument?e.ownerDocument.body:e.body:rt(t)&&He(t)?t:ns(t)}function tn(e,t,i){var n;t===void 0&&(t=[]),i===void 0&&(i=!0);const o=ns(e),s=o===((n=e.ownerDocument)==null?void 0:n.body),r=V(o);if(s){const a=Ta(r);return t.concat(r,r.visualViewport||[],He(o)?o:[],a&&i?tn(a):[])}return t.concat(o,tn(o,[],i))}function Ta(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function os(e){const t=X(e);let i=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=rt(e),s=o?e.offsetWidth:i,r=o?e.offsetHeight:n,a=ui(i)!==s||ui(n)!==r;return a&&(i=s,n=r),{width:i,height:n,$:a}}function ss(e){return st(e)?e:e.contextElement}function Yt(e){const t=ss(e);if(!rt(t))return $t(1);const i=t.getBoundingClientRect(),{width:n,height:o,$:s}=os(t);let r=(s?ui(i.width):i.width)/n,a=(s?ui(i.height):i.height)/o;return(!r||!Number.isFinite(r))&&(r=1),(!a||!Number.isFinite(a))&&(a=1),{x:r,y:a}}const Ia=$t(0);function rs(e){const t=V(e);return!_n()||!t.visualViewport?Ia:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Na(e,t,i){return t===void 0&&(t=!1),!i||t&&i!==V(e)?!1:t}function ke(e,t,i,n){t===void 0&&(t=!1),i===void 0&&(i=!1);const o=e.getBoundingClientRect(),s=ss(e);let r=$t(1);t&&(n?st(n)&&(r=Yt(n)):r=Yt(e));const a=Na(s,i,n)?rs(s):$t(0);let l=(o.left+a.x)/r.x,d=(o.top+a.y)/r.y,u=o.width/r.x,c=o.height/r.y;if(s){const h=V(s),p=n&&st(n)?V(n):n;let g=h,_=g.frameElement;for(;_&&n&&p!==g;){const v=Yt(_),f=_.getBoundingClientRect(),y=X(_),x=f.left+(_.clientLeft+parseFloat(y.paddingLeft))*v.x,w=f.top+(_.clientTop+parseFloat(y.paddingTop))*v.y;l*=v.x,d*=v.y,u*=v.x,c*=v.y,l+=x,d+=w,g=V(_),_=g.frameElement}}return Qt({width:u,height:c,x:l,y:d})}const Pa=[":popover-open",":modal"];function as(e){return Pa.some(t=>{try{return e.matches(t)}catch{return!1}})}function Ma(e){let{elements:t,rect:i,offsetParent:n,strategy:o}=e;const s=o==="fixed",r=At(n),a=t?as(t.floating):!1;if(n===r||a&&s)return i;let l={scrollLeft:0,scrollTop:0},d=$t(1);const u=$t(0),c=rt(n);if((c||!c&&!s)&&((Ct(n)!=="body"||He(r))&&(l=Ti(n)),rt(n))){const h=ke(n);d=Yt(n),u.x=h.x+n.clientLeft,u.y=h.y+n.clientTop}return{width:i.width*d.x,height:i.height*d.y,x:i.x*d.x-l.scrollLeft*d.x+u.x,y:i.y*d.y-l.scrollTop*d.y+u.y}}function La(e){return Array.from(e.getClientRects())}function ls(e){return ke(At(e)).left+Ti(e).scrollLeft}function ja(e){const t=At(e),i=Ti(e),n=e.ownerDocument.body,o=ht(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),s=ht(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let r=-i.scrollLeft+ls(e);const a=-i.scrollTop;return X(n).direction==="rtl"&&(r+=ht(t.clientWidth,n.clientWidth)-o),{width:o,height:s,x:r,y:a}}function Da(e,t){const i=V(e),n=At(e),o=i.visualViewport;let s=n.clientWidth,r=n.clientHeight,a=0,l=0;if(o){s=o.width,r=o.height;const d=_n();(!d||d&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:s,height:r,x:a,y:l}}function Ra(e,t){const i=ke(e,!0,t==="fixed"),n=i.top+e.clientTop,o=i.left+e.clientLeft,s=rt(e)?Yt(e):$t(1),r=e.clientWidth*s.x,a=e.clientHeight*s.y,l=o*s.x,d=n*s.y;return{width:r,height:a,x:l,y:d}}function Vn(e,t,i){let n;if(t==="viewport")n=Da(e,i);else if(t==="document")n=ja(At(e));else if(st(t))n=Ra(t,i);else{const o=rs(e);n={...t,x:t.x-o.x,y:t.y-o.y}}return Qt(n)}function cs(e,t){const i=Zt(e);return i===t||!st(i)||Oi(i)?!1:X(i).position==="fixed"||cs(i,t)}function za(e,t){const i=t.get(e);if(i)return i;let n=tn(e,[],!1).filter(a=>st(a)&&Ct(a)!=="body"),o=null;const s=X(e).position==="fixed";let r=s?Zt(e):e;for(;st(r)&&!Oi(r);){const a=X(r),l=yn(r);!l&&a.position==="fixed"&&(o=null),(s?!l&&!o:!l&&a.position==="static"&&o&&["absolute","fixed"].includes(o.position)||He(r)&&!l&&cs(e,r))?n=n.filter(d=>d!==r):o=a,r=Zt(r)}return t.set(e,n),n}function Fa(e){let{element:t,boundary:i,rootBoundary:n,strategy:o}=e;const s=[...i==="clippingAncestors"?za(t,this._c):[].concat(i),n],r=s[0],a=s.reduce((l,d)=>{const u=Vn(t,d,o);return l.top=ht(u.top,l.top),l.right=Jt(u.right,l.right),l.bottom=Jt(u.bottom,l.bottom),l.left=ht(u.left,l.left),l},Vn(t,r,o));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function Ha(e){const{width:t,height:i}=os(e);return{width:t,height:i}}function Ba(e,t,i){const n=rt(t),o=At(t),s=i==="fixed",r=ke(e,!0,s,t);let a={scrollLeft:0,scrollTop:0};const l=$t(0);if(n||!n&&!s)if((Ct(t)!=="body"||He(o))&&(a=Ti(t)),n){const c=ke(t,!0,s,t);l.x=c.x+t.clientLeft,l.y=c.y+t.clientTop}else o&&(l.x=ls(o));const d=r.left+a.scrollLeft-l.x,u=r.top+a.scrollTop-l.y;return{x:d,y:u,width:r.width,height:r.height}}function Wn(e,t){return!rt(e)||X(e).position==="fixed"?null:t?t(e):e.offsetParent}function ds(e,t){const i=V(e);if(!rt(e)||as(e))return i;let n=Wn(e,t);for(;n&&Sa(n)&&X(n).position==="static";)n=Wn(n,t);return n&&(Ct(n)==="html"||Ct(n)==="body"&&X(n).position==="static"&&!yn(n))?i:n||Oa(e)||i}const Ua=async function(e){const t=this.getOffsetParent||ds,i=this.getDimensions;return{reference:Ba(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,...await i(e.floating)}}};function Va(e){return X(e).direction==="rtl"}const Wa={convertOffsetParentRelativeRectToViewportRelativeRect:Ma,getDocumentElement:At,getClippingRect:Fa,getOffsetParent:ds,getElementRects:Ua,getClientRects:La,getDimensions:Ha,getScale:Yt,isElement:st,isRTL:Va},us=Aa,hs=wa,ps=Ca,ms=(e,t,i)=>{const n=new Map,o={platform:Wa,...i},s={...o.platform,_c:n};return xa(e,t,{...o,platform:s})};/** * @license * Copyright 2019 Google LLC * SPDX-License-Identifier: BSD-3-Clause @@ -10,9 +10,9 @@ import{e as De,t as fn,a as gn,L as Ur,i as Vr,_ as Ht,J as at,E as Wr,b as Gr,m * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const mi=globalThis,bi=mi.trustedTypes,Qn=bi?bi.createPolicy("lit-html",{createHTML:e=>e}):void 0,fs="$lit$",xt=`lit$${Math.random().toFixed(9).slice(2)}$`,gs="?"+xt,el=`<${gs}>`,Dt=document,Oe=()=>Dt.createComment(""),Te=e=>e===null||typeof e!="object"&&typeof e!="function",Cn=Array.isArray,il=e=>Cn(e)||typeof(e==null?void 0:e[Symbol.iterator])=="function",Ui=`[ + */const mi=globalThis,bi=mi.trustedTypes,Qn=bi?bi.createPolicy("lit-html",{createHTML:e=>e}):void 0,fs="$lit$",xt=`lit$${Math.random().toFixed(9).slice(2)}$`,gs="?"+xt,el=`<${gs}>`,Rt=document,Oe=()=>Rt.createComment(""),Te=e=>e===null||typeof e!="object"&&typeof e!="function",Cn=Array.isArray,il=e=>Cn(e)||typeof(e==null?void 0:e[Symbol.iterator])=="function",Ui=`[ \f\r]`,_e=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Zn=/-->/g,Kn=/>/g,Nt=RegExp(`>|${Ui}(?:([^\\s"'>=/]+)(${Ui}*=${Ui}*(?:[^ -\f\r"'\`<>=]|("|')|))|$)`,"g"),to=/'/g,eo=/"/g,vs=/^(?:script|style|textarea|title)$/i,nl=e=>(t,...i)=>({_$litType$:e,strings:t,values:i}),m=nl(1),zt=Symbol.for("lit-noChange"),M=Symbol.for("lit-nothing"),io=new WeakMap,Mt=Dt.createTreeWalker(Dt,129);function ys(e,t){if(!Cn(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return Qn!==void 0?Qn.createHTML(t):t}const ol=(e,t)=>{const i=e.length-1,n=[];let o,s=t===2?"":t===3?"":"",r=_e;for(let a=0;a"?(r=o??_e,c=-1):u[1]===void 0?c=-2:(c=r.lastIndex-u[2].length,d=u[1],r=u[3]===void 0?Nt:u[3]==='"'?eo:to):r===eo||r===to?r=Nt:r===Zn||r===Kn?r=_e:(r=Nt,o=void 0);const p=r===Nt&&e[a+1].startsWith("/>")?" ":"";s+=r===_e?l+el:c>=0?(n.push(d),l.slice(0,c)+fs+l.slice(c)+xt+p):l+xt+(c===-2?a:p)}return[ys(e,s+(e[i]||"")+(t===2?"":t===3?"":"")),n]};class Ie{constructor({strings:t,_$litType$:i},n){let o;this.parts=[];let s=0,r=0;const a=t.length-1,l=this.parts,[d,u]=ol(t,i);if(this.el=Ie.createElement(d,n),Mt.currentNode=this.el.content,i===2||i===3){const c=this.el.content.firstChild;c.replaceWith(...c.childNodes)}for(;(o=Mt.nextNode())!==null&&l.length0){o.textContent=bi?bi.emptyScript:"";for(let p=0;p2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=M}_$AI(t,i=this,n,o){const s=this.strings;let r=!1;if(s===void 0)t=te(this,t,i,0),r=!Te(t)||t!==this._$AH&&t!==zt,r&&(this._$AH=t);else{const a=t;let l,d;for(t=s[0],l=0;l{const n=(i==null?void 0:i.renderBefore)??t;let o=n._$litPart$;if(o===void 0){const s=(i==null?void 0:i.renderBefore)??null;n._$litPart$=o=new Be(t.insertBefore(Oe(),s),s,void 0,i??{})}return o._$AI(e),o};/** +\f\r"'\`<>=]|("|')|))|$)`,"g"),to=/'/g,eo=/"/g,vs=/^(?:script|style|textarea|title)$/i,nl=e=>(t,...i)=>({_$litType$:e,strings:t,values:i}),m=nl(1),zt=Symbol.for("lit-noChange"),M=Symbol.for("lit-nothing"),io=new WeakMap,Mt=Rt.createTreeWalker(Rt,129);function ys(e,t){if(!Cn(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return Qn!==void 0?Qn.createHTML(t):t}const ol=(e,t)=>{const i=e.length-1,n=[];let o,s=t===2?"":t===3?"":"",r=_e;for(let a=0;a"?(r=o??_e,c=-1):u[1]===void 0?c=-2:(c=r.lastIndex-u[2].length,d=u[1],r=u[3]===void 0?Nt:u[3]==='"'?eo:to):r===eo||r===to?r=Nt:r===Zn||r===Kn?r=_e:(r=Nt,o=void 0);const p=r===Nt&&e[a+1].startsWith("/>")?" ":"";s+=r===_e?l+el:c>=0?(n.push(d),l.slice(0,c)+fs+l.slice(c)+xt+p):l+xt+(c===-2?a:p)}return[ys(e,s+(e[i]||"")+(t===2?"":t===3?"":"")),n]};class Ie{constructor({strings:t,_$litType$:i},n){let o;this.parts=[];let s=0,r=0;const a=t.length-1,l=this.parts,[d,u]=ol(t,i);if(this.el=Ie.createElement(d,n),Mt.currentNode=this.el.content,i===2||i===3){const c=this.el.content.firstChild;c.replaceWith(...c.childNodes)}for(;(o=Mt.nextNode())!==null&&l.length0){o.textContent=bi?bi.emptyScript:"";for(let p=0;p2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=M}_$AI(t,i=this,n,o){const s=this.strings;let r=!1;if(s===void 0)t=te(this,t,i,0),r=!Te(t)||t!==this._$AH&&t!==zt,r&&(this._$AH=t);else{const a=t;let l,d;for(t=s[0],l=0;l{const n=(i==null?void 0:i.renderBefore)??t;let o=n._$litPart$;if(o===void 0){const s=(i==null?void 0:i.renderBefore)??null;n._$litPart$=o=new Be(t.insertBefore(Oe(),s),s,void 0,i??{})}return o._$AI(e),o};/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause @@ -50,7 +50,7 @@ import{e as De,t as fn,a as gn,L as Ur,i as Vr,_ as Ht,J as at,E as Wr,b as Gr,m * * @license MIT * @version 2.0.0 -*/const Cs=Object.freeze({left:0,top:0,width:16,height:16}),gi=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Ue=Object.freeze({...Cs,...gi}),en=Object.freeze({...Ue,body:"",hidden:!1}),vl=Object.freeze({width:null,height:null}),Es=Object.freeze({...vl,...gi});function yl(e,t=0){const i=e.replace(/^-?[0-9.]*/,"");function n(o){for(;o<0;)o+=4;return o%4}if(i===""){const o=parseInt(e);return isNaN(o)?0:n(o)}else if(i!==e){let o=0;switch(i){case"%":o=25;break;case"deg":o=90}if(o){let s=parseFloat(e.slice(0,e.length-i.length));return isNaN(s)?0:(s=s/o,s%1===0?n(s):0)}}return t}const _l=/[\s,]+/;function xl(e,t){t.split(_l).forEach(i=>{switch(i.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}const As={...Es,preserveAspectRatio:""};function ro(e){const t={...As},i=(n,o)=>e.getAttribute(n)||o;return t.width=i("width",null),t.height=i("height",null),t.rotate=yl(i("rotate","")),xl(t,i("flip","")),t.preserveAspectRatio=i("preserveAspectRatio",i("preserveaspectratio","")),t}function wl(e,t){for(const i in As)if(e[i]!==t[i])return!0;return!1}const Ee=/^[a-z0-9]+(-[a-z0-9]+)*$/,Ve=(e,t,i,n="")=>{const o=e.split(":");if(e.slice(0,1)==="@"){if(o.length<2||o.length>3)return null;n=o.shift().slice(1)}if(o.length>3||!o.length)return null;if(o.length>1){const a=o.pop(),l=o.pop(),d={provider:o.length>0?o[0]:n,prefix:l,name:a};return t&&!si(d)?null:d}const s=o[0],r=s.split("-");if(r.length>1){const a={provider:n,prefix:r.shift(),name:r.join("-")};return t&&!si(a)?null:a}if(i&&n===""){const a={provider:n,prefix:"",name:s};return t&&!si(a,i)?null:a}return null},si=(e,t)=>e?!!((e.provider===""||e.provider.match(Ee))&&(t&&e.prefix===""||e.prefix.match(Ee))&&e.name.match(Ee)):!1;function $l(e,t){const i={};!e.hFlip!=!t.hFlip&&(i.hFlip=!0),!e.vFlip!=!t.vFlip&&(i.vFlip=!0);const n=((e.rotate||0)+(t.rotate||0))%4;return n&&(i.rotate=n),i}function ao(e,t){const i=$l(e,t);for(const n in en)n in gi?n in e&&!(n in i)&&(i[n]=gi[n]):n in t?i[n]=t[n]:n in e&&(i[n]=e[n]);return i}function Cl(e,t){const i=e.icons,n=e.aliases||Object.create(null),o=Object.create(null);function s(r){if(i[r])return o[r]=[];if(!(r in o)){o[r]=null;const a=n[r]&&n[r].parent,l=a&&s(a);l&&(o[r]=[a].concat(l))}return o[r]}return Object.keys(i).concat(Object.keys(n)).forEach(s),o}function El(e,t,i){const n=e.icons,o=e.aliases||Object.create(null);let s={};function r(a){s=ao(n[a]||o[a],s)}return r(t),i.forEach(r),ao(e,s)}function Ss(e,t){const i=[];if(typeof e!="object"||typeof e.icons!="object")return i;e.not_found instanceof Array&&e.not_found.forEach(o=>{t(o,null),i.push(o)});const n=Cl(e);for(const o in n){const s=n[o];s&&(t(o,El(e,o,s)),i.push(o))}return i}const Al={provider:"",aliases:{},not_found:{},...Cs};function Wi(e,t){for(const i in t)if(i in e&&typeof e[i]!=typeof t[i])return!1;return!0}function ks(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.prefix!="string"||!e.icons||typeof e.icons!="object"||!Wi(e,Al))return null;const i=t.icons;for(const o in i){const s=i[o];if(!o.match(Ee)||typeof s.body!="string"||!Wi(s,en))return null}const n=t.aliases||Object.create(null);for(const o in n){const s=n[o],r=s.parent;if(!o.match(Ee)||typeof r!="string"||!i[r]&&!n[r]||!Wi(s,en))return null}return t}const vi=Object.create(null);function Sl(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function Et(e,t){const i=vi[e]||(vi[e]=Object.create(null));return i[t]||(i[t]=Sl(e,t))}function En(e,t){return ks(t)?Ss(t,(i,n)=>{n?e.icons[i]=n:e.missing.add(i)}):[]}function kl(e,t,i){try{if(typeof i.body=="string")return e.icons[t]={...i},!0}catch{}return!1}function Ol(e,t){let i=[];return(typeof e=="string"?[e]:Object.keys(vi)).forEach(n=>{(typeof n=="string"&&typeof t=="string"?[t]:Object.keys(vi[n]||{})).forEach(o=>{const s=Et(n,o);i=i.concat(Object.keys(s.icons).map(r=>(n!==""?"@"+n+":":"")+o+":"+r))})}),i}let Ne=!1;function Os(e){return typeof e=="boolean"&&(Ne=e),Ne}function Pe(e){const t=typeof e=="string"?Ve(e,!0,Ne):e;if(t){const i=Et(t.provider,t.prefix),n=t.name;return i.icons[n]||(i.missing.has(n)?null:void 0)}}function Ts(e,t){const i=Ve(e,!0,Ne);if(!i)return!1;const n=Et(i.provider,i.prefix);return kl(n,i.name,t)}function lo(e,t){if(typeof e!="object")return!1;if(typeof t!="string"&&(t=e.provider||""),Ne&&!t&&!e.prefix){let o=!1;return ks(e)&&(e.prefix="",Ss(e,(s,r)=>{r&&Ts(s,r)&&(o=!0)})),o}const i=e.prefix;if(!si({provider:t,prefix:i,name:"a"}))return!1;const n=Et(t,i);return!!En(n,e)}function co(e){return!!Pe(e)}function Tl(e){const t=Pe(e);return t?{...Ue,...t}:null}function Il(e){const t={loaded:[],missing:[],pending:[]},i=Object.create(null);e.sort((o,s)=>o.provider!==s.provider?o.provider.localeCompare(s.provider):o.prefix!==s.prefix?o.prefix.localeCompare(s.prefix):o.name.localeCompare(s.name));let n={provider:"",prefix:"",name:""};return e.forEach(o=>{if(n.name===o.name&&n.prefix===o.prefix&&n.provider===o.provider)return;n=o;const s=o.provider,r=o.prefix,a=o.name,l=i[s]||(i[s]=Object.create(null)),d=l[r]||(l[r]=Et(s,r));let u;a in d.icons?u=t.loaded:r===""||d.missing.has(a)?u=t.missing:u=t.pending;const c={provider:s,prefix:r,name:a};u.push(c)}),t}function Is(e,t){e.forEach(i=>{const n=i.loaderCallbacks;n&&(i.loaderCallbacks=n.filter(o=>o.id!==t))})}function Nl(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let i=!1;const n=e.provider,o=e.prefix;t.forEach(s=>{const r=s.icons,a=r.pending.length;r.pending=r.pending.filter(l=>{if(l.prefix!==o)return!0;const d=l.name;if(e.icons[d])r.loaded.push({provider:n,prefix:o,name:d});else if(e.missing.has(d))r.missing.push({provider:n,prefix:o,name:d});else return i=!0,!0;return!1}),r.pending.length!==a&&(i||Is([e],s.id),s.callback(r.loaded.slice(0),r.missing.slice(0),r.pending.slice(0),s.abort))})}))}let Pl=0;function Ml(e,t,i){const n=Pl++,o=Is.bind(null,i,n);if(!t.pending.length)return o;const s={id:n,icons:t,callback:e,abort:o};return i.forEach(r=>{(r.loaderCallbacks||(r.loaderCallbacks=[])).push(s)}),o}const nn=Object.create(null);function uo(e,t){nn[e]=t}function on(e){return nn[e]||nn[""]}function Ll(e,t=!0,i=!1){const n=[];return e.forEach(o=>{const s=typeof o=="string"?Ve(o,t,i):o;s&&n.push(s)}),n}var jl={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function Rl(e,t,i,n){const o=e.resources.length,s=e.random?Math.floor(Math.random()*o):e.index;let r;if(e.random){let C=e.resources.slice(0);for(r=[];C.length>1;){const A=Math.floor(Math.random()*C.length);r.push(C[A]),C=C.slice(0,A).concat(C.slice(A+1))}r=r.concat(C)}else r=e.resources.slice(s).concat(e.resources.slice(0,s));const a=Date.now();let l="pending",d=0,u,c=null,h=[],p=[];typeof n=="function"&&p.push(n);function g(){c&&(clearTimeout(c),c=null)}function _(){l==="pending"&&(l="aborted"),g(),h.forEach(C=>{C.status==="pending"&&(C.status="aborted")}),h=[]}function v(C,A){A&&(p=[]),typeof C=="function"&&p.push(C)}function f(){return{startTime:a,payload:t,status:l,queriesSent:d,queriesPending:h.length,subscribe:v,abort:_}}function y(){l="failed",p.forEach(C=>{C(void 0,u)})}function x(){h.forEach(C=>{C.status==="pending"&&(C.status="aborted")}),h=[]}function w(C,A,N){const $=A!=="success";switch(h=h.filter(S=>S!==C),l){case"pending":break;case"failed":if($||!e.dataAfterTimeout)return;break;default:return}if(A==="abort"){u=N,y();return}if($){u=N,h.length||(r.length?E():y());return}if(g(),x(),!e.random){const S=e.resources.indexOf(C.resource);S!==-1&&S!==e.index&&(e.index=S)}l="completed",p.forEach(S=>{S(N)})}function E(){if(l!=="pending")return;g();const C=r.shift();if(C===void 0){if(h.length){c=setTimeout(()=>{g(),l==="pending"&&(x(),y())},e.timeout);return}y();return}const A={status:"pending",resource:C,callback:(N,$)=>{w(A,N,$)}};h.push(A),d++,c=setTimeout(E,e.rotate),i(C,t,A.callback)}return setTimeout(E),f}function Ns(e){const t={...jl,...e};let i=[];function n(){i=i.filter(r=>r().status==="pending")}function o(r,a,l){const d=Rl(t,r,a,(u,c)=>{n(),l&&l(u,c)});return i.push(d),d}function s(r){return i.find(a=>r(a))||null}return{query:o,find:s,setIndex:r=>{t.index=r},getIndex:()=>t.index,cleanup:n}}function An(e){let t;if(typeof e.resources=="string")t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}const Ni=Object.create(null),ei=["https://api.simplesvg.com","https://api.unisvg.com"],sn=[];for(;ei.length>0;)ei.length===1||Math.random()>.5?sn.push(ei.shift()):sn.push(ei.pop());Ni[""]=An({resources:["https://api.iconify.design"].concat(sn)});function ho(e,t){const i=An(t);return i===null?!1:(Ni[e]=i,!0)}function Pi(e){return Ni[e]}function Dl(){return Object.keys(Ni)}function po(){}const Gi=Object.create(null);function zl(e){if(!Gi[e]){const t=Pi(e);if(!t)return;const i=Ns(t),n={config:t,redundancy:i};Gi[e]=n}return Gi[e]}function Ps(e,t,i){let n,o;if(typeof e=="string"){const s=on(e);if(!s)return i(void 0,424),po;o=s.send;const r=zl(e);r&&(n=r.redundancy)}else{const s=An(e);if(s){n=Ns(s);const r=e.resources?e.resources[0]:"",a=on(r);a&&(o=a.send)}}return!n||!o?(i(void 0,424),po):n.query(t,o,i)().abort}const mo="iconify2",Me="iconify",Ms=Me+"-count",bo=Me+"-version",Ls=36e5,Fl=168,Hl=50;function rn(e,t){try{return e.getItem(t)}catch{}}function Sn(e,t,i){try{return e.setItem(t,i),!0}catch{}}function fo(e,t){try{e.removeItem(t)}catch{}}function an(e,t){return Sn(e,Ms,t.toString())}function ln(e){return parseInt(rn(e,Ms))||0}const jt={local:!0,session:!0},js={local:new Set,session:new Set};let kn=!1;function Bl(e){kn=e}let ii=typeof window>"u"?{}:window;function Rs(e){const t=e+"Storage";try{if(ii&&ii[t]&&typeof ii[t].length=="number")return ii[t]}catch{}jt[e]=!1}function Ds(e,t){const i=Rs(e);if(!i)return;const n=rn(i,bo);if(n!==mo){if(n){const a=ln(i);for(let l=0;l{const l=Me+a.toString(),d=rn(i,l);if(typeof d=="string"){try{const u=JSON.parse(d);if(typeof u=="object"&&typeof u.cached=="number"&&u.cached>o&&typeof u.provider=="string"&&typeof u.data=="object"&&typeof u.data.prefix=="string"&&t(u,a))return!0}catch{}fo(i,l)}};let r=ln(i);for(let a=r-1;a>=0;a--)s(a)||(a===r-1?(r--,an(i,r)):js[e].add(a))}function zs(){if(!kn){Bl(!0);for(const e in jt)Ds(e,t=>{const i=t.data,n=t.provider,o=i.prefix,s=Et(n,o);if(!En(s,i).length)return!1;const r=i.lastModified||-1;return s.lastModifiedCached=s.lastModifiedCached?Math.min(s.lastModifiedCached,r):r,!0})}}function Ul(e,t){const i=e.lastModifiedCached;if(i&&i>=t)return i===t;if(e.lastModifiedCached=t,i)for(const n in jt)Ds(n,o=>{const s=o.data;return o.provider!==e.provider||s.prefix!==e.prefix||s.lastModified===t});return!0}function Vl(e,t){kn||zs();function i(n){let o;if(!jt[n]||!(o=Rs(n)))return;const s=js[n];let r;if(s.size)s.delete(r=Array.from(s).shift());else if(r=ln(o),r>=Hl||!an(o,r+1))return;const a={cached:Math.floor(Date.now()/Ls),provider:e.provider,data:t};return Sn(o,Me+r.toString(),JSON.stringify(a))}t.lastModified&&!Ul(e,t.lastModified)||Object.keys(t.icons).length&&(t.not_found&&(t=Object.assign({},t),delete t.not_found),i("local")||i("session"))}function go(){}function Wl(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,Nl(e)}))}function Gl(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;const{provider:i,prefix:n}=e,o=e.iconsToLoad;delete e.iconsToLoad;let s;!o||!(s=on(i))||s.prepare(i,n,o).forEach(r=>{Ps(i,r,a=>{if(typeof a!="object")r.icons.forEach(l=>{e.missing.add(l)});else try{const l=En(e,a);if(!l.length)return;const d=e.pendingIcons;d&&l.forEach(u=>{d.delete(u)}),Vl(e,a)}catch(l){console.error(l)}Wl(e)})})}))}const On=(e,t)=>{const i=Ll(e,!0,Os()),n=Il(i);if(!n.pending.length){let l=!0;return t&&setTimeout(()=>{l&&t(n.loaded,n.missing,n.pending,go)}),()=>{l=!1}}const o=Object.create(null),s=[];let r,a;return n.pending.forEach(l=>{const{provider:d,prefix:u}=l;if(u===a&&d===r)return;r=d,a=u,s.push(Et(d,u));const c=o[d]||(o[d]=Object.create(null));c[u]||(c[u]=[])}),n.pending.forEach(l=>{const{provider:d,prefix:u,name:c}=l,h=Et(d,u),p=h.pendingIcons||(h.pendingIcons=new Set);p.has(c)||(p.add(c),o[d][u].push(c))}),s.forEach(l=>{const{provider:d,prefix:u}=l;o[d][u].length&&Gl(l,o[d][u])}),t?Ml(t,n,s):go},ql=e=>new Promise((t,i)=>{const n=typeof e=="string"?Ve(e,!0):e;if(!n){i(e);return}On([n||e],o=>{if(o.length&&n){const s=Pe(n);if(s){t({...Ue,...s});return}}i(e)})});function Yl(e){try{const t=typeof e=="string"?JSON.parse(e):e;if(typeof t.body=="string")return{...t}}catch{}}function Xl(e,t){const i=typeof e=="string"?Ve(e,!0,!0):null;if(!i){const s=Yl(e);return{value:e,data:s}}const n=Pe(i);if(n!==void 0||!i.prefix)return{value:e,name:i,data:n};const o=On([i],()=>t(e,i,Pe(i)));return{value:e,name:i,loading:o}}function qi(e){return e.hasAttribute("inline")}let Fs=!1;try{Fs=navigator.vendor.indexOf("Apple")===0}catch{}function Jl(e,t){switch(t){case"svg":case"bg":case"mask":return t}return t!=="style"&&(Fs||e.indexOf("=0;){const o=e.indexOf(">",n),s=e.indexOf("",s);if(r===-1)break;i+=e.slice(o+1,s).trim(),e=e.slice(0,n).trim()+e.slice(r+1)}return{defs:i,content:e}}function tc(e,t){return e?""+e+""+t:t}function ec(e,t,i){const n=Kl(e);return tc(n.defs,t+n.content+i)}const ic=e=>e==="unset"||e==="undefined"||e==="none";function Hs(e,t){const i={...Ue,...e},n={...Es,...t},o={left:i.left,top:i.top,width:i.width,height:i.height};let s=i.body;[i,n].forEach(_=>{const v=[],f=_.hFlip,y=_.vFlip;let x=_.rotate;f?y?x+=2:(v.push("translate("+(o.width+o.left).toString()+" "+(0-o.top).toString()+")"),v.push("scale(-1 1)"),o.top=o.left=0):y&&(v.push("translate("+(0-o.left).toString()+" "+(o.height+o.top).toString()+")"),v.push("scale(1 -1)"),o.top=o.left=0);let w;switch(x<0&&(x-=Math.floor(x/4)*4),x=x%4,x){case 1:w=o.height/2+o.top,v.unshift("rotate(90 "+w.toString()+" "+w.toString()+")");break;case 2:v.unshift("rotate(180 "+(o.width/2+o.left).toString()+" "+(o.height/2+o.top).toString()+")");break;case 3:w=o.width/2+o.left,v.unshift("rotate(-90 "+w.toString()+" "+w.toString()+")");break}x%2===1&&(o.left!==o.top&&(w=o.left,o.left=o.top,o.top=w),o.width!==o.height&&(w=o.width,o.width=o.height,o.height=w)),v.length&&(s=ec(s,'',""))});const r=n.width,a=n.height,l=o.width,d=o.height;let u,c;r===null?(c=a===null?"1em":a==="auto"?d:a,u=cn(c,l/d)):(u=r==="auto"?l:r,c=a===null?cn(u,d/l):a==="auto"?d:a);const h={},p=(_,v)=>{ic(v)||(h[_]=v.toString())};p("width",u),p("height",c);const g=[o.left,o.top,l,d];return h.viewBox=g.join(" "),{attributes:h,viewBox:g,body:s}}function Tn(e,t){let i=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const n in t)i+=" "+n+'="'+t[n]+'"';return'"+e+""}function nc(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(//g,"%3E").replace(/\s+/g," ")}function oc(e){return"data:image/svg+xml,"+nc(e)}function Bs(e){return'url("'+oc(e)+'")'}const sc=()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}};let yi=sc();function rc(e){yi=e}function ac(){return yi}function lc(e,t){const i=Pi(e);if(!i)return 0;let n;if(!i.maxURL)n=0;else{let o=0;i.resources.forEach(r=>{o=Math.max(o,r.length)});const s=t+".json?icons=";n=i.maxURL-o-i.path.length-s.length}return n}function cc(e){return e===404}const dc=(e,t,i)=>{const n=[],o=lc(e,t),s="icons";let r={type:s,provider:e,prefix:t,icons:[]},a=0;return i.forEach((l,d)=>{a+=l.length+1,a>=o&&d>0&&(n.push(r),r={type:s,provider:e,prefix:t,icons:[]},a=l.length),r.icons.push(l)}),n.push(r),n};function uc(e){if(typeof e=="string"){const t=Pi(e);if(t)return t.path}return"/"}const hc=(e,t,i)=>{if(!yi){i("abort",424);return}let n=uc(t.provider);switch(t.type){case"icons":{const s=t.prefix,r=t.icons.join(","),a=new URLSearchParams({icons:r});n+=s+".json?"+a.toString();break}case"custom":{const s=t.uri;n+=s.slice(0,1)==="/"?s.slice(1):s;break}default:i("abort",400);return}let o=503;yi(e+n).then(s=>{const r=s.status;if(r!==200){setTimeout(()=>{i(cc(r)?"abort":"next",r)});return}return o=501,s.json()}).then(s=>{if(typeof s!="object"||s===null){setTimeout(()=>{s===404?i("abort",s):i("next",o)});return}setTimeout(()=>{i("success",s)})}).catch(()=>{i("next",o)})},pc={prepare:dc,send:hc};function vo(e,t){switch(e){case"local":case"session":jt[e]=t;break;case"all":for(const i in jt)jt[i]=t;break}}const Yi="data-style";let Us="";function mc(e){Us=e}function yo(e,t){let i=Array.from(e.childNodes).find(n=>n.hasAttribute&&n.hasAttribute(Yi));i||(i=document.createElement("style"),i.setAttribute(Yi,Yi),e.appendChild(i)),i.textContent=":host{display:inline-block;vertical-align:"+(t?"-0.125em":"0")+"}span,svg{display:block}"+Us}function Vs(){uo("",pc),Os(!0);let e;try{e=window}catch{}if(e){if(zs(),e.IconifyPreload!==void 0){const t=e.IconifyPreload,i="Invalid IconifyPreload syntax.";typeof t=="object"&&t!==null&&(t instanceof Array?t:[t]).forEach(n=>{try{(typeof n!="object"||n===null||n instanceof Array||typeof n.icons!="object"||typeof n.prefix!="string"||!lo(n))&&console.error(i)}catch{console.error(i)}})}if(e.IconifyProviders!==void 0){const t=e.IconifyProviders;if(typeof t=="object"&&t!==null)for(const i in t){const n="IconifyProviders["+i+"] is invalid.";try{const o=t[i];if(typeof o!="object"||!o||o.resources===void 0)continue;ho(i,o)||console.error(n)}catch{console.error(n)}}}}return{enableCache:t=>vo(t,!0),disableCache:t=>vo(t,!1),iconLoaded:co,iconExists:co,getIcon:Tl,listIcons:Ol,addIcon:Ts,addCollection:lo,calculateSize:cn,buildIcon:Hs,iconToHTML:Tn,svgToURL:Bs,loadIcons:On,loadIcon:ql,addAPIProvider:ho,appendCustomStyle:mc,_api:{getAPIConfig:Pi,setAPIModule:uo,sendAPIQuery:Ps,setFetch:rc,getFetch:ac,listAPIProviders:Dl}}}const dn={"background-color":"currentColor"},Ws={"background-color":"transparent"},_o={image:"var(--svg)",repeat:"no-repeat",size:"100% 100%"},xo={"-webkit-mask":dn,mask:dn,background:Ws};for(const e in xo){const t=xo[e];for(const i in _o)t[e+"-"+i]=_o[i]}function wo(e){return e?e+(e.match(/^[-0-9.]+$/)?"px":""):"inherit"}function bc(e,t,i){const n=document.createElement("span");let o=e.body;o.indexOf("");const s=e.attributes,r=Tn(o,{...s,width:t.width+"",height:t.height+""}),a=Bs(r),l=n.style,d={"--svg":a,width:wo(s.width),height:wo(s.height),...i?dn:Ws};for(const u in d)l.setProperty(u,d[u]);return n}let Ae;function fc(){try{Ae=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch{Ae=null}}function gc(e){return Ae===void 0&&fc(),Ae?Ae.createHTML(e):e}function vc(e){const t=document.createElement("span"),i=e.attributes;let n="";i.width||(n="width: inherit;"),i.height||(n+="height: inherit;"),n&&(i.style=n);const o=Tn(e.body,i);return t.innerHTML=gc(o),t.firstChild}function un(e){return Array.from(e.childNodes).find(t=>{const i=t.tagName&&t.tagName.toUpperCase();return i==="SPAN"||i==="SVG"})}function $o(e,t){const i=t.icon.data,n=t.customisations,o=Hs(i,n);n.preserveAspectRatio&&(o.attributes.preserveAspectRatio=n.preserveAspectRatio);const s=t.renderedMode;let r;switch(s){case"svg":r=vc(o);break;default:r=bc(o,{...Ue,...i},s==="mask")}const a=un(e);a?r.tagName==="SPAN"&&a.tagName===r.tagName?a.setAttribute("style",r.getAttribute("style")):e.replaceChild(r,a):e.appendChild(r)}function Co(e,t,i){const n=i&&(i.rendered?i:i.lastRender);return{rendered:!1,inline:t,icon:e,lastRender:n}}function yc(e="iconify-icon"){let t,i;try{t=window.customElements,i=window.HTMLElement}catch{return}if(!t||!i)return;const n=t.get(e);if(n)return n;const o=["icon","mode","inline","observe","width","height","rotate","flip"],s=class extends i{constructor(){super(),It(this,"_shadowRoot"),It(this,"_initialised",!1),It(this,"_state"),It(this,"_checkQueued",!1),It(this,"_connected",!1),It(this,"_observer",null),It(this,"_visible",!0);const a=this._shadowRoot=this.attachShadow({mode:"open"}),l=qi(this);yo(a,l),this._state=Co({value:""},l),this._queueCheck()}connectedCallback(){this._connected=!0,this.startObserver()}disconnectedCallback(){this._connected=!1,this.stopObserver()}static get observedAttributes(){return o.slice(0)}attributeChangedCallback(a){switch(a){case"inline":{const l=qi(this),d=this._state;l!==d.inline&&(d.inline=l,yo(this._shadowRoot,l));break}case"observer":{this.observer?this.startObserver():this.stopObserver();break}default:this._queueCheck()}}get icon(){const a=this.getAttribute("icon");if(a&&a.slice(0,1)==="{")try{return JSON.parse(a)}catch{}return a}set icon(a){typeof a=="object"&&(a=JSON.stringify(a)),this.setAttribute("icon",a)}get inline(){return qi(this)}set inline(a){a?this.setAttribute("inline","true"):this.removeAttribute("inline")}get observer(){return this.hasAttribute("observer")}set observer(a){a?this.setAttribute("observer","true"):this.removeAttribute("observer")}restartAnimation(){const a=this._state;if(a.rendered){const l=this._shadowRoot;if(a.renderedMode==="svg")try{l.lastChild.setCurrentTime(0);return}catch{}$o(l,a)}}get status(){const a=this._state;return a.rendered?"rendered":a.icon.data===null?"failed":"loading"}_queueCheck(){this._checkQueued||(this._checkQueued=!0,setTimeout(()=>{this._check()}))}_check(){if(!this._checkQueued)return;this._checkQueued=!1;const a=this._state,l=this.getAttribute("icon");if(l!==a.icon.value){this._iconChanged(l);return}if(!a.rendered||!this._visible)return;const d=this.getAttribute("mode"),u=ro(this);(a.attrMode!==d||wl(a.customisations,u)||!un(this._shadowRoot))&&this._renderIcon(a.icon,u,d)}_iconChanged(a){const l=Xl(a,(d,u,c)=>{const h=this._state;if(h.rendered||this.getAttribute("icon")!==d)return;const p={value:d,name:u,data:c};p.data?this._gotIconData(p):h.icon=p});l.data?this._gotIconData(l):this._state=Co(l,this._state.inline,this._state)}_forceRender(){if(!this._visible){const a=un(this._shadowRoot);a&&this._shadowRoot.removeChild(a);return}this._queueCheck()}_gotIconData(a){this._checkQueued=!1,this._renderIcon(a,ro(this),this.getAttribute("mode"))}_renderIcon(a,l,d){const u=Jl(a.data.body,d),c=this._state.inline;$o(this._shadowRoot,this._state={rendered:!0,icon:a,inline:c,customisations:l,attrMode:d,renderedMode:u})}startObserver(){if(!this._observer)try{this._observer=new IntersectionObserver(a=>{const l=a.some(d=>d.isIntersecting);l!==this._visible&&(this._visible=l,this._forceRender())}),this._observer.observe(this)}catch{if(this._observer){try{this._observer.disconnect()}catch{}this._observer=null}}}stopObserver(){this._observer&&(this._observer.disconnect(),this._observer=null,this._visible=!0,this._connected&&this._forceRender())}};o.forEach(a=>{a in s.prototype||Object.defineProperty(s.prototype,a,{get:function(){return this.getAttribute(a)},set:function(l){l!==null?this.setAttribute(a,l):this.removeAttribute(a)}})});const r=Vs();for(const a in r)s[a]=s.prototype[a]=r[a];return t.define(e,s),s}yc()||Vs();var _c=Object.defineProperty,xc=Object.getOwnPropertyDescriptor,tt=(e,t,i,n)=>{for(var o=n>1?void 0:n?xc(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(o=(n?r(t,i,o):r(o))||o);return n&&o&&_c(t,i,o),o};const Gs=class extends T{constructor(){super(),this.labelHidden=!1,this.active=!1,this.disabled=!1,this.vertical=!1,this.tooltipVisible=!1,this._stateBeforeLoading={disabled:!1,icon:""},this._loading=!1,this._parent=ie(),this._tooltip=ie(),this._mouseLeave=!1,this.onClick=e=>{e.stopPropagation(),this.disabled||this.dispatchEvent(new Event("click"))},this.showContextMenu=()=>{const e=this._contextMenu;e&&(e.visible=!0)},this.mouseLeave=!0}set loading(e){if(this._loading=e,e)this._stateBeforeLoading={disabled:this.disabled,icon:this.icon},this.disabled=e,this.icon="eos-icons:loading";else{const{disabled:t,icon:i}=this._stateBeforeLoading;this.disabled=t,this.icon=i}}get loading(){return this._loading}set mouseLeave(e){this._mouseLeave=e,e&&(this.tooltipVisible=!1,clearTimeout(this.timeoutID))}get mouseLeave(){return this._mouseLeave}computeTooltipPosition(){const{value:e}=this._parent,{value:t}=this._tooltip;e&&t&&ms(e,t,{placement:"bottom",middleware:[es(10),ps(),hs(),us({padding:5})]}).then(i=>{const{x:n,y:o}=i;Object.assign(t.style,{left:`${n}px`,top:`${o}px`})})}onMouseEnter(){if(!(this.tooltipTitle||this.tooltipText))return;this.mouseLeave=!1;const e=this.tooltipTime??700;this.timeoutID=setTimeout(()=>{this.mouseLeave||(this.computeTooltipPosition(),this.tooltipVisible=!0)},e)}click(){this.disabled||super.click()}get _contextMenu(){return this.querySelector("bim-context-menu")}connectedCallback(){super.connectedCallback(),this.addEventListener("click",this.showContextMenu)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this.showContextMenu)}render(){const e=m` +*/const Cs=Object.freeze({left:0,top:0,width:16,height:16}),gi=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Ue=Object.freeze({...Cs,...gi}),en=Object.freeze({...Ue,body:"",hidden:!1}),vl=Object.freeze({width:null,height:null}),Es=Object.freeze({...vl,...gi});function yl(e,t=0){const i=e.replace(/^-?[0-9.]*/,"");function n(o){for(;o<0;)o+=4;return o%4}if(i===""){const o=parseInt(e);return isNaN(o)?0:n(o)}else if(i!==e){let o=0;switch(i){case"%":o=25;break;case"deg":o=90}if(o){let s=parseFloat(e.slice(0,e.length-i.length));return isNaN(s)?0:(s=s/o,s%1===0?n(s):0)}}return t}const _l=/[\s,]+/;function xl(e,t){t.split(_l).forEach(i=>{switch(i.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}const As={...Es,preserveAspectRatio:""};function ro(e){const t={...As},i=(n,o)=>e.getAttribute(n)||o;return t.width=i("width",null),t.height=i("height",null),t.rotate=yl(i("rotate","")),xl(t,i("flip","")),t.preserveAspectRatio=i("preserveAspectRatio",i("preserveaspectratio","")),t}function wl(e,t){for(const i in As)if(e[i]!==t[i])return!0;return!1}const Ee=/^[a-z0-9]+(-[a-z0-9]+)*$/,Ve=(e,t,i,n="")=>{const o=e.split(":");if(e.slice(0,1)==="@"){if(o.length<2||o.length>3)return null;n=o.shift().slice(1)}if(o.length>3||!o.length)return null;if(o.length>1){const a=o.pop(),l=o.pop(),d={provider:o.length>0?o[0]:n,prefix:l,name:a};return t&&!si(d)?null:d}const s=o[0],r=s.split("-");if(r.length>1){const a={provider:n,prefix:r.shift(),name:r.join("-")};return t&&!si(a)?null:a}if(i&&n===""){const a={provider:n,prefix:"",name:s};return t&&!si(a,i)?null:a}return null},si=(e,t)=>e?!!((e.provider===""||e.provider.match(Ee))&&(t&&e.prefix===""||e.prefix.match(Ee))&&e.name.match(Ee)):!1;function $l(e,t){const i={};!e.hFlip!=!t.hFlip&&(i.hFlip=!0),!e.vFlip!=!t.vFlip&&(i.vFlip=!0);const n=((e.rotate||0)+(t.rotate||0))%4;return n&&(i.rotate=n),i}function ao(e,t){const i=$l(e,t);for(const n in en)n in gi?n in e&&!(n in i)&&(i[n]=gi[n]):n in t?i[n]=t[n]:n in e&&(i[n]=e[n]);return i}function Cl(e,t){const i=e.icons,n=e.aliases||Object.create(null),o=Object.create(null);function s(r){if(i[r])return o[r]=[];if(!(r in o)){o[r]=null;const a=n[r]&&n[r].parent,l=a&&s(a);l&&(o[r]=[a].concat(l))}return o[r]}return Object.keys(i).concat(Object.keys(n)).forEach(s),o}function El(e,t,i){const n=e.icons,o=e.aliases||Object.create(null);let s={};function r(a){s=ao(n[a]||o[a],s)}return r(t),i.forEach(r),ao(e,s)}function Ss(e,t){const i=[];if(typeof e!="object"||typeof e.icons!="object")return i;e.not_found instanceof Array&&e.not_found.forEach(o=>{t(o,null),i.push(o)});const n=Cl(e);for(const o in n){const s=n[o];s&&(t(o,El(e,o,s)),i.push(o))}return i}const Al={provider:"",aliases:{},not_found:{},...Cs};function Wi(e,t){for(const i in t)if(i in e&&typeof e[i]!=typeof t[i])return!1;return!0}function ks(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.prefix!="string"||!e.icons||typeof e.icons!="object"||!Wi(e,Al))return null;const i=t.icons;for(const o in i){const s=i[o];if(!o.match(Ee)||typeof s.body!="string"||!Wi(s,en))return null}const n=t.aliases||Object.create(null);for(const o in n){const s=n[o],r=s.parent;if(!o.match(Ee)||typeof r!="string"||!i[r]&&!n[r]||!Wi(s,en))return null}return t}const vi=Object.create(null);function Sl(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function Et(e,t){const i=vi[e]||(vi[e]=Object.create(null));return i[t]||(i[t]=Sl(e,t))}function En(e,t){return ks(t)?Ss(t,(i,n)=>{n?e.icons[i]=n:e.missing.add(i)}):[]}function kl(e,t,i){try{if(typeof i.body=="string")return e.icons[t]={...i},!0}catch{}return!1}function Ol(e,t){let i=[];return(typeof e=="string"?[e]:Object.keys(vi)).forEach(n=>{(typeof n=="string"&&typeof t=="string"?[t]:Object.keys(vi[n]||{})).forEach(o=>{const s=Et(n,o);i=i.concat(Object.keys(s.icons).map(r=>(n!==""?"@"+n+":":"")+o+":"+r))})}),i}let Ne=!1;function Os(e){return typeof e=="boolean"&&(Ne=e),Ne}function Pe(e){const t=typeof e=="string"?Ve(e,!0,Ne):e;if(t){const i=Et(t.provider,t.prefix),n=t.name;return i.icons[n]||(i.missing.has(n)?null:void 0)}}function Ts(e,t){const i=Ve(e,!0,Ne);if(!i)return!1;const n=Et(i.provider,i.prefix);return kl(n,i.name,t)}function lo(e,t){if(typeof e!="object")return!1;if(typeof t!="string"&&(t=e.provider||""),Ne&&!t&&!e.prefix){let o=!1;return ks(e)&&(e.prefix="",Ss(e,(s,r)=>{r&&Ts(s,r)&&(o=!0)})),o}const i=e.prefix;if(!si({provider:t,prefix:i,name:"a"}))return!1;const n=Et(t,i);return!!En(n,e)}function co(e){return!!Pe(e)}function Tl(e){const t=Pe(e);return t?{...Ue,...t}:null}function Il(e){const t={loaded:[],missing:[],pending:[]},i=Object.create(null);e.sort((o,s)=>o.provider!==s.provider?o.provider.localeCompare(s.provider):o.prefix!==s.prefix?o.prefix.localeCompare(s.prefix):o.name.localeCompare(s.name));let n={provider:"",prefix:"",name:""};return e.forEach(o=>{if(n.name===o.name&&n.prefix===o.prefix&&n.provider===o.provider)return;n=o;const s=o.provider,r=o.prefix,a=o.name,l=i[s]||(i[s]=Object.create(null)),d=l[r]||(l[r]=Et(s,r));let u;a in d.icons?u=t.loaded:r===""||d.missing.has(a)?u=t.missing:u=t.pending;const c={provider:s,prefix:r,name:a};u.push(c)}),t}function Is(e,t){e.forEach(i=>{const n=i.loaderCallbacks;n&&(i.loaderCallbacks=n.filter(o=>o.id!==t))})}function Nl(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;const t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let i=!1;const n=e.provider,o=e.prefix;t.forEach(s=>{const r=s.icons,a=r.pending.length;r.pending=r.pending.filter(l=>{if(l.prefix!==o)return!0;const d=l.name;if(e.icons[d])r.loaded.push({provider:n,prefix:o,name:d});else if(e.missing.has(d))r.missing.push({provider:n,prefix:o,name:d});else return i=!0,!0;return!1}),r.pending.length!==a&&(i||Is([e],s.id),s.callback(r.loaded.slice(0),r.missing.slice(0),r.pending.slice(0),s.abort))})}))}let Pl=0;function Ml(e,t,i){const n=Pl++,o=Is.bind(null,i,n);if(!t.pending.length)return o;const s={id:n,icons:t,callback:e,abort:o};return i.forEach(r=>{(r.loaderCallbacks||(r.loaderCallbacks=[])).push(s)}),o}const nn=Object.create(null);function uo(e,t){nn[e]=t}function on(e){return nn[e]||nn[""]}function Ll(e,t=!0,i=!1){const n=[];return e.forEach(o=>{const s=typeof o=="string"?Ve(o,t,i):o;s&&n.push(s)}),n}var jl={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function Dl(e,t,i,n){const o=e.resources.length,s=e.random?Math.floor(Math.random()*o):e.index;let r;if(e.random){let C=e.resources.slice(0);for(r=[];C.length>1;){const A=Math.floor(Math.random()*C.length);r.push(C[A]),C=C.slice(0,A).concat(C.slice(A+1))}r=r.concat(C)}else r=e.resources.slice(s).concat(e.resources.slice(0,s));const a=Date.now();let l="pending",d=0,u,c=null,h=[],p=[];typeof n=="function"&&p.push(n);function g(){c&&(clearTimeout(c),c=null)}function _(){l==="pending"&&(l="aborted"),g(),h.forEach(C=>{C.status==="pending"&&(C.status="aborted")}),h=[]}function v(C,A){A&&(p=[]),typeof C=="function"&&p.push(C)}function f(){return{startTime:a,payload:t,status:l,queriesSent:d,queriesPending:h.length,subscribe:v,abort:_}}function y(){l="failed",p.forEach(C=>{C(void 0,u)})}function x(){h.forEach(C=>{C.status==="pending"&&(C.status="aborted")}),h=[]}function w(C,A,N){const $=A!=="success";switch(h=h.filter(S=>S!==C),l){case"pending":break;case"failed":if($||!e.dataAfterTimeout)return;break;default:return}if(A==="abort"){u=N,y();return}if($){u=N,h.length||(r.length?E():y());return}if(g(),x(),!e.random){const S=e.resources.indexOf(C.resource);S!==-1&&S!==e.index&&(e.index=S)}l="completed",p.forEach(S=>{S(N)})}function E(){if(l!=="pending")return;g();const C=r.shift();if(C===void 0){if(h.length){c=setTimeout(()=>{g(),l==="pending"&&(x(),y())},e.timeout);return}y();return}const A={status:"pending",resource:C,callback:(N,$)=>{w(A,N,$)}};h.push(A),d++,c=setTimeout(E,e.rotate),i(C,t,A.callback)}return setTimeout(E),f}function Ns(e){const t={...jl,...e};let i=[];function n(){i=i.filter(r=>r().status==="pending")}function o(r,a,l){const d=Dl(t,r,a,(u,c)=>{n(),l&&l(u,c)});return i.push(d),d}function s(r){return i.find(a=>r(a))||null}return{query:o,find:s,setIndex:r=>{t.index=r},getIndex:()=>t.index,cleanup:n}}function An(e){let t;if(typeof e.resources=="string")t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}const Ni=Object.create(null),ei=["https://api.simplesvg.com","https://api.unisvg.com"],sn=[];for(;ei.length>0;)ei.length===1||Math.random()>.5?sn.push(ei.shift()):sn.push(ei.pop());Ni[""]=An({resources:["https://api.iconify.design"].concat(sn)});function ho(e,t){const i=An(t);return i===null?!1:(Ni[e]=i,!0)}function Pi(e){return Ni[e]}function Rl(){return Object.keys(Ni)}function po(){}const Gi=Object.create(null);function zl(e){if(!Gi[e]){const t=Pi(e);if(!t)return;const i=Ns(t),n={config:t,redundancy:i};Gi[e]=n}return Gi[e]}function Ps(e,t,i){let n,o;if(typeof e=="string"){const s=on(e);if(!s)return i(void 0,424),po;o=s.send;const r=zl(e);r&&(n=r.redundancy)}else{const s=An(e);if(s){n=Ns(s);const r=e.resources?e.resources[0]:"",a=on(r);a&&(o=a.send)}}return!n||!o?(i(void 0,424),po):n.query(t,o,i)().abort}const mo="iconify2",Me="iconify",Ms=Me+"-count",bo=Me+"-version",Ls=36e5,Fl=168,Hl=50;function rn(e,t){try{return e.getItem(t)}catch{}}function Sn(e,t,i){try{return e.setItem(t,i),!0}catch{}}function fo(e,t){try{e.removeItem(t)}catch{}}function an(e,t){return Sn(e,Ms,t.toString())}function ln(e){return parseInt(rn(e,Ms))||0}const jt={local:!0,session:!0},js={local:new Set,session:new Set};let kn=!1;function Bl(e){kn=e}let ii=typeof window>"u"?{}:window;function Ds(e){const t=e+"Storage";try{if(ii&&ii[t]&&typeof ii[t].length=="number")return ii[t]}catch{}jt[e]=!1}function Rs(e,t){const i=Ds(e);if(!i)return;const n=rn(i,bo);if(n!==mo){if(n){const a=ln(i);for(let l=0;l{const l=Me+a.toString(),d=rn(i,l);if(typeof d=="string"){try{const u=JSON.parse(d);if(typeof u=="object"&&typeof u.cached=="number"&&u.cached>o&&typeof u.provider=="string"&&typeof u.data=="object"&&typeof u.data.prefix=="string"&&t(u,a))return!0}catch{}fo(i,l)}};let r=ln(i);for(let a=r-1;a>=0;a--)s(a)||(a===r-1?(r--,an(i,r)):js[e].add(a))}function zs(){if(!kn){Bl(!0);for(const e in jt)Rs(e,t=>{const i=t.data,n=t.provider,o=i.prefix,s=Et(n,o);if(!En(s,i).length)return!1;const r=i.lastModified||-1;return s.lastModifiedCached=s.lastModifiedCached?Math.min(s.lastModifiedCached,r):r,!0})}}function Ul(e,t){const i=e.lastModifiedCached;if(i&&i>=t)return i===t;if(e.lastModifiedCached=t,i)for(const n in jt)Rs(n,o=>{const s=o.data;return o.provider!==e.provider||s.prefix!==e.prefix||s.lastModified===t});return!0}function Vl(e,t){kn||zs();function i(n){let o;if(!jt[n]||!(o=Ds(n)))return;const s=js[n];let r;if(s.size)s.delete(r=Array.from(s).shift());else if(r=ln(o),r>=Hl||!an(o,r+1))return;const a={cached:Math.floor(Date.now()/Ls),provider:e.provider,data:t};return Sn(o,Me+r.toString(),JSON.stringify(a))}t.lastModified&&!Ul(e,t.lastModified)||Object.keys(t.icons).length&&(t.not_found&&(t=Object.assign({},t),delete t.not_found),i("local")||i("session"))}function go(){}function Wl(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,Nl(e)}))}function Gl(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;const{provider:i,prefix:n}=e,o=e.iconsToLoad;delete e.iconsToLoad;let s;!o||!(s=on(i))||s.prepare(i,n,o).forEach(r=>{Ps(i,r,a=>{if(typeof a!="object")r.icons.forEach(l=>{e.missing.add(l)});else try{const l=En(e,a);if(!l.length)return;const d=e.pendingIcons;d&&l.forEach(u=>{d.delete(u)}),Vl(e,a)}catch(l){console.error(l)}Wl(e)})})}))}const On=(e,t)=>{const i=Ll(e,!0,Os()),n=Il(i);if(!n.pending.length){let l=!0;return t&&setTimeout(()=>{l&&t(n.loaded,n.missing,n.pending,go)}),()=>{l=!1}}const o=Object.create(null),s=[];let r,a;return n.pending.forEach(l=>{const{provider:d,prefix:u}=l;if(u===a&&d===r)return;r=d,a=u,s.push(Et(d,u));const c=o[d]||(o[d]=Object.create(null));c[u]||(c[u]=[])}),n.pending.forEach(l=>{const{provider:d,prefix:u,name:c}=l,h=Et(d,u),p=h.pendingIcons||(h.pendingIcons=new Set);p.has(c)||(p.add(c),o[d][u].push(c))}),s.forEach(l=>{const{provider:d,prefix:u}=l;o[d][u].length&&Gl(l,o[d][u])}),t?Ml(t,n,s):go},ql=e=>new Promise((t,i)=>{const n=typeof e=="string"?Ve(e,!0):e;if(!n){i(e);return}On([n||e],o=>{if(o.length&&n){const s=Pe(n);if(s){t({...Ue,...s});return}}i(e)})});function Yl(e){try{const t=typeof e=="string"?JSON.parse(e):e;if(typeof t.body=="string")return{...t}}catch{}}function Xl(e,t){const i=typeof e=="string"?Ve(e,!0,!0):null;if(!i){const s=Yl(e);return{value:e,data:s}}const n=Pe(i);if(n!==void 0||!i.prefix)return{value:e,name:i,data:n};const o=On([i],()=>t(e,i,Pe(i)));return{value:e,name:i,loading:o}}function qi(e){return e.hasAttribute("inline")}let Fs=!1;try{Fs=navigator.vendor.indexOf("Apple")===0}catch{}function Jl(e,t){switch(t){case"svg":case"bg":case"mask":return t}return t!=="style"&&(Fs||e.indexOf("=0;){const o=e.indexOf(">",n),s=e.indexOf("",s);if(r===-1)break;i+=e.slice(o+1,s).trim(),e=e.slice(0,n).trim()+e.slice(r+1)}return{defs:i,content:e}}function tc(e,t){return e?""+e+""+t:t}function ec(e,t,i){const n=Kl(e);return tc(n.defs,t+n.content+i)}const ic=e=>e==="unset"||e==="undefined"||e==="none";function Hs(e,t){const i={...Ue,...e},n={...Es,...t},o={left:i.left,top:i.top,width:i.width,height:i.height};let s=i.body;[i,n].forEach(_=>{const v=[],f=_.hFlip,y=_.vFlip;let x=_.rotate;f?y?x+=2:(v.push("translate("+(o.width+o.left).toString()+" "+(0-o.top).toString()+")"),v.push("scale(-1 1)"),o.top=o.left=0):y&&(v.push("translate("+(0-o.left).toString()+" "+(o.height+o.top).toString()+")"),v.push("scale(1 -1)"),o.top=o.left=0);let w;switch(x<0&&(x-=Math.floor(x/4)*4),x=x%4,x){case 1:w=o.height/2+o.top,v.unshift("rotate(90 "+w.toString()+" "+w.toString()+")");break;case 2:v.unshift("rotate(180 "+(o.width/2+o.left).toString()+" "+(o.height/2+o.top).toString()+")");break;case 3:w=o.width/2+o.left,v.unshift("rotate(-90 "+w.toString()+" "+w.toString()+")");break}x%2===1&&(o.left!==o.top&&(w=o.left,o.left=o.top,o.top=w),o.width!==o.height&&(w=o.width,o.width=o.height,o.height=w)),v.length&&(s=ec(s,'',""))});const r=n.width,a=n.height,l=o.width,d=o.height;let u,c;r===null?(c=a===null?"1em":a==="auto"?d:a,u=cn(c,l/d)):(u=r==="auto"?l:r,c=a===null?cn(u,d/l):a==="auto"?d:a);const h={},p=(_,v)=>{ic(v)||(h[_]=v.toString())};p("width",u),p("height",c);const g=[o.left,o.top,l,d];return h.viewBox=g.join(" "),{attributes:h,viewBox:g,body:s}}function Tn(e,t){let i=e.indexOf("xlink:")===-1?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(const n in t)i+=" "+n+'="'+t[n]+'"';return'"+e+""}function nc(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(//g,"%3E").replace(/\s+/g," ")}function oc(e){return"data:image/svg+xml,"+nc(e)}function Bs(e){return'url("'+oc(e)+'")'}const sc=()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}};let yi=sc();function rc(e){yi=e}function ac(){return yi}function lc(e,t){const i=Pi(e);if(!i)return 0;let n;if(!i.maxURL)n=0;else{let o=0;i.resources.forEach(r=>{o=Math.max(o,r.length)});const s=t+".json?icons=";n=i.maxURL-o-i.path.length-s.length}return n}function cc(e){return e===404}const dc=(e,t,i)=>{const n=[],o=lc(e,t),s="icons";let r={type:s,provider:e,prefix:t,icons:[]},a=0;return i.forEach((l,d)=>{a+=l.length+1,a>=o&&d>0&&(n.push(r),r={type:s,provider:e,prefix:t,icons:[]},a=l.length),r.icons.push(l)}),n.push(r),n};function uc(e){if(typeof e=="string"){const t=Pi(e);if(t)return t.path}return"/"}const hc=(e,t,i)=>{if(!yi){i("abort",424);return}let n=uc(t.provider);switch(t.type){case"icons":{const s=t.prefix,r=t.icons.join(","),a=new URLSearchParams({icons:r});n+=s+".json?"+a.toString();break}case"custom":{const s=t.uri;n+=s.slice(0,1)==="/"?s.slice(1):s;break}default:i("abort",400);return}let o=503;yi(e+n).then(s=>{const r=s.status;if(r!==200){setTimeout(()=>{i(cc(r)?"abort":"next",r)});return}return o=501,s.json()}).then(s=>{if(typeof s!="object"||s===null){setTimeout(()=>{s===404?i("abort",s):i("next",o)});return}setTimeout(()=>{i("success",s)})}).catch(()=>{i("next",o)})},pc={prepare:dc,send:hc};function vo(e,t){switch(e){case"local":case"session":jt[e]=t;break;case"all":for(const i in jt)jt[i]=t;break}}const Yi="data-style";let Us="";function mc(e){Us=e}function yo(e,t){let i=Array.from(e.childNodes).find(n=>n.hasAttribute&&n.hasAttribute(Yi));i||(i=document.createElement("style"),i.setAttribute(Yi,Yi),e.appendChild(i)),i.textContent=":host{display:inline-block;vertical-align:"+(t?"-0.125em":"0")+"}span,svg{display:block}"+Us}function Vs(){uo("",pc),Os(!0);let e;try{e=window}catch{}if(e){if(zs(),e.IconifyPreload!==void 0){const t=e.IconifyPreload,i="Invalid IconifyPreload syntax.";typeof t=="object"&&t!==null&&(t instanceof Array?t:[t]).forEach(n=>{try{(typeof n!="object"||n===null||n instanceof Array||typeof n.icons!="object"||typeof n.prefix!="string"||!lo(n))&&console.error(i)}catch{console.error(i)}})}if(e.IconifyProviders!==void 0){const t=e.IconifyProviders;if(typeof t=="object"&&t!==null)for(const i in t){const n="IconifyProviders["+i+"] is invalid.";try{const o=t[i];if(typeof o!="object"||!o||o.resources===void 0)continue;ho(i,o)||console.error(n)}catch{console.error(n)}}}}return{enableCache:t=>vo(t,!0),disableCache:t=>vo(t,!1),iconLoaded:co,iconExists:co,getIcon:Tl,listIcons:Ol,addIcon:Ts,addCollection:lo,calculateSize:cn,buildIcon:Hs,iconToHTML:Tn,svgToURL:Bs,loadIcons:On,loadIcon:ql,addAPIProvider:ho,appendCustomStyle:mc,_api:{getAPIConfig:Pi,setAPIModule:uo,sendAPIQuery:Ps,setFetch:rc,getFetch:ac,listAPIProviders:Rl}}}const dn={"background-color":"currentColor"},Ws={"background-color":"transparent"},_o={image:"var(--svg)",repeat:"no-repeat",size:"100% 100%"},xo={"-webkit-mask":dn,mask:dn,background:Ws};for(const e in xo){const t=xo[e];for(const i in _o)t[e+"-"+i]=_o[i]}function wo(e){return e?e+(e.match(/^[-0-9.]+$/)?"px":""):"inherit"}function bc(e,t,i){const n=document.createElement("span");let o=e.body;o.indexOf("");const s=e.attributes,r=Tn(o,{...s,width:t.width+"",height:t.height+""}),a=Bs(r),l=n.style,d={"--svg":a,width:wo(s.width),height:wo(s.height),...i?dn:Ws};for(const u in d)l.setProperty(u,d[u]);return n}let Ae;function fc(){try{Ae=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch{Ae=null}}function gc(e){return Ae===void 0&&fc(),Ae?Ae.createHTML(e):e}function vc(e){const t=document.createElement("span"),i=e.attributes;let n="";i.width||(n="width: inherit;"),i.height||(n+="height: inherit;"),n&&(i.style=n);const o=Tn(e.body,i);return t.innerHTML=gc(o),t.firstChild}function un(e){return Array.from(e.childNodes).find(t=>{const i=t.tagName&&t.tagName.toUpperCase();return i==="SPAN"||i==="SVG"})}function $o(e,t){const i=t.icon.data,n=t.customisations,o=Hs(i,n);n.preserveAspectRatio&&(o.attributes.preserveAspectRatio=n.preserveAspectRatio);const s=t.renderedMode;let r;switch(s){case"svg":r=vc(o);break;default:r=bc(o,{...Ue,...i},s==="mask")}const a=un(e);a?r.tagName==="SPAN"&&a.tagName===r.tagName?a.setAttribute("style",r.getAttribute("style")):e.replaceChild(r,a):e.appendChild(r)}function Co(e,t,i){const n=i&&(i.rendered?i:i.lastRender);return{rendered:!1,inline:t,icon:e,lastRender:n}}function yc(e="iconify-icon"){let t,i;try{t=window.customElements,i=window.HTMLElement}catch{return}if(!t||!i)return;const n=t.get(e);if(n)return n;const o=["icon","mode","inline","observe","width","height","rotate","flip"],s=class extends i{constructor(){super(),It(this,"_shadowRoot"),It(this,"_initialised",!1),It(this,"_state"),It(this,"_checkQueued",!1),It(this,"_connected",!1),It(this,"_observer",null),It(this,"_visible",!0);const a=this._shadowRoot=this.attachShadow({mode:"open"}),l=qi(this);yo(a,l),this._state=Co({value:""},l),this._queueCheck()}connectedCallback(){this._connected=!0,this.startObserver()}disconnectedCallback(){this._connected=!1,this.stopObserver()}static get observedAttributes(){return o.slice(0)}attributeChangedCallback(a){switch(a){case"inline":{const l=qi(this),d=this._state;l!==d.inline&&(d.inline=l,yo(this._shadowRoot,l));break}case"observer":{this.observer?this.startObserver():this.stopObserver();break}default:this._queueCheck()}}get icon(){const a=this.getAttribute("icon");if(a&&a.slice(0,1)==="{")try{return JSON.parse(a)}catch{}return a}set icon(a){typeof a=="object"&&(a=JSON.stringify(a)),this.setAttribute("icon",a)}get inline(){return qi(this)}set inline(a){a?this.setAttribute("inline","true"):this.removeAttribute("inline")}get observer(){return this.hasAttribute("observer")}set observer(a){a?this.setAttribute("observer","true"):this.removeAttribute("observer")}restartAnimation(){const a=this._state;if(a.rendered){const l=this._shadowRoot;if(a.renderedMode==="svg")try{l.lastChild.setCurrentTime(0);return}catch{}$o(l,a)}}get status(){const a=this._state;return a.rendered?"rendered":a.icon.data===null?"failed":"loading"}_queueCheck(){this._checkQueued||(this._checkQueued=!0,setTimeout(()=>{this._check()}))}_check(){if(!this._checkQueued)return;this._checkQueued=!1;const a=this._state,l=this.getAttribute("icon");if(l!==a.icon.value){this._iconChanged(l);return}if(!a.rendered||!this._visible)return;const d=this.getAttribute("mode"),u=ro(this);(a.attrMode!==d||wl(a.customisations,u)||!un(this._shadowRoot))&&this._renderIcon(a.icon,u,d)}_iconChanged(a){const l=Xl(a,(d,u,c)=>{const h=this._state;if(h.rendered||this.getAttribute("icon")!==d)return;const p={value:d,name:u,data:c};p.data?this._gotIconData(p):h.icon=p});l.data?this._gotIconData(l):this._state=Co(l,this._state.inline,this._state)}_forceRender(){if(!this._visible){const a=un(this._shadowRoot);a&&this._shadowRoot.removeChild(a);return}this._queueCheck()}_gotIconData(a){this._checkQueued=!1,this._renderIcon(a,ro(this),this.getAttribute("mode"))}_renderIcon(a,l,d){const u=Jl(a.data.body,d),c=this._state.inline;$o(this._shadowRoot,this._state={rendered:!0,icon:a,inline:c,customisations:l,attrMode:d,renderedMode:u})}startObserver(){if(!this._observer)try{this._observer=new IntersectionObserver(a=>{const l=a.some(d=>d.isIntersecting);l!==this._visible&&(this._visible=l,this._forceRender())}),this._observer.observe(this)}catch{if(this._observer){try{this._observer.disconnect()}catch{}this._observer=null}}}stopObserver(){this._observer&&(this._observer.disconnect(),this._observer=null,this._visible=!0,this._connected&&this._forceRender())}};o.forEach(a=>{a in s.prototype||Object.defineProperty(s.prototype,a,{get:function(){return this.getAttribute(a)},set:function(l){l!==null?this.setAttribute(a,l):this.removeAttribute(a)}})});const r=Vs();for(const a in r)s[a]=s.prototype[a]=r[a];return t.define(e,s),s}yc()||Vs();var _c=Object.defineProperty,xc=Object.getOwnPropertyDescriptor,tt=(e,t,i,n)=>{for(var o=n>1?void 0:n?xc(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(o=(n?r(t,i,o):r(o))||o);return n&&o&&_c(t,i,o),o};const Gs=class extends T{constructor(){super(),this.labelHidden=!1,this.active=!1,this.disabled=!1,this.vertical=!1,this.tooltipVisible=!1,this._stateBeforeLoading={disabled:!1,icon:""},this._loading=!1,this._parent=ie(),this._tooltip=ie(),this._mouseLeave=!1,this.onClick=e=>{e.stopPropagation(),this.disabled||this.dispatchEvent(new Event("click"))},this.showContextMenu=()=>{const e=this._contextMenu;e&&(e.visible=!0)},this.mouseLeave=!0}set loading(e){if(this._loading=e,e)this._stateBeforeLoading={disabled:this.disabled,icon:this.icon},this.disabled=e,this.icon="eos-icons:loading";else{const{disabled:t,icon:i}=this._stateBeforeLoading;this.disabled=t,this.icon=i}}get loading(){return this._loading}set mouseLeave(e){this._mouseLeave=e,e&&(this.tooltipVisible=!1,clearTimeout(this.timeoutID))}get mouseLeave(){return this._mouseLeave}computeTooltipPosition(){const{value:e}=this._parent,{value:t}=this._tooltip;e&&t&&ms(e,t,{placement:"bottom",middleware:[es(10),ps(),hs(),us({padding:5})]}).then(i=>{const{x:n,y:o}=i;Object.assign(t.style,{left:`${n}px`,top:`${o}px`})})}onMouseEnter(){if(!(this.tooltipTitle||this.tooltipText))return;this.mouseLeave=!1;const e=this.tooltipTime??700;this.timeoutID=setTimeout(()=>{this.mouseLeave||(this.computeTooltipPosition(),this.tooltipVisible=!0)},e)}click(){this.disabled||super.click()}get _contextMenu(){return this.querySelector("bim-context-menu")}connectedCallback(){super.connectedCallback(),this.addEventListener("click",this.showContextMenu)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("click",this.showContextMenu)}render(){const e=m`
${this.tooltipTitle?m`

${this.tooltipTitle} @@ -446,7 +446,7 @@ import{e as De,t as fn,a as gn,L as Ur,i as Vr,_ as Ht,J as at,E as Wr,b as Gr,m [data-context-dialog]::backdrop { background-color: transparent; } -`,St={scrollbar:Cc,globalStyles:Ec},Xs=class O{static set config(t){this._config={...O._config,...t}}static get config(){return O._config}static addGlobalStyles(){let t=document.querySelector("style[id='bim-ui']");if(t)return;t=document.createElement("style"),t.id="bim-ui",t.textContent=St.globalStyles.cssText;const i=document.head.firstChild;i?document.head.insertBefore(t,i):document.head.append(t)}static defineCustomElement(t,i){customElements.get(t)||customElements.define(t,i)}static registerComponents(){O.init()}static init(){O.addGlobalStyles(),O.defineCustomElement("bim-button",Q),O.defineCustomElement("bim-checkbox",le),O.defineCustomElement("bim-color-input",Bt),O.defineCustomElement("bim-context-menu",kc),O.defineCustomElement("bim-dropdown",bt),O.defineCustomElement("bim-grid",Nn),O.defineCustomElement("bim-icon",Lc),O.defineCustomElement("bim-input",Ge),O.defineCustomElement("bim-label",de),O.defineCustomElement("bim-number-input",W),O.defineCustomElement("bim-option",F),O.defineCustomElement("bim-panel",Ut),O.defineCustomElement("bim-panel-section",ue),O.defineCustomElement("bim-selector",he),O.defineCustomElement("bim-table",K),O.defineCustomElement("bim-tabs",Wt),O.defineCustomElement("bim-tab",Y),O.defineCustomElement("bim-table-cell",lr),O.defineCustomElement("bim-table-children",dr),O.defineCustomElement("bim-table-group",hr),O.defineCustomElement("bim-table-row",Vt),O.defineCustomElement("bim-text-input",lt),O.defineCustomElement("bim-toolbar",zi),O.defineCustomElement("bim-toolbar-group",Ri),O.defineCustomElement("bim-toolbar-section",be),O.defineCustomElement("bim-viewport",$r)}static newRandomId(){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";let i="";for(let n=0;n<10;n++){const o=Math.floor(Math.random()*t.length);i+=t.charAt(o)}return i}};Xs._config={sectionLabelOnVerticalToolbar:!1};let hn=Xs;class B extends T{constructor(){super(...arguments),this._lazyLoadObserver=null,this._visibleElements=[],this.ELEMENTS_BEFORE_OBSERVER=20,this.useObserver=!1,this.elements=new Set,this.observe=t=>{if(!this.useObserver)return;for(const n of t)this.elements.add(n);const i=t.slice(this.ELEMENTS_BEFORE_OBSERVER);for(const n of i)n.remove();this.observeLastElement()}}set visibleElements(t){this._visibleElements=this.useObserver?t:[],this.requestUpdate()}get visibleElements(){return this._visibleElements}getLazyObserver(){if(!this.useObserver)return null;if(this._lazyLoadObserver)return this._lazyLoadObserver;const t=new IntersectionObserver(i=>{const n=i[0];if(!n.isIntersecting)return;const o=n.target;t.unobserve(o);const s=this.ELEMENTS_BEFORE_OBSERVER+this.visibleElements.length,r=[...this.elements][s];r&&(this.visibleElements=[...this.visibleElements,r],t.observe(r))},{threshold:.5});return t}observeLastElement(){const t=this.getLazyObserver();if(!t)return;const i=this.ELEMENTS_BEFORE_OBSERVER+this.visibleElements.length-1,n=[...this.elements][i];n&&t.observe(n)}resetVisibleElements(){const t=this.getLazyObserver();if(t){for(const i of this.elements)t.unobserve(i);this.visibleElements=[],this.observeLastElement()}}static create(t,i){const n=document.createDocumentFragment();if(t.length===0)return ee(t(),n),n.firstElementChild;if(!i)throw new Error("UIComponent: Initial state is required for statefull components.");let o=i;const s=t,r=l=>(o={...o,...l},ee(s(o),n),o);r(i);const a=()=>o;return[n.firstElementChild,r,a]}}var Ac=Object.defineProperty,Sc=Object.getOwnPropertyDescriptor,Js=(e,t,i,n)=>{for(var o=Sc(t,i),s=e.length-1,r;s>=0;s--)(r=e[s])&&(o=r(t,i,o)||o);return o&&Ac(t,i,o),o},D;const In=(D=class extends T{constructor(){super(...arguments),this._previousContainer=null,this._visible=!1}get placement(){return this._placement}set placement(e){this._placement=e,this.updatePosition()}static removeMenus(){for(const e of D.menus)e instanceof D&&(e.visible=!1);D.dialog.close(),D.dialog.remove()}get visible(){return this._visible}set visible(e){var t;this._visible=e,e?(D.dialog.parentElement||document.body.append(D.dialog),this._previousContainer=this.parentElement,D.dialog.style.top=`${window.scrollY||document.documentElement.scrollTop}px`,D.dialog.append(this),D.dialog.showModal(),this.updatePosition(),this.dispatchEvent(new Event("visible"))):((t=this._previousContainer)==null||t.append(this),this._previousContainer=null,this.dispatchEvent(new Event("hidden")))}async updatePosition(){if(!(this.visible&&this._previousContainer))return;const e=this.placement??"right",t=await ms(this._previousContainer,this,{placement:e,middleware:[es(10),ps(),hs(),us({padding:5})]}),{x:i,y:n}=t;this.style.left=`${i}px`,this.style.top=`${n}px`}connectedCallback(){super.connectedCallback(),D.menus.push(this)}render(){return m` `}},D.styles=[St.scrollbar,I` +`,St={scrollbar:Cc,globalStyles:Ec},Xs=class O{static set config(t){this._config={...O._config,...t}}static get config(){return O._config}static addGlobalStyles(){let t=document.querySelector("style[id='bim-ui']");if(t)return;t=document.createElement("style"),t.id="bim-ui",t.textContent=St.globalStyles.cssText;const i=document.head.firstChild;i?document.head.insertBefore(t,i):document.head.append(t)}static defineCustomElement(t,i){customElements.get(t)||customElements.define(t,i)}static registerComponents(){O.init()}static init(){O.addGlobalStyles(),O.defineCustomElement("bim-button",Q),O.defineCustomElement("bim-checkbox",le),O.defineCustomElement("bim-color-input",Bt),O.defineCustomElement("bim-context-menu",kc),O.defineCustomElement("bim-dropdown",bt),O.defineCustomElement("bim-grid",Nn),O.defineCustomElement("bim-icon",Lc),O.defineCustomElement("bim-input",Ge),O.defineCustomElement("bim-label",de),O.defineCustomElement("bim-number-input",W),O.defineCustomElement("bim-option",F),O.defineCustomElement("bim-panel",Ut),O.defineCustomElement("bim-panel-section",ue),O.defineCustomElement("bim-selector",he),O.defineCustomElement("bim-table",K),O.defineCustomElement("bim-tabs",Wt),O.defineCustomElement("bim-tab",Y),O.defineCustomElement("bim-table-cell",lr),O.defineCustomElement("bim-table-children",dr),O.defineCustomElement("bim-table-group",hr),O.defineCustomElement("bim-table-row",Vt),O.defineCustomElement("bim-text-input",lt),O.defineCustomElement("bim-toolbar",zi),O.defineCustomElement("bim-toolbar-group",Di),O.defineCustomElement("bim-toolbar-section",be),O.defineCustomElement("bim-viewport",$r)}static newRandomId(){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";let i="";for(let n=0;n<10;n++){const o=Math.floor(Math.random()*t.length);i+=t.charAt(o)}return i}};Xs._config={sectionLabelOnVerticalToolbar:!1};let hn=Xs;class B extends T{constructor(){super(...arguments),this._lazyLoadObserver=null,this._visibleElements=[],this.ELEMENTS_BEFORE_OBSERVER=20,this.useObserver=!1,this.elements=new Set,this.observe=t=>{if(!this.useObserver)return;for(const n of t)this.elements.add(n);const i=t.slice(this.ELEMENTS_BEFORE_OBSERVER);for(const n of i)n.remove();this.observeLastElement()}}set visibleElements(t){this._visibleElements=this.useObserver?t:[],this.requestUpdate()}get visibleElements(){return this._visibleElements}getLazyObserver(){if(!this.useObserver)return null;if(this._lazyLoadObserver)return this._lazyLoadObserver;const t=new IntersectionObserver(i=>{const n=i[0];if(!n.isIntersecting)return;const o=n.target;t.unobserve(o);const s=this.ELEMENTS_BEFORE_OBSERVER+this.visibleElements.length,r=[...this.elements][s];r&&(this.visibleElements=[...this.visibleElements,r],t.observe(r))},{threshold:.5});return t}observeLastElement(){const t=this.getLazyObserver();if(!t)return;const i=this.ELEMENTS_BEFORE_OBSERVER+this.visibleElements.length-1,n=[...this.elements][i];n&&t.observe(n)}resetVisibleElements(){const t=this.getLazyObserver();if(t){for(const i of this.elements)t.unobserve(i);this.visibleElements=[],this.observeLastElement()}}static create(t,i){const n=document.createDocumentFragment();if(t.length===0)return ee(t(),n),n.firstElementChild;if(!i)throw new Error("UIComponent: Initial state is required for statefull components.");let o=i;const s=t,r=l=>(o={...o,...l},ee(s(o),n),o);r(i);const a=()=>o;return[n.firstElementChild,r,a]}}var Ac=Object.defineProperty,Sc=Object.getOwnPropertyDescriptor,Js=(e,t,i,n)=>{for(var o=Sc(t,i),s=e.length-1,r;s>=0;s--)(r=e[s])&&(o=r(t,i,o)||o);return o&&Ac(t,i,o),o},R;const In=(R=class extends T{constructor(){super(...arguments),this._previousContainer=null,this._visible=!1}get placement(){return this._placement}set placement(e){this._placement=e,this.updatePosition()}static removeMenus(){for(const e of R.menus)e instanceof R&&(e.visible=!1);R.dialog.close(),R.dialog.remove()}get visible(){return this._visible}set visible(e){var t;this._visible=e,e?(R.dialog.parentElement||document.body.append(R.dialog),this._previousContainer=this.parentElement,R.dialog.style.top=`${window.scrollY||document.documentElement.scrollTop}px`,R.dialog.append(this),R.dialog.showModal(),this.updatePosition(),this.dispatchEvent(new Event("visible"))):((t=this._previousContainer)==null||t.append(this),this._previousContainer=null,this.dispatchEvent(new Event("hidden")))}async updatePosition(){if(!(this.visible&&this._previousContainer))return;const e=this.placement??"right",t=await ms(this._previousContainer,this,{placement:e,middleware:[es(10),ps(),hs(),us({padding:5})]}),{x:i,y:n}=t;this.style.left=`${i}px`,this.style.top=`${n}px`}connectedCallback(){super.connectedCallback(),R.menus.push(this)}render(){return m` `}},R.styles=[St.scrollbar,I` :host { pointer-events: auto; position: absolute; @@ -470,9 +470,9 @@ import{e as De,t as fn,a as gn,L as Ur,i as Vr,_ as Ht,J as at,E as Wr,b as Gr,m :host(:not([visible])) { display: none; } - `],D.dialog=B.create(()=>m`

{e.target===D.dialog&&D.removeMenus()}} - @cancel=${()=>D.removeMenus()} + `],R.dialog=B.create(()=>m` {e.target===R.dialog&&R.removeMenus()}} + @cancel=${()=>R.removeMenus()} data-context-dialog style=" width: 0; @@ -485,7 +485,7 @@ import{e as De,t as fn,a as gn,L as Ur,i as Vr,_ as Ht,J as at,E as Wr,b as Gr,m overflow: visible; background-color: transparent; " - >`),D.menus=[],D);Js([b({type:String,reflect:!0})],In.prototype,"placement");Js([b({type:Boolean,reflect:!0})],In.prototype,"visible");let kc=In;const _i=(e,t={},i=!0)=>{let n={};for(const o of e.children){const s=o,r=s.getAttribute("name")||s.getAttribute("label"),a=t[r];if(r){if("value"in s&&typeof s.value<"u"&&s.value!==null){const l=s.value;if(typeof l=="object"&&!Array.isArray(l)&&Object.keys(l).length===0)continue;n[r]=a?a(s.value):s.value}else if(i){const l=_i(s,t);if(Object.keys(l).length===0)continue;n[r]=a?a(l):l}}else i&&(n={...n,..._i(s,t)})}return n},Mi=e=>e==="true"||e==="false"?e==="true":e&&!isNaN(Number(e))&&e.trim()!==""?Number(e):e,Oc=[">=","<=","=",">","<","?","/","#"];function Eo(e){const t=Oc.find(r=>e.split(r).length===2),i=e.split(t).map(r=>r.trim()),[n,o]=i,s=o.startsWith("'")&&o.endsWith("'")?o.replace(/'/g,""):Mi(o);return{key:n,condition:t,value:s}}const pn=e=>{try{const t=[],i=e.split(/&(?![^()]*\))/).map(n=>n.trim());for(const n of i){const o=!n.startsWith("(")&&!n.endsWith(")"),s=n.startsWith("(")&&n.endsWith(")");if(o){const r=Eo(n);t.push(r)}if(s){const r={operator:"&",queries:n.replace(/^(\()|(\))$/g,"").split("&").map(a=>a.trim()).map((a,l)=>{const d=Eo(a);return l>0&&(d.operator="&"),d})};t.push(r)}}return t}catch{return null}},Ao=(e,t,i)=>{let n=!1;switch(t){case"=":n=e===i;break;case"?":n=String(e).includes(String(i));break;case"<":(typeof e=="number"||typeof i=="number")&&(n=e":(typeof e=="number"||typeof i=="number")&&(n=e>i);break;case">=":(typeof e=="number"||typeof i=="number")&&(n=e>=i);break;case"/":n=String(e).startsWith(String(i));break}return n};var Tc=Object.defineProperty,Ic=Object.getOwnPropertyDescriptor,kt=(e,t,i,n)=>{for(var o=n>1?void 0:n?Ic(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(o=(n?r(t,i,o):r(o))||o);return n&&o&&Tc(t,i,o),o};const Qs=class extends T{constructor(){super(...arguments),this.checked=!1,this.checkbox=!1,this.noMark=!1,this.vertical=!1}get value(){return this._value!==void 0?this._value:this.label?Mi(this.label):this.label}set value(e){this._value=e}render(){return m` + >`),R.menus=[],R);Js([b({type:String,reflect:!0})],In.prototype,"placement");Js([b({type:Boolean,reflect:!0})],In.prototype,"visible");let kc=In;const _i=(e,t={},i=!0)=>{let n={};for(const o of e.children){const s=o,r=s.getAttribute("name")||s.getAttribute("label"),a=t[r];if(r){if("value"in s&&typeof s.value<"u"&&s.value!==null){const l=s.value;if(typeof l=="object"&&!Array.isArray(l)&&Object.keys(l).length===0)continue;n[r]=a?a(s.value):s.value}else if(i){const l=_i(s,t);if(Object.keys(l).length===0)continue;n[r]=a?a(l):l}}else i&&(n={...n,..._i(s,t)})}return n},Mi=e=>e==="true"||e==="false"?e==="true":e&&!isNaN(Number(e))&&e.trim()!==""?Number(e):e,Oc=[">=","<=","=",">","<","?","/","#"];function Eo(e){const t=Oc.find(r=>e.split(r).length===2),i=e.split(t).map(r=>r.trim()),[n,o]=i,s=o.startsWith("'")&&o.endsWith("'")?o.replace(/'/g,""):Mi(o);return{key:n,condition:t,value:s}}const pn=e=>{try{const t=[],i=e.split(/&(?![^()]*\))/).map(n=>n.trim());for(const n of i){const o=!n.startsWith("(")&&!n.endsWith(")"),s=n.startsWith("(")&&n.endsWith(")");if(o){const r=Eo(n);t.push(r)}if(s){const r={operator:"&",queries:n.replace(/^(\()|(\))$/g,"").split("&").map(a=>a.trim()).map((a,l)=>{const d=Eo(a);return l>0&&(d.operator="&"),d})};t.push(r)}}return t}catch{return null}},Ao=(e,t,i)=>{let n=!1;switch(t){case"=":n=e===i;break;case"?":n=String(e).includes(String(i));break;case"<":(typeof e=="number"||typeof i=="number")&&(n=e":(typeof e=="number"||typeof i=="number")&&(n=e>i);break;case">=":(typeof e=="number"||typeof i=="number")&&(n=e>=i);break;case"/":n=String(e).startsWith(String(i));break}return n};var Tc=Object.defineProperty,Ic=Object.getOwnPropertyDescriptor,kt=(e,t,i,n)=>{for(var o=n>1?void 0:n?Ic(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(o=(n?r(t,i,o):r(o))||o);return n&&o&&Tc(t,i,o),o};const Qs=class extends T{constructor(){super(...arguments),this.checked=!1,this.checkbox=!1,this.noMark=!1,this.vertical=!1}get value(){return this._value!==void 0?this._value:this.label?Mi(this.label):this.label}set value(e){this._value=e}render(){return m`
${this.img||this.icon||this.label?m`
${this.checkbox&&!this.noMark?m`{for(var o=void 0,s=e.length-1,r;s>=0;s--)(r=e[s])&&(o=r(t,i,o)||o);return o&&Rc(t,i,o),o};const ir=class extends T{constructor(){super(...arguments),this.labelHidden=!1,this.iconHidden=!1,this.vertical=!1}get value(){return this.textContent?Mi(this.textContent):this.textContent}render(){return m` + `;let Ge=er;Li([b({type:String,reflect:!0})],Ge.prototype,"name");Li([b({type:String,reflect:!0})],Ge.prototype,"label");Li([b({type:String,reflect:!0})],Ge.prototype,"icon");Li([b({type:Boolean,reflect:!0})],Ge.prototype,"vertical");var Dc=Object.defineProperty,qe=(e,t,i,n)=>{for(var o=void 0,s=e.length-1,r;s>=0;s--)(r=e[s])&&(o=r(t,i,o)||o);return o&&Dc(t,i,o),o};const ir=class extends T{constructor(){super(...arguments),this.labelHidden=!1,this.iconHidden=!1,this.vertical=!1}get value(){return this.textContent?Mi(this.textContent):this.textContent}render(){return m`
${this.img?m``:null} ${!this.iconHidden&&this.icon?m``:null} @@ -796,7 +796,7 @@ import{e as De,t as fn,a as gn,L as Ur,i as Vr,_ as Ht,J as at,E as Wr,b as Gr,m calc(var(--bim-label--fz, var(--bim-ui_size-xs)) * 4) ); } - `;let de=ir;qe([b({type:String,reflect:!0})],de.prototype,"img");qe([b({type:Boolean,attribute:"label-hidden",reflect:!0})],de.prototype,"labelHidden");qe([b({type:String,reflect:!0})],de.prototype,"icon");qe([b({type:Boolean,attribute:"icon-hidden",reflect:!0})],de.prototype,"iconHidden");qe([b({type:Boolean,reflect:!0})],de.prototype,"vertical");var Dc=Object.defineProperty,zc=Object.getOwnPropertyDescriptor,Z=(e,t,i,n)=>{for(var o=n>1?void 0:n?zc(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(o=(n?r(t,i,o):r(o))||o);return n&&o&&Dc(t,i,o),o};const nr=class extends T{constructor(){super(...arguments),this._value=0,this.vertical=!1,this.slider=!1,this._input=ie(),this.onValueChange=new Event("change")}set value(e){this.setValue(e.toString())}get value(){return this._value}onChange(e){e.stopPropagation();const{value:t}=this._input;t&&this.setValue(t.value)}setValue(e){const{value:t}=this._input;let i=e;if(i=i.replace(/[^0-9.-]/g,""),i=i.replace(/(\..*)\./g,"$1"),i.endsWith(".")||(i.lastIndexOf("-")>0&&(i=i[0]+i.substring(1).replace(/-/g,"")),i==="-"||i==="-0"))return;let n=Number(i);Number.isNaN(n)||(n=this.min!==void 0?Math.max(n,this.min):n,n=this.max!==void 0?Math.min(n,this.max):n,this.value!==n&&(this._value=n,t&&(t.value=this.value.toString()),this.requestUpdate(),this.dispatchEvent(this.onValueChange)))}onBlur(){const{value:e}=this._input;e&&Number.isNaN(Number(e.value))&&(e.value=this.value.toString())}onSliderMouseDown(e){document.body.style.cursor="w-resize";const{clientX:t}=e,i=this.value;let n=!1;const o=a=>{var l;n=!0;const{clientX:d}=a,u=this.step??1,c=((l=u.toString().split(".")[1])==null?void 0:l.length)||0,h=1/(this.sensitivity??1),p=(d-t)/h;if(Math.floor(Math.abs(p))!==Math.abs(p))return;const g=i+p*u;this.setValue(g.toFixed(c))},s=()=>{this.slider=!0,this.removeEventListener("blur",s)},r=()=>{document.removeEventListener("mousemove",o),document.body.style.cursor="default",n?n=!1:(this.addEventListener("blur",s),this.slider=!1,requestAnimationFrame(()=>this.focus())),document.removeEventListener("mouseup",r)};document.addEventListener("mousemove",o),document.addEventListener("mouseup",r)}onFocus(e){e.stopPropagation();const t=i=>{i.key==="Escape"&&(this.blur(),window.removeEventListener("keydown",t))};window.addEventListener("keydown",t)}connectedCallback(){super.connectedCallback(),this.min&&this.min>this.value&&(this._value=this.min),this.max&&this.max{for(var o=n>1?void 0:n?zc(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(o=(n?r(t,i,o):r(o))||o);return n&&o&&Rc(t,i,o),o};const nr=class extends T{constructor(){super(...arguments),this._value=0,this.vertical=!1,this.slider=!1,this._input=ie(),this.onValueChange=new Event("change")}set value(e){this.setValue(e.toString())}get value(){return this._value}onChange(e){e.stopPropagation();const{value:t}=this._input;t&&this.setValue(t.value)}setValue(e){const{value:t}=this._input;let i=e;if(i=i.replace(/[^0-9.-]/g,""),i=i.replace(/(\..*)\./g,"$1"),i.endsWith(".")||(i.lastIndexOf("-")>0&&(i=i[0]+i.substring(1).replace(/-/g,"")),i==="-"||i==="-0"))return;let n=Number(i);Number.isNaN(n)||(n=this.min!==void 0?Math.max(n,this.min):n,n=this.max!==void 0?Math.min(n,this.max):n,this.value!==n&&(this._value=n,t&&(t.value=this.value.toString()),this.requestUpdate(),this.dispatchEvent(this.onValueChange)))}onBlur(){const{value:e}=this._input;e&&Number.isNaN(Number(e.value))&&(e.value=this.value.toString())}onSliderMouseDown(e){document.body.style.cursor="w-resize";const{clientX:t}=e,i=this.value;let n=!1;const o=a=>{var l;n=!0;const{clientX:d}=a,u=this.step??1,c=((l=u.toString().split(".")[1])==null?void 0:l.length)||0,h=1/(this.sensitivity??1),p=(d-t)/h;if(Math.floor(Math.abs(p))!==Math.abs(p))return;const g=i+p*u;this.setValue(g.toFixed(c))},s=()=>{this.slider=!0,this.removeEventListener("blur",s)},r=()=>{document.removeEventListener("mousemove",o),document.body.style.cursor="default",n?n=!1:(this.addEventListener("blur",s),this.slider=!1,requestAnimationFrame(()=>this.focus())),document.removeEventListener("mouseup",r)};document.addEventListener("mousemove",o),document.addEventListener("mouseup",r)}onFocus(e){e.stopPropagation();const t=i=>{i.key==="Escape"&&(this.blur(),window.removeEventListener("keydown",t))};window.addEventListener("keydown",t)}connectedCallback(){super.connectedCallback(),this.min&&this.min>this.value&&(this._value=this.min),this.max&&this.max{for(var o=n>1?void 0:n?dd(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(o=(n?r(t,i,o):r(o))||o);return n&&o&&cd(t,i,o),o};const _r=class extends T{constructor(){super(...arguments),this._vertical=!1,this._labelHidden=!1}set vertical(e){this._vertical=e,this.updateChildren()}get vertical(){return this._vertical}set labelHidden(e){this._labelHidden=e,this.updateChildren()}get labelHidden(){return this._labelHidden}updateChildren(){const e=this.children;for(const t of e)t instanceof Ri&&(t.vertical=this.vertical),t.toggleAttribute("label-hidden",this.vertical)}render(){return m` + `;let Di=yr;vr([b({type:Number,reflect:!0})],Di.prototype,"rows",2);vr([b({type:Boolean,reflect:!0})],Di.prototype,"vertical",1);var cd=Object.defineProperty,dd=Object.getOwnPropertyDescriptor,Ri=(e,t,i,n)=>{for(var o=n>1?void 0:n?dd(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(o=(n?r(t,i,o):r(o))||o);return n&&o&&cd(t,i,o),o};const _r=class extends T{constructor(){super(...arguments),this._vertical=!1,this._labelHidden=!1}set vertical(e){this._vertical=e,this.updateChildren()}get vertical(){return this._vertical}set labelHidden(e){this._labelHidden=e,this.updateChildren()}get labelHidden(){return this._labelHidden}updateChildren(){const e=this.children;for(const t of e)t instanceof Di&&(t.vertical=this.vertical),t.toggleAttribute("label-hidden",this.vertical)}render(){return m`
@@ -1666,7 +1666,7 @@ import{e as De,t as fn,a as gn,L as Ur,i as Vr,_ as Ht,J as at,E as Wr,b as Gr,m :host([vertical]) .children { flex-direction: column; } - `;let be=_r;Di([b({type:String,reflect:!0})],be.prototype,"label",2);Di([b({type:String,reflect:!0})],be.prototype,"icon",2);Di([b({type:Boolean,reflect:!0})],be.prototype,"vertical",1);Di([b({type:Boolean,attribute:"label-hidden",reflect:!0})],be.prototype,"labelHidden",1);var ud=Object.defineProperty,hd=Object.getOwnPropertyDescriptor,Pn=(e,t,i,n)=>{for(var o=n>1?void 0:n?hd(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(o=(n?r(t,i,o):r(o))||o);return n&&o&&ud(t,i,o),o};const xr=class extends T{constructor(){super(...arguments),this.labelsHidden=!1,this._vertical=!1,this._hidden=!1}set vertical(e){this._vertical=e,this.updateSections()}get vertical(){return this._vertical}set hidden(e){this._hidden=e,this.dispatchEvent(new Event("hiddenchange"))}get hidden(){return this._hidden}updateSections(){const e=this.children;for(const t of e)t instanceof be&&(t.labelHidden=this.vertical&&!hn.config.sectionLabelOnVerticalToolbar,t.vertical=this.vertical)}render(){return m` + `;let be=_r;Ri([b({type:String,reflect:!0})],be.prototype,"label",2);Ri([b({type:String,reflect:!0})],be.prototype,"icon",2);Ri([b({type:Boolean,reflect:!0})],be.prototype,"vertical",1);Ri([b({type:Boolean,attribute:"label-hidden",reflect:!0})],be.prototype,"labelHidden",1);var ud=Object.defineProperty,hd=Object.getOwnPropertyDescriptor,Pn=(e,t,i,n)=>{for(var o=n>1?void 0:n?hd(t,i):t,s=e.length-1,r;s>=0;s--)(r=e[s])&&(o=(n?r(t,i,o):r(o))||o);return n&&o&&ud(t,i,o),o};const xr=class extends T{constructor(){super(...arguments),this.labelsHidden=!1,this._vertical=!1,this._hidden=!1}set vertical(e){this._vertical=e,this.updateSections()}get vertical(){return this._vertical}set hidden(e){this._hidden=e,this.dispatchEvent(new Event("hiddenchange"))}get hidden(){return this._hidden}updateSections(){const e=this.children;for(const t of e)t instanceof be&&(t.labelHidden=this.vertical&&!hn.config.sectionLabelOnVerticalToolbar,t.vertical=this.vertical)}render(){return m`
@@ -1742,7 +1742,7 @@ import{e as De,t as fn,a as gn,L as Ur,i as Vr,_ as Ht,J as at,E as Wr,b as Gr,m `:null} ${n}
-`},yd=e=>{const{components:t,dataStyles:i,onTopicEnter:n}=e,o=t.get(De),s=e.topics??o.list.values();return m` +`},yd=e=>{const{components:t,dataStyles:i,onTopicEnter:n}=e,o=t.get(Re),s=e.topics??o.list.values();return m` {const{cell:a}=r;a.style.marginLeft="0"}} ${J(r=>{if(!r)return;const a=r;a.hiddenColumns=["Guid"],a.columns=["Title"],a.selectableRows=!0,a.dataTransform={Title:(l,d)=>{const{Guid:u}=d;if(typeof u!="string")return l;const c=o.list.get(u);return c?m`