@roomle/web-sdk 2.28.0 → 2.29.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-dd4c5739.js → banana-for-scale-656cea8a.js} +2 -2
- package/lib/{banana-for-scale-dd4c5739.js.map → banana-for-scale-656cea8a.js.map} +1 -1
- package/lib/{banana-for-scale-2239eff7.nomodule.js → banana-for-scale-89f70127.nomodule.js} +2 -2
- package/lib/{banana-for-scale-2239eff7.nomodule.js.map → banana-for-scale-89f70127.nomodule.js.map} +1 -1
- package/lib/{budgeteer-measure-05dc445d.js → budgeteer-measure-8cfea554.js} +2 -2
- package/lib/{budgeteer-measure-05dc445d.js.map → budgeteer-measure-8cfea554.js.map} +1 -1
- package/lib/budgeteer-measure.nomodule.js +1 -1
- package/lib/{component-dimensioning-07857a7e.js → component-dimensioning-1b5f64dd.js} +2 -2
- package/lib/component-dimensioning-1b5f64dd.js.map +1 -0
- package/lib/{component-dimensioning-e121b044.nomodule.js → component-dimensioning-7bdd1b3b.nomodule.js} +2 -2
- package/lib/component-dimensioning-7bdd1b3b.nomodule.js.map +1 -0
- package/lib/configurator-6e7f5ef0.js +2 -0
- package/lib/{configurator-366b9a69.js.map → configurator-6e7f5ef0.js.map} +1 -1
- package/lib/configurator-eddf59f1.nomodule.js +2 -0
- package/lib/{configurator-b498456a.nomodule.js.map → configurator-eddf59f1.nomodule.js.map} +1 -1
- package/lib/configurator-main-7acfa92f.js +2 -0
- package/lib/configurator-main-7acfa92f.js.map +1 -0
- package/lib/configurator-main.nomodule.js +1 -1
- package/lib/configurator-mesh-generator-05375458.nomodule.js +2 -0
- package/lib/configurator-mesh-generator-05375458.nomodule.js.map +1 -0
- package/lib/{configurator-mesh-generator-e827c528.js → configurator-mesh-generator-f210ee04.js} +2 -2
- package/lib/configurator-mesh-generator-f210ee04.js.map +1 -0
- package/lib/{default-light-setting-7eb7961c.js → default-light-setting-7de63c9a.js} +2 -2
- package/lib/default-light-setting-7de63c9a.js.map +1 -0
- package/lib/{default-light-setting-f21a820b.nomodule.js → default-light-setting-e4720308.nomodule.js} +2 -2
- package/lib/default-light-setting-e4720308.nomodule.js.map +1 -0
- package/lib/definitions/common-core/src/services/global-callback.d.ts +1 -0
- package/lib/definitions/configurator-core/src/roomle-configurator.d.ts +7 -1
- package/lib/definitions/configurator-core/src/webgl/scene-helper.d.ts +1 -1
- package/lib/{dimensioning-helper-73700224.nomodule.js → dimensioning-helper-844fc69d.nomodule.js} +2 -2
- package/lib/dimensioning-helper-844fc69d.nomodule.js.map +1 -0
- package/lib/{dimensioning-helper-2f129aab.js → dimensioning-helper-e77fbedb.js} +2 -2
- package/lib/dimensioning-helper-e77fbedb.js.map +1 -0
- package/lib/glb-viewer-0331f919.js +2 -0
- package/lib/{glb-viewer-10243e50.js.map → glb-viewer-0331f919.js.map} +1 -1
- package/lib/glb-viewer-6e5482c7.nomodule.js +2 -0
- package/lib/{glb-viewer-d6e080e4.nomodule.js.map → glb-viewer-6e5482c7.nomodule.js.map} +1 -1
- package/lib/glb-viewer-main-17601c40.js +2 -0
- package/lib/glb-viewer-main-17601c40.js.map +1 -0
- package/lib/glb-viewer-main.nomodule.js +1 -1
- package/lib/image-renderer-880c414d.nomodule.js +2 -0
- package/lib/{image-renderer-9478b17b.nomodule.js.map → image-renderer-880c414d.nomodule.js.map} +1 -1
- package/lib/image-renderer-ad267c8b.js +2 -0
- package/lib/{image-renderer-9e47bc3a.js.map → image-renderer-ad267c8b.js.map} +1 -1
- package/lib/legacy/{banana-for-scale-1dc75d47.legacy.js → banana-for-scale-bd7d6dfd.legacy.js} +2 -2
- package/lib/legacy/{banana-for-scale-1dc75d47.legacy.js.map → banana-for-scale-bd7d6dfd.legacy.js.map} +1 -1
- package/lib/legacy/budgeteer-measure.legacy.js +1 -1
- package/lib/legacy/{component-dimensioning-d657350b.legacy.js → component-dimensioning-59fd1367.legacy.js} +2 -2
- package/lib/legacy/component-dimensioning-59fd1367.legacy.js.map +1 -0
- package/lib/legacy/configurator-82b7967e.legacy.js +2 -0
- package/lib/legacy/{configurator-3250dfc2.legacy.js.map → configurator-82b7967e.legacy.js.map} +1 -1
- package/lib/legacy/configurator-main.legacy.js +1 -1
- package/lib/legacy/{configurator-mesh-generator-d604f05c.legacy.js → configurator-mesh-generator-6266fa75.legacy.js} +2 -2
- package/lib/legacy/configurator-mesh-generator-6266fa75.legacy.js.map +1 -0
- package/lib/legacy/{default-light-setting-14b03f67.legacy.js → default-light-setting-97f711dc.legacy.js} +2 -2
- package/lib/legacy/default-light-setting-97f711dc.legacy.js.map +1 -0
- package/lib/legacy/{dimensioning-helper-bed08d96.legacy.js → dimensioning-helper-99057da2.legacy.js} +2 -2
- package/lib/legacy/dimensioning-helper-99057da2.legacy.js.map +1 -0
- package/lib/legacy/glb-viewer-be2c067a.legacy.js +2 -0
- package/lib/legacy/{glb-viewer-5dcdda0a.legacy.js.map → glb-viewer-be2c067a.legacy.js.map} +1 -1
- package/lib/legacy/glb-viewer-main.legacy.js +1 -1
- package/lib/legacy/image-renderer-6df9eca6.legacy.js +2 -0
- package/lib/legacy/{image-renderer-0f532f9c.legacy.js.map → image-renderer-6df9eca6.legacy.js.map} +1 -1
- package/lib/legacy/{main-thread-to-worker-880d5b78.legacy.js → main-thread-to-worker-4c02f179.legacy.js} +2 -2
- package/lib/legacy/main-thread-to-worker-4c02f179.legacy.js.map +1 -0
- package/lib/legacy/{material-viewer-41e5c677.legacy.js → material-viewer-e83460de.legacy.js} +2 -2
- package/lib/legacy/material-viewer-e83460de.legacy.js.map +1 -0
- package/lib/legacy/material-viewer-main.legacy.js +1 -1
- package/lib/legacy/{mesh-generator-4f2f2ec7.legacy.js → mesh-generator-084a73cd.legacy.js} +2 -2
- package/lib/legacy/mesh-generator-084a73cd.legacy.js.map +1 -0
- package/lib/legacy/{pixotron-cd4cd438.legacy.js → pixotron-6195d494.legacy.js} +2 -2
- package/lib/legacy/{pixotron-cd4cd438.legacy.js.map → pixotron-6195d494.legacy.js.map} +1 -1
- package/lib/legacy/{planner-03b11101.legacy.js → planner-5b7cc8fa.legacy.js} +2 -2
- package/lib/legacy/{planner-03b11101.legacy.js.map → planner-5b7cc8fa.legacy.js.map} +1 -1
- package/lib/legacy/planner-main.legacy.js +1 -1
- package/lib/legacy/{rapi-access-ef758fca.legacy.js → rapi-access-7d0f02e7.legacy.js} +3 -3
- package/lib/legacy/{rapi-access-ef758fca.legacy.js.map → rapi-access-7d0f02e7.legacy.js.map} +1 -1
- package/lib/legacy/roomle-sdk.legacy.js +1 -1
- package/lib/legacy/{scene-manager-afd27798.legacy.js → scene-manager-65a4c302.legacy.js} +2 -2
- package/lib/legacy/scene-manager-65a4c302.legacy.js.map +1 -0
- package/lib/legacy/static/ConfiguratorKernel-4c09558b00e81ba8.wasm +0 -0
- package/lib/legacy/static/{ConfiguratorKernel-c416f21e546a33f4.js → ConfiguratorKernel-7379813e2cd03c0d.js} +74 -74
- package/lib/legacy/static/ConfiguratorKernelJs-3789a15227520de1.js +143 -0
- package/lib/legacy/static/ConfiguratorKernelJs-dd075c23d87b4733.mem +0 -0
- package/lib/legacy/static/RoomleCore-43a1c9de57277471.wasm +0 -0
- package/lib/legacy/static/{RoomleCore-30311f70b9e1675b.js → RoomleCore-4da5951bbc66db16.js} +83 -83
- package/lib/legacy/static/RoomleCoreJs-86806817a5b958c9.js +151 -0
- package/lib/legacy/static/RoomleCoreJs-cfff2977254b7f93.mem +0 -0
- package/lib/legacy/static/shaders-df453330fdd84fa7.json +1 -0
- package/lib/legacy/{stats-helper-0acbc658.legacy.js → stats-helper-e832d5a9.legacy.js} +2 -2
- package/lib/legacy/{stats-helper-0acbc658.legacy.js.map → stats-helper-e832d5a9.legacy.js.map} +1 -1
- package/lib/{main-thread-to-worker-bb844d54.nomodule.js → main-thread-to-worker-4fc95d50.nomodule.js} +2 -2
- package/lib/main-thread-to-worker-4fc95d50.nomodule.js.map +1 -0
- package/lib/{main-thread-to-worker-91bf9f5e.js → main-thread-to-worker-5447c1c5.js} +2 -2
- package/lib/main-thread-to-worker-5447c1c5.js.map +1 -0
- package/lib/{material-viewer-1b0d838c.nomodule.js → material-viewer-8183024b.nomodule.js} +2 -2
- package/lib/material-viewer-8183024b.nomodule.js.map +1 -0
- package/lib/{material-viewer-90b397b7.js → material-viewer-9ee1ebf0.js} +2 -2
- package/lib/material-viewer-9ee1ebf0.js.map +1 -0
- package/lib/material-viewer-main-6c084313.js +2 -0
- package/lib/material-viewer-main-6c084313.js.map +1 -0
- package/lib/material-viewer-main.nomodule.js +1 -1
- package/lib/{mesh-generator-948c7db4.nomodule.js → mesh-generator-7dea7a1b.nomodule.js} +2 -2
- package/lib/mesh-generator-7dea7a1b.nomodule.js.map +1 -0
- package/lib/{mesh-generator-ff0dbfc8.js → mesh-generator-a980f1b0.js} +2 -2
- package/lib/mesh-generator-a980f1b0.js.map +1 -0
- package/lib/{pixotron-ec9a72e0.nomodule.js → pixotron-4065f090.nomodule.js} +2 -2
- package/lib/{pixotron-ec9a72e0.nomodule.js.map → pixotron-4065f090.nomodule.js.map} +1 -1
- package/lib/{pixotron-5167229f.js → pixotron-9baf521b.js} +2 -2
- package/lib/{pixotron-5167229f.js.map → pixotron-9baf521b.js.map} +1 -1
- package/lib/{planner-f1b53f57.nomodule.js → planner-2040e9ab.nomodule.js} +2 -2
- package/lib/{planner-f1b53f57.nomodule.js.map → planner-2040e9ab.nomodule.js.map} +1 -1
- package/lib/{planner-c3c34e74.js → planner-79b62302.js} +2 -2
- package/lib/{planner-c3c34e74.js.map → planner-79b62302.js.map} +1 -1
- package/lib/planner-main-74807374.js +2 -0
- package/lib/planner-main-74807374.js.map +1 -0
- package/lib/planner-main.nomodule.js +1 -1
- package/lib/{rapi-access-cf61a750.nomodule.js → rapi-access-65dbda00.nomodule.js} +3 -3
- package/lib/{rapi-access-cf61a750.nomodule.js.map → rapi-access-65dbda00.nomodule.js.map} +1 -1
- package/lib/{rapi-access-cc4f78e4.js → rapi-access-d209c65c.js} +3 -3
- package/lib/{rapi-access-cc4f78e4.js.map → rapi-access-d209c65c.js.map} +1 -1
- package/lib/{roomle-sdk-da4e3ccc.js → roomle-sdk-85d54446.js} +2 -2
- package/lib/roomle-sdk-85d54446.js.map +1 -0
- package/lib/roomle-sdk.nomodule.js +1 -1
- package/lib/{scene-manager-aa8b9035.nomodule.js → scene-manager-0ac7eb06.nomodule.js} +2 -2
- package/lib/scene-manager-0ac7eb06.nomodule.js.map +1 -0
- package/lib/{scene-manager-8c308533.js → scene-manager-424afdbc.js} +2 -2
- package/lib/scene-manager-424afdbc.js.map +1 -0
- package/lib/static/ConfiguratorKernel-4c09558b00e81ba8.wasm +0 -0
- package/lib/static/ConfiguratorKernel-7379813e2cd03c0d.js +1 -0
- package/lib/static/ConfiguratorKernel-7379813e2cd03c0d.js.map +1 -0
- package/lib/static/ConfiguratorKernelJs-3789a15227520de1.js +143 -0
- package/lib/static/ConfiguratorKernelJs-dd075c23d87b4733.mem +0 -0
- package/lib/static/RoomleCore-43a1c9de57277471.wasm +0 -0
- package/lib/static/RoomleCore-4da5951bbc66db16.js +1 -0
- package/lib/static/RoomleCore-4da5951bbc66db16.js.map +1 -0
- package/lib/static/RoomleCoreJs-86806817a5b958c9.js +151 -0
- package/lib/static/RoomleCoreJs-cfff2977254b7f93.mem +0 -0
- package/lib/static/shaders-df453330fdd84fa7.json +1 -0
- package/lib/{stats-helper-f53f8b2f.js → stats-helper-3ffe1651.js} +2 -2
- package/lib/{stats-helper-f53f8b2f.js.map → stats-helper-3ffe1651.js.map} +1 -1
- package/lib/{stats-helper-7dc63459.nomodule.js → stats-helper-9b173f93.nomodule.js} +2 -2
- package/lib/{stats-helper-7dc63459.nomodule.js.map → stats-helper-9b173f93.nomodule.js.map} +1 -1
- package/package.json +2 -2
- package/lib/component-dimensioning-07857a7e.js.map +0 -1
- package/lib/component-dimensioning-e121b044.nomodule.js.map +0 -1
- package/lib/configurator-366b9a69.js +0 -2
- package/lib/configurator-b498456a.nomodule.js +0 -2
- package/lib/configurator-main-1ba50225.js +0 -2
- package/lib/configurator-main-1ba50225.js.map +0 -1
- package/lib/configurator-mesh-generator-bedfe9a1.nomodule.js +0 -2
- package/lib/configurator-mesh-generator-bedfe9a1.nomodule.js.map +0 -1
- package/lib/configurator-mesh-generator-e827c528.js.map +0 -1
- package/lib/default-light-setting-7eb7961c.js.map +0 -1
- package/lib/default-light-setting-f21a820b.nomodule.js.map +0 -1
- package/lib/dimensioning-helper-2f129aab.js.map +0 -1
- package/lib/dimensioning-helper-73700224.nomodule.js.map +0 -1
- package/lib/glb-viewer-10243e50.js +0 -2
- package/lib/glb-viewer-d6e080e4.nomodule.js +0 -2
- package/lib/glb-viewer-main-39535b70.js +0 -2
- package/lib/glb-viewer-main-39535b70.js.map +0 -1
- package/lib/image-renderer-9478b17b.nomodule.js +0 -2
- package/lib/image-renderer-9e47bc3a.js +0 -2
- package/lib/legacy/component-dimensioning-d657350b.legacy.js.map +0 -1
- package/lib/legacy/configurator-3250dfc2.legacy.js +0 -2
- package/lib/legacy/configurator-mesh-generator-d604f05c.legacy.js.map +0 -1
- package/lib/legacy/default-light-setting-14b03f67.legacy.js.map +0 -1
- package/lib/legacy/dimensioning-helper-bed08d96.legacy.js.map +0 -1
- package/lib/legacy/glb-viewer-5dcdda0a.legacy.js +0 -2
- package/lib/legacy/image-renderer-0f532f9c.legacy.js +0 -2
- package/lib/legacy/main-thread-to-worker-880d5b78.legacy.js.map +0 -1
- package/lib/legacy/material-viewer-41e5c677.legacy.js.map +0 -1
- package/lib/legacy/mesh-generator-4f2f2ec7.legacy.js.map +0 -1
- package/lib/legacy/scene-manager-afd27798.legacy.js.map +0 -1
- package/lib/legacy/static/ConfiguratorKernel-a1daecbcb66a7ea2.wasm +0 -0
- package/lib/legacy/static/ConfiguratorKernelJs-2a6eb4d239731162.mem +0 -0
- package/lib/legacy/static/ConfiguratorKernelJs-fdb5588c5f9ad271.js +0 -143
- package/lib/legacy/static/RoomleCore-423543e6e81ce65d.wasm +0 -0
- package/lib/legacy/static/RoomleCoreJs-3ca6b11e7db6ad5c.js +0 -151
- package/lib/legacy/static/RoomleCoreJs-88d140ccbd2a0401.mem +0 -0
- package/lib/legacy/static/shaders-300ca3b7af102119.json +0 -1
- package/lib/main-thread-to-worker-91bf9f5e.js.map +0 -1
- package/lib/main-thread-to-worker-bb844d54.nomodule.js.map +0 -1
- package/lib/material-viewer-1b0d838c.nomodule.js.map +0 -1
- package/lib/material-viewer-90b397b7.js.map +0 -1
- package/lib/material-viewer-main-39b78443.js +0 -2
- package/lib/material-viewer-main-39b78443.js.map +0 -1
- package/lib/mesh-generator-948c7db4.nomodule.js.map +0 -1
- package/lib/mesh-generator-ff0dbfc8.js.map +0 -1
- package/lib/planner-main-f87ff090.js +0 -2
- package/lib/planner-main-f87ff090.js.map +0 -1
- package/lib/roomle-sdk-da4e3ccc.js.map +0 -1
- package/lib/scene-manager-8c308533.js.map +0 -1
- package/lib/scene-manager-aa8b9035.nomodule.js.map +0 -1
- package/lib/static/ConfiguratorKernel-a1daecbcb66a7ea2.wasm +0 -0
- package/lib/static/ConfiguratorKernel-c416f21e546a33f4.js +0 -1
- package/lib/static/ConfiguratorKernel-c416f21e546a33f4.js.map +0 -1
- package/lib/static/ConfiguratorKernelJs-2a6eb4d239731162.mem +0 -0
- package/lib/static/ConfiguratorKernelJs-fdb5588c5f9ad271.js +0 -143
- package/lib/static/RoomleCore-30311f70b9e1675b.js +0 -1
- package/lib/static/RoomleCore-30311f70b9e1675b.js.map +0 -1
- package/lib/static/RoomleCore-423543e6e81ce65d.wasm +0 -0
- package/lib/static/RoomleCoreJs-3ca6b11e7db6ad5c.js +0 -151
- package/lib/static/RoomleCoreJs-88d140ccbd2a0401.mem +0 -0
- package/lib/static/shaders-300ca3b7af102119.json +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
System.register(["./main-thread-to-worker-
|
|
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
2
|
/*! *****************************************************************************
|
|
3
3
|
Copyright (c) Microsoft Corporation.
|
|
4
4
|
|
|
@@ -12,5 +12,5 @@ System.register(["./main-thread-to-worker-880d5b78.legacy.js"],(function(e){var
|
|
|
12
12
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
13
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
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?D(e):L(e)}),e=>{e&&e.children&&0!==e.children.length&&e.children.forEach(e=>{D(e)})}),D=e("a2",e=>{e&&(e.material&&H(e.material),e.geometry&&A(e.geometry),e.children&&e.children.length>0&&L(e))}),A=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]})),V=(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 N{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(),V(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-300ca3b7af102119.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),D(e),t<0||this.meshes.splice(t,1)}removeAllMeshes(e=!0){this.meshes.forEach(t=>{this.remove(t),e&&D(t)}),this.meshes=[],this._removeLoadingMesh(),this.remove(this._boundingBoxMesh),D(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),D(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),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.positionTo.clone().add(this._boundingBox.getCenter(new THREE.Vector3)),n=this.positionFrom.clone().add(this._boundingBox.getCenter(new THREE.Vector3)),s=new THREE.Line3(n,t).closestPointToPoint(e,!0,new THREE.Vector3);return(isNaN(s.x)||isNaN(s.y)||isNaN(s.z))&&s.copy(e),s.sub(this._boundingBox.getCenter(new THREE.Vector3))}updatePreviewPosition(e){let t=this.getPositionForIntersectionPoint(e),n=this.parent.localToWorld(t);this._newPosition=this.worldToLocal(n),this._dockline.position.copy((new THREE.Vector3).addVectors(this._newPosition,this._boundingBox.getCenter(new THREE.Vector3))),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-a1daecbcb66a7ea2.wasm",LOADER:"static/ConfiguratorKernel-c416f21e546a33f4.js"},PLANNER:{URL:"static/RoomleCore-423543e6e81ce65d.wasm",LOADER:"static/RoomleCore-30311f70b9e1675b.js"}},ASM:{CONFIGURATOR:{MEM_URL:"static/ConfiguratorKernelJs-2a6eb4d239731162.mem",LOADER:"static/ConfiguratorKernelJs-fdb5588c5f9ad271.js"},PLANNER:{MEM_URL:"static/RoomleCoreJs-88d140ccbd2a0401.mem",LOADER:"static/RoomleCoreJs-3ca6b11e7db6ad5c.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(){}async _handleCortoMesh(e,t,n){var s;await this._scriptLoader.fetch("static/corto.em.roomle-05666d318bd656c3.js",{id:"corto-lib"}),await window.CortoDecoder.ready;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 De=["language","browserLanguage","userLanguage","systemLanguage"];class Ae{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=De.length;e<n;e++){const n=t[De[e]];if(n)return n.substr(0,2)}return"en"})()||"en",this.overrideCountry=null,this._creator_=e}setOverrides(e){l(this,e)}}e("ag",Ae);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={})=>{}}}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",N),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",N),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())A(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",Ae,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,Ve=ze.itemHeaders,Ne=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:Ve})}getComponents(e){return this._getByIds(e,"components")}getItems(e){return this._getByIds(e,"items",{additionalHeaders:Ve})}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))}_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);return this._globalCallback.onNetworkRequest(e,n,t),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||Ne;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-
|
|
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?D(e):L(e)}),e=>{e&&e.children&&0!==e.children.length&&e.children.forEach(e=>{D(e)})}),D=e("a2",e=>{e&&(e.material&&H(e.material),e.geometry&&A(e.geometry),e.children&&e.children.length>0&&L(e))}),A=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]})),V=(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 N{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(),V(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-df453330fdd84fa7.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),D(e),t<0||this.meshes.splice(t,1)}removeAllMeshes(e=!0){this.meshes.forEach(t=>{this.remove(t),e&&D(t)}),this.meshes=[],this._removeLoadingMesh(),this.remove(this._boundingBoxMesh),D(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),D(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),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.positionTo.clone().add(this._boundingBox.getCenter(new THREE.Vector3)),n=this.positionFrom.clone().add(this._boundingBox.getCenter(new THREE.Vector3)),s=new THREE.Line3(n,t).closestPointToPoint(e,!0,new THREE.Vector3);return(isNaN(s.x)||isNaN(s.y)||isNaN(s.z))&&s.copy(e),s.sub(this._boundingBox.getCenter(new THREE.Vector3))}updatePreviewPosition(e){let t=this.getPositionForIntersectionPoint(e),n=this.parent.localToWorld(t);this._newPosition=this.worldToLocal(n),this._dockline.position.copy((new THREE.Vector3).addVectors(this._newPosition,this._boundingBox.getCenter(new THREE.Vector3))),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-4c09558b00e81ba8.wasm",LOADER:"static/ConfiguratorKernel-7379813e2cd03c0d.js"},PLANNER:{URL:"static/RoomleCore-43a1c9de57277471.wasm",LOADER:"static/RoomleCore-4da5951bbc66db16.js"}},ASM:{CONFIGURATOR:{MEM_URL:"static/ConfiguratorKernelJs-dd075c23d87b4733.mem",LOADER:"static/ConfiguratorKernelJs-3789a15227520de1.js"},PLANNER:{MEM_URL:"static/RoomleCoreJs-cfff2977254b7f93.mem",LOADER:"static/RoomleCoreJs-86806817a5b958c9.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(){}async _handleCortoMesh(e,t,n){var s;await this._scriptLoader.fetch("static/corto.em.roomle-05666d318bd656c3.js",{id:"corto-lib"}),await window.CortoDecoder.ready;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 De=["language","browserLanguage","userLanguage","systemLanguage"];class Ae{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=De.length;e<n;e++){const n=t[De[e]];if(n)return n.substr(0,2)}return"en"})()||"en",this.overrideCountry=null,this._creator_=e}setOverrides(e){l(this,e)}}e("ag",Ae);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",N),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",N),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())A(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",Ae,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,Ve=ze.itemHeaders,Ne=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:Ve})}getComponents(e){return this._getByIds(e,"components")}getItems(e){return this._getByIds(e,"items",{additionalHeaders:Ve})}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||Ne;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-7d0f02e7.legacy.js.map
|
package/lib/legacy/{rapi-access-ef758fca.legacy.js.map → rapi-access-7d0f02e7.legacy.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rapi-access-
|
|
1
|
+
{"version":3,"file":"rapi-access-7d0f02e7.legacy.js","sources":["../../../packages/common-core/public/textures/env/roomle.envmap","../../../packages/common-core/public/textures/env/roomle64.envmap","../../../packages/common-core/public/predefined_lightsettings/shelf.json","../../../packages/common-core/public/predefined_lightsettings/shelf_front.json","../../../packages/common-core/public/predefined_lightsettings/sofa.json","../../../packages/common-core/public/predefined_lightsettings/baked.json","../../../packages/common-core/public/predefined_lightsettings/camera.json","../../../packages/common-core/public/predefined_lightsettings/equal.json","../../../packages/workers/generated/asset-loader.worker.js","../../../node_modules/three/examples/js/loaders/GLTFLoader.js","../../../node_modules/three/examples/js/loaders/DRACOLoader.js","../../../node_modules/three/examples/js/libs/draco/draco_wasm_wrapper.js","../../../node_modules/three/examples/js/libs/draco/draco_decoder.wasm","../../../node_modules/three/examples/js/libs/draco/draco_decoder.js","../../../packages/common-core/generated/shaders.json","../../../packages/common-core/generated/rthree.js","../../../node_modules/roomle-core-hsc/wasm/ConfiguratorKernel.wasm","../../../node_modules/roomle-core-hsc/wasm/ConfiguratorKernel.js","../../../node_modules/roomle-core-hsc/wasm/RoomleCore.wasm","../../../node_modules/roomle-core-hsc/wasm/RoomleCore.js","../../../node_modules/roomle-core-hsc/ConfiguratorKernelJs.mem","../../../node_modules/roomle-core-hsc/ConfiguratorKernelJs.js","../../../node_modules/roomle-core-hsc/RoomleCoreJs.mem","../../../node_modules/roomle-core-hsc/RoomleCoreJs.js","../../../node_modules/roomle-core-hsc/corto.em.roomle.js"],"sourcesContent":["export default \"static/roomle-91862a5e7f3f46e5.envmap\"","export default \"static/roomle64-adb0f447a54b5143.envmap\"","export default \"static/shelf-2975dd3f2fa9c763.json\"","export default \"static/shelf_front-8c9566a4512f0de8.json\"","export default \"static/sofa-997b116bc5f2e92e.json\"","export default \"static/baked-6485a2b1daeb69e8.json\"","export default \"static/camera-f4cef679615485dc.json\"","export default \"static/equal-319f6b83c827913f.json\"","export default \"static/asset-loader.worker-796c70f59b977071.js\"","export default \"static/GLTFLoader-5b296b5fb14cfe1a.js\"","export default \"static/DRACOLoader-5edeeab4a8dbc0bd.js\"","export default \"static/draco_wasm_wrapper-d775f9f135cb30ff.js\"","export default \"static/draco_decoder-979e668167e37c95.wasm\"","export default \"static/draco_decoder-3866672a1fa2f980.js\"","export default \"static/shaders-df453330fdd84fa7.json\"","export default \"static/rthree-508a6ceb9a1516ce.js\"","export default \"static/ConfiguratorKernel-4c09558b00e81ba8.wasm\"","export default \"static/ConfiguratorKernel-7379813e2cd03c0d.js\"","export default \"static/RoomleCore-43a1c9de57277471.wasm\"","export default \"static/RoomleCore-4da5951bbc66db16.js\"","export default \"static/ConfiguratorKernelJs-dd075c23d87b4733.mem\"","export default \"static/ConfiguratorKernelJs-3789a15227520de1.js\"","export default \"static/RoomleCoreJs-cfff2977254b7f93.mem\"","export default \"static/RoomleCoreJs-86806817a5b958c9.js\"","export default \"static/corto.em.roomle-05666d318bd656c3.js\""],"names":[],"mappings":";;;;;;;;;;;;;;85UAAe,+DCAA,giECAA,wECAA,uECAA,iECAA,mECAA,mECAA,6DDAA,6iKEAA,8jHCAA,mDCAA,4ECAA,qECAA,gECAA,qvECAA,0PCAA,+4jBCAA,yDCAA,8DCAA,iDCAA,qECAA,0DCAA,oECAA,kDCAA,o/QCAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./rapi-access-
|
|
1
|
+
System.register(["./rapi-access-7d0f02e7.legacy.js","./main-thread-to-worker-4c02f179.legacy.js"],(function(e,t){var a,r,n,i,o,s;return{setters:[function(e){a=e.s,r=e.n,n=e.o,i=e.af,o=e.ag,s=e.ah},function(){}],execute:function(){e("default",class{static getConfigurator(e,a){return a=this._setupDI("configurator",e,a),new Promise((e,r)=>t.import("./configurator-82b7967e.legacy.js").then((function(e){return e.c})).then(({Configurator:t})=>e(new t(a)),r))}static getPlanner(e,a){return a=this._setupDI("planner",e,a),new Promise((e,r)=>t.import("./planner-5b7cc8fa.legacy.js").then(({Planner:t})=>e(new t(a)),r))}static async getGlbViewer(e,a){return a=this._setupDI("glb-viewer",e,a),new Promise((e,r)=>t.import("./glb-viewer-be2c067a.legacy.js").then(({GlbViewer:t})=>e(new t(a)),r))}static getMaterialViewer(e,a){return a=this._setupDI("configurator",e,a),new Promise((e,r)=>t.import("./material-viewer-e83460de.legacy.js").then(({MaterialViewer:t})=>e(new t(a)),r))}static getRapiAccess(){return a.addToContainer([new r("rapi-access",n,0),new r("global-callback",i,0)]),Promise.resolve(a.lookup("rapi-access"))}static get callbacks(){return a.addToContainer([new r("global-callback",i,0)]),Promise.resolve(a.lookup("global-callback"))}static setGlobalInitData(e){e&&(a.addToContainer([new r("global-init-data",o,0)]),a.lookup("global-init-data").setOverrides(e))}static getContext(e){return a.getContext(e)}static _setupDI(e,t,n){return t&&(a.addToContainer([new r("init-data",s,1)]),n||(n=a.getContext(e)),a.lookup("init-data",n).setOverrides(t)),n}})}}}));
|
|
2
2
|
//# sourceMappingURL=roomle-sdk.legacy.js.map
|