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AAQC,IAAI,wDAAyDyB,GAErEA,EAAQoD,SAASnB,EAAIkB,UAAUlE,IAAI,SAC5Be,CACT,C,mJCtLO,IAAMqD,EAAN,MAWLC,YAAoBC,GAAA,KAAAA,WAAAA,EATb,KAAAC,eAAgC,IAAI,IAEpC,KAAAC,gBAA2B,aAC3B,KAAAC,WAAoB,oBAG3B,KAAAC,oBAAsCC,EACtC,KAAAC,wBAAsCD,CAEe,CAErDE,SAASC,GACV,IACCzF,QAAQC,IAAI,6CAA8CwF,EAAOC,WACjEC,KAAKR,gBAAkBM,EAAOC,UAC9BC,KAAKV,WAAWW,WAAWH,EAAOC,WAClC,IAAIG,EAAMF,KAAKV,WAAWa,qBACrBD,EAKJF,KAAKP,WAAaS,EAAIE,gBAJtB/F,QAAQC,IAAI,kBAAmB0F,KAAKV,WAAWe,UAC/ChG,QAAQiG,MAAM,wBACdN,KAAKP,WAAa,2B,CAIlB,SACDpF,QAAQC,IAAI,M,CAEZ,CACA2B,iBAAmB5B,QAAQC,IAAI,qCAAuC,GA9B3D8E,E,mUAAc,EAD1B,EAAAmB,W,kIAYiC,OAXrBnB,E","sources":["webpack://client-app/./src/app/project/ifc-fun/openbim-testbed.scss","webpack://client-app/./src/app/project/ifc-fun/openbim-testbed.html","webpack://client-app/./src/app/project/ifc-fun/openbim-hover.ts","webpack://client-app/./src/app/project/ifc-fun/openbim-initcontainer.ts","webpack://client-app/./src/app/project/ifc-fun/openbim-testbed.ts"],"sourcesContent":["// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \"router-view{display:flex;flex-direction:column;height:100vh;border:0px purple solid;background:gray}.whynogeneralcontainerclass2{height:calc(100vh - 4em);overflow:hidden}.openbim-testbed-class{background:pink;border:0px red solid}#container{height:100%;border:0px blue solid}#model-revision-container{position:relative;left:632px;top:-425px;width:50%}\", \"\",{\"version\":3,\"sources\":[\"webpack://./src/app/project/ifc-fun/openbim-testbed.scss\"],\"names\":[],\"mappings\":\"AAKA,YACC,YAAA,CACA,qBAAA,CACA,YAAA,CACA,uBAAA,CACA,eAAA,CAsBD,6BACC,wBAAA,CACG,eAAA,CAGJ,uBACC,eAAA,CACA,oBAAA,CAWD,WACC,WAAA,CACA,qBAAA,CAGD,0BACC,iBAAA,CAAA,UAAA,CAAA,UAAA,CACA,SAAA\",\"sourcesContent\":[\"@import \\\"/src/resources/customized-styles/variables.scss\\\";\\r\\n\\r\\n//$debug-border: 3px;\\r\\n$debug-border: 0px;\\r\\n\\r\\nrouter-view {\\r\\n\\tdisplay: flex;\\r\\n\\tflex-direction: column;\\r\\n\\theight: 100vh; \\r\\n\\tborder: $debug-border purple solid;\\r\\n\\tbackground: gray;\\r\\n}\\r\\n\\r\\n/* I finally figured out the problems here:\\r\\n(1) Our class item openbim-testbed-class - which is also the no-general-container -\\r\\nis the 'all the rest of the page' box, below the fixed toolbar-header.\\r\\n It must be statically/fixed-sized with the 'calc 100-headerHeight' technique.\\r\\nSo, mixing or trying to control that with any other technique, causes trouble.\\r\\n\\r\\n(2) the component element, is a weird pseudo-element, not a proper display-element.\\r\\nSo we shouldn't try to style or size it. If we do, it behaves weirdly (it doesn't have an ordinary 'boxed layout'.)\\r\\n\\r\\n(3) Once all the wrong stuff has been cleared away, the actual container-div must have height set as 100%,\\r\\nto not get a 150px-high default-canvas.\\r\\n\\r\\nApart from that, the openBim toolbars style-layout themselves a bit weirdly,\\r\\nhighlighting that we haven't fully understood how to use them correctly.\\r\\n\\r\\nSome of the problems we triggered before, caused the 'rest-of-the-page' element to become higher\\r\\nthan the container that was supposed to hold it!\\r\\n*/\\r\\n\\r\\n.whynogeneralcontainerclass2 { \\t\\r\\n\\theight: calc(100vh - $top-bar-height);\\r\\n overflow: hidden;\\r\\n} // TL;DR: Don't try to size this as a flex-item (ie with simple flex-rules.)\\r\\n\\r\\n.openbim-testbed-class { \\r\\n\\tbackground: pink;\\r\\n\\tborder: $debug-border red solid;\\r\\n} \\r\\n\\r\\n// TL;DR: Don't try to style the aurelia-container , unless you have a very wellunderstood reason why that would do any good.. - it probably won't :-)\\r\\n//openbim-container {\\r\\n\\t//height: 50%; //100%; \\r\\n\\t//width: 500px;\\r\\n\\t//border: 3px lime solid;\\t \\r\\n\\t// HVIS vi taender for saadan en border, laver den aandssvage ting..\\r\\n\\t// der er nok noget display-ish der er funky for den component.\\r\\n//}\\r\\n#container { \\r\\n\\theight: 100%; // seems to be required, otherwise you get the default 150px high canvas.\\r\\n\\tborder: $debug-border blue solid;\\t \\r\\n} \\r\\n\\r\\n#model-revision-container {\\r\\n\\tposition: relative; left: 632px; top: -425px;\\r\\n\\twidth:50%;\\r\\n}\\r\\n\\r\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","module.exports = \"\\r\\n\\r\\n\";","// openbim-hover:\r\n\r\nimport * as THREE from \"three\"; // ALSO: npm i --save-dev @types/three\r\nimport * as OBC from \"openbim-components\"; \r\n\r\nexport function isMeshType(object?: THREE.Object3D): object is THREE.Mesh { return object?.type === 'Mesh'; }\r\nconst okTypes:{} = {Mesh:1,Group:1}; //const okTypes:string[] = ['Mesh','Group'];\r\n\r\nfunction filterMeshes_Costly(meshes_really_obj3Ds: THREE.Object3D[]):THREE.Object3D[] {\r\n let outs:THREE.Object3D[] = [];\r\n let nonMeshes:number=0;\r\n let info = '';\r\n for (let m of meshes_really_obj3Ds) {\r\n if (m.type in okTypes) { // (x.includes() works for array, but in should be faster.) //!isMeshType(m)) { // e.g. lights, cameras, etc.\r\n outs.push(m);\r\n } else {\r\n ++nonMeshes; //const err = 'ouch,its not a mesh:'; //console.error(err,m.type, m);//throw err;\r\n info += m.type;\r\n }\r\n }\r\n // TMI: console.log('ignoring',nonMeshes,'out of', meshes_really_obj3Ds.length, info);\r\n return outs; //meshes_really_obj3Ds;\r\n}\r\n\r\nfunction getMeshes_COSTLY(comp:OBC.Components):THREE.Mesh[] { //THREE.Object3D\r\n // https://stackoverflow.com/questions/53230986/three-js-object3d-missing-ismesh-material-and-geometry-properties\r\n\t// FIXME: A flaw in doing it this way, does not intrinsically guard us against non-mesh 3dObjs.\r\n\tconst THREE_scene:THREE.Scene = comp.scene.get();\r\n\tlet meshes_really_obj3Ds:THREE.Object3D[] = THREE_scene.children;\r\n meshes_really_obj3Ds = filterMeshes_Costly(meshes_really_obj3Ds);\r\n\treturn meshes_really_obj3Ds;\r\n}\r\n\r\nexport function initHover_RayCaster(comp:OBC.Components):void {\t//, meshes_:THREE.Mesh[]\r\n\t/* Todo: the hover-UI should probably NOT act\r\n\twhen mouse is held for camera nav.\r\n\t */\r\n\r\n\t/* the raycaster currently registers directly on WINDOW, NOT on container.\r\n\tI wonder if there is any trade-off in registering it on container instead?\r\n\t*/\r\n\t/* JG: This is a 'raw' approach that works directly on THREE.JS entities. That is, it has no OBC/IFC knowledge - as I understand it.\r\n\t */\r\n\t//////////////////////////// RayCaster highlight.\r\n\t// https://docs.thatopen.com/Tutorials/SimpleRaycaster\r\n\tconsole.log('initSelection_RayCaster', comp);\r\n\r\n\t// todo, how can we get transparency?\r\n\tconst hiliteMat = new THREE.MeshStandardMaterial({color: '#BCF124'});\r\n\tlet prevHitMesh:THREE.Mesh; //THREE.Object3D;\r\n\tlet prevMat:THREE.Material|THREE.Material[]; // oh how I hate the attitude of structural typing.\r\n\twindow.onmousemove = () => {\r\n\t\t// FIXME - eventually we don't want to costly acquire meshes, so better to 'observe' them \r\n\t\t// and keep a 'shadow' list of current meshes.\r\n\t\t// That is, we would recalc the shadow-mesh-list each time we change the available meshes(revisions/models).\r\n\t\tconst meshes:THREE.Mesh[] = getMeshes_COSTLY(comp);\r\n\t\tconst hit_INTERSECTION:THREE.Intersection | null = comp.raycaster.castRay(meshes); \r\n\t\tif (prevHitMesh) { prevHitMesh.material = prevMat; } // (restore original material.)\r\n\t\tif (!hit_INTERSECTION) { return; }\r\n\r\n\t\t// Issue: Intersection.object has the base-type Object3D,\r\n\t\t// but _in practice_, it has a derived type which WILL (?) have a material property.\r\n\t\t// So, right now, we can't 'see' that Object3D will have a field 'material'.\r\n\t\t// Apparently, the type is really THREE.Mesh.\r\n\t\tconst hit_INTERSECTION_object:THREE.Mesh = hit_INTERSECTION.object; \r\n\t\t// FIXME, we should guard against hit_INTERSECTION_object NOT being a mesh! If it is not a mesh, we should not 'play'.\r\n\r\n\t\t// for monday! const bla1 = hit_INTERSECTION_object.id;\r\n\t\t// for monday! const bla2 = hit_INTERSECTION_object.uuid;\r\n\r\n\t\tprevHitMesh = hit_INTERSECTION_object; // (remember original mesh so we can restore it.) \r\n\t\tprevMat = hit_INTERSECTION_object.material; // (remember original mat so we can restore it.)\r\n\t\thit_INTERSECTION_object.material = hiliteMat; // (beware - if hit is not really a MESH, the .material property is not there!)\r\n\r\n\t\t/* Todo: from this OpenBim adapter,\r\n\t\twe would need to ?? something with class EntityIdFinderService and ??\r\n\t\twe should probably emit a new 'AjourInternal' 'element-strokedHovered', to connect up to previous catenda-handler.\r\n\t\t */\r\n\t}\r\n\t// FIXME: We should guard against this handler, EITHER never being installed twice, OR being uninstalled before being added again.\r\n}\r\n\r\n//////////////////////////// end RayCaster highlight.\r\n","import * as THREE from \"three\"; // ALSO: npm i --save-dev @types/three\r\nimport * as OBC from \"openbim-components\"; \r\nimport { FragmentsGroup} from 'bim-fragment'; \r\nimport { IUniform } from \"three\";\r\nimport Stats from \"stats.js\";\r\n\r\n//type UniformsMapType = { [uniform: string]: IUniform };\r\ninterface ShaderMat_UniformsMap { [uniform: string]: IUniform }\r\n\r\nlet ix=0;\r\n\r\nfunction fixFPS(stats:Stats) {\r\n\tlet found=false;\r\n\tfor (const c of document.body.children) {\r\n\t\tif (c == stats.dom) { found=true;break;}\r\n\t}\r\n\tif (!found) {\r\n\t\tdocument.body.append(stats.dom);\r\n\t\tconsole.log('readding stats.', ++ix);\r\n\t}\r\n\t//const body = document.body;\r\n\t//const children = body.children;\r\n\t//const len = children.length;\r\n}\r\nfunction fixIt(stats:Stats) {\r\n\t//stats.dom.style.background = 'red';\r\n\t//stats.dom.innerHTML = 'BOB';\r\n\tconst elm1:HTMLCanvasElement = stats.dom.children[0];\r\n\telm1.style.display = 'inline-block';\r\n\tconst elm2:HTMLCanvasElement = stats.dom.children[1];\r\n\telm2.style.display = 'inline-block';\r\n}\r\nfunction addFPSCounter(components:OBC.Components) {\r\n\t// https://github.com/IFCjs/components/blob/main/src/core/SimpleScene/index.html\r\n\tconst stats = new Stats();\r\n\tstats.showPanel(2);\r\n\tdocument.body.append(stats.dom);\r\n\tstats.dom.style.left = '0px';\r\n\tconsole.log('we added fps!');\r\n\tfixIt(stats);\r\n\r\n\tconst renderer2 = components.renderer;\r\n\trenderer2.onBeforeUpdate.add(() => stats.begin());\r\n\trenderer2.onAfterUpdate.add(() => {\r\n\t\tstats.end();\r\n\t\t//fixIt(stats);\r\n\t});\t\r\n}\r\n\r\n\r\n\r\nexport function openbimFlag_EG_OutlineEnabled():boolean { \r\n\t// If this causes problems, disable the this hack again by returning TRUE.\r\n\treturn false; \r\n}\r\n\r\n\r\nlet ofCourseTrue:boolean = true;\r\n\r\nexport async function init_OpenBimComponents(container:HTMLElement, fancyExtras:boolean, FPS_Counter:boolean):Promise {\r\n\t// view-source:https://ifcjs.github.io/components/src/ui/UIManager/index.html\r\n //const container = document.getElementById('container')!; // Get the
element where the scene will be displayed\r\n\tconsole.log('OBC init run, container:', container);\r\n\tconst comp:OBC.Components = new OBC.Components(); // Initialize the basic components needed to use this library\r\n\r\n\r\n\t// onBeforeUpdate on renderer?\r\n\r\n\tconst OBC_scene1 = new OBC.SimpleScene(comp);\r\n\tcomp.scene = OBC_scene1; // 1\r\n\r\n\tlet postProductionRenderer:OBC.PostproductionRenderer|undefined;\r\n\tif (!ofCourseTrue) { //fancyExtras) { // NB - not an option when we want selection/hover.\r\n\t comp.renderer = new OBC.SimpleRenderer(comp, container); // 2 \r\n\t} else {\r\n\t\tpostProductionRenderer = new OBC.PostproductionRenderer(comp, container); // 2 \r\n\t\tcomp.renderer = postProductionRenderer;\t\r\n\t}\r\n\r\n\tcomp.camera = new OBC.SimpleCamera(comp); // 3\r\n\tcomp.raycaster = new OBC.SimpleRaycaster(comp); // 4\r\n\r\n\t// does it help FPS if we turn that off?\r\n\tif (openbimFlag_EG_OutlineEnabled()) { postProductionRenderer!.postproduction.enabled = true; } // (Kan åbenbart først gøres, når camera er på plads.) SKAL gøres pga. fragmentHighlighter krav.\r\n\tcomp.init();\r\n\r\n\tconst THREE_scene:THREE.Scene = comp.scene.get();\r\n\r\n\t//THREE_scene.background = new THREE.Color('lime');\r\n\r\n\t// if (fancyExtras && !ofCourseTrue) { await activateQOL_Grid(comp); } // seems to 'cost' about 10-FPS.\r\n\r\n //addRedDemoBox(THREE_scene, comp);\r\n\r\n\t//if (ofCourseTrue || fancyExtras) { addMyOwnLights(THREE_scene); } // not needed because of scene.setup() \r\n\r\n\tOBC_scene1.setup(); //comp.scene.setup(); // would add default lights. \r\n\r\n\tif (FPS_Counter) { addFPSCounter(comp); }\r\n\treturn comp;\r\n}\r\n\r\nasync function activateQOL_Grid(comp:OBC.Components) {\r\n\tconst grid:OBC.SimpleGrid = comp.tools.get(OBC.SimpleGrid); // actually this INSTANTIATES it!\r\n\ttryToExamineGrid_Issues(grid);\r\n}\r\n\r\nfunction tryToExamineGrid_Issues(grid: OBC.SimpleGrid) {\r\n\tconst mat:THREE.ShaderMaterial = grid.material;\r\n\tconst sm_uniforms:ShaderMat_UniformsMap = mat.uniforms;\r\n\tconsole.log('sm_uniforms:', sm_uniforms);\r\n\tif (sm_uniforms == undefined) {\r\n\t\tconsole.warn('initializing uniforms map on SimpleGrids THREE.ShaderMaterial because it is empty');\r\n\t\tmat.uniforms = {};\r\n\t}\r\n\t// we might use SimpleCamera.OnBeforeUpdate to inspect what is happening with the grid material?\r\n}\r\n\r\n\r\nfunction addRedDemoBox(THREE_scene:THREE.Scene, comp:OBC.Components) {\r\n\tconst boxGeom = new THREE.BoxGeometry(3,3,3); // Add some elements to the scene\r\n\tconst boxMat = new THREE.MeshStandardMaterial({ color: \"red\" });\r\n\tconst boxMesh = new THREE.Mesh(boxGeom, boxMat);\r\n\tboxMesh.position.set(0, 1.5, 0);\r\n\tTHREE_scene.add(boxMesh); \r\n\t// JG: Jeg fjerner den ene, fordi jeg tror ikke vi behoever den.\r\n\t//comp.meshes.push(boxMesh); // hvorfor er det nu, at det er en god ide at adde begge steder? \t\t\r\n}\r\n\r\nfunction addMyOwnLights(scene:THREE.Scene) { \r\n\tconsole.log('addMyOwnLights');\r\n\tconst light1 = new THREE.DirectionalLight('lightblue');\r\n\tlight1.position.set(5, 10, 3);\r\n\tlight1.intensity = 0.35;\r\n\tscene.add(light1);\r\n\tconst light2 = new THREE.AmbientLight('lightyellow');\r\n\tlight2.intensity = 0.75;\r\n\tscene.add(light2); \r\n}\r\n\r\n\r\n///////////////////////////////////////////////////////////////////////////////////\r\n\r\nexport async function add_a_default_fragment_on_startup(frag_url:string, components:OBC.Components,mgr:OBC.FragmentManager):Promise {\r\n\tconsole.log('inside add_a_default_fragment_on_startup');\r\n\tconst file = await fetch(frag_url); // 400k. // NO STATIC/leave out the static prefix!\r\n\tconst arrayBuffer = await file.arrayBuffer(); // returns type ArrayBuffer\r\n\tconst FRAGMENT_buffer = new Uint8Array(arrayBuffer); // convert ArrayBuffer to UI8A.\r\n \r\n\tconst model:FragmentsGroup = await mgr.load(FRAGMENT_buffer); // is really fragmentsGroup.\r\n \r\n\t// view-source:https://ifcjs.github.io/components/src/fragments/FragmentManager/index.html\r\n\t// Hmm, would the fragmentsManager.load above here actually display 3d model directly,\r\n\t// if we did not have the culler?\r\n\t\r\n\t// modelThroughCuller(components, model);\r\n\tconsole.log('add_a_default_fragment_on_startup, model:', model);\r\n\treturn model;\r\n}\r\n\r\n////////////////////////////////////////////////////////////////////////////////\r\n\r\nlet toolbar = undefined;\r\n\r\nexport function makeIfcLoader(comp:OBC.Components):OBC.FragmentIfcLoader {\r\n let fragmentIfcLoader = new OBC.FragmentIfcLoader(comp);\r\n fragmentIfcLoader.settings.wasm = { path: \"https://unpkg.com/web-ifc@0.0.46/\", absolute: true };\r\n return fragmentIfcLoader;\r\n}\r\n\r\nexport function init_IfcLoader_Toolbars(comp:OBC.Components, mgr:OBC.FragmentManager, fragmentIfcLoader:OBC.FragmentIfcLoader):OBC.Toolbar {\r\n // noget gaar galt med disse toolbars,\r\n // maaske er de der hvor revisions-UI vises?\r\n\r\n // https://top-docs.vercel.app/docs/Tutorials/FragmentIfcLoader\r\n //let fragmentIfcLoader = new OBC.FragmentIfcLoader(comp);\r\n //\r\n toolbar = new OBC.Toolbar(comp); //const \r\n comp.ui.addToolbar(toolbar);\r\n // \r\n const loadIfc_button:OBC.SimpleUIComponent = fragmentIfcLoader.uiElement.get(\"main\"); // (the 'primary' action of a tool is presumably named main)\r\n const loaderButton:OBC.Button = loadIfc_button;\r\n // why is there this mismatch between button and button?\r\n toolbar.addChild(loaderButton); //loadIfc_button); // what does it mean when we accept ...Button[] ?\r\n console.log('added fragmentIfcLoader-button to mainToolbar, tb is:', toolbar);\r\n\r\n toolbar.addChild(mgr.uiElement.get(\"main\"));\r\n return toolbar;\r\n}\r\n\r\n\r\n/////////////////////////////////////////////////////////////////////////////////\r\n","import {autoinject} from \"aurelia-framework\";\r\nimport { AppContextService } from \"app/services/app-context-service\";\r\nimport { OpenBimHandles } from \"./OpenBimHandles\";\r\n//import {EventAggregator} from \"aurelia-event-aggregator\";\r\n\r\n@autoinject\r\nexport class OpenbimTestbed { \r\n\r\n public openBimHandles:OpenBimHandles = new OpenBimHandles();\r\n\r\n public projectIdForMRP : string = 'no-prj-yet'; // arggh, binds to this!\r\n public orgIdForOB:string = 'obtb-no-orgId-yet';\r\n //public orgId:string = 'no-org-yet2';\r\n\r\n fileId_forBind:string|undefined = undefined; //'obtb-has-no-fileId';\r\n revisionId_forBind:string|undefined = undefined; //'obtb-has-no-revId';\r\n\r\n constructor(private appContext: AppContextService ) {} // private aggr: EventAggregator, \r\n \r\n activate(params:any) {\r\n\ttry {\r\n\t\tconsole.log('OpenbimTestbed.activate sets projectId to ', params.projectId);\r\n\t\tthis.projectIdForMRP = params.projectId; // because binds to it, sigh.\r\n\t\tthis.appContext.setProject(params.projectId);\r\n\t\tlet prj = this.appContext.getSelectedProject()!;\r\n\t\tif (!prj) {\r\n\t\t\tconsole.log('avail projects:', this.appContext.projects);\r\n\t\t\tconsole.error('no selected project!');\r\n\t\t\tthis.orgIdForOB = 'OBTB-gotNoOrgId_From_Prj';\r\n\t\t} else {\r\n\t\t\tthis.orgIdForOB = prj.ownerCompanyId; //orgId\r\n\t\t}\r\n\t} catch {\r\n\t\tconsole.log('wtf');\r\n\t}\r\n } // called first.\r\n async attached() { console.log('OpenbimTestbed attached is called.'); } // called second.\r\n} //end-class-OpenbimTestbed.\r\n"],"names":["___CSS_LOADER_EXPORT___","push","module","id","exports","okTypes","Mesh","Group","initHover_RayCaster","comp","console","log","hiliteMat","color","prevHitMesh","prevMat","window","onmousemove","meshes","meshes_really_obj3Ds","scene","get","children","outs","info","m","type","filterMeshes_Costly","getMeshes_COSTLY","hit_INTERSECTION","raycaster","castRay","material","hit_INTERSECTION_object","object","openbimFlag_EG_OutlineEnabled","toolbar","ofCourseTrue","async","init_OpenBimComponents","container","fancyExtras","FPS_Counter","OBC_scene1","postProductionRenderer","renderer","camera","init","setup","components","stats","showPanel","document","body","append","dom","style","left","display","fixIt","renderer2","onBeforeUpdate","add","begin","onAfterUpdate","end","addFPSCounter","add_a_default_fragment_on_startup","frag_url","mgr","file","fetch","arrayBuffer","FRAGMENT_buffer","Uint8Array","model","load","makeIfcLoader","fragmentIfcLoader","settings","wasm","path","absolute","init_IfcLoader_Toolbars","ui","addToolbar","loaderButton","uiElement","addChild","OpenbimTestbed","constructor","appContext","openBimHandles","projectIdForMRP","orgIdForOB","fileId_forBind","undefined","revisionId_forBind","activate","params","projectId","this","setProject","prj","getSelectedProject","ownerCompanyId","projects","error","autoinject"],"sourceRoot":""}