diff --git a/examples/AngleMeasurement/index.html b/examples/AngleMeasurement/index.html index dd1e9b74c..5ce760552 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 2511d6557..2c9b20099 100644 --- a/examples/AreaMeasurement/index.html +++ b/examples/AreaMeasurement/index.html @@ -58,10 +58,10 @@ - + - - + + diff --git a/examples/BoundingBoxer/index.html b/examples/BoundingBoxer/index.html index b59883078..a0a2484b1 100644 --- a/examples/BoundingBoxer/index.html +++ b/examples/BoundingBoxer/index.html @@ -58,10 +58,10 @@ - + - - + + diff --git a/examples/Civil3DNavigator/index.html b/examples/Civil3DNavigator/index.html index 668556ef9..4009680a4 100644 --- a/examples/Civil3DNavigator/index.html +++ b/examples/Civil3DNavigator/index.html @@ -58,10 +58,10 @@ - - + + - + diff --git a/examples/CivilCrossSectionNavigator/index.html b/examples/CivilCrossSectionNavigator/index.html index d6740de31..8695b3ae9 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 8bb1bde42..5333b8f10 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 42727d0e6..9f2c0cb4c 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 3ffc4b698..ef2bfae0d 100644 --- a/examples/Classifier/index.html +++ b/examples/Classifier/index.html @@ -58,10 +58,10 @@ - + - - + + diff --git a/examples/ClipEdges/index.html b/examples/ClipEdges/index.html index 1474469b9..734d35f1b 100644 --- a/examples/ClipEdges/index.html +++ b/examples/ClipEdges/index.html @@ -58,11 +58,11 @@ - + - - - + + + diff --git a/examples/Clipper/index.html b/examples/Clipper/index.html index 1c545fca3..d1a5474c9 100644 --- a/examples/Clipper/index.html +++ b/examples/Clipper/index.html @@ -58,10 +58,10 @@ - + - - + + diff --git a/examples/Cullers/index.html b/examples/Cullers/index.html index d9bf4699f..9d2f4bff2 100644 --- a/examples/Cullers/index.html +++ b/examples/Cullers/index.html @@ -58,9 +58,9 @@ - + - + diff --git a/examples/EdgeMeasurement/index.html b/examples/EdgeMeasurement/index.html index efa58e08e..71d84741c 100644 --- a/examples/EdgeMeasurement/index.html +++ b/examples/EdgeMeasurement/index.html @@ -58,10 +58,10 @@ - + - - + + diff --git a/examples/Exploder/index.html b/examples/Exploder/index.html index 3be339945..90a32eee0 100644 --- a/examples/Exploder/index.html +++ b/examples/Exploder/index.html @@ -58,10 +58,10 @@ - + - - + + diff --git a/examples/FaceMeasurement/index.html b/examples/FaceMeasurement/index.html index 856a79cb6..629f787aa 100644 --- a/examples/FaceMeasurement/index.html +++ b/examples/FaceMeasurement/index.html @@ -58,10 +58,10 @@ - + - - + + diff --git a/examples/FragmentsManager/index.html b/examples/FragmentsManager/index.html index a375bc7c0..01efe5bec 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 513b36b17..30a24e1b4 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 e10a3ea6e..67ceb20e2 100644 --- a/examples/Hider/index.html +++ b/examples/Hider/index.html @@ -58,10 +58,10 @@ - + - - + + diff --git a/examples/Highlighter/index.html b/examples/Highlighter/index.html index 42cdfd6a5..996d29f99 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 a6c65e96c..5b93a1d34 100644 --- a/examples/IfcGeometryTiler/index.html +++ b/examples/IfcGeometryTiler/index.html @@ -58,10 +58,10 @@ - + - - + + diff --git a/examples/IfcJsonExporter/index.html b/examples/IfcJsonExporter/index.html index 602f2915d..181d30e83 100644 --- a/examples/IfcJsonExporter/index.html +++ b/examples/IfcJsonExporter/index.html @@ -58,10 +58,10 @@ - + - - + + diff --git a/examples/IfcLoader/index.html b/examples/IfcLoader/index.html index 7b05ae4f2..81f8793b7 100644 --- a/examples/IfcLoader/index.html +++ b/examples/IfcLoader/index.html @@ -58,10 +58,10 @@ - - + + - + diff --git a/examples/IfcPropertiesManager/index.html b/examples/IfcPropertiesManager/index.html index e653fe99a..2331b4a43 100644 --- a/examples/IfcPropertiesManager/index.html +++ b/examples/IfcPropertiesManager/index.html @@ -6,7 +6,7 @@ Ifc Properties Manager - + diff --git a/examples/IfcPropertiesTiler/index.html b/examples/IfcPropertiesTiler/index.html index 93c6b5b69..f63402533 100644 --- a/examples/IfcPropertiesTiler/index.html +++ b/examples/IfcPropertiesTiler/index.html @@ -58,10 +58,10 @@ - + - - + + diff --git a/examples/IfcRelationsIndexer/index.html b/examples/IfcRelationsIndexer/index.html index f3ef11927..80de8c3e3 100644 --- a/examples/IfcRelationsIndexer/index.html +++ b/examples/IfcRelationsIndexer/index.html @@ -58,10 +58,10 @@ - + - - + + diff --git a/examples/IfcStreamer/index.html b/examples/IfcStreamer/index.html index 71481e0b0..08e0551b0 100644 --- a/examples/IfcStreamer/index.html +++ b/examples/IfcStreamer/index.html @@ -58,10 +58,10 @@ - + - - + + diff --git a/examples/LengthMeasurement/index.html b/examples/LengthMeasurement/index.html index d8ffb279d..f00ee4873 100644 --- a/examples/LengthMeasurement/index.html +++ b/examples/LengthMeasurement/index.html @@ -58,11 +58,11 @@ - + - - - + + + diff --git a/examples/Marker/index.html b/examples/Marker/index.html index 33669d8ae..28441948e 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 e453e9a11..ec75ba5b2 100644 --- a/examples/MeasurementUtils/index.html +++ b/examples/MeasurementUtils/index.html @@ -58,9 +58,9 @@ - + - + diff --git a/examples/MiniMap/index.html b/examples/MiniMap/index.html index 1076c316e..507a1ea61 100644 --- a/examples/MiniMap/index.html +++ b/examples/MiniMap/index.html @@ -64,10 +64,10 @@ - + - - + + diff --git a/examples/OrthoPerspectiveCamera/index.html b/examples/OrthoPerspectiveCamera/index.html index 3dad2a51d..176e588c4 100644 --- a/examples/OrthoPerspectiveCamera/index.html +++ b/examples/OrthoPerspectiveCamera/index.html @@ -58,10 +58,10 @@ - + - - + + diff --git a/examples/Plans/index.html b/examples/Plans/index.html index 5c78020bd..8f95c85c2 100644 --- a/examples/Plans/index.html +++ b/examples/Plans/index.html @@ -58,10 +58,10 @@ - - - - + + + + diff --git a/examples/PostproductionRenderer/index.html b/examples/PostproductionRenderer/index.html index 37d543b23..e91b9bbc1 100644 --- a/examples/PostproductionRenderer/index.html +++ b/examples/PostproductionRenderer/index.html @@ -58,11 +58,11 @@ - + - - - + + + diff --git a/examples/Raycasters/index.html b/examples/Raycasters/index.html index f026bad7c..84538c36c 100644 --- a/examples/Raycasters/index.html +++ b/examples/Raycasters/index.html @@ -58,9 +58,9 @@ - + - + diff --git a/examples/ShadowDropper/index.html b/examples/ShadowDropper/index.html index eb4f716b8..561295085 100644 --- a/examples/ShadowDropper/index.html +++ b/examples/ShadowDropper/index.html @@ -58,11 +58,11 @@ - - + + - - + + diff --git a/examples/VolumeMeasurement/index.html b/examples/VolumeMeasurement/index.html index 0a433a975..73ec91866 100644 --- a/examples/VolumeMeasurement/index.html +++ b/examples/VolumeMeasurement/index.html @@ -58,10 +58,10 @@ - + - - + + diff --git a/examples/Worlds/index.html b/examples/Worlds/index.html index 0f30df406..c8c39823d 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 72e196cbf..c5f96a46d 100644 --- a/examples/assets/angleMeasurement.js +++ b/examples/assets/angleMeasurement.js @@ -1 +1 @@ -import{B as d,M as c,a as l}from"./web-ifc-api-x-FY_BW3.js";import{p as m,C as i,o as p,W as w,d as u}from"./index-Dr4eFCtu.js";import{S as y,y as b}from"./index-Bkd9n44b.js";import{S as f}from"./stats.min-BpIepu9J.js";const r=document.getElementById("container"),o=new m,g=o.get(i),e=g.create();e.scene=new p(o);e.renderer=new y(o,r);e.camera=new w(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 d(3,3,3),B=new c({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=o.get(b);t.world=e;t.enabled=!0;r.ondblclick=()=>t.create();window.onkeydown=a=>{(a.code==="Delete"||a.code==="Backspace")&&t.deleteAll()};const n=new f;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-56EJvEs4.js";import{p as m,C as i,o as w,W as p,u}from"./index-BcIWfMQD.js";import{x as b,w as f}from"./index-mpk8FhA9.js";import{S as g}from"./stats.min-BpIepu9J.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),x=new d({color:"#6528D7"}),s=new l(k,x);s.position.set(0,1.5,0);e.scene.three.add(s);e.meshes.add(s);const t=o.get(f);t.world=e;t.enabled=!0;r.ondblclick=()=>t.create();window.onkeydown=a=>{(a.code==="Delete"||a.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 887f4846f..a2541642a 100644 --- a/examples/assets/areaMeasurement.js +++ b/examples/assets/areaMeasurement.js @@ -1 +1 @@ -import{B as d,M as c,a as m}from"./web-ifc-api-x-FY_BW3.js";import{S as i}from"./stats.min-BpIepu9J.js";import{p as l,C as p,o as w,W as u,d as b}from"./index-Dr4eFCtu.js";import{S as f,I as g}from"./index-Bkd9n44b.js";const a=document.getElementById("container"),n=new l,y=n.get(p),e=y.create();e.scene=new w(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 d(3,3,3),B=new c({color:"#6528D7"}),s=new m(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 i;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-56EJvEs4.js";import{S as i}from"./stats.min-BpIepu9J.js";import{p as l,C as p,o as w,W as u,u as y}from"./index-BcIWfMQD.js";import{x as b,y as f}from"./index-mpk8FhA9.js";const a=document.getElementById("container"),n=new l,g=n.get(p),e=g.create();e.scene=new w(n);e.renderer=new b(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(y);h.create(e);e.scene.three.background=null;const x=new c(3,3,3),k=new d({color:"#6528D7"}),s=new m(x,k);s.position.set(0,1.5,0);e.scene.three.add(s);e.meshes.add(s);const t=n.get(f);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 i;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/boundingBoxer.js b/examples/assets/boundingBoxer.js index 3cce77ffa..d30cbf82f 100644 --- a/examples/assets/boundingBoxer.js +++ b/examples/assets/boundingBoxer.js @@ -1,4 +1,4 @@ -import"./web-ifc-api-x-FY_BW3.js";import{S as c}from"./stats.min-BpIepu9J.js";import{m as l,t as a,a as r}from"./index-tywNknxv.js";import{p as d,C as m,o as p,r as b,W as u,d as g,h as f,F as h}from"./index-Dr4eFCtu.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(g);B.create(e);e.scene.three.background=null;const v=t.get(f),x=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),k=await x.arrayBuffer(),L=new Uint8Array(k),i=v.load(L);e.scene.three.add(i);const s=t.get(h);s.add(i);const A=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-56EJvEs4.js";import{S as c}from"./stats.min-BpIepu9J.js";import{m as l,t as a,a as r}from"./index-TmOv0r_5.js";import{p as d,C as m,o as p,r as b,W as u,u as g,h as f,g as h}from"./index-BcIWfMQD.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(g);B.create(e);e.scene.three.background=null;const v=t.get(f),x=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),k=await x.arrayBuffer(),L=new Uint8Array(k),i=v.load(L);e.scene.three.add(i);const s=t.get(h);s.add(i);const A=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 1a9d4138c..488c6f24a 100644 --- a/examples/assets/civil3DNavigator.js +++ b/examples/assets/civil3DNavigator.js @@ -1 +1 @@ -import{q as i,S as p}from"./web-ifc-api-x-FY_BW3.js";import{p as l,C as h,o as m,W as f,d as g,h as u,T as w}from"./index-Dr4eFCtu.js";import{S as y}from"./stats.min-BpIepu9J.js";import{B as b,E as B}from"./index-Bkd9n44b.js";const d=document.getElementById("container"),t=new l,E=t.get(h),e=E.create();e.scene=new m(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 S=t.get(g);S.create(e);e.scene.three.background=null;const U=t.get(u),v=await fetch("https://thatopen.github.io/engine_components/resources/road.frag"),A=await v.arrayBuffer(),C=new Uint8Array(A),r=await U.load(C);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(B);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()); +import{q as i,S as p}from"./web-ifc-api-56EJvEs4.js";import{p as l,C as h,o as m,W as f,u,h as g,T as w}from"./index-BcIWfMQD.js";import{S as y}from"./stats.min-BpIepu9J.js";import{k as b,v}from"./index-mpk8FhA9.js";const d=document.getElementById("container"),t=new l,S=t.get(h),e=S.create();e.scene=new m(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(u);U.create(e);e.scene.three.background=null;const k=t.get(g),A=await fetch("https://thatopen.github.io/engine_components/resources/road.frag"),B=await A.arrayBuffer(),C=new Uint8Array(B),r=await k.load(C);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(v);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 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 c82b71b79..0224af5cd 100644 --- a/examples/assets/civilCrossSectionNavigator.js +++ b/examples/assets/civilCrossSectionNavigator.js @@ -1 +1 @@ -import{C as B,L as E}from"./web-ifc-api-x-FY_BW3.js";import{p as M,C as v,o as S,a as k,d as A,h as C,A as D}from"./index-Dr4eFCtu.js";import{m as x}from"./index-tywNknxv.js";import{r as I}from"./index-Clxzob3C.js";import{S as L}from"./stats.min-BpIepu9J.js";import{B as P,b as U,E as j,v as H,m as N}from"./index-Bkd9n44b.js";x.init();I.init();const y=document.getElementById("container"),e=new M,W=e.get(v),t=W.create();t.scene=new S(e);t.renderer=new P(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 _=e.get(A);_.create(t);t.scene.three.background=null;const b=e.get(C),z=await fetch("https://thatopen.github.io/engine_components/resources/road.frag"),F=await z.arrayBuffer(),R=new Uint8Array(F),d=b.load(R);t.scene.three.add(d);const T=await fetch("https://thatopen.github.io/engine_components/resources/road.json");d.setLocalProperties(await T.json());const f=document.getElementById("scene-2d-left");f.components=e;if(!f.world)throw new Error("World not found!");const c=e.get(U);c.world=f.world;await c.draw(d);const l=e.get(j);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(H);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(D);p.byEntity(d);const q=p.list,w=e.get(N),u=w.styles.list;for(const o in q.entities){const n=p.find({entities:[o]}),r=new B(Math.random(),Math.random(),Math.random()),s=new E({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 L;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 k}from"./web-ifc-api-56EJvEs4.js";import{p as v,C as B,o as E,a as I,u as S,h as A,A as C}from"./index-BcIWfMQD.js";import{m as D}from"./index-TmOv0r_5.js";import{r as x}from"./index-CMSSJh4C.js";import{S as L}from"./stats.min-BpIepu9J.js";import{k as P,g as U,v as j,I as H,m as N}from"./index-mpk8FhA9.js";D.init();x.init();const y=document.getElementById("container"),e=new v,W=e.get(B),t=W.create();t.scene=new E(e);t.renderer=new P(e,y);t.camera=new I(e);e.init();t.scene.setup();t.camera.controls.setLookAt(5,5,5,0,0,0);y.appendChild(t.renderer.three2D.domElement);const _=e.get(S);_.create(t);t.scene.three.background=null;const b=e.get(A),z=await fetch("https://thatopen.github.io/engine_components/resources/road.frag"),F=await z.arrayBuffer(),R=new Uint8Array(F),d=b.load(R);t.scene.three.add(d);const T=await fetch("https://thatopen.github.io/engine_components/resources/road.json");d.setLocalProperties(await T.json());const f=document.getElementById("scene-2d-left");f.components=e;if(!f.world)throw new Error("World not found!");const c=e.get(U);c.world=f.world;await c.draw(d);const l=e.get(j);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(H);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(C);p.byEntity(d);const q=p.list,w=e.get(N),u=w.styles.list;for(const o in q.entities){const n=p.find({entities:[o]}),r=new M(Math.random(),Math.random(),Math.random()),s=new k({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 L;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 655b27962..372227574 100644 --- a/examples/assets/civilElevationNavigator.js +++ b/examples/assets/civilElevationNavigator.js @@ -1 +1 @@ -import"./web-ifc-api-x-FY_BW3.js";import{p as y,C as b,o as S,a as B,d as E,h as k}from"./index-Dr4eFCtu.js";import{B as A,E as C,b as I,g as M}from"./index-Bkd9n44b.js";import{m as x}from"./index-tywNknxv.js";import{r as D}from"./index-Clxzob3C.js";import{S as U}from"./stats.min-BpIepu9J.js";x.init();D.init();const f=document.getElementById("container"),t=new y,z=t.get(b),e=z.create();e.scene=new S(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 L=t.get(E);L.create(e);e.scene.three.background=null;const N=t.get(k),P=await fetch("https://thatopen.github.io/engine_components/resources/road.frag"),T=await P.arrayBuffer(),W=new Uint8Array(T),c=N.load(W);e.scene.three.add(c);const i=t.get(C);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(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 U;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-56EJvEs4.js";import{p as y,C as S,o as b,a as k,u as E,h as B}from"./index-BcIWfMQD.js";import{k as A,v as C,g as I,E as M}from"./index-mpk8FhA9.js";import{m as x}from"./index-TmOv0r_5.js";import{r as D}from"./index-CMSSJh4C.js";import{S as U}from"./stats.min-BpIepu9J.js";x.init();D.init();const f=document.getElementById("container"),t=new y,z=t.get(S),e=z.create();e.scene=new b(t);e.renderer=new A(t,f);e.camera=new k(t);t.init();e.scene.setup();e.camera.controls.setLookAt(5,5,5,0,0,0);f.appendChild(e.renderer.three2D.domElement);const L=t.get(E);L.create(e);e.scene.three.background=null;const N=t.get(B),P=await fetch("https://thatopen.github.io/engine_components/resources/road.frag"),T=await P.arrayBuffer(),W=new Uint8Array(T),c=N.load(W);e.scene.three.add(c);const i=t.get(C);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(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 U;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 835b0a50b..3fb8fe22d 100644 --- a/examples/assets/civilPlanNavigator.js +++ b/examples/assets/civilPlanNavigator.js @@ -1 +1 @@ -import"./web-ifc-api-x-FY_BW3.js";import{p,C as g,o as h,a as f,d as u,h as w}from"./index-Dr4eFCtu.js";import{B as y,E as b,b as B}from"./index-Bkd9n44b.js";import{m as v}from"./index-tywNknxv.js";import{r as E}from"./index-Clxzob3C.js";import{S}from"./stats.min-BpIepu9J.js";v.init();E.init();const i=document.getElementById("container"),t=new p,x=t.get(g),e=x.create();e.scene=new h(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(u);A.create(e);e.scene.three.background=null;const C=t.get(w),I=await fetch("https://thatopen.github.io/engine_components/resources/road.frag"),U=await I.arrayBuffer(),k=new Uint8Array(U),r=C.load(k);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(B);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 S;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-56EJvEs4.js";import{p as l,C as p,o as h,a as u,u as f,h as w}from"./index-BcIWfMQD.js";import{k as y,v as b,g as v}from"./index-mpk8FhA9.js";import{m as B}from"./index-TmOv0r_5.js";import{r as S}from"./index-CMSSJh4C.js";import{S as k}from"./stats.min-BpIepu9J.js";B.init();S.init();const i=document.getElementById("container"),t=new l,x=t.get(p),e=x.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 C=t.get(w),E=await fetch("https://thatopen.github.io/engine_components/resources/road.frag"),I=await E.arrayBuffer(),U=new Uint8Array(I),r=C.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 g=o.curve.index,d=o.curve.alignment.absolute[g];d.mesh.geometry.computeBoundingSphere();const c=d.mesh.geometry.boundingSphere;c&&e.camera.controls.fitToSphere(c,!0)});const n=new k;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 3520f56f0..033e746d3 100644 --- a/examples/assets/classifier.js +++ b/examples/assets/classifier.js @@ -1,4 +1,4 @@ -import{a2 as d,C as m}from"./web-ifc-api-x-FY_BW3.js";import{S as u}from"./stats.min-BpIepu9J.js";import{m as b,t as a,a as c}from"./index-tywNknxv.js";import{p,C,o as f,r as w,W as I,d as g,h as A,A as y}from"./index-Dr4eFCtu.js";const E=document.getElementById("container"),s=new p,L=s.get(C),t=L.create();t.scene=new f(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 h=s.get(g);h.create(t);t.scene.three.background=null;const F=new A(s),R=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),S=await R.arrayBuffer(),T=new Uint8Array(S),l=F.load(T);t.scene.three.add(l);const o=s.get(y);o.byEntity(l);o.byIfcRel(l,d,"storeys");o.byModel(l.uuid,l);const N=o.find({entities:["IFCWALLSTANDARDCASE"]}),$=o.find({entities:["IFCSLAB"]}),U=o.find({entities:["IFCMEMBER","IFCPLATE"]}),v=o.find({entities:["IFCFURNISHINGELEMENT"]}),B=o.find({entities:["IFCDOOR"]}),D=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{a2 as u,C as m}from"./web-ifc-api-56EJvEs4.js";import{S as d}from"./stats.min-BpIepu9J.js";import{m as b,t as a,a as c}from"./index-TmOv0r_5.js";import{p,C,o as f,r as w,W as I,u as g,h as A,A as y}from"./index-BcIWfMQD.js";const E=document.getElementById("container"),s=new p,L=s.get(C),t=L.create();t.scene=new f(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 h=s.get(g);h.create(t);t.scene.three.background=null;const F=new A(s),R=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),S=await R.arrayBuffer(),T=new Uint8Array(S),l=F.load(T);t.scene.three.add(l);const o=s.get(y);o.byEntity(l);o.byIfcRel(l,u,"storeys");o.byModel(l.uuid,l);const N=o.find({entities:["IFCWALLSTANDARDCASE"]}),$=o.find({entities:["IFCSLAB"]}),U=o.find({entities:["IFCMEMBER","IFCPLATE"]}),v=o.find({entities:["IFCFURNISHINGELEMENT"]}),B=o.find({entities:["IFCDOOR"]}),D=o.find({models:[l.uuid]}),i=new d;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` diff --git a/examples/assets/clipEdges.js b/examples/assets/clipEdges.js index e498e0ad3..d6337a6c4 100644 --- a/examples/assets/clipEdges.js +++ b/examples/assets/clipEdges.js @@ -1,4 +1,4 @@ -import{B as M,M as y,a as d,b as c,L as b}from"./web-ifc-api-x-FY_BW3.js";import{S as f}from"./stats.min-BpIepu9J.js";import{m as k,t as m,a as p}from"./index-tywNknxv.js";import{p as x,C as v,o as P,W as B,d as C,H as I,R as L}from"./index-Dr4eFCtu.js";import{S as $,m as S,d as D}from"./index-Bkd9n44b.js";const u=document.getElementById("container"),o=new x,z=o.get(v),e=z.create();e.scene=new P(o);e.renderer=new $(o,u);e.camera=new B(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(C);h.config.color.setHex(6710886);const E=h.create(e);e.renderer.postproduction.customEffects.excludedMeshes.push(E.three);e.scene.three.background=null;const g=new M(3,3,3),w=new y({color:"#6528D7"}),a=new d(g,w);a.position.set(-2,1.5,0);e.scene.three.add(a);e.meshes.add(a);const l=new d(g,w);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(S);n.Type=D;const W=new c({color:"lightblue",side:2}),A=new b({color:"blue"}),H=new c({color:"blue",opacity:.5,side:2,transparent:!0});r.styles.create("Red lines",new Set([a]),e,A,W,H);const O=new c({color:"salmon",side:2}),F=new b({color:"red"}),G=new c({color:"red",opacity:.5,side:2,transparent:!0});r.styles.create("Blue lines",new Set([l]),e,F,O,G);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` +import{B as M,M as y,a as d,b as c,L as b}from"./web-ifc-api-56EJvEs4.js";import{S as f}from"./stats.min-BpIepu9J.js";import{m as x,t as m,a as p}from"./index-TmOv0r_5.js";import{p as k,C as v,o as P,W as B,u as C,H as I,b as L}from"./index-BcIWfMQD.js";import{x as $,m as D,d as z}from"./index-mpk8FhA9.js";const u=document.getElementById("container"),o=new k,E=o.get(v),e=E.create();e.scene=new P(o);e.renderer=new $(o,u);e.camera=new B(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(C);h.config.color.setHex(6710886);const S=h.create(e);e.renderer.postproduction.customEffects.excludedMeshes.push(S.three);e.scene.three.background=null;const g=new M(3,3,3),w=new y({color:"#6528D7"}),a=new d(g,w);a.position.set(-2,1.5,0);e.scene.three.add(a);e.meshes.add(a);const l=new d(g,w);l.position.set(2,1.5,0);e.scene.three.add(l);e.meshes.add(l);const A=o.get(I);A.get(e);const n=o.get(L);n.enabled=!0;const r=o.get(D);n.Type=z;const W=new c({color:"lightblue",side:2}),H=new b({color:"blue"}),O=new c({color:"blue",opacity:.5,side:2,transparent:!0});r.styles.create("Red lines",new Set([a]),e,H,W,O);const F=new c({color:"salmon",side:2}),G=new b({color:"red"}),R=new c({color:"red",opacity:.5,side:2,transparent:!0});r.styles.create("Blue lines",new Set([l]),e,G,F,R);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());x.init();const i=m.create(()=>p` diff --git a/examples/assets/clipper.js b/examples/assets/clipper.js index 159c7ee82..ecdfe2b80 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-x-FY_BW3.js";import{S as p}from"./stats.min-BpIepu9J.js";import{m as u,t as s,a as c}from"./index-tywNknxv.js";import{p as h,C as g,o as k,r as w,W as y,H as f,R as v}from"./index-Dr4eFCtu.js";const b=document.getElementById("container"),a=new h,M=a.get(g),e=M.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),C=new m({color:"#6528D7"}),o=new d(x,C);o.position.set(0,1.5,0);e.scene.three.add(o);e.meshes.add(o);const $=a.get(f);$.get(e);const n=a.get(v);n.enabled=!0;b.ondblclick=()=>{n.enabled&&n.create(e)};window.onkeydown=t=>{(t.code==="Delete"||t.code==="Backspace")&&n.enabled&&n.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-56EJvEs4.js";import{S as p}from"./stats.min-BpIepu9J.js";import{m as u,t as s,a as c}from"./index-TmOv0r_5.js";import{p as h,C as g,o as k,r as w,W as y,H as f,b as v}from"./index-BcIWfMQD.js";const b=document.getElementById("container"),a=new h,M=a.get(g),e=M.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),C=new m({color:"#6528D7"}),o=new d(x,C);o.position.set(0,1.5,0);e.scene.three.add(o);e.meshes.add(o);const $=a.get(f);$.get(e);const n=a.get(v);n.enabled=!0;b.ondblclick=()=>{n.enabled&&n.create(e)};window.onkeydown=t=>{(t.code==="Delete"||t.code==="Backspace")&&n.enabled&&n.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 64c56e3c6..49730d54e 100644 --- a/examples/assets/cullers.js +++ b/examples/assets/cullers.js @@ -1 +1 @@ -import{B as c,a6 as i,a as l}from"./web-ifc-api-x-FY_BW3.js";import{S as m}from"./stats.min-BpIepu9J.js";import{p,C as u,o as y,r as b,W as g,d as f,T as w}from"./index-Dr4eFCtu.js";const h=document.getElementById("container"),t=new p,x=t.get(u),e=x.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 M=t.get(f);M.create(e);e.scene.three.background=null;const B=t.get(w),o=B.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 C=new c(2,2,2),U=new i({color:"#6528D7"});function d(a){return Math.random()*a}function E(){for(let a=0;a<300;a++){const n=new l(C,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,a8 as i,a as l}from"./web-ifc-api-56EJvEs4.js";import{S as m}from"./stats.min-BpIepu9J.js";import{p as u,C as p,o as y,r as b,W as g,u as f,T as w}from"./index-BcIWfMQD.js";const h=document.getElementById("container"),t=new u,x=t.get(p),e=x.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 M=t.get(f);M.create(e);e.scene.three.background=null;const B=t.get(w),o=B.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 C=new c(2,2,2),U=new i({color:"#6528D7"});function d(a){return Math.random()*a}function E(){for(let a=0;a<300;a++){const n=new l(C,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 3ab23e214..5809216fd 100644 --- a/examples/assets/edgeMeasurement.js +++ b/examples/assets/edgeMeasurement.js @@ -1 +1 @@ -import{a as c}from"./web-ifc-api-x-FY_BW3.js";import{S as i}from"./stats.min-BpIepu9J.js";import{p as l,C as f,o as m,W as p,d as w,h}from"./index-Dr4eFCtu.js";import{S as g,T as u}from"./index-Bkd9n44b.js";const d=document.getElementById("container"),t=new l,y=t.get(f),e=y.create();e.scene=new m(t);e.renderer=new g(t,d);e.camera=new p(t);t.init();e.camera.controls.setLookAt(5,5,5,0,0,0);e.scene.setup();const b=t.get(w);b.create(e);e.scene.three.background=null;const S=new h(t),k=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),A=await k.arrayBuffer(),B=new Uint8Array(A),r=S.load(B);e.scene.three.add(r);for(const o of r.children)o instanceof c&&e.meshes.add(o);const n=t.get(u);n.world=e;n.enabled=!0;d.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-56EJvEs4.js";import{S as i}from"./stats.min-BpIepu9J.js";import{p as l,C as f,o as m,W as p,u as w,h}from"./index-BcIWfMQD.js";import{x as u,b as g}from"./index-mpk8FhA9.js";const r=document.getElementById("container"),t=new l,y=t.get(f),e=y.create();e.scene=new m(t);e.renderer=new u(t,r);e.camera=new p(t);t.init();e.camera.controls.setLookAt(5,5,5,0,0,0);e.scene.setup();const b=t.get(w);b.create(e);e.scene.three.background=null;const k=new h(t),x=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),A=await x.arrayBuffer(),B=new Uint8Array(A),d=k.load(B);e.scene.three.add(d);for(const o of d.children)o instanceof c&&e.meshes.add(o);const n=t.get(g);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 9d7ded2a5..b62973c08 100644 --- a/examples/assets/exploder.js +++ b/examples/assets/exploder.js @@ -1,15 +1,15 @@ -import{ao as l}from"./web-ifc-api-x-FY_BW3.js";import{S as p}from"./stats.min-BpIepu9J.js";import{m,t as a,a as i}from"./index-tywNknxv.js";import{p as d,C as b,o as u,r as g,W as h,d as f,h as w,b as x,O as y,A as S}from"./index-Dr4eFCtu.js";const v=document.getElementById("container"),e=new d,L=e.get(b),t=L.create();t.scene=new u(e);t.renderer=new g(e,v);t.camera=new h(e);e.init();t.camera.controls.setLookAt(12,6,8,0,0,-10);t.scene.setup();const k=e.get(f);k.create(t);t.scene.three.background=null;const A=new w(e),I=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),B=await I.arrayBuffer(),C=new Uint8Array(B),s=A.load(C);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),O=await fetch("https://thatopen.github.io/engine_components/resources/small-relations.json"),U=r.getRelationsMapFromJSON(await O.text());r.setRelationMap(s,U);const j=e.get(y),F=e.get(S);await F.bySpatialStructure(s,{isolate:new Set([l])});const n=new p;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{aq as l}from"./web-ifc-api-56EJvEs4.js";import{S as p}from"./stats.min-BpIepu9J.js";import{m,t as a,a as i}from"./index-TmOv0r_5.js";import{p as d,C as u,o as b,r as g,W as h,u as f,h as w,c as x,S as y,A as S}from"./index-BcIWfMQD.js";const v=document.getElementById("container"),e=new d,L=e.get(u),t=L.create();t.scene=new b(e);t.renderer=new g(e,v);t.camera=new h(e);e.init();t.camera.controls.setLookAt(12,6,8,0,0,-10);t.scene.setup();const k=e.get(f);k.create(t);t.scene.three.background=null;const A=new w(e),I=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),B=await I.arrayBuffer(),C=new Uint8Array(B),s=A.load(C);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),U=await fetch("https://thatopen.github.io/engine_components/resources/small-relations.json"),j=r.getRelationsMapFromJSON(await U.text());r.setRelationMap(s,j);const F=e.get(y),R=e.get(S);await R.bySpatialStructure(s,{isolate:new Set([l])});const n=new p;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` + @change="${({target:c})=>{F.set(c.value)}}"> - `);document.body.append(o);const R=a.create(()=>i` + `);document.body.append(o);const _=a.create(()=>i` - `);document.body.append(R); + `);document.body.append(_); diff --git a/examples/assets/faceMeasurement.js b/examples/assets/faceMeasurement.js index baf4161fd..8f84f16f3 100644 --- a/examples/assets/faceMeasurement.js +++ b/examples/assets/faceMeasurement.js @@ -1 +1 @@ -import{a as c}from"./web-ifc-api-x-FY_BW3.js";import{S as i}from"./stats.min-BpIepu9J.js";import{p as l,C as f,o as m,W as p,d as w,h}from"./index-Dr4eFCtu.js";import{S as g,C as u}from"./index-Bkd9n44b.js";const d=document.getElementById("container"),t=new l,y=t.get(f),e=y.create();e.scene=new m(t);e.renderer=new g(t,d);e.camera=new p(t);t.init();e.camera.controls.setLookAt(5,5,5,0,0,0);e.scene.setup();const b=t.get(w);b.create(e);e.scene.three.background=null;const S=new h(t),k=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),A=await k.arrayBuffer(),C=new Uint8Array(A),r=S.load(C);e.scene.three.add(r);for(const o of r.children)o instanceof c&&e.meshes.add(o);const n=t.get(u);n.world=e;n.enabled=!0;d.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-56EJvEs4.js";import{S as i}from"./stats.min-BpIepu9J.js";import{p as l,C as f,o as m,W as p,u as w,h}from"./index-BcIWfMQD.js";import{x as u,T as g}from"./index-mpk8FhA9.js";const r=document.getElementById("container"),t=new l,y=t.get(f),e=y.create();e.scene=new m(t);e.renderer=new u(t,r);e.camera=new p(t);t.init();e.camera.controls.setLookAt(5,5,5,0,0,0);e.scene.setup();const b=t.get(w);b.create(e);e.scene.three.background=null;const k=new h(t),x=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),A=await x.arrayBuffer(),B=new Uint8Array(A),d=k.load(B);e.scene.three.add(d);for(const o of d.children)o instanceof c&&e.meshes.add(o);const n=t.get(g);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 6071c49ce..a8212b7bf 100644 --- a/examples/assets/fragmentsManager.js +++ b/examples/assets/fragmentsManager.js @@ -1,4 +1,4 @@ -import"./web-ifc-api-x-FY_BW3.js";import{S as u}from"./stats.min-BpIepu9J.js";import{p,C as b,o as g,r as f,W as w,d as h,h as y}from"./index-Dr4eFCtu.js";import{m as k,t as l,a as d}from"./index-tywNknxv.js";const L=document.getElementById("container"),n=new p,v=n.get(b),e=v.create();e.scene=new g(n);e.renderer=new f(n,L);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 C(){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` +import"./web-ifc-api-56EJvEs4.js";import{S as u}from"./stats.min-BpIepu9J.js";import{p,C as b,o as g,r as f,W as w,u as h,h as y}from"./index-BcIWfMQD.js";import{m as k,t as l,a as m}from"./index-TmOv0r_5.js";const L=document.getElementById("container"),n=new p,v=n.get(b),e=v.create();e.scene=new g(n);e.renderer=new f(n,L);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 d="";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),d=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(d);if(!o)return;const t=s.export(o),c=new Blob([t]),r=new File([c],"small.frag");U(r)}function C(){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(()=>m` @@ -19,7 +19,7 @@ import"./web-ifc-api-x-FY_BW3.js";import{S as u}from"./stats.min-BpIepu9J.js";im - `);document.body.append(i);const $=l.create(()=>d` + `);document.body.append(i);const $=l.create(()=>m` diff --git a/examples/assets/grids.js b/examples/assets/grids.js index 83ddfdd10..9993b98e9 100644 --- a/examples/assets/grids.js +++ b/examples/assets/grids.js @@ -1 +1 @@ -import{a as t,B as s}from"./web-ifc-api-x-FY_BW3.js";import{p as r,C as d,o as a,r as c,W as m,d as i}from"./index-Dr4eFCtu.js";const l=document.getElementById("container"),n=new r,p=n.get(d),e=p.create();e.scene=new a(n);e.renderer=new c(n,l);e.camera=new m(n);n.init();const w=new t(new s);e.scene.three.add(w);e.scene.three.background=null;const g=n.get(i),u=g.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-56EJvEs4.js";import{p as r,C as a,o as d,r as c,W as m,u as i}from"./index-BcIWfMQD.js";const l=document.getElementById("container"),n=new r,p=n.get(a),e=p.create();e.scene=new d(n);e.renderer=new c(n,l);e.camera=new m(n);n.init();const w=new t(new s);e.scene.three.add(w);e.scene.three.background=null;const g=n.get(i),u=g.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()); diff --git a/examples/assets/hider.js b/examples/assets/hider.js index 6912fdc8d..b2d493b6a 100644 --- a/examples/assets/hider.js +++ b/examples/assets/hider.js @@ -1,4 +1,4 @@ -import{ao as S}from"./web-ifc-api-x-FY_BW3.js";import{S as k}from"./stats.min-BpIepu9J.js";import{m as x,t as r,a as l}from"./index-tywNknxv.js";import{p as C,C as v,o as F,r as I,W as L,d as j,h as A,b as $,S as B,A as E}from"./index-Dr4eFCtu.js";const M=document.getElementById("container"),e=new C,N=e.get(v),t=N.create();t.scene=new F(e);t.renderer=new I(e,M);t.camera=new L(e);e.init();t.camera.controls.setLookAt(12,6,8,0,0,-10);t.scene.setup();const O=e.get(j);O.create(t);t.scene.three.background=null;const b=e.get(A),U=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),_=await U.arrayBuffer(),R=new Uint8Array(_),i=b.load(R);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(B),s=e.get(E);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={},W=Object.keys(s.list.entities);for(const n of W)h[n]=!0;const o=r.create(()=>l` +import{aq as S}from"./web-ifc-api-56EJvEs4.js";import{S as k}from"./stats.min-BpIepu9J.js";import{m as x,t as r,a as l}from"./index-TmOv0r_5.js";import{p as C,C as v,o as F,r as I,W as L,u as _,h as j,c as A,_ as $,A as B}from"./index-BcIWfMQD.js";const E=document.getElementById("container"),e=new C,M=e.get(v),t=M.create();t.scene=new F(e);t.renderer=new I(e,E);t.camera=new L(e);e.init();t.camera.controls.setLookAt(12,6,8,0,0,-10);t.scene.setup();const N=e.get(_);N.create(t);t.scene.three.background=null;const b=e.get(j),O=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),U=await O.arrayBuffer(),q=new Uint8Array(U),i=b.load(q);t.scene.three.add(i);const R=await fetch("https://thatopen.github.io/engine_components/resources/small.json");i.setLocalProperties(await R.json());const d=e.get(A),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($),s=e.get(B);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={},W=Object.keys(s.list.entities);for(const n of W)h[n]=!0;const o=r.create(()=>l` diff --git a/examples/assets/highlighter.js b/examples/assets/highlighter.js index 66c24040f..2578a82a4 100644 --- a/examples/assets/highlighter.js +++ b/examples/assets/highlighter.js @@ -1 +1 @@ -import"./web-ifc-api-x-FY_BW3.js";import{p as r,C as s,o as a,r as c,W as d,d as i,h as m}from"./index-Dr4eFCtu.js";import{a as l}from"./index-Bkd9n44b.js";import{S as p}from"./stats.min-BpIepu9J.js";const f=document.getElementById("container"),t=new r,g=t.get(s),e=g.create();e.scene=new a(t);e.renderer=new c(t,f);e.camera=new d(t);t.init();e.camera.controls.setLookAt(12,6,8,0,0,-10);e.scene.setup();const h=t.get(i);h.create(e);e.scene.three.background=null;const u=new m(t),w=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),y=await w.arrayBuffer(),b=new Uint8Array(y),S=u.load(b);e.scene.three.add(S);const o=t.get(l);o.setup({world:e});o.zoomToSelection=!0;const n=new p;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-56EJvEs4.js";import{p as r,C as s,o as a,r as c,W as d,u as i,h as m}from"./index-BcIWfMQD.js";import{A as l}from"./index-mpk8FhA9.js";import{S as p}from"./stats.min-BpIepu9J.js";const f=document.getElementById("container"),t=new r,u=t.get(s),e=u.create();e.scene=new a(t);e.renderer=new c(t,f);e.camera=new d(t);t.init();e.camera.controls.setLookAt(12,6,8,0,0,-10);e.scene.setup();const g=t.get(i);g.create(e);e.scene.three.background=null;const h=new m(t),w=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),y=await w.arrayBuffer(),b=new Uint8Array(y),A=h.load(b);e.scene.three.add(A);const o=t.get(l);o.setup({world:e});o.zoomToSelection=!0;const n=new p;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/ifcGeometryTiler.js b/examples/assets/ifcGeometryTiler.js index da9ea6eab..1dcf00221 100644 --- a/examples/assets/ifcGeometryTiler.js +++ b/examples/assets/ifcGeometryTiler.js @@ -1,4 +1,4 @@ -import"./web-ifc-api-x-FY_BW3.js";import{S as w}from"./stats.min-BpIepu9J.js";import{m as h,t as b,a as g}from"./index-tywNknxv.js";import{p as y,C as F,o as L,r as B,W as I,d as S,h as U,_ as k}from"./index-Dr4eFCtu.js";const v=document.getElementById("container"),a=new y,A=a.get(F),t=A.create();t.scene=new L(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 C=new U(a),R=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),_=await R.arrayBuffer(),j=new Uint8Array(_),x=C.load(j);t.scene.three.add(x);const i=a.get(k),z={path:"https://unpkg.com/web-ifc@0.0.56/",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 G(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 O(e){for(const{name:s,bits:n}of e)G(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 O(l),d=[],f={},l=[],u=1})});async function P(){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-56EJvEs4.js";import{S as w}from"./stats.min-BpIepu9J.js";import{m as h,t as b,a as g}from"./index-TmOv0r_5.js";import{p as y,C as F,o as L,r as B,W as I,u as S,h as U,N as k}from"./index-BcIWfMQD.js";const v=document.getElementById("container"),a=new y,A=a.get(F),t=A.create();t.scene=new L(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 C=new U(a),N=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),R=await N.arrayBuffer(),j=new Uint8Array(R),x=C.load(j);t.scene.three.add(x);const i=a.get(k),z={path:"https://unpkg.com/web-ifc@0.0.56/",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 G(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 O(e){for(const{name:s,bits:n}of e)G(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 O(l),d=[],f={},l=[],u=1})});async function P(){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 f75dab080..353fbd9f2 100644 --- a/examples/assets/ifcJsonExporter.js +++ b/examples/assets/ifcJsonExporter.js @@ -1,4 +1,4 @@ -import{a5 as d}from"./web-ifc-api-x-FY_BW3.js";import{S as b}from"./stats.min-BpIepu9J.js";import{m as f,t as i,a as c}from"./index-tywNknxv.js";import{p as u,C as w,o as g,r as h,W as y,d as k,h as x,m as I}from"./index-Dr4eFCtu.js";const L=document.getElementById("container"),t=new u,U=t.get(w),e=U.create();e.scene=new g(t);e.renderer=new h(t,L);e.camera=new y(t);t.init();e.camera.controls.setLookAt(12,6,8,0,0,-10);e.scene.setup();const v=t.get(k);v.create(e);e.scene.three.background=null;const B=new x(t),O=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),S=await O.arrayBuffer(),A=new Uint8Array(S),j=B.load(A);e.scene.three.add(j);const C=t.get(I),a=new d;a.SetWasmPath("https://unpkg.com/web-ifc@0.0.56/",!0);await a.Init();const E=await fetch("https://thatopen.github.io/engine_components/resources/small.ifc"),F=await E.arrayBuffer(),R=new Uint8Array(F),D=a.OpenModel(R),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=i.create(()=>c` +import{a7 as d}from"./web-ifc-api-56EJvEs4.js";import{S as u}from"./stats.min-BpIepu9J.js";import{m as b,t as i,a as c}from"./index-TmOv0r_5.js";import{p as f,C as w,o as g,r as h,W as y,u as k,h as x,m as I}from"./index-BcIWfMQD.js";const L=document.getElementById("container"),t=new f,U=t.get(w),e=U.create();e.scene=new g(t);e.renderer=new h(t,L);e.camera=new y(t);t.init();e.camera.controls.setLookAt(12,6,8,0,0,-10);e.scene.setup();const v=t.get(k);v.create(e);e.scene.three.background=null;const B=new x(t),O=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),S=await O.arrayBuffer(),A=new Uint8Array(S),j=B.load(A);e.scene.three.add(j);const C=t.get(I),a=new d;a.SetWasmPath("https://unpkg.com/web-ifc@0.0.56/",!0);await a.Init();const E=await fetch("https://thatopen.github.io/engine_components/resources/small.ifc"),F=await E.arrayBuffer(),R=new Uint8Array(F),D=a.OpenModel(R),n=new u;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());b.init();const s=i.create(()=>c` diff --git a/examples/assets/ifcLoader.js b/examples/assets/ifcLoader.js index a48644dc0..10c22e86e 100644 --- a/examples/assets/ifcLoader.js +++ b/examples/assets/ifcLoader.js @@ -1,4 +1,4 @@ -import{b6 as b,b7 as u,b8 as f}from"./web-ifc-api-x-FY_BW3.js";import{m as g,t as m,a as p}from"./index-tywNknxv.js";import{S as w}from"./stats.min-BpIepu9J.js";import{p as I,C,o as y,r as h,W as F,d as L,h as N,c as R}from"./index-Dr4eFCtu.js";const E=document.getElementById("container"),o=new I,O=o.get(C),t=O.create();t.scene=new y(o);t.renderer=new h(o,E);t.camera=new F(o);o.init();t.camera.controls.setLookAt(12,6,8,0,0,-10);t.scene.setup();const x=o.get(L);x.create(t);t.scene.three.background=null;const a=o.get(N),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{b6 as u,b7 as b,b8 as f}from"./web-ifc-api-56EJvEs4.js";import{m as g,t as m,a as p}from"./index-TmOv0r_5.js";import{S as w}from"./stats.min-BpIepu9J.js";import{p as I,C,o as y,r as h,W as F,u as L,h as R,R as N}from"./index-BcIWfMQD.js";const E=document.getElementById("container"),o=new I,O=o.get(C),t=O.create();t.scene=new y(o);t.renderer=new h(o,E);t.camera=new F(o);o.init();t.camera.controls.setLookAt(12,6,8,0,0,-10);t.scene.setup();const x=o.get(L);x.create(t);t.scene.three.background=null;const a=o.get(R),c=o.get(N);await c.setup();const k=[u,b,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` diff --git a/examples/assets/ifcPropertiesManager.js b/examples/assets/ifcPropertiesManager.js index f31d32086..c78d575ef 100644 --- a/examples/assets/ifcPropertiesManager.js +++ b/examples/assets/ifcPropertiesManager.js @@ -1,5 +1,5 @@ -var yn=Object.defineProperty;var gn=(I,s,t)=>s in I?yn(I,s,{enumerable:!0,configurable:!0,writable:!0,value:t}):I[s]=t;var U=(I,s,t)=>(gn(I,typeof s!="symbol"?s+"":s,t),t);import{d as Bt,V as g,h as ft,x as Cn,r as J,T as yt,S as mn,c as $,s as q,b5 as wn,N as Bn,aU as _e,a as cn,aV as Yn,H as xn,e as pe,X as Ye,Y as Tn,Z as Rn,_ as ln,$ as xe,a0 as Fn,a1 as An,a2 as Ge,au as Gn,av as bn,a3 as Vn,p as un,aw as fn,ax as Nn,ao as On,a9 as xt,i as Hn,I as Me,ab as Q,aY as vn,ay as _n,L as Wn,az as Xn,aA as zn,aB as kn,aC as $n,aD as jn,aZ as Kn,a_ as qn,a$ as Qn,b0 as Zn,a5 as We,a6 as Xe,a7 as Jn,a8 as ts,aa as es,C as ns,ac as bt,ad as ss}from"./web-ifc-api-x-FY_BW3.js";const Sn=0,is=1,Es=2,ze=2,Te=1.25,ke=1,te=6*4+4+4,Ce=65535,os=Math.pow(2,-24),Re=Symbol("SKIP_GENERATION");function Is(I){return I.index?I.index.count:I.attributes.position.count}function Nt(I){return Is(I)/3}function rs(I,s=ArrayBuffer){return I>65535?new Uint32Array(new s(4*I)):new Uint16Array(new s(2*I))}function as(I,s){if(!I.index){const t=I.attributes.position.count,e=s.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer,n=rs(t,e);I.setIndex(new Bt(n,1));for(let E=0;Eo-r);for(let o=0;oE.offset-i.offset),e=t[t.length-1];e.count=Math.min(s-e.offset,e.count);let n=0;return t.forEach(({count:E})=>n+=E),s!==n}function Y(I,s,t){return t.min.x=s[I],t.min.y=s[I+1],t.min.z=s[I+2],t.max.x=s[I+3],t.max.y=s[I+4],t.max.z=s[I+5],t}function cs(I){I[0]=I[1]=I[2]=1/0,I[3]=I[4]=I[5]=-1/0}function $e(I){let s=-1,t=-1/0;for(let e=0;e<3;e++){const n=I[e+3]-I[e];n>t&&(t=n,s=e)}return s}function je(I,s){s.set(I)}function Ke(I,s,t){let e,n;for(let E=0;E<3;E++){const i=E+3;e=I[E],n=s[E],t[E]=en?e:n}}function Vt(I,s,t){for(let e=0;e<3;e++){const n=s[I+2*e],E=s[I+2*e+1],i=n-E,o=n+E;it[e+3]&&(t[e+3]=o)}}function pt(I){const s=I[3]-I[0],t=I[4]-I[1],e=I[5]-I[2];return 2*(s*t+t*e+e*s)}function le(I,s,t,e,n=null){let E=1/0,i=1/0,o=1/0,r=-1/0,c=-1/0,C=-1/0,T=1/0,a=1/0,R=1/0,l=-1/0,S=-1/0,N=-1/0;const F=n!==null;for(let u=s*6,O=(s+t)*6;ur&&(r=P),F&&Al&&(l=A);const p=I[u+2],d=I[u+3],D=p-d,y=p+d;Dc&&(c=y),F&&pS&&(S=p);const M=I[u+4],h=I[u+5],m=M-h,w=M+h;mC&&(C=w),F&&MN&&(N=M)}e[0]=E,e[1]=i,e[2]=o,e[3]=r,e[4]=c,e[5]=C,F&&(n[0]=T,n[1]=a,n[2]=R,n[3]=l,n[4]=S,n[5]=N)}function Ts(I,s,t,e){let n=1/0,E=1/0,i=1/0,o=-1/0,r=-1/0,c=-1/0;for(let C=s*6,T=(s+t)*6;Co&&(o=a);const R=I[C+2];Rr&&(r=R);const l=I[C+4];lc&&(c=l)}e[0]=n,e[1]=E,e[2]=i,e[3]=o,e[4]=r,e[5]=c}function Rs(I,s){cs(s);const t=I.attributes.position,e=I.index?I.index.array:null,n=Nt(I),E=new Float32Array(n*6),i=t.normalized,o=t.array,r=t.offset||0;let c=3;t.isInterleavedBufferAttribute&&(c=t.data.stride);const C=["getX","getY","getZ"];for(let T=0;TL&&(L=O),A>L&&(L=A);const P=(L-f)/2,p=F*2;E[R+p+0]=f+P,E[R+p+1]=P+(Math.abs(f)+P)*os,fs[F+3]&&(s[F+3]=L)}}return E}const Z=32,ls=(I,s)=>I.candidate-s.candidate,et=new Array(Z).fill().map(()=>({count:0,bounds:new Float32Array(6),rightCacheBounds:new Float32Array(6),leftCacheBounds:new Float32Array(6),candidate:0})),Ht=new Float32Array(6);function Fs(I,s,t,e,n,E){let i=-1,o=0;if(E===Sn)i=$e(s),i!==-1&&(o=(s[i]+s[i+3])/2);else if(E===is)i=$e(I),i!==-1&&(o=As(t,e,n,i));else if(E===Es){const r=pt(I);let c=Te*n;const C=e*6,T=(e+n)*6;for(let a=0;a<3;a++){const R=s[a],N=(s[a+3]-R)/Z;if(n=P.candidate?Vt(A,t,P.rightCacheBounds):(Vt(A,t,P.leftCacheBounds),P.count++)}}for(let A=0;A=Z&&(L=Z-1);const P=et[L];P.count++,Vt(O,t,P.bounds)}const F=et[Z-1];je(F.bounds,F.rightCacheBounds);for(let O=Z-2;O>=0;O--){const A=et[O],f=et[O+1];Ke(A.bounds,f.rightCacheBounds,A.rightCacheBounds)}let u=0;for(let O=0;O=r;)o--;if(i=r;)o--;if(i2**16,n=e?4:2,E=s?new SharedArrayBuffer(t*n):new ArrayBuffer(t*n),i=e?new Uint32Array(E):new Uint16Array(E);for(let o=0,r=i.length;o=n&&(T=!0,E&&(console.warn(`MeshBVH: Max depth of ${n} reached when generating BVH. Consider increasing maxDepth.`),console.warn(t))),L<=i||p>=n)return u(f+L),A.offset=f,A.count=L,A;const d=Fs(A.boundingData,P,l,f,L,o);if(d.axis===-1)return u(f+L),A.offset=f,A.count=L,A;const D=S(C,e,l,f,L,d);if(D===f||D===f+L)u(f+L),A.offset=f,A.count=L;else{A.splitAxis=d.axis;const y=new vt,M=f,h=D-f;A.left=y,y.boundingData=new Float32Array(6),le(l,M,h,y.boundingData,R),O(y,M,h,R,p+1);const m=new vt,w=D,x=L-h;A.right=m,m.boundingData=new Float32Array(6),le(l,w,x,m.boundingData,R),O(m,w,x,R,p+1)}return A}}function Ss(I,s){const t=I.geometry;s.indirect&&(I._indirectBuffer=Ns(t,s.useSharedArrayBuffer),Cs(t)&&!s.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.')),I._indirectBuffer||as(t,s);const e=Os(I,s);let n,E,i;const o=[],r=s.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer;for(let T=0;TMath.pow(2,32))throw new Error("MeshBVH: Cannot store child pointer greater than 32 bits.");return E[R+6]=A/4,A=C(A,u),E[R+7]=O,A}}}class tt{constructor(){this.min=1/0,this.max=-1/0}setFromPointsField(s,t){let e=1/0,n=-1/0;for(let E=0,i=s.length;En?r:n}this.min=e,this.max=n}setFromPoints(s,t){let e=1/0,n=-1/0;for(let E=0,i=t.length;En?r:n}this.min=e,this.max=n}isSeparated(s){return this.min>s.max||s.min>this.max}}tt.prototype.setFromBox=function(){const I=new g;return function(t,e){const n=e.min,E=e.max;let i=1/0,o=-1/0;for(let r=0;r<=1;r++)for(let c=0;c<=1;c++)for(let C=0;C<=1;C++){I.x=n.x*r+E.x*(1-r),I.y=n.y*c+E.y*(1-c),I.z=n.z*C+E.z*(1-C);const T=t.dot(I);i=Math.min(T,i),o=Math.max(T,o)}this.min=i,this.max=o}}();const Ls=function(){const I=new g,s=new g,t=new g;return function(n,E,i){const o=n.start,r=I,c=E.start,C=s;t.subVectors(o,c),I.subVectors(n.end,n.start),s.subVectors(E.end,E.start);const T=t.dot(C),a=C.dot(r),R=C.dot(C),l=t.dot(r),N=r.dot(r)*R-a*a;let F,u;N!==0?F=(T*a-l*R)/N:F=0,u=(T+F*a)/R,i.x=F,i.y=u}}(),be=function(){const I=new ft,s=new g,t=new g;return function(n,E,i,o){Ls(n,E,I);let r=I.x,c=I.y;if(r>=0&&r<=1&&c>=0&&c<=1){n.at(r,i),E.at(c,o);return}else if(r>=0&&r<=1){c<0?E.at(0,o):E.at(1,o),n.closestPointToPoint(o,!0,i);return}else if(c>=0&&c<=1){r<0?n.at(0,i):n.at(1,i),E.closestPointToPoint(i,!0,o);return}else{let C;r<0?C=n.start:C=n.end;let T;c<0?T=E.start:T=E.end;const a=s,R=t;if(n.closestPointToPoint(T,!0,s),E.closestPointToPoint(C,!0,t),a.distanceToSquared(T)<=R.distanceToSquared(C)){i.copy(a),o.copy(T);return}else{i.copy(C),o.copy(R);return}}}}(),Ps=function(){const I=new g,s=new g,t=new Cn,e=new J;return function(E,i){const{radius:o,center:r}=E,{a:c,b:C,c:T}=i;if(e.start=c,e.end=C,e.closestPointToPoint(r,!0,I).distanceTo(r)<=o||(e.start=c,e.end=T,e.closestPointToPoint(r,!0,I).distanceTo(r)<=o)||(e.start=C,e.end=T,e.closestPointToPoint(r,!0,I).distanceTo(r)<=o))return!0;const S=i.getPlane(t);if(Math.abs(S.distanceToPoint(r))<=o){const F=S.projectPoint(r,s);if(i.containsPoint(F))return!0}return!1}}(),ps=1e-15;function Fe(I){return Math.abs(I)new g),this.satBounds=new Array(4).fill().map(()=>new tt),this.points=[this.a,this.b,this.c],this.sphere=new mn,this.plane=new Cn,this.needsUpdate=!0}intersectsSphere(s){return Ps(s,this)}update(){const s=this.a,t=this.b,e=this.c,n=this.points,E=this.satAxes,i=this.satBounds,o=E[0],r=i[0];this.getNormal(o),r.setFromPoints(o,n);const c=E[1],C=i[1];c.subVectors(s,t),C.setFromPoints(c,n);const T=E[2],a=i[2];T.subVectors(t,e),a.setFromPoints(T,n);const R=E[3],l=i[3];R.subVectors(e,s),l.setFromPoints(R,n),this.sphere.setFromPoints(this.points),this.plane.setFromNormalAndCoplanarPoint(o,s),this.needsUpdate=!1}}K.prototype.closestPointToSegment=function(){const I=new g,s=new g,t=new J;return function(n,E=null,i=null){const{start:o,end:r}=n,c=this.points;let C,T=1/0;for(let a=0;a<3;a++){const R=(a+1)%3;t.start.copy(c[a]),t.end.copy(c[R]),be(t,n,I,s),C=I.distanceToSquared(s),C=2){(A===1?F.start:F.end).copy(R),O=2;break}if(O++,O===2&&A===-1)break}}return O}return function(N,F=null,u=!1){this.needsUpdate&&this.update(),N.isExtendedTriangle?N.needsUpdate&&N.update():(I.copy(N),I.update(),N=I);const O=this.plane,A=N.plane;if(Math.abs(O.normal.dot(A.normal))>1-1e-10){const f=this.satBounds,L=this.satAxes;t[0]=N.a,t[1]=N.b,t[2]=N.c;for(let d=0;d<4;d++){const D=f[d],y=L[d];if(e.setFromPoints(y,t),D.isSeparated(e))return!1}const P=N.satBounds,p=N.satAxes;s[0]=this.a,s[1]=this.b,s[2]=this.c;for(let d=0;d<4;d++){const D=P[d],y=p[d];if(e.setFromPoints(y,s),D.isSeparated(e))return!1}for(let d=0;d<4;d++){const D=L[d];for(let y=0;y<4;y++){const M=p[y];if(E.crossVectors(D,M),e.setFromPoints(E,s),n.setFromPoints(E,t),e.isSeparated(n))return!1}}return F&&(u||console.warn("ExtendedTriangle.intersectsTriangle: Triangles are coplanar which does not support an output edge. Setting edge to 0, 0, 0."),F.start.set(0,0,0),F.end.set(0,0,0)),!0}else{const f=l(this,A,T);if(f===1&&N.containsPoint(T.end))return F&&(F.start.copy(T.end),F.end.copy(T.end)),!0;if(f!==2)return!1;const L=l(N,O,a);if(L===1&&this.containsPoint(a.end))return F&&(F.start.copy(a.end),F.end.copy(a.end)),!0;if(L!==2)return!1;if(T.delta(o),a.delta(r),o.dot(r)<0){let h=a.start;a.start=a.end,a.end=h}const P=T.start.dot(o),p=T.end.dot(o),d=a.start.dot(o),D=a.end.dot(o),y=p0?F.start.copy(T.start):F.start.copy(a.start),c.subVectors(T.end,a.end),c.dot(o)<0?F.end.copy(T.end):F.end.copy(a.end)),!0)}}}();K.prototype.distanceToPoint=function(){const I=new g;return function(t){return this.closestPointToPoint(t,I),t.distanceTo(I)}}();K.prototype.distanceToTriangle=function(){const I=new g,s=new g,t=["a","b","c"],e=new J,n=new J;return function(i,o=null,r=null){const c=o||r?e:null;if(this.intersectsTriangle(i,c))return(o||r)&&(o&&c.getCenter(o),r&&c.getCenter(r)),0;let C=1/0;for(let T=0;T<3;T++){let a;const R=t[T],l=i[R];this.closestPointToPoint(l,I),a=l.distanceToSquared(I),anew g),this.satAxes=new Array(3).fill().map(()=>new g),this.satBounds=new Array(3).fill().map(()=>new tt),this.alignedSatBounds=new Array(3).fill().map(()=>new tt),this.needsUpdate=!1,s&&this.min.copy(s),t&&this.max.copy(t),e&&this.matrix.copy(e)}set(s,t,e){this.min.copy(s),this.max.copy(t),this.matrix.copy(e),this.needsUpdate=!0}copy(s){this.min.copy(s.min),this.max.copy(s.max),this.matrix.copy(s.matrix),this.needsUpdate=!0}}H.prototype.update=function(){return function(){const s=this.matrix,t=this.min,e=this.max,n=this.points;for(let c=0;c<=1;c++)for(let C=0;C<=1;C++)for(let T=0;T<=1;T++){const a=1*c|2*C|4*T,R=n[a];R.x=c?e.x:t.x,R.y=C?e.y:t.y,R.z=T?e.z:t.z,R.applyMatrix4(s)}const E=this.satBounds,i=this.satAxes,o=n[0];for(let c=0;c<3;c++){const C=i[c],T=E[c],a=1<new J),t=new Array(12).fill().map(()=>new J),e=new g,n=new g;return function(i,o=0,r=null,c=null){if(this.needsUpdate&&this.update(),this.intersectsBox(i))return(r||c)&&(i.getCenter(n),this.closestPointToPoint(n,e),i.closestPointToPoint(e,n),r&&r.copy(e),c&&c.copy(n)),0;const C=o*o,T=i.min,a=i.max,R=this.points;let l=1/0;for(let N=0;N<8;N++){const F=R[N];n.copy(F).clamp(T,a);const u=F.distanceToSquared(n);if(unew K)}}const W=new Ms;function v(I,s){return s[I+15]===65535}function _(I,s){return s[I+6]}function X(I,s){return s[I+14]}function z(I){return I+8}function k(I,s){return s[I+6]}function pn(I,s){return s[I+7]}class ds{constructor(){this.float32Array=null,this.uint16Array=null,this.uint32Array=null;const s=[];let t=null;this.setBuffer=e=>{t&&s.push(t),t=e,this.float32Array=new Float32Array(e),this.uint16Array=new Uint16Array(e),this.uint32Array=new Uint32Array(e)},this.clearBuffer=()=>{t=null,this.float32Array=null,this.uint16Array=null,this.uint32Array=null,s.length!==0&&this.setBuffer(s.pop())}}}const B=new ds;let it,ut;const It=[],_t=new Ve(()=>new q);function Us(I,s,t,e,n,E){it=_t.getPrimitive(),ut=_t.getPrimitive(),It.push(it,ut),B.setBuffer(I._roots[s]);const i=de(0,I.geometry,t,e,n,E);B.clearBuffer(),_t.releasePrimitive(it),_t.releasePrimitive(ut),It.pop(),It.pop();const o=It.length;return o>0&&(ut=It[o-1],it=It[o-2]),i}function de(I,s,t,e,n=null,E=0,i=0){const{float32Array:o,uint16Array:r,uint32Array:c}=B;let C=I*2;if(v(C,r)){const a=_(I,c),R=X(C,r);return Y(I,o,it),e(a,R,!1,i,E+I,it)}else{let D=function(M){const{uint16Array:h,uint32Array:m}=B;let w=M*2;for(;!v(w,h);)M=z(M),w=M*2;return _(M,m)},y=function(M){const{uint16Array:h,uint32Array:m}=B;let w=M*2;for(;!v(w,h);)M=k(M,m),w=M*2;return _(M,m)+X(w,h)};const a=z(I),R=k(I,c);let l=a,S=R,N,F,u,O;if(n&&(u=it,O=ut,Y(l,o,u),Y(S,o,O),N=n(u),F=n(O),F(Mt.copy(s).clamp(C.min,C.max),Mt.distanceToSquared(s)),intersectsBounds:(C,T,a)=>a{C.closestPointToPoint(s,Mt);const a=s.distanceToSquared(Mt);return a0&&c.normal.multiplyScalar(-1));const C={a:E,b:i,c:o,normal:new g,materialIndex:0};yt.getNormal(rt,at,Ct,C.normal),c.face=C,c.faceIndex=E}return c}function ce(I,s,t,e,n){const E=e*3;let i=E+0,o=E+1,r=E+2;const c=I.index;I.index&&(i=c.getX(i),o=c.getX(o),r=c.getX(r));const{position:C,normal:T,uv:a,uv1:R}=I.attributes,l=ys(t,C,T,a,R,i,o,r,s);return l?(l.faceIndex=e,n&&n.push(l),l):null}function b(I,s,t,e){const n=I.a,E=I.b,i=I.c;let o=s,r=s+1,c=s+2;t&&(o=t.getX(o),r=t.getX(r),c=t.getX(c)),n.x=e.getX(o),n.y=e.getY(o),n.z=e.getZ(o),E.x=e.getX(r),E.y=e.getY(r),E.z=e.getZ(r),i.x=e.getX(c),i.y=e.getY(c),i.z=e.getZ(c)}function gs(I,s,t,e,n,E){const{geometry:i,_indirectBuffer:o}=I;for(let r=e,c=e+n;rL&&(L=M),hP&&(P=h),mp&&(p=m)}return r[a+0]!==O||r[a+1]!==A||r[a+2]!==f||r[a+3]!==L||r[a+4]!==P||r[a+5]!==p?(r[a+0]=O,r[a+1]=A,r[a+2]=f,r[a+3]=L,r[a+4]=P,r[a+5]=p,!0):!1}else{const F=a+8,u=i[a+6],O=F+R,A=u+R;let f=l,L=!1,P=!1;s?f||(L=s.has(O),P=s.has(A),f=!L&&!P):(L=!0,P=!0);const p=f||L,d=f||P;let D=!1;p&&(D=T(F,R,f));let y=!1;d&&(y=T(u,R,f));const M=D||y;if(M)for(let h=0;h<3;h++){const m=F+h,w=u+h,x=r[m],St=r[m+3],Lt=r[w],Pt=r[w+3];r[a+h]=xPt?St:Pt}return M}}}const Je=new q;function Et(I,s,t,e){return Y(I,s,Je),t.intersectBox(Je,e)}function Ys(I,s,t,e,n,E){const{geometry:i,_indirectBuffer:o}=I;for(let r=e,c=e+n;r=0;let R,l;a?(R=z(I),l=k(I,i)):(R=k(I,i),l=z(I));const N=Et(R,n,e,en)?De(R,s,t,e):null;if(N){const O=N.point[C];if(a?O<=n[l+c]:O>=n[l+c+3])return N}const u=Et(l,n,e,en)?De(l,s,t,e):null;return N&&u?N.distance<=u.distance?N:u:N||u||null}}const $t=new q,ct=new K,Tt=new K,dt=new $,nn=new H,jt=new H;function vs(I,s,t,e){B.setBuffer(I._roots[s]);const n=he(0,I,t,e);return B.clearBuffer(),n}function he(I,s,t,e,n=null){const{float32Array:E,uint16Array:i,uint32Array:o}=B;let r=I*2;if(n===null&&(t.boundingBox||t.computeBoundingBox(),nn.set(t.boundingBox.min,t.boundingBox.max,e),n=nn),v(r,i)){const C=s.geometry,T=C.index,a=C.attributes.position,R=t.index,l=t.attributes.position,S=_(I,o),N=X(r,i);if(dt.copy(e).invert(),t.boundsTree)return Y(I,E,jt),jt.matrix.copy(dt),jt.needsUpdate=!0,t.boundsTree.shapecast({intersectsBounds:u=>jt.intersectsBox(u),intersectsTriangle:u=>{u.a.applyMatrix4(e),u.b.applyMatrix4(e),u.c.applyMatrix4(e),u.needsUpdate=!0;for(let O=S*3,A=(N+S)*3;Oue.distanceToBox(f),intersectsBounds:(f,L,P)=>P{if(s.boundsTree)return s.boundsTree.shapecast({boundsTraverseOrder:p=>Ut.distanceToBox(p),intersectsBounds:(p,d,D)=>D{for(let D=p,y=p+d;DL&&(L=m),wP&&(P=w),xp&&(p=x)}}return r[a+0]!==O||r[a+1]!==A||r[a+2]!==f||r[a+3]!==L||r[a+4]!==P||r[a+5]!==p?(r[a+0]=O,r[a+1]=A,r[a+2]=f,r[a+3]=L,r[a+4]=P,r[a+5]=p,!0):!1}else{const F=a+8,u=i[a+6],O=F+R,A=u+R;let f=l,L=!1,P=!1;s?f||(L=s.has(O),P=s.has(A),f=!L&&!P):(L=!0,P=!0);const p=f||L,d=f||P;let D=!1;p&&(D=T(F,R,f));let y=!1;d&&(y=T(u,R,f));const M=D||y;if(M)for(let h=0;h<3;h++){const m=F+h,w=u+h,x=r[m],St=r[m+3],Lt=r[w],Pt=r[w+3];r[a+h]=xPt?St:Pt}return M}}}const sn=new g;function js(I,s,t,e,n){B.setBuffer(I._roots[s]),ye(0,I,t,e,n),B.clearBuffer()}function ye(I,s,t,e,n){const{float32Array:E,uint16Array:i,uint32Array:o}=B,r=I*2;if(v(r,i)){const C=_(I,o),T=X(r,i);Ys(s,t,e,C,T,n)}else{const C=z(I);Et(C,E,e,sn)&&ye(C,s,t,e,n);const T=k(I,o);Et(T,E,e,sn)&&ye(T,s,t,e,n)}}const En=new g,Ks=["x","y","z"];function qs(I,s,t,e){B.setBuffer(I._roots[s]);const n=ge(0,I,t,e);return B.clearBuffer(),n}function ge(I,s,t,e){const{float32Array:n,uint16Array:E,uint32Array:i}=B;let o=I*2;if(v(o,E)){const c=_(I,i),C=X(o,E);return xs(s,t,e,c,C)}else{const c=pn(I,i),C=Ks[c],a=e.direction[C]>=0;let R,l;a?(R=z(I),l=k(I,i)):(R=k(I,i),l=z(I));const N=Et(R,n,e,En)?ge(R,s,t,e):null;if(N){const O=N.point[C];if(a?O<=n[l+c]:O>=n[l+c+3])return N}const u=Et(l,n,e,En)?ge(l,s,t,e):null;return N&&u?N.distance<=u.distance?N:u:N||u||null}}const qt=new q,Rt=new K,lt=new K,Dt=new $,on=new H,Qt=new H;function Qs(I,s,t,e){B.setBuffer(I._roots[s]);const n=me(0,I,t,e);return B.clearBuffer(),n}function me(I,s,t,e,n=null){const{float32Array:E,uint16Array:i,uint32Array:o}=B;let r=I*2;if(n===null&&(t.boundingBox||t.computeBoundingBox(),on.set(t.boundingBox.min,t.boundingBox.max,e),n=on),v(r,i)){const C=s.geometry,T=C.index,a=C.attributes.position,R=t.index,l=t.attributes.position,S=_(I,o),N=X(r,i);if(Dt.copy(e).invert(),t.boundsTree)return Y(I,E,Qt),Qt.matrix.copy(Dt),Qt.needsUpdate=!0,t.boundsTree.shapecast({intersectsBounds:u=>Qt.intersectsBox(u),intersectsTriangle:u=>{u.a.applyMatrix4(e),u.b.applyMatrix4(e),u.c.applyMatrix4(e),u.needsUpdate=!0;for(let O=S,A=N+S;Ofe.distanceToBox(f),intersectsBounds:(f,L,P)=>P{if(s.boundsTree){const P=s.boundsTree;return P.shapecast({boundsTraverseOrder:p=>ht.distanceToBox(p),intersectsBounds:(p,d,D)=>D{for(let D=p,y=p+d;Dnew q),Ft=new q,At=new q,Ne=new q,Oe=new q;let Se=!1;function ii(I,s,t,e){if(Se)throw new Error("MeshBVH: Recursive calls to bvhcast not supported.");Se=!0;const n=I._roots,E=s._roots;let i,o=0,r=0;const c=new $().copy(t).invert();for(let C=0,T=n.length;Cr.slice()),index:i.array.slice(),indirectBuffer:E?E.slice():null}:o={roots:n,index:i.array,indirectBuffer:E},o}static deserialize(s,t,e={}){e={setIndex:!0,indirect:!!s.indirectBuffer,...e};const{index:n,roots:E,indirectBuffer:i}=s,o=new He(t,{...e,[Re]:!0});if(o._roots=E,o._indirectBuffer=i||null,e.setIndex){const r=t.getIndex();if(r===null){const c=new Bt(s.index,1,!1);t.setIndex(c)}else r.array!==n&&(r.array.set(n),r.needsUpdate=!0)}return o}get indirect(){return!!this._indirectBuffer}constructor(s,t={}){if(s.isBufferGeometry){if(s.index&&s.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:Sn,maxDepth:40,maxLeafTris:10,verbose:!0,useSharedArrayBuffer:!1,setBoundingBox:!0,onProgress:null,indirect:!1,[Re]:!1},t),t.useSharedArrayBuffer&&!si())throw new Error("MeshBVH: SharedArrayBuffer is not available.");this.geometry=s,this._roots=null,this._indirectBuffer=null,t[Re]||(Ss(this,t),!s.boundingBox&&t.setBoundingBox&&(s.boundingBox=this.getBoundingBox(new q)));const{_indirectBuffer:e}=this;this.resolveTriangleIndex=t.indirect?n=>e[n]:n=>n}refit(s=null){return(this.indirect?$s:Bs)(this,s)}traverse(s,t=0){const e=this._roots[t],n=new Uint32Array(e),E=new Uint16Array(e);i(0);function i(o,r=0){const c=o*2,C=E[c+15]===Ce;if(C){const T=n[o+6],a=E[c+14];s(r,C,new Float32Array(e,o*4,6),T,a)}else{const T=o+te/4,a=n[o+6],R=n[o+7];s(r,C,new Float32Array(e,o*4,6),R)||(i(T,r+1),i(a,r+1))}}}raycast(s,t=_e){const e=this._roots,n=this.geometry,E=[],i=t.isMaterial,o=Array.isArray(t),r=n.groups,c=i?t.side:t,C=this.indirect?js:bs;for(let T=0,a=e.length;TT(a,R,l,S,N)?!0:e(a,R,this,o,l,S,t)}else i||(o?i=(T,a,R,l)=>e(T,a,this,o,R,l,t):i=(T,a,R)=>R);let r=!1,c=0;const C=this._roots;for(let T=0,a=C.length;T{const S=this.resolveTriangleIndex(l);b(i,S*3,o,r)}:l=>{b(i,l*3,o,r)},C=W.getPrimitive(),T=s.geometry.index,a=s.geometry.attributes.position,R=s.indirect?l=>{const S=s.resolveTriangleIndex(l);b(C,S*3,T,a)}:l=>{b(C,l*3,T,a)};if(E){const l=(S,N,F,u,O,A,f,L)=>{for(let P=F,p=F+u;PJt.intersectsBox(e),intersectsTriangle:e=>Jt.intersectsTriangle(e)})}intersectsSphere(s){return this.shapecast({intersectsBounds:t=>s.intersectsBox(t),intersectsTriangle:t=>t.intersectsSphere(s)})}closestPointToGeometry(s,t,e={},n={},E=0,i=1/0){return(this.indirect?ni:ks)(this,s,t,e,n,E,i)}closestPointToPoint(s,t={},e=0,n=1/0){return Ds(this,s,t,e,n)}getBoundingBox(s){return s.makeEmpty(),this._roots.forEach(e=>{Y(0,new Float32Array(e),In),s.union(In)}),s}}function rn(I,s,t){return I===null||(I.point.applyMatrix4(s.matrixWorld),I.distance=I.point.distanceTo(t.ray.origin),I.object=s,I.distancet.far)?null:I}const Le=new Yn,an=new $,Ei=cn.prototype.raycast;function oi(I,s){if(this.geometry.boundsTree){if(this.material===void 0)return;an.copy(this.matrixWorld).invert(),Le.copy(I.ray).applyMatrix4(an);const t=this.geometry.boundsTree;if(I.firstHitOnly===!0){const e=rn(t.raycastFirst(Le,this.material),this,I);e&&s.push(e)}else{const e=t.raycast(Le,this.material);for(let n=0,E=e.length;n{const t=this.handlers.slice(0);for(const e of t)e(s)});U(this,"handlers",[])}add(s){this.handlers.push(s)}remove(s){this.handlers=this.handlers.filter(t=>t!==s)}reset(){this.handlers.length=0}}class ai{constructor(s){U(this,"isDisposeable",()=>"dispose"in this&&"onDisposed"in this);U(this,"isResizeable",()=>"resize"in this&&"getSize"in this);U(this,"isUpdateable",()=>"onAfterUpdate"in this&&"onBeforeUpdate"in this&&"update"in this);U(this,"isHideable",()=>"visible"in this);U(this,"isConfigurable",()=>"setup"in this&&"config"in this&&"onSetup"in this);this.components=s}}class Gt extends ai{}const G=class G{static create(){const s=Math.random()*4294967295|0,t=Math.random()*4294967295|0,e=Math.random()*4294967295|0,n=Math.random()*4294967295|0;return`${G._lut[s&255]+G._lut[s>>8&255]+G._lut[s>>16&255]+G._lut[s>>24&255]}-${G._lut[t&255]}${G._lut[t>>8&255]}-${G._lut[t>>16&15|64]}${G._lut[t>>24&255]}-${G._lut[e&63|128]}${G._lut[e>>8&255]}-${G._lut[e>>16&255]}${G._lut[e>>24&255]}${G._lut[n&255]}${G._lut[n>>8&255]}${G._lut[n>>16&255]}${G._lut[n>>24&255]}`.toLowerCase()}static validate(s){if(!G._pattern.test(s))throw new Error(`${s} is not a valid UUID v4. +var ms=Object.defineProperty;var ws=(r,n,t)=>n in r?ms(r,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[n]=t;var M=(r,n,t)=>(ws(r,typeof n!="symbol"?n+"":n,t),t);import{d as Bt,V as g,h as ft,x as Cs,r as J,T as yt,S as Bs,c as $,s as K,b5 as Ys,N as xs,aU as _e,a as cs,aV as Gs,H as bs,e as pe,X as Ye,Y as Ts,Z as Rs,_ as ls,$ as xe,a0 as Fs,a1 as As,a2 as Ge,a3 as us,a4 as fs,a5 as Vs,p as Ns,aw as Os,ax as Ss,aq as Ls,ab as xt,i as Hs,I as de,ad as Q,aY as vs,ay as _s,L as Ws,az as Xs,aA as zs,aB as ks,aC as $s,aD as js,aZ as qs,a_ as Ks,a$ as Qs,b0 as Zs,a7 as We,a8 as Xe,a9 as Js,aa as tn,ac as en,C as sn,ae as bt,af as nn}from"./web-ifc-api-56EJvEs4.js";const Ps=0,En=1,on=2,ze=2,Te=1.25,ke=1,te=6*4+4+4,Ce=65535,rn=Math.pow(2,-24),Re=Symbol("SKIP_GENERATION");function In(r){return r.index?r.index.count:r.attributes.position.count}function Nt(r){return In(r)/3}function an(r,n=ArrayBuffer){return r>65535?new Uint32Array(new n(4*r)):new Uint16Array(new n(2*r))}function Cn(r,n){if(!r.index){const t=r.attributes.position.count,e=n.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer,s=an(t,e);r.setIndex(new Bt(s,1));for(let E=0;Eo-I);for(let o=0;oE.offset-i.offset),e=t[t.length-1];e.count=Math.min(n-e.offset,e.count);let s=0;return t.forEach(({count:E})=>s+=E),n!==s}function Y(r,n,t){return t.min.x=n[r],t.min.y=n[r+1],t.min.z=n[r+2],t.max.x=n[r+3],t.max.y=n[r+4],t.max.z=n[r+5],t}function Tn(r){r[0]=r[1]=r[2]=1/0,r[3]=r[4]=r[5]=-1/0}function $e(r){let n=-1,t=-1/0;for(let e=0;e<3;e++){const s=r[e+3]-r[e];s>t&&(t=s,n=e)}return n}function je(r,n){n.set(r)}function qe(r,n,t){let e,s;for(let E=0;E<3;E++){const i=E+3;e=r[E],s=n[E],t[E]=es?e:s}}function Vt(r,n,t){for(let e=0;e<3;e++){const s=n[r+2*e],E=n[r+2*e+1],i=s-E,o=s+E;it[e+3]&&(t[e+3]=o)}}function pt(r){const n=r[3]-r[0],t=r[4]-r[1],e=r[5]-r[2];return 2*(n*t+t*e+e*n)}function le(r,n,t,e,s=null){let E=1/0,i=1/0,o=1/0,I=-1/0,c=-1/0,C=-1/0,T=1/0,a=1/0,R=1/0,l=-1/0,S=-1/0,N=-1/0;const F=s!==null;for(let u=n*6,O=(n+t)*6;uI&&(I=P),F&&Al&&(l=A);const p=r[u+2],U=r[u+3],D=p-U,y=p+U;Dc&&(c=y),F&&pS&&(S=p);const d=r[u+4],h=r[u+5],m=d-h,w=d+h;mC&&(C=w),F&&dN&&(N=d)}e[0]=E,e[1]=i,e[2]=o,e[3]=I,e[4]=c,e[5]=C,F&&(s[0]=T,s[1]=a,s[2]=R,s[3]=l,s[4]=S,s[5]=N)}function Rn(r,n,t,e){let s=1/0,E=1/0,i=1/0,o=-1/0,I=-1/0,c=-1/0;for(let C=n*6,T=(n+t)*6;Co&&(o=a);const R=r[C+2];RI&&(I=R);const l=r[C+4];lc&&(c=l)}e[0]=s,e[1]=E,e[2]=i,e[3]=o,e[4]=I,e[5]=c}function ln(r,n){Tn(n);const t=r.attributes.position,e=r.index?r.index.array:null,s=Nt(r),E=new Float32Array(s*6),i=t.normalized,o=t.array,I=t.offset||0;let c=3;t.isInterleavedBufferAttribute&&(c=t.data.stride);const C=["getX","getY","getZ"];for(let T=0;TL&&(L=O),A>L&&(L=A);const P=(L-f)/2,p=F*2;E[R+p+0]=f+P,E[R+p+1]=P+(Math.abs(f)+P)*rn,fn[F+3]&&(n[F+3]=L)}}return E}const Z=32,Fn=(r,n)=>r.candidate-n.candidate,et=new Array(Z).fill().map(()=>({count:0,bounds:new Float32Array(6),rightCacheBounds:new Float32Array(6),leftCacheBounds:new Float32Array(6),candidate:0})),Ht=new Float32Array(6);function An(r,n,t,e,s,E){let i=-1,o=0;if(E===Ps)i=$e(n),i!==-1&&(o=(n[i]+n[i+3])/2);else if(E===En)i=$e(r),i!==-1&&(o=un(t,e,s,i));else if(E===on){const I=pt(r);let c=Te*s;const C=e*6,T=(e+s)*6;for(let a=0;a<3;a++){const R=n[a],N=(n[a+3]-R)/Z;if(s=P.candidate?Vt(A,t,P.rightCacheBounds):(Vt(A,t,P.leftCacheBounds),P.count++)}}for(let A=0;A=Z&&(L=Z-1);const P=et[L];P.count++,Vt(O,t,P.bounds)}const F=et[Z-1];je(F.bounds,F.rightCacheBounds);for(let O=Z-2;O>=0;O--){const A=et[O],f=et[O+1];qe(A.bounds,f.rightCacheBounds,A.rightCacheBounds)}let u=0;for(let O=0;O=I;)o--;if(i=I;)o--;if(i2**16,s=e?4:2,E=n?new SharedArrayBuffer(t*s):new ArrayBuffer(t*s),i=e?new Uint32Array(E):new Uint16Array(E);for(let o=0,I=i.length;o=s&&(T=!0,E&&(console.warn(`MeshBVH: Max depth of ${s} reached when generating BVH. Consider increasing maxDepth.`),console.warn(t))),L<=i||p>=s)return u(f+L),A.offset=f,A.count=L,A;const U=An(A.boundingData,P,l,f,L,o);if(U.axis===-1)return u(f+L),A.offset=f,A.count=L,A;const D=S(C,e,l,f,L,U);if(D===f||D===f+L)u(f+L),A.offset=f,A.count=L;else{A.splitAxis=U.axis;const y=new vt,d=f,h=D-f;A.left=y,y.boundingData=new Float32Array(6),le(l,d,h,y.boundingData,R),O(y,d,h,R,p+1);const m=new vt,w=D,G=L-h;A.right=m,m.boundingData=new Float32Array(6),le(l,w,G,m.boundingData,R),O(m,w,G,R,p+1)}return A}}function Ln(r,n){const t=r.geometry;n.indirect&&(r._indirectBuffer=On(t,n.useSharedArrayBuffer),cn(t)&&!n.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.')),r._indirectBuffer||Cn(t,n);const e=Sn(r,n);let s,E,i;const o=[],I=n.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer;for(let T=0;TMath.pow(2,32))throw new Error("MeshBVH: Cannot store child pointer greater than 32 bits.");return E[R+6]=A/4,A=C(A,u),E[R+7]=O,A}}}class tt{constructor(){this.min=1/0,this.max=-1/0}setFromPointsField(n,t){let e=1/0,s=-1/0;for(let E=0,i=n.length;Es?I:s}this.min=e,this.max=s}setFromPoints(n,t){let e=1/0,s=-1/0;for(let E=0,i=t.length;Es?I:s}this.min=e,this.max=s}isSeparated(n){return this.min>n.max||n.min>this.max}}tt.prototype.setFromBox=function(){const r=new g;return function(t,e){const s=e.min,E=e.max;let i=1/0,o=-1/0;for(let I=0;I<=1;I++)for(let c=0;c<=1;c++)for(let C=0;C<=1;C++){r.x=s.x*I+E.x*(1-I),r.y=s.y*c+E.y*(1-c),r.z=s.z*C+E.z*(1-C);const T=t.dot(r);i=Math.min(T,i),o=Math.max(T,o)}this.min=i,this.max=o}}();const Pn=function(){const r=new g,n=new g,t=new g;return function(s,E,i){const o=s.start,I=r,c=E.start,C=n;t.subVectors(o,c),r.subVectors(s.end,s.start),n.subVectors(E.end,E.start);const T=t.dot(C),a=C.dot(I),R=C.dot(C),l=t.dot(I),N=I.dot(I)*R-a*a;let F,u;N!==0?F=(T*a-l*R)/N:F=0,u=(T+F*a)/R,i.x=F,i.y=u}}(),be=function(){const r=new ft,n=new g,t=new g;return function(s,E,i,o){Pn(s,E,r);let I=r.x,c=r.y;if(I>=0&&I<=1&&c>=0&&c<=1){s.at(I,i),E.at(c,o);return}else if(I>=0&&I<=1){c<0?E.at(0,o):E.at(1,o),s.closestPointToPoint(o,!0,i);return}else if(c>=0&&c<=1){I<0?s.at(0,i):s.at(1,i),E.closestPointToPoint(i,!0,o);return}else{let C;I<0?C=s.start:C=s.end;let T;c<0?T=E.start:T=E.end;const a=n,R=t;if(s.closestPointToPoint(T,!0,n),E.closestPointToPoint(C,!0,t),a.distanceToSquared(T)<=R.distanceToSquared(C)){i.copy(a),o.copy(T);return}else{i.copy(C),o.copy(R);return}}}}(),pn=function(){const r=new g,n=new g,t=new Cs,e=new J;return function(E,i){const{radius:o,center:I}=E,{a:c,b:C,c:T}=i;if(e.start=c,e.end=C,e.closestPointToPoint(I,!0,r).distanceTo(I)<=o||(e.start=c,e.end=T,e.closestPointToPoint(I,!0,r).distanceTo(I)<=o)||(e.start=C,e.end=T,e.closestPointToPoint(I,!0,r).distanceTo(I)<=o))return!0;const S=i.getPlane(t);if(Math.abs(S.distanceToPoint(I))<=o){const F=S.projectPoint(I,n);if(i.containsPoint(F))return!0}return!1}}(),dn=1e-15;function Fe(r){return Math.abs(r)new g),this.satBounds=new Array(4).fill().map(()=>new tt),this.points=[this.a,this.b,this.c],this.sphere=new Bs,this.plane=new Cs,this.needsUpdate=!0}intersectsSphere(n){return pn(n,this)}update(){const n=this.a,t=this.b,e=this.c,s=this.points,E=this.satAxes,i=this.satBounds,o=E[0],I=i[0];this.getNormal(o),I.setFromPoints(o,s);const c=E[1],C=i[1];c.subVectors(n,t),C.setFromPoints(c,s);const T=E[2],a=i[2];T.subVectors(t,e),a.setFromPoints(T,s);const R=E[3],l=i[3];R.subVectors(e,n),l.setFromPoints(R,s),this.sphere.setFromPoints(this.points),this.plane.setFromNormalAndCoplanarPoint(o,n),this.needsUpdate=!1}}q.prototype.closestPointToSegment=function(){const r=new g,n=new g,t=new J;return function(s,E=null,i=null){const{start:o,end:I}=s,c=this.points;let C,T=1/0;for(let a=0;a<3;a++){const R=(a+1)%3;t.start.copy(c[a]),t.end.copy(c[R]),be(t,s,r,n),C=r.distanceToSquared(n),C=2){(A===1?F.start:F.end).copy(R),O=2;break}if(O++,O===2&&A===-1)break}}return O}return function(N,F=null,u=!1){this.needsUpdate&&this.update(),N.isExtendedTriangle?N.needsUpdate&&N.update():(r.copy(N),r.update(),N=r);const O=this.plane,A=N.plane;if(Math.abs(O.normal.dot(A.normal))>1-1e-10){const f=this.satBounds,L=this.satAxes;t[0]=N.a,t[1]=N.b,t[2]=N.c;for(let U=0;U<4;U++){const D=f[U],y=L[U];if(e.setFromPoints(y,t),D.isSeparated(e))return!1}const P=N.satBounds,p=N.satAxes;n[0]=this.a,n[1]=this.b,n[2]=this.c;for(let U=0;U<4;U++){const D=P[U],y=p[U];if(e.setFromPoints(y,n),D.isSeparated(e))return!1}for(let U=0;U<4;U++){const D=L[U];for(let y=0;y<4;y++){const d=p[y];if(E.crossVectors(D,d),e.setFromPoints(E,n),s.setFromPoints(E,t),e.isSeparated(s))return!1}}return F&&(u||console.warn("ExtendedTriangle.intersectsTriangle: Triangles are coplanar which does not support an output edge. Setting edge to 0, 0, 0."),F.start.set(0,0,0),F.end.set(0,0,0)),!0}else{const f=l(this,A,T);if(f===1&&N.containsPoint(T.end))return F&&(F.start.copy(T.end),F.end.copy(T.end)),!0;if(f!==2)return!1;const L=l(N,O,a);if(L===1&&this.containsPoint(a.end))return F&&(F.start.copy(a.end),F.end.copy(a.end)),!0;if(L!==2)return!1;if(T.delta(o),a.delta(I),o.dot(I)<0){let h=a.start;a.start=a.end,a.end=h}const P=T.start.dot(o),p=T.end.dot(o),U=a.start.dot(o),D=a.end.dot(o),y=p0?F.start.copy(T.start):F.start.copy(a.start),c.subVectors(T.end,a.end),c.dot(o)<0?F.end.copy(T.end):F.end.copy(a.end)),!0)}}}();q.prototype.distanceToPoint=function(){const r=new g;return function(t){return this.closestPointToPoint(t,r),t.distanceTo(r)}}();q.prototype.distanceToTriangle=function(){const r=new g,n=new g,t=["a","b","c"],e=new J,s=new J;return function(i,o=null,I=null){const c=o||I?e:null;if(this.intersectsTriangle(i,c))return(o||I)&&(o&&c.getCenter(o),I&&c.getCenter(I)),0;let C=1/0;for(let T=0;T<3;T++){let a;const R=t[T],l=i[R];this.closestPointToPoint(l,r),a=l.distanceToSquared(r),anew g),this.satAxes=new Array(3).fill().map(()=>new g),this.satBounds=new Array(3).fill().map(()=>new tt),this.alignedSatBounds=new Array(3).fill().map(()=>new tt),this.needsUpdate=!1,n&&this.min.copy(n),t&&this.max.copy(t),e&&this.matrix.copy(e)}set(n,t,e){this.min.copy(n),this.max.copy(t),this.matrix.copy(e),this.needsUpdate=!0}copy(n){this.min.copy(n.min),this.max.copy(n.max),this.matrix.copy(n.matrix),this.needsUpdate=!0}}H.prototype.update=function(){return function(){const n=this.matrix,t=this.min,e=this.max,s=this.points;for(let c=0;c<=1;c++)for(let C=0;C<=1;C++)for(let T=0;T<=1;T++){const a=1*c|2*C|4*T,R=s[a];R.x=c?e.x:t.x,R.y=C?e.y:t.y,R.z=T?e.z:t.z,R.applyMatrix4(n)}const E=this.satBounds,i=this.satAxes,o=s[0];for(let c=0;c<3;c++){const C=i[c],T=E[c],a=1<new J),t=new Array(12).fill().map(()=>new J),e=new g,s=new g;return function(i,o=0,I=null,c=null){if(this.needsUpdate&&this.update(),this.intersectsBox(i))return(I||c)&&(i.getCenter(s),this.closestPointToPoint(s,e),i.closestPointToPoint(e,s),I&&I.copy(e),c&&c.copy(s)),0;const C=o*o,T=i.min,a=i.max,R=this.points;let l=1/0;for(let N=0;N<8;N++){const F=R[N];s.copy(F).clamp(T,a);const u=F.distanceToSquared(s);if(unew q)}}const W=new Mn;function v(r,n){return n[r+15]===65535}function _(r,n){return n[r+6]}function X(r,n){return n[r+14]}function z(r){return r+8}function k(r,n){return n[r+6]}function Ms(r,n){return n[r+7]}class Un{constructor(){this.float32Array=null,this.uint16Array=null,this.uint32Array=null;const n=[];let t=null;this.setBuffer=e=>{t&&n.push(t),t=e,this.float32Array=new Float32Array(e),this.uint16Array=new Uint16Array(e),this.uint32Array=new Uint32Array(e)},this.clearBuffer=()=>{t=null,this.float32Array=null,this.uint16Array=null,this.uint32Array=null,n.length!==0&&this.setBuffer(n.pop())}}}const B=new Un;let it,ut;const rt=[],_t=new Ve(()=>new K);function Dn(r,n,t,e,s,E){it=_t.getPrimitive(),ut=_t.getPrimitive(),rt.push(it,ut),B.setBuffer(r._roots[n]);const i=Me(0,r.geometry,t,e,s,E);B.clearBuffer(),_t.releasePrimitive(it),_t.releasePrimitive(ut),rt.pop(),rt.pop();const o=rt.length;return o>0&&(ut=rt[o-1],it=rt[o-2]),i}function Me(r,n,t,e,s=null,E=0,i=0){const{float32Array:o,uint16Array:I,uint32Array:c}=B;let C=r*2;if(v(C,I)){const a=_(r,c),R=X(C,I);return Y(r,o,it),e(a,R,!1,i,E+r,it)}else{let D=function(d){const{uint16Array:h,uint32Array:m}=B;let w=d*2;for(;!v(w,h);)d=z(d),w=d*2;return _(d,m)},y=function(d){const{uint16Array:h,uint32Array:m}=B;let w=d*2;for(;!v(w,h);)d=k(d,m),w=d*2;return _(d,m)+X(w,h)};const a=z(r),R=k(r,c);let l=a,S=R,N,F,u,O;if(s&&(u=it,O=ut,Y(l,o,u),Y(S,o,O),N=s(u),F=s(O),F(dt.copy(n).clamp(C.min,C.max),dt.distanceToSquared(n)),intersectsBounds:(C,T,a)=>a{C.closestPointToPoint(n,dt);const a=n.distanceToSquared(dt);return a0&&c.normal.multiplyScalar(-1));const C={a:E,b:i,c:o,normal:new g,materialIndex:0};yt.getNormal(It,at,Ct,C.normal),c.face=C,c.faceIndex=E}return c}function ce(r,n,t,e,s){const E=e*3;let i=E+0,o=E+1,I=E+2;const c=r.index;r.index&&(i=c.getX(i),o=c.getX(o),I=c.getX(I));const{position:C,normal:T,uv:a,uv1:R}=r.attributes,l=gn(t,C,T,a,R,i,o,I,n);return l?(l.faceIndex=e,s&&s.push(l),l):null}function V(r,n,t,e){const s=r.a,E=r.b,i=r.c;let o=n,I=n+1,c=n+2;t&&(o=t.getX(o),I=t.getX(I),c=t.getX(c)),s.x=e.getX(o),s.y=e.getY(o),s.z=e.getZ(o),E.x=e.getX(I),E.y=e.getY(I),E.z=e.getZ(I),i.x=e.getX(c),i.y=e.getY(c),i.z=e.getZ(c)}function mn(r,n,t,e,s,E){const{geometry:i,_indirectBuffer:o}=r;for(let I=e,c=e+s;IL&&(L=d),hP&&(P=h),mp&&(p=m)}return I[a+0]!==O||I[a+1]!==A||I[a+2]!==f||I[a+3]!==L||I[a+4]!==P||I[a+5]!==p?(I[a+0]=O,I[a+1]=A,I[a+2]=f,I[a+3]=L,I[a+4]=P,I[a+5]=p,!0):!1}else{const F=a+8,u=i[a+6],O=F+R,A=u+R;let f=l,L=!1,P=!1;n?f||(L=n.has(O),P=n.has(A),f=!L&&!P):(L=!0,P=!0);const p=f||L,U=f||P;let D=!1;p&&(D=T(F,R,f));let y=!1;U&&(y=T(u,R,f));const d=D||y;if(d)for(let h=0;h<3;h++){const m=F+h,w=u+h,G=I[m],St=I[m+3],Lt=I[w],Pt=I[w+3];I[a+h]=GPt?St:Pt}return d}}}const Je=new K;function Et(r,n,t,e){return Y(r,n,Je),t.intersectBox(Je,e)}function xn(r,n,t,e,s,E){const{geometry:i,_indirectBuffer:o}=r;for(let I=e,c=e+s;I=0;let R,l;a?(R=z(r),l=k(r,i)):(R=k(r,i),l=z(r));const N=Et(R,s,e,es)?De(R,n,t,e):null;if(N){const O=N.point[C];if(a?O<=s[l+c]:O>=s[l+c+3])return N}const u=Et(l,s,e,es)?De(l,n,t,e):null;return N&&u?N.distance<=u.distance?N:u:N||u||null}}const $t=new K,ct=new q,Tt=new q,Mt=new $,ss=new H,jt=new H;function _n(r,n,t,e){B.setBuffer(r._roots[n]);const s=he(0,r,t,e);return B.clearBuffer(),s}function he(r,n,t,e,s=null){const{float32Array:E,uint16Array:i,uint32Array:o}=B;let I=r*2;if(s===null&&(t.boundingBox||t.computeBoundingBox(),ss.set(t.boundingBox.min,t.boundingBox.max,e),s=ss),v(I,i)){const C=n.geometry,T=C.index,a=C.attributes.position,R=t.index,l=t.attributes.position,S=_(r,o),N=X(I,i);if(Mt.copy(e).invert(),t.boundsTree)return Y(r,E,jt),jt.matrix.copy(Mt),jt.needsUpdate=!0,t.boundsTree.shapecast({intersectsBounds:u=>jt.intersectsBox(u),intersectsTriangle:u=>{u.a.applyMatrix4(e),u.b.applyMatrix4(e),u.c.applyMatrix4(e),u.needsUpdate=!0;for(let O=S*3,A=(N+S)*3;Oue.distanceToBox(f),intersectsBounds:(f,L,P)=>P{if(n.boundsTree)return n.boundsTree.shapecast({boundsTraverseOrder:p=>Ut.distanceToBox(p),intersectsBounds:(p,U,D)=>D{for(let D=p,y=p+U;DL&&(L=m),wP&&(P=w),Gp&&(p=G)}}return I[a+0]!==O||I[a+1]!==A||I[a+2]!==f||I[a+3]!==L||I[a+4]!==P||I[a+5]!==p?(I[a+0]=O,I[a+1]=A,I[a+2]=f,I[a+3]=L,I[a+4]=P,I[a+5]=p,!0):!1}else{const F=a+8,u=i[a+6],O=F+R,A=u+R;let f=l,L=!1,P=!1;n?f||(L=n.has(O),P=n.has(A),f=!L&&!P):(L=!0,P=!0);const p=f||L,U=f||P;let D=!1;p&&(D=T(F,R,f));let y=!1;U&&(y=T(u,R,f));const d=D||y;if(d)for(let h=0;h<3;h++){const m=F+h,w=u+h,G=I[m],St=I[m+3],Lt=I[w],Pt=I[w+3];I[a+h]=GPt?St:Pt}return d}}}const ns=new g;function qn(r,n,t,e,s){B.setBuffer(r._roots[n]),ye(0,r,t,e,s),B.clearBuffer()}function ye(r,n,t,e,s){const{float32Array:E,uint16Array:i,uint32Array:o}=B,I=r*2;if(v(I,i)){const C=_(r,o),T=X(I,i);xn(n,t,e,C,T,s)}else{const C=z(r);Et(C,E,e,ns)&&ye(C,n,t,e,s);const T=k(r,o);Et(T,E,e,ns)&&ye(T,n,t,e,s)}}const is=new g,Kn=["x","y","z"];function Qn(r,n,t,e){B.setBuffer(r._roots[n]);const s=ge(0,r,t,e);return B.clearBuffer(),s}function ge(r,n,t,e){const{float32Array:s,uint16Array:E,uint32Array:i}=B;let o=r*2;if(v(o,E)){const c=_(r,i),C=X(o,E);return Gn(n,t,e,c,C)}else{const c=Ms(r,i),C=Kn[c],a=e.direction[C]>=0;let R,l;a?(R=z(r),l=k(r,i)):(R=k(r,i),l=z(r));const N=Et(R,s,e,is)?ge(R,n,t,e):null;if(N){const O=N.point[C];if(a?O<=s[l+c]:O>=s[l+c+3])return N}const u=Et(l,s,e,is)?ge(l,n,t,e):null;return N&&u?N.distance<=u.distance?N:u:N||u||null}}const Kt=new K,Rt=new q,lt=new q,Dt=new $,Es=new H,Qt=new H;function Zn(r,n,t,e){B.setBuffer(r._roots[n]);const s=me(0,r,t,e);return B.clearBuffer(),s}function me(r,n,t,e,s=null){const{float32Array:E,uint16Array:i,uint32Array:o}=B;let I=r*2;if(s===null&&(t.boundingBox||t.computeBoundingBox(),Es.set(t.boundingBox.min,t.boundingBox.max,e),s=Es),v(I,i)){const C=n.geometry,T=C.index,a=C.attributes.position,R=t.index,l=t.attributes.position,S=_(r,o),N=X(I,i);if(Dt.copy(e).invert(),t.boundsTree)return Y(r,E,Qt),Qt.matrix.copy(Dt),Qt.needsUpdate=!0,t.boundsTree.shapecast({intersectsBounds:u=>Qt.intersectsBox(u),intersectsTriangle:u=>{u.a.applyMatrix4(e),u.b.applyMatrix4(e),u.c.applyMatrix4(e),u.needsUpdate=!0;for(let O=S,A=N+S;Ofe.distanceToBox(f),intersectsBounds:(f,L,P)=>P{if(n.boundsTree){const P=n.boundsTree;return P.shapecast({boundsTraverseOrder:p=>ht.distanceToBox(p),intersectsBounds:(p,U,D)=>D{for(let D=p,y=p+U;Dnew K),Ft=new K,At=new K,Ne=new K,Oe=new K;let Se=!1;function Ei(r,n,t,e){if(Se)throw new Error("MeshBVH: Recursive calls to bvhcast not supported.");Se=!0;const s=r._roots,E=n._roots;let i,o=0,I=0;const c=new $().copy(t).invert();for(let C=0,T=s.length;CI.slice()),index:i.array.slice(),indirectBuffer:E?E.slice():null}:o={roots:s,index:i.array,indirectBuffer:E},o}static deserialize(n,t,e={}){e={setIndex:!0,indirect:!!n.indirectBuffer,...e};const{index:s,roots:E,indirectBuffer:i}=n,o=new He(t,{...e,[Re]:!0});if(o._roots=E,o._indirectBuffer=i||null,e.setIndex){const I=t.getIndex();if(I===null){const c=new Bt(n.index,1,!1);t.setIndex(c)}else I.array!==s&&(I.array.set(s),I.needsUpdate=!0)}return o}get indirect(){return!!this._indirectBuffer}constructor(n,t={}){if(n.isBufferGeometry){if(n.index&&n.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:Ps,maxDepth:40,maxLeafTris:10,verbose:!0,useSharedArrayBuffer:!1,setBoundingBox:!0,onProgress:null,indirect:!1,[Re]:!1},t),t.useSharedArrayBuffer&&!ii())throw new Error("MeshBVH: SharedArrayBuffer is not available.");this.geometry=n,this._roots=null,this._indirectBuffer=null,t[Re]||(Ln(this,t),!n.boundingBox&&t.setBoundingBox&&(n.boundingBox=this.getBoundingBox(new K)));const{_indirectBuffer:e}=this;this.resolveTriangleIndex=t.indirect?s=>e[s]:s=>s}refit(n=null){return(this.indirect?jn:Yn)(this,n)}traverse(n,t=0){const e=this._roots[t],s=new Uint32Array(e),E=new Uint16Array(e);i(0);function i(o,I=0){const c=o*2,C=E[c+15]===Ce;if(C){const T=s[o+6],a=E[c+14];n(I,C,new Float32Array(e,o*4,6),T,a)}else{const T=o+te/4,a=s[o+6],R=s[o+7];n(I,C,new Float32Array(e,o*4,6),R)||(i(T,I+1),i(a,I+1))}}}raycast(n,t=_e){const e=this._roots,s=this.geometry,E=[],i=t.isMaterial,o=Array.isArray(t),I=s.groups,c=i?t.side:t,C=this.indirect?qn:Vn;for(let T=0,a=e.length;TT(a,R,l,S,N)?!0:e(a,R,this,o,l,S,t)}else i||(o?i=(T,a,R,l)=>e(T,a,this,o,R,l,t):i=(T,a,R)=>R);let I=!1,c=0;const C=this._roots;for(let T=0,a=C.length;T{const S=this.resolveTriangleIndex(l);V(i,S*3,o,I)}:l=>{V(i,l*3,o,I)},C=W.getPrimitive(),T=n.geometry.index,a=n.geometry.attributes.position,R=n.indirect?l=>{const S=n.resolveTriangleIndex(l);V(C,S*3,T,a)}:l=>{V(C,l*3,T,a)};if(E){const l=(S,N,F,u,O,A,f,L)=>{for(let P=F,p=F+u;PJt.intersectsBox(e),intersectsTriangle:e=>Jt.intersectsTriangle(e)})}intersectsSphere(n){return this.shapecast({intersectsBounds:t=>n.intersectsBox(t),intersectsTriangle:t=>t.intersectsSphere(n)})}closestPointToGeometry(n,t,e={},s={},E=0,i=1/0){return(this.indirect?ni:$n)(this,n,t,e,s,E,i)}closestPointToPoint(n,t={},e=0,s=1/0){return hn(this,n,t,e,s)}getBoundingBox(n){return n.makeEmpty(),this._roots.forEach(e=>{Y(0,new Float32Array(e),os),n.union(os)}),n}}function rs(r,n,t){return r===null||(r.point.applyMatrix4(n.matrixWorld),r.distance=r.point.distanceTo(t.ray.origin),r.object=n,r.distancet.far)?null:r}const Le=new Gs,Is=new $,oi=cs.prototype.raycast;function ri(r,n){if(this.geometry.boundsTree){if(this.material===void 0)return;Is.copy(this.matrixWorld).invert(),Le.copy(r.ray).applyMatrix4(Is);const t=this.geometry.boundsTree;if(r.firstHitOnly===!0){const e=rs(t.raycastFirst(Le,this.material),this,r);e&&n.push(e)}else{const e=t.raycast(Le,this.material);for(let s=0,E=e.length;s{const t=this.handlers.slice(0);for(const e of t)e(n)});M(this,"handlers",[])}add(n){this.handlers.push(n)}remove(n){this.handlers=this.handlers.filter(t=>t!==n)}reset(){this.handlers.length=0}}class Ci{constructor(n){M(this,"isDisposeable",()=>"dispose"in this&&"onDisposed"in this);M(this,"isResizeable",()=>"resize"in this&&"getSize"in this);M(this,"isUpdateable",()=>"onAfterUpdate"in this&&"onBeforeUpdate"in this&&"update"in this);M(this,"isHideable",()=>"visible"in this);M(this,"isConfigurable",()=>"setup"in this&&"config"in this&&"onSetup"in this);this.components=n}}class Gt extends Ci{}class as extends Map{constructor(t){super(t);M(this,"onItemSet",new x);M(this,"onItemUpdated",new x);M(this,"onItemDeleted",new x);M(this,"onCleared",new x)}clear(){super.clear(),this.onCleared.trigger()}set(t,e){const s=this.has(t),E=super.set(t,e);return s?(this.onItemUpdated||(this.onItemUpdated=new x),this.onItemUpdated.trigger({key:t,value:e})):(this.onItemSet||(this.onItemSet=new x),this.onItemSet.trigger({key:t,value:e})),E}delete(t){const e=super.delete(t);return e&&this.onItemDeleted.trigger(),e}dispose(){this.clear(),this.onItemSet.reset(),this.onItemDeleted.reset(),this.onCleared.reset()}}const b=class b{static create(){const n=Math.random()*4294967295|0,t=Math.random()*4294967295|0,e=Math.random()*4294967295|0,s=Math.random()*4294967295|0;return`${b._lut[n&255]+b._lut[n>>8&255]+b._lut[n>>16&255]+b._lut[n>>24&255]}-${b._lut[t&255]}${b._lut[t>>8&255]}-${b._lut[t>>16&15|64]}${b._lut[t>>24&255]}-${b._lut[e&63|128]}${b._lut[e>>8&255]}-${b._lut[e>>16&255]}${b._lut[e>>24&255]}${b._lut[s&255]}${b._lut[s>>8&255]}${b._lut[s>>16&255]}${b._lut[s>>24&255]}`.toLowerCase()}static validate(n){if(!b._pattern.test(n))throw new Error(`${n} 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.`)}};U(G,"_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}$/),U(G,"_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 ne=G;const Ie=class Ie{constructor(){U(this,"onDisposed",new V);U(this,"list",new Map);U(this,"enabled",!1);U(this,"_clock");U(this,"update",()=>{if(!this.enabled)return;const s=this._clock.getDelta();for(const[t,e]of this.list)e.enabled&&e.isUpdateable()&&e.update(s);requestAnimationFrame(this.update)});this._clock=new xn,Ie.setupBVH()}add(s,t){if(this.list.has(s))throw new Error("You're trying to add a component that already exists in the components instance. Use Components.get() instead.");ne.validate(s),this.list.set(s,t)}get(s){const t=s.uuid;if(!this.list.has(t)){const e=new s(this);return this.list.has(t)||this.add(t,e),e}return this.list.get(t)}init(){this.enabled=!0,this._clock.start(),this.update()}dispose(){this.enabled=!1;for(const[s,t]of this.list)t.enabled=!1,t.isDisposeable()&&t.dispose();this._clock.stop(),this.onDisposed.trigger(),this.onDisposed.reset()}static setupBVH(){pe.prototype.computeBoundsTree=Ii,pe.prototype.disposeBoundsTree=ri,cn.prototype.raycast=oi}};U(Ie,"release","2.1.14");let se=Ie;const Ci=new Map([[Ye,{forRelating:"IsDecomposedBy",forRelated:"Decomposes"}],[Tn,{forRelating:"AssociatedTo",forRelated:"HasAssociations"}],[Rn,{forRelating:"ClassificationForObjects",forRelated:"HasAssociations"}],[ln,{forRelating:"IsGroupedBy",forRelated:"HasAssignments"}],[xe,{forRelated:"IsDefinedBy",forRelating:"DefinesOcurrence"}],[Fn,{forRelated:"IsTypedBy",forRelating:"Types"}],[An,{forRelated:"IsDefinedBy",forRelating:"Defines"}],[Ge,{forRelated:"ContainedInStructure",forRelating:"ContainsElements"}],[Gn,{forRelated:"AssignedToFlowElement",forRelating:"HasControlElements"}],[bn,{forRelated:"ConnectedFrom",forRelating:"ConnectedTo"}]]),mt=class mt extends Gt{constructor(t){super(t);U(this,"onDisposed",new V);U(this,"onRelationsIndexed",new V);U(this,"relationMaps",{});U(this,"enabled",!0);U(this,"_relToAttributesMap",Ci);U(this,"_inverseAttributes",["IsDecomposedBy","Decomposes","AssociatedTo","HasAssociations","ClassificationForObjects","IsGroupedBy","HasAssignments","IsDefinedBy","DefinesOcurrence","IsTypedBy","Types","Defines","ContainedInStructure","ContainsElements","HasControlElements","AssignedToFlowElement","ConnectedTo","ConnectedFrom"]);U(this,"_ifcRels",[Ye,Tn,Rn,ln,xe,Fn,An,Ge]);U(this,"onFragmentsDisposed",t=>{delete this.relationMaps[t.groupID]});this.components.add(mt.uuid,this),t.get(Yt).onFragmentsDisposed.add(this.onFragmentsDisposed)}indexRelations(t,e,n,E){const i=Object.keys(e).find(a=>a.startsWith("Relating")),o=Object.keys(e).find(a=>a.startsWith("Related"));if(!(i&&o))return;const r=e[i].value,c=e[o].map(a=>a.value),C=t.get(r)??new Map,T=this.getAttributeIndex(E);T!==null&&(C.set(T,c),t.set(r,C));for(const a of c){const R=t.get(a)??new Map,l=this.getAttributeIndex(n);if(!l)continue;const S=R.get(l)??[];S.push(r),R.set(l,S),t.set(a,R)}}getAttributeIndex(t){const e=this._inverseAttributes.indexOf(t);return e===-1?null:e}setRelationMap(t,e){this.relationMaps[t.uuid]=e,this.onRelationsIndexed.trigger({modelID:t.uuid,relationsMap:e})}async process(t){if(!t.hasProperties)throw new Error("FragmentsGroup properties not found");let e=this.relationMaps[t.uuid];if(e)return e;e=new Map;for(const n of this._ifcRels){const E=await t.getAllPropertiesOfType(n);if(!E)continue;const i=this._relToAttributesMap.get(n);if(!i)continue;const{forRelated:o,forRelating:r}=i;for(const c in E){const C=E[c];this.indexRelations(e,C,o,r)}}return this.setRelationMap(t,e),e}async processFromWebIfc(t,e){const n=new Map;for(const E of this._ifcRels){const i=this._relToAttributesMap.get(E);if(!i)continue;const{forRelated:o,forRelating:r}=i,c=t.GetLineIDsWithType(e,E);for(let C=0;C{}),i={},o=s.getAllPropertiesIDs();for(const c of o){const C=await s.getProperties(c);if(!C)continue;const T=C.type===t,a=Object.keys(C).find(F=>F.startsWith("Relating")),R=Object.keys(C).find(F=>F.startsWith("Related"));if(!(T&&a&&R))continue;const l=await s.getProperties((r=C[a])==null?void 0:r.value),S=C[R];if(!l||!S||!(S&&Array.isArray(S)))continue;const N=S.map(F=>F.value);await E(l.expressID,N),i[l.expressID]=N}return i}static async getQsetQuantities(s,t,e){const E=e??(()=>{}),i=await s.getProperties(t);return!i||i.type!==Hn?null:(i.Quantities??[{}]).map(c=>(c.value&&E(c.value),c.value)).filter(c=>c!==null)}static async getPsetProps(s,t,e){const E=e??(()=>{}),i=await s.getProperties(t);return!i||i.type!==Me?null:(i.HasProperties??[{}]).map(c=>(c.value&&E(c.value),c.value)).filter(c=>c!==null)}static async getPsetRel(s,t){var o;if(!await s.getProperties(t))return null;const n=await s.getAllPropertiesOfType(xe);if(!n)return null;const E=Object.values(n);let i=null;for(const r of E)((o=r.RelatingPropertyDefinition)==null?void 0:o.value)===t&&(i=r.expressID);return i}static async getQsetRel(s,t){return Ee.getPsetRel(s,t)}static async getEntityName(s,t){var i;const e=await s.getProperties(t);if(!e)return{key:null,name:null};const n=Object.keys(e).find(o=>o.endsWith("Name"))??null,E=n?(i=e[n])==null?void 0:i.value:null;return{key:n,name:E}}static async getQuantityValue(s,t){const e=await s.getProperties(t);if(!e)return{key:null,value:null};const n=Object.keys(e).find(i=>i.endsWith("Value"))??null;let E;return n===null||e[n]===void 0||e[n]===null?E=null:E=e[n].value,{key:n,value:E}}static isRel(s){return Ti[s].startsWith("IFCREL")}static async attributeExists(s,t,e){const n=await s.getProperties(t);return n?Object.keys(n).includes(e):!1}static async groupEntitiesByType(s,t){var n;const e=new Map;for(const E of t){const i=await s.getProperties(E);if(!i)continue;const o=i.type;e.get(o)||e.set(o,new Set),(n=e.get(o))==null||n.add(E)}return e}}class Ri{constructor(){U(this,"factor",1);U(this,"complement",1)}apply(s){const e=this.getScaleMatrix().multiply(s);s.copy(e)}setUp(s){var E,i,o;this.factor=1;const t=this.getLengthUnits(s);if(!t)return;const e=t==null,n=t.Name===void 0||t.Name===null;e||n||(t.Name.value==="FOOT"&&(this.factor=.3048),((E=t.Prefix)==null?void 0:E.value)==="MILLI"?this.complement=.001:((i=t.Prefix)==null?void 0:i.value)==="CENTI"?this.complement=.01:((o=t.Prefix)==null?void 0:o.value)==="DECI"&&(this.complement=.01))}getLengthUnits(s){try{const e=s.GetLineIDsWithType(0,vn).get(0),n=s.GetLine(0,e);for(const E of n.Units){if(!E||E.value===null||E.value===void 0)continue;const i=s.GetLine(0,E.value);if(i.UnitType&&i.UnitType.value==="LENGTHUNIT")return i}return null}catch{return console.log("Could not get units"),null}}getScaleMatrix(){const s=this.factor;return new $().fromArray([s,0,0,0,0,s,0,0,0,0,s,0,0,0,0,1])}}class li{constructor(){U(this,"itemsByFloor",{});U(this,"_units",new Ri)}setUp(s){this._units.setUp(s),this.cleanUp();try{const t=s.GetLineIDsWithType(0,Ge),e=new Set,n=s.GetLineIDsWithType(0,xt);for(let c=0;c{this.getMesh(i,e)});for(const i of this._visitedFragments){const{index:o,fragment:r}=i[1];e.keyFragments.set(o,r.id)}for(const i of e.items){const o=this._fragmentInstances.get(i.id);if(!o)throw new Error("Fragment not found!");const r=[];for(const[c,C]of o)r.push(C);i.add(r)}const E=this.webIfc.GetCoordinationMatrix(0);return e.coordinationMatrix.fromArray(E),e.civilData=this._civil.read(this.webIfc),e}getMesh(t,e){const n=t.geometries.size(),E=t.expressID;for(let i=0;io.value!==n),await t.setProperties(n,null),this.registerChange(t,e,n))}async addElementToPset(t,e,...n){const E=await Ee.getPsetRel(t,e);if(!E)return;const i=await t.getProperties(E);if(!i)return;for(const r of n){const c=new bt(r);i.RelatedObjects.push(c),this.onElementToPset.trigger({model:t,psetID:e,elementID:r})}this.registerChange(t,e);const o=this.components.get(ie);for(const r of n)o.addEntityRelations(t,r,"IsDefinedBy",e)}async addPropToPset(t,e,...n){const E=await t.getProperties(e);if(E){for(const i of n){if(E.HasProperties.includes(i))continue;const o=new bt(i);E.HasProperties.push(o),this.onPropToPset.trigger({model:t,psetID:e,propID:i})}this.registerChange(t,e)}}async saveToIfc(t,e){const n=this.components.get(oe),E=n.webIfc,i=await n.readIfcFile(e),o=this.changeMap[t.uuid]??[];for(const c of o){const C=await t.getProperties(c);if(C)try{E.WriteLine(i,C)}catch{}else try{E.DeleteLine(i,c)}catch{}}const r=E.SaveModel(i);return n.webIfc.CloseModel(i),n.cleanUp(),r}async setAttributeListener(t,e,n){this.attributeListeners[t.uuid]||(this.attributeListeners[t.uuid]={});const E=this.attributeListeners[t.uuid][e]?this.attributeListeners[t.uuid][e][n]:null;if(E)return E;const i=await t.getProperties(e);if(!i)throw new Error(`Entity with expressID ${e} doesn't exists.`);const o=i[n];if(Array.isArray(o)||!o)throw new Error(`Attribute ${n} is array or null, and it can't have a listener.`);const r=o.value;if(r===void 0||r==null)throw new Error(`Attribute ${n} has a badly defined handle.`);const c=new V;return Object.defineProperty(i[n],"value",{get(){return this._value},async set(C){this._value=C,c.trigger(C)}}),i[n].value=r,this.attributeListeners[t.uuid][e]||(this.attributeListeners[t.uuid][e]={}),this.attributeListeners[t.uuid][e][n]=c,c}increaseMaxID(t){return t.ifcMetadata.maxExpressID++,t.ifcMetadata.maxExpressID}newGUID(t){const e=st.getIFCSchema(t);return new Q[e].IfcGloballyUniqueId(ne.create())}async getOwnerHistory(t){const e=await t.getAllPropertiesOfType(ss);if(!e)throw new Error("No OwnerHistory was found.");const n=Object.keys(e).map(o=>parseInt(o,10)),E=e[n[0]],i=new bt(E.expressID);return{ownerHistory:E,ownerHistoryHandle:i}}registerChange(t,...e){this.changeMap[t.uuid]||(this.changeMap[t.uuid]=new Set);for(const n of e)this.changeMap[t.uuid].add(n),this.onDataChanged.trigger({model:t,expressID:n})}async newSingleProperty(t,e,n,E){const i=st.getIFCSchema(t),o=new Q[i].IfcIdentifier(n),r=new Q[i][e](E),c=new Q[i].IfcPropertySingleValue(o,null,r,null);return c.expressID=this.increaseMaxID(t),await this.setData(t,c),c}};U(st,"uuid","58c2d9f0-183c-48d6-a402-dfcf5b9a34df");let Be=st;const Mn=new se,dn=Mn.get(oe);await dn.setup();const Ni=await fetch("https://thatopen.github.io/engine_components/resources/small.ifc"),Un=await Ni.arrayBuffer(),ot=await dn.load(new Uint8Array(Un)),Ot=Mn.get(Be),{pset:Dn}=await Ot.newPset(ot,"CalculatedQuantities"),Oi=await Ot.newSingleNumericProperty(ot,"IfcReal","Volume",12.25);await Ot.addPropToPset(ot,Dn.expressID,Oi.expressID);await Ot.addElementToPset(ot,Dn.expressID,186);const Pe=await ot.getProperties(186);Pe&&(Pe.Name.value="New Wall Name",await Ot.setData(ot,Pe));const Si=await Ot.saveToIfc(ot,new Uint8Array(Un)),hn=new File([Si],"small-modified.ifc"),ve=document.createElement("a");ve.href=URL.createObjectURL(hn);ve.download=hn.name;URL.revokeObjectURL(ve.href); +- If you're using a platform tool, verify the uuid isn't misspelled or contact the tool creator.`)}};M(b,"_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}$/),M(b,"_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 se=b;const re=class re{constructor(){M(this,"onDisposed",new x);M(this,"list",new Map);M(this,"enabled",!1);M(this,"_clock");M(this,"update",()=>{if(!this.enabled)return;const n=this._clock.getDelta();for(const[t,e]of this.list)e.enabled&&e.isUpdateable()&&e.update(n);requestAnimationFrame(this.update)});this._clock=new bs,re.setupBVH()}add(n,t){if(this.list.has(n))throw new Error("You're trying to add a component that already exists in the components instance. Use Components.get() instead.");se.validate(n),this.list.set(n,t)}get(n){const t=n.uuid;if(!this.list.has(t)){const e=new n(this);return this.list.has(t)||this.add(t,e),e}return this.list.get(t)}init(){this.enabled=!0,this._clock.start(),this.update()}dispose(){this.enabled=!1;for(const[n,t]of this.list)t.enabled=!1,t.isDisposeable()&&t.dispose();this._clock.stop(),this.onDisposed.trigger(),this.onDisposed.reset()}static setupBVH(){pe.prototype.computeBoundsTree=Ii,pe.prototype.disposeBoundsTree=ai,cs.prototype.raycast=ri}};M(re,"release","2.1.17");let ne=re;const ci=new Map([[Ye,{forRelating:"IsDecomposedBy",forRelated:"Decomposes"}],[Ts,{forRelating:"AssociatedTo",forRelated:"HasAssociations"}],[Rs,{forRelating:"ClassificationForObjects",forRelated:"HasAssociations"}],[ls,{forRelating:"IsGroupedBy",forRelated:"HasAssignments"}],[xe,{forRelated:"IsDefinedBy",forRelating:"DefinesOcurrence"}],[Fs,{forRelated:"IsTypedBy",forRelating:"Types"}],[As,{forRelated:"IsDefinedBy",forRelating:"Defines"}],[Ge,{forRelated:"ContainedInStructure",forRelating:"ContainsElements"}],[us,{forRelated:"AssignedToFlowElement",forRelating:"HasControlElements"}],[fs,{forRelated:"ConnectedFrom",forRelating:"ConnectedTo"}]]),mt=class mt extends Gt{constructor(t){super(t);M(this,"onDisposed",new x);M(this,"onRelationsIndexed",new x);M(this,"relationMaps",{});M(this,"enabled",!0);M(this,"_relToAttributesMap",ci);M(this,"_inverseAttributes",["IsDecomposedBy","Decomposes","AssociatedTo","HasAssociations","ClassificationForObjects","IsGroupedBy","HasAssignments","IsDefinedBy","DefinesOcurrence","IsTypedBy","Types","Defines","ContainedInStructure","ContainsElements","HasControlElements","AssignedToFlowElement","ConnectedTo","ConnectedFrom"]);M(this,"_ifcRels",[Ye,Ts,Rs,ls,xe,Fs,As,Ge,us,fs]);M(this,"onFragmentsDisposed",t=>{delete this.relationMaps[t.groupID]});this.components.add(mt.uuid,this),t.get(Yt).onFragmentsDisposed.add(this.onFragmentsDisposed)}indexRelations(t,e,s,E){const i=Object.keys(e).find(a=>a.startsWith("Relating")),o=Object.keys(e).find(a=>a.startsWith("Related"));if(!(i&&o))return;const I=e[i].value,c=e[o].map(a=>a.value),C=t.get(I)??new Map,T=this.getAttributeIndex(E);T!==null&&(C.set(T,c),t.set(I,C));for(const a of c){const R=t.get(a)??new Map,l=this.getAttributeIndex(s);if(!l)continue;const S=R.get(l)??[];S.push(I),R.set(l,S),t.set(a,R)}}getAttributeIndex(t){const e=this._inverseAttributes.indexOf(t);return e===-1?null:e}setRelationMap(t,e){this.relationMaps[t.uuid]=e,this.onRelationsIndexed.trigger({modelID:t.uuid,relationsMap:e})}async process(t){if(!t.hasProperties)throw new Error("FragmentsGroup properties not found");let e=this.relationMaps[t.uuid];if(e)return e;e=new Map;for(const s of this._ifcRels){const E=await t.getAllPropertiesOfType(s);if(!E)continue;const i=this._relToAttributesMap.get(s);if(!i)continue;const{forRelated:o,forRelating:I}=i;for(const c in E){const C=E[c];this.indexRelations(e,C,o,I)}}return this.setRelationMap(t,e),e}async processFromWebIfc(t,e){const s=new Map;for(const E of this._ifcRels){const i=this._relToAttributesMap.get(E);if(!i)continue;const{forRelated:o,forRelating:I}=i,c=t.GetLineIDsWithType(e,E);for(let C=0;C{}),i={},o=n.getAllPropertiesIDs();for(const c of o){const C=await n.getProperties(c);if(!C)continue;const T=C.type===t,a=Object.keys(C).find(F=>F.startsWith("Relating")),R=Object.keys(C).find(F=>F.startsWith("Related"));if(!(T&&a&&R))continue;const l=await n.getProperties((I=C[a])==null?void 0:I.value),S=C[R];if(!l||!S||!(S&&Array.isArray(S)))continue;const N=S.map(F=>F.value);await E(l.expressID,N),i[l.expressID]=N}return i}static async getQsetQuantities(n,t,e){const E=e??(()=>{}),i=await n.getProperties(t);return!i||i.type!==Hs?null:(i.Quantities??[{}]).map(c=>(c.value&&E(c.value),c.value)).filter(c=>c!==null)}static async getPsetProps(n,t,e){const E=e??(()=>{}),i=await n.getProperties(t);return!i||i.type!==de?null:(i.HasProperties??[{}]).map(c=>(c.value&&E(c.value),c.value)).filter(c=>c!==null)}static async getPsetRel(n,t){var o;if(!await n.getProperties(t))return null;const s=await n.getAllPropertiesOfType(xe);if(!s)return null;const E=Object.values(s);let i=null;for(const I of E)((o=I.RelatingPropertyDefinition)==null?void 0:o.value)===t&&(i=I.expressID);return i}static async getQsetRel(n,t){return Ee.getPsetRel(n,t)}static async getEntityName(n,t){var i;const e=await n.getProperties(t);if(!e)return{key:null,name:null};const s=Object.keys(e).find(o=>o.endsWith("Name"))??null,E=s?(i=e[s])==null?void 0:i.value:null;return{key:s,name:E}}static async getQuantityValue(n,t){const e=await n.getProperties(t);if(!e)return{key:null,value:null};const s=Object.keys(e).find(i=>i.endsWith("Value"))??null;let E;return s===null||e[s]===void 0||e[s]===null?E=null:E=e[s].value,{key:s,value:E}}static isRel(n){return Ri[n].startsWith("IFCREL")}static async attributeExists(n,t,e){const s=await n.getProperties(t);return s?Object.keys(s).includes(e):!1}static async groupEntitiesByType(n,t){var s;const e=new Map;for(const E of t){const i=await n.getProperties(E);if(!i)continue;const o=i.type;e.get(o)||e.set(o,new Set),(s=e.get(o))==null||s.add(E)}return e}}class li{constructor(){M(this,"factor",1);M(this,"complement",1)}apply(n){const e=this.getScaleMatrix().multiply(n);n.copy(e)}setUp(n){var E,i,o;this.factor=1;const t=this.getLengthUnits(n);if(!t)return;const e=t==null,s=t.Name===void 0||t.Name===null;e||s||(t.Name.value==="FOOT"&&(this.factor=.3048),((E=t.Prefix)==null?void 0:E.value)==="MILLI"?this.complement=.001:((i=t.Prefix)==null?void 0:i.value)==="CENTI"?this.complement=.01:((o=t.Prefix)==null?void 0:o.value)==="DECI"&&(this.complement=.01))}getLengthUnits(n){try{const e=n.GetLineIDsWithType(0,vs).get(0),s=n.GetLine(0,e);for(const E of s.Units){if(!E||E.value===null||E.value===void 0)continue;const i=n.GetLine(0,E.value);if(i.UnitType&&i.UnitType.value==="LENGTHUNIT")return i}return null}catch{return console.log("Could not get units"),null}}getScaleMatrix(){const n=this.factor;return new $().fromArray([n,0,0,0,0,n,0,0,0,0,n,0,0,0,0,1])}}class Fi{constructor(){M(this,"itemsByFloor",{});M(this,"_units",new li)}setUp(n){this._units.setUp(n),this.cleanUp();try{const t=n.GetLineIDsWithType(0,Ge),e=new Set,s=n.GetLineIDsWithType(0,xt);for(let c=0;c{this.getMesh(i,e)});for(const i of this._visitedFragments){const{index:o,fragment:I}=i[1];e.keyFragments.set(o,I.id)}for(const i of e.items){const o=this._fragmentInstances.get(i.id);if(!o)throw new Error("Fragment not found!");const I=[];for(const[c,C]of o)I.push(C);i.add(I)}const E=this.webIfc.GetCoordinationMatrix(0);return e.coordinationMatrix.fromArray(E),e.civilData=this._civil.read(this.webIfc),e}getMesh(t,e){const s=t.geometries.size(),E=t.expressID;for(let i=0;io.value!==s),await t.setProperties(s,null),this.registerChange(t,e,s))}async addElementToPset(t,e,...s){const E=await Ee.getPsetRel(t,e);if(!E)return;const i=await t.getProperties(E);if(!i)return;for(const I of s){const c=new bt(I);i.RelatedObjects.push(c),this.onElementToPset.trigger({model:t,psetID:e,elementID:I})}this.registerChange(t,e);const o=this.components.get(ie);for(const I of s)o.addEntityRelations(t,I,"IsDefinedBy",e)}async addPropToPset(t,e,...s){const E=await t.getProperties(e);if(E){for(const i of s){if(E.HasProperties.includes(i))continue;const o=new bt(i);E.HasProperties.push(o),this.onPropToPset.trigger({model:t,psetID:e,propID:i})}this.registerChange(t,e)}}async saveToIfc(t,e){const s=this.components.get(oe),E=s.webIfc,i=await s.readIfcFile(e),o=this.changeMap[t.uuid]??[];for(const c of o){const C=await t.getProperties(c);if(C)try{E.WriteLine(i,C)}catch{}else try{E.DeleteLine(i,c)}catch{}}const I=E.SaveModel(i);return s.webIfc.CloseModel(i),s.cleanUp(),I}async setAttributeListener(t,e,s){this.attributeListeners[t.uuid]||(this.attributeListeners[t.uuid]={});const E=this.attributeListeners[t.uuid][e]?this.attributeListeners[t.uuid][e][s]:null;if(E)return E;const i=await t.getProperties(e);if(!i)throw new Error(`Entity with expressID ${e} doesn't exists.`);const o=i[s];if(Array.isArray(o)||!o)throw new Error(`Attribute ${s} is array or null, and it can't have a listener.`);const I=o.value;if(I===void 0||I==null)throw new Error(`Attribute ${s} has a badly defined handle.`);const c=new x;return Object.defineProperty(i[s],"value",{get(){return this._value},async set(C){this._value=C,c.trigger(C)}}),i[s].value=I,this.attributeListeners[t.uuid][e]||(this.attributeListeners[t.uuid][e]={}),this.attributeListeners[t.uuid][e][s]=c,c}increaseMaxID(t){return t.ifcMetadata.maxExpressID++,t.ifcMetadata.maxExpressID}newGUID(t){const e=nt.getIFCSchema(t);return new Q[e].IfcGloballyUniqueId(se.create())}async getOwnerHistory(t){const e=await t.getAllPropertiesOfType(nn);if(!e)throw new Error("No OwnerHistory was found.");const s=Object.keys(e).map(o=>parseInt(o,10)),E=e[s[0]],i=new bt(E.expressID);return{ownerHistory:E,ownerHistoryHandle:i}}registerChange(t,...e){this.changeMap[t.uuid]||(this.changeMap[t.uuid]=new Set);for(const s of e)this.changeMap[t.uuid].add(s),this.onDataChanged.trigger({model:t,expressID:s})}async newSingleProperty(t,e,s,E){const i=nt.getIFCSchema(t),o=new Q[i].IfcIdentifier(s),I=new Q[i][e](E),c=new Q[i].IfcPropertySingleValue(o,null,I,null);return c.expressID=this.increaseMaxID(t),await this.setData(t,c),c}};M(nt,"uuid","58c2d9f0-183c-48d6-a402-dfcf5b9a34df");let Be=nt;const Us=new ne,Ds=Us.get(oe);await Ds.setup();const Oi=await fetch("https://thatopen.github.io/engine_components/resources/small.ifc"),hs=await Oi.arrayBuffer(),ot=await Ds.load(new Uint8Array(hs)),Ot=Us.get(Be),{pset:ys}=await Ot.newPset(ot,"CalculatedQuantities"),Si=await Ot.newSingleNumericProperty(ot,"IfcReal","Volume",12.25);await Ot.addPropToPset(ot,ys.expressID,Si.expressID);await Ot.addElementToPset(ot,ys.expressID,186);const Pe=await ot.getProperties(186);Pe&&(Pe.Name.value="New Wall Name",await Ot.setData(ot,Pe));const Li=await Ot.saveToIfc(ot,new Uint8Array(hs)),gs=new File([Li],"small-modified.ifc"),ve=document.createElement("a");ve.href=URL.createObjectURL(gs);ve.download=gs.name;URL.revokeObjectURL(ve.href); diff --git a/examples/assets/ifcPropertiesTiler.js b/examples/assets/ifcPropertiesTiler.js index f8e80698f..3c6293d4a 100644 --- a/examples/assets/ifcPropertiesTiler.js +++ b/examples/assets/ifcPropertiesTiler.js @@ -1,4 +1,4 @@ -import"./web-ifc-api-x-FY_BW3.js";import{S as b}from"./stats.min-BpIepu9J.js";import{m as w,t as f,a as u}from"./index-tywNknxv.js";import{p as y,C as g,o as h,r as B,W as F,d as L,h as S,$ as U,b as k}from"./index-Dr4eFCtu.js";const v=document.getElementById("container"),n=new y,x=n.get(g),s=x.create();s.scene=new h(n);s.renderer=new B(n,v);s.camera=new F(n);n.init();s.camera.controls.setLookAt(12,6,8,0,0,-10);s.scene.setup();const I=n.get(L);I.create(s);s.scene.three.background=null;const R=new S(n),A=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),P=await A.arrayBuffer(),$=new Uint8Array(P),j=R.load($);s.scene.three.add(j);function C(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 O(e){for(const{name:o,bits:t}of e)C(o,t),await new Promise(a=>{setTimeout(a,100)})}const c=n.get(U);c.settings.wasm={path:"https://unpkg.com/web-ifc@0.0.56/",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(k).serializeRelations(e);d.push({name:"small.ifc-processed-properties-indexes",bits:new Blob([t])}),await O(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` +import"./web-ifc-api-56EJvEs4.js";import{S as b}from"./stats.min-BpIepu9J.js";import{m as w,t as f,a as u}from"./index-TmOv0r_5.js";import{p as y,C as g,o as h,r as B,W as F,u as L,h as S,J as U,c as k}from"./index-BcIWfMQD.js";const v=document.getElementById("container"),n=new y,x=n.get(g),s=x.create();s.scene=new h(n);s.renderer=new B(n,v);s.camera=new F(n);n.init();s.camera.controls.setLookAt(12,6,8,0,0,-10);s.scene.setup();const I=n.get(L);I.create(s);s.scene.three.background=null;const R=new S(n),A=await fetch("https://thatopen.github.io/engine_components/resources/small.frag"),P=await A.arrayBuffer(),j=new Uint8Array(P),C=R.load(j);s.scene.three.add(C);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 O(e){for(const{name:o,bits:t}of e)J(o,t),await new Promise(a=>{setTimeout(a,100)})}const c=n.get(U);c.settings.wasm={path:"https://unpkg.com/web-ifc@0.0.56/",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(k).serializeRelations(e);d.push({name:"small.ifc-processed-properties-indexes",bits:new Blob([t])}),await O(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` diff --git a/examples/assets/ifcRelationsIndexer.js b/examples/assets/ifcRelationsIndexer.js index 26e598de0..29094ba29 100644 --- a/examples/assets/ifcRelationsIndexer.js +++ b/examples/assets/ifcRelationsIndexer.js @@ -1,4 +1,4 @@ -import"./web-ifc-api-x-FY_BW3.js";import{S as g}from"./stats.min-BpIepu9J.js";import{m as f,t as m,a as u}from"./index-tywNknxv.js";import{p as w,C as y,o as h,r as R,W as x,d as I,c as L,b as S,K as U}from"./index-Dr4eFCtu.js";const k=document.getElementById("container"),n=new w,v=n.get(y),t=v.create();t.scene=new h(n);t.renderer=new R(n,k);t.camera=new x(n);n.init();t.camera.controls.setLookAt(12,6,8,0,0,-10);t.scene.setup();const P=n.get(I);P.create(t);t.scene.three.background=null;const b=n.get(L);await b.setup();const j=await fetch("https://thatopen.github.io/engine_components/resources/small.ifc"),A=await j.arrayBuffer(),C=new Uint8Array(A),e=await b.load(C);t.scene.three.add(e);const o=n.get(S);await o.process(e);const p=o.getEntityRelations(e,6518,"IsDefinedBy");if(p)for(const s of p){const c=await e.getProperties(s);console.log(c),await U.getPsetProps(e,s,async l=>{const a=await e.getProperties(l);console.log(a)})}const O=(s,c)=>{const l=new File([s],c),a=document.createElement("a");a.href=URL.createObjectURL(l),a.download=l.name,a.click(),URL.revokeObjectURL(a.href)},B=o.serializeModelRelations(e);console.log(B);const E=o.serializeAllRelations();delete o.relationMaps[e.uuid];const F=await fetch("https://thatopen.github.io/engine_components/resources/small-relations.json"),M=o.getRelationsMapFromJSON(await F.text());o.setRelationMap(e,M);const d=o.getEntityRelations(e,6518,"ContainedInStructure");if(d&&d[0]){const s=await e.getProperties(d[0]);console.log(s)}const i=new g;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());f.init();const r=m.create(()=>u` +import"./web-ifc-api-56EJvEs4.js";import{S as g}from"./stats.min-BpIepu9J.js";import{m as f,t as m,a as u}from"./index-TmOv0r_5.js";import{p as w,C as y,o as h,r as R,W as x,u as I,R as L,c as S,K as U}from"./index-BcIWfMQD.js";const k=document.getElementById("container"),n=new w,v=n.get(y),t=v.create();t.scene=new h(n);t.renderer=new R(n,k);t.camera=new x(n);n.init();t.camera.controls.setLookAt(12,6,8,0,0,-10);t.scene.setup();const P=n.get(I);P.create(t);t.scene.three.background=null;const b=n.get(L);await b.setup();const j=await fetch("https://thatopen.github.io/engine_components/resources/small.ifc"),A=await j.arrayBuffer(),C=new Uint8Array(A),e=await b.load(C);t.scene.three.add(e);const o=n.get(S);await o.process(e);const p=o.getEntityRelations(e,6518,"IsDefinedBy");if(p)for(const s of p){const c=await e.getProperties(s);console.log(c),await U.getPsetProps(e,s,async l=>{const a=await e.getProperties(l);console.log(a)})}const O=(s,c)=>{const l=new File([s],c),a=document.createElement("a");a.href=URL.createObjectURL(l),a.download=l.name,a.click(),URL.revokeObjectURL(a.href)},B=o.serializeModelRelations(e);console.log(B);const E=o.serializeAllRelations();delete o.relationMaps[e.uuid];const F=await fetch("https://thatopen.github.io/engine_components/resources/small-relations.json"),M=o.getRelationsMapFromJSON(await F.text());o.setRelationMap(e,M);const d=o.getEntityRelations(e,6518,"ContainedInStructure");if(d&&d[0]){const s=await e.getProperties(d[0]);console.log(s)}const i=new g;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());f.init();const r=m.create(()=>u` diff --git a/examples/assets/ifcStreamer.js b/examples/assets/ifcStreamer.js index d8201612a..46a2faccf 100644 --- a/examples/assets/ifcStreamer.js +++ b/examples/assets/ifcStreamer.js @@ -1 +1 @@ -import"./web-ifc-api-x-FY_BW3.js";import{S as i}from"./stats.min-BpIepu9J.js";import{p as l,C as m,o as p,r as u,W as w,d as g}from"./index-Dr4eFCtu.js";import{x as h}from"./index-Bkd9n44b.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 x(r,s){const c=await(await fetch(r)).json();let a;a=await(await fetch(s)).json();const d=await t.load(c,!0,a);console.log(d)}await x("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-56EJvEs4.js";import{S as d}from"./stats.min-BpIepu9J.js";import{p as l,C as m,o as p,r as u,W as w,u as g}from"./index-BcIWfMQD.js";import{S as h}from"./index-mpk8FhA9.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(r,s){const c=await(await fetch(r)).json();let a;a=await(await fetch(s)).json();const i=await t.load(c,!0,a);console.log(i)}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 d;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-Dr4eFCtu.js b/examples/assets/index-BcIWfMQD.js similarity index 53% rename from examples/assets/index-Dr4eFCtu.js rename to examples/assets/index-BcIWfMQD.js index ea3bb31f0..c285c58a8 100644 --- a/examples/assets/index-Dr4eFCtu.js +++ b/examples/assets/index-BcIWfMQD.js @@ -1,13 +1,13 @@ -import{r as Ft,s as st,T as Ie,t as pi,E as So,c as H,V as O,h as At,x as fe,S as Os,a as U,C as Qt,y as Ci,D as No,A as yo,W as Fs,w as Ti,P as wo,aW as Lo,v as Po,ap as Rt,aX as Mo,af as _n,i as Do,I as Js,$ as mi,a5 as Ce,H as Uo,e as ze,b as Te,N as He,q as jt,Q as Zt,X as fi,Y as Sn,Z as Nn,_ as yn,a0 as wn,a1 as Ln,a2 as Ri,a3 as Pn,B as it,a4 as xo,ab as yt,a6 as bi,a7 as Mn,a8 as Dn,a9 as Kt,aa as vo,d as Ge,ac as ke,ad as bo,ae as Bo,p as Fi,aw as Ai,ax as gi,ao as Oi,K as _i,am as Yo,J as rt,O as As,at as Ps,al as zo,au as Go,av as Vo,ay as Ho,L as Un,az as Wo,aA as Xo,aB as ko,aC as Zo,aD as Qo,aU as Bi,aV as jo,z as Yi,aq as Ze,an as Dt,ar as qo,as as ge,ai as Ko,aY as $o,aZ as Jo,a_ as tr,a$ as er,b0 as sr,b5 as ir}from"./web-ifc-api-x-FY_BW3.js";var nr=Object.defineProperty,or=(c,t,e)=>t in c?nr(c,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):c[t]=e,I=(c,t,e)=>(or(c,typeof t!="symbol"?t+"":t,e),e);const xn=0,rr=1,ar=2,zi=2,Ms=1.25,Gi=1,Ts=6*4+4+4,_s=65535,hr=Math.pow(2,-24),Ds=Symbol("SKIP_GENERATION");function cr(c){return c.index?c.index.count:c.attributes.position.count}function Re(c){return cr(c)/3}function lr(c,t=ArrayBuffer){return c>65535?new Uint32Array(new t(4*c)):new Uint16Array(new t(2*c))}function dr(c,t){if(!c.index){const e=c.attributes.position.count,s=t.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer,i=lr(e,s);c.setIndex(new Ge(i,1));for(let n=0;nr-a);for(let r=0;rn.offset-o.offset),s=e[e.length-1];s.count=Math.min(t-s.offset,s.count);let i=0;return e.forEach(({count:n})=>i+=n),t!==i}function j(c,t,e){return e.min.x=t[c],e.min.y=t[c+1],e.min.z=t[c+2],e.max.x=t[c+3],e.max.y=t[c+4],e.max.z=t[c+5],e}function ur(c){c[0]=c[1]=c[2]=1/0,c[3]=c[4]=c[5]=-1/0}function Vi(c){let t=-1,e=-1/0;for(let s=0;s<3;s++){const i=c[s+3]-c[s];i>e&&(e=i,t=s)}return t}function Hi(c,t){t.set(c)}function Wi(c,t,e){let s,i;for(let n=0;n<3;n++){const o=n+3;s=c[n],i=t[n],e[n]=si?s:i}}function Qe(c,t,e){for(let s=0;s<3;s++){const i=t[c+2*s],n=t[c+2*s+1],o=i-n,r=i+n;oe[s+3]&&(e[s+3]=r)}}function Oe(c){const t=c[3]-c[0],e=c[4]-c[1],s=c[5]-c[2];return 2*(t*e+e*s+s*t)}function Us(c,t,e,s,i=null){let n=1/0,o=1/0,r=1/0,a=-1/0,h=-1/0,d=-1/0,E=1/0,l=1/0,u=1/0,C=-1/0,T=-1/0,m=-1/0;const f=i!==null;for(let R=t*6,A=(t+e)*6;Ra&&(a=_),f&&pC&&(C=p);const S=c[R+2],y=c[R+3],w=S-y,L=S+y;wh&&(h=L),f&&ST&&(T=S);const P=c[R+4],D=c[R+5],x=P-D,Y=P+D;xd&&(d=Y),f&&Pm&&(m=P)}s[0]=n,s[1]=o,s[2]=r,s[3]=a,s[4]=h,s[5]=d,f&&(i[0]=E,i[1]=l,i[2]=u,i[3]=C,i[4]=T,i[5]=m)}function Ir(c,t,e,s){let i=1/0,n=1/0,o=1/0,r=-1/0,a=-1/0,h=-1/0;for(let d=t*6,E=(t+e)*6;dr&&(r=l);const u=c[d+2];ua&&(a=u);const C=c[d+4];Ch&&(h=C)}s[0]=i,s[1]=n,s[2]=o,s[3]=r,s[4]=a,s[5]=h}function pr(c,t){ur(t);const e=c.attributes.position,s=c.index?c.index.array:null,i=Re(c),n=new Float32Array(i*6),o=e.normalized,r=e.array,a=e.offset||0;let h=3;e.isInterleavedBufferAttribute&&(h=e.data.stride);const d=["getX","getY","getZ"];for(let E=0;Eg&&(g=A),p>g&&(g=p);const _=(g-F)/2,S=f*2;n[u+S+0]=F+_,n[u+S+1]=_+(Math.abs(F)+_)*hr,Ft[f+3]&&(t[f+3]=g)}}return n}const wt=32,Cr=(c,t)=>c.candidate-t.candidate,Ut=new Array(wt).fill().map(()=>({count:0,bounds:new Float32Array(6),rightCacheBounds:new Float32Array(6),leftCacheBounds:new Float32Array(6),candidate:0})),je=new Float32Array(6);function Tr(c,t,e,s,i,n){let o=-1,r=0;if(n===xn)o=Vi(t),o!==-1&&(r=(t[o]+t[o+3])/2);else if(n===rr)o=Vi(c),o!==-1&&(r=mr(e,s,i,o));else if(n===ar){const a=Oe(c);let h=Ms*i;const d=s*6,E=(s+i)*6;for(let l=0;l<3;l++){const u=t[l],C=(t[l+3]-u)/wt;if(i=F.candidate?Qe(R,e,F.rightCacheBounds):(Qe(R,e,F.leftCacheBounds),F.count++)}}for(let R=0;R=wt&&(R=wt-1);const A=Ut[R];A.count++,Qe(f,e,A.bounds)}const T=Ut[wt-1];Hi(T.bounds,T.rightCacheBounds);for(let f=wt-2;f>=0;f--){const R=Ut[f],A=Ut[f+1];Wi(R.bounds,A.rightCacheBounds,R.rightCacheBounds)}let m=0;for(let f=0;f=a;)r--;if(o=a;)r--;if(o2**16,i=s?4:2,n=t?new SharedArrayBuffer(e*i):new ArrayBuffer(e*i),o=s?new Uint32Array(n):new Uint16Array(n);for(let r=0,a=o.length;r=i&&(E=!0,n&&(console.warn(`MeshBVH: Max depth of ${i} reached when generating BVH. Consider increasing maxDepth.`),console.warn(e))),g<=o||S>=i)return R(F+g),p.offset=F,p.count=g,p;const y=Tr(p.boundingData,_,C,F,g,r);if(y.axis===-1)return R(F+g),p.offset=F,p.count=g,p;const w=T(d,s,C,F,g,y);if(w===F||w===F+g)R(F+g),p.offset=F,p.count=g;else{p.splitAxis=y.axis;const L=new qe,P=F,D=w-F;p.left=L,L.boundingData=new Float32Array(6),Us(C,P,D,L.boundingData,u),A(L,P,D,u,S+1);const x=new qe,Y=w,z=g-D;p.right=x,x.boundingData=new Float32Array(6),Us(C,Y,z,x.boundingData,u),A(x,Y,z,u,S+1)}return p}}function gr(c,t){const e=c.geometry;t.indirect&&(c._indirectBuffer=Fr(e,t.useSharedArrayBuffer),Er(e)&&!t.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||dr(e,t);const s=Ar(c,t);let i,n,o;const r=[],a=t.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer;for(let E=0;EMath.pow(2,32))throw new Error("MeshBVH: Cannot store child pointer greater than 32 bits.");return n[u+6]=p/4,p=d(p,R),n[u+7]=A,p}}}class Pt{constructor(){this.min=1/0,this.max=-1/0}setFromPointsField(t,e){let s=1/0,i=-1/0;for(let n=0,o=t.length;ni?r:i}this.min=s,this.max=i}setFromPoints(t,e){let s=1/0,i=-1/0;for(let n=0,o=e.length;ni?a:i}this.min=s,this.max=i}isSeparated(t){return this.min>t.max||t.min>this.max}}Pt.prototype.setFromBox=function(){const c=new O;return function(t,e){const s=e.min,i=e.max;let n=1/0,o=-1/0;for(let r=0;r<=1;r++)for(let a=0;a<=1;a++)for(let h=0;h<=1;h++){c.x=s.x*r+i.x*(1-r),c.y=s.y*a+i.y*(1-a),c.z=s.z*h+i.z*(1-h);const d=t.dot(c);n=Math.min(d,n),o=Math.max(d,o)}this.min=n,this.max=o}}();const Or=function(){const c=new O,t=new O,e=new O;return function(s,i,n){const o=s.start,r=c,a=i.start,h=t;e.subVectors(o,a),c.subVectors(s.end,s.start),t.subVectors(i.end,i.start);const d=e.dot(h),E=h.dot(r),l=h.dot(h),u=e.dot(r),C=r.dot(r)*l-E*E;let T,m;C!==0?T=(d*E-u*l)/C:T=0,m=(d+T*E)/l,n.x=T,n.y=m}}(),Si=function(){const c=new At,t=new O,e=new O;return function(s,i,n,o){Or(s,i,c);let r=c.x,a=c.y;if(r>=0&&r<=1&&a>=0&&a<=1){s.at(r,n),i.at(a,o);return}else if(r>=0&&r<=1){a<0?i.at(0,o):i.at(1,o),s.closestPointToPoint(o,!0,n);return}else if(a>=0&&a<=1){r<0?s.at(0,n):s.at(1,n),i.closestPointToPoint(n,!0,o);return}else{let h;r<0?h=s.start:h=s.end;let d;a<0?d=i.start:d=i.end;const E=t,l=e;if(s.closestPointToPoint(d,!0,t),i.closestPointToPoint(h,!0,e),E.distanceToSquared(d)<=l.distanceToSquared(h)){n.copy(E),o.copy(d);return}else{n.copy(h),o.copy(l);return}}}}(),_r=function(){const c=new O,t=new O,e=new fe,s=new Ft;return function(i,n){const{radius:o,center:r}=i,{a,b:h,c:d}=n;if(s.start=a,s.end=h,s.closestPointToPoint(r,!0,c).distanceTo(r)<=o||(s.start=a,s.end=d,s.closestPointToPoint(r,!0,c).distanceTo(r)<=o)||(s.start=h,s.end=d,s.closestPointToPoint(r,!0,c).distanceTo(r)<=o))return!0;const E=n.getPlane(e);if(Math.abs(E.distanceToPoint(r))<=o){const l=E.projectPoint(r,t);if(n.containsPoint(l))return!0}return!1}}(),Sr=1e-15;function xs(c){return Math.abs(c)new O),this.satBounds=new Array(4).fill().map(()=>new Pt),this.points=[this.a,this.b,this.c],this.sphere=new Os,this.plane=new fe,this.needsUpdate=!0}intersectsSphere(t){return _r(t,this)}update(){const t=this.a,e=this.b,s=this.c,i=this.points,n=this.satAxes,o=this.satBounds,r=n[0],a=o[0];this.getNormal(r),a.setFromPoints(r,i);const h=n[1],d=o[1];h.subVectors(t,e),d.setFromPoints(h,i);const E=n[2],l=o[2];E.subVectors(e,s),l.setFromPoints(E,i);const u=n[3],C=o[3];u.subVectors(s,t),C.setFromPoints(u,i),this.sphere.setFromPoints(this.points),this.plane.setFromNormalAndCoplanarPoint(r,t),this.needsUpdate=!1}}gt.prototype.closestPointToSegment=function(){const c=new O,t=new O,e=new Ft;return function(s,i=null,n=null){const{start:o,end:r}=s,a=this.points;let h,d=1/0;for(let E=0;E<3;E++){const l=(E+1)%3;e.start.copy(a[E]),e.end.copy(a[l]),Si(e,s,c,t),h=c.distanceToSquared(t),h=2){(p===1?f.start:f.end).copy(u),A=2;break}if(A++,A===2&&p===-1)break}}return A}return function(T,m=null,f=!1){this.needsUpdate&&this.update(),T.isExtendedTriangle?T.needsUpdate&&T.update():(c.copy(T),c.update(),T=c);const R=this.plane,A=T.plane;if(Math.abs(R.normal.dot(A.normal))>1-1e-10){const p=this.satBounds,F=this.satAxes;e[0]=T.a,e[1]=T.b,e[2]=T.c;for(let S=0;S<4;S++){const y=p[S],w=F[S];if(s.setFromPoints(w,e),y.isSeparated(s))return!1}const g=T.satBounds,_=T.satAxes;t[0]=this.a,t[1]=this.b,t[2]=this.c;for(let S=0;S<4;S++){const y=g[S],w=_[S];if(s.setFromPoints(w,t),y.isSeparated(s))return!1}for(let S=0;S<4;S++){const y=F[S];for(let w=0;w<4;w++){const L=_[w];if(n.crossVectors(y,L),s.setFromPoints(n,t),i.setFromPoints(n,e),s.isSeparated(i))return!1}}return m&&(f||console.warn("ExtendedTriangle.intersectsTriangle: Triangles are coplanar which does not support an output edge. Setting edge to 0, 0, 0."),m.start.set(0,0,0),m.end.set(0,0,0)),!0}else{const p=C(this,A,E);if(p===1&&T.containsPoint(E.end))return m&&(m.start.copy(E.end),m.end.copy(E.end)),!0;if(p!==2)return!1;const F=C(T,R,l);if(F===1&&this.containsPoint(l.end))return m&&(m.start.copy(l.end),m.end.copy(l.end)),!0;if(F!==2)return!1;if(E.delta(r),l.delta(a),r.dot(a)<0){let P=l.start;l.start=l.end,l.end=P}const g=E.start.dot(r),_=E.end.dot(r),S=l.start.dot(r),y=l.end.dot(r),w=_0?m.start.copy(E.start):m.start.copy(l.start),h.subVectors(E.end,l.end),h.dot(r)<0?m.end.copy(E.end):m.end.copy(l.end)),!0)}}}();gt.prototype.distanceToPoint=function(){const c=new O;return function(t){return this.closestPointToPoint(t,c),t.distanceTo(c)}}();gt.prototype.distanceToTriangle=function(){const c=new O,t=new O,e=["a","b","c"],s=new Ft,i=new Ft;return function(n,o=null,r=null){const a=o||r?s:null;if(this.intersectsTriangle(n,a))return(o||r)&&(o&&a.getCenter(o),r&&a.getCenter(r)),0;let h=1/0;for(let d=0;d<3;d++){let E;const l=e[d],u=n[l];this.closestPointToPoint(u,c),E=u.distanceToSquared(c),Enew O),this.satAxes=new Array(3).fill().map(()=>new O),this.satBounds=new Array(3).fill().map(()=>new Pt),this.alignedSatBounds=new Array(3).fill().map(()=>new Pt),this.needsUpdate=!1,t&&this.min.copy(t),e&&this.max.copy(e),s&&this.matrix.copy(s)}set(t,e,s){this.min.copy(t),this.max.copy(e),this.matrix.copy(s),this.needsUpdate=!0}copy(t){this.min.copy(t.min),this.max.copy(t.max),this.matrix.copy(t.matrix),this.needsUpdate=!0}}at.prototype.update=function(){return function(){const c=this.matrix,t=this.min,e=this.max,s=this.points;for(let a=0;a<=1;a++)for(let h=0;h<=1;h++)for(let d=0;d<=1;d++){const E=1*a|2*h|4*d,l=s[E];l.x=a?e.x:t.x,l.y=h?e.y:t.y,l.z=d?e.z:t.z,l.applyMatrix4(c)}const i=this.satBounds,n=this.satAxes,o=s[0];for(let a=0;a<3;a++){const h=n[a],d=i[a],E=1<new Ft),e=new Array(12).fill().map(()=>new Ft),s=new O,i=new O;return function(n,o=0,r=null,a=null){if(this.needsUpdate&&this.update(),this.intersectsBox(n))return(r||a)&&(n.getCenter(i),this.closestPointToPoint(i,s),n.closestPointToPoint(s,i),r&&r.copy(s),a&&a.copy(i)),0;const h=o*o,d=n.min,E=n.max,l=this.points;let u=1/0;for(let T=0;T<8;T++){const m=l[T];i.copy(m).clamp(d,E);const f=m.distanceToSquared(i);if(fnew gt)}}const ut=new Nr;function ct(c,t){return t[c+15]===65535}function lt(c,t){return t[c+6]}function It(c,t){return t[c+14]}function pt(c){return c+8}function Ct(c,t){return t[c+6]}function Bn(c,t){return t[c+7]}class yr{constructor(){this.float32Array=null,this.uint16Array=null,this.uint32Array=null;const t=[];let e=null;this.setBuffer=s=>{e&&t.push(e),e=s,this.float32Array=new Float32Array(s),this.uint16Array=new Uint16Array(s),this.uint32Array=new Uint32Array(s)},this.clearBuffer=()=>{e=null,this.float32Array=null,this.uint16Array=null,this.uint32Array=null,t.length!==0&&this.setBuffer(t.pop())}}}const Z=new yr;let Bt,pe;const Jt=[],Ke=new Ni(()=>new st);function wr(c,t,e,s,i,n){Bt=Ke.getPrimitive(),pe=Ke.getPrimitive(),Jt.push(Bt,pe),Z.setBuffer(c._roots[t]);const o=ti(0,c.geometry,e,s,i,n);Z.clearBuffer(),Ke.releasePrimitive(Bt),Ke.releasePrimitive(pe),Jt.pop(),Jt.pop();const r=Jt.length;return r>0&&(pe=Jt[r-1],Bt=Jt[r-2]),o}function ti(c,t,e,s,i=null,n=0,o=0){const{float32Array:r,uint16Array:a,uint32Array:h}=Z;let d=c*2;if(ct(d,a)){const E=lt(c,h),l=It(d,a);return j(c,r,Bt),s(E,l,!1,o,n+c,Bt)}else{let E=function(L){const{uint16Array:P,uint32Array:D}=Z;let x=L*2;for(;!ct(x,P);)L=pt(L),x=L*2;return lt(L,D)},l=function(L){const{uint16Array:P,uint32Array:D}=Z;let x=L*2;for(;!ct(x,P);)L=Ct(L,D),x=L*2;return lt(L,D)+It(x,P)};const u=pt(c),C=Ct(c,h);let T=u,m=C,f,R,A,p;if(i&&(A=Bt,p=pe,j(T,r,A),j(m,r,p),f=i(A),R=i(p),R(_e.copy(t).clamp(d.min,d.max),_e.distanceToSquared(t)),intersectsBounds:(d,E,l)=>l{d.closestPointToPoint(t,_e);const l=t.distanceToSquared(_e);return l0&&h.normal.multiplyScalar(-1));const d={a:n,b:o,c:r,normal:new O,materialIndex:0};Ie.getNormal(te,ee,se,d.normal),h.face=d,h.faceIndex=n}return h}function Ss(c,t,e,s,i){const n=s*3;let o=n+0,r=n+1,a=n+2;const h=c.index;c.index&&(o=h.getX(o),r=h.getX(r),a=h.getX(a));const{position:d,normal:E,uv:l,uv1:u}=c.attributes,C=Mr(e,d,E,l,u,o,r,a,t);return C?(C.faceIndex=s,i&&i.push(C),C):null}function K(c,t,e,s){const i=c.a,n=c.b,o=c.c;let r=t,a=t+1,h=t+2;e&&(r=e.getX(r),a=e.getX(a),h=e.getX(h)),i.x=s.getX(r),i.y=s.getY(r),i.z=s.getZ(r),n.x=s.getX(a),n.y=s.getY(a),n.z=s.getZ(a),o.x=s.getX(h),o.y=s.getY(h),o.z=s.getZ(h)}function Dr(c,t,e,s,i,n){const{geometry:o,_indirectBuffer:r}=c;for(let a=s,h=s+i;aF&&(F=L),Pg&&(g=P),D_&&(_=D)}return a[l+0]!==R||a[l+1]!==A||a[l+2]!==p||a[l+3]!==F||a[l+4]!==g||a[l+5]!==_?(a[l+0]=R,a[l+1]=A,a[l+2]=p,a[l+3]=F,a[l+4]=g,a[l+5]=_,!0):!1}else{const m=l+8,f=o[l+6],R=m+u,A=f+u;let p=C,F=!1,g=!1;t?p||(F=t.has(R),g=t.has(A),p=!F&&!g):(F=!0,g=!0);const _=p||F,S=p||g;let y=!1;_&&(y=E(m,u,p));let w=!1;S&&(w=E(f,u,p));const L=y||w;if(L)for(let P=0;P<3;P++){const D=m+P,x=f+P,Y=a[D],z=a[D+3],tt=a[x],W=a[x+3];a[l+P]=YW?z:W}return L}}}const Qi=new st;function Yt(c,t,e,s){return j(c,t,Qi),e.intersectBox(Qi,s)}function br(c,t,e,s,i,n){const{geometry:o,_indirectBuffer:r}=c;for(let a=s,h=s+i;a=0;let E,l;d?(E=pt(c),l=Ct(c,o)):(E=Ct(c,o),l=pt(c));const u=Yt(E,i,s,qi)?si(E,t,e,s):null;if(u){const T=u.point[h];if(d?T<=i[l+a]:T>=i[l+a+3])return u}const C=Yt(l,i,s,qi)?si(l,t,e,s):null;return u&&C?u.distance<=C.distance?u:C:u||C||null}}const ss=new st,ie=new gt,ne=new gt,Se=new H,Ki=new at,is=new at;function Hr(c,t,e,s){Z.setBuffer(c._roots[t]);const i=ii(0,c,e,s);return Z.clearBuffer(),i}function ii(c,t,e,s,i=null){const{float32Array:n,uint16Array:o,uint32Array:r}=Z;let a=c*2;if(i===null&&(e.boundingBox||e.computeBoundingBox(),Ki.set(e.boundingBox.min,e.boundingBox.max,s),i=Ki),ct(a,o)){const h=t.geometry,d=h.index,E=h.attributes.position,l=e.index,u=e.attributes.position,C=lt(c,r),T=It(a,o);if(Se.copy(s).invert(),e.boundsTree)return j(c,n,is),is.matrix.copy(Se),is.needsUpdate=!0,e.boundsTree.shapecast({intersectsBounds:m=>is.intersectsBox(m),intersectsTriangle:m=>{m.a.applyMatrix4(s),m.b.applyMatrix4(s),m.c.applyMatrix4(s),m.needsUpdate=!0;for(let f=C*3,R=(T+C)*3;fbs.distanceToBox(F),intersectsBounds:(F,g,_)=>_{if(t.boundsTree)return t.boundsTree.shapecast({boundsTraverseOrder:_=>Ne.distanceToBox(_),intersectsBounds:(_,S,y)=>y{for(let y=_,w=_+S;yF&&(F=D),xg&&(g=x),Y_&&(_=Y)}}return a[l+0]!==R||a[l+1]!==A||a[l+2]!==p||a[l+3]!==F||a[l+4]!==g||a[l+5]!==_?(a[l+0]=R,a[l+1]=A,a[l+2]=p,a[l+3]=F,a[l+4]=g,a[l+5]=_,!0):!1}else{const m=l+8,f=o[l+6],R=m+u,A=f+u;let p=C,F=!1,g=!1;t?p||(F=t.has(R),g=t.has(A),p=!F&&!g):(F=!0,g=!0);const _=p||F,S=p||g;let y=!1;_&&(y=E(m,u,p));let w=!1;S&&(w=E(f,u,p));const L=y||w;if(L)for(let P=0;P<3;P++){const D=m+P,x=f+P,Y=a[D],z=a[D+3],tt=a[x],W=a[x+3];a[l+P]=YW?z:W}return L}}}const $i=new O;function qr(c,t,e,s,i){Z.setBuffer(c._roots[t]),ni(0,c,e,s,i),Z.clearBuffer()}function ni(c,t,e,s,i){const{float32Array:n,uint16Array:o,uint32Array:r}=Z,a=c*2;if(ct(a,o)){const h=lt(c,r),d=It(a,o);br(t,e,s,h,d,i)}else{const h=pt(c);Yt(h,n,s,$i)&&ni(h,t,e,s,i);const d=Ct(c,r);Yt(d,n,s,$i)&&ni(d,t,e,s,i)}}const Ji=new O,Kr=["x","y","z"];function $r(c,t,e,s){Z.setBuffer(c._roots[t]);const i=oi(0,c,e,s);return Z.clearBuffer(),i}function oi(c,t,e,s){const{float32Array:i,uint16Array:n,uint32Array:o}=Z;let r=c*2;if(ct(r,n)){const a=lt(c,o),h=It(r,n);return Br(t,e,s,a,h)}else{const a=Bn(c,o),h=Kr[a],d=s.direction[h]>=0;let E,l;d?(E=pt(c),l=Ct(c,o)):(E=Ct(c,o),l=pt(c));const u=Yt(E,i,s,Ji)?oi(E,t,e,s):null;if(u){const T=u.point[h];if(d?T<=i[l+a]:T>=i[l+a+3])return u}const C=Yt(l,i,s,Ji)?oi(l,t,e,s):null;return u&&C?u.distance<=C.distance?u:C:u||C||null}}const os=new st,oe=new gt,re=new gt,ye=new H,tn=new at,rs=new at;function Jr(c,t,e,s){Z.setBuffer(c._roots[t]);const i=ri(0,c,e,s);return Z.clearBuffer(),i}function ri(c,t,e,s,i=null){const{float32Array:n,uint16Array:o,uint32Array:r}=Z;let a=c*2;if(i===null&&(e.boundingBox||e.computeBoundingBox(),tn.set(e.boundingBox.min,e.boundingBox.max,s),i=tn),ct(a,o)){const h=t.geometry,d=h.index,E=h.attributes.position,l=e.index,u=e.attributes.position,C=lt(c,r),T=It(a,o);if(ye.copy(s).invert(),e.boundsTree)return j(c,n,rs),rs.matrix.copy(ye),rs.needsUpdate=!0,e.boundsTree.shapecast({intersectsBounds:m=>rs.intersectsBox(m),intersectsTriangle:m=>{m.a.applyMatrix4(s),m.b.applyMatrix4(s),m.c.applyMatrix4(s),m.needsUpdate=!0;for(let f=C,R=T+C;fBs.distanceToBox(F),intersectsBounds:(F,g,_)=>_{if(t.boundsTree){const _=t.boundsTree;return _.shapecast({boundsTraverseOrder:S=>we.distanceToBox(S),intersectsBounds:(S,y,w)=>w{for(let w=S,L=S+y;wnew st),ae=new st,he=new st,Ys=new st,zs=new st;let Gs=!1;function ra(c,t,e,s){if(Gs)throw new Error("MeshBVH: Recursive calls to bvhcast not supported.");Gs=!0;const i=c._roots,n=t._roots;let o,r=0,a=0;const h=new H().copy(e).invert();for(let d=0,E=i.length;da.slice()),index:o.array.slice(),indirectBuffer:n?n.slice():null}:r={roots:i,index:o.array,indirectBuffer:n},r}static deserialize(t,e,s={}){s={setIndex:!0,indirect:!!t.indirectBuffer,...s};const{index:i,roots:n,indirectBuffer:o}=t,r=new yi(e,{...s,[Ds]:!0});if(r._roots=n,r._indirectBuffer=o||null,s.setIndex){const a=e.getIndex();if(a===null){const h=new Ge(t.index,1,!1);e.setIndex(h)}else a.array!==i&&(a.array.set(i),a.needsUpdate=!0)}return r}get indirect(){return!!this._indirectBuffer}constructor(t,e={}){if(t.isBufferGeometry){if(t.index&&t.index.isInterleavedBufferAttribute)throw new Error("MeshBVH: InterleavedBufferAttribute is not supported for the index attribute.")}else throw new Error("MeshBVH: Only BufferGeometries are supported.");if(e=Object.assign({strategy:xn,maxDepth:40,maxLeafTris:10,verbose:!0,useSharedArrayBuffer:!1,setBoundingBox:!0,onProgress:null,indirect:!1,[Ds]:!1},e),e.useSharedArrayBuffer&&!oa())throw new Error("MeshBVH: SharedArrayBuffer is not available.");this.geometry=t,this._roots=null,this._indirectBuffer=null,e[Ds]||(gr(this,e),!t.boundingBox&&e.setBoundingBox&&(t.boundingBox=this.getBoundingBox(new st)));const{_indirectBuffer:s}=this;this.resolveTriangleIndex=e.indirect?i=>s[i]:i=>i}refit(t=null){return(this.indirect?jr:vr)(this,t)}traverse(t,e=0){const s=this._roots[e],i=new Uint32Array(s),n=new Uint16Array(s);o(0);function o(r,a=0){const h=r*2,d=n[h+15]===_s;if(d){const E=i[r+6],l=n[h+14];t(a,d,new Float32Array(s,r*4,6),E,l)}else{const E=r+Ts/4,l=i[r+6],u=i[r+7];t(a,d,new Float32Array(s,r*4,6),u)||(o(E,a+1),o(l,a+1))}}}raycast(t,e=Bi){const s=this._roots,i=this.geometry,n=[],o=e.isMaterial,r=Array.isArray(e),a=i.groups,h=o?e.side:e,d=this.indirect?qr:zr;for(let E=0,l=s.length;EE(l,u,C,T,m)?!0:s(l,u,this,r,C,T,e)}else o||(r?o=(E,l,u,C)=>s(E,l,this,r,u,C,e):o=(E,l,u)=>u);let a=!1,h=0;const d=this._roots;for(let E=0,l=d.length;E{const T=this.resolveTriangleIndex(C);K(o,T*3,r,a)}:C=>{K(o,C*3,r,a)},d=ut.getPrimitive(),E=t.geometry.index,l=t.geometry.attributes.position,u=t.indirect?C=>{const T=t.resolveTriangleIndex(C);K(d,T*3,E,l)}:C=>{K(d,C*3,E,l)};if(n){const C=(T,m,f,R,A,p,F,g)=>{for(let _=f,S=f+R;_hs.intersectsBox(s),intersectsTriangle:s=>hs.intersectsTriangle(s)})}intersectsSphere(t){return this.shapecast({intersectsBounds:e=>t.intersectsBox(e),intersectsTriangle:e=>e.intersectsSphere(t)})}closestPointToGeometry(t,e,s={},i={},n=0,o=1/0){return(this.indirect?na:Qr)(this,t,e,s,i,n,o)}closestPointToPoint(t,e={},s=0,i=1/0){return Lr(this,t,e,s,i)}getBoundingBox(t){return t.makeEmpty(),this._roots.forEach(e=>{j(0,new Float32Array(e),en),t.union(en)}),t}}function sn(c,t,e){return c===null||(c.point.applyMatrix4(t.matrixWorld),c.distance=c.point.distanceTo(e.ray.origin),c.object=t,c.distancee.far)?null:c}const Vs=new jo,nn=new H,aa=U.prototype.raycast;function ha(c,t){if(this.geometry.boundsTree){if(this.material===void 0)return;nn.copy(this.matrixWorld).invert(),Vs.copy(c.ray).applyMatrix4(nn);const e=this.geometry.boundsTree;if(c.firstHitOnly===!0){const s=sn(e.raycastFirst(Vs,this.material),this,c);s&&t.push(s)}else{const s=e.raycast(Vs,this.material);for(let i=0,n=s.length;i{const e=this.handlers.slice(0);for(const s of e)s(t)}),I(this,"handlers",[])}add(t){this.handlers.push(t)}remove(t){this.handlers=this.handlers.filter(e=>e!==t)}reset(){this.handlers.length=0}}class ms{constructor(){I(this,"trigger",async t=>{const e=this.handlers.slice(0);for(const s of e)await s(t)}),I(this,"handlers",[])}add(t){this.handlers.push(t)}remove(t){this.handlers=this.handlers.filter(e=>e!==t)}reset(){this.handlers.length=0}}class wi{constructor(t){I(this,"isDisposeable",()=>"dispose"in this&&"onDisposed"in this),I(this,"isResizeable",()=>"resize"in this&&"getSize"in this),I(this,"isUpdateable",()=>"onAfterUpdate"in this&&"onBeforeUpdate"in this&&"update"in this),I(this,"isHideable",()=>"visible"in this),I(this,"isConfigurable",()=>"setup"in this&&"config"in this&&"onSetup"in this),this.components=t}}class J extends wi{}class Li extends wi{constructor(t){super(t),I(this,"worlds",new Map),I(this,"onWorldChanged",new M),I(this,"currentWorld",null),this.onWorldChanged.add(({world:e,action:s})=>{s==="removed"&&this.worlds.delete(e.uuid)})}}class da extends Li{constructor(){super(...arguments),I(this,"hasCameraControls",()=>"controls"in this)}}class Ea extends Li{constructor(){super(...arguments),I(this,"onAfterUpdate",new M),I(this,"onBeforeUpdate",new M),I(this,"onDisposed",new M),I(this,"onResize",new M),I(this,"onClippingPlanesUpdated",new M),I(this,"clippingPlanes",[])}updateClippingPlanes(){this.onClippingPlanesUpdated.trigger()}setPlane(t,e,s){e.isLocal=s;const i=this.clippingPlanes.indexOf(e);t&&i===-1?this.clippingPlanes.push(e):!t&&i>-1&&this.clippingPlanes.splice(i,1),this.three.clippingPlanes=this.clippingPlanes.filter(n=>!n.isLocal)}}const Yn=class ai extends J{constructor(t){super(t),I(this,"_disposedComponents",new Set),I(this,"enabled",!0),t.add(ai.uuid,this)}get(){return this._disposedComponents}destroy(t,e=!0,s=!0){t.removeFromParent();const i=t;i.dispose&&i.dispose(),this.disposeGeometryAndMaterials(t,e),s&&i.children&&i.children.length&&this.disposeChildren(i),t.children.length=0}disposeGeometry(t){t.boundsTree&&t.disposeBoundsTree&&t.disposeBoundsTree(),t.dispose()}disposeGeometryAndMaterials(t,e){const s=t;s.geometry&&this.disposeGeometry(s.geometry),e&&s.material&&ai.disposeMaterial(s),s.material=[],s.geometry=null}disposeChildren(t){for(const e of t.children)this.destroy(e)}static disposeMaterial(t){if(t.material)if(Array.isArray(t.material))for(const e of t.material)e.dispose();else t.material.dispose()}};I(Yn,"uuid","76e9cd8e-ad8f-4753-9ef6-cbc60f7247fe");let me=Yn;class ua extends Li{constructor(t){super(t),I(this,"onDisposed",new M)}dispose(){const t=this.components.get(me);for(const e of this.three.children){const s=e;s.geometry&&t.destroy(s)}this.three.children=[],this.onDisposed.trigger(),this.onDisposed.reset()}}const fs=0,Ia=1,pa=new O,on=new Ft,Hs=new fe,rn=new O,cs=new Ie;class Ca{constructor(){this.tolerance=-1,this.faces=[],this.newFaces=[],this.assigned=new an,this.unassigned=new an,this.vertices=[]}setFromPoints(t){if(t.length>=4){this.makeEmpty();for(let e=0,s=t.length;ethis.tolerance)return!1;return!0}intersectRay(t,e){const s=this.faces;let i=-1/0,n=1/0;for(let o=0,r=s.length;o0&&d>=0)return null;const E=d!==0?-h/d:0;if(!(E<=0)&&(d>0?n=Math.min(E,n):i=Math.max(E,i),i>n))return null}return i!==-1/0?t.at(i,e):t.at(n,e),e}intersectsRay(t){return this.intersectRay(t,pa)!==null}makeEmpty(){return this.faces=[],this.vertices=[],this}addVertexToFace(t,e){return t.face=e,e.outside===null?this.assigned.append(t):this.assigned.insertBefore(e.outside,t),e.outside=t,this}removeVertexFromFace(t,e){return t===e.outside&&(t.next!==null&&t.next.face===e?e.outside=t.next:e.outside=null),this.assigned.remove(t),this}removeAllVerticesFromFace(t){if(t.outside!==null){const e=t.outside;let s=t.outside;for(;s.next!==null&&s.next.face===t;)s=s.next;return this.assigned.removeSubList(e,s),e.prev=s.next=null,t.outside=null,e}}deleteFaceVertices(t,e){const s=this.removeAllVerticesFromFace(t);if(s!==void 0)if(e===void 0)this.unassigned.appendChain(s);else{let i=s;do{const n=i.next;e.distanceToPoint(i.point)>this.tolerance?this.addVertexToFace(i,e):this.unassigned.append(i),i=n}while(i!==null)}return this}resolveUnassignedPoints(t){if(this.unassigned.isEmpty()===!1){let e=this.unassigned.first();do{const s=e.next;let i=this.tolerance,n=null;for(let o=0;oi&&(i=a,n=r),i>1e3*this.tolerance)break}}n!==null&&this.addVertexToFace(e,n),e=s}while(e!==null)}return this}computeExtremes(){const t=new O,e=new O,s=[],i=[];for(let n=0;n<3;n++)s[n]=i[n]=this.vertices[0];t.copy(this.vertices[0].point),e.copy(this.vertices[0].point);for(let n=0,o=this.vertices.length;ne.getComponent(h)&&(e.setComponent(h,a.getComponent(h)),i[h]=r)}return this.tolerance=3*Number.EPSILON*(Math.max(Math.abs(t.x),Math.abs(e.x))+Math.max(Math.abs(t.y),Math.abs(e.y))+Math.max(Math.abs(t.z),Math.abs(e.z))),{min:s,max:i}}computeInitialHull(){const t=this.vertices,e=this.computeExtremes(),s=e.min,i=e.max;let n=0,o=0;for(let l=0;l<3;l++){const u=i[l].point.getComponent(l)-s[l].point.getComponent(l);u>n&&(n=u,o=l)}const r=s[o],a=i[o];let h,d;n=0,on.set(r.point,a.point);for(let l=0,u=this.vertices.length;ln&&(n=T,h=C)}}n=-1,Hs.setFromCoplanarPoints(r.point,a.point,h.point);for(let l=0,u=this.vertices.length;ln&&(n=T,d=C)}}const E=[];if(Hs.distanceToPoint(d.point)<0){E.push(ft.create(r,a,h),ft.create(d,a,r),ft.create(d,h,a),ft.create(d,r,h));for(let l=0;l<3;l++){const u=(l+1)%3;E[l+1].getEdge(2).setTwin(E[0].getEdge(u)),E[l+1].getEdge(1).setTwin(E[u+1].getEdge(0))}}else{E.push(ft.create(r,h,a),ft.create(d,r,a),ft.create(d,a,h),ft.create(d,h,r));for(let l=0;l<3;l++){const u=(l+1)%3;E[l+1].getEdge(2).setTwin(E[0].getEdge((3-l)%3)),E[l+1].getEdge(0).setTwin(E[u+1].getEdge(1))}}for(let l=0;l<4;l++)this.faces.push(E[l]);for(let l=0,u=t.length;ln&&(n=f,T=this.faces[m])}T!==null&&this.addVertexToFace(C,T)}}return this}reindexFaces(){const t=[];for(let e=0;ee&&(e=n,t=i),i=i.next}while(i!==null&&i.face===s);return t}}computeHorizon(t,e,s,i){this.deleteFaceVertices(s),s.mark=Ia;let n;e===null?n=e=s.getEdge(0):n=e.next;do{const o=n.twin,r=o.face;r.mark===fs&&(r.distanceToPoint(t)>this.tolerance?this.computeHorizon(t,o,r,i):i.push(n)),n=n.next}while(n!==e);return this}addAdjoiningFace(t,e){const s=ft.create(t,e.tail(),e.head());return this.faces.push(s),s.getEdge(-1).setTwin(e.twin),s.getEdge(0)}addNewFaces(t,e){this.newFaces=[];let s=null,i=null;for(let n=0;n0;)e=e.next,t--;for(;t<0;)e=e.prev,t++;return e}compute(){const t=this.edge.tail(),e=this.edge.head(),s=this.edge.next.head();return cs.set(t.point,e.point,s.point),cs.getNormal(this.normal),cs.getMidpoint(this.midpoint),this.area=cs.getArea(),this.constant=this.normal.dot(this.midpoint),this}distanceToPoint(t){return this.normal.dot(t)-this.constant}}class Ws{constructor(t,e){this.vertex=t,this.prev=null,this.next=null,this.twin=null,this.face=e}head(){return this.vertex}tail(){return this.prev?this.prev.vertex:null}length(){const t=this.head(),e=this.tail();return e!==null?e.point.distanceTo(t.point):-1}lengthSquared(){const t=this.head(),e=this.tail();return e!==null?e.point.distanceToSquared(t.point):-1}setTwin(t){return this.twin=t,t.twin=this,this}}class Ta{constructor(t){this.point=t,this.prev=null,this.next=null,this.face=null}}class an{constructor(){this.head=null,this.tail=null}first(){return this.head}last(){return this.tail}clear(){return this.head=this.tail=null,this}insertBefore(t,e){return e.prev=t.prev,e.next=t,e.prev===null?this.head=e:e.prev.next=e,t.prev=e,this}insertAfter(t,e){return e.prev=t,e.next=t.next,e.next===null?this.tail=e:e.next.prev=e,t.next=e,this}append(t){return this.head===null?this.head=t:this.tail.next=t,t.prev=this.tail,t.next=null,this.tail=t,this}appendChain(t){for(this.head===null?this.head=t:this.tail.next=t,t.prev=this.tail;t.next!==null;)t=t.next;return this.tail=t,this}remove(t){return t.prev===null?this.head=t.next:t.prev.next=t.next,t.next===null?this.tail=t.prev:t.next.prev=t.prev,this}removeSubList(t,e){return t.prev===null?this.head=e.next:t.prev.next=e.next,e.next===null?this.tail=t.prev:e.next.prev=t.prev,this}isEmpty(){return this.head===null}}const hi=[2,2,1],ci=[1,0,0];function Nt(c,t){return c*3+t}function ma(c){const t=c.elements;let e=0;for(let s=0;s<9;s++)e+=t[s]*t[s];return Math.sqrt(e)}function fa(c){const t=c.elements;let e=0;for(let s=0;s<3;s++){const i=t[Nt(hi[s],ci[s])];e+=2*i*i}return Math.sqrt(e)}function Ra(c,t){let e=0,s=1;const i=c.elements;for(let h=0;h<3;h++){const d=Math.abs(i[Nt(hi[h],ci[h])]);d>e&&(e=d,s=h)}let n=1,o=0;const r=ci[s],a=hi[s];if(Math.abs(i[Nt(a,r)])>Number.EPSILON){const h=i[Nt(a,a)],d=i[Nt(r,r)],E=i[Nt(a,r)],l=(h-d)/2/E;let u;l<0?u=-1/(-l+Math.sqrt(1+l*l)):u=1/(l+Math.sqrt(1+l*l)),n=1/Math.sqrt(1+u*u),o=u*n}return t.identity(),t.elements[Nt(r,r)]=n,t.elements[Nt(a,a)]=n,t.elements[Nt(a,r)]=o,t.elements[Nt(r,a)]=-o,t}function Fa(c,t){let e=0,s=0;const i=10;t.unitary.identity(),t.diagonal.copy(c);const n=t.unitary,o=t.diagonal,r=new Zt,a=new Zt,h=Number.EPSILON*ma(o);for(;sh;)Ra(o,r),a.copy(r).transpose(),o.multiply(r),o.premultiply(a),n.multiply(r),++e>2&&(s++,e=0);return t}function Aa(c){const t=[];for(let $=0;$0}class hn{static isTransparent(t){return t.transparent&&t.opacity<1}}const li=class et{static create(){const t=Math.random()*4294967295|0,e=Math.random()*4294967295|0,s=Math.random()*4294967295|0,i=Math.random()*4294967295|0;return`${et._lut[t&255]+et._lut[t>>8&255]+et._lut[t>>16&255]+et._lut[t>>24&255]}-${et._lut[e&255]}${et._lut[e>>8&255]}-${et._lut[e>>16&15|64]}${et._lut[e>>24&255]}-${et._lut[s&63|128]}${et._lut[s>>8&255]}-${et._lut[s>>16&255]}${et._lut[s>>24&255]}${et._lut[i&255]}${et._lut[i>>8&255]}${et._lut[i>>16&255]}${et._lut[i>>24&255]}`.toLowerCase()}static validate(t){if(!et._pattern.test(t))throw new Error(`${t} is not a valid UUID v4. +import{r as Ft,s as st,T as Ie,t as pi,E as Po,c as H,V as O,h as At,x as fe,S as Os,a as U,C as Qt,y as Ci,D as Lo,A as Mo,W as Fs,w as Ti,P as Do,aW as Uo,v as xo,ar as Rt,aX as vo,ah as Sn,i as bo,I as Js,$ as mi,a7 as Ce,H as Bo,e as ze,b as Te,N as He,q as jt,Q as Zt,X as fi,Y as Nn,Z as yn,_ as wn,a0 as Pn,a1 as Ln,a2 as Ri,a3 as Mn,a4 as Dn,a5 as Un,B as it,a6 as Yo,ad as yt,a8 as bi,a9 as xn,aa as vn,ab as Kt,ac as zo,d as Ge,ae as ke,af as Go,ag as Vo,p as Fi,aw as Ai,ax as gi,aq as Oi,K as _i,ao as Ho,J as rt,O as As,av as Ls,an as Wo,ay as Xo,L as bn,az as ko,aA as Zo,aB as Qo,aC as jo,aD as qo,aU as Bi,aV as Ko,z as Yi,as as Ze,ap as Dt,at as $o,au as ge,ak as Jo,aY as tr,aZ as er,a_ as sr,a$ as ir,b0 as nr,b5 as or}from"./web-ifc-api-56EJvEs4.js";var rr=Object.defineProperty,ar=(c,t,e)=>t in c?rr(c,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):c[t]=e,I=(c,t,e)=>(ar(c,typeof t!="symbol"?t+"":t,e),e);const Bn=0,hr=1,cr=2,zi=2,Ms=1.25,Gi=1,Ts=6*4+4+4,_s=65535,lr=Math.pow(2,-24),Ds=Symbol("SKIP_GENERATION");function dr(c){return c.index?c.index.count:c.attributes.position.count}function Re(c){return dr(c)/3}function Er(c,t=ArrayBuffer){return c>65535?new Uint32Array(new t(4*c)):new Uint16Array(new t(2*c))}function ur(c,t){if(!c.index){const e=c.attributes.position.count,s=t.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer,i=Er(e,s);c.setIndex(new Ge(i,1));for(let n=0;nr-a);for(let r=0;rn.offset-o.offset),s=e[e.length-1];s.count=Math.min(t-s.offset,s.count);let i=0;return e.forEach(({count:n})=>i+=n),t!==i}function j(c,t,e){return e.min.x=t[c],e.min.y=t[c+1],e.min.z=t[c+2],e.max.x=t[c+3],e.max.y=t[c+4],e.max.z=t[c+5],e}function pr(c){c[0]=c[1]=c[2]=1/0,c[3]=c[4]=c[5]=-1/0}function Vi(c){let t=-1,e=-1/0;for(let s=0;s<3;s++){const i=c[s+3]-c[s];i>e&&(e=i,t=s)}return t}function Hi(c,t){t.set(c)}function Wi(c,t,e){let s,i;for(let n=0;n<3;n++){const o=n+3;s=c[n],i=t[n],e[n]=si?s:i}}function Qe(c,t,e){for(let s=0;s<3;s++){const i=t[c+2*s],n=t[c+2*s+1],o=i-n,r=i+n;oe[s+3]&&(e[s+3]=r)}}function Oe(c){const t=c[3]-c[0],e=c[4]-c[1],s=c[5]-c[2];return 2*(t*e+e*s+s*t)}function Us(c,t,e,s,i=null){let n=1/0,o=1/0,r=1/0,a=-1/0,h=-1/0,d=-1/0,E=1/0,l=1/0,u=1/0,C=-1/0,T=-1/0,m=-1/0;const f=i!==null;for(let R=t*6,A=(t+e)*6;Ra&&(a=_),f&&pC&&(C=p);const S=c[R+2],y=c[R+3],w=S-y,P=S+y;wh&&(h=P),f&&ST&&(T=S);const L=c[R+4],D=c[R+5],x=L-D,Y=L+D;xd&&(d=Y),f&&Lm&&(m=L)}s[0]=n,s[1]=o,s[2]=r,s[3]=a,s[4]=h,s[5]=d,f&&(i[0]=E,i[1]=l,i[2]=u,i[3]=C,i[4]=T,i[5]=m)}function Cr(c,t,e,s){let i=1/0,n=1/0,o=1/0,r=-1/0,a=-1/0,h=-1/0;for(let d=t*6,E=(t+e)*6;dr&&(r=l);const u=c[d+2];ua&&(a=u);const C=c[d+4];Ch&&(h=C)}s[0]=i,s[1]=n,s[2]=o,s[3]=r,s[4]=a,s[5]=h}function Tr(c,t){pr(t);const e=c.attributes.position,s=c.index?c.index.array:null,i=Re(c),n=new Float32Array(i*6),o=e.normalized,r=e.array,a=e.offset||0;let h=3;e.isInterleavedBufferAttribute&&(h=e.data.stride);const d=["getX","getY","getZ"];for(let E=0;Eg&&(g=A),p>g&&(g=p);const _=(g-F)/2,S=f*2;n[u+S+0]=F+_,n[u+S+1]=_+(Math.abs(F)+_)*lr,Ft[f+3]&&(t[f+3]=g)}}return n}const wt=32,mr=(c,t)=>c.candidate-t.candidate,Ut=new Array(wt).fill().map(()=>({count:0,bounds:new Float32Array(6),rightCacheBounds:new Float32Array(6),leftCacheBounds:new Float32Array(6),candidate:0})),je=new Float32Array(6);function fr(c,t,e,s,i,n){let o=-1,r=0;if(n===Bn)o=Vi(t),o!==-1&&(r=(t[o]+t[o+3])/2);else if(n===hr)o=Vi(c),o!==-1&&(r=Rr(e,s,i,o));else if(n===cr){const a=Oe(c);let h=Ms*i;const d=s*6,E=(s+i)*6;for(let l=0;l<3;l++){const u=t[l],C=(t[l+3]-u)/wt;if(i=F.candidate?Qe(R,e,F.rightCacheBounds):(Qe(R,e,F.leftCacheBounds),F.count++)}}for(let R=0;R=wt&&(R=wt-1);const A=Ut[R];A.count++,Qe(f,e,A.bounds)}const T=Ut[wt-1];Hi(T.bounds,T.rightCacheBounds);for(let f=wt-2;f>=0;f--){const R=Ut[f],A=Ut[f+1];Wi(R.bounds,A.rightCacheBounds,R.rightCacheBounds)}let m=0;for(let f=0;f=a;)r--;if(o=a;)r--;if(o2**16,i=s?4:2,n=t?new SharedArrayBuffer(e*i):new ArrayBuffer(e*i),o=s?new Uint32Array(n):new Uint16Array(n);for(let r=0,a=o.length;r=i&&(E=!0,n&&(console.warn(`MeshBVH: Max depth of ${i} reached when generating BVH. Consider increasing maxDepth.`),console.warn(e))),g<=o||S>=i)return R(F+g),p.offset=F,p.count=g,p;const y=fr(p.boundingData,_,C,F,g,r);if(y.axis===-1)return R(F+g),p.offset=F,p.count=g,p;const w=T(d,s,C,F,g,y);if(w===F||w===F+g)R(F+g),p.offset=F,p.count=g;else{p.splitAxis=y.axis;const P=new qe,L=F,D=w-F;p.left=P,P.boundingData=new Float32Array(6),Us(C,L,D,P.boundingData,u),A(P,L,D,u,S+1);const x=new qe,Y=w,z=g-D;p.right=x,x.boundingData=new Float32Array(6),Us(C,Y,z,x.boundingData,u),A(x,Y,z,u,S+1)}return p}}function _r(c,t){const e=c.geometry;t.indirect&&(c._indirectBuffer=gr(e,t.useSharedArrayBuffer),Ir(e)&&!t.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||ur(e,t);const s=Or(c,t);let i,n,o;const r=[],a=t.useSharedArrayBuffer?SharedArrayBuffer:ArrayBuffer;for(let E=0;EMath.pow(2,32))throw new Error("MeshBVH: Cannot store child pointer greater than 32 bits.");return n[u+6]=p/4,p=d(p,R),n[u+7]=A,p}}}class Lt{constructor(){this.min=1/0,this.max=-1/0}setFromPointsField(t,e){let s=1/0,i=-1/0;for(let n=0,o=t.length;ni?r:i}this.min=s,this.max=i}setFromPoints(t,e){let s=1/0,i=-1/0;for(let n=0,o=e.length;ni?a:i}this.min=s,this.max=i}isSeparated(t){return this.min>t.max||t.min>this.max}}Lt.prototype.setFromBox=function(){const c=new O;return function(t,e){const s=e.min,i=e.max;let n=1/0,o=-1/0;for(let r=0;r<=1;r++)for(let a=0;a<=1;a++)for(let h=0;h<=1;h++){c.x=s.x*r+i.x*(1-r),c.y=s.y*a+i.y*(1-a),c.z=s.z*h+i.z*(1-h);const d=t.dot(c);n=Math.min(d,n),o=Math.max(d,o)}this.min=n,this.max=o}}();const Sr=function(){const c=new O,t=new O,e=new O;return function(s,i,n){const o=s.start,r=c,a=i.start,h=t;e.subVectors(o,a),c.subVectors(s.end,s.start),t.subVectors(i.end,i.start);const d=e.dot(h),E=h.dot(r),l=h.dot(h),u=e.dot(r),C=r.dot(r)*l-E*E;let T,m;C!==0?T=(d*E-u*l)/C:T=0,m=(d+T*E)/l,n.x=T,n.y=m}}(),Si=function(){const c=new At,t=new O,e=new O;return function(s,i,n,o){Sr(s,i,c);let r=c.x,a=c.y;if(r>=0&&r<=1&&a>=0&&a<=1){s.at(r,n),i.at(a,o);return}else if(r>=0&&r<=1){a<0?i.at(0,o):i.at(1,o),s.closestPointToPoint(o,!0,n);return}else if(a>=0&&a<=1){r<0?s.at(0,n):s.at(1,n),i.closestPointToPoint(n,!0,o);return}else{let h;r<0?h=s.start:h=s.end;let d;a<0?d=i.start:d=i.end;const E=t,l=e;if(s.closestPointToPoint(d,!0,t),i.closestPointToPoint(h,!0,e),E.distanceToSquared(d)<=l.distanceToSquared(h)){n.copy(E),o.copy(d);return}else{n.copy(h),o.copy(l);return}}}}(),Nr=function(){const c=new O,t=new O,e=new fe,s=new Ft;return function(i,n){const{radius:o,center:r}=i,{a,b:h,c:d}=n;if(s.start=a,s.end=h,s.closestPointToPoint(r,!0,c).distanceTo(r)<=o||(s.start=a,s.end=d,s.closestPointToPoint(r,!0,c).distanceTo(r)<=o)||(s.start=h,s.end=d,s.closestPointToPoint(r,!0,c).distanceTo(r)<=o))return!0;const E=n.getPlane(e);if(Math.abs(E.distanceToPoint(r))<=o){const l=E.projectPoint(r,t);if(n.containsPoint(l))return!0}return!1}}(),yr=1e-15;function xs(c){return Math.abs(c)new O),this.satBounds=new Array(4).fill().map(()=>new Lt),this.points=[this.a,this.b,this.c],this.sphere=new Os,this.plane=new fe,this.needsUpdate=!0}intersectsSphere(t){return Nr(t,this)}update(){const t=this.a,e=this.b,s=this.c,i=this.points,n=this.satAxes,o=this.satBounds,r=n[0],a=o[0];this.getNormal(r),a.setFromPoints(r,i);const h=n[1],d=o[1];h.subVectors(t,e),d.setFromPoints(h,i);const E=n[2],l=o[2];E.subVectors(e,s),l.setFromPoints(E,i);const u=n[3],C=o[3];u.subVectors(s,t),C.setFromPoints(u,i),this.sphere.setFromPoints(this.points),this.plane.setFromNormalAndCoplanarPoint(r,t),this.needsUpdate=!1}}gt.prototype.closestPointToSegment=function(){const c=new O,t=new O,e=new Ft;return function(s,i=null,n=null){const{start:o,end:r}=s,a=this.points;let h,d=1/0;for(let E=0;E<3;E++){const l=(E+1)%3;e.start.copy(a[E]),e.end.copy(a[l]),Si(e,s,c,t),h=c.distanceToSquared(t),h=2){(p===1?f.start:f.end).copy(u),A=2;break}if(A++,A===2&&p===-1)break}}return A}return function(T,m=null,f=!1){this.needsUpdate&&this.update(),T.isExtendedTriangle?T.needsUpdate&&T.update():(c.copy(T),c.update(),T=c);const R=this.plane,A=T.plane;if(Math.abs(R.normal.dot(A.normal))>1-1e-10){const p=this.satBounds,F=this.satAxes;e[0]=T.a,e[1]=T.b,e[2]=T.c;for(let S=0;S<4;S++){const y=p[S],w=F[S];if(s.setFromPoints(w,e),y.isSeparated(s))return!1}const g=T.satBounds,_=T.satAxes;t[0]=this.a,t[1]=this.b,t[2]=this.c;for(let S=0;S<4;S++){const y=g[S],w=_[S];if(s.setFromPoints(w,t),y.isSeparated(s))return!1}for(let S=0;S<4;S++){const y=F[S];for(let w=0;w<4;w++){const P=_[w];if(n.crossVectors(y,P),s.setFromPoints(n,t),i.setFromPoints(n,e),s.isSeparated(i))return!1}}return m&&(f||console.warn("ExtendedTriangle.intersectsTriangle: Triangles are coplanar which does not support an output edge. Setting edge to 0, 0, 0."),m.start.set(0,0,0),m.end.set(0,0,0)),!0}else{const p=C(this,A,E);if(p===1&&T.containsPoint(E.end))return m&&(m.start.copy(E.end),m.end.copy(E.end)),!0;if(p!==2)return!1;const F=C(T,R,l);if(F===1&&this.containsPoint(l.end))return m&&(m.start.copy(l.end),m.end.copy(l.end)),!0;if(F!==2)return!1;if(E.delta(r),l.delta(a),r.dot(a)<0){let L=l.start;l.start=l.end,l.end=L}const g=E.start.dot(r),_=E.end.dot(r),S=l.start.dot(r),y=l.end.dot(r),w=_0?m.start.copy(E.start):m.start.copy(l.start),h.subVectors(E.end,l.end),h.dot(r)<0?m.end.copy(E.end):m.end.copy(l.end)),!0)}}}();gt.prototype.distanceToPoint=function(){const c=new O;return function(t){return this.closestPointToPoint(t,c),t.distanceTo(c)}}();gt.prototype.distanceToTriangle=function(){const c=new O,t=new O,e=["a","b","c"],s=new Ft,i=new Ft;return function(n,o=null,r=null){const a=o||r?s:null;if(this.intersectsTriangle(n,a))return(o||r)&&(o&&a.getCenter(o),r&&a.getCenter(r)),0;let h=1/0;for(let d=0;d<3;d++){let E;const l=e[d],u=n[l];this.closestPointToPoint(u,c),E=u.distanceToSquared(c),Enew O),this.satAxes=new Array(3).fill().map(()=>new O),this.satBounds=new Array(3).fill().map(()=>new Lt),this.alignedSatBounds=new Array(3).fill().map(()=>new Lt),this.needsUpdate=!1,t&&this.min.copy(t),e&&this.max.copy(e),s&&this.matrix.copy(s)}set(t,e,s){this.min.copy(t),this.max.copy(e),this.matrix.copy(s),this.needsUpdate=!0}copy(t){this.min.copy(t.min),this.max.copy(t.max),this.matrix.copy(t.matrix),this.needsUpdate=!0}}at.prototype.update=function(){return function(){const c=this.matrix,t=this.min,e=this.max,s=this.points;for(let a=0;a<=1;a++)for(let h=0;h<=1;h++)for(let d=0;d<=1;d++){const E=1*a|2*h|4*d,l=s[E];l.x=a?e.x:t.x,l.y=h?e.y:t.y,l.z=d?e.z:t.z,l.applyMatrix4(c)}const i=this.satBounds,n=this.satAxes,o=s[0];for(let a=0;a<3;a++){const h=n[a],d=i[a],E=1<new Ft),e=new Array(12).fill().map(()=>new Ft),s=new O,i=new O;return function(n,o=0,r=null,a=null){if(this.needsUpdate&&this.update(),this.intersectsBox(n))return(r||a)&&(n.getCenter(i),this.closestPointToPoint(i,s),n.closestPointToPoint(s,i),r&&r.copy(s),a&&a.copy(i)),0;const h=o*o,d=n.min,E=n.max,l=this.points;let u=1/0;for(let T=0;T<8;T++){const m=l[T];i.copy(m).clamp(d,E);const f=m.distanceToSquared(i);if(fnew gt)}}const ut=new wr;function ct(c,t){return t[c+15]===65535}function lt(c,t){return t[c+6]}function It(c,t){return t[c+14]}function pt(c){return c+8}function Ct(c,t){return t[c+6]}function Gn(c,t){return t[c+7]}class Pr{constructor(){this.float32Array=null,this.uint16Array=null,this.uint32Array=null;const t=[];let e=null;this.setBuffer=s=>{e&&t.push(e),e=s,this.float32Array=new Float32Array(s),this.uint16Array=new Uint16Array(s),this.uint32Array=new Uint32Array(s)},this.clearBuffer=()=>{e=null,this.float32Array=null,this.uint16Array=null,this.uint32Array=null,t.length!==0&&this.setBuffer(t.pop())}}}const Z=new Pr;let Bt,pe;const Jt=[],Ke=new Ni(()=>new st);function Lr(c,t,e,s,i,n){Bt=Ke.getPrimitive(),pe=Ke.getPrimitive(),Jt.push(Bt,pe),Z.setBuffer(c._roots[t]);const o=ti(0,c.geometry,e,s,i,n);Z.clearBuffer(),Ke.releasePrimitive(Bt),Ke.releasePrimitive(pe),Jt.pop(),Jt.pop();const r=Jt.length;return r>0&&(pe=Jt[r-1],Bt=Jt[r-2]),o}function ti(c,t,e,s,i=null,n=0,o=0){const{float32Array:r,uint16Array:a,uint32Array:h}=Z;let d=c*2;if(ct(d,a)){const E=lt(c,h),l=It(d,a);return j(c,r,Bt),s(E,l,!1,o,n+c,Bt)}else{let E=function(P){const{uint16Array:L,uint32Array:D}=Z;let x=P*2;for(;!ct(x,L);)P=pt(P),x=P*2;return lt(P,D)},l=function(P){const{uint16Array:L,uint32Array:D}=Z;let x=P*2;for(;!ct(x,L);)P=Ct(P,D),x=P*2;return lt(P,D)+It(x,L)};const u=pt(c),C=Ct(c,h);let T=u,m=C,f,R,A,p;if(i&&(A=Bt,p=pe,j(T,r,A),j(m,r,p),f=i(A),R=i(p),R(_e.copy(t).clamp(d.min,d.max),_e.distanceToSquared(t)),intersectsBounds:(d,E,l)=>l{d.closestPointToPoint(t,_e);const l=t.distanceToSquared(_e);return l0&&h.normal.multiplyScalar(-1));const d={a:n,b:o,c:r,normal:new O,materialIndex:0};Ie.getNormal(te,ee,se,d.normal),h.face=d,h.faceIndex=n}return h}function Ss(c,t,e,s,i){const n=s*3;let o=n+0,r=n+1,a=n+2;const h=c.index;c.index&&(o=h.getX(o),r=h.getX(r),a=h.getX(a));const{position:d,normal:E,uv:l,uv1:u}=c.attributes,C=Ur(e,d,E,l,u,o,r,a,t);return C?(C.faceIndex=s,i&&i.push(C),C):null}function K(c,t,e,s){const i=c.a,n=c.b,o=c.c;let r=t,a=t+1,h=t+2;e&&(r=e.getX(r),a=e.getX(a),h=e.getX(h)),i.x=s.getX(r),i.y=s.getY(r),i.z=s.getZ(r),n.x=s.getX(a),n.y=s.getY(a),n.z=s.getZ(a),o.x=s.getX(h),o.y=s.getY(h),o.z=s.getZ(h)}function xr(c,t,e,s,i,n){const{geometry:o,_indirectBuffer:r}=c;for(let a=s,h=s+i;aF&&(F=P),Lg&&(g=L),D_&&(_=D)}return a[l+0]!==R||a[l+1]!==A||a[l+2]!==p||a[l+3]!==F||a[l+4]!==g||a[l+5]!==_?(a[l+0]=R,a[l+1]=A,a[l+2]=p,a[l+3]=F,a[l+4]=g,a[l+5]=_,!0):!1}else{const m=l+8,f=o[l+6],R=m+u,A=f+u;let p=C,F=!1,g=!1;t?p||(F=t.has(R),g=t.has(A),p=!F&&!g):(F=!0,g=!0);const _=p||F,S=p||g;let y=!1;_&&(y=E(m,u,p));let w=!1;S&&(w=E(f,u,p));const P=y||w;if(P)for(let L=0;L<3;L++){const D=m+L,x=f+L,Y=a[D],z=a[D+3],tt=a[x],W=a[x+3];a[l+L]=YW?z:W}return P}}}const Qi=new st;function Yt(c,t,e,s){return j(c,t,Qi),e.intersectBox(Qi,s)}function Yr(c,t,e,s,i,n){const{geometry:o,_indirectBuffer:r}=c;for(let a=s,h=s+i;a=0;let E,l;d?(E=pt(c),l=Ct(c,o)):(E=Ct(c,o),l=pt(c));const u=Yt(E,i,s,qi)?si(E,t,e,s):null;if(u){const T=u.point[h];if(d?T<=i[l+a]:T>=i[l+a+3])return u}const C=Yt(l,i,s,qi)?si(l,t,e,s):null;return u&&C?u.distance<=C.distance?u:C:u||C||null}}const ss=new st,ie=new gt,ne=new gt,Se=new H,Ki=new at,is=new at;function Xr(c,t,e,s){Z.setBuffer(c._roots[t]);const i=ii(0,c,e,s);return Z.clearBuffer(),i}function ii(c,t,e,s,i=null){const{float32Array:n,uint16Array:o,uint32Array:r}=Z;let a=c*2;if(i===null&&(e.boundingBox||e.computeBoundingBox(),Ki.set(e.boundingBox.min,e.boundingBox.max,s),i=Ki),ct(a,o)){const h=t.geometry,d=h.index,E=h.attributes.position,l=e.index,u=e.attributes.position,C=lt(c,r),T=It(a,o);if(Se.copy(s).invert(),e.boundsTree)return j(c,n,is),is.matrix.copy(Se),is.needsUpdate=!0,e.boundsTree.shapecast({intersectsBounds:m=>is.intersectsBox(m),intersectsTriangle:m=>{m.a.applyMatrix4(s),m.b.applyMatrix4(s),m.c.applyMatrix4(s),m.needsUpdate=!0;for(let f=C*3,R=(T+C)*3;fbs.distanceToBox(F),intersectsBounds:(F,g,_)=>_{if(t.boundsTree)return t.boundsTree.shapecast({boundsTraverseOrder:_=>Ne.distanceToBox(_),intersectsBounds:(_,S,y)=>y{for(let y=_,w=_+S;yF&&(F=D),xg&&(g=x),Y_&&(_=Y)}}return a[l+0]!==R||a[l+1]!==A||a[l+2]!==p||a[l+3]!==F||a[l+4]!==g||a[l+5]!==_?(a[l+0]=R,a[l+1]=A,a[l+2]=p,a[l+3]=F,a[l+4]=g,a[l+5]=_,!0):!1}else{const m=l+8,f=o[l+6],R=m+u,A=f+u;let p=C,F=!1,g=!1;t?p||(F=t.has(R),g=t.has(A),p=!F&&!g):(F=!0,g=!0);const _=p||F,S=p||g;let y=!1;_&&(y=E(m,u,p));let w=!1;S&&(w=E(f,u,p));const P=y||w;if(P)for(let L=0;L<3;L++){const D=m+L,x=f+L,Y=a[D],z=a[D+3],tt=a[x],W=a[x+3];a[l+L]=YW?z:W}return P}}}const $i=new O;function $r(c,t,e,s,i){Z.setBuffer(c._roots[t]),ni(0,c,e,s,i),Z.clearBuffer()}function ni(c,t,e,s,i){const{float32Array:n,uint16Array:o,uint32Array:r}=Z,a=c*2;if(ct(a,o)){const h=lt(c,r),d=It(a,o);Yr(t,e,s,h,d,i)}else{const h=pt(c);Yt(h,n,s,$i)&&ni(h,t,e,s,i);const d=Ct(c,r);Yt(d,n,s,$i)&&ni(d,t,e,s,i)}}const Ji=new O,Jr=["x","y","z"];function ta(c,t,e,s){Z.setBuffer(c._roots[t]);const i=oi(0,c,e,s);return Z.clearBuffer(),i}function oi(c,t,e,s){const{float32Array:i,uint16Array:n,uint32Array:o}=Z;let r=c*2;if(ct(r,n)){const a=lt(c,o),h=It(r,n);return zr(t,e,s,a,h)}else{const a=Gn(c,o),h=Jr[a],d=s.direction[h]>=0;let E,l;d?(E=pt(c),l=Ct(c,o)):(E=Ct(c,o),l=pt(c));const u=Yt(E,i,s,Ji)?oi(E,t,e,s):null;if(u){const T=u.point[h];if(d?T<=i[l+a]:T>=i[l+a+3])return u}const C=Yt(l,i,s,Ji)?oi(l,t,e,s):null;return u&&C?u.distance<=C.distance?u:C:u||C||null}}const os=new st,oe=new gt,re=new gt,ye=new H,tn=new at,rs=new at;function ea(c,t,e,s){Z.setBuffer(c._roots[t]);const i=ri(0,c,e,s);return Z.clearBuffer(),i}function ri(c,t,e,s,i=null){const{float32Array:n,uint16Array:o,uint32Array:r}=Z;let a=c*2;if(i===null&&(e.boundingBox||e.computeBoundingBox(),tn.set(e.boundingBox.min,e.boundingBox.max,s),i=tn),ct(a,o)){const h=t.geometry,d=h.index,E=h.attributes.position,l=e.index,u=e.attributes.position,C=lt(c,r),T=It(a,o);if(ye.copy(s).invert(),e.boundsTree)return j(c,n,rs),rs.matrix.copy(ye),rs.needsUpdate=!0,e.boundsTree.shapecast({intersectsBounds:m=>rs.intersectsBox(m),intersectsTriangle:m=>{m.a.applyMatrix4(s),m.b.applyMatrix4(s),m.c.applyMatrix4(s),m.needsUpdate=!0;for(let f=C,R=T+C;fBs.distanceToBox(F),intersectsBounds:(F,g,_)=>_{if(t.boundsTree){const _=t.boundsTree;return _.shapecast({boundsTraverseOrder:S=>we.distanceToBox(S),intersectsBounds:(S,y,w)=>w{for(let w=S,P=S+y;wnew st),ae=new st,he=new st,Ys=new st,zs=new st;let Gs=!1;function ha(c,t,e,s){if(Gs)throw new Error("MeshBVH: Recursive calls to bvhcast not supported.");Gs=!0;const i=c._roots,n=t._roots;let o,r=0,a=0;const h=new H().copy(e).invert();for(let d=0,E=i.length;da.slice()),index:o.array.slice(),indirectBuffer:n?n.slice():null}:r={roots:i,index:o.array,indirectBuffer:n},r}static deserialize(t,e,s={}){s={setIndex:!0,indirect:!!t.indirectBuffer,...s};const{index:i,roots:n,indirectBuffer:o}=t,r=new yi(e,{...s,[Ds]:!0});if(r._roots=n,r._indirectBuffer=o||null,s.setIndex){const a=e.getIndex();if(a===null){const h=new Ge(t.index,1,!1);e.setIndex(h)}else a.array!==i&&(a.array.set(i),a.needsUpdate=!0)}return r}get indirect(){return!!this._indirectBuffer}constructor(t,e={}){if(t.isBufferGeometry){if(t.index&&t.index.isInterleavedBufferAttribute)throw new Error("MeshBVH: InterleavedBufferAttribute is not supported for the index attribute.")}else throw new Error("MeshBVH: Only BufferGeometries are supported.");if(e=Object.assign({strategy:Bn,maxDepth:40,maxLeafTris:10,verbose:!0,useSharedArrayBuffer:!1,setBoundingBox:!0,onProgress:null,indirect:!1,[Ds]:!1},e),e.useSharedArrayBuffer&&!aa())throw new Error("MeshBVH: SharedArrayBuffer is not available.");this.geometry=t,this._roots=null,this._indirectBuffer=null,e[Ds]||(_r(this,e),!t.boundingBox&&e.setBoundingBox&&(t.boundingBox=this.getBoundingBox(new st)));const{_indirectBuffer:s}=this;this.resolveTriangleIndex=e.indirect?i=>s[i]:i=>i}refit(t=null){return(this.indirect?Kr:Br)(this,t)}traverse(t,e=0){const s=this._roots[e],i=new Uint32Array(s),n=new Uint16Array(s);o(0);function o(r,a=0){const h=r*2,d=n[h+15]===_s;if(d){const E=i[r+6],l=n[h+14];t(a,d,new Float32Array(s,r*4,6),E,l)}else{const E=r+Ts/4,l=i[r+6],u=i[r+7];t(a,d,new Float32Array(s,r*4,6),u)||(o(E,a+1),o(l,a+1))}}}raycast(t,e=Bi){const s=this._roots,i=this.geometry,n=[],o=e.isMaterial,r=Array.isArray(e),a=i.groups,h=o?e.side:e,d=this.indirect?$r:Vr;for(let E=0,l=s.length;EE(l,u,C,T,m)?!0:s(l,u,this,r,C,T,e)}else o||(r?o=(E,l,u,C)=>s(E,l,this,r,u,C,e):o=(E,l,u)=>u);let a=!1,h=0;const d=this._roots;for(let E=0,l=d.length;E{const T=this.resolveTriangleIndex(C);K(o,T*3,r,a)}:C=>{K(o,C*3,r,a)},d=ut.getPrimitive(),E=t.geometry.index,l=t.geometry.attributes.position,u=t.indirect?C=>{const T=t.resolveTriangleIndex(C);K(d,T*3,E,l)}:C=>{K(d,C*3,E,l)};if(n){const C=(T,m,f,R,A,p,F,g)=>{for(let _=f,S=f+R;_hs.intersectsBox(s),intersectsTriangle:s=>hs.intersectsTriangle(s)})}intersectsSphere(t){return this.shapecast({intersectsBounds:e=>t.intersectsBox(e),intersectsTriangle:e=>e.intersectsSphere(t)})}closestPointToGeometry(t,e,s={},i={},n=0,o=1/0){return(this.indirect?ra:qr)(this,t,e,s,i,n,o)}closestPointToPoint(t,e={},s=0,i=1/0){return Mr(this,t,e,s,i)}getBoundingBox(t){return t.makeEmpty(),this._roots.forEach(e=>{j(0,new Float32Array(e),en),t.union(en)}),t}}function sn(c,t,e){return c===null||(c.point.applyMatrix4(t.matrixWorld),c.distance=c.point.distanceTo(e.ray.origin),c.object=t,c.distancee.far)?null:c}const Vs=new Ko,nn=new H,ca=U.prototype.raycast;function la(c,t){if(this.geometry.boundsTree){if(this.material===void 0)return;nn.copy(this.matrixWorld).invert(),Vs.copy(c.ray).applyMatrix4(nn);const e=this.geometry.boundsTree;if(c.firstHitOnly===!0){const s=sn(e.raycastFirst(Vs,this.material),this,c);s&&t.push(s)}else{const s=e.raycast(Vs,this.material);for(let i=0,n=s.length;i{const e=this.handlers.slice(0);for(const s of e)s(t)}),I(this,"handlers",[])}add(t){this.handlers.push(t)}remove(t){this.handlers=this.handlers.filter(e=>e!==t)}reset(){this.handlers.length=0}}class ms{constructor(){I(this,"trigger",async t=>{const e=this.handlers.slice(0);for(const s of e)await s(t)}),I(this,"handlers",[])}add(t){this.handlers.push(t)}remove(t){this.handlers=this.handlers.filter(e=>e!==t)}reset(){this.handlers.length=0}}class wi{constructor(t){I(this,"isDisposeable",()=>"dispose"in this&&"onDisposed"in this),I(this,"isResizeable",()=>"resize"in this&&"getSize"in this),I(this,"isUpdateable",()=>"onAfterUpdate"in this&&"onBeforeUpdate"in this&&"update"in this),I(this,"isHideable",()=>"visible"in this),I(this,"isConfigurable",()=>"setup"in this&&"config"in this&&"onSetup"in this),this.components=t}}class J extends wi{}class Pi extends wi{constructor(t){super(t),I(this,"worlds",new Map),I(this,"onWorldChanged",new M),I(this,"currentWorld",null),this.onWorldChanged.add(({world:e,action:s})=>{s==="removed"&&this.worlds.delete(e.uuid)})}}class ua extends Pi{constructor(){super(...arguments),I(this,"hasCameraControls",()=>"controls"in this)}}class Ia extends Pi{constructor(){super(...arguments),I(this,"onAfterUpdate",new M),I(this,"onBeforeUpdate",new M),I(this,"onDisposed",new M),I(this,"onResize",new M),I(this,"onClippingPlanesUpdated",new M),I(this,"clippingPlanes",[])}updateClippingPlanes(){this.onClippingPlanesUpdated.trigger()}setPlane(t,e,s){e.isLocal=s;const i=this.clippingPlanes.indexOf(e);t&&i===-1?this.clippingPlanes.push(e):!t&&i>-1&&this.clippingPlanes.splice(i,1),this.three.clippingPlanes=this.clippingPlanes.filter(n=>!n.isLocal)}}const Vn=class ai extends J{constructor(t){super(t),I(this,"_disposedComponents",new Set),I(this,"enabled",!0),t.add(ai.uuid,this)}get(){return this._disposedComponents}destroy(t,e=!0,s=!0){t.removeFromParent();const i=t;i.dispose&&i.dispose(),this.disposeGeometryAndMaterials(t,e),s&&i.children&&i.children.length&&this.disposeChildren(i),t.children.length=0}disposeGeometry(t){t.boundsTree&&t.disposeBoundsTree&&t.disposeBoundsTree(),t.dispose()}disposeGeometryAndMaterials(t,e){const s=t;s.geometry&&this.disposeGeometry(s.geometry),e&&s.material&&ai.disposeMaterial(s),s.material=[],s.geometry=null}disposeChildren(t){for(const e of t.children)this.destroy(e)}static disposeMaterial(t){if(t.material)if(Array.isArray(t.material))for(const e of t.material)e.dispose();else t.material.dispose()}};I(Vn,"uuid","76e9cd8e-ad8f-4753-9ef6-cbc60f7247fe");let me=Vn;class pa extends Pi{constructor(t){super(t),I(this,"onDisposed",new M)}dispose(){const t=this.components.get(me);for(const e of this.three.children){const s=e;s.geometry&&t.destroy(s)}this.three.children=[],this.onDisposed.trigger(),this.onDisposed.reset()}}class on extends Map{constructor(t){super(t),I(this,"onItemSet",new M),I(this,"onItemUpdated",new M),I(this,"onItemDeleted",new M),I(this,"onCleared",new M)}clear(){super.clear(),this.onCleared.trigger()}set(t,e){const s=this.has(t),i=super.set(t,e);return s?(this.onItemUpdated||(this.onItemUpdated=new M),this.onItemUpdated.trigger({key:t,value:e})):(this.onItemSet||(this.onItemSet=new M),this.onItemSet.trigger({key:t,value:e})),i}delete(t){const e=super.delete(t);return e&&this.onItemDeleted.trigger(),e}dispose(){this.clear(),this.onItemSet.reset(),this.onItemDeleted.reset(),this.onCleared.reset()}}const fs=0,Ca=1,Ta=new O,rn=new Ft,Hs=new fe,an=new O,cs=new Ie;class ma{constructor(){this.tolerance=-1,this.faces=[],this.newFaces=[],this.assigned=new hn,this.unassigned=new hn,this.vertices=[]}setFromPoints(t){if(t.length>=4){this.makeEmpty();for(let e=0,s=t.length;ethis.tolerance)return!1;return!0}intersectRay(t,e){const s=this.faces;let i=-1/0,n=1/0;for(let o=0,r=s.length;o0&&d>=0)return null;const E=d!==0?-h/d:0;if(!(E<=0)&&(d>0?n=Math.min(E,n):i=Math.max(E,i),i>n))return null}return i!==-1/0?t.at(i,e):t.at(n,e),e}intersectsRay(t){return this.intersectRay(t,Ta)!==null}makeEmpty(){return this.faces=[],this.vertices=[],this}addVertexToFace(t,e){return t.face=e,e.outside===null?this.assigned.append(t):this.assigned.insertBefore(e.outside,t),e.outside=t,this}removeVertexFromFace(t,e){return t===e.outside&&(t.next!==null&&t.next.face===e?e.outside=t.next:e.outside=null),this.assigned.remove(t),this}removeAllVerticesFromFace(t){if(t.outside!==null){const e=t.outside;let s=t.outside;for(;s.next!==null&&s.next.face===t;)s=s.next;return this.assigned.removeSubList(e,s),e.prev=s.next=null,t.outside=null,e}}deleteFaceVertices(t,e){const s=this.removeAllVerticesFromFace(t);if(s!==void 0)if(e===void 0)this.unassigned.appendChain(s);else{let i=s;do{const n=i.next;e.distanceToPoint(i.point)>this.tolerance?this.addVertexToFace(i,e):this.unassigned.append(i),i=n}while(i!==null)}return this}resolveUnassignedPoints(t){if(this.unassigned.isEmpty()===!1){let e=this.unassigned.first();do{const s=e.next;let i=this.tolerance,n=null;for(let o=0;oi&&(i=a,n=r),i>1e3*this.tolerance)break}}n!==null&&this.addVertexToFace(e,n),e=s}while(e!==null)}return this}computeExtremes(){const t=new O,e=new O,s=[],i=[];for(let n=0;n<3;n++)s[n]=i[n]=this.vertices[0];t.copy(this.vertices[0].point),e.copy(this.vertices[0].point);for(let n=0,o=this.vertices.length;ne.getComponent(h)&&(e.setComponent(h,a.getComponent(h)),i[h]=r)}return this.tolerance=3*Number.EPSILON*(Math.max(Math.abs(t.x),Math.abs(e.x))+Math.max(Math.abs(t.y),Math.abs(e.y))+Math.max(Math.abs(t.z),Math.abs(e.z))),{min:s,max:i}}computeInitialHull(){const t=this.vertices,e=this.computeExtremes(),s=e.min,i=e.max;let n=0,o=0;for(let l=0;l<3;l++){const u=i[l].point.getComponent(l)-s[l].point.getComponent(l);u>n&&(n=u,o=l)}const r=s[o],a=i[o];let h,d;n=0,rn.set(r.point,a.point);for(let l=0,u=this.vertices.length;ln&&(n=T,h=C)}}n=-1,Hs.setFromCoplanarPoints(r.point,a.point,h.point);for(let l=0,u=this.vertices.length;ln&&(n=T,d=C)}}const E=[];if(Hs.distanceToPoint(d.point)<0){E.push(ft.create(r,a,h),ft.create(d,a,r),ft.create(d,h,a),ft.create(d,r,h));for(let l=0;l<3;l++){const u=(l+1)%3;E[l+1].getEdge(2).setTwin(E[0].getEdge(u)),E[l+1].getEdge(1).setTwin(E[u+1].getEdge(0))}}else{E.push(ft.create(r,h,a),ft.create(d,r,a),ft.create(d,a,h),ft.create(d,h,r));for(let l=0;l<3;l++){const u=(l+1)%3;E[l+1].getEdge(2).setTwin(E[0].getEdge((3-l)%3)),E[l+1].getEdge(0).setTwin(E[u+1].getEdge(1))}}for(let l=0;l<4;l++)this.faces.push(E[l]);for(let l=0,u=t.length;ln&&(n=f,T=this.faces[m])}T!==null&&this.addVertexToFace(C,T)}}return this}reindexFaces(){const t=[];for(let e=0;ee&&(e=n,t=i),i=i.next}while(i!==null&&i.face===s);return t}}computeHorizon(t,e,s,i){this.deleteFaceVertices(s),s.mark=Ca;let n;e===null?n=e=s.getEdge(0):n=e.next;do{const o=n.twin,r=o.face;r.mark===fs&&(r.distanceToPoint(t)>this.tolerance?this.computeHorizon(t,o,r,i):i.push(n)),n=n.next}while(n!==e);return this}addAdjoiningFace(t,e){const s=ft.create(t,e.tail(),e.head());return this.faces.push(s),s.getEdge(-1).setTwin(e.twin),s.getEdge(0)}addNewFaces(t,e){this.newFaces=[];let s=null,i=null;for(let n=0;n0;)e=e.next,t--;for(;t<0;)e=e.prev,t++;return e}compute(){const t=this.edge.tail(),e=this.edge.head(),s=this.edge.next.head();return cs.set(t.point,e.point,s.point),cs.getNormal(this.normal),cs.getMidpoint(this.midpoint),this.area=cs.getArea(),this.constant=this.normal.dot(this.midpoint),this}distanceToPoint(t){return this.normal.dot(t)-this.constant}}class Ws{constructor(t,e){this.vertex=t,this.prev=null,this.next=null,this.twin=null,this.face=e}head(){return this.vertex}tail(){return this.prev?this.prev.vertex:null}length(){const t=this.head(),e=this.tail();return e!==null?e.point.distanceTo(t.point):-1}lengthSquared(){const t=this.head(),e=this.tail();return e!==null?e.point.distanceToSquared(t.point):-1}setTwin(t){return this.twin=t,t.twin=this,this}}class fa{constructor(t){this.point=t,this.prev=null,this.next=null,this.face=null}}class hn{constructor(){this.head=null,this.tail=null}first(){return this.head}last(){return this.tail}clear(){return this.head=this.tail=null,this}insertBefore(t,e){return e.prev=t.prev,e.next=t,e.prev===null?this.head=e:e.prev.next=e,t.prev=e,this}insertAfter(t,e){return e.prev=t,e.next=t.next,e.next===null?this.tail=e:e.next.prev=e,t.next=e,this}append(t){return this.head===null?this.head=t:this.tail.next=t,t.prev=this.tail,t.next=null,this.tail=t,this}appendChain(t){for(this.head===null?this.head=t:this.tail.next=t,t.prev=this.tail;t.next!==null;)t=t.next;return this.tail=t,this}remove(t){return t.prev===null?this.head=t.next:t.prev.next=t.next,t.next===null?this.tail=t.prev:t.next.prev=t.prev,this}removeSubList(t,e){return t.prev===null?this.head=e.next:t.prev.next=e.next,e.next===null?this.tail=t.prev:e.next.prev=t.prev,this}isEmpty(){return this.head===null}}const hi=[2,2,1],ci=[1,0,0];function Nt(c,t){return c*3+t}function Ra(c){const t=c.elements;let e=0;for(let s=0;s<9;s++)e+=t[s]*t[s];return Math.sqrt(e)}function Fa(c){const t=c.elements;let e=0;for(let s=0;s<3;s++){const i=t[Nt(hi[s],ci[s])];e+=2*i*i}return Math.sqrt(e)}function Aa(c,t){let e=0,s=1;const i=c.elements;for(let h=0;h<3;h++){const d=Math.abs(i[Nt(hi[h],ci[h])]);d>e&&(e=d,s=h)}let n=1,o=0;const r=ci[s],a=hi[s];if(Math.abs(i[Nt(a,r)])>Number.EPSILON){const h=i[Nt(a,a)],d=i[Nt(r,r)],E=i[Nt(a,r)],l=(h-d)/2/E;let u;l<0?u=-1/(-l+Math.sqrt(1+l*l)):u=1/(l+Math.sqrt(1+l*l)),n=1/Math.sqrt(1+u*u),o=u*n}return t.identity(),t.elements[Nt(r,r)]=n,t.elements[Nt(a,a)]=n,t.elements[Nt(a,r)]=o,t.elements[Nt(r,a)]=-o,t}function ga(c,t){let e=0,s=0;const i=10;t.unitary.identity(),t.diagonal.copy(c);const n=t.unitary,o=t.diagonal,r=new Zt,a=new Zt,h=Number.EPSILON*Ra(o);for(;sh;)Aa(o,r),a.copy(r).transpose(),o.multiply(r),o.premultiply(a),n.multiply(r),++e>2&&(s++,e=0);return t}function Oa(c){const t=[];for(let $=0;$0}class cn{static isTransparent(t){return t.transparent&&t.opacity<1}}const li=class et{static create(){const t=Math.random()*4294967295|0,e=Math.random()*4294967295|0,s=Math.random()*4294967295|0,i=Math.random()*4294967295|0;return`${et._lut[t&255]+et._lut[t>>8&255]+et._lut[t>>16&255]+et._lut[t>>24&255]}-${et._lut[e&255]}${et._lut[e>>8&255]}-${et._lut[e>>16&15|64]}${et._lut[e>>24&255]}-${et._lut[s&63|128]}${et._lut[s>>8&255]}-${et._lut[s>>16&255]}${et._lut[s>>24&255]}${et._lut[i&255]}${et._lut[i>>8&255]}${et._lut[i>>16&255]}${et._lut[i>>24&255]}`.toLowerCase()}static validate(t){if(!et._pattern.test(t))throw new Error(`${t} 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.`)}};I(li,"_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}$/),I(li,"_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 Pi=li;const zn=class Gn{constructor(){I(this,"onDisposed",new M),I(this,"list",new Map),I(this,"enabled",!1),I(this,"_clock"),I(this,"update",()=>{if(!this.enabled)return;const t=this._clock.getDelta();for(const[e,s]of this.list)s.enabled&&s.isUpdateable()&&s.update(t);requestAnimationFrame(this.update)}),this._clock=new Uo,Gn.setupBVH()}add(t,e){if(this.list.has(t))throw new Error("You're trying to add a component that already exists in the components instance. Use Components.get() instead.");Pi.validate(t),this.list.set(t,e)}get(t){const e=t.uuid;if(!this.list.has(e)){const s=new t(this);return this.list.has(e)||this.add(e,s),s}return this.list.get(e)}init(){this.enabled=!0,this._clock.start(),this.update()}dispose(){this.enabled=!1;for(const[t,e]of this.list)e.enabled=!1,e.isDisposeable()&&e.dispose();this._clock.stop(),this.onDisposed.trigger(),this.onDisposed.reset()}static setupBVH(){ze.prototype.computeBoundsTree=ca,ze.prototype.disposeBoundsTree=la,U.prototype.raycast=ha}};I(zn,"release","2.1.14");let Oa=zn;class _a{constructor(t){I(this,"_event"),I(this,"_position",new At),I(this,"onDisposed",new M),I(this,"updateMouseInfo",e=>{this._event=e}),this.dom=t,this.setupEvents(!0)}get position(){if(this._event){const t=this.dom.getBoundingClientRect();this._position.x=this.getPositionX(t,this._event),this._position.y=this.getPositionY(t,this._event)}return this._position}dispose(){this.setupEvents(!1),this.onDisposed.trigger(),this.onDisposed.reset()}getPositionY(t,e){return-((e.clientY-t.top)/(t.bottom-t.top))*2+1}getPositionX(t,e){return(e.clientX-t.left)/(t.right-t.left)*2-1}setupEvents(t){t?this.dom.addEventListener("pointermove",this.updateMouseInfo):this.dom.removeEventListener("pointermove",this.updateMouseInfo)}}class Sa{constructor(t,e){I(this,"enabled",!0),I(this,"components"),I(this,"onDisposed",new M),I(this,"mouse"),I(this,"three",new pi),I(this,"world");const s=e.renderer;if(!s)throw new Error("A renderer is needed for the raycaster to work!");this.world=e,this.mouse=new _a(s.three.domElement),this.components=t}dispose(){this.mouse.dispose(),this.onDisposed.trigger(),this.onDisposed.reset()}castRay(t=Array.from(this.world.meshes)){if(!this.world)throw new Error("A world is needed to cast rays!");const e=this.world.camera.three;return this.three.setFromCamera(this.mouse.position,e),this.intersect(t)}castRayFromVector(t,e,s=Array.from(this.world.meshes)){return this.three.set(t,e),this.intersect(s)}intersect(t=Array.from(this.world.meshes)){const e=this.three.intersectObjects(t),s=this.filterClippingPlanes(e);return s.length>0?s[0]:null}filterClippingPlanes(t){if(!this.world.renderer)throw new Error("Renderer not found!");const e=this.world.renderer.three;if(!e.clippingPlanes)return t;const s=e.clippingPlanes;return t.length<=0||!s||(s==null?void 0:s.length)<=0?t:t.filter(i=>s.every(n=>n.distanceToPoint(i.point)>0))}}const Vn=class Hn extends J{constructor(t){super(t),I(this,"enabled",!0),I(this,"list",new Map),I(this,"onDisposed",new M),t.add(Hn.uuid,this)}get(t){if(this.list.has(t.uuid))return this.list.get(t.uuid);const e=new Sa(this.components,t);return this.list.set(t.uuid,e),t.onDisposed.add(()=>{this.delete(t)}),e}delete(t){const e=this.list.get(t.uuid);e&&e.dispose(),this.list.delete(t.uuid)}dispose(){for(const[t,e]of this.list)e.dispose();this.list.clear(),this.onDisposed.trigger()}};I(Vn,"uuid","d5d8bdf0-db25-4952-b951-b643af207ace");let cn=Vn;class Na extends wi{constructor(){super(...arguments),I(this,"meshes",new Set),I(this,"onAfterUpdate",new M),I(this,"onBeforeUpdate",new M),I(this,"onDisposed",new M),I(this,"isDisposing",!1),I(this,"enabled",!0),I(this,"uuid",Pi.create()),I(this,"name"),I(this,"_scene"),I(this,"_camera"),I(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 e=this.components.get(me);this.scene.dispose(),this.camera.isDisposeable()&&this.camera.dispose(),this.renderer&&this.renderer.dispose();for(const s of this.meshes)e.destroy(s);this.meshes.clear()}this._scene=null,this._camera=null,this._renderer=null,this.onDisposed.trigger()}}class ch extends ua{constructor(t){super(t),I(this,"isSetup",!1),I(this,"three"),I(this,"onSetup",new M),I(this,"config",{directionalLight:{color:new Qt("white"),intensity:1.5,position:new O(5,10,3)},ambientLight:{color:new Qt("white"),intensity:1}}),this.three=new Ci,this.three.background=new Qt(2107698)}setup(t){this.config={...this.config,...t};const e=new No(this.config.directionalLight.color,this.config.directionalLight.intensity);e.position.copy(this.config.directionalLight.position);const s=new yo(this.config.ambientLight.color,this.config.ambientLight.intensity);this.three.add(e,s),this.isSetup=!0,this.onSetup.trigger(this)}}class lh extends Ea{constructor(t,e,s){super(t),I(this,"enabled",!0),I(this,"container"),I(this,"three"),I(this,"_canvas"),I(this,"_parameters"),I(this,"_resizeObserver",null),I(this,"onContainerUpdated",new M),I(this,"_resizing",!1),I(this,"resize",o=>{if(this._resizing)return;this._resizing=!0,this.onContainerUpdated.trigger();const r=o?o.x:this.container.clientWidth,a=o?o.y:this.container.clientHeight;this.three.setSize(r,a),this.onResize.trigger(new At(r,a)),this._resizing=!1}),I(this,"resizeEvent",()=>{this.resize()}),I(this,"onContextLost",o=>{o.preventDefault(),this.enabled=!1}),I(this,"onContextBack",()=>{this.three.setRenderTarget(null),this.three.dispose(),this.three=new Fs({canvas:this._canvas,antialias:!0,alpha:!0,...this._parameters}),this.enabled=!0}),this.container=e,this._parameters=s,this.three=new Fs({antialias:!0,alpha:!0,...s}),this.three.setPixelRatio(Math.min(window.devicePixelRatio,2)),this.setupRenderer(),this.setupEvents(!0),this.resize(),this._canvas=this.three.domElement;const i=this.three.getContext(),{canvas:n}=i;n.addEventListener("webglcontextlost",this.onContextLost,!1),n.addEventListener("webglcontextrestored",this.onContextBack,!1)}update(){if(!this.enabled||!this.currentWorld)return;this.onBeforeUpdate.trigger(this);const t=this.currentWorld.scene.three,e=this.currentWorld.camera.three;this.three.render(t,e),this.onAfterUpdate.trigger(this)}dispose(){this.enabled=!1,this.setupEvents(!1),this.three.domElement.remove(),this.three.dispose(),this.onResize.reset(),this.onAfterUpdate.reset(),this.onBeforeUpdate.reset(),this.onDisposed.trigger(),this.onDisposed.reset()}getSize(){return new At(this.three.domElement.clientWidth,this.three.domElement.clientHeight)}setupEvents(t){const e=this.three.domElement.parentElement;if(!e)throw new Error("This renderer needs to have an HTML container!");this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null),window.removeEventListener("resize",this.resizeEvent),t&&(this._resizeObserver=new ResizeObserver(this.resizeEvent),this._resizeObserver.observe(e),window.addEventListener("resize",this.resizeEvent))}setupRenderer(){this.three.localClippingEnabled=!0,this.container&&this.container.appendChild(this.three.domElement),this.onContainerUpdated.trigger()}}/*! +- If you're using a platform tool, verify the uuid isn't misspelled or contact the tool creator.`)}};I(li,"_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}$/),I(li,"_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 Li=li;const Hn=class Wn{constructor(){I(this,"onDisposed",new M),I(this,"list",new Map),I(this,"enabled",!1),I(this,"_clock"),I(this,"update",()=>{if(!this.enabled)return;const t=this._clock.getDelta();for(const[e,s]of this.list)s.enabled&&s.isUpdateable()&&s.update(t);requestAnimationFrame(this.update)}),this._clock=new Bo,Wn.setupBVH()}add(t,e){if(this.list.has(t))throw new Error("You're trying to add a component that already exists in the components instance. Use Components.get() instead.");Li.validate(t),this.list.set(t,e)}get(t){const e=t.uuid;if(!this.list.has(e)){const s=new t(this);return this.list.has(e)||this.add(e,s),s}return this.list.get(e)}init(){this.enabled=!0,this._clock.start(),this.update()}dispose(){this.enabled=!1;for(const[t,e]of this.list)e.enabled=!1,e.isDisposeable()&&e.dispose();this._clock.stop(),this.onDisposed.trigger(),this.onDisposed.reset()}static setupBVH(){ze.prototype.computeBoundsTree=da,ze.prototype.disposeBoundsTree=Ea,U.prototype.raycast=la}};I(Hn,"release","2.1.17");let Sa=Hn;class Na{constructor(t){I(this,"_event"),I(this,"_position",new At),I(this,"onDisposed",new M),I(this,"updateMouseInfo",e=>{this._event=e}),this.dom=t,this.setupEvents(!0)}get position(){if(this._event){const t=this.dom.getBoundingClientRect();this._position.x=this.getPositionX(t,this._event),this._position.y=this.getPositionY(t,this._event)}return this._position}dispose(){this.setupEvents(!1),this.onDisposed.trigger(),this.onDisposed.reset()}getPositionY(t,e){return-((e.clientY-t.top)/(t.bottom-t.top))*2+1}getPositionX(t,e){return(e.clientX-t.left)/(t.right-t.left)*2-1}setupEvents(t){t?this.dom.addEventListener("pointermove",this.updateMouseInfo):this.dom.removeEventListener("pointermove",this.updateMouseInfo)}}class ya{constructor(t,e){I(this,"enabled",!0),I(this,"components"),I(this,"onDisposed",new M),I(this,"mouse"),I(this,"three",new pi),I(this,"world");const s=e.renderer;if(!s)throw new Error("A renderer is needed for the raycaster to work!");this.world=e,this.mouse=new Na(s.three.domElement),this.components=t}dispose(){this.mouse.dispose(),this.onDisposed.trigger(),this.onDisposed.reset()}castRay(t=Array.from(this.world.meshes)){if(!this.world)throw new Error("A world is needed to cast rays!");const e=this.world.camera.three;return this.three.setFromCamera(this.mouse.position,e),this.intersect(t)}castRayFromVector(t,e,s=Array.from(this.world.meshes)){return this.three.set(t,e),this.intersect(s)}intersect(t=Array.from(this.world.meshes)){const e=this.three.intersectObjects(t),s=this.filterClippingPlanes(e);return s.length>0?s[0]:null}filterClippingPlanes(t){if(!this.world.renderer)throw new Error("Renderer not found!");const e=this.world.renderer.three;if(!e.clippingPlanes)return t;const s=e.clippingPlanes;return t.length<=0||!s||(s==null?void 0:s.length)<=0?t:t.filter(i=>s.every(n=>n.distanceToPoint(i.point)>0))}}const Xn=class kn extends J{constructor(t){super(t),I(this,"enabled",!0),I(this,"list",new Map),I(this,"onDisposed",new M),t.add(kn.uuid,this)}get(t){if(this.list.has(t.uuid))return this.list.get(t.uuid);const e=new ya(this.components,t);return this.list.set(t.uuid,e),t.onDisposed.add(()=>{this.delete(t)}),e}delete(t){const e=this.list.get(t.uuid);e&&e.dispose(),this.list.delete(t.uuid)}dispose(){for(const[t,e]of this.list)e.dispose();this.list.clear(),this.onDisposed.trigger()}};I(Xn,"uuid","d5d8bdf0-db25-4952-b951-b643af207ace");let ln=Xn;class wa extends wi{constructor(){super(...arguments),I(this,"meshes",new Set),I(this,"onAfterUpdate",new M),I(this,"onBeforeUpdate",new M),I(this,"onDisposed",new M),I(this,"isDisposing",!1),I(this,"enabled",!0),I(this,"uuid",Li.create()),I(this,"name"),I(this,"_scene"),I(this,"_camera"),I(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 e=this.components.get(me);this.scene.dispose(),this.camera.isDisposeable()&&this.camera.dispose(),this.renderer&&this.renderer.dispose();for(const s of this.meshes)e.destroy(s);this.meshes.clear()}this._scene=null,this._camera=null,this._renderer=null,this.onDisposed.trigger()}}class lh extends pa{constructor(t){super(t),I(this,"isSetup",!1),I(this,"three"),I(this,"onSetup",new M),I(this,"config",{directionalLight:{color:new Qt("white"),intensity:1.5,position:new O(5,10,3)},ambientLight:{color:new Qt("white"),intensity:1}}),this.three=new Ci,this.three.background=new Qt(2107698)}setup(t){this.config={...this.config,...t};const e=new Lo(this.config.directionalLight.color,this.config.directionalLight.intensity);e.position.copy(this.config.directionalLight.position);const s=new Mo(this.config.ambientLight.color,this.config.ambientLight.intensity);this.three.add(e,s),this.isSetup=!0,this.onSetup.trigger(this)}}class dh extends Ia{constructor(t,e,s){super(t),I(this,"enabled",!0),I(this,"container"),I(this,"three"),I(this,"_canvas"),I(this,"_parameters"),I(this,"_resizeObserver",null),I(this,"onContainerUpdated",new M),I(this,"_resizing",!1),I(this,"resize",o=>{if(this._resizing)return;this._resizing=!0,this.onContainerUpdated.trigger();const r=o?o.x:this.container.clientWidth,a=o?o.y:this.container.clientHeight;this.three.setSize(r,a),this.onResize.trigger(new At(r,a)),this._resizing=!1}),I(this,"resizeEvent",()=>{this.resize()}),I(this,"onContextLost",o=>{o.preventDefault(),this.enabled=!1}),I(this,"onContextBack",()=>{this.three.setRenderTarget(null),this.three.dispose(),this.three=new Fs({canvas:this._canvas,antialias:!0,alpha:!0,...this._parameters}),this.enabled=!0}),this.container=e,this._parameters=s,this.three=new Fs({antialias:!0,alpha:!0,...s}),this.three.setPixelRatio(Math.min(window.devicePixelRatio,2)),this.setupRenderer(),this.setupEvents(!0),this.resize(),this._canvas=this.three.domElement;const i=this.three.getContext(),{canvas:n}=i;n.addEventListener("webglcontextlost",this.onContextLost,!1),n.addEventListener("webglcontextrestored",this.onContextBack,!1)}update(){if(!this.enabled||!this.currentWorld)return;this.onBeforeUpdate.trigger(this);const t=this.currentWorld.scene.three,e=this.currentWorld.camera.three;this.three.render(t,e),this.onAfterUpdate.trigger(this)}dispose(){this.enabled=!1,this.setupEvents(!1),this.three.domElement.remove(),this.three.dispose(),this.onResize.reset(),this.onAfterUpdate.reset(),this.onBeforeUpdate.reset(),this.onDisposed.trigger(),this.onDisposed.reset()}getSize(){return new At(this.three.domElement.clientWidth,this.three.domElement.clientHeight)}setupEvents(t){const e=this.three.domElement.parentElement;if(!e)throw new Error("This renderer needs to have an HTML container!");this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null),window.removeEventListener("resize",this.resizeEvent),t&&(this._resizeObserver=new ResizeObserver(this.resizeEvent),this._resizeObserver.observe(e),window.addEventListener("resize",this.resizeEvent))}setupRenderer(){this.three.localClippingEnabled=!0,this.container&&this.container.appendChild(this.three.domElement),this.onContainerUpdated.trigger()}}/*! * camera-controls * https://github.com/yomotsu/camera-controls * (c) 2017 @yomotsu * Released under the MIT License. - */const b={LEFT:1,RIGHT:2,MIDDLE:4},N=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}),ce={NONE:0,IN:1,OUT:-1};function Ht(c){return c.isPerspectiveCamera}function vt(c){return c.isOrthographicCamera}const le=Math.PI*2,ln=Math.PI/2,Wn=1e-5,Le=Math.PI/180;function mt(c,t,e){return Math.max(t,Math.min(e,c))}function k(c,t=Wn){return Math.abs(c)0==u>d&&(u=d,e.value=(u-d)/n),u}function En(c,t,e,s,i=1/0,n,o){s=Math.max(1e-4,s);const r=2/s,a=r*n,h=1/(1+a+.48*a*a+.235*a*a*a);let d=t.x,E=t.y,l=t.z,u=c.x-d,C=c.y-E,T=c.z-l;const m=d,f=E,R=l,A=i*s,p=A*A,F=u*u+C*C+T*T;if(F>p){const Y=Math.sqrt(F);u=u/Y*A,C=C/Y*A,T=T/Y*A}d=c.x-u,E=c.y-C,l=c.z-T;const g=(e.x+r*u)*n,_=(e.y+r*C)*n,S=(e.z+r*T)*n;e.x=(e.x-r*g)*h,e.y=(e.y-r*_)*h,e.z=(e.z-r*S)*h,o.x=d+(u+g)*h,o.y=E+(C+_)*h,o.z=l+(T+S)*h;const y=m-c.x,w=f-c.y,L=R-c.z,P=o.x-m,D=o.y-f,x=o.z-R;return y*P+w*D+L*x>0&&(o.x=m,o.y=f,o.z=R,e.x=(o.x-m)/n,e.y=(o.y-f)/n,e.z=(o.z-R)/n),o}function Xs(c,t){t.set(0,0),c.forEach(e=>{t.x+=e.clientX,t.y+=e.clientY}),t.x/=c.length,t.y/=c.length}function ks(c,t){return vt(c)?(console.warn(`${t} is not supported in OrthographicCamera`),!0):!1}class ya{constructor(){this._listeners={}}addEventListener(t,e){const s=this._listeners;s[t]===void 0&&(s[t]=[]),s[t].indexOf(e)===-1&&s[t].push(e)}hasEventListener(t,e){const s=this._listeners;return s[t]!==void 0&&s[t].indexOf(e)!==-1}removeEventListener(t,e){const s=this._listeners[t];if(s!==void 0){const i=s.indexOf(e);i!==-1&&s.splice(i,1)}}removeAllEventListeners(t){if(!t){this._listeners={};return}Array.isArray(this._listeners[t])&&(this._listeners[t].length=0)}dispatchEvent(t){const e=this._listeners[t.type];if(e!==void 0){t.target=this;const s=e.slice(0);for(let i=0,n=s.length;i{},this._enabled=!0,this._state=N.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=ce.NONE,this._thetaVelocity={value:0},this._phiVelocity={value:0},this._radiusVelocity={value:0},this._targetVelocity=new v.Vector3,this._focalOffsetVelocity=new v.Vector3,this._zoomVelocity={value:0},this._truckInternal=(p,F,g)=>{let _,S;if(Ht(this._camera)){const y=B.copy(this._camera.position).sub(this._target),w=this._camera.getEffectiveFOV()*Le,L=y.length()*Math.tan(w*.5);_=this.truckSpeed*p*L/this._elementRect.height,S=this.truckSpeed*F*L/this._elementRect.height}else if(vt(this._camera)){const y=this._camera;_=p*(y.right-y.left)/y.zoom/this._elementRect.width,S=F*(y.top-y.bottom)/y.zoom/this._elementRect.height}else return;this.verticalDragToForward?(g?this.setFocalOffset(this._focalOffsetEnd.x+_,this._focalOffsetEnd.y,this._focalOffsetEnd.z,!0):this.truck(_,0,!0),this.forward(-S,!0)):g?this.setFocalOffset(this._focalOffsetEnd.x+_,this._focalOffsetEnd.y+S,this._focalOffsetEnd.z,!0):this.truck(_,S,!0)},this._rotateInternal=(p,F)=>{const g=le*this.azimuthRotateSpeed*p/this._elementRect.height,_=le*this.polarRotateSpeed*F/this._elementRect.height;this.rotate(g,_,!0)},this._dollyInternal=(p,F,g)=>{const _=Math.pow(.95,-p*this.dollySpeed),S=this._sphericalEnd.radius,y=this._sphericalEnd.radius*_,w=mt(y,this.minDistance,this.maxDistance),L=w-y;this.infinityDolly&&this.dollyToCursor?this._dollyToNoClamp(y,!0):this.infinityDolly&&!this.dollyToCursor?(this.dollyInFixed(L,!0),this._dollyToNoClamp(w,!0)):this._dollyToNoClamp(w,!0),this.dollyToCursor&&(this._changedDolly+=(this.infinityDolly?y:w)-S,this._dollyControlCoord.set(F,g)),this._lastDollyDirection=Math.sign(-p)},this._zoomInternal=(p,F,g)=>{const _=Math.pow(.95,p*this.dollySpeed),S=this._zoom,y=this._zoom*_;this.zoomTo(y,!0),this.dollyToCursor&&(this._changedZoom+=y-S,this._dollyControlCoord.set(F,g))},typeof v>"u"&&console.error("camera-controls: `THREE` is undefined. You must first run `CameraControls.install( { THREE: THREE } )`. Check the docs for further information."),this._camera=t,this._yAxisUpSpace=new v.Quaternion().setFromUnitVectors(this._camera.up,Es),this._yAxisUpSpaceInverse=this._yAxisUpSpace.clone().invert(),this._state=N.NONE,this._target=new v.Vector3,this._targetEnd=this._target.clone(),this._focalOffset=new v.Vector3,this._focalOffsetEnd=this._focalOffset.clone(),this._spherical=new v.Spherical().setFromVector3(B.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 v.Vector3,new v.Vector3,new v.Vector3,new v.Vector3],this._updateNearPlaneCorners(),this._boundary=new v.Box3(new v.Vector3(-1/0,-1/0,-1/0),new v.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 v.Vector2,this.mouseButtons={left:N.ROTATE,middle:N.DOLLY,right:N.TRUCK,wheel:Ht(this._camera)?N.DOLLY:vt(this._camera)?N.ZOOM:N.NONE},this.touches={one:N.TOUCH_ROTATE,two:Ht(this._camera)?N.TOUCH_DOLLY_TRUCK:vt(this._camera)?N.TOUCH_ZOOM_TRUCK:N.NONE,three:N.TOUCH_TRUCK};const s=new v.Vector2,i=new v.Vector2,n=new v.Vector2,o=p=>{if(!this._enabled||!this._domElement)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const _=this._domElement.getBoundingClientRect(),S=p.clientX/_.width,y=p.clientY/_.height;if(Sthis._interactiveArea.right||ythis._interactiveArea.bottom)return}const F=p.pointerType!=="mouse"?null:(p.buttons&b.LEFT)===b.LEFT?b.LEFT:(p.buttons&b.MIDDLE)===b.MIDDLE?b.MIDDLE:(p.buttons&b.RIGHT)===b.RIGHT?b.RIGHT:null;if(F!==null){const _=this._findPointerByMouseButton(F);_&&this._disposePointer(_)}if((p.buttons&b.LEFT)===b.LEFT&&this._lockedPointer)return;const g={pointerId:p.pointerId,clientX:p.clientX,clientY:p.clientY,deltaX:0,deltaY:0,mouseButton:F};this._activePointers.push(g),this._domElement.ownerDocument.removeEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",d),this._domElement.ownerDocument.addEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.addEventListener("pointerup",d),this._isDragging=!0,T(p)},r=p=>{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 _=this._domElement.getBoundingClientRect(),S=p.clientX/_.width,y=p.clientY/_.height;if(Sthis._interactiveArea.right||ythis._interactiveArea.bottom)return}const F=(p.buttons&b.LEFT)===b.LEFT?b.LEFT:(p.buttons&b.MIDDLE)===b.MIDDLE?b.MIDDLE:(p.buttons&b.RIGHT)===b.RIGHT?b.RIGHT:null;if(F!==null){const _=this._findPointerByMouseButton(F);_&&this._disposePointer(_)}const g={pointerId:1,clientX:p.clientX,clientY:p.clientY,deltaX:0,deltaY:0,mouseButton:(p.buttons&b.LEFT)===b.LEFT?b.LEFT:(p.buttons&b.MIDDLE)===b.LEFT?b.MIDDLE:(p.buttons&b.RIGHT)===b.LEFT?b.RIGHT:null};this._activePointers.push(g),this._domElement.ownerDocument.removeEventListener("mousemove",h),this._domElement.ownerDocument.removeEventListener("mouseup",E),this._domElement.ownerDocument.addEventListener("mousemove",h),this._domElement.ownerDocument.addEventListener("mouseup",E),this._isDragging=!0,T(p)},a=p=>{p.cancelable&&p.preventDefault();const F=p.pointerId,g=this._lockedPointer||this._findPointerById(F);if(g){if(g.clientX=p.clientX,g.clientY=p.clientY,g.deltaX=p.movementX,g.deltaY=p.movementY,this._state=0,p.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&&(p.buttons&b.LEFT)===b.LEFT)&&(this._state=this._state|this.mouseButtons.left),this._isDragging&&(p.buttons&b.MIDDLE)===b.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),this._isDragging&&(p.buttons&b.RIGHT)===b.RIGHT&&(this._state=this._state|this.mouseButtons.right);m()}},h=p=>{const F=this._lockedPointer||this._findPointerById(1);F&&(F.clientX=p.clientX,F.clientY=p.clientY,F.deltaX=p.movementX,F.deltaY=p.movementY,this._state=0,(this._lockedPointer||(p.buttons&b.LEFT)===b.LEFT)&&(this._state=this._state|this.mouseButtons.left),(p.buttons&b.MIDDLE)===b.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),(p.buttons&b.RIGHT)===b.RIGHT&&(this._state=this._state|this.mouseButtons.right),m())},d=p=>{const F=this._findPointerById(p.pointerId);if(!(F&&F===this._lockedPointer)){if(F&&this._disposePointer(F),p.pointerType==="touch")switch(this._activePointers.length){case 0:this._state=N.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=N.NONE;f()}},E=()=>{const p=this._findPointerById(1);p&&p===this._lockedPointer||(p&&this._disposePointer(p),this._state=N.NONE,f())};let l=-1;const u=p=>{if(!this._domElement||!this._enabled||this.mouseButtons.wheel===N.NONE)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const y=this._domElement.getBoundingClientRect(),w=p.clientX/y.width,L=p.clientY/y.height;if(wthis._interactiveArea.right||Lthis._interactiveArea.bottom)return}if(p.preventDefault(),this.dollyToCursor||this.mouseButtons.wheel===N.ROTATE||this.mouseButtons.wheel===N.TRUCK){const y=performance.now();l-y<1e3&&this._getClientRect(this._elementRect),l=y}const F=La?-1:-3,g=p.deltaMode===1?p.deltaY/F:p.deltaY/(F*10),_=this.dollyToCursor?(p.clientX-this._elementRect.x)/this._elementRect.width*2-1:0,S=this.dollyToCursor?(p.clientY-this._elementRect.y)/this._elementRect.height*-2+1:0;switch(this.mouseButtons.wheel){case N.ROTATE:{this._rotateInternal(p.deltaX,p.deltaY),this._isUserControllingRotate=!0;break}case N.TRUCK:{this._truckInternal(p.deltaX,p.deltaY,!1),this._isUserControllingTruck=!0;break}case N.OFFSET:{this._truckInternal(p.deltaX,p.deltaY,!0),this._isUserControllingOffset=!0;break}case N.DOLLY:{this._dollyInternal(-g,_,S),this._isUserControllingDolly=!0;break}case N.ZOOM:{this._zoomInternal(-g,_,S),this._isUserControllingZoom=!0;break}}this.dispatchEvent({type:"control"})},C=p=>{if(!(!this._domElement||!this._enabled)){if(this.mouseButtons.right===ot.ACTION.NONE){const F=p instanceof PointerEvent?p.pointerId:0,g=this._findPointerById(F);g&&this._disposePointer(g),this._domElement.ownerDocument.removeEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",d),this._domElement.ownerDocument.removeEventListener("mousemove",h),this._domElement.ownerDocument.removeEventListener("mouseup",E);return}p.preventDefault()}},T=p=>{if(this._enabled){if(Xs(this._activePointers,ht),this._getClientRect(this._elementRect),s.copy(ht),i.copy(ht),this._activePointers.length>=2){const F=ht.x-this._activePointers[1].clientX,g=ht.y-this._activePointers[1].clientY,_=Math.sqrt(F*F+g*g);n.set(0,_);const S=(this._activePointers[0].clientX+this._activePointers[1].clientX)*.5,y=(this._activePointers[0].clientY+this._activePointers[1].clientY)*.5;i.set(S,y)}if(this._state=0,!p)this._lockedPointer&&(this._state=this._state|this.mouseButtons.left);else if("pointerType"in p&&p.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&&(p.buttons&b.LEFT)===b.LEFT&&(this._state=this._state|this.mouseButtons.left),(p.buttons&b.MIDDLE)===b.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),(p.buttons&b.RIGHT)===b.RIGHT&&(this._state=this._state|this.mouseButtons.right);((this._state&N.ROTATE)===N.ROTATE||(this._state&N.TOUCH_ROTATE)===N.TOUCH_ROTATE||(this._state&N.TOUCH_DOLLY_ROTATE)===N.TOUCH_DOLLY_ROTATE||(this._state&N.TOUCH_ZOOM_ROTATE)===N.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&N.TRUCK)===N.TRUCK||(this._state&N.TOUCH_TRUCK)===N.TOUCH_TRUCK||(this._state&N.TOUCH_DOLLY_TRUCK)===N.TOUCH_DOLLY_TRUCK||(this._state&N.TOUCH_ZOOM_TRUCK)===N.TOUCH_ZOOM_TRUCK)&&(this._targetEnd.copy(this._target),this._targetVelocity.set(0,0,0)),((this._state&N.DOLLY)===N.DOLLY||(this._state&N.TOUCH_DOLLY)===N.TOUCH_DOLLY||(this._state&N.TOUCH_DOLLY_TRUCK)===N.TOUCH_DOLLY_TRUCK||(this._state&N.TOUCH_DOLLY_OFFSET)===N.TOUCH_DOLLY_OFFSET||(this._state&N.TOUCH_DOLLY_ROTATE)===N.TOUCH_DOLLY_ROTATE)&&(this._sphericalEnd.radius=this._spherical.radius,this._radiusVelocity.value=0),((this._state&N.ZOOM)===N.ZOOM||(this._state&N.TOUCH_ZOOM)===N.TOUCH_ZOOM||(this._state&N.TOUCH_ZOOM_TRUCK)===N.TOUCH_ZOOM_TRUCK||(this._state&N.TOUCH_ZOOM_OFFSET)===N.TOUCH_ZOOM_OFFSET||(this._state&N.TOUCH_ZOOM_ROTATE)===N.TOUCH_ZOOM_ROTATE)&&(this._zoomEnd=this._zoom,this._zoomVelocity.value=0),((this._state&N.OFFSET)===N.OFFSET||(this._state&N.TOUCH_OFFSET)===N.TOUCH_OFFSET||(this._state&N.TOUCH_DOLLY_OFFSET)===N.TOUCH_DOLLY_OFFSET||(this._state&N.TOUCH_ZOOM_OFFSET)===N.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,Xs(this._activePointers,ht);const p=this._domElement&&document.pointerLockElement===this._domElement?this._lockedPointer||this._activePointers[0]:null,F=p?-p.deltaX:i.x-ht.x,g=p?-p.deltaY:i.y-ht.y;if(i.copy(ht),((this._state&N.ROTATE)===N.ROTATE||(this._state&N.TOUCH_ROTATE)===N.TOUCH_ROTATE||(this._state&N.TOUCH_DOLLY_ROTATE)===N.TOUCH_DOLLY_ROTATE||(this._state&N.TOUCH_ZOOM_ROTATE)===N.TOUCH_ZOOM_ROTATE)&&(this._rotateInternal(F,g),this._isUserControllingRotate=!0),(this._state&N.DOLLY)===N.DOLLY||(this._state&N.ZOOM)===N.ZOOM){const _=this.dollyToCursor?(s.x-this._elementRect.x)/this._elementRect.width*2-1:0,S=this.dollyToCursor?(s.y-this._elementRect.y)/this._elementRect.height*-2+1:0,y=this.dollyDragInverted?-1:1;(this._state&N.DOLLY)===N.DOLLY?(this._dollyInternal(y*g*ds,_,S),this._isUserControllingDolly=!0):(this._zoomInternal(y*g*ds,_,S),this._isUserControllingZoom=!0)}if((this._state&N.TOUCH_DOLLY)===N.TOUCH_DOLLY||(this._state&N.TOUCH_ZOOM)===N.TOUCH_ZOOM||(this._state&N.TOUCH_DOLLY_TRUCK)===N.TOUCH_DOLLY_TRUCK||(this._state&N.TOUCH_ZOOM_TRUCK)===N.TOUCH_ZOOM_TRUCK||(this._state&N.TOUCH_DOLLY_OFFSET)===N.TOUCH_DOLLY_OFFSET||(this._state&N.TOUCH_ZOOM_OFFSET)===N.TOUCH_ZOOM_OFFSET||(this._state&N.TOUCH_DOLLY_ROTATE)===N.TOUCH_DOLLY_ROTATE||(this._state&N.TOUCH_ZOOM_ROTATE)===N.TOUCH_ZOOM_ROTATE){const _=ht.x-this._activePointers[1].clientX,S=ht.y-this._activePointers[1].clientY,y=Math.sqrt(_*_+S*S),w=n.y-y;n.set(0,y);const L=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&N.TOUCH_DOLLY)===N.TOUCH_DOLLY||(this._state&N.TOUCH_DOLLY_ROTATE)===N.TOUCH_DOLLY_ROTATE||(this._state&N.TOUCH_DOLLY_TRUCK)===N.TOUCH_DOLLY_TRUCK||(this._state&N.TOUCH_DOLLY_OFFSET)===N.TOUCH_DOLLY_OFFSET?(this._dollyInternal(w*ds,L,P),this._isUserControllingDolly=!0):(this._zoomInternal(w*ds,L,P),this._isUserControllingZoom=!0)}((this._state&N.TRUCK)===N.TRUCK||(this._state&N.TOUCH_TRUCK)===N.TOUCH_TRUCK||(this._state&N.TOUCH_DOLLY_TRUCK)===N.TOUCH_DOLLY_TRUCK||(this._state&N.TOUCH_ZOOM_TRUCK)===N.TOUCH_ZOOM_TRUCK)&&(this._truckInternal(F,g,!1),this._isUserControllingTruck=!0),((this._state&N.OFFSET)===N.OFFSET||(this._state&N.TOUCH_OFFSET)===N.TOUCH_OFFSET||(this._state&N.TOUCH_DOLLY_OFFSET)===N.TOUCH_DOLLY_OFFSET||(this._state&N.TOUCH_ZOOM_OFFSET)===N.TOUCH_ZOOM_OFFSET)&&(this._truckInternal(F,g,!0),this._isUserControllingOffset=!0),this.dispatchEvent({type:"control"})},f=()=>{Xs(this._activePointers,ht),i.copy(ht),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",h),this._domElement.ownerDocument.removeEventListener("pointerup",d),this._domElement.ownerDocument.removeEventListener("mouseup",E),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",d),this._domElement.requestPointerLock(),this._domElement.ownerDocument.addEventListener("pointerlockchange",R),this._domElement.ownerDocument.addEventListener("pointerlockerror",A),this._domElement.ownerDocument.addEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.addEventListener("pointerup",d),T())},this.unlockPointer=()=>{this._lockedPointer!==null&&(this._disposePointer(this._lockedPointer),this._lockedPointer=null),document.exitPointerLock(),this.cancel(),this._domElement&&(this._domElement.ownerDocument.removeEventListener("pointerlockchange",R),this._domElement.ownerDocument.removeEventListener("pointerlockerror",A))};const R=()=>{this._domElement&&this._domElement.ownerDocument.pointerLockElement===this._domElement||this.unlockPointer()},A=()=>{this.unlockPointer()};this._addAllEventListeners=p=>{this._domElement=p,this._domElement.style.touchAction="none",this._domElement.style.userSelect="none",this._domElement.style.webkitUserSelect="none",this._domElement.addEventListener("pointerdown",o),Pa&&this._domElement.addEventListener("mousedown",r),this._domElement.addEventListener("pointercancel",d),this._domElement.addEventListener("wheel",u,{passive:!1}),this._domElement.addEventListener("contextmenu",C)},this._removeAllEventListeners=()=>{this._domElement&&(this._domElement.style.touchAction="",this._domElement.style.userSelect="",this._domElement.style.webkitUserSelect="",this._domElement.removeEventListener("pointerdown",o),this._domElement.removeEventListener("mousedown",r),this._domElement.removeEventListener("pointercancel",d),this._domElement.removeEventListener("wheel",u,{passive:!1}),this._domElement.removeEventListener("contextmenu",C),this._domElement.ownerDocument.removeEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.removeEventListener("mousemove",h),this._domElement.ownerDocument.removeEventListener("pointerup",d),this._domElement.ownerDocument.removeEventListener("mouseup",E),this._domElement.ownerDocument.removeEventListener("pointerlockchange",R),this._domElement.ownerDocument.removeEventListener("pointerlockerror",A))},this.cancel=()=>{this._state!==N.NONE&&(this._state=N.NONE,this._activePointers.length=0,f())},e&&this.connect(e),this.update(0)}get camera(){return this._camera}set camera(t){this._camera=t,this.updateCameraUp(),this._camera.updateProjectionMatrix(),this._updateNearPlaneCorners(),this._needsUpdate=!0}get enabled(){return this._enabled}set enabled(t){this._enabled=t,this._domElement&&(t?(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(t){this._spherical.radius===t&&this._sphericalEnd.radius===t||(this._spherical.radius=t,this._sphericalEnd.radius=t,this._needsUpdate=!0)}get azimuthAngle(){return this._spherical.theta}set azimuthAngle(t){this._spherical.theta===t&&this._sphericalEnd.theta===t||(this._spherical.theta=t,this._sphericalEnd.theta=t,this._needsUpdate=!0)}get polarAngle(){return this._spherical.phi}set polarAngle(t){this._spherical.phi===t&&this._sphericalEnd.phi===t||(this._spherical.phi=t,this._sphericalEnd.phi=t,this._needsUpdate=!0)}get boundaryEnclosesCamera(){return this._boundaryEnclosesCamera}set boundaryEnclosesCamera(t){this._boundaryEnclosesCamera=t,this._needsUpdate=!0}set interactiveArea(t){this._interactiveArea.width=mt(t.width,0,1),this._interactiveArea.height=mt(t.height,0,1),this._interactiveArea.x=mt(t.x,0,1-this._interactiveArea.width),this._interactiveArea.y=mt(t.y,0,1-this._interactiveArea.height)}addEventListener(t,e){super.addEventListener(t,e)}removeEventListener(t,e){super.removeEventListener(t,e)}rotate(t,e,s=!1){return this.rotateTo(this._sphericalEnd.theta+t,this._sphericalEnd.phi+e,s)}rotateAzimuthTo(t,e=!1){return this.rotateTo(t,this._sphericalEnd.phi,e)}rotatePolarTo(t,e=!1){return this.rotateTo(this._sphericalEnd.theta,t,e)}rotateTo(t,e,s=!1){this._isUserControllingRotate=!1;const i=mt(t,this.minAzimuthAngle,this.maxAzimuthAngle),n=mt(e,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 o=!s||V(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&V(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold);return this._createOnRestPromise(o)}dolly(t,e=!1){return this.dollyTo(this._sphericalEnd.radius-t,e)}dollyTo(t,e=!1){return this._isUserControllingDolly=!1,this._lastDollyDirection=ce.NONE,this._changedDolly=0,this._dollyToNoClamp(mt(t,this.minDistance,this.maxDistance),e)}_dollyToNoClamp(t,e=!1){const s=this._sphericalEnd.radius;if(this.colliderMeshes.length>=1){const n=this._collisionTest(),o=V(n,this._spherical.radius);if(!(s>t)&&o)return Promise.resolve();this._sphericalEnd.radius=Math.min(t,n)}else this._sphericalEnd.radius=t;this._needsUpdate=!0,e||(this._spherical.radius=this._sphericalEnd.radius);const i=!e||V(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(i)}dollyInFixed(t,e=!1){this._targetEnd.add(this._getCameraDirection(De).multiplyScalar(t)),e||this._target.copy(this._targetEnd);const s=!e||V(this._target.x,this._targetEnd.x,this.restThreshold)&&V(this._target.y,this._targetEnd.y,this.restThreshold)&&V(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(s)}zoom(t,e=!1){return this.zoomTo(this._zoomEnd+t,e)}zoomTo(t,e=!1){this._isUserControllingZoom=!1,this._zoomEnd=mt(t,this.minZoom,this.maxZoom),this._needsUpdate=!0,e||(this._zoom=this._zoomEnd);const s=!e||V(this._zoom,this._zoomEnd,this.restThreshold);return this._changedZoom=0,this._createOnRestPromise(s)}pan(t,e,s=!1){return console.warn("`pan` has been renamed to `truck`"),this.truck(t,e,s)}truck(t,e,s=!1){this._camera.updateMatrix(),Ot.setFromMatrixColumn(this._camera.matrix,0),_t.setFromMatrixColumn(this._camera.matrix,1),Ot.multiplyScalar(t),_t.multiplyScalar(-e);const i=B.copy(Ot).add(_t),n=G.copy(this._targetEnd).add(i);return this.moveTo(n.x,n.y,n.z,s)}forward(t,e=!1){B.setFromMatrixColumn(this._camera.matrix,0),B.crossVectors(this._camera.up,B),B.multiplyScalar(t);const s=G.copy(this._targetEnd).add(B);return this.moveTo(s.x,s.y,s.z,e)}elevate(t,e=!1){return B.copy(this._camera.up).multiplyScalar(t),this.moveTo(this._targetEnd.x+B.x,this._targetEnd.y+B.y,this._targetEnd.z+B.z,e)}moveTo(t,e,s,i=!1){this._isUserControllingTruck=!1;const n=B.set(t,e,s).sub(this._targetEnd);this._encloseToBoundary(this._targetEnd,n,this.boundaryFriction),this._needsUpdate=!0,i||this._target.copy(this._targetEnd);const o=!i||V(this._target.x,this._targetEnd.x,this.restThreshold)&&V(this._target.y,this._targetEnd.y,this.restThreshold)&&V(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(o)}lookInDirectionOf(t,e,s,i=!1){const n=B.set(t,e,s).sub(this._targetEnd).normalize().multiplyScalar(-this._sphericalEnd.radius);return this.setPosition(n.x,n.y,n.z,i)}fitToBox(t,e,{cover:s=!1,paddingLeft:i=0,paddingRight:n=0,paddingBottom:o=0,paddingTop:r=0}={}){const a=[],h=t.isBox3?Ee.copy(t):Ee.setFromObject(t);h.isEmpty()&&(console.warn("camera-controls: fitTo() cannot be used with an empty box. Aborting"),Promise.resolve());const d=dn(this._sphericalEnd.theta,ln),E=dn(this._sphericalEnd.phi,ln);a.push(this.rotateTo(d,E,e));const l=B.setFromSpherical(this._sphericalEnd).normalize(),u=Tn.setFromUnitVectors(l,Zs),C=V(Math.abs(l.y),1);C&&u.multiply(js.setFromAxisAngle(Es,d)),u.multiply(this._yAxisUpSpaceInverse);const T=Cn.makeEmpty();G.copy(h.min).applyQuaternion(u),T.expandByPoint(G),G.copy(h.min).setX(h.max.x).applyQuaternion(u),T.expandByPoint(G),G.copy(h.min).setY(h.max.y).applyQuaternion(u),T.expandByPoint(G),G.copy(h.max).setZ(h.min.z).applyQuaternion(u),T.expandByPoint(G),G.copy(h.min).setZ(h.max.z).applyQuaternion(u),T.expandByPoint(G),G.copy(h.max).setY(h.min.y).applyQuaternion(u),T.expandByPoint(G),G.copy(h.max).setX(h.min.x).applyQuaternion(u),T.expandByPoint(G),G.copy(h.max).applyQuaternion(u),T.expandByPoint(G),T.min.x-=i,T.min.y-=o,T.max.x+=n,T.max.y+=r,u.setFromUnitVectors(Zs,l),C&&u.premultiply(js.invert()),u.premultiply(this._yAxisUpSpace);const m=T.getSize(B),f=T.getCenter(G).applyQuaternion(u);if(Ht(this._camera)){const R=this.getDistanceToFitBox(m.x,m.y,m.z,s);a.push(this.moveTo(f.x,f.y,f.z,e)),a.push(this.dollyTo(R,e)),a.push(this.setFocalOffset(0,0,0,e))}else if(vt(this._camera)){const R=this._camera,A=R.right-R.left,p=R.top-R.bottom,F=s?Math.max(A/m.x,p/m.y):Math.min(A/m.x,p/m.y);a.push(this.moveTo(f.x,f.y,f.z,e)),a.push(this.zoomTo(F,e)),a.push(this.setFocalOffset(0,0,0,e))}return Promise.all(a)}fitToSphere(t,e){const s=[],i=t instanceof v.Sphere?Qs.copy(t):ot.createBoundingSphere(t,Qs);if(s.push(this.moveTo(i.center.x,i.center.y,i.center.z,e)),Ht(this._camera)){const n=this.getDistanceToFitSphere(i.radius);s.push(this.dollyTo(n,e))}else if(vt(this._camera)){const n=this._camera.right-this._camera.left,o=this._camera.top-this._camera.bottom,r=2*i.radius,a=Math.min(n/r,o/r);s.push(this.zoomTo(a,e))}return s.push(this.setFocalOffset(0,0,0,e)),Promise.all(s)}setLookAt(t,e,s,i,n,o,r=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=ce.NONE,this._changedDolly=0;const a=G.set(i,n,o),h=B.set(t,e,s);this._targetEnd.copy(a),this._sphericalEnd.setFromVector3(h.sub(a).applyQuaternion(this._yAxisUpSpace)),this.normalizeRotations(),this._needsUpdate=!0,r||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));const d=!r||V(this._target.x,this._targetEnd.x,this.restThreshold)&&V(this._target.y,this._targetEnd.y,this.restThreshold)&&V(this._target.z,this._targetEnd.z,this.restThreshold)&&V(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&V(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&V(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(d)}lerpLookAt(t,e,s,i,n,o,r,a,h,d,E,l,u,C=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=ce.NONE,this._changedDolly=0;const T=B.set(i,n,o),m=G.set(t,e,s);dt.setFromVector3(m.sub(T).applyQuaternion(this._yAxisUpSpace));const f=de.set(d,E,l),R=G.set(r,a,h);Ue.setFromVector3(R.sub(f).applyQuaternion(this._yAxisUpSpace)),this._targetEnd.copy(T.lerp(f,u));const A=Ue.theta-dt.theta,p=Ue.phi-dt.phi,F=Ue.radius-dt.radius;this._sphericalEnd.set(dt.radius+F*u,dt.phi+p*u,dt.theta+A*u),this.normalizeRotations(),this._needsUpdate=!0,C||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));const g=!C||V(this._target.x,this._targetEnd.x,this.restThreshold)&&V(this._target.y,this._targetEnd.y,this.restThreshold)&&V(this._target.z,this._targetEnd.z,this.restThreshold)&&V(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&V(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&V(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(g)}setPosition(t,e,s,i=!1){return this.setLookAt(t,e,s,this._targetEnd.x,this._targetEnd.y,this._targetEnd.z,i)}setTarget(t,e,s,i=!1){const n=this.getPosition(B),o=this.setLookAt(n.x,n.y,n.z,t,e,s,i);return this._sphericalEnd.phi=mt(this._sphericalEnd.phi,this.minPolarAngle,this.maxPolarAngle),o}setFocalOffset(t,e,s,i=!1){this._isUserControllingOffset=!1,this._focalOffsetEnd.set(t,e,s),this._needsUpdate=!0,i||this._focalOffset.copy(this._focalOffsetEnd);const n=!i||V(this._focalOffset.x,this._focalOffsetEnd.x,this.restThreshold)&&V(this._focalOffset.y,this._focalOffsetEnd.y,this.restThreshold)&&V(this._focalOffset.z,this._focalOffsetEnd.z,this.restThreshold);return this._createOnRestPromise(n)}setOrbitPoint(t,e,s){this._camera.updateMatrixWorld(),Ot.setFromMatrixColumn(this._camera.matrixWorldInverse,0),_t.setFromMatrixColumn(this._camera.matrixWorldInverse,1),Wt.setFromMatrixColumn(this._camera.matrixWorldInverse,2);const i=B.set(t,e,s),n=i.distanceTo(this._camera.position),o=i.sub(this._camera.position);Ot.multiplyScalar(o.x),_t.multiplyScalar(o.y),Wt.multiplyScalar(o.z),B.copy(Ot).add(_t).add(Wt),B.z=B.z+n,this.dollyTo(n,!1),this.setFocalOffset(-B.x,B.y,-B.z,!1),this.moveTo(t,e,s,!1)}setBoundary(t){if(!t){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(t),this._boundary.clampPoint(this._targetEnd,this._targetEnd),this._needsUpdate=!0}setViewport(t,e,s,i){if(t===null){this._viewport=null;return}this._viewport=this._viewport||new v.Vector4,typeof t=="number"?this._viewport.set(t,e,s,i):this._viewport.copy(t)}getDistanceToFitBox(t,e,s,i=!1){if(ks(this._camera,"getDistanceToFitBox"))return this._spherical.radius;const n=t/e,o=this._camera.getEffectiveFOV()*Le,r=this._camera.aspect;return((i?n>r:ne.pointerId===t)}_findPointerByMouseButton(t){return this._activePointers.find(e=>e.mouseButton===t)}_disposePointer(t){this._activePointers.splice(this._activePointers.indexOf(t),1)}_encloseToBoundary(t,e,s){const i=e.lengthSq();if(i===0)return t;const n=G.copy(e).add(t),o=this._boundary.clampPoint(n,de).sub(n),r=o.lengthSq();if(r===0)return t.add(e);if(r===i)return t;if(s===0)return t.add(e).add(o);{const a=1+s*r/e.dot(o);return t.add(G.copy(e).multiplyScalar(a)).add(o.multiplyScalar(1-s))}}_updateNearPlaneCorners(){if(Ht(this._camera)){const t=this._camera,e=t.near,s=t.getEffectiveFOV()*Le,i=Math.tan(s*.5)*e,n=i*t.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(vt(this._camera)){const t=this._camera,e=1/t.zoom,s=t.left*e,i=t.right*e,n=t.top*e,o=t.bottom*e;this._nearPlaneCorners[0].set(s,n,0),this._nearPlaneCorners[1].set(i,n,0),this._nearPlaneCorners[2].set(i,o,0),this._nearPlaneCorners[3].set(s,o,0)}}_collisionTest(){let t=1/0;if(!(this.colliderMeshes.length>=1)||ks(this._camera,"_collisionTest"))return t;const e=this._getTargetDirection(De);qs.lookAt(un,e,this._camera.up);for(let s=0;s<4;s++){const i=G.copy(this._nearPlaneCorners[s]);i.applyMatrix4(qs);const n=de.addVectors(this._target,i);us.set(n,e),us.far=this._spherical.radius+1;const o=us.intersectObjects(this.colliderMeshes);o.length!==0&&o[0].distance{const s=()=>{this.removeEventListener("rest",s),e()};this.addEventListener("rest",s)}))}_addAllEventListeners(t){}_removeAllEventListeners(){}get dampingFactor(){return console.warn(".dampingFactor has been deprecated. use smoothTime (in seconds) instead."),0}set dampingFactor(t){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(t){console.warn(".draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead.")}static createBoundingSphere(t,e=new v.Sphere){const s=e,i=s.center;Ee.makeEmpty(),t.traverseVisible(o=>{o.isMesh&&Ee.expandByObject(o)}),Ee.getCenter(i);let n=0;return t.traverseVisible(o=>{if(!o.isMesh)return;const r=o,a=r.geometry.clone();a.applyMatrix4(r.matrixWorld);const h=a.attributes.position;for(let d=0,E=h.count;d{var e;if(!(!this.currentWorld||!this.currentWorld.renderer)){if(this.three instanceof Ti){this.onAspectUpdated.trigger();return}if((e=this.currentWorld.renderer)!=null&&e.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:e,world:s})=>{if(e==="added"){const i=this.newCameraControls();this._allControls.set(s.uuid,i)}if(e==="removed"){const i=this._allControls.get(s.uuid);i&&(i.dispose(),this._allControls.delete(s.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,e]of this._allControls)e.dispose()}update(t){this.enabled&&(this.onBeforeUpdate.trigger(this),this.controls.update(t),this.onAfterUpdate.trigger(this))}setupCamera(){const t=window.innerWidth/window.innerHeight,e=new wo(60,t,1,1e3);return e.position.set(50,50,50),e.lookAt(new O(0,0,0)),e}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!");ot.install({THREE:Ve.getSubsetOfThree()});const{domElement:t}=this.currentWorld.renderer.three,e=new ot(this.three,t);return e.smoothTime=.2,e.dollyToCursor=!0,e.infinityDolly=!0,e.minDistance=6,e}setupEvents(t){t?window.addEventListener("resize",this.updateAspect):window.removeEventListener("resize",this.updateAspect)}static getSubsetOfThree(){return{MOUSE:Lo,Vector2:At,Vector3:O,Vector4:Po,Quaternion:Rt,Matrix4:H,Spherical:Mo,Box3:st,Sphere:Os,Raycaster:pi,MathUtils:_n}}}const kn=class Zn extends J{constructor(t){super(t),I(this,"onAfterUpdate",new M),I(this,"onBeforeUpdate",new M),I(this,"onDisposed",new M),I(this,"onWorldCreated",new M),I(this,"onWorldDeleted",new M),I(this,"list",new Map),I(this,"enabled",!0),t.add(Zn.uuid,this)}create(){const t=new Na(this.components),e=t.uuid;if(this.list.has(e))throw new Error("There is already a world with this name!");return this.list.set(e,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 e=t.uuid;this.list.delete(t.uuid),t.dispose(),this.onWorldDeleted.trigger(e)}dispose(){this.enabled=!1;for(const[t,e]of this.list)e.dispose();this.list.clear(),this.onDisposed.trigger()}update(t){if(this.enabled)for(const[e,s]of this.list)s.update(t)}};I(kn,"uuid","fdb61dc4-2ec1-4966-b83d-54ea795fad4a");let Ma=kn;class Da{constructor(t,e,s){I(this,"onDisposed",new M),I(this,"world"),I(this,"components"),I(this,"three"),I(this,"_fade",3),I(this,"updateZoom",()=>{this.world.camera instanceof Ve&&(this.material.uniforms.uZoom.value=this.world.camera.three.zoom)}),this.world=e;const{color:i,size1:n,size2:o,distance:r}=s;this.components=t;const a=new _i(2,2,1,1),h=new Yo({side:He,uniforms:{uSize1:{value:n},uSize2:{value:o},uColor:{value:i},uDistance:{value:r},uFade:{value:this._fade},uZoom:{value:1}},transparent:!0,vertexShader:` + */const b={LEFT:1,RIGHT:2,MIDDLE:4},N=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}),ce={NONE:0,IN:1,OUT:-1};function Ht(c){return c.isPerspectiveCamera}function vt(c){return c.isOrthographicCamera}const le=Math.PI*2,dn=Math.PI/2,Zn=1e-5,Pe=Math.PI/180;function mt(c,t,e){return Math.max(t,Math.min(e,c))}function k(c,t=Zn){return Math.abs(c)0==u>d&&(u=d,e.value=(u-d)/n),u}function un(c,t,e,s,i=1/0,n,o){s=Math.max(1e-4,s);const r=2/s,a=r*n,h=1/(1+a+.48*a*a+.235*a*a*a);let d=t.x,E=t.y,l=t.z,u=c.x-d,C=c.y-E,T=c.z-l;const m=d,f=E,R=l,A=i*s,p=A*A,F=u*u+C*C+T*T;if(F>p){const Y=Math.sqrt(F);u=u/Y*A,C=C/Y*A,T=T/Y*A}d=c.x-u,E=c.y-C,l=c.z-T;const g=(e.x+r*u)*n,_=(e.y+r*C)*n,S=(e.z+r*T)*n;e.x=(e.x-r*g)*h,e.y=(e.y-r*_)*h,e.z=(e.z-r*S)*h,o.x=d+(u+g)*h,o.y=E+(C+_)*h,o.z=l+(T+S)*h;const y=m-c.x,w=f-c.y,P=R-c.z,L=o.x-m,D=o.y-f,x=o.z-R;return y*L+w*D+P*x>0&&(o.x=m,o.y=f,o.z=R,e.x=(o.x-m)/n,e.y=(o.y-f)/n,e.z=(o.z-R)/n),o}function Xs(c,t){t.set(0,0),c.forEach(e=>{t.x+=e.clientX,t.y+=e.clientY}),t.x/=c.length,t.y/=c.length}function ks(c,t){return vt(c)?(console.warn(`${t} is not supported in OrthographicCamera`),!0):!1}class Pa{constructor(){this._listeners={}}addEventListener(t,e){const s=this._listeners;s[t]===void 0&&(s[t]=[]),s[t].indexOf(e)===-1&&s[t].push(e)}hasEventListener(t,e){const s=this._listeners;return s[t]!==void 0&&s[t].indexOf(e)!==-1}removeEventListener(t,e){const s=this._listeners[t];if(s!==void 0){const i=s.indexOf(e);i!==-1&&s.splice(i,1)}}removeAllEventListeners(t){if(!t){this._listeners={};return}Array.isArray(this._listeners[t])&&(this._listeners[t].length=0)}dispatchEvent(t){const e=this._listeners[t.type];if(e!==void 0){t.target=this;const s=e.slice(0);for(let i=0,n=s.length;i{},this._enabled=!0,this._state=N.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=ce.NONE,this._thetaVelocity={value:0},this._phiVelocity={value:0},this._radiusVelocity={value:0},this._targetVelocity=new v.Vector3,this._focalOffsetVelocity=new v.Vector3,this._zoomVelocity={value:0},this._truckInternal=(p,F,g)=>{let _,S;if(Ht(this._camera)){const y=B.copy(this._camera.position).sub(this._target),w=this._camera.getEffectiveFOV()*Pe,P=y.length()*Math.tan(w*.5);_=this.truckSpeed*p*P/this._elementRect.height,S=this.truckSpeed*F*P/this._elementRect.height}else if(vt(this._camera)){const y=this._camera;_=p*(y.right-y.left)/y.zoom/this._elementRect.width,S=F*(y.top-y.bottom)/y.zoom/this._elementRect.height}else return;this.verticalDragToForward?(g?this.setFocalOffset(this._focalOffsetEnd.x+_,this._focalOffsetEnd.y,this._focalOffsetEnd.z,!0):this.truck(_,0,!0),this.forward(-S,!0)):g?this.setFocalOffset(this._focalOffsetEnd.x+_,this._focalOffsetEnd.y+S,this._focalOffsetEnd.z,!0):this.truck(_,S,!0)},this._rotateInternal=(p,F)=>{const g=le*this.azimuthRotateSpeed*p/this._elementRect.height,_=le*this.polarRotateSpeed*F/this._elementRect.height;this.rotate(g,_,!0)},this._dollyInternal=(p,F,g)=>{const _=Math.pow(.95,-p*this.dollySpeed),S=this._sphericalEnd.radius,y=this._sphericalEnd.radius*_,w=mt(y,this.minDistance,this.maxDistance),P=w-y;this.infinityDolly&&this.dollyToCursor?this._dollyToNoClamp(y,!0):this.infinityDolly&&!this.dollyToCursor?(this.dollyInFixed(P,!0),this._dollyToNoClamp(w,!0)):this._dollyToNoClamp(w,!0),this.dollyToCursor&&(this._changedDolly+=(this.infinityDolly?y:w)-S,this._dollyControlCoord.set(F,g)),this._lastDollyDirection=Math.sign(-p)},this._zoomInternal=(p,F,g)=>{const _=Math.pow(.95,p*this.dollySpeed),S=this._zoom,y=this._zoom*_;this.zoomTo(y,!0),this.dollyToCursor&&(this._changedZoom+=y-S,this._dollyControlCoord.set(F,g))},typeof v>"u"&&console.error("camera-controls: `THREE` is undefined. You must first run `CameraControls.install( { THREE: THREE } )`. Check the docs for further information."),this._camera=t,this._yAxisUpSpace=new v.Quaternion().setFromUnitVectors(this._camera.up,Es),this._yAxisUpSpaceInverse=this._yAxisUpSpace.clone().invert(),this._state=N.NONE,this._target=new v.Vector3,this._targetEnd=this._target.clone(),this._focalOffset=new v.Vector3,this._focalOffsetEnd=this._focalOffset.clone(),this._spherical=new v.Spherical().setFromVector3(B.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 v.Vector3,new v.Vector3,new v.Vector3,new v.Vector3],this._updateNearPlaneCorners(),this._boundary=new v.Box3(new v.Vector3(-1/0,-1/0,-1/0),new v.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 v.Vector2,this.mouseButtons={left:N.ROTATE,middle:N.DOLLY,right:N.TRUCK,wheel:Ht(this._camera)?N.DOLLY:vt(this._camera)?N.ZOOM:N.NONE},this.touches={one:N.TOUCH_ROTATE,two:Ht(this._camera)?N.TOUCH_DOLLY_TRUCK:vt(this._camera)?N.TOUCH_ZOOM_TRUCK:N.NONE,three:N.TOUCH_TRUCK};const s=new v.Vector2,i=new v.Vector2,n=new v.Vector2,o=p=>{if(!this._enabled||!this._domElement)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const _=this._domElement.getBoundingClientRect(),S=p.clientX/_.width,y=p.clientY/_.height;if(Sthis._interactiveArea.right||ythis._interactiveArea.bottom)return}const F=p.pointerType!=="mouse"?null:(p.buttons&b.LEFT)===b.LEFT?b.LEFT:(p.buttons&b.MIDDLE)===b.MIDDLE?b.MIDDLE:(p.buttons&b.RIGHT)===b.RIGHT?b.RIGHT:null;if(F!==null){const _=this._findPointerByMouseButton(F);_&&this._disposePointer(_)}if((p.buttons&b.LEFT)===b.LEFT&&this._lockedPointer)return;const g={pointerId:p.pointerId,clientX:p.clientX,clientY:p.clientY,deltaX:0,deltaY:0,mouseButton:F};this._activePointers.push(g),this._domElement.ownerDocument.removeEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",d),this._domElement.ownerDocument.addEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.addEventListener("pointerup",d),this._isDragging=!0,T(p)},r=p=>{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 _=this._domElement.getBoundingClientRect(),S=p.clientX/_.width,y=p.clientY/_.height;if(Sthis._interactiveArea.right||ythis._interactiveArea.bottom)return}const F=(p.buttons&b.LEFT)===b.LEFT?b.LEFT:(p.buttons&b.MIDDLE)===b.MIDDLE?b.MIDDLE:(p.buttons&b.RIGHT)===b.RIGHT?b.RIGHT:null;if(F!==null){const _=this._findPointerByMouseButton(F);_&&this._disposePointer(_)}const g={pointerId:1,clientX:p.clientX,clientY:p.clientY,deltaX:0,deltaY:0,mouseButton:(p.buttons&b.LEFT)===b.LEFT?b.LEFT:(p.buttons&b.MIDDLE)===b.LEFT?b.MIDDLE:(p.buttons&b.RIGHT)===b.LEFT?b.RIGHT:null};this._activePointers.push(g),this._domElement.ownerDocument.removeEventListener("mousemove",h),this._domElement.ownerDocument.removeEventListener("mouseup",E),this._domElement.ownerDocument.addEventListener("mousemove",h),this._domElement.ownerDocument.addEventListener("mouseup",E),this._isDragging=!0,T(p)},a=p=>{p.cancelable&&p.preventDefault();const F=p.pointerId,g=this._lockedPointer||this._findPointerById(F);if(g){if(g.clientX=p.clientX,g.clientY=p.clientY,g.deltaX=p.movementX,g.deltaY=p.movementY,this._state=0,p.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&&(p.buttons&b.LEFT)===b.LEFT)&&(this._state=this._state|this.mouseButtons.left),this._isDragging&&(p.buttons&b.MIDDLE)===b.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),this._isDragging&&(p.buttons&b.RIGHT)===b.RIGHT&&(this._state=this._state|this.mouseButtons.right);m()}},h=p=>{const F=this._lockedPointer||this._findPointerById(1);F&&(F.clientX=p.clientX,F.clientY=p.clientY,F.deltaX=p.movementX,F.deltaY=p.movementY,this._state=0,(this._lockedPointer||(p.buttons&b.LEFT)===b.LEFT)&&(this._state=this._state|this.mouseButtons.left),(p.buttons&b.MIDDLE)===b.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),(p.buttons&b.RIGHT)===b.RIGHT&&(this._state=this._state|this.mouseButtons.right),m())},d=p=>{const F=this._findPointerById(p.pointerId);if(!(F&&F===this._lockedPointer)){if(F&&this._disposePointer(F),p.pointerType==="touch")switch(this._activePointers.length){case 0:this._state=N.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=N.NONE;f()}},E=()=>{const p=this._findPointerById(1);p&&p===this._lockedPointer||(p&&this._disposePointer(p),this._state=N.NONE,f())};let l=-1;const u=p=>{if(!this._domElement||!this._enabled||this.mouseButtons.wheel===N.NONE)return;if(this._interactiveArea.left!==0||this._interactiveArea.top!==0||this._interactiveArea.width!==1||this._interactiveArea.height!==1){const y=this._domElement.getBoundingClientRect(),w=p.clientX/y.width,P=p.clientY/y.height;if(wthis._interactiveArea.right||Pthis._interactiveArea.bottom)return}if(p.preventDefault(),this.dollyToCursor||this.mouseButtons.wheel===N.ROTATE||this.mouseButtons.wheel===N.TRUCK){const y=performance.now();l-y<1e3&&this._getClientRect(this._elementRect),l=y}const F=Ma?-1:-3,g=p.deltaMode===1?p.deltaY/F:p.deltaY/(F*10),_=this.dollyToCursor?(p.clientX-this._elementRect.x)/this._elementRect.width*2-1:0,S=this.dollyToCursor?(p.clientY-this._elementRect.y)/this._elementRect.height*-2+1:0;switch(this.mouseButtons.wheel){case N.ROTATE:{this._rotateInternal(p.deltaX,p.deltaY),this._isUserControllingRotate=!0;break}case N.TRUCK:{this._truckInternal(p.deltaX,p.deltaY,!1),this._isUserControllingTruck=!0;break}case N.OFFSET:{this._truckInternal(p.deltaX,p.deltaY,!0),this._isUserControllingOffset=!0;break}case N.DOLLY:{this._dollyInternal(-g,_,S),this._isUserControllingDolly=!0;break}case N.ZOOM:{this._zoomInternal(-g,_,S),this._isUserControllingZoom=!0;break}}this.dispatchEvent({type:"control"})},C=p=>{if(!(!this._domElement||!this._enabled)){if(this.mouseButtons.right===ot.ACTION.NONE){const F=p instanceof PointerEvent?p.pointerId:0,g=this._findPointerById(F);g&&this._disposePointer(g),this._domElement.ownerDocument.removeEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.removeEventListener("pointerup",d),this._domElement.ownerDocument.removeEventListener("mousemove",h),this._domElement.ownerDocument.removeEventListener("mouseup",E);return}p.preventDefault()}},T=p=>{if(this._enabled){if(Xs(this._activePointers,ht),this._getClientRect(this._elementRect),s.copy(ht),i.copy(ht),this._activePointers.length>=2){const F=ht.x-this._activePointers[1].clientX,g=ht.y-this._activePointers[1].clientY,_=Math.sqrt(F*F+g*g);n.set(0,_);const S=(this._activePointers[0].clientX+this._activePointers[1].clientX)*.5,y=(this._activePointers[0].clientY+this._activePointers[1].clientY)*.5;i.set(S,y)}if(this._state=0,!p)this._lockedPointer&&(this._state=this._state|this.mouseButtons.left);else if("pointerType"in p&&p.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&&(p.buttons&b.LEFT)===b.LEFT&&(this._state=this._state|this.mouseButtons.left),(p.buttons&b.MIDDLE)===b.MIDDLE&&(this._state=this._state|this.mouseButtons.middle),(p.buttons&b.RIGHT)===b.RIGHT&&(this._state=this._state|this.mouseButtons.right);((this._state&N.ROTATE)===N.ROTATE||(this._state&N.TOUCH_ROTATE)===N.TOUCH_ROTATE||(this._state&N.TOUCH_DOLLY_ROTATE)===N.TOUCH_DOLLY_ROTATE||(this._state&N.TOUCH_ZOOM_ROTATE)===N.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&N.TRUCK)===N.TRUCK||(this._state&N.TOUCH_TRUCK)===N.TOUCH_TRUCK||(this._state&N.TOUCH_DOLLY_TRUCK)===N.TOUCH_DOLLY_TRUCK||(this._state&N.TOUCH_ZOOM_TRUCK)===N.TOUCH_ZOOM_TRUCK)&&(this._targetEnd.copy(this._target),this._targetVelocity.set(0,0,0)),((this._state&N.DOLLY)===N.DOLLY||(this._state&N.TOUCH_DOLLY)===N.TOUCH_DOLLY||(this._state&N.TOUCH_DOLLY_TRUCK)===N.TOUCH_DOLLY_TRUCK||(this._state&N.TOUCH_DOLLY_OFFSET)===N.TOUCH_DOLLY_OFFSET||(this._state&N.TOUCH_DOLLY_ROTATE)===N.TOUCH_DOLLY_ROTATE)&&(this._sphericalEnd.radius=this._spherical.radius,this._radiusVelocity.value=0),((this._state&N.ZOOM)===N.ZOOM||(this._state&N.TOUCH_ZOOM)===N.TOUCH_ZOOM||(this._state&N.TOUCH_ZOOM_TRUCK)===N.TOUCH_ZOOM_TRUCK||(this._state&N.TOUCH_ZOOM_OFFSET)===N.TOUCH_ZOOM_OFFSET||(this._state&N.TOUCH_ZOOM_ROTATE)===N.TOUCH_ZOOM_ROTATE)&&(this._zoomEnd=this._zoom,this._zoomVelocity.value=0),((this._state&N.OFFSET)===N.OFFSET||(this._state&N.TOUCH_OFFSET)===N.TOUCH_OFFSET||(this._state&N.TOUCH_DOLLY_OFFSET)===N.TOUCH_DOLLY_OFFSET||(this._state&N.TOUCH_ZOOM_OFFSET)===N.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,Xs(this._activePointers,ht);const p=this._domElement&&document.pointerLockElement===this._domElement?this._lockedPointer||this._activePointers[0]:null,F=p?-p.deltaX:i.x-ht.x,g=p?-p.deltaY:i.y-ht.y;if(i.copy(ht),((this._state&N.ROTATE)===N.ROTATE||(this._state&N.TOUCH_ROTATE)===N.TOUCH_ROTATE||(this._state&N.TOUCH_DOLLY_ROTATE)===N.TOUCH_DOLLY_ROTATE||(this._state&N.TOUCH_ZOOM_ROTATE)===N.TOUCH_ZOOM_ROTATE)&&(this._rotateInternal(F,g),this._isUserControllingRotate=!0),(this._state&N.DOLLY)===N.DOLLY||(this._state&N.ZOOM)===N.ZOOM){const _=this.dollyToCursor?(s.x-this._elementRect.x)/this._elementRect.width*2-1:0,S=this.dollyToCursor?(s.y-this._elementRect.y)/this._elementRect.height*-2+1:0,y=this.dollyDragInverted?-1:1;(this._state&N.DOLLY)===N.DOLLY?(this._dollyInternal(y*g*ds,_,S),this._isUserControllingDolly=!0):(this._zoomInternal(y*g*ds,_,S),this._isUserControllingZoom=!0)}if((this._state&N.TOUCH_DOLLY)===N.TOUCH_DOLLY||(this._state&N.TOUCH_ZOOM)===N.TOUCH_ZOOM||(this._state&N.TOUCH_DOLLY_TRUCK)===N.TOUCH_DOLLY_TRUCK||(this._state&N.TOUCH_ZOOM_TRUCK)===N.TOUCH_ZOOM_TRUCK||(this._state&N.TOUCH_DOLLY_OFFSET)===N.TOUCH_DOLLY_OFFSET||(this._state&N.TOUCH_ZOOM_OFFSET)===N.TOUCH_ZOOM_OFFSET||(this._state&N.TOUCH_DOLLY_ROTATE)===N.TOUCH_DOLLY_ROTATE||(this._state&N.TOUCH_ZOOM_ROTATE)===N.TOUCH_ZOOM_ROTATE){const _=ht.x-this._activePointers[1].clientX,S=ht.y-this._activePointers[1].clientY,y=Math.sqrt(_*_+S*S),w=n.y-y;n.set(0,y);const P=this.dollyToCursor?(i.x-this._elementRect.x)/this._elementRect.width*2-1:0,L=this.dollyToCursor?(i.y-this._elementRect.y)/this._elementRect.height*-2+1:0;(this._state&N.TOUCH_DOLLY)===N.TOUCH_DOLLY||(this._state&N.TOUCH_DOLLY_ROTATE)===N.TOUCH_DOLLY_ROTATE||(this._state&N.TOUCH_DOLLY_TRUCK)===N.TOUCH_DOLLY_TRUCK||(this._state&N.TOUCH_DOLLY_OFFSET)===N.TOUCH_DOLLY_OFFSET?(this._dollyInternal(w*ds,P,L),this._isUserControllingDolly=!0):(this._zoomInternal(w*ds,P,L),this._isUserControllingZoom=!0)}((this._state&N.TRUCK)===N.TRUCK||(this._state&N.TOUCH_TRUCK)===N.TOUCH_TRUCK||(this._state&N.TOUCH_DOLLY_TRUCK)===N.TOUCH_DOLLY_TRUCK||(this._state&N.TOUCH_ZOOM_TRUCK)===N.TOUCH_ZOOM_TRUCK)&&(this._truckInternal(F,g,!1),this._isUserControllingTruck=!0),((this._state&N.OFFSET)===N.OFFSET||(this._state&N.TOUCH_OFFSET)===N.TOUCH_OFFSET||(this._state&N.TOUCH_DOLLY_OFFSET)===N.TOUCH_DOLLY_OFFSET||(this._state&N.TOUCH_ZOOM_OFFSET)===N.TOUCH_ZOOM_OFFSET)&&(this._truckInternal(F,g,!0),this._isUserControllingOffset=!0),this.dispatchEvent({type:"control"})},f=()=>{Xs(this._activePointers,ht),i.copy(ht),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",h),this._domElement.ownerDocument.removeEventListener("pointerup",d),this._domElement.ownerDocument.removeEventListener("mouseup",E),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",d),this._domElement.requestPointerLock(),this._domElement.ownerDocument.addEventListener("pointerlockchange",R),this._domElement.ownerDocument.addEventListener("pointerlockerror",A),this._domElement.ownerDocument.addEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.addEventListener("pointerup",d),T())},this.unlockPointer=()=>{this._lockedPointer!==null&&(this._disposePointer(this._lockedPointer),this._lockedPointer=null),document.exitPointerLock(),this.cancel(),this._domElement&&(this._domElement.ownerDocument.removeEventListener("pointerlockchange",R),this._domElement.ownerDocument.removeEventListener("pointerlockerror",A))};const R=()=>{this._domElement&&this._domElement.ownerDocument.pointerLockElement===this._domElement||this.unlockPointer()},A=()=>{this.unlockPointer()};this._addAllEventListeners=p=>{this._domElement=p,this._domElement.style.touchAction="none",this._domElement.style.userSelect="none",this._domElement.style.webkitUserSelect="none",this._domElement.addEventListener("pointerdown",o),Da&&this._domElement.addEventListener("mousedown",r),this._domElement.addEventListener("pointercancel",d),this._domElement.addEventListener("wheel",u,{passive:!1}),this._domElement.addEventListener("contextmenu",C)},this._removeAllEventListeners=()=>{this._domElement&&(this._domElement.style.touchAction="",this._domElement.style.userSelect="",this._domElement.style.webkitUserSelect="",this._domElement.removeEventListener("pointerdown",o),this._domElement.removeEventListener("mousedown",r),this._domElement.removeEventListener("pointercancel",d),this._domElement.removeEventListener("wheel",u,{passive:!1}),this._domElement.removeEventListener("contextmenu",C),this._domElement.ownerDocument.removeEventListener("pointermove",a,{passive:!1}),this._domElement.ownerDocument.removeEventListener("mousemove",h),this._domElement.ownerDocument.removeEventListener("pointerup",d),this._domElement.ownerDocument.removeEventListener("mouseup",E),this._domElement.ownerDocument.removeEventListener("pointerlockchange",R),this._domElement.ownerDocument.removeEventListener("pointerlockerror",A))},this.cancel=()=>{this._state!==N.NONE&&(this._state=N.NONE,this._activePointers.length=0,f())},e&&this.connect(e),this.update(0)}get camera(){return this._camera}set camera(t){this._camera=t,this.updateCameraUp(),this._camera.updateProjectionMatrix(),this._updateNearPlaneCorners(),this._needsUpdate=!0}get enabled(){return this._enabled}set enabled(t){this._enabled=t,this._domElement&&(t?(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(t){this._spherical.radius===t&&this._sphericalEnd.radius===t||(this._spherical.radius=t,this._sphericalEnd.radius=t,this._needsUpdate=!0)}get azimuthAngle(){return this._spherical.theta}set azimuthAngle(t){this._spherical.theta===t&&this._sphericalEnd.theta===t||(this._spherical.theta=t,this._sphericalEnd.theta=t,this._needsUpdate=!0)}get polarAngle(){return this._spherical.phi}set polarAngle(t){this._spherical.phi===t&&this._sphericalEnd.phi===t||(this._spherical.phi=t,this._sphericalEnd.phi=t,this._needsUpdate=!0)}get boundaryEnclosesCamera(){return this._boundaryEnclosesCamera}set boundaryEnclosesCamera(t){this._boundaryEnclosesCamera=t,this._needsUpdate=!0}set interactiveArea(t){this._interactiveArea.width=mt(t.width,0,1),this._interactiveArea.height=mt(t.height,0,1),this._interactiveArea.x=mt(t.x,0,1-this._interactiveArea.width),this._interactiveArea.y=mt(t.y,0,1-this._interactiveArea.height)}addEventListener(t,e){super.addEventListener(t,e)}removeEventListener(t,e){super.removeEventListener(t,e)}rotate(t,e,s=!1){return this.rotateTo(this._sphericalEnd.theta+t,this._sphericalEnd.phi+e,s)}rotateAzimuthTo(t,e=!1){return this.rotateTo(t,this._sphericalEnd.phi,e)}rotatePolarTo(t,e=!1){return this.rotateTo(this._sphericalEnd.theta,t,e)}rotateTo(t,e,s=!1){this._isUserControllingRotate=!1;const i=mt(t,this.minAzimuthAngle,this.maxAzimuthAngle),n=mt(e,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 o=!s||V(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&V(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold);return this._createOnRestPromise(o)}dolly(t,e=!1){return this.dollyTo(this._sphericalEnd.radius-t,e)}dollyTo(t,e=!1){return this._isUserControllingDolly=!1,this._lastDollyDirection=ce.NONE,this._changedDolly=0,this._dollyToNoClamp(mt(t,this.minDistance,this.maxDistance),e)}_dollyToNoClamp(t,e=!1){const s=this._sphericalEnd.radius;if(this.colliderMeshes.length>=1){const n=this._collisionTest(),o=V(n,this._spherical.radius);if(!(s>t)&&o)return Promise.resolve();this._sphericalEnd.radius=Math.min(t,n)}else this._sphericalEnd.radius=t;this._needsUpdate=!0,e||(this._spherical.radius=this._sphericalEnd.radius);const i=!e||V(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(i)}dollyInFixed(t,e=!1){this._targetEnd.add(this._getCameraDirection(De).multiplyScalar(t)),e||this._target.copy(this._targetEnd);const s=!e||V(this._target.x,this._targetEnd.x,this.restThreshold)&&V(this._target.y,this._targetEnd.y,this.restThreshold)&&V(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(s)}zoom(t,e=!1){return this.zoomTo(this._zoomEnd+t,e)}zoomTo(t,e=!1){this._isUserControllingZoom=!1,this._zoomEnd=mt(t,this.minZoom,this.maxZoom),this._needsUpdate=!0,e||(this._zoom=this._zoomEnd);const s=!e||V(this._zoom,this._zoomEnd,this.restThreshold);return this._changedZoom=0,this._createOnRestPromise(s)}pan(t,e,s=!1){return console.warn("`pan` has been renamed to `truck`"),this.truck(t,e,s)}truck(t,e,s=!1){this._camera.updateMatrix(),Ot.setFromMatrixColumn(this._camera.matrix,0),_t.setFromMatrixColumn(this._camera.matrix,1),Ot.multiplyScalar(t),_t.multiplyScalar(-e);const i=B.copy(Ot).add(_t),n=G.copy(this._targetEnd).add(i);return this.moveTo(n.x,n.y,n.z,s)}forward(t,e=!1){B.setFromMatrixColumn(this._camera.matrix,0),B.crossVectors(this._camera.up,B),B.multiplyScalar(t);const s=G.copy(this._targetEnd).add(B);return this.moveTo(s.x,s.y,s.z,e)}elevate(t,e=!1){return B.copy(this._camera.up).multiplyScalar(t),this.moveTo(this._targetEnd.x+B.x,this._targetEnd.y+B.y,this._targetEnd.z+B.z,e)}moveTo(t,e,s,i=!1){this._isUserControllingTruck=!1;const n=B.set(t,e,s).sub(this._targetEnd);this._encloseToBoundary(this._targetEnd,n,this.boundaryFriction),this._needsUpdate=!0,i||this._target.copy(this._targetEnd);const o=!i||V(this._target.x,this._targetEnd.x,this.restThreshold)&&V(this._target.y,this._targetEnd.y,this.restThreshold)&&V(this._target.z,this._targetEnd.z,this.restThreshold);return this._createOnRestPromise(o)}lookInDirectionOf(t,e,s,i=!1){const n=B.set(t,e,s).sub(this._targetEnd).normalize().multiplyScalar(-this._sphericalEnd.radius);return this.setPosition(n.x,n.y,n.z,i)}fitToBox(t,e,{cover:s=!1,paddingLeft:i=0,paddingRight:n=0,paddingBottom:o=0,paddingTop:r=0}={}){const a=[],h=t.isBox3?Ee.copy(t):Ee.setFromObject(t);h.isEmpty()&&(console.warn("camera-controls: fitTo() cannot be used with an empty box. Aborting"),Promise.resolve());const d=En(this._sphericalEnd.theta,dn),E=En(this._sphericalEnd.phi,dn);a.push(this.rotateTo(d,E,e));const l=B.setFromSpherical(this._sphericalEnd).normalize(),u=mn.setFromUnitVectors(l,Zs),C=V(Math.abs(l.y),1);C&&u.multiply(js.setFromAxisAngle(Es,d)),u.multiply(this._yAxisUpSpaceInverse);const T=Tn.makeEmpty();G.copy(h.min).applyQuaternion(u),T.expandByPoint(G),G.copy(h.min).setX(h.max.x).applyQuaternion(u),T.expandByPoint(G),G.copy(h.min).setY(h.max.y).applyQuaternion(u),T.expandByPoint(G),G.copy(h.max).setZ(h.min.z).applyQuaternion(u),T.expandByPoint(G),G.copy(h.min).setZ(h.max.z).applyQuaternion(u),T.expandByPoint(G),G.copy(h.max).setY(h.min.y).applyQuaternion(u),T.expandByPoint(G),G.copy(h.max).setX(h.min.x).applyQuaternion(u),T.expandByPoint(G),G.copy(h.max).applyQuaternion(u),T.expandByPoint(G),T.min.x-=i,T.min.y-=o,T.max.x+=n,T.max.y+=r,u.setFromUnitVectors(Zs,l),C&&u.premultiply(js.invert()),u.premultiply(this._yAxisUpSpace);const m=T.getSize(B),f=T.getCenter(G).applyQuaternion(u);if(Ht(this._camera)){const R=this.getDistanceToFitBox(m.x,m.y,m.z,s);a.push(this.moveTo(f.x,f.y,f.z,e)),a.push(this.dollyTo(R,e)),a.push(this.setFocalOffset(0,0,0,e))}else if(vt(this._camera)){const R=this._camera,A=R.right-R.left,p=R.top-R.bottom,F=s?Math.max(A/m.x,p/m.y):Math.min(A/m.x,p/m.y);a.push(this.moveTo(f.x,f.y,f.z,e)),a.push(this.zoomTo(F,e)),a.push(this.setFocalOffset(0,0,0,e))}return Promise.all(a)}fitToSphere(t,e){const s=[],i=t instanceof v.Sphere?Qs.copy(t):ot.createBoundingSphere(t,Qs);if(s.push(this.moveTo(i.center.x,i.center.y,i.center.z,e)),Ht(this._camera)){const n=this.getDistanceToFitSphere(i.radius);s.push(this.dollyTo(n,e))}else if(vt(this._camera)){const n=this._camera.right-this._camera.left,o=this._camera.top-this._camera.bottom,r=2*i.radius,a=Math.min(n/r,o/r);s.push(this.zoomTo(a,e))}return s.push(this.setFocalOffset(0,0,0,e)),Promise.all(s)}setLookAt(t,e,s,i,n,o,r=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=ce.NONE,this._changedDolly=0;const a=G.set(i,n,o),h=B.set(t,e,s);this._targetEnd.copy(a),this._sphericalEnd.setFromVector3(h.sub(a).applyQuaternion(this._yAxisUpSpace)),this.normalizeRotations(),this._needsUpdate=!0,r||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));const d=!r||V(this._target.x,this._targetEnd.x,this.restThreshold)&&V(this._target.y,this._targetEnd.y,this.restThreshold)&&V(this._target.z,this._targetEnd.z,this.restThreshold)&&V(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&V(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&V(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(d)}lerpLookAt(t,e,s,i,n,o,r,a,h,d,E,l,u,C=!1){this._isUserControllingRotate=!1,this._isUserControllingDolly=!1,this._isUserControllingTruck=!1,this._lastDollyDirection=ce.NONE,this._changedDolly=0;const T=B.set(i,n,o),m=G.set(t,e,s);dt.setFromVector3(m.sub(T).applyQuaternion(this._yAxisUpSpace));const f=de.set(d,E,l),R=G.set(r,a,h);Ue.setFromVector3(R.sub(f).applyQuaternion(this._yAxisUpSpace)),this._targetEnd.copy(T.lerp(f,u));const A=Ue.theta-dt.theta,p=Ue.phi-dt.phi,F=Ue.radius-dt.radius;this._sphericalEnd.set(dt.radius+F*u,dt.phi+p*u,dt.theta+A*u),this.normalizeRotations(),this._needsUpdate=!0,C||(this._target.copy(this._targetEnd),this._spherical.copy(this._sphericalEnd));const g=!C||V(this._target.x,this._targetEnd.x,this.restThreshold)&&V(this._target.y,this._targetEnd.y,this.restThreshold)&&V(this._target.z,this._targetEnd.z,this.restThreshold)&&V(this._spherical.theta,this._sphericalEnd.theta,this.restThreshold)&&V(this._spherical.phi,this._sphericalEnd.phi,this.restThreshold)&&V(this._spherical.radius,this._sphericalEnd.radius,this.restThreshold);return this._createOnRestPromise(g)}setPosition(t,e,s,i=!1){return this.setLookAt(t,e,s,this._targetEnd.x,this._targetEnd.y,this._targetEnd.z,i)}setTarget(t,e,s,i=!1){const n=this.getPosition(B),o=this.setLookAt(n.x,n.y,n.z,t,e,s,i);return this._sphericalEnd.phi=mt(this._sphericalEnd.phi,this.minPolarAngle,this.maxPolarAngle),o}setFocalOffset(t,e,s,i=!1){this._isUserControllingOffset=!1,this._focalOffsetEnd.set(t,e,s),this._needsUpdate=!0,i||this._focalOffset.copy(this._focalOffsetEnd);const n=!i||V(this._focalOffset.x,this._focalOffsetEnd.x,this.restThreshold)&&V(this._focalOffset.y,this._focalOffsetEnd.y,this.restThreshold)&&V(this._focalOffset.z,this._focalOffsetEnd.z,this.restThreshold);return this._createOnRestPromise(n)}setOrbitPoint(t,e,s){this._camera.updateMatrixWorld(),Ot.setFromMatrixColumn(this._camera.matrixWorldInverse,0),_t.setFromMatrixColumn(this._camera.matrixWorldInverse,1),Wt.setFromMatrixColumn(this._camera.matrixWorldInverse,2);const i=B.set(t,e,s),n=i.distanceTo(this._camera.position),o=i.sub(this._camera.position);Ot.multiplyScalar(o.x),_t.multiplyScalar(o.y),Wt.multiplyScalar(o.z),B.copy(Ot).add(_t).add(Wt),B.z=B.z+n,this.dollyTo(n,!1),this.setFocalOffset(-B.x,B.y,-B.z,!1),this.moveTo(t,e,s,!1)}setBoundary(t){if(!t){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(t),this._boundary.clampPoint(this._targetEnd,this._targetEnd),this._needsUpdate=!0}setViewport(t,e,s,i){if(t===null){this._viewport=null;return}this._viewport=this._viewport||new v.Vector4,typeof t=="number"?this._viewport.set(t,e,s,i):this._viewport.copy(t)}getDistanceToFitBox(t,e,s,i=!1){if(ks(this._camera,"getDistanceToFitBox"))return this._spherical.radius;const n=t/e,o=this._camera.getEffectiveFOV()*Pe,r=this._camera.aspect;return((i?n>r:ne.pointerId===t)}_findPointerByMouseButton(t){return this._activePointers.find(e=>e.mouseButton===t)}_disposePointer(t){this._activePointers.splice(this._activePointers.indexOf(t),1)}_encloseToBoundary(t,e,s){const i=e.lengthSq();if(i===0)return t;const n=G.copy(e).add(t),o=this._boundary.clampPoint(n,de).sub(n),r=o.lengthSq();if(r===0)return t.add(e);if(r===i)return t;if(s===0)return t.add(e).add(o);{const a=1+s*r/e.dot(o);return t.add(G.copy(e).multiplyScalar(a)).add(o.multiplyScalar(1-s))}}_updateNearPlaneCorners(){if(Ht(this._camera)){const t=this._camera,e=t.near,s=t.getEffectiveFOV()*Pe,i=Math.tan(s*.5)*e,n=i*t.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(vt(this._camera)){const t=this._camera,e=1/t.zoom,s=t.left*e,i=t.right*e,n=t.top*e,o=t.bottom*e;this._nearPlaneCorners[0].set(s,n,0),this._nearPlaneCorners[1].set(i,n,0),this._nearPlaneCorners[2].set(i,o,0),this._nearPlaneCorners[3].set(s,o,0)}}_collisionTest(){let t=1/0;if(!(this.colliderMeshes.length>=1)||ks(this._camera,"_collisionTest"))return t;const e=this._getTargetDirection(De);qs.lookAt(In,e,this._camera.up);for(let s=0;s<4;s++){const i=G.copy(this._nearPlaneCorners[s]);i.applyMatrix4(qs);const n=de.addVectors(this._target,i);us.set(n,e),us.far=this._spherical.radius+1;const o=us.intersectObjects(this.colliderMeshes);o.length!==0&&o[0].distance{const s=()=>{this.removeEventListener("rest",s),e()};this.addEventListener("rest",s)}))}_addAllEventListeners(t){}_removeAllEventListeners(){}get dampingFactor(){return console.warn(".dampingFactor has been deprecated. use smoothTime (in seconds) instead."),0}set dampingFactor(t){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(t){console.warn(".draggingDampingFactor has been deprecated. use draggingSmoothTime (in seconds) instead.")}static createBoundingSphere(t,e=new v.Sphere){const s=e,i=s.center;Ee.makeEmpty(),t.traverseVisible(o=>{o.isMesh&&Ee.expandByObject(o)}),Ee.getCenter(i);let n=0;return t.traverseVisible(o=>{if(!o.isMesh)return;const r=o,a=r.geometry.clone();a.applyMatrix4(r.matrixWorld);const h=a.attributes.position;for(let d=0,E=h.count;d{var e;if(!(!this.currentWorld||!this.currentWorld.renderer)){if(this.three instanceof Ti){this.onAspectUpdated.trigger();return}if((e=this.currentWorld.renderer)!=null&&e.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:e,world:s})=>{if(e==="added"){const i=this.newCameraControls();this._allControls.set(s.uuid,i)}if(e==="removed"){const i=this._allControls.get(s.uuid);i&&(i.dispose(),this._allControls.delete(s.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,e]of this._allControls)e.dispose()}update(t){this.enabled&&(this.onBeforeUpdate.trigger(this),this.controls.update(t),this.onAfterUpdate.trigger(this))}setupCamera(){const t=window.innerWidth/window.innerHeight,e=new Do(60,t,1,1e3);return e.position.set(50,50,50),e.lookAt(new O(0,0,0)),e}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!");ot.install({THREE:Ve.getSubsetOfThree()});const{domElement:t}=this.currentWorld.renderer.three,e=new ot(this.three,t);return e.smoothTime=.2,e.dollyToCursor=!0,e.infinityDolly=!0,e.minDistance=6,e}setupEvents(t){t?window.addEventListener("resize",this.updateAspect):window.removeEventListener("resize",this.updateAspect)}static getSubsetOfThree(){return{MOUSE:Uo,Vector2:At,Vector3:O,Vector4:xo,Quaternion:Rt,Matrix4:H,Spherical:vo,Box3:st,Sphere:Os,Raycaster:pi,MathUtils:Sn}}}const jn=class qn extends J{constructor(t){super(t),I(this,"onAfterUpdate",new M),I(this,"onBeforeUpdate",new M),I(this,"onDisposed",new M),I(this,"onWorldCreated",new M),I(this,"onWorldDeleted",new M),I(this,"list",new Map),I(this,"enabled",!0),t.add(qn.uuid,this)}create(){const t=new wa(this.components),e=t.uuid;if(this.list.has(e))throw new Error("There is already a world with this name!");return this.list.set(e,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 e=t.uuid;this.list.delete(t.uuid),t.dispose(),this.onWorldDeleted.trigger(e)}dispose(){this.enabled=!1;for(const[t,e]of this.list)e.dispose();this.list.clear(),this.onDisposed.trigger()}update(t){if(this.enabled)for(const[e,s]of this.list)s.update(t)}};I(jn,"uuid","fdb61dc4-2ec1-4966-b83d-54ea795fad4a");let Ua=jn;class xa{constructor(t,e,s){I(this,"onDisposed",new M),I(this,"world"),I(this,"components"),I(this,"three"),I(this,"_fade",3),I(this,"updateZoom",()=>{this.world.camera instanceof Ve&&(this.material.uniforms.uZoom.value=this.world.camera.three.zoom)}),this.world=e;const{color:i,size1:n,size2:o,distance:r}=s;this.components=t;const a=new _i(2,2,1,1),h=new Ho({side:He,uniforms:{uSize1:{value:n},uSize2:{value:o},uColor:{value:i},uDistance:{value:r},uFade:{value:this._fade},uZoom:{value:1}},transparent:!0,vertexShader:` varying vec3 worldPosition; @@ -68,7 +68,7 @@ import{r as Ft,s as st,T as Ie,t as pi,E as So,c as H,V as O,h as At,x as fe,S a } - `,extensions:{derivatives:!0}});this.three=new U(a,h),this.three.frustumCulled=!1,e.scene.three.add(this.three),this.setupEvents(!0)}get visible(){return this.three.visible}set visible(t){t?this.world.scene.three.add(this.three):this.three.removeFromParent()}get material(){return this.three.material}get fade(){return this._fade===3}set fade(t){this._fade=t?3:0,this.material.uniforms.uFade.value=this._fade}dispose(){this.setupEvents(!1),this.components.get(me).destroy(this.three),this.onDisposed.trigger(),this.onDisposed.reset(),this.world=null,this.components=null}setupEvents(t){if(this.world.isDisposing||!(this.world.camera instanceof Ve))return;const e=this.world.camera.controls;t?e.addEventListener("update",this.updateZoom):e.removeEventListener("update",this.updateZoom)}}const Qn=class jn extends J{constructor(t){super(t),I(this,"list",new Map),I(this,"config",{color:new Qt(12303291),size1:1,size2:10,distance:500}),I(this,"onDisposed",new M),I(this,"enabled",!0),t.add(jn.uuid,this)}create(t){if(this.list.has(t.uuid))throw new Error("This world already has a grid!");const e=new Da(this.components,t,this.config);return this.list.set(t.uuid,e),t.onDisposed.add(()=>{this.delete(t)}),e}delete(t){const e=this.list.get(t.uuid);e&&e.dispose(),this.list.delete(t.uuid)}dispose(){for(const[t,e]of this.list)e.dispose();this.list.clear(),this.onDisposed.trigger(),this.onDisposed.reset()}};I(Qn,"uuid","d1e814d5-b81c-4452-87a2-f039375e0489");let dh=Qn;const Xt=new pi,nt=new O,xt=new O,Q=new Rt,mn={X:new O(1,0,0),Y:new O(0,1,0),Z:new O(0,0,1)},Ks={type:"change"},fn={type:"mouseDown"},Rn={type:"mouseUp",mode:null},Fn={type:"objectChange"};class Ua extends As{constructor(t,e){super(),e===void 0&&(console.warn('THREE.TransformControls: The second parameter "domElement" is now mandatory.'),e=document),this.isTransformControls=!0,this.visible=!1,this.domElement=e,this.domElement.style.touchAction="none";const s=new za;this._gizmo=s,this.add(s);const i=new Ga;this._plane=i,this.add(i);const n=this;function o(R,A){let p=A;Object.defineProperty(n,R,{get:function(){return p!==void 0?p:A},set:function(F){p!==F&&(p=F,i[R]=F,s[R]=F,n.dispatchEvent({type:R+"-changed",value:F}),n.dispatchEvent(Ks))}}),n[R]=A,i[R]=A,s[R]=A}o("camera",t),o("object",void 0),o("enabled",!0),o("axis",null),o("mode","translate"),o("translationSnap",null),o("rotationSnap",null),o("scaleSnap",null),o("space","world"),o("size",1),o("dragging",!1),o("showX",!0),o("showY",!0),o("showZ",!0);const r=new O,a=new O,h=new Rt,d=new Rt,E=new O,l=new Rt,u=new O,C=new O,T=new O,m=0,f=new O;o("worldPosition",r),o("worldPositionStart",a),o("worldQuaternion",h),o("worldQuaternionStart",d),o("cameraPosition",E),o("cameraQuaternion",l),o("pointStart",u),o("pointEnd",C),o("rotationAxis",T),o("rotationAngle",m),o("eye",f),this._offset=new O,this._startNorm=new O,this._endNorm=new O,this._cameraScale=new O,this._parentPosition=new O,this._parentQuaternion=new Rt,this._parentQuaternionInv=new Rt,this._parentScale=new O,this._worldScaleStart=new O,this._worldQuaternionInv=new Rt,this._worldScale=new O,this._positionStart=new O,this._quaternionStart=new Rt,this._scaleStart=new O,this._getPointer=xa.bind(this),this._onPointerDown=ba.bind(this),this._onPointerHover=va.bind(this),this._onPointerMove=Ba.bind(this),this._onPointerUp=Ya.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(t){if(this.object===void 0||this.dragging===!0)return;Xt.setFromCamera(t,this.camera);const e=$s(this._gizmo.picker[this.mode],Xt);e?this.axis=e.object.name:this.axis=null}pointerDown(t){if(!(this.object===void 0||this.dragging===!0||t.button!==0)&&this.axis!==null){Xt.setFromCamera(t,this.camera);const e=$s(this._plane,Xt,!0);e&&(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(e.point).sub(this.worldPositionStart)),this.dragging=!0,fn.mode=this.mode,this.dispatchEvent(fn)}}pointerMove(t){const e=this.axis,s=this.mode,i=this.object;let n=this.space;if(s==="scale"?n="local":(e==="E"||e==="XYZE"||e==="XYZ")&&(n="world"),i===void 0||e===null||this.dragging===!1||t.button!==-1)return;Xt.setFromCamera(t,this.camera);const o=$s(this._plane,Xt,!0);if(o){if(this.pointEnd.copy(o.point).sub(this.worldPositionStart),s==="translate")this._offset.copy(this.pointEnd).sub(this.pointStart),n==="local"&&e!=="XYZ"&&this._offset.applyQuaternion(this._worldQuaternionInv),e.indexOf("X")===-1&&(this._offset.x=0),e.indexOf("Y")===-1&&(this._offset.y=0),e.indexOf("Z")===-1&&(this._offset.z=0),n==="local"&&e!=="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(Q.copy(this._quaternionStart).invert()),e.search("X")!==-1&&(i.position.x=Math.round(i.position.x/this.translationSnap)*this.translationSnap),e.search("Y")!==-1&&(i.position.y=Math.round(i.position.y/this.translationSnap)*this.translationSnap),e.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(nt.setFromMatrixPosition(i.parent.matrixWorld)),e.search("X")!==-1&&(i.position.x=Math.round(i.position.x/this.translationSnap)*this.translationSnap),e.search("Y")!==-1&&(i.position.y=Math.round(i.position.y/this.translationSnap)*this.translationSnap),e.search("Z")!==-1&&(i.position.z=Math.round(i.position.z/this.translationSnap)*this.translationSnap),i.parent&&i.position.sub(nt.setFromMatrixPosition(i.parent.matrixWorld))));else if(s==="scale"){if(e.search("XYZ")!==-1){let r=this.pointEnd.length()/this.pointStart.length();this.pointEnd.dot(this.pointStart)<0&&(r*=-1),xt.set(r,r,r)}else nt.copy(this.pointStart),xt.copy(this.pointEnd),nt.applyQuaternion(this._worldQuaternionInv),xt.applyQuaternion(this._worldQuaternionInv),xt.divide(nt),e.search("X")===-1&&(xt.x=1),e.search("Y")===-1&&(xt.y=1),e.search("Z")===-1&&(xt.z=1);i.scale.copy(this._scaleStart).multiply(xt),this.scaleSnap&&(e.search("X")!==-1&&(i.scale.x=Math.round(i.scale.x/this.scaleSnap)*this.scaleSnap||this.scaleSnap),e.search("Y")!==-1&&(i.scale.y=Math.round(i.scale.y/this.scaleSnap)*this.scaleSnap||this.scaleSnap),e.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 r=20/this.worldPosition.distanceTo(nt.setFromMatrixPosition(this.camera.matrixWorld));let a=!1;e==="XYZE"?(this.rotationAxis.copy(this._offset).cross(this.eye).normalize(),this.rotationAngle=this._offset.dot(nt.copy(this.rotationAxis).cross(this.eye))*r):(e==="X"||e==="Y"||e==="Z")&&(this.rotationAxis.copy(mn[e]),nt.copy(mn[e]),n==="local"&&nt.applyQuaternion(this.worldQuaternion),nt.cross(this.eye),nt.length()===0?a=!0:this.rotationAngle=this._offset.dot(nt.normalize())*r),(e==="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"&&e!=="E"&&e!=="XYZE"?(i.quaternion.copy(this._quaternionStart),i.quaternion.multiply(Q.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this._parentQuaternionInv),i.quaternion.copy(Q.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),i.quaternion.multiply(this._quaternionStart).normalize())}this.dispatchEvent(Ks),this.dispatchEvent(Fn)}}pointerUp(t){t.button===0&&(this.dragging&&this.axis!==null&&(Rn.mode=this.mode,this.dispatchEvent(Rn)),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(t){t.geometry&&t.geometry.dispose(),t.material&&t.material.dispose()})}attach(t){return this.object=t,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(Ks),this.dispatchEvent(Fn),this.pointStart.copy(this.pointEnd))}getRaycaster(){return Xt}getMode(){return this.mode}setMode(t){this.mode=t}setTranslationSnap(t){this.translationSnap=t}setRotationSnap(t){this.rotationSnap=t}setScaleSnap(t){this.scaleSnap=t}setSize(t){this.size=t}setSpace(t){this.space=t}}function xa(c){if(this.domElement.ownerDocument.pointerLockElement)return{x:0,y:0,button:c.button};{const t=this.domElement.getBoundingClientRect();return{x:(c.clientX-t.left)/t.width*2-1,y:-(c.clientY-t.top)/t.height*2+1,button:c.button}}}function va(c){if(this.enabled)switch(c.pointerType){case"mouse":case"pen":this.pointerHover(this._getPointer(c));break}}function ba(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 Ba(c){this.enabled&&this.pointerMove(this._getPointer(c))}function Ya(c){this.enabled&&(this.domElement.releasePointerCapture(c.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.pointerUp(this._getPointer(c)))}function $s(c,t,e){const s=t.intersectObject(c,!0);for(let i=0;i.9&&(n.visible=!1)),this.axis==="Y"&&(Q.setFromEuler(Is.set(0,0,Math.PI/2)),n.quaternion.copy(e).multiply(Q),Math.abs(X.copy(kt).applyQuaternion(e).dot(this.eye))>.9&&(n.visible=!1)),this.axis==="Z"&&(Q.setFromEuler(Is.set(0,Math.PI/2,0)),n.quaternion.copy(e).multiply(Q),Math.abs(X.copy(Be).applyQuaternion(e).dot(this.eye))>.9&&(n.visible=!1)),this.axis==="XYZE"&&(Q.setFromEuler(Is.set(0,Math.PI/2,0)),X.copy(this.rotationAxis),n.quaternion.setFromRotationMatrix(gn.lookAt(An,X,kt)),n.quaternion.multiply(Q),n.visible=this.dragging),this.axis==="E"&&(n.visible=!1)):n.name==="START"?(n.position.copy(this.worldPositionStart),n.visible=this.dragging):n.name==="END"?(n.position.copy(this.worldPosition),n.visible=this.dragging):n.name==="DELTA"?(n.position.copy(this.worldPositionStart),n.quaternion.copy(this.worldQuaternionStart),nt.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),nt.applyQuaternion(this.worldQuaternionStart.clone().invert()),n.scale.copy(nt),n.visible=this.dragging):(n.quaternion.copy(e),this.dragging?n.position.copy(this.worldPositionStart):n.position.copy(this.worldPosition),this.axis&&(n.visible=this.axis.search(n.name)!==-1));continue}n.quaternion.copy(e),this.mode==="translate"||this.mode==="scale"?(n.name==="X"&&Math.abs(X.copy(be).applyQuaternion(e).dot(this.eye))>.99&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="Y"&&Math.abs(X.copy(kt).applyQuaternion(e).dot(this.eye))>.99&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="Z"&&Math.abs(X.copy(Be).applyQuaternion(e).dot(this.eye))>.99&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="XY"&&Math.abs(X.copy(Be).applyQuaternion(e).dot(this.eye))<.2&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="YZ"&&Math.abs(X.copy(be).applyQuaternion(e).dot(this.eye))<.2&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="XZ"&&Math.abs(X.copy(kt).applyQuaternion(e).dot(this.eye))<.2&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1)):this.mode==="rotate"&&(ps.copy(e),X.copy(this.eye).applyQuaternion(Q.copy(e).invert()),n.name.search("E")!==-1&&n.quaternion.setFromRotationMatrix(gn.lookAt(this.eye,An,kt)),n.name==="X"&&(Q.setFromAxisAngle(be,Math.atan2(-X.y,X.z)),Q.multiplyQuaternions(ps,Q),n.quaternion.copy(Q)),n.name==="Y"&&(Q.setFromAxisAngle(kt,Math.atan2(X.x,X.z)),Q.multiplyQuaternions(ps,Q),n.quaternion.copy(Q)),n.name==="Z"&&(Q.setFromAxisAngle(Be,Math.atan2(X.y,X.x)),Q.multiplyQuaternions(ps,Q),n.quaternion.copy(Q))),n.visible=n.visible&&(n.name.indexOf("X")===-1||this.showX),n.visible=n.visible&&(n.name.indexOf("Y")===-1||this.showY),n.visible=n.visible&&(n.name.indexOf("Z")===-1||this.showZ),n.visible=n.visible&&(n.name.indexOf("E")===-1||this.showX&&this.showY&&this.showZ),n.material._color=n.material._color||n.material.color.clone(),n.material._opacity=n.material._opacity||n.material.opacity,n.material.color.copy(n.material._color),n.material.opacity=n.material._opacity,this.enabled&&this.axis&&(n.name===this.axis||this.axis.split("").some(function(r){return n.name===r}))&&(n.material.color.setHex(16776960),n.material.opacity=1)}super.updateMatrixWorld(t)}}class Ga extends U{constructor(){super(new _i(1e5,1e5,2,2),new Te({visible:!1,wireframe:!0,side:He,transparent:!0,opacity:.1,toneMapped:!1})),this.isTransformControlsPlane=!0,this.type="TransformControlsPlane"}updateMatrixWorld(t){let e=this.space;switch(this.position.copy(this.worldPosition),this.mode==="scale"&&(e="local"),Cs.copy(be).applyQuaternion(e==="local"?this.worldQuaternion:Rs),xe.copy(kt).applyQuaternion(e==="local"?this.worldQuaternion:Rs),ve.copy(Be).applyQuaternion(e==="local"?this.worldQuaternion:Rs),X.copy(xe),this.mode){case"translate":case"scale":switch(this.axis){case"X":X.copy(this.eye).cross(Cs),St.copy(Cs).cross(X);break;case"Y":X.copy(this.eye).cross(xe),St.copy(xe).cross(X);break;case"Z":X.copy(this.eye).cross(ve),St.copy(ve).cross(X);break;case"XY":St.copy(ve);break;case"YZ":St.copy(Cs);break;case"XZ":X.copy(ve),St.copy(xe);break;case"XYZ":case"E":St.set(0,0,0);break}break;case"rotate":default:St.set(0,0,0)}St.length()===0?this.quaternion.copy(this.cameraQuaternion):(On.lookAt(nt.set(0,0,0),St,X),this.quaternion.setFromRotationMatrix(On)),super.updateMatrixWorld(t)}}class Mi{constructor(t,e,s,i,n,o=5,r=!0){if(I(this,"onDraggingStarted",new M),I(this,"onDraggingEnded",new M),I(this,"onDisposed",new M),I(this,"normal"),I(this,"origin"),I(this,"three",new fe),I(this,"components"),I(this,"world"),I(this,"type","default"),I(this,"_helper"),I(this,"_visible",!0),I(this,"_enabled",!0),I(this,"_controlsActive",!1),I(this,"_arrowBoundBox",new U),I(this,"_planeMesh"),I(this,"_controls"),I(this,"_hiddenMaterial",new Te({visible:!1})),I(this,"update",()=>{this._enabled&&this.three.setFromNormalAndCoplanarPoint(this.normal,this._helper.position)}),I(this,"changeDrag",a=>{this._visible=!a.value,this.preventCameraMovement(),this.notifyDraggingChanged(a)}),this.components=t,this.world=e,!e.renderer)throw new Error("The given world must have a renderer!");this.normal=i,this.origin=s,e.renderer.setPlane(!0,this.three),this._planeMesh=Mi.newPlaneMesh(o,n),this._helper=this.newHelper(),this._controls=this.newTransformControls(),this.three.setFromNormalAndCoplanarPoint(i,s),r&&this.toggleControls(!0)}get enabled(){return this._enabled}set enabled(t){if(!this.world.renderer)throw new Error("No renderer found for clipping plane!");this._enabled=t,this.world.renderer.setPlane(t,this.three)}get visible(){return this._visible}set visible(t){this._visible=t,this._controls.visible=t,this._helper.visible=t,this.toggleControls(t)}get meshes(){return[this._planeMesh,this._arrowBoundBox]}get planeMaterial(){return this._planeMesh.material}set planeMaterial(t){this._planeMesh.material=t}get size(){return this._planeMesh.scale.x}set size(t){this._planeMesh.scale.set(t,t,t)}get helper(){return this._helper}setFromNormalAndCoplanarPoint(t,e){this.reset(),this.normal.equals(t)||(this.normal.copy(t),this._helper.lookAt(t)),this.origin.copy(e),this._helper.position.copy(e),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 t=new O(1,0,0),e=new O;this.normal.equals(t)||(this.normal.copy(t),this._helper.lookAt(t)),this.origin.copy(e),this._helper.position.copy(e),this._helper.updateMatrix()}toggleControls(t){if(t){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=t}newTransformControls(){if(!this.world.renderer)throw new Error("No renderer found for clipping plane!");const t=this.world.camera.three,e=this.world.renderer.three.domElement,s=new Ua(t,e);return this.initializeControls(s),this.world.scene.three.add(s),s}initializeControls(t){t.attach(this._helper),t.showX=!1,t.showY=!1,t.setSpace("local"),this.createArrowBoundingBox(),t.children[0].children[0].add(this._arrowBoundBox)}createArrowBoundingBox(){this._arrowBoundBox.geometry=new rt(.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(t){t.value?this.onDraggingStarted.trigger():this.onDraggingEnded.trigger()}preventCameraMovement(){this.world.camera.enabled=this._visible}newHelper(){const t=new As;return t.lookAt(this.normal),t.position.copy(this.origin),this._planeMesh.position.z+=.01,t.add(this._planeMesh),this.world.scene.three.add(t),t}static newPlaneMesh(t,e){const s=new _i(1),i=new U(s,e);return i.scale.set(t,t,t),i}}const qn=class di extends J{constructor(t){super(t),I(this,"onBeforeDrag",new M),I(this,"onAfterDrag",new M),I(this,"onBeforeCreate",new M),I(this,"onBeforeCancel",new M),I(this,"onAfterCancel",new M),I(this,"onBeforeDelete",new M),I(this,"onAfterCreate",new M),I(this,"onAfterDelete",new M),I(this,"onDisposed",new M),I(this,"orthogonalY",!1),I(this,"toleranceOrthogonalY",.7),I(this,"Type",Mi),I(this,"list",[]),I(this,"_material",new Te({color:12255487,side:He,transparent:!0,opacity:.2})),I(this,"_size",5),I(this,"_enabled",!1),I(this,"_visible",!0),I(this,"_onStartDragging",()=>{this.onBeforeDrag.trigger()}),I(this,"_onEndDragging",()=>{this.onAfterDrag.trigger()}),this.components.add(di.uuid,this)}get enabled(){return this._enabled}set enabled(t){this._enabled=t;for(const e of this.list)e.enabled=t;this.updateMaterialsAndPlanes()}get visible(){return this._visible}set visible(t){this._visible=t;for(const e of this.list)e.visible=t}get material(){return this._material}set material(t){this._material=t;for(const e of this.list)e.planeMaterial=t}get size(){return this._size}set size(t){this._size=t;for(const e of this.list)e.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(di.uuid),this.onDisposed.reset()}create(t){const e=this.components.get(cn).get(t).castRay();return e?this.createPlaneFromIntersection(t,e):null}createFromNormalAndCoplanarPoint(t,e,s){const i=this.newPlane(t,s,e);return this.updateMaterialsAndPlanes(),i}delete(t,e){e||(e=this.pickPlane(t)),e&&this.deletePlane(e)}deleteAll(t){const e=[...this.list];for(const s of e)if(!t||t.has(s.type)){this.delete(s.world,s);const i=this.list.indexOf(s);i!==-1&&this.list.splice(i,1)}}deletePlane(t){const e=this.list.indexOf(t);if(e!==-1){if(this.list.splice(e,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 e=this.components.get(cn).get(t),s=this.getAllPlaneMeshes(),i=e.castRay(s);if(i){const n=i.object;return this.list.find(o=>o.meshes.includes(n))}}getAllPlaneMeshes(){const t=[];for(const e of this.list)t.push(...e.meshes);return t}createPlaneFromIntersection(t,e){var s;if(!t.renderer)throw new Error("The given world must have a renderer!");const i=e.point.distanceTo(new O(0,0,0)),n=(s=e.face)==null?void 0:s.normal;if(!i||!n)return null;const o=this.getWorldNormal(e,n),r=this.newPlane(t,e.point,o.negate());return r.visible=this._visible,r.size=this._size,t.renderer.setPlane(!0,r.three),this.updateMaterialsAndPlanes(),r}getWorldNormal(t,e){const s=t.object;let i=t.object.matrixWorld.clone();if(s instanceof jt&&t.instanceId!==void 0){const r=new H;s.getMatrixAt(t.instanceId,r),i=r.multiply(i)}const n=new Zt().getNormalMatrix(i),o=e.clone().applyMatrix3(n).normalize();return this.normalizePlaneDirectionY(o),o}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,e,s){const i=new this.Type(this.components,t,e,s,this._material);return i.onDraggingStarted.add(this._onStartDragging),i.onDraggingEnded.add(this._onEndDragging),this.list.push(i),this.onAfterCreate.trigger(i),i}updateMaterialsAndPlanes(){const t=this.components.get(Ma);for(const[e,s]of t.list){if(!s.renderer)continue;s.renderer.updateClippingPlanes();const{clippingPlanes:i}=s.renderer;for(const n of s.meshes)if(n.material)if(Array.isArray(n.material))for(const o of n.material)o.clippingPlanes=i;else n.material.clippingPlanes=i}}};I(qn,"uuid","66290bc5-18c4-4cd1-9379-2e17a0617611");let Eh=qn;function Va(c,t,e,s){return new Promise((i,n)=>{function o(){const r=c.clientWaitSync(t,e,0);if(r===c.WAIT_FAILED){n();return}if(r===c.TIMEOUT_EXPIRED){setTimeout(o,s);return}i()}o()})}async function Ha(c,t,e,s,i,n,o){const r=c.fenceSync(c.SYNC_GPU_COMMANDS_COMPLETE,0);c.flush(),await Va(c,r,0,10),c.deleteSync(r),c.bindBuffer(t,e),c.getBufferSubData(t,s,i,n,o),c.bindBuffer(t,null)}async function Wa(c,t,e,s,i,n,o,r){const a=c.createBuffer();return c.bindBuffer(c.PIXEL_PACK_BUFFER,a),c.bufferData(c.PIXEL_PACK_BUFFER,r.byteLength,c.STREAM_READ),c.readPixels(t,e,s,i,n,o,0),c.bindBuffer(c.PIXEL_PACK_BUFFER,null),await Ha(c,c.PIXEL_PACK_BUFFER,a,0,r),c.deleteBuffer(a),r}class Xa{constructor(t,e,s){if(I(this,"onDisposed",new M),I(this,"onViewUpdated",new ms),I(this,"enabled",!0),I(this,"needsUpdate",!1),I(this,"renderDebugFrame",!1),I(this,"components"),I(this,"world"),I(this,"renderer"),I(this,"autoUpdate",!0),I(this,"updateInterval",1e3),I(this,"worker"),I(this,"scene",new Ci),I(this,"_width",512),I(this,"_height",512),I(this,"_availableColor",1),I(this,"renderTarget"),I(this,"bufferSize"),I(this,"_buffer"),I(this,"_isWorkerBusy",!1),I(this,"updateVisibility",async o=>{if(!this.enabled||!this.needsUpdate&&!o||this._isWorkerBusy)return;this._isWorkerBusy=!0;const r=this.world.camera.three;r.updateMatrix(),this.renderer.setSize(this._width,this._height),this.renderer.setRenderTarget(this.renderTarget),this.renderer.render(this.scene,r);const a=this.renderer.getContext();await Wa(a,0,0,this._width,this._height,a.RGBA,a.UNSIGNED_BYTE,this._buffer),this.renderer.setRenderTarget(null),this.renderDebugFrame&&this.renderer.render(this.scene,r),this.worker.postMessage({buffer:this._buffer}),this.needsUpdate=!1}),!e.renderer)throw new Error("The given world must have a renderer!");this.components=t,this.applySettings(s),this.world=e,this.renderer=new Fs,this.renderTarget=new Ko(this._width,this._height),this.bufferSize=this._width*this._height*4,this._buffer=new Uint8Array(this.bufferSize),this.renderer.clippingPlanes=e.renderer.clippingPlanes;const i=` + `,extensions:{derivatives:!0}});this.three=new U(a,h),this.three.frustumCulled=!1,e.scene.three.add(this.three),this.setupEvents(!0)}get visible(){return this.three.visible}set visible(t){t?this.world.scene.three.add(this.three):this.three.removeFromParent()}get material(){return this.three.material}get fade(){return this._fade===3}set fade(t){this._fade=t?3:0,this.material.uniforms.uFade.value=this._fade}dispose(){this.setupEvents(!1),this.components.get(me).destroy(this.three),this.onDisposed.trigger(),this.onDisposed.reset(),this.world=null,this.components=null}setupEvents(t){if(this.world.isDisposing||!(this.world.camera instanceof Ve))return;const e=this.world.camera.controls;t?e.addEventListener("update",this.updateZoom):e.removeEventListener("update",this.updateZoom)}}const Kn=class $n extends J{constructor(t){super(t),I(this,"list",new Map),I(this,"config",{color:new Qt(12303291),size1:1,size2:10,distance:500}),I(this,"onDisposed",new M),I(this,"enabled",!0),t.add($n.uuid,this)}create(t){if(this.list.has(t.uuid))throw new Error("This world already has a grid!");const e=new xa(this.components,t,this.config);return this.list.set(t.uuid,e),t.onDisposed.add(()=>{this.delete(t)}),e}delete(t){const e=this.list.get(t.uuid);e&&e.dispose(),this.list.delete(t.uuid)}dispose(){for(const[t,e]of this.list)e.dispose();this.list.clear(),this.onDisposed.trigger(),this.onDisposed.reset()}};I(Kn,"uuid","d1e814d5-b81c-4452-87a2-f039375e0489");let Eh=Kn;const Xt=new pi,nt=new O,xt=new O,Q=new Rt,fn={X:new O(1,0,0),Y:new O(0,1,0),Z:new O(0,0,1)},Ks={type:"change"},Rn={type:"mouseDown"},Fn={type:"mouseUp",mode:null},An={type:"objectChange"};class va extends As{constructor(t,e){super(),e===void 0&&(console.warn('THREE.TransformControls: The second parameter "domElement" is now mandatory.'),e=document),this.isTransformControls=!0,this.visible=!1,this.domElement=e,this.domElement.style.touchAction="none";const s=new Va;this._gizmo=s,this.add(s);const i=new Ha;this._plane=i,this.add(i);const n=this;function o(R,A){let p=A;Object.defineProperty(n,R,{get:function(){return p!==void 0?p:A},set:function(F){p!==F&&(p=F,i[R]=F,s[R]=F,n.dispatchEvent({type:R+"-changed",value:F}),n.dispatchEvent(Ks))}}),n[R]=A,i[R]=A,s[R]=A}o("camera",t),o("object",void 0),o("enabled",!0),o("axis",null),o("mode","translate"),o("translationSnap",null),o("rotationSnap",null),o("scaleSnap",null),o("space","world"),o("size",1),o("dragging",!1),o("showX",!0),o("showY",!0),o("showZ",!0);const r=new O,a=new O,h=new Rt,d=new Rt,E=new O,l=new Rt,u=new O,C=new O,T=new O,m=0,f=new O;o("worldPosition",r),o("worldPositionStart",a),o("worldQuaternion",h),o("worldQuaternionStart",d),o("cameraPosition",E),o("cameraQuaternion",l),o("pointStart",u),o("pointEnd",C),o("rotationAxis",T),o("rotationAngle",m),o("eye",f),this._offset=new O,this._startNorm=new O,this._endNorm=new O,this._cameraScale=new O,this._parentPosition=new O,this._parentQuaternion=new Rt,this._parentQuaternionInv=new Rt,this._parentScale=new O,this._worldScaleStart=new O,this._worldQuaternionInv=new Rt,this._worldScale=new O,this._positionStart=new O,this._quaternionStart=new Rt,this._scaleStart=new O,this._getPointer=ba.bind(this),this._onPointerDown=Ya.bind(this),this._onPointerHover=Ba.bind(this),this._onPointerMove=za.bind(this),this._onPointerUp=Ga.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(t){if(this.object===void 0||this.dragging===!0)return;Xt.setFromCamera(t,this.camera);const e=$s(this._gizmo.picker[this.mode],Xt);e?this.axis=e.object.name:this.axis=null}pointerDown(t){if(!(this.object===void 0||this.dragging===!0||t.button!==0)&&this.axis!==null){Xt.setFromCamera(t,this.camera);const e=$s(this._plane,Xt,!0);e&&(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(e.point).sub(this.worldPositionStart)),this.dragging=!0,Rn.mode=this.mode,this.dispatchEvent(Rn)}}pointerMove(t){const e=this.axis,s=this.mode,i=this.object;let n=this.space;if(s==="scale"?n="local":(e==="E"||e==="XYZE"||e==="XYZ")&&(n="world"),i===void 0||e===null||this.dragging===!1||t.button!==-1)return;Xt.setFromCamera(t,this.camera);const o=$s(this._plane,Xt,!0);if(o){if(this.pointEnd.copy(o.point).sub(this.worldPositionStart),s==="translate")this._offset.copy(this.pointEnd).sub(this.pointStart),n==="local"&&e!=="XYZ"&&this._offset.applyQuaternion(this._worldQuaternionInv),e.indexOf("X")===-1&&(this._offset.x=0),e.indexOf("Y")===-1&&(this._offset.y=0),e.indexOf("Z")===-1&&(this._offset.z=0),n==="local"&&e!=="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(Q.copy(this._quaternionStart).invert()),e.search("X")!==-1&&(i.position.x=Math.round(i.position.x/this.translationSnap)*this.translationSnap),e.search("Y")!==-1&&(i.position.y=Math.round(i.position.y/this.translationSnap)*this.translationSnap),e.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(nt.setFromMatrixPosition(i.parent.matrixWorld)),e.search("X")!==-1&&(i.position.x=Math.round(i.position.x/this.translationSnap)*this.translationSnap),e.search("Y")!==-1&&(i.position.y=Math.round(i.position.y/this.translationSnap)*this.translationSnap),e.search("Z")!==-1&&(i.position.z=Math.round(i.position.z/this.translationSnap)*this.translationSnap),i.parent&&i.position.sub(nt.setFromMatrixPosition(i.parent.matrixWorld))));else if(s==="scale"){if(e.search("XYZ")!==-1){let r=this.pointEnd.length()/this.pointStart.length();this.pointEnd.dot(this.pointStart)<0&&(r*=-1),xt.set(r,r,r)}else nt.copy(this.pointStart),xt.copy(this.pointEnd),nt.applyQuaternion(this._worldQuaternionInv),xt.applyQuaternion(this._worldQuaternionInv),xt.divide(nt),e.search("X")===-1&&(xt.x=1),e.search("Y")===-1&&(xt.y=1),e.search("Z")===-1&&(xt.z=1);i.scale.copy(this._scaleStart).multiply(xt),this.scaleSnap&&(e.search("X")!==-1&&(i.scale.x=Math.round(i.scale.x/this.scaleSnap)*this.scaleSnap||this.scaleSnap),e.search("Y")!==-1&&(i.scale.y=Math.round(i.scale.y/this.scaleSnap)*this.scaleSnap||this.scaleSnap),e.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 r=20/this.worldPosition.distanceTo(nt.setFromMatrixPosition(this.camera.matrixWorld));let a=!1;e==="XYZE"?(this.rotationAxis.copy(this._offset).cross(this.eye).normalize(),this.rotationAngle=this._offset.dot(nt.copy(this.rotationAxis).cross(this.eye))*r):(e==="X"||e==="Y"||e==="Z")&&(this.rotationAxis.copy(fn[e]),nt.copy(fn[e]),n==="local"&&nt.applyQuaternion(this.worldQuaternion),nt.cross(this.eye),nt.length()===0?a=!0:this.rotationAngle=this._offset.dot(nt.normalize())*r),(e==="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"&&e!=="E"&&e!=="XYZE"?(i.quaternion.copy(this._quaternionStart),i.quaternion.multiply(Q.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this._parentQuaternionInv),i.quaternion.copy(Q.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),i.quaternion.multiply(this._quaternionStart).normalize())}this.dispatchEvent(Ks),this.dispatchEvent(An)}}pointerUp(t){t.button===0&&(this.dragging&&this.axis!==null&&(Fn.mode=this.mode,this.dispatchEvent(Fn)),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(t){t.geometry&&t.geometry.dispose(),t.material&&t.material.dispose()})}attach(t){return this.object=t,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(Ks),this.dispatchEvent(An),this.pointStart.copy(this.pointEnd))}getRaycaster(){return Xt}getMode(){return this.mode}setMode(t){this.mode=t}setTranslationSnap(t){this.translationSnap=t}setRotationSnap(t){this.rotationSnap=t}setScaleSnap(t){this.scaleSnap=t}setSize(t){this.size=t}setSpace(t){this.space=t}}function ba(c){if(this.domElement.ownerDocument.pointerLockElement)return{x:0,y:0,button:c.button};{const t=this.domElement.getBoundingClientRect();return{x:(c.clientX-t.left)/t.width*2-1,y:-(c.clientY-t.top)/t.height*2+1,button:c.button}}}function Ba(c){if(this.enabled)switch(c.pointerType){case"mouse":case"pen":this.pointerHover(this._getPointer(c));break}}function Ya(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 za(c){this.enabled&&this.pointerMove(this._getPointer(c))}function Ga(c){this.enabled&&(this.domElement.releasePointerCapture(c.pointerId),this.domElement.removeEventListener("pointermove",this._onPointerMove),this.pointerUp(this._getPointer(c)))}function $s(c,t,e){const s=t.intersectObject(c,!0);for(let i=0;i.9&&(n.visible=!1)),this.axis==="Y"&&(Q.setFromEuler(Is.set(0,0,Math.PI/2)),n.quaternion.copy(e).multiply(Q),Math.abs(X.copy(kt).applyQuaternion(e).dot(this.eye))>.9&&(n.visible=!1)),this.axis==="Z"&&(Q.setFromEuler(Is.set(0,Math.PI/2,0)),n.quaternion.copy(e).multiply(Q),Math.abs(X.copy(Be).applyQuaternion(e).dot(this.eye))>.9&&(n.visible=!1)),this.axis==="XYZE"&&(Q.setFromEuler(Is.set(0,Math.PI/2,0)),X.copy(this.rotationAxis),n.quaternion.setFromRotationMatrix(On.lookAt(gn,X,kt)),n.quaternion.multiply(Q),n.visible=this.dragging),this.axis==="E"&&(n.visible=!1)):n.name==="START"?(n.position.copy(this.worldPositionStart),n.visible=this.dragging):n.name==="END"?(n.position.copy(this.worldPosition),n.visible=this.dragging):n.name==="DELTA"?(n.position.copy(this.worldPositionStart),n.quaternion.copy(this.worldQuaternionStart),nt.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),nt.applyQuaternion(this.worldQuaternionStart.clone().invert()),n.scale.copy(nt),n.visible=this.dragging):(n.quaternion.copy(e),this.dragging?n.position.copy(this.worldPositionStart):n.position.copy(this.worldPosition),this.axis&&(n.visible=this.axis.search(n.name)!==-1));continue}n.quaternion.copy(e),this.mode==="translate"||this.mode==="scale"?(n.name==="X"&&Math.abs(X.copy(be).applyQuaternion(e).dot(this.eye))>.99&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="Y"&&Math.abs(X.copy(kt).applyQuaternion(e).dot(this.eye))>.99&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="Z"&&Math.abs(X.copy(Be).applyQuaternion(e).dot(this.eye))>.99&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="XY"&&Math.abs(X.copy(Be).applyQuaternion(e).dot(this.eye))<.2&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="YZ"&&Math.abs(X.copy(be).applyQuaternion(e).dot(this.eye))<.2&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1),n.name==="XZ"&&Math.abs(X.copy(kt).applyQuaternion(e).dot(this.eye))<.2&&(n.scale.set(1e-10,1e-10,1e-10),n.visible=!1)):this.mode==="rotate"&&(ps.copy(e),X.copy(this.eye).applyQuaternion(Q.copy(e).invert()),n.name.search("E")!==-1&&n.quaternion.setFromRotationMatrix(On.lookAt(this.eye,gn,kt)),n.name==="X"&&(Q.setFromAxisAngle(be,Math.atan2(-X.y,X.z)),Q.multiplyQuaternions(ps,Q),n.quaternion.copy(Q)),n.name==="Y"&&(Q.setFromAxisAngle(kt,Math.atan2(X.x,X.z)),Q.multiplyQuaternions(ps,Q),n.quaternion.copy(Q)),n.name==="Z"&&(Q.setFromAxisAngle(Be,Math.atan2(X.y,X.x)),Q.multiplyQuaternions(ps,Q),n.quaternion.copy(Q))),n.visible=n.visible&&(n.name.indexOf("X")===-1||this.showX),n.visible=n.visible&&(n.name.indexOf("Y")===-1||this.showY),n.visible=n.visible&&(n.name.indexOf("Z")===-1||this.showZ),n.visible=n.visible&&(n.name.indexOf("E")===-1||this.showX&&this.showY&&this.showZ),n.material._color=n.material._color||n.material.color.clone(),n.material._opacity=n.material._opacity||n.material.opacity,n.material.color.copy(n.material._color),n.material.opacity=n.material._opacity,this.enabled&&this.axis&&(n.name===this.axis||this.axis.split("").some(function(r){return n.name===r}))&&(n.material.color.setHex(16776960),n.material.opacity=1)}super.updateMatrixWorld(t)}}class Ha extends U{constructor(){super(new _i(1e5,1e5,2,2),new Te({visible:!1,wireframe:!0,side:He,transparent:!0,opacity:.1,toneMapped:!1})),this.isTransformControlsPlane=!0,this.type="TransformControlsPlane"}updateMatrixWorld(t){let e=this.space;switch(this.position.copy(this.worldPosition),this.mode==="scale"&&(e="local"),Cs.copy(be).applyQuaternion(e==="local"?this.worldQuaternion:Rs),xe.copy(kt).applyQuaternion(e==="local"?this.worldQuaternion:Rs),ve.copy(Be).applyQuaternion(e==="local"?this.worldQuaternion:Rs),X.copy(xe),this.mode){case"translate":case"scale":switch(this.axis){case"X":X.copy(this.eye).cross(Cs),St.copy(Cs).cross(X);break;case"Y":X.copy(this.eye).cross(xe),St.copy(xe).cross(X);break;case"Z":X.copy(this.eye).cross(ve),St.copy(ve).cross(X);break;case"XY":St.copy(ve);break;case"YZ":St.copy(Cs);break;case"XZ":X.copy(ve),St.copy(xe);break;case"XYZ":case"E":St.set(0,0,0);break}break;case"rotate":default:St.set(0,0,0)}St.length()===0?this.quaternion.copy(this.cameraQuaternion):(_n.lookAt(nt.set(0,0,0),St,X),this.quaternion.setFromRotationMatrix(_n)),super.updateMatrixWorld(t)}}class Mi{constructor(t,e,s,i,n,o=5,r=!0){if(I(this,"onDraggingStarted",new M),I(this,"onDraggingEnded",new M),I(this,"onDisposed",new M),I(this,"normal"),I(this,"origin"),I(this,"three",new fe),I(this,"components"),I(this,"world"),I(this,"type","default"),I(this,"_helper"),I(this,"_visible",!0),I(this,"_enabled",!0),I(this,"_controlsActive",!1),I(this,"_arrowBoundBox",new U),I(this,"_planeMesh"),I(this,"_controls"),I(this,"_hiddenMaterial",new Te({visible:!1})),I(this,"update",()=>{this._enabled&&this.three.setFromNormalAndCoplanarPoint(this.normal,this._helper.position)}),I(this,"changeDrag",a=>{this._visible=!a.value,this.preventCameraMovement(),this.notifyDraggingChanged(a)}),this.components=t,this.world=e,!e.renderer)throw new Error("The given world must have a renderer!");this.normal=i,this.origin=s,e.renderer.setPlane(!0,this.three),this._planeMesh=Mi.newPlaneMesh(o,n),this._helper=this.newHelper(),this._controls=this.newTransformControls(),this.three.setFromNormalAndCoplanarPoint(i,s),r&&this.toggleControls(!0)}get enabled(){return this._enabled}set enabled(t){if(!this.world.renderer)throw new Error("No renderer found for clipping plane!");this._enabled=t,this.world.renderer.setPlane(t,this.three)}get visible(){return this._visible}set visible(t){this._visible=t,this._controls.visible=t,this._helper.visible=t,this.toggleControls(t)}get meshes(){return[this._planeMesh,this._arrowBoundBox]}get planeMaterial(){return this._planeMesh.material}set planeMaterial(t){this._planeMesh.material=t}get size(){return this._planeMesh.scale.x}set size(t){this._planeMesh.scale.set(t,t,t)}get helper(){return this._helper}setFromNormalAndCoplanarPoint(t,e){this.reset(),this.normal.equals(t)||(this.normal.copy(t),this._helper.lookAt(t)),this.origin.copy(e),this._helper.position.copy(e),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 t=new O(1,0,0),e=new O;this.normal.equals(t)||(this.normal.copy(t),this._helper.lookAt(t)),this.origin.copy(e),this._helper.position.copy(e),this._helper.updateMatrix()}toggleControls(t){if(t){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=t}newTransformControls(){if(!this.world.renderer)throw new Error("No renderer found for clipping plane!");const t=this.world.camera.three,e=this.world.renderer.three.domElement,s=new va(t,e);return this.initializeControls(s),this.world.scene.three.add(s),s}initializeControls(t){t.attach(this._helper),t.showX=!1,t.showY=!1,t.setSpace("local"),this.createArrowBoundingBox(),t.children[0].children[0].add(this._arrowBoundBox)}createArrowBoundingBox(){this._arrowBoundBox.geometry=new rt(.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(t){t.value?this.onDraggingStarted.trigger():this.onDraggingEnded.trigger()}preventCameraMovement(){this.world.camera.enabled=this._visible}newHelper(){const t=new As;return t.lookAt(this.normal),t.position.copy(this.origin),this._planeMesh.position.z+=.01,t.add(this._planeMesh),this.world.scene.three.add(t),t}static newPlaneMesh(t,e){const s=new _i(1),i=new U(s,e);return i.scale.set(t,t,t),i}}const Jn=class di extends J{constructor(t){super(t),I(this,"onBeforeDrag",new M),I(this,"onAfterDrag",new M),I(this,"onBeforeCreate",new M),I(this,"onBeforeCancel",new M),I(this,"onAfterCancel",new M),I(this,"onBeforeDelete",new M),I(this,"onAfterCreate",new M),I(this,"onAfterDelete",new M),I(this,"onDisposed",new M),I(this,"orthogonalY",!1),I(this,"toleranceOrthogonalY",.7),I(this,"Type",Mi),I(this,"list",[]),I(this,"_material",new Te({color:12255487,side:He,transparent:!0,opacity:.2})),I(this,"_size",5),I(this,"_enabled",!1),I(this,"_visible",!0),I(this,"_onStartDragging",()=>{this.onBeforeDrag.trigger()}),I(this,"_onEndDragging",()=>{this.onAfterDrag.trigger()}),this.components.add(di.uuid,this)}get enabled(){return this._enabled}set enabled(t){this._enabled=t;for(const e of this.list)e.enabled=t;this.updateMaterialsAndPlanes()}get visible(){return this._visible}set visible(t){this._visible=t;for(const e of this.list)e.visible=t}get material(){return this._material}set material(t){this._material=t;for(const e of this.list)e.planeMaterial=t}get size(){return this._size}set size(t){this._size=t;for(const e of this.list)e.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(di.uuid),this.onDisposed.reset()}create(t){const e=this.components.get(ln).get(t).castRay();return e?this.createPlaneFromIntersection(t,e):null}createFromNormalAndCoplanarPoint(t,e,s){const i=this.newPlane(t,s,e);return this.updateMaterialsAndPlanes(),i}delete(t,e){e||(e=this.pickPlane(t)),e&&this.deletePlane(e)}deleteAll(t){const e=[...this.list];for(const s of e)if(!t||t.has(s.type)){this.delete(s.world,s);const i=this.list.indexOf(s);i!==-1&&this.list.splice(i,1)}}deletePlane(t){const e=this.list.indexOf(t);if(e!==-1){if(this.list.splice(e,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 e=this.components.get(ln).get(t),s=this.getAllPlaneMeshes(),i=e.castRay(s);if(i){const n=i.object;return this.list.find(o=>o.meshes.includes(n))}}getAllPlaneMeshes(){const t=[];for(const e of this.list)t.push(...e.meshes);return t}createPlaneFromIntersection(t,e){var s;if(!t.renderer)throw new Error("The given world must have a renderer!");const i=e.point.distanceTo(new O(0,0,0)),n=(s=e.face)==null?void 0:s.normal;if(!i||!n)return null;const o=this.getWorldNormal(e,n),r=this.newPlane(t,e.point,o.negate());return r.visible=this._visible,r.size=this._size,t.renderer.setPlane(!0,r.three),this.updateMaterialsAndPlanes(),r}getWorldNormal(t,e){const s=t.object;let i=t.object.matrixWorld.clone();if(s instanceof jt&&t.instanceId!==void 0){const r=new H;s.getMatrixAt(t.instanceId,r),i=r.multiply(i)}const n=new Zt().getNormalMatrix(i),o=e.clone().applyMatrix3(n).normalize();return this.normalizePlaneDirectionY(o),o}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,e,s){const i=new this.Type(this.components,t,e,s,this._material);return i.onDraggingStarted.add(this._onStartDragging),i.onDraggingEnded.add(this._onEndDragging),this.list.push(i),this.onAfterCreate.trigger(i),i}updateMaterialsAndPlanes(){const t=this.components.get(Ua);for(const[e,s]of t.list){if(!s.renderer)continue;s.renderer.updateClippingPlanes();const{clippingPlanes:i}=s.renderer;for(const n of s.meshes)if(n.material)if(Array.isArray(n.material))for(const o of n.material)o.clippingPlanes=i;else n.material.clippingPlanes=i}}};I(Jn,"uuid","66290bc5-18c4-4cd1-9379-2e17a0617611");let uh=Jn;function Wa(c,t,e,s){return new Promise((i,n)=>{function o(){const r=c.clientWaitSync(t,e,0);if(r===c.WAIT_FAILED){n();return}if(r===c.TIMEOUT_EXPIRED){setTimeout(o,s);return}i()}o()})}async function Xa(c,t,e,s,i,n,o){const r=c.fenceSync(c.SYNC_GPU_COMMANDS_COMPLETE,0);c.flush(),await Wa(c,r,0,10),c.deleteSync(r),c.bindBuffer(t,e),c.getBufferSubData(t,s,i,n,o),c.bindBuffer(t,null)}async function ka(c,t,e,s,i,n,o,r){const a=c.createBuffer();return c.bindBuffer(c.PIXEL_PACK_BUFFER,a),c.bufferData(c.PIXEL_PACK_BUFFER,r.byteLength,c.STREAM_READ),c.readPixels(t,e,s,i,n,o,0),c.bindBuffer(c.PIXEL_PACK_BUFFER,null),await Xa(c,c.PIXEL_PACK_BUFFER,a,0,r),c.deleteBuffer(a),r}class Za{constructor(t,e,s){if(I(this,"onDisposed",new M),I(this,"onViewUpdated",new ms),I(this,"enabled",!0),I(this,"needsUpdate",!1),I(this,"renderDebugFrame",!1),I(this,"components"),I(this,"world"),I(this,"renderer"),I(this,"autoUpdate",!0),I(this,"updateInterval",1e3),I(this,"worker"),I(this,"scene",new Ci),I(this,"_width",512),I(this,"_height",512),I(this,"_availableColor",1),I(this,"renderTarget"),I(this,"bufferSize"),I(this,"_buffer"),I(this,"_isWorkerBusy",!1),I(this,"updateVisibility",async o=>{if(!this.enabled||!this.needsUpdate&&!o||this._isWorkerBusy)return;this._isWorkerBusy=!0;const r=this.world.camera.three;r.updateMatrix(),this.renderer.setSize(this._width,this._height),this.renderer.setRenderTarget(this.renderTarget),this.renderer.render(this.scene,r);const a=this.renderer.getContext();await ka(a,0,0,this._width,this._height,a.RGBA,a.UNSIGNED_BYTE,this._buffer),this.renderer.setRenderTarget(null),this.renderDebugFrame&&this.renderer.render(this.scene,r),this.worker.postMessage({buffer:this._buffer}),this.needsUpdate=!1}),!e.renderer)throw new Error("The given world must have a renderer!");this.components=t,this.applySettings(s),this.world=e,this.renderer=new Fs,this.renderTarget=new Jo(this._width,this._height),this.bufferSize=this._width*this._height*4,this._buffer=new Uint8Array(this.bufferSize),this.renderer.clippingPlanes=e.renderer.clippingPlanes;const i=` addEventListener("message", (event) => { const { buffer } = event.data; const colors = new Map(); @@ -85,4 +85,4 @@ import{r as Ft,s as st,T as Ie,t as pi,E as So,c as H,V as O,h as At,x as fe,S a } postMessage({ colors }); }); - `,n=new Blob([i],{type:"application/javascript"});this.worker=new Worker(URL.createObjectURL(n))}dispose(){this.enabled=!1;for(const t of this.scene.children)t.removeFromParent();this.onViewUpdated.reset(),this.worker.terminate(),this.renderer.dispose(),this.renderTarget.dispose(),this._buffer=null,this.onDisposed.reset()}getAvailableColor(){let t=BigInt(this._availableColor.toString());const e=[];do e.unshift(Number(t%256n)),t/=256n;while(t);for(;e.length!==3;)e.unshift(0);const[s,i,n]=e,o=`${s}-${i}-${n}`;return{r:s,g:i,b:n,code:o}}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(t){t&&(t.updateInterval!==void 0&&(this.updateInterval=t.updateInterval),t.height!==void 0&&(this._height=t.height),t.width!==void 0&&(this._width=t.width),t.autoUpdate!==void 0&&(this.autoUpdate=t.autoUpdate))}}class ka extends Xa{constructor(t,e,s){super(t,e,s),I(this,"onViewUpdated",new M),I(this,"threshold",100),I(this,"colorMeshes",new Map),I(this,"isProcessing",!1),I(this,"_colorCodeMeshMap",new Map),I(this,"_meshIDColorCodeMap",new Map),I(this,"_currentVisibleMeshes",new Set),I(this,"_recentlyHiddenMeshes",new Set),I(this,"_intervalID",null),I(this,"_transparentMat",new Te({transparent:!0,opacity:0})),I(this,"handleWorkerMessage",async i=>{if(this.isProcessing)return;const n=i.data.colors;this._recentlyHiddenMeshes=new Set(this._currentVisibleMeshes),this._currentVisibleMeshes.clear();for(const[o,r]of n){if(r{this.isProcessing||await this.updateVisibility()},this.updateInterval),this.onViewUpdated.add(({seen:i,unseen:n})=>{for(const o of i)o.visible=!0;for(const o of n)o.visible=!1})}dispose(){super.dispose(),this._intervalID!==null&&(window.clearInterval(this._intervalID),this._intervalID=null),this._currentVisibleMeshes.clear(),this._recentlyHiddenMeshes.clear(),this._meshIDColorCodeMap.clear(),this._transparentMat.dispose(),this._colorCodeMeshMap.clear();const t=this.components.get(me);for(const e in this.colorMeshes){const s=this.colorMeshes.get(e);s&&t.destroy(s,!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 e=t instanceof jt,{geometry:s,material:i}=t,{colorMaterial:n,code:o}=this.getAvailableMaterial();let r;if(Array.isArray(i)){let d=!0;const E=[];for(const l of i)hn.isTransparent(l)?E.push(this._transparentMat):(d=!1,E.push(n));if(d){n.dispose(),this.isProcessing=!1;return}r=E}else if(hn.isTransparent(i)){n.dispose(),this.isProcessing=!1;return}else r=n;this._colorCodeMeshMap.set(o,t),this._meshIDColorCodeMap.set(t.uuid,o);const a=e?t.count:1,h=new jt(s,r,a);e?h.instanceMatrix=t.instanceMatrix:h.setMatrixAt(0,new H),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 e=this.components.get(me);this._currentVisibleMeshes.delete(t),this._recentlyHiddenMeshes.delete(t);const s=this.colorMeshes.get(t.uuid),i=this._meshIDColorCodeMap.get(t.uuid);if(!s||!i){this.isProcessing=!1;return}this._colorCodeMeshMap.delete(i),this._meshIDColorCodeMap.delete(t.uuid),this.colorMeshes.delete(t.uuid),s.geometry=void 0,s.material=[],e.destroy(s,!0),this._recentlyHiddenMeshes.delete(t),this._currentVisibleMeshes.delete(t),this.isProcessing=!1}updateInstanced(t){for(const e of t){const s=this.colorMeshes.get(e.uuid);s&&(s.count=e.count)}}getAvailableMaterial(){const{r:t,g:e,b:s,code:i}=this.getAvailableColor(),n=Ps.enabled;Ps.enabled=!1;const o=new Qt(`rgb(${t}, ${e}, ${s})`);if(!this.world.renderer)throw new Error("Renderer not found in the world!");const r=this.world.renderer.clippingPlanes,a=new Te({color:o,clippingPlanes:r,side:He});return Ps.enabled=n,{colorMaterial:a,code:i}}}const Kn=class Ei extends J{constructor(t){super(t),I(this,"onDisposed",new M),I(this,"_enabled",!0),I(this,"list",new Map),t.add(Ei.uuid,this)}get enabled(){return this._enabled}set enabled(t){this._enabled=t;for(const[e,s]of this.list)s.enabled=t}create(t,e){if(this.list.has(t.uuid))return this.list.get(t.uuid);const s=new ka(this.components,t,e);return this.list.set(t.uuid,s),s}delete(t){const e=this.list.get(t.uuid);e&&e.dispose(),this.list.delete(t.uuid)}dispose(){this.enabled=!1,this.onDisposed.trigger(Ei.uuid),this.onDisposed.reset();for(const[t,e]of this.list)e.dispose();this.list.clear()}updateInstanced(t){for(const[,e]of this.list)e.updateInstanced(t)}};I(Kn,"uuid","69f2a50d-c266-44fc-b1bd-fa4d34be89e6");let Za=Kn;class Qa{constructor(t){if(I(this,"onDisposed",new M),I(this,"onAfterUpdate",new M),I(this,"onBeforeUpdate",new M),I(this,"onResize",new M),I(this,"frontOffset",0),I(this,"overrideMaterial",new zo),I(this,"backgroundColor",new Qt(395274)),I(this,"renderer"),I(this,"enabled",!0),I(this,"world"),I(this,"_lockRotation",!0),I(this,"_camera"),I(this,"_plane"),I(this,"_size",new At(320,160)),I(this,"_tempVector1",new O),I(this,"_tempVector2",new O),I(this,"_tempTarget",new O),I(this,"down",new O(0,-1,0)),I(this,"updatePlanes",()=>{if(!this.world.renderer)throw new Error("The given world must have a renderer!");const i=[],n=this.world.renderer.three;for(const o of n.clippingPlanes)i.push(o);i.push(this._plane),this.renderer.clippingPlanes=i}),this.world=t,!this.world.renderer)throw new Error("The given world must have a renderer!");this.renderer=new Fs,this.renderer.setSize(this._size.x,this._size.y);const e=1,s=this._size.x/this._size.y;this._camera=new Ti(e*s/-2,e*s/2,e/2,e/-2),this.world.renderer.onClippingPlanesUpdated.add(this.updatePlanes),this._camera.position.set(0,200,0),this._camera.zoom=.1,this._camera.rotation.x=-Math.PI/2,this._plane=new fe(this.down,200),this.updatePlanes()}get lockRotation(){return this._lockRotation}set lockRotation(t){this._lockRotation=t,t&&(this._camera.rotation.z=0)}get zoom(){return this._camera.zoom}set zoom(t){this._camera.zoom=t,this._camera.updateProjectionMatrix()}dispose(){this.enabled=!1,this.onBeforeUpdate.reset(),this.onAfterUpdate.reset(),this.onResize.reset(),this.overrideMaterial.dispose(),this.renderer.dispose(),this.onDisposed.trigger(),this.onDisposed.reset()}get(){return this._camera}update(){if(!this.enabled)return;this.onBeforeUpdate.trigger();const t=this.world.scene.three,e=this.world.camera;if(!e.hasCameraControls())throw new Error("The given world must use camera controls!");if(!(t instanceof Ci))throw new Error("The given world must have a THREE.Scene as a root!");const s=e.controls;if(s.getPosition(this._tempVector1),this._camera.position.x=this._tempVector1.x,this._camera.position.z=this._tempVector1.z,this.frontOffset!==0&&(s.getTarget(this._tempVector2),this._tempVector2.sub(this._tempVector1),this._tempVector2.normalize().multiplyScalar(this.frontOffset),this._camera.position.x+=this._tempVector2.x,this._camera.position.z+=this._tempVector2.z),!this._lockRotation){s.getTarget(this._tempTarget);const n=Math.atan2(this._tempTarget.x-this._tempVector1.x,this._tempTarget.z-this._tempVector1.z);this._camera.rotation.z=n+Math.PI}this._plane.set(this.down,this._tempVector1.y);const i=t.background;t.background=this.backgroundColor,this.renderer.render(t,this._camera),t.background=i,this.onAfterUpdate.trigger()}getSize(){return this._size}resize(t=this._size){this._size.copy(t),this.renderer.setSize(t.x,t.y);const e=t.x/t.y,s=1;this._camera.left=s*e/-2,this._camera.right=s*e/2,this._camera.top=s/2,this._camera.bottom=-s/2,this._camera.updateProjectionMatrix(),this.onResize.trigger(t)}}const $n=class Jn extends J{constructor(t){super(t),I(this,"onAfterUpdate",new M),I(this,"onBeforeUpdate",new M),I(this,"onDisposed",new M),I(this,"enabled",!0),I(this,"list",new Map),this.components.add(Jn.uuid,this)}create(t){if(this.list.has(t.uuid))throw new Error("This world already has a minimap!");const e=new Qa(t);return this.list.set(t.uuid,e),e}delete(t){const e=this.list.get(t);e&&e.dispose(),this.list.delete(t)}dispose(){for(const[t,e]of this.list)e.dispose();this.list.clear(),this.onDisposed.trigger()}update(){for(const[t,e]of this.list)e.update()}};I($n,"uuid","39ad6aad-84c8-4adf-a1e0-7f25313a9e7f");let uh=$n;class ja{constructor(t){I(this,"enabled",!1),I(this,"id","FirstPerson"),this.camera=t}set(t){if(this.enabled=t,t){if(this.camera.projection.current!=="Perspective"){this.camera.set("Orbit");return}this.setupFirstPersonCamera()}}setupFirstPersonCamera(){const t=this.camera.controls,e=new O;t.distance--,t.getPosition(e),t.minDistance=1,t.maxDistance=1,t.distance=1,t.moveTo(e.x,e.y,e.z),t.truckSpeed=50,t.mouseButtons.wheel=ot.ACTION.DOLLY,t.touches.two=ot.ACTION.TOUCH_ZOOM_TRUCK}}class qa{constructor(t){I(this,"enabled",!0),I(this,"id","Orbit"),this.camera=t,this.activateOrbitControls()}set(t){this.enabled=t,t&&this.activateOrbitControls()}activateOrbitControls(){const t=this.camera.controls;t.minDistance=1,t.maxDistance=300;const e=new O;t.getPosition(e);const s=e.length();t.distance=s,t.truckSpeed=2;const{rotation:i}=this.camera.three,n=new O(0,0,-1).applyEuler(i),o=e.addScaledVector(n,s);t.moveTo(o.x,o.y,o.z)}}class Ka{constructor(t){I(this,"enabled",!1),I(this,"id","Plan"),I(this,"mouseAction1"),I(this,"mouseAction2"),I(this,"mouseInitialized",!1),I(this,"defaultAzimuthSpeed"),I(this,"defaultPolarSpeed"),this.camera=t,this.defaultAzimuthSpeed=t.controls.azimuthRotateSpeed,this.defaultPolarSpeed=t.controls.polarRotateSpeed}set(t){this.enabled=t;const e=this.camera.controls;e.azimuthRotateSpeed=t?0:this.defaultAzimuthSpeed,e.polarRotateSpeed=t?0:this.defaultPolarSpeed,this.mouseInitialized||(this.mouseAction1=e.touches.one,this.mouseAction2=e.touches.two,this.mouseInitialized=!0),t?(e.mouseButtons.left=ot.ACTION.TRUCK,e.touches.one=ot.ACTION.TOUCH_TRUCK,e.touches.two=ot.ACTION.TOUCH_ZOOM):(e.mouseButtons.left=ot.ACTION.ROTATE,e.touches.one=this.mouseAction1,e.touches.two=this.mouseAction2)}}class $a{constructor(t){I(this,"onChanged",new M),I(this,"current","Perspective"),I(this,"camera"),I(this,"matchOrthoDistanceEnabled",!1),I(this,"_component"),I(this,"_previousDistance",-1),this._component=t,this.camera=t.three}async set(t){this.current!==t&&(t==="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 t=this.getPerspectiveDims();if(!t)return;const{width:e,height:s}=t;this.setupOrthoCamera(s,e),this.camera=this._component.threeOrtho,this.current="Orthographic"}getPerspectiveDims(){const t=this._component.currentWorld;if(!t||!t.renderer)return null;const e=new O;this._component.threePersp.getWorldDirection(e);const s=new O;this._component.controls.getTarget(s);const i=s.clone().sub(this._component.threePersp.position).dot(e),n=t.renderer.getSize(),o=n.x/n.y,r=this._component.threePersp,a=i*2*Math.atan(r.fov*(Math.PI/180)/2);return{width:a*o,height:a}}setupOrthoCamera(t,e){this._component.controls.mouseButtons.wheel=ot.ACTION.ZOOM,this._component.controls.mouseButtons.middle=ot.ACTION.ZOOM;const s=this._component.threePersp,i=this._component.threeOrtho;i.zoom=1,i.left=e/-2,i.right=e/2,i.top=t/2,i.bottom=t/-2,i.updateProjectionMatrix(),i.position.copy(s.position),i.quaternion.copy(s.quaternion),this._component.controls.camera=i}getDistance(){const t=this._component.threePersp,e=this._component.threeOrtho;return(e.top-e.bottom)/e.zoom/(2*Math.atan(t.fov*(Math.PI/180)/2))}async setPerspectiveCamera(){this._component.controls.mouseButtons.wheel=ot.ACTION.DOLLY,this._component.controls.mouseButtons.middle=ot.ACTION.DOLLY;const t=this._component.threePersp,e=this._component.threeOrtho;t.position.copy(e.position),t.quaternion.copy(e.quaternion),this._component.controls.mouseButtons.wheel=ot.ACTION.DOLLY,this.matchOrthoDistanceEnabled?this._component.controls.distance=this.getDistance():this._component.controls.distance=this._previousDistance,await this._component.controls.zoomTo(1),t.updateProjectionMatrix(),this._component.controls.camera=t,this.camera=t,this.current="Perspective"}}class Ih extends Ve{constructor(t){super(t),I(this,"projection"),I(this,"threeOrtho"),I(this,"threePersp"),I(this,"_userInputButtons",{}),I(this,"_frustumSize",50),I(this,"_navigationModes",new Map),I(this,"_mode",null),I(this,"previousSize",null),this.threePersp=this.three,this.threeOrtho=this.newOrthoCamera(),this.projection=new $a(this),this.onAspectUpdated.add(()=>{this.setOrthoPerspCameraAspect()}),this.projection.onChanged.add(e=>{this.three=e,this.updateAspect()}),this.onWorldChanged.add(({action:e})=>{e==="added"&&(this._navigationModes.clear(),this._navigationModes.set("Orbit",new qa(this)),this._navigationModes.set("FirstPerson",new ja(this)),this._navigationModes.set("Plan",new Ka(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,e=1.5){if(!this.enabled)return;const s=Number.MAX_VALUE,i=Number.MIN_VALUE,n=new O(s,s,s),o=new O(i,i,i);for(const l of t){const u=new st().setFromObject(l);u.min.xo.x&&(o.x=u.max.x),u.max.y>o.y&&(o.y=u.max.y),u.max.z>o.z&&(o.z=u.max.z)}const r=new st(n,o),a=new O;r.getSize(a);const h=new O;r.getCenter(h);const d=Math.max(a.x,a.y,a.z)*e,E=new Os(h,d);await this.controls.fitToSphere(E,!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 Ti(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(),e=this.threeOrtho.top,s=this.threeOrtho.right,i=t.y/this.previousSize.y,n=t.x/this.previousSize.x,o=e*i,r=s*n;this.threeOrtho.left=-r,this.threeOrtho.right=r,this.threeOrtho.top=o,this.threeOrtho.bottom=-o,this.threeOrtho.updateProjectionMatrix(),this.previousSize.copy(t)}}const Ja=new Map([[fi,{forRelating:"IsDecomposedBy",forRelated:"Decomposes"}],[Sn,{forRelating:"AssociatedTo",forRelated:"HasAssociations"}],[Nn,{forRelating:"ClassificationForObjects",forRelated:"HasAssociations"}],[yn,{forRelating:"IsGroupedBy",forRelated:"HasAssignments"}],[mi,{forRelated:"IsDefinedBy",forRelating:"DefinesOcurrence"}],[wn,{forRelated:"IsTypedBy",forRelating:"Types"}],[Ln,{forRelated:"IsDefinedBy",forRelating:"Defines"}],[Ri,{forRelated:"ContainedInStructure",forRelating:"ContainsElements"}],[Go,{forRelated:"AssignedToFlowElement",forRelating:"HasControlElements"}],[Vo,{forRelated:"ConnectedFrom",forRelating:"ConnectedTo"}]]),to=class ui extends J{constructor(t){super(t),I(this,"onDisposed",new M),I(this,"onRelationsIndexed",new M),I(this,"relationMaps",{}),I(this,"enabled",!0),I(this,"_relToAttributesMap",Ja),I(this,"_inverseAttributes",["IsDecomposedBy","Decomposes","AssociatedTo","HasAssociations","ClassificationForObjects","IsGroupedBy","HasAssignments","IsDefinedBy","DefinesOcurrence","IsTypedBy","Types","Defines","ContainedInStructure","ContainsElements","HasControlElements","AssignedToFlowElement","ConnectedTo","ConnectedFrom"]),I(this,"_ifcRels",[fi,Sn,Nn,yn,mi,wn,Ln,Ri]),I(this,"onFragmentsDisposed",e=>{delete this.relationMaps[e.groupID]}),this.components.add(ui.uuid,this),t.get(Et).onFragmentsDisposed.add(this.onFragmentsDisposed)}indexRelations(t,e,s,i){const n=Object.keys(e).find(E=>E.startsWith("Relating")),o=Object.keys(e).find(E=>E.startsWith("Related"));if(!(n&&o))return;const r=e[n].value,a=e[o].map(E=>E.value),h=t.get(r)??new Map,d=this.getAttributeIndex(i);d!==null&&(h.set(d,a),t.set(r,h));for(const E of a){const l=t.get(E)??new Map,u=this.getAttributeIndex(s);if(!u)continue;const C=l.get(u)??[];C.push(r),l.set(u,C),t.set(E,l)}}getAttributeIndex(t){const e=this._inverseAttributes.indexOf(t);return e===-1?null:e}setRelationMap(t,e){this.relationMaps[t.uuid]=e,this.onRelationsIndexed.trigger({modelID:t.uuid,relationsMap:e})}async process(t){if(!t.hasProperties)throw new Error("FragmentsGroup properties not found");let e=this.relationMaps[t.uuid];if(e)return e;e=new Map;for(const s of this._ifcRels){const i=await t.getAllPropertiesOfType(s);if(!i)continue;const n=this._relToAttributesMap.get(s);if(!n)continue;const{forRelated:o,forRelating:r}=n;for(const a in i){const h=i[a];this.indexRelations(e,h,o,r)}}return this.setRelationMap(t,e),e}async processFromWebIfc(t,e){const s=new Map;for(const i of this._ifcRels){const n=this._relToAttributesMap.get(i);if(!n)continue;const{forRelated:o,forRelating:r}=n,a=t.GetLineIDsWithType(e,i);for(let h=0;hi.x&&(i.x=o.x),o.y>i.y&&(i.y=o.y),o.z>i.z&&(i.z=o.z);return new st(e,s)}dispose(){const t=this.components.get(me);for(const e of this._meshes)t.destroy(e);this._meshes=[],this.onDisposed.trigger(Lt.uuid),this.onDisposed.reset()}get(){const t=this._absoluteMin.clone(),e=this._absoluteMax.clone();return new st(t,e)}getSphere(){const t=this._absoluteMin.clone(),e=this._absoluteMax.clone(),s=Math.abs((e.x-t.x)/2),i=Math.abs((e.y-t.y)/2),n=Math.abs((e.z-t.z)/2),o=new O(t.x+s,t.y+i,t.z+n),r=o.distanceTo(t);return new Os(o,r)}getMesh(){const t=new st(this._absoluteMin,this._absoluteMax),e=Lt.getDimensions(t),{width:s,height:i,depth:n,center:o}=e,r=new it(s,i,n),a=new U(r);return this._meshes.push(a),a.position.copy(o),a}reset(){this._absoluteMin=Lt.newBound(!0),this._absoluteMax=Lt.newBound(!1)}add(t){for(const e of t.items)this.addMesh(e.mesh)}addMesh(t,e){if(!t.geometry.index)return;const s=Lt.getFragmentBounds(t);t.updateMatrixWorld();const i=t.matrixWorld,n=new H,o=t instanceof jt,r=new Set;if(e&&t instanceof xo)for(const a of e){const h=t.fragment.getInstancesIDs(a);if(h)for(const d of h)r.add(d)}else r.add(0);for(const a of r){const h=s.min.clone(),d=s.max.clone();o&&(t.getMatrixAt(a,n),h.applyMatrix4(n),d.applyMatrix4(n)),h.applyMatrix4(i),d.applyMatrix4(i),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),d.x>this._absoluteMax.x&&(this._absoluteMax.x=d.x),d.y>this._absoluteMax.y&&(this._absoluteMax.y=d.y),d.z>this._absoluteMax.z&&(this._absoluteMax.z=d.z),d.xo.x&&(o.x=d),E>o.y&&(o.y=E),l>o.z&&(o.z=l)}return new st(n,o)}};I(io,"uuid","d1444724-dba6-4cdd-a0c7-68ee1450d166");let ph=io;const no=new Set([1123145078,574549367,1675464909,2059837836,3798115385,32440307,3125803723,3207858831,2740243338,2624227202,4240577450,3615266464,3724593414,220341763,477187591,1878645084,1300840506,3303107099,1607154358,1878645084,846575682,1351298697,2417041796,3049322572,3331915920,1416205885,776857604,3285139300,3958052878,2827736869,2732653382,673634403,3448662350,4142052618,2924175390,803316827,2556980723,1809719519,2205249479,807026263,3737207727,1660063152,2347385850,2705031697,3732776249,2485617015,2611217952,1704287377,2937912522,2770003689,1281925730,1484403080,3448662350,4142052618,3800577675,4006246654,3590301190,1383045692,2775532180,2047409740,370225590,3593883385,2665983363,4124623270,812098782,3649129432,987898635,1105321065,3510044353,1635779807,2603310189,3406155212,1310608509,4261334040,2736907675,3649129432,1136057603,1260505505,4182860854,2713105998,2898889636,59481748,3749851601,3486308946,3150382593,1062206242,3264961684,15328376,1485152156,370225590,1981873012,2859738748,45288368,2614616156,2732653382,775493141,2147822146,2601014836,2629017746,1186437898,2367409068,1213902940,3632507154,3900360178,476780140,1472233963,2804161546,3008276851,738692330,374418227,315944413,3905492369,3570813810,2571569899,178912537,2294589976,1437953363,2133299955,572779678,3092502836,388784114,2624227202,1425443689,3057273783,2347385850,1682466193,2519244187,2839578677,3958567839,2513912981,2830218821,427810014]),oo=class ro extends J{constructor(t){super(t),I(this,"enabled",!0),t.add(ro.uuid,this)}async export(t,e,s=!1,i=!0){const n={},o=new Set(t.GetIfcEntityList(e)),r=new Set([Fi,Ai,gi,Oi,Kt]);for(const a of r)o.add(a);for(const a of o){if(no.has(a))continue;const h=r.has(a)&&i,d=t.GetLineIDsWithType(e,a);for(const E of d){const l=t.GetLine(0,E,h,s);n[l.expressID]=l}}return n}};I(oo,"uuid","b32c4332-cd67-436e-ba7f-196646c7a635");let th=oo;const ao={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 qt{static async getUnits(t){var e,s,i;const{IFCUNITASSIGNMENT:n}=yt,o=await t.getAllPropertiesOfType(n);if(!o)return 1;const r=Object.keys(o),a=o[parseInt(r[0],10)];for(const h of a.Units){if(h.value===void 0||h.value===null)continue;const d=await t.getProperties(h.value);if(!d||!d.UnitType||!d.UnitType.value||d.UnitType.value!=="LENGTHUNIT")continue;let E=1,l=1;return d.Name.value==="METRE"&&(l=1),d.Name.value==="FOOT"&&(l=.3048),((e=d.Prefix)==null?void 0:e.value)==="MILLI"?E=.001:((s=d.Prefix)==null?void 0:s.value)==="CENTI"?E=.01:((i=d.Prefix)==null?void 0:i.value)==="DECI"&&(E=.1),l*E}return 1}static async findItemByGuid(t,e){var s;const i=t.getAllPropertiesIDs();for(const n of i){const o=await t.getProperties(n);if(o&&((s=o.GlobalId)==null?void 0:s.value)===e)return o}return null}static async getRelationMap(t,e,s){var i;const n=s??(async()=>{}),o={},r=t.getAllPropertiesIDs();for(const a of r){const h=await t.getProperties(a);if(!h)continue;const d=h.type===e,E=Object.keys(h).find(m=>m.startsWith("Relating")),l=Object.keys(h).find(m=>m.startsWith("Related"));if(!(d&&E&&l))continue;const u=await t.getProperties((i=h[E])==null?void 0:i.value),C=h[l];if(!u||!C||!(C&&Array.isArray(C)))continue;const T=C.map(m=>m.value);await n(u.expressID,T),o[u.expressID]=T}return o}static async getQsetQuantities(t,e,s){const i=s??(()=>{}),n=await t.getProperties(e);return!n||n.type!==Do?null:(n.Quantities??[{}]).map(o=>(o.value&&i(o.value),o.value)).filter(o=>o!==null)}static async getPsetProps(t,e,s){const i=s??(()=>{}),n=await t.getProperties(e);return!n||n.type!==Js?null:(n.HasProperties??[{}]).map(o=>(o.value&&i(o.value),o.value)).filter(o=>o!==null)}static async getPsetRel(t,e){var s;if(!await t.getProperties(e))return null;const i=await t.getAllPropertiesOfType(mi);if(!i)return null;const n=Object.values(i);let o=null;for(const r of n)((s=r.RelatingPropertyDefinition)==null?void 0:s.value)===e&&(o=r.expressID);return o}static async getQsetRel(t,e){return qt.getPsetRel(t,e)}static async getEntityName(t,e){var s;const i=await t.getProperties(e);if(!i)return{key:null,name:null};const n=Object.keys(i).find(r=>r.endsWith("Name"))??null,o=n?(s=i[n])==null?void 0:s.value:null;return{key:n,name:o}}static async getQuantityValue(t,e){const s=await t.getProperties(e);if(!s)return{key:null,value:null};const i=Object.keys(s).find(o=>o.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(t){return ao[t].startsWith("IFCREL")}static async attributeExists(t,e,s){const i=await t.getProperties(e);return i?Object.keys(i).includes(s):!1}static async groupEntitiesByType(t,e){var s;const i=new Map;for(const n of e){const o=await t.getProperties(n);if(!o)continue;const r=o.type;i.get(r)||i.set(r,new Set),(s=i.get(r))==null||s.add(n)}return i}}class eh{constructor(){I(this,"factor",1),I(this,"complement",1)}apply(t){const e=this.getScaleMatrix().multiply(t);t.copy(e)}setUp(t){var e,s,i;this.factor=1;const n=this.getLengthUnits(t);if(!n)return;const o=n==null,r=n.Name===void 0||n.Name===null;o||r||(n.Name.value==="FOOT"&&(this.factor=.3048),((e=n.Prefix)==null?void 0:e.value)==="MILLI"?this.complement=.001:((s=n.Prefix)==null?void 0:s.value)==="CENTI"?this.complement=.01:((i=n.Prefix)==null?void 0:i.value)==="DECI"&&(this.complement=.01))}getLengthUnits(t){try{const e=t.GetLineIDsWithType(0,$o).get(0),s=t.GetLine(0,e);for(const i of s.Units){if(!i||i.value===null||i.value===void 0)continue;const n=t.GetLine(0,i.value);if(n.UnitType&&n.UnitType.value==="LENGTHUNIT")return n}return null}catch{return console.log("Could not get units"),null}}getScaleMatrix(){const t=this.factor;return new H().fromArray([t,0,0,0,0,t,0,0,0,0,t,0,0,0,0,1])}}class ho{constructor(){I(this,"itemsByFloor",{}),I(this,"_units",new eh)}setUp(t){this._units.setUp(t),this.cleanUp();try{const e=t.GetLineIDsWithType(0,Ri),s=new Set,i=t.GetLineIDsWithType(0,Kt);for(let h=0;h{this.getMesh(n,e)});for(const n of this._visitedFragments){const{index:o,fragment:r}=n[1];e.keyFragments.set(o,r.id)}for(const n of e.items){const o=this._fragmentInstances.get(n.id);if(!o)throw new Error("Fragment not found!");const r=[];for(const[a,h]of o)r.push(h);n.add(r)}const i=this.webIfc.GetCoordinationMatrix(0);return e.coordinationMatrix.fromArray(i),e.civilData=this._civil.read(this.webIfc),e}getMesh(t,e){const s=t.geometries.size(),i=t.expressID;for(let n=0;no.value!==s),await t.setProperties(s,null),this.registerChange(t,e,s))}async addElementToPset(t,e,...s){const i=await qt.getPsetRel(t,e);if(!i)return;const n=await t.getProperties(i);if(!n)return;for(const r of s){const a=new ke(r);n.RelatedObjects.push(a),this.onElementToPset.trigger({model:t,psetID:e,elementID:r})}this.registerChange(t,e);const o=this.components.get(Ns);for(const r of s)o.addEntityRelations(t,r,"IsDefinedBy",e)}async addPropToPset(t,e,...s){const i=await t.getProperties(e);if(i){for(const n of s){if(i.HasProperties.includes(n))continue;const o=new ke(n);i.HasProperties.push(o),this.onPropToPset.trigger({model:t,psetID:e,propID:n})}this.registerChange(t,e)}}async saveToIfc(t,e){const s=this.components.get(sh),i=s.webIfc,n=await s.readIfcFile(e),o=this.changeMap[t.uuid]??[];for(const a of o){const h=await t.getProperties(a);if(h)try{i.WriteLine(n,h)}catch{}else try{i.DeleteLine(n,a)}catch{}}const r=i.SaveModel(n);return s.webIfc.CloseModel(n),s.cleanUp(),r}async setAttributeListener(t,e,s){this.attributeListeners[t.uuid]||(this.attributeListeners[t.uuid]={});const i=this.attributeListeners[t.uuid][e]?this.attributeListeners[t.uuid][e][s]:null;if(i)return i;const n=await t.getProperties(e);if(!n)throw new Error(`Entity with expressID ${e} doesn't exists.`);const o=n[s];if(Array.isArray(o)||!o)throw new Error(`Attribute ${s} is array or null, and it can't have a listener.`);const r=o.value;if(r===void 0||r==null)throw new Error(`Attribute ${s} has a badly defined handle.`);const a=new M;return Object.defineProperty(n[s],"value",{get(){return this._value},async set(h){this._value=h,a.trigger(h)}}),n[s].value=r,this.attributeListeners[t.uuid][e]||(this.attributeListeners[t.uuid][e]={}),this.attributeListeners[t.uuid][e][s]=a,a}increaseMaxID(t){return t.ifcMetadata.maxExpressID++,t.ifcMetadata.maxExpressID}newGUID(t){const e=ue.getIFCSchema(t);return new yt[e].IfcGloballyUniqueId(Pi.create())}async getOwnerHistory(t){const e=await t.getAllPropertiesOfType(bo);if(!e)throw new Error("No OwnerHistory was found.");const s=Object.keys(e).map(o=>parseInt(o,10)),i=e[s[0]],n=new ke(i.expressID);return{ownerHistory:i,ownerHistoryHandle:n}}registerChange(t,...e){this.changeMap[t.uuid]||(this.changeMap[t.uuid]=new Set);for(const s of e)this.changeMap[t.uuid].add(s),this.onDataChanged.trigger({model:t,expressID:s})}async newSingleProperty(t,e,s,i){const n=ue.getIFCSchema(t),o=new yt[n].IfcIdentifier(s),r=new yt[n][e](i),a=new yt[n].IfcPropertySingleValue(o,null,r,null);return a.expressID=this.increaseMaxID(t),await this.setData(t,a),a}};I(ih,"uuid","58c2d9f0-183c-48d6-a402-dfcf5b9a34df");const Io=class po extends J{constructor(t){super(t),I(this,"enabled",!0),I(this,"list",{}),I(this,"onDisposed",new M),I(this,"onFragmentsDisposed",e=>{const{groupID:s,fragmentIDs:i}=e;for(const n in this.list){const o=this.list[n],r=Object.keys(o);if(r.includes(s))delete o[s],Object.values(o).length===0&&delete this.list[n];else for(const a of r){const h=o[a];for(const d of i)delete h.map[d];Object.values(h).length===0&&delete o[a]}}}),t.add(po.uuid,this),t.get(Et).onFragmentsDisposed.add(this.onFragmentsDisposed)}dispose(){this.list={},this.components.get(Et).onFragmentsDisposed.remove(this.onFragmentsDisposed),this.onDisposed.trigger(),this.onDisposed.reset()}remove(t){for(const e in this.list){const s=this.list[e];for(const i in s){const n=s[i];delete n.map[t]}}}find(t){const e=this.components.get(Et);if(!t){const o={};for(const[r,a]of e.list)o[r]=new Set(a.ids);return o}const s=Object.keys(t).length,i={};for(const o in t){const r=t[o];if(!this.list[o]){console.warn(`Classification ${o} does not exist.`);continue}for(const a of r){const h=this.list[o][a];if(h)for(const d in h.map){i[d]||(i[d]=new Map);for(const E of h.map[d]){const l=i[d].get(E);l===void 0?i[d].set(E,1):i[d].set(E,l+1)}}}}const n={};for(const o in i){const r=i[o];for(const[a,h]of r){if(h===void 0)throw new Error("Malformed fragments map!");h===s&&(n[o]||(n[o]=new Set),n[o].add(a))}}return n}byModel(t,e){this.list.models||(this.list.models={});const s=this.list.models;s[t]||(s[t]={map:{},id:null,name:t});const i=s[t];for(const[n,o]of e.data){const r=o[0];for(const a of r){const h=e.keyFragments.get(a);h&&(i.map[h]||(i.map[h]=new Set),i.map[h].add(n))}}}async byPredefinedType(t){var e;this.list.predefinedTypes||(this.list.predefinedTypes={});const s=this.list.predefinedTypes,i=t.getAllPropertiesIDs();for(const n of i){const o=await t.getProperties(n);if(!o)continue;const r=String((e=o.PredefinedType)==null?void 0:e.value).toUpperCase();s[r]||(s[r]={map:{},id:null,name:r});const a=s[r];for(const[h,d]of t.data){const E=d[0];for(const l of E){const u=t.keyFragments.get(l);if(!u)throw new Error("Fragment ID not found!");a.map[u]||(a.map[u]=new Set),a.map[u].add(o.expressID)}}}}byEntity(t){this.list.entities||(this.list.entities={});for(const[e,s]of t.data){const i=s[1][1],n=ao[i];this.saveItem(t,"entities",n,e)}}async byIfcRel(t,e,s){qt.isRel(e)&&await qt.getRelationMap(t,e,async(i,n)=>{const{name:o}=await qt.getEntityName(t,i);for(const r of n)this.saveItem(t,s,o??"NO REL NAME",r)})}async bySpatialStructure(t,e={}){var s,i;const n=this.components.get(Ns),o=n.relationMaps[t.uuid];if(!o)throw new Error(`Classifier: model relations of ${t.name||t.uuid} have to exists to group by spatial structure.`);const r="spatialStructures",a=e.useProperties===void 0||e.useProperties;for(const[h]of o){if(e.isolate){const u=t.data.get(h);if(!u)continue;const C=u[1][1];if(C===void 0||!e.isolate.has(C))continue}const d=n.getEntityRelations(t,h,"Decomposes");if(d)for(const u of d){let C=u.toString();if(a){const T=await t.getProperties(u);if(!T)continue;C=(s=T.Name)==null?void 0:s.value}this.saveItem(t,r,C,h,u)}const E=n.getEntityRelations(t,h,"ContainsElements");if(!E)continue;let l=h.toString();if(a){const u=await t.getProperties(h);if(!u)continue;l=(i=u.Name)==null?void 0:i.value}for(const u of E){this.saveItem(t,r,l,u,h);const C=n.getEntityRelations(t,Number(u),"IsDecomposedBy");if(C)for(const T of C)this.saveItem(t,r,l,T,h)}}}setColor(t,e,s=!1){const i=this.components.get(Et);for(const n in t){const o=i.list.get(n);if(!o)continue;const r=t[n];o.setColor(e,r,s)}}resetColor(t){const e=this.components.get(Et);for(const s in t){const i=e.list.get(s);if(!i)continue;const n=t[s];i.resetColor(n)}}saveItem(t,e,s,i,n=null){this.list[e]||(this.list[e]={});const o=t.data.get(i);if(o)for(const r of o[0]){const a=t.keyFragments.get(r);if(a){const h=this.list[e];h[s]||(h[s]={map:{},id:n,name:s}),h[s].map[a]||(h[s].map[a]=new Set),h[s].map[a].add(i)}}}};I(Io,"uuid","e25a7f3c-46c4-4a14-9d3d-5115f24ebeb7");let nh=Io;const Co=class To extends J{constructor(t){super(t),I(this,"onDisposed",new M),I(this,"enabled",!0),I(this,"height",10),I(this,"groupName","spatialStructures"),I(this,"list",new Set),t.add(To.uuid,this)}dispose(){this.list.clear(),this.onDisposed.trigger(),this.onDisposed.reset()}set(t){if(!this.enabled)return;const e=this.components.get(nh),s=this.components.get(Et),i=t?1:-1;let n=0;const o=e.list[this.groupName],r=new H;for(const a in o){r.elements[13]=n*i*this.height;for(const h in o[a].map){const d=s.list.get(h),E=a+h,l=this.list.has(E);if(!d||t&&l||!t&&!l)continue;t?this.list.add(E):this.list.delete(E);const u=o[a].map[h];d.applyTransform(u,r),d.mesh.computeBoundingSphere(),d.mesh.computeBoundingBox()}n++}}};I(Co,"uuid","d260618b-ce88-4c7d-826c-6debb91de3e2");let Ch=Co;const mo=class fo extends J{constructor(t){super(t),I(this,"enabled",!0),this.components.add(fo.uuid,this)}set(t,e){const s=this.components.get(Et);if(!e){for(const[i,n]of s.list)n&&(n.setVisibility(t),this.updateCulledVisibility(n));return}for(const i in e){const n=e[i],o=s.list.get(i);o&&(o.setVisibility(t,n),this.updateCulledVisibility(o))}}isolate(t){this.set(!1),this.set(!0,t)}updateCulledVisibility(t){const e=this.components.get(Za);for(const[s,i]of e.list){const n=i.colorMeshes.get(t.id);n&&(n.count=t.mesh.count)}}};I(mo,"uuid","dd9ccf2d-8a21-4821-b7f6-2949add16a29");let Th=mo;class oh extends Di{constructor(){super(...arguments),I(this,"minGeometrySize",10),I(this,"minAssetsSize",1e3)}}const Ro=class Fo extends J{constructor(t){super(t),I(this,"onGeometryStreamed",new M),I(this,"onAssetStreamed",new M),I(this,"onProgress",new M),I(this,"onIfcLoaded",new M),I(this,"onDisposed",new M),I(this,"settings",new oh),I(this,"enabled",!0),I(this,"webIfc",new Ce),I(this,"_spatialTree",new ho),I(this,"_metaData",new lo),I(this,"_visitedGeometries",new Map),I(this,"_streamSerializer",new Bo),I(this,"_geometries",new Map),I(this,"_geometryCount",0),I(this,"_civil",new co),I(this,"_groupSerializer",new Pn),I(this,"_assets",[]),I(this,"_meshesWithHoles",new Set),this.components.add(Fo.uuid,this),this.settings.excludedCategories.add(Mn)}dispose(){this.onIfcLoaded.reset(),this.onGeometryStreamed.reset(),this.onAssetStreamed.reset(),this.webIfc=null,this.onDisposed.trigger(),this.onDisposed.reset()}async streamFromBuffer(t){await this.readIfcFile(t),await this.streamAllGeometries(),this.cleanUp()}async streamFromCallBack(t){await this.streamIfcFile(t),await this.streamAllGeometries(),this.cleanUp()}async readIfcFile(t){const{path:e,absolute:s,logLevel:i}=this.settings.wasm;this.webIfc.SetWasmPath(e,s),await this.webIfc.Init(),i&&this.webIfc.SetLogLevel(i),this.webIfc.OpenModel(t,this.settings.webIfc)}async streamIfcFile(t){const{path:e,absolute:s,logLevel:i}=this.settings.wasm;this.webIfc.SetWasmPath(e,s),await this.webIfc.Init(),i&&this.webIfc.SetLogLevel(i),this.webIfc.OpenModelFromCallback(t,this.settings.webIfc)}async streamAllGeometries(){const{minGeometrySize:t,minAssetsSize:e}=this.settings;this._spatialTree.setUp(this.webIfc);const s=this.webIfc.GetIfcEntityList(0),i=[[]],n=new Dn;n.ifcMetadata={name:"",description:"",...this._metaData.getNameInfo(this.webIfc),...this._metaData.getDescriptionInfo(this.webIfc),schema:this.webIfc.GetModelSchema(0)||"IFC2X3",maxExpressID:this.webIfc.GetMaxExpressID(0)};let o=0,r=0;for(const C of s){if(!this.webIfc.IsIfcElement(C)&&C!==Kt||this.settings.excludedCategories.has(C))continue;const T=this.webIfc.GetLineIDsWithType(0,C),m=T.size();for(let f=0;ft&&(o=0,r++,i.push([]));const R=T.get(f);i[r].push(R);const A=this.webIfc.GetLine(0,R);if(A.GlobalId){const F=(A==null?void 0:A.GlobalId.value)||(A==null?void 0:A.GlobalId);n.globalToExpressIDs.set(F,R)}const p=this._spatialTree.itemsByFloor[R]||0;n.data.set(R,[[],[p,C]]),o++}}this._spatialTree.cleanUp();let a=.01,h=0;for(const C of i){h++,this.webIfc.StreamMeshes(0,C,m=>{this.getMesh(this.webIfc,m,n)}),this._geometryCount>t&&await this.streamGeometries(),this._assets.length>e&&await this.streamAssets();const T=h/i.length;T>a&&(a+=.01,a=Math.max(a,T),this.onProgress.trigger(Math.round(a*100)/100))}this._geometryCount&&await this.streamGeometries(),this._assets.length&&await this.streamAssets();const{opaque:d,transparent:E}=n.geometryIDs;for(const[C,{index:T,uuid:m}]of this._visitedGeometries)n.keyFragments.set(T,m),(C>1?d:E).set(C,T);Eo.get(n,this.webIfc);const l=this.webIfc.GetCoordinationMatrix(0);n.coordinationMatrix.fromArray(l),n.civilData=this._civil.read(this.webIfc);const u=this._groupSerializer.export(n);this.onIfcLoaded.trigger(u),n.dispose(!0)}cleanUp(){this.webIfc.Dispose(),this.webIfc=null,this.webIfc=new Ce,this._visitedGeometries.clear(),this._geometries.clear(),this._assets=[],this._meshesWithHoles.clear()}getMesh(t,e,s){const i=e.geometries.size(),n=e.expressID,o={id:n,geometries:[]};for(let r=0;ri&&(i=Math.round(i*100)/100,await this.onProgress.trigger(i),i+=.01)}await this.onProgress.trigger(1);const o=await this.components.get(Ns).processFromWebIfc(this.webIfc,0);await this.onIndicesStreamed.trigger(o)}cleanUp(){this.webIfc.Dispose(),this.webIfc=null,this.webIfc=new Ce}}I(ah,"uuid","88d2c89c-ce32-47d7-8cb6-d51e4b311a0b");const Ao=class go extends J{constructor(t){super(t),I(this,"enabled",!0),t.add(go.uuid,this)}static distanceFromPointToLine(t,e,s,i=!1){const n=new Ft,o=new O;return n.set(e,s),n.closestPointToPoint(t,i,o),o.distanceTo(t)}getFace(t,e,s){if(!t.geometry.index)throw new Error("Geometry must be indexed!");const i=new Map,n=t.geometry.index.array,{plane:o}=this.getFaceData(e,s,t),r=[];for(let E=0;Ep.id);if(!u.size){const p=a++;for(const{id:F}of l)h.set(F,p);d.set(p,{edges:new Set(C),indices:new Set([E])});continue}let T=null;const m=new Set,f=new Set(C);for(const[p,F]of u){T===null?T=F:F!==T&&m.add(F),h.delete(p);const{edges:g}=d.get(F);g.delete(p),f.delete(p)}if(T===null)throw new Error("Error computing face!");const R=d.get(T),{indices:A}=R;A.add(E);for(const p of f){h.set(p,T);const{edges:F}=R;F.add(p)}for(const p of m){const F=d.get(p),{edges:g,indices:_}=F,S=d.get(T),{edges:y,indices:w}=S;for(const L of g)y.add(L),h.set(L,T);for(const L of _)w.add(L);d.delete(p)}}for(const[E,{indices:l,edges:u}]of d)if(l.has(e)){const C=[];for(const T of u){const m=i.get(T);C.push(m)}return{edges:C,indices:l}}return null}getVerticesAndNormal(t,e,s){if(!t.geometry.index)throw new Error("Geometry must be indexed!");const i=t.geometry.index.array,n=t.geometry.attributes.position.array,o=t.geometry.attributes.normal.array,r=i[e*3]*3,a=i[e*3+1]*3,h=i[e*3+2]*3,d=new O(n[r],n[r+1],n[r+2]),E=new O(n[a],n[a+1],n[a+2]),l=new O(n[h],n[h+1],n[h+2]),u=new O(o[r],o[r+1],o[r+2]),C=new O(o[a],o[a+1],o[a+2]),T=new O(o[h],o[h+1],o[h+2]),m=(u.x+C.x+T.x)/3,f=(u.y+C.y+T.y)/3,R=(u.z+C.z+T.z)/3,A=new O(m,f,R);if(s!==void 0&&t instanceof jt){const p=new H;t.getMatrixAt(s,p);const F=new H;F.extractRotation(p),A.applyMatrix4(F),d.applyMatrix4(p),E.applyMatrix4(p),l.applyMatrix4(p)}return{p1:d,p2:E,p3:l,faceNormal:A}}round(t){t.x=Math.trunc(t.x*1e3)/1e3,t.y=Math.trunc(t.y*1e3)/1e3,t.z=Math.trunc(t.z*1e3)/1e3}getVolumeFromFragments(t){const e=this.components.get(Et),s=new H,i=[];for(const o in t){const r=e.list.get(o);if(!r)continue;const a=t[o];let h=0;for(const l of a){const u=r.getInstancesIDs(l);u&&(h+=u.size)}const d=new jt(r.mesh.geometry,void 0,h);let E=0;for(const l of a){const u=r.getInstancesIDs(l);if(u)for(const C of u)r.mesh.getMatrixAt(C,s),d.setMatrixAt(E++,s)}i.push(d)}const n=this.getVolumeFromMeshes(i);for(const o of i)o.geometry=null,o.material=[],o.dispose();return n}getVolumeFromMeshes(t){let e=0;for(const s of t)e+=this.getVolumeOfMesh(s);return e}getFaceData(t,e,s){const i=this.getVerticesAndNormal(s,t,e),{p1:n,p2:o,p3:r,faceNormal:a}=i;this.round(n),this.round(o),this.round(r),this.round(a);const h=[{id:`${n.x}|${n.y}|${n.z}`,value:n},{id:`${o.x}|${o.y}|${o.z}`,value:o},{id:`${r.x}|${r.y}|${r.z}`,value:r}];h.sort((R,A)=>R.idA.id?1:0);const[{id:d,value:E},{id:l,value:u},{id:C,value:T}]=h,m=[{id:`${d}|${l}`,distance:E.distanceTo(u),points:[E,u]},{id:`${l}|${C}`,distance:u.distanceTo(T),points:[u,T]},{id:`${d}|${C}`,distance:E.distanceTo(T),points:[E,T]}],f=new fe;return f.setFromNormalAndCoplanarPoint(a,n),f.constant=Math.round(f.constant*10)/10,{plane:f,edges:m}}getVolumeOfMesh(t){let e=0;const s=new O,i=new O,n=new O,{index:o}=t.geometry,r=t.geometry.attributes.position.array;if(!o)return console.warn("Geometry must be indexed to compute its volume!"),0;const a=[];if(t instanceof jt)for(let d=0;d{if(this.isProcessing)return;const n=i.data.colors;this._recentlyHiddenMeshes=new Set(this._currentVisibleMeshes),this._currentVisibleMeshes.clear();for(const[o,r]of n){if(r{this.isProcessing||await this.updateVisibility()},this.updateInterval),this.onViewUpdated.add(({seen:i,unseen:n})=>{for(const o of i)o.visible=!0;for(const o of n)o.visible=!1})}dispose(){super.dispose(),this._intervalID!==null&&(window.clearInterval(this._intervalID),this._intervalID=null),this._currentVisibleMeshes.clear(),this._recentlyHiddenMeshes.clear(),this._meshIDColorCodeMap.clear(),this._transparentMat.dispose(),this._colorCodeMeshMap.clear();const t=this.components.get(me);for(const e in this.colorMeshes){const s=this.colorMeshes.get(e);s&&t.destroy(s,!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 e=t instanceof jt,{geometry:s,material:i}=t,{colorMaterial:n,code:o}=this.getAvailableMaterial();let r;if(Array.isArray(i)){let d=!0;const E=[];for(const l of i)cn.isTransparent(l)?E.push(this._transparentMat):(d=!1,E.push(n));if(d){n.dispose(),this.isProcessing=!1;return}r=E}else if(cn.isTransparent(i)){n.dispose(),this.isProcessing=!1;return}else r=n;this._colorCodeMeshMap.set(o,t),this._meshIDColorCodeMap.set(t.uuid,o);const a=e?t.count:1,h=new jt(s,r,a);e?h.instanceMatrix=t.instanceMatrix:h.setMatrixAt(0,new H),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 e=this.components.get(me);this._currentVisibleMeshes.delete(t),this._recentlyHiddenMeshes.delete(t);const s=this.colorMeshes.get(t.uuid),i=this._meshIDColorCodeMap.get(t.uuid);if(!s||!i){this.isProcessing=!1;return}this._colorCodeMeshMap.delete(i),this._meshIDColorCodeMap.delete(t.uuid),this.colorMeshes.delete(t.uuid),s.geometry=void 0,s.material=[],e.destroy(s,!0),this._recentlyHiddenMeshes.delete(t),this._currentVisibleMeshes.delete(t),this.isProcessing=!1}updateInstanced(t){for(const e of t){const s=this.colorMeshes.get(e.uuid);s&&(s.count=e.count)}}getAvailableMaterial(){const{r:t,g:e,b:s,code:i}=this.getAvailableColor(),n=Ls.enabled;Ls.enabled=!1;const o=new Qt(`rgb(${t}, ${e}, ${s})`);if(!this.world.renderer)throw new Error("Renderer not found in the world!");const r=this.world.renderer.clippingPlanes,a=new Te({color:o,clippingPlanes:r,side:He});return Ls.enabled=n,{colorMaterial:a,code:i}}}const to=class Ei extends J{constructor(t){super(t),I(this,"onDisposed",new M),I(this,"_enabled",!0),I(this,"list",new Map),t.add(Ei.uuid,this)}get enabled(){return this._enabled}set enabled(t){this._enabled=t;for(const[e,s]of this.list)s.enabled=t}create(t,e){if(this.list.has(t.uuid))return this.list.get(t.uuid);const s=new Qa(this.components,t,e);return this.list.set(t.uuid,s),s}delete(t){const e=this.list.get(t.uuid);e&&e.dispose(),this.list.delete(t.uuid)}dispose(){this.enabled=!1,this.onDisposed.trigger(Ei.uuid),this.onDisposed.reset();for(const[t,e]of this.list)e.dispose();this.list.clear()}updateInstanced(t){for(const[,e]of this.list)e.updateInstanced(t)}};I(to,"uuid","69f2a50d-c266-44fc-b1bd-fa4d34be89e6");let ja=to;class qa{constructor(t){if(I(this,"onDisposed",new M),I(this,"onAfterUpdate",new M),I(this,"onBeforeUpdate",new M),I(this,"onResize",new M),I(this,"frontOffset",0),I(this,"overrideMaterial",new Wo),I(this,"backgroundColor",new Qt(395274)),I(this,"renderer"),I(this,"enabled",!0),I(this,"world"),I(this,"_lockRotation",!0),I(this,"_camera"),I(this,"_plane"),I(this,"_size",new At(320,160)),I(this,"_tempVector1",new O),I(this,"_tempVector2",new O),I(this,"_tempTarget",new O),I(this,"down",new O(0,-1,0)),I(this,"updatePlanes",()=>{if(!this.world.renderer)throw new Error("The given world must have a renderer!");const i=[],n=this.world.renderer.three;for(const o of n.clippingPlanes)i.push(o);i.push(this._plane),this.renderer.clippingPlanes=i}),this.world=t,!this.world.renderer)throw new Error("The given world must have a renderer!");this.renderer=new Fs,this.renderer.setSize(this._size.x,this._size.y);const e=1,s=this._size.x/this._size.y;this._camera=new Ti(e*s/-2,e*s/2,e/2,e/-2),this.world.renderer.onClippingPlanesUpdated.add(this.updatePlanes),this._camera.position.set(0,200,0),this._camera.zoom=.1,this._camera.rotation.x=-Math.PI/2,this._plane=new fe(this.down,200),this.updatePlanes()}get lockRotation(){return this._lockRotation}set lockRotation(t){this._lockRotation=t,t&&(this._camera.rotation.z=0)}get zoom(){return this._camera.zoom}set zoom(t){this._camera.zoom=t,this._camera.updateProjectionMatrix()}dispose(){this.enabled=!1,this.onBeforeUpdate.reset(),this.onAfterUpdate.reset(),this.onResize.reset(),this.overrideMaterial.dispose(),this.renderer.dispose(),this.onDisposed.trigger(),this.onDisposed.reset()}get(){return this._camera}update(){if(!this.enabled)return;this.onBeforeUpdate.trigger();const t=this.world.scene.three,e=this.world.camera;if(!e.hasCameraControls())throw new Error("The given world must use camera controls!");if(!(t instanceof Ci))throw new Error("The given world must have a THREE.Scene as a root!");const s=e.controls;if(s.getPosition(this._tempVector1),this._camera.position.x=this._tempVector1.x,this._camera.position.z=this._tempVector1.z,this.frontOffset!==0&&(s.getTarget(this._tempVector2),this._tempVector2.sub(this._tempVector1),this._tempVector2.normalize().multiplyScalar(this.frontOffset),this._camera.position.x+=this._tempVector2.x,this._camera.position.z+=this._tempVector2.z),!this._lockRotation){s.getTarget(this._tempTarget);const n=Math.atan2(this._tempTarget.x-this._tempVector1.x,this._tempTarget.z-this._tempVector1.z);this._camera.rotation.z=n+Math.PI}this._plane.set(this.down,this._tempVector1.y);const i=t.background;t.background=this.backgroundColor,this.renderer.render(t,this._camera),t.background=i,this.onAfterUpdate.trigger()}getSize(){return this._size}resize(t=this._size){this._size.copy(t),this.renderer.setSize(t.x,t.y);const e=t.x/t.y,s=1;this._camera.left=s*e/-2,this._camera.right=s*e/2,this._camera.top=s/2,this._camera.bottom=-s/2,this._camera.updateProjectionMatrix(),this.onResize.trigger(t)}}const eo=class so extends J{constructor(t){super(t),I(this,"onAfterUpdate",new M),I(this,"onBeforeUpdate",new M),I(this,"onDisposed",new M),I(this,"enabled",!0),I(this,"list",new Map),this.components.add(so.uuid,this)}create(t){if(this.list.has(t.uuid))throw new Error("This world already has a minimap!");const e=new qa(t);return this.list.set(t.uuid,e),e}delete(t){const e=this.list.get(t);e&&e.dispose(),this.list.delete(t)}dispose(){for(const[t,e]of this.list)e.dispose();this.list.clear(),this.onDisposed.trigger()}update(){for(const[t,e]of this.list)e.update()}};I(eo,"uuid","39ad6aad-84c8-4adf-a1e0-7f25313a9e7f");let Ih=eo;class Ka{constructor(t){I(this,"enabled",!1),I(this,"id","FirstPerson"),this.camera=t}set(t){if(this.enabled=t,t){if(this.camera.projection.current!=="Perspective"){this.camera.set("Orbit");return}this.setupFirstPersonCamera()}}setupFirstPersonCamera(){const t=this.camera.controls,e=new O;t.distance--,t.getPosition(e),t.minDistance=1,t.maxDistance=1,t.distance=1,t.moveTo(e.x,e.y,e.z),t.truckSpeed=50,t.mouseButtons.wheel=ot.ACTION.DOLLY,t.touches.two=ot.ACTION.TOUCH_ZOOM_TRUCK}}class $a{constructor(t){I(this,"enabled",!0),I(this,"id","Orbit"),this.camera=t,this.activateOrbitControls()}set(t){this.enabled=t,t&&this.activateOrbitControls()}activateOrbitControls(){const t=this.camera.controls;t.minDistance=1,t.maxDistance=300;const e=new O;t.getPosition(e);const s=e.length();t.distance=s,t.truckSpeed=2;const{rotation:i}=this.camera.three,n=new O(0,0,-1).applyEuler(i),o=e.addScaledVector(n,s);t.moveTo(o.x,o.y,o.z)}}class Ja{constructor(t){I(this,"enabled",!1),I(this,"id","Plan"),I(this,"mouseAction1"),I(this,"mouseAction2"),I(this,"mouseInitialized",!1),I(this,"defaultAzimuthSpeed"),I(this,"defaultPolarSpeed"),this.camera=t,this.defaultAzimuthSpeed=t.controls.azimuthRotateSpeed,this.defaultPolarSpeed=t.controls.polarRotateSpeed}set(t){this.enabled=t;const e=this.camera.controls;e.azimuthRotateSpeed=t?0:this.defaultAzimuthSpeed,e.polarRotateSpeed=t?0:this.defaultPolarSpeed,this.mouseInitialized||(this.mouseAction1=e.touches.one,this.mouseAction2=e.touches.two,this.mouseInitialized=!0),t?(e.mouseButtons.left=ot.ACTION.TRUCK,e.touches.one=ot.ACTION.TOUCH_TRUCK,e.touches.two=ot.ACTION.TOUCH_ZOOM):(e.mouseButtons.left=ot.ACTION.ROTATE,e.touches.one=this.mouseAction1,e.touches.two=this.mouseAction2)}}class th{constructor(t){I(this,"onChanged",new M),I(this,"current","Perspective"),I(this,"camera"),I(this,"matchOrthoDistanceEnabled",!1),I(this,"_component"),I(this,"_previousDistance",-1),this._component=t,this.camera=t.three}async set(t){this.current!==t&&(t==="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 t=this.getPerspectiveDims();if(!t)return;const{width:e,height:s}=t;this.setupOrthoCamera(s,e),this.camera=this._component.threeOrtho,this.current="Orthographic"}getPerspectiveDims(){const t=this._component.currentWorld;if(!t||!t.renderer)return null;const e=new O;this._component.threePersp.getWorldDirection(e);const s=new O;this._component.controls.getTarget(s);const i=s.clone().sub(this._component.threePersp.position).dot(e),n=t.renderer.getSize(),o=n.x/n.y,r=this._component.threePersp,a=i*2*Math.atan(r.fov*(Math.PI/180)/2);return{width:a*o,height:a}}setupOrthoCamera(t,e){this._component.controls.mouseButtons.wheel=ot.ACTION.ZOOM,this._component.controls.mouseButtons.middle=ot.ACTION.ZOOM;const s=this._component.threePersp,i=this._component.threeOrtho;i.zoom=1,i.left=e/-2,i.right=e/2,i.top=t/2,i.bottom=t/-2,i.updateProjectionMatrix(),i.position.copy(s.position),i.quaternion.copy(s.quaternion),this._component.controls.camera=i}getDistance(){const t=this._component.threePersp,e=this._component.threeOrtho;return(e.top-e.bottom)/e.zoom/(2*Math.atan(t.fov*(Math.PI/180)/2))}async setPerspectiveCamera(){this._component.controls.mouseButtons.wheel=ot.ACTION.DOLLY,this._component.controls.mouseButtons.middle=ot.ACTION.DOLLY;const t=this._component.threePersp,e=this._component.threeOrtho;t.position.copy(e.position),t.quaternion.copy(e.quaternion),this._component.controls.mouseButtons.wheel=ot.ACTION.DOLLY,this.matchOrthoDistanceEnabled?this._component.controls.distance=this.getDistance():this._component.controls.distance=this._previousDistance,await this._component.controls.zoomTo(1),t.updateProjectionMatrix(),this._component.controls.camera=t,this.camera=t,this.current="Perspective"}}class ph extends Ve{constructor(t){super(t),I(this,"projection"),I(this,"threeOrtho"),I(this,"threePersp"),I(this,"_userInputButtons",{}),I(this,"_frustumSize",50),I(this,"_navigationModes",new Map),I(this,"_mode",null),I(this,"previousSize",null),this.threePersp=this.three,this.threeOrtho=this.newOrthoCamera(),this.projection=new th(this),this.onAspectUpdated.add(()=>{this.setOrthoPerspCameraAspect()}),this.projection.onChanged.add(e=>{this.three=e,this.updateAspect()}),this.onWorldChanged.add(({action:e})=>{e==="added"&&(this._navigationModes.clear(),this._navigationModes.set("Orbit",new $a(this)),this._navigationModes.set("FirstPerson",new Ka(this)),this._navigationModes.set("Plan",new Ja(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,e=1.5){if(!this.enabled)return;const s=Number.MAX_VALUE,i=Number.MIN_VALUE,n=new O(s,s,s),o=new O(i,i,i);for(const l of t){const u=new st().setFromObject(l);u.min.xo.x&&(o.x=u.max.x),u.max.y>o.y&&(o.y=u.max.y),u.max.z>o.z&&(o.z=u.max.z)}const r=new st(n,o),a=new O;r.getSize(a);const h=new O;r.getCenter(h);const d=Math.max(a.x,a.y,a.z)*e,E=new Os(h,d);await this.controls.fitToSphere(E,!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 Ti(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(),e=this.threeOrtho.top,s=this.threeOrtho.right,i=t.y/this.previousSize.y,n=t.x/this.previousSize.x,o=e*i,r=s*n;this.threeOrtho.left=-r,this.threeOrtho.right=r,this.threeOrtho.top=o,this.threeOrtho.bottom=-o,this.threeOrtho.updateProjectionMatrix(),this.previousSize.copy(t)}}const eh=new Map([[fi,{forRelating:"IsDecomposedBy",forRelated:"Decomposes"}],[Nn,{forRelating:"AssociatedTo",forRelated:"HasAssociations"}],[yn,{forRelating:"ClassificationForObjects",forRelated:"HasAssociations"}],[wn,{forRelating:"IsGroupedBy",forRelated:"HasAssignments"}],[mi,{forRelated:"IsDefinedBy",forRelating:"DefinesOcurrence"}],[Pn,{forRelated:"IsTypedBy",forRelating:"Types"}],[Ln,{forRelated:"IsDefinedBy",forRelating:"Defines"}],[Ri,{forRelated:"ContainedInStructure",forRelating:"ContainsElements"}],[Mn,{forRelated:"AssignedToFlowElement",forRelating:"HasControlElements"}],[Dn,{forRelated:"ConnectedFrom",forRelating:"ConnectedTo"}]]),io=class ui extends J{constructor(t){super(t),I(this,"onDisposed",new M),I(this,"onRelationsIndexed",new M),I(this,"relationMaps",{}),I(this,"enabled",!0),I(this,"_relToAttributesMap",eh),I(this,"_inverseAttributes",["IsDecomposedBy","Decomposes","AssociatedTo","HasAssociations","ClassificationForObjects","IsGroupedBy","HasAssignments","IsDefinedBy","DefinesOcurrence","IsTypedBy","Types","Defines","ContainedInStructure","ContainsElements","HasControlElements","AssignedToFlowElement","ConnectedTo","ConnectedFrom"]),I(this,"_ifcRels",[fi,Nn,yn,wn,mi,Pn,Ln,Ri,Mn,Dn]),I(this,"onFragmentsDisposed",e=>{delete this.relationMaps[e.groupID]}),this.components.add(ui.uuid,this),t.get(Et).onFragmentsDisposed.add(this.onFragmentsDisposed)}indexRelations(t,e,s,i){const n=Object.keys(e).find(E=>E.startsWith("Relating")),o=Object.keys(e).find(E=>E.startsWith("Related"));if(!(n&&o))return;const r=e[n].value,a=e[o].map(E=>E.value),h=t.get(r)??new Map,d=this.getAttributeIndex(i);d!==null&&(h.set(d,a),t.set(r,h));for(const E of a){const l=t.get(E)??new Map,u=this.getAttributeIndex(s);if(!u)continue;const C=l.get(u)??[];C.push(r),l.set(u,C),t.set(E,l)}}getAttributeIndex(t){const e=this._inverseAttributes.indexOf(t);return e===-1?null:e}setRelationMap(t,e){this.relationMaps[t.uuid]=e,this.onRelationsIndexed.trigger({modelID:t.uuid,relationsMap:e})}async process(t){if(!t.hasProperties)throw new Error("FragmentsGroup properties not found");let e=this.relationMaps[t.uuid];if(e)return e;e=new Map;for(const s of this._ifcRels){const i=await t.getAllPropertiesOfType(s);if(!i)continue;const n=this._relToAttributesMap.get(s);if(!n)continue;const{forRelated:o,forRelating:r}=n;for(const a in i){const h=i[a];this.indexRelations(e,h,o,r)}}return this.setRelationMap(t,e),e}async processFromWebIfc(t,e){const s=new Map;for(const i of this._ifcRels){const n=this._relToAttributesMap.get(i);if(!n)continue;const{forRelated:o,forRelating:r}=n,a=t.GetLineIDsWithType(e,i);for(let h=0;hi.x&&(i.x=o.x),o.y>i.y&&(i.y=o.y),o.z>i.z&&(i.z=o.z);return new st(e,s)}dispose(){const t=this.components.get(me);for(const e of this._meshes)t.destroy(e);this._meshes=[],this.onDisposed.trigger(Pt.uuid),this.onDisposed.reset()}get(){const t=this._absoluteMin.clone(),e=this._absoluteMax.clone();return new st(t,e)}getSphere(){const t=this._absoluteMin.clone(),e=this._absoluteMax.clone(),s=Math.abs((e.x-t.x)/2),i=Math.abs((e.y-t.y)/2),n=Math.abs((e.z-t.z)/2),o=new O(t.x+s,t.y+i,t.z+n),r=o.distanceTo(t);return new Os(o,r)}getMesh(){const t=new st(this._absoluteMin,this._absoluteMax),e=Pt.getDimensions(t),{width:s,height:i,depth:n,center:o}=e,r=new it(s,i,n),a=new U(r);return this._meshes.push(a),a.position.copy(o),a}reset(){this._absoluteMin=Pt.newBound(!0),this._absoluteMax=Pt.newBound(!1)}add(t){for(const e of t.items)this.addMesh(e.mesh)}addMesh(t,e){if(!t.geometry.index)return;const s=Pt.getFragmentBounds(t);t.updateMatrixWorld();const i=t.matrixWorld,n=new H,o=t instanceof jt,r=new Set;if(e&&t instanceof Yo)for(const a of e){const h=t.fragment.getInstancesIDs(a);if(h)for(const d of h)r.add(d)}else r.add(0);for(const a of r){const h=s.min.clone(),d=s.max.clone();o&&(t.getMatrixAt(a,n),h.applyMatrix4(n),d.applyMatrix4(n)),h.applyMatrix4(i),d.applyMatrix4(i),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),d.x>this._absoluteMax.x&&(this._absoluteMax.x=d.x),d.y>this._absoluteMax.y&&(this._absoluteMax.y=d.y),d.z>this._absoluteMax.z&&(this._absoluteMax.z=d.z),d.xo.x&&(o.x=d),E>o.y&&(o.y=E),l>o.z&&(o.z=l)}return new st(n,o)}};I(ro,"uuid","d1444724-dba6-4cdd-a0c7-68ee1450d166");let Ch=ro;const ao=new Set([1123145078,574549367,1675464909,2059837836,3798115385,32440307,3125803723,3207858831,2740243338,2624227202,4240577450,3615266464,3724593414,220341763,477187591,1878645084,1300840506,3303107099,1607154358,1878645084,846575682,1351298697,2417041796,3049322572,3331915920,1416205885,776857604,3285139300,3958052878,2827736869,2732653382,673634403,3448662350,4142052618,2924175390,803316827,2556980723,1809719519,2205249479,807026263,3737207727,1660063152,2347385850,2705031697,3732776249,2485617015,2611217952,1704287377,2937912522,2770003689,1281925730,1484403080,3448662350,4142052618,3800577675,4006246654,3590301190,1383045692,2775532180,2047409740,370225590,3593883385,2665983363,4124623270,812098782,3649129432,987898635,1105321065,3510044353,1635779807,2603310189,3406155212,1310608509,4261334040,2736907675,3649129432,1136057603,1260505505,4182860854,2713105998,2898889636,59481748,3749851601,3486308946,3150382593,1062206242,3264961684,15328376,1485152156,370225590,1981873012,2859738748,45288368,2614616156,2732653382,775493141,2147822146,2601014836,2629017746,1186437898,2367409068,1213902940,3632507154,3900360178,476780140,1472233963,2804161546,3008276851,738692330,374418227,315944413,3905492369,3570813810,2571569899,178912537,2294589976,1437953363,2133299955,572779678,3092502836,388784114,2624227202,1425443689,3057273783,2347385850,1682466193,2519244187,2839578677,3958567839,2513912981,2830218821,427810014]),ho=class co extends J{constructor(t){super(t),I(this,"enabled",!0),t.add(co.uuid,this)}async export(t,e,s=!1,i=!0){const n={},o=new Set(t.GetIfcEntityList(e)),r=new Set([Fi,Ai,gi,Oi,Kt]);for(const a of r)o.add(a);for(const a of o){if(ao.has(a))continue;const h=r.has(a)&&i,d=t.GetLineIDsWithType(e,a);for(const E of d){const l=t.GetLine(0,E,h,s);n[l.expressID]=l}}return n}};I(ho,"uuid","b32c4332-cd67-436e-ba7f-196646c7a635");let sh=ho;const lo={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 qt{static async getUnits(t){var e,s,i;const{IFCUNITASSIGNMENT:n}=yt,o=await t.getAllPropertiesOfType(n);if(!o)return 1;const r=Object.keys(o),a=o[parseInt(r[0],10)];for(const h of a.Units){if(h.value===void 0||h.value===null)continue;const d=await t.getProperties(h.value);if(!d||!d.UnitType||!d.UnitType.value||d.UnitType.value!=="LENGTHUNIT")continue;let E=1,l=1;return d.Name.value==="METRE"&&(l=1),d.Name.value==="FOOT"&&(l=.3048),((e=d.Prefix)==null?void 0:e.value)==="MILLI"?E=.001:((s=d.Prefix)==null?void 0:s.value)==="CENTI"?E=.01:((i=d.Prefix)==null?void 0:i.value)==="DECI"&&(E=.1),l*E}return 1}static async findItemByGuid(t,e){var s;const i=t.getAllPropertiesIDs();for(const n of i){const o=await t.getProperties(n);if(o&&((s=o.GlobalId)==null?void 0:s.value)===e)return o}return null}static async getRelationMap(t,e,s){var i;const n=s??(async()=>{}),o={},r=t.getAllPropertiesIDs();for(const a of r){const h=await t.getProperties(a);if(!h)continue;const d=h.type===e,E=Object.keys(h).find(m=>m.startsWith("Relating")),l=Object.keys(h).find(m=>m.startsWith("Related"));if(!(d&&E&&l))continue;const u=await t.getProperties((i=h[E])==null?void 0:i.value),C=h[l];if(!u||!C||!(C&&Array.isArray(C)))continue;const T=C.map(m=>m.value);await n(u.expressID,T),o[u.expressID]=T}return o}static async getQsetQuantities(t,e,s){const i=s??(()=>{}),n=await t.getProperties(e);return!n||n.type!==bo?null:(n.Quantities??[{}]).map(o=>(o.value&&i(o.value),o.value)).filter(o=>o!==null)}static async getPsetProps(t,e,s){const i=s??(()=>{}),n=await t.getProperties(e);return!n||n.type!==Js?null:(n.HasProperties??[{}]).map(o=>(o.value&&i(o.value),o.value)).filter(o=>o!==null)}static async getPsetRel(t,e){var s;if(!await t.getProperties(e))return null;const i=await t.getAllPropertiesOfType(mi);if(!i)return null;const n=Object.values(i);let o=null;for(const r of n)((s=r.RelatingPropertyDefinition)==null?void 0:s.value)===e&&(o=r.expressID);return o}static async getQsetRel(t,e){return qt.getPsetRel(t,e)}static async getEntityName(t,e){var s;const i=await t.getProperties(e);if(!i)return{key:null,name:null};const n=Object.keys(i).find(r=>r.endsWith("Name"))??null,o=n?(s=i[n])==null?void 0:s.value:null;return{key:n,name:o}}static async getQuantityValue(t,e){const s=await t.getProperties(e);if(!s)return{key:null,value:null};const i=Object.keys(s).find(o=>o.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(t){return lo[t].startsWith("IFCREL")}static async attributeExists(t,e,s){const i=await t.getProperties(e);return i?Object.keys(i).includes(s):!1}static async groupEntitiesByType(t,e){var s;const i=new Map;for(const n of e){const o=await t.getProperties(n);if(!o)continue;const r=o.type;i.get(r)||i.set(r,new Set),(s=i.get(r))==null||s.add(n)}return i}}class ih{constructor(){I(this,"factor",1),I(this,"complement",1)}apply(t){const e=this.getScaleMatrix().multiply(t);t.copy(e)}setUp(t){var e,s,i;this.factor=1;const n=this.getLengthUnits(t);if(!n)return;const o=n==null,r=n.Name===void 0||n.Name===null;o||r||(n.Name.value==="FOOT"&&(this.factor=.3048),((e=n.Prefix)==null?void 0:e.value)==="MILLI"?this.complement=.001:((s=n.Prefix)==null?void 0:s.value)==="CENTI"?this.complement=.01:((i=n.Prefix)==null?void 0:i.value)==="DECI"&&(this.complement=.01))}getLengthUnits(t){try{const e=t.GetLineIDsWithType(0,tr).get(0),s=t.GetLine(0,e);for(const i of s.Units){if(!i||i.value===null||i.value===void 0)continue;const n=t.GetLine(0,i.value);if(n.UnitType&&n.UnitType.value==="LENGTHUNIT")return n}return null}catch{return console.log("Could not get units"),null}}getScaleMatrix(){const t=this.factor;return new H().fromArray([t,0,0,0,0,t,0,0,0,0,t,0,0,0,0,1])}}class Eo{constructor(){I(this,"itemsByFloor",{}),I(this,"_units",new ih)}setUp(t){this._units.setUp(t),this.cleanUp();try{const e=t.GetLineIDsWithType(0,Ri),s=new Set,i=t.GetLineIDsWithType(0,Kt);for(let h=0;h{this.getMesh(n,e)});for(const n of this._visitedFragments){const{index:o,fragment:r}=n[1];e.keyFragments.set(o,r.id)}for(const n of e.items){const o=this._fragmentInstances.get(n.id);if(!o)throw new Error("Fragment not found!");const r=[];for(const[a,h]of o)r.push(h);n.add(r)}const i=this.webIfc.GetCoordinationMatrix(0);return e.coordinationMatrix.fromArray(i),e.civilData=this._civil.read(this.webIfc),e}getMesh(t,e){const s=t.geometries.size(),i=t.expressID;for(let n=0;no.value!==s),await t.setProperties(s,null),this.registerChange(t,e,s))}async addElementToPset(t,e,...s){const i=await qt.getPsetRel(t,e);if(!i)return;const n=await t.getProperties(i);if(!n)return;for(const r of s){const a=new ke(r);n.RelatedObjects.push(a),this.onElementToPset.trigger({model:t,psetID:e,elementID:r})}this.registerChange(t,e);const o=this.components.get(Ns);for(const r of s)o.addEntityRelations(t,r,"IsDefinedBy",e)}async addPropToPset(t,e,...s){const i=await t.getProperties(e);if(i){for(const n of s){if(i.HasProperties.includes(n))continue;const o=new ke(n);i.HasProperties.push(o),this.onPropToPset.trigger({model:t,psetID:e,propID:n})}this.registerChange(t,e)}}async saveToIfc(t,e){const s=this.components.get(nh),i=s.webIfc,n=await s.readIfcFile(e),o=this.changeMap[t.uuid]??[];for(const a of o){const h=await t.getProperties(a);if(h)try{i.WriteLine(n,h)}catch{}else try{i.DeleteLine(n,a)}catch{}}const r=i.SaveModel(n);return s.webIfc.CloseModel(n),s.cleanUp(),r}async setAttributeListener(t,e,s){this.attributeListeners[t.uuid]||(this.attributeListeners[t.uuid]={});const i=this.attributeListeners[t.uuid][e]?this.attributeListeners[t.uuid][e][s]:null;if(i)return i;const n=await t.getProperties(e);if(!n)throw new Error(`Entity with expressID ${e} doesn't exists.`);const o=n[s];if(Array.isArray(o)||!o)throw new Error(`Attribute ${s} is array or null, and it can't have a listener.`);const r=o.value;if(r===void 0||r==null)throw new Error(`Attribute ${s} has a badly defined handle.`);const a=new M;return Object.defineProperty(n[s],"value",{get(){return this._value},async set(h){this._value=h,a.trigger(h)}}),n[s].value=r,this.attributeListeners[t.uuid][e]||(this.attributeListeners[t.uuid][e]={}),this.attributeListeners[t.uuid][e][s]=a,a}increaseMaxID(t){return t.ifcMetadata.maxExpressID++,t.ifcMetadata.maxExpressID}newGUID(t){const e=ue.getIFCSchema(t);return new yt[e].IfcGloballyUniqueId(Li.create())}async getOwnerHistory(t){const e=await t.getAllPropertiesOfType(Go);if(!e)throw new Error("No OwnerHistory was found.");const s=Object.keys(e).map(o=>parseInt(o,10)),i=e[s[0]],n=new ke(i.expressID);return{ownerHistory:i,ownerHistoryHandle:n}}registerChange(t,...e){this.changeMap[t.uuid]||(this.changeMap[t.uuid]=new Set);for(const s of e)this.changeMap[t.uuid].add(s),this.onDataChanged.trigger({model:t,expressID:s})}async newSingleProperty(t,e,s,i){const n=ue.getIFCSchema(t),o=new yt[n].IfcIdentifier(s),r=new yt[n][e](i),a=new yt[n].IfcPropertySingleValue(o,null,r,null);return a.expressID=this.increaseMaxID(t),await this.setData(t,a),a}};I(To,"uuid","58c2d9f0-183c-48d6-a402-dfcf5b9a34df");let Th=To;const mo=class fo extends J{constructor(t){super(t),I(this,"enabled",!0),I(this,"list",{}),I(this,"onDisposed",new M),I(this,"onFragmentsDisposed",e=>{const{groupID:s,fragmentIDs:i}=e;for(const n in this.list){const o=this.list[n],r=Object.keys(o);if(r.includes(s))delete o[s],Object.values(o).length===0&&delete this.list[n];else for(const a of r){const h=o[a];for(const d of i)delete h.map[d];Object.values(h).length===0&&delete o[a]}}}),t.add(fo.uuid,this),t.get(Et).onFragmentsDisposed.add(this.onFragmentsDisposed)}dispose(){this.list={},this.components.get(Et).onFragmentsDisposed.remove(this.onFragmentsDisposed),this.onDisposed.trigger(),this.onDisposed.reset()}remove(t){for(const e in this.list){const s=this.list[e];for(const i in s){const n=s[i];delete n.map[t]}}}find(t){const e=this.components.get(Et);if(!t){const o={};for(const[r,a]of e.list)o[r]=new Set(a.ids);return o}const s=Object.keys(t).length,i={};for(const o in t){const r=t[o];if(!this.list[o]){console.warn(`Classification ${o} does not exist.`);continue}for(const a of r){const h=this.list[o][a];if(h)for(const d in h.map){i[d]||(i[d]=new Map);for(const E of h.map[d]){const l=i[d].get(E);l===void 0?i[d].set(E,1):i[d].set(E,l+1)}}}}const n={};for(const o in i){const r=i[o];for(const[a,h]of r){if(h===void 0)throw new Error("Malformed fragments map!");h===s&&(n[o]||(n[o]=new Set),n[o].add(a))}}return n}byModel(t,e){this.list.models||(this.list.models={});const s=this.list.models;s[t]||(s[t]={map:{},id:null,name:t});const i=s[t];for(const[n,o]of e.data){const r=o[0];for(const a of r){const h=e.keyFragments.get(a);h&&(i.map[h]||(i.map[h]=new Set),i.map[h].add(n))}}}async byPredefinedType(t){var e;this.list.predefinedTypes||(this.list.predefinedTypes={});const s=this.list.predefinedTypes,i=t.getAllPropertiesIDs();for(const n of i){const o=await t.getProperties(n);if(!o)continue;const r=String((e=o.PredefinedType)==null?void 0:e.value).toUpperCase();s[r]||(s[r]={map:{},id:null,name:r});const a=s[r];for(const[h,d]of t.data){const E=d[0];for(const l of E){const u=t.keyFragments.get(l);if(!u)throw new Error("Fragment ID not found!");a.map[u]||(a.map[u]=new Set),a.map[u].add(o.expressID)}}}}byEntity(t){this.list.entities||(this.list.entities={});for(const[e,s]of t.data){const i=s[1][1],n=lo[i];this.saveItem(t,"entities",n,e)}}async byIfcRel(t,e,s){qt.isRel(e)&&await qt.getRelationMap(t,e,async(i,n)=>{const{name:o}=await qt.getEntityName(t,i);for(const r of n)this.saveItem(t,s,o??"NO REL NAME",r)})}async bySpatialStructure(t,e={}){var s,i;const n=this.components.get(Ns),o=n.relationMaps[t.uuid];if(!o)throw new Error(`Classifier: model relations of ${t.name||t.uuid} have to exists to group by spatial structure.`);const r="spatialStructures",a=e.useProperties===void 0||e.useProperties;for(const[h]of o){if(e.isolate){const u=t.data.get(h);if(!u)continue;const C=u[1][1];if(C===void 0||!e.isolate.has(C))continue}const d=n.getEntityRelations(t,h,"Decomposes");if(d)for(const u of d){let C=u.toString();if(a){const T=await t.getProperties(u);if(!T)continue;C=(s=T.Name)==null?void 0:s.value}this.saveItem(t,r,C,h,u)}const E=n.getEntityRelations(t,h,"ContainsElements");if(!E)continue;let l=h.toString();if(a){const u=await t.getProperties(h);if(!u)continue;l=(i=u.Name)==null?void 0:i.value}for(const u of E){this.saveItem(t,r,l,u,h);const C=n.getEntityRelations(t,Number(u),"IsDecomposedBy");if(C)for(const T of C)this.saveItem(t,r,l,T,h)}}}setColor(t,e,s=!1){const i=this.components.get(Et);for(const n in t){const o=i.list.get(n);if(!o)continue;const r=t[n];o.setColor(e,r,s)}}resetColor(t){const e=this.components.get(Et);for(const s in t){const i=e.list.get(s);if(!i)continue;const n=t[s];i.resetColor(n)}}saveItem(t,e,s,i,n=null){this.list[e]||(this.list[e]={});const o=t.data.get(i);if(o)for(const r of o[0]){const a=t.keyFragments.get(r);if(a){const h=this.list[e];h[s]||(h[s]={map:{},id:n,name:s}),h[s].map[a]||(h[s].map[a]=new Set),h[s].map[a].add(i)}}}};I(mo,"uuid","e25a7f3c-46c4-4a14-9d3d-5115f24ebeb7");let oh=mo;const Ro=class Fo extends J{constructor(t){super(t),I(this,"onDisposed",new M),I(this,"enabled",!0),I(this,"height",10),I(this,"groupName","spatialStructures"),I(this,"list",new Set),t.add(Fo.uuid,this)}dispose(){this.list.clear(),this.onDisposed.trigger(),this.onDisposed.reset()}set(t){if(!this.enabled)return;const e=this.components.get(oh),s=this.components.get(Et),i=t?1:-1;let n=0;const o=e.list[this.groupName],r=new H;for(const a in o){r.elements[13]=n*i*this.height;for(const h in o[a].map){const d=s.list.get(h),E=a+h,l=this.list.has(E);if(!d||t&&l||!t&&!l)continue;t?this.list.add(E):this.list.delete(E);const u=o[a].map[h];d.applyTransform(u,r),d.mesh.computeBoundingSphere(),d.mesh.computeBoundingBox()}n++}}};I(Ro,"uuid","d260618b-ce88-4c7d-826c-6debb91de3e2");let mh=Ro;const Ao=class go extends J{constructor(t){super(t),I(this,"enabled",!0),this.components.add(go.uuid,this)}set(t,e){const s=this.components.get(Et);if(!e){for(const[i,n]of s.list)n&&(n.setVisibility(t),this.updateCulledVisibility(n));return}for(const i in e){const n=e[i],o=s.list.get(i);o&&(o.setVisibility(t,n),this.updateCulledVisibility(o))}}isolate(t){this.set(!1),this.set(!0,t)}updateCulledVisibility(t){const e=this.components.get(ja);for(const[s,i]of e.list){const n=i.colorMeshes.get(t.id);n&&(n.count=t.mesh.count)}}};I(Ao,"uuid","dd9ccf2d-8a21-4821-b7f6-2949add16a29");let fh=Ao;class rh extends Di{constructor(){super(...arguments),I(this,"minGeometrySize",10),I(this,"minAssetsSize",1e3)}}const Oo=class _o extends J{constructor(t){super(t),I(this,"onGeometryStreamed",new M),I(this,"onAssetStreamed",new M),I(this,"onProgress",new M),I(this,"onIfcLoaded",new M),I(this,"onDisposed",new M),I(this,"settings",new rh),I(this,"enabled",!0),I(this,"webIfc",new Ce),I(this,"_spatialTree",new Eo),I(this,"_metaData",new Io),I(this,"_visitedGeometries",new Map),I(this,"_streamSerializer",new Vo),I(this,"_geometries",new Map),I(this,"_geometryCount",0),I(this,"_civil",new uo),I(this,"_groupSerializer",new Un),I(this,"_assets",[]),I(this,"_meshesWithHoles",new Set),this.components.add(_o.uuid,this),this.settings.excludedCategories.add(xn)}dispose(){this.onIfcLoaded.reset(),this.onGeometryStreamed.reset(),this.onAssetStreamed.reset(),this.webIfc=null,this.onDisposed.trigger(),this.onDisposed.reset()}async streamFromBuffer(t){await this.readIfcFile(t),await this.streamAllGeometries(),this.cleanUp()}async streamFromCallBack(t){await this.streamIfcFile(t),await this.streamAllGeometries(),this.cleanUp()}async readIfcFile(t){const{path:e,absolute:s,logLevel:i}=this.settings.wasm;this.webIfc.SetWasmPath(e,s),await this.webIfc.Init(),i&&this.webIfc.SetLogLevel(i),this.webIfc.OpenModel(t,this.settings.webIfc)}async streamIfcFile(t){const{path:e,absolute:s,logLevel:i}=this.settings.wasm;this.webIfc.SetWasmPath(e,s),await this.webIfc.Init(),i&&this.webIfc.SetLogLevel(i),this.webIfc.OpenModelFromCallback(t,this.settings.webIfc)}async streamAllGeometries(){const{minGeometrySize:t,minAssetsSize:e}=this.settings;this._spatialTree.setUp(this.webIfc);const s=this.webIfc.GetIfcEntityList(0),i=[[]],n=new vn;n.ifcMetadata={name:"",description:"",...this._metaData.getNameInfo(this.webIfc),...this._metaData.getDescriptionInfo(this.webIfc),schema:this.webIfc.GetModelSchema(0)||"IFC2X3",maxExpressID:this.webIfc.GetMaxExpressID(0)};let o=0,r=0;for(const C of s){if(!this.webIfc.IsIfcElement(C)&&C!==Kt||this.settings.excludedCategories.has(C))continue;const T=this.webIfc.GetLineIDsWithType(0,C),m=T.size();for(let f=0;ft&&(o=0,r++,i.push([]));const R=T.get(f);i[r].push(R);const A=this.webIfc.GetLine(0,R);if(A.GlobalId){const F=(A==null?void 0:A.GlobalId.value)||(A==null?void 0:A.GlobalId);n.globalToExpressIDs.set(F,R)}const p=this._spatialTree.itemsByFloor[R]||0;n.data.set(R,[[],[p,C]]),o++}}this._spatialTree.cleanUp();let a=.01,h=0;for(const C of i){h++,this.webIfc.StreamMeshes(0,C,m=>{this.getMesh(this.webIfc,m,n)}),this._geometryCount>t&&await this.streamGeometries(),this._assets.length>e&&await this.streamAssets();const T=h/i.length;T>a&&(a+=.01,a=Math.max(a,T),this.onProgress.trigger(Math.round(a*100)/100))}this._geometryCount&&await this.streamGeometries(),this._assets.length&&await this.streamAssets();const{opaque:d,transparent:E}=n.geometryIDs;for(const[C,{index:T,uuid:m}]of this._visitedGeometries)n.keyFragments.set(T,m),(C>1?d:E).set(C,T);po.get(n,this.webIfc);const l=this.webIfc.GetCoordinationMatrix(0);n.coordinationMatrix.fromArray(l),n.civilData=this._civil.read(this.webIfc);const u=this._groupSerializer.export(n);this.onIfcLoaded.trigger(u),n.dispose(!0)}cleanUp(){this.webIfc.Dispose(),this.webIfc=null,this.webIfc=new Ce,this._visitedGeometries.clear(),this._geometries.clear(),this._assets=[],this._meshesWithHoles.clear()}getMesh(t,e,s){const i=e.geometries.size(),n=e.expressID,o={id:n,geometries:[]};for(let r=0;ri&&(i=Math.round(i*100)/100,await this.onProgress.trigger(i),i+=.01)}await this.onProgress.trigger(1);const o=await this.components.get(Ns).processFromWebIfc(this.webIfc,0);await this.onIndicesStreamed.trigger(o)}cleanUp(){this.webIfc.Dispose(),this.webIfc=null,this.webIfc=new Ce}}I(hh,"uuid","88d2c89c-ce32-47d7-8cb6-d51e4b311a0b");const So=class No extends J{constructor(t){super(t),I(this,"enabled",!0),t.add(No.uuid,this)}static distanceFromPointToLine(t,e,s,i=!1){const n=new Ft,o=new O;return n.set(e,s),n.closestPointToPoint(t,i,o),o.distanceTo(t)}getFace(t,e,s){if(!t.geometry.index)throw new Error("Geometry must be indexed!");const i=new Map,n=t.geometry.index.array,{plane:o}=this.getFaceData(e,s,t),r=[];for(let E=0;Ep.id);if(!u.size){const p=a++;for(const{id:F}of l)h.set(F,p);d.set(p,{edges:new Set(C),indices:new Set([E])});continue}let T=null;const m=new Set,f=new Set(C);for(const[p,F]of u){T===null?T=F:F!==T&&m.add(F),h.delete(p);const{edges:g}=d.get(F);g.delete(p),f.delete(p)}if(T===null)throw new Error("Error computing face!");const R=d.get(T),{indices:A}=R;A.add(E);for(const p of f){h.set(p,T);const{edges:F}=R;F.add(p)}for(const p of m){const F=d.get(p),{edges:g,indices:_}=F,S=d.get(T),{edges:y,indices:w}=S;for(const P of g)y.add(P),h.set(P,T);for(const P of _)w.add(P);d.delete(p)}}for(const[E,{indices:l,edges:u}]of d)if(l.has(e)){const C=[];for(const T of u){const m=i.get(T);C.push(m)}return{edges:C,indices:l}}return null}getVerticesAndNormal(t,e,s){if(!t.geometry.index)throw new Error("Geometry must be indexed!");const i=t.geometry.index.array,n=t.geometry.attributes.position.array,o=t.geometry.attributes.normal.array,r=i[e*3]*3,a=i[e*3+1]*3,h=i[e*3+2]*3,d=new O(n[r],n[r+1],n[r+2]),E=new O(n[a],n[a+1],n[a+2]),l=new O(n[h],n[h+1],n[h+2]),u=new O(o[r],o[r+1],o[r+2]),C=new O(o[a],o[a+1],o[a+2]),T=new O(o[h],o[h+1],o[h+2]),m=(u.x+C.x+T.x)/3,f=(u.y+C.y+T.y)/3,R=(u.z+C.z+T.z)/3,A=new O(m,f,R);if(s!==void 0&&t instanceof jt){const p=new H;t.getMatrixAt(s,p);const F=new H;F.extractRotation(p),A.applyMatrix4(F),d.applyMatrix4(p),E.applyMatrix4(p),l.applyMatrix4(p)}return{p1:d,p2:E,p3:l,faceNormal:A}}round(t){t.x=Math.trunc(t.x*1e3)/1e3,t.y=Math.trunc(t.y*1e3)/1e3,t.z=Math.trunc(t.z*1e3)/1e3}getVolumeFromFragments(t){const e=this.components.get(Et),s=new H,i=[];for(const o in t){const r=e.list.get(o);if(!r)continue;const a=t[o];let h=0;for(const l of a){const u=r.getInstancesIDs(l);u&&(h+=u.size)}const d=new jt(r.mesh.geometry,void 0,h);let E=0;for(const l of a){const u=r.getInstancesIDs(l);if(u)for(const C of u)r.mesh.getMatrixAt(C,s),d.setMatrixAt(E++,s)}i.push(d)}const n=this.getVolumeFromMeshes(i);for(const o of i)o.geometry=null,o.material=[],o.dispose();return n}getVolumeFromMeshes(t){let e=0;for(const s of t)e+=this.getVolumeOfMesh(s);return e}getFaceData(t,e,s){const i=this.getVerticesAndNormal(s,t,e),{p1:n,p2:o,p3:r,faceNormal:a}=i;this.round(n),this.round(o),this.round(r),this.round(a);const h=[{id:`${n.x}|${n.y}|${n.z}`,value:n},{id:`${o.x}|${o.y}|${o.z}`,value:o},{id:`${r.x}|${r.y}|${r.z}`,value:r}];h.sort((R,A)=>R.idA.id?1:0);const[{id:d,value:E},{id:l,value:u},{id:C,value:T}]=h,m=[{id:`${d}|${l}`,distance:E.distanceTo(u),points:[E,u]},{id:`${l}|${C}`,distance:u.distanceTo(T),points:[u,T]},{id:`${d}|${C}`,distance:E.distanceTo(T),points:[E,T]}],f=new fe;return f.setFromNormalAndCoplanarPoint(a,n),f.constant=Math.round(f.constant*10)/10,{plane:f,edges:m}}getVolumeOfMesh(t){let e=0;const s=new O,i=new O,n=new O,{index:o}=t.geometry,r=t.geometry.attributes.position.array;if(!o)return console.warn("Geometry must be indexed to compute its volume!"),0;const a=[];if(t instanceof jt)for(let d=0;dt in e?Fr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,Et=(e,t,i)=>(Br(e,typeof t!="symbol"?t+"":t,i),i);const Ut=Math.min,it=Math.max,ei=Math.round,bt=e=>({x:e,y:e}),Ur={left:"right",right:"left",bottom:"top",top:"bottom"},Vr={start:"end",end:"start"};function $n(e,t,i){return it(e,Ut(t,i))}function Pe(e,t){return typeof e=="function"?e(t):e}function nt(e){return e.split("-")[0]}function fi(e){return e.split("-")[1]}function Ts(e){return e==="x"?"y":"x"}function Ns(e){return e==="y"?"height":"width"}function Nt(e){return["top","bottom"].includes(nt(e))?"y":"x"}function Ps(e){return Ts(Nt(e))}function Wr(e,t,i){i===void 0&&(i=!1);const n=fi(e),s=Ps(e),o=Ns(s);let r=s==="x"?n===(i?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(r=ii(r)),[r,ii(r)]}function qr(e){const t=ii(e);return[Ri(e),t,Ri(t)]}function Ri(e){return e.replace(/start|end/g,t=>Vr[t])}function Gr(e,t,i){const n=["left","right"],s=["right","left"],o=["top","bottom"],r=["bottom","top"];switch(e){case"top":case"bottom":return i?t?s:n:t?n:s;case"left":case"right":return t?o:r;default:return[]}}function Yr(e,t,i,n){const s=fi(e);let o=Gr(nt(e),i==="start",n);return s&&(o=o.map(r=>r+"-"+s),t&&(o=o.concat(o.map(Ri)))),o}function ii(e){return e.replace(/left|right|bottom|top/g,t=>Ur[t])}function Xr(e){return{top:0,right:0,bottom:0,left:0,...e}}function Ms(e){return typeof e!="number"?Xr(e):{top:e,right:e,bottom:e,left:e}}function Vt(e){const{x:t,y:i,width:n,height:s}=e;return{width:n,height:s,top:i,left:t,right:t+n,bottom:i+s,x:t,y:i}}function Cn(e,t,i){let{reference:n,floating:s}=e;const o=Nt(t),r=Ps(t),a=Ns(r),l=nt(t),u=o==="y",h=n.x+n.width/2-s.width/2,c=n.y+n.height/2-s.height/2,d=n[a]/2-s[a]/2;let p;switch(l){case"top":p={x:h,y:n.y-s.height};break;case"bottom":p={x:h,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:c};break;case"left":p={x:n.x-s.width,y:c};break;default:p={x:n.x,y:n.y}}switch(fi(t)){case"start":p[r]-=d*(i&&u?-1:1);break;case"end":p[r]+=d*(i&&u?-1:1);break}return p}const Jr=async(e,t,i)=>{const{placement:n="bottom",strategy:s="absolute",middleware:o=[],platform:r}=i,a=o.filter(Boolean),l=await(r.isRTL==null?void 0:r.isRTL(t));let u=await r.getElementRects({reference:e,floating:t,strategy:s}),{x:h,y:c}=Cn(u,n,l),d=n,p={},y=0;for(let x=0;xM<=0)){var lt,tt;const M=(((lt=o.flip)==null?void 0:lt.index)||0)+1,ut=E[M];if(ut)return{data:{index:M,overflows:k},reset:{placement:ut}};let J=(tt=k.filter(Q=>Q.overflows[0]<=0).sort((Q,B)=>Q.overflows[1]-B.overflows[1])[0])==null?void 0:tt.placement;if(!J)switch(p){case"bestFit":{var ct;const Q=(ct=k.filter(B=>{if($){const U=Nt(B.placement);return U===g||U==="y"}return!0}).map(B=>[B.placement,B.overflows.filter(U=>U>0).reduce((U,ce)=>U+ce,0)]).sort((B,U)=>B[1]-U[1])[0])==null?void 0:ct[0];Q&&(J=Q);break}case"initialPlacement":J=a;break}if(s!==J)return{reset:{placement:J}}}return{}}}};function Is(e){const t=Ut(...e.map(o=>o.left)),i=Ut(...e.map(o=>o.top)),n=it(...e.map(o=>o.right)),s=it(...e.map(o=>o.bottom));return{x:t,y:i,width:n-t,height:s-i}}function Zr(e){const t=e.slice().sort((s,o)=>s.y-o.y),i=[];let n=null;for(let s=0;sn.height/2?i.push([o]):i[i.length-1].push(o),n=o}return i.map(s=>Vt(Is(s)))}const Kr=function(e){return e===void 0&&(e={}),{name:"inline",options:e,async fn(t){const{placement:i,elements:n,rects:s,platform:o,strategy:r}=t,{padding:a=2,x:l,y:u}=Pe(e,t),h=Array.from(await(o.getClientRects==null?void 0:o.getClientRects(n.reference))||[]),c=Zr(h),d=Vt(Is(h)),p=Ms(a);function y(){if(c.length===2&&c[0].left>c[1].right&&l!=null&&u!=null)return c.find(b=>l>b.left-p.left&&lb.top-p.top&&u=2){if(Nt(i)==="y"){const k=c[0],lt=c[c.length-1],tt=nt(i)==="top",ct=k.top,M=lt.bottom,ut=tt?k.left:lt.left,J=tt?k.right:lt.right,Q=J-ut,B=M-ct;return{top:ct,bottom:M,left:ut,right:J,width:Q,height:B,x:ut,y:ct}}const b=nt(i)==="left",f=it(...c.map(k=>k.right)),g=Ut(...c.map(k=>k.left)),v=c.filter(k=>b?k.left===g:k.right===f),w=v[0].top,C=v[v.length-1].bottom,$=g,E=f,H=E-$,R=C-w;return{top:w,bottom:C,left:$,right:E,width:H,height:R,x:$,y:w}}return d}const x=await o.getElementRects({reference:{getBoundingClientRect:y},floating:n.floating,strategy:r});return s.reference.x!==x.reference.x||s.reference.y!==x.reference.y||s.reference.width!==x.reference.width||s.reference.height!==x.reference.height?{reset:{rects:x}}:{}}}};async function ta(e,t){const{placement:i,platform:n,elements:s}=e,o=await(n.isRTL==null?void 0:n.isRTL(s.floating)),r=nt(i),a=fi(i),l=Nt(i)==="y",u=["left","top"].includes(r)?-1:1,h=o&&l?-1:1,c=Pe(t,e);let{mainAxis:d,crossAxis:p,alignmentAxis:y}=typeof c=="number"?{mainAxis:c,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...c};return a&&typeof y=="number"&&(p=a==="end"?y*-1:y),l?{x:p*h,y:d*u}:{x:d*u,y:p*h}}const Ls=function(e){return{name:"offset",options:e,async fn(t){var i,n;const{x:s,y:o,placement:r,middlewareData:a}=t,l=await ta(t,e);return r===((i=a.offset)==null?void 0:i.placement)&&(n=a.arrow)!=null&&n.alignmentOffset?{}:{x:s+l.x,y:o+l.y,data:{...l,placement:r}}}}},ea=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:i,y:n,placement:s}=t,{mainAxis:o=!0,crossAxis:r=!1,limiter:a={fn:b=>{let{x:f,y:g}=b;return{x:f,y:g}}},...l}=Pe(e,t),u={x:i,y:n},h=await nn(t,l),c=Nt(nt(s)),d=Ts(c);let p=u[d],y=u[c];if(o){const b=d==="y"?"top":"left",f=d==="y"?"bottom":"right",g=p+h[b],v=p-h[f];p=$n(g,p,v)}if(r){const b=c==="y"?"top":"left",f=c==="y"?"bottom":"right",g=y+h[b],v=y-h[f];y=$n(g,y,v)}const x=a.fn({...t,[d]:p,[c]:y});return{...x,data:{x:x.x-i,y:x.y-n}}}}};function gt(e){return zs(e)?(e.nodeName||"").toLowerCase():"#document"}function D(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function yt(e){var t;return(t=(zs(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function zs(e){return e instanceof Node||e instanceof D(e).Node}function st(e){return e instanceof Element||e instanceof D(e).Element}function Z(e){return e instanceof HTMLElement||e instanceof D(e).HTMLElement}function En(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof D(e).ShadowRoot}function Me(e){const{overflow:t,overflowX:i,overflowY:n,display:s}=W(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+i)&&!["inline","contents"].includes(s)}function ia(e){return["table","td","th"].includes(gt(e))}function na(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function sn(e){const t=on(),i=W(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 sa(e){let t=Wt(e);for(;Z(t)&&!bi(t);){if(na(t))return null;if(sn(t))return t;t=Wt(t)}return null}function on(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function bi(e){return["html","body","#document"].includes(gt(e))}function W(e){return D(e).getComputedStyle(e)}function gi(e){return st(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Wt(e){if(gt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||En(e)&&e.host||yt(e);return En(t)?t.host:t}function Rs(e){const t=Wt(e);return bi(t)?e.ownerDocument?e.ownerDocument.body:e.body:Z(t)&&Me(t)?t:Rs(t)}function ji(e,t,i){var n;t===void 0&&(t=[]),i===void 0&&(i=!0);const s=Rs(e),o=s===((n=e.ownerDocument)==null?void 0:n.body),r=D(s);return o?t.concat(r,r.visualViewport||[],Me(s)?s:[],r.frameElement&&i?ji(r.frameElement):[]):t.concat(s,ji(s,[],i))}function js(e){const t=W(e);let i=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const s=Z(e),o=s?e.offsetWidth:i,r=s?e.offsetHeight:n,a=ei(i)!==o||ei(n)!==r;return a&&(i=o,n=r),{width:i,height:n,$:a}}function Hs(e){return st(e)?e:e.contextElement}function Ft(e){const t=Hs(e);if(!Z(t))return bt(1);const i=t.getBoundingClientRect(),{width:n,height:s,$:o}=js(t);let r=(o?ei(i.width):i.width)/n,a=(o?ei(i.height):i.height)/s;return(!r||!Number.isFinite(r))&&(r=1),(!a||!Number.isFinite(a))&&(a=1),{x:r,y:a}}const oa=bt(0);function Ds(e){const t=D(e);return!on()||!t.visualViewport?oa:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ra(e,t,i){return t===void 0&&(t=!1),!i||t&&i!==D(e)?!1:t}function _e(e,t,i,n){t===void 0&&(t=!1),i===void 0&&(i=!1);const s=e.getBoundingClientRect(),o=Hs(e);let r=bt(1);t&&(n?st(n)&&(r=Ft(n)):r=Ft(e));const a=ra(o,i,n)?Ds(o):bt(0);let l=(s.left+a.x)/r.x,u=(s.top+a.y)/r.y,h=s.width/r.x,c=s.height/r.y;if(o){const d=D(o),p=n&&st(n)?D(n):n;let y=d,x=y.frameElement;for(;x&&n&&p!==y;){const b=Ft(x),f=x.getBoundingClientRect(),g=W(x),v=f.left+(x.clientLeft+parseFloat(g.paddingLeft))*b.x,w=f.top+(x.clientTop+parseFloat(g.paddingTop))*b.y;l*=b.x,u*=b.y,h*=b.x,c*=b.y,l+=v,u+=w,y=D(x),x=y.frameElement}}return Vt({width:h,height:c,x:l,y:u})}const aa=[":popover-open",":modal"];function Fs(e){return aa.some(t=>{try{return e.matches(t)}catch{return!1}})}function la(e){let{elements:t,rect:i,offsetParent:n,strategy:s}=e;const o=s==="fixed",r=yt(n),a=t?Fs(t.floating):!1;if(n===r||a&&o)return i;let l={scrollLeft:0,scrollTop:0},u=bt(1);const h=bt(0),c=Z(n);if((c||!c&&!o)&&((gt(n)!=="body"||Me(r))&&(l=gi(n)),Z(n))){const d=_e(n);u=Ft(n),h.x=d.x+n.clientLeft,h.y=d.y+n.clientTop}return{width:i.width*u.x,height:i.height*u.y,x:i.x*u.x-l.scrollLeft*u.x+h.x,y:i.y*u.y-l.scrollTop*u.y+h.y}}function ca(e){return Array.from(e.getClientRects())}function Bs(e){return _e(yt(e)).left+gi(e).scrollLeft}function ua(e){const t=yt(e),i=gi(e),n=e.ownerDocument.body,s=it(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),o=it(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let r=-i.scrollLeft+Bs(e);const a=-i.scrollTop;return W(n).direction==="rtl"&&(r+=it(t.clientWidth,n.clientWidth)-s),{width:s,height:o,x:r,y:a}}function ha(e,t){const i=D(e),n=yt(e),s=i.visualViewport;let o=n.clientWidth,r=n.clientHeight,a=0,l=0;if(s){o=s.width,r=s.height;const u=on();(!u||u&&t==="fixed")&&(a=s.offsetLeft,l=s.offsetTop)}return{width:o,height:r,x:a,y:l}}function da(e,t){const i=_e(e,!0,t==="fixed"),n=i.top+e.clientTop,s=i.left+e.clientLeft,o=Z(e)?Ft(e):bt(1),r=e.clientWidth*o.x,a=e.clientHeight*o.y,l=s*o.x,u=n*o.y;return{width:r,height:a,x:l,y:u}}function An(e,t,i){let n;if(t==="viewport")n=ha(e,i);else if(t==="document")n=ua(yt(e));else if(st(t))n=da(t,i);else{const s=Ds(e);n={...t,x:t.x-s.x,y:t.y-s.y}}return Vt(n)}function Us(e,t){const i=Wt(e);return i===t||!st(i)||bi(i)?!1:W(i).position==="fixed"||Us(i,t)}function pa(e,t){const i=t.get(e);if(i)return i;let n=ji(e,[],!1).filter(a=>st(a)&>(a)!=="body"),s=null;const o=W(e).position==="fixed";let r=o?Wt(e):e;for(;st(r)&&!bi(r);){const a=W(r),l=sn(r);!l&&a.position==="fixed"&&(s=null),(o?!l&&!s:!l&&a.position==="static"&&s&&["absolute","fixed"].includes(s.position)||Me(r)&&!l&&Us(e,r))?n=n.filter(u=>u!==r):s=a,r=Wt(r)}return t.set(e,n),n}function ma(e){let{element:t,boundary:i,rootBoundary:n,strategy:s}=e;const o=[...i==="clippingAncestors"?pa(t,this._c):[].concat(i),n],r=o[0],a=o.reduce((l,u)=>{const h=An(t,u,s);return l.top=it(h.top,l.top),l.right=Ut(h.right,l.right),l.bottom=Ut(h.bottom,l.bottom),l.left=it(h.left,l.left),l},An(t,r,s));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function fa(e){const{width:t,height:i}=js(e);return{width:t,height:i}}function ba(e,t,i){const n=Z(t),s=yt(t),o=i==="fixed",r=_e(e,!0,o,t);let a={scrollLeft:0,scrollTop:0};const l=bt(0);if(n||!n&&!o)if((gt(t)!=="body"||Me(s))&&(a=gi(t)),n){const c=_e(t,!0,o,t);l.x=c.x+t.clientLeft,l.y=c.y+t.clientTop}else s&&(l.x=Bs(s));const u=r.left+a.scrollLeft-l.x,h=r.top+a.scrollTop-l.y;return{x:u,y:h,width:r.width,height:r.height}}function Sn(e,t){return!Z(e)||W(e).position==="fixed"?null:t?t(e):e.offsetParent}function Vs(e,t){const i=D(e);if(!Z(e)||Fs(e))return i;let n=Sn(e,t);for(;n&&ia(n)&&W(n).position==="static";)n=Sn(n,t);return n&&(gt(n)==="html"||gt(n)==="body"&&W(n).position==="static"&&!sn(n))?i:n||sa(e)||i}const ga=async function(e){const t=this.getOffsetParent||Vs,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 W(e).direction==="rtl"}const ya={convertOffsetParentRelativeRectToViewportRelativeRect:la,getDocumentElement:yt,getClippingRect:ma,getOffsetParent:Vs,getElementRects:ga,getClientRects:ca,getDimensions:fa,getScale:Ft,isElement:st,isRTL:va},Ws=ea,qs=Qr,Gs=Kr,Ys=(e,t,i)=>{const n=new Map,s={platform:ya,...i},o={...s.platform,_c:n};return Jr(e,t,{...s,platform:o})};/** +import{C as nn,o as yr,a as _r,h as Mt,c as Ne,R as xr,A as wr,O as $r,_ as Cr,d as Er,u as Ar,Y as ni}from"./index-BcIWfMQD.js";import{V as sn,c as gi,G as wn,F as Sr,L as kr,d as $n,e as Or,f as Tr,P as Xe,g as de,D as Nr,A as Pr,C as Pe,O as Mr,h as Ir,I as Cs,i as Es,j as As,k as Lr,l as zr,m as Ss,n as ks,o as Os,p as Rr,R as jr}from"./web-ifc-api-56EJvEs4.js";import{k as Hr,A as Dr,x as I}from"./index-mpk8FhA9.js";var Br=Object.defineProperty,Fr=(e,t,i)=>t in e?Br(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i,Ct=(e,t,i)=>(Fr(e,typeof t!="symbol"?t+"":t,i),i);const Ut=Math.min,nt=Math.max,si=Math.round,mt=e=>({x:e,y:e}),Ur={left:"right",right:"left",bottom:"top",top:"bottom"},Vr={start:"end",end:"start"};function Cn(e,t,i){return nt(e,Ut(t,i))}function Me(e,t){return typeof e=="function"?e(t):e}function ot(e){return e.split("-")[0]}function vi(e){return e.split("-")[1]}function Ts(e){return e==="x"?"y":"x"}function Ns(e){return e==="y"?"height":"width"}function Tt(e){return["top","bottom"].includes(ot(e))?"y":"x"}function Ps(e){return Ts(Tt(e))}function Wr(e,t,i){i===void 0&&(i=!1);const n=vi(e),s=Ps(e),o=Ns(s);let r=s==="x"?n===(i?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(r=oi(r)),[r,oi(r)]}function qr(e){const t=oi(e);return[Di(e),t,Di(t)]}function Di(e){return e.replace(/start|end/g,t=>Vr[t])}function Gr(e,t,i){const n=["left","right"],s=["right","left"],o=["top","bottom"],r=["bottom","top"];switch(e){case"top":case"bottom":return i?t?s:n:t?n:s;case"left":case"right":return t?o:r;default:return[]}}function Yr(e,t,i,n){const s=vi(e);let o=Gr(ot(e),i==="start",n);return s&&(o=o.map(r=>r+"-"+s),t&&(o=o.concat(o.map(Di)))),o}function oi(e){return e.replace(/left|right|bottom|top/g,t=>Ur[t])}function Xr(e){return{top:0,right:0,bottom:0,left:0,...e}}function Ms(e){return typeof e!="number"?Xr(e):{top:e,right:e,bottom:e,left:e}}function Vt(e){const{x:t,y:i,width:n,height:s}=e;return{width:n,height:s,top:i,left:t,right:t+n,bottom:i+s,x:t,y:i}}function En(e,t,i){let{reference:n,floating:s}=e;const o=Tt(t),r=Ps(t),a=Ns(r),l=ot(t),u=o==="y",d=n.x+n.width/2-s.width/2,c=n.y+n.height/2-s.height/2,h=n[a]/2-s[a]/2;let p;switch(l){case"top":p={x:d,y:n.y-s.height};break;case"bottom":p={x:d,y:n.y+n.height};break;case"right":p={x:n.x+n.width,y:c};break;case"left":p={x:n.x-s.width,y:c};break;default:p={x:n.x,y:n.y}}switch(vi(t)){case"start":p[r]-=h*(i&&u?-1:1);break;case"end":p[r]+=h*(i&&u?-1:1);break}return p}const Jr=async(e,t,i)=>{const{placement:n="bottom",strategy:s="absolute",middleware:o=[],platform:r}=i,a=o.filter(Boolean),l=await(r.isRTL==null?void 0:r.isRTL(t));let u=await r.getElementRects({reference:e,floating:t,strategy:s}),{x:d,y:c}=En(u,n,l),h=n,p={},v=0;for(let _=0;_L<=0)){var Y,D;const L=(((Y=o.flip)==null?void 0:Y.index)||0)+1,et=$[L];if(et)return{data:{index:L,overflows:S},reset:{placement:et}};let J=(D=S.filter(Q=>Q.overflows[0]<=0).sort((Q,V)=>Q.overflows[1]-V.overflows[1])[0])==null?void 0:D.placement;if(!J)switch(p){case"bestFit":{var ut;const Q=(ut=S.filter(V=>{if(C){const Z=Tt(V.placement);return Z===g||Z==="y"}return!0}).map(V=>[V.placement,V.overflows.filter(Z=>Z>0).reduce((Z,ue)=>Z+ue,0)]).sort((V,Z)=>V[1]-Z[1])[0])==null?void 0:ut[0];Q&&(J=Q);break}case"initialPlacement":J=a;break}if(s!==J)return{reset:{placement:J}}}return{}}}};function Is(e){const t=Ut(...e.map(o=>o.left)),i=Ut(...e.map(o=>o.top)),n=nt(...e.map(o=>o.right)),s=nt(...e.map(o=>o.bottom));return{x:t,y:i,width:n-t,height:s-i}}function Zr(e){const t=e.slice().sort((s,o)=>s.y-o.y),i=[];let n=null;for(let s=0;sn.height/2?i.push([o]):i[i.length-1].push(o),n=o}return i.map(s=>Vt(Is(s)))}const Kr=function(e){return e===void 0&&(e={}),{name:"inline",options:e,async fn(t){const{placement:i,elements:n,rects:s,platform:o,strategy:r}=t,{padding:a=2,x:l,y:u}=Me(e,t),d=Array.from(await(o.getClientRects==null?void 0:o.getClientRects(n.reference))||[]),c=Zr(d),h=Vt(Is(d)),p=Ms(a);function v(){if(c.length===2&&c[0].left>c[1].right&&l!=null&&u!=null)return c.find(b=>l>b.left-p.left&&lb.top-p.top&&u=2){if(Tt(i)==="y"){const S=c[0],Y=c[c.length-1],D=ot(i)==="top",ut=S.top,L=Y.bottom,et=D?S.left:Y.left,J=D?S.right:Y.right,Q=J-et,V=L-ut;return{top:ut,bottom:L,left:et,right:J,width:Q,height:V,x:et,y:ut}}const b=ot(i)==="left",m=nt(...c.map(S=>S.right)),g=Ut(...c.map(S=>S.left)),y=c.filter(S=>b?S.left===g:S.right===m),w=y[0].top,E=y[y.length-1].bottom,C=g,$=m,P=$-C,T=E-w;return{top:w,bottom:E,left:C,right:$,width:P,height:T,x:C,y:w}}return h}const _=await o.getElementRects({reference:{getBoundingClientRect:v},floating:n.floating,strategy:r});return s.reference.x!==_.reference.x||s.reference.y!==_.reference.y||s.reference.width!==_.reference.width||s.reference.height!==_.reference.height?{reset:{rects:_}}:{}}}};async function ta(e,t){const{placement:i,platform:n,elements:s}=e,o=await(n.isRTL==null?void 0:n.isRTL(s.floating)),r=ot(i),a=vi(i),l=Tt(i)==="y",u=["left","top"].includes(r)?-1:1,d=o&&l?-1:1,c=Me(t,e);let{mainAxis:h,crossAxis:p,alignmentAxis:v}=typeof c=="number"?{mainAxis:c,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...c};return a&&typeof v=="number"&&(p=a==="end"?v*-1:v),l?{x:p*d,y:h*u}:{x:h*u,y:p*d}}const Ls=function(e){return{name:"offset",options:e,async fn(t){var i,n;const{x:s,y:o,placement:r,middlewareData:a}=t,l=await ta(t,e);return r===((i=a.offset)==null?void 0:i.placement)&&(n=a.arrow)!=null&&n.alignmentOffset?{}:{x:s+l.x,y:o+l.y,data:{...l,placement:r}}}}},ea=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:i,y:n,placement:s}=t,{mainAxis:o=!0,crossAxis:r=!1,limiter:a={fn:b=>{let{x:m,y:g}=b;return{x:m,y:g}}},...l}=Me(e,t),u={x:i,y:n},d=await on(t,l),c=Tt(ot(s)),h=Ts(c);let p=u[h],v=u[c];if(o){const b=h==="y"?"top":"left",m=h==="y"?"bottom":"right",g=p+d[b],y=p-d[m];p=Cn(g,p,y)}if(r){const b=c==="y"?"top":"left",m=c==="y"?"bottom":"right",g=v+d[b],y=v-d[m];v=Cn(g,v,y)}const _=a.fn({...t,[h]:p,[c]:v});return{..._,data:{x:_.x-i,y:_.y-n}}}}};function bt(e){return zs(e)?(e.nodeName||"").toLowerCase():"#document"}function B(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function vt(e){var t;return(t=(zs(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function zs(e){return e instanceof Node||e instanceof B(e).Node}function rt(e){return e instanceof Element||e instanceof B(e).Element}function K(e){return e instanceof HTMLElement||e instanceof B(e).HTMLElement}function An(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof B(e).ShadowRoot}function Ie(e){const{overflow:t,overflowX:i,overflowY:n,display:s}=q(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+i)&&!["inline","contents"].includes(s)}function ia(e){return["table","td","th"].includes(bt(e))}function na(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function rn(e){const t=an(),i=q(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 sa(e){let t=Wt(e);for(;K(t)&&!yi(t);){if(na(t))return null;if(rn(t))return t;t=Wt(t)}return null}function an(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function yi(e){return["html","body","#document"].includes(bt(e))}function q(e){return B(e).getComputedStyle(e)}function _i(e){return rt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Wt(e){if(bt(e)==="html")return e;const t=e.assignedSlot||e.parentNode||An(e)&&e.host||vt(e);return An(t)?t.host:t}function Rs(e){const t=Wt(e);return yi(t)?e.ownerDocument?e.ownerDocument.body:e.body:K(t)&&Ie(t)?t:Rs(t)}function Bi(e,t,i){var n;t===void 0&&(t=[]),i===void 0&&(i=!0);const s=Rs(e),o=s===((n=e.ownerDocument)==null?void 0:n.body),r=B(s);return o?t.concat(r,r.visualViewport||[],Ie(s)?s:[],r.frameElement&&i?Bi(r.frameElement):[]):t.concat(s,Bi(s,[],i))}function js(e){const t=q(e);let i=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const s=K(e),o=s?e.offsetWidth:i,r=s?e.offsetHeight:n,a=si(i)!==o||si(n)!==r;return a&&(i=o,n=r),{width:i,height:n,$:a}}function Hs(e){return rt(e)?e:e.contextElement}function Dt(e){const t=Hs(e);if(!K(t))return mt(1);const i=t.getBoundingClientRect(),{width:n,height:s,$:o}=js(t);let r=(o?si(i.width):i.width)/n,a=(o?si(i.height):i.height)/s;return(!r||!Number.isFinite(r))&&(r=1),(!a||!Number.isFinite(a))&&(a=1),{x:r,y:a}}const oa=mt(0);function Ds(e){const t=B(e);return!an()||!t.visualViewport?oa:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ra(e,t,i){return t===void 0&&(t=!1),!i||t&&i!==B(e)?!1:t}function xe(e,t,i,n){t===void 0&&(t=!1),i===void 0&&(i=!1);const s=e.getBoundingClientRect(),o=Hs(e);let r=mt(1);t&&(n?rt(n)&&(r=Dt(n)):r=Dt(e));const a=ra(o,i,n)?Ds(o):mt(0);let l=(s.left+a.x)/r.x,u=(s.top+a.y)/r.y,d=s.width/r.x,c=s.height/r.y;if(o){const h=B(o),p=n&&rt(n)?B(n):n;let v=h,_=v.frameElement;for(;_&&n&&p!==v;){const b=Dt(_),m=_.getBoundingClientRect(),g=q(_),y=m.left+(_.clientLeft+parseFloat(g.paddingLeft))*b.x,w=m.top+(_.clientTop+parseFloat(g.paddingTop))*b.y;l*=b.x,u*=b.y,d*=b.x,c*=b.y,l+=y,u+=w,v=B(_),_=v.frameElement}}return Vt({width:d,height:c,x:l,y:u})}const aa=[":popover-open",":modal"];function Bs(e){return aa.some(t=>{try{return e.matches(t)}catch{return!1}})}function la(e){let{elements:t,rect:i,offsetParent:n,strategy:s}=e;const o=s==="fixed",r=vt(n),a=t?Bs(t.floating):!1;if(n===r||a&&o)return i;let l={scrollLeft:0,scrollTop:0},u=mt(1);const d=mt(0),c=K(n);if((c||!c&&!o)&&((bt(n)!=="body"||Ie(r))&&(l=_i(n)),K(n))){const h=xe(n);u=Dt(n),d.x=h.x+n.clientLeft,d.y=h.y+n.clientTop}return{width:i.width*u.x,height:i.height*u.y,x:i.x*u.x-l.scrollLeft*u.x+d.x,y:i.y*u.y-l.scrollTop*u.y+d.y}}function ca(e){return Array.from(e.getClientRects())}function Fs(e){return xe(vt(e)).left+_i(e).scrollLeft}function ua(e){const t=vt(e),i=_i(e),n=e.ownerDocument.body,s=nt(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),o=nt(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let r=-i.scrollLeft+Fs(e);const a=-i.scrollTop;return q(n).direction==="rtl"&&(r+=nt(t.clientWidth,n.clientWidth)-s),{width:s,height:o,x:r,y:a}}function ha(e,t){const i=B(e),n=vt(e),s=i.visualViewport;let o=n.clientWidth,r=n.clientHeight,a=0,l=0;if(s){o=s.width,r=s.height;const u=an();(!u||u&&t==="fixed")&&(a=s.offsetLeft,l=s.offsetTop)}return{width:o,height:r,x:a,y:l}}function da(e,t){const i=xe(e,!0,t==="fixed"),n=i.top+e.clientTop,s=i.left+e.clientLeft,o=K(e)?Dt(e):mt(1),r=e.clientWidth*o.x,a=e.clientHeight*o.y,l=s*o.x,u=n*o.y;return{width:r,height:a,x:l,y:u}}function Sn(e,t,i){let n;if(t==="viewport")n=ha(e,i);else if(t==="document")n=ua(vt(e));else if(rt(t))n=da(t,i);else{const s=Ds(e);n={...t,x:t.x-s.x,y:t.y-s.y}}return Vt(n)}function Us(e,t){const i=Wt(e);return i===t||!rt(i)||yi(i)?!1:q(i).position==="fixed"||Us(i,t)}function pa(e,t){const i=t.get(e);if(i)return i;let n=Bi(e,[],!1).filter(a=>rt(a)&&bt(a)!=="body"),s=null;const o=q(e).position==="fixed";let r=o?Wt(e):e;for(;rt(r)&&!yi(r);){const a=q(r),l=rn(r);!l&&a.position==="fixed"&&(s=null),(o?!l&&!s:!l&&a.position==="static"&&s&&["absolute","fixed"].includes(s.position)||Ie(r)&&!l&&Us(e,r))?n=n.filter(u=>u!==r):s=a,r=Wt(r)}return t.set(e,n),n}function fa(e){let{element:t,boundary:i,rootBoundary:n,strategy:s}=e;const o=[...i==="clippingAncestors"?pa(t,this._c):[].concat(i),n],r=o[0],a=o.reduce((l,u)=>{const d=Sn(t,u,s);return l.top=nt(d.top,l.top),l.right=Ut(d.right,l.right),l.bottom=Ut(d.bottom,l.bottom),l.left=nt(d.left,l.left),l},Sn(t,r,s));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function ma(e){const{width:t,height:i}=js(e);return{width:t,height:i}}function ba(e,t,i){const n=K(t),s=vt(t),o=i==="fixed",r=xe(e,!0,o,t);let a={scrollLeft:0,scrollTop:0};const l=mt(0);if(n||!n&&!o)if((bt(t)!=="body"||Ie(s))&&(a=_i(t)),n){const c=xe(t,!0,o,t);l.x=c.x+t.clientLeft,l.y=c.y+t.clientTop}else s&&(l.x=Fs(s));const u=r.left+a.scrollLeft-l.x,d=r.top+a.scrollTop-l.y;return{x:u,y:d,width:r.width,height:r.height}}function kn(e,t){return!K(e)||q(e).position==="fixed"?null:t?t(e):e.offsetParent}function Vs(e,t){const i=B(e);if(!K(e)||Bs(e))return i;let n=kn(e,t);for(;n&&ia(n)&&q(n).position==="static";)n=kn(n,t);return n&&(bt(n)==="html"||bt(n)==="body"&&q(n).position==="static"&&!rn(n))?i:n||sa(e)||i}const ga=async function(e){const t=this.getOffsetParent||Vs,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 q(e).direction==="rtl"}const ya={convertOffsetParentRelativeRectToViewportRelativeRect:la,getDocumentElement:vt,getClippingRect:fa,getOffsetParent:Vs,getElementRects:ga,getClientRects:ca,getDimensions:ma,getScale:Dt,isElement:rt,isRTL:va},Ws=ea,qs=Qr,Gs=Kr,Ys=(e,t,i)=>{const n=new Map,s={platform:ya,...i},o={...s.platform,_c:n};return Jr(e,t,{...s,platform:o})};/** * @license * Copyright 2019 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const Qe=globalThis,rn=Qe.ShadowRoot&&(Qe.ShadyCSS===void 0||Qe.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,an=Symbol(),kn=new WeakMap;let Xs=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==an)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(rn&&e===void 0){const i=t!==void 0&&t.length===1;i&&(e=kn.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&kn.set(t,e))}return e}toString(){return this.cssText}};const _a=e=>new Xs(typeof e=="string"?e:e+"",void 0,an),O=(e,...t)=>{const i=e.length===1?e[0]:t.reduce((n,s,o)=>n+(r=>{if(r._$cssResult$===!0)return r.cssText;if(typeof r=="number")return r;throw Error("Value passed to 'css' function must be a 'css' function result: "+r+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+e[o+1],e[0]);return new Xs(i,e,an)},xa=(e,t)=>{if(rn)e.adoptedStyleSheets=t.map(i=>i instanceof CSSStyleSheet?i:i.styleSheet);else for(const i of t){const n=document.createElement("style"),s=Qe.litNonce;s!==void 0&&n.setAttribute("nonce",s),n.textContent=i.cssText,e.appendChild(n)}},On=rn?e=>e:e=>e instanceof CSSStyleSheet?(t=>{let i="";for(const n of t.cssRules)i+=n.cssText;return _a(i)})(e):e;/** + */const Ke=globalThis,ln=Ke.ShadowRoot&&(Ke.ShadyCSS===void 0||Ke.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,cn=Symbol(),On=new WeakMap;let Xs=class{constructor(e,t,i){if(this._$cssResult$=!0,i!==cn)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o;const t=this.t;if(ln&&e===void 0){const i=t!==void 0&&t.length===1;i&&(e=On.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),i&&On.set(t,e))}return e}toString(){return this.cssText}};const _a=e=>new Xs(typeof e=="string"?e:e+"",void 0,cn),O=(e,...t)=>{const i=e.length===1?e[0]:t.reduce((n,s,o)=>n+(r=>{if(r._$cssResult$===!0)return r.cssText;if(typeof r=="number")return r;throw Error("Value passed to 'css' function must be a 'css' function result: "+r+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+e[o+1],e[0]);return new Xs(i,e,cn)},xa=(e,t)=>{if(ln)e.adoptedStyleSheets=t.map(i=>i instanceof CSSStyleSheet?i:i.styleSheet);else for(const i of t){const n=document.createElement("style"),s=Ke.litNonce;s!==void 0&&n.setAttribute("nonce",s),n.textContent=i.cssText,e.appendChild(n)}},Tn=ln?e=>e:e=>e instanceof CSSStyleSheet?(t=>{let i="";for(const n of t.cssRules)i+=n.cssText;return _a(i)})(e):e;/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const{is:wa,defineProperty:$a,getOwnPropertyDescriptor:Ca,getOwnPropertyNames:Ea,getOwnPropertySymbols:Aa,getPrototypeOf:Sa}=Object,qt=globalThis,Tn=qt.trustedTypes,ka=Tn?Tn.emptyScript:"",Nn=qt.reactiveElementPolyfillSupport,fe=(e,t)=>e,ni={toAttribute(e,t){switch(t){case Boolean:e=e?ka:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let i=e;switch(t){case Boolean:i=e!==null;break;case Number:i=e===null?null:Number(e);break;case Object:case Array:try{i=JSON.parse(e)}catch{i=null}}return i}},ln=(e,t)=>!wa(e,t),Pn={attribute:!0,type:String,converter:ni,reflect:!1,hasChanged:ln};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),qt.litPropertyMetadata??(qt.litPropertyMetadata=new WeakMap);class Ht extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,i=Pn){if(i.state&&(i.attribute=!1),this._$Ei(),this.elementProperties.set(t,i),!i.noAccessor){const n=Symbol(),s=this.getPropertyDescriptor(t,n,i);s!==void 0&&$a(this.prototype,t,s)}}static getPropertyDescriptor(t,i,n){const{get:s,set:o}=Ca(this.prototype,t)??{get(){return this[i]},set(r){this[i]=r}};return{get(){return s==null?void 0:s.call(this)},set(r){const a=s==null?void 0:s.call(this);o.call(this,r),this.requestUpdate(t,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Pn}static _$Ei(){if(this.hasOwnProperty(fe("elementProperties")))return;const t=Sa(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(fe("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(fe("properties"))){const i=this.properties,n=[...Ea(i),...Aa(i)];for(const s of n)this.createProperty(s,i[s])}const t=this[Symbol.metadata];if(t!==null){const i=litPropertyMetadata.get(t);if(i!==void 0)for(const[n,s]of i)this.elementProperties.set(n,s)}this._$Eh=new Map;for(const[i,n]of this.elementProperties){const s=this._$Eu(i,n);s!==void 0&&this._$Eh.set(s,i)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const i=[];if(Array.isArray(t)){const n=new Set(t.flat(1/0).reverse());for(const s of n)i.unshift(On(s))}else t!==void 0&&i.push(On(t));return i}static _$Eu(t,i){const n=i.attribute;return n===!1?void 0:typeof n=="string"?n:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise(i=>this.enableUpdating=i),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach(i=>i(this))}addController(t){var i;(this._$EO??(this._$EO=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&((i=t.hostConnected)==null||i.call(t))}removeController(t){var i;(i=this._$EO)==null||i.delete(t)}_$E_(){const t=new Map,i=this.constructor.elementProperties;for(const n of i.keys())this.hasOwnProperty(n)&&(t.set(n,this[n]),delete this[n]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return xa(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$EO)==null||t.forEach(i=>{var n;return(n=i.hostConnected)==null?void 0:n.call(i)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach(i=>{var n;return(n=i.hostDisconnected)==null?void 0:n.call(i)})}attributeChangedCallback(t,i,n){this._$AK(t,n)}_$EC(t,i){var n;const s=this.constructor.elementProperties.get(t),o=this.constructor._$Eu(t,s);if(o!==void 0&&s.reflect===!0){const r=(((n=s.converter)==null?void 0:n.toAttribute)!==void 0?s.converter:ni).toAttribute(i,s.type);this._$Em=t,r==null?this.removeAttribute(o):this.setAttribute(o,r),this._$Em=null}}_$AK(t,i){var n;const s=this.constructor,o=s._$Eh.get(t);if(o!==void 0&&this._$Em!==o){const r=s.getPropertyOptions(o),a=typeof r.converter=="function"?{fromAttribute:r.converter}:((n=r.converter)==null?void 0:n.fromAttribute)!==void 0?r.converter:ni;this._$Em=o,this[o]=a.fromAttribute(i,r.type),this._$Em=null}}requestUpdate(t,i,n){if(t!==void 0){if(n??(n=this.constructor.getPropertyOptions(t)),!(n.hasChanged??ln)(this[t],i))return;this.P(t,i,n)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,i,n){this._$AL.has(t)||this._$AL.set(t,i),n.reflect===!0&&this._$Em!==t&&(this._$Ej??(this._$Ej=new Set)).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(i){Promise.reject(i)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[o,r]of this._$Ep)this[o]=r;this._$Ep=void 0}const s=this.constructor.elementProperties;if(s.size>0)for(const[o,r]of s)r.wrapped!==!0||this._$AL.has(o)||this[o]===void 0||this.P(o,this[o],r)}let i=!1;const n=this._$AL;try{i=this.shouldUpdate(n),i?(this.willUpdate(n),(t=this._$EO)==null||t.forEach(s=>{var o;return(o=s.hostUpdate)==null?void 0:o.call(s)}),this.update(n)):this._$EU()}catch(s){throw i=!1,this._$EU(),s}i&&this._$AE(n)}willUpdate(t){}_$AE(t){var i;(i=this._$EO)==null||i.forEach(n=>{var s;return(s=n.hostUpdated)==null?void 0:s.call(n)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&(this._$Ej=this._$Ej.forEach(i=>this._$EC(i,this[i]))),this._$EU()}updated(t){}firstUpdated(t){}}Ht.elementStyles=[],Ht.shadowRootOptions={mode:"open"},Ht[fe("elementProperties")]=new Map,Ht[fe("finalized")]=new Map,Nn==null||Nn({ReactiveElement:Ht}),(qt.reactiveElementVersions??(qt.reactiveElementVersions=[])).push("2.0.4");/** + */const{is:wa,defineProperty:$a,getOwnPropertyDescriptor:Ca,getOwnPropertyNames:Ea,getOwnPropertySymbols:Aa,getPrototypeOf:Sa}=Object,qt=globalThis,Nn=qt.trustedTypes,ka=Nn?Nn.emptyScript:"",Pn=qt.reactiveElementPolyfillSupport,be=(e,t)=>e,ri={toAttribute(e,t){switch(t){case Boolean:e=e?ka:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let i=e;switch(t){case Boolean:i=e!==null;break;case Number:i=e===null?null:Number(e);break;case Object:case Array:try{i=JSON.parse(e)}catch{i=null}}return i}},un=(e,t)=>!wa(e,t),Mn={attribute:!0,type:String,converter:ri,reflect:!1,hasChanged:un};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),qt.litPropertyMetadata??(qt.litPropertyMetadata=new WeakMap);class jt extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,i=Mn){if(i.state&&(i.attribute=!1),this._$Ei(),this.elementProperties.set(t,i),!i.noAccessor){const n=Symbol(),s=this.getPropertyDescriptor(t,n,i);s!==void 0&&$a(this.prototype,t,s)}}static getPropertyDescriptor(t,i,n){const{get:s,set:o}=Ca(this.prototype,t)??{get(){return this[i]},set(r){this[i]=r}};return{get(){return s==null?void 0:s.call(this)},set(r){const a=s==null?void 0:s.call(this);o.call(this,r),this.requestUpdate(t,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??Mn}static _$Ei(){if(this.hasOwnProperty(be("elementProperties")))return;const t=Sa(this);t.finalize(),t.l!==void 0&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(be("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(be("properties"))){const i=this.properties,n=[...Ea(i),...Aa(i)];for(const s of n)this.createProperty(s,i[s])}const t=this[Symbol.metadata];if(t!==null){const i=litPropertyMetadata.get(t);if(i!==void 0)for(const[n,s]of i)this.elementProperties.set(n,s)}this._$Eh=new Map;for(const[i,n]of this.elementProperties){const s=this._$Eu(i,n);s!==void 0&&this._$Eh.set(s,i)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const i=[];if(Array.isArray(t)){const n=new Set(t.flat(1/0).reverse());for(const s of n)i.unshift(Tn(s))}else t!==void 0&&i.push(Tn(t));return i}static _$Eu(t,i){const n=i.attribute;return n===!1?void 0:typeof n=="string"?n:typeof t=="string"?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){var t;this._$ES=new Promise(i=>this.enableUpdating=i),this._$AL=new Map,this._$E_(),this.requestUpdate(),(t=this.constructor.l)==null||t.forEach(i=>i(this))}addController(t){var i;(this._$EO??(this._$EO=new Set)).add(t),this.renderRoot!==void 0&&this.isConnected&&((i=t.hostConnected)==null||i.call(t))}removeController(t){var i;(i=this._$EO)==null||i.delete(t)}_$E_(){const t=new Map,i=this.constructor.elementProperties;for(const n of i.keys())this.hasOwnProperty(n)&&(t.set(n,this[n]),delete this[n]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return xa(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),(t=this._$EO)==null||t.forEach(i=>{var n;return(n=i.hostConnected)==null?void 0:n.call(i)})}enableUpdating(t){}disconnectedCallback(){var t;(t=this._$EO)==null||t.forEach(i=>{var n;return(n=i.hostDisconnected)==null?void 0:n.call(i)})}attributeChangedCallback(t,i,n){this._$AK(t,n)}_$EC(t,i){var n;const s=this.constructor.elementProperties.get(t),o=this.constructor._$Eu(t,s);if(o!==void 0&&s.reflect===!0){const r=(((n=s.converter)==null?void 0:n.toAttribute)!==void 0?s.converter:ri).toAttribute(i,s.type);this._$Em=t,r==null?this.removeAttribute(o):this.setAttribute(o,r),this._$Em=null}}_$AK(t,i){var n;const s=this.constructor,o=s._$Eh.get(t);if(o!==void 0&&this._$Em!==o){const r=s.getPropertyOptions(o),a=typeof r.converter=="function"?{fromAttribute:r.converter}:((n=r.converter)==null?void 0:n.fromAttribute)!==void 0?r.converter:ri;this._$Em=o,this[o]=a.fromAttribute(i,r.type),this._$Em=null}}requestUpdate(t,i,n){if(t!==void 0){if(n??(n=this.constructor.getPropertyOptions(t)),!(n.hasChanged??un)(this[t],i))return;this.P(t,i,n)}this.isUpdatePending===!1&&(this._$ES=this._$ET())}P(t,i,n){this._$AL.has(t)||this._$AL.set(t,i),n.reflect===!0&&this._$Em!==t&&(this._$Ej??(this._$Ej=new Set)).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(i){Promise.reject(i)}const t=this.scheduleUpdate();return t!=null&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this._$Ep){for(const[o,r]of this._$Ep)this[o]=r;this._$Ep=void 0}const s=this.constructor.elementProperties;if(s.size>0)for(const[o,r]of s)r.wrapped!==!0||this._$AL.has(o)||this[o]===void 0||this.P(o,this[o],r)}let i=!1;const n=this._$AL;try{i=this.shouldUpdate(n),i?(this.willUpdate(n),(t=this._$EO)==null||t.forEach(s=>{var o;return(o=s.hostUpdate)==null?void 0:o.call(s)}),this.update(n)):this._$EU()}catch(s){throw i=!1,this._$EU(),s}i&&this._$AE(n)}willUpdate(t){}_$AE(t){var i;(i=this._$EO)==null||i.forEach(n=>{var s;return(s=n.hostUpdated)==null?void 0:s.call(n)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&(this._$Ej=this._$Ej.forEach(i=>this._$EC(i,this[i]))),this._$EU()}updated(t){}firstUpdated(t){}}jt.elementStyles=[],jt.shadowRootOptions={mode:"open"},jt[be("elementProperties")]=new Map,jt[be("finalized")]=new Map,Pn==null||Pn({ReactiveElement:jt}),(qt.reactiveElementVersions??(qt.reactiveElementVersions=[])).push("2.0.4");/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const si=globalThis,oi=si.trustedTypes,Mn=oi?oi.createPolicy("lit-html",{createHTML:e=>e}):void 0,Js="$lit$",pt=`lit$${Math.random().toFixed(9).slice(2)}$`,Qs="?"+pt,Oa=`<${Qs}>`,Pt=document,xe=()=>Pt.createComment(""),we=e=>e===null||typeof e!="object"&&typeof e!="function",Zs=Array.isArray,Ta=e=>Zs(e)||typeof(e==null?void 0:e[Symbol.iterator])=="function",Ti=`[ -\f\r]`,de=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,In=/-->/g,Ln=/>/g,At=RegExp(`>|${Ti}(?:([^\\s"'>=/]+)(${Ti}*=${Ti}*(?:[^ -\f\r"'\`<>=]|("|')|))|$)`,"g"),zn=/'/g,Rn=/"/g,Ks=/^(?:script|style|textarea|title)$/i,Na=e=>(t,...i)=>({_$litType$:e,strings:t,values:i}),_=Na(1),Gt=Symbol.for("lit-noChange"),N=Symbol.for("lit-nothing"),jn=new WeakMap,kt=Pt.createTreeWalker(Pt,129);function to(e,t){if(!Array.isArray(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return Mn!==void 0?Mn.createHTML(t):t}const Pa=(e,t)=>{const i=e.length-1,n=[];let s,o=t===2?"":"",r=de;for(let a=0;a"?(r=s??de,c=-1):h[1]===void 0?c=-2:(c=r.lastIndex-h[2].length,u=h[1],r=h[3]===void 0?At:h[3]==='"'?Rn:zn):r===Rn||r===zn?r=At:r===In||r===Ln?r=de:(r=At,s=void 0);const p=r===At&&e[a+1].startsWith("/>")?" ":"";o+=r===de?l+Oa:c>=0?(n.push(u),l.slice(0,c)+Js+l.slice(c)+pt+p):l+pt+(c===-2?a:p)}return[to(e,o+(e[i]||"")+(t===2?"":"")),n]};class $e{constructor({strings:t,_$litType$:i},n){let s;this.parts=[];let o=0,r=0;const a=t.length-1,l=this.parts,[u,h]=Pa(t,i);if(this.el=$e.createElement(u,n),kt.currentNode=this.el.content,i===2){const c=this.el.content.firstChild;c.replaceWith(...c.childNodes)}for(;(s=kt.nextNode())!==null&&l.length0){s.textContent=oi?oi.emptyScript:"";for(let p=0;p2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=N}_$AI(t,i=this,n,s){const o=this.strings;let r=!1;if(o===void 0)t=Yt(this,t,i,0),r=!we(t)||t!==this._$AH&&t!==Gt,r&&(this._$AH=t);else{const a=t;let l,u;for(t=o[0],l=0;l{const n=(i==null?void 0:i.renderBefore)??t;let s=n._$litPart$;if(s===void 0){const o=(i==null?void 0:i.renderBefore)??null;n._$litPart$=s=new Ie(t.insertBefore(xe(),o),o,void 0,i??{})}return s._$AI(e),s};/** + */const ai=globalThis,li=ai.trustedTypes,In=li?li.createPolicy("lit-html",{createHTML:e=>e}):void 0,Js="$lit$",pt=`lit$${Math.random().toFixed(9).slice(2)}$`,Qs="?"+pt,Oa=`<${Qs}>`,Nt=document,we=()=>Nt.createComment(""),$e=e=>e===null||typeof e!="object"&&typeof e!="function",Zs=Array.isArray,Ta=e=>Zs(e)||typeof(e==null?void 0:e[Symbol.iterator])=="function",Mi=`[ +\f\r]`,pe=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Ln=/-->/g,zn=/>/g,Et=RegExp(`>|${Mi}(?:([^\\s"'>=/]+)(${Mi}*=${Mi}*(?:[^ +\f\r"'\`<>=]|("|')|))|$)`,"g"),Rn=/'/g,jn=/"/g,Ks=/^(?:script|style|textarea|title)$/i,Na=e=>(t,...i)=>({_$litType$:e,strings:t,values:i}),x=Na(1),Gt=Symbol.for("lit-noChange"),M=Symbol.for("lit-nothing"),Hn=new WeakMap,St=Nt.createTreeWalker(Nt,129);function to(e,t){if(!Array.isArray(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return In!==void 0?In.createHTML(t):t}const Pa=(e,t)=>{const i=e.length-1,n=[];let s,o=t===2?"":"",r=pe;for(let a=0;a"?(r=s??pe,c=-1):d[1]===void 0?c=-2:(c=r.lastIndex-d[2].length,u=d[1],r=d[3]===void 0?Et:d[3]==='"'?jn:Rn):r===jn||r===Rn?r=Et:r===Ln||r===zn?r=pe:(r=Et,s=void 0);const p=r===Et&&e[a+1].startsWith("/>")?" ":"";o+=r===pe?l+Oa:c>=0?(n.push(u),l.slice(0,c)+Js+l.slice(c)+pt+p):l+pt+(c===-2?a:p)}return[to(e,o+(e[i]||"")+(t===2?"":"")),n]};class Ce{constructor({strings:t,_$litType$:i},n){let s;this.parts=[];let o=0,r=0;const a=t.length-1,l=this.parts,[u,d]=Pa(t,i);if(this.el=Ce.createElement(u,n),St.currentNode=this.el.content,i===2){const c=this.el.content.firstChild;c.replaceWith(...c.childNodes)}for(;(s=St.nextNode())!==null&&l.length0){s.textContent=li?li.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,s){const o=this.strings;let r=!1;if(o===void 0)t=Yt(this,t,i,0),r=!$e(t)||t!==this._$AH&&t!==Gt,r&&(this._$AH=t);else{const a=t;let l,u;for(t=o[0],l=0;l{const n=(i==null?void 0:i.renderBefore)??t;let s=n._$litPart$;if(s===void 0){const o=(i==null?void 0:i.renderBefore)??null;n._$litPart$=s=new Le(t.insertBefore(we(),o),o,void 0,i??{})}return s._$AI(e),s};/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */let S=class extends Ht{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e;const t=super.createRenderRoot();return(e=this.renderOptions).renderBefore??(e.renderBefore=t.firstChild),t}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Xt(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)==null||e.setConnected(!1)}render(){return Gt}};var Dn;S._$litElement$=!0,S.finalized=!0,(Dn=globalThis.litElementHydrateSupport)==null||Dn.call(globalThis,{LitElement:S});const Fn=globalThis.litElementPolyfillSupport;Fn==null||Fn({LitElement:S});(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.0.6");/** + */let k=class extends jt{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e;const t=super.createRenderRoot();return(e=this.renderOptions).renderBefore??(e.renderBefore=t.firstChild),t}update(e){const t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Xt(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),(e=this._$Do)==null||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),(e=this._$Do)==null||e.setConnected(!1)}render(){return Gt}};var Bn;k._$litElement$=!0,k.finalized=!0,(Bn=globalThis.litElementHydrateSupport)==null||Bn.call(globalThis,{LitElement:k});const Fn=globalThis.litElementPolyfillSupport;Fn==null||Fn({LitElement:k});(globalThis.litElementVersions??(globalThis.litElementVersions=[])).push("4.0.6");/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const ja={attribute:!0,type:String,converter:ni,reflect:!1,hasChanged:ln},Ha=(e=ja,t,i)=>{const{kind:n,metadata:s}=i;let o=globalThis.litPropertyMetadata.get(s);if(o===void 0&&globalThis.litPropertyMetadata.set(s,o=new Map),o.set(i.name,e),n==="accessor"){const{name:r}=i;return{set(a){const l=t.get.call(this);t.set.call(this,a),this.requestUpdate(r,l,e)},init(a){return a!==void 0&&this.P(r,void 0,e),a}}}if(n==="setter"){const{name:r}=i;return function(a){const l=this[r];t.call(this,a),this.requestUpdate(r,l,e)}}throw Error("Unsupported decorator location: "+n)};function m(e){return(t,i)=>typeof i=="object"?Ha(e,t,i):((n,s,o)=>{const r=s.hasOwnProperty(o);return s.constructor.createProperty(o,r?{...n,wrapped:!0}:n),r?Object.getOwnPropertyDescriptor(s,o):void 0})(e,t,i)}/** + */const ja={attribute:!0,type:String,converter:ri,reflect:!1,hasChanged:un},Ha=(e=ja,t,i)=>{const{kind:n,metadata:s}=i;let o=globalThis.litPropertyMetadata.get(s);if(o===void 0&&globalThis.litPropertyMetadata.set(s,o=new Map),o.set(i.name,e),n==="accessor"){const{name:r}=i;return{set(a){const l=t.get.call(this);t.set.call(this,a),this.requestUpdate(r,l,e)},init(a){return a!==void 0&&this.P(r,void 0,e),a}}}if(n==="setter"){const{name:r}=i;return function(a){const l=this[r];t.call(this,a),this.requestUpdate(r,l,e)}}throw Error("Unsupported decorator location: "+n)};function f(e){return(t,i)=>typeof i=="object"?Ha(e,t,i):((n,s,o)=>{const r=s.hasOwnProperty(o);return s.constructor.createProperty(o,r?{...n,wrapped:!0}:n),r?Object.getOwnPropertyDescriptor(s,o):void 0})(e,t,i)}/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */function Le(e){return m({...e,state:!0,attribute:!1})}/** + */function ze(e){return f({...e,state:!0,attribute:!1})}/** * @license * Copyright 2020 Google LLC * SPDX-License-Identifier: BSD-3-Clause @@ -32,15 +32,15 @@ import{C as Ki,o as _r,a as xr,h as It,b as Te,c as wr,S as $r,A as Cr,g as Er,d * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const Fa={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Ba=e=>(...t)=>({_$litDirective$:e,values:t});let Ua=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,i){this._$Ct=e,this._$AM=t,this._$Ci=i}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};/** + */const Ba={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},Fa=e=>(...t)=>({_$litDirective$:e,values:t});let Ua=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,i){this._$Ct=e,this._$AM=t,this._$Ci=i}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}};/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const be=(e,t)=>{var i;const n=e._$AN;if(n===void 0)return!1;for(const s of n)(i=s._$AO)==null||i.call(s,t,!1),be(s,t);return!0},ri=e=>{let t,i;do{if((t=e._$AM)===void 0)break;i=t._$AN,i.delete(e),e=t}while((i==null?void 0:i.size)===0)},eo=e=>{for(let t;t=e._$AM;e=t){let i=t._$AN;if(i===void 0)t._$AN=i=new Set;else if(i.has(e))break;i.add(e),qa(t)}};function Va(e){this._$AN!==void 0?(ri(this),this._$AM=e,eo(this)):this._$AM=e}function Wa(e,t=!1,i=0){const n=this._$AH,s=this._$AN;if(s!==void 0&&s.size!==0)if(t)if(Array.isArray(n))for(let o=i;o{e.type==Fa.CHILD&&(e._$AP??(e._$AP=Wa),e._$AQ??(e._$AQ=Va))};class Ga extends Ua{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,i,n){super._$AT(t,i,n),eo(this),this.isConnected=t._$AU}_$AO(t,i=!0){var n,s;t!==this.isConnected&&(this.isConnected=t,t?(n=this.reconnected)==null||n.call(this):(s=this.disconnected)==null||s.call(this)),i&&(be(this,t),ri(this))}setValue(t){if(Da(this._$Ct))this._$Ct._$AI(t,this);else{const i=[...this._$Ct._$AH];i[this._$Ci]=t,this._$Ct._$AI(i,this,0)}}disconnected(){}reconnected(){}}/** + */const ge=(e,t)=>{var i;const n=e._$AN;if(n===void 0)return!1;for(const s of n)(i=s._$AO)==null||i.call(s,t,!1),ge(s,t);return!0},ci=e=>{let t,i;do{if((t=e._$AM)===void 0)break;i=t._$AN,i.delete(e),e=t}while((i==null?void 0:i.size)===0)},eo=e=>{for(let t;t=e._$AM;e=t){let i=t._$AN;if(i===void 0)t._$AN=i=new Set;else if(i.has(e))break;i.add(e),qa(t)}};function Va(e){this._$AN!==void 0?(ci(this),this._$AM=e,eo(this)):this._$AM=e}function Wa(e,t=!1,i=0){const n=this._$AH,s=this._$AN;if(s!==void 0&&s.size!==0)if(t)if(Array.isArray(n))for(let o=i;o{e.type==Ba.CHILD&&(e._$AP??(e._$AP=Wa),e._$AQ??(e._$AQ=Va))};class Ga extends Ua{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,i,n){super._$AT(t,i,n),eo(this),this.isConnected=t._$AU}_$AO(t,i=!0){var n,s;t!==this.isConnected&&(this.isConnected=t,t?(n=this.reconnected)==null||n.call(this):(s=this.disconnected)==null||s.call(this)),i&&(ge(this,t),ci(this))}setValue(t){if(Da(this._$Ct))this._$Ct._$AI(t,this);else{const i=[...this._$Ct._$AH];i[this._$Ci]=t,this._$Ct._$AI(i,this,0)}}disconnected(){}reconnected(){}}/** * @license * Copyright 2020 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const ft=()=>new Ya;class Ya{}const Ni=new WeakMap,G=Ba(class extends Ga{render(e){return N}update(e,[t]){var i;const n=t!==this.Y;return n&&this.Y!==void 0&&this.rt(void 0),(n||this.lt!==this.ct)&&(this.Y=t,this.ht=(i=e.options)==null?void 0:i.host,this.rt(this.ct=e.element)),N}rt(e){if(this.isConnected||(e=void 0),typeof this.Y=="function"){const t=this.ht??globalThis;let i=Ni.get(t);i===void 0&&(i=new WeakMap,Ni.set(t,i)),i.get(this.Y)!==void 0&&this.Y.call(this.ht,void 0),i.set(this.Y,e),e!==void 0&&this.Y.call(this.ht,e)}else this.Y.value=e}get lt(){var e,t;return typeof this.Y=="function"?(e=Ni.get(this.ht??globalThis))==null?void 0:e.get(this.Y):(t=this.Y)==null?void 0:t.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});/** + */const Bt=()=>new Ya;class Ya{}const Ii=new WeakMap,st=Fa(class extends Ga{render(e){return M}update(e,[t]){var i;const n=t!==this.Y;return n&&this.Y!==void 0&&this.rt(void 0),(n||this.lt!==this.ct)&&(this.Y=t,this.ht=(i=e.options)==null?void 0:i.host,this.rt(this.ct=e.element)),M}rt(e){if(this.isConnected||(e=void 0),typeof this.Y=="function"){const t=this.ht??globalThis;let i=Ii.get(t);i===void 0&&(i=new WeakMap,Ii.set(t,i)),i.get(this.Y)!==void 0&&this.Y.call(this.ht,void 0),i.set(this.Y,e),e!==void 0&&this.Y.call(this.ht,e)}else this.Y.value=e}get lt(){var e,t;return typeof this.Y=="function"?(e=Ii.get(this.ht??globalThis))==null?void 0:e.get(this.Y):(t=this.Y)==null?void 0:t.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});/** * (c) Iconify * * For the full copyright and license information, please view the license.txt @@ -50,30 +50,16 @@ import{C as Ki,o as _r,a as xr,h as It,b as Te,c as wr,S as $r,A as Cr,g as Er,d * * @license MIT * @version 2.0.0 -*/const io=Object.freeze({left:0,top:0,width:16,height:16}),ai=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),ze=Object.freeze({...io,...ai}),Hi=Object.freeze({...ze,body:"",hidden:!1}),Xa=Object.freeze({width:null,height:null}),no=Object.freeze({...Xa,...ai});function Ja(e,t=0){const i=e.replace(/^-?[0-9.]*/,"");function n(s){for(;s<0;)s+=4;return s%4}if(i===""){const s=parseInt(e);return isNaN(s)?0:n(s)}else if(i!==e){let s=0;switch(i){case"%":s=25;break;case"deg":s=90}if(s){let o=parseFloat(e.slice(0,e.length-i.length));return isNaN(o)?0:(o=o/s,o%1===0?n(o):0)}}return t}const Qa=/[\s,]+/;function Za(e,t){t.split(Qa).forEach(i=>{switch(i.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}const so={...no,preserveAspectRatio:""};function Bn(e){const t={...so},i=(n,s)=>e.getAttribute(n)||s;return t.width=i("width",null),t.height=i("height",null),t.rotate=Ja(i("rotate","")),Za(t,i("flip","")),t.preserveAspectRatio=i("preserveAspectRatio",i("preserveaspectratio","")),t}function Ka(e,t){for(const i in so)if(e[i]!==t[i])return!0;return!1}const ge=/^[a-z0-9]+(-[a-z0-9]+)*$/,Re=(e,t,i,n="")=>{const s=e.split(":");if(e.slice(0,1)==="@"){if(s.length<2||s.length>3)return null;n=s.shift().slice(1)}if(s.length>3||!s.length)return null;if(s.length>1){const a=s.pop(),l=s.pop(),u={provider:s.length>0?s[0]:n,prefix:l,name:a};return t&&!Ze(u)?null:u}const o=s[0],r=o.split("-");if(r.length>1){const a={provider:n,prefix:r.shift(),name:r.join("-")};return t&&!Ze(a)?null:a}if(i&&n===""){const a={provider:n,prefix:"",name:o};return t&&!Ze(a,i)?null:a}return null},Ze=(e,t)=>e?!!((e.provider===""||e.provider.match(ge))&&(t&&e.prefix===""||e.prefix.match(ge))&&e.name.match(ge)):!1;function tl(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 Un(e,t){const i=tl(e,t);for(const n in Hi)n in ai?n in e&&!(n in i)&&(i[n]=ai[n]):n in t?i[n]=t[n]:n in e&&(i[n]=e[n]);return i}function el(e,t){const i=e.icons,n=e.aliases||Object.create(null),s=Object.create(null);function o(r){if(i[r])return s[r]=[];if(!(r in s)){s[r]=null;const a=n[r]&&n[r].parent,l=a&&o(a);l&&(s[r]=[a].concat(l))}return s[r]}return Object.keys(i).concat(Object.keys(n)).forEach(o),s}function il(e,t,i){const n=e.icons,s=e.aliases||Object.create(null);let o={};function r(a){o=Un(n[a]||s[a],o)}return r(t),i.forEach(r),Un(e,o)}function oo(e,t){const i=[];if(typeof e!="object"||typeof e.icons!="object")return i;e.not_found instanceof Array&&e.not_found.forEach(s=>{t(s,null),i.push(s)});const n=el(e);for(const s in n){const o=n[s];o&&(t(s,il(e,s,o)),i.push(s))}return i}const nl={provider:"",aliases:{},not_found:{},...io};function Pi(e,t){for(const i in t)if(i in e&&typeof e[i]!=typeof t[i])return!1;return!0}function ro(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.prefix!="string"||!e.icons||typeof e.icons!="object"||!Pi(e,nl))return null;const i=t.icons;for(const s in i){const o=i[s];if(!s.match(ge)||typeof o.body!="string"||!Pi(o,Hi))return null}const n=t.aliases||Object.create(null);for(const s in n){const o=n[s],r=o.parent;if(!s.match(ge)||typeof r!="string"||!i[r]&&!n[r]||!Pi(o,Hi))return null}return t}const li=Object.create(null);function sl(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function vt(e,t){const i=li[e]||(li[e]=Object.create(null));return i[t]||(i[t]=sl(e,t))}function cn(e,t){return ro(t)?oo(t,(i,n)=>{n?e.icons[i]=n:e.missing.add(i)}):[]}function ol(e,t,i){try{if(typeof i.body=="string")return e.icons[t]={...i},!0}catch{}return!1}function rl(e,t){let i=[];return(typeof e=="string"?[e]:Object.keys(li)).forEach(n=>{(typeof n=="string"&&typeof t=="string"?[t]:Object.keys(li[n]||{})).forEach(s=>{const o=vt(n,s);i=i.concat(Object.keys(o.icons).map(r=>(n!==""?"@"+n+":":"")+s+":"+r))})}),i}let Ce=!1;function ao(e){return typeof e=="boolean"&&(Ce=e),Ce}function Ee(e){const t=typeof e=="string"?Re(e,!0,Ce):e;if(t){const i=vt(t.provider,t.prefix),n=t.name;return i.icons[n]||(i.missing.has(n)?null:void 0)}}function lo(e,t){const i=Re(e,!0,Ce);if(!i)return!1;const n=vt(i.provider,i.prefix);return ol(n,i.name,t)}function Vn(e,t){if(typeof e!="object")return!1;if(typeof t!="string"&&(t=e.provider||""),Ce&&!t&&!e.prefix){let s=!1;return ro(e)&&(e.prefix="",oo(e,(o,r)=>{r&&lo(o,r)&&(s=!0)})),s}const i=e.prefix;if(!Ze({provider:t,prefix:i,name:"a"}))return!1;const n=vt(t,i);return!!cn(n,e)}function Wn(e){return!!Ee(e)}function al(e){const t=Ee(e);return t?{...ze,...t}:null}function ll(e){const t={loaded:[],missing:[],pending:[]},i=Object.create(null);e.sort((s,o)=>s.provider!==o.provider?s.provider.localeCompare(o.provider):s.prefix!==o.prefix?s.prefix.localeCompare(o.prefix):s.name.localeCompare(o.name));let n={provider:"",prefix:"",name:""};return e.forEach(s=>{if(n.name===s.name&&n.prefix===s.prefix&&n.provider===s.provider)return;n=s;const o=s.provider,r=s.prefix,a=s.name,l=i[o]||(i[o]=Object.create(null)),u=l[r]||(l[r]=vt(o,r));let h;a in u.icons?h=t.loaded:r===""||u.missing.has(a)?h=t.missing:h=t.pending;const c={provider:o,prefix:r,name:a};h.push(c)}),t}function co(e,t){e.forEach(i=>{const n=i.loaderCallbacks;n&&(i.loaderCallbacks=n.filter(s=>s.id!==t))})}function cl(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,s=e.prefix;t.forEach(o=>{const r=o.icons,a=r.pending.length;r.pending=r.pending.filter(l=>{if(l.prefix!==s)return!0;const u=l.name;if(e.icons[u])r.loaded.push({provider:n,prefix:s,name:u});else if(e.missing.has(u))r.missing.push({provider:n,prefix:s,name:u});else return i=!0,!0;return!1}),r.pending.length!==a&&(i||co([e],o.id),o.callback(r.loaded.slice(0),r.missing.slice(0),r.pending.slice(0),o.abort))})}))}let ul=0;function hl(e,t,i){const n=ul++,s=co.bind(null,i,n);if(!t.pending.length)return s;const o={id:n,icons:t,callback:e,abort:s};return i.forEach(r=>{(r.loaderCallbacks||(r.loaderCallbacks=[])).push(o)}),s}const Di=Object.create(null);function qn(e,t){Di[e]=t}function Fi(e){return Di[e]||Di[""]}function dl(e,t=!0,i=!1){const n=[];return e.forEach(s=>{const o=typeof s=="string"?Re(s,t,i):s;o&&n.push(o)}),n}var pl={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function ml(e,t,i,n){const s=e.resources.length,o=e.random?Math.floor(Math.random()*s):e.index;let r;if(e.random){let $=e.resources.slice(0);for(r=[];$.length>1;){const E=Math.floor(Math.random()*$.length);r.push($[E]),$=$.slice(0,E).concat($.slice(E+1))}r=r.concat($)}else r=e.resources.slice(o).concat(e.resources.slice(0,o));const a=Date.now();let l="pending",u=0,h,c=null,d=[],p=[];typeof n=="function"&&p.push(n);function y(){c&&(clearTimeout(c),c=null)}function x(){l==="pending"&&(l="aborted"),y(),d.forEach($=>{$.status==="pending"&&($.status="aborted")}),d=[]}function b($,E){E&&(p=[]),typeof $=="function"&&p.push($)}function f(){return{startTime:a,payload:t,status:l,queriesSent:u,queriesPending:d.length,subscribe:b,abort:x}}function g(){l="failed",p.forEach($=>{$(void 0,h)})}function v(){d.forEach($=>{$.status==="pending"&&($.status="aborted")}),d=[]}function w($,E,H){const R=E!=="success";switch(d=d.filter(k=>k!==$),l){case"pending":break;case"failed":if(R||!e.dataAfterTimeout)return;break;default:return}if(E==="abort"){h=H,g();return}if(R){h=H,d.length||(r.length?C():g());return}if(y(),v(),!e.random){const k=e.resources.indexOf($.resource);k!==-1&&k!==e.index&&(e.index=k)}l="completed",p.forEach(k=>{k(H)})}function C(){if(l!=="pending")return;y();const $=r.shift();if($===void 0){if(d.length){c=setTimeout(()=>{y(),l==="pending"&&(v(),g())},e.timeout);return}g();return}const E={status:"pending",resource:$,callback:(H,R)=>{w(E,H,R)}};d.push(E),u++,c=setTimeout(C,e.rotate),i($,t,E.callback)}return setTimeout(C),f}function uo(e){const t={...pl,...e};let i=[];function n(){i=i.filter(r=>r().status==="pending")}function s(r,a,l){const u=ml(t,r,a,(h,c)=>{n(),l&&l(h,c)});return i.push(u),u}function o(r){return i.find(a=>r(a))||null}return{query:s,find:o,setIndex:r=>{t.index=r},getIndex:()=>t.index,cleanup:n}}function un(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 yi=Object.create(null),Ye=["https://api.simplesvg.com","https://api.unisvg.com"],Bi=[];for(;Ye.length>0;)Ye.length===1||Math.random()>.5?Bi.push(Ye.shift()):Bi.push(Ye.pop());yi[""]=un({resources:["https://api.iconify.design"].concat(Bi)});function Gn(e,t){const i=un(t);return i===null?!1:(yi[e]=i,!0)}function _i(e){return yi[e]}function fl(){return Object.keys(yi)}function Yn(){}const Mi=Object.create(null);function bl(e){if(!Mi[e]){const t=_i(e);if(!t)return;const i=uo(t),n={config:t,redundancy:i};Mi[e]=n}return Mi[e]}function ho(e,t,i){let n,s;if(typeof e=="string"){const o=Fi(e);if(!o)return i(void 0,424),Yn;s=o.send;const r=bl(e);r&&(n=r.redundancy)}else{const o=un(e);if(o){n=uo(o);const r=e.resources?e.resources[0]:"",a=Fi(r);a&&(s=a.send)}}return!n||!s?(i(void 0,424),Yn):n.query(t,s,i)().abort}const Xn="iconify2",Ae="iconify",po=Ae+"-count",Jn=Ae+"-version",mo=36e5,gl=168,vl=50;function Ui(e,t){try{return e.getItem(t)}catch{}}function hn(e,t,i){try{return e.setItem(t,i),!0}catch{}}function Qn(e,t){try{e.removeItem(t)}catch{}}function Vi(e,t){return hn(e,po,t.toString())}function Wi(e){return parseInt(Ui(e,po))||0}const Tt={local:!0,session:!0},fo={local:new Set,session:new Set};let dn=!1;function yl(e){dn=e}let Xe=typeof window>"u"?{}:window;function bo(e){const t=e+"Storage";try{if(Xe&&Xe[t]&&typeof Xe[t].length=="number")return Xe[t]}catch{}Tt[e]=!1}function go(e,t){const i=bo(e);if(!i)return;const n=Ui(i,Jn);if(n!==Xn){if(n){const a=Wi(i);for(let l=0;l{const l=Ae+a.toString(),u=Ui(i,l);if(typeof u=="string"){try{const h=JSON.parse(u);if(typeof h=="object"&&typeof h.cached=="number"&&h.cached>s&&typeof h.provider=="string"&&typeof h.data=="object"&&typeof h.data.prefix=="string"&&t(h,a))return!0}catch{}Qn(i,l)}};let r=Wi(i);for(let a=r-1;a>=0;a--)o(a)||(a===r-1?(r--,Vi(i,r)):fo[e].add(a))}function vo(){if(!dn){yl(!0);for(const e in Tt)go(e,t=>{const i=t.data,n=t.provider,s=i.prefix,o=vt(n,s);if(!cn(o,i).length)return!1;const r=i.lastModified||-1;return o.lastModifiedCached=o.lastModifiedCached?Math.min(o.lastModifiedCached,r):r,!0})}}function _l(e,t){const i=e.lastModifiedCached;if(i&&i>=t)return i===t;if(e.lastModifiedCached=t,i)for(const n in Tt)go(n,s=>{const o=s.data;return s.provider!==e.provider||o.prefix!==e.prefix||o.lastModified===t});return!0}function xl(e,t){dn||vo();function i(n){let s;if(!Tt[n]||!(s=bo(n)))return;const o=fo[n];let r;if(o.size)o.delete(r=Array.from(o).shift());else if(r=Wi(s),r>=vl||!Vi(s,r+1))return;const a={cached:Math.floor(Date.now()/mo),provider:e.provider,data:t};return hn(s,Ae+r.toString(),JSON.stringify(a))}t.lastModified&&!_l(e,t.lastModified)||Object.keys(t.icons).length&&(t.not_found&&(t=Object.assign({},t),delete t.not_found),i("local")||i("session"))}function Zn(){}function wl(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,cl(e)}))}function $l(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,s=e.iconsToLoad;delete e.iconsToLoad;let o;!s||!(o=Fi(i))||o.prepare(i,n,s).forEach(r=>{ho(i,r,a=>{if(typeof a!="object")r.icons.forEach(l=>{e.missing.add(l)});else try{const l=cn(e,a);if(!l.length)return;const u=e.pendingIcons;u&&l.forEach(h=>{u.delete(h)}),xl(e,a)}catch(l){console.error(l)}wl(e)})})}))}const pn=(e,t)=>{const i=dl(e,!0,ao()),n=ll(i);if(!n.pending.length){let l=!0;return t&&setTimeout(()=>{l&&t(n.loaded,n.missing,n.pending,Zn)}),()=>{l=!1}}const s=Object.create(null),o=[];let r,a;return n.pending.forEach(l=>{const{provider:u,prefix:h}=l;if(h===a&&u===r)return;r=u,a=h,o.push(vt(u,h));const c=s[u]||(s[u]=Object.create(null));c[h]||(c[h]=[])}),n.pending.forEach(l=>{const{provider:u,prefix:h,name:c}=l,d=vt(u,h),p=d.pendingIcons||(d.pendingIcons=new Set);p.has(c)||(p.add(c),s[u][h].push(c))}),o.forEach(l=>{const{provider:u,prefix:h}=l;s[u][h].length&&$l(l,s[u][h])}),t?hl(t,n,o):Zn},Cl=e=>new Promise((t,i)=>{const n=typeof e=="string"?Re(e,!0):e;if(!n){i(e);return}pn([n||e],s=>{if(s.length&&n){const o=Ee(n);if(o){t({...ze,...o});return}}i(e)})});function El(e){try{const t=typeof e=="string"?JSON.parse(e):e;if(typeof t.body=="string")return{...t}}catch{}}function Al(e,t){const i=typeof e=="string"?Re(e,!0,!0):null;if(!i){const o=El(e);return{value:e,data:o}}const n=Ee(i);if(n!==void 0||!i.prefix)return{value:e,name:i,data:n};const s=pn([i],()=>t(e,i,Ee(i)));return{value:e,name:i,loading:s}}function Ii(e){return e.hasAttribute("inline")}let yo=!1;try{yo=navigator.vendor.indexOf("Apple")===0}catch{}function Sl(e,t){switch(t){case"svg":case"bg":case"mask":return t}return t!=="style"&&(yo||e.indexOf("=0;){const s=e.indexOf(">",n),o=e.indexOf("",o);if(r===-1)break;i+=e.slice(s+1,o).trim(),e=e.slice(0,n).trim()+e.slice(r+1)}return{defs:i,content:e}}function Nl(e,t){return e?""+e+""+t:t}function Pl(e,t,i){const n=Tl(e);return Nl(n.defs,t+n.content+i)}const Ml=e=>e==="unset"||e==="undefined"||e==="none";function _o(e,t){const i={...ze,...e},n={...no,...t},s={left:i.left,top:i.top,width:i.width,height:i.height};let o=i.body;[i,n].forEach(x=>{const b=[],f=x.hFlip,g=x.vFlip;let v=x.rotate;f?g?v+=2:(b.push("translate("+(s.width+s.left).toString()+" "+(0-s.top).toString()+")"),b.push("scale(-1 1)"),s.top=s.left=0):g&&(b.push("translate("+(0-s.left).toString()+" "+(s.height+s.top).toString()+")"),b.push("scale(1 -1)"),s.top=s.left=0);let w;switch(v<0&&(v-=Math.floor(v/4)*4),v=v%4,v){case 1:w=s.height/2+s.top,b.unshift("rotate(90 "+w.toString()+" "+w.toString()+")");break;case 2:b.unshift("rotate(180 "+(s.width/2+s.left).toString()+" "+(s.height/2+s.top).toString()+")");break;case 3:w=s.width/2+s.left,b.unshift("rotate(-90 "+w.toString()+" "+w.toString()+")");break}v%2===1&&(s.left!==s.top&&(w=s.left,s.left=s.top,s.top=w),s.width!==s.height&&(w=s.width,s.width=s.height,s.height=w)),b.length&&(o=Pl(o,'',""))});const r=n.width,a=n.height,l=s.width,u=s.height;let h,c;r===null?(c=a===null?"1em":a==="auto"?u:a,h=qi(c,l/u)):(h=r==="auto"?l:r,c=a===null?qi(h,u/l):a==="auto"?u:a);const d={},p=(x,b)=>{Ml(b)||(d[x]=b.toString())};p("width",h),p("height",c);const y=[s.left,s.top,l,u];return d.viewBox=y.join(" "),{attributes:d,viewBox:y,body:o}}function mn(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 Il(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(//g,"%3E").replace(/\s+/g," ")}function Ll(e){return"data:image/svg+xml,"+Il(e)}function xo(e){return'url("'+Ll(e)+'")'}const zl=()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}};let ci=zl();function Rl(e){ci=e}function jl(){return ci}function Hl(e,t){const i=_i(e);if(!i)return 0;let n;if(!i.maxURL)n=0;else{let s=0;i.resources.forEach(r=>{s=Math.max(s,r.length)});const o=t+".json?icons=";n=i.maxURL-s-i.path.length-o.length}return n}function Dl(e){return e===404}const Fl=(e,t,i)=>{const n=[],s=Hl(e,t),o="icons";let r={type:o,provider:e,prefix:t,icons:[]},a=0;return i.forEach((l,u)=>{a+=l.length+1,a>=s&&u>0&&(n.push(r),r={type:o,provider:e,prefix:t,icons:[]},a=l.length),r.icons.push(l)}),n.push(r),n};function Bl(e){if(typeof e=="string"){const t=_i(e);if(t)return t.path}return"/"}const Ul=(e,t,i)=>{if(!ci){i("abort",424);return}let n=Bl(t.provider);switch(t.type){case"icons":{const o=t.prefix,r=t.icons.join(","),a=new URLSearchParams({icons:r});n+=o+".json?"+a.toString();break}case"custom":{const o=t.uri;n+=o.slice(0,1)==="/"?o.slice(1):o;break}default:i("abort",400);return}let s=503;ci(e+n).then(o=>{const r=o.status;if(r!==200){setTimeout(()=>{i(Dl(r)?"abort":"next",r)});return}return s=501,o.json()}).then(o=>{if(typeof o!="object"||o===null){setTimeout(()=>{o===404?i("abort",o):i("next",s)});return}setTimeout(()=>{i("success",o)})}).catch(()=>{i("next",s)})},Vl={prepare:Fl,send:Ul};function Kn(e,t){switch(e){case"local":case"session":Tt[e]=t;break;case"all":for(const i in Tt)Tt[i]=t;break}}const Li="data-style";let wo="";function Wl(e){wo=e}function ts(e,t){let i=Array.from(e.childNodes).find(n=>n.hasAttribute&&n.hasAttribute(Li));i||(i=document.createElement("style"),i.setAttribute(Li,Li),e.appendChild(i)),i.textContent=":host{display:inline-block;vertical-align:"+(t?"-0.125em":"0")+"}span,svg{display:block}"+wo}function $o(){qn("",Vl),ao(!0);let e;try{e=window}catch{}if(e){if(vo(),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"||!Vn(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 s=t[i];if(typeof s!="object"||!s||s.resources===void 0)continue;Gn(i,s)||console.error(n)}catch{console.error(n)}}}}return{enableCache:t=>Kn(t,!0),disableCache:t=>Kn(t,!1),iconLoaded:Wn,iconExists:Wn,getIcon:al,listIcons:rl,addIcon:lo,addCollection:Vn,calculateSize:qi,buildIcon:_o,iconToHTML:mn,svgToURL:xo,loadIcons:pn,loadIcon:Cl,addAPIProvider:Gn,appendCustomStyle:Wl,_api:{getAPIConfig:_i,setAPIModule:qn,sendAPIQuery:ho,setFetch:Rl,getFetch:jl,listAPIProviders:fl}}}const Gi={"background-color":"currentColor"},Co={"background-color":"transparent"},es={image:"var(--svg)",repeat:"no-repeat",size:"100% 100%"},is={"-webkit-mask":Gi,mask:Gi,background:Co};for(const e in is){const t=is[e];for(const i in es)t[e+"-"+i]=es[i]}function ns(e){return e?e+(e.match(/^[-0-9.]+$/)?"px":""):"inherit"}function ql(e,t,i){const n=document.createElement("span");let s=e.body;s.indexOf("");const o=e.attributes,r=mn(s,{...o,width:t.width+"",height:t.height+""}),a=xo(r),l=n.style,u={"--svg":a,width:ns(o.width),height:ns(o.height),...i?Gi:Co};for(const h in u)l.setProperty(h,u[h]);return n}let ve;function Gl(){try{ve=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch{ve=null}}function Yl(e){return ve===void 0&&Gl(),ve?ve.createHTML(e):e}function Xl(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 s=mn(e.body,i);return t.innerHTML=Yl(s),t.firstChild}function Yi(e){return Array.from(e.childNodes).find(t=>{const i=t.tagName&&t.tagName.toUpperCase();return i==="SPAN"||i==="SVG"})}function ss(e,t){const i=t.icon.data,n=t.customisations,s=_o(i,n);n.preserveAspectRatio&&(s.attributes.preserveAspectRatio=n.preserveAspectRatio);const o=t.renderedMode;let r;switch(o){case"svg":r=Xl(s);break;default:r=ql(s,{...ze,...i},o==="mask")}const a=Yi(e);a?r.tagName==="SPAN"&&a.tagName===r.tagName?a.setAttribute("style",r.getAttribute("style")):e.replaceChild(r,a):e.appendChild(r)}function os(e,t,i){const n=i&&(i.rendered?i:i.lastRender);return{rendered:!1,inline:t,icon:e,lastRender:n}}function Jl(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 s=["icon","mode","inline","observe","width","height","rotate","flip"],o=class extends i{constructor(){super(),Et(this,"_shadowRoot"),Et(this,"_initialised",!1),Et(this,"_state"),Et(this,"_checkQueued",!1),Et(this,"_connected",!1),Et(this,"_observer",null),Et(this,"_visible",!0);const a=this._shadowRoot=this.attachShadow({mode:"open"}),l=Ii(this);ts(a,l),this._state=os({value:""},l),this._queueCheck()}connectedCallback(){this._connected=!0,this.startObserver()}disconnectedCallback(){this._connected=!1,this.stopObserver()}static get observedAttributes(){return s.slice(0)}attributeChangedCallback(a){switch(a){case"inline":{const l=Ii(this),u=this._state;l!==u.inline&&(u.inline=l,ts(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 Ii(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{}ss(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 u=this.getAttribute("mode"),h=Bn(this);(a.attrMode!==u||Ka(a.customisations,h)||!Yi(this._shadowRoot))&&this._renderIcon(a.icon,h,u)}_iconChanged(a){const l=Al(a,(u,h,c)=>{const d=this._state;if(d.rendered||this.getAttribute("icon")!==u)return;const p={value:u,name:h,data:c};p.data?this._gotIconData(p):d.icon=p});l.data?this._gotIconData(l):this._state=os(l,this._state.inline,this._state)}_forceRender(){if(!this._visible){const a=Yi(this._shadowRoot);a&&this._shadowRoot.removeChild(a);return}this._queueCheck()}_gotIconData(a){this._checkQueued=!1,this._renderIcon(a,Bn(this),this.getAttribute("mode"))}_renderIcon(a,l,u){const h=Sl(a.data.body,u),c=this._state.inline;ss(this._shadowRoot,this._state={rendered:!0,icon:a,inline:c,customisations:l,attrMode:u,renderedMode:h})}startObserver(){if(!this._observer)try{this._observer=new IntersectionObserver(a=>{const l=a.some(u=>u.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())}};s.forEach(a=>{a in o.prototype||Object.defineProperty(o.prototype,a,{get:function(){return this.getAttribute(a)},set:function(l){l!==null?this.setAttribute(a,l):this.removeAttribute(a)}})});const r=$o();for(const a in r)o[a]=o.prototype[a]=r[a];return t.define(e,o),o}Jl()||$o();var Ql=Object.defineProperty,K=(e,t,i,n)=>{for(var s=void 0,o=e.length-1,r;o>=0;o--)(r=e[o])&&(s=r(t,i,s)||s);return s&&Ql(t,i,s),s},Je;const Y=(Je=class extends S{constructor(){super(),this.labelHidden=!1,this.active=!1,this.disabled=!1,this.vertical=!1,this.tooltipVisible=!1,this._parent=ft(),this._tooltip=ft(),this._contextMenu=ft(),this._mouseLeave=!1,this.onWindowMouseUp=e=>{const{value:t}=this._contextMenu;!this.contains(e.target)&&t&&(t.visible=!1)},this.mouseLeave=!0,this.addEventListener("click",e=>e.stopPropagation())}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&&Ys(e,t,{placement:"bottom",middleware:[Ls(10),Gs(),qs(),Ws({padding:5})]}).then(i=>{const{x:n,y:s}=i;Object.assign(t.style,{left:`${n}px`,top:`${s}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)}onChildrenClick(e){e.stopPropagation();const{value:t}=this._contextMenu;t&&(t.visible=!t.visible)}onSlotChange(e){const{value:t}=this._contextMenu,i=e.target.assignedElements();for(const n of i){if(!(n instanceof Je)){n.remove(),console.warn("Only bim-button is allowed inside bim-button. Child has been removed.");continue}n.addEventListener("click",()=>t==null?void 0:t.updatePosition())}this.requestUpdate()}connectedCallback(){super.connectedCallback(),window.addEventListener("mouseup",this.onWindowMouseUp)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("mouseup",this.onWindowMouseUp)}render(){const e=_` -
- ${this.tooltipTitle?_`

+*/const io=Object.freeze({left:0,top:0,width:16,height:16}),ui=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),Re=Object.freeze({...io,...ui}),Fi=Object.freeze({...Re,body:"",hidden:!1}),Xa=Object.freeze({width:null,height:null}),no=Object.freeze({...Xa,...ui});function Ja(e,t=0){const i=e.replace(/^-?[0-9.]*/,"");function n(s){for(;s<0;)s+=4;return s%4}if(i===""){const s=parseInt(e);return isNaN(s)?0:n(s)}else if(i!==e){let s=0;switch(i){case"%":s=25;break;case"deg":s=90}if(s){let o=parseFloat(e.slice(0,e.length-i.length));return isNaN(o)?0:(o=o/s,o%1===0?n(o):0)}}return t}const Qa=/[\s,]+/;function Za(e,t){t.split(Qa).forEach(i=>{switch(i.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0;break}})}const so={...no,preserveAspectRatio:""};function Un(e){const t={...so},i=(n,s)=>e.getAttribute(n)||s;return t.width=i("width",null),t.height=i("height",null),t.rotate=Ja(i("rotate","")),Za(t,i("flip","")),t.preserveAspectRatio=i("preserveAspectRatio",i("preserveaspectratio","")),t}function Ka(e,t){for(const i in so)if(e[i]!==t[i])return!0;return!1}const ve=/^[a-z0-9]+(-[a-z0-9]+)*$/,je=(e,t,i,n="")=>{const s=e.split(":");if(e.slice(0,1)==="@"){if(s.length<2||s.length>3)return null;n=s.shift().slice(1)}if(s.length>3||!s.length)return null;if(s.length>1){const a=s.pop(),l=s.pop(),u={provider:s.length>0?s[0]:n,prefix:l,name:a};return t&&!ti(u)?null:u}const o=s[0],r=o.split("-");if(r.length>1){const a={provider:n,prefix:r.shift(),name:r.join("-")};return t&&!ti(a)?null:a}if(i&&n===""){const a={provider:n,prefix:"",name:o};return t&&!ti(a,i)?null:a}return null},ti=(e,t)=>e?!!((e.provider===""||e.provider.match(ve))&&(t&&e.prefix===""||e.prefix.match(ve))&&e.name.match(ve)):!1;function tl(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 Vn(e,t){const i=tl(e,t);for(const n in Fi)n in ui?n in e&&!(n in i)&&(i[n]=ui[n]):n in t?i[n]=t[n]:n in e&&(i[n]=e[n]);return i}function el(e,t){const i=e.icons,n=e.aliases||Object.create(null),s=Object.create(null);function o(r){if(i[r])return s[r]=[];if(!(r in s)){s[r]=null;const a=n[r]&&n[r].parent,l=a&&o(a);l&&(s[r]=[a].concat(l))}return s[r]}return Object.keys(i).concat(Object.keys(n)).forEach(o),s}function il(e,t,i){const n=e.icons,s=e.aliases||Object.create(null);let o={};function r(a){o=Vn(n[a]||s[a],o)}return r(t),i.forEach(r),Vn(e,o)}function oo(e,t){const i=[];if(typeof e!="object"||typeof e.icons!="object")return i;e.not_found instanceof Array&&e.not_found.forEach(s=>{t(s,null),i.push(s)});const n=el(e);for(const s in n){const o=n[s];o&&(t(s,il(e,s,o)),i.push(s))}return i}const nl={provider:"",aliases:{},not_found:{},...io};function Li(e,t){for(const i in t)if(i in e&&typeof e[i]!=typeof t[i])return!1;return!0}function ro(e){if(typeof e!="object"||e===null)return null;const t=e;if(typeof t.prefix!="string"||!e.icons||typeof e.icons!="object"||!Li(e,nl))return null;const i=t.icons;for(const s in i){const o=i[s];if(!s.match(ve)||typeof o.body!="string"||!Li(o,Fi))return null}const n=t.aliases||Object.create(null);for(const s in n){const o=n[s],r=o.parent;if(!s.match(ve)||typeof r!="string"||!i[r]&&!n[r]||!Li(o,Fi))return null}return t}const hi=Object.create(null);function sl(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function gt(e,t){const i=hi[e]||(hi[e]=Object.create(null));return i[t]||(i[t]=sl(e,t))}function hn(e,t){return ro(t)?oo(t,(i,n)=>{n?e.icons[i]=n:e.missing.add(i)}):[]}function ol(e,t,i){try{if(typeof i.body=="string")return e.icons[t]={...i},!0}catch{}return!1}function rl(e,t){let i=[];return(typeof e=="string"?[e]:Object.keys(hi)).forEach(n=>{(typeof n=="string"&&typeof t=="string"?[t]:Object.keys(hi[n]||{})).forEach(s=>{const o=gt(n,s);i=i.concat(Object.keys(o.icons).map(r=>(n!==""?"@"+n+":":"")+s+":"+r))})}),i}let Ee=!1;function ao(e){return typeof e=="boolean"&&(Ee=e),Ee}function Ae(e){const t=typeof e=="string"?je(e,!0,Ee):e;if(t){const i=gt(t.provider,t.prefix),n=t.name;return i.icons[n]||(i.missing.has(n)?null:void 0)}}function lo(e,t){const i=je(e,!0,Ee);if(!i)return!1;const n=gt(i.provider,i.prefix);return ol(n,i.name,t)}function Wn(e,t){if(typeof e!="object")return!1;if(typeof t!="string"&&(t=e.provider||""),Ee&&!t&&!e.prefix){let s=!1;return ro(e)&&(e.prefix="",oo(e,(o,r)=>{r&&lo(o,r)&&(s=!0)})),s}const i=e.prefix;if(!ti({provider:t,prefix:i,name:"a"}))return!1;const n=gt(t,i);return!!hn(n,e)}function qn(e){return!!Ae(e)}function al(e){const t=Ae(e);return t?{...Re,...t}:null}function ll(e){const t={loaded:[],missing:[],pending:[]},i=Object.create(null);e.sort((s,o)=>s.provider!==o.provider?s.provider.localeCompare(o.provider):s.prefix!==o.prefix?s.prefix.localeCompare(o.prefix):s.name.localeCompare(o.name));let n={provider:"",prefix:"",name:""};return e.forEach(s=>{if(n.name===s.name&&n.prefix===s.prefix&&n.provider===s.provider)return;n=s;const o=s.provider,r=s.prefix,a=s.name,l=i[o]||(i[o]=Object.create(null)),u=l[r]||(l[r]=gt(o,r));let d;a in u.icons?d=t.loaded:r===""||u.missing.has(a)?d=t.missing:d=t.pending;const c={provider:o,prefix:r,name:a};d.push(c)}),t}function co(e,t){e.forEach(i=>{const n=i.loaderCallbacks;n&&(i.loaderCallbacks=n.filter(s=>s.id!==t))})}function cl(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,s=e.prefix;t.forEach(o=>{const r=o.icons,a=r.pending.length;r.pending=r.pending.filter(l=>{if(l.prefix!==s)return!0;const u=l.name;if(e.icons[u])r.loaded.push({provider:n,prefix:s,name:u});else if(e.missing.has(u))r.missing.push({provider:n,prefix:s,name:u});else return i=!0,!0;return!1}),r.pending.length!==a&&(i||co([e],o.id),o.callback(r.loaded.slice(0),r.missing.slice(0),r.pending.slice(0),o.abort))})}))}let ul=0;function hl(e,t,i){const n=ul++,s=co.bind(null,i,n);if(!t.pending.length)return s;const o={id:n,icons:t,callback:e,abort:s};return i.forEach(r=>{(r.loaderCallbacks||(r.loaderCallbacks=[])).push(o)}),s}const Ui=Object.create(null);function Gn(e,t){Ui[e]=t}function Vi(e){return Ui[e]||Ui[""]}function dl(e,t=!0,i=!1){const n=[];return e.forEach(s=>{const o=typeof s=="string"?je(s,t,i):s;o&&n.push(o)}),n}var pl={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function fl(e,t,i,n){const s=e.resources.length,o=e.random?Math.floor(Math.random()*s):e.index;let r;if(e.random){let C=e.resources.slice(0);for(r=[];C.length>1;){const $=Math.floor(Math.random()*C.length);r.push(C[$]),C=C.slice(0,$).concat(C.slice($+1))}r=r.concat(C)}else r=e.resources.slice(o).concat(e.resources.slice(0,o));const a=Date.now();let l="pending",u=0,d,c=null,h=[],p=[];typeof n=="function"&&p.push(n);function v(){c&&(clearTimeout(c),c=null)}function _(){l==="pending"&&(l="aborted"),v(),h.forEach(C=>{C.status==="pending"&&(C.status="aborted")}),h=[]}function b(C,$){$&&(p=[]),typeof C=="function"&&p.push(C)}function m(){return{startTime:a,payload:t,status:l,queriesSent:u,queriesPending:h.length,subscribe:b,abort:_}}function g(){l="failed",p.forEach(C=>{C(void 0,d)})}function y(){h.forEach(C=>{C.status==="pending"&&(C.status="aborted")}),h=[]}function w(C,$,P){const T=$!=="success";switch(h=h.filter(S=>S!==C),l){case"pending":break;case"failed":if(T||!e.dataAfterTimeout)return;break;default:return}if($==="abort"){d=P,g();return}if(T){d=P,h.length||(r.length?E():g());return}if(v(),y(),!e.random){const S=e.resources.indexOf(C.resource);S!==-1&&S!==e.index&&(e.index=S)}l="completed",p.forEach(S=>{S(P)})}function E(){if(l!=="pending")return;v();const C=r.shift();if(C===void 0){if(h.length){c=setTimeout(()=>{v(),l==="pending"&&(y(),g())},e.timeout);return}g();return}const $={status:"pending",resource:C,callback:(P,T)=>{w($,P,T)}};h.push($),u++,c=setTimeout(E,e.rotate),i(C,t,$.callback)}return setTimeout(E),m}function uo(e){const t={...pl,...e};let i=[];function n(){i=i.filter(r=>r().status==="pending")}function s(r,a,l){const u=fl(t,r,a,(d,c)=>{n(),l&&l(d,c)});return i.push(u),u}function o(r){return i.find(a=>r(a))||null}return{query:s,find:o,setIndex:r=>{t.index=r},getIndex:()=>t.index,cleanup:n}}function dn(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 wi=Object.create(null),Je=["https://api.simplesvg.com","https://api.unisvg.com"],Wi=[];for(;Je.length>0;)Je.length===1||Math.random()>.5?Wi.push(Je.shift()):Wi.push(Je.pop());wi[""]=dn({resources:["https://api.iconify.design"].concat(Wi)});function Yn(e,t){const i=dn(t);return i===null?!1:(wi[e]=i,!0)}function $i(e){return wi[e]}function ml(){return Object.keys(wi)}function Xn(){}const zi=Object.create(null);function bl(e){if(!zi[e]){const t=$i(e);if(!t)return;const i=uo(t),n={config:t,redundancy:i};zi[e]=n}return zi[e]}function ho(e,t,i){let n,s;if(typeof e=="string"){const o=Vi(e);if(!o)return i(void 0,424),Xn;s=o.send;const r=bl(e);r&&(n=r.redundancy)}else{const o=dn(e);if(o){n=uo(o);const r=e.resources?e.resources[0]:"",a=Vi(r);a&&(s=a.send)}}return!n||!s?(i(void 0,424),Xn):n.query(t,s,i)().abort}const Jn="iconify2",Se="iconify",po=Se+"-count",Qn=Se+"-version",fo=36e5,gl=168,vl=50;function qi(e,t){try{return e.getItem(t)}catch{}}function pn(e,t,i){try{return e.setItem(t,i),!0}catch{}}function Zn(e,t){try{e.removeItem(t)}catch{}}function Gi(e,t){return pn(e,po,t.toString())}function Yi(e){return parseInt(qi(e,po))||0}const Ot={local:!0,session:!0},mo={local:new Set,session:new Set};let fn=!1;function yl(e){fn=e}let Qe=typeof window>"u"?{}:window;function bo(e){const t=e+"Storage";try{if(Qe&&Qe[t]&&typeof Qe[t].length=="number")return Qe[t]}catch{}Ot[e]=!1}function go(e,t){const i=bo(e);if(!i)return;const n=qi(i,Qn);if(n!==Jn){if(n){const a=Yi(i);for(let l=0;l{const l=Se+a.toString(),u=qi(i,l);if(typeof u=="string"){try{const d=JSON.parse(u);if(typeof d=="object"&&typeof d.cached=="number"&&d.cached>s&&typeof d.provider=="string"&&typeof d.data=="object"&&typeof d.data.prefix=="string"&&t(d,a))return!0}catch{}Zn(i,l)}};let r=Yi(i);for(let a=r-1;a>=0;a--)o(a)||(a===r-1?(r--,Gi(i,r)):mo[e].add(a))}function vo(){if(!fn){yl(!0);for(const e in Ot)go(e,t=>{const i=t.data,n=t.provider,s=i.prefix,o=gt(n,s);if(!hn(o,i).length)return!1;const r=i.lastModified||-1;return o.lastModifiedCached=o.lastModifiedCached?Math.min(o.lastModifiedCached,r):r,!0})}}function _l(e,t){const i=e.lastModifiedCached;if(i&&i>=t)return i===t;if(e.lastModifiedCached=t,i)for(const n in Ot)go(n,s=>{const o=s.data;return s.provider!==e.provider||o.prefix!==e.prefix||o.lastModified===t});return!0}function xl(e,t){fn||vo();function i(n){let s;if(!Ot[n]||!(s=bo(n)))return;const o=mo[n];let r;if(o.size)o.delete(r=Array.from(o).shift());else if(r=Yi(s),r>=vl||!Gi(s,r+1))return;const a={cached:Math.floor(Date.now()/fo),provider:e.provider,data:t};return pn(s,Se+r.toString(),JSON.stringify(a))}t.lastModified&&!_l(e,t.lastModified)||Object.keys(t.icons).length&&(t.not_found&&(t=Object.assign({},t),delete t.not_found),i("local")||i("session"))}function Kn(){}function wl(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,cl(e)}))}function $l(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,s=e.iconsToLoad;delete e.iconsToLoad;let o;!s||!(o=Vi(i))||o.prepare(i,n,s).forEach(r=>{ho(i,r,a=>{if(typeof a!="object")r.icons.forEach(l=>{e.missing.add(l)});else try{const l=hn(e,a);if(!l.length)return;const u=e.pendingIcons;u&&l.forEach(d=>{u.delete(d)}),xl(e,a)}catch(l){console.error(l)}wl(e)})})}))}const mn=(e,t)=>{const i=dl(e,!0,ao()),n=ll(i);if(!n.pending.length){let l=!0;return t&&setTimeout(()=>{l&&t(n.loaded,n.missing,n.pending,Kn)}),()=>{l=!1}}const s=Object.create(null),o=[];let r,a;return n.pending.forEach(l=>{const{provider:u,prefix:d}=l;if(d===a&&u===r)return;r=u,a=d,o.push(gt(u,d));const c=s[u]||(s[u]=Object.create(null));c[d]||(c[d]=[])}),n.pending.forEach(l=>{const{provider:u,prefix:d,name:c}=l,h=gt(u,d),p=h.pendingIcons||(h.pendingIcons=new Set);p.has(c)||(p.add(c),s[u][d].push(c))}),o.forEach(l=>{const{provider:u,prefix:d}=l;s[u][d].length&&$l(l,s[u][d])}),t?hl(t,n,o):Kn},Cl=e=>new Promise((t,i)=>{const n=typeof e=="string"?je(e,!0):e;if(!n){i(e);return}mn([n||e],s=>{if(s.length&&n){const o=Ae(n);if(o){t({...Re,...o});return}}i(e)})});function El(e){try{const t=typeof e=="string"?JSON.parse(e):e;if(typeof t.body=="string")return{...t}}catch{}}function Al(e,t){const i=typeof e=="string"?je(e,!0,!0):null;if(!i){const o=El(e);return{value:e,data:o}}const n=Ae(i);if(n!==void 0||!i.prefix)return{value:e,name:i,data:n};const s=mn([i],()=>t(e,i,Ae(i)));return{value:e,name:i,loading:s}}function Ri(e){return e.hasAttribute("inline")}let yo=!1;try{yo=navigator.vendor.indexOf("Apple")===0}catch{}function Sl(e,t){switch(t){case"svg":case"bg":case"mask":return t}return t!=="style"&&(yo||e.indexOf("=0;){const s=e.indexOf(">",n),o=e.indexOf("",o);if(r===-1)break;i+=e.slice(s+1,o).trim(),e=e.slice(0,n).trim()+e.slice(r+1)}return{defs:i,content:e}}function Nl(e,t){return e?""+e+""+t:t}function Pl(e,t,i){const n=Tl(e);return Nl(n.defs,t+n.content+i)}const Ml=e=>e==="unset"||e==="undefined"||e==="none";function _o(e,t){const i={...Re,...e},n={...no,...t},s={left:i.left,top:i.top,width:i.width,height:i.height};let o=i.body;[i,n].forEach(_=>{const b=[],m=_.hFlip,g=_.vFlip;let y=_.rotate;m?g?y+=2:(b.push("translate("+(s.width+s.left).toString()+" "+(0-s.top).toString()+")"),b.push("scale(-1 1)"),s.top=s.left=0):g&&(b.push("translate("+(0-s.left).toString()+" "+(s.height+s.top).toString()+")"),b.push("scale(1 -1)"),s.top=s.left=0);let w;switch(y<0&&(y-=Math.floor(y/4)*4),y=y%4,y){case 1:w=s.height/2+s.top,b.unshift("rotate(90 "+w.toString()+" "+w.toString()+")");break;case 2:b.unshift("rotate(180 "+(s.width/2+s.left).toString()+" "+(s.height/2+s.top).toString()+")");break;case 3:w=s.width/2+s.left,b.unshift("rotate(-90 "+w.toString()+" "+w.toString()+")");break}y%2===1&&(s.left!==s.top&&(w=s.left,s.left=s.top,s.top=w),s.width!==s.height&&(w=s.width,s.width=s.height,s.height=w)),b.length&&(o=Pl(o,'',""))});const r=n.width,a=n.height,l=s.width,u=s.height;let d,c;r===null?(c=a===null?"1em":a==="auto"?u:a,d=Xi(c,l/u)):(d=r==="auto"?l:r,c=a===null?Xi(d,u/l):a==="auto"?u:a);const h={},p=(_,b)=>{Ml(b)||(h[_]=b.toString())};p("width",d),p("height",c);const v=[s.left,s.top,l,u];return h.viewBox=v.join(" "),{attributes:h,viewBox:v,body:o}}function bn(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 Il(e){return e.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(//g,"%3E").replace(/\s+/g," ")}function Ll(e){return"data:image/svg+xml,"+Il(e)}function xo(e){return'url("'+Ll(e)+'")'}const zl=()=>{let e;try{if(e=fetch,typeof e=="function")return e}catch{}};let di=zl();function Rl(e){di=e}function jl(){return di}function Hl(e,t){const i=$i(e);if(!i)return 0;let n;if(!i.maxURL)n=0;else{let s=0;i.resources.forEach(r=>{s=Math.max(s,r.length)});const o=t+".json?icons=";n=i.maxURL-s-i.path.length-o.length}return n}function Dl(e){return e===404}const Bl=(e,t,i)=>{const n=[],s=Hl(e,t),o="icons";let r={type:o,provider:e,prefix:t,icons:[]},a=0;return i.forEach((l,u)=>{a+=l.length+1,a>=s&&u>0&&(n.push(r),r={type:o,provider:e,prefix:t,icons:[]},a=l.length),r.icons.push(l)}),n.push(r),n};function Fl(e){if(typeof e=="string"){const t=$i(e);if(t)return t.path}return"/"}const Ul=(e,t,i)=>{if(!di){i("abort",424);return}let n=Fl(t.provider);switch(t.type){case"icons":{const o=t.prefix,r=t.icons.join(","),a=new URLSearchParams({icons:r});n+=o+".json?"+a.toString();break}case"custom":{const o=t.uri;n+=o.slice(0,1)==="/"?o.slice(1):o;break}default:i("abort",400);return}let s=503;di(e+n).then(o=>{const r=o.status;if(r!==200){setTimeout(()=>{i(Dl(r)?"abort":"next",r)});return}return s=501,o.json()}).then(o=>{if(typeof o!="object"||o===null){setTimeout(()=>{o===404?i("abort",o):i("next",s)});return}setTimeout(()=>{i("success",o)})}).catch(()=>{i("next",s)})},Vl={prepare:Bl,send:Ul};function ts(e,t){switch(e){case"local":case"session":Ot[e]=t;break;case"all":for(const i in Ot)Ot[i]=t;break}}const ji="data-style";let wo="";function Wl(e){wo=e}function es(e,t){let i=Array.from(e.childNodes).find(n=>n.hasAttribute&&n.hasAttribute(ji));i||(i=document.createElement("style"),i.setAttribute(ji,ji),e.appendChild(i)),i.textContent=":host{display:inline-block;vertical-align:"+(t?"-0.125em":"0")+"}span,svg{display:block}"+wo}function $o(){Gn("",Vl),ao(!0);let e;try{e=window}catch{}if(e){if(vo(),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"||!Wn(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 s=t[i];if(typeof s!="object"||!s||s.resources===void 0)continue;Yn(i,s)||console.error(n)}catch{console.error(n)}}}}return{enableCache:t=>ts(t,!0),disableCache:t=>ts(t,!1),iconLoaded:qn,iconExists:qn,getIcon:al,listIcons:rl,addIcon:lo,addCollection:Wn,calculateSize:Xi,buildIcon:_o,iconToHTML:bn,svgToURL:xo,loadIcons:mn,loadIcon:Cl,addAPIProvider:Yn,appendCustomStyle:Wl,_api:{getAPIConfig:$i,setAPIModule:Gn,sendAPIQuery:ho,setFetch:Rl,getFetch:jl,listAPIProviders:ml}}}const Ji={"background-color":"currentColor"},Co={"background-color":"transparent"},is={image:"var(--svg)",repeat:"no-repeat",size:"100% 100%"},ns={"-webkit-mask":Ji,mask:Ji,background:Co};for(const e in ns){const t=ns[e];for(const i in is)t[e+"-"+i]=is[i]}function ss(e){return e?e+(e.match(/^[-0-9.]+$/)?"px":""):"inherit"}function ql(e,t,i){const n=document.createElement("span");let s=e.body;s.indexOf("");const o=e.attributes,r=bn(s,{...o,width:t.width+"",height:t.height+""}),a=xo(r),l=n.style,u={"--svg":a,width:ss(o.width),height:ss(o.height),...i?Ji:Co};for(const d in u)l.setProperty(d,u[d]);return n}let ye;function Gl(){try{ye=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch{ye=null}}function Yl(e){return ye===void 0&&Gl(),ye?ye.createHTML(e):e}function Xl(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 s=bn(e.body,i);return t.innerHTML=Yl(s),t.firstChild}function Qi(e){return Array.from(e.childNodes).find(t=>{const i=t.tagName&&t.tagName.toUpperCase();return i==="SPAN"||i==="SVG"})}function os(e,t){const i=t.icon.data,n=t.customisations,s=_o(i,n);n.preserveAspectRatio&&(s.attributes.preserveAspectRatio=n.preserveAspectRatio);const o=t.renderedMode;let r;switch(o){case"svg":r=Xl(s);break;default:r=ql(s,{...Re,...i},o==="mask")}const a=Qi(e);a?r.tagName==="SPAN"&&a.tagName===r.tagName?a.setAttribute("style",r.getAttribute("style")):e.replaceChild(r,a):e.appendChild(r)}function rs(e,t,i){const n=i&&(i.rendered?i:i.lastRender);return{rendered:!1,inline:t,icon:e,lastRender:n}}function Jl(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 s=["icon","mode","inline","observe","width","height","rotate","flip"],o=class extends i{constructor(){super(),Ct(this,"_shadowRoot"),Ct(this,"_initialised",!1),Ct(this,"_state"),Ct(this,"_checkQueued",!1),Ct(this,"_connected",!1),Ct(this,"_observer",null),Ct(this,"_visible",!0);const a=this._shadowRoot=this.attachShadow({mode:"open"}),l=Ri(this);es(a,l),this._state=rs({value:""},l),this._queueCheck()}connectedCallback(){this._connected=!0,this.startObserver()}disconnectedCallback(){this._connected=!1,this.stopObserver()}static get observedAttributes(){return s.slice(0)}attributeChangedCallback(a){switch(a){case"inline":{const l=Ri(this),u=this._state;l!==u.inline&&(u.inline=l,es(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 Ri(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{}os(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 u=this.getAttribute("mode"),d=Un(this);(a.attrMode!==u||Ka(a.customisations,d)||!Qi(this._shadowRoot))&&this._renderIcon(a.icon,d,u)}_iconChanged(a){const l=Al(a,(u,d,c)=>{const h=this._state;if(h.rendered||this.getAttribute("icon")!==u)return;const p={value:u,name:d,data:c};p.data?this._gotIconData(p):h.icon=p});l.data?this._gotIconData(l):this._state=rs(l,this._state.inline,this._state)}_forceRender(){if(!this._visible){const a=Qi(this._shadowRoot);a&&this._shadowRoot.removeChild(a);return}this._queueCheck()}_gotIconData(a){this._checkQueued=!1,this._renderIcon(a,Un(this),this.getAttribute("mode"))}_renderIcon(a,l,u){const d=Sl(a.data.body,u),c=this._state.inline;os(this._shadowRoot,this._state={rendered:!0,icon:a,inline:c,customisations:l,attrMode:u,renderedMode:d})}startObserver(){if(!this._observer)try{this._observer=new IntersectionObserver(a=>{const l=a.some(u=>u.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())}};s.forEach(a=>{a in o.prototype||Object.defineProperty(o.prototype,a,{get:function(){return this.getAttribute(a)},set:function(l){l!==null?this.setAttribute(a,l):this.removeAttribute(a)}})});const r=$o();for(const a in r)o[a]=o.prototype[a]=r[a];return t.define(e,o),o}Jl()||$o();var Ql=Object.defineProperty,tt=(e,t,i,n)=>{for(var s=void 0,o=e.length-1,r;o>=0;o--)(r=e[o])&&(s=r(t,i,s)||s);return s&&Ql(t,i,s),s},Ze;const X=(Ze=class extends k{constructor(){super(),this.labelHidden=!1,this.active=!1,this.disabled=!1,this.vertical=!1,this.tooltipVisible=!1,this._parent=Bt(),this._tooltip=Bt(),this._contextMenu=Bt(),this._mouseLeave=!1,this.onWindowMouseUp=e=>{const{value:t}=this._contextMenu;!this.contains(e.target)&&t&&(t.visible=!1)},this.mouseLeave=!0}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&&Ys(e,t,{placement:"bottom",middleware:[Ls(10),Gs(),qs(),Ws({padding:5})]}).then(i=>{const{x:n,y:s}=i;Object.assign(t.style,{left:`${n}px`,top:`${s}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)}onChildrenClick(e){e.stopPropagation();const{value:t}=this._contextMenu;t&&(t.visible=!t.visible)}onSlotChange(e){const{value:t}=this._contextMenu,i=e.target.assignedElements();for(const n of i){if(!(n instanceof Ze)){n.remove(),console.warn("Only bim-button is allowed inside bim-button. Child has been removed.");continue}n.addEventListener("click",()=>t==null?void 0:t.updatePosition())}this.requestUpdate()}connectedCallback(){super.connectedCallback(),window.addEventListener("mouseup",this.onWindowMouseUp)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("mouseup",this.onWindowMouseUp)}render(){const e=x` +

+ ${this.tooltipTitle?x`

${this.tooltipTitle}

`:null} - ${this.tooltipText?_`

${this.tooltipText}

`:null} + ${this.tooltipText?x`

${this.tooltipText}

`:null}
- `,t=this.children.length>0;return _` - -
- ${this.label||this.icon?_` + `,t=this.children.length>0;return x` +
+ ${this.label||this.icon?x`
`:null} ${this.tooltipTitle||this.tooltipText?e:null} - ${t?_` + ${t?x`
- + + + +
`:null}
- `}},Je.styles=O` + `}},Ze.styles=O` :host { - --bim-label--c: var(--bim-ui_bg-contrast-100); + --bim-label--c: var(--bim-ui_bg-contrast-100, white); display: block; flex: 1; pointer-events: none; + background-color: var(--bim-button--bgc, var(--bim-ui_bg-contrast-20)); + border-radius: var(--bim-ui_size-4xs); + transition: all 0.15s; } :host(:not([disabled]):hover) { @@ -117,13 +118,14 @@ import{C as Ki,o as _r,a as xr,h as It,b as Te,c as wr,S as $r,A as Cr,g as Er,d } .parent { - --bim-label--fz: var(--bim-ui_size-xs); --bim-icon--c: var(--bim-label--c); + position: relative; display: flex; height: 100%; user-select: none; row-gap: 0.125rem; - column-gap: 0.125rem; + min-height: var(--bim-ui_size-5xl); + min-width: var(--bim-ui_size-5xl); } .button, @@ -133,10 +135,17 @@ import{C as Ki,o as _r,a as xr,h as It,b as Te,c as wr,S as $r,A as Cr,g as Er,d align-items: center; justify-content: center; pointer-events: auto; - min-height: var(--bim-ui_size-5xl); - min-width: var(--bim-ui_size-5xl); - background-color: var(--bim-button--bgc, var(--bim-ui_bg-contrast-20)); - outline: var(--bim-button--olw) solid var(--bim-button--olc); + } + + .children { + padding: 0 0.375rem; + position: absolute; + height: 100%; + right: 0; + } + + :host(:not([label-hidden])[icon][vertical]) .parent { + min-height: 2.5rem; } .button { @@ -147,11 +156,9 @@ import{C as Ki,o as _r,a as xr,h as It,b as Te,c as wr,S as $r,A as Cr,g as Er,d justify-content: var(--bim-button--jc, center); } - :host(:hover) .button, - :host(:hover) .children { + :host(:hover), + :host([active]) { --bim-label--c: var(--bim-ui_main-contrast); - --bim-icon--c: var(--bim-ui_main-contrast); - fill: white; background-color: var(--bim-ui_main-base); } @@ -159,12 +166,6 @@ import{C as Ki,o as _r,a as xr,h as It,b as Te,c as wr,S as $r,A as Cr,g as Er,d flex: 1; } - :host([active]) .button { - --bim-label--c: var(--bim-ui_main-contrast); - --bim-icon--c: var(--bim-ui_main-contrast); - background-color: var(--bim-ui_main-base); - } - :host([vertical]) .parent { justify-content: center; } @@ -177,17 +178,8 @@ import{C as Ki,o as _r,a as xr,h as It,b as Te,c as wr,S as $r,A as Cr,g as Er,d background-color: gray; } - .children { - --bim-icon--fz: var(--bim-ui_size-base); - padding: 0 0.125rem; - } - ::slotted(bim-button) { --bim-icon--fz: var(--bim-ui_size-base); - --bim-button--bgc: var( - --bim-context-menu--bgc, - var(--bim-ui_bg-contrast-20) - ); --bim-button--bdrs: var(--bim-ui_size-4xs); --bim-button--olw: 0; --bim-button--olc: transparent; @@ -216,9 +208,9 @@ import{C as Ki,o as _r,a as xr,h as It,b as Te,c as wr,S as $r,A as Cr,g as Er,d :host(:not([tooltip-visible])) .tooltip { display: none; } - `,Je);K([m({type:String,reflect:!0})],Y.prototype,"label");K([m({type:Boolean,attribute:"label-hidden",reflect:!0})],Y.prototype,"labelHidden");K([m({type:Boolean,reflect:!0})],Y.prototype,"active");K([m({type:Boolean,reflect:!0,attribute:"disabled"})],Y.prototype,"disabled");K([m({type:String,reflect:!0})],Y.prototype,"icon");K([m({type:Boolean,reflect:!0})],Y.prototype,"vertical");K([m({type:Number,attribute:"tooltip-time",reflect:!0})],Y.prototype,"tooltipTime");K([m({type:Boolean,attribute:"tooltip-visible",reflect:!0})],Y.prototype,"tooltipVisible");K([m({type:String,attribute:"tooltip-title",reflect:!0})],Y.prototype,"tooltipTitle");K([m({type:String,attribute:"tooltip-text",reflect:!0})],Y.prototype,"tooltipText");let Zl=Y;var Kl=Object.defineProperty,je=(e,t,i,n)=>{for(var s=void 0,o=e.length-1,r;o>=0;o--)(r=e[o])&&(s=r(t,i,s)||s);return s&&Kl(t,i,s),s};const Eo=class extends S{constructor(){super(...arguments),this.checked=!1,this.inverted=!1,this.onValueChange=new Event("change")}get value(){return this.checked}onChange(e){e.stopPropagation(),this.checked=e.target.checked,this.dispatchEvent(this.onValueChange)}render(){return _` + `,Ze);tt([f({type:String,reflect:!0})],X.prototype,"label");tt([f({type:Boolean,attribute:"label-hidden",reflect:!0})],X.prototype,"labelHidden");tt([f({type:Boolean,reflect:!0})],X.prototype,"active");tt([f({type:Boolean,reflect:!0,attribute:"disabled"})],X.prototype,"disabled");tt([f({type:String,reflect:!0})],X.prototype,"icon");tt([f({type:Boolean,reflect:!0})],X.prototype,"vertical");tt([f({type:Number,attribute:"tooltip-time",reflect:!0})],X.prototype,"tooltipTime");tt([f({type:Boolean,attribute:"tooltip-visible",reflect:!0})],X.prototype,"tooltipVisible");tt([f({type:String,attribute:"tooltip-title",reflect:!0})],X.prototype,"tooltipTitle");tt([f({type:String,attribute:"tooltip-text",reflect:!0})],X.prototype,"tooltipText");let Zl=X;var Kl=Object.defineProperty,He=(e,t,i,n)=>{for(var s=void 0,o=e.length-1,r;o>=0;o--)(r=e[o])&&(s=r(t,i,s)||s);return s&&Kl(t,i,s),s};const Eo=class extends k{constructor(){super(...arguments),this.checked=!1,this.inverted=!1,this.onValueChange=new Event("change")}get value(){return this.checked}onChange(e){e.stopPropagation(),this.checked=e.target.checked,this.dispatchEvent(this.onValueChange)}render(){return x`
- ${this.label?_`${this.label} `:null} + ${this.label?x`${this.label} `:null} {for(var s=void 0,o=e.length-1,r;o>=0;o--)(r=e[o])&&(s=r(t,i,s)||s);return s&&tc(t,i,s),s};const Ao=class extends S{constructor(){super(...arguments),this.vertical=!1,this.color="#bcf124",this._colorInput=ft(),this._textInput=ft(),this.onValueChange=new Event("input"),this.onOpacityInput=e=>{const t=e.target;this.opacity=t.value,this.dispatchEvent(this.onValueChange)}}set value(e){const{color:t,opacity:i}=e;this.color=t,i&&(this.opacity=i)}get value(){const e={color:this.color};return this.opacity&&(e.opacity=this.opacity),e}onColorInput(e){e.stopPropagation();const{value:t}=this._colorInput;t&&(this.color=t.value,this.dispatchEvent(this.onValueChange))}onTextInput(e){e.stopPropagation();const{value:t}=this._textInput;if(!t)return;const{value:i}=t;let n=i.replace(/[^a-fA-F0-9]/g,"");n.startsWith("#")||(n=`#${n}`),t.value=n.slice(0,7),t.value.length===7&&(this.color=t.value,this.dispatchEvent(this.onValueChange))}focus(){const{value:e}=this._colorInput;e&&e.click()}render(){return _` + `;let Kt=Eo;He([f({type:String,reflect:!0})],Kt.prototype,"icon");He([f({type:String,reflect:!0})],Kt.prototype,"name");He([f({type:String,reflect:!0})],Kt.prototype,"label");He([f({type:Boolean,reflect:!0})],Kt.prototype,"checked");He([f({type:Boolean,reflect:!0})],Kt.prototype,"inverted");var tc=Object.defineProperty,te=(e,t,i,n)=>{for(var s=void 0,o=e.length-1,r;o>=0;o--)(r=e[o])&&(s=r(t,i,s)||s);return s&&tc(t,i,s),s};const Ao=class extends k{constructor(){super(...arguments),this.vertical=!1,this.color="#bcf124",this._colorInput=Bt(),this._textInput=Bt(),this.onValueChange=new Event("input"),this.onOpacityInput=e=>{const t=e.target;this.opacity=t.value,this.dispatchEvent(this.onValueChange)}}set value(e){const{color:t,opacity:i}=e;this.color=t,i&&(this.opacity=i)}get value(){const e={color:this.color};return this.opacity&&(e.opacity=this.opacity),e}onColorInput(e){e.stopPropagation();const{value:t}=this._colorInput;t&&(this.color=t.value,this.dispatchEvent(this.onValueChange))}onTextInput(e){e.stopPropagation();const{value:t}=this._textInput;if(!t)return;const{value:i}=t;let n=i.replace(/[^a-fA-F0-9]/g,"");n.startsWith("#")||(n=`#${n}`),t.value=n.slice(0,7),t.value.length===7&&(this.color=t.value,this.dispatchEvent(this.onValueChange))}focus(){const{value:e}=this._colorInput;e&&e.click()}render(){return x`
- ${this.opacity!==void 0?_`{for(var s=sc(t,i),o=e.length-1,r;o>=0;o--)(r=e[o])&&(s=r(t,i,s)||s);return s&&nc(t,i,s),s};const So=class extends S{constructor(){super(...arguments),this._visible=!1,this._middleware={name:"middleware",async fn(e){const{right:t,top:i}=await nn(e);return e.x-=Math.sign(t)===1?t+5:0,e.y-=Math.sign(i)===1?i+5:0,e}}}get visible(){return this._visible}set visible(e){this._visible=e,e&&this.updatePosition()}async updatePosition(e){const t=e||this.parentNode;if(!t){this.visible=!1,console.warn("No target element found for context-menu.");return}const i=await Ys(t,this,{placement:"right",middleware:[Ls(10),Gs(),qs(),Ws({padding:5}),this._middleware]}),{x:n,y:s}=i;this.style.left=`${n}px`,this.style.top=`${s}px`}render(){return _` `}};So.styles=[zt.scrollbar,O` +`,Lt={scrollbar:ec,globalStyles:ic};var nc=Object.defineProperty,sc=Object.getOwnPropertyDescriptor,oc=(e,t,i,n)=>{for(var s=sc(t,i),o=e.length-1,r;o>=0;o--)(r=e[o])&&(s=r(t,i,s)||s);return s&&nc(t,i,s),s};const So=class extends k{constructor(){super(...arguments),this._visible=!1,this._middleware={name:"middleware",async fn(e){const{right:t,top:i}=await on(e);return e.x-=Math.sign(t)===1?t+5:0,e.y-=Math.sign(i)===1?i+5:0,e}}}get visible(){return this._visible}set visible(e){this._visible=e,e&&this.updatePosition()}async updatePosition(e){const t=e||this.parentNode;if(!t){this.visible=!1,console.warn("No target element found for context-menu.");return}const i=await Ys(t,this,{placement:"right",middleware:[Ls(10),Gs(),qs(),Ws({padding:5}),this._middleware]}),{x:n,y:s}=i;this.style.left=`${n}px`,this.style.top=`${s}px`}render(){return x` `}};So.styles=[Lt.scrollbar,O` :host { --bim-label--fz: var(--bim-ui_size-xs); position: absolute; @@ -490,10 +484,10 @@ import{C as Ki,o as _r,a as xr,h as It,b as Te,c as wr,S as $r,A as Cr,g as Er,d :host(:not([visible])) { display: none; } - `];let ko=So;oc([m({type:Boolean,reflect:!0})],ko.prototype,"visible");class _t extends S{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 s=n.target;t.unobserve(s);const o=this.ELEMENTS_BEFORE_OBSERVER+this.visibleElements.length,r=[...this.elements][o];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 Xt(t(),n),n.firstElementChild;if(!i)throw new Error("UIComponent: Initial state is required for statefull components.");let s=i;const o=t,r=a=>(s={...s,...a},Xt(o(s),n),s);return r(i),[n.firstElementChild,r]}}const ui=(e,t=!0)=>{let i={};for(const n of e.children){const s=n,o=s.getAttribute("name")||s.getAttribute("label");if(o){if("value"in s){const r=s.value;if(typeof r=="object"&&!Array.isArray(r)&&Object.keys(r).length===0)continue;i[o]=s.value}else if(t){const r=ui(s);if(Object.keys(r).length===0)continue;i[o]=r}}else t&&(i={...i,...ui(s)})}return i},xi=e=>e==="true"||e==="false"?e==="true":e&&!isNaN(Number(e))&&e.trim()!==""?Number(e):e,rc=[">=","<=","=",">","<","?","/","#"];function rs(e){const t=rc.find(r=>e.split(r).length===2),i=e.split(t).map(r=>r.trim()),[n,s]=i,o=s.startsWith("'")&&s.endsWith("'")?s.replace(/'/g,""):xi(s);return{key:n,condition:t,value:o}}const Xi=e=>{try{const t=[],i=e.split(/&(?![^()]*\))/).map(n=>n.trim());for(const n of i){const s=!n.startsWith("(")&&!n.endsWith(")"),o=n.startsWith("(")&&n.endsWith(")");if(s){const r=rs(n);t.push(r)}if(o){const r={operator:"&",queries:n.replace(/^(\()|(\))$/g,"").split("&").map(a=>a.trim()).map((a,l)=>{const u=rs(a);return l>0&&(u.operator="&"),u})};t.push(r)}}return t}catch{return null}},as=(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 ac=Object.defineProperty,lc=Object.getOwnPropertyDescriptor,xt=(e,t,i,n)=>{for(var s=n>1?void 0:n?lc(t,i):t,o=e.length-1,r;o>=0;o--)(r=e[o])&&(s=(n?r(t,i,s):r(s))||s);return n&&s&&ac(t,i,s),s};const Oo=class extends S{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?xi(this.label):this.label}set value(e){this._value=e}render(){return _` + `];let ko=So;oc([f({type:Boolean,reflect:!0})],ko.prototype,"visible");class yt extends k{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 s=n.target;t.unobserve(s);const o=this.ELEMENTS_BEFORE_OBSERVER+this.visibleElements.length,r=[...this.elements][o];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 Xt(t(),n),n.firstElementChild;if(!i)throw new Error("UIComponent: Initial state is required for statefull components.");let s=i;const o=t,r=a=>(s={...s,...a},Xt(o(s),n),s);return r(i),[n.firstElementChild,r]}}const pi=(e,t=!0)=>{let i={};for(const n of e.children){const s=n,o=s.getAttribute("name")||s.getAttribute("label");if(o){if("value"in s){const r=s.value;if(typeof r=="object"&&!Array.isArray(r)&&Object.keys(r).length===0)continue;i[o]=s.value}else if(t){const r=pi(s);if(Object.keys(r).length===0)continue;i[o]=r}}else t&&(i={...i,...pi(s)})}return i},Ci=e=>e==="true"||e==="false"?e==="true":e&&!isNaN(Number(e))&&e.trim()!==""?Number(e):e,rc=[">=","<=","=",">","<","?","/","#"];function as(e){const t=rc.find(r=>e.split(r).length===2),i=e.split(t).map(r=>r.trim()),[n,s]=i,o=s.startsWith("'")&&s.endsWith("'")?s.replace(/'/g,""):Ci(s);return{key:n,condition:t,value:o}}const Zi=e=>{try{const t=[],i=e.split(/&(?![^()]*\))/).map(n=>n.trim());for(const n of i){const s=!n.startsWith("(")&&!n.endsWith(")"),o=n.startsWith("(")&&n.endsWith(")");if(s){const r=as(n);t.push(r)}if(o){const r={operator:"&",queries:n.replace(/^(\()|(\))$/g,"").split("&").map(a=>a.trim()).map((a,l)=>{const u=as(a);return l>0&&(u.operator="&"),u})};t.push(r)}}return t}catch{return null}},ls=(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 ac=Object.defineProperty,lc=Object.getOwnPropertyDescriptor,_t=(e,t,i,n)=>{for(var s=n>1?void 0:n?lc(t,i):t,o=e.length-1,r;o>=0;o--)(r=e[o])&&(s=(n?r(t,i,s):r(s))||s);return n&&s&&ac(t,i,s),s};const Oo=class extends k{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?Ci(this.label):this.label}set value(e){this._value=e}render(){return x`
- ${this.img||this.icon||this.label?_`
- ${this.checkbox&&!this.noMark?_` + ${this.checkbox&&!this.noMark?x``:null} @@ -504,7 +498,7 @@ import{C as Ki,o as _r,a as xr,h as It,b as Te,c as wr,S as $r,A as Cr,g as Er,d >${this.label}
`:null} - ${!this.checkbox&&!this.noMark&&this.checked?_`{for(var s=n>1?void 0:n?uc(t,i):t,o=e.length-1,r;o>=0;o--)(r=e[o])&&(s=(n?r(t,i,s):r(s))||s);return n&&s&&cc(t,i,s),s};const To=class extends _t{constructor(){super(),this.multiple=!1,this.required=!1,this.vertical=!1,this._inputContainer=ft(),this._listElement=ft(),this._visible=!1,this._value=[],this.onValueChange=new Event("change"),this.onWindowMouseUp=e=>{this.visible&&(this.contains(e.target)||(this.visible=!1))},this.onOptionClick=e=>{const t=e.target,i=this._value.includes(t);if(!this.multiple&&!this.required&&!i)this._value=[t];else if(!this.multiple&&!this.required&&i)this._value=[];else if(!this.multiple&&this.required&&!i)this._value=[t];else if(this.multiple&&!this.required&&!i)this._value=[...this._value,t];else if(this.multiple&&!this.required&&i)this._value=this._value.filter(n=>n!==t);else if(this.multiple&&this.required&&!i)this._value=[...this._value,t];else if(this.multiple&&this.required&&i){const n=this._value.filter(s=>s!==t);n.length!==0&&(this._value=n)}this.updateOptionsState(),this.dispatchEvent(this.onValueChange)},this.useObserver=!0}set visible(e){this._visible=e,e||this.resetVisibleElements()}get visible(){return this._visible}set value(e){if(this.required&&Object.keys(e).length===0)return;const t=[];for(const i of e){const n=this.findOption(i);if(n&&(t.push(n),!this.multiple&&Object.keys(e).length>1))break}this._value=t,this.updateOptionsState(),this.dispatchEvent(this.onValueChange)}get value(){return this._value.filter(e=>e instanceof I&&e.checked).map(e=>e.value)}get _options(){const e=[...this.elements];for(const t of this.children)t instanceof I&&e.push(t);return e}onSlotChange(e){const t=e.target.assignedElements();this.observe(t);for(const i of t){if(!(i instanceof I)){i.remove();continue}i.removeEventListener("click",this.onOptionClick),i.addEventListener("click",this.onOptionClick)}}updateOptionsState(){for(const e of this._options)e instanceof I&&(this._value.includes(e)?e.checked=!0:e.checked=!1)}findOption(e){return this._options.find(t=>t instanceof I?t.label===e||t.value===e:!1)}connectedCallback(){super.connectedCallback(),window.addEventListener("mouseup",this.onWindowMouseUp)}firstUpdated(){for(const e of this.children)e instanceof I&&e.checked&&this._value.push(e)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("mouseup",this.onWindowMouseUp)}render(){let e,t,i;if(this._value.length===0)e="Select an option...";else if(this._value.length===1){const n=this._value[0];e=(n==null?void 0:n.label)||(n==null?void 0:n.value),t=n==null?void 0:n.img,i=n==null?void 0:n.icon}else e=`Multiple (${this._value.length})`;return _` + `;let j=Oo;_t([f({type:String,reflect:!0})],j.prototype,"img",2);_t([f({type:String,reflect:!0})],j.prototype,"label",2);_t([f({type:String,reflect:!0})],j.prototype,"icon",2);_t([f({type:Boolean,reflect:!0})],j.prototype,"checked",2);_t([f({type:Boolean,reflect:!0})],j.prototype,"checkbox",2);_t([f({type:Boolean,attribute:"no-mark",reflect:!0})],j.prototype,"noMark",2);_t([f({converter:{fromAttribute(e){return e&&Ci(e)}}})],j.prototype,"value",1);_t([f({type:Boolean,reflect:!0})],j.prototype,"vertical",2);var cc=Object.defineProperty,uc=Object.getOwnPropertyDescriptor,xt=(e,t,i,n)=>{for(var s=n>1?void 0:n?uc(t,i):t,o=e.length-1,r;o>=0;o--)(r=e[o])&&(s=(n?r(t,i,s):r(s))||s);return n&&s&&cc(t,i,s),s};const To=class extends yt{constructor(){super(),this.multiple=!1,this.required=!1,this.vertical=!1,this._visible=!1,this._value=new Set,this.onValueChange=new Event("change"),this.onWindowMouseUp=e=>{this.visible&&(this.contains(e.target)||(this.visible=!1))},this.onOptionClick=e=>{const t=e.target,i=this._value.has(t);if(!this.multiple&&!this.required&&!i)this._value=new Set([t]);else if(!this.multiple&&!this.required&&i)this._value=new Set([]);else if(!this.multiple&&this.required&&!i)this._value=new Set([t]);else if(this.multiple&&!this.required&&!i)this._value=new Set([...this._value,t]);else if(this.multiple&&!this.required&&i){const n=[...this._value].filter(s=>s!==t);this._value=new Set(n)}else if(this.multiple&&this.required&&!i)this._value=new Set([...this._value,t]);else if(this.multiple&&this.required&&i){const n=[...this._value].filter(o=>o!==t),s=new Set(n);s.size!==0&&(this._value=s)}this.updateOptionsState(),this.dispatchEvent(this.onValueChange)},this.useObserver=!0}set visible(e){this._visible=e,e||this.resetVisibleElements()}get visible(){return this._visible}set value(e){if(this.required&&Object.keys(e).length===0)return;const t=new Set;for(const i of e){const n=this.findOption(i);if(n&&(t.add(n),!this.multiple&&Object.keys(e).length===1))break}this._value=t,this.updateOptionsState(),this.dispatchEvent(this.onValueChange)}get value(){return[...this._value].filter(e=>e instanceof j&&e.checked).map(e=>e.value)}get _options(){const e=new Set([...this.elements]);for(const t of this.children)t instanceof j&&e.add(t);return[...e]}onSlotChange(e){const t=e.target.assignedElements();this.observe(t);const i=new Set;for(const n of this.elements){if(!(n instanceof j)){n.remove();continue}n.checked&&i.add(n),n.removeEventListener("click",this.onOptionClick),n.addEventListener("click",this.onOptionClick)}this._value=i}updateOptionsState(){for(const e of this._options)e instanceof j&&(e.checked=this._value.has(e))}findOption(e){return this._options.find(t=>t instanceof j?t.label===e||t.value===e:!1)}connectedCallback(){super.connectedCallback(),window.addEventListener("mouseup",this.onWindowMouseUp)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("mouseup",this.onWindowMouseUp)}render(){let e,t,i;if(this._value.size===0)e="Select an option...";else if(this._value.size===1){const n=[...this._value][0];e=(n==null?void 0:n.label)||(n==null?void 0:n.value),t=n==null?void 0:n.img,i=n==null?void 0:n.icon}else e=`Multiple (${this._value.size})`;return x` -
this.visible=!this.visible} - > +
this.visible=!this.visible}> ${e}
- + ${this.visibleElements.map(n=>n)} - `}};To.styles=[zt.scrollbar,O` + `}};To.styles=[Lt.scrollbar,O` :host { --bim-input--bgc: var( --bim-dropdown--bgc, var(--bim-ui_bg-contrast-20) ); - --bim-input--olw: var(--bim-dropdown--olw, 2px); - --bim-input--olc: var(--bim-dropdown--olc, transparent); - --bim-input--bdrs: var(--bim-dropdown--bdrs, var(--bim-ui_size-4xs)); + --bim-input--olw: 2px; + --bim-input--olc: transparent; + --bim-input--bdrs: var(--bim-ui_size-4xs); flex: 1; display: block; } :host([visible]) { - --bim-input--olc: var( - --bim-dropdown¡focus--c, - var(--bim-ui_accent-base) - ); + --bim-input--olc: var(--bim-ui_accent-base); } .input { @@ -643,8 +631,8 @@ import{C as Ki,o as _r,a as xr,h as It,b as Te,c as wr,S as $r,A as Cr,g as Er,d bim-label { pointer-events: none; } - `];let ot=To;wt([m({type:String,reflect:!0})],ot.prototype,"name",2);wt([m({type:String,reflect:!0})],ot.prototype,"icon",2);wt([m({type:String,reflect:!0})],ot.prototype,"label",2);wt([m({type:Boolean,reflect:!0})],ot.prototype,"multiple",2);wt([m({type:Boolean,reflect:!0})],ot.prototype,"required",2);wt([m({type:Boolean,reflect:!0})],ot.prototype,"vertical",2);wt([m({type:Boolean,reflect:!0})],ot.prototype,"visible",1);wt([Le()],ot.prototype,"_value",2);var hc=Object.defineProperty,No=(e,t,i,n)=>{for(var s=void 0,o=e.length-1,r;o>=0;o--)(r=e[o])&&(s=r(t,i,s)||s);return s&&hc(t,i,s),s};const Po=class extends S{constructor(){super(...arguments),this.floating=!1,this.layouts={}}getUniqueAreasFromTemplate(e){const t=e.split(` -`).map(i=>i.trim()).map(i=>i.split('"')[1]).filter(i=>i!==void 0).flatMap(i=>i.split(/\s+/));return[...new Set(t)].filter(i=>i!=="")}firstUpdated(){this._onLayoutChange=new Event("layoutchange")}render(){if(this.layout){if(this.layouts[this.layout]){this.innerHTML="";const e=this.layouts[this.layout],t=this.getUniqueAreasFromTemplate(e.template).map(i=>{const n=e.elements[i];return n&&(n.style.gridArea=i),n}).filter(i=>!!i);this.style.gridTemplate=e.template,this._onLayoutChange&&this.dispatchEvent(this._onLayoutChange),this.append(...t)}}else this.innerHTML="",this.style.gridTemplate="",this._onLayoutChange&&this.dispatchEvent(this._onLayoutChange);return _``}};Po.styles=O` + `];let at=To;xt([f({type:String,reflect:!0})],at.prototype,"name",2);xt([f({type:String,reflect:!0})],at.prototype,"icon",2);xt([f({type:String,reflect:!0})],at.prototype,"label",2);xt([f({type:Boolean,reflect:!0})],at.prototype,"multiple",2);xt([f({type:Boolean,reflect:!0})],at.prototype,"required",2);xt([f({type:Boolean,reflect:!0})],at.prototype,"vertical",2);xt([f({type:Boolean,reflect:!0})],at.prototype,"visible",1);xt([ze()],at.prototype,"_value",2);var hc=Object.defineProperty,No=(e,t,i,n)=>{for(var s=void 0,o=e.length-1,r;o>=0;o--)(r=e[o])&&(s=r(t,i,s)||s);return s&&hc(t,i,s),s};const Po=class extends k{constructor(){super(...arguments),this.floating=!1,this.layouts={}}getUniqueAreasFromTemplate(e){const t=e.split(` +`).map(i=>i.trim()).map(i=>i.split('"')[1]).filter(i=>i!==void 0).flatMap(i=>i.split(/\s+/));return[...new Set(t)].filter(i=>i!=="")}firstUpdated(){this._onLayoutChange=new Event("layoutchange")}render(){if(this.layout){if(this.layouts[this.layout]){this.innerHTML="";const e=this.layouts[this.layout],t=this.getUniqueAreasFromTemplate(e.template).map(i=>{const n=e.elements[i];return n&&(n.style.gridArea=i),n}).filter(i=>!!i);this.style.gridTemplate=e.template,this._onLayoutChange&&this.dispatchEvent(this._onLayoutChange),this.append(...t)}}else this.innerHTML="",this.style.gridTemplate="",this._onLayoutChange&&this.dispatchEvent(this._onLayoutChange);return x``}};Po.styles=O` :host { display: grid; height: 100%; @@ -673,9 +661,9 @@ import{C as Ki,o as _r,a as xr,h as It,b as Te,c as wr,S as $r,A as Cr,g as Er,d background-color: var(--bim-ui_bg-contrast-20); gap: 1px; } - `;let fn=Po;No([m({type:Boolean,reflect:!0})],fn.prototype,"floating");No([m({type:String,reflect:!0})],fn.prototype,"layout");const Ji=class extends S{render(){return _` + `;let gn=Po;No([f({type:Boolean,reflect:!0})],gn.prototype,"floating");No([f({type:String,reflect:!0})],gn.prototype,"layout");const Ki=class extends k{render(){return x` - `}};Ji.styles=O` + `}};Ki.styles=O` :host { height: var(--bim-icon--fz, var(--bim-ui_size-sm)); width: var(--bim-icon--fz, var(--bim-ui_size-sm)); @@ -685,10 +673,11 @@ import{C as Ki,o as _r,a as xr,h as It,b as Te,c as wr,S as $r,A as Cr,g as Er,d height: var(--bim-icon--fz, var(--bim-ui_size-sm)); width: var(--bim-icon--fz, var(--bim-ui_size-sm)); color: var(--bim-icon--c); + transition: all 0.15s; } - `,Ji.properties={icon:{type:String}};let dc=Ji;var pc=Object.defineProperty,wi=(e,t,i,n)=>{for(var s=void 0,o=e.length-1,r;o>=0;o--)(r=e[o])&&(s=r(t,i,s)||s);return s&&pc(t,i,s),s};const Mo=class extends S{constructor(){super(...arguments),this.vertical=!1,this.onValueChange=new Event("change")}get value(){const e={};for(const t of this.children){const i=t;"value"in i?e[i.name||i.label]=i.value:"checked"in i&&(e[i.name||i.label]=i.checked)}return e}set value(e){const t=[...this.children];for(const i in e){const n=t.find(r=>{const a=r;return a.name===i||a.label===i});if(!n)continue;const s=n,o=e[i];typeof o=="boolean"?s.checked=o:s.value=o}}render(){return _` + `,Ki.properties={icon:{type:String}};let dc=Ki;var pc=Object.defineProperty,Ei=(e,t,i,n)=>{for(var s=void 0,o=e.length-1,r;o>=0;o--)(r=e[o])&&(s=r(t,i,s)||s);return s&&pc(t,i,s),s};const Mo=class extends k{constructor(){super(...arguments),this.vertical=!1,this.onValueChange=new Event("change")}get value(){const e={};for(const t of this.children){const i=t;"value"in i?e[i.name||i.label]=i.value:"checked"in i&&(e[i.name||i.label]=i.checked)}return e}set value(e){const t=[...this.children];for(const i in e){const n=t.find(r=>{const a=r;return a.name===i||a.label===i});if(!n)continue;const s=n,o=e[i];typeof o=="boolean"?s.checked=o:s.value=o}}render(){return x`
- ${this.label||this.icon?_`${this.label}`:null} + ${this.label||this.icon?x`${this.label}`:null}
@@ -730,6 +719,7 @@ import{C as Ki,o as _r,a as xr,h as It,b as Te,c as wr,S as $r,A as Cr,g as Er,d outline: var(--bim-input--olw, 2px) solid var(--bim-input--olc, transparent); border-radius: var(--bim-input--bdrs, var(--bim-ui_size-4xs)); + transition: all 0.15s; } :host(:not([vertical])) .input { @@ -740,10 +730,10 @@ import{C as Ki,o as _r,a as xr,h as It,b as Te,c as wr,S as $r,A as Cr,g as Er,d :host(:not([vertical])[label]) .input { max-width: fit-content; } - `;let He=Mo;wi([m({type:String,reflect:!0})],He.prototype,"name");wi([m({type:String,reflect:!0})],He.prototype,"label");wi([m({type:String,reflect:!0})],He.prototype,"icon");wi([m({type:Boolean,reflect:!0})],He.prototype,"vertical");var mc=Object.defineProperty,De=(e,t,i,n)=>{for(var s=void 0,o=e.length-1,r;o>=0;o--)(r=e[o])&&(s=r(t,i,s)||s);return s&&mc(t,i,s),s};const Io=class extends S{constructor(){super(...arguments),this.labelHidden=!1,this.iconHidden=!1,this.vertical=!1}get value(){return this.textContent?xi(this.textContent):this.textContent}render(){return _` + `;let De=Mo;Ei([f({type:String,reflect:!0})],De.prototype,"name");Ei([f({type:String,reflect:!0})],De.prototype,"label");Ei([f({type:String,reflect:!0})],De.prototype,"icon");Ei([f({type:Boolean,reflect:!0})],De.prototype,"vertical");var fc=Object.defineProperty,Be=(e,t,i,n)=>{for(var s=void 0,o=e.length-1,r;o>=0;o--)(r=e[o])&&(s=r(t,i,s)||s);return s&&fc(t,i,s),s};const Io=class extends k{constructor(){super(...arguments),this.labelHidden=!1,this.iconHidden=!1,this.vertical=!1}get value(){return this.textContent?Ci(this.textContent):this.textContent}render(){return x`
- ${this.img?_``:null} - ${!this.iconHidden&&this.icon?_``:null} + ${this.img?x``:null} + ${!this.iconHidden&&this.icon?x``:null}

`}};Io.styles=O` @@ -755,6 +745,7 @@ import{C as Ki,o as _r,a as xr,h as It,b as Te,c as wr,S as $r,A as Cr,g as Er,d display: block; white-space: nowrap; line-height: 1.1rem; + transition: all 0.15s; } .parent { @@ -801,15 +792,15 @@ import{C as Ki,o as _r,a as xr,h as It,b as Te,c as wr,S as $r,A as Cr,g as Er,d calc(var(--bim-label--fz, var(--bim-ui_size-xs)) * 4) ); } - `;let ee=Io;De([m({type:String,reflect:!0})],ee.prototype,"img");De([m({type:Boolean,attribute:"label-hidden",reflect:!0})],ee.prototype,"labelHidden");De([m({type:String,reflect:!0})],ee.prototype,"icon");De([m({type:Boolean,attribute:"icon-hidden",reflect:!0})],ee.prototype,"iconHidden");De([m({type:Boolean,reflect:!0})],ee.prototype,"vertical");var fc=Object.defineProperty,bc=Object.getOwnPropertyDescriptor,q=(e,t,i,n)=>{for(var s=n>1?void 0:n?bc(t,i):t,o=e.length-1,r;o>=0;o--)(r=e[o])&&(s=(n?r(t,i,s):r(s))||s);return n&&s&&fc(t,i,s),s};const Lo=class extends S{constructor(){super(...arguments),this._value=0,this.vertical=!1,this.slider=!1,this._input=ft(),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 s=a=>{var l;n=!0;const{clientX:u}=a,h=this.step??1,c=((l=h.toString().split(".")[1])==null?void 0:l.length)||0,d=1/(this.sensitivity??1),p=(u-t)/d;if(Math.floor(Math.abs(p))!==Math.abs(p))return;const y=i+p*h;this.setValue(y.toFixed(c))},o=()=>{this.slider=!0,this.removeEventListener("blur",o)},r=()=>{document.removeEventListener("mousemove",s),document.body.style.cursor="default",n?n=!1:(this.addEventListener("blur",o),this.slider=!1,requestAnimationFrame(()=>this.focus())),document.removeEventListener("mouseup",r)};document.addEventListener("mousemove",s),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 s=n>1?void 0:n?bc(t,i):t,o=e.length-1,r;o>=0;o--)(r=e[o])&&(s=(n?r(t,i,s):r(s))||s);return n&&s&&mc(t,i,s),s};const Lo=class extends k{constructor(){super(...arguments),this._value=0,this.vertical=!1,this.slider=!1,this._input=Bt(),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 s=a=>{var l;n=!0;const{clientX:u}=a,d=this.step??1,c=((l=d.toString().split(".")[1])==null?void 0:l.length)||0,h=1/(this.sensitivity??1),p=(u-t)/h;if(Math.floor(Math.abs(p))!==Math.abs(p))return;const v=i+p*d;this.setValue(v.toFixed(c))},o=()=>{this.slider=!0,this.removeEventListener("blur",o)},r=()=>{document.removeEventListener("mousemove",s),document.body.style.cursor="default",n?n=!1:(this.addEventListener("blur",o),this.slider=!1,requestAnimationFrame(()=>this.focus())),document.removeEventListener("mouseup",r)};document.addEventListener("mousemove",s),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${this.pref}`:null} - ${this.suffix?_`${this.suffix}`:null} - `,t=this.min??-1/0,i=this.max??1/0,n=100*(this.value-t)/(i-t),s=_` + `,t=this.min??-1/0,i=this.max??1/0,n=100*(this.value-t)/(i-t),s=x`
- ${this.pref||this.icon?_`${`${this.pref}: `}`:null} ${this.value} - ${this.suffix?_`${this.suffix}`:null} + ${this.suffix?x`${this.suffix}`:null}
- `,o=`${this.label||this.name||this.pref?`${this.label||this.name||this.pref}: `:""}${this.value}${this.suffix??""}`;return _` + `,o=`${this.label||this.name||this.pref?`${this.label||this.name||this.pref}: `:""}${this.value}${this.suffix??""}`;return x` {for(var s=n>1?void 0:n?vc(t,i):t,o=e.length-1,r;o>=0;o--)(r=e[o])&&(s=(n?r(t,i,s):r(s))||s);return n&&s&&gc(t,i,s),s};const zo=class extends S{constructor(){super(...arguments),this.onValueChange=new Event("change"),this._hidden=!1,this.headerHidden=!1,this.activationButton=document.createElement("bim-button")}set hidden(e){this._hidden=e,this.activationButton.active=!e,this.dispatchEvent(new Event("hiddenchange"))}get hidden(){return this._hidden}get value(){return ui(this)}set value(e){const t=[...this.children];for(const i in e){const n=t.find(o=>{const r=o;return r.name===i||r.label===i});if(!n)continue;const s=n;s.value=e[i]}}connectedCallback(){super.connectedCallback(),this.activationButton.active=!this.hidden,this.activationButton.onclick=()=>this.hidden=!this.hidden}disconnectedCallback(){super.disconnectedCallback(),this.activationButton.remove()}collapseSections(){const e=this.querySelectorAll("bim-panel-section");for(const t of e)t.collapsed=!0}expandSections(){const e=this.querySelectorAll("bim-panel-section");for(const t of e)t.collapsed=!1}render(){return this.activationButton.icon=this.icon,this.activationButton.label=this.label||this.name,this.activationButton.tooltipTitle=this.label||this.name,_` + `;let F=Lo;G([f({type:String,reflect:!0})],F.prototype,"name",2);G([f({type:String,reflect:!0})],F.prototype,"icon",2);G([f({type:String,reflect:!0})],F.prototype,"label",2);G([f({type:String,reflect:!0})],F.prototype,"pref",2);G([f({type:Number,reflect:!0})],F.prototype,"min",2);G([f({type:Number,reflect:!0})],F.prototype,"value",1);G([f({type:Number,reflect:!0})],F.prototype,"step",2);G([f({type:Number,reflect:!0})],F.prototype,"sensitivity",2);G([f({type:Number,reflect:!0})],F.prototype,"max",2);G([f({type:String,reflect:!0})],F.prototype,"suffix",2);G([f({type:Boolean,reflect:!0})],F.prototype,"vertical",2);G([f({type:Boolean,reflect:!0})],F.prototype,"slider",2);var gc=Object.defineProperty,vc=Object.getOwnPropertyDescriptor,Fe=(e,t,i,n)=>{for(var s=n>1?void 0:n?vc(t,i):t,o=e.length-1,r;o>=0;o--)(r=e[o])&&(s=(n?r(t,i,s):r(s))||s);return n&&s&&gc(t,i,s),s};const zo=class extends k{constructor(){super(...arguments),this.onValueChange=new Event("change"),this._hidden=!1,this.headerHidden=!1,this.activationButton=document.createElement("bim-button")}set hidden(e){this._hidden=e,this.activationButton.active=!e,this.dispatchEvent(new Event("hiddenchange"))}get hidden(){return this._hidden}get value(){return pi(this)}set value(e){const t=[...this.children];for(const i in e){const n=t.find(o=>{const r=o;return r.name===i||r.label===i});if(!n)continue;const s=n;s.value=e[i]}}connectedCallback(){super.connectedCallback(),this.activationButton.active=!this.hidden,this.activationButton.onclick=()=>this.hidden=!this.hidden}disconnectedCallback(){super.disconnectedCallback(),this.activationButton.remove()}collapseSections(){const e=this.querySelectorAll("bim-panel-section");for(const t of e)t.collapsed=!0}expandSections(){const e=this.querySelectorAll("bim-panel-section");for(const t of e)t.collapsed=!1}render(){return this.activationButton.icon=this.icon,this.activationButton.label=this.label||this.name,this.activationButton.tooltipTitle=this.label||this.name,x`
- ${this.label||this.name||this.icon?_`${this.label}`:null} + ${this.label||this.name||this.icon?x`${this.label}`:null}
- `}};zo.styles=[zt.scrollbar,O` + `}};zo.styles=[Lt.scrollbar,O` :host { display: flex; border-radius: var(--bim-ui_size-base); @@ -987,7 +978,7 @@ import{C as Ki,o as _r,a as xr,h as It,b as Te,c as wr,S as $r,A as Cr,g as Er,d ::slotted(bim-panel-section:not(:last-child)) { border-bottom: 1px solid var(--bim-ui_bg-contrast-20); } - `];let ie=zo;Fe([m({type:String,reflect:!0})],ie.prototype,"icon",2);Fe([m({type:String,reflect:!0})],ie.prototype,"name",2);Fe([m({type:String,reflect:!0})],ie.prototype,"label",2);Fe([m({type:Boolean,reflect:!0})],ie.prototype,"hidden",1);Fe([m({type:Boolean,attribute:"header-hidden",reflect:!0})],ie.prototype,"headerHidden",2);var yc=Object.defineProperty,Be=(e,t,i,n)=>{for(var s=void 0,o=e.length-1,r;o>=0;o--)(r=e[o])&&(s=r(t,i,s)||s);return s&&yc(t,i,s),s};const Ro=class extends S{constructor(){super(...arguments),this.onValueChange=new Event("change")}get value(){return ui(this)}set value(e){const t=[...this.children];for(const i in e){const n=t.find(o=>{const r=o;return r.name===i||r.label===i});if(!n)continue;const s=n;s.value=e[i]}}onHeaderClick(){this.fixed||(this.collapsed=!this.collapsed)}render(){const e=this.label||this.icon||this.name||this.fixed,t=_`{for(var s=void 0,o=e.length-1,r;o>=0;o--)(r=e[o])&&(s=r(t,i,s)||s);return s&&yc(t,i,s),s};const Ro=class extends k{constructor(){super(...arguments),this.onValueChange=new Event("change")}get value(){return pi(this)}set value(e){const t=[...this.children];for(const i in e){const n=t.find(o=>{const r=o;return r.name===i||r.label===i});if(!n)continue;const s=n;s.value=e[i]}}onHeaderClick(){this.fixed||(this.collapsed=!this.collapsed)}render(){const e=this.label||this.icon||this.name||this.fixed,t=x` - `,i=_``,i=x` - `,n=this.collapsed?t:i,s=_` + `,n=this.collapsed?t:i,s=x`
- ${this.label||this.icon||this.name?_`${this.label}`:null} + ${this.label||this.icon||this.name?x`${this.label}`:null} ${this.fixed?null:n}
- `;return _` + `;return x`
${e?s:null}
- `}};Ro.styles=[zt.scrollbar,O` + `}};Ro.styles=[Lt.scrollbar,O` :host { display: block; pointer-events: auto; @@ -1069,12 +1060,13 @@ import{C as Ki,o as _r,a as xr,h as It,b as Te,c as wr,S as $r,A as Cr,g as Er,d :host(:not([fixed])[collapsed]) .components { display: none; + height: 0px; } bim-label { pointer-events: none; } - `];let ne=Ro;Be([m({type:String,reflect:!0})],ne.prototype,"icon");Be([m({type:String,reflect:!0})],ne.prototype,"label");Be([m({type:String,reflect:!0})],ne.prototype,"name");Be([m({type:Boolean,reflect:!0})],ne.prototype,"fixed");Be([m({type:Boolean,reflect:!0})],ne.prototype,"collapsed");var _c=Object.defineProperty,Ue=(e,t,i,n)=>{for(var s=void 0,o=e.length-1,r;o>=0;o--)(r=e[o])&&(s=r(t,i,s)||s);return s&&_c(t,i,s),s};const jo=class extends S{constructor(){super(...arguments),this.vertical=!1,this.onValueChange=new Event("change"),this._canEmitEvents=!1,this._value=document.createElement("bim-option"),this.onOptionClick=e=>{this._value=e.target,this.dispatchEvent(this.onValueChange);for(const t of this.children)t instanceof I&&(t.checked=t===e.target)}}get _options(){return[...this.querySelectorAll("bim-option")]}set value(e){const t=this.findOption(e);if(t){for(const i of this._options)i.checked=i===t;this._value=t,this._canEmitEvents&&this.dispatchEvent(this.onValueChange)}}get value(){return this._value.value}onSlotChange(e){const t=e.target.assignedElements();for(const i of t)i instanceof I&&(i.noMark=!0,i.removeEventListener("click",this.onOptionClick),i.addEventListener("click",this.onOptionClick))}findOption(e){return this._options.find(t=>t instanceof I?t.label===e||t.value===e:!1)}firstUpdated(){const e=[...this.children].find(t=>t instanceof I&&t.checked);e&&(this._value=e)}render(){return _` + `];let ne=Ro;Ue([f({type:String,reflect:!0})],ne.prototype,"icon");Ue([f({type:String,reflect:!0})],ne.prototype,"label");Ue([f({type:String,reflect:!0})],ne.prototype,"name");Ue([f({type:Boolean,reflect:!0})],ne.prototype,"fixed");Ue([f({type:Boolean,reflect:!0})],ne.prototype,"collapsed");var _c=Object.defineProperty,Ve=(e,t,i,n)=>{for(var s=void 0,o=e.length-1,r;o>=0;o--)(r=e[o])&&(s=r(t,i,s)||s);return s&&_c(t,i,s),s};const jo=class extends k{constructor(){super(...arguments),this.vertical=!1,this.onValueChange=new Event("change"),this._canEmitEvents=!1,this._value=document.createElement("bim-option"),this.onOptionClick=e=>{this._value=e.target,this.dispatchEvent(this.onValueChange);for(const t of this.children)t instanceof j&&(t.checked=t===e.target)}}get _options(){return[...this.querySelectorAll("bim-option")]}set value(e){const t=this.findOption(e);if(t){for(const i of this._options)i.checked=i===t;this._value=t,this._canEmitEvents&&this.dispatchEvent(this.onValueChange)}}get value(){return this._value.value}onSlotChange(e){const t=e.target.assignedElements();for(const i of t)i instanceof j&&(i.noMark=!0,i.removeEventListener("click",this.onOptionClick),i.addEventListener("click",this.onOptionClick))}findOption(e){return this._options.find(t=>t instanceof j?t.label===e||t.value===e:!1)}firstUpdated(){const e=[...this.children].find(t=>t instanceof j&&t.checked);e&&(this._value=e)}render(){return x` {for(var s=void 0,o=e.length-1,r;o>=0;o--)(r=e[o])&&(s=r(t,i,s)||s);return s&&xc(t,i,s),s};const Ho=class extends S{constructor(){super(...arguments),this.column="",this.columnIndex=0,this.rowData={}}get data(){return this.column?this.rowData[this.column]:null}render(){return _` + `;let se=jo;Ve([f({type:String,reflect:!0})],se.prototype,"name");Ve([f({type:String,reflect:!0})],se.prototype,"icon");Ve([f({type:String,reflect:!0})],se.prototype,"label");Ve([f({type:Boolean,reflect:!0})],se.prototype,"vertical");Ve([ze()],se.prototype,"_value");var xc=Object.defineProperty,wc=(e,t,i,n)=>{for(var s=void 0,o=e.length-1,r;o>=0;o--)(r=e[o])&&(s=r(t,i,s)||s);return s&&xc(t,i,s),s};const Ho=class extends k{constructor(){super(...arguments),this.column="",this.columnIndex=0,this.rowData={}}get data(){return this.column?this.rowData[this.column]:null}render(){return x`
- `,s=document.createDocumentFragment();Xt(n,s);const o=document.createElement("div");o.classList.add("branch","branch-horizontal"),o.style.left=`${i-1+.5625}rem`;const r=document.createElementNS("http://www.w3.org/2000/svg","svg");r.setAttribute("height","9.5"),r.setAttribute("width","7.5"),r.setAttribute("viewBox","0 0 4.6666672 7.3333333");const a=document.createElementNS("http://www.w3.org/2000/svg","path");a.setAttribute("d","m 1.7470835,6.9583848 2.5899999,-2.59 c 0.39,-0.39 0.39,-1.02 0,-1.41 L 1.7470835,0.36838483 c -0.63,-0.62000003 -1.71000005,-0.18 -1.71000005,0.70999997 v 5.17 c 0,0.9 1.08000005,1.34 1.71000005,0.71 z"),r.append(a);const l=document.createElementNS("http://www.w3.org/2000/svg","svg");l.setAttribute("height","6.5"),l.setAttribute("width","9.5"),l.setAttribute("viewBox","0 0 5.9111118 5.0175439");const u=document.createElementNS("http://www.w3.org/2000/svg","path");u.setAttribute("d","M -0.33616196,1.922522 2.253838,4.5125219 c 0.39,0.39 1.02,0.39 1.41,0 L 6.2538379,1.922522 c 0.6200001,-0.63 0.18,-1.71000007 -0.7099999,-1.71000007 H 0.37383804 c -0.89999997,0 -1.33999997,1.08000007 -0.71,1.71000007 z"),l.append(u);const h=document.createElement("div");h.addEventListener("click",p=>{p.stopPropagation(),this.toggleChildren()}),h.classList.add("caret"),h.style.left=`${.125+i}rem`,this.childrenHidden?h.append(r):h.append(l);const c=document.createElement("bim-table-row");this.data.children&&!this.childrenHidden&&c.append(s),c.table=this.table,c.data=this.data.data,(t=this.table)==null||t.dispatchEvent(new CustomEvent("rowcreated",{detail:{row:c}})),this.data.children&&c.append(h),i!==0&&(!this.data.children||this.childrenHidden)&&c.append(o);let d;if(this.data.children){d=document.createElement("bim-table-children"),this._children=d,d.table=this.table,d.data=this.data.children;const p=document.createDocumentFragment();Xt(n,p),d.append(p)}return _` -
${c} ${this.childrenHidden?null:d}
+ `,s=document.createDocumentFragment();Xt(n,s);const o=document.createElement("div");o.classList.add("branch","branch-horizontal"),o.style.left=`${i-1+.5625}rem`;const r=document.createElementNS("http://www.w3.org/2000/svg","svg");r.setAttribute("height","9.5"),r.setAttribute("width","7.5"),r.setAttribute("viewBox","0 0 4.6666672 7.3333333");const a=document.createElementNS("http://www.w3.org/2000/svg","path");a.setAttribute("d","m 1.7470835,6.9583848 2.5899999,-2.59 c 0.39,-0.39 0.39,-1.02 0,-1.41 L 1.7470835,0.36838483 c -0.63,-0.62000003 -1.71000005,-0.18 -1.71000005,0.70999997 v 5.17 c 0,0.9 1.08000005,1.34 1.71000005,0.71 z"),r.append(a);const l=document.createElementNS("http://www.w3.org/2000/svg","svg");l.setAttribute("height","6.5"),l.setAttribute("width","9.5"),l.setAttribute("viewBox","0 0 5.9111118 5.0175439");const u=document.createElementNS("http://www.w3.org/2000/svg","path");u.setAttribute("d","M -0.33616196,1.922522 2.253838,4.5125219 c 0.39,0.39 1.02,0.39 1.41,0 L 6.2538379,1.922522 c 0.6200001,-0.63 0.18,-1.71000007 -0.7099999,-1.71000007 H 0.37383804 c -0.89999997,0 -1.33999997,1.08000007 -0.71,1.71000007 z"),l.append(u);const d=document.createElement("div");d.addEventListener("click",p=>{p.stopPropagation(),this.toggleChildren()}),d.classList.add("caret"),d.style.left=`${.125+i}rem`,this.childrenHidden?d.append(r):d.append(l);const c=document.createElement("bim-table-row");this.data.children&&!this.childrenHidden&&c.append(s),c.table=this.table,c.data=this.data.data,(t=this.table)==null||t.dispatchEvent(new CustomEvent("rowcreated",{detail:{row:c}})),this.data.children&&c.append(d),i!==0&&(!this.data.children||this.childrenHidden)&&c.append(o);let h;if(this.data.children){h=document.createElement("bim-table-children"),this._children=h,h.table=this.table,h.data=this.data.children;const p=document.createDocumentFragment();Xt(n,p),h.append(p)}return x` +
${c} ${this.childrenHidden?null:h}
`}};Uo.styles=O` :host { position: relative; @@ -1204,10 +1196,10 @@ import{C as Ki,o as _r,a as xr,h as It,b as Te,c as wr,S as $r,A as Cr,g as Er,d .caret svg { fill: var(--bim-ui_bg-contrast-60); } - `;let Vo=Uo;Ac([m({type:Boolean,attribute:"children-hidden",reflect:!0})],Vo.prototype,"childrenHidden");var Sc=Object.defineProperty,Ve=(e,t,i,n)=>{for(var s=void 0,o=e.length-1,r;o>=0;o--)(r=e[o])&&(s=r(t,i,s)||s);return s&&Sc(t,i,s),s};const Wo=class extends S{constructor(){super(...arguments),this.columns=[],this.hiddenColumns=[],this.data={},this.isHeader=!1,this.table=this.closest("bim-table"),this.onTableColumnsChange=()=>{this.table&&(this.columns=this.table.columns)},this.onTableColumnsHidden=()=>{this.table&&(this.hiddenColumns=this.table.hiddenColumns)},this._observer=new IntersectionObserver(e=>{this._intersecting=e[0].isIntersecting},{rootMargin:"36px"})}get _columnNames(){return this.columns.filter(e=>!this.hiddenColumns.includes(e.name)).map(e=>e.name)}get _columnWidths(){return this.columns.filter(e=>!this.hiddenColumns.includes(e.name)).map(e=>e.width)}connectedCallback(){super.connectedCallback(),this._observer.observe(this),this.table&&(this.columns=this.table.columns,this.hiddenColumns=this.table.hiddenColumns,this.table.addEventListener("columnschange",this.onTableColumnsChange),this.table.addEventListener("columnshidden",this.onTableColumnsHidden))}disconnectedCallback(){super.disconnectedCallback(),this._observer.unobserve(this),this.table&&(this.columns=[],this.hiddenColumns=[],this.table.removeEventListener("columnschange",this.onTableColumnsChange),this.table.removeEventListener("columnshidden",this.onTableColumnsHidden))}compute(){var e,t,i;const n=((e=this.table)==null?void 0:e.getRowIndentation(this.data))??0,s=this.isHeader?this.data:((t=this.table)==null?void 0:t.computeRowDeclaration(this.data))??this.data,o=[];for(const r in s){if(this.hiddenColumns.includes(r))continue;const a=s[r];let l;if(typeof a=="string"||typeof a=="boolean"||typeof a=="number"?(l=document.createElement("bim-label"),l.textContent=String(a)):a instanceof HTMLElement?l=a:(l=document.createDocumentFragment(),Xt(a,l)),!l)continue;const u=document.createElement("bim-table-cell");u.append(l),u.column=r,this._columnNames.indexOf(r)===0&&!this.isHeader&&(u.style.marginLeft=`${n+.125}rem`);const h=this._columnNames.indexOf(r);u.setAttribute("data-column-index",String(h)),u.toggleAttribute("data-cell-header",this.isHeader),u.rowData=this.data,(i=this.table)==null||i.dispatchEvent(new CustomEvent("cellcreated",{detail:{cell:u}})),o.push(u)}return this.style.gridTemplateAreas=`"${this._columnNames.join(" ")}"`,this.style.gridTemplateColumns=`${this._columnWidths.join(" ")}`,_` + `;let Vo=Uo;Ac([f({type:Boolean,attribute:"children-hidden",reflect:!0})],Vo.prototype,"childrenHidden");var Sc=Object.defineProperty,We=(e,t,i,n)=>{for(var s=void 0,o=e.length-1,r;o>=0;o--)(r=e[o])&&(s=r(t,i,s)||s);return s&&Sc(t,i,s),s};const Wo=class extends k{constructor(){super(...arguments),this.columns=[],this.hiddenColumns=[],this.data={},this.isHeader=!1,this.table=this.closest("bim-table"),this.onTableColumnsChange=()=>{this.table&&(this.columns=this.table.columns)},this.onTableColumnsHidden=()=>{this.table&&(this.hiddenColumns=this.table.hiddenColumns)},this._observer=new IntersectionObserver(e=>{this._intersecting=e[0].isIntersecting},{rootMargin:"36px"})}get _columnNames(){return this.columns.filter(e=>!this.hiddenColumns.includes(e.name)).map(e=>e.name)}get _columnWidths(){return this.columns.filter(e=>!this.hiddenColumns.includes(e.name)).map(e=>e.width)}connectedCallback(){super.connectedCallback(),this._observer.observe(this),this.table&&(this.columns=this.table.columns,this.hiddenColumns=this.table.hiddenColumns,this.table.addEventListener("columnschange",this.onTableColumnsChange),this.table.addEventListener("columnshidden",this.onTableColumnsHidden))}disconnectedCallback(){super.disconnectedCallback(),this._observer.unobserve(this),this.table&&(this.columns=[],this.hiddenColumns=[],this.table.removeEventListener("columnschange",this.onTableColumnsChange),this.table.removeEventListener("columnshidden",this.onTableColumnsHidden))}compute(){var e,t,i;const n=((e=this.table)==null?void 0:e.getRowIndentation(this.data))??0,s=this.isHeader?this.data:((t=this.table)==null?void 0:t.computeRowDeclaration(this.data))??this.data,o=[];for(const r in s){if(this.hiddenColumns.includes(r))continue;const a=s[r];let l;if(typeof a=="string"||typeof a=="boolean"||typeof a=="number"?(l=document.createElement("bim-label"),l.textContent=String(a)):a instanceof HTMLElement?l=a:(l=document.createDocumentFragment(),Xt(a,l)),!l)continue;const u=document.createElement("bim-table-cell");u.append(l),u.column=r,this._columnNames.indexOf(r)===0&&!this.isHeader&&(u.style.marginLeft=`${n+.125}rem`);const d=this._columnNames.indexOf(r);u.setAttribute("data-column-index",String(d)),u.toggleAttribute("data-cell-header",this.isHeader),u.rowData=this.data,(i=this.table)==null||i.dispatchEvent(new CustomEvent("cellcreated",{detail:{cell:u}})),o.push(u)}return this.style.gridTemplateAreas=`"${this._columnNames.join(" ")}"`,this.style.gridTemplateColumns=`${this._columnWidths.join(" ")}`,x` ${o} - `}render(){return _`${this._intersecting?this.compute():_``}`}};Wo.styles=O` + `}render(){return x`${this._intersecting?this.compute():x``}`}};Wo.styles=O` :host { position: relative; grid-area: Data; @@ -1219,14 +1211,14 @@ import{C as Ki,o as _r,a as xr,h as It,b as Te,c as wr,S as $r,A as Cr,g as Er,d top: 50%; bottom: 0; } - `;let oe=Wo;Ve([m({attribute:!1})],oe.prototype,"columns");Ve([m({attribute:!1})],oe.prototype,"hiddenColumns");Ve([m({attribute:!1})],oe.prototype,"data");Ve([m({type:Boolean,attribute:"is-header",reflect:!0})],oe.prototype,"isHeader");Ve([Le()],oe.prototype,"_intersecting");var kc=Object.defineProperty,Oc=Object.getOwnPropertyDescriptor,re=(e,t,i,n)=>{for(var s=n>1?void 0:n?Oc(t,i):t,o=e.length-1,r;o>=0;o--)(r=e[o])&&(s=(n?r(t,i,s):r(s))||s);return n&&s&&kc(t,i,s),s};const qo=class extends S{constructor(){super(...arguments),this._columnsChange=new Event("columnschange"),this._filteredData=[],this.headersHidden=!1,this.minColWidth="4rem",this._columns=[],this._textDelimiters={comma:",",tab:" "},this._queryString=null,this._data=[],this.expanded=!1,this.preserveStructureOnFilter=!1,this.indentationInText=!1,this.dataTransform={},this._onColumnsHidden=new Event("columnshidden"),this._hiddenColumns=[],this._stringFilterFunction=(e,t)=>Object.values(t.data).some(i=>String(i).toLowerCase().includes(e.toLowerCase())),this._queryFilterFunction=(e,t)=>{let i=!1;const n=Xi(e)??[];for(const s of n){if("queries"in s){i=!1;break}const{condition:o,value:r}=s;let{key:a}=s;if(a.startsWith("[")&&a.endsWith("]")){const l=a.replace("[","").replace("]","");a=l,i=Object.keys(t.data).filter(u=>u.includes(l)).map(u=>as(t.data[u],o,r)).some(u=>u)}else i=as(t.data[a],o,r);if(!i)break}return i}}set columns(e){const t=[];for(const i of e){const n=typeof i=="string"?{name:i,width:`minmax(${this.minColWidth}, 1fr)`}:i;t.push(n)}this._columns=t,this.computeMissingColumns(this.data),this.dispatchEvent(this._columnsChange)}get columns(){return this._columns}get _headerRowData(){const e={};for(const t of this.columns)if(typeof t=="string")e[t]=t;else{const{name:i}=t;e[i]=i}return e}get value(){return this._filteredData}set queryString(e){this._queryString=e&&e.trim()!==""?e.trim():null,this.updateFilteredData()}get queryString(){return this._queryString}set data(e){this._data=e,this.updateFilteredData(),this.computeMissingColumns(e)&&(this.columns=this._columns)}get data(){return this._data}get dataAsync(){return new Promise(e=>{setTimeout(()=>{e(this.data)})})}set hiddenColumns(e){this._hiddenColumns=e,setTimeout(()=>{this.dispatchEvent(this._onColumnsHidden)})}get hiddenColumns(){return this._hiddenColumns}updateFilteredData(){this.queryString?(Xi(this.queryString)?(this.filterFunction=this._queryFilterFunction,this._filteredData=this.filter(this.queryString)):(this.filterFunction=this._stringFilterFunction,this._filteredData=this.filter(this.queryString)),this.preserveStructureOnFilter&&(this._expandedBeforeFilter===void 0&&(this._expandedBeforeFilter=this.expanded),this.expanded=!0)):(this.preserveStructureOnFilter&&this._expandedBeforeFilter!==void 0&&(this.expanded=this._expandedBeforeFilter,this._expandedBeforeFilter=void 0),this._filteredData=this.data)}computeMissingColumns(e){let t=!1;for(const i of e){const{children:n,data:s}=i;for(const o in s)this._columns.map(r=>typeof r=="string"?r:r.name).includes(o)||(this._columns.push({name:o,width:`minmax(${this.minColWidth}, 1fr)`}),t=!0);if(n){const o=this.computeMissingColumns(n);o&&!t&&(t=o)}}return t}generateText(e="comma",t=this.value,i="",n=!0){const s=this._textDelimiters[e];let o="";const r=this.columns.map(a=>a.name);if(n){this.indentationInText&&(o+=`Indentation${s}`);const a=`${r.join(s)} -`;o+=a}for(const[a,l]of t.entries()){const{data:u,children:h}=l,c=this.indentationInText?`${i}${a+1}${s}`:"",d=r.map(y=>u[y]??""),p=`${c}${d.join(s)} -`;o+=p,h&&(o+=this.generateText(e,l.children,`${i}${a+1}.`,!1))}return o}get csv(){return this.generateText("comma")}get tsv(){return this.generateText("tab")}computeRowDeclaration(e){const t={};for(const i in e){const n=this.dataTransform[i];n?t[i]=n(e[i],e):t[i]=e[i]}return t}downloadData(e="BIM Table Data",t="json"){let i=null;if(t==="json"&&(i=new File([JSON.stringify(this.value,void 0,2)],`${e}.json`)),t==="csv"&&(i=new File([this.csv],`${e}.csv`)),t==="tsv"&&(i=new File([this.tsv],`${e}.tsv`)),!i)return;const n=document.createElement("a");n.href=URL.createObjectURL(i),n.download=i.name,n.click(),URL.revokeObjectURL(n.href)}getRowIndentation(e,t=this.value,i=0){for(const n of t){if(n.data===e)return i;if(n.children){const s=this.getRowIndentation(e,n.children,i+1);if(s!==null)return s}}return null}getGroupIndentation(e,t=this.value,i=0){for(const n of t){if(n===e)return i;if(n.children){const s=this.getGroupIndentation(e,n.children,i+1);if(s!==null)return s}}return null}connectedCallback(){super.connectedCallback(),this.dispatchEvent(new Event("connected"))}disconnectedCallback(){super.disconnectedCallback(),this.dispatchEvent(new Event("disconnected"))}filter(e,t=this.filterFunction??this._stringFilterFunction,i=this.data){const n=[];for(const s of i)if(t(e,s)){if(this.preserveStructureOnFilter){const o={data:s.data};if(s.children){const r=this.filter(e,t,s.children);r.length&&(o.children=r)}n.push(o)}else if(n.push({data:s.data}),s.children){const o=this.filter(e,t,s.children);n.push(...o)}}else if(s.children){const o=this.filter(e,t,s.children);this.preserveStructureOnFilter&&o.length?n.push({data:s.data,children:o}):n.push(...o)}return n}render(){const e=document.createElement("bim-table-row");e.table=this,e.isHeader=!0,e.data=this._headerRowData,e.style.gridArea="Header",e.style.position="sticky",e.style.top="0",e.style.zIndex="5";const t=document.createElement("bim-table-children");return t.table=this,t.data=this.value,t.style.gridArea="Body",t.style.backgroundColor="transparent",_` + `;let oe=Wo;We([f({attribute:!1})],oe.prototype,"columns");We([f({attribute:!1})],oe.prototype,"hiddenColumns");We([f({attribute:!1})],oe.prototype,"data");We([f({type:Boolean,attribute:"is-header",reflect:!0})],oe.prototype,"isHeader");We([ze()],oe.prototype,"_intersecting");var kc=Object.defineProperty,Oc=Object.getOwnPropertyDescriptor,re=(e,t,i,n)=>{for(var s=n>1?void 0:n?Oc(t,i):t,o=e.length-1,r;o>=0;o--)(r=e[o])&&(s=(n?r(t,i,s):r(s))||s);return n&&s&&kc(t,i,s),s};const qo=class extends k{constructor(){super(...arguments),this._columnsChange=new Event("columnschange"),this._filteredData=[],this.headersHidden=!1,this.minColWidth="4rem",this._columns=[],this._textDelimiters={comma:",",tab:" "},this._queryString=null,this._data=[],this.expanded=!1,this.preserveStructureOnFilter=!1,this.indentationInText=!1,this.dataTransform={},this._onColumnsHidden=new Event("columnshidden"),this._hiddenColumns=[],this._stringFilterFunction=(e,t)=>Object.values(t.data).some(i=>String(i).toLowerCase().includes(e.toLowerCase())),this._queryFilterFunction=(e,t)=>{let i=!1;const n=Zi(e)??[];for(const s of n){if("queries"in s){i=!1;break}const{condition:o,value:r}=s;let{key:a}=s;if(a.startsWith("[")&&a.endsWith("]")){const l=a.replace("[","").replace("]","");a=l,i=Object.keys(t.data).filter(u=>u.includes(l)).map(u=>ls(t.data[u],o,r)).some(u=>u)}else i=ls(t.data[a],o,r);if(!i)break}return i}}set columns(e){const t=[];for(const i of e){const n=typeof i=="string"?{name:i,width:`minmax(${this.minColWidth}, 1fr)`}:i;t.push(n)}this._columns=t,this.computeMissingColumns(this.data),this.dispatchEvent(this._columnsChange)}get columns(){return this._columns}get _headerRowData(){const e={};for(const t of this.columns)if(typeof t=="string")e[t]=t;else{const{name:i}=t;e[i]=i}return e}get value(){return this._filteredData}set queryString(e){this._queryString=e&&e.trim()!==""?e.trim():null,this.updateFilteredData()}get queryString(){return this._queryString}set data(e){this._data=e,this.updateFilteredData(),this.computeMissingColumns(e)&&(this.columns=this._columns)}get data(){return this._data}get dataAsync(){return new Promise(e=>{setTimeout(()=>{e(this.data)})})}set hiddenColumns(e){this._hiddenColumns=e,setTimeout(()=>{this.dispatchEvent(this._onColumnsHidden)})}get hiddenColumns(){return this._hiddenColumns}updateFilteredData(){this.queryString?(Zi(this.queryString)?(this.filterFunction=this._queryFilterFunction,this._filteredData=this.filter(this.queryString)):(this.filterFunction=this._stringFilterFunction,this._filteredData=this.filter(this.queryString)),this.preserveStructureOnFilter&&(this._expandedBeforeFilter===void 0&&(this._expandedBeforeFilter=this.expanded),this.expanded=!0)):(this.preserveStructureOnFilter&&this._expandedBeforeFilter!==void 0&&(this.expanded=this._expandedBeforeFilter,this._expandedBeforeFilter=void 0),this._filteredData=this.data)}computeMissingColumns(e){let t=!1;for(const i of e){const{children:n,data:s}=i;for(const o in s)this._columns.map(r=>typeof r=="string"?r:r.name).includes(o)||(this._columns.push({name:o,width:`minmax(${this.minColWidth}, 1fr)`}),t=!0);if(n){const o=this.computeMissingColumns(n);o&&!t&&(t=o)}}return t}generateText(e="comma",t=this.value,i="",n=!0){const s=this._textDelimiters[e];let o="";const r=this.columns.map(a=>a.name);if(n){this.indentationInText&&(o+=`Indentation${s}`);const a=`${r.join(s)} +`;o+=a}for(const[a,l]of t.entries()){const{data:u,children:d}=l,c=this.indentationInText?`${i}${a+1}${s}`:"",h=r.map(v=>u[v]??""),p=`${c}${h.join(s)} +`;o+=p,d&&(o+=this.generateText(e,l.children,`${i}${a+1}.`,!1))}return o}get csv(){return this.generateText("comma")}get tsv(){return this.generateText("tab")}computeRowDeclaration(e){const t={};for(const i in e){const n=this.dataTransform[i];n?t[i]=n(e[i],e):t[i]=e[i]}return t}downloadData(e="BIM Table Data",t="json"){let i=null;if(t==="json"&&(i=new File([JSON.stringify(this.value,void 0,2)],`${e}.json`)),t==="csv"&&(i=new File([this.csv],`${e}.csv`)),t==="tsv"&&(i=new File([this.tsv],`${e}.tsv`)),!i)return;const n=document.createElement("a");n.href=URL.createObjectURL(i),n.download=i.name,n.click(),URL.revokeObjectURL(n.href)}getRowIndentation(e,t=this.value,i=0){for(const n of t){if(n.data===e)return i;if(n.children){const s=this.getRowIndentation(e,n.children,i+1);if(s!==null)return s}}return null}getGroupIndentation(e,t=this.value,i=0){for(const n of t){if(n===e)return i;if(n.children){const s=this.getGroupIndentation(e,n.children,i+1);if(s!==null)return s}}return null}connectedCallback(){super.connectedCallback(),this.dispatchEvent(new Event("connected"))}disconnectedCallback(){super.disconnectedCallback(),this.dispatchEvent(new Event("disconnected"))}filter(e,t=this.filterFunction??this._stringFilterFunction,i=this.data){const n=[];for(const s of i)if(t(e,s)){if(this.preserveStructureOnFilter){const o={data:s.data};if(s.children){const r=this.filter(e,t,s.children);r.length&&(o.children=r)}n.push(o)}else if(n.push({data:s.data}),s.children){const o=this.filter(e,t,s.children);n.push(...o)}}else if(s.children){const o=this.filter(e,t,s.children);this.preserveStructureOnFilter&&o.length?n.push({data:s.data,children:o}):n.push(...o)}return n}render(){const e=document.createElement("bim-table-row");e.table=this,e.isHeader=!0,e.data=this._headerRowData,e.style.gridArea="Header",e.style.position="sticky",e.style.top="0",e.style.zIndex="5";const t=document.createElement("bim-table-children");return t.table=this,t.data=this.value,t.style.gridArea="Body",t.style.backgroundColor="transparent",x`
${this.headersHidden?null:e}
${t}
- `}};qo.styles=[zt.scrollbar,O` + `}};qo.styles=[Lt.scrollbar,O` :host { --bim-button--bgc: transparent; position: relative; @@ -1259,7 +1251,7 @@ import{C as Ki,o as _r,a as xr,h as It,b as Te,c as wr,S as $r,A as Cr,g as Er,d flex-wrap: wrap; margin-bottom: 0.5rem; } - `];let Rt=qo;re([Le()],Rt.prototype,"_filteredData",2);re([m({type:Boolean,attribute:"headers-hidden",reflect:!0})],Rt.prototype,"headersHidden",2);re([m({type:String,attribute:"min-col-width",reflect:!0})],Rt.prototype,"minColWidth",2);re([m({type:Array,attribute:!1})],Rt.prototype,"columns",1);re([m({type:Array,attribute:!1})],Rt.prototype,"data",1);re([m({type:Boolean,reflect:!0})],Rt.prototype,"expanded",2);var Tc=Object.defineProperty,Nc=Object.getOwnPropertyDescriptor,$i=(e,t,i,n)=>{for(var s=n>1?void 0:n?Nc(t,i):t,o=e.length-1,r;o>=0;o--)(r=e[o])&&(s=(n?r(t,i,s):r(s))||s);return n&&s&&Tc(t,i,s),s};const Go=class extends S{constructor(){super(...arguments),this._defaultName="__unnamed__",this.name=this._defaultName,this._hidden=!1}set hidden(e){this._hidden=e,this.dispatchEvent(new Event("hiddenchange"))}get hidden(){return this._hidden}connectedCallback(){super.connectedCallback();const{parentElement:e}=this;if(e&&this.name===this._defaultName){const t=[...e.children].indexOf(this);this.name=`${this._defaultName}${t}`}}render(){return _` `}};Go.styles=O` + `];let zt=qo;re([ze()],zt.prototype,"_filteredData",2);re([f({type:Boolean,attribute:"headers-hidden",reflect:!0})],zt.prototype,"headersHidden",2);re([f({type:String,attribute:"min-col-width",reflect:!0})],zt.prototype,"minColWidth",2);re([f({type:Array,attribute:!1})],zt.prototype,"columns",1);re([f({type:Array,attribute:!1})],zt.prototype,"data",1);re([f({type:Boolean,reflect:!0})],zt.prototype,"expanded",2);var Tc=Object.defineProperty,Nc=Object.getOwnPropertyDescriptor,Ai=(e,t,i,n)=>{for(var s=n>1?void 0:n?Nc(t,i):t,o=e.length-1,r;o>=0;o--)(r=e[o])&&(s=(n?r(t,i,s):r(s))||s);return n&&s&&Tc(t,i,s),s};const Go=class extends k{constructor(){super(...arguments),this._defaultName="__unnamed__",this.name=this._defaultName,this._hidden=!1}set hidden(e){this._hidden=e,this.dispatchEvent(new Event("hiddenchange"))}get hidden(){return this._hidden}connectedCallback(){super.connectedCallback();const{parentElement:e}=this;if(e&&this.name===this._defaultName){const t=[...e.children].indexOf(this);this.name=`${this._defaultName}${t}`}}render(){return x` `}};Go.styles=O` :host { display: block; height: 100%; @@ -1268,14 +1260,14 @@ import{C as Ki,o as _r,a as xr,h as It,b as Te,c as wr,S as $r,A as Cr,g as Er,d :host([hidden]) { display: none; } - `;let V=Go;$i([m({type:String,reflect:!0})],V.prototype,"name",2);$i([m({type:String,reflect:!0})],V.prototype,"label",2);$i([m({type:String,reflect:!0})],V.prototype,"icon",2);$i([m({type:Boolean,reflect:!0})],V.prototype,"hidden",1);var Pc=Object.defineProperty,Mc=Object.getOwnPropertyDescriptor,ae=(e,t,i,n)=>{for(var s=n>1?void 0:n?Mc(t,i):t,o=e.length-1,r;o>=0;o--)(r=e[o])&&(s=(n?r(t,i,s):r(s))||s);return n&&s&&Pc(t,i,s),s};const Yo=class extends S{constructor(){super(...arguments),this._switchers=[],this.bottom=!1,this.switchersHidden=!1,this.floating=!1,this.switchersFull=!1,this.onTabHiddenChange=e=>{const t=e.target;t instanceof V&&!t.hidden&&(t.removeEventListener("hiddenchange",this.onTabHiddenChange),this.tab=t.name,t.addEventListener("hiddenchange",this.onTabHiddenChange))}}set tab(e){this._tab=e;const t=[...this.children],i=t.find(n=>n instanceof V&&n.name===e);for(const n of t){if(!(n instanceof V))continue;n.hidden=i!==n;const s=this.getTabSwitcher(n.name);s&&s.toggleAttribute("data-active",!n.hidden)}}get tab(){return this._tab}getTabSwitcher(e){return this._switchers.find(t=>t.getAttribute("data-name")===e)}createSwitchers(){this._switchers=[];for(const e of this.children){if(!(e instanceof V))continue;const t=document.createElement("div");t.addEventListener("click",()=>{this.tab===e.name?this.toggleAttribute("tab",!1):this.tab=e.name}),t.setAttribute("data-name",e.name),t.className="switcher";const i=document.createElement("bim-label");i.textContent=e.label??"",i.icon=e.icon,t.append(i),this._switchers.push(t)}}onSlotChange(e){this.createSwitchers();const t=e.target.assignedElements(),i=t.find(n=>n instanceof V?this.tab?n.name===this.tab:!n.hidden:!1);i&&i instanceof V&&(this.tab=i.name);for(const n of t){if(!(n instanceof V)){n.remove();continue}n.removeEventListener("hiddenchange",this.onTabHiddenChange),i!==n&&(n.hidden=!0),n.addEventListener("hiddenchange",this.onTabHiddenChange)}}render(){return _` + `;let W=Go;Ai([f({type:String,reflect:!0})],W.prototype,"name",2);Ai([f({type:String,reflect:!0})],W.prototype,"label",2);Ai([f({type:String,reflect:!0})],W.prototype,"icon",2);Ai([f({type:Boolean,reflect:!0})],W.prototype,"hidden",1);var Pc=Object.defineProperty,Mc=Object.getOwnPropertyDescriptor,ae=(e,t,i,n)=>{for(var s=n>1?void 0:n?Mc(t,i):t,o=e.length-1,r;o>=0;o--)(r=e[o])&&(s=(n?r(t,i,s):r(s))||s);return n&&s&&Pc(t,i,s),s};const Yo=class extends k{constructor(){super(...arguments),this._switchers=[],this.bottom=!1,this.switchersHidden=!1,this.floating=!1,this.switchersFull=!1,this.onTabHiddenChange=e=>{const t=e.target;t instanceof W&&!t.hidden&&(t.removeEventListener("hiddenchange",this.onTabHiddenChange),this.tab=t.name,t.addEventListener("hiddenchange",this.onTabHiddenChange))}}set tab(e){this._tab=e;const t=[...this.children],i=t.find(n=>n instanceof W&&n.name===e);for(const n of t){if(!(n instanceof W))continue;n.hidden=i!==n;const s=this.getTabSwitcher(n.name);s&&s.toggleAttribute("data-active",!n.hidden)}}get tab(){return this._tab}getTabSwitcher(e){return this._switchers.find(t=>t.getAttribute("data-name")===e)}createSwitchers(){this._switchers=[];for(const e of this.children){if(!(e instanceof W))continue;const t=document.createElement("div");t.addEventListener("click",()=>{this.tab===e.name?this.toggleAttribute("tab",!1):this.tab=e.name}),t.setAttribute("data-name",e.name),t.className="switcher";const i=document.createElement("bim-label");i.textContent=e.label??"",i.icon=e.icon,t.append(i),this._switchers.push(t)}}onSlotChange(e){this.createSwitchers();const t=e.target.assignedElements(),i=t.find(n=>n instanceof W?this.tab?n.name===this.tab:!n.hidden:!1);i&&i instanceof W&&(this.tab=i.name);for(const n of t){if(!(n instanceof W)){n.remove();continue}n.removeEventListener("hiddenchange",this.onTabHiddenChange),i!==n&&(n.hidden=!0),n.addEventListener("hiddenchange",this.onTabHiddenChange)}}render(){return x`
${this._switchers}
- `}};Yo.styles=[zt.scrollbar,O` + `}};Yo.styles=[Lt.scrollbar,O` * { box-sizing: border-box; } @@ -1311,6 +1303,7 @@ import{C as Ki,o as _r,a as xr,h as It,b as Te,c as wr,S as $r,A as Cr,g as Er,d padding: 0rem 0.75rem; display: flex; justify-content: center; + transition: all 0.15s; } :host([switchers-full]) .switcher { @@ -1385,11 +1378,11 @@ import{C as Ki,o as _r,a as xr,h as It,b as Te,c as wr,S as $r,A as Cr,g as Er,d border-radius: var(--bim-ui_size-2xs); background-color: var(--bim-ui_bg-base); } - `];let jt=Yo;ae([Le()],jt.prototype,"_switchers",2);ae([m({type:Boolean,reflect:!0})],jt.prototype,"bottom",2);ae([m({type:Boolean,attribute:"switchers-hidden",reflect:!0})],jt.prototype,"switchersHidden",2);ae([m({type:Boolean,reflect:!0})],jt.prototype,"floating",2);ae([m({type:String,reflect:!0})],jt.prototype,"tab",1);ae([m({type:Boolean,attribute:"switchers-full",reflect:!0})],jt.prototype,"switchersFull",2);/** + `];let Rt=Yo;ae([ze()],Rt.prototype,"_switchers",2);ae([f({type:Boolean,reflect:!0})],Rt.prototype,"bottom",2);ae([f({type:Boolean,attribute:"switchers-hidden",reflect:!0})],Rt.prototype,"switchersHidden",2);ae([f({type:Boolean,reflect:!0})],Rt.prototype,"floating",2);ae([f({type:String,reflect:!0})],Rt.prototype,"tab",1);ae([f({type:Boolean,attribute:"switchers-full",reflect:!0})],Rt.prototype,"switchersFull",2);/** * @license * Copyright 2018 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const Ic=e=>e??N;var Lc=Object.defineProperty,zc=Object.getOwnPropertyDescriptor,$t=(e,t,i,n)=>{for(var s=n>1?void 0:n?zc(t,i):t,o=e.length-1,r;o>=0;o--)(r=e[o])&&(s=(n?r(t,i,s):r(s))||s);return n&&s&&Lc(t,i,s),s};const Xo=class extends S{constructor(){super(...arguments),this._inputTypes=["date","datetime-local","email","month","password","search","tel","text","time","url","week"],this.value="",this.vertical=!1,this._type="text",this.onValueChange=new Event("input")}set type(e){this._inputTypes.includes(e)&&(this._type=e)}get type(){return this._type}get query(){return Xi(this.value)}onInputChange(e){e.stopPropagation();const t=e.target;clearTimeout(this._debounceTimeoutID),this._debounceTimeoutID=setTimeout(()=>{this.value=t.value,this.dispatchEvent(this.onValueChange)},this.debounce)}focus(){setTimeout(()=>{var e;const t=(e=this.shadowRoot)==null?void 0:e.querySelector("input");t==null||t.focus()})}render(){return _` + */const Ic=e=>e??M;var Lc=Object.defineProperty,zc=Object.getOwnPropertyDescriptor,wt=(e,t,i,n)=>{for(var s=n>1?void 0:n?zc(t,i):t,o=e.length-1,r;o>=0;o--)(r=e[o])&&(s=(n?r(t,i,s):r(s))||s);return n&&s&&Lc(t,i,s),s};const Xo=class extends k{constructor(){super(...arguments),this._inputTypes=["date","datetime-local","email","month","password","search","tel","text","time","url","week"],this.value="",this.vertical=!1,this._type="text",this.onValueChange=new Event("input")}set type(e){this._inputTypes.includes(e)&&(this._type=e)}get type(){return this._type}get query(){return Zi(this.value)}onInputChange(e){e.stopPropagation();const t=e.target;clearTimeout(this._debounceTimeoutID),this._debounceTimeoutID=setTimeout(()=>{this.value=t.value,this.dispatchEvent(this.onValueChange)},this.debounce)}focus(){setTimeout(()=>{var e;const t=(e=this.shadowRoot)==null?void 0:e.querySelector("input");t==null||t.focus()})}render(){return x` {for(var s=n>1?void 0:n?jc(t,i):t,o=e.length-1,r;o>=0;o--)(r=e[o])&&(s=(n?r(t,i,s):r(s))||s);return n&&s&&Rc(t,i,s),s};const Qo=class extends S{constructor(){super(...arguments),this.rows=2,this._vertical=!1}set vertical(e){this._vertical=e,this.updateChildren()}get vertical(){return this._vertical}updateChildren(){const e=this.children;for(const t of e)this.vertical?t.setAttribute("label-hidden",""):t.removeAttribute("label-hidden")}render(){return _` + `;let lt=Xo;wt([f({type:String,reflect:!0})],lt.prototype,"icon",2);wt([f({type:String,reflect:!0})],lt.prototype,"label",2);wt([f({type:String,reflect:!0})],lt.prototype,"name",2);wt([f({type:String,reflect:!0})],lt.prototype,"placeholder",2);wt([f({type:String,reflect:!0})],lt.prototype,"value",2);wt([f({type:Boolean,reflect:!0})],lt.prototype,"vertical",2);wt([f({type:Number,reflect:!0})],lt.prototype,"debounce",2);wt([f({type:String,reflect:!0})],lt.prototype,"type",1);var Rc=Object.defineProperty,jc=Object.getOwnPropertyDescriptor,Jo=(e,t,i,n)=>{for(var s=n>1?void 0:n?jc(t,i):t,o=e.length-1,r;o>=0;o--)(r=e[o])&&(s=(n?r(t,i,s):r(s))||s);return n&&s&&Rc(t,i,s),s};const Qo=class extends k{constructor(){super(...arguments),this.rows=2,this._vertical=!1}set vertical(e){this._vertical=e,this.updateChildren()}get vertical(){return this._vertical}updateChildren(){const e=this.children;for(const t of e)this.vertical?t.setAttribute("label-hidden",""):t.removeAttribute("label-hidden")}render(){return x` -
+
${this.label||this.icon?m`
t in i?Pr(i,t,{enumerable:!0,configurab ${this.tooltipTitle||this.tooltipText?i:null} ${t?m`
- + + + +
`:null} @@ -102,10 +100,13 @@ var Pr=Object.defineProperty,jr=(i,t,e)=>t in i?Pr(i,t,{enumerable:!0,configurab
`}},be.styles=E` :host { - --bim-label--c: var(--bim-ui_bg-contrast-100); + --bim-label--c: var(--bim-ui_bg-contrast-100, white); display: block; flex: 1; pointer-events: none; + background-color: var(--bim-button--bgc, var(--bim-ui_bg-contrast-20)); + border-radius: var(--bim-ui_size-4xs); + transition: all 0.15s; } :host(:not([disabled]):hover) { @@ -117,13 +118,14 @@ var Pr=Object.defineProperty,jr=(i,t,e)=>t in i?Pr(i,t,{enumerable:!0,configurab } .parent { - --bim-label--fz: var(--bim-ui_size-xs); --bim-icon--c: var(--bim-label--c); + position: relative; display: flex; height: 100%; user-select: none; row-gap: 0.125rem; - column-gap: 0.125rem; + min-height: var(--bim-ui_size-5xl); + min-width: var(--bim-ui_size-5xl); } .button, @@ -133,10 +135,17 @@ var Pr=Object.defineProperty,jr=(i,t,e)=>t in i?Pr(i,t,{enumerable:!0,configurab align-items: center; justify-content: center; pointer-events: auto; - min-height: var(--bim-ui_size-5xl); - min-width: var(--bim-ui_size-5xl); - background-color: var(--bim-button--bgc, var(--bim-ui_bg-contrast-20)); - outline: var(--bim-button--olw) solid var(--bim-button--olc); + } + + .children { + padding: 0 0.375rem; + position: absolute; + height: 100%; + right: 0; + } + + :host(:not([label-hidden])[icon][vertical]) .parent { + min-height: 2.5rem; } .button { @@ -147,11 +156,9 @@ var Pr=Object.defineProperty,jr=(i,t,e)=>t in i?Pr(i,t,{enumerable:!0,configurab justify-content: var(--bim-button--jc, center); } - :host(:hover) .button, - :host(:hover) .children { + :host(:hover), + :host([active]) { --bim-label--c: var(--bim-ui_main-contrast); - --bim-icon--c: var(--bim-ui_main-contrast); - fill: white; background-color: var(--bim-ui_main-base); } @@ -159,12 +166,6 @@ var Pr=Object.defineProperty,jr=(i,t,e)=>t in i?Pr(i,t,{enumerable:!0,configurab flex: 1; } - :host([active]) .button { - --bim-label--c: var(--bim-ui_main-contrast); - --bim-icon--c: var(--bim-ui_main-contrast); - background-color: var(--bim-ui_main-base); - } - :host([vertical]) .parent { justify-content: center; } @@ -177,17 +178,8 @@ var Pr=Object.defineProperty,jr=(i,t,e)=>t in i?Pr(i,t,{enumerable:!0,configurab background-color: gray; } - .children { - --bim-icon--fz: var(--bim-ui_size-base); - padding: 0 0.125rem; - } - ::slotted(bim-button) { --bim-icon--fz: var(--bim-ui_size-base); - --bim-button--bgc: var( - --bim-context-menu--bgc, - var(--bim-ui_bg-contrast-20) - ); --bim-button--bdrs: var(--bim-ui_size-4xs); --bim-button--olw: 0; --bim-button--olc: transparent; @@ -238,6 +230,7 @@ var Pr=Object.defineProperty,jr=(i,t,e)=>t in i?Pr(i,t,{enumerable:!0,configurab column-gap: 0.5rem; width: 100%; align-items: center; + transition: all 0.15s; } :host([inverted]) .parent { @@ -252,13 +245,14 @@ var Pr=Object.defineProperty,jr=(i,t,e)=>t in i?Pr(i,t,{enumerable:!0,configurab border: none; outline: none; accent-color: var(--bim-checkbox--c, var(--bim-ui_main-base)); + transition: all 0.15s; } input:focus { outline: var(--bim-checkbox--olw, 2px) solid var(--bim-checkbox--olc, var(--bim-ui_accent-base)); } - `;let Tt=Zn;oe([u({type:String,reflect:!0})],Tt.prototype,"icon");oe([u({type:String,reflect:!0})],Tt.prototype,"name");oe([u({type:String,reflect:!0})],Tt.prototype,"label");oe([u({type:Boolean,reflect:!0})],Tt.prototype,"checked");oe([u({type:Boolean,reflect:!0})],Tt.prototype,"inverted");var Ws=Object.defineProperty,zt=(i,t,e,r)=>{for(var n=void 0,o=i.length-1,s;o>=0;o--)(s=i[o])&&(n=s(t,e,n)||n);return n&&Ws(t,e,n),n};const tr=class extends w{constructor(){super(...arguments),this.vertical=!1,this.color="#bcf124",this._colorInput=Z(),this._textInput=Z(),this.onValueChange=new Event("input"),this.onOpacityInput=t=>{const e=t.target;this.opacity=e.value,this.dispatchEvent(this.onValueChange)}}set value(t){const{color:e,opacity:r}=t;this.color=e,r&&(this.opacity=r)}get value(){const t={color:this.color};return this.opacity&&(t.opacity=this.opacity),t}onColorInput(t){t.stopPropagation();const{value:e}=this._colorInput;e&&(this.color=e.value,this.dispatchEvent(this.onValueChange))}onTextInput(t){t.stopPropagation();const{value:e}=this._textInput;if(!e)return;const{value:r}=e;let n=r.replace(/[^a-fA-F0-9]/g,"");n.startsWith("#")||(n=`#${n}`),e.value=n.slice(0,7),e.value.length===7&&(this.color=e.value,this.dispatchEvent(this.onValueChange))}focus(){const{value:t}=this._colorInput;t&&t.click()}render(){return m` + `;let Tt=Zn;oe([u({type:String,reflect:!0})],Tt.prototype,"icon");oe([u({type:String,reflect:!0})],Tt.prototype,"name");oe([u({type:String,reflect:!0})],Tt.prototype,"label");oe([u({type:Boolean,reflect:!0})],Tt.prototype,"checked");oe([u({type:Boolean,reflect:!0})],Tt.prototype,"inverted");var Ws=Object.defineProperty,zt=(i,t,e,r)=>{for(var n=void 0,o=i.length-1,s;o>=0;o--)(s=i[o])&&(n=s(t,e,n)||n);return n&&Ws(t,e,n),n};const tr=class extends w{constructor(){super(...arguments),this.vertical=!1,this.color="#bcf124",this._colorInput=xt(),this._textInput=xt(),this.onValueChange=new Event("input"),this.onOpacityInput=t=>{const e=t.target;this.opacity=e.value,this.dispatchEvent(this.onValueChange)}}set value(t){const{color:e,opacity:r}=t;this.color=e,r&&(this.opacity=r)}get value(){const t={color:this.color};return this.opacity&&(t.opacity=this.opacity),t}onColorInput(t){t.stopPropagation();const{value:e}=this._colorInput;e&&(this.color=e.value,this.dispatchEvent(this.onValueChange))}onTextInput(t){t.stopPropagation();const{value:e}=this._textInput;if(!e)return;const{value:r}=e;let n=r.replace(/[^a-fA-F0-9]/g,"");n.startsWith("#")||(n=`#${n}`),e.value=n.slice(0,7),e.value.length===7&&(this.color=e.value,this.dispatchEvent(this.onValueChange))}focus(){const{value:t}=this._colorInput;t&&t.click()}render(){return m`
t in i?Pr(i,t,{enumerable:!0,configurab style="display: flex; align-items: center; gap: .375rem; height: 100%; flex: 1; padding: 0 0.5rem;" > t in i?Pr(i,t,{enumerable:!0,configurab style="background-color: ${this.color}" >
t in i?Pr(i,t,{enumerable:!0,configurab bim-number-input { flex-grow: 0; } - `;let bt=tr;zt([u({type:String,reflect:!0})],bt.prototype,"name");zt([u({type:String,reflect:!0})],bt.prototype,"label");zt([u({type:String,reflect:!0})],bt.prototype,"icon");zt([u({type:Boolean,reflect:!0})],bt.prototype,"vertical");zt([u({type:Number,reflect:!0})],bt.prototype,"opacity");zt([u({type:String,reflect:!0})],bt.prototype,"color");const Ys=E` + `;let dt=tr;zt([u({type:String,reflect:!0})],dt.prototype,"name");zt([u({type:String,reflect:!0})],dt.prototype,"label");zt([u({type:String,reflect:!0})],dt.prototype,"icon");zt([u({type:Boolean,reflect:!0})],dt.prototype,"vertical");zt([u({type:Number,reflect:!0})],dt.prototype,"opacity");zt([u({type:String,reflect:!0})],dt.prototype,"color");const Ys=E` ::-webkit-scrollbar { width: 0.4rem; height: 0.4rem; @@ -463,7 +457,7 @@ var Pr=Object.defineProperty,jr=(i,t,e)=>t in i?Pr(i,t,{enumerable:!0,configurab --bim-ui_bg-contrast-100: var(--bim-ui_gray-0); --bim-ui_accent-base: #6528d7; } -`,mt={scrollbar:Ys,globalStyles:Qs};var Gs=Object.defineProperty,Js=Object.getOwnPropertyDescriptor,Xs=(i,t,e,r)=>{for(var n=Js(t,e),o=i.length-1,s;o>=0;o--)(s=i[o])&&(n=s(t,e,n)||n);return n&&Gs(t,e,n),n};const er=class extends w{constructor(){super(...arguments),this._visible=!1,this._middleware={name:"middleware",async fn(t){const{right:e,top:r}=await oi(t);return t.x-=Math.sign(e)===1?e+5:0,t.y-=Math.sign(r)===1?r+5:0,t}}}get visible(){return this._visible}set visible(t){this._visible=t,t&&this.updatePosition()}async updatePosition(t){const e=t||this.parentNode;if(!e){this.visible=!1,console.warn("No target element found for context-menu.");return}const r=await $n(e,this,{placement:"right",middleware:[hn(10),wn(),xn(),_n({padding:5}),this._middleware]}),{x:n,y:o}=r;this.style.left=`${n}px`,this.style.top=`${o}px`}render(){return m` `}};er.styles=[mt.scrollbar,E` +`,pt={scrollbar:Ys,globalStyles:Qs};var Gs=Object.defineProperty,Js=Object.getOwnPropertyDescriptor,Xs=(i,t,e,r)=>{for(var n=Js(t,e),o=i.length-1,s;o>=0;o--)(s=i[o])&&(n=s(t,e,n)||n);return n&&Gs(t,e,n),n};const er=class extends w{constructor(){super(...arguments),this._visible=!1,this._middleware={name:"middleware",async fn(t){const{right:e,top:r}=await oi(t);return t.x-=Math.sign(e)===1?e+5:0,t.y-=Math.sign(r)===1?r+5:0,t}}}get visible(){return this._visible}set visible(t){this._visible=t,t&&this.updatePosition()}async updatePosition(t){const e=t||this.parentNode;if(!e){this.visible=!1,console.warn("No target element found for context-menu.");return}const r=await $n(e,this,{placement:"right",middleware:[hn(10),wn(),xn(),_n({padding:5}),this._middleware]}),{x:n,y:o}=r;this.style.left=`${n}px`,this.style.top=`${o}px`}render(){return m` `}};er.styles=[pt.scrollbar,E` :host { --bim-label--fz: var(--bim-ui_size-xs); position: absolute; @@ -490,7 +484,7 @@ var Pr=Object.defineProperty,jr=(i,t,e)=>t in i?Pr(i,t,{enumerable:!0,configurab :host(:not([visible])) { display: none; } - `];let ir=er;Xs([u({type:Boolean,reflect:!0})],ir.prototype,"visible");class Ks extends w{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 r of t)this.elements.add(r);const e=t.slice(this.ELEMENTS_BEFORE_OBSERVER);for(const r of e)r.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(e=>{const r=e[0];if(!r.isIntersecting)return;const n=r.target;t.unobserve(n);const o=this.ELEMENTS_BEFORE_OBSERVER+this.visibleElements.length,s=[...this.elements][o];s&&(this.visibleElements=[...this.visibleElements,s],t.observe(s))},{threshold:.5});return t}observeLastElement(){const t=this.getLazyObserver();if(!t)return;const e=this.ELEMENTS_BEFORE_OBSERVER+this.visibleElements.length-1,r=[...this.elements][e];r&&t.observe(r)}resetVisibleElements(){const t=this.getLazyObserver();if(t){for(const e of this.elements)t.unobserve(e);this.visibleElements=[],this.observeLastElement()}}static create(t,e){const r=document.createDocumentFragment();if(t.length===0)return Ot(t(),r),r.firstElementChild;if(!e)throw new Error("UIComponent: Initial state is required for statefull components.");let n=e;const o=t,s=l=>(n={...n,...l},Ot(o(n),r),n);return s(e),[r.firstElementChild,s]}}const Ae=(i,t=!0)=>{let e={};for(const r of i.children){const n=r,o=n.getAttribute("name")||n.getAttribute("label");if(o){if("value"in n){const s=n.value;if(typeof s=="object"&&!Array.isArray(s)&&Object.keys(s).length===0)continue;e[o]=n.value}else if(t){const s=Ae(n);if(Object.keys(s).length===0)continue;e[o]=s}}else t&&(e={...e,...Ae(n)})}return e},je=i=>i==="true"||i==="false"?i==="true":i&&!isNaN(Number(i))&&i.trim()!==""?Number(i):i,Zs=[">=","<=","=",">","<","?","/","#"];function nn(i){const t=Zs.find(s=>i.split(s).length===2),e=i.split(t).map(s=>s.trim()),[r,n]=e,o=n.startsWith("'")&&n.endsWith("'")?n.replace(/'/g,""):je(n);return{key:r,condition:t,value:o}}const ni=i=>{try{const t=[],e=i.split(/&(?![^()]*\))/).map(r=>r.trim());for(const r of e){const n=!r.startsWith("(")&&!r.endsWith(")"),o=r.startsWith("(")&&r.endsWith(")");if(n){const s=nn(r);t.push(s)}if(o){const s={operator:"&",queries:r.replace(/^(\()|(\))$/g,"").split("&").map(l=>l.trim()).map((l,a)=>{const c=nn(l);return a>0&&(c.operator="&"),c})};t.push(s)}}return t}catch{return null}},rn=(i,t,e)=>{let r=!1;switch(t){case"=":r=i===e;break;case"?":r=String(i).includes(String(e));break;case"<":(typeof i=="number"||typeof e=="number")&&(r=i":(typeof i=="number"||typeof e=="number")&&(r=i>e);break;case">=":(typeof i=="number"||typeof e=="number")&&(r=i>=e);break;case"/":r=String(i).startsWith(String(e));break}return r};var tl=Object.defineProperty,el=Object.getOwnPropertyDescriptor,ot=(i,t,e,r)=>{for(var n=r>1?void 0:r?el(t,e):t,o=i.length-1,s;o>=0;o--)(s=i[o])&&(n=(r?s(t,e,n):s(n))||n);return r&&n&&tl(t,e,n),n};const nr=class extends w{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?je(this.label):this.label}set value(t){this._value=t}render(){return m` + `];let ir=er;Xs([u({type:Boolean,reflect:!0})],ir.prototype,"visible");class Ks extends w{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 r of t)this.elements.add(r);const e=t.slice(this.ELEMENTS_BEFORE_OBSERVER);for(const r of e)r.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(e=>{const r=e[0];if(!r.isIntersecting)return;const n=r.target;t.unobserve(n);const o=this.ELEMENTS_BEFORE_OBSERVER+this.visibleElements.length,s=[...this.elements][o];s&&(this.visibleElements=[...this.visibleElements,s],t.observe(s))},{threshold:.5});return t}observeLastElement(){const t=this.getLazyObserver();if(!t)return;const e=this.ELEMENTS_BEFORE_OBSERVER+this.visibleElements.length-1,r=[...this.elements][e];r&&t.observe(r)}resetVisibleElements(){const t=this.getLazyObserver();if(t){for(const e of this.elements)t.unobserve(e);this.visibleElements=[],this.observeLastElement()}}static create(t,e){const r=document.createDocumentFragment();if(t.length===0)return Ot(t(),r),r.firstElementChild;if(!e)throw new Error("UIComponent: Initial state is required for statefull components.");let n=e;const o=t,s=l=>(n={...n,...l},Ot(o(n),r),n);return s(e),[r.firstElementChild,s]}}const Se=(i,t=!0)=>{let e={};for(const r of i.children){const n=r,o=n.getAttribute("name")||n.getAttribute("label");if(o){if("value"in n){const s=n.value;if(typeof s=="object"&&!Array.isArray(s)&&Object.keys(s).length===0)continue;e[o]=n.value}else if(t){const s=Se(n);if(Object.keys(s).length===0)continue;e[o]=s}}else t&&(e={...e,...Se(n)})}return e},je=i=>i==="true"||i==="false"?i==="true":i&&!isNaN(Number(i))&&i.trim()!==""?Number(i):i,Zs=[">=","<=","=",">","<","?","/","#"];function nn(i){const t=Zs.find(s=>i.split(s).length===2),e=i.split(t).map(s=>s.trim()),[r,n]=e,o=n.startsWith("'")&&n.endsWith("'")?n.replace(/'/g,""):je(n);return{key:r,condition:t,value:o}}const ni=i=>{try{const t=[],e=i.split(/&(?![^()]*\))/).map(r=>r.trim());for(const r of e){const n=!r.startsWith("(")&&!r.endsWith(")"),o=r.startsWith("(")&&r.endsWith(")");if(n){const s=nn(r);t.push(s)}if(o){const s={operator:"&",queries:r.replace(/^(\()|(\))$/g,"").split("&").map(l=>l.trim()).map((l,a)=>{const c=nn(l);return a>0&&(c.operator="&"),c})};t.push(s)}}return t}catch{return null}},rn=(i,t,e)=>{let r=!1;switch(t){case"=":r=i===e;break;case"?":r=String(i).includes(String(e));break;case"<":(typeof i=="number"||typeof e=="number")&&(r=i":(typeof i=="number"||typeof e=="number")&&(r=i>e);break;case">=":(typeof i=="number"||typeof e=="number")&&(r=i>=e);break;case"/":r=String(i).startsWith(String(e));break}return r};var tl=Object.defineProperty,el=Object.getOwnPropertyDescriptor,nt=(i,t,e,r)=>{for(var n=r>1?void 0:r?el(t,e):t,o=i.length-1,s;o>=0;o--)(s=i[o])&&(n=(r?s(t,e,n):s(n))||n);return r&&n&&tl(t,e,n),n};const nr=class extends w{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?je(this.label):this.label}set value(t){this._value=t}render(){return m`
${this.img||this.icon||this.label?m`
${this.checkbox&&!this.noMark?m`t in i?Pr(i,t,{enumerable:!0,configurab flex: 1; padding: 0rem 0.5rem; border-radius: var(--bim-ui_size-4xs); + transition: all 0.15s; } :host(:hover) { @@ -570,18 +565,14 @@ var Pr=Object.defineProperty,jr=(i,t,e)=>t in i?Pr(i,t,{enumerable:!0,configurab bim-label { pointer-events: none; } - `;let O=nr;ot([u({type:String,reflect:!0})],O.prototype,"img",2);ot([u({type:String,reflect:!0})],O.prototype,"label",2);ot([u({type:String,reflect:!0})],O.prototype,"icon",2);ot([u({type:Boolean,reflect:!0})],O.prototype,"checked",2);ot([u({type:Boolean,reflect:!0})],O.prototype,"checkbox",2);ot([u({type:Boolean,attribute:"no-mark",reflect:!0})],O.prototype,"noMark",2);ot([u({converter:{fromAttribute(i){return i&&je(i)}}})],O.prototype,"value",1);ot([u({type:Boolean,reflect:!0})],O.prototype,"vertical",2);var il=Object.defineProperty,nl=Object.getOwnPropertyDescriptor,st=(i,t,e,r)=>{for(var n=r>1?void 0:r?nl(t,e):t,o=i.length-1,s;o>=0;o--)(s=i[o])&&(n=(r?s(t,e,n):s(n))||n);return r&&n&&il(t,e,n),n};const rr=class extends Ks{constructor(){super(),this.multiple=!1,this.required=!1,this.vertical=!1,this._inputContainer=Z(),this._listElement=Z(),this._visible=!1,this._value=[],this.onValueChange=new Event("change"),this.onWindowMouseUp=t=>{this.visible&&(this.contains(t.target)||(this.visible=!1))},this.onOptionClick=t=>{const e=t.target,r=this._value.includes(e);if(!this.multiple&&!this.required&&!r)this._value=[e];else if(!this.multiple&&!this.required&&r)this._value=[];else if(!this.multiple&&this.required&&!r)this._value=[e];else if(this.multiple&&!this.required&&!r)this._value=[...this._value,e];else if(this.multiple&&!this.required&&r)this._value=this._value.filter(n=>n!==e);else if(this.multiple&&this.required&&!r)this._value=[...this._value,e];else if(this.multiple&&this.required&&r){const n=this._value.filter(o=>o!==e);n.length!==0&&(this._value=n)}this.updateOptionsState(),this.dispatchEvent(this.onValueChange)},this.useObserver=!0}set visible(t){this._visible=t,t||this.resetVisibleElements()}get visible(){return this._visible}set value(t){if(this.required&&Object.keys(t).length===0)return;const e=[];for(const r of t){const n=this.findOption(r);if(n&&(e.push(n),!this.multiple&&Object.keys(t).length>1))break}this._value=e,this.updateOptionsState(),this.dispatchEvent(this.onValueChange)}get value(){return this._value.filter(t=>t instanceof O&&t.checked).map(t=>t.value)}get _options(){const t=[...this.elements];for(const e of this.children)e instanceof O&&t.push(e);return t}onSlotChange(t){const e=t.target.assignedElements();this.observe(e);for(const r of e){if(!(r instanceof O)){r.remove();continue}r.removeEventListener("click",this.onOptionClick),r.addEventListener("click",this.onOptionClick)}}updateOptionsState(){for(const t of this._options)t instanceof O&&(this._value.includes(t)?t.checked=!0:t.checked=!1)}findOption(t){return this._options.find(e=>e instanceof O?e.label===t||e.value===t:!1)}connectedCallback(){super.connectedCallback(),window.addEventListener("mouseup",this.onWindowMouseUp)}firstUpdated(){for(const t of this.children)t instanceof O&&t.checked&&this._value.push(t)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("mouseup",this.onWindowMouseUp)}render(){let t,e,r;if(this._value.length===0)t="Select an option...";else if(this._value.length===1){const n=this._value[0];t=(n==null?void 0:n.label)||(n==null?void 0:n.value),e=n==null?void 0:n.img,r=n==null?void 0:n.icon}else t=`Multiple (${this._value.length})`;return m` + `;let O=nr;nt([u({type:String,reflect:!0})],O.prototype,"img",2);nt([u({type:String,reflect:!0})],O.prototype,"label",2);nt([u({type:String,reflect:!0})],O.prototype,"icon",2);nt([u({type:Boolean,reflect:!0})],O.prototype,"checked",2);nt([u({type:Boolean,reflect:!0})],O.prototype,"checkbox",2);nt([u({type:Boolean,attribute:"no-mark",reflect:!0})],O.prototype,"noMark",2);nt([u({converter:{fromAttribute(i){return i&&je(i)}}})],O.prototype,"value",1);nt([u({type:Boolean,reflect:!0})],O.prototype,"vertical",2);var il=Object.defineProperty,nl=Object.getOwnPropertyDescriptor,rt=(i,t,e,r)=>{for(var n=r>1?void 0:r?nl(t,e):t,o=i.length-1,s;o>=0;o--)(s=i[o])&&(n=(r?s(t,e,n):s(n))||n);return r&&n&&il(t,e,n),n};const rr=class extends Ks{constructor(){super(),this.multiple=!1,this.required=!1,this.vertical=!1,this._visible=!1,this._value=new Set,this.onValueChange=new Event("change"),this.onWindowMouseUp=t=>{this.visible&&(this.contains(t.target)||(this.visible=!1))},this.onOptionClick=t=>{const e=t.target,r=this._value.has(e);if(!this.multiple&&!this.required&&!r)this._value=new Set([e]);else if(!this.multiple&&!this.required&&r)this._value=new Set([]);else if(!this.multiple&&this.required&&!r)this._value=new Set([e]);else if(this.multiple&&!this.required&&!r)this._value=new Set([...this._value,e]);else if(this.multiple&&!this.required&&r){const n=[...this._value].filter(o=>o!==e);this._value=new Set(n)}else if(this.multiple&&this.required&&!r)this._value=new Set([...this._value,e]);else if(this.multiple&&this.required&&r){const n=[...this._value].filter(s=>s!==e),o=new Set(n);o.size!==0&&(this._value=o)}this.updateOptionsState(),this.dispatchEvent(this.onValueChange)},this.useObserver=!0}set visible(t){this._visible=t,t||this.resetVisibleElements()}get visible(){return this._visible}set value(t){if(this.required&&Object.keys(t).length===0)return;const e=new Set;for(const r of t){const n=this.findOption(r);if(n&&(e.add(n),!this.multiple&&Object.keys(t).length===1))break}this._value=e,this.updateOptionsState(),this.dispatchEvent(this.onValueChange)}get value(){return[...this._value].filter(t=>t instanceof O&&t.checked).map(t=>t.value)}get _options(){const t=new Set([...this.elements]);for(const e of this.children)e instanceof O&&t.add(e);return[...t]}onSlotChange(t){const e=t.target.assignedElements();this.observe(e);const r=new Set;for(const n of this.elements){if(!(n instanceof O)){n.remove();continue}n.checked&&r.add(n),n.removeEventListener("click",this.onOptionClick),n.addEventListener("click",this.onOptionClick)}this._value=r}updateOptionsState(){for(const t of this._options)t instanceof O&&(t.checked=this._value.has(t))}findOption(t){return this._options.find(e=>e instanceof O?e.label===t||e.value===t:!1)}connectedCallback(){super.connectedCallback(),window.addEventListener("mouseup",this.onWindowMouseUp)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("mouseup",this.onWindowMouseUp)}render(){let t,e,r;if(this._value.size===0)t="Select an option...";else if(this._value.size===1){const n=[...this._value][0];t=(n==null?void 0:n.label)||(n==null?void 0:n.value),e=n==null?void 0:n.img,r=n==null?void 0:n.icon}else t=`Multiple (${this._value.size})`;return m` -
this.visible=!this.visible} - > +
this.visible=!this.visible}> t in i?Pr(i,t,{enumerable:!0,configurab >${t} t in i?Pr(i,t,{enumerable:!0,configurab
- + ${this.visibleElements.map(n=>n)} - `}};rr.styles=[mt.scrollbar,E` + `}};rr.styles=[pt.scrollbar,E` :host { --bim-input--bgc: var( --bim-dropdown--bgc, var(--bim-ui_bg-contrast-20) ); - --bim-input--olw: var(--bim-dropdown--olw, 2px); - --bim-input--olc: var(--bim-dropdown--olc, transparent); - --bim-input--bdrs: var(--bim-dropdown--bdrs, var(--bim-ui_size-4xs)); + --bim-input--olw: 2px; + --bim-input--olc: transparent; + --bim-input--bdrs: var(--bim-ui_size-4xs); flex: 1; display: block; } :host([visible]) { - --bim-input--olc: var( - --bim-dropdown¡focus--c, - var(--bim-ui_accent-base) - ); + --bim-input--olc: var(--bim-ui_accent-base); } .input { @@ -643,7 +631,7 @@ var Pr=Object.defineProperty,jr=(i,t,e)=>t in i?Pr(i,t,{enumerable:!0,configurab bim-label { pointer-events: none; } - `];let Y=rr;st([u({type:String,reflect:!0})],Y.prototype,"name",2);st([u({type:String,reflect:!0})],Y.prototype,"icon",2);st([u({type:String,reflect:!0})],Y.prototype,"label",2);st([u({type:Boolean,reflect:!0})],Y.prototype,"multiple",2);st([u({type:Boolean,reflect:!0})],Y.prototype,"required",2);st([u({type:Boolean,reflect:!0})],Y.prototype,"vertical",2);st([u({type:Boolean,reflect:!0})],Y.prototype,"visible",1);st([ie()],Y.prototype,"_value",2);var rl=Object.defineProperty,or=(i,t,e,r)=>{for(var n=void 0,o=i.length-1,s;o>=0;o--)(s=i[o])&&(n=s(t,e,n)||n);return n&&rl(t,e,n),n};const sr=class extends w{constructor(){super(...arguments),this.floating=!1,this.layouts={}}getUniqueAreasFromTemplate(t){const e=t.split(` + `];let Y=rr;rt([u({type:String,reflect:!0})],Y.prototype,"name",2);rt([u({type:String,reflect:!0})],Y.prototype,"icon",2);rt([u({type:String,reflect:!0})],Y.prototype,"label",2);rt([u({type:Boolean,reflect:!0})],Y.prototype,"multiple",2);rt([u({type:Boolean,reflect:!0})],Y.prototype,"required",2);rt([u({type:Boolean,reflect:!0})],Y.prototype,"vertical",2);rt([u({type:Boolean,reflect:!0})],Y.prototype,"visible",1);rt([ie()],Y.prototype,"_value",2);var rl=Object.defineProperty,or=(i,t,e,r)=>{for(var n=void 0,o=i.length-1,s;o>=0;o--)(s=i[o])&&(n=s(t,e,n)||n);return n&&rl(t,e,n),n};const sr=class extends w{constructor(){super(...arguments),this.floating=!1,this.layouts={}}getUniqueAreasFromTemplate(t){const e=t.split(` `).map(r=>r.trim()).map(r=>r.split('"')[1]).filter(r=>r!==void 0).flatMap(r=>r.split(/\s+/));return[...new Set(e)].filter(r=>r!=="")}firstUpdated(){this._onLayoutChange=new Event("layoutchange")}render(){if(this.layout){if(this.layouts[this.layout]){this.innerHTML="";const t=this.layouts[this.layout],e=this.getUniqueAreasFromTemplate(t.template).map(r=>{const n=t.elements[r];return n&&(n.style.gridArea=r),n}).filter(r=>!!r);this.style.gridTemplate=t.template,this._onLayoutChange&&this.dispatchEvent(this._onLayoutChange),this.append(...e)}}else this.innerHTML="",this.style.gridTemplate="",this._onLayoutChange&&this.dispatchEvent(this._onLayoutChange);return m``}};sr.styles=E` :host { display: grid; @@ -685,6 +673,7 @@ var Pr=Object.defineProperty,jr=(i,t,e)=>t in i?Pr(i,t,{enumerable:!0,configurab height: var(--bim-icon--fz, var(--bim-ui_size-sm)); width: var(--bim-icon--fz, var(--bim-ui_size-sm)); color: var(--bim-icon--c); + transition: all 0.15s; } `,ri.properties={icon:{type:String}};let ol=ri;var sl=Object.defineProperty,Le=(i,t,e,r)=>{for(var n=void 0,o=i.length-1,s;o>=0;o--)(s=i[o])&&(n=s(t,e,n)||n);return n&&sl(t,e,n),n};const lr=class extends w{constructor(){super(...arguments),this.vertical=!1,this.onValueChange=new Event("change")}get value(){const t={};for(const e of this.children){const r=e;"value"in r?t[r.name||r.label]=r.value:"checked"in r&&(t[r.name||r.label]=r.checked)}return t}set value(t){const e=[...this.children];for(const r in t){const n=e.find(l=>{const a=l;return a.name===r||a.label===r});if(!n)continue;const o=n,s=t[r];typeof s=="boolean"?o.checked=s:o.value=s}}render(){return m`
@@ -730,6 +719,7 @@ var Pr=Object.defineProperty,jr=(i,t,e)=>t in i?Pr(i,t,{enumerable:!0,configurab outline: var(--bim-input--olw, 2px) solid var(--bim-input--olc, transparent); border-radius: var(--bim-input--bdrs, var(--bim-ui_size-4xs)); + transition: all 0.15s; } :host(:not([vertical])) .input { @@ -755,6 +745,7 @@ var Pr=Object.defineProperty,jr=(i,t,e)=>t in i?Pr(i,t,{enumerable:!0,configurab display: block; white-space: nowrap; line-height: 1.1rem; + transition: all 0.15s; } .parent { @@ -801,7 +792,7 @@ var Pr=Object.defineProperty,jr=(i,t,e)=>t in i?Pr(i,t,{enumerable:!0,configurab calc(var(--bim-label--fz, var(--bim-ui_size-xs)) * 4) ); } - `;let Pt=ar;le([u({type:String,reflect:!0})],Pt.prototype,"img");le([u({type:Boolean,attribute:"label-hidden",reflect:!0})],Pt.prototype,"labelHidden");le([u({type:String,reflect:!0})],Pt.prototype,"icon");le([u({type:Boolean,attribute:"icon-hidden",reflect:!0})],Pt.prototype,"iconHidden");le([u({type:Boolean,reflect:!0})],Pt.prototype,"vertical");var al=Object.defineProperty,cl=Object.getOwnPropertyDescriptor,R=(i,t,e,r)=>{for(var n=r>1?void 0:r?cl(t,e):t,o=i.length-1,s;o>=0;o--)(s=i[o])&&(n=(r?s(t,e,n):s(n))||n);return r&&n&&al(t,e,n),n};const cr=class extends w{constructor(){super(...arguments),this._value=0,this.vertical=!1,this.slider=!1,this._input=Z(),this.onValueChange=new Event("change")}set value(t){this.setValue(t.toString())}get value(){return this._value}onChange(t){t.stopPropagation();const{value:e}=this._input;e&&this.setValue(e.value)}setValue(t){const{value:e}=this._input;let r=t;if(r=r.replace(/[^0-9.-]/g,""),r=r.replace(/(\..*)\./g,"$1"),r.endsWith(".")||(r.lastIndexOf("-")>0&&(r=r[0]+r.substring(1).replace(/-/g,"")),r==="-"||r==="-0"))return;let n=Number(r);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,e&&(e.value=this.value.toString()),this.requestUpdate(),this.dispatchEvent(this.onValueChange)))}onBlur(){const{value:t}=this._input;t&&Number.isNaN(Number(t.value))&&(t.value=this.value.toString())}onSliderMouseDown(t){document.body.style.cursor="w-resize";const{clientX:e}=t,r=this.value;let n=!1;const o=a=>{var c;n=!0;const{clientX:h}=a,d=this.step??1,p=((c=d.toString().split(".")[1])==null?void 0:c.length)||0,b=1/(this.sensitivity??1),f=(h-e)/b;if(Math.floor(Math.abs(f))!==Math.abs(f))return;const v=r+f*d;this.setValue(v.toFixed(p))},s=()=>{this.slider=!0,this.removeEventListener("blur",s)},l=()=>{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",l)};document.addEventListener("mousemove",o),document.addEventListener("mouseup",l)}onFocus(t){t.stopPropagation();const e=r=>{r.key==="Escape"&&(this.blur(),window.removeEventListener("keydown",e))};window.addEventListener("keydown",e)}connectedCallback(){super.connectedCallback(),this.min&&this.min>this.value&&(this._value=this.min),this.max&&this.max{for(var n=r>1?void 0:r?cl(t,e):t,o=i.length-1,s;o>=0;o--)(s=i[o])&&(n=(r?s(t,e,n):s(n))||n);return r&&n&&al(t,e,n),n};const cr=class extends w{constructor(){super(...arguments),this._value=0,this.vertical=!1,this.slider=!1,this._input=xt(),this.onValueChange=new Event("change")}set value(t){this.setValue(t.toString())}get value(){return this._value}onChange(t){t.stopPropagation();const{value:e}=this._input;e&&this.setValue(e.value)}setValue(t){const{value:e}=this._input;let r=t;if(r=r.replace(/[^0-9.-]/g,""),r=r.replace(/(\..*)\./g,"$1"),r.endsWith(".")||(r.lastIndexOf("-")>0&&(r=r[0]+r.substring(1).replace(/-/g,"")),r==="-"||r==="-0"))return;let n=Number(r);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,e&&(e.value=this.value.toString()),this.requestUpdate(),this.dispatchEvent(this.onValueChange)))}onBlur(){const{value:t}=this._input;t&&Number.isNaN(Number(t.value))&&(t.value=this.value.toString())}onSliderMouseDown(t){document.body.style.cursor="w-resize";const{clientX:e}=t,r=this.value;let n=!1;const o=a=>{var c;n=!0;const{clientX:h}=a,d=this.step??1,p=((c=d.toString().split(".")[1])==null?void 0:c.length)||0,b=1/(this.sensitivity??1),f=(h-e)/b;if(Math.floor(Math.abs(f))!==Math.abs(f))return;const v=r+f*d;this.setValue(v.toFixed(p))},s=()=>{this.slider=!0,this.removeEventListener("blur",s)},l=()=>{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",l)};document.addEventListener("mousemove",o),document.addEventListener("mouseup",l)}onFocus(t){t.stopPropagation();const e=r=>{r.key==="Escape"&&(this.blur(),window.removeEventListener("keydown",e))};window.addEventListener("keydown",e)}connectedCallback(){super.connectedCallback(),this.min&&this.min>this.value&&(this._value=this.min),this.max&&this.maxt in i?Pr(i,t,{enumerable:!0,configurab >${this.pref}`:null} t in i?Pr(i,t,{enumerable:!0,configurab bim-label { pointer-events: none; } - `;let j=cr;R([u({type:String,reflect:!0})],j.prototype,"name",2);R([u({type:String,reflect:!0})],j.prototype,"icon",2);R([u({type:String,reflect:!0})],j.prototype,"label",2);R([u({type:String,reflect:!0})],j.prototype,"pref",2);R([u({type:Number,reflect:!0})],j.prototype,"min",2);R([u({type:Number,reflect:!0})],j.prototype,"value",1);R([u({type:Number,reflect:!0})],j.prototype,"step",2);R([u({type:Number,reflect:!0})],j.prototype,"sensitivity",2);R([u({type:Number,reflect:!0})],j.prototype,"max",2);R([u({type:String,reflect:!0})],j.prototype,"suffix",2);R([u({type:Boolean,reflect:!0})],j.prototype,"vertical",2);R([u({type:Boolean,reflect:!0})],j.prototype,"slider",2);var hl=Object.defineProperty,ul=Object.getOwnPropertyDescriptor,ae=(i,t,e,r)=>{for(var n=r>1?void 0:r?ul(t,e):t,o=i.length-1,s;o>=0;o--)(s=i[o])&&(n=(r?s(t,e,n):s(n))||n);return r&&n&&hl(t,e,n),n};const hr=class extends w{constructor(){super(...arguments),this.onValueChange=new Event("change"),this._hidden=!1,this.headerHidden=!1,this.activationButton=document.createElement("bim-button")}set hidden(t){this._hidden=t,this.activationButton.active=!t,this.dispatchEvent(new Event("hiddenchange"))}get hidden(){return this._hidden}get value(){return Ae(this)}set value(t){const e=[...this.children];for(const r in t){const n=e.find(s=>{const l=s;return l.name===r||l.label===r});if(!n)continue;const o=n;o.value=t[r]}}connectedCallback(){super.connectedCallback(),this.activationButton.active=!this.hidden,this.activationButton.onclick=()=>this.hidden=!this.hidden}disconnectedCallback(){super.disconnectedCallback(),this.activationButton.remove()}collapseSections(){const t=this.querySelectorAll("bim-panel-section");for(const e of t)e.collapsed=!0}expandSections(){const t=this.querySelectorAll("bim-panel-section");for(const e of t)e.collapsed=!1}render(){return this.activationButton.icon=this.icon,this.activationButton.label=this.label||this.name,this.activationButton.tooltipTitle=this.label||this.name,m` + `;let j=cr;R([u({type:String,reflect:!0})],j.prototype,"name",2);R([u({type:String,reflect:!0})],j.prototype,"icon",2);R([u({type:String,reflect:!0})],j.prototype,"label",2);R([u({type:String,reflect:!0})],j.prototype,"pref",2);R([u({type:Number,reflect:!0})],j.prototype,"min",2);R([u({type:Number,reflect:!0})],j.prototype,"value",1);R([u({type:Number,reflect:!0})],j.prototype,"step",2);R([u({type:Number,reflect:!0})],j.prototype,"sensitivity",2);R([u({type:Number,reflect:!0})],j.prototype,"max",2);R([u({type:String,reflect:!0})],j.prototype,"suffix",2);R([u({type:Boolean,reflect:!0})],j.prototype,"vertical",2);R([u({type:Boolean,reflect:!0})],j.prototype,"slider",2);var hl=Object.defineProperty,ul=Object.getOwnPropertyDescriptor,ae=(i,t,e,r)=>{for(var n=r>1?void 0:r?ul(t,e):t,o=i.length-1,s;o>=0;o--)(s=i[o])&&(n=(r?s(t,e,n):s(n))||n);return r&&n&&hl(t,e,n),n};const hr=class extends w{constructor(){super(...arguments),this.onValueChange=new Event("change"),this._hidden=!1,this.headerHidden=!1,this.activationButton=document.createElement("bim-button")}set hidden(t){this._hidden=t,this.activationButton.active=!t,this.dispatchEvent(new Event("hiddenchange"))}get hidden(){return this._hidden}get value(){return Se(this)}set value(t){const e=[...this.children];for(const r in t){const n=e.find(s=>{const l=s;return l.name===r||l.label===r});if(!n)continue;const o=n;o.value=t[r]}}connectedCallback(){super.connectedCallback(),this.activationButton.active=!this.hidden,this.activationButton.onclick=()=>this.hidden=!this.hidden}disconnectedCallback(){super.disconnectedCallback(),this.activationButton.remove()}collapseSections(){const t=this.querySelectorAll("bim-panel-section");for(const e of t)e.collapsed=!0}expandSections(){const t=this.querySelectorAll("bim-panel-section");for(const e of t)e.collapsed=!1}render(){return this.activationButton.icon=this.icon,this.activationButton.label=this.label||this.name,this.activationButton.tooltipTitle=this.label||this.name,m`
${this.label||this.name||this.icon?m`${this.label}`:null}
- `}};hr.styles=[mt.scrollbar,E` + `}};hr.styles=[pt.scrollbar,E` :host { display: flex; border-radius: var(--bim-ui_size-base); @@ -987,7 +978,7 @@ var Pr=Object.defineProperty,jr=(i,t,e)=>t in i?Pr(i,t,{enumerable:!0,configurab ::slotted(bim-panel-section:not(:last-child)) { border-bottom: 1px solid var(--bim-ui_bg-contrast-20); } - `];let jt=hr;ae([u({type:String,reflect:!0})],jt.prototype,"icon",2);ae([u({type:String,reflect:!0})],jt.prototype,"name",2);ae([u({type:String,reflect:!0})],jt.prototype,"label",2);ae([u({type:Boolean,reflect:!0})],jt.prototype,"hidden",1);ae([u({type:Boolean,attribute:"header-hidden",reflect:!0})],jt.prototype,"headerHidden",2);var dl=Object.defineProperty,ce=(i,t,e,r)=>{for(var n=void 0,o=i.length-1,s;o>=0;o--)(s=i[o])&&(n=s(t,e,n)||n);return n&&dl(t,e,n),n};const ur=class extends w{constructor(){super(...arguments),this.onValueChange=new Event("change")}get value(){return Ae(this)}set value(t){const e=[...this.children];for(const r in t){const n=e.find(s=>{const l=s;return l.name===r||l.label===r});if(!n)continue;const o=n;o.value=t[r]}}onHeaderClick(){this.fixed||(this.collapsed=!this.collapsed)}render(){const t=this.label||this.icon||this.name||this.fixed,e=m`{for(var n=void 0,o=i.length-1,s;o>=0;o--)(s=i[o])&&(n=s(t,e,n)||n);return n&&dl(t,e,n),n};const ur=class extends w{constructor(){super(...arguments),this.onValueChange=new Event("change")}get value(){return Se(this)}set value(t){const e=[...this.children];for(const r in t){const n=e.find(s=>{const l=s;return l.name===r||l.label===r});if(!n)continue;const o=n;o.value=t[r]}}onHeaderClick(){this.fixed||(this.collapsed=!this.collapsed)}render(){const t=this.label||this.icon||this.name||this.fixed,e=m`t in i?Pr(i,t,{enumerable:!0,configurab
- `}};ur.styles=[mt.scrollbar,E` + `}};ur.styles=[pt.scrollbar,E` :host { display: block; pointer-events: auto; @@ -1069,6 +1060,7 @@ var Pr=Object.defineProperty,jr=(i,t,e)=>t in i?Pr(i,t,{enumerable:!0,configurab :host(:not([fixed])[collapsed]) .components { display: none; + height: 0px; } bim-label { @@ -1226,7 +1218,7 @@ var Pr=Object.defineProperty,jr=(i,t,e)=>t in i?Pr(i,t,{enumerable:!0,configurab ${this.headersHidden?null:t}
${e}
- `}};_r.styles=[mt.scrollbar,E` + `}};_r.styles=[pt.scrollbar,E` :host { --bim-button--bgc: transparent; position: relative; @@ -1259,7 +1251,7 @@ var Pr=Object.defineProperty,jr=(i,t,e)=>t in i?Pr(i,t,{enumerable:!0,configurab flex-wrap: wrap; margin-bottom: 0.5rem; } - `];let ft=_r;Ht([ie()],ft.prototype,"_filteredData",2);Ht([u({type:Boolean,attribute:"headers-hidden",reflect:!0})],ft.prototype,"headersHidden",2);Ht([u({type:String,attribute:"min-col-width",reflect:!0})],ft.prototype,"minColWidth",2);Ht([u({type:Array,attribute:!1})],ft.prototype,"columns",1);Ht([u({type:Array,attribute:!1})],ft.prototype,"data",1);Ht([u({type:Boolean,reflect:!0})],ft.prototype,"expanded",2);var $l=Object.defineProperty,El=Object.getOwnPropertyDescriptor,Me=(i,t,e,r)=>{for(var n=r>1?void 0:r?El(t,e):t,o=i.length-1,s;o>=0;o--)(s=i[o])&&(n=(r?s(t,e,n):s(n))||n);return r&&n&&$l(t,e,n),n};const xr=class extends w{constructor(){super(...arguments),this._defaultName="__unnamed__",this.name=this._defaultName,this._hidden=!1}set hidden(t){this._hidden=t,this.dispatchEvent(new Event("hiddenchange"))}get hidden(){return this._hidden}connectedCallback(){super.connectedCallback();const{parentElement:t}=this;if(t&&this.name===this._defaultName){const e=[...t.children].indexOf(this);this.name=`${this._defaultName}${e}`}}render(){return m` `}};xr.styles=E` + `];let bt=_r;Ht([ie()],bt.prototype,"_filteredData",2);Ht([u({type:Boolean,attribute:"headers-hidden",reflect:!0})],bt.prototype,"headersHidden",2);Ht([u({type:String,attribute:"min-col-width",reflect:!0})],bt.prototype,"minColWidth",2);Ht([u({type:Array,attribute:!1})],bt.prototype,"columns",1);Ht([u({type:Array,attribute:!1})],bt.prototype,"data",1);Ht([u({type:Boolean,reflect:!0})],bt.prototype,"expanded",2);var $l=Object.defineProperty,El=Object.getOwnPropertyDescriptor,Me=(i,t,e,r)=>{for(var n=r>1?void 0:r?El(t,e):t,o=i.length-1,s;o>=0;o--)(s=i[o])&&(n=(r?s(t,e,n):s(n))||n);return r&&n&&$l(t,e,n),n};const xr=class extends w{constructor(){super(...arguments),this._defaultName="__unnamed__",this.name=this._defaultName,this._hidden=!1}set hidden(t){this._hidden=t,this.dispatchEvent(new Event("hiddenchange"))}get hidden(){return this._hidden}connectedCallback(){super.connectedCallback();const{parentElement:t}=this;if(t&&this.name===this._defaultName){const e=[...t.children].indexOf(this);this.name=`${this._defaultName}${e}`}}render(){return m` `}};xr.styles=E` :host { display: block; height: 100%; @@ -1268,14 +1260,14 @@ var Pr=Object.defineProperty,jr=(i,t,e)=>t in i?Pr(i,t,{enumerable:!0,configurab :host([hidden]) { display: none; } - `;let L=xr;Me([u({type:String,reflect:!0})],L.prototype,"name",2);Me([u({type:String,reflect:!0})],L.prototype,"label",2);Me([u({type:String,reflect:!0})],L.prototype,"icon",2);Me([u({type:Boolean,reflect:!0})],L.prototype,"hidden",1);var Cl=Object.defineProperty,Al=Object.getOwnPropertyDescriptor,Bt=(i,t,e,r)=>{for(var n=r>1?void 0:r?Al(t,e):t,o=i.length-1,s;o>=0;o--)(s=i[o])&&(n=(r?s(t,e,n):s(n))||n);return r&&n&&Cl(t,e,n),n};const wr=class extends w{constructor(){super(...arguments),this._switchers=[],this.bottom=!1,this.switchersHidden=!1,this.floating=!1,this.switchersFull=!1,this.onTabHiddenChange=t=>{const e=t.target;e instanceof L&&!e.hidden&&(e.removeEventListener("hiddenchange",this.onTabHiddenChange),this.tab=e.name,e.addEventListener("hiddenchange",this.onTabHiddenChange))}}set tab(t){this._tab=t;const e=[...this.children],r=e.find(n=>n instanceof L&&n.name===t);for(const n of e){if(!(n instanceof L))continue;n.hidden=r!==n;const o=this.getTabSwitcher(n.name);o&&o.toggleAttribute("data-active",!n.hidden)}}get tab(){return this._tab}getTabSwitcher(t){return this._switchers.find(e=>e.getAttribute("data-name")===t)}createSwitchers(){this._switchers=[];for(const t of this.children){if(!(t instanceof L))continue;const e=document.createElement("div");e.addEventListener("click",()=>{this.tab===t.name?this.toggleAttribute("tab",!1):this.tab=t.name}),e.setAttribute("data-name",t.name),e.className="switcher";const r=document.createElement("bim-label");r.textContent=t.label??"",r.icon=t.icon,e.append(r),this._switchers.push(e)}}onSlotChange(t){this.createSwitchers();const e=t.target.assignedElements(),r=e.find(n=>n instanceof L?this.tab?n.name===this.tab:!n.hidden:!1);r&&r instanceof L&&(this.tab=r.name);for(const n of e){if(!(n instanceof L)){n.remove();continue}n.removeEventListener("hiddenchange",this.onTabHiddenChange),r!==n&&(n.hidden=!0),n.addEventListener("hiddenchange",this.onTabHiddenChange)}}render(){return m` + `;let L=xr;Me([u({type:String,reflect:!0})],L.prototype,"name",2);Me([u({type:String,reflect:!0})],L.prototype,"label",2);Me([u({type:String,reflect:!0})],L.prototype,"icon",2);Me([u({type:Boolean,reflect:!0})],L.prototype,"hidden",1);var Cl=Object.defineProperty,Sl=Object.getOwnPropertyDescriptor,Bt=(i,t,e,r)=>{for(var n=r>1?void 0:r?Sl(t,e):t,o=i.length-1,s;o>=0;o--)(s=i[o])&&(n=(r?s(t,e,n):s(n))||n);return r&&n&&Cl(t,e,n),n};const wr=class extends w{constructor(){super(...arguments),this._switchers=[],this.bottom=!1,this.switchersHidden=!1,this.floating=!1,this.switchersFull=!1,this.onTabHiddenChange=t=>{const e=t.target;e instanceof L&&!e.hidden&&(e.removeEventListener("hiddenchange",this.onTabHiddenChange),this.tab=e.name,e.addEventListener("hiddenchange",this.onTabHiddenChange))}}set tab(t){this._tab=t;const e=[...this.children],r=e.find(n=>n instanceof L&&n.name===t);for(const n of e){if(!(n instanceof L))continue;n.hidden=r!==n;const o=this.getTabSwitcher(n.name);o&&o.toggleAttribute("data-active",!n.hidden)}}get tab(){return this._tab}getTabSwitcher(t){return this._switchers.find(e=>e.getAttribute("data-name")===t)}createSwitchers(){this._switchers=[];for(const t of this.children){if(!(t instanceof L))continue;const e=document.createElement("div");e.addEventListener("click",()=>{this.tab===t.name?this.toggleAttribute("tab",!1):this.tab=t.name}),e.setAttribute("data-name",t.name),e.className="switcher";const r=document.createElement("bim-label");r.textContent=t.label??"",r.icon=t.icon,e.append(r),this._switchers.push(e)}}onSlotChange(t){this.createSwitchers();const e=t.target.assignedElements(),r=e.find(n=>n instanceof L?this.tab?n.name===this.tab:!n.hidden:!1);r&&r instanceof L&&(this.tab=r.name);for(const n of e){if(!(n instanceof L)){n.remove();continue}n.removeEventListener("hiddenchange",this.onTabHiddenChange),r!==n&&(n.hidden=!0),n.addEventListener("hiddenchange",this.onTabHiddenChange)}}render(){return m`
${this._switchers}
- `}};wr.styles=[mt.scrollbar,E` + `}};wr.styles=[pt.scrollbar,E` * { box-sizing: border-box; } @@ -1311,6 +1303,7 @@ var Pr=Object.defineProperty,jr=(i,t,e)=>t in i?Pr(i,t,{enumerable:!0,configurab padding: 0rem 0.75rem; display: flex; justify-content: center; + transition: all 0.15s; } :host([switchers-full]) .switcher { @@ -1385,11 +1378,11 @@ var Pr=Object.defineProperty,jr=(i,t,e)=>t in i?Pr(i,t,{enumerable:!0,configurab border-radius: var(--bim-ui_size-2xs); background-color: var(--bim-ui_bg-base); } - `];let gt=wr;Bt([ie()],gt.prototype,"_switchers",2);Bt([u({type:Boolean,reflect:!0})],gt.prototype,"bottom",2);Bt([u({type:Boolean,attribute:"switchers-hidden",reflect:!0})],gt.prototype,"switchersHidden",2);Bt([u({type:Boolean,reflect:!0})],gt.prototype,"floating",2);Bt([u({type:String,reflect:!0})],gt.prototype,"tab",1);Bt([u({type:Boolean,attribute:"switchers-full",reflect:!0})],gt.prototype,"switchersFull",2);/** + `];let mt=wr;Bt([ie()],mt.prototype,"_switchers",2);Bt([u({type:Boolean,reflect:!0})],mt.prototype,"bottom",2);Bt([u({type:Boolean,attribute:"switchers-hidden",reflect:!0})],mt.prototype,"switchersHidden",2);Bt([u({type:Boolean,reflect:!0})],mt.prototype,"floating",2);Bt([u({type:String,reflect:!0})],mt.prototype,"tab",1);Bt([u({type:Boolean,attribute:"switchers-full",reflect:!0})],mt.prototype,"switchersFull",2);/** * @license * Copyright 2018 Google LLC * SPDX-License-Identifier: BSD-3-Clause - */const kl=i=>i??S;var Sl=Object.defineProperty,Ol=Object.getOwnPropertyDescriptor,lt=(i,t,e,r)=>{for(var n=r>1?void 0:r?Ol(t,e):t,o=i.length-1,s;o>=0;o--)(s=i[o])&&(n=(r?s(t,e,n):s(n))||n);return r&&n&&Sl(t,e,n),n};const $r=class extends w{constructor(){super(...arguments),this._inputTypes=["date","datetime-local","email","month","password","search","tel","text","time","url","week"],this.value="",this.vertical=!1,this._type="text",this.onValueChange=new Event("input")}set type(t){this._inputTypes.includes(t)&&(this._type=t)}get type(){return this._type}get query(){return ni(this.value)}onInputChange(t){t.stopPropagation();const e=t.target;clearTimeout(this._debounceTimeoutID),this._debounceTimeoutID=setTimeout(()=>{this.value=e.value,this.dispatchEvent(this.onValueChange)},this.debounce)}focus(){setTimeout(()=>{var t;const e=(t=this.shadowRoot)==null?void 0:t.querySelector("input");e==null||e.focus()})}render(){return m` + */const kl=i=>i??A;var Al=Object.defineProperty,Ol=Object.getOwnPropertyDescriptor,ot=(i,t,e,r)=>{for(var n=r>1?void 0:r?Ol(t,e):t,o=i.length-1,s;o>=0;o--)(s=i[o])&&(n=(r?s(t,e,n):s(n))||n);return r&&n&&Al(t,e,n),n};const $r=class extends w{constructor(){super(...arguments),this._inputTypes=["date","datetime-local","email","month","password","search","tel","text","time","url","week"],this.value="",this.vertical=!1,this._type="text",this.onValueChange=new Event("input")}set type(t){this._inputTypes.includes(t)&&(this._type=t)}get type(){return this._type}get query(){return ni(this.value)}onInputChange(t){t.stopPropagation();const e=t.target;clearTimeout(this._debounceTimeoutID),this._debounceTimeoutID=setTimeout(()=>{this.value=e.value,this.dispatchEvent(this.onValueChange)},this.debounce)}focus(){setTimeout(()=>{var t;const e=(t=this.shadowRoot)==null?void 0:t.querySelector("input");e==null||e.focus()})}render(){return m` t in i?Pr(i,t,{enumerable:!0,configurab /* :host([disabled]) { --bim-input--bgc: var(--bim-ui_bg-contrast-20); } */ - `;let Q=$r;lt([u({type:String,reflect:!0})],Q.prototype,"icon",2);lt([u({type:String,reflect:!0})],Q.prototype,"label",2);lt([u({type:String,reflect:!0})],Q.prototype,"name",2);lt([u({type:String,reflect:!0})],Q.prototype,"placeholder",2);lt([u({type:String,reflect:!0})],Q.prototype,"value",2);lt([u({type:Boolean,reflect:!0})],Q.prototype,"vertical",2);lt([u({type:Number,reflect:!0})],Q.prototype,"debounce",2);lt([u({type:String,reflect:!0})],Q.prototype,"type",1);var Tl=Object.defineProperty,zl=Object.getOwnPropertyDescriptor,Er=(i,t,e,r)=>{for(var n=r>1?void 0:r?zl(t,e):t,o=i.length-1,s;o>=0;o--)(s=i[o])&&(n=(r?s(t,e,n):s(n))||n);return r&&n&&Tl(t,e,n),n};const Cr=class extends w{constructor(){super(...arguments),this.rows=2,this._vertical=!1}set vertical(t){this._vertical=t,this.updateChildren()}get vertical(){return this._vertical}updateChildren(){const t=this.children;for(const e of t)this.vertical?e.setAttribute("label-hidden",""):e.removeAttribute("label-hidden")}render(){return m` + `;let Q=$r;ot([u({type:String,reflect:!0})],Q.prototype,"icon",2);ot([u({type:String,reflect:!0})],Q.prototype,"label",2);ot([u({type:String,reflect:!0})],Q.prototype,"name",2);ot([u({type:String,reflect:!0})],Q.prototype,"placeholder",2);ot([u({type:String,reflect:!0})],Q.prototype,"value",2);ot([u({type:Boolean,reflect:!0})],Q.prototype,"vertical",2);ot([u({type:Number,reflect:!0})],Q.prototype,"debounce",2);ot([u({type:String,reflect:!0})],Q.prototype,"type",1);var Tl=Object.defineProperty,zl=Object.getOwnPropertyDescriptor,Er=(i,t,e,r)=>{for(var n=r>1?void 0:r?zl(t,e):t,o=i.length-1,s;o>=0;o--)(s=i[o])&&(n=(r?s(t,e,n):s(n))||n);return r&&n&&Tl(t,e,n),n};const Cr=class extends w{constructor(){super(...arguments),this.rows=2,this._vertical=!1}set vertical(t){this._vertical=t,this.updateChildren()}get vertical(){return this._vertical}updateChildren(){const t=this.children;for(const e of t)this.vertical?e.setAttribute("label-hidden",""):e.removeAttribute("label-hidden")}render(){return m`