@roomle/web-sdk 2.30.0-alpha.2 → 2.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/{banana-for-scale-fb4951ea.nomodule.js → banana-for-scale-6039ec99.nomodule.js} +2 -2
- package/lib/{banana-for-scale-fb4951ea.nomodule.js.map → banana-for-scale-6039ec99.nomodule.js.map} +1 -1
- package/lib/{banana-for-scale-caefa555.js → banana-for-scale-e0f3ceb7.js} +2 -2
- package/lib/{banana-for-scale-caefa555.js.map → banana-for-scale-e0f3ceb7.js.map} +1 -1
- package/lib/{component-dimensioning-2b3aad3c.js → component-dimensioning-693bfa2f.js} +2 -2
- package/lib/component-dimensioning-693bfa2f.js.map +1 -0
- package/lib/{component-dimensioning-51012f2a.nomodule.js → component-dimensioning-a07c783b.nomodule.js} +2 -2
- package/lib/component-dimensioning-a07c783b.nomodule.js.map +1 -0
- package/lib/{configurator-568ac399.nomodule.js → configurator-82d6aac4.nomodule.js} +2 -2
- package/lib/{configurator-568ac399.nomodule.js.map → configurator-82d6aac4.nomodule.js.map} +1 -1
- package/lib/{configurator-4a6cd959.js → configurator-c8121d36.js} +2 -2
- package/lib/{configurator-4a6cd959.js.map → configurator-c8121d36.js.map} +1 -1
- package/lib/configurator-main-5578f7c1.js +2 -0
- package/lib/configurator-main-5578f7c1.js.map +1 -0
- package/lib/configurator-main.nomodule.js +1 -1
- package/lib/configurator-mesh-generator-202a8152.nomodule.js +2 -0
- package/lib/configurator-mesh-generator-202a8152.nomodule.js.map +1 -0
- package/lib/{configurator-mesh-generator-bca47a36.js → configurator-mesh-generator-31a1f944.js} +2 -2
- package/lib/configurator-mesh-generator-31a1f944.js.map +1 -0
- package/lib/{default-light-setting-9ffb3b37.js → default-light-setting-82c45035.js} +2 -2
- package/lib/default-light-setting-82c45035.js.map +1 -0
- package/lib/{default-light-setting-2f5fcf5a.nomodule.js → default-light-setting-f8d25c8f.nomodule.js} +2 -2
- package/lib/default-light-setting-f8d25c8f.nomodule.js.map +1 -0
- package/lib/definitions/common-core/src/cameracontrol/camera-control-3d.d.ts +0 -1
- package/lib/definitions/common-core/src/cameracontrol/camera-control.d.ts +1 -0
- package/lib/{dimensioning-helper-bf36f892.nomodule.js → dimensioning-helper-d3a04793.nomodule.js} +2 -2
- package/lib/dimensioning-helper-d3a04793.nomodule.js.map +1 -0
- package/lib/{dimensioning-helper-198c5160.js → dimensioning-helper-e6829ce0.js} +2 -2
- package/lib/dimensioning-helper-e6829ce0.js.map +1 -0
- package/lib/{glb-viewer-9b9ac401.nomodule.js → glb-viewer-15affc03.nomodule.js} +2 -2
- package/lib/{glb-viewer-9b9ac401.nomodule.js.map → glb-viewer-15affc03.nomodule.js.map} +1 -1
- package/lib/{glb-viewer-d59ab6cc.js → glb-viewer-7d23d927.js} +2 -2
- package/lib/{glb-viewer-d59ab6cc.js.map → glb-viewer-7d23d927.js.map} +1 -1
- package/lib/glb-viewer-main-52c3545c.js +2 -0
- package/lib/glb-viewer-main-52c3545c.js.map +1 -0
- package/lib/glb-viewer-main.nomodule.js +1 -1
- package/lib/image-renderer-6fc71da8.js +2 -0
- package/lib/{image-renderer-12af57ab.js.map → image-renderer-6fc71da8.js.map} +1 -1
- package/lib/image-renderer-c9c4c8f7.nomodule.js +2 -0
- package/lib/{image-renderer-845b2c5c.nomodule.js.map → image-renderer-c9c4c8f7.nomodule.js.map} +1 -1
- package/lib/legacy/{banana-for-scale-deade068.legacy.js → banana-for-scale-e8b915f1.legacy.js} +2 -2
- package/lib/legacy/{banana-for-scale-deade068.legacy.js.map → banana-for-scale-e8b915f1.legacy.js.map} +1 -1
- package/lib/legacy/{component-dimensioning-3a77c31c.legacy.js → component-dimensioning-48101456.legacy.js} +2 -2
- package/lib/legacy/component-dimensioning-48101456.legacy.js.map +1 -0
- package/lib/legacy/{configurator-9357ee51.legacy.js → configurator-680166a3.legacy.js} +2 -2
- package/lib/legacy/{configurator-9357ee51.legacy.js.map → configurator-680166a3.legacy.js.map} +1 -1
- package/lib/legacy/configurator-main.legacy.js +1 -1
- package/lib/legacy/{configurator-mesh-generator-acd369c8.legacy.js → configurator-mesh-generator-60b80890.legacy.js} +2 -2
- package/lib/legacy/configurator-mesh-generator-60b80890.legacy.js.map +1 -0
- package/lib/legacy/{default-light-setting-1962bfd5.legacy.js → default-light-setting-36654912.legacy.js} +2 -2
- package/lib/legacy/default-light-setting-36654912.legacy.js.map +1 -0
- package/lib/legacy/{dimensioning-helper-d3ee4356.legacy.js → dimensioning-helper-9f04bd0f.legacy.js} +2 -2
- package/lib/legacy/dimensioning-helper-9f04bd0f.legacy.js.map +1 -0
- package/lib/legacy/{glb-viewer-3bc2a0a2.legacy.js → glb-viewer-bb4c879c.legacy.js} +2 -2
- package/lib/legacy/{glb-viewer-3bc2a0a2.legacy.js.map → glb-viewer-bb4c879c.legacy.js.map} +1 -1
- package/lib/legacy/glb-viewer-main.legacy.js +1 -1
- package/lib/legacy/image-renderer-0dcc5d03.legacy.js +2 -0
- package/lib/legacy/{image-renderer-ab8f30f8.legacy.js.map → image-renderer-0dcc5d03.legacy.js.map} +1 -1
- package/lib/legacy/{material-viewer-975fc2c6.legacy.js → material-viewer-3e1c757c.legacy.js} +2 -2
- package/lib/legacy/material-viewer-3e1c757c.legacy.js.map +1 -0
- package/lib/legacy/material-viewer-main.legacy.js +1 -1
- package/lib/legacy/{mesh-generator-3a36e30e.legacy.js → mesh-generator-06dd33ab.legacy.js} +2 -2
- package/lib/legacy/mesh-generator-06dd33ab.legacy.js.map +1 -0
- package/lib/legacy/pixotron-5df83bdf.legacy.js +2 -0
- package/lib/legacy/{pixotron-d879cbb4.legacy.js.map → pixotron-5df83bdf.legacy.js.map} +1 -1
- package/lib/legacy/planner-6fcb9010.legacy.js +2 -0
- package/lib/legacy/{planner-a3578f70.legacy.js.map → planner-6fcb9010.legacy.js.map} +1 -1
- package/lib/legacy/planner-main.legacy.js +1 -1
- package/lib/legacy/rapi-access-3c63c74b.legacy.js +16 -0
- package/lib/legacy/{rapi-access-0564780f.legacy.js.map → rapi-access-3c63c74b.legacy.js.map} +1 -1
- package/lib/legacy/roomle-sdk.legacy.js +1 -1
- package/lib/legacy/{scene-manager-566f79ad.legacy.js → scene-manager-1943ea73.legacy.js} +2 -2
- package/lib/legacy/scene-manager-1943ea73.legacy.js.map +1 -0
- package/lib/legacy/static/{ConfiguratorKernel-9caa95838538c54f.js → ConfiguratorKernel-4ca6a302619d4901.js} +74 -74
- package/lib/legacy/static/ConfiguratorKernel-6713e1de96ef978c.wasm +0 -0
- package/lib/legacy/static/ConfiguratorKernelJs-48f878d7e377be5f.mem +0 -0
- package/lib/legacy/static/ConfiguratorKernelJs-df7e5e8c447ce141.js +143 -0
- package/lib/legacy/static/{RoomleCore-0cc69dbcd8b6156d.js → RoomleCore-0b27042fad1c1d39.js} +83 -83
- package/lib/legacy/static/RoomleCore-e855c1668e7e1763.wasm +0 -0
- package/lib/legacy/static/RoomleCoreJs-582f2f94cdd9aadc.js +151 -0
- package/lib/legacy/static/RoomleCoreJs-fe17a5f3a30cab74.mem +0 -0
- package/lib/legacy/static/shaders-2fc4ae2ed0253c51.json +1 -0
- package/lib/legacy/{stats-helper-fd09ffc7.legacy.js → stats-helper-bf66b858.legacy.js} +2 -2
- package/lib/legacy/{stats-helper-fd09ffc7.legacy.js.map → stats-helper-bf66b858.legacy.js.map} +1 -1
- package/lib/{material-viewer-dd26226c.nomodule.js → material-viewer-a13d25f9.nomodule.js} +2 -2
- package/lib/material-viewer-a13d25f9.nomodule.js.map +1 -0
- package/lib/{material-viewer-8a1d68a3.js → material-viewer-b38ac2ae.js} +2 -2
- package/lib/material-viewer-b38ac2ae.js.map +1 -0
- package/lib/material-viewer-main-01208f3e.js +2 -0
- package/lib/material-viewer-main-01208f3e.js.map +1 -0
- package/lib/material-viewer-main.nomodule.js +1 -1
- package/lib/{mesh-generator-5719ff3b.nomodule.js → mesh-generator-21da9a0f.nomodule.js} +2 -2
- package/lib/mesh-generator-21da9a0f.nomodule.js.map +1 -0
- package/lib/{mesh-generator-a1f7a1e1.js → mesh-generator-76bdc62e.js} +2 -2
- package/lib/mesh-generator-76bdc62e.js.map +1 -0
- package/lib/pixotron-102325cf.js +2 -0
- package/lib/{pixotron-353a4c63.js.map → pixotron-102325cf.js.map} +1 -1
- package/lib/pixotron-b9c572b1.nomodule.js +2 -0
- package/lib/{pixotron-03df3477.nomodule.js.map → pixotron-b9c572b1.nomodule.js.map} +1 -1
- package/lib/planner-714bb53f.nomodule.js +2 -0
- package/lib/{planner-4e699458.nomodule.js.map → planner-714bb53f.nomodule.js.map} +1 -1
- package/lib/planner-7825b896.js +2 -0
- package/lib/{planner-b5d0b1dd.js.map → planner-7825b896.js.map} +1 -1
- package/lib/planner-main-20affea9.js +2 -0
- package/lib/planner-main-20affea9.js.map +1 -0
- package/lib/planner-main.nomodule.js +1 -1
- package/lib/rapi-access-6aa6bee0.js +16 -0
- package/lib/{rapi-access-c14962f0.js.map → rapi-access-6aa6bee0.js.map} +1 -1
- package/lib/rapi-access-a4deb335.nomodule.js +16 -0
- package/lib/{rapi-access-d4ab24b0.nomodule.js.map → rapi-access-a4deb335.nomodule.js.map} +1 -1
- package/lib/{roomle-sdk-9cac6e58.js → roomle-sdk-b6d056a3.js} +2 -2
- package/lib/roomle-sdk-b6d056a3.js.map +1 -0
- package/lib/roomle-sdk.nomodule.js +1 -1
- package/lib/{scene-manager-7a14bed1.nomodule.js → scene-manager-65338406.nomodule.js} +2 -2
- package/lib/scene-manager-65338406.nomodule.js.map +1 -0
- package/lib/{scene-manager-ade91550.js → scene-manager-a0e9a847.js} +2 -2
- package/lib/scene-manager-a0e9a847.js.map +1 -0
- package/lib/static/ConfiguratorKernel-4ca6a302619d4901.js +1 -0
- package/lib/static/ConfiguratorKernel-4ca6a302619d4901.js.map +1 -0
- package/lib/static/ConfiguratorKernel-6713e1de96ef978c.wasm +0 -0
- package/lib/static/ConfiguratorKernelJs-48f878d7e377be5f.mem +0 -0
- package/lib/static/ConfiguratorKernelJs-df7e5e8c447ce141.js +143 -0
- package/lib/static/RoomleCore-0b27042fad1c1d39.js +1 -0
- package/lib/static/RoomleCore-0b27042fad1c1d39.js.map +1 -0
- package/lib/static/RoomleCore-e855c1668e7e1763.wasm +0 -0
- package/lib/static/RoomleCoreJs-582f2f94cdd9aadc.js +151 -0
- package/lib/static/RoomleCoreJs-fe17a5f3a30cab74.mem +0 -0
- package/lib/static/shaders-2fc4ae2ed0253c51.json +1 -0
- package/lib/{stats-helper-c99a0e36.nomodule.js → stats-helper-38be1e59.nomodule.js} +2 -2
- package/lib/{stats-helper-c99a0e36.nomodule.js.map → stats-helper-38be1e59.nomodule.js.map} +1 -1
- package/lib/{stats-helper-ad6c829b.js → stats-helper-3bba9132.js} +2 -2
- package/lib/{stats-helper-ad6c829b.js.map → stats-helper-3bba9132.js.map} +1 -1
- package/package.json +2 -2
- package/lib/component-dimensioning-2b3aad3c.js.map +0 -1
- package/lib/component-dimensioning-51012f2a.nomodule.js.map +0 -1
- package/lib/configurator-main-ec8f91d2.js +0 -2
- package/lib/configurator-main-ec8f91d2.js.map +0 -1
- package/lib/configurator-mesh-generator-63176adc.nomodule.js +0 -2
- package/lib/configurator-mesh-generator-63176adc.nomodule.js.map +0 -1
- package/lib/configurator-mesh-generator-bca47a36.js.map +0 -1
- package/lib/default-light-setting-2f5fcf5a.nomodule.js.map +0 -1
- package/lib/default-light-setting-9ffb3b37.js.map +0 -1
- package/lib/dimensioning-helper-198c5160.js.map +0 -1
- package/lib/dimensioning-helper-bf36f892.nomodule.js.map +0 -1
- package/lib/glb-viewer-main-de3955c1.js +0 -2
- package/lib/glb-viewer-main-de3955c1.js.map +0 -1
- package/lib/image-renderer-12af57ab.js +0 -2
- package/lib/image-renderer-845b2c5c.nomodule.js +0 -2
- package/lib/legacy/component-dimensioning-3a77c31c.legacy.js.map +0 -1
- package/lib/legacy/configurator-mesh-generator-acd369c8.legacy.js.map +0 -1
- package/lib/legacy/default-light-setting-1962bfd5.legacy.js.map +0 -1
- package/lib/legacy/dimensioning-helper-d3ee4356.legacy.js.map +0 -1
- package/lib/legacy/image-renderer-ab8f30f8.legacy.js +0 -2
- package/lib/legacy/material-viewer-975fc2c6.legacy.js.map +0 -1
- package/lib/legacy/mesh-generator-3a36e30e.legacy.js.map +0 -1
- package/lib/legacy/pixotron-d879cbb4.legacy.js +0 -2
- package/lib/legacy/planner-a3578f70.legacy.js +0 -2
- package/lib/legacy/rapi-access-0564780f.legacy.js +0 -16
- package/lib/legacy/scene-manager-566f79ad.legacy.js.map +0 -1
- package/lib/legacy/static/ConfiguratorKernel-3e4350b62d6ccb33.wasm +0 -0
- package/lib/legacy/static/ConfiguratorKernelJs-09c978f7fdbef284.js +0 -143
- package/lib/legacy/static/ConfiguratorKernelJs-d70d079649d7be16.mem +0 -0
- package/lib/legacy/static/RoomleCore-e255ef00e2f5451a.wasm +0 -0
- package/lib/legacy/static/RoomleCoreJs-a8fa921965a7d125.mem +0 -0
- package/lib/legacy/static/RoomleCoreJs-b092f47eed9a8777.js +0 -151
- package/lib/legacy/static/shaders-ac8930ba02e392fe.json +0 -1
- package/lib/material-viewer-8a1d68a3.js.map +0 -1
- package/lib/material-viewer-dd26226c.nomodule.js.map +0 -1
- package/lib/material-viewer-main-2fea9d74.js +0 -2
- package/lib/material-viewer-main-2fea9d74.js.map +0 -1
- package/lib/mesh-generator-5719ff3b.nomodule.js.map +0 -1
- package/lib/mesh-generator-a1f7a1e1.js.map +0 -1
- package/lib/pixotron-03df3477.nomodule.js +0 -2
- package/lib/pixotron-353a4c63.js +0 -2
- package/lib/planner-4e699458.nomodule.js +0 -2
- package/lib/planner-b5d0b1dd.js +0 -2
- package/lib/planner-main-3c7e6b62.js +0 -2
- package/lib/planner-main-3c7e6b62.js.map +0 -1
- package/lib/rapi-access-c14962f0.js +0 -16
- package/lib/rapi-access-d4ab24b0.nomodule.js +0 -16
- package/lib/roomle-sdk-9cac6e58.js.map +0 -1
- package/lib/scene-manager-7a14bed1.nomodule.js.map +0 -1
- package/lib/scene-manager-ade91550.js.map +0 -1
- package/lib/static/ConfiguratorKernel-3e4350b62d6ccb33.wasm +0 -0
- package/lib/static/ConfiguratorKernel-9caa95838538c54f.js +0 -1
- package/lib/static/ConfiguratorKernel-9caa95838538c54f.js.map +0 -1
- package/lib/static/ConfiguratorKernelJs-09c978f7fdbef284.js +0 -143
- package/lib/static/ConfiguratorKernelJs-d70d079649d7be16.mem +0 -0
- package/lib/static/RoomleCore-0cc69dbcd8b6156d.js +0 -1
- package/lib/static/RoomleCore-0cc69dbcd8b6156d.js.map +0 -1
- package/lib/static/RoomleCore-e255ef00e2f5451a.wasm +0 -0
- package/lib/static/RoomleCoreJs-a8fa921965a7d125.mem +0 -0
- package/lib/static/RoomleCoreJs-b092f47eed9a8777.js +0 -151
- package/lib/static/shaders-ac8930ba02e392fe.json +0 -1
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
System.register(["./rapi-access-0564780f.legacy.js","./main-thread-to-worker-4c02f179.legacy.js","./pixotron-d879cbb4.legacy.js","./default-light-setting-1962bfd5.legacy.js"],(function(e){var t,n,r,i,o,a,s,l,c,d,h,u,_,p,g,b,m,E,f,C,y,P,R,j,w,O,H,M,v;return{setters:[function(e){t=e.U,n=e.T,r=e.J,i=e.V,o=e.e,a=e.W,s=e.O,l=e.X,c=e.Q,d=e.Y,h=e.Z,u=e._,_=e.i,p=e.$,g=e.C,b=e.B,m=e.E,E=e.M,f=e.a0,C=e.s,y=e.j,P=e.a1,R=e.a2,j=e.t,w=e.h},function(e){O=e.f},function(e){H=e.E,M=e.L},function(e){v=e.D}],execute:function(){e("G","static/GLTFExporter-86edae059df3a219.js"),e("C",class extends t{constructor(e){super(e),this.onKernelIsReady=null,this.onComponentPositionsUpdated=null,this.onUpdateParameters=e=>{},this.onUpdatePossibleChildren=(e,t)=>{},this.onUpdatePrice=(e,t)=>{},this.onSelectionChange=(e,t,n,r)=>{},this.onSelectionCancel=()=>{},this.onPartListUpdate=(e,t)=>{},this.onBoundsUpdate=e=>{},this.onLoadConfiguration=()=>{},this.onConfigurationReady=(e,t,n)=>{},this.onOpenTag=e=>{},this.onOpenAddOns=()=>{},this.onClickOutside=()=>{},this.onNoDockingsAvailable=()=>{},this.onUiIntersectionChange=e=>{},this.onZoomChange=(e,t)=>{},this.onDimensionsVisibilityChange=e=>{},this.onErrorDueToOffline=e=>{},this.onError=e=>{},this.onDockingsPreviewRemoved=()=>{},this.onConfigurationHasChildren=e=>{},this.onTrackTiming=(e,t,n,r)=>{},this.onUserInitiatedDockDone=(e,t,n,r,i)=>{},this.onAddonPlusHover=()=>{},this.onAddonPlusHoverOff=()=>{},this.onAddonPlusShown=()=>{},this.onAddonPlusHidden=()=>{},this.onContentProblem=e=>{},this.onSyncStarted=()=>{},this.onSyncDone=()=>{},this.onOpenFloorMaterials=()=>{},this.onOpenPartList=()=>{},this.onComponentLoadError=(e,t)=>{},this.onConfigurationLoadError=()=>{},this.onChangeTypeChangeTag=e=>{},this.onRemoveTypeChangeTag=e=>{},this.onConfigurationLabelChange=(e,t,n)=>{},this.onMemoryCorruption=()=>{},this.onConfiguratorKernelIsReady=(e,t)=>{},this.onConfigurationSaved=e=>{},this.onCameraPositionChanges=()=>{},this.onHistoryChange=(e,t)=>{}}});class x{constructor(){this._promiseExecutors=[]}create(){return new Promise((e,t)=>{this._promiseExecutors.push({resolve:e,reject:t})})}resolve(e){return new Promise(t=>{this._promiseExecutors.forEach(t=>t.resolve(e)),this._promiseExecutors=[],t(e)})}reject(e){return new Promise((t,n)=>{this._promiseExecutors.forEach(t=>t.reject(e)),this._promiseExecutors=[],n(e)})}}class I extends class{constructor(e){this._coreReference=e.clone()}clearReference(){this._coreReference.delete(),this._coreReference=null}getKernelObject(){return this._coreReference}}{constructor(e){super(e),this._objectWaiter=new x;const t=n(e.getCenter());this._container=new THREE.Object3D,this._container.position.copy(t),this._boundingBox=this._generateBoundingBox(this.getSize(),e.customColor),r(this._boundingBox),this._container.add(this._boundingBox),2!==this.getPlanElement().getType().value&&(this._object=new THREE.Object3D,this._container.add(this._object))}getSize(){return this._object?(new THREE.Box3).setFromObject(this._object).getSize(new THREE.Vector3):new THREE.Vector3}update(){this._container.position.copy(n(this.getPlanElement().getCenter()))}getPosition(){return this._container.position}getRotation(){return this._container.rotation.y}getBounds(){let e=new THREE.Box3;return e.setFromObject(this._container),e}getBoundingBox(){return this._boundingBox}getPlanElement(){return this._coreReference}setObject(e){this._object=e,this._objectWaiter.resolve(e)}getObject(){return this._object}async getObjectAsync(){return this._object?Promise.resolve(this._object):this._objectWaiter.create()}addMesh(e){this._object.add(e),this.hidePreviewBox()}getMesh(e){if(!this._object||0===this._object.children.length)return null;const t=i(e,this.getPlanElement().getType());return this._object.children.find(e=>e.userData.material===t)}getContainer(){return this._container}getId(){return this.getPlanElement().getId()}clear(){o(this._container),this._selectionMesh&&o(this._selectionMesh)}hidePreviewBox(){this._container&&this._boundingBox&&(this._boundingBox.material=a())}_generateBoundingBox(e,t){e.addScalar(.01);let n=new THREE.BoxGeometry(e.x,e.y,e.z),r=new THREE.Color(s);t>0&&(r=l(t));let i=new THREE.MeshStandardMaterial({color:r,opacity:c,transparent:!0}),o=new THREE.Mesh(n,i);return o.name="bounding box",o.position.y=e.y/2,o.castShadow=!1,o.receiveShadow=!1,o.layers.set(5),o}select(){if(!this._selectionMesh){let e=new THREE.MeshStandardMaterial({color:this._primaryColor,opacity:c,transparent:!0});const t=n(this.getPlanElement().getCenter());this._selectionMesh=new THREE.Mesh(d(t,this.getSize()),e)}this._container.add(this._selectionMesh)}deselect(){this._selectionMesh&&this._container.remove(this._selectionMesh)}setPrimaryColor(e){this._primaryColor=e}}class T extends I{constructor(e){super(e),this._container.rotation.y=e.rotation}getPlanObject(){return this.getPlanElement()}getSize(){return h(this.getPlanObject().size)}update(){super.update(),this._container.rotation.y=this.getPlanObject().rotation}}class k extends T{constructor(e){super(e),this._container.name="Configurable "+this._container.name}addRootComponent(e){this.setObject(e),this._container.add(this.getObject())}getConfigurationRuntimeId(){return this.getPlanObject().getConfigurationRuntimeId()}}e("d",k);let L=e("c",(()=>{class e extends T{constructor(e){super(e),this._container.name="Static "+this._container.name}setRapiItem(e){return this._rapiItem?Promise.resolve():this._addStaticItem(e)}_addStaticItem(e){this._rapiItem=e;let t=this.getPlanObject();this._glbUrl=O(e),this._glbUrl;let n=e.scaleable?h(t.size):void 0,i=new THREE.Vector3(1,1,1);return t.flipX&&(i.x*=-1),t.flipY&&(i.z*=-1),new Promise(o=>{this._staticItemLoader.loadGLB(this._glbUrl,void 0,void 0,n,i,t.customColor,e.colorable).then(t=>{t.name=e.label,this.setObject(t),p(t,this._glbUrl),r(t),this._container.add(this.getObject()),this.hidePreviewBox(),o()})})}getRapiItem(){return this._rapiItem}needsRapiItem(){return!this._glbUrl}getGLBUrl(){return this._glbUrl}}return u([_],e.prototype,"_staticItemLoader",void 0),e})());class D extends I{constructor(e){super(e),this._container.name="Wall Plan Element"}addMesh(e){super.addMesh(e);const t=(new THREE.Box3).setFromObject(this.getObject()).getSize(new THREE.Vector3);this._boundingBox.geometry=new THREE.BoxGeometry(t.x,t.y,t.z),this._boundingBox.position.y=t.y/2}}class S extends I{constructor(e){super(e),this._container.name="Floor Plan Element"}addMesh(e){super.addMesh(e),e.castShadow=!1;const t=(new THREE.Box3).setFromObject(this.getObject()).getSize(new THREE.Vector3);this._boundingBox.geometry=new THREE.BoxGeometry(t.x,.01,t.z)}}class B extends I{constructor(e){super(e),this._container.name="Ceiling Plan Element"}addMesh(e){super.addMesh(e),e.castShadow=!1;const t=(new THREE.Box3).setFromObject(this.getObject()).getSize(new THREE.Vector3);this._boundingBox.geometry=new THREE.BoxGeometry(t.x,.01,t.z)}}let V=e("P",(()=>{class e extends g{constructor(e){super(e,0),this._plannerKernelCallbackListener=new Set,b.addMeta("kernel_is_ready",{isWasm:this._useWASM}),this._scriptLoader.fetch(this._kernelPath,{id:"kernel"}).then(this._loadSuccess.bind(this),this._loadError.bind(this))}get kernelContainer(){return this._kernelContainer}_loadSuccess(){window.RoomleCore(this._kernelContainer)}_loadError(){console.error("kernel load error")}_createPlanInteractionHandler(){const e=this._kernelContainer;this._planInteractionHandler=new e.PlanInteractionHandler,this._planInteractionHandler.init(this._planInteractionHandler,1,100,!0,!0,e.DrawingType.CLICK_PER_CLICK),this._roomlePlannerUiCallback.onPlanInteractionHandlerCreated(this._planInteractionHandler)}addPlannerListener(e){this._plannerKernelCallbackListener.add(e)}removePlannerListener(e){this._plannerKernelCallbackListener.delete(e)}isReady(){super.isReady(),this.registerCallbacks(),this._roomlePlannerUiCallback.onPlannerKernelIsReady(this._kernelContainer),this._createPlanInteractionHandler();const e=this._planInteractionHandler.getConfiguratorKernel();this._kernelInstance=e,this._roomlePlannerUiCallback.onConfiguratorKernelIsReady(this._kernelContainer,e),m.isProduction||(window.__RML__DEBUG__.ConfiguratorKernel=this._kernelInstance,window.__RML__DEBUG__.PlannerKernelContainer=this._kernelContainer),this._kernelAccessCallback.isReady(),this._kernelInstance.useEnvironmentGeometry(!1)}get callbacks(){return this._roomlePlannerUiCallback}get planInteractionHandler(){return this._planInteractionHandler}get planModelViewHelper(){return this._kernelContainer.PlanModelViewHelper}catalogItemLoaded(e){const t=this._rapiItemToKernelItem(e);this._kernelContainer.catalogItemLoaded(t)}async insertItems(e){let t=new this._kernelContainer.CatalogItemPtrList;e.forEach(e=>{let n=e.count||1;for(let r=0;r<n;r++)e.count||(e.count=0),t.push_back(this._rapiItemToKernelItem(e))}),this._planInteractionHandler.addPlanObjects(t);const n=this._planInteractionHandler.getPlan().extRef.jsObject;await Promise.all(n.getStaticPlanObjectViewModels().map(async e=>{if(e.needsRapiItem()){const t=await this._rapiAccess.getItem(e.getPlanObject().getCatalogItemId());e.setRapiItem(t)}}))}_rapiItemToKernelItem(e){let t=new this._kernelContainer.CatalogItem(e.id),n=t.size;return n.x=e.width||0,n.y=e.depth||0,n.z=e.height||0,t.size=n,t.flipable=e.flipable,e.layer&&(t.layer=e.layer),t.orderable=e.orderable,t.scaleable=e.scaleable,t.type=e.type||"other",t.detailType=e.detailType||t.type||"other",t.configuration=e.configuration||"",t}onLoadComponentError(e,t){}configurationLoaded(e,t,n,r,i){}componentDefinitionLoaded(e,t){}componentDefinitionLoadingError(e,t){}configurationLoadingError(){}componentConfigurationUpdated(e){}componentParameters(){}requestComponentDimensions(){}planObjectCreated(e,t){}planObjectUpdated(e){}planObjectConfigurationUpdated(e,t,n){}planObjectDeleted(){}requestPlanObjectDimensions(){}cleanUpCallbacks(){super.cleanUpCallbacks(),this._kernelContainer.unregisterPlannerCallback(this)}registerCallbacks(){super.registerCallbacks(),this._kernelContainer.registerPlannerCallback(this)}async requestExternalMesh(e,t){let n;try{n=await this._rapiAccess.getMesh(e,E,t)}catch(e){throw console.error(e),e}try{const r=await fetch(new Request(this._dataSyncer.requestAsset(n.url,!0))),i=await r.arrayBuffer();this._handleCortoMesh(i,e,t)}catch(e){throw console.error(e),e}}Editor3dRootComponentCreated(e,t,n,r){this._configuratorKernelCallbackListener.forEach(i=>i.Editor3dComponentCreated(e,t,n,r,!0))}Editor3dPlanObjectConstructionDone(e){}Editor3dBeginGroup(){}Editor3dEndGroup(){}Editor3dSetMaterial(){}Editor3dLoadMaterial(){}Editor3dAddDockPreview(e,t){}Editor3dSetPreviewPointAssociations(e,t){}Editor3dSetPreviewLineAssociations(e,t){}Editor3dPreviewConstructionDone(e,t){}Editor3dTranslateBy(){}Editor3dRotateBy(){}Editor3dRotateAround(){}Editor3dAddCube(){}Editor3dAddCubeUVMod(){}Editor3dAddSphere(){}Editor3dAddSphereUVMod(){}Editor3dAddRectangle(){}Editor3dAddRectangleUVMod(){}Editor3dAddMesh(){}Editor3dAddMeshUVMod(){}Editor3dAddMeshUVCoord(){}Editor3dAddCylinder(){}Editor3dAddCylinderUVMod(){}Editor3dAddPrism(){}Editor3dAddPrismUVMod(){}Editor3dAddFittingPoint(){}Editor3dAddFittingLine(){}Editor3dSelectObject(){}Editor3dCopy(){}Editor3dUpdatePlanObjectPosition(){}Editor3dUpdatePlanObjectRotation(){}Editor3dUpdatePlanObjectTransform(){}Editor3dUpdatePlanComponentPosition(){}Editor3dUpdatePlanComponentRotation(){}Editor3dUpdatePlanComponentTransform(){}planElementRemoved(e){this._plannerKernelCallbackListener.forEach(t=>t.planElementRemoved(e)),this._plannerKernelCallbackListener.forEach(t=>t.removePlanObjectFromScene(e.extRef.jsObject)),this._decoupleReferences(e)}handlerSwitchedPlans(e,t){if(this._decoupleReferences(e),t){let e=new U(this._creator_);e.setReference(t),this._coupleReferences(e,t),this._plannerKernelCallbackListener.forEach(t=>t.handlerSwitchedPlans(e))}}planBoundsChanged(){this._plannerKernelCallbackListener.forEach(e=>e.planBoundsChanged())}planCleared(){}planCompletelyLoaded(e){this._plannerKernelCallbackListener.forEach(t=>t.planCompletelyLoaded(e))}planElement3dMeshChanged(e,t){if(t.extRef){const e=t.extRef.jsObject;for(let t=e.getObject().children.length-1;t>=0;t--)e.getObject().remove(e.getObject().children[t])}this.planModelViewHelper.requestMesh3d(t)}planElementAdded(e,t){if(e&&e.extRef)if(t.getType()===this._kernelContainer.PlanElementType.OBJECT){let n,r=t;if(r.hasConfiguration())n=new k(r),this._coupleReferences(n,r),e.extRef.jsObject.addPlanElementViewModel(n);else{n=new L(r),this._coupleReferences(n,r),e.extRef.jsObject.addPlanElementViewModel(n);const i=t.getCatalogItemId();i&&this._rapiAccess.getItem(i).then(e=>{n.setRapiItem(e)})}this._plannerKernelCallbackListener.forEach(e=>e.addPlanObjectToScene(n))}else{let n,r=t;if(t.getType()===this._kernelContainer.PlanElementType.WALL?n=new D(r):t.getType()===this._kernelContainer.PlanElementType.FLOOR?n=new S(r):t.getType()===this._kernelContainer.PlanElementType.CEILING&&(n=new B(r)),!n)return;n.setPrimaryColor(this._initData.colors.PRIMARY),this._coupleReferences(n,r),e.extRef.jsObject.addPlanElementViewModel(n),this.planModelViewHelper.requestMesh3d(t)}}planElementChanged(e,t){if(t.extRef){let n=t.extRef.jsObject;n.update(),this._plannerKernelCallbackListener.forEach(t=>t.planElementChanged(e,n))}}planHistoryStateChanged(){this.planInteractionHandler&&this._roomlePlannerUiCallback.onHistoryChange(this.planInteractionHandler.isUndoPossible(),this.planInteractionHandler.isRedoPossible())}planObjectConfigurationCreated(e,t){}planObjectConfigurationLoaded(e,t,n){e&&e.extRef&&t&&t.extRef&&t.extRef.jsObject.getPlanObject().getConfigurationRuntimeId()>0&&this._plannerKernelCallbackListener.forEach(r=>r.planObjectConfigurationLoaded(e,t,n))}requestCatalogItem(e){}startedDrawing(){}stoppedDrawing(){}updateMesh2d(){}beginConstruction(){}addMesh(e,t,n,r,i,o){this._plannerKernelCallbackListener.forEach(a=>a.addMesh(e,t,n,r,i,o))}endConstruction(){}beginPlanConstruction(e){this._plannerKernelCallbackListener.forEach(t=>t.beginPlanConstruction(e))}addPlanMesh(e,t,n,r,i,o,a){this._plannerKernelCallbackListener.forEach(s=>s.addPlanMesh(e,t,n,r,i,o,a))}endPlanConstruction(e){this._plannerKernelCallbackListener.forEach(t=>t.endPlanConstruction(e))}addPlanObjectFromItem(e,t,n){if(!t&&!n)return this.insertItems([e]);n=n||0===n?n:0,t=t||{x:0,y:0,z:0};const r=this._rapiItemToKernelItem(e);return this._planInteractionHandler.addPlanObjectFromItem(r,t,n)}_coupleReferences(e,t){let n=new this._kernelContainer.EMSReference;n.jsObject=e,t.extRef=n}_decoupleReferences(e){e&&e.extRef&&(e.extRef.jsObject.clearReference(),e.extRef.jsObject=null,e.extRef.delete(),e.extRef=null)}}return u([_],e.prototype,"_kernelAccessCallback",void 0),u([_],e.prototype,"_roomlePlannerUiCallback",void 0),u([_],e.prototype,"_initData",void 0),e})()),U=(()=>{class e extends f{constructor(e){super(e),this._configurablePlanObjectViewModels=[],this._staticPlanObjectViewModels=[],this._constructionGroup=new THREE.Group,this._constructionGroup.name="Construction",this._ceilingGroup=new THREE.Group,this._getKernelAccess().addPlannerListener(this)}planBoundsChanged(){}_getKernelAccess(){return C.lookup("planner-kernel-access",this._creator_)}setReference(e){this._coreReference=e.clone()}clearReference(){this._coreReference.delete(),this._coreReference=null,super.clearReference()}getCorePlan(){return this._coreReference}addPlanElementViewModel(e){e instanceof k?this._configurablePlanObjectViewModels.push(e):e instanceof L?(this._staticPlanObjectViewModels.push(e),"door"!==e.getPlanObject().getObjectType()&&"window"!==e.getPlanObject().getObjectType()&&this._initData.edit&&this._plannerSceneEventHandler.addPlanObjectHandlers(e)):e instanceof D?(this._initData.edit&&this._plannerSceneEventHandler.addWallHandlers(e),this._constructionGroup.add(e.getContainer())):(e instanceof S||e instanceof B)&&this._constructionGroup.add(e.getContainer())}_addRootComponent(e){const t=this._getPlanObjectViewModelForRuntimeId(e.parentObjectId);t&&t instanceof k&&(t.addRootComponent(e),this._initData.edit&&this._plannerSceneEventHandler.addPlanObjectHandlers(t),t.hidePreviewBox())}_getPlanObjectViewModelForRuntimeId(e){let t=null;return this._configurablePlanObjectViewModels.forEach(n=>{e===n.getConfigurationRuntimeId()&&(t=n)}),t}getPlanObjectForId(e){let t=null;return this._configurablePlanObjectViewModels.forEach(n=>{e===n.getId()&&(t=n)}),this._staticPlanObjectViewModels.forEach(n=>{e===n.getId()&&(t=n)}),t}getConstructionGroup(){return this._constructionGroup}getCeilingGroup(){return this._ceilingGroup}getBoundingBox(){const e=this.getCorePlan();return e?y(e.getBounds()):(new THREE.Box3).setFromObject(this._constructionGroup)}setPlannerSceneEventHandler(e){this._plannerSceneEventHandler=e}sceneCleared(){this._configurablePlanObjectViewModels.forEach(e=>{e.clear()}),this._staticPlanObjectViewModels.forEach(e=>{e.clear()}),super.sceneCleared()}getStaticPlanObjectViewModels(){return this._staticPlanObjectViewModels}getComponent(e){return this._components.get(e)}_generateMesh(e=0,t=null,n,r,i,o,a,s,l){return this._plannerMeshGenerator.generateMesh(t,n,r,i,o,a,s,l)}_setMaterial(e,t,n){this._plannerMeshGenerator.setMaterial(e,t)}Editor3dComponentCreated(e,t,n,r,i){super.Editor3dComponentCreated(e,t,n,r,i),this._getKernelAccess()instanceof V&&this.dockComponent(e,r,t,n)}addPlanObjectToScene(e){}handlerSwitchedPlans(e){this._constructionGroup.clear(),this._ceilingGroup.clear()}planCompletelyLoaded(e){}beginPlanConstruction(e){}addPlanMesh(e,t,n,r,i,o,a){}endPlanConstruction(e){}planElementChanged(e,t){}planObjectConfigurationLoaded(e,t,n){}addMesh(e,t,n,r,i,o){const a=e.extRef.jsObject;let s=a.getMesh(t);s?s.geometry=this._plannerMeshGenerator.generateGeometry(null,n,r,i,o):(s=this._generateMesh(0,null,t,n,r,i,o,e.getType()),a.addMesh(s))}removePlanObjectFromScene(e){}planElementRemoved(e){if(e.getType()===this._getKernelAccess().kernelContainer.PlanElementType.OBJECT){let t=e;if(t.hasConfiguration()){const e=t.extRef.jsObject,n=this._configurablePlanObjectViewModels.indexOf(e);n>-1&&this._configurablePlanObjectViewModels.splice(n,1)}else{const e=t.extRef.jsObject,n=this._staticPlanObjectViewModels.indexOf(e);n>-1&&this._staticPlanObjectViewModels.splice(n,1)}}}getMeshGenerator(){return this._plannerMeshGenerator}}return u([_],e.prototype,"_plannerMeshGenerator",void 0),e})();const A=j(30);class G extends H{constructor(e,t,n,r){super(),this._offset=new THREE.Vector3(0,0,0),this._mode=void 0===r?1:r,this._scene=e,this._camera=t,this._raycaster=new THREE.Raycaster,this._raycaster.layers.enableAll(),this._inputManager=n,this._addInputListeners(n),this._planeBottom=new THREE.Plane(new THREE.Vector3(0,1,0)),this._planeFront=new THREE.Plane(new THREE.Vector3(0,0,1)),this._planeSide=new THREE.Plane(new THREE.Vector3(1,0,0))}setLayers(e){this._raycaster.layers=e}_addInputListeners(e){e.addEventListener(3,e=>{this._findCandidate(e.positionRelative)},this),e.addEventListener(5,e=>{this._findSelection(e.positionRelative)},this),e.addEventListener(6,e=>{this._findHover(e.positionRelative,e.type)},this),e.addEventListener(0,e=>{this._onDragStart(e.positionRelative)},this),e.addEventListener(1,e=>{this._onDrag(e.positionRelative)},this),e.addEventListener(2,e=>{this._onDragEnd(e.positionRelative)},this),e.addEventListener(9,e=>{this._onRotate(e.positionRelative,e.rotation)},this),e.addEventListener(10,()=>{this._currentRotate=null},this)}_findCandidate(e){this._intersection(e)&&this._inputManager.onElementHit()}_findSelection(e){let t=this._intersection(e);t?t&&t.object.dispatchEvent({type:"select"}):this.dispatchEvent(3)}_findHover(e,t){const n=this._intersection(e);!n&&this._currentHover?(this._currentHover.dispatchEvent({type:"hover_off",attachment:{type:t}}),this._currentHover=null):n&&(this._currentHover&&this._currentHover.id!==n.object.id&&(this._currentHover.dispatchEvent({type:"hover_off",attachment:{type:t}}),this._currentHover=null),this._currentHover?this._currentHover.dispatchEvent({type:"hover_move",attachment:{intersection:n,type:t}}):(this._currentHover=n.object,this._currentHover.dispatchEvent({type:"hover_on",attachment:{intersection:n,type:t}})))}_intersection(e){const t=this._intersect(e);if(t.length<=0)return null;let n=t[0];return t.length>1&&this._currentHover&&this._currentDrag&&this._currentDrag.id!==this._currentHover.id&&t.forEach(e=>{e.object.id===this._currentHover.id&&e.object.userData.priority===this._currentHover.userData.priority&&n.object.userData.priority<=e.object.userData.priority&&(n=e)}),n}_intersect(e){this._raycaster.setFromCamera(e,this._camera);const t=[];return this._raycaster.intersectObjects(this._scene.children,!0).forEach(e=>{const n=this._findObjectWithHandler(e.object);n&&(e.object=n,t.push(e))}),t.length>=0?t.sort((e,t)=>e.object.userData.priority!==t.object.userData.priority?t.object.userData.priority-e.object.userData.priority:e.distance-t.distance):[]}_findObjectWithHandler(e){return e.userData.hasListener?e:e.parent?this._findObjectWithHandler(e.parent):null}_onDragStart(e){let t=this._intersection(e);if(!t&&!this._currentDrag)return;if(t&&t.object.userData.roomleId===this._rootComponentId)return;!this._currentDrag&&t&&(this._currentDrag=t.object,this._currentDrag.dispatchEvent({type:"drag_start"}));let n=this._currentDrag.parent;n&&n.computeBoundingBox&&(n.computeBoundingBox(),this._calculateOffset(n)),this._positionPlanes(n)}_onDrag(e){if(!this._currentDrag)return;this._raycaster.setFromCamera(e,this._camera);let t,n=new THREE.Vector3(0,0,-5);if(this._raycaster.ray.intersectPlane(this._planeBottom,n),0===this._mode){const e=this._scene.children.find(({type:e,name:t})=>"Group"===e&&"Construction"===t);if(e){const t=this._raycaster.intersectObjects(e.children,!0);if(t.length){const e=t[0].point.clone();return void this._currentDrag.dispatchEvent({type:"drag",attachment:{position:e}})}}t=n.clone(),t.y=this._currentDrag.parent.position.y}else t=this._getIntersectionPosition(n),t.sub(this._offset);this._currentDrag.dispatchEvent({type:"drag",attachment:{position:t}})}_getIntersectionPosition(e){let t=this._getDistanceToCamera(e),n=this._camera.userData.yaw,r=new THREE.Vector3(0,0,0),i=new THREE.Vector3(0,0,0);this._raycaster.ray.intersectPlane(this._planeFront,r),this._raycaster.ray.intersectPlane(this._planeSide,i);let o,a=this._getDistanceToCamera(i),s=this._getDistanceToCamera(r);return n>=-A&&n<=A?o=t<s?e.clone():r.clone():t<s&&t<a?o=e.clone():s<t&&s<a?o=r.clone():a<t&&a<s&&(o=i.clone()),o}_getDistanceToCamera(e){let t=e.clone().sub(this._camera.position).length();return P(e)&&(t=Number.POSITIVE_INFINITY),t}_onDragEnd(e){this._currentDrag&&(this._currentDrag.dispatchEvent({type:"drag_end",attachment:{position:e}}),this._currentDrag=null)}_onRotate(e,t){if(!this._currentRotate){let t=this._intersection(e);if(!t)return;this._currentRotate=t.object}this._currentRotate.dispatchEvent({type:"rotate",attachment:{rotation:t}})}_positionPlanes(e){0===this._mode?(this._planeBottom.constant=0,this._camera.userData&&this._camera.userData.pitch&&this._camera.userData.pitch<0&&(this._planeBottom.constant=-3)):e&&e.boundingBox&&this._rootComponentPosition&&(this._planeBottom.constant=-e.boundingBox.getCenter(new THREE.Vector3).y-this._rootComponentPosition.y,this._planeSide.constant=2*-e.boundingBox.getSize(new THREE.Vector3).x+e.boundingBox.getCenter(new THREE.Vector3).x,this._camera.userData.yaw>0&&(this._planeSide.constant*=-1),this._bounds&&(this._planeFront.constant=this._bounds.z/2+e.boundingBox.getCenter(new THREE.Vector3).z))}_calculateOffset(e){e&&e.boundingBox&&(this._offset.copy(e.boundingBox.getCenter(new THREE.Vector3)),this._offset.applyQuaternion(e.getWorldQuaternion(new THREE.Quaternion)))}update(e,t,n){if(e&&(this._bounds=e),t&&(this._rootComponentPosition=t),n){this._backgroundScene=n;let e=this._backgroundScene.children[0];e instanceof THREE.Mesh&&e.geometry.computeBoundingBox()}}clear(){this._currentDrag&&R(this._currentDrag),this._currentHover&&R(this._currentHover)}enableDragIn(e){this._currentDrag=e}setRootComponentId(e){this._rootComponentId=e}setCamera(e){this._camera=e}setScene(e){this._scene=e}setMode(e){this._mode=e}}e("S",class extends H{constructor(e,t,n,r){super(),this._debug=!1,this._dragIn=!1,this._inputManager=r,this._raycastHelper=new G(t,n,this._inputManager),this._creator_=e}isDragIn(){return this._dragIn}setDragIn(e,t){this._dragIn=e,e?this._inputManager.enableDragIn(t):this._raycastHelper.clear(),this._interaction()}});class K extends M{constructor(e,t){super(e,t),this._params={ambientLight:{color:"#ffffff"}},this._ambientLight=new THREE.AmbientLight(new THREE.Color(this._params.ambientLight.color),1.2),this._ambientLight.layers.set(1),this.addToScene()}needsBounds(){return!1}addToScene(){this._scene.add(this._ambientLight)}removeFromScene(){this._scene.remove(this._ambientLight)}reload(){this.removeFromScene(),this.addToScene()}showGUI(){let e=w();if(e&&this._ambientLight){let t=e.addFolder("Ambient Light");t.add(this._ambientLight,"visible"),t.add(this._ambientLight,"intensity").min(0).max(5).step(.1),t.addColor(this._params.ambientLight,"color").onChange(e=>this._ambientLight.color=new THREE.Color(e))}}}let z=null;const F=()=>(z||(z=new THREE.WebGLRenderer({antialias:!0,alpha:!0}),z.outputEncoding=THREE.sRGBEncoding),z.autoClear=!0,z),W=(e("g",(e,t=0)=>{if(!e){const e=new THREE.Vector3;return{center:e,bounds:e,diagonal:0}}const n=e.getSize(new THREE.Vector3);return n.addScalar(t),{center:e.getCenter(new THREE.Vector3),bounds:n,diagonal:Math.sqrt(Math.pow(n.x,2)+Math.pow(n.y,2)+Math.pow(n.z,2))}}),e("a",(e,t,n,r,i={})=>new Promise(o=>{const{size:a=1024,showDimensions:s}=i,l=F();l.setSize(a,a);const c=e.fog?e.fog.clone():null,d=e.background?e.background.clone():null;e.background=null,e.fog=null;let h=new v(e);n.layers.disable(2),n.layers.disable(5),s?n.layers.enable(7):n.layers.disable(7),W(n,r,-20,-30),l.render(e,n),t&&(l.autoClear=!1,l.clearDepth(),l.render(t,n));const u=l.domElement.toDataURL();n.layers.enable(2),e.background=d,e.fog=c,h.removeFromScene(),o({image:u,width:a,height:a,blob:null})})),e("r",(e,t,n,r,i,o)=>new Promise(r=>{o||(o=1024);const i=F();i.setSize(o,o);const a=e.fog?e.fog.clone():null,s=e.background?e.background.clone():null;e.background=null,e.fog=null,t.layers.disable(2),t.layers.disable(5),n?W(t,n,-20,-30):(t.aspect=1,t.updateProjectionMatrix()),i.render(e,t);const l=i.domElement.toDataURL();t.layers.enable(2),e.background=s,e.fog=a,r({image:l,width:o,height:o,blob:null})})),e("p",(e,t,n,r)=>{e.far=1e3,e.fov=15,e.aspect=1,e.position.copy(t.center),e.rotation.set(0,0,0),e.rotateY(j(r)),e.rotateX(j(n)),e.translateZ(3.8*t.diagonal),e.updateProjectionMatrix()}));e("b",(e,t,n,r={})=>{const{showDimensions:i=!1}=r;return new Promise(r=>{const o=F();o.autoClear=!1;let a=new THREE.OrthographicCamera(-n.bounds.x/2,n.bounds.x/2,n.bounds.z/2,-n.bounds.z/2,.5);a.position.copy(n.center),a.rotateX(j(-90)),a.translateZ(n.bounds.y+1),a.far=a.position.y+.5,a.layers.mask=65535;let s=200*n.bounds.x,l=200*n.bounds.z;if(s>4096||l>4096){let e=0;s>4096?e=s/4096:l>4096&&(e=l/4096),s/=e,l/=e}o.setSize(s,l);let c=e.fog?e.fog.clone():null,d=e.background?e.background.clone():null;e.background=null,e.fog=null;let h=i?new K(e):new v(e);a.layers.disable(2),a.layers.disable(5),i?a.layers.enable(7):a.layers.disable(7),o.render(e,a),t&&(o.clearDepth(),o.render(t,a));let u=o.domElement.toDataURL();a.layers.enable(2),a.layers.enable(5),e.background=d,e.fog=c,h.removeFromScene(),r({image:u,width:s,height:l,blob:null})})})}}}));
|
|
2
|
-
//# sourceMappingURL=image-renderer-ab8f30f8.legacy.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"material-viewer-975fc2c6.legacy.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mesh-generator-3a36e30e.legacy.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
System.register(["./query-params-helper-8c00a872.legacy.js","./rapi-access-0564780f.legacy.js","./main-thread-to-worker-4c02f179.legacy.js"],(function(t){var e,i,s,a,n,o,h,r,_,l,d,c,u,g,m,p,w,E,P,y,v,S,b;return{setters:[function(t){e=t.g},function(t){i=t.s,s=t.B,a=t.I,n=t._,o=t.i,h=t.t,r=t.u,_=t.v,l=t.w,d=t.x,c=t.y,u=t.h,g=t.G,m=t.z,p=t.F,w=t.H,E=t.J,P=t.K,y=t.N},function(t){v=t.d,S=t.g,b=t.h}],execute:function(){t("f","static/dat.gui.min-b5cbb61e5c62f0bf.js"),t("T","static/Tween-d024b02fe34f25ab.js"),t("M",class{constructor(t){this._context=t||i.getContext(this.getContextName()),s.start("loadingTime")}_setupCommonGlobals(){window.__RML__DEBUG__||(window.__RML__DEBUG__={}),window.__RML__ENV__||(window.__RML__ENV__={},window.__RML__ENV__.assetPath||(window.__RML__ENV__.assetPath=""))}_setupCommonDependencies(){i.setup(a);const t=e();this.lookup("global-init-data").setOverrides(t),this.lookup("init-data",this._context).setOverrides(t)}_cleanUpCommonGlobals(){window.__RML__DEBUG__&&(window.__RML__DEBUG__.Kernel&&window.__RML__DEBUG__.Kernel.clearAll&&window.__RML__DEBUG__.Kernel.clearAll(),delete window.__RML__DEBUG__),delete window.__RML__ENV__;for(const t in window.THREE)if(window.THREE.hasOwnProperty(t))try{delete window.THREE[t]}catch(t){console.error(t)}window.THREE=void 0}_cleanUpCommonDependencies(){}boot(t){this._setupCommonGlobals(),this._setupCommonDependencies(),this.setupGlobals(t),this.setupDependencies(),this.bootFinished()}lookup(t,e){return window.__RML__DI__.lookup(t,e)}teardown(){this.cleanUpDependencies(),this._cleanUpCommonDependencies(),this.cleanUpGlobals(),this._cleanUpCommonGlobals(),window.__RML__DI__&&delete window.__RML__DI__}pause(){this.lookup("life-cycle-manager",this._context).pause(),window.TWEEN&&TWEEN.removeAll()}resume(t){t&&this.lookup("dom-helper",this._context).setDomElement(t),this.lookup("life-cycle-manager",this._context).resume()}destroy(){this.pause(),this.lookup("life-cycle-manager",this._context).destroy(),i.cleanUp(this._context)}getRapiAccess(){return this.lookup("rapi-access",this._context)}});class x{constructor(){this._listeners={}}_addEventListener(t,e,i){this._listeners[t]||(this._listeners[t]=[]),this._listeners[t].push({callback:e,scope:i})}addEventListener(t,e,i){this._addEventListener(t,e,i)}dispatchEvent(t,e){if(!this._listeners[t])return;const i=this._listeners[t];let s=i.length;for(let t=0;t<s;t++){const s=i[t];e?s.callback.apply(s.scope,[e]):s.callback.call(s.scope)}}removeEventListener(t,e){const i=this._listeners[t];if(i)for(let t=0,s=i.length;t<s;t++)if(i[t].callback===e)return void i.splice(t,1)}}t("E",x);const T=t("h",10);let f=t("d",(()=>{class t extends x{constructor(t,e,i){if(super(),this._tweenEnd=null,this._cameraStandingStill=!0,this._pitch=h(T),this._yaw=h(-30),this._distance=-1,this._locked=!1,this._inputListeners=[],this._lerpEnabled=!0,this._creator_=t,this._inputManager=e,this._initInputListener(),this._addInputListeners(),this._cameraPosition=new THREE.Vector3,this._targetPosition=new THREE.Vector3,i?this._cameraPosition.copy(i):this._cameraPosition=new THREE.Vector3(0,.5,3),this._initData.debug){const t=this.getDebugCameraPosition();t&&this._setCurrentCameraParameters(t)}let s=this._domHelper.getClientDimensions();this._width=s.x,this._height=s.y,this._dispatchCameraIdle=v(this._dispatchCameraIdle.bind(this),16)}getCamera(){return this._getCamera()}_addInputListeners(){this._inputListeners.forEach(t=>{this._inputManager.addEventListener(t.key,t.fun,this)})}_removeInputListeners(){this._inputListeners.forEach(t=>{this._inputManager.removeEventListener(t.key,t.fun)}),this._inputListeners=[]}cleanUp(){this._removeInputListeners()}animateCamera(t){let e=this._cameraPosition;if(!e||r(e,this.getCamera().position))return this._cameraStandingStill||(this._cameraStandingStill=!0,this._dispatchCameraIdle(),this._initData.debug&&this.saveDebugCameraPosition()),!1;if(this._cameraStandingStill&&this.dispatchEvent(7,3),this._cameraStandingStill=!1,this._lerpEnabled&&!this._tweenEnd){let i=this.getCamera().position.clone();const s=Math.min(10*t,1);i.lerp(e,s),this.getCamera().position.copy(i)}else this.getCamera().position.copy(e);return!0}getDebugCameraPosition(){return JSON.parse(localStorage.getItem("debug_camera_position"))}saveDebugCameraPosition(){localStorage.setItem("debug_camera_position",JSON.stringify(this._getCurrentCameraParameters()))}_dispatchCameraIdle(){this.dispatchEvent(8,3)}_areEqual(t,e){return t.yaw.toFixed(5)===e.yaw.toFixed(5)&&t.pitch.toFixed(5)===e.pitch.toFixed(5)&&t.distance.toFixed(5)===e.distance.toFixed(5)&&t.targetX===e.targetX&&t.targetY===e.targetY&&t.targetZ===e.targetZ}_tweenCameraParameter(t,e,i){return new Promise(i=>{if(e.yaw-t.yaw<=-Math.PI?t.yaw-=2*Math.PI:e.yaw-t.yaw>=Math.PI&&(t.yaw+=2*Math.PI),window.TWEEN){if(null!==this._tweenEnd&&this._tweenEnd.blockOtherTweens)return;this._tweenEnd=e,new TWEEN.Tween(t).to(e,400).easing(TWEEN.Easing.Sinusoidal.In).onUpdate(()=>{this.dispatchEvent(1,3),this._yaw=t.yaw,this._pitch=t.pitch,this._distance=t.distance,this._update(new THREE.Vector3(t.targetX,t.targetY,t.targetZ))}).onComplete(()=>{this.dispatchEvent(2,3),this._tweenEnd=null,i()}).start(),this.dispatchEvent(0,3)}})}_getCurrentCameraParameters(){const t=this._targetPosition.clone();return{yaw:this._yaw,pitch:this._pitch,distance:this._distance,targetX:t.x,targetY:t.y,targetZ:t.z}}_setCurrentCameraParameters(t){this._yaw=t.yaw,this._pitch=t.pitch,this._distance=t.distance,this._targetPosition.copy(new THREE.Vector3(t.targetX,t.targetY,t.targetZ))}_rotateHorizontal(t){this._yaw-=t,this._yaw<-Math.PI?this._yaw+=2*Math.PI:this._yaw>Math.PI&&(this._yaw-=2*Math.PI)}_rotateVertical(t){this._pitch+=t,this._pitch<-Math.PI?this._pitch+=2*Math.PI:this._pitch>Math.PI&&(this._pitch-=2*Math.PI)}saveState(t){if(t||!this._stateSaved){let t=this._yaw,e=this._pitch,i=this._distance,s=this._targetPosition.clone();if(this._stateSaved={yaw:t,pitch:e,distance:i,targetX:s.x,targetY:s.y,targetZ:s.z,blockOtherTweens:!0},this._getCamera().fov){let t=this._getCamera();this._stateSaved.fov=t.fov,this._stateSaved.near=t.near,this._stateSaved.far=t.far}return this._stateSaved}return null}resetToState(){if(this._stateSaved){this._stateSaved.blockOtherTweens=!1;let t=this._targetPosition.clone();this._tweenCameraParameter({yaw:this._yaw,pitch:this._pitch,distance:this._distance,targetX:t.x,targetY:t.y,targetZ:t.z},this._stateSaved,!0)}this._stateSaved=null}setToState(t,e){this._tweenCameraParameter(t,e,!0)}hasSavedState(){return null!=this._stateSaved}lock(){this._locked=!0}unlock(){this._locked=!1}getTargetPosition(){return this._targetPosition}_saveYawAndPitch(){this._getCamera().userData.yaw=this._yaw,this._getCamera().userData.pitch=this._pitch}getInputPosition(t){const{x:e,y:i}=this._domHelper.getClientDimensions();return new THREE.Vector3(t.x/e*2-1,-t.y/i*2+1,.5)}addLightContainer(t){t.name="lights";const e=this._getCamera(),i=e.children.find(t=>"lights"===t.name);i&&e.remove(i),e.add(t)}checkNearFarDistance(t){if(!t)return;const e=this._cameraPosition.distanceTo(t),i=this._getCamera();i instanceof THREE.PerspectiveCamera&&e>i.far&&(i.far=e+1)}}return n([o],t.prototype,"_domHelper",void 0),n([o],t.prototype,"_initData",void 0),t})());class M{constructor(t,e){this.minZoom=!1,this.maxZoom=!1,this.minZoom=t,this.maxZoom=e}}t("C",class extends f{constructor(t,e,i,s){super(t,e,i),this._bounds=new THREE.Vector3,this._scale=1,this._state=0,this._zoomSpeed=Math.pow(.95,3),this.minDistance=0,this.maxDistance=5,this.minPolarAngle=h(0),this.maxPolarAngle=h(85),this.minAzimuthAngle=Number.NEGATIVE_INFINITY,this.maxAzimuthAngle=Number.POSITIVE_INFINITY,this._zoomDistance=.1,this._userInteraction=!1,this._currentZoomHash="",this._maxZoomedIn=!1,this._maxZoomedOut=!1,this._panningEnabled=!1,s?this._camera=s:this._initCamera(),this._targetPosition||(this._targetPosition=new THREE.Vector3(0,0,0));const{cameraRestriction:a,zoomDistance:n,minVerticalCameraAngle:o,maxVerticalCameraAngle:r,minHorizontalCameraAngle:_,maxHorizontalCameraAngle:l}=this._initData;if(n&&(this._zoomDistance=n/100),void 0!==o&&(this.minPolarAngle=h(o<0?o:-1*o)),void 0!==r&&(this.maxPolarAngle=h(r)),void 0!==_&&(this.minAzimuthAngle=h(_<0?_:-1*_)),void 0!==l&&(this.maxAzimuthAngle=h(l)),void 0!==a){let t=Math.abs(h(a));this.minAzimuthAngle=-t,this.maxAzimuthAngle=t,this.maxPolarAngle=Math.min(t,h(85))}this._update()}_getCamera(){return this._camera||this._initCamera(),this._camera}_initCamera(){this._camera=new THREE.PerspectiveCamera,this._camera.fov=30,this._camera.aspect=this._width/this._height,this._camera.near=.1,this._camera.far=100,this._camera.updateProjectionMatrix(),this._camera.layers.set(3),this._camera.layers.enable(1),this._camera.layers.enable(2),this._camera.layers.enable(5),this._camera.layers.enable(4)}updateCamera(){let{x:t,y:e}=this._domHelper.getClientDimensions();this._camera.aspect=t/e,this._camera.updateProjectionMatrix()}animateCamera(t){if(!super.animateCamera(t))return!1;let e=this._targetPosition;return!!e&&(this.getCamera().lookAt(e),!0)}_initInputListener(){this._inputListeners.push({key:3,fun:()=>{this._state=1}}),this._inputListeners.push({key:6,fun:t=>{var e,i;1!==this._state||this._locked||(this._userInteraction=!0,!(void 0!==(null===(e=t.event)||void 0===e?void 0:e.shiftKey)&&(null===(i=t.event)||void 0===i?void 0:i.shiftKey))&&this._panningEnabled&&this.disablePanning(),this._move(new THREE.Vector2(t.position.x,t.position.y),t.type))}}),this._inputListeners.push({key:11,fun:t=>{1===this._state||this._locked||(this._userInteraction=!0,this._pan(new THREE.Vector2(t.position.x,t.position.y),t.type))}}),this._inputListeners.push({key:4,fun:t=>{1===this._state&&this.dispatchEvent(2,t.type),this._state=0,this._orbitPosition=null,this._lerpEnabled=!0}}),this._inputListeners.push({key:7,fun:({event:t})=>{this._maxZoomedIn||(t&&(t.preventDefault(),t.stopPropagation()),this.zoomIn())}}),this._inputListeners.push({key:8,fun:({event:t})=>{this._maxZoomedOut||(t&&(t.preventDefault(),t.stopPropagation()),this.zoomOut())}})}_panTargetPosition(t){const e=t.clone().sub(this._orbitPosition),i=this._domHelper.element,s=this._targetPosition.project(this._camera),a=Math.max(2,4*(1-this._distance/this.maxDistance));s.x=s.x-e.x/i.clientHeight*a,s.y=s.y+e.y/i.clientHeight*a,this._targetPosition.copy(s.unproject(this._camera))}_pan(t,e){this._lerpEnabled=!1,this._orbitPosition||(this._orbitPosition=new THREE.Vector2(t.x,t.y),this.dispatchEvent(0,e)),this._panTargetPosition(t),_(this._orbitPosition,t)||this.dispatchEvent(1,e),this._orbitPosition.copy(t),this._update()}_move(t,e){this._orbitPosition||(this._orbitPosition=new THREE.Vector2(t.x,t.y),this.dispatchEvent(0,e));const i=t.clone().sub(this._orbitPosition),s=this._domHelper.element;this._panningEnabled?this._panTargetPosition(t):(this._rotateHorizontal(2*Math.PI*i.x/s.clientWidth*1),this._rotateVertical(2*Math.PI*i.y/s.clientHeight*1)),_(this._orbitPosition,t)||this.dispatchEvent(1,e),this._orbitPosition.copy(t),this._update()}setBounds(t){this._boundingBox=t}zoomToFitBounds(t){this.setBounds(t);const e=t.getSize(new THREE.Vector3);if(this._initData.debug||e.x+e.y+e.z===0)return;const i=this._getCurrentCameraParameters(),s=t.getCenter(new THREE.Vector3);this._targetPosition=new THREE.Vector3(s.x,s.y,s.z);const a=this._setDistanceAndRangesBasedOnBounds(e);this._distance=a,this._checkZoomDistance(t,a),this._tweenCameraParameter(i,{yaw:this._yaw,pitch:this._pitch,distance:this._distance,targetX:this._targetPosition.x,targetY:this._targetPosition.y,targetZ:this._targetPosition.z},!1)}updateToBounds(t,e,i=!0,s){if(this.setBounds(t),this._initData.debug)return;const a=t.getCenter(new THREE.Vector3);this._targetPosition=s?s.clone():new THREE.Vector3(a.x,a.y,a.z);const n=this._getCurrentCameraParameters(),o=t.getSize(new THREE.Vector3);if(i){const i=this._setDistanceAndRangesBasedOnBounds(o);this._distance=i,this._checkZoomDistance(t,i),this._userInteraction?this._tweenCameraParameter(n,{yaw:this._yaw,pitch:this._pitch,distance:this._distance,targetX:this._targetPosition.x,targetY:this._targetPosition.y,targetZ:this._targetPosition.z},e):this._update()}else this._setDistanceAndRangesBasedOnBounds(o,!1);this._update()}_checkZoomDistance(t,e){const i=t.getBoundingSphere(new THREE.Sphere);e-i.radius<this._zoomDistance&&(console.warn("the initial camera position is closer than the zoomDistance param, zoomDistance is set to initial camera position."),this._zoomDistance=e-i.radius)}_setDistanceAndRangesBasedOnBounds(t,e=!0){const i=this._domHelper.getClientDimensions(),s=i.x,a=i.y,n=this._camera.offset?s-s*this._camera.offset.left-s*(1-this._camera.offset.right):s,o=this._camera.offset?a-a*this._camera.offset.bottom-a*(1-this._camera.offset.top):a;this._bounds.copy(t);const{cameraSpacing:h}=this._initData;t.addScalar(h/100),this.minDistance=Math.sqrt(t.x*t.x+t.y*t.y+t.z*t.z);const r=Math.max(t.x,t.y),{x:_,y:d}=this._getMargin(n,o),c=l(t.x+_,t.y+d,t.z,this._camera.fov,n,o);return this._distance<c&&e&&(this._distance=c),this.maxDistance=c+r,this.maxDistance<2&&(this.maxDistance=2),this._camera.far=5*this.maxDistance,this._setCameraNear(),c}_getMargin(t,e){let i=this._bounds.x/2,s=this._bounds.y/2;return t>1080&&(i+=this._bounds.x<.3?.2:0,i+=this._bounds.x*(t/1080-1)),e>1080&&(i+=this._bounds.y<.3?.2:0,s+=this._bounds.y*(e/1080-1)),{x:i,y:s}}reset(t,e,i,s,a=!0){const n=t.getSize(new THREE.Vector3);if(n){if(e)this._targetPosition.copy(e);else{const e=t.getCenter(new THREE.Vector3);this._targetPosition.copy(e)}const o=this._getCurrentCameraParameters();if(i||(i=-30),s||(s=T),this._pitch=h(s),this._yaw=h(i),this._initData.debug)return this._distance=this._setDistanceAndRangesBasedOnBounds(n),this._update(this._targetPosition),void this._setDistanceAndRangesBasedOnBounds(n);this._setDistanceAndRangesBasedOnBounds(n);let r=this._targetPosition.clone();a?this._tweenCameraParameter(o,{yaw:this._yaw,pitch:this._pitch,distance:this._distance,targetX:r.x,targetY:r.y,targetZ:r.z},!0):this._update(this._targetPosition)}else console.warn("you cant reset without bounds!")}updateAndReset(t,e,i,s,a,n=!0){const o=new THREE.Vector3(-t.x/2,0,-t.z/2),r=new THREE.Vector3(t.x/2,t.y,t.z/2);if(this._boundingBox=new THREE.Box3(o,r),a&&t.addScalar(a),e?this._targetPosition.copy(e):this._targetPosition=new THREE.Vector3(0,t.y/2,0),-1===this._distance){const e=this._setDistanceAndRangesBasedOnBounds(t);this._distance=Math.max(2,e)}const _=this._getCurrentCameraParameters();i||(i=-30),s||(s=T),this._pitch=h(s),this._yaw=h(i),this._setDistanceAndRangesBasedOnBounds(t);let l=this._targetPosition.clone();n?this._tweenCameraParameter(_,{yaw:this._yaw,pitch:this._pitch,distance:this.maxDistance,targetX:l.x,targetY:l.y,targetZ:l.z},!0):this._update(this._targetPosition)}_update(t){this._initData.debug?this._pitch=Math.max(h(-89),Math.min(h(89),this._pitch)):(this._yaw=Math.max(this.minAzimuthAngle,Math.min(this.maxAzimuthAngle,this._yaw)),this._pitch=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._pitch))),this._saveYawAndPitch();const e=new THREE.Euler(-this._pitch,this._yaw,0,"ZYX"),i=(new THREE.Quaternion).setFromEuler(e),s=new THREE.Vector3(0,0,-1);s.applyQuaternion(i),this._distance*=this._scale,this._initData.debug||(this._distance=Math.min(this.maxDistance,this._distance)),t&&this._targetPosition.copy(t);const a=this._targetPosition.clone().sub(s.multiplyScalar(this._distance));if(this._initData.debug)this._cameraPosition.copy(a),this._zoomChanged(!1,!1);else{const t=this._getCameraSphere(a);null!=this._boundingBox&&this._boundingBox.intersectsSphere(t)&&this._scale>=1?this._distance+=.1:null==this._boundingBox||this._boundingBox.intersectsSphere(t)?this._zoomChanged(!1,!0):(this._cameraPosition.copy(a),this._distance===this.maxDistance?this._zoomChanged(!0,!1):this._zoomChanged(!1,!1))}this._scale=1}_zoomChanged(t,e){let i=t+""+e;0!==this._currentZoomHash.length&&this._currentZoomHash===i||(this.dispatchEvent(5,new M(t,e)),this._currentZoomHash=i),this._maxZoomedIn=e,this._maxZoomedOut=t}zoomTo(t,e,i,s,a,n){return this._tweenCameraParameter(this._getCurrentCameraParameters(),{yaw:s,pitch:a,distance:2.725*l(t.x,t.y,t.z,this._camera.fov,e,i),targetX:n.x,targetY:n.y,targetZ:n.z,blockOtherTweens:!0},!0)}_getCameraSphere(t){const e=Math.max(this._bounds.x,this._bounds.y),i=Math.max(e/10,this._zoomDistance);return new THREE.Sphere(t,i)}zoomIn(t){this._lerpEnabled=!0,this._scale*=t?Math.pow(.95,t):this._zoomSpeed,this._setCameraNear(),this._update(),this.dispatchEvent(3)}zoomOut(t){this._lerpEnabled=!0,this._scale/=t?Math.pow(.95,t):this._zoomSpeed,this._setCameraNear(),this._update(),this.dispatchEvent(4)}_setCameraNear(){const t=Math.max(.1,this._distance/6);this._camera.near=t}clear(){this._userInteraction=!1,this._initData.debug||(this._distance=-1,this._targetPosition=new THREE.Vector3(0,0,0))}async moveCamera(t){return this._tweenCameraParameter(this._getCurrentCameraParameters(),t,!0)}enablePanning(){this._lerpEnabled=!1,this._panningEnabled=!0}disablePanning(){this._lerpEnabled=!1,this._panningEnabled=!1}});let R={},C={};t("S",(()=>{class t{constructor(t){this._creator_=t}fetch(t,e){return this._singlePromiseFactory.create(5,t,(i,a)=>{!function(t,e,i,a){if(-1===t.indexOf("http")&&(t=S()+t),R[t])return i();if(e.id&&C[e.id])return a(new Error('There is already a script with ID "'+e.id+'"'));const n=s.start("load_"+e.id.replace(/-/g,"_")),o=document.createElement("script");o.async=!1,o.src=t,o.id=e.id,o.onload=()=>{R[t]=!0,C[e.id]=!0,s.end(n),Object.defineProperty(i,"name",{value:"resolve-"+e.id}),i()},o.onerror=t=>{a(t)},document.body.appendChild(o)}(t,e,i,a)})}loadScripts(t){const e=[];return t.forEach(t=>{let i=this.fetch(t.name,{id:t.id});e.push(i)}),Promise.all(e)}cleanUp(){for(let t in C)if(C.hasOwnProperty(t)){const e=document.getElementById(t);e&&e.parentElement.removeChild(e)}R={},C={}}}return n([o],t.prototype,"_singlePromiseFactory",void 0),t})());const A={MOUSE_MOVE:"mousemove",MOUSE_DOWN:"mousedown",MOUSE_UP:"mouseup",MOUSE_LEAVE:"mouseleave",MOUSE_ENTER:"mouseenter",MOUSE_WHEEL:"wheel",TOUCH_MOVE:"touchmove",TOUCH_START:"touchstart",TOUCH_END:"touchend",CONTEXT_MENU:"contextmenu"};class D{constructor(t,e,i,s,a){this.position=t,this.positionRelative=e,this.type=i,this.rotation=s,this.event=a}}const k=t("i",5*window.devicePixelRatio),H=3*window.devicePixelRatio;t("I",(()=>{class t extends x{constructor(t){super(),this._debug=!1,this._elementHit=!1,this._delta=-1,this._state=0,this._pinchDistance=-1,this._rotationAngle=-1,this._lastMouseWheelEvent=null,this._lastTouchEvent=null,this._events=Object.keys(A).map(t=>A[t]),this._creator_=t,this._downPosition={x:0,y:0},this._downPositionRelative={x:0,y:0},this._boundingClientRect=this._domHelper.element.getBoundingClientRect()}enableDragIn(t){this._setState(1),this._dragEnabled=!0,t&&(this._dragMV=this._dragM.bind(this),this._dragEV=this._dragE.bind(this),this._dragTarget=t.currentTarget||t.target,this._delta=-1,this._dragMVName="drag",this._dragEVName="dragend",window.TouchEvent&&t instanceof TouchEvent?(this._dragMVName="touchmove",this._dragEVName="touchend"):t.dataTransfer&&t.dataTransfer.setData&&t.dataTransfer.setData("text/plain"," "),this._firefoxDragPosition={x:0,y:0},document.ondragover=t=>{t=t||window.event,this._firefoxDragPosition.x=t.pageX,this._firefoxDragPosition.y=t.pageY},this._dragTarget.addEventListener(this._dragMVName,this._dragMV,!1),this._dragTarget.addEventListener(this._dragEVName,this._dragEV,!1))}_dragM(t){let e=t,i=null,s=null;window.TouchEvent&&t instanceof TouchEvent?(i=this._getTouchPosition(e),s=this._getTouchPositionRelative(e)):(i=this._getMousePosition(e),s=this._getMousePositionRelative(e)),i.x>0&&i.y>0&&this._move(i,s)}_dragE(t){let e=t;document.ondragover=null,this._firefoxDragPosition=null,this._dragTarget.removeEventListener(this._dragMVName,this._dragMV),this._dragTarget.removeEventListener(this._dragEVName,this._dragEV),window.TouchEvent&&t instanceof TouchEvent?this._onUp(this._getTouchPosition(e),this._getTouchPositionRelative(e),2):this._onUp(this._getMousePosition(e),this._getMousePositionRelative(e),1)}addEvents(t){this._events.forEach(e=>t.addEventListener(e,this,!1))}removeEvents(t){this._events.forEach(e=>t.removeEventListener(e,this,!1))}_move2(t){if(this._lastTouchEvent&&t.timeStamp-this._lastTouchEvent.timeStamp<16)return;const e=t.touches[0],i=t.touches[1],s=e.pageX-i.pageX,a=e.pageY-i.pageY,n=Math.abs(s)+Math.abs(a);this._pinchDistance>-1&&(n>this._pinchDistance+H?(this._setState(3),this.dispatchEvent(7,new D(this._getTouchPosition(t),this._getTouchPositionRelative(t)))):n<this._pinchDistance-H?(this._setState(3),this.dispatchEvent(8,new D(this._getTouchPosition(t),this._getTouchPositionRelative(t)))):n<=this._pinchDistance+H&&n>=this._pinchDistance-H&&(this._setState(5),this.dispatchEvent(11,new D(this._getTouchPosition(t),this._getTouchPositionRelative(t))))),this._pinchDistance=n,this._lastTouchEvent=t}_setState(t){this._state=t}_move(t,e,i,s){void 0===i&&(i=0),void 0===this._dragEnabled&&(this._dragEnabled=!1),1===this._state&&this._canDrag(i)&&(this._delta=this._getDelta(t),this._delta>k&&(this._setState(2),this._longClickTimer&&clearTimeout(this._longClickTimer),this.dispatchEvent(0,new D(t,e)))),2===this._state&&this.dispatchEvent(1,new D(t,e)),this._longClickTimer&&clearTimeout(this._longClickTimer),this.dispatchEvent(6,new D(t,e,i,null,s))}_longClick(){this._setState(2),this._longClickTimer&&clearTimeout(this._longClickTimer),this.dispatchEvent(0,new D(this._downPosition,this._downPositionRelative)),this.dispatchEvent(1,new D(this._downPosition,this._downPositionRelative))}_onUp(t,e,i){this.dispatchEvent(4,new D(t,e,i)),this._getDelta(t)<=k&&this.dispatchEvent(5,new D(t,e)),2===this._state&&this.dispatchEvent(2,new D(t,e)),4===this._state&&(this.dispatchEvent(10,new D(t,e)),this._rotationAngle=-1),3===this._state&&(this._pinchDistance=-1),this._lastTouchEvent=null,this._setState(0),this._dragTarget=null,this._elementHit=!1,this._longClickTimer&&clearTimeout(this._longClickTimer)}_getTouchPosition(t){if(t.touches.length){let{clientX:e,clientY:i}=t.touches[0];if(t.touches.length>1){const s=t.touches[1],a=s.clientX,n=s.clientY;e=(e+a)/2,i=(i+n)/2}return{x:e,y:i}}const e=t.changedTouches[0];return{x:e.clientX,y:e.clientY}}_getTouchPositionRelative(t){const e=this._boundingClientRect,{clientWidth:i,clientHeight:s}=this._domHelper.element;if(t.touches.length){const{clientX:a,clientY:n}=t.touches[0];return{x:(a-e.left)/i*2-1,y:-(n-e.top)/s*2+1}}const a=t.changedTouches[0];return{x:(a.clientX-e.left)/i*2-1,y:-(a.clientY-e.top)/s*2+1}}_getMousePosition(t){if(0!==t.clientX&&0!==t.clientY)return{x:t.clientX,y:t.clientY};{let{x:e,y:i}=this._getFireFoxMousePosition(t);return{x:e,y:i}}}_getFireFoxMousePosition(t){let{x:e,y:i}=this._domHelper.getClientDimensions();return{x:e-(e+t.offsetX),y:i-(i+t.offsetY)}}_getMousePositionRelative(t){const e=this._boundingClientRect;return 0!==t.clientX&&0!==t.clientY?{x:(t.clientX-e.left)/this._domHelper.element.clientWidth*2-1,y:-(t.clientY-e.top)/this._domHelper.element.clientHeight*2+1}:this._firefoxDragPosition&&0!==this._firefoxDragPosition.x&&0!==this._firefoxDragPosition.y?{x:(this._firefoxDragPosition.x-e.left)/this._domHelper.element.clientWidth*2-1,y:-(this._firefoxDragPosition.y-e.top)/this._domHelper.element.clientHeight*2+1}:(console.trace("this should not happen"),{x:0,y:0})}_getDelta(t){return Math.abs(this._downPosition.y-t.y)+Math.abs(this._downPosition.x-t.x)}setDragEnabled(t){this._dragEnabled=t}handleEvent(t){switch(this._debug&&t.type,t.type){case A.MOUSE_MOVE:this._onMouseMove(t);break;case A.MOUSE_DOWN:this._onMouseDown(t);break;case A.MOUSE_UP:this._onMouseUp(t);break;case A.MOUSE_LEAVE:this._onMouseLeave(t);break;case A.MOUSE_ENTER:this._onMouseEnter(t);break;case A.MOUSE_WHEEL:this._onMouseWheel(t);break;case A.TOUCH_MOVE:this._onTouchMove(t);break;case A.TOUCH_START:this._onTouchStart(t);break;case A.TOUCH_END:this._onTouchEnd(t);break;case A.CONTEXT_MENU:this._onContextMenu(t)}}_onMouseDown(t){t.preventDefault();let{x:e,y:i}=this._getMousePosition(t);this._downPosition={x:e,y:i},this._downPositionRelative=this._getMousePositionRelative(t),this.dispatchEvent(3,new D({x:e,y:i},this._downPositionRelative,1)),this._setState(1)}_onMouseUp(t){t.preventDefault(),this._onUp(this._getMousePosition(t),this._getMousePositionRelative(t),1)}_onMouseMove(t){t.preventDefault(),this._move(this._getMousePosition(t),this._getMousePositionRelative(t),1,t)}_onMouseLeave(t){this._delta=-1,this._onMouseUp(t)}_onMouseEnter(t){t.preventDefault()}_onMouseWheel(t){if(this._lastMouseWheelEvent&&t.timeStamp-this._lastMouseWheelEvent.timeStamp<40)return t.preventDefault(),void t.stopPropagation();t.deltaY<0?this.dispatchEvent(7,new D(this._getMousePosition(t),this._getMousePositionRelative(t),1,0,t)):this.dispatchEvent(8,new D(this._getMousePosition(t),this._getMousePositionRelative(t),1,0,t)),this._lastMouseWheelEvent=t}_onTouchMove(t){if(t.preventDefault(),!this._dragTarget)if(1===t.touches.length)this._move(this._getTouchPosition(t),this._getTouchPositionRelative(t),2);else if(2===t.touches.length)if(this._elementHit||4===this._state){const e=t.touches[0],i=t.touches[1];let s={x:e.pageX,y:e.pageY},a={x:i.pageX,y:i.pageY};const n=d(c(s,a));this._rotationAngle<0&&(this._rotationAngle=n);const o=n-this._rotationAngle;this._rotationAngle=n,this.dispatchEvent(9,new D(this._getTouchPosition(t),this._getTouchPositionRelative(t),2,h(o))),this._setState(4)}else this._move2(t)}_onTouchStart(t){if(t.preventDefault(),1===t.touches.length){let{x:e,y:i}=this._getTouchPosition(t);this._downPosition={x:e,y:i},this._downPositionRelative=this._getTouchPositionRelative(t),this.dispatchEvent(3,new D({x:e,y:i},this._downPositionRelative,2)),this._setState(1),this._longClickTimer=window.setTimeout(this._longClick.bind(this),350)}else 2===t.touches.length&&(1!==this._state&&2!==this._state||this._onUp(this._getTouchPosition(t),this._getTouchPositionRelative(t),2),this._setState(3))}_onTouchEnd(t){t.preventDefault(),t.touches.length>1&&5===this._state||3===this._state||this._onUp(this._getTouchPosition(t),this._getTouchPositionRelative(t),2)}_onContextMenu(t){t.preventDefault()}_canDrag(t){return this._dragEnabled}onElementHit(){this._elementHit=!0}updateSize(){this._boundingClientRect=this._domHelper.element.getBoundingClientRect()}}return n([o],t.prototype,"_domHelper",void 0),t})());var L=t("P","static/PhotoStudioRoom-5b94763849f82256.glb");class O{constructor(t,e){this._scene=t,e&&e.removeFromScene()}needsBounds(){return!1}updateBounds(t){}getCameraContainer(){return this._cameraContainer||(this._cameraContainer=new THREE.Object3D),this._cameraContainer}}t("L",O),t("D",(()=>{class t extends O{constructor(t,e){super(t,e),this._lights=[]}needsBounds(){return!0}updateBounds(t){if(this._cameraLight){const e=this._cameraLight,i=new THREE.Vector3;t.getSize(i);const s=1.5*Math.max(Math.max(i.x,i.y),i.z);this._boundingSize=s,e.shadow.camera.top=s/2,e.shadow.camera.bottom=-s/2,e.shadow.camera.left=-s/2,e.shadow.camera.right=s/2,e.shadow.camera.updateProjectionMatrix()}}loadFromJSON(t){return new Promise(e=>{this._lights=this._dynamicLightSettingLoader.parse(t),this.addToScene(),e()})}loadFromObject(t){return new Promise(e=>{t.lights||e(),this._lights=this._dynamicLightSettingLoader.load(t),this._lights.forEach((t,e)=>{t.userData.movesWithCamera&&(this._cameraLight=t,this._lights.splice(e,1))}),this.addToScene(),e()})}loadFromURL(t){return new Promise((e,i)=>{fetch(new Request(t,{method:"GET"})).then(b).then(t=>this.loadFromObject(t).then(e,i))})}addToScene(){this._lights.forEach(t=>{this._scene.add(t)}),this._cameraLight&&this._scene.add(this._cameraLight)}update(t,e){if(!this._cameraLight)return;let i=new THREE.Vector3;t.getWorldDirection(i),i.multiplyScalar(-this._boundingSize);let s=e.clone().add(i);this._cameraLight.position.copy(s)}removeFromScene(){this._lights.forEach(t=>{this._scene.remove(t)}),this._cameraLight&&this._scene.remove(this._cameraLight)}reload(){this.removeFromScene(),this.addToScene()}showGUI(){let t=u();this._cameraLight&&this._addToGUI(t,this._cameraLight),this._lights.forEach(e=>{this._addToGUI(t,e)})}_addToGUI(t,e){t&&(e instanceof THREE.SpotLight&&this._addSpotLightToGUI(t,e),e instanceof THREE.AmbientLight&&this._addAmbientLightToGUI(t,e),e instanceof THREE.DirectionalLight&&this._addDirectionalLightToGUI(t,e),e instanceof THREE.RectAreaLight&&this._addRectAreaLightToGUI(t,e))}_addRectAreaLightToGUI(t,e){let i=t.addFolder(e.name),s={name:e.name,color:"#"+e.color.getHexString(),intensity:e.intensity*(e.width*e.height)};i.add(e,"visible"),i.add(s,"intensity").min(10).max(400).step(10).onChange(t=>{e.intensity=t/(e.width*e.height)}),i.add(e,"castShadow"),i.addColor(s,"color").onChange(t=>{e.color=new THREE.Color(t)}),i.add(e.position,"x").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new THREE.Vector3(0,0,0))}),i.add(e.position,"y").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new THREE.Vector3(0,0,0))}),i.add(e.position,"z").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new THREE.Vector3(0,0,0))})}_addSpotLightToGUI(t,e){let i=t.addFolder(e.name),s={name:e.name,color:"#"+e.color.getHexString(),angle:180*e.angle/Math.PI};i.add(e,"visible"),i.add(e,"intensity").min(0).max(5).step(.1),i.add(e,"penumbra").min(0).max(1).step(.1),i.addColor(s,"color").onChange(t=>{e.color=new THREE.Color(t)}),i.add(s,"angle").min(10).max(180).step(1).onChange(t=>{e.angle=t*Math.PI/180}),i.add(e.position,"x").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new THREE.Vector3(0,0,0))}),i.add(e.position,"y").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new THREE.Vector3(0,0,0))}),i.add(e.position,"z").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new THREE.Vector3(0,0,0))})}_addAmbientLightToGUI(t,e){let i={name:e.name,color:"#"+e.color.getHexString()},s=t.addFolder(e.name);s.add(e,"visible"),s.add(e,"intensity").min(0).max(5).step(.1),s.addColor(i,"color").onChange(t=>{e.color=new THREE.Color(t)})}_addDirectionalLightToGUI(t,e){let i=t.addFolder(e.name),s={name:e.name,color:"#"+e.color.getHexString()};i.add(e,"visible"),i.add(e,"intensity").min(0).max(5).step(.1),i.addColor(s,"color").onChange(t=>{e.color=new THREE.Color(t)}),i.add(e,"castShadow"),i.add(e.position,"x").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new THREE.Vector3(0,0,0))}),i.add(e.position,"y").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new THREE.Vector3(0,0,0))}),i.add(e.position,"z").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new THREE.Vector3(0,0,0))})}}return n([o],t.prototype,"_dynamicLightSettingLoader",void 0),t})());class B{constructor(t,e){this._scene=t,e&&(e.removeFromScene(),e.cleanUp())}updateCamera(t){}reload(){this.removeFromScene(),this.addToScene()}updateBounds(t,e){this._bounds=t}cleanUp(){this._scene=null}}let Q=t("G",(()=>{class t extends B{constructor(t,e){super(t,e),this._gltfLoaderPromise=this._scriptLoader.fetch(g,{id:"gltf-loader-js"}).then(()=>{this._gltfLoader=new THREE.GLTFLoader})}needsBounds(){return!0}needsCamera(){return!0}updateBounds(t){if(super.updateBounds(t),this._backgroundMesh){let e=Math.max(t.x,t.z)/6;e=Math.max(e,1),this._backgroundMesh.scale.copy(new THREE.Vector3(e,e,e))}}updateCamera(t){if(this._backgroundMesh){let e=t.getWorldDirection(new THREE.Vector3);e.y=0,e.lengthSq()<.01&&(e=new THREE.Vector3(0,1,0),e.applyQuaternion(t.quaternion),e.y=0),e.multiplyScalar(-1),e.normalize();let i=Math.asin(e.x);e.z<0&&(i=Math.PI-i),this._backgroundMesh.rotation.set(0,i,0)}}addToScene(){this._scene&&this._backgroundMesh&&this._scene.add(this._backgroundMesh)}removeFromScene(){this._scene&&this._backgroundMesh&&this._scene.remove(this._backgroundMesh)}loadBackground(t,e){this._backgroundMaterial=e,this._backgroundMaterial||(this._backgroundMaterial=new THREE.MeshBasicMaterial),this._gltfLoaderPromise.then(()=>{this._gltfLoader.load(t,this._onBackgroundLoaded.bind(this),t=>{},t=>{console.error(t)})})}_onBackgroundLoaded(t){this._scene&&(this._backgroundMaterial.vertexColors=!0,t&&t.scene&&t.scene.children&&t.scene.children.length>0&&(t.scene.children[0].material=this._backgroundMaterial,t.scene.children[0].layers.set(2),t.scene.position.copy(new THREE.Vector3(0,0,0)),this._backgroundMesh=t.scene,this._backgroundMesh.layers.set(2),this._backgroundMesh.receiveShadow=!0,m(this._backgroundMesh,!0,!1),this.removeFromScene(),this.addToScene()))}showGUI(){console.warn("gui not implemented for gltf environment")}}return n([o],t.prototype,"_scriptLoader",void 0),t})());const I={enable:!0,shadowMapResolution:512,smoothTransition:!0,numSamples:500,numSamplesPerFrame:4,bShadowMaterial:!0,falloff:1.5,darkness:.2,size:1.6,lightSolidAngle:40,yPosition:0};class z extends B{constructor(t,e){super(t,e),this._pixotronGuard=new p,this._params=Object.assign(I,{lightDirection:new THREE.Vector3(0,1,.5),onComplete:this._addGroundShadows.bind(this),onProgress:this._progressCallback.bind(this)})}_progressCallback(t){}needsBounds(){return!0}needsCamera(){return!1}needsRotation(){return!1}setPixotron(t,e,i,s){t&&(this._pixotron=t,this._renderer=e,this._camera=i,this._shadowBaker||(this._shadowBaker=new window.PIXOTRON.PlaneShadowBakePass(Object.assign(this._params,s))),this._shadowBaker.enable?this._shadowBaker.startBake(this._renderer,this._scene,this._camera):this._shadowBaker.enable=!0,this._wasAAEnabled=this._pixotron.enableAA,this._pixotronGuard.resolve())}async _addGroundShadows(){await this._pixotronGuard.wait(),this._pixotron.needsUpdate=!0,this._shadowPlane=this._shadowBaker.getShadowPlane(),this._shadowPlane.name="Shadow plane",this._shadowPlane.receiveShadow=!1,0!==this._params.yPosition&&(this._shadowPlane.position.y=this._params.yPosition),this._shadowPlane.visible=!0,this.addToScene(),this._loadedCallback&&this._loadedCallback()}setLoadedCallback(t){this._loadedCallback=t}update(){const t=this._getNumberOfChildren();this._bake(),this._sceneChildren=t}updateBounds(t,e){const i=this._getNumberOfChildren();return!(w(this._bounds,t,1e-4)&&this._scene&&i===this._sceneChildren&&!e||(super.updateBounds(t),this._bake(),this._sceneChildren=i,0))}_bake(){this._pixotronGuard.wait().then(()=>{this._shadowPlane&&(this._shadowPlane.visible=!1),this._shadowBaker.startBake(this._renderer,this._scene,this._camera)})}_getNumberOfChildren(){let t=0;return this._scene.traverse(e=>{"Shadow plane"!==e.name&&t++}),t}addToScene(){this._scene&&this._shadowPlane&&(this._shadowPlane.material.needsUpdate=!0,E(this._shadowPlane),this._scene.add(this._shadowPlane))}removeFromScene(){this._shadowPlane&&(this._scene.remove(this._shadowPlane),this._pixotron&&(this._pixotron.enableAA=this._wasAAEnabled))}showGUI(){}}t("B",z);class U{constructor(t){this._innerSize=1,this._outerSize=100,this._plane=new THREE.Object3D,this._plane.rotation.x=-Math.PI/2;const e=new THREE.MeshStandardMaterial;this._innerPlaneMesh=new THREE.Mesh,this._innerPlaneMesh.layers.set(2),this._innerPlaneMesh.material=e,this._innerPlaneMesh.receiveShadow=!0,this._outerPlaneMesh=new THREE.Mesh,this._outerPlaneMesh.layers.set(2),this._outerPlaneMesh.material=e,this._outerPlaneMesh.receiveShadow=!0,this._plane.add(this._innerPlaneMesh),this._plane.add(this._outerPlaneMesh),this._innerSize=1,this._outerSize=t,this._updatePlane(this._innerSize,this._outerSize)}getRootNode(){return this._plane}getInnerPlane(){return this._innerPlaneMesh}getOuterPlane(){return this._outerPlaneMesh}updateSize(t){this._innerSize=t,this._updatePlane(this._innerSize,this._outerSize)}_updatePlane(t,e){const i=new THREE.Shape;i.moveTo(-t/2,-t/2),i.lineTo(-t/2,t/2),i.lineTo(t/2,t/2),i.lineTo(t/2,-t/2),i.lineTo(-t/2,-t/2);const s=new THREE.Shape;s.moveTo(-e/2,-e/2),s.lineTo(-e/2,e/2),s.lineTo(e/2,e/2),s.lineTo(e/2,-e/2),s.lineTo(-e/2,-e/2);const a=new THREE.Path;a.moveTo(-t/2,-t/2),a.lineTo(-t/2,t/2),a.lineTo(t/2,t/2),a.lineTo(t/2,-t/2),a.lineTo(-t/2,-t/2),s.holes.push(a);const n=new THREE.ShapeBufferGeometry(i);this._innerPlaneMesh.geometry&&this._innerPlaneMesh.geometry.dispose(),this._innerPlaneMesh.geometry=n;const o=new THREE.ShapeBufferGeometry(s);this._outerPlaneMesh.geometry&&this._outerPlaneMesh.geometry.dispose(),this._outerPlaneMesh.geometry=o;const h=n.attributes.uv.clone();n.setAttribute("uv2",h);const r=n.attributes.uv2.array;for(let t=0;t<r.length;++t)r[t]+=.5}}let V=t("F",(()=>{class t extends z{constructor(t,e,i){super(t,e),this._longestSide=2,this._bakedShadowPlane=new U(100),this._fog=i||!1,this._textureLoader=new THREE.TextureLoader,this.addToScene()}needsBounds(){return!0}needsCamera(){return this._fog}needsRotation(){return!1}updateBounds(t){return super.updateBounds(t),this._longestSide=Math.max(t.x,t.z),this._update(),!0}updateCamera(t){this._cameraDistance=t.position.distanceTo(new THREE.Vector3(0,0,0)),this._update()}_update(){this._fog&&this._updateFog()}_updateFog(){let t=this._longestSide/2;this._scene.fog=new THREE.Fog(16185078,this._cameraDistance+t+3,this._cameraDistance+t+3+1),this._scene.background=new THREE.Color(16185078)}_updateFloor(){if(this._floorMaterial)this._bakedShadowPlane.getOuterPlane().material=this._floorMaterial,this._bakedShadowPlane.getInnerPlane().material=this._floorMaterial;else{let t=this._width/1e3,e=this._height/1e3;this._repeatable&&(this._floorTexture.wrapS=THREE.RepeatWrapping,this._floorTexture.wrapT=THREE.RepeatWrapping,this._floorTexture.repeat.set(100/t,100/e));let i=new THREE.MeshStandardMaterial({map:this._floorTexture,side:THREE.DoubleSide});this._bakedShadowPlane.getInnerPlane().material=i,this._bakedShadowPlane.getOuterPlane().material=i}}addToScene(){this._scene&&(this._shadowPlane&&(this._bakedShadowPlane.updateSize(this._shadowPlane.scale.x),this._bakedShadowPlane.getRootNode().position.copy(this._shadowPlane.position),this._bakedShadowPlane.getInnerPlane().material.aoMap=this._shadowPlane.material.aoMap),this._scene.add(this._bakedShadowPlane.getRootNode()))}removeFromScene(){this._scene.remove(this._bakedShadowPlane.getRootNode())}setFloorMaterial(t,e,i,s){return this._width=e,this._height=i,this._repeatable=s,this._floorPromise=new Promise((e,i)=>{this._textureLoader.load(t,t=>{this._floorTexture=t,e()},null,i)}),new Promise((t,e)=>{this._floorPromise.then(()=>{this._updateFloor(),this._update(),t()},e)})}changeFloorMaterial(t,e){this._floorPromise=new Promise((i,s)=>{this._floorMaterial=P(t,this._environmentLoader),this._rapiAccess.getTexturesOf(t).then(t=>{if(t.length>0){let a=[];t.forEach(t=>{a.push(y(this._dataSyncer.requestAsset(t.image,!0),t,this._floorMaterial,e,1,1))}),Promise.all(a).then(()=>{setTimeout(()=>i(),0)},s)}else setTimeout(()=>i(),0)})});let i=[this._floorPromise];return new Promise((t,e)=>{Promise.all(i).then(()=>{this._updateFloor(),this._update(),t()},e)})}showGUI(){this._floorMaterial?this._addGUI():this._floorPromise&&this._floorPromise.then(()=>this._addGUI())}_addGUI(){let t=u();if(!t)return;let e=t.addFolder("Floor");e.add(this._floorMaterial,"roughness").min(0).max(1).step(.01),e.add(this._floorMaterial,"reflectivity").min(0).max(1).step(.01),e.add(this._floorMaterial,"clearCoat").min(0).max(1).step(.01),e.add(this._floorMaterial,"clearCoatRoughness").min(0).max(1).step(.01),e.add(this._floorMaterial,"opacity").min(0).max(1).step(.01),e.add(this._floorMaterial,"metalness").min(0).max(1).step(.01),e.add(this._floorMaterial,"bumpScale").min(0).max(1).step(.01)}}return n([o],t.prototype,"_rapiAccess",void 0),n([o],t.prototype,"_dataSyncer",void 0),n([o],t.prototype,"_environmentLoader",void 0),t})());class N extends z{constructor(t,e,i,s,a){if(super(t,e),this._color=i,this._oldBackground=t.background,s&&a){this._canvas=s,this._style=document.createElement("style");let t='background-image: url("'+a+'"); background-size: cover;';this._style.innerText=".rml-scene-background {"+t+"}",this._canvas.appendChild(this._style)}}needsBounds(){return!0}needsCamera(){return!1}needsRotation(){return!1}addToScene(){super.addToScene(),this._scene&&this._color&&(this._scene.background=this._color),this._canvas&&this._canvas.classList&&(this._scene.background=null,this._canvas.classList.add("rml-scene-background"),this._pixotron&&(this._pixotron.enableAA=!1))}removeFromScene(){super.removeFromScene(),this._oldBackground&&(this._scene.background=this._oldBackground),this._canvas&&this._canvas.classList.remove("rml-scene-background")}}t("a",N),t("c",(()=>{class t{parse(t,e,i,s){let a=JSON.parse(s);return a.environment?this.load(t,e,i,a):null}load(t,e,i,s){let a,n=s.environment;if(!n)return console.warn("No environment set in scene settings"),Promise.resolve(null);switch(n.type){case"color":a=new Promise(e=>e(new N(t,i,new THREE.Color(n.details.color))));break;case"image":a=new Promise(s=>s(new N(t,i,null,e,n.details.imageUrl)));break;case"gltf":a=new Promise(e=>{let s=new Q(t,i);s.loadBackground(S()+L),e(s)});break;case"floor":a=new Promise(e=>{this._rapiAccess.getMaterial(n.details.material).then(s=>{let a=void 0===n.details.fog||n.details.fog,o=new V(t,i,a);o.changeFloorMaterial(s).then(()=>{e(o)})})});break;case"baked_shadow":a=new Promise(s=>{n.details&&n.details.color?s(new N(t,i,new THREE.Color(n.details.color))):n.details&&n.details.imageUrl?s(new N(t,i,null,e,n.details.imageUrl)):s(new z(t,i))});break;default:console.warn("Could not load environment, return old environment"),a=new Promise(t=>t(i))}return a}}return n([o],t.prototype,"_rapiAccess",void 0),t})());class F{constructor(){this._settings=new window.PIXOTRON.QualitySettings(5),this._settings.enableAA=!0,this._settings.useAreaLight=!0,this._settings.useDevicePixelRatio=!0,this._settings.useHDREnv=!0,this._settings.useGBuffer=!0,this._settings.ssr=!0,this._settings.saoQualitySettings={enabled:!0,downscale:1,enabledOnMove:!0,useNormalWeights:!0,useAccumulative:!1,enableBlur:!0},this._settings.shadowQualitySettings={enabled:!0,downscale:1,enabledOnMove:!0}}getSettings(){return this._settings}}class G{constructor(){this._settings=new window.PIXOTRON.QualitySettings(4),this._settings.enableAA=!0,this._settings.useAreaLight=!0,this._settings.useDevicePixelRatio=!0,this._settings.useHDREnv=!0,this._settings.useGBuffer=!0,this._settings.ssr=!0,this._settings.saoQualitySettings={enabled:!0,downscale:1,enabledOnMove:!0,useNormalWeights:!0,useAccumulative:!1,enableBlur:!0},this._settings.shadowQualitySettings={enabled:!0,downscale:1,enabledOnMove:!0}}getSettings(){return this._settings}}class X{constructor(){this._settings=new window.PIXOTRON.QualitySettings(3),this._settings.enableAA=!0,this._settings.useAreaLight=!0,this._settings.useDevicePixelRatio=!1,this._settings.useHDREnv=!0,this._settings.useGBuffer=!0,this._settings.ssr=!1,this._settings.saoQualitySettings={enabled:!0,downscale:1,enabledOnMove:!0,useNormalWeights:!0,useAccumulative:!1,enableBlur:!0},this._settings.shadowQualitySettings={enabled:!0,downscale:1,enabledOnMove:!0}}getSettings(){return this._settings}}class j{constructor(){this._settings=new window.PIXOTRON.QualitySettings(2),this._settings.enableAA=!0,this._settings.useAreaLight=!0,this._settings.useDevicePixelRatio=!1,this._settings.useHDREnv=!1,this._settings.useGBuffer=!0,this._settings.ssr=!1,this._settings.saoQualitySettings={enabled:!0,downscale:1,enabledOnMove:!0,useNormalWeights:!0,useAccumulative:!1,enableBlur:!1},this._settings.shadowQualitySettings={enabled:!0,downscale:1,enabledOnMove:!0}}getSettings(){return this._settings}}class W{constructor(){this._settings=new window.PIXOTRON.QualitySettings(1),this._settings.enableAA=!0,this._settings.useAreaLight=!0,this._settings.useDevicePixelRatio=!1,this._settings.useHDREnv=!1,this._settings.useGBuffer=!0,this._settings.ssr=!1,this._settings.saoQualitySettings={enabled:!1,downscale:1,enabledOnMove:!0,useNormalWeights:!0,useAccumulative:!1,enableBlur:!1},this._settings.shadowQualitySettings={enabled:!0,downscale:1,enabledOnMove:!0}}getSettings(){return this._settings}}class Y{constructor(){this._settings=new window.PIXOTRON.QualitySettings(0),this._settings.enableAA=!1,this._settings.useAreaLight=!1,this._settings.useDevicePixelRatio=!1,this._settings.useHDREnv=!1,this._settings.useGBuffer=!0,this._settings.ssr=!1,this._settings.saoQualitySettings={enabled:!1,downscale:1,enabledOnMove:!0,useNormalWeights:!0,useAccumulative:!1,enableBlur:!1},this._settings.shadowQualitySettings={enabled:!1,downscale:1,enabledOnMove:!0}}getSettings(){return this._settings}}t("b",class{constructor(t){this._sceneBoundingSphere=new THREE.Sphere,this._pixotron=t,this._initializeQualitySettings(),this._initializeQualityAdapters()}getPixotronInstance(t){const e={saoparams:{intensity:.5,occlusionWorldRadius:.6,smoothTransition:!0,bias:.02,accumulative:!1},shadowparams:{shadowQuality:1,smoothTransition:!0,enableAccumulation:!0,shadowBiasMultiplier:.05,nearPlane:.01,farPlane:50,fov:40,numSamples:100,side:THREE.FrontSide}};return t=t||e,new window.PIXOTRON.Pixotron(t)}showGUI(){let t=u();if(!t)return;let e=t.addFolder("Renderer");e.add(this._pixotron.getSAOPass(),"enabled"),this._pixotron.getSAOPass().smoothTransition&&e.add(this._pixotron.getSAOPass(),"smoothTransition"),e.add(this._pixotron.getSAOPass(),"occlusionWorldRadius").min(0).max(1).step(1e-4).onChange(t=>{this._adjustSaoRadius(t)}),e.add(this._pixotron.getSAOPass(),"intensity").min(.1).max(2).step(.05),e.add(this._pixotron.getSAOPass(),"bias").min(0).max(1).step(1e-4).onChange(t=>{this._adjustSaoBias(t)}),this._pixotron.getSAOPass().numSamples&&e.add(this._pixotron.getSAOPass(),"numSamples").min(10).max(3e3).step(10),void 0!==this._pixotron.getShadowPass().enabled&&e.add(this._pixotron.getShadowPass(),"enabled"),e.add(this._pixotron.getShadowPass(),"smoothTransition"),e.add(this._pixotron.getShadowPass(),"enableAccumulation"),e.add(this._pixotron.getShadowPass(),"shadowRadius").min(0).max(5).step(.1),e.add(this._pixotron.getShadowPass(),"shadowBiasMultiplier").min(0).max(3).step(.01),e.add(this._pixotron.getShadowPass(),"numSamples").min(10).max(3e3).step(10)}updateBounds(t){this._sceneBoundingSphere.copy(t);const e=.25*this._getMaxSaoRadius();this._adjustSaoRadius(e);const i=2*this._getMinSaoBias();this._adjustSaoBias(i)}_getSaoRadius(){return this._sceneBoundingSphere.radius}_adjustSaoRadius(t){const e=this._pixotron.getSAOPass(),i=this._getMinSaoRadius(),s=this._getMaxSaoRadius();e.occlusionWorldRadius=Math.min(Math.max(t,i),s)}_adjustSaoBias(t){const e=this._pixotron.getSAOPass(),i=this._getMinSaoBias(),s=this._getMaxSaoBias();e.bias=Math.min(Math.max(t,i),s)}_getMinSaoRadius(){return.001*this._getSaoRadius()}_getMaxSaoRadius(){return.6*this._getSaoRadius()}_getMinSaoBias(){return.001*this._getSaoRadius()}_getMaxSaoBias(){return.01*this._getSaoRadius()}updatePixelRatio(t){const e=new THREE.Vector2;t.getDrawingBufferSize(e),this._pixotron.setSize(Math.floor(e.width),Math.floor(e.height))}getHighPixelRatioQualitySetting(){return this._highPixelRatioQualitySetting.getSettings()}getLowestQualitySetting(){return this._lowQualitySetting.getSettings()}_initializeQualitySettings(){this._highestQualitySetting=new G,this._highPixelRatioQualitySetting=new F,this._highQualitySetting=new X,this._midQualitySetting=new j,this._lowQualitySetting=new W,this._lowestQualitySetting=new Y}_initializeQualityAdapters(){this._autoQualityAdapter=new window.PIXOTRON.AutoQualityAdapter(this._pixotron),this._autoQualityAdapter.addQuality(this._highestQualitySetting.getSettings()),this._autoQualityAdapter.addQuality(this._highQualitySetting.getSettings()),this._autoQualityAdapter.addQuality(this._midQualitySetting.getSettings()),this._autoQualityAdapter.addQuality(this._lowQualitySetting.getSettings()),this._autoQualityAdapter.addQuality(this._lowestQualitySetting.getSettings()),this._autoQualityAdapter.setDesiredFps(20),this._manualQualityAdapter=new window.PIXOTRON.ManualQualityAdapter(this._pixotron)}onAutoQualityChange(t){this._autoQualityAdapter.onQualityChange(t)}onManualQualityChange(t){this._manualQualityAdapter.onQualityChange(t)}getAutoAdapter(){return this._autoQualityAdapter}lockAdapter(){this._autoQualityAdapter.getCurrentQualitySetting().lock()}unLockAdapter(){this._autoQualityAdapter.getCurrentQualitySetting().unLock()}enablePixotronAutoQuality(){this._currentQualityAdapter||(this._currentQualityAdapter=this._autoQualityAdapter,this._pixotron.setQualityAdapter(this._autoQualityAdapter))}movingCameraStarts(){this._currentQualityAdapter&&(this._currentQualityAdapter=this._autoQualityAdapter,this._currentQualitySetting&&(this._manualQualityAdapter.setQualitySetting(this._currentQualitySetting),this._pixotron.setQualityAdapter(this._manualQualityAdapter)),this._pixotron.setQualityAdapter(this._autoQualityAdapter))}movingCameraStops(){this._currentQualityAdapter&&(this._currentQualitySetting=this._currentQualityAdapter.getCurrentQualitySetting(),this._currentQualityAdapter=this._manualQualityAdapter,this._pixotron.setQualityAdapter(this._manualQualityAdapter),this._manualQualityAdapter.setQualitySetting(this._highestQualitySetting.getSettings()))}}),t("g","static/pi.min-0272f873b3a4380a.js"),t("e",["static/CopyShader-cde53240fcc3e06e.js","static/EffectComposer-1e936e5d03ff43cc.js","static/RenderPass-bc5df3810a01b2c6.js","static/ShaderPass-31f36160e0ea282d.js","static/LuminosityHighPassShader-dd5826656142421d.js","static/OutlinePass-f4bcd337cdd89b8d.js","static/RectAreaLightUniformsLib-4b74882185efd473.js","static/GammaCorrectionShader-b3b56f244f0d1e0e.js"])}}}));
|
|
2
|
-
//# sourceMappingURL=pixotron-d879cbb4.legacy.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
System.register(["./query-params-helper-8c00a872.legacy.js","./rapi-access-0564780f.legacy.js","./main-thread-to-worker-4c02f179.legacy.js","./image-renderer-ab8f30f8.legacy.js","./pixotron-d879cbb4.legacy.js","./mesh-generator-3a36e30e.legacy.js","./default-light-setting-1962bfd5.legacy.js","./scene-manager-566f79ad.legacy.js"],(function(e,t){var n,a,i,s,r,o,l,h,c,d,_,g,p,m,u,S,w,C,f,E,v,M,b,I,k,y,P,H,L,D,T,R,O,V,A,B,j,x,G,F,K,z,U,q,W,X,N,Q,J,Y,Z;return{setters:[function(){},function(e){n=e.h,a=e._,i=e.i,s=e.a4,r=e.d,o=e.F,l=e.a5,h=e.j,c=e.B,d=e.J,_=e.a6,g=e.r,p=e.G,m=e.a7,u=e.c,S=e.V,w=e.a2,C=e.U,f=e.n,E=e.L,v=e.o,M=e.s},function(e){b=e.s,I=e.l,k=e.m},function(e){y=e.S,P=e.c,H=e.d,L=e.G,D=e.b,T=e.a,R=e.g,O=e.P,V=e.C},function(e){A=e.L,B=e.B,j=e.a,x=e.C,G=e.h,F=e.T,K=e.e,z=e.g,U=e.I,q=e.E,W=e.S,X=e.M},function(e){N=e.M},function(e){Q=e.D},function(e){J=e.S,Y=e.C,Z=e.a}],execute:function(){class $ extends A{constructor(e,t){super(e,t),this._center=new THREE.Vector3(0,0,0),this._params={ambientLight:{color:"#ffffff"},hemiLight:{color:"#ffffff"},mainDirLight:{direction:{x:.03,y:1,z:.03},color:"#ffffff"}},this._ambientLight=new THREE.AmbientLight(new THREE.Color(this._params.ambientLight.color),.3),this._ambientLight.layers.set(1),this._mainDirLight=new THREE.DirectionalLight(new THREE.Color(this._params.mainDirLight.color),.5),this._mainDirLight.castShadow=!0,this._mainDirLight.shadow.camera.near=.5,this._mainDirLight.shadow.camera.far=100,this._mainDirLight.shadow.mapSize=new THREE.Vector2(1024,1024),this._mainDirLight.visible=!0,this.addToScene()}updateSunPosition(e,t){}addToScene(){this._scene.add(this._mainDirLight),this._scene.add(this._ambientLight),this._scene.add(this._mainDirLight.target)}removeFromScene(){this._scene.remove(this._mainDirLight),this._scene.remove(this._ambientLight),this._scene.remove(this._mainDirLight.target)}reload(){this.removeFromScene(),this.addToScene()}needsBounds(){return!0}updateBounds(e){this._center.copy(e.getCenter(new THREE.Vector3));const t=new THREE.Sphere;e.getBoundingSphere(t);const n=t.radius,a=new THREE.Vector3(this._params.mainDirLight.direction.x,this._params.mainDirLight.direction.y,this._params.mainDirLight.direction.z);a.normalize(),a.multiplyScalar(n),this._mainDirLight.position.copy(this._center),this._mainDirLight.position.add(a),this._mainDirLight.target.position.copy(this._center),this._mainDirLight.target.updateMatrixWorld(!0),this._mainDirLight.shadow.camera.top=n,this._mainDirLight.shadow.camera.bottom=-n,this._mainDirLight.shadow.camera.left=-n,this._mainDirLight.shadow.camera.right=n,this._mainDirLight.shadow.camera.near=.01,this._mainDirLight.shadow.camera.far=2*n,this._mainDirLight.shadow.camera.updateProjectionMatrix()}showGUI(){let e=n();if(e){if(this._ambientLight){let t=e.addFolder("Ambient Light");t.add(this._ambientLight,"visible"),t.add(this._ambientLight,"intensity").min(0).max(5).step(.1),t.addColor(this._params.ambientLight,"color").onChange(e=>this._ambientLight.color=new THREE.Color(e))}if(this._hemiLight){let t=e.addFolder("Hemi Light");t.add(this._hemiLight,"visible"),t.add(this._hemiLight,"intensity").min(0).max(5).step(.1),t.addColor(this._params.hemiLight,"color").onChange(e=>this._hemiLight.color=new THREE.Color(e))}if(this._mainDirLight){let t=e.addFolder("Main Directional Light");t.add(this._mainDirLight,"visible"),t.add(this._mainDirLight,"intensity").min(0).max(10).step(.1),t.add(this._mainDirLight,"castShadow"),t.addColor(this._params.mainDirLight,"color").onChange(e=>this._mainDirLight.color=new THREE.Color(e)),t.add(this._mainDirLight.position,"x").min(-10).max(10).step(.1).onChange(()=>this._mainDirLight.lookAt(this._center)),t.add(this._mainDirLight.position,"y").min(-10).max(50).step(.1).onChange(()=>this._mainDirLight.lookAt(this._center)),t.add(this._mainDirLight.position,"z").min(-10).max(10).step(.1).onChange(()=>this._mainDirLight.lookAt(this._center))}}}}class ee{constructor(e){const{planElementViewModel:t,resetCamera:n,state:a,oldState:i}=e;this.planElementViewModel=t,this.resetCamera=void 0===n||n,this.state=void 0===a?0:a,this.oldState=void 0===i?0:i}}let te=(()=>{class e extends y{constructor(e,t,n,a){super(e,t,n,a),this._state=0,this._inputManager.addEventListener(4,()=>this._position=null,this),this._raycastHelper.setMode(0);const i=new THREE.Layers;i.enable(3),i.enable(6),this._raycastHelper.setLayers(i),this._raycastHelper.addEventListener(3,()=>{this._plannerSelectionHandler.cancelSelection()},this),this._plannerSelectionHandler.addEventListener(0,({planElementViewModel:e})=>{this.dispatchEvent(0,new ee({planElementViewModel:e}))},this),this._plannerSelectionHandler.addEventListener(1,({planElementViewModel:e})=>{this.setState(0),this.dispatchEvent(1,new ee({planElementViewModel:e}))},this),this._inputManager.addEventListener(6,e=>this._move(e),this)}getSelectionMode(){return this._plannerSelectionHandler.getSelectionMode()}async addPlanObjectHandlers(e,t){t||(t=await e.getObjectAsync());const n={hasListener:!0,priority:1,roomleId:e.getId()};this._addPlanObjectHandlers(e,t,n)}addWallHandlers(e){this._addPlanElementHandlers(e,e.getBoundingBox(),{hasListener:!0,priority:1,roomleId:e.getId()})}_addPlanObjectHandlers(e,t,n){t.userData.hasListener||(t.userData=n,t.addEventListener("select",()=>this._clickElement(e)),t.addEventListener("drag_start",()=>this._dragStart(e)),t.addEventListener("drag",t=>this._drag(e,t.attachment.position)),t.addEventListener("drag_end",t=>this._dragEnd(e,t.attachment.position)),t.addEventListener("hover_on",()=>this._hoverOn(e)),t.addEventListener("hover_off",()=>this._hoverOff(e)),t.addEventListener("rotate",t=>this._rotate(e,t.attachment.rotation)))}_addPlanElementHandlers(e,t,n){t.userData.hasListener||(t.userData=n,t.addEventListener("select",()=>this._clickElement(e)),t.addEventListener("drag_start",()=>this._dragStart(e)),t.addEventListener("drag",t=>this._drag(e,t.attachment.position)),t.addEventListener("drag_end",t=>this._dragEnd(e,t.attachment.position)),t.addEventListener("hover_on",()=>this._hoverOn(e)),t.addEventListener("hover_off",()=>this._hoverOff(e)))}_clickElement(e){this._debug&&e.getId(),this._plannerSelectionHandler.check(e),this._setCursor()}_hoverOn(e){this._hoveredObject=e,this._setCursor()}_hoverOff(e){this._hoveredObject=null,this._setCursor()}_setCursor(){2===this._state&&this._hasSelection()?b("ew-resize"):1===this._state?b("grabbing"):this._hoveredObject&&this._plannerSelectionHandler.isSelected(this._hoveredObject.getId())?b("move"):this._hoveredObject?b("pointer"):b("default")}setCamera(e){this._raycastHelper.setCamera(e)}setScene(e){this._raycastHelper.setScene(e)}getSelectedIds(){return this._plannerSelectionHandler.getSelectedIds()}setSelectionMode(e){this._plannerSelectionHandler.setSelectionMode(e)}setPlanViewModel(e){this._planViewModel=e}cancelSelection(){this._plannerSelectionHandler.cancelSelection()}_dragStart(e){this._plannerSelectionHandler.isSelected(e.getId())&&0===this._state&&(this._draggedObject=e,this.setState(1),this.dispatchEvent(4,new ee({planElementViewModel:e})),this._setCursor())}_drag(e,t){if(!this._draggedObject||1!==this._state)return;const n=this._plannerKernelAccess.planInteractionHandler;if(this._plannerSelectionHandler.getSelectedIds().length>1){const e=new this._plannerKernelAccess.kernelContainer.PlanObjectPtrList;let a=t.sub(this._draggedObject.getPosition());this._plannerSelectionHandler.getSelectedIds().forEach(t=>e.push_back(this._planViewModel.getPlanObjectForId(t).getPlanObject())),n.moveObjectsBy(e,s(a))}else n.moveElementTo(e.getPlanElement(),s(t));this.dispatchEvent(5,new ee({planElementViewModel:e}))}_dragEnd(e,t){this._draggedObject&&(this._draggedObject=null,this.setState(0),this.dispatchEvent(6,new ee({planElementViewModel:e})),this._dragIn&&(this.cancelSelection(),this.setDragIn(!1)),this._setCursor())}_rotate(e,t){if(this._plannerSelectionHandler.isSelected(e.getId())){const n=this._plannerKernelAccess.planInteractionHandler,a=e.getPlanObject();n.setObjectRotation(e.getPlanElement(),a.rotation-t)}}setState(e){const t=this._state;this._state=e,this._setCursor(),this.dispatchEvent(2,new ee({state:this._state,oldState:t})),this._position=null,2===this._state&&this._plannerKernelAccess.planInteractionHandler.deactivateAllSnappingActivity()}resetState(){this.setState(0)}_move(e){if(2===this._state&&this._hasSelection()){this._setCursor();let t=Math.PI/180;const{x:n,y:a}=e.positionRelative;this._position?t=1.4*e.positionRelative.x*Math.PI-1.4*this._position.x*Math.PI:this._position=new THREE.Vector3(e.positionRelative.x,e.positionRelative.y,0);const i=new this._plannerKernelAccess.kernelContainer.PlanObjectPtrList,r=new THREE.Box3;this.getSelectedIds().forEach(e=>{var t;const n=null===(t=this._planViewModel)||void 0===t?void 0:t.getPlanObjectForId(e);n&&n.getObject()&&(i.push_back(n.getPlanObject()),r.expandByObject(n.getContainer()))});const o=r.getCenter(new THREE.Vector3);this._plannerKernelAccess.planInteractionHandler.rotateObjectsBy(i,t,s(o)),this._position.copy(new THREE.Vector3(n,a,0))}}_hasSelection(){return this._plannerSelectionHandler.getSelectedIds().length>0}selectPlanElement(e){this._plannerSelectionHandler.check(e)}_interaction(e){this.dispatchEvent(0,new ee({}))}addComponentDragInHandler(e){if(!this._dragIn)return;const t=e.getBoundingBox();this._addPlanElementHandlers(e,t,{hasListener:!0,priority:1,roomleId:e.getId()}),this._raycastHelper.enableDragIn(t),this._dragStart(e)}}return a([i],e.prototype,"_plannerSelectionHandler",void 0),a([i],e.prototype,"_plannerKernelAccess",void 0),e})(),ne=(()=>{class e extends J{constructor(e,t,n,a){super(e,t,r.HSP,a),this._staticItemGuard=new o,this._configurableItemGuard=new o,this._roomlePlannerCallback=n,this._plannerMeshGenerator.maxAnisotropy=this._renderer.capabilities.getMaxAnisotropy(),this._plannerMeshGenerator.maxTextures=this._renderer.capabilities.maxTextures,this._plannerSceneEventHandler=new te(e,this._scene,this._cameraControl.getCamera(),this._getInputManager()),this._plannerSceneEventHandler.addEventListener(2,({state:e,oldState:t})=>{2===t&&e!==t&&this._roomlePlannerUiCallback.onRotationCancel(),2===e||1===e?this._cameraControl.lock():this._cameraControl.unlock()},this),this._plannerSceneEventHandler.addEventListener(0,({planElementViewModel:e})=>{e instanceof P&&this._initData.debug&&e.getGLBUrl(),this._highlight(e),this._onSelectionChange(e)},this),this._plannerSceneEventHandler.addEventListener(1,()=>{this._highlight(null),this._roomlePlannerUiCallback.onSelectionCancel()},this),this._plannerSceneEventHandler.addEventListener(4,()=>{this._plannerKernelAccess.planInteractionHandler.startInteraction(),this._cameraControl.lock(),this._environment instanceof B&&this._environment.removeFromScene(),this._requestRender(),this._dragStartBounds=this.getBounds()},this),this._plannerSceneEventHandler.addEventListener(5,({planElementViewModel:e})=>{this._cameraControl.checkNearFarDistance(e.getPosition()),this._requestRender()},this),this._plannerSceneEventHandler.addEventListener(6,({planElementViewModel:e})=>{const t=this._plannerKernelAccess.planInteractionHandler;t.endInteraction(),this._cameraControl.unlock(),this._environment instanceof B&&this._environment.addToScene();const n=this._getDragPosition(e.getPosition());n&&t.moveElementTo(e.getPlanElement(),s(n)),this._renderEverything(),this.updateEnvironment(this.getBounds(),!0),this._zoomToBounds()},this),this._plannerKernelAccess.addPlannerListener(this),this._plannerMeshGenerator.setMaterialLoadedListener(()=>{this._configurableItemGuard.resolve(),this._requestRender()}),window.onbeforeunload=this.clearScene.bind(this)}_getDragPosition(e){if(!this._plannerSceneEventHandler.isDragIn())return null;const t=this._dragStartBounds?this._dragStartBounds:this.getBounds(),n=t.getCenter(new THREE.Vector3),a=e.distanceTo(n),i=t.getSize(new THREE.Vector3),s=Math.max(i.x,i.z)+3;if(a>s){const t=(new THREE.Vector3).subVectors(e,n).normalize();return n.clone().add(t.multiplyScalar(s))}return null}_onSelectionChange(e){let t;e instanceof P&&(t="static"),e instanceof H&&(t="configuration");const n={};if(e instanceof P&&(n.item=e.getRapiItem()),e instanceof H){const t=e.getConfigurationRuntimeId();n.configurationRuntimeId=t}const a=(async()=>{const n={};if(e instanceof P&&(n.item=e.getRapiItem()),e instanceof H){const a=e.getConfigurationRuntimeId(),i=e.getPlanObject().getCatalogItemId(),s=this._plannerKernelAccess.kernelInstance.getHashOfConfiguration(a);let r;if(i&&g(i)){const e=await this._rapiAccess.getItem(i);n.item=e,r=e.rootComponentId?e.rootComponentId:null}else try{const e=await this._rapiAccess.getConfiguration(s);n.configuration=e,r=e.rootComponentId?e.rootComponentId:null}catch(e){console.warn("Could not get RAPI configuration for kernel hash "+s+", saving configuration...");const t=await this._plannerKernelAccess.getConfigurationData(a),i=await this._rapiAccess.saveConfiguration(t);n.configuration=i,r=i.rootComponentId?i.rootComponentId:null}if(r){const e=await this._rapiAccess.getComponent(r);n.component=e}n.configurationRuntimeId=a,t="configuration"}return I(n)})();this._roomlePlannerUiCallback.onSelectionChange(I(this._plannerSceneEventHandler.getSelectionMode()),I(t),I(n),a)}_setupScene(e,t){super._setupScene(e,t),this._initData.moc?(this._lightSetting=new Q(this._scene),this._setEnvironment(new j(this._scene,this._environment,new THREE.Color(this._initData.colors.DEFAULT_BACKGROUND)))):(this._lightSetting=new $(this._scene),this._addSky(),this._setEnvironment(new B(this._scene,this._environment)))}onBeforeRender(){this._cameraControl instanceof x&&this._plannerMeshGenerator.wallMeshes.forEach(e=>l(this._cameraControl.getCamera(),e.material))}_getInputManager(){return this._plannerInputManager}createCameraControl(e){this.setMode(e)}resetCamera(){this._cameraControl.hasSavedState()?this.resetCameraToState():this.resetCameraPositionToStart()}resetCameraToState(){this._cameraControl.resetToState()}resetCameraPositionToStart(){this._requestRender()}_getYRotationOfObject(e){let t=e.getWorldDirection(new THREE.Vector3).clone();t.y=0,t.lengthSq()<.01&&(t=new THREE.Vector3(0,1,0),t.applyQuaternion(e.quaternion),t.y=0),t.normalize();let n=Math.asin(t.x);return t.z<0&&(n=Math.PI-n),n<0&&(n+=2*Math.PI),n}loadStaticPlanObjects(){let e=new Map;this._planViewModel.getStaticPlanObjectViewModels().forEach(t=>{let n=t.getPlanObject();e.has(n.getCatalogItemId())?e.get(n.getCatalogItemId()).push(t):e.set(n.getCatalogItemId(),[t])}),this._rapiAccess.getItems(Array.from(e.keys())).then(t=>{let n=[];t.forEach(t=>{this._plannerKernelAccess.catalogItemLoaded(t),e.get(t.id).forEach(e=>{n.push(new Promise((n,a)=>{e.setRapiItem(t).then(()=>{this._requestRender(),n()},a)}))})}),Promise.all(n).then(()=>this._staticItemsLoaded())})}_staticItemsLoaded(){this._requestRender(),this._staticItemGuard.resolve(),this._roomlePlannerUiCallback.onItemsLoaded()}preload(e){this._planId=e;let t=this._localStorageHelper.getItem(this._planId,"rml_plans");t&&this._loadGLTF(t).then(e=>{this._preloadScene=e,this._preloadScene&&this._scene.add(this._preloadScene),this._requestRender()})}planXMLLoaded(e){this.endPlanConstruction(e);const t=e.getBounds(),n=h(t);this._updateBounds(n),this.loadStaticPlanObjects()}planCompletelyLoaded(e){this._requestRender()}handlerSwitchedPlans(e){if(this._planViewModel=e,this._planViewModel.setPlannerSceneEventHandler(this._plannerSceneEventHandler),this._planViewModel.setGeometriesMergedListener(()=>{this._renderEverything()}),this._plannerSceneEventHandler.setPlanViewModel(this._planViewModel),this.clearScene(),!this._initData.moc){this._addSky();let e=new THREE.PlaneGeometry(1e3,1e3);e.rotateX(-Math.PI/2);let t=new THREE.MeshStandardMaterial({color:"#f0f0f0",roughness:1,metalness:0}),n=new THREE.Mesh(e,t);n.name="Ground",n.position.y=-.01,n.receiveShadow=!0,this._scene.add(n)}this.resetCamera(),this._setCeiling(),this._staticItemGuard.reset(),this._configurableItemGuard.reset(),Promise.all([this._staticItemGuard.wait(),this._configurableItemGuard.wait()]).then(this._itemsLoaded.bind(this))}_itemsLoaded(){const e=this._planViewModel.getCorePlan();if(this._pixotron){const t=h(e.getBounds());this._pixotron.getShadowPass().setShadowRecieverBBox(t)}this._roomlePlannerUiCallback.onCompletelyLoaded(),this.updateEnvironment(),this._renderEverything(),c.end("loadingTime")}beginPlanConstruction(e){}addPlanMesh(e,t,n,a,i,s,r){}endPlanConstruction(e){this._renderLoopFunction=()=>{this._scene.add(this._planViewModel.getConstructionGroup()),this._scene.add(this._planViewModel.getCeilingGroup()),this._lightSetting.needsBounds()&&this._lightSetting.updateBounds(this._planViewModel.getBoundingBox()),this._scene.remove(this._preloadScene)}}addPlanObjectToScene(e){const t=e.getContainer();d(t),this._scene.add(t),this._zoomToBounds(),this._plannerSceneEventHandler.isDragIn()&&(this._plannerSceneEventHandler.selectPlanElement(e),this._plannerSceneEventHandler.addComponentDragInHandler(e),this._requestRender())}removePlanObjectFromScene(e){this._scene.remove(e.getContainer()),this.updateEnvironment(this.getBounds()),this._renderEverything()}planElementChanged(e,t){this.updateEnvironment(this.getBounds(),!0),this._renderEverything(),this._onPlanChanged()}exportGLB(e,t){this._scriptLoader.fetch(L,{id:"gltf-exporter"}).then(()=>{let n=new THREE.GLTFExporter;e||(e=[],this._scene.children.forEach(t=>{this._isPartOfScene(t)&&e.push(t)})),n.parse(e,e=>{let n=t||"test";this._localStorageHelper.addItem(n,JSON.stringify(e),"rml_plans")},{binary:!1,embedImages:!0,forceIndices:!0})})}importGLB(e){this._loadGLB(e).then(e=>this._scene.add(e))}clearScene(){this._plannerMeshGenerator.clear(),this._planViewModel.sceneCleared(),super.clearScene()}_addSky(){this._sky=new THREE.Sky,this._sky.name="Sky",this._sky.scale.setScalar(45e4),this._scene.add(this._sky),this._sky.material.uniforms.turbidity.value=10,this._sky.material.uniforms.rayleigh.value=2,this._sky.material.uniforms.luminance.value=1,this._sky.material.uniforms.mieCoefficient.value=.005,this._sky.material.uniforms.mieDirectionalG.value=.8;let e=new THREE.Mesh(new THREE.SphereBufferGeometry(2e4,16,8),new THREE.MeshBasicMaterial({color:16777215}));e.name="Sunsphere",e.position.y=-7e5,e.visible=!1,this._scene.add(e);let t=-.2*Math.PI,n=2*Math.PI*-.25;e.position.x=4e5*Math.cos(n),e.position.y=4e5*Math.sin(n)*Math.sin(t),e.position.z=4e5*Math.sin(n)*Math.cos(t),e.visible=!0,this._sky.material.uniforms.sunPosition.value.copy(e.position),this._lightSetting instanceof $&&this._lightSetting.updateSunPosition(.3,.25)}switchTo2D(){this._cameraControl instanceof Y||(this._requestRender(),this._changeCameraControl(new Y(this._creator_,this._getInputManager())),this._updateCamera(),this._addCameraControlListener(),this._setCeiling(),this._roomlePlannerUiCallback.onCameraChanged("2D"))}switchTo3D(){this._cameraControl instanceof x||(this._changeCameraControl(new x(this._creator_,this._getInputManager(),new THREE.Vector3(0,10,0),this.getPerspectiveOffsetCamera())),this._updateCamera(),this._addCameraControlListener(),this._setCeiling(),this._roomlePlannerUiCallback.onCameraChanged("3D"))}_setCeiling(){this._planViewModel&&(this._cameraControl instanceof Z?this._planViewModel.getCeilingGroup().visible=!0:this._planViewModel.getCeilingGroup().visible=!1)}cameraControlChanged(){super.cameraControlChanged(),this._plannerSceneEventHandler&&this._plannerSceneEventHandler.setCamera(this._cameraControl.getCamera())}sceneChanged(){this._plannerSceneEventHandler&&this._plannerSceneEventHandler.setScene(this._scene)}closeHSC(){this._requestRender(),this._cameraControl instanceof x&&this._cameraControl.resetToState()}switchToFirstPerson(){if(this._cameraControl instanceof Z)return;this._plannerMeshGenerator.wallMeshes.forEach(e=>_(e.material,!1,!1)),this._requestRender();let e=new THREE.Vector3(0,0,0);this._planViewModel&&(e=this._planViewModel.getBoundingBox().getCenter(new THREE.Vector3)),this._cameraControl&&this._cameraControl.cleanUp(),this._changeCameraControl(new Z(this._creator_,this._getInputManager(),e,this.getPerspectiveOffsetCamera())),this._addCameraControlListener(),this._setCeiling(),this._roomlePlannerUiCallback.onCameraChanged("FP")}_onKeyDown(e){super._onKeyDown(e),this._initData.debug&&this._checkNumKey(e),!e.key||"Meta"!==e.key&&"Control"!==e.key||(this._plannerSceneEventHandler.setSelectionMode("multiselect"),e.preventDefault()),e.key&&e.key.includes("Shift")&&this._cameraControl instanceof x&&(this._cameraControl.enablePanning(),e.preventDefault())}_checkNumKey(e){e.key&&"1"===e.key&&(this.switchTo2D(),e.preventDefault()),e.key&&"2"===e.key&&(this.switchTo3D(),e.preventDefault()),e.key&&"3"===e.key&&(this.switchToFirstPerson(),e.preventDefault())}_onKeyUp(e){super._onKeyDown(e),!e.key||"Meta"!==e.key&&"Control"!==e.key||(this._plannerSceneEventHandler.setSelectionMode("standard"),e.preventDefault()),e.key&&e.key.includes("Shift")&&this._cameraControl instanceof x&&(this._cameraControl.disablePanning(),e.preventDefault())}setMode(e){switch(e){case"2D":this.switchTo2D();break;case"3D":this.switchTo3D();break;case"FP":this.switchToFirstPerson()}}_highlight(e){let t=new Set;e&&e.getObject()&&e.getObject().children&&e.getObject().children.forEach(e=>t.add(e)),this._plannerSceneEventHandler.getSelectedIds().forEach(e=>{const n=this._planViewModel.getPlanObjectForId(e);n&&n.getObject()&&n.getObject().children&&n.getObject().children.forEach(e=>t.add(e))}),this._pixotron&&this._pixotron.highlightObjects(Array.from(t))}destroy(){super.destroy(),this._plannerMeshGenerator.removeMaterialLoadedListener(),this._planViewModel.removeGeometriesMergedListener()}getPixotronParams(){return{saoparams:{intensity:.5,occlusionWorldRadius:.6,smoothTransition:!0,samplesPerFrame:4,bias:.02,numSamples:100,accumulative:!1,falloff:2},shadowparams:{shadowMapResolution:1024,shadowRadius:3,shadowQuality:1,smoothTransition:!0,enableAccumulation:!0,shadowBiasMultiplier:.6,nearPlane:.01,farPlane:50,fov:110,side:THREE.FrontSide,numSamples:100},outlineparams:{highlightColor:new THREE.Color(this._initData.colors.SELECTION),edgeStrength:1,transparency:.9,edgeThickness:2}}}getBakedShadowParams(){return{enable:!0,shadowMapResolution:1024,smoothTransition:!0,numSamples:500,numSamplesPerFrame:4,bShadowMaterial:!0,falloff:1.8,darkness:.3,size:1.2,lightDirection:new THREE.Vector3(0,1,0),lightSolidAngle:40,yPosition:.006}}planObjectConfigurationLoaded(e,t,n){if(e&&e.extRef&&t&&t.extRef){let e=t.extRef.jsObject.getPlanObject().getConfigurationRuntimeId();e>0&&this._planViewModel.constructComponents(e)}}addMesh(e,t,n,a,i,s){}_updateBounds(e){e&&(this._updateCamera(e),super._updateBounds(e))}_updateCamera(e){if(e||(e=this.getBounds()),e){if(this._cameraControl instanceof x){const t=e.getSize(new THREE.Vector3),n=Math.max(t.x,t.z),a=this._initData.moc?.5*n*-1:5,i=this._initData.moc?G:70;this._cameraControl.updateAndReset(t,e.getCenter(new THREE.Vector3),-15,i,a,!1)}this._cameraControl instanceof Y&&this._cameraControl.updateToBounds(e.getSize(new THREE.Vector3),e.getCenter(new THREE.Vector3))}}_zoomToBounds(){const e=this.getBounds();this._cameraControl instanceof x&&this._cameraControl.zoomToFitBounds(e)}getBounds(){return this._planViewModel?this._planViewModel.getBoundingBox():null}cancelSelection(){this._plannerSceneEventHandler.cancelSelection(),this._highlight(null),this._requestRender()}deleteSelection(){const e=this._plannerSceneEventHandler.getSelectedIds();this.cancelSelection(),e.forEach(e=>{const t=this._planViewModel.getPlanObjectForId(e);t&&t.getObject()&&this._plannerKernelAccess.planInteractionHandler.removeElement(t.getKernelObject())})}rotateSelection(e){const t=new this._plannerKernelAccess.kernelContainer.PlanObjectPtrList,n=new THREE.Box3;this._plannerSceneEventHandler.getSelectedIds().forEach(e=>{const a=this._planViewModel.getPlanObjectForId(e);a&&a.getObject()&&(t.push_back(a.getPlanObject()),n.expandByObject(a.getContainer()))});const a=n.getCenter(new THREE.Vector3),i=this._plannerKernelAccess.planInteractionHandler.groupObjects(t);this._plannerKernelAccess.planInteractionHandler.rotateGroupBy(i,e,s(a))}planBoundsChanged(){this.updateEnvironment(this.getBounds()),this._requestRender()}planElementRemoved(e){this._onPlanChanged(),this._renderEverything()}_onPlanChanged(){this._roomlePlannerUiCallback.onPlanChanged()}prepareTopImage(e={}){return new Promise(t=>{this._planViewModel.materialQueue.finished(!0).then(async()=>{let n=this._calculateBoundingBoxOfAllMeshes(.1);this._lightSetting.removeFromScene();let a=await D(this._scene,null,n,e);this._lightSetting.addToScene(),this._requestRender(),t(a)})})}preparePerspectiveImage(e={}){return new Promise((t,n)=>{this._planViewModel.materialQueue.finished(!0).then(async()=>{let n;n=this._cameraControl instanceof x?this._cameraControl.getCamera().clone():this.getPerspectiveOffsetCamera();let a=this._calculateBoundingBoxOfAllMeshes();this._lightSetting.removeFromScene();const i=await T(this._scene,null,n,a,e);this._lightSetting.addToScene(),this._requestRender(),t(i)},n)})}_calculateBoundingBoxOfAllMeshes(e=0){const t=this.getBounds();return R(t,e)}enableRotation(){this._plannerSceneEventHandler.setState(2)}disableRotation(){this._plannerSceneEventHandler.resetState()}dragIn(e){this._plannerSceneEventHandler.setDragIn(!0,e)}getPlannerSceneEventHandler(){return this._plannerSceneEventHandler}}return a([i],e.prototype,"_plannerKernelAccess",void 0),a([i],e.prototype,"_rapiAccess",void 0),a([i],e.prototype,"_plannerMeshGenerator",void 0),a([i],e.prototype,"_plannerInputManager",void 0),a([i],e.prototype,"_roomlePlannerUiCallback",void 0),a([i],e.prototype,"_localStorageHelper",void 0),e})();const ae={left:0,top:1,right:1,bottom:0};let ie=(()=>{class e{constructor(e){this._hscInstance=null,this._glbInstance=null,this._creator_=e,this._kernelAccessCallback.addListener(this),this._backstack.init([r.HSP],this)}deleteSelection(){this._sceneManager.deleteSelection()}rotateSelection(e){this._sceneManager.rotateSelection(e)}cancelSelection(){this._sceneManager.cancelSelection()}init(e,t,n){return c.start("loadingTime"),this._domHelper.setDomElement(e),this._sceneManager?(this._lifeCycleManager.resume(),Promise.resolve()):(this._preloadPlanId=t,this.setOverrides(n),new Promise(this._initPromiseCallback.bind(this)))}loadPlanXml(e,t){return this.setOverrides(t),new Promise(n=>{this._plan=this._planInteractionHandler.loadPlanXML(e),this._sceneManager.planXMLLoaded(this._plan),this._roomlePlannerUiCallback.onTotalFloorAreaChanged(this._planInteractionHandler.getPlan().getTotalFloorArea()),this._backstack.bringIntoForeground(r.HSP),this._initData.moc&&(t.id?this._rapiAccess.trackView(t.id):this._rapiAccess.trackView("planXML")),n()})}loadPlan(e,t){return this.setOverrides(t),new Promise((t,n)=>{this._rapiAccess.getPlan(e).then(n=>{this._plan=this._planInteractionHandler.loadPlanXML(n.planObjects),this._sceneManager.planXMLLoaded(this._plan),this._roomlePlannerUiCallback.onTotalFloorAreaChanged(this._planInteractionHandler.getPlan().getTotalFloorArea()),this._backstack.bringIntoForeground(r.HSP),this._initData.moc&&this._rapiAccess.trackView(e),t()},n)})}setOverrides(e){e&&(this._initData.setOverrides(e),this._globalInitData.setOverrides(e))}switch2D(){this._sceneManager.switchTo2D()}switch3D(){this._sceneManager.switchTo3D()}switchToFirstPerson(){this._sceneManager.switchToFirstPerson()}exportGLB(){this._sceneManager.exportGLB()}importGLB(e){this._sceneManager.importGLB(e)}_initPromiseCallback(e,t){this._threeLoader.fetch().then(()=>{let t=this._scriptLoader.fetch(p,{id:"gltf-loader"}),n=this._scriptLoader.fetch(m,{id:"draco-loader"}),a=this._scriptLoader.fetch(F,{id:"tween-js"}),i=this._scriptLoader.fetch("static/Sky-6621935ea8a523af.js",{id:"sky-js"});Promise.all([t,n,a,i]).then(()=>{this._kernelReadyCallback=e;const{mode:t,stats:n}=this._initData;this._sceneManager||(this._sceneManager=new ne(this._creator_,ae,this,t)),this._preloadPlanId&&this._sceneManager.preload(this._preloadPlanId),n?this.showStats():this.enableHD(),this._planInteractionHandler&&this._kernelReadyCallback()})})}enableHD(){return new Promise((e,t)=>{const n=()=>{this._sceneManager.enableHD(),e()};this._threeLoader.fetch().then(()=>Promise.all(K.map(e=>this._scriptLoader.fetch(e,{id:e})))).then(()=>{this._scriptLoader.fetch(z,{id:"pi-js"}).then(n,t)},t)})}isReady(){this._planInteractionHandler=this._plannerKernelAccess.planInteractionHandler,this._kernelReadyCallback&&this._kernelReadyCallback()}showBenchmarks(){c.showBenchmarks()}async switchToConfigurator(){const e=await this._singlePromiseFactory.create(3,"startHSC",e=>{if(this._hscInstance)return e(this._hscInstance);t.import("./configurator-9357ee51.legacy.js").then((function(e){return e.c})).then(({Configurator:t})=>{const n=new t(this._creator_);n.boot({kernelInstance:this._planInteractionHandler.getConfiguratorKernel(),kernelContainer:this._plannerKernelAccess.kernelContainer}),n.getApi().setOverrides(this._initData),n.getApi().init(this._domHelper.element).then(()=>{this._hscInstance=n,e(this._hscInstance)})})});return this._backstack.bringIntoForeground(r.HSC),this.cancelSelection(),e}async switchToViewer(){const e=await this._singlePromiseFactory.create(4,"startGLB",e=>{if(this._glbInstance)return e(this._glbInstance);t.import("./glb-viewer-3bc2a0a2.legacy.js").then(t=>{const n=new t.GlbViewer(this._creator_);n.boot(),n.getApi().setOverrides(this._initData),n.getApi().init(this._domHelper.element).then(()=>{this._glbInstance=n,e(this._glbInstance)})})});return this._backstack.bringIntoForeground(r.GLB),this.cancelSelection(),e}switchToPlanner(e){e&&this.loadPlan(e),this._backstack.bringIntoForeground(r.HSP)}updateSize(){this._sceneManager.updateCamera()}getMain(){}update(){this.updateSize(),this._glbInstance&&this._glbInstance.getApi().updateSize(),this._hscInstance&&this._hscInstance.getApi().updateSize()}get callbacks(){return this._roomlePlannerUiCallback}set callbacks(e){this._roomlePlannerUiCallback=e}showStats(){this._sceneManager.showStats()}onBackStackChanged(e){this._roomlePlannerUiCallback.onBackStackChanged(e)}onCloseHSC(){this._sceneManager.closeHSC(),this._hscInstance&&this._hscInstance.getApi().pauseKernelCallbacks()}back(){if(this._backstack.current()===r.GLB&&this._glbInstance&&this._glbInstance.getApi().clearScene(),this._backstack.current()===r.HSC&&this._hscInstance){const e=this._hscInstance.getApi();e.cancelSelection(),e.cancelDockings(),e.hideDimensions(),e.disableMultiselect(),this._sceneManager.updateScene()}this._backstack.back()}backTo(e){this._backstack.backTo(e)}getConfigurator(){return this._hscInstance}getCurrentSkin(){return this._rapiAccess.getCurrentSkin()}getRuntimeComponentIdOfRootComponent(e){return e?this._plannerKernelAccess.planInteractionHandler?this._plannerKernelAccess.planInteractionHandler.getConfiguratorKernel().getRootPlanComponentIdFromObjectId(e):(console.warn("Can not retrieve runtime id without planInteractionHandler"),0):(console.warn("Can not retrieve runtime id without planObjectId"),0)}resumeTest(e){this._domHelper.setDomElement(e),this._lifeCycleManager.resume()}pauseTest(){this._lifeCycleManager.pause()}syncCatalog(e){return this._dataSyncer.syncCatalog(e)}loadError(e){}getPlanInteractionHandler(){return Promise.resolve(this._planInteractionHandler)}getPlanModelViewHelper(){return Promise.resolve(this._plannerKernelAccess.planModelViewHelper)}async insertObject(e,t,n){if(!this._planInteractionHandler)throw new Error("no plan interaction handler");t&&(t=s(new THREE.Vector3(t.x,t.y,t.z)));const a=await(g(e)?this._rapiAccess.getItem(e):this._rapiAccess.getConfiguration(e)),i=await this._plannerKernelAccess.addPlanObjectFromItem(a,t,n);return this._sceneManager.updateScene(),i}async insertItemList(e){const t=e.map(e=>g(e)?this._rapiAccess.getItem(e):this._rapiAccess.getConfiguration(e)),n=await Promise.all(t);await this._plannerKernelAccess.insertItems(n)}async insertItems(e){await this._plannerKernelAccess.insertItems(e)}getScene(){return this._sceneManager.getScene()}updateScene(){this._sceneManager.updateScene()}getCameraOffset(){return this._sceneManager.getCameraOffset()}setCameraOffset(e){this._sceneManager.setCameraOffset(e)}async getObjects(){const e=(await this.getPlanModelViewHelper()).getPlanOverview(this._plan);let t=[];for(let n=0;n<e.objects.size();n++)t.push(u(e.objects.get(n)));return t}async getPlanOverview(){const e=(await this.getPlanModelViewHelper()).getPlanOverview(this._plan);return u(e)}prepareTopImage(e={}){return this._sceneManager.prepareTopImage(e)}preparePerspectiveImage(e={}){return this._sceneManager.preparePerspectiveImage(e)}enableRotation(){this._sceneManager.enableRotation()}disableRotation(){this._sceneManager.disableRotation()}async dragInObject(e,t){this._sceneManager.dragIn(t);const n=await this._rapiAccess.getItem(e);this.insertItems([n])}enableSnapping(){this._planInteractionHandler.reactivateAllSnappingActivity()}disableSnapping(){this._planInteractionHandler.deactivateAllSnappingActivity()}}return a([i],e.prototype,"_domHelper",void 0),a([i],e.prototype,"_scriptLoader",void 0),a([i],e.prototype,"_kernelAccessCallback",void 0),a([i],e.prototype,"_plannerKernelAccess",void 0),a([i],e.prototype,"_rapiAccess",void 0),a([i],e.prototype,"_singlePromiseFactory",void 0),a([i],e.prototype,"_roomlePlannerUiCallback",void 0),a([i],e.prototype,"_lifeCycleManager",void 0),a([i],e.prototype,"_backstack",void 0),a([i],e.prototype,"_threeLoader",void 0),a([i],e.prototype,"_dataSyncer",void 0),a([i],e.prototype,"_initData",void 0),a([i],e.prototype,"_globalInitData",void 0),e})(),se=(()=>{class e{constructor(e){this._initialStack=[],this._creator_=e,this._lifeCycleManager.addEventListener(this)}_setInitialStack(e){this._initialStack=[...e]}_setCallbacks(e){this._callbacks=e}_resetCanvasStack(){this._canvasStack=[...this._initialStack]}init(e,t){this._setInitialStack(e),this._resetCanvasStack(),this._setCallbacks(t)}bringIntoForeground(e){const t=this._domHelper.element.querySelectorAll("canvas");let n=!1;t.forEach(t=>{if(t.classList.contains(e)){if(!t.classList.contains("foreground")){const t=this.current();t&&e!==t&&(this._canvasStack.push(e),n=!0),t||(n=!0)}t.classList.remove("background"),t.classList.add("foreground")}else t.classList.remove("foreground"),t.classList.add("background")}),n&&this._callbacks.onBackStackChanged(this._canvasStack)}current(){return this._canvasStack[this._canvasStack.length-1]}back(){if(1===this._canvasStack.length)return;let e=this._canvasStack.pop();this.bringIntoForeground(this.current()),e===r.HSC&&this._callbacks.onCloseHSC(),this._callbacks.onBackStackChanged(this._canvasStack)}backTo(e){if(1!==this._canvasStack.length&&this.current()!==e)for(;this._canvasStack.length>0;){let t=this.current();if(t===e){this.bringIntoForeground(t);break}t===r.HSC&&this._callbacks.onCloseHSC(),this._canvasStack.pop(),this._callbacks.onBackStackChanged(this._canvasStack)}}pause(){this._resetCanvasStack()}resume(){}destroy(){}}return a([i],e.prototype,"_domHelper",void 0),a([i],e.prototype,"_lifeCycleManager",void 0),e})();class re{constructor(e){const{planElementViewModel:t}=e;this.planElementViewModel=t}}const oe=[new f("script-loader",W),new f("planner-input-manager",class extends U{_canDrag(e){return!0}},1),new f("planner-kernel-access",O),new f("logger",E),new f("planner-mesh-generator",class extends N{constructor(e){super(e),this._wallMeshes=[],this._defaultMaterial=new THREE.MeshStandardMaterial({color:"#ffffff",roughness:1,metalness:0,opacity:1,envMap:null}),this._environmentLoader.setEnvMap(this._defaultMaterial)}generateGeometry(e=null,t,n,a,i,s=!1){let r;return r=s?this._generateGeometry(e,t,n,a,i).clone():this._generateGeometry(e,t,n,a,i),r}generateMesh(e=null,t,n,a,i,s,r,o=!1){const l=this.generateGeometry(e,n,a,i,s,o),h=new THREE.Mesh(l,this._previewMaterial);return h.layers.set(3),!t&&r&&7!==r.value?(console.warn("material is undefined"),h):(this.setMaterial(h,t,r).then(()=>{const e=r&&3===r.value;h.castShadow=!e}),this._checkWallMaterial(h,r),h)}async setMaterial(e,t,n){if(e.userData.material=S(t,n),e.userData.materialId=t,k(t))t?await this._assignMaterial(e,t):(console.warn("Used default material because material is empty"),this.changeMaterialOfMesh(e,this._defaultMaterial));else{if(!t)return void this.changeMaterialOfMesh(e,this._defaultMaterial);2===(t=t).getSourceType().value?await this._assignMaterial(e,t.materialId):1===t.getSourceType().value?await this._assignItem(e,t.catalogItemId):3===t.getSourceType().value?await this._assignRGB(e,t.rgbValue):0===t.getSourceType().value?this.changeMaterialOfMesh(e,this._defaultMaterial):(this.changeMaterialOfMesh(e,this._defaultMaterial),1!==n.value&&7!==n.value&&3!==n.value&&console.warn("Used default material because material is not supported",t))}}set maxAnisotropy(e){this._maxAnisotropy=e}_checkWallMaterial(e,t){t&&1===t.value&&(e.renderOrder=5,this._wallMeshes.push(e))}clear(){super.clear(),this.clearWallMeshes()}clearWallMeshes(){this._wallMeshes.forEach(e=>{w(e)}),this._wallMeshes=[]}get wallMeshes(){return this._wallMeshes}}),new f("rapi-access",v),new f("roomle-planner-ui-callback",class extends C{constructor(e){super(e),this.onItemsLoaded=()=>{},this.onBackStackChanged=e=>{},this.onCameraChanged=e=>{},this.onTotalFloorAreaChanged=e=>{},this.onPlanInteractionHandlerCreated=e=>{},this.onPlannerKernelIsReady=e=>{},this.onConfiguratorKernelIsReady=(e,t)=>{},this.onSelectionChange=(e,t,n,a)=>{},this.onSelectionCancel=()=>{},this.onPlanChanged=()=>{},this.onCompletelyLoaded=()=>{},this.onRotationCancel=()=>{},this.onHistoryChange=(e,t)=>{}}}),new f("configurator-ui-callbacks",V,1),new f("backstack",se),new f("planner-selection-handler",class extends q{constructor(){super(...arguments),this._selectionMode="standard",this._selectedPlanElementViewModels=new Map}check(e){"standard"===this._selectionMode&&this._checkStandard(e),"multiselect"===this._selectionMode&&this._checkMulti(e)}cancelSelection(){0!==this._selectedPlanElementViewModels.size&&this._selectedPlanElementViewModels.forEach((e,t)=>{this._selectedPlanElementViewModels.delete(t),this.dispatchEvent(1,new re({planElementViewModel:e}))})}_checkStandard(e){if(this._selectedPlanElementViewModels.has(e.getId()))return this._selectedPlanElementViewModels.delete(e.getId()),void this.dispatchEvent(1,new re({planElementViewModel:e}));this._selectedPlanElementViewModels.size>0&&this._selectedPlanElementViewModels.forEach((e,t)=>{this._selectedPlanElementViewModels.delete(t),this.dispatchEvent(1,new re({planElementViewModel:e}))}),this._selectedPlanElementViewModels.set(e.getId(),e),this.dispatchEvent(0,new re({planElementViewModel:e}))}_checkMulti(e){if(this._selectedPlanElementViewModels.has(e.getId()))return this._selectedPlanElementViewModels.delete(e.getId()),void this.dispatchEvent(1,new re({planElementViewModel:e}));this._selectedPlanElementViewModels.set(e.getId(),e),this.dispatchEvent(0,new re({planElementViewModel:e}))}setSelectionMode(e){this._selectionMode=e}getSelectionMode(){return this._selectionMode}hasSelection(){return this._selectedPlanElementViewModels.size>0}getSelectedIds(){let e=[];return this._selectedPlanElementViewModels.forEach(t=>e.push(t.getId())),e}isSelected(e){return!!this._selectedPlanElementViewModels.get(e)}})];e("Planner",class extends X{setupGlobals(){}setupDependencies(){M.setup(oe),this.lookup("logger",this._context),this.lookup("planner-kernel-access",this._context)}cleanUpGlobals(){throw new Error("Method not implemented.")}cleanUpDependencies(){throw new Error("Method not implemented.")}bootFinished(){this._planner=new ie(this._context),this._planner.getMain=()=>this,window.RoomlePlanner||(window.RoomlePlanner=this._planner)}getApi(){return this._planner}getContextName(){return"planner"}})}}}));
|
|
2
|
-
//# sourceMappingURL=planner-a3578f70.legacy.js.map
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
System.register(["./main-thread-to-worker-4c02f179.legacy.js"],(function(e){var t,n,s,o,r,i,a,l,h,c,d;return{setters:[function(e){t=e.a,n=e.g,s=e.M,o=e.h,r=e.s,i=e.w,a=e.R,l=e.b,h=e.c,c=e.e,d=e.u}],execute:function(){e({R:pe,_,i:F});class u{constructor(){this._context=new Map,this._lookups=new Map,this._singletons=new Map}getContext(e){if(this._context.has(e)){const t=this._context.get(e);return this._context.set(e,t+1),e+t}return this._context.set(e,1),e+0}addDependencyInjectionAssignments(e){e.forEach(e=>{this._lookups.set(e.className,e)})}lookup(e,t){if(!this._lookups.has(e))return null;const n=this._lookups.get(e);if(1===n.type&&void 0===t){const t="Dependency "+e+" has definition context but no context was defined!";return console.trace(t),console.error(t),null}let s=t&&1===n.type?t:"global";if(s+="_"+e,2===n.type)return new n.classDefinition;if(this._singletons.has(s))return this._singletons.get(s);const o=new n.classDefinition(t);return this._singletons.set(s,o),o}cleanUp(e){if(e){let t=[];this._singletons.forEach((n,s)=>{s.startsWith(e)&&t.push(s)}),t.forEach(e=>{this._singletons.delete(e)})}else this._singletons.clear(),this._singletons=new Map}}class p{constructor(e,t,n){this.className=e,this.classDefinition=t,this.type=void 0===n?0:n}}e("n",p);const g={JPG:".jpg",JPEG:".jpeg",PNG:".png",GIF:".gif"};class m{_base64toBlob(e,t){t=t||"";const n=atob(e),s=n.length,o=Math.ceil(s/1024),r=new Array(o);for(let e=0;e<o;++e){let t=1024*e,o=Math.min(t+1024,s);const i=new Array(o-t);for(let e=t,s=0;e<o;++s,++e)i[s]=n[e].charCodeAt(0);r[e]=new Uint8Array(i)}return new Blob(r,{type:t})}_createFormData(e,t,n,s){const o=new FormData;-1!==e.indexOf(",")&&(e=e.substr(e.indexOf(",")+1));const r=-1===Object.keys(g).map(e=>g[e]).indexOf(n)?"application":"image",i=this._base64toBlob(e,r+"/"+n.substr(1));return o.append(s,i,t+n),o}create(e,t,n,s){return this._createFormData(e,t,n,s)}}
|
|
2
|
-
/*! *****************************************************************************
|
|
3
|
-
Copyright (c) Microsoft Corporation.
|
|
4
|
-
|
|
5
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
-
purpose with or without fee is hereby granted.
|
|
7
|
-
|
|
8
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
9
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
10
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
11
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
12
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
-
***************************************************************************** */function _(e,t,n,s){var o,r=arguments.length,i=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,n,s);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(i=(r<3?o(i):r>3?o(t,n,i):o(t,n))||i);return r>3&&i&&Object.defineProperty(t,n,i),i}class f{constructor(){this._size=256,this._maxLod=0,this._encoding=THREE.LinearEncoding,this._type=THREE.UnsignedByteType,this._format=THREE.RGBAFormat,this._cubeTextures=[],this._lightDirection=new THREE.Vector3,this._path=""}setPath(e){this._path=e}load(e){return new Promise(t=>{(new THREE.FileLoader).setResponseType("arraybuffer").load(this._path+e,e=>{this.parseData_(e),t(this._cubeTexture)})})}parseHeader_(e){let t=new DataView(e,0,30);this._size=t.getUint16(0),this._maxLod=t.getUint8(2),this._encoding=t.getUint16(3),this._type=t.getUint16(5),this._format=t.getUint16(7),this._lightDirection.x=t.getFloat32(9),this._lightDirection.y=t.getFloat32(13),this._lightDirection.z=t.getFloat32(17)}parseBufferData_(e,t){let n=this._size;const s=Math.log2(this._size)+1;this._cubeTextures=[];for(let o=0;o<s;o++){let s=new THREE.CubeTexture;this._cubeTextures.push(s),s.format=THREE.RGBAFormat,s.encoding=this._encoding,s.type=this._type,s.minFilter=THREE.LinearMipMapLinearFilter,s.magFilter=THREE.LinearFilter,s.generateMipmaps=!1;for(let o=0;o<6;o++){let r=new Uint8Array(e,t,4*n*n),i=new THREE.DataTexture(r,n,n);i.format=s.format,i.encoding=s.encoding,i.type=s.type,i.generateMipmaps=!1,t+=4*n*n,s.images[o]=i,i.needsUpdate=!0}s.needsUpdate=!0,n/=2}this._cubeTexture=new THREE.CubeTexture,this._cubeTexture.format=THREE.RGBAFormat,this._cubeTexture.encoding=this._encoding,this._cubeTexture.type=this._type,this._cubeTexture.minFilter=THREE.LinearMipMapLinearFilter,this._cubeTexture.magFilter=THREE.LinearFilter,this._cubeTexture.generateMipmaps=!1;for(let e=0;e<6;e++){this._cubeTexture.image[e]=this._cubeTextures[0].images[e];for(let e=1;e<s;e++)this._cubeTexture.mipmaps[e-1]=this._cubeTextures[e],this._cubeTextures[e].needsUpdate=!0}this._cubeTexture.needsUpdate=!0,this._cubeTexture.maxLod=this._maxLod-1}convertToRGBABuffer(e){let t=new Uint8Array(e,30,e.byteLength-30),n=4;this._format===THREE.RGBFormat&&(n=3);const s=4*t.length/n;let o=new ArrayBuffer(s),r=new DataView(o),i=0,a=t.length/n;if(3===n)for(let e=0;e<a;e++)r.setUint8(i++,t[e]),r.setUint8(i++,t[e+a]),r.setUint8(i++,t[e+2*a]),r.setUint8(i++,255);else for(let e=0;e<a;e++)r.setUint8(i++,t[e]),r.setUint8(i++,t[e+a]),r.setUint8(i++,t[e+2*a]),r.setUint8(i++,t[e+3*a]);return o}parseData_(e){this.parseHeader_(e);let t=30;t=0;let n=this.convertToRGBABuffer(e);this.parseBufferData_(n,0)}}const w=e("t",(function(e){return e*(Math.PI/180)})),y=(e("w",(function(e,t,n,s,o,r){e=Math.sqrt(e*e+n*n);const i=o/r,a=2*Math.atan(Math.tan(s*Math.PI/180/2)*i)*180/Math.PI,l=w(s),h=t/2/Math.tan(l/2),c=e/(2*Math.atan(Math.PI*a/360));return Math.max(h,c)})),function(e){return Math.round(1e3*e)/1e3}),E=(e("a9",(function(e,t){return Math.abs(e.y-t.y)+Math.abs(e.x-t.x)})),e("y",(function(e,t){return Math.atan2(t.y-e.y,t.x-e.x)})),e("x",(function(e){let t=function(e){return e*(180/Math.PI)}(e);return t<0&&(t=180+(180+t)),t})),e("O","#DDDDDD")),b=(e("S",1),e("a3",0),e("Q",1)),C=(e("g",(e,t,n,s)=>{if(!e||!t||0===n||0===s)return new THREE.Vector3;let o=e.clone(),r=n/2,i=s/2;return o.project(t),o.x=Math.floor(o.x*r+r),o.y=Math.floor(-o.y*i+i),o.z=e.distanceTo(t.position),o}),e("j",(e,t)=>{t||(t=new THREE.Vector3(0,0,0));let n=new THREE.Vector3(e.size.x/1e3,e.size.z/1e3,e.size.y/1e3),s=new THREE.Vector3(e.origin.x/1e3,e.origin.z/1e3,e.origin.y/-1e3),o=new THREE.Vector3(0,0,-n.z).add(s).sub(t),r=new THREE.Vector3(n.x,n.y,0).add(s).add(t);return new THREE.Box3(o,r)})),M=(e("l",e=>(e.from=e.from/1e3,e.to=e.to/1e3,1===e.type.value?(e.type={value:2},e.from*=-1,e.to*=-1):2===e.type.value&&(e.type={value:1}),e)),e("z",(e,t,n)=>{e.castShadow=n,e.receiveShadow=t,e.children.forEach(e=>{M(e,t,n)})}));e("u",(e,t)=>{let n=y(e.x),s=y(e.y),o=y(e.z),r=y(t.x),i=y(t.y),a=y(t.z);return n===r&&s===i&&o===a}),e("a8",(e,t)=>{let n=y(e.w),s=y(e.x),o=y(e.y),r=y(e.z),i=y(t.w),a=y(t.x),l=y(t.y),h=y(t.z);return n===i&&s===a&&o===l&&r===h}),e("v",(e,t)=>{let n=y(e.x),s=y(e.y),o=y(t.x),r=y(t.y);return n===o&&s===r});let v=null;const T=()=>{if(v)return v;const e=new Uint8Array(4);for(let t=0;t<1;t++){const n=4*t;e[n]=255,e[n+1]=255,e[n+2]=255,e[n+3]=255}const t=new THREE.DataTexture(e,1,1,THREE.RGBAFormat);return t.needsUpdate=!0,t},R=(e,t,n,s)=>{const o=new Uint8Array(4),r=Math.floor(255*e),i=Math.floor(255*t),a=Math.floor(255*n),l=Math.floor(255*s);for(let e=0;e<4;e++){const t=4*e;o[t]=r,o[t+1]=i,o[t+2]=a,o[t+3]=l}const h=new THREE.DataTexture(o,1,1,THREE.RGBAFormat);return h.needsUpdate=!0,h},I=(e("K",(e,t)=>I(null,e,t)),e("ab",(e,n,s)=>{if(e||(e=P()),e.name=n.id?n.id.toString():"",void 0!==n.shading.metallic&&(e.metalness=1===n.shading.metallic?1:.5,e.reflectivity=t(n.shading.metallic,.5)),n.shading.transmission&&n.shading.transmission>0?(e.transmission=n.shading.transmission,e.opacity=1,e.transparent=!0,e.depthWrite=!1,e.metalness=0):void 0!==n.shading.alpha&&n.shading.alpha<1&&(e.transparent=n.shading.alpha<1,e.opacity=n.shading.alpha,e.depthWrite=n.shading.alpha>=1),e.aoMapIntensity=t(n.shading.occlusion,1),e.roughness=t(n.shading.roughness,.5),e.alphaTest=t(n.shading.alphaCutoff,0),void 0!==n.shading.basecolor){const t=new THREE.Color(n.shading.basecolor.r,n.shading.basecolor.g,n.shading.basecolor.b);e.color.copy(t.convertSRGBToLinear())}return null==s||s.setEnvMap(e),n.shading.doubleSided?e.side=THREE.DoubleSide:e.side=THREE.FrontSide,e.map||(v||(v=T()),e.map=v),e})),P=()=>new THREE.MeshPhysicalMaterial({});e("ac",e=>{let t=e.color.clone().convertLinearToSRGB(),n={alpha:e.opacity,metallic:e.reflectivity,basecolor:{r:t.r,g:t.g,b:t.b},roughness:e.roughness,doubleSided:e.side===THREE.DoubleSide,alphaCutoff:e.alphaTest,transmission:e.transmission};return 1===e.metalness?n.metallic=1:n.metallic=e.reflectivity,n});let x=null;e("N",(e,t,n,s,o,r,i=16)=>(x||(x=new THREE.TextureLoader,x.crossOrigin=""),new Promise((a,l)=>{if(!e)return console.warn("trying to add a texture without image",t),void a();x.load(e,e=>{k(e,t,n,s,o,r,i),a()},l)})));const k=e("ad",(e,t,n,s,o,r,i=16)=>{e.anisotropy=s,e.wrapS=THREE.RepeatWrapping,e.wrapT=THREE.RepeatWrapping,"ORM"===t.mapping&&i<=8?console.warn("ORM maps are not supported on devices with only "+i+" texture units"):(e.repeat.set(o,r),"XYZ"===t.mapping?(n.normalMap=e,n.map===T()&&(n.map=null)):"ORM"===t.mapping?(n.aoMap=e,n.roughnessMap=e,n.metalnessMap=e):(e.encoding=THREE.sRGBEncoding,n.map=e),"RGBA"===t.mapping&&(n.transparent=!0),n.needsUpdate=!0)}),S=(e("h",(e=!0)=>window.dat&&window.dat.GUI?(window.__RML_GUI__||(window.__RML_GUI__=new dat.GUI({autoPlace:e})),window.__RML_GUI__):null),e("a5",(e,t,n=!0)=>{let s=e.getWorldDirection(new THREE.Vector3),o=Math.abs(s.y);o<.5&&!t.transparent&&S(t,!0,n),o>.5&&t.transparent&&S(t,!1,n)}),e("a6",(e,t,n=!0)=>{if(!e.userData.tween)if(t)if(e.transparent=!0,n){let t={opacity:1};e.userData.tween=!0,new TWEEN.Tween(t).to({opacity:.2},400).easing(TWEEN.Easing.Sinusoidal.In).onUpdate(()=>{e.opacity=t.opacity}).onComplete(()=>{e.userData.tween=!1}).start()}else e.opacity=.2;else if(n){let t={opacity:.2};e.userData.tween=!0,new TWEEN.Tween(t).to({opacity:1},400).easing(TWEEN.Easing.Sinusoidal.In).onUpdate(()=>{e.opacity=t.opacity}).onComplete(()=>{e.transparent=!1,e.userData.tween=!1}).start()}else e.opacity=1,e.transparent=!1})),L=(e("X",e=>{let t=new THREE.Color;return t.setRGB((e>>16)/255,(e>>8&255)/255,(e>>0&255)/255),t}),e("m",(e,t)=>{e.traverse(e=>{if(e instanceof THREE.Mesh&&TWEEN){const n=e.material;e.userData.tween&&e.userData.tween.stop();const s={opacity:n.opacity};t.transparent&&(n.transparent=t.transparent),e.userData.tween=new TWEEN.Tween(s).to(t,250).easing(TWEEN.Easing.Linear.None).onUpdate(()=>{n.opacity=s.opacity}).onStop(()=>{t.transparent||(n.transparent=t.transparent),n.opacity=t.opacity,n.needsUpdate=!0,e.userData.tween=void 0}).onComplete(()=>{t.transparent||(n.transparent=t.transparent),n.needsUpdate=!0,e.userData.tween=void 0}).start()}})}),e("J",e=>{e.traverse(e=>{if(e instanceof THREE.Mesh&&TWEEN){let t=e.material;if(0===t.opacity)return;let n={opacity:0,transparent:!0},s={opacity:t.opacity,transparent:t.transparent};t.transparent=n.transparent,t.opacity=n.opacity,new TWEEN.Tween(n).to(s,500).easing(TWEEN.Easing.Linear.None).onUpdate(()=>{t.opacity=n.opacity}).onComplete(()=>{t.transparent=s.transparent}).start()}})}),e("$",(e,t)=>{let n=(new THREE.Box3).setFromObject(e),s=n.getSize(new THREE.Vector3),o=Math.min(s.x,s.y,s.z),r=!0;return o>5&&(console.warn("GLB seems to be too big ("+o+")",t),r=!1),n.min.y<-.01&&(console.warn("GLB seems to be under the floor ("+n.min.y+"): ",t),r=!1),r}),e("e",e=>{"Mesh"===e.type?A(e):L(e)}),e=>{e&&e.children&&0!==e.children.length&&e.children.forEach(e=>{A(e)})}),A=e("a2",e=>{e&&(e.material&&H(e.material),e.geometry&&D(e.geometry),e.children&&e.children.length>0&&L(e))}),D=e=>{e&&e.dispose()},H=e=>{e&&(e.map&&e.map.dispose(),e.normalMap&&e.normalMap.dispose(),e.dispose())};let O;e("W",()=>(O||(O=new THREE.MeshBasicMaterial,O.visible=!1),O)),e("Y",(e,t)=>{let n=t.x/2,s=t.z/2,o=new THREE.Vector3(-n,.01,s),r=[o,new THREE.Vector3(o.x,o.y,o.z+.2),new THREE.Vector3(o.x-.2,o.y,o.z+.2),new THREE.Vector3(o.x-.2,o.y,o.z)],i=[new THREE.Face3(3,2,0),new THREE.Face3(2,1,0)],a=new THREE.Geometry;return a.vertices.push(...r),a.faces.push(...i),a.computeFaceNormals(),a.computeVertexNormals(),a}),e("a1",e=>0===e.x&&0===e.y&&0===e.z),e("V",(e,t)=>{let n="";return e.materialId&&""!==e.materialId?n=e.materialId:e.catalogItemId&&""!==e.catalogItemId?n=e.catalogItemId:e.rgbValue>0?n="rbg"+JSON.stringify(e.rgbValue):e.length>0?n=e:t&&1===t.value?n="default_wall_material_"+e.getSourceType().value:t&&7===t.value&&(n="default_ceiling_material_"+e.getSourceType().value),n}),e("H",(e,t,n=.01)=>!(!e||!t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n);const B=function(e){return e.startsWith("_")&&(e=e.substr(1)),e.replace(/[A-Z](?:(?=[^A-Z])|[A-Z]*(?=[A-Z][^A-Z]|$))/g,(function(e,t){return(t>0?"-":"")+e.toLowerCase()}))};function F(e,t){const n=Symbol("property-cache");Object.defineProperty(e,t,{get(){if(!this[n]){const e=window.__RML__DI__.lookup(B(t),this._creator_);e?this[n]=e:console.error("Dependency "+B(t)+" not found! Add dependency to /utils/injectables.ts")}return this[n]}})}let j=e("ae",(()=>{class e{constructor(e){this._hdrCubeUrl="static/roomle-91862a5e7f3f46e5.envmap",this._hdrCubeUrlLowres="static/roomle64-adb0f447a54b5143.envmap",this._envMapReader=new f,this._creator_=e;const t=new THREE.Color(E);this._environmentMap=((e,t,n,s)=>{const o=new THREE.CubeTexture;o.format=THREE.RGBAFormat,o.generateMipmaps=!1;for(let r=0;r<6;++r){const i=R(e,t,n,s);i.format=o.format,i.type=o.type,i.minFilter=o.minFilter,i.magFilter=o.magFilter,i.generateMipmaps=o.generateMipmaps,i.needsUpdate=!0,o.images[r]=i}return o.needsUpdate=!0,o})(t.r,t.g,t.b,b),this._envMapReader.setPath(n()),this._loadHDREnvMap(this._hdrCubeUrlLowres)}static setEnvironmentMap(e,t){e&&t&&(e.envMap=t,e.envMapIntensity=1,e.needsUpdate=!0)}getEnvironmentMap(){return this._environmentMap}_processPMREM(e){const t=new THREE.PMREMGenerator(this._renderer);let n=t.fromCubemap(e);return e.magFilter=THREE.LinearFilter,e.needsUpdate=!0,t.dispose(),n.texture}_loadHDREnvMap(e){return this._initData.disableEnvMap?Promise.resolve():new Promise(t=>{this._envMapReader.load(e).then(n=>{n.encoding=THREE.sRGBEncoding;const s=this._renderer.extensions.get("EXT_shader_texture_lod");this._environmentMap=s?this._processPMREM(n):n,e!==this._hdrCubeUrl&&(this._environmentMap.encoding=THREE.sRGBEncoding,window.requestIdleCallback(this._loadHDREnvMap.bind(this,this._hdrCubeUrl))),this._updateEnvironmentMap(),t(),this._envChangedCallback&&this._envChangedCallback()})})}setRendererAndScene(e,t){this._renderer=e,this._scene=t}registerEnvironmentChangedCallback(e){this._envChangedCallback=e}_updateEnvironmentMap(){this._initData.disableEnvMap||this._scene.traverse(t=>{t instanceof THREE.Mesh&&(t.material instanceof THREE.MeshStandardMaterial||"MeshPhysicalMaterial"===t.material.type)&&e.setEnvironmentMap(t.material,this._environmentMap)})}setEnvMap(t){this._initData.disableEnvMap||e.setEnvironmentMap(t,this.getEnvironmentMap())}}return _([F],e.prototype,"_initData",void 0),e})());const U=e("P",{SOFA:"sofa",SHELF:"shelf",SHELF_FRONT:"shelf_front",BAKED:"baked",CAMERA:"camera",EQUAL:"equal"});class G{static createDynamicLightSettingSource(e,t){let s={};if(e)s.url=e;else if(t)switch(t){case U.SHELF:s.url=n()+"static/shelf-2975dd3f2fa9c763.json";break;case U.SHELF_FRONT:s.url=n()+"static/shelf_front-8c9566a4512f0de8.json";break;case U.SOFA:s.url=n()+"static/sofa-997b116bc5f2e92e.json";break;case U.BAKED:s.url=n()+"static/baked-6485a2b1daeb69e8.json";break;case U.CAMERA:s.url=n()+"static/camera-f4cef679615485dc.json";break;case U.EQUAL:s.url=n()+"static/equal-319f6b83c827913f.json";break;default:s.url=n()+"static/camera-f4cef679615485dc.json"}else s=null;return s}parse(e){let t=JSON.parse(e);return t.lights?this.load(t):[]}load(e){let t=[];return e.lights?(e.lights.forEach(e=>{let n;switch(e.type){case"ambient":n=this._parseAmbientLight(e);break;case"rectarea":n=this._parseRectAreaLight(e);break;case"spot":n=this._parseSpotLight(e);break;case"directional":n=this._parseDirectionalLight(e)}n&&t.push(n)}),t):[]}_parseAmbientLight(e){let t=new THREE.AmbientLight;return this._parseCommon(t,e),t}_parseRectAreaLight(e){let t=new THREE.RectAreaLight;this._parseCommon(t,e);let{intensity:n,castShadow:s,target:o,width:r,height:i}=e;return t.width=r||.8,t.height=i||.8,t.castShadow=s||!1,t.matrixAutoUpdate=!0,t.intensity=(n||240)/((r||.8)*(i||.8)),t.lookAt(o?new THREE.Vector3(o.x,o.y,o.z):new THREE.Vector3(0,0,0)),t}_parseSpotLight(e){let t=new THREE.SpotLight;this._parseCommon(t,e);let{angle:n,penumbra:s,target:o,castShadow:r}=e;return t.angle=(n||100)*Math.PI/180,t.penumbra=s||.5,t.lookAt(o?new THREE.Vector3(o.x,o.y,o.z):new THREE.Vector3(0,0,0)),t.shadow.camera.near=.1,t.shadow.camera.far=10,t.shadow.mapSize=new THREE.Vector2(1024,1024),t.castShadow=r||!1,t}_parseDirectionalLight(e){let t=new THREE.DirectionalLight;this._parseCommon(t,e);let{target:n,castShadow:s}=e;return t.castShadow=s||!1,t.shadow.camera.near=.1,t.shadow.camera.far=100,t.shadow.mapSize=new THREE.Vector2(1024,1024),t.shadow.bias=-5e-5,t.lookAt(n?new THREE.Vector3(n.x,n.y,n.z):new THREE.Vector3(0,0,0)),t}_parseCommon(e,t){let{name:n,intensity:s,color:o,position:r,movesWithCamera:i}=t;e.name=n||"",e.intensity=s||1,e.color=new THREE.Color(o||"#ffffff"),e.position.copy(r?new THREE.Vector3(r.x,r.y,r.z):new THREE.Vector3(0,0,0)),e.visible=!0,e.layers.set(1),e.userData.movesWithCamera=i}}e("f",G);const z=["127.0.0.1","localhost","0.0.0.0"],W=(e("r",(function(e){return!(!e||"string"!=typeof e||e.split(":").length>2)})),e("q",e=>{if(!e||"string"!=typeof e)return null;const t=e.split(":");return t.length<2?null:t[0]})),N=(e("k",({articleNr:e,componentId:t})=>e&&""!==e?t.split(":")[0]+":"+e:null),(e,t)=>null!=e?"string"==typeof e?"true"===e:!0===e:("string"==typeof t&&(t=parseInt(t,10)),t>=200&&t<300));class V{constructor(){this._queue=[],this._pendingRequests=0}_nextSlot(){if(this._pendingRequests-=1,!this._queue.length)return;const{request:e,resolve:t,reject:n}=this._queue.shift();this._fetch(e).then(t,n)}_fetch(e,t={}){return this._pendingRequests+=1,new Promise((n,s)=>{self.fetch(e,t).then(function(e){if(this._nextSlot(),N(e.ok,e.status))n(...arguments);else{const t=(null==e?void 0:e.url)||"URL unknown";s(new Error(e.statusText||'Http error "'+(e&&e.status?e.status:"unknown")+'", for "'+t+'"'))}}.bind(this),e=>{this._nextSlot(),s(e)})})}fetch(e,t={}){return this._pendingRequests>=40?new Promise((t,n)=>this._queue.push({request:e,resolve:t,reject:n})):this._fetch(e,t)}}class K{info(...e){console}log(...e){console}warn(...e){console.warn.apply(console,e)}error(...e){console.warn.apply(console,e)}}e("L",K);let q=(()=>{class e extends K{constructor(e){super(),this._creator_=e}setMeta(e){this._meta=e}get meta(){return this._meta?this._meta:{}}throw(e){const t="[Kernel Exception]: "+e;this._globalCallback.onKernelMsg("exception",e,this.meta),this.error(t)}error(e){this._globalCallback.onKernelMsg("error",e,this.meta),super.error(e)}warn(e){this._globalCallback.onKernelMsg("warning",e,this.meta),super.warn(e)}}return _([F],e.prototype,"_globalCallback",void 0),e})();const J=new Map,Q=new Map,Z=new Map,$=new Map;let X=e("p",(()=>{class e{constructor(e){this._bootCallbacks=[],this._isStarted=!1,this._isStarting=!1,this._alwaysUseCache=!1,this._creator_=e}start(e){return this._configuratorUiCallbacks.onSyncStarted(),this._startWorker().then(()=>this._handleCatalog(e)).then(()=>{const{typeChangeTag:e,floorMaterialsTag:t}=this._initData;Promise.all([this._syncFloorTag(t),this._syncTypeChangeTag(e)]).then(()=>{$.set(e,!0),this._configuratorUiCallbacks.onSyncDone()})})}syncCatalog(e){return this._startWorker().then(()=>this._handleCatalog(e))}syncFloorTag(e){return this._startWorker().then(()=>this._syncFloorTag(e))}syncTypeChangeTag(e){return this._startWorker().then(()=>this._syncTypeChangeTag(e))}_syncFloorTag(e){const t=[];return e&&!Z.get(e)?(t.push(this._handleTags([e])),this._rapiAccess.getTag(e).then(e=>{t.push(this._handleMaterialsAndTextures(e))}),this._singlePromiseFactory.create(1,e,n=>{Promise.all(t).then(()=>{Z.set(e,!0),n()},e=>this._softReject(n,'_syncFloorTag error: "'+e+'"'))})):Promise.resolve()}_syncTypeChangeTag(e){const t=[];return e&&!$.get(e)?(t.push(this._handleTags([e])),this._rapiAccess.getTag(e).then(e=>{this._rapiAccess.getItems(e.items).then(e=>{e.forEach(e=>{this.getIsCatalogSynced(e.catalog)&&t.push(this._handleCatalog(e.catalog))})})}),this._singlePromiseFactory.create(2,e,n=>{Promise.all(t).then(()=>{Z.set(e,!0),n()},e=>this._softReject(n,'_syncTypeChangeTag error: "'+e+'"'))})):Promise.resolve()}getIsCatalogSynced(e){return!!Q.get(e)}_startWorker(){return new Promise((e,t)=>{if(this._isStarted)return e();this._bootCallbacks.push({resolve:e,reject:t}),this._isStarting||(this._worker=new Worker(n()+"static/asset-loader.worker-796c70f59b977071.js"),this._mainThreadToWorker=new s(this,this._worker),this._isStarting=!0,this._mainThreadToWorker.sendToWorker(1))})}onCommand(e,t,n){switch(e){case 4:this._isStarted=!0,this._bootCallbacks.forEach(({resolve:e})=>e());break;case 3:this._mainThreadToWorker.resolvePromises(t,n)}}_handleCatalog(e){return this._singlePromiseFactory.create(0,e,t=>this.getIsCatalogSynced(e)?t():this._rapiAccess.getCatalog(e).then(e=>Promise.all([this._handleContentWithAssets(this._rapiAccess.getComponentsOf(e),["perspectiveImage"]),this._handleItemsAndAdditionalContents(e),this._handleMaterialsAndTextures(e),this._handleExternalMeshes(e),this._handleTags(e.tags)])).then(()=>{Q.set(e,!0),t()},e=>this._softReject(t,'Catalog sync error: "'+e+'"')))}_handleTags(e){return this._handleContentWithAssets(this._rapiAccess.getTags(e),["pngIcon","svgIcon"])}_handleExternalMeshes(e){return new Promise(t=>{this._rapiAccess.getMeshesOfCatalog(e.id).then(e=>{const n=[];e.forEach(e=>{n.push(this._handleContentWithAssets(Promise.all([this._rapiAccess.getMesh(e.id)]),["url"]))}),Promise.all(n).then(t,e=>this._softReject(t,'Sync crt files error: "'+e+'"'))},e=>this._softReject(t,'getMeshesOfCatalog error: "'+e+'"'))})}_handleItemsAndAdditionalContents(e){return new Promise(t=>{this._rapiAccess.getItemsOf(e).then(e=>{const n=[];n.push(this._handleContentWithAssets(Promise.resolve(e),["perspectiveImage"])),this._rapiAccess.getAdditionalContentsOfItems(e).then(e=>{const t=e.filter(e=>-1!==[5,6,4].indexOf(e.type));n.push(this._handleContentWithAssets(Promise.resolve(t),["content"]))},e=>this._softReject(t,'getAdditionalContentsOfItems error: "'+e+'"')),Promise.all(n).then(t,e=>this._softReject(t,'AdditionalContent image sync error:"'+e+'"'))})})}_handleMaterialsAndTextures(e){return new Promise(t=>{this._rapiAccess.getMaterialsOf(e).then(e=>{const n=[];n.push(this._handleContentWithAssets(Promise.resolve(e),["thumbnail"])),e.forEach(e=>{n.push(this._handleContentWithAssets(this._rapiAccess.getTexturesOf(e),["image"]))}),Promise.all(n).then(t,e=>this._softReject(t,'getTexturesOf error: "'+e+'"'))},e=>this._softReject(t,'getMaterialsOf error: "'+e+'"'))})}_handleContentWithAssets(e,t){return new Promise(n=>e.then(e=>this._fetchAssets(e,t).then(n,e=>this._softReject(n,'_handleContentWithAssets error: "'+e+'"')),e=>this._softReject(n,'_handleContentWithAssets promise error: "'+e+'"')))}_fetchAssets(e,t){const n=[];e||(e=[]);for(let s=0,o=e.length;s<o;s++){const o=e[s];t.forEach(e=>{const t=o[e];t&&n.push(this._preCacheAsset(t))})}return Promise.all(n)}_preCacheAsset(e){return new Promise(t=>{if(J.get(e))return t();this._assetUrlToBase64(e).then(n=>{J.set(e,n),t()},e=>this._softReject(t,'_preCacheAsset error: "'+e+'"'))})}_assetUrlToBase64(e){return new Promise(t=>{this._mainThreadToWorker.sendToWorker(5,e,t,e=>this._softReject(t,'_assetUrlToBase64 error: "'+e+'"'))})}_softReject(e,t){this._errorHandler.softReject(e,t,2)}requestAsset(e,t=!1){return navigator.onLine&&!this._alwaysUseCache?e:J.get(e)||(t?e:null)}setAlwaysUseCache(e){this._alwaysUseCache=e}preFillAssetCache(e,t){J.set(e,t)}}return _([F],e.prototype,"_rapiAccess",void 0),_([F],e.prototype,"_singlePromiseFactory",void 0),_([F],e.prototype,"_errorHandler",void 0),_([F],e.prototype,"_configuratorUiCallbacks",void 0),_([F],e.prototype,"_initData",void 0),e})());class Y{constructor(e){this.info=e,this._init()}_init(){this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}resolve(e){e&&this._resolve(e),this._resolve()}reject(e){this._reject(e)}wait(){return this._promise}reset(){this._init()}}e("F",Y);var ee=e("G","static/GLTFLoader-5b296b5fb14cfe1a.js"),te=e("a7","static/DRACOLoader-5edeeab4a8dbc0bd.js");const ne={"draco_wasm_wrapper.js":"static/draco_wasm_wrapper-d775f9f135cb30ff.js","draco_decoder.wasm":"static/draco_decoder-979e668167e37c95.wasm","draco_decoder.js":"static/draco_decoder-3866672a1fa2f980.js"};let se=(()=>{class e{constructor(e){if(this._gltfLoaderGuard=new Y,this._creator_=e,THREE.GLTFLoader&&THREE.DRACOLoader)this._initLoaders();else{let e=this._scriptLoader.fetch(ee,{id:"gltf-loader"}),t=this._scriptLoader.fetch(te,{id:"draco-loader"});Promise.all([e,t]).then(()=>this._initLoaders())}}_initLoaders(){this._gltfLoader=new THREE.GLTFLoader;const e=new THREE.DRACOLoader;if("function"!=typeof e._loadLibrary)throw new Error("Can not patch draco loader! Did three.js update the DracoLoader example?");const t=e._loadLibrary.bind(e._loadLibrary);e._loadLibrary=(e,s)=>{const o=ne[e];if(!o)throw new Error('Can not load draco dependency "'+e+'" did three.js update DracoLoader lib? Available files'+JSON.stringify(ne));return t(n()+o,s)},this._gltfLoader.setDRACOLoader(e),this._gltfLoaderGuard.resolve(this._gltfLoader)}async loadGLB(e,t,n,s,o,r,i,a){return await this._gltfLoaderGuard.wait(),new Promise((l,h)=>{this._gltfLoader.load(e,e=>{l(this._handleGLTFScene("GLB",e,t,n,s,o,r,i))},e=>{a&&a(e.loaded/e.total)},e=>{h(e)})})}async loadGLTF(e,t,n,s,o,r,i,a){return await this._gltfLoaderGuard.wait(),new Promise((l,h)=>{this._gltfLoader.parse(e,null,e=>{l(this._handleGLTFScene("GLTF",e,t,n,s,o,r,i))},e=>{a&&a(e.loaded/e.total)},e=>{h(e)})})}_handleGLTFScene(e,t,n,s,o,r,i,a){if(!t||!t.scene||!t.scene.children||0===t.scene.children.length)return null;if(n&&t.scene.position.copy(n),s&&(t.scene.rotation.y=s),o){const e=new THREE.Box3;e.setFromObject(t.scene);const{x:n,y:s,z:r}=e.getSize(new THREE.Vector3);let i=new THREE.Vector3(o.x/n,o.y/s,o.z/r);t.scene.scale.copy(i)}return r&&t.scene.scale.multiply(r),t.scene.type=e,t.scene.traverse(e=>{if(e instanceof THREE.Mesh){if(e.layers.set(3),e.material instanceof THREE.MeshStandardMaterial){const t=e.material;if(this._environmentLoader.setEnvMap(t),a&&i&&i>0){let e=new THREE.Color(i);t.color=e.copyGammaToLinear(e),t.roughness=.5,t.metalness=.1}t.needsUpdate=!0}e.castShadow=!0,e.receiveShadow=!0}}),t.scene}}return _([F],e.prototype,"_environmentLoader",void 0),_([F],e.prototype,"_scriptLoader",void 0),e})(),oe=(()=>{class e{constructor(e){this._jsonLoaded=!1,this._creator_=e}_loadShaders(){return new Promise((e,t)=>{if(this._jsonLoaded)return e();this._networkLayer.fetch(n()+"static/shaders-ac8930ba02e392fe.json",{credentials:"same-origin"}).then(o,t).then(t=>{window._rsl=t,this._jsonLoaded=!0,e()},t)})}fetch(){return window._rsl||(window._rsl={}),new Promise((e,t)=>this._loadShaders().then(()=>{this._scriptLoader.fetch("static/rthree-508a6ceb9a1516ce.js",{id:"three-lib"}).then(e,t)},t))}}return _([F],e.prototype,"_scriptLoader",void 0),_([F],e.prototype,"_networkLayer",void 0),e})(),re=(()=>{class e{constructor(e){this._context_=e}getStore(e="rml_default"){return this._localStorage.getItem(e)||{entries:[]}}saveStore(e,t){this._localStorage.setItem(e,t)}addItem(e,t,n="rml_default",s=5){const o=this.getStore(n),r=o.entries.find(t=>t.id===e);if(r?(r.payload=t,r.date=Date.now()):o.entries.push({id:e,date:Date.now(),payload:t}),o.entries.length>s)for(o.entries.sort((e,t)=>t.date-e.date);o.entries.length>s;)o.entries.pop();this.saveStore(n,o)}getItem(e,t="rml_default"){const n=this.getStore(t).entries.find(t=>t.id===e);return n?n.payload:null}}return _([F],e.prototype,"_localStorage",void 0),e})();class ie{set(e,t){t&&(void 0!==t.enableAA&&(e.enableAA=t.enableAA),this._setSAOPass(e,t),this._setShadowPass(e,t),this._setGroundShadow(e,t))}_setSAOPass(e,t){if(t.SAOPass){const n=t.SAOPass;void 0!==n.enabled&&(e.getSAOPass().enabled=n.enabled),void 0!==n.smoothTransition&&(e.getSAOPass().smoothTransition=n.smoothTransition),n.occlusionWorldRadius&&(e.getSAOPass().occlusionWorldRadius=n.occlusionWorldRadius),n.intensity&&(e.getSAOPass().intensity=n.intensity),n.bias&&(e.getSAOPass().bias=n.bias),n.numSamples&&(e.getSAOPass().numSamples=n.numSamples)}}_setShadowPass(e,t){if(t.shadowPass){const n=t.shadowPass;void 0!==n.enabled&&(e.getShadowPass().enabled=n.enabled),void 0!==n.smoothTransition&&(e.getShadowPass().smoothTransition=n.smoothTransition),void 0!==n.enableAccumulation&&(e.getShadowPass().enableAccumulation=n.enableAccumulation),n.shadowRadius&&(e.getShadowPass().shadowRadius=n.shadowRadius),n.shadowBiasMultiplier&&(e.getShadowPass().shadowBiasMultiplier=n.shadowBiasMultiplier),n.numSamples&&(e.getShadowPass().numSamples=n.numSamples)}}_setGroundShadow(e,t){if(t.groundShadow){const n=t.groundShadow;void 0!==n.enable&&(e.getShadowPlanePass().enable=n.enable),void 0!==n.smoothTransition&&(e.getShadowPlanePass().smoothTransition=n.smoothTransition),n.numSamples&&(e.getShadowPlanePass().numSamples=n.numSamples),n.numSamplesPerFrame&&(e.getShadowPlanePass().numSamplesPerFrame=n.numSamplesPerFrame)}}}e("aa",ie);const ae=e("T",e=>new THREE.Vector3(e.x/1e3,e.z/1e3,e.y/-1e3)),le=(e("Z",e=>new THREE.Vector3(e.x/1e3,e.z/1e3,e.y/1e3)),e("a4",e=>({x:1e3*e.x,y:-1e3*e.z,z:1e3*e.y}))),he=e=>decodeURIComponent(encodeURIComponent(e)),ce=e("c",e=>{if(!e){const t=typeof e;return"number"===t||"boolean"===t?e:null}if(!e.hasOwnProperty("size")&&e.size&&"function"==typeof e.size){let t=de(e);for(let e=0;e<t.length;e++)t[e]=ce(t[e]);return"string"==typeof t?he(t):t}if("object"==typeof e)for(let t in e)e.hasOwnProperty(t)&&(e[t]=ce(e[t]));return"string"==typeof e?he(e):e}),de=e=>{let t=[];if(e){let n=e.size();for(let s=0;s<n;s++)t.push(e.get(s))}return t},ue=e=>{let t=new THREE.Matrix4,n=ce(e);return t.fromArray(n),t.transpose(),(e=>{let t=new THREE.Matrix4;t.set(1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1),t.scale(new THREE.Vector3(.001,.001,.001));let n=new THREE.Matrix4;return n.set(1,0,0,0,0,0,-1,0,0,1,0,0,0,0,0,1),n.scale(new THREE.Vector3(1e3,1e3,1e3)),t.multiply(e).multiply(n)})(t)};function pe(){class e extends THREE.Object3D{constructor(e,t,n,s){super(),this._selected=!1,this.geometryChanged=!0,this.meshes=[],this.castShadow=!1,this.receiveShadow=!0,this._setValues(e,t,n,s)}static _generateOutline(e,t){let n=new THREE.LineSegments(new THREE.EdgesGeometry(e),new THREE.LineDashedMaterial({color:"#000000",dashSize:.03,gapSize:.01,linewidth:1}));return n.translateOnAxis(t,1),n.userData.ignoreComponentRaycast=!0,n}static cloneDockLine(e,t){let n=new THREE.LineSegments(e.geometry,e.material);return n.translateOnAxis(t.getCenter(new THREE.Vector3),1),n.name="dockline",n.layers.set(5),n.userData.ignoreComponentRaycast=!0,n}_setValues(e,t,n,s){e&&(this.roomleId=e,this.name=e.toString()),t&&(this.roomlePosition=Object.assign({},t)),n&&(this.roomleRotation=Object.assign({},n)),s&&(this.parentObjectId=s)}get loadingMesh(){return this._loadingMesh}get boundingBoxMesh(){return this._boundingBoxMesh}get boundingBox(){return this._boundingBox}set roomlePosition(e){this._roomlePosition=e,e&&this.position.set(e.x/1e3,e.z/1e3,e.y/-1e3)}get roomlePosition(){return this._roomlePosition}set roomleRotation(e){this._roomleRotation=e,e&&this.rotation.set(e.x,e.z,-e.y)}get roomleRotation(){return this._roomleRotation}replaceMeshes(e){this.removeAllMeshes(),e.forEach(e=>{this.addMesh(new THREE.Mesh(e.geometry,e.material))})}addMesh(e,t){e.renderOrder=2,e.userData.meshType=0,t&&e.applyMatrix4(ue(t)),this.add(e),this.meshes.push(e)}getMeshById(e){return this.meshes.find(t=>t.userData.meshId===e)}removeMeshById(e){const t=this.getMeshById(e);t?this.removeMesh(t):console.warn("Could not remove mesh with id "+e,this.roomleId,this.meshes)}removeMesh(e){const t=this.meshes.indexOf(e);this.remove(e),A(e),t<0||this.meshes.splice(t,1)}removeAllMeshes(e=!0){this.meshes.forEach(t=>{this.remove(t),e&&A(t)}),this.meshes=[],this._removeLoadingMesh(),this.remove(this._boundingBoxMesh),A(this._boundingBoxMesh),this._boundingBoxMesh=null}_hideAllMeshes(){this.meshes.forEach(e=>e.visible=!1)}_showAllMeshes(){this.meshes.forEach(e=>e.visible=!0)}select(){this._selected=!0}loading(){if(!this._kernelBoundingBox)return void console.warn("Bounding box (box for measurements) for component "+this.roomleId+" not set, can not show external mesh loading box!");this._removeLoadingMesh(),this._hideAllMeshes();const{x:e,y:t,z:n}=this._kernelBoundingBox.getSize(new THREE.Vector3);let s=new THREE.BoxGeometry(e,t,n);this._loadingMesh=new THREE.Mesh(s,new THREE.MeshStandardMaterial({transparent:!0,opacity:b,color:new THREE.Color(E)})),this._loadingMesh.name="loading mesh",this._loadingMesh.receiveShadow=!1,this._loadingMesh.castShadow=!1,this._loadingMesh.layers.set(5),this._loadingMesh.translateOnAxis(this._kernelBoundingBox.getCenter(new THREE.Vector3),1),this._loadingMesh.renderOrder=3,this.add(this._loadingMesh)}_removeLoadingMesh(){this._loadingMesh&&(this.remove(this._loadingMesh),A(this._loadingMesh),this._loadingMesh=null)}loadingFinished(){this._removeLoadingMesh(),this._showAllMeshes()}deselect(){this._selected=!1}hoverOn(){r("pointer")}hoverOff(){r("default")}removeFromParent(){this.parent&&(this.parent.remove(this),this.removeAllMeshes())}computeBoundingBox(t,n=!1){if(this._boundingBoxMesh&&this.remove(this._boundingBoxMesh),!n&&t&&0===t.size.x&&0===t.size.y&&0===t.size.z)return;let s;if(!t||n){this._boundingBox=new THREE.Box3;let e=new THREE.Vector3;this.meshes.forEach(t=>{if(t.geometry instanceof THREE.Geometry){let n=t.geometry.vertices;for(let s=0,o=n.length;s<o;s++)e.copy(n[s]),e.applyMatrix4(t.matrix),this._boundingBox.expandByPoint(e)}else if(t.geometry instanceof THREE.BufferGeometry){let n=t.geometry.attributes.position;if(void 0!==n)for(let s=0,o=n.count;s<o;s++)e.fromBufferAttribute(n,s).applyMatrix4(t.matrixWorld),this._boundingBox.expandByPoint(e)}}),this._kernelBoundingBox=this._boundingBox.clone();let t=this._boundingBox.max.x-this._boundingBox.min.x,n=this._boundingBox.max.y-this._boundingBox.min.y,o=this._boundingBox.max.z-this._boundingBox.min.z;s=new THREE.BoxGeometry(t,n,o)}else{this._kernelBoundingBox=C(t),this._boundingBox=this._kernelBoundingBox.clone();let{x:e,y:n,z:o}=this._boundingBox.getSize(new THREE.Vector3);s=new THREE.BoxGeometry(e,n,o)}this._boundingBoxMesh=new THREE.Mesh(s,new THREE.MeshStandardMaterial({color:"#FFFFFF",transparent:!0,opacity:0,polygonOffset:!0,polygonOffsetFactor:-1,visible:!1})),this._boundingBoxMesh.name="bounding box mesh";let o=this._boundingBox.getCenter(new THREE.Vector3);this._boundingBoxMesh.position.add(o),this._boundingBoxMesh.layers.set(5),this._boundingBoxMesh.renderOrder=3,this._boundingBoxMesh.castShadow=!1,this._boundingBoxMesh.receiveShadow=!1,this.add(this._boundingBoxMesh),this._dockline=e._generateOutline(s,o),this._dockline.name="bounding box outline",this._dockline.layers.set(5),this._selected&&this.add(this._dockline)}recursiveMeshes(){let t=this.meshes.slice();return this.children.forEach(n=>{n instanceof e&&t.push(...n.recursiveMeshes())}),t}isChild(t){let n=!1;return this.children.forEach(s=>{s instanceof e&&!n&&(n=s.roomleId===t||s.isChild(t))}),n}getKernelPosition(e){let t=this.parent.localToWorld(this.position);return le(e.worldToLocal(t))}}class t extends e{constructor(e,t){super(e,null,null,null),this.glbUrl=t}}class n extends e{constructor(e,t,n,s){super(e,t,n,s),this._stringId=null,this.receivedPointAssociation=!1,this.castShadow=!1,this.receiveShadow=!1}get stringId(){return this._stringId?this._stringId:this.roomleId.toString()}addMesh(e,t){super.addMesh(e,t),e.material instanceof THREE.MeshStandardMaterial&&(e.material.opacity=.6,e.material.roughness=1,e.material.metalness=0,e.material.color=new THREE.Color("#DDDDDD")),e.renderOrder=1,e.castShadow=!1,e.receiveShadow=!1}hoverOn(){this.remove(this._dockline),this.meshes.forEach(({material:e})=>{e.opacity=.9,e.roughness=1,e.metalness=0,e.color=new THREE.Color("#DDDDDD")}),r("pointer")}hoverOff(){this.add(this._dockline),this.meshes.forEach(({material:e})=>{e.opacity=.6,e.roughness=1,e.metalness=0,e.color=new THREE.Color("#DDDDDD")}),r("default")}clonePreview(t){const s=new n(this.roomleId,this.roomlePosition,this.roomleRotation,this.parentObjectId);return s._stringId=this.roomleId+"_"+t,this.children.forEach(e=>{e instanceof THREE.Mesh&&0===e.userData.meshType&&s.meshes.push(e.clone(!0))}),s.meshes.forEach(e=>{e.material=e.material.clone(),e.geometry=e.geometry.clone(),s.add(e)}),this._dockline&&(s._dockline=e.cloneDockLine(this._dockline,this._boundingBox)),this._boundingBoxMesh&&(s._boundingBoxMesh=this._boundingBoxMesh.clone(!0)),this._boundingBox&&(s._boundingBox=this._boundingBox.clone()),s}preparePreview(){this.add(this._dockline),this.add(this._boundingBoxMesh)}}class s extends n{constructor(e,t,n,s,o){super(e,t,n,s),o&&(this._stringId=this.roomleId+"_has_additional_dock_point_copy")}set roomleLineFrom(e){this._roomleLineFrom=e,this.lineFrom=ae(e)}get roomleLineFrom(){return this._roomleLineFrom}set roomleLineTo(e){this._roomleLineTo=e;let t=ae(e);t.equals(this.lineFrom)&&(console.warn("lineFrom and lineTo are equal!"),t.add(new THREE.Vector3(0,.01,0))),this.lineTo=t}get roomleLineTo(){return this._roomleLineTo}set roomlePositionFrom(e){this._roomlePositionFrom=e,this.positionFrom=ae(e)}get roomlePositionFrom(){return this._roomlePositionFrom}set roomlePositionTo(e){this._roomlePositionTo=e;let t=ae(e);t.equals(this.positionFrom)&&(console.warn("positionFrom and positionTo are equal!"),t.add(new THREE.Vector3(0,.01,0))),this.positionTo=t}get roomlePositionTo(){return this._roomlePositionTo}addMesh(e,t){super.addMesh(e,t),e.visible=!1,e.renderOrder=3}hoverOn(){this._dockline.visible=!0,r("pointer")}hoverOff(){this._dockline.visible=!1,r("default")}preparePreview(){super.preparePreview(),this._dockline.visible=!1;let e=this.lineTo.clone(),t=this.lineFrom.clone();const n=(new THREE.Vector3).subVectors(e,t);let s=n.length(),o=n.normalize(),r=new THREE.ArrowHelper(o,t),i=new THREE.CylinderGeometry(.01,.01,s,16,1);this.lineMesh=new THREE.Mesh(i,new THREE.MeshStandardMaterial({color:E,transparent:!0,opacity:.4})),this.lineMesh.name="line mesh";const a=(new THREE.Quaternion).setFromEuler(r.rotation);this.lineMesh.quaternion.multiply(a),this.lineMesh.renderOrder=1;let l=(new THREE.Vector3).addVectors(e,t).multiplyScalar(.5);this.lineMesh.position.copy((new THREE.Vector3).subVectors(l,this.position.clone())),this.add(this.lineMesh);let h=this._boundingBox.getCenter(new THREE.Vector3).applyEuler(this.docklineRotation),c=null,d=0,u=Math.abs(o.x),p=Math.abs(o.y),g=Math.abs(o.z);u>=p&&u>=g?(c=new THREE.Vector3(h.x,0,0),d=Math.sqrt(h.y*h.y+h.z*h.z)):p>=u&&p>=g?(c=new THREE.Vector3(0,h.y,0),d=Math.sqrt(h.x*h.x+h.z*h.z)):g>=p&&g>=u&&(c=new THREE.Vector3(0,0,h.z),d=Math.sqrt(h.y*h.y+h.x*h.x)),d=d>0?d:.01;let m=(new THREE.Vector3).subVectors(this.positionTo.clone(),this.positionFrom.clone()).length()+c.length(),_=new THREE.CylinderGeometry(1.1*d,1.1*d,m,32,1);this.boundingLineMesh=new THREE.Mesh(_,new THREE.MeshStandardMaterial({color:"#ffffff",transparent:!0,opacity:0})),this.boundingLineMesh.name="bounding line mesh",this.boundingLineMesh.userData.ignoreComponentRaycast=!0;let f=this.positionTo.clone(),w=this.positionFrom.clone(),y=(new THREE.Vector3).subVectors(f,w).normalize(),b=new THREE.ArrowHelper(y,w);const C=(new THREE.Quaternion).setFromEuler(b.rotation);this.boundingLineMesh.quaternion.multiply(C),this.boundingLineMesh.renderOrder=3;let M=(new THREE.Vector3).addVectors(this.positionTo.clone(),this.positionFrom.clone()).multiplyScalar(.5).add(h);this.boundingLineMesh.position.copy((new THREE.Vector3).subVectors(M,this.position.clone())),this.add(this.boundingLineMesh)}clonePreviewLine(t){let n=new s(this.roomleId,this.roomlePosition,this.roomleRotation,this.parentObjectId,this.receivedPointAssociation);return n._stringId=this.roomleId+"_"+t,this.children.forEach(e=>{e instanceof THREE.Mesh&&0===e.userData.meshType&&n.meshes.push(e.clone(!0))}),n.meshes.forEach(e=>{e.material=e.material.clone(),e.geometry=e.geometry.clone(),n.add(e)}),this._dockline&&(n._dockline=e.cloneDockLine(this._dockline,this._boundingBox)),this._boundingBoxMesh&&(n._boundingBoxMesh=this._boundingBoxMesh.clone(!0)),this._boundingBox&&(n._boundingBox=this._boundingBox.clone()),n}getPositionForIntersectionPoint(e){let t=this._boundingBox.getCenter(new THREE.Vector3).applyEuler(this.docklineRotation),n=this.positionTo.clone().add(t),s=this.positionFrom.clone().add(t),o=new THREE.Line3(s,n).closestPointToPoint(e,!0,new THREE.Vector3);return(isNaN(o.x)||isNaN(o.y)||isNaN(o.z))&&o.copy(e),o.sub(t)}updatePreviewPosition(e){let t=this.getPositionForIntersectionPoint(e),n=this.parent.localToWorld(t);this._newPosition=this.worldToLocal(n);let s=this._boundingBox.getCenter(new THREE.Vector3).applyEuler(this.docklineRotation);this._dockline.position.copy((new THREE.Vector3).addVectors(this._newPosition,s)),this._dockline.rotation.copy(this.docklineRotation)}hideSelectionLine(){this._dockline.visible=!1}getKernelPosition(e){if(this._newPosition){let t=this.localToWorld(this._newPosition);return le(e.worldToLocal(t))}return super.getKernelPosition(e)}}class o extends THREE.PerspectiveCamera{constructor(e,t,n,s,o){super(e,t,n,s),o||(o={left:0,top:1,right:1,bottom:0}),this.offset=o}set offset(e){this._offset=e,this.updateProjectionMatrix()}get offset(){return this._offset}_calculateProjectionMatrix(){let e,t,n,s,o=this.fov*(2*Math.PI/360)/2;n=Math.tan(o),s=-n;let r=Math.atan(this.aspect*Math.tan(o));t=Math.tan(r),e=-t;let i=this._offset.left,a=this._offset.right,l=this._offset.top,h=this._offset.bottom,c=new THREE.Vector2(a-i,l-h),d=new THREE.Vector2(i+c.x/2,h+c.y/2);if(c.x<c.y){let o=(1-d.x)/(c.x/2),r=d.x/(c.x/2);t*=o,e*=r;let i=(o+r)/2;n*=i,s*=i}else{let o=(1-d.y)/(c.y/2),r=d.y/(c.y/2);n*=o,s*=r;let i=(r+o)/2;e*=i,t*=i}e*=this.near,t*=this.near,n*=this.near,s*=this.near;let u=this.near*Math.tan(Math.PI/180*.5*this.fov)/this.zoom*2,p=this.aspect*u;return this.view&&this.view.enabled&&(e+=this.view.offsetX*p/this.view.fullWidth,n-=this.view.offsetY*u/this.view.fullHeight,t+=this.view.offsetX*p/this.view.fullWidth,s-=this.view.offsetY*u/this.view.fullHeight),(new THREE.Matrix4).makePerspective(e,t,n,s,this.near,this.far)}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){this._offset?(this.projectionMatrix=this._calculateProjectionMatrix(),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()):super.updateProjectionMatrix()}}return{create:function(t,n,s,o){return new e(t,n,s,o)},createPreview:function(e,t){return new n(e,{x:0,y:0,z:0},{x:0,y:0,z:0},t)},createStatic:function(e,n){return new t(e,n)},createPreviewLine:function(e){let t=new s(e.id,e.roomlePosition,e.roomleRotation,e.parentObjectId,e.receivedPointAssociation);return e.meshes.forEach(e=>{let n=e.clone();n.material=e.material.clone(),n.geometry=e.geometry.clone(),t.addMesh(n)}),t.computeBoundingBox(),t},isPreview:function(e){return e instanceof n},isPreviewLine:function(e){return e instanceof s},createCamera:function(e,t,n,s,r){return new o(e,t,n,s,r)}}}const ge=new Map,me=function(e,t,n){let s=ge.get(e);if(s){const o=n?[n]:void 0;s.forEach(({resolve:e,reject:n})=>t?e.apply(e,o):n.apply(n,o)),ge.delete(e)}};class _e{static finishOperation(e,t){me(e,!0,t)}static failOperation(e,t){me(e,!1,t)}static waitFor(e,t){return new Promise((n,s)=>{let o=ge.get(e);o||(ge.set(e,[]),o=ge.get(e)),o.push({resolve:n,reject:s}),"function"==typeof t&&t.apply(t)})}}e("a",_e);const fe=new Map;class we{static start(e){if(!window.performance||!window.performance.getEntriesByName)return"";let t=window.performance.getEntriesByName(e).length++,n="";t<100&&(n="0"),t<10&&(n="0"+n);const s=t>0?e+"_"+n+t:e,o=s+"_start";return window.performance.mark(o),s}static addMeta(e,t){const n=we.getMeta(e);fe.set(e,Object.assign(n,t))}static getMeta(e){return fe.get(e)||{}}static end(e){}static getMeasure(e){return[]}static showBenchmarks(e){const t=window.performance.getEntriesByType("measure");t.sort((function(e,t){return e.startTime-t.startTime}));const n=[];for(let s=0,o=t.length;s<o;s++){const o=t[s];e&&-1===o.name.indexOf(e)||n.push({Start:parseFloat(o.startTime.toFixed(2)),Name:o.name,Duration:parseFloat(o.duration.toFixed(2))})}console.table(n)}}e("B",we);var ye={isProduction:!0,isUnitTesting:!1,environment:"production",detailEnvironment:"development",features:{},APP:{RAPI:{server:"/api/v2",localReverseProxy:"https://www.roomle.com/api/v2",liveServer:"https://www.roomle.com/api/v2",testServer:"https://www.test.roomle.com/api/v2",headers:{apiKey:"roomle_portal_v2",currentTenant:9,locale:"en",language:"en",device:1,token:"anonymous",platform:"web"},itemHeaders:{assetRevision:"glb",assetFileFormat:"glb"}},SHORTENER_URL:"http://rml.co/"},environments:{PRODUCTION:"production",DEVELOPMENT:"development",TEST:"test",TEST_SERVER:"test_server",ALPHA:"alpha"}};"undefined"!=typeof module&&module.exports||(window.IS_DEBUG=!0),function(e=!1){if(e){let e=JSON.parse(JSON.stringify(ye));e.APP,e.features}}();const Ee=JSON.parse(JSON.stringify(ye));var be=e("E",Ee);let Ce,Me,ve,Te,Re;const Ie={WASM:{CONFIGURATOR:{URL:"static/ConfiguratorKernel-3e4350b62d6ccb33.wasm",LOADER:"static/ConfiguratorKernel-9caa95838538c54f.js"},PLANNER:{URL:"static/RoomleCore-e255ef00e2f5451a.wasm",LOADER:"static/RoomleCore-0cc69dbcd8b6156d.js"}},ASM:{CONFIGURATOR:{MEM_URL:"static/ConfiguratorKernelJs-d70d079649d7be16.mem",LOADER:"static/ConfiguratorKernelJs-09c978f7fdbef284.js"},PLANNER:{MEM_URL:"static/RoomleCoreJs-a8fa921965a7d125.mem",LOADER:"static/RoomleCoreJs-b092f47eed9a8777.js"}}},Pe=!!window.WebAssembly;e("C",(()=>{class e{constructor(e,t){this._requestedMaterialIds=[],this._configuratorKernelCallbackListener=new Set,this._cachedGroupIds=[],this._waitingForGroups=!1,this._subComponentsWaiters=new Map,this._shouldWait=!0,this._creator_=e,this._setupKernelPaths(t),this._setupEmsModule(t),this._useWASM=Pe,this._kernelPath=Pe?ve:Te,window.KernelCallback={isReady:this.isReady.bind(this)},this._lifeCycleManager.addEventListener(this)}_utilityToLongArray(e){const t=new this._kernelContainer.LongArray;return e.forEach(e=>t.push_back(e)),t}get kernelContainer(){return this._kernelContainer}get kernelInstance(){return this._kernelInstance}_setupKernelPaths(e){const t=0===e?"PLANNER":"CONFIGURATOR";Ce=Ie.ASM[t].MEM_URL,Me=Ie.WASM[t].URL,ve=Ie.WASM[t].LOADER,Te=Ie.ASM[t].LOADER,Re=!0}_setupEmsModule(e){const t=this;this._kernelContainer={locateFile(t){const s=0===e?/RoomleCoreJs[\-a-z0-9]*\.js\.mem/:/ConfiguratorKernelJs[\-a-z0-9]*\.js\.mem/;return t.match(s)?n()+Ce:t},wasmBinaryFile:n()+Me,preRun:[],postRun:[],setStatus:null,print(e){t._kernelIo.log(e)},printErr(e){t._kernelIo.error(e)},quit(e){t._kernelIo.throw(e)}},Re&&Pe&&(this._kernelContainer.instantiateWasm=function(e,t){return((e,t,s)=>{const o="function"==typeof WebAssembly.instantiateStreaming;we.addMeta("kernel_is_ready",{cachedInIndexedDB:!1});let r=null;o?(we.start("kernel_stream_compile"),r=WebAssembly.instantiateStreaming(fetch(n()+e),t),we.end("kernel_stream_compile")):(we.start("kernel_legacy_compile"),r=fetch(n()+e).then(e=>e.arrayBuffer()).then(e=>WebAssembly.instantiate(e,t))),we.addMeta("kernel_is_ready",{instantiateStreaming:o}),r.then(e=>{we.end(o?"kernel_stream_compile":"kernel_legacy_compile"),s(e.instance)},e=>console.error(e))})(Me,e,t),{}})}_passSubComponentsToKernel(e,t){const n=e.id,s=t.get(n);if(s)for(let t=0,o=s.length;t<o;t++){const{parentId:o,partId:r}=s[t];this._kernelIo.setMeta({componentId:n}),this._kernelInstance.loadedSubComponent(o,r,n,e.configuration)}}_fetchSubComponents(e){let t=[...e.keys()];t.length&&this._rapiAccess.getComponents(t).then(t=>{for(let n=0,s=t.length;n<s;n++)this._passSubComponentsToKernel(t[n],e);this._flushSubComponentsWaiters()})}_flushSubComponentsWaiters(){this._fetchSubComponents(this._subComponentsWaiters),this._subComponentsWaiters=new Map,this._shouldWait=!1}isReady(){this._kernelContainer.setExternalHelpers(this._kernelIo,{convertCObject:ce}),be.isProduction||be.isUnitTesting||this.addDebugInfo(),window.KernelCallback&&(window.KernelCallback=null,delete window.KernelCallback)}addDebugInfo(){const e=function(t,n=[]){const s=Object.getPrototypeOf(t),o=s?Object.getOwnPropertyNames(s):[],r=t?Object.getOwnPropertyNames(t):[];return s?e(s,[...n,...r,...o]):[...r,...o,...n]},t=e(this),n=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toString","valueOf"];[...new Set(t)].forEach(e=>{if(!e.startsWith("_")&&"function"==typeof this[e]&&-1===n.indexOf(e))try{const t=this[e].bind(this);this[e]=function(...n){return this._kernelIo.log("[ KernelCommunication ]: "+e),t(...n)}}catch(e){}})}getConfigurationData(e){return new Promise(t=>{var n;const s=this.kernelInstance.getPlanObject(e),o=(new Date).toISOString(),r=this.kernelInstance.getComponentId(e),i=W(r),a=(null===(n=s.boxForMeasurement)||void 0===n?void 0:n.size)||s.bounds;t({created:o,lastAccess:o,configuration:this.kernelInstance.getSerializedConfiguration(e),configurationHash:this.kernelInstance.getHashOfConfiguration(e),parts:JSON.stringify(this.kernelInstance.getPartList(e)),rootComponentId:r,width:a.x,height:a.z,depth:a.y,catalog:i,orderable:!1,requestable:!1})})}loadComponent(e,t,n){this._rapiAccess.getComponent(t.componentId).then(s=>{var o;let r=s.configuration;r||(r="error",null===(o=this._configuratorUiCallbacks)||void 0===o||o.onContentProblem({rapiPath:"components",ids:[t.componentId],message:t.componentId+" has no configuration"})),this._kernelIo.setMeta({componentId:t.componentId}),this._kernelInstance.loadComponent(e,r,t,n),this._flushSubComponentsWaiters()},s=>{var o;this._kernelInstance.loadComponent(e,"error",t,n),this.onLoadComponentError(s,t.componentId),null===(o=this._configuratorUiCallbacks)||void 0===o||o.onError(new Error(`Component with id "${t.componentId}" can not be loaded. "${s}"`)),this._flushSubComponentsWaiters()})}loadSubComponent(e,t,n){if(this._shouldWait){let s=this._subComponentsWaiters.get(n);s||this._subComponentsWaiters.set(n,[]),s=this._subComponentsWaiters.get(n),s.push({parentId:e,partId:t}),this._subComponentsWaiters.set(n,s)}else this._rapiAccess.getComponent(n).then(s=>{var o;let r=s.configuration;r||(r="error",null===(o=this._configuratorUiCallbacks)||void 0===o||o.onContentProblem({rapiPath:"components",ids:[n],message:"SubComponent "+n+" has no configuration"})),this._kernelIo.setMeta({componentId:n,parentId:e}),this._kernelInstance.loadedSubComponent(e,t,n,r)})}requestDeleteComponent(e){e&&this._kernelInstance.deleteComponent(e)}dockComponentWithPosition(e,t,n,s,o){var r;this._kernelInstance.dockComponentWithPosition(n,s,e,t,o);const i=this._kernelInstance.getComponentId(n),a=this._kernelInstance.getComponentId(e);null===(r=this._configuratorUiCallbacks)||void 0===r||r.onUserInitiatedDockDone(i,s,a,t,o)}Editor3dAddBakedMesh(e,t,n,s,o,r,i){this._configuratorKernelCallbackListener.forEach(a=>a.Editor3dAddBakedMesh(e,t,n,s,o,r,i))}Editor3dAddNamedMesh(e,t,n,s,o,r,i,a,l,h){this._configuratorKernelCallbackListener.forEach(c=>c.Editor3dAddNamedMesh(e,t,n,s,o,r,i,a,l,h))}Editor3ChangedNamedMesh(e,t,n,s,o){this._configuratorKernelCallbackListener.forEach(r=>r.Editor3ChangedNamedMesh(e,t,n,s,o))}Editor3dRemoveNamedMesh(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.Editor3dRemoveNamedMesh(e,t))}Editor3dBeginConstruction(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.Editor3dBeginConstruction(e,t))}Editor3dEndConstruction(e){this._configuratorKernelCallbackListener.forEach(t=>t.Editor3dEndConstruction(e))}Editor3dComponentCreated(e,t,n,s){this._configuratorKernelCallbackListener.forEach(o=>o.Editor3dComponentCreated(e,t,n,s,!1))}Editor3dComponentDocked(e,t,n,s){this._configuratorKernelCallbackListener.forEach(o=>o.Editor3dComponentDocked(e,t,n,s))}Editor3dGeometryReady(e){this._configuratorKernelCallbackListener.forEach(t=>t.Editor3dGeometryReady(e)),this.requestPlanComponentConstruction(e)}Editor3dGeometryNotReady(e){this._configuratorKernelCallbackListener.forEach(t=>t.Editor3dGeometryNotReady(e))}componentDeleted(e){this._configuratorKernelCallbackListener.forEach(t=>t.componentDeleted(e))}componentMetaUpdated(e){let t=this._kernelInstance.getComponent(e);this._configuratorKernelCallbackListener.forEach(e=>e.componentMetaUpdated(t))}sceneCleared(){this._configuratorKernelCallbackListener.forEach(e=>e.sceneCleared())}requestMaterialsInGroup(e){-1===this._cachedGroupIds.indexOf(e)&&this._cachedGroupIds.push(e),this._waitingForGroups||(this._waitingForGroups=!0,_e.waitFor(4).then(()=>{this._rapiAccess.getMaterialsByGroup(this._cachedGroupIds).then(e=>{e.forEach(e=>{const t=new this._kernelContainer.StringArray;e.materials.forEach(e=>t.push_back(e.id));const n=e.legacyId||e.id;e.legacyId||console.warn("Material group has no legacy id, please check content why this is the case"),this._kernelInstance.setMaterialsInGroup(n,t)}),this._cachedGroupIds=[]},e=>{var t;console.error(e),null===(t=this._configuratorUiCallbacks)||void 0===t||t.onError(new Error(`Material group with ids "${this._cachedGroupIds.join(",")}" can not be loaded. "${e}"`)),this._cachedGroupIds=[]})}))}requestPlanComponentConstruction(e){this._kernelInstance.requestDeltaPlanComponentConstruction(e)}addConfiguratorListener(e){this._configuratorKernelCallbackListener.add(e)}removeConfiguratorListener(e){this._configuratorKernelCallbackListener.delete(e)}cleanUpCallbacks(){"function"==typeof this._kernelContainer.unregisterConfiguratorCallback&&this._kernelContainer.unregisterConfiguratorCallback(this)}async requestMaterialProperties(e){if(this._requestedMaterialIds.push(e),await i(0),!this._requestedMaterialIds.length)return;const t=[...this._requestedMaterialIds];this._requestedMaterialIds=[],(await this._rapiAccess.getMaterials(t)).forEach(e=>{const t=new this._kernelContainer.StringStringMap,n=e.properties||{};for(let e in n)n.hasOwnProperty(e)&&t.set(e,n[e]);t.size()&&this._kernelInstance.setMaterialProperties(e.id,t)})}registerCallbacks(){this._kernelContainer.registerConfiguratorCallback(this)}pause(){this.cleanUpCallbacks()}resume(){this.cleanUpCallbacks(),this.registerCallbacks()}destroy(){}_handleCortoMesh(e,t,n){var s;try{this._kernelInstance.addMeshCorto(t,n,new Uint8Array(e))}catch(e){console.error(e),null===(s=this._configuratorUiCallbacks)||void 0===s||s.onMemoryCorruption()}}}return _([F],e.prototype,"_rapiAccess",void 0),_([F],e.prototype,"_scriptLoader",void 0),_([F],e.prototype,"_kernelIo",void 0),_([F],e.prototype,"_dataSyncer",void 0),_([F],e.prototype,"_lifeCycleManager",void 0),_([F],e.prototype,"_configuratorUiCallbacks",void 0),_([F],e.prototype,"_globalCallback",void 0),e})());const xe=e("D",10);e("b",9);let ke=e("a0",(()=>{class e{constructor(e){this._mergeThreshold=3,this._componentsToMerge=new Se,this._mergeInProgress=!1,this._components=new Map,this._previews=new Map,this._creator_=e,this._getKernelAccess().addConfiguratorListener(this),this._componentFactory=pe()}get materialQueue(){return this.getMeshGenerator().materialQueue}_getKernelAccess(){return je.lookup("kernel-access",this._creator_)}clearReference(){this._getKernelAccess().removeConfiguratorListener(this)}_addMeshToSubPart(e,t,n,s,o,r,i,a){let l=this._generateMesh(e,t,n,o,r,i,a);s&&l.applyMatrix4(ue(s)),this._subPartObject.add(l)}_addMeshToComponent(e,t,n,s,o,r,i,a,l,h){if(this._subPartGuard&&this._subPartGuard.info===e)return void this._addMeshToSubPart(e,null,s,null,r,i,a,l);const c=this.getComponent(e);if(!c)return;const d=this._componentFactory.isPreview(c),u=this._generateMesh(e,n,d?null:s,r,i,a,l);u.userData.meshId=t,u.userData.geometryId=n,u.userData.materialId=s,o&&(u.userData.transform=ue(o),u.applyMatrix4(u.userData.transform)),d&&u.layers.set(4),c&&c.addMesh(u),c.meshes.length>this._mergeThreshold&&this._componentsToMerge.set(e,c.meshes.length)}_changeMeshOfComponent(e,t,n,s,o){const r=this.getComponent(e);if(!r)return;const i=r.getMeshById(t);i&&(i.userData.geometryId!==n&&console.warn("Geometry of mesh has changed!"),i.userData.materialId=s,this._configuratorMeshGenerator.setMaterial(i,s),o&&(i.userData.transform=ue(o),i.position.set(0,0,0),i.scale.set(1,1,1),i.rotation.set(0,0,0),i.applyMatrix4(i.userData.transform)))}_removeMeshFromComponent(e,t){const n=this.getComponent(e);n&&n.removeMeshById(t)}getComponent(e){let t=this._components.get(e);return t||(t=this._previews.get(e.toString()),t)?t:(console.warn("component not found!",e),null)}tryToMergeComponents(){this._initData.moc||this._mergeInProgress||(this._mergeInProgress=!0,this._componentsToMerge.size,this._requestMergeComponents())}_requestMergeComponents(){window.requestIdleCallback(this._mergeNextComponent.bind(this))}_mergeNextComponent(){if(this._componentsToMerge.size>0){const e=this._componentsToMerge.largestValue();this._componentsToMerge.delete(e),this._mergeComponent(e),this._requestMergeComponents()}else this._mergeInProgress=!1,this._geometriesMerged&&this._geometriesMerged(),this._components.forEach(e=>{e.loadingMesh&&console.warn("component still has loading mesh: ",e.hash)})}_mergeComponent(e){const t=this._components.get(e);if(t&&!(t.meshes.length<=this._mergeThreshold))if(this._cacheHolder.componentCache.has(t.hash)){const e=this._cacheHolder.componentCache.get(t.hash).meshes;t.replaceMeshes(e)}else{const e=new Map,n=[],s=[];t.meshes.forEach(t=>{const o=t.userData.material;if(!o)return void console.warn("mesh has no material id set");if(!e.has(o)){const s=new THREE.Mesh(new THREE.Geometry,t.material);s.userData.material=o,s.receiveShadow=!0,s.castShadow=!0,s.layers.set(3),this._setMaterial(s,o),n.push(s),e.set(o,s)}const r=e.get(o).geometry;t.userData.transform?r.merge(t.geometry,t.userData.transform):r.merge(t.geometry),s.push(t)}),n.forEach(e=>t.addMesh(e)),s.forEach(e=>t.removeMesh(e)),this._cacheHolder.componentCache.set(t.hash,t)}}_addRootComponent(e){this._listener&&this._listener.display(e)}removeDockingComponent(){this._getKernelAccess().requestDeleteComponent(this._configuratorContext.dockingRootComponentId),this._configuratorContext.dockingRootComponentId=null}dockComponent(e,t,n,s){let o=this._components.get(t),r=this._components.get(e);r&&(r.roomlePosition=n,r.roomleRotation=s,o&&o.add(r))}dockComponentWithPosition(e,t){let n,s=this._components.get(e.parentId);n=t?t.getKernelPosition(s):e.getKernelPosition(s);const o=we.start("dock_component_with_position_"+e.childId);this._getKernelAccess().dockComponentWithPosition(e.parentId,e.parentDockId,e.childId,e.childDockId,n),this._configuratorContext.dockingRootComponentId=null,we.end(o)}removePreviews(){this._previews.size>0&&(this._previews.forEach(e=>{e.removeFromParent(),e.removeAllMeshes()}),this._previews.clear())}_updatePlanObject(e){const t=this._components.get(e.rootPlanComponentId);let n=!0;t&&(n=t.geometryChanged),this._listener&&this._listener.planObjectUpdated(e,n)}Editor3dAddBakedMesh(e,t,n,s,o,r,i){this._addMeshToComponent(e,null,null,t,null,n,s,o,r,i)}Editor3dAddDockPreview(e,t){let n=this._componentFactory.createPreview(t,e);this._previews.set(t.toString(),n)}Editor3dAddNamedMesh(e,t,n,s,o,r,i,a,l,h){this._addMeshToComponent(e,t,n,s,o,r,i,a,l,h)}Editor3ChangedNamedMesh(e,t,n,s,o){this._changeMeshOfComponent(e,t,n,s,o)}Editor3dRemoveNamedMesh(e,t){this._removeMeshFromComponent(e,t)}Editor3dBeginConstruction(e,t){if(!t){const t=this._components.get(e);t&&t.removeAllMeshes()}this._subPartGuard&&e===this._subPartGuard.info&&(this._subPartObject=new THREE.Object3D)}Editor3dComponentCreated(e,t,n,s,o){o&&(this._configuratorContext.rootComponentId=e);let r=null;this._components.has(e)?(r=this._components.get(e),r.removeAllMeshes()):(r=this._componentFactory.create(e,t,n,s),r.layers.set(3)),this._components.set(e,r),o&&this._addRootComponent(r)}Editor3dComponentDocked(e,t,n,s){this.dockComponent(e,t,n,s)}Editor3dEndConstruction(e){if(this._subPartGuard&&this._subPartGuard.info===e)return void this._subPartGuard.resolve(this._subPartObject);const t=this._getKernelAccess().kernelInstance.getComponent(e),n=this._components.get(e);n&&(n.computeBoundingBox(t.boxForMeasurement),n.boundingBoxMesh&&this._listener&&this._listener.addComponentHandlers(n));let s=this._previews.get(e.toString());s&&s.computeBoundingBox(t.boxForMeasurement,!0)}Editor3dGeometryReady(e){const t=this._components.get(e);t&&t.loadingFinished()}Editor3dGeometryNotReady(e){const t=this._components.get(e);t&&t.loading()}Editor3dPlanObjectConstructionDone(e){const t=this._getKernelAccess().kernelInstance.getPlanObject(e),n=[t,this._getKernelAccess().kernelInstance.getFullPartList(),this._getKernelAccess().kernelInstance.getHashOfConfiguration(e),this._getKernelAccess().kernelInstance.getComponentId(t.rootPlanComponentId)];_e.finishOperation(2,n),this._updatePlanObject(t),this._listener&&this._listener.planObjectConstructionDone(t)}Editor3dPreviewConstructionDone(e,t){let n=!1;this._previews.forEach(e=>{null!==e.parent&&(this._listener&&(this._componentFactory.isPreviewLine(e)?this._listener.addPreviewLineHandlers(e):this._listener.addPreviewHandlers(e)),n=!0)}),this._listener&&this._listener.previewConstructionDone(this._components.get(e),n)}Editor3dSetPreviewLineAssociations(e,t){let n=this._previews.get(t.toString());if(n.clear(),!n)return;let s=this._componentFactory.createPreviewLine(n),o=this._components.get(this._configuratorContext.rootComponentId);for(let t=0;t<e.length;t++){let n;n=0===t?s:s.clonePreviewLine(t),n.name="Preview Line",n.parentDockId=e[t].parentDockId,n.parentId=e[t].parentId,n.childDockId=e[t].childDockId,n.childId=e[t].childId,n.docklineRotation=(r=e[t].rotation,new THREE.Euler(r.x,r.z,-r.y)),n.roomlePosition=e[t].position,e[t].lineFrom.x>e[t].lineTo.x||e[t].lineFrom.y>e[t].lineTo.y||e[t].lineFrom.z>e[t].lineTo.z?(n.roomleLineFrom=e[t].lineTo,n.roomleLineTo=e[t].lineFrom):(n.roomleLineFrom=e[t].lineFrom,n.roomleLineTo=e[t].lineTo),e[t].positionFrom.x>e[t].positionTo.x||e[t].positionFrom.y>e[t].positionTo.y||e[t].positionFrom.z>e[t].positionTo.z?(n.roomlePositionFrom=e[t].positionTo,n.roomlePositionTo=e[t].positionFrom):(n.roomlePositionFrom=e[t].positionFrom,n.roomlePositionTo=e[t].positionTo),o.add(n),n.preparePreview(),this._previews.set(n.stringId,n)}var r}Editor3dSetPreviewPointAssociations(e,t){let n=this._previews.get(t.toString());if(!n)return;let s=this._components.get(this._configuratorContext.rootComponentId);for(let t=0;t<e.length;t++){let o;0===t?o=n:(o=n.clonePreview(t),this._previews.set(o.stringId,o)),o.name="Preview Point",o.parentDockId=e[t].parentDockId,o.parentId=e[t].parentId,o.childDockId=e[t].childDockId,o.childId=e[t].childId,o.preparePreview(),o.receivedPointAssociation=!0,o.userData.ignoreComponentRaycast=!0,s.add(o),o.roomlePosition=e[t].position,o.roomleRotation=e[t].rotation}}componentDeleted(e){const t=this._components.get(e);t&&(this._listener&&this._listener.componentDeleted(t),t.removeFromParent(),t.removeAllMeshes(),this._components.delete(e))}componentMetaUpdated(e){const t=this._getRuntimeComponent(e.id);t&&(t.hash=e.hash,t.roomlePosition=e.position,t.roomleRotation=e.rotation,e.boxForMeasurement&&t.computeBoundingBox(e.boxForMeasurement),this._listener&&this._listener.componentUpdated(t,e))}componentConfigurationUpdated(e,t){const n=this._getRuntimeComponent(e);n&&(n.geometryChanged=t)}_getRuntimeComponent(e){let t=this._components.get(e);return t||(t=this._previews.get(e.toString()),t)?t:null}configurationLoaded(e,t,n,s,o){e===xe&&(this._configuratorContext.dockingRootComponentId=n);let r=0===t;r?this._getKernelAccess().kernelInstance.requestPlanComponentConstructionRecursive(n):this._getKernelAccess().kernelInstance.requestPlanObjectConstruction(t);let i=this._getKernelAccess().kernelInstance.getComponent(n),a=this._components.get(n);a&&(a.computeBoundingBox(i.boxForMeasurement),a.hash=i.hash),this._listener&&this._listener.configurationLoaded(a,r&&void 0!==a.boundingBoxMesh)}finishParameterChange(e,t){this.materialQueue.registerCallback(e)}planObjectConfigurationUpdated(e,t,n){let s=this._getKernelAccess().kernelInstance.getPlanObject(e);this._updatePlanObject(s)}planObjectCreated(e,t){this._configuratorContext.planObjectId=t,this._listener&&this._listener.clearScene()}planObjectUpdated(e){this._updatePlanObject(e)}sceneCleared(){this._components.forEach((function(e){e.removeFromParent(),e.removeAllMeshes()})),this._components.clear(),this._previews.forEach(e=>{e.removeFromParent(),e.removeAllMeshes()}),this._previews.clear()}setListener(e){this._listener=e}getBoundingBox(){if(this._configuratorContext.planObjectId){const e=this._getKernelAccess().kernelInstance.getPlanObject(this._configuratorContext.planObjectId);if(e&&e.boxForMeasurement)return C(e.boxForMeasurement)}else if(this._configuratorContext.rootComponentId){const e=this._components.get(this._configuratorContext.rootComponentId);return(new THREE.Box3).setFromObject(e)}return null}getBoundingBoxWithPreviews(){const e=this._components.get(this._configuratorContext.rootComponentId);return e?(new THREE.Box3).setFromObject(e):null}hasPreviews(){return this._previews.size>0}clearRootComponent(){var e;null===(e=this._components.get(this._configuratorContext.rootComponentId))||void 0===e||e.hoverOff()}debugSceneGraph(e){e?this._components.has(e)?this._components.get(e):this._previews.has(e.toString())&&this._previews.get(e.toString()):this._configuratorContext}getComponentsForIds(e){let t=[];return e.forEach(e=>{const n=this._components.get(e);n&&t.push(n)}),t}getComponents(){return Array.from(this._components.values())}getPreviews(){return Array.from(this._previews.values())}isPreviewLine(e){return this._componentFactory.isPreviewLine(e)}isPreview(e){return this._componentFactory.isPreview(e)}setGeometriesMergedListener(e){this._geometriesMerged=e}removeGeometriesMergedListener(){this._geometriesMerged=void 0}setMergeThreshold(e){this._mergeThreshold=e}_generateMesh(e=0,t=null,n,s,o,r,i,a,l){return this._configuratorMeshGenerator.generateMesh(e,t,n,s,o,r,i)}_setMaterial(e,t,n){this._configuratorMeshGenerator.setMaterial(e,t)}constructComponents(e){this._getKernelAccess().kernelInstance.requestPlanObjectConstruction(e)}requestSubPartConstruction(e){return this._subPartGuard=new Y(e),this._getKernelAccess().requestPlanComponentConstruction(e),this._subPartGuard.wait()}getMeshGenerator(){return this._configuratorMeshGenerator}}return _([F],e.prototype,"_configuratorMeshGenerator",void 0),_([F],e.prototype,"_configuratorContext",void 0),_([F],e.prototype,"_cacheHolder",void 0),_([F],e.prototype,"_initData",void 0),e})());class Se extends Map{largestValue(){let e=this.entries().next().value[0],t=0;return this.forEach((n,s)=>{n>t&&(e=s,t=n)}),e}}class Le{constructor(e){this.autoQuality=!0,this.colors=a,this.unit=null,this.unitStringType=null,this.meshSelection=!0,this.stats=!1,this._measureTraffic=!1,this.gammaOutput=!0,this.disableDebugGUI=!1,this.disableEnvMap=!1,this.dls=null,this.ls=null,this.cameraSpacing=0,this.transparentHighlighting=!0,this.mode="3D",this.edit=!1,this.moc=!1,this._creator_=e}setOverrides(e){l(this,e)}}e("ah",Le);const Ae=["language","browserLanguage","userLanguage","systemLanguage"];class De{constructor(e){this.locale=((e=null)=>{const t=window.navigator;if(e)return e.substr(0,2);if(Array.isArray(t.languages)&&t.languages.length>0)return t.languages[0].substr(0,2);for(let e=0,n=Ae.length;e<n;e++){const n=t[Ae[e]];if(n)return n.substr(0,2)}return"en"})()||"en",this.overrideCountry=null,this._creator_=e}setOverrides(e){l(this,e)}}e("ag",De);class He{constructor(e){return this._isMute=!1,this._creator_=e,h(this,"_isMute",{enumerable:!1,writable:!1}),h(He.prototype,"_setMute",{enumerable:!1,writable:!1}),h(He.prototype,"mute",{enumerable:!1,writable:!1}),h(He.prototype,"unmute",{enumerable:!1,writable:!1}),new Proxy(this,this)}_setMute(e){c(this,"_isMute",!0),this._isMute=e,c(this,"_isMute",!1)}mute(){this._setMute(!0)}unmute(){this._setMute(!1)}get(e,t){return this._isMute&&"function"==typeof this[t]&&"on"===t.substr(0,2)?()=>{}:this[t]}}e("U",He);class Oe extends He{constructor(){super(...arguments),this.onNetworkRequest=(e,t,n)=>{},this.onKernelMsg=(e,t,n={})=>{},this.onCheckExternalCache=async(e,t)=>Promise.resolve(null)}}e("af",Oe),e("d",{HSC:"rml-hsc",HSP:"rml-hsp",GLB:"rml-glb",RMV:"rml-mv"});let Be=(()=>{class e{constructor(e){this._creator_=e,this._lifeCycleManager.addEventListener(this)}get element(){return this._container}setDomElement(e){if(!this._container){this._container=document.createElement("div"),this._container.classList.add("rml-threejs-canvas-container"),this._container.setAttribute("ondragover","return false"),this._container.style.position="relative",this._container.style.width="100%",this._container.style.height="100%";const t=document.createElement("style");t.innerText=".rml-threejs-canvas-container canvas{position:absolute;top:0;left:0;right:0;bottom:0;}.rml-threejs-canvas-container .foreground{z-index:100; opacity:1;}.rml-threejs-canvas-container .background{z-index:-1; opacity:0;}",this._container.appendChild(t),e.appendChild(this._container)}this._element=e}getClientDimensions(){return new THREE.Vector2(this._element.clientWidth,this._element.clientHeight)}_removeDomElement(e){if(!e)return;const t=e.parentElement;t&&t.removeChild(e)}reset(){this._element=null,this._removeDomElement(this._container),this._container=null}pause(){this.reset()}resume(){}destroy(){}}return _([F],e.prototype,"_lifeCycleManager",void 0),e})();const Fe=e("I",[new p("error-handler",class{constructor(){this._listeners={}}_subscribe(e,t){this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(t)}subscribe(e,t){this._subscribe(e,t)}dispatch(e,t){if(!this._listeners[e])return;const n=this._listeners[e];let s=n.length;for(let e=0;e<s;e++){const s=n[e];s.apply(s,t)}}unsubscribe(e,t){if(!this._listeners[e])return;const n=this._listeners[e];let s=n.length;for(let e=0;e<s;e++)if(n[e]===t)return n.splice(e,1),s--,void e--}softReject(e,t,n){return this.dispatch(n,[t]),e()}}),new p("form-data-util",m),new p("environment-loader",j),new p("static-item-loader",se,0),new p("form-data-util",m),new p("single-promise-factory",class{constructor(e){this._promises=new Map,this._creator_=e}create(e,t,n){return new Promise((s,o)=>{let r=this._promises.get(e),i=!0;if(!r){const t=new Map;this._promises.set(e,t),r=this._promises.get(e),i=!1}r.get(t)||(r.set(t,[]),i=!1);const a=r.get(t);a.push({resolve:s,reject:o}),r.set(t,a);const l=()=>{r.delete(t),0===r.size&&this._promises.delete(e)};i||new Promise(n).then(e=>{r.get(t).forEach(({resolve:t})=>t(e)),l()},e=>{r.get(t).forEach(({reject:t})=>t(e)),l()})})}},1),new p("dynamic-light-setting-loader",G),new p("dynamic-quality-setting-loader",ie),new p("network-layer",V),new p("local-storage",class{constructor(e){this._context_=e}get _localStorage(){let e=null;try{e=window.localStorage}catch(e){console.error(e)}return e}getItem(e){if(!this._localStorage)return null;const t=this._localStorage.getItem(e);try{return JSON.parse(t)}catch(e){return t}}setItem(e,t){if(this._localStorage)try{const n=JSON.stringify(t);this._localStorage.setItem(e,n)}catch(e){console.error(e)}}}),new p("network-layer",V),new p("kernel-io",q,0),new p("data-syncer",X),new p("memory-manager",class{constructor(){this._configurationStringSet=new Set,this._singleLoadCounter=0}loadingConfigurationString(){this._singleLoadCounter+=1}loadingConfiguration(e){this._configurationStringSet.add(e),this._singleLoadCounter+=1}shouldHardReset(){return this._configurationStringSet.size>=15||this._singleLoadCounter>=30}executedHardReset(){this._configurationStringSet.clear(),this._singleLoadCounter=0}}),new p("life-cycle-manager",class{constructor(){this._listeners=[]}addEventListener(e){this._listeners.push(e)}removeEventListener(e){const t=this._listeners;let n=t.length;if(n)for(let s=0;s<n;s++)t[s]===e&&(t.splice(s,1),s--,n--)}pause(){this._listeners.forEach(e=>e.pause())}resume(){this._listeners.forEach(e=>e.resume())}destroy(){this._listeners.forEach(e=>e.destroy())}},1),new p("three-loader",oe),new p("local-storage-helper",re),new p("cache-holder",class{constructor(){this._componentCache=new Map,this._geometryCache=new Map,this._materialCache=new Map}get componentCache(){return this._componentCache}get geometryCache(){return this._geometryCache}get materialCache(){return this._materialCache}clear(){for(const e of this._componentCache.values())L(e);for(const e of this._materialCache.values())H(e);for(const e of this._geometryCache.values())D(e);this._componentCache.clear(),this._geometryCache.clear(),this._materialCache.clear()}},0),new p("kernel-access-callback",class{constructor(e){this._callbackListener=new Set,this._creator_=e}addListener(e){this._callbackListener.add(e)}removeListener(e){this._callbackListener.delete(e)}isReady(){this._callbackListener.forEach(e=>e.isReady())}loadError(e){this._callbackListener.forEach(t=>t.loadError(e))}},1),new p("configurator-kernel-access-callback",class{constructor(e){this._callbackListener=new Set,this._creator_=e}addListener(e){this._callbackListener.add(e)}removeListener(e){this._callbackListener.delete(e)}isReady(){this._callbackListener.forEach(e=>e.isReady())}updatePossibleChildren(e,t,n){this._callbackListener.forEach(s=>s.updatePossibleChildren(e,t,n))}updateParameters(e,t,n,s){this._callbackListener.forEach(o=>o.updateParameters(e,t,n,s))}loadError(e){this._callbackListener.forEach(t=>t.loadError(e))}},1),new p("configurator-view-model",ke,1),new p("configurator-context",class{constructor(){this.rootComponentParametersAsGlobal=!1,this.lastLoadedRapiId=null,this.selectedRuntimeComponentIds=[],this.selectionMode="standard"}get selectedRuntimeComponentId(){return this.selectedRuntimeComponentIds.length>0?this.selectedRuntimeComponentIds[0]:null}},1),new p("init-data",Le,1),new p("global-init-data",De,0),new p("global-callback",Oe,0),new p("dom-helper",Be,1)]);class je{static _ensureContainer(){window.__RML__DI__||(window.__RML__DI__=new u,window.__RML__DI__.addDependencyInjectionAssignments(Fe))}static setup(e){je.addToContainer(e)}static lookup(e,t){return window.__RML__DI__?window.__RML__DI__.lookup(e,t):null}static getContext(e){return je._ensureContainer(),window.__RML__DI__.getContext(e)}static cleanUp(e){return window.__RML__DI__?window.__RML__DI__.cleanUp(e):null}static addToContainer(e){je._ensureContainer(),window.__RML__DI__.addDependencyInjectionAssignments(e)}}e("s",je);let Ue=e("A",(()=>{class e{static init(t={}){const{kernelInstance:n,kernelContainer:s,planObjectId:o}=t;e.kernelInstance=n,e.kernelContainer=s,e.planObjectId=o}static cleanUp(){e.useHDGeometry=!1,e.kernelInstance=null,e.kernelContainer=null,e.planObjectId=null}}return e.useHDGeometry=!1,e.kernelInstance=null,e.kernelContainer=null,e.planObjectId=null,e})());const{APP:Ge}=be,{RAPI:ze}=Ge,We=ze.headers,Ne=ze.itemHeaders,Ve=We.token,Ke=e("M","crt"),qe=d();let Je=new Map,Qe=new Map,Ze=new Map,$e=new Map,Xe=new Map,Ye=new Map,et=new Map,tt=new Map,nt=new Map;const st=e=>Je.get(e)||Je.get(qe+e),ot=e=>e&&e.tags&&e.tags.length,rt=e=>!ot(e)&&e.group;e("o",(()=>{class e{constructor(e){this._itemLoaded=!1,this._currentToken=null,this._creator_=e,window.addEventListener("online",this._flushOfflineQueue.bind(this))}getPreloadForItem(e){return this._getPreload(e,!0)}getPreloadForConfiguration(e){return this._getPreload(e,!1)}_getPreload(e,t){return new Promise((n,s)=>{if(!navigator.onLine)return n();if(this._dataSyncer.getIsCatalogSynced(W(e)))return n();if(et.get(e))return n();const o=t?"?itemId=":"?configurationId=";this._get("/preloads/components/"+o+e,"preloads/components").then(t=>{if(et.get(e))return n();t.forEach(e=>{this._prepareData(e,"components")}),et.set(e,!0),n()},s)})}changeUseOfHDGeometry(){const e=$e.get("components");et.clear(),Ye.clear(),e&&$e.delete("components")}getHSCPackage(e){return new Promise((t,n)=>{if(Ye.get(e))return t();this._get("/catalogs/"+e+"/package","package").then(n=>{if(Ye.get(e))return t(n);n.components.forEach(e=>{this._prepareData(e,"components")}),n.materials.forEach(e=>{this._prepareData(e,"materials"),this._prepareGroups(e)}),n.textures.forEach(e=>{this._prepareData(e,"textures")}),Ye.set(e,!0),t(n)},n)})}getComponent(e){return this._getById(e,"components")}getConfiguration(e){return this._getById(e,"configurations")}getConfigurations(e){return this._getByIds(e,"configurations")}getItem(e){return this._getById(e,"items",{additionalHeaders:Ne})}getComponents(e){return this._getByIds(e,"components")}getItems(e){return this._getByIds(e,"items",{additionalHeaders:Ne})}getTag(e){return this._getById(e,"tags")}getTags(e){return this._getByIds(e,"tags")}getTexture(e){return this._getById(e,"textures")}getCatalog(e){return this._getById(e,"catalogs")}getMesh(e,t=Ke,n=50){return this._getById(e,"meshes",{pathSuffix:"/data?format="+t+"&targetQuality="+n.toString()})}getMeshesOfCatalog(e){return new Promise((t,n)=>{const s=Xe.get(e);s?t(s):this._get("/meshes?catalog="+e,"catalogMeshes").then(n=>{Xe.set(e,n),t(n)},n)})}getTexturesOf(e){return this._getRelationData(e,{rapiPath:"textures"})}getItemsOf(e){return this._getRelationData(e,{rapiPath:"items"})}async getMaterialsOf(e){return(await this._getRelationData(e,{rapiPath:"materials"},{embed:["textures"]})).filter(e=>e.active)}getComponentsOf(e){return this._getRelationData(e,{rapiPath:"components"})}getAdditionalContentsOfItems(e){const t=[],n=[];return e.forEach(e=>{const s=Qe.get(e.id.toString());s?n.push(...s):t.push(e.id.toString())}),new Promise((e,s)=>{0!==t.length?this._getByIdsPackets(t,"itemAdditionalContents",{filterKey:"itemIds"}).then(t=>{t.forEach(e=>{let t=Qe.get(e.itemId);t||(t=[]);for(let n=0,s=t.length;n<s;n++)if(t[n].id===e.id)return;t.push(e),Qe.set(e.itemId,t)}),e([...t,...n])},s):e(n)})}getMaterial(e){return this._getById(e,"materials",{embed:["textures"]})}peekMaterial(e){return this._peekData(e,"materials")}peekComponent(e){return this._peekData(e,"components")}async getMaterials(e){return(await this._getByIds(e,"materials",{embed:["textures"]})).filter(e=>e.active)}getPlan(e){return this._getById(e,"plans")}static clearCaches(){Je=new Map,Ze=new Map,$e=new Map,Ye=new Map,et=new Map,tt=new Map,Qe=new Map}cleanUp(){e.clearCaches()}getMaterialsByGroup(e){const t=e.slice(),n=[];let s=t.length;for(let e=0;e<s;e++){const o=st(t[e]);if(o){const r=o.length;for(let e=0;e<r;e++){const t=this._getCache("materials").get(o[e]);n.push(t)}t.splice(e,1),s--,e--}}return new Promise((e,s)=>{0!==t.length&&navigator.onLine?this._getByIdsPackets(t,"materials",{filterKey:"groups",embed:["textures"]}).then(t=>{e(this.combineMaterialsToGroups([...t,...n]))},s):e(this.combineMaterialsToGroups(n))})}_flushOfflineQueue(){return new Promise((e,t)=>{const n=this._localStorage.getItem("hsc_configurations_offline_queue_v1"),s=[];for(let e in n)if(n.hasOwnProperty(e)){const t=n[e];s.push(new Promise((e,n)=>{this.saveConfiguration(t.data).then(s=>{const o=[];t.perspectiveImage&&!s.perspectiveImage&&o.push(this.savePerspectiveImage(s,t.perspectiveImage)),t.topImage&&!s.topImage&&o.push(this.savePerspectiveImage(s,t.topImage)),Promise.all(o).then(e,n)},n)}))}Promise.all(s).then(()=>{this._localStorage.setItem("hsc_configurations_offline_queue_v1",{}),e()},t)})}_setQueuedConfiguration(e,t={}){const n=e.configurationHash,{perspectiveImage:s,topImage:o}=t;let r=this._localStorage.getItem("hsc_configurations_offline_queue_v1")||{},i=r[n]||{};i.data=e,i.perspectiveImage=s,i.topImage=o,r[n]=i,this._localStorage.setItem("hsc_configurations_offline_queue_v1",r)}async saveConfiguration(e){return navigator.onLine?await this._save("/configurations",{configuration:e},"configurations",{accept:"application/json",contentType:"application/json; charset=UTF-8"}):(e.perspectiveImage=null,e.topImage=null,this._setQueuedConfiguration(e),this._markConfigurationAsLocally(e),Promise.resolve(e))}saveTopImage(e,t){return this._saveConfigurationImage(e,t,"topImage")}savePerspectiveImage(e,t){return this._saveConfigurationImage(e,t,"perspectiveImage")}getShortUrl(e,t){return new Promise((n,s)=>this._fetchJson("/shortIds","shortIds",{method:"POST",resolve:n,reject:s,data:JSON.stringify({shortId:{type:t,referencedId:e}}),accept:"application/json",contentType:"application/json; charset=UTF-8"}))}_peekData(e,t){const n=$e.get(t);return n&&n.get(e)||null}_saveConfigurationImage(e,t,n){if(!navigator.onLine){const s={};return s[n]=t,this._setQueuedConfiguration(e,s),this._markConfigurationAsLocally(e),e[n]=t.image,Promise.resolve(e)}const s=this._formDataUtil.create(t.image,e.configurationHash,g.PNG,n);return this._save("/configurations/"+e.id+"/"+n,s,"configurations",{accept:"application/json"})}_markConfigurationAsLocally(e){e.isLocally=!0,e.id=e.configurationHash}_save(e,t,n,s={}){const o=t instanceof FormData?t:JSON.stringify(t);return new Promise((t,r)=>{const i={method:s.method||"POST",data:o,resolve:t,reject:r};s.contentType&&(i.contentType=s.contentType),s.accept&&(i.accept=s.accept),this._fetchJson(e,n,i)})}combineMaterialsToGroups(e){return new Promise((t,n)=>{const s=new Map,o={id:null,label:null,materials:[]},r=[];for(let t=0,n=e.length;t<n;t++){const n=e[t],i=n.tags&&n.tags.length?n.tags.map(e=>({isTag:!0,id:e})):[];n.group&&i.push({isTag:!1,id:qe+n.group,legacyId:n.group}),i.length||i.push({isTag:!1,id:null}),n.tags&&n.tags.length&&n.tags.forEach(e=>-1===r.indexOf(e)?r.push(e):null),i.forEach(({isTag:e,id:t,legacyId:r})=>{const i=n.id;let a=t?st(t):[];a||(Je.set(t,[]),a=st(t)),-1===a.indexOf(i.toString())&&a.push(i.toString());const l=ot(n),h=l&&e,c=rt(n);if(h||c&&!e||!l&&!c&&!t){let e=t?s.get(t):o;e||(s.set(t,{id:t,label:n.groupLabel,legacyId:r,materials:[]}),e=s.get(t)),e.materials.push(n)}})}const i=o.materials.length?[o]:[];this.getTags(r).then(e=>{const n=e.reduce((e,t)=>(e[t.id]=t,e),{});return s.forEach((e,t)=>{i.push({id:t,label:n[t]?n[t].label:e.label,materials:e.materials,legacyId:e.legacyId,sort:n[t]?n[t].sort:void 0})}),t(i)},n)})}_getByIds(e,t,n={}){const s=this._getCache(t),o=this._getErrorCache(t),r=[],i=[...new Set(e)];let a=i.length;if(s&&s.size){const e=(new Date).getTime();for(let t=0;t<a;t++){const n=i[t],l=s.get(n),h=o.get(n);let c=!1;null!=l?(r.push(l),c=!0):c=void 0!==h&&(e-h.timestamp<6e4||!1===navigator.onLine),c&&(i.splice(t,1),a--,t--)}}return new Promise((e,s)=>{0!==i.length&&navigator.onLine?this._getByIdsPackets(i,t,n).then(t=>{e([...t,...r])},s):e(r)})}_getByIdsPackets(e,t,n={}){const s=n.filterKey||"ids";let o,r="/"+t+"/",i="?",a=[];const l=e.length;if(!l)return new Promise(e=>e([]));let h=!0,c=[];for(o=0;o<l;o++){h=!1;const n=e[o],l=i+s+"[]="+n,d=l.length+r.length;c.push(n),i="&",d<=1500?r+=l:(d>1500&&(c.pop(),o--),a.push({url:r,ids:c}),h=!0,r="/"+t+"/",i="?",c=[])}h||a.push({url:r,ids:c});const d=[];return a.forEach(e=>d.push(this._getByIdsSingle(e.ids,e.url,t,n))),new Promise((e,t)=>{Promise.all(d).then(t=>{const n=[];t.length&&t.forEach(e=>n.push(...e)),e(n)},t)})}_getByIdsSingle(e,t,n,s={}){return new Promise((o,r)=>{this._get(t,n,s).then(t=>{for(let n=0,o=t.length;n<o;n++){const o=s&&s.cacheKey?t[n][s.cacheKey]:t[n].id,r=e.indexOf(o.toString());-1!==r&&e.splice(r,1)}const r=e.length;if(r){const t=this._getCache(n),s=this._getErrorCache(n),o=(new Date).getTime();for(let n=0;n<r;n++)s.set(e[n],{code:0,timestamp:o}),t.delete(e[n]);this._errorHandler.dispatch(2,[n,e.map(e=>'"'+e+'"').join(",")])}o(t)},r)})}_getById(e,t,n={}){if(!e||""===e||"string"!=typeof e)return console.error("no id passed to _getById"),Promise.reject(new Error("no id passed to _getById"));const s=this._getCache(t).get(e);if(s)return new Promise(e=>e(s));if(!navigator.onLine)return Promise.reject("Nothing cached but tried to fetch in offline mode");const o={...n,id:e},r=n.pathSuffix||"";return this._get("/"+t+"/"+e+r,t,o)}_get(e,t,n={}){const s=Ue.useHDGeometry?"includeGeometryHD=true":"";let o=-1===e.indexOf("?")?"?":"&";return""!==s&&(e+=o+s),n.embed&&Array.isArray(n.embed)&&n.embed.forEach(t=>{e+=o+"embed"+(t[0].toUpperCase()+t.substr(1))+"=true",o="&"}),new Promise((s,o)=>{const r=tt.get(e);Array.isArray(r)&&r.length>0?r.push({resolve:s,reject:o}):(tt.set(e,[{resolve:s,reject:o}]),this._fetchJson(e,t,n))})}_fetchJson(e,t,n={}){this._fetch(e,n).then(o.bind(this)).then(this._handleJson(e,t,n).bind(this)).catch(this._handleError(e,n).bind(this))}async _fetch(e,t){const n={method:t.method?t.method:"GET",headers:this._createHeaders(t),mode:"cors",cache:"default"};t.data&&(n.body=t.data);let s=ze.server;const o=this._globalInitData.overrideRapi;o&&(s="live"===o?ze.liveServer:ze.testServer),(this._globalInitData.customApiUrl||""===this._globalInitData.customApiUrl)&&(s=this._globalInitData.customApiUrl);const r=new Request(s+e,n);this._globalCallback.onNetworkRequest(e,n,t);const i=await this._globalCallback.onCheckExternalCache(e,n);return i?{headers:{get:()=>"application/json"},json:()=>Promise.resolve(i)}:this._networkLayer.fetch(r)}_createHeaders(e={}){const t={...We};this._globalInitData.overrideTenant&&(t.currentTenant=this._globalInitData.overrideTenant),this._globalInitData.overrideCountry&&(t.country=this._globalInitData.overrideCountry);const n=this._globalInitData.locale||"en";t.language=n,t.locale=n;const{contentType:s,accept:o,additionalHeaders:r,data:i}=e;if(s&&(t["content-type"]=e.contentType),o&&(t.accept=e.accept),r)for(let e in r)r.hasOwnProperty(e)&&(t[e]=r[e]);this._globalInitData.configuratorId&&(t.configurator=this._globalInitData.configuratorId);const a=this._currentToken||Ve;t.token="03-"+window.btoa((new Date).toISOString()+";"+a+";"+We.apiKey);const l=new Headers(t);return i instanceof FormData&&l.delete("content-type"),l}_handleJson(e,t,n={}){return s=>{let o=null,r=null;"number"==typeof s&&(o=s);for(let e in s)"meta"!==e&&s.hasOwnProperty(e)&&(o=s[e],r=e);if("error"===r)return this._handleError(e,n)(new Error(JSON.stringify(o)));if(!o)throw new TypeError("RAPI returned empty JSON");if(Array.isArray(o))for(let e=0,s=o.length;e<s;e++)this._prepareData(o[e],t,n),this._prepareEmbeddedData(o[e],t,n);else this._prepareData(o,t,n),this._prepareEmbeddedData(o,t,n);n.resolve?n.resolve(o):this._notifyWaiters(e,null,o)}}_prepareEmbeddedData(e,t,n={}){n.embed&&Array.isArray(n.embed)&&n.embed.forEach(s=>{const o=e[s.slice(0,-1)+"Objects"];if(Array.isArray(o)){for(let e=0,t=o.length;e<t;e++)this._prepareData(o[e],s,n);this._prepareRelationalData(t,s,e.id,o)}else o&&(this._prepareData(o,s,n),this._prepareRelationalData(t,s,e.id,[o]))})}_getCache(e){return this._getCacheFrom(e,$e)}_getErrorCache(e){return this._getCacheFrom(e,nt)}_getCacheFrom(e,t){let n=t.get(e);return n||(t.set(e,new Map),n=t.get(e)),n}_setCache(e,t,n){n.set(e.toString(),t)}_prepareData(e,t,n=null){let s=this._getCache(t);const o=n&&n.cacheKey?e[n.cacheKey]:e.id;if(o||n&&n.id||"tenants/me"===t)if("tenants/me"!==t){{const t=o||n.id;this._setCache(t,e,s)}e.__rapi_path__=t}else this._setCache("0",e,s);else"shortIds"!==t&&console.error("Can not cache because there is no ID!")}_getRelationsCacheFor(e,t,n){let s=Ze.get(t);if(!s){const o=new Map,r=new Map;r.set(n,void 0),o.set(e,r),Ze.set(t,o),s=Ze.get(t)}let o=s.get(e);if(!o){const t=new Map;t.set(n,void 0),s.set(e,t),o=s.get(e)}return o.get(n)}_prepareGroups(e){const t=e.group,n=e.id;let s=st(t);s||(Je.set(t,[]),s=st(t)),-1===s.indexOf(n.toString())&&s.push(n.toString())}_handleError(e,t={}){return n=>{navigator.onLine?(n.rmlErrorCode=1,n.message='Failed to load "'+e+'" because of "'+n.message+'"',this._errorHandler.dispatch(1,[n])):(n.rmlErrorCode=0,n.message='Failed to load "'+e+'" because of "'+n.message+'"',this._errorHandler.dispatch(0,[n])),t.reject?t.reject(n):this._notifyWaiters(e,n,null)}}_getRelationData(e,t,n={}){const s=e.id;if(!s)return Promise.resolve([]);const o=e.__rapi_path__,r=t.rapiPath;let i=this._getCache(r),a=this._getRelationsCacheFor(s.toString(),o,r),l=[];return a?(a.forEach(e=>l.push(i.get(e))),new Promise(e=>e(l))):navigator.onLine?new Promise((e,t)=>{this._get("/"+o+"/"+s+"/"+r,r,n).then(t=>{this._prepareRelationalData(o,r,s,t),e(t)},t)}):Promise.resolve([])}_prepareRelationalData(e,t,n,s){Ze.has(e)||Ze.set(e,new Map);let o=Ze.get(e);const r=n.toString();o.has(r)||o.set(r,new Map);let i=o.get(r),a=this._getCache(t),l=[];for(let e=0,t=s.length;e<t;e++){const t=s[e],n=t.id.toString();l.push(n),a.set(n,t)}i.set(t,l)}_notifyWaiters(e,t,n){const s=tt.get(e);if(s&&s.length){for(let e=0,o=s.length;e<o;e++)t?s[e].reject(t):s[e].resolve(n);tt.delete(e)}}_tenantMe(){return new Promise((e,t)=>{const n=this._getCache("tenants/me"),s=this._globalInitData.overrideTenant?this._globalInitData.overrideTenant:n.get("0");if(s)return e(s);this._fetchJson("/tenants/me","tenants/me",{resolve:t=>e(t),reject:t})})}async getTenant(e){return e||(e=await this._tenantMe()),this._getById(e.toString(),"tenants")}getCurrentSkin(){return this._tenantMe().then(e=>this._getById(e.toString(),"tenants").then(e=>this._getById(e.skin.toString(),"skins")))}getPrices(e){return this._getByIds(e,"prices",{filterKey:"priceIds",cacheKey:"priceId"})}async getConfiguratorSettings(e){const t=await this._getById(e,"configurators");return t.allowedHosts||(t.allowedHosts=[]),t.allowedHosts&&!Array.isArray(t.allowedHosts)&&(t.allowedHosts=t.allowedHosts.split(" ")),t}sendUserAction(e){return this._save("/userActions",{userAction:e},"userActions",{accept:"application/json",contentType:"application/json; charset=UTF-8"})}shareConfiguration(e,t,n){const s="/configurations/"+e+"/shares",o=new FormData;return o.append("email",t),o.append("type",n.toString()),new Promise((e,t)=>{const n={method:"POST",data:o,resolve:e,reject:t,accept:"application/json",contentType:"application/json; charset=UTF-8"};this._fetch(s,n).then(n.resolve,n.reject)})}export3D(e,t,n,s={}){const o="/configurations/"+e+"/3d-exports",r={formats:[{file_format:n,pack_external_data:!0,...s}]},i=JSON.stringify(r),a=new FormData;return a.append("email",t),a.append("settings",i),new Promise((e,t)=>{const n={method:"POST",data:a,resolve:e,reject:t};this._fetch(o,n).then(n.resolve,n.reject)})}async trackView(e){if(this._itemLoaded||(t=(()=>{var e;const t=(()=>{if(window.__RML__ENV__&&window.__RML__ENV__.skipIframeCheck)return!1;try{return window.self!==window.top}catch(e){return!0}})();let n=null===(e=null===window||void 0===window?void 0:window.location)||void 0===e?void 0:e.href;if(!n)return null;if(t){if(!document.referrer)return null;n=document.referrer}const{hostname:s}=new URL(n);return s})())&&(z.includes(t)||t.endsWith("gitlab.io")||t.endsWith("gitlab.com")||t.endsWith("codesandbox.io")||t.endsWith("stackblitz.com")||/^(admin.*.roomle.com)$/.test(t)))return;var t;const{configuratorId:n}=this._globalInitData,s={module:3,action:1,actionId:e,actionLabel:n};await this.sendUserAction(s),this._itemLoaded=!0}signinUser(e,t){return new Promise((n,s)=>{const o={method:"POST",accept:"application/json",contentType:"application/json; charset=UTF-8",data:JSON.stringify({identification:e,passwordMD5:t}),cacheKey:"token",resolve:n,reject:s};this._fetchJson("/auth/signin","auth",o)})}async signoutUser(e){const t=this._currentToken;t!==e&&this.setCurrentToken(e),await this._fetch("/auth/signout",{}),t&&t!==e?this.setCurrentToken(t):this.removeCurrentToken()}async savePlan(e){const t=e.id?"/plans/"+e.id:"/plans";return this._save(t,{plan:e},"plans",{method:e.id?"PUT":"POST",accept:"application/json",contentType:"application/json; charset=UTF-8"})}setCurrentToken(e){this._currentToken=e}removeCurrentToken(){this._currentToken=null}createNewPlan(){return{name:"",description:"",changeDate:(new Date).toISOString(),created:(new Date).toISOString(),draftId:null,thumbnail:"data:image/png;base64,missing",planObjects:null,active:!0,open:0,planDirectory:0,changed:0,version:2,floorLevel:0,visibility:9,user:null,tenant:null,assets:[],parent:null,setting:null}}}return _([F],e.prototype,"_formDataUtil",void 0),_([F],e.prototype,"_errorHandler",void 0),_([F],e.prototype,"_dataSyncer",void 0),_([F],e.prototype,"_networkLayer",void 0),_([F],e.prototype,"_localStorage",void 0),_([F],e.prototype,"_globalInitData",void 0),_([F],e.prototype,"_globalCallback",void 0),e})())}}}));
|
|
16
|
-
//# sourceMappingURL=rapi-access-0564780f.legacy.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"scene-manager-566f79ad.legacy.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
Binary file
|