1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="2b0d15c3-85ba-4dd7-9851-db930d5855ac",e._sentryDebugIdIdentifier="sentry-dbid-2b0d15c3-85ba-4dd7-9851-db930d5855ac")}catch(e){}}();"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1650],{51650:function(e,t,n){n.r(t),n.d(t,{default:function(){return o}});var r=n(57437),i=n(2265),a=n(68092);function o(e){var t;let{url:o,file:g,opts:m,syncing:p,stats:b,onRows:w,onStats:y,onError:v}=e,x=(0,i.useRef)(null),I=(0,i.useRef)(null),M=(0,i.useRef)({onRows:w,onStats:y,onError:v});M.current={onRows:w,onStats:y,onError:v};let A=null!==(t=null==g?void 0:g.size)&&void 0!==t?t:0;return(0,i.useEffect)(()=>{let e=!1,t=()=>{};return(async()=>{var r,i,g,m;let p;let w=x.current;if(!w)return;let y=t=>{var n,r;e||null===(n=(r=M.current).onError)||void 0===n||n.call(r,t)};if(A>262144e3){y("This model is ".concat(f(A)," and the viewer stops at ").concat(f(262144e3),". ")+"An IFC is parsed entirely inside this tab's memory, which a browser caps near 2 GB, so a file this size takes the tab down instead of opening. Export one storey, one discipline or a coordination view from your BIM tool and it will open here.");return}let v=document.createElement("div");v.style.cssText="position:absolute;left:0;right:0;bottom:0;z-index:2;padding:11px 15px;pointer-events:none;font-size:12.5px;letter-spacing:-.01em;color:var(--ink-2,rgba(243,244,249,.62));background:linear-gradient(to top,rgba(8,9,15,.88),rgba(8,9,15,0))",v.textContent="Reading fileâ¦",w.appendChild(v);let S=e=>{v.textContent=e},C=()=>{v.parentNode&&v.parentNode.removeChild(v)};t=C;try{p=await s(o,A,262144e3,e=>S("Reading⦠".concat(f(e))))}catch(e){C(),y("This file could not be read.");return}if(e)return;if(!p){C(),y("This model is larger than ".concat(f(262144e3),", which is where the viewer stops. ")+"Export one storey or one discipline from your BIM tool and it will open here.");return}let B=await Promise.all([n.e(5870),n.e(6689)]).then(n.bind(n,51448)),{OrbitControls:z}=await Promise.all([n.e(5870),n.e(2691)]).then(n.bind(n,2691)),D=await n.e(1289).then(n.bind(n,66547));if(e)return;let E=null,G=-1,R=!1,k=()=>{if(!R&&E){R=!0;try{G>=0&&E.CloseModel(G)}catch(e){}try{E.Dispose()}catch(e){}E=null}};t=()=>{C(),k()};let T=[],F=new Map,P=new Map,L=0,N=0,O="IFC";try{if((E=new D.IfcAPI).SetWasmPath("/wasm/",!0),await E.Init(void 0,!0),e){k();return}if(S(p.byteLength>41943040?"Parsing ".concat(f(p.byteLength),"⦠a model this size takes a minute"):"Parsing ".concat(f(p.byteLength),"â¦")),await d(),(G=E.OpenModel(p,{COORDINATE_TO_ORIGIN:!0}))<0){k(),C(),y("This does not look like a valid IFC file, or its schema is one web-ifc cannot read.");return}if(e){k();return}p=new Uint8Array(0),O=String(E.GetModelSchema(G)||"IFC");let t=[];try{let e=E.GetLineIDsWithType(G,D.IFCPRODUCT,!0);for(let n=0;n<e.size();n++)t.push(e.get(n))}catch(e){}let n=e=>{let t=e.geometries,n=t.size();n&&L++;for(let e=0;e<n;e++){let n=t.get(e),r=n.geometryExpressID;if(P.has(r)||P.set(r,function(e,t,n,r){let i=null;try{i=t.GetGeometry(n,r);let a=t.GetVertexArray(i.GetVertexData(),i.GetVertexDataSize()),o=t.GetIndexArray(i.GetIndexData(),i.GetIndexDataSize());if(!a.length||!o.length)return null;let l=new e.InterleavedBuffer(a,6),s=new e.BufferGeometry;return s.setAttribute("position",new e.InterleavedBufferAttribute(l,3,0)),s.setAttribute("normal",new e.InterleavedBufferAttribute(l,3,3)),s.setIndex(new e.BufferAttribute(o,1)),s}catch(e){return null}finally{try{var a;null==i||null===(a=i.delete)||void 0===a||a.call(i)}catch(e){}}}(B,E,G,r)),!P.get(r))continue;let i=n.color,a=[i.x,i.y,i.z,i.w],o=r+"|"+c(a),l=F.get(o);l||(l={geomID:r,colour:a,mats:[]},F.set(o,l));let s=n.flatTransformation;for(let e=0;e<16;e++)l.mats.push(s[e])}};if(t.length){for(let r=0;r<t.length;r+=300)if(E.StreamMeshes(G,t.slice(r,r+300),n),S("Building geometry⦠".concat(u(Math.min(r+300,t.length))," of ").concat(u(t.length)," elements")),await d(),e){k(),l(P,T);return}}else S("Building geometryâ¦"),await d(),E.StreamAllMeshes(G,n)}catch(e){k(),l(P,T),C(),y("This IFC could not be parsed. It may be truncated, or written to a schema web-ifc does not support.");return}k();let _=new B.Group;_.rotation.x=-Math.PI/2;let W=new Map,U=new B.Box3,H=new B.Matrix4,V=0;
1if(F.forEach(e=>{let t=P.get(e.geomID),n=e.mats.length/16;if(!t||!n)return;let r=c(e.colour),i=W.get(r);if(!i){let t=e.colour[3];i=new B.MeshLambertMaterial({color:new B.Color().setRGB(e.colour[0],e.colour[1],e.colour[2],B.SRGBColorSpace),side:B.DoubleSide,transparent:t<1,opacity:t,depthWrite:t>=1}),W.set(r,i),T.push(i)}let a=new B.InstancedMesh(t,i,n);for(let t=0;t<n;t++)H.fromArray(e.mats,16*t),a.setMatrixAt(t,H);a.instanceMatrix.needsUpdate=!0,a.computeBoundingBox(),a.boundingBox&&U.union(a.boundingBox),a.renderOrder=e.colour[3]<1?1:0,_.add(a);let o=t.getIndex();V+=(o?o.count:t.attributes.position.count)/3*n,N+=t.attributes.position.count*n}),!_.children.length){l(P,T),C(),y("This IFC parsed, but it contains no geometry â it may be a property-only or reference file.");return}let j=new B.WebGLRenderer({antialias:!0,alpha:!1,preserveDrawingBuffer:!0});j.setPixelRatio(Math.min(devicePixelRatio,2)),j.setSize(w.clientWidth,w.clientHeight),w.appendChild(j.domElement);let q=new B.Scene;q.add(new B.HemisphereLight(16777215,4477030,2.1));let J=new B.DirectionalLight(16777215,1.5);J.position.set(1,2,1.4),q.add(J);let K=new B.DirectionalLight(16777215,.7);K.position.set(-1.4,.6,-1),q.add(K);let Q=new B.PerspectiveCamera(45,w.clientWidth/w.clientHeight,.01,5e3),X=new z(Q,j.domElement);X.enableDamping=!0,X.dampingFactor=.08;let Y=new B.GridHelper(10,20,6514417,2764613);Y.material.transparent=!0,Y.material.opacity=.35,q.add(Y);let Z=U.getSize(new B.Vector3),$=U.getCenter(new B.Vector3);_.position.set(-$.x,-$.z,$.y),q.add(_);let ee=Z.z,et=Math.max(Z.x,Z.y,Z.z)||1;Q.position.set(1.1*et,.75*et,1.3*et),Q.near=et/500,Q.far=100*et,Q.updateProjectionMatrix(),X.target.set(0,0,0),X.update(),Y.scale.setScalar(et/5),Y.position.y=-ee/2,C(),null===(r=(i=M.current).onRows)||void 0===r||r.call(i,[{label:b.schema,value:O},{label:b.elements,value:u(L)},{label:b.triangles,value:u(Math.round(V))},{label:b.size,value:"".concat(h(Z.x)," \xd7 ").concat(h(Z.y)," \xd7 ").concat(h(Z.z)," m")}]),null===(g=(m=M.current).onStats)||void 0===g||g.call(m,{meshes:_.children.length,triangles:Math.round(V),vertices:N,materials:W.size,size:[Z.x,Z.y,Z.z]});let en=Math.random(),er=0;X.addEventListener("change",()=>{var e;(null===(e=I.current)||void 0===e?void 0:e.syncing)&&(a.m.kind="ifc",a.m.owner=en,a.m.orbit=JSON.stringify({p:Q.position.toArray(),t:X.target.toArray()}),a.m.v++)});let ei=new ResizeObserver(()=>{w.clientWidth&&(Q.aspect=w.clientWidth/w.clientHeight,Q.updateProjectionMatrix(),j.setSize(w.clientWidth,w.clientHeight))});ei.observe(w);let ea=0,eo=null,el=!1,es=()=>{ea=requestAnimationFrame(es);let e=I.current||{};if(e.syncing&&"ifc"===a.m.kind&&a.m.v!==er&&a.m.owner!==en){er=a.m.v;try{let e=JSON.parse(a.m.orbit);Q.position.fromArray(e.p),X.target.fromArray(e.t)}catch(e){}}X.autoRotate=!!e.autoRotate&&!e.syncing,X.autoRotateSpeed=1.2,Y.visible=!!e.grid,e.bgImage&&e.bgImage!==eo?(eo=e.bgImage,new B.TextureLoader().load(e.bgImage,t=>{t.colorSpace=B.SRGBColorSpace,eo===e.bgImage&&(q.background=t)})):e.bgImage||(eo=null,q.background=new B.Color(e.bg||"#0B0D14")),!!e.wireframe!==el&&(el=!!e.wireframe,T.forEach(e=>{e.wireframe=el})),X.update(),j.render(q,Q)};ea=requestAnimationFrame(es),t=()=>{var e,t;cancelAnimationFrame(ea),ei.disconnect(),X.dispose(),k(),C(),l(P,T),null===(t=q.background)||void 0===t||null===(e=t.dispose)||void 0===e||e.call(t),j.dispose(),j.domElement.parentNode===w&&w.removeChild(j.domElement)}})(),()=>{e=!0,t()}},[o,A]),I.current={...m,syncing:p},(0,r.jsx)("div",{ref:x,className:"tv-three",style:{position:"relative"}})}function l(e,t){e.forEach(e=>{var t;return null==e?void 0:null===(t=e.dispose)||void 0===t?void 0:t.call(e)}),e.clear(),t.forEach(e=>{var t;return null==e?void 0:null===(t=e.dispose)||void 0===t?void 0:t.call(e)}),t.length=0}async function s(e,t,n,r){var i,a;let o=await fetch(e);if(!o.ok)throw Error("fetch failed");let l=t||Number(o.headers.get("content-length"))||0,s=null===(a=o.body)||void 0===a?void 0:null===(i=a.getReader)||void 0===i?void 0:i.call(a);if(!s){let e=new Uint8Array(await o.arrayBuffer());return e.byteLength>n?null:e}let d=l?new Uint8Array(l):null,c=[],u=0,h=0;for(;;){let e=await s.read();if(e.done)break;let t=e.value;if(d&&u+t.length<=d.length?d.set(t,u):c.push(t),(u+=t.length)>n)return await s.cancel(),null;u-h>4194304&&(h=u,r(u))}if(d&&!c.length)return u===d.length?d:d.subarray(0,u);let f=new Uint8Array(u),g=0;d&&(f.set(d.subarray(0,Math.min(d.length,u))),g=Math.min(d.length,u));for(let e=0;e<c.length;e++)f.set(c[e],g),g+=c[e].length;return f}function d(){return new Promise(e=>{requestAnimationFrame(()=>setTimeout(e,0))})}function c(e){return Math.round(255*e[0])+","+Math.round(255*e[1])+","+Math.round(255*e[2])+","+Math.round(100*e[3])}
1function u(e){return Math.round(e).toLocaleString("en-US")}function h(e){return e>=100?Math.round(e).toString():e.toFixed(e>=10?1:2)}function f(e){return e>=1073741824?(e/1024/1024/1024).toFixed(1)+" GB":Math.round(e/1024/1024)+" MB"}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.