@roomle/web-sdk 2.51.0 → 2.52.0-debug.1

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.
Files changed (175) hide show
  1. package/.releaserc.json +1 -1
  2. package/lib/{banana-for-scale-455962c1.js → banana-for-scale-7f4886dc.js} +2 -2
  3. package/lib/{banana-for-scale-455962c1.js.map → banana-for-scale-7f4886dc.js.map} +1 -1
  4. package/lib/{banana-for-scale-236808f3.nomodule.js → banana-for-scale-beb021eb.nomodule.js} +2 -2
  5. package/lib/{banana-for-scale-236808f3.nomodule.js.map → banana-for-scale-beb021eb.nomodule.js.map} +1 -1
  6. package/lib/{component-dimensioning-c1fcd269.nomodule.js → component-dimensioning-172d70ad.nomodule.js} +2 -2
  7. package/lib/component-dimensioning-172d70ad.nomodule.js.map +1 -0
  8. package/lib/{component-dimensioning-ea18dbe0.js → component-dimensioning-9246c6cc.js} +2 -2
  9. package/lib/component-dimensioning-9246c6cc.js.map +1 -0
  10. package/lib/{component-raycast-helper-d3f8c97f.nomodule.js → component-raycast-helper-619320dd.nomodule.js} +2 -2
  11. package/lib/component-raycast-helper-619320dd.nomodule.js.map +1 -0
  12. package/lib/{component-raycast-helper-f65a4d48.js → component-raycast-helper-f1b04bb6.js} +2 -2
  13. package/lib/component-raycast-helper-f1b04bb6.js.map +1 -0
  14. package/lib/{configurator-0a897d23.nomodule.js → configurator-089743c8.nomodule.js} +2 -2
  15. package/lib/configurator-089743c8.nomodule.js.map +1 -0
  16. package/lib/{configurator-5631c3e6.js → configurator-8d5b17e5.js} +2 -2
  17. package/lib/configurator-8d5b17e5.js.map +1 -0
  18. package/lib/configurator-main-f39a172b.js +2 -0
  19. package/lib/configurator-main-f39a172b.js.map +1 -0
  20. package/lib/configurator-main.nomodule.js +1 -1
  21. package/lib/{continuous-drawing-helper-fa64d1fb.nomodule.js → continuous-drawing-helper-161e3098.nomodule.js} +2 -2
  22. package/lib/continuous-drawing-helper-161e3098.nomodule.js.map +1 -0
  23. package/lib/{continuous-drawing-helper-4d5f60e7.js → continuous-drawing-helper-7269b28d.js} +2 -2
  24. package/lib/continuous-drawing-helper-7269b28d.js.map +1 -0
  25. package/lib/{default-light-setting-7ccab33f.nomodule.js → default-light-setting-d6819041.nomodule.js} +2 -2
  26. package/lib/default-light-setting-d6819041.nomodule.js.map +1 -0
  27. package/lib/{default-light-setting-01e3c0d6.js → default-light-setting-de008a6d.js} +2 -2
  28. package/lib/default-light-setting-de008a6d.js.map +1 -0
  29. package/lib/definitions/common-core/__tests__/view-model/construction-plan-object-view-model.d.ts +1 -0
  30. package/lib/definitions/common-core/src/view-model/plan-element-view-model.d.ts +1 -0
  31. package/lib/definitions/planner-core/src/services/planner-kernel-access.d.ts +1 -0
  32. package/lib/definitions/planner-core/src/view-model/construction-plan-object-view-model.d.ts +16 -0
  33. package/lib/definitions/planner-core/src/view-model/plan-view-model.d.ts +3 -0
  34. package/lib/definitions/typings/planner.d.ts +3 -0
  35. package/lib/{dimensioning-helper-07083be3.nomodule.js → dimensioning-helper-0d4caa33.nomodule.js} +2 -2
  36. package/lib/{dimensioning-helper-07083be3.nomodule.js.map → dimensioning-helper-0d4caa33.nomodule.js.map} +1 -1
  37. package/lib/{dimensioning-helper-343e2ed7.js → dimensioning-helper-26db3ade.js} +2 -2
  38. package/lib/{dimensioning-helper-343e2ed7.js.map → dimensioning-helper-26db3ade.js.map} +1 -1
  39. package/lib/{glb-viewer-55dbe84d.nomodule.js → glb-viewer-0246e88b.nomodule.js} +2 -2
  40. package/lib/{glb-viewer-55dbe84d.nomodule.js.map → glb-viewer-0246e88b.nomodule.js.map} +1 -1
  41. package/lib/{glb-viewer-737dcf73.js → glb-viewer-91d48343.js} +2 -2
  42. package/lib/{glb-viewer-737dcf73.js.map → glb-viewer-91d48343.js.map} +1 -1
  43. package/lib/glb-viewer-main-9f58a136.js +2 -0
  44. package/lib/glb-viewer-main-9f58a136.js.map +1 -0
  45. package/lib/glb-viewer-main.nomodule.js +1 -1
  46. package/lib/legacy/{banana-for-scale-e144600b.legacy.js → banana-for-scale-be99f7f4.legacy.js} +2 -2
  47. package/lib/legacy/{banana-for-scale-e144600b.legacy.js.map → banana-for-scale-be99f7f4.legacy.js.map} +1 -1
  48. package/lib/legacy/{component-dimensioning-153f01a8.legacy.js → component-dimensioning-7393934c.legacy.js} +2 -2
  49. package/lib/legacy/component-dimensioning-7393934c.legacy.js.map +1 -0
  50. package/lib/legacy/{component-raycast-helper-60136749.legacy.js → component-raycast-helper-3943f1d8.legacy.js} +2 -2
  51. package/lib/legacy/component-raycast-helper-3943f1d8.legacy.js.map +1 -0
  52. package/lib/legacy/{configurator-e0381a17.legacy.js → configurator-7c3619d8.legacy.js} +2 -2
  53. package/lib/legacy/configurator-7c3619d8.legacy.js.map +1 -0
  54. package/lib/legacy/configurator-main.legacy.js +1 -1
  55. package/lib/legacy/{continuous-drawing-helper-227d6370.legacy.js → continuous-drawing-helper-e7cc68f4.legacy.js} +2 -2
  56. package/lib/legacy/continuous-drawing-helper-e7cc68f4.legacy.js.map +1 -0
  57. package/lib/legacy/{default-light-setting-770aa149.legacy.js → default-light-setting-31623ca0.legacy.js} +2 -2
  58. package/lib/legacy/default-light-setting-31623ca0.legacy.js.map +1 -0
  59. package/lib/legacy/{dimensioning-helper-0af28573.legacy.js → dimensioning-helper-acdfd39b.legacy.js} +2 -2
  60. package/lib/legacy/{dimensioning-helper-0af28573.legacy.js.map → dimensioning-helper-acdfd39b.legacy.js.map} +1 -1
  61. package/lib/legacy/{glb-viewer-3231eccb.legacy.js → glb-viewer-e96b3963.legacy.js} +2 -2
  62. package/lib/legacy/{glb-viewer-3231eccb.legacy.js.map → glb-viewer-e96b3963.legacy.js.map} +1 -1
  63. package/lib/legacy/glb-viewer-main.legacy.js +1 -1
  64. package/lib/legacy/{material-viewer-cea911d6.legacy.js → material-viewer-2f01e891.legacy.js} +2 -2
  65. package/lib/legacy/material-viewer-2f01e891.legacy.js.map +1 -0
  66. package/lib/legacy/material-viewer-main.legacy.js +1 -1
  67. package/lib/legacy/pixotron-aed2579e.legacy.js +2 -0
  68. package/lib/legacy/{pixotron-d7cf5356.legacy.js.map → pixotron-aed2579e.legacy.js.map} +1 -1
  69. package/lib/legacy/planner-6c0ce8eb.legacy.js +2 -0
  70. package/lib/legacy/{planner-a8d60d23.legacy.js.map → planner-6c0ce8eb.legacy.js.map} +1 -1
  71. package/lib/legacy/planner-main.legacy.js +1 -1
  72. package/lib/legacy/roomle-configurator-89322fbd.legacy.js +2 -0
  73. package/lib/legacy/{roomle-configurator-b870b2ea.legacy.js.map → roomle-configurator-89322fbd.legacy.js.map} +1 -1
  74. package/lib/legacy/roomle-dependency-injection-6d4fe95c.legacy.js +16 -0
  75. package/lib/legacy/{roomle-dependency-injection-95bbacdd.legacy.js.map → roomle-dependency-injection-6d4fe95c.legacy.js.map} +1 -1
  76. package/lib/legacy/roomle-sdk.legacy.js +1 -1
  77. package/lib/legacy/{script-loader-1042be7b.legacy.js → script-loader-a64acbb1.legacy.js} +2 -2
  78. package/lib/legacy/script-loader-a64acbb1.legacy.js.map +1 -0
  79. package/lib/legacy/static/shaders-a517109fc4195f66.json +1 -0
  80. package/lib/legacy/{stats-helper-8314170b.legacy.js → stats-helper-767882c3.legacy.js} +2 -2
  81. package/lib/legacy/{stats-helper-8314170b.legacy.js.map → stats-helper-767882c3.legacy.js.map} +1 -1
  82. package/lib/legacy/{tools-core-af38b46a.legacy.js → tools-core-253210a4.legacy.js} +2 -2
  83. package/lib/legacy/tools-core-253210a4.legacy.js.map +1 -0
  84. package/lib/{material-viewer-23a97271.js → material-viewer-3b958f44.js} +2 -2
  85. package/lib/material-viewer-3b958f44.js.map +1 -0
  86. package/lib/{material-viewer-64415ade.nomodule.js → material-viewer-e73cc1f8.nomodule.js} +2 -2
  87. package/lib/material-viewer-e73cc1f8.nomodule.js.map +1 -0
  88. package/lib/material-viewer-main-01a4fb08.js +2 -0
  89. package/lib/material-viewer-main-01a4fb08.js.map +1 -0
  90. package/lib/material-viewer-main.nomodule.js +1 -1
  91. package/lib/pixotron-ad110207.js +2 -0
  92. package/lib/{pixotron-9ea3cf30.js.map → pixotron-ad110207.js.map} +1 -1
  93. package/lib/pixotron-becbee6b.nomodule.js +2 -0
  94. package/lib/{pixotron-24f2ab0b.nomodule.js.map → pixotron-becbee6b.nomodule.js.map} +1 -1
  95. package/lib/planner-0176717a.nomodule.js +2 -0
  96. package/lib/{planner-0595038e.nomodule.js.map → planner-0176717a.nomodule.js.map} +1 -1
  97. package/lib/planner-86b833ec.js +2 -0
  98. package/lib/{planner-3e9cecde.js.map → planner-86b833ec.js.map} +1 -1
  99. package/lib/planner-main-d1636ed4.js +2 -0
  100. package/lib/planner-main-d1636ed4.js.map +1 -0
  101. package/lib/planner-main.nomodule.js +1 -1
  102. package/lib/roomle-configurator-e7256218.nomodule.js +2 -0
  103. package/lib/{roomle-configurator-24031764.nomodule.js.map → roomle-configurator-e7256218.nomodule.js.map} +1 -1
  104. package/lib/roomle-configurator-ff35715f.js +2 -0
  105. package/lib/{roomle-configurator-56e5c051.js.map → roomle-configurator-ff35715f.js.map} +1 -1
  106. package/lib/roomle-dependency-injection-0d6b01a8.js +16 -0
  107. package/lib/{roomle-dependency-injection-6d855646.js.map → roomle-dependency-injection-0d6b01a8.js.map} +1 -1
  108. package/lib/roomle-dependency-injection-95fcebc2.nomodule.js +16 -0
  109. package/lib/{roomle-dependency-injection-12d03539.nomodule.js.map → roomle-dependency-injection-95fcebc2.nomodule.js.map} +1 -1
  110. package/lib/{roomle-sdk-0244e9df.js → roomle-sdk-f552b223.js} +2 -2
  111. package/lib/roomle-sdk-f552b223.js.map +1 -0
  112. package/lib/roomle-sdk.nomodule.js +1 -1
  113. package/lib/{script-loader-9da04da5.nomodule.js → script-loader-1d69982b.nomodule.js} +2 -2
  114. package/lib/script-loader-1d69982b.nomodule.js.map +1 -0
  115. package/lib/{script-loader-48213503.js → script-loader-5681c298.js} +2 -2
  116. package/lib/script-loader-5681c298.js.map +1 -0
  117. package/lib/static/shaders-a517109fc4195f66.json +1 -0
  118. package/lib/{stats-helper-521c544f.nomodule.js → stats-helper-7d9f0a8a.nomodule.js} +2 -2
  119. package/lib/{stats-helper-521c544f.nomodule.js.map → stats-helper-7d9f0a8a.nomodule.js.map} +1 -1
  120. package/lib/{stats-helper-51c4a315.js → stats-helper-b27c936e.js} +2 -2
  121. package/lib/{stats-helper-51c4a315.js.map → stats-helper-b27c936e.js.map} +1 -1
  122. package/lib/{tools-core-fd5914bc.js → tools-core-0d19f253.js} +2 -2
  123. package/lib/tools-core-0d19f253.js.map +1 -0
  124. package/lib/{tools-core-89a3a0c5.nomodule.js → tools-core-e26bb496.nomodule.js} +2 -2
  125. package/lib/tools-core-e26bb496.nomodule.js.map +1 -0
  126. package/package.json +2 -2
  127. package/lib/component-dimensioning-c1fcd269.nomodule.js.map +0 -1
  128. package/lib/component-dimensioning-ea18dbe0.js.map +0 -1
  129. package/lib/component-raycast-helper-d3f8c97f.nomodule.js.map +0 -1
  130. package/lib/component-raycast-helper-f65a4d48.js.map +0 -1
  131. package/lib/configurator-0a897d23.nomodule.js.map +0 -1
  132. package/lib/configurator-5631c3e6.js.map +0 -1
  133. package/lib/configurator-main-008351b5.js +0 -2
  134. package/lib/configurator-main-008351b5.js.map +0 -1
  135. package/lib/continuous-drawing-helper-4d5f60e7.js.map +0 -1
  136. package/lib/continuous-drawing-helper-fa64d1fb.nomodule.js.map +0 -1
  137. package/lib/default-light-setting-01e3c0d6.js.map +0 -1
  138. package/lib/default-light-setting-7ccab33f.nomodule.js.map +0 -1
  139. package/lib/glb-viewer-main-d2b14fcf.js +0 -2
  140. package/lib/glb-viewer-main-d2b14fcf.js.map +0 -1
  141. package/lib/legacy/component-dimensioning-153f01a8.legacy.js.map +0 -1
  142. package/lib/legacy/component-raycast-helper-60136749.legacy.js.map +0 -1
  143. package/lib/legacy/configurator-e0381a17.legacy.js.map +0 -1
  144. package/lib/legacy/continuous-drawing-helper-227d6370.legacy.js.map +0 -1
  145. package/lib/legacy/default-light-setting-770aa149.legacy.js.map +0 -1
  146. package/lib/legacy/material-viewer-cea911d6.legacy.js.map +0 -1
  147. package/lib/legacy/pixotron-d7cf5356.legacy.js +0 -2
  148. package/lib/legacy/planner-a8d60d23.legacy.js +0 -2
  149. package/lib/legacy/roomle-configurator-b870b2ea.legacy.js +0 -2
  150. package/lib/legacy/roomle-dependency-injection-95bbacdd.legacy.js +0 -16
  151. package/lib/legacy/script-loader-1042be7b.legacy.js.map +0 -1
  152. package/lib/legacy/static/shaders-513b41a25d232f83.json +0 -1
  153. package/lib/legacy/tools-core-af38b46a.legacy.js.map +0 -1
  154. package/lib/material-viewer-23a97271.js.map +0 -1
  155. package/lib/material-viewer-64415ade.nomodule.js.map +0 -1
  156. package/lib/material-viewer-main-9fb92220.js +0 -2
  157. package/lib/material-viewer-main-9fb92220.js.map +0 -1
  158. package/lib/pixotron-24f2ab0b.nomodule.js +0 -2
  159. package/lib/pixotron-9ea3cf30.js +0 -2
  160. package/lib/planner-0595038e.nomodule.js +0 -2
  161. package/lib/planner-3e9cecde.js +0 -2
  162. package/lib/planner-main-2b2906a7.js +0 -2
  163. package/lib/planner-main-2b2906a7.js.map +0 -1
  164. package/lib/roomle-configurator-24031764.nomodule.js +0 -2
  165. package/lib/roomle-configurator-56e5c051.js +0 -2
  166. package/lib/roomle-dependency-injection-12d03539.nomodule.js +0 -16
  167. package/lib/roomle-dependency-injection-6d855646.js +0 -16
  168. package/lib/roomle-sdk-0244e9df.js.map +0 -1
  169. package/lib/script-loader-48213503.js.map +0 -1
  170. package/lib/script-loader-9da04da5.nomodule.js.map +0 -1
  171. package/lib/static/shaders-513b41a25d232f83.json +0 -1
  172. package/lib/static/worker-to-main-thread-57c27030.js +0 -1
  173. package/lib/static/worker-to-main-thread-57c27030.js.map +0 -1
  174. package/lib/tools-core-89a3a0c5.nomodule.js.map +0 -1
  175. package/lib/tools-core-fd5914bc.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"roomle-configurator-56e5c051.js","sources":["../../node_modules/three/examples/js/exporters/GLTFExporter.js"],"sourcesContent":["export default \"static/GLTFExporter-86edae059df3a219.js\""],"names":[],"mappings":"izCAAA,4BAAe,2+5CAAA"}
1
+ {"version":3,"file":"roomle-configurator-ff35715f.js","sources":["../../node_modules/three/examples/js/exporters/GLTFExporter.js"],"sourcesContent":["export default \"static/GLTFExporter-86edae059df3a219.js\""],"names":[],"mappings":"s1CAAA,4BAAe,0n7CAAA"}
@@ -0,0 +1,16 @@
1
+ import{a as getValue,g as getAssetPath,M as MainThreadToWorker,h as handleJsonResponse,R as ROOMLE_COLORS,d as deepMerge,s as setWriteable,b as setDescriptor,c as createBenchmarkMaterial,e as createBenchmarkTexture,r as removeItem,f as getGlbUrl,w as wait,o as objectArrayToMap,u as uuid,i as setCursor,j as isString}from"./main-thread-to-worker-811523e8.js";class Container{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 i=t&&1===n.type?t:"global";if(i+="_"+e,2===n.type)return new n.classDefinition;if(this._singletons.has(i))return this._singletons.get(i);const s=new n.classDefinition(t);return this._singletons.set(i,s),s}cleanUp(e){if(e){let t=[];this._singletons.forEach((n,i)=>{i.startsWith(e)&&t.push(i)}),t.forEach(e=>{this._singletons.delete(e)})}else this._singletons.clear(),this._singletons=new Map}}class DependencyInjectionAssignment{constructor(e,t,n){this.className=e,this.classDefinition=t,this.type=void 0===n?0:n}}const IMAGE_FORMATS={JPG:".jpg",JPEG:".jpeg",PNG:".png",GIF:".gif"};class FormDataUtil{_base64toBlob(e,t){t=t||"";const n=atob(e),i=n.length,s=Math.ceil(i/1024),o=new Array(s);for(let e=0;e<s;++e){let t=1024*e,s=Math.min(t+1024,i);const r=new Array(s-t);for(let e=t,i=0;e<s;++i,++e)r[i]=n[e].charCodeAt(0);o[e]=new Uint8Array(r)}return new Blob(o,{type:t})}_createFormData(e,t,n,i){const s=new FormData;-1!==e.indexOf(",")&&(e=e.substr(e.indexOf(",")+1));const o=-1===Object.keys(IMAGE_FORMATS).map(e=>IMAGE_FORMATS[e]).indexOf(n)?"application":"image",r=this._base64toBlob(e,o+"/"+n.substr(1));return s.append(i,r,t+n),s}create(e,t,n,i){return this._createFormData(e,t,n,i)}}
2
+ /*! *****************************************************************************
3
+ Copyright (c) Microsoft Corporation.
4
+
5
+ Permission to use, copy, modify, and/or distribute this software for any
6
+ purpose with or without fee is hereby granted.
7
+
8
+ THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
9
+ REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10
+ AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
11
+ INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12
+ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
+ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
+ PERFORMANCE OF THIS SOFTWARE.
15
+ ***************************************************************************** */function __decorate(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}class EnvMapReader{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 i=Math.log2(this._size)+1;this._cubeTextures=[];for(let s=0;s<i;s++){let i=new THREE.CubeTexture;this._cubeTextures.push(i),i.format=THREE.RGBAFormat,i.encoding=this._encoding,i.type=this._type,i.minFilter=THREE.LinearMipMapLinearFilter,i.magFilter=THREE.LinearFilter,i.generateMipmaps=!1;for(let s=0;s<6;s++){let o=new Uint8Array(e,t,4*n*n),r=new THREE.DataTexture(o,n,n);r.format=i.format,r.encoding=i.encoding,r.type=i.type,r.generateMipmaps=!1,t+=4*n*n,i.images[s]=r,r.needsUpdate=!0}i.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<i;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 i=4*t.length/n;let s=new ArrayBuffer(i),o=new DataView(s),r=0,a=t.length/n;if(3===n)for(let e=0;e<a;e++)o.setUint8(r++,t[e]),o.setUint8(r++,t[e+a]),o.setUint8(r++,t[e+2*a]),o.setUint8(r++,255);else for(let e=0;e<a;e++)o.setUint8(r++,t[e]),o.setUint8(r++,t[e+a]),o.setUint8(r++,t[e+2*a]),o.setUint8(r++,t[e+3*a]);return s}parseData_(e){this.parseHeader_(e);let t=30;t=0;let n=this.convertToRGBABuffer(e);this.parseBufferData_(n,0)}}const toRadiant=function(e){return e*(Math.PI/180)},toDegrees=function(e){return e*(180/Math.PI)},getIdealDistance=function(e,t,n,i,s,o){e=Math.sqrt(e*e+n*n);const r=s/o,a=2*Math.atan(Math.tan(i*Math.PI/180/2)*r)*180/Math.PI,l=toRadiant(i),c=t/2/Math.tan(l/2),h=e/(2*Math.atan(Math.PI*a/360));return Math.max(c,h)},round=function(e){return Math.round(1e3*e)/1e3},getDelta=function(e,t){return Math.abs(e.y-t.y)+Math.abs(e.x-t.x)},convertToTHREE=e=>new THREE.Vector3(e.x/1e3,e.z/1e3,e.y/-1e3),convertToThreeDimensions=e=>new THREE.Vector3(e.x/1e3,e.z/1e3,e.y/1e3),convertToKernel=e=>({x:Math.round(1e3*e.x),y:Math.round(-1e3*e.z),z:Math.round(1e3*e.y)}),utilityStringToUTF16=e=>decodeURIComponent(encodeURIComponent(e)),convertCObject=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=utilityToArray(e);for(let e=0;e<t.length;e++)t[e]=convertCObject(t[e]);return"string"==typeof t?utilityStringToUTF16(t):t}if("object"==typeof e)for(let t in e)e.hasOwnProperty(t)&&(e[t]=convertCObject(e[t]));return"string"==typeof e?utilityStringToUTF16(e):e},utilityToArray=e=>{let t=[];if(e){let n=e.size();for(let i=0;i<n;i++)t.push(e.get(i))}return t},convertToThreeMatrix=e=>{let t=new THREE.Matrix4,n=convertCObject(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)},getScreenXY=(e,t,n,i)=>{if(!e||!t||0===n||0===i)return new THREE.Vector3;let s=e.clone(),o=n/2,r=i/2;return s.project(t),s.x=Math.floor(s.x*o+o),s.y=Math.floor(-s.y*r+r),s.z=e.distanceTo(t.position),s},kernelBoxToThreeBox=(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),i=new THREE.Vector3(e.origin.x/1e3,e.origin.z/1e3,e.origin.y/-1e3),s=new THREE.Vector3(0,0,-n.z).add(i).sub(t),o=new THREE.Vector3(n.x,n.y,0).add(i).add(t);return new THREE.Box3(s,o)},position3VectorsAreEqual=(e,t)=>{let n=round(e.x),i=round(e.y),s=round(e.z),o=round(t.x),r=round(t.y),a=round(t.z);return n===o&&i===r&&s===a},rotationQuaternionsAreEqual=(e,t)=>{let n=round(e.w),i=round(e.x),s=round(e.y),o=round(e.z),r=round(t.w),a=round(t.x),l=round(t.y),c=round(t.z);return n===r&&i===a&&s===l&&o===c},position2VectorsAreEqual=(e,t)=>{let n=round(e.x),i=round(e.y),s=round(t.x),o=round(t.y);return n===s&&i===o};let whiteTexture=null;const getWhiteTexture=()=>{if(whiteTexture)return whiteTexture;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},createColorTexture=(e,t,n,i)=>{const s=new Uint8Array(4),o=Math.floor(255*e),r=Math.floor(255*t),a=Math.floor(255*n),l=Math.floor(255*i);for(let e=0;e<4;e++){const t=4*e;s[t]=o,s[t+1]=r,s[t+2]=a,s[t+3]=l}const c=new THREE.DataTexture(s,1,1,THREE.RGBAFormat);return c.needsUpdate=!0,c},createMaterial=(e,t)=>setMaterial(null,e,t),setMaterial=(e,t,n)=>{if(e||(e=createMeshPhysicalMaterial()),e.name=t.id?t.id.toString():"",void 0!==t.shading.metallic&&(e.metalness=1===t.shading.metallic?1:.5,e.reflectivity=getValue(t.shading.metallic,.5)),t.shading.transmission&&t.shading.transmission>0?(e.transmission=t.shading.transmission,e.opacity=1,e.transparent=!0,e.depthWrite=!1,e.metalness=0):void 0!==t.shading.alpha&&t.shading.alpha<1&&(e.transparent=t.shading.alpha<1,e.opacity=t.shading.alpha,e.depthWrite=t.shading.alpha>=1),e.aoMapIntensity=getValue(t.shading.occlusion,1),e.roughness=getValue(t.shading.roughness,.5),e.alphaTest=getValue(t.shading.alphaCutoff,0),void 0!==t.shading.basecolor){const n=new THREE.Color(t.shading.basecolor.r,t.shading.basecolor.g,t.shading.basecolor.b);e.color.copy(n.convertSRGBToLinear())}return null==n||n.setEnvMap(e),t.shading.doubleSided?e.side=THREE.DoubleSide:e.side=THREE.FrontSide,e.map||(whiteTexture||(whiteTexture=getWhiteTexture()),e.map=whiteTexture),e},createMeshPhysicalMaterial=()=>new THREE.MeshPhysicalMaterial({}),getMaterialShading=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 textureLoader=null;const addTexture=(e,t,n,i,s,o,r=16)=>(textureLoader||(textureLoader=new THREE.TextureLoader,textureLoader.crossOrigin=""),new Promise((a,l)=>{if(!e)return console.warn("trying to add a texture without image",t),void a();textureLoader.load(e,e=>{addExistingTexture(e,t,n,i,s,o,r),a()},l)})),addExistingTexture=(e,t,n,i,s,o,r=16)=>{e.anisotropy=i,e.wrapS=THREE.RepeatWrapping,e.wrapT=THREE.RepeatWrapping,"ORM"===t.mapping&&r<=8?console.warn("ORM maps are not supported on devices with only "+r+" texture units"):(e.repeat.set(s,o),"XYZ"===t.mapping?(n.normalMap=e,n.map===getWhiteTexture()&&(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)},getGUI=(e=!0)=>window.dat&&window.dat.GUI?(window.__RML_GUI__||(window.__RML_GUI__=new dat.GUI({autoPlace:e})),window.__RML_GUI__):null,hideWallsBasedOnCamera=(e,t)=>{for(const n of t){const t=n.getKernelObject();let i;if(2===t.wallType.value&&(i=convertToTHREE(t.rightNormal)),1===t.wallType.value&&(i=convertToTHREE(t.leftNormal)),!i)continue;let s=convertToTHREE(n.getPlanElement().getCenter());s=s.applyMatrix4(e.matrixWorldInverse),i=i.transformDirection(e.matrixWorldInverse),s.dot(i)>=0?n.show():n.isSelected||n.hide()}},setWallTransparency=(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},transitionTransparencyOfMaterial=(e,t)=>{e.traverse(e=>{if(e instanceof THREE.Mesh&&TWEEN){const n=e.material;e.userData.tween&&e.userData.tween.stop();const i={opacity:n.opacity};t.transparent&&(n.transparent=t.transparent),e.userData.tween=new TWEEN.Tween(i).to(t,250).easing(TWEEN.Easing.Linear.None).onUpdate(()=>{n.opacity=i.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()}})},fadeIn=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},i={opacity:t.opacity,transparent:t.transparent};t.transparent=n.transparent,t.opacity=n.opacity,new TWEEN.Tween(n).to(i,500).easing(TWEEN.Easing.Linear.None).onUpdate(()=>{t.opacity=n.opacity}).onComplete(()=>{t.transparent=i.transparent}).start()}})},dispose=e=>{"Mesh"===e.type?disposeMesh(e):disposeObject(e)},disposeObject=e=>{e&&e.children&&0!==e.children.length&&e.children.forEach(e=>{disposeMesh(e)})},disposeMesh=e=>{e&&(e.material&&disposeMaterial(e.material),e.geometry&&disposeGeometry(e.geometry),e.children&&e.children.length>0&&disposeObject(e))},disposeGeometry=e=>{e&&e.dispose()},disposeMaterial=e=>{e&&(e.map&&e.map.dispose(),e.normalMap&&e.normalMap.dispose(),e.dispose())};let boundingBoxMaterial;const vectorIsZero=e=>0===e.x&&0===e.y&&0===e.z,getMaterialId=(e,t)=>{let n="";return e||""===e?(e.materialId&&""!==e.materialId?n=e.materialId:e.catalogItemId&&""!==e.catalogItemId?n=e.catalogItemId:e.rgbValue>0?n="rgb"+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):null},vectorIsEqual=(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,getYRotationOfObject=e=>{let t=e.getWorldDirection(new THREE.Vector3).clone();t.y=0,t.lengthSq()<.01&&(t=new THREE.Vector3(0,1,0),t.applyQuaternion(e.quaternion),t.y=0),t.normalize();let n=Math.asin(t.x);return t.z<0&&(n=Math.PI-n),n<0&&(n+=2*Math.PI),n},compareBox3Size=(e,t)=>{if(!e||!t)return 0;const n=e.clone().expandByScalar(.001).containsBox(t),i=t.clone().expandByScalar(.001).containsBox(e);return i&&n||!i&&!n?0:!0===n?1:-1},getDrawingMinBounds=(e,t,n)=>{const i=t>n,s=i?15:0,o=i?0:10,r=e.getSize(new THREE.Vector3),a=e.getCenter(new THREE.Vector3),l=r.x>2*s?r.x/2:s,c=r.z>2*o?r.z/2:o;return new THREE.Box3(new THREE.Vector3(a.x-l,a.y,a.z-c),new THREE.Vector3(a.x+l,a.y,a.z+c))},threeVectorToTransferableXY=e=>{const{x:t,y:n}=e;return{x:t,y:n}},threeVectorToTransferableXYZ=e=>{const{x:t,y:n,z:i}=e;return{x:t,y:n,z:i}},dashCase=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 inject(e,t){const n=Symbol("property-cache");Object.defineProperty(e,t,{get(){if(!this[n]){const e=window.__RML__DI__.lookup(dashCase(t),this._creator_);e?this[n]=e:console.error("Dependency "+dashCase(t)+" not found! Add dependency to /utils/injectables.ts")}return this[n]}})}class EnvironmentLoader{static setEnvironmentMap(e,t){e&&t&&(e.envMap=t,e.envMapIntensity=1,e.needsUpdate=!0)}constructor(e){this._hdrCubeUrl="static/roomle-91862a5e7f3f46e5.envmap",this._hdrCubeUrlLowres="static/roomle64-adb0f447a54b5143.envmap",this._envMapReader=new EnvMapReader,this._onEnvMapUpdate=[],this._creator_=e;const t=new THREE.Color("#DDDDDD");this._environmentMap=((e,t,n,i)=>{const s=new THREE.CubeTexture;s.format=THREE.RGBAFormat,s.generateMipmaps=!1;for(let i=0;i<6;++i){const o=createColorTexture(e,t,n,1);o.format=s.format,o.type=s.type,o.minFilter=s.minFilter,o.magFilter=s.magFilter,o.generateMipmaps=s.generateMipmaps,o.needsUpdate=!0,s.images[i]=o}return s.needsUpdate=!0,s})(t.r,t.g,t.b),this._envMapReader.setPath(getAssetPath()),this._loadHDREnvMap(this._hdrCubeUrlLowres)}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 i=this._renderer.extensions.get("EXT_shader_texture_lod");this._environmentMap=i?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(e=>{e instanceof THREE.Mesh&&(e.material instanceof THREE.MeshStandardMaterial||"MeshPhysicalMaterial"===e.material.type)&&EnvironmentLoader.setEnvironmentMap(e.material,this._environmentMap)}),this._onEnvMapUpdate.forEach(e=>e()),this._onEnvMapUpdate=[])}onEnvMapUpdate(e){this._onEnvMapUpdate.push(e)}setEnvMap(e){this._initData.disableEnvMap||EnvironmentLoader.setEnvironmentMap(e,this.getEnvironmentMap())}}__decorate([inject],EnvironmentLoader.prototype,"_initData",void 0);const PREDEFINED_LIGHTSETTING={SOFA:"sofa",SHELF:"shelf",SHELF_FRONT:"shelf_front",BAKED:"baked",CAMERA:"camera",EQUAL:"equal"};class DynamicLightSettingLoader{static createDynamicLightSettingSource(e,t){let n={};if(e)n.url=e;else if(t)switch(t){case PREDEFINED_LIGHTSETTING.SHELF:n.url=getAssetPath()+"static/shelf-2975dd3f2fa9c763.json";break;case PREDEFINED_LIGHTSETTING.SHELF_FRONT:n.url=getAssetPath()+"static/shelf_front-8c9566a4512f0de8.json";break;case PREDEFINED_LIGHTSETTING.SOFA:n.url=getAssetPath()+"static/sofa-997b116bc5f2e92e.json";break;case PREDEFINED_LIGHTSETTING.BAKED:n.url=getAssetPath()+"static/baked-6485a2b1daeb69e8.json";break;case PREDEFINED_LIGHTSETTING.CAMERA:n.url=getAssetPath()+"static/camera-05824b47cdb951e4.json";break;case PREDEFINED_LIGHTSETTING.EQUAL:n.url=getAssetPath()+"static/equal-319f6b83c827913f.json";break;default:n.url=getAssetPath()+"static/camera-05824b47cdb951e4.json"}else n=null;return n}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:i,target:s,width:o,height:r}=e;return t.width=o||.8,t.height=r||.8,t.castShadow=i||!1,t.matrixAutoUpdate=!0,t.intensity=(n||240)/((o||.8)*(r||.8)),t.lookAt(s?new THREE.Vector3(s.x,s.y,s.z):new THREE.Vector3(0,0,0)),t}_parseSpotLight(e){let t=new THREE.SpotLight;this._parseCommon(t,e);let{angle:n,penumbra:i,target:s,castShadow:o}=e;return t.angle=(n||100)*Math.PI/180,t.penumbra=i||.5,t.lookAt(s?new THREE.Vector3(s.x,s.y,s.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=o||!1,t}_parseDirectionalLight(e){let t=new THREE.DirectionalLight;this._parseCommon(t,e);let{target:n,castShadow:i}=e;return t.castShadow=i||!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:i,color:s,position:o,movesWithCamera:r}=t;e.name=n||"",e.intensity=i||1,e.color=new THREE.Color(s||"#ffffff"),e.position.copy(o?new THREE.Vector3(o.x,o.y,o.z):new THREE.Vector3(0,0,0)),e.visible=!0,e.layers.set(1),e.userData.movesWithCamera=r}}const NAMES_FOR_LOCALHOST=["127.0.0.1","localhost","0.0.0.0"],isIdItemId=function(e){return!(!e||"string"!=typeof e||e.split(":").length>2)},getCatalogIdFromItemOrConfigurationId=e=>{if(!e||"string"!=typeof e)return null;const t=e.split(":");return t.length<2?null:t[0]},kernelPartToPriceId=({articleNr:e,componentId:t})=>e&&""!==e?t.split(":")[0]+":"+e:null,wasRequestSuccess=(e,t)=>null!=e?"string"==typeof e?"true"===e:!0===e:("string"==typeof t&&(t=parseInt(t,10)),t>=200&&t<300);class NetworkLayer{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={},n={}){return this._pendingRequests+=1,new Promise((i,s)=>{self.fetch(e,t).then(async function(e){this._nextSlot();const t=!n.checkResponse||!1!==await n.checkResponse(e);if(wasRequestSuccess(e.ok,e.status)&&t)i(...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={},n={}){return this._pendingRequests>=40?new Promise((t,n)=>this._queue.push({request:e,resolve:t,reject:n})):this._fetch(e,t,n)}}class Logger{info(...e){console}log(...e){console}warn(...e){console.warn.apply(console,e)}error(...e){console.warn.apply(console,e)}}class KernelIo extends Logger{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)}}__decorate([inject],KernelIo.prototype,"_globalCallback",void 0);const ASSET_CACHE=new Map,SYNCED_CATALOGS=new Map,SYNCED_FLOORS_TAGS=new Map,SYNCED_TYPE_CHANGE_TAGS=new Map;class DataSyncer{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(()=>{SYNCED_TYPE_CHANGE_TAGS.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&&!SYNCED_FLOORS_TAGS.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(()=>{SYNCED_FLOORS_TAGS.set(e,!0),n()},e=>this._softReject(n,'_syncFloorTag error: "'+e+'"'))})):Promise.resolve()}_syncTypeChangeTag(e){const t=[];return e&&!SYNCED_TYPE_CHANGE_TAGS.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(()=>{SYNCED_FLOORS_TAGS.set(e,!0),n()},e=>this._softReject(n,'_syncTypeChangeTag error: "'+e+'"'))})):Promise.resolve()}getIsCatalogSynced(e){return!!SYNCED_CATALOGS.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(getAssetPath()+"static/asset-loader.worker-d8f85c01953acd85.js"),this._mainThreadToWorker=new MainThreadToWorker(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(()=>{SYNCED_CATALOGS.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 i=0,s=e.length;i<s;i++){const s=e[i];t.forEach(e=>{const t=s[e];t&&n.push(this._preCacheAsset(t))})}return Promise.all(n)}_preCacheAsset(e){return new Promise(t=>{if(ASSET_CACHE.get(e))return t();this._assetUrlToBase64(e).then(n=>{ASSET_CACHE.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:ASSET_CACHE.get(e)||(t?e:null)}setAlwaysUseCache(e){this._alwaysUseCache=e}preFillAssetCache(e,t){ASSET_CACHE.set(e,t)}}__decorate([inject],DataSyncer.prototype,"_rapiAccess",void 0),__decorate([inject],DataSyncer.prototype,"_singlePromiseFactory",void 0),__decorate([inject],DataSyncer.prototype,"_errorHandler",void 0),__decorate([inject],DataSyncer.prototype,"_configuratorUiCallbacks",void 0),__decorate([inject],DataSyncer.prototype,"_initData",void 0);class AsyncGuard{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()}}var GLTF_LOADER_FILE_NAME="static/GLTFLoader-5b296b5fb14cfe1a.js",DRACO_LOADER_FILE_NAME="static/DRACOLoader-5edeeab4a8dbc0bd.js";const DRACO_LIB_FILES={"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"};class StaticItemLoader{constructor(e){if(this._gltfLoaderGuard=new AsyncGuard,this._creator_=e,THREE.GLTFLoader&&THREE.DRACOLoader)this._initLoaders();else{let e=this._scriptLoader.fetch("static/GLTFLoader-5b296b5fb14cfe1a.js",{id:"gltf-loader"}),t=this._scriptLoader.fetch("static/DRACOLoader-5edeeab4a8dbc0bd.js",{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,n)=>{const i=DRACO_LIB_FILES[e];if(!i)throw new Error('Can not load draco dependency "'+e+'" did three.js update DracoLoader lib? Available files'+JSON.stringify(DRACO_LIB_FILES));return t(getAssetPath()+i,n)},this._gltfLoader.setDRACOLoader(e),this._gltfLoaderGuard.resolve(this._gltfLoader)}async loadGLB(e,t,n,i,s,o,r,a){return await this._gltfLoaderGuard.wait(),new Promise((l,c)=>{this._gltfLoader.load(e,e=>{l(this._handleGLTFScene("GLB",e,t,n,i,s,o,r))},e=>{a&&a(e.loaded/e.total)},e=>{c(e)})})}async loadGLTF(e,t,n,i,s,o,r,a){return await this._gltfLoaderGuard.wait(),new Promise((l,c)=>{this._gltfLoader.parse(e,null,e=>{l(this._handleGLTFScene("GLTF",e,t,n,i,s,o,r))},e=>{a&&a(e.loaded/e.total)},e=>{c(e)})})}_handleGLTFScene(e,t,n,i,s,o,r,a){if(!t||!t.scene||!t.scene.children||0===t.scene.children.length)return null;if(n&&t.scene.position.copy(n),i&&(t.scene.rotation.y=i),s){const e=new THREE.Box3;e.setFromObject(t.scene);const{x:n,y:i,z:o}=e.getSize(new THREE.Vector3);let r=new THREE.Vector3(s.x/n,s.y/i,s.z/o);t.scene.scale.copy(r)}return o&&t.scene.scale.multiply(o),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&&r&&r>0){let e=new THREE.Color(r);t.color=e.copyGammaToLinear(e),t.roughness=.5,t.metalness=.1}t.needsUpdate=!0}e.castShadow=!0,e.receiveShadow=!0}}),t.scene}}__decorate([inject],StaticItemLoader.prototype,"_environmentLoader",void 0),__decorate([inject],StaticItemLoader.prototype,"_scriptLoader",void 0);class ThreeLoader{constructor(e){this._jsonLoaded=!1,this._creator_=e}_loadShaders(){return new Promise((e,t)=>{if(this._jsonLoaded)return e();this._networkLayer.fetch(getAssetPath()+"static/shaders-a517109fc4195f66.json",{credentials:"same-origin"}).then(handleJsonResponse,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-750136f8399d9f72.js",{id:"three-lib"}).then(e,t)},t))}}__decorate([inject],ThreeLoader.prototype,"_scriptLoader",void 0),__decorate([inject],ThreeLoader.prototype,"_networkLayer",void 0);class LocalStorageHelper{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",i=5){const s=this.getStore(n),o=s.entries.find(t=>t.id===e);if(o?(o.payload=t,o.date=Date.now()):s.entries.push({id:e,date:Date.now(),payload:t}),s.entries.length>i)for(s.entries.sort((e,t)=>t.date-e.date);s.entries.length>i;)s.entries.pop();this.saveStore(n,s)}getItem(e,t="rml_default"){const n=this.getStore(t).entries.find(t=>t.id===e);return n?n.payload:null}}__decorate([inject],LocalStorageHelper.prototype,"_localStorage",void 0);class DynamicQualitySettingLoader{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)}}}const CAMERA_TYPE={CAMERA_2D:"2D",CAMERA_3D:"3D",CAMERA_FP:"FP"},sanitizedCameraMode=e=>{if(!e)return CAMERA_TYPE.CAMERA_3D;let t=e.toUpperCase();return-1===Object.values(CAMERA_TYPE).indexOf(t)&&(t=CAMERA_TYPE.CAMERA_3D),t};class InitData{constructor(e){this.autoQuality=!0,this.colors=ROOMLE_COLORS,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.featureFlags={pulsePreview:!1},this.mode=CAMERA_TYPE.CAMERA_3D,this.edit=!1,this.moc=!1,this._creator_=e}setOverrides(e){deepMerge(this,e)}}const BROWSER_LANGUAGE_PROPERTY_KEYS_KNOWN=["language","browserLanguage","userLanguage","systemLanguage"],isSafari=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);class GlobalInitData{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=BROWSER_LANGUAGE_PROPERTY_KEYS_KNOWN.length;e<n;e++){const n=t[BROWSER_LANGUAGE_PROPERTY_KEYS_KNOWN[e]];if(n)return n.substr(0,2)}return"en"})()||"en",this.overrideCountry=null,this._creator_=e}setOverrides(e){deepMerge(this,e)}}class UiCallback{_setMute(e){setWriteable(this,"_isMute",!0),this._isMute=e,setWriteable(this,"_isMute",!1)}mute(){this._setMute(!0)}unmute(){this._setMute(!1)}constructor(e){return this._isMute=!1,this.cameraStartsMoving=()=>{},this._creator_=e,setDescriptor(this,"_isMute",{enumerable:!1,writable:!1}),setDescriptor(UiCallback.prototype,"_setMute",{enumerable:!1,writable:!1}),setDescriptor(UiCallback.prototype,"mute",{enumerable:!1,writable:!1}),setDescriptor(UiCallback.prototype,"unmute",{enumerable:!1,writable:!1}),new Proxy(this,this)}get(e,t){return this._isMute&&"function"==typeof this[t]&&"on"===t.substr(0,2)?()=>{}:this[t]}}class GlobalCallback extends UiCallback{constructor(){super(...arguments),this.onNetworkRequest=(e,t,n)=>{},this.onKernelMsg=(e,t,n={})=>{},this.onCheckExternalCache=async(e,t)=>Promise.resolve(null),this.onValidateNetworkResponse=(e,t)=>Promise.resolve(!0)}}const CANVAS_ID={HSC:"rml-configurator",HSP:"rml-hsp",GLB:"rml-glb",RMV:"rml-mv"};class DomHelper{get element(){return this._container}constructor(e){this._creator_=e,this._lifeCycleManager.addEventListener(this)}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;z-index:100; opacity:1;}",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(){}}__decorate([inject],DomHelper.prototype,"_lifeCycleManager",void 0);class ScenePluginDefaultImplementation{constructor(e){this._creator_=e}setScene(e){}setUiScene(e){}updateBounds(e){}clearScene(e,t){}moveCameraEnd(e){}moveCameraStart(e){}needsUiScene(){return!1}}class PluginSystem{constructor(e){this._plugins=[],this._creator_=e}async init(e,t,n){this._scene=e,this._uiScene=t,this._cameraPosition=n;const{bananaForScale:i}=this._initData;i&&await import("./banana-for-scale-7f4886dc.js").then(({default:e})=>this._plugins.push(new e(this._creator_))),this._plugins.forEach(e=>e.setScene(this._scene)),this._plugins.forEach(e=>e.setUiScene(this._uiScene)),this._plugins.forEach(e=>e.updateBounds(this._bounds)),this._plugins.forEach(e=>e.moveCameraEnd(this._cameraPosition))}addPlugin(e){this._plugins.push(e),e.setScene(this._scene),e.setUiScene(this._uiScene),e.updateBounds(this._bounds),e.moveCameraEnd(this._cameraPosition)}updateBounds(e){this._bounds=e,this._plugins.forEach(t=>t.updateBounds(e))}clearScene(e,t){this._plugins.forEach(n=>n.clearScene(e,t))}getActivePlugins(){return this._plugins}getPlugin(e){for(let t of this._plugins)if(t instanceof e)return t;return null}moveCameraEnd(e){this._cameraPosition=e,this._plugins.forEach(t=>t.moveCameraEnd(e))}moveCameraStart(e){this._cameraPosition=e,this._plugins.forEach(t=>t.moveCameraStart(e))}needsUiScene(){return this._plugins.map(e=>e.needsUiScene()).reduce((e,t)=>e||t,!1)}}__decorate([inject],PluginSystem.prototype,"_initData",void 0);class PromiseQueue{constructor(e,t){this._waitingPromises=[],this._finishPromiseExecutor=[],this._errorCallback=()=>{},Promise.allSettled=Promise.allSettled||(e=>Promise.all(e.map(e=>e.then(e=>({status:"fulfilled",value:e})).catch(e=>({status:"rejected",reason:e}))))),e&&this.registerCallback(e),t&&(this._errorCallback=t)}push(e){this._waitingPromises.push(e),Promise.all(this._waitingPromises).then(e=>{e.length===this._waitingPromises.length&&(this._callback&&this._callback(e),this._waitingPromises=[])},this._errorCallback)}finished(e=!1){return new Promise((t,n)=>{this._finishPromiseExecutor.push({resolve:t,reject:n});const i=e?"allSettled":"all";Promise[i](this._waitingPromises).then(e=>{if("allSettled"===i){const t=[];e.forEach(({value:e,status:n})=>{"fulfilled"===n&&t.push(e)}),this._resolveAllExecutors(t)}else this._resolveAllExecutors(e)},e=>{this._rejectAllExecutors(e)})})}registerCallback(e){this._callback=e}unregisterCallback(){this._callback=null}_resolveAllExecutors(e){this._finishPromiseExecutor.forEach(({resolve:t})=>t(e)),this._finishPromiseExecutor=[]}_rejectAllExecutors(e){this._finishPromiseExecutor.forEach(({reject:t})=>t(e)),this._finishPromiseExecutor=[]}clear(){const e=this._waitingPromises.length>0;this._waitingPromises=[],e?this._rejectAllExecutors(new Error("Promise queue has been cleared")):this._resolveAllExecutors([])}get length(){return this._waitingPromises.length}}class MeshGenerator{constructor(e){this.materialQueue=new PromiseQueue,this._geometryComponentMaterialCache=new Map,this._maxAnisotropy=1,this._maxTextures=16,this._textureLoader=new THREE.TextureLoader,this._configuratorPreviewMaterial=new THREE.MeshStandardMaterial({color:"#DDDDDD",transparent:!0,opacity:1,roughness:1,envMap:null}),this._creator_=e,this._previewMaterial=new THREE.MeshStandardMaterial({color:"#DDDDDD",roughness:1,metalness:0}),this._environmentLoader.setEnvMap(this._previewMaterial)}getGeometry(e){return e&&this._cacheHolder.geometryCache.has(e)?this._cacheHolder.geometryCache.get(e):null}_generateGeometry(e,t,n,i,s){let o;return e&&this._cacheHolder.geometryCache.has(e)?o=this._cacheHolder.geometryCache.get(e):(o=new THREE.BufferGeometry,o.setIndex(new THREE.Uint32BufferAttribute(n,1)),o.setAttribute("position",new THREE.Float32BufferAttribute(t,3)),o.setAttribute("normal",new THREE.Float32BufferAttribute(s,3)),o.setAttribute("uv",new THREE.Float32BufferAttribute(i,2)),o.scale(.001,.001,.001),o.rotateX(-Math.PI/2),e&&this._cacheHolder.geometryCache.set(e,o)),o}changeMaterialOfMesh(e,t){e&&t?(e.material=t,e.material.transparent||0===e.material.opacity||e.material.transmission>0?(e.castShadow=!1,e.receiveShadow=!1):(e.castShadow=!0,e.receiveShadow=!0),e.material.needsUpdate=!0,this._materialLoaded&&this._materialLoaded(t)):console.warn("could not assign material to mesh",{mesh:e},{material:t})}_createMaterial(e,t,n,i,s){if(this._cacheHolder.materialCache.has(e))t();else if(e.startsWith("benchmarkMaterial")){let o=createBenchmarkMaterial(e),r=createMaterial(o,this._environmentLoader);this._loadBenchmarkTextures(o,r,i,s).then(t,n)}else this._rapiAccess.getMaterial(e).then(e=>{let o=createMaterial(e,this._environmentLoader);this._loadTextures(e,o,i,s).then(t,n)},n)}_loadBenchmarkTextures(e,t,n=1,i=1){return new Promise((s,o)=>{const r=createBenchmarkTexture(e.id);addTexture(this._dataSyncer.requestAsset(r.image,!0),r,t,this._maxAnisotropy,n/(0===r.mmWidth?1:r.mmWidth),i/(0===r.mmHeight?1:r.mmHeight),this._maxTextures).then(()=>{this._cacheHolder.materialCache.set(e.id,t),s()},o)})}_loadTextures(e,t,n=1,i=1){return new Promise((s,o)=>{if(!e.textures||e.textures&&0===e.textures.length)return this._cacheHolder.materialCache.set(e.id,t),s();this._rapiAccess.getTexturesOf(e).then(r=>{let a=[];r.forEach(e=>{a.push(addTexture(this._dataSyncer.requestAsset(e.image,!0),e,t,this._maxAnisotropy,n/(0===e.mmWidth?1:e.mmWidth),i/(0===e.mmHeight?1:e.mmHeight),this._maxTextures))}),Promise.all(a).then(()=>{this._cacheHolder.materialCache.set(e.id,t),s()},o)})})}_loadMaterial(e,t,n){return new Promise((i,s)=>{this._singlePromiseFactory.create(6,e,(i,s)=>this._createMaterial(e,i,s,t,n)).then(()=>{setTimeout(()=>i(this._cacheHolder.materialCache.get(e)),0)},s)})}_assignMaterial(e,t){return this._cacheHolder.materialCache.has(t)?(this.changeMaterialOfMesh(e,this._cacheHolder.materialCache.get(t)),Promise.resolve()):new Promise((n,i)=>{this._loadMaterial(t).then(i=>{e.userData.materialId===t&&this.changeMaterialOfMesh(e,i),n()},i)})}get maxAnisotropy(){return this._maxAnisotropy}set maxAnisotropy(e){this._maxAnisotropy=e}get maxTextures(){return this._maxTextures}set maxTextures(e){this._maxTextures=e}clear(){this._cacheHolder.clear()}_assignRGB(e,t){return new Promise(n=>{let i,s="rgb"+JSON.stringify(t);this._cacheHolder.materialCache.has(s)?i=this._cacheHolder.materialCache.get(s):(i=new THREE.MeshStandardMaterial({color:t}),this._environmentLoader.setEnvMap(i),this._cacheHolder.materialCache.set(s,i)),this.changeMaterialOfMesh(e,i),setTimeout(()=>n(),0)})}_assignItem(e,t){return new Promise((n,i)=>{if(this._cacheHolder.materialCache.has(t))return this.changeMaterialOfMesh(e,this._cacheHolder.materialCache.get(t)),void n();this._rapiAccess.getItem(t).then(s=>{if(s.topImage)this._textureLoader.load(s.topImage,i=>{i.anisotropy=this._maxAnisotropy,i.wrapS=THREE.RepeatWrapping,i.wrapT=THREE.RepeatWrapping;let o=new THREE.Vector2(1,1);s.width>0&&(o.x=1/s.width),s.depth>0&&(o.y=1/s.depth),i.repeat.set(o.x,o.y);const r=new THREE.MeshPhysicalMaterial({map:i,roughness:.5,metalness:.1});this._environmentLoader.setEnvMap(r),this._cacheHolder.materialCache.set(t,r),this.changeMaterialOfMesh(e,r),setTimeout(()=>n(),0)});else{const e="can not set material, catalog item top image is not set";console.warn(e),i(e)}},i)})}setMaterialLoadedListener(e){this._materialLoaded=e}removeMaterialLoadedListener(){this._materialLoaded=void 0}_createMesh(e,t,n){if(e&&t){const i=this._getComponentMeshId(e,t);if(this._geometryComponentMaterialCache.has(i)){const e=this._geometryComponentMaterialCache.get(i);if(this._cacheHolder.materialCache.has(e)){const t=this._cacheHolder.materialCache.get(e);return new THREE.Mesh(n,t)}}}return new THREE.Mesh(n,this._configuratorPreviewMaterial.clone())}_getComponentMeshId(e,t){return e+"_"+t}}__decorate([inject],MeshGenerator.prototype,"_rapiAccess",void 0),__decorate([inject],MeshGenerator.prototype,"_environmentLoader",void 0),__decorate([inject],MeshGenerator.prototype,"_dataSyncer",void 0),__decorate([inject],MeshGenerator.prototype,"_singlePromiseFactory",void 0),__decorate([inject],MeshGenerator.prototype,"_cacheHolder",void 0),__decorate([inject],MeshGenerator.prototype,"_plannerMeshGenerator",void 0);class ConfiguratorMeshGenerator extends MeshGenerator{constructor(e){super(e),this._environmentLoader.setEnvMap(this._configuratorPreviewMaterial)}generateMesh(e=0,t=null,n,i,s,o,r,a=!1){let l;l=a?this._generateGeometry(t,i,s,o,r).clone():this._generateGeometry(t,i,s,o,r);const c=this._createMesh(e,t,l);return c.userData.materialId=n,c.layers.set(4),n&&this.materialQueue.push(this._assignMaterial(c,n).then(()=>{e&&t&&this._geometryComponentMaterialCache.set(this._getComponentMeshId(e,t),n)})),c}setMaterial(e,t,n){return this._assignMaterial(e,t)}loadMaterial(e,t,n){return super._loadMaterial(e,t,n)}loadTextures(e,t,n,i){return super._loadTextures(e,t,n,i)}}class EventDispatcher{constructor(){this._listeners={},this._disabled=!1}_addEventListener(e,t,n){this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push({callback:t,scope:n})}addEventListener(e,t,n){this._addEventListener(e,t,n)}dispatchEvent(e,t){if(!this._listeners[e]||this._disabled)return;const n=this._listeners[e];let i=n.length;for(let e=0;e<i;e++){const i=n[e];t?i.callback.apply(i.scope,[t]):i.callback.call(i.scope)}}removeEventListener(e,t){const n=this._listeners[e];if(n)for(let e=0,i=n.length;e<i;e++)if(n[e].callback===t)return void n.splice(e,1)}enableEvents(){this._disabled=!1}disableEvents(){this._disabled=!0}}const BROWSER_EVENTS={SCROLL:"scroll",MOUSE_MOVE:"mousemove",MOUSE_DOWN:"mousedown",MOUSE_UP:"mouseup",MOUSE_LEAVE:"mouseleave",MOUSE_ENTER:"mouseenter",MOUSE_WHEEL:"wheel",TOUCH_MOVE:"touchmove",TOUCH_START:"touchstart",TOUCH_END:"touchend",CONTEXT_MENU:"contextmenu",DOUBLE_CLICK:"dblclick"};class InputEvent{constructor(e,t,n,i,s){this.position=e,this.positionRelative=t,this.type=n,this.rotation=i,this.event=s}}const MIN_MOVE_DISTANCE=5*window.devicePixelRatio,MIN_DOLLY_DISTANCE=3*window.devicePixelRatio;class InputManager extends EventDispatcher{constructor(e){super(),this._elementHit=!1,this._delta=-1,this._state=0,this._pinchDistance=-1,this._rotationAngle=-1,this._lastMouseWheelEvent=null,this._lastTouchEvent=null,this._events=Object.keys(BROWSER_EVENTS).map(e=>BROWSER_EVENTS[e]),this._boundingClientRectInvalid=!0,this._creator_=e,this._downPosition={x:0,y:0},this._downPositionRelative={x:0,y:0},this._boundingClientRect=this._getBoundingClientRect()}enableDragIn(e){this._setState(1),this._dragEnabled=!0,e&&(this._dragMV=this._dragM.bind(this),this._dragEV=this._dragE.bind(this),this._dragTarget=e.currentTarget||e.target,this._delta=-1,this._dragMVName="drag",this._dragEVName="dragend",window.TouchEvent&&e instanceof TouchEvent?(this._dragMVName="touchmove",this._dragEVName="touchend"):e.dataTransfer&&e.dataTransfer.setData&&e.dataTransfer.setData("text/plain"," "),this._firefoxDragPosition={x:0,y:0},document.ondragover=e=>{e=e||window.event,this._firefoxDragPosition.x=e.pageX,this._firefoxDragPosition.y=e.pageY},this._dragTarget.addEventListener(this._dragMVName,this._dragMV,!1),this._dragTarget.addEventListener(this._dragEVName,this._dragEV,!1))}_dragM(e){let t=e,n=null,i=null;window.TouchEvent&&e instanceof TouchEvent?(n=this._getTouchPosition(t),i=this._getTouchPositionRelative(t)):(n=this._getMousePosition(t),i=this._getMousePositionRelative(t)),n.x>0&&n.y>0&&this._move(n,i)}_dragE(e){let t=e;document.ondragover=null,this._firefoxDragPosition=null,this._dragTarget.removeEventListener(this._dragMVName,this._dragMV),this._dragTarget.removeEventListener(this._dragEVName,this._dragEV),window.TouchEvent&&e instanceof TouchEvent?this._onUp(this._getTouchPosition(t),this._getTouchPositionRelative(t),2):this._onUp(this._getMousePosition(t),this._getMousePositionRelative(t),1)}addEvents(e){this._events.forEach(t=>e.addEventListener(t,this,!1)),null===window||void 0===window||window.addEventListener("scroll",this,!1)}removeEvents(e){this._events.forEach(t=>e.removeEventListener(t,this,!1)),null===window||void 0===window||window.removeEventListener("scroll",this,!1)}_move2(e){if(this._lastTouchEvent&&e.timeStamp-this._lastTouchEvent.timeStamp<16)return;const t=e.touches[0],n=e.touches[1],i=t.pageX-n.pageX,s=t.pageY-n.pageY,o=Math.abs(i)+Math.abs(s);this._pinchDistance>-1&&(o>this._pinchDistance+MIN_DOLLY_DISTANCE?(this._setState(3),this.dispatchEvent(7,new InputEvent(this._getTouchPosition(e),this._getTouchPositionRelative(e)))):o<this._pinchDistance-MIN_DOLLY_DISTANCE?(this._setState(3),this.dispatchEvent(8,new InputEvent(this._getTouchPosition(e),this._getTouchPositionRelative(e)))):o<=this._pinchDistance+MIN_DOLLY_DISTANCE&&o>=this._pinchDistance-MIN_DOLLY_DISTANCE&&(this._setState(5),this.dispatchEvent(11,new InputEvent(this._getTouchPosition(e),this._getTouchPositionRelative(e))))),this._pinchDistance=o,this._lastTouchEvent=e}_setState(e){this._state=e}_move(e,t,n,i){void 0===n&&(n=0),void 0===this._dragEnabled&&(this._dragEnabled=!1),1===this._state&&this._canDrag(n)&&(this._delta=this._getDelta(e),(this._delta>MIN_MOVE_DISTANCE||this._elementHit)&&(this._setState(2),this._longClickTimer&&clearTimeout(this._longClickTimer),this.dispatchEvent(0,new InputEvent(this._downPosition,this._downPositionRelative)))),2===this._state&&this.dispatchEvent(1,new InputEvent(e,t)),this.dispatchEvent(6,new InputEvent(e,t,n,null,i))}_longClick(e){2!==e&&(this._setState(2),this._longClickTimer&&clearTimeout(this._longClickTimer),this.dispatchEvent(0,new InputEvent(this._downPosition,this._downPositionRelative)),this.dispatchEvent(1,new InputEvent(this._downPosition,this._downPositionRelative))),this.dispatchEvent(14,new InputEvent(this._downPosition,this._downPositionRelative,2))}_onUp(e,t,n){this.dispatchEvent(4,new InputEvent(e,t,n)),this._getDelta(e)<=MIN_MOVE_DISTANCE&&this.dispatchEvent(5,new InputEvent(e,t)),2===this._state&&this.dispatchEvent(2,new InputEvent(e,t)),4===this._state&&(this.dispatchEvent(10,new InputEvent(e,t)),this._rotationAngle=-1),3===this._state&&(this._pinchDistance=-1),this._lastTouchEvent=null,this._setState(0),this._dragTarget=null,this._elementHit=!1,this._longClickTimer&&clearTimeout(this._longClickTimer)}_getTouchPosition(e){if(e.touches.length){let{clientX:t,clientY:n}=e.touches[0];if(e.touches.length>1){const i=e.touches[1],s=i.clientX,o=i.clientY;t=(t+s)/2,n=(n+o)/2}return{x:t,y:n}}const t=e.changedTouches[0];return{x:t.clientX,y:t.clientY}}_getTouchPositionRelative(e){const t=this._getBoundingClientRect(),{clientWidth:n,clientHeight:i}=this._domHelper.element;if(e.touches.length){const{clientX:s,clientY:o}=e.touches[0];return{x:(s-t.left)/n*2-1,y:-(o-t.top)/i*2+1}}const s=e.changedTouches[0];return{x:(s.clientX-t.left)/n*2-1,y:-(s.clientY-t.top)/i*2+1}}_getMousePosition(e){if(0!==e.clientX&&0!==e.clientY)return{x:e.clientX,y:e.clientY};{let{x:t,y:n}=this._getFireFoxMousePosition(e);return{x:t,y:n}}}_getFireFoxMousePosition(e){let{x:t,y:n}=this._domHelper.getClientDimensions();return{x:t-(t+e.offsetX),y:n-(n+e.offsetY)}}_getMousePositionRelative(e){const t=this._getBoundingClientRect();return 0!==e.clientX&&0!==e.clientY?{x:(e.clientX-t.left)/this._domHelper.element.clientWidth*2-1,y:-(e.clientY-t.top)/this._domHelper.element.clientHeight*2+1}:this._firefoxDragPosition&&0!==this._firefoxDragPosition.x&&0!==this._firefoxDragPosition.y?{x:(this._firefoxDragPosition.x-t.left)/this._domHelper.element.clientWidth*2-1,y:-(this._firefoxDragPosition.y-t.top)/this._domHelper.element.clientHeight*2+1}:{x:0,y:0}}_getDelta(e){return Math.abs(this._downPosition.y-e.y)+Math.abs(this._downPosition.x-e.x)}setDragEnabled(e){this._dragEnabled=e}handleEvent(e){switch(e.type){case BROWSER_EVENTS.SCROLL:this._boundingClientRectInvalid=!0;break;case BROWSER_EVENTS.MOUSE_MOVE:this._onMouseMove(e);break;case BROWSER_EVENTS.DOUBLE_CLICK:this._onDoubleClick(e);break;case BROWSER_EVENTS.MOUSE_DOWN:this._onMouseDown(e);break;case BROWSER_EVENTS.MOUSE_UP:this._onMouseUp(e);break;case BROWSER_EVENTS.MOUSE_LEAVE:this._onMouseLeave(e);break;case BROWSER_EVENTS.MOUSE_ENTER:this._onMouseEnter(e);break;case BROWSER_EVENTS.MOUSE_WHEEL:this._onMouseWheel(e);break;case BROWSER_EVENTS.TOUCH_MOVE:this._onTouchMove(e);break;case BROWSER_EVENTS.TOUCH_START:this._onTouchStart(e);break;case BROWSER_EVENTS.TOUCH_END:this._onTouchEnd(e);break;case BROWSER_EVENTS.CONTEXT_MENU:this._onContextMenu(e)}}_onMouseDown(e){if(e.preventDefault(),2===e.detail)return;let{x:t,y:n}=this._getMousePosition(e);this._downPosition={x:t,y:n},this._downPositionRelative=this._getMousePositionRelative(e),this.dispatchEvent(3,new InputEvent({x:t,y:n},this._downPositionRelative,1)),this._setState(1)}_onMouseUp(e){e.preventDefault(),2!==e.detail&&this._onUp(this._getMousePosition(e),this._getMousePositionRelative(e),1)}_onMouseMove(e){e.preventDefault(),this._move(this._getMousePosition(e),this._getMousePositionRelative(e),1,e)}_onDoubleClick(e){e.preventDefault(),this.dispatchEvent(12,new InputEvent(this._getMousePosition(e),this._getMousePositionRelative(e),1))}_onMouseLeave(e){var t;this._delta=-1,(null===(t=e.relatedTarget)||void 0===t?void 0:t.closest('[data-rml-sdk="ignore-mouse-leave"]'))||this._onMouseUp(e)}_onMouseEnter(e){e.preventDefault()}_onMouseWheel(e){if(this._lastMouseWheelEvent&&e.timeStamp-this._lastMouseWheelEvent.timeStamp<40)return e.preventDefault(),void e.stopPropagation();e.deltaY<0?this.dispatchEvent(7,new InputEvent(this._getMousePosition(e),this._getMousePositionRelative(e),1,0,e)):this.dispatchEvent(8,new InputEvent(this._getMousePosition(e),this._getMousePositionRelative(e),1,0,e)),this._lastMouseWheelEvent=e}_onTouchMove(e){if(e.preventDefault(),!this._dragTarget)if(1===e.touches.length)this._move(this._getTouchPosition(e),this._getTouchPositionRelative(e),2);else if(2===e.touches.length)if(this._elementHit||4===this._state){const i=e.touches[0],s=e.touches[1],o=function(e){let t=toDegrees(e);return t<0&&(t=180+(180+t)),t}((t={x:i.pageX,y:i.pageY},n={x:s.pageX,y:s.pageY},Math.atan2(n.y-t.y,n.x-t.x)));this._rotationAngle<0&&(this._rotationAngle=o);const r=o-this._rotationAngle;this._rotationAngle=o,this.dispatchEvent(9,new InputEvent(this._getTouchPosition(e),this._getTouchPositionRelative(e),2,toRadiant(r))),this._setState(4)}else this._move2(e);var t,n}_onTouchStart(e){if(e.preventDefault(),1===e.touches.length){let{x:t,y:n}=this._getTouchPosition(e);this._downPosition={x:t,y:n},this._downPositionRelative=this._getTouchPositionRelative(e),this.dispatchEvent(3,new InputEvent({x:t,y:n},this._downPositionRelative,2)),this._setState(1),this._longClickTimer=window.setTimeout(this._longClick.bind(this,2),350)}else 2===e.touches.length&&(1!==this._state&&2!==this._state||this._onUp(this._getTouchPosition(e),this._getTouchPositionRelative(e),2),this._setState(3))}_onTouchEnd(e){e.preventDefault(),e.touches.length>1&&5===this._state||3===this._state||(this.dispatchEvent(13,new InputEvent(this._getTouchPosition(e),this._getTouchPositionRelative(e),2)),this._onUp(this._getTouchPosition(e),this._getTouchPositionRelative(e),2))}_onContextMenu(e){e.preventDefault()}_canDrag(e){return this._dragEnabled}onElementHit(){this._elementHit=!0}_getBoundingClientRect(){return this._boundingClientRectInvalid&&(this._boundingClientRect=this._domHelper.element.getBoundingClientRect(),this._boundingClientRectInvalid=!1),this._boundingClientRect}updateSize(){this._boundingClientRectInvalid=!0}}__decorate([inject],InputManager.prototype,"_domHelper",void 0);class SelectionHandlerEvent{constructor(e){const{component:t,resetCamera:n,consecutive:i}=e;this.component=t,this.resetCamera=void 0===n||n,this.consecutive=void 0===i||i}}const PROMISE_CALLBACKS=new Map,RESOURCES=new Map;class AsyncDependencyLoader{static loadFont(e){if(RESOURCES.has(e))return new Promise(t=>{t(RESOURCES.get(e))});if(PROMISE_CALLBACKS.has(e))return new Promise((t,n)=>{PROMISE_CALLBACKS.get(e).push({resolve:t,reject:n})});let t=new THREE.FontLoader;return new Promise((n,i)=>{PROMISE_CALLBACKS.set(e,[{resolve:n,reject:i}]),t.load(getAssetPath()+e,t=>{RESOURCES.set(e,t),AsyncDependencyLoader._resolveAll(e,t)})})}static _resolveAll(e,t){PROMISE_CALLBACKS.has(e)&&PROMISE_CALLBACKS.get(e).forEach(e=>e.resolve(t)),PROMISE_CALLBACKS.delete(e)}}class ComponentDimensioningHelper{constructor(e){this._activeComponents=[],this._componentDimensioningsExist=new Map,this._creator_=e}setCamera(e){this._camera=e}add(e){if(this._componentDimensioningsExist.has(e.runtimeId)&&!this._componentDimensioningsExist.get(e.runtimeId))return!1;const t=this._plannerKernelAccess.kernelInstance.getComponent(e.runtimeId),n=t.dimensionings;if(this._componentDimensioningsExist.set(e.runtimeId,n.length>0),!n||0===n.length||this._camera.position.z<0)return!1;const i=kernelBoxToThreeBox(t.boxForMeasurement),s={x:this._camera.position.x,y:this._camera.position.z};return import("./component-dimensioning-9246c6cc.js").then(t=>{AsyncDependencyLoader.loadFont("static/rubik_regular-bc008a7de2daee79.json").then(o=>{n.forEach(n=>{var r;e.add(new t.default(((r=n).from=r.from/1e3,r.to=r.to/1e3,1===r.type.value?(r.type={value:2},r.from*=-1,r.to*=-1):2===r.type.value&&(r.type={value:1}),r),i,o,s))})})}),this._activeComponents.push(e),!0}remove(e,t=!0){return new Promise(n=>{import("./component-dimensioning-9246c6cc.js").then(i=>{let s=[];e.children.forEach(e=>{e instanceof i.default&&s.push(e)}),s.forEach(t=>{e.remove(t),dispose(t)}),t&&removeItem(this._activeComponents,e),n()})})}hasComponentDimensions(){return this._activeComponents.length>0}async reset(){for(const e of this._activeComponents)await this.remove(e);this._activeComponents=[]}invalidateDimensioningsCache(e){e?this._componentDimensioningsExist.delete(e):this._componentDimensioningsExist.clear()}}__decorate([inject],ComponentDimensioningHelper.prototype,"_plannerKernelAccess",void 0);class Waiter{constructor(){this._promiseExecutors=[]}create(){return new Promise((e,t)=>{this._promiseExecutors.push({resolve:e,reject:t})})}resolve(e){return new Promise(t=>{this._promiseExecutors.forEach(t=>t.resolve(e)),this._promiseExecutors=[],t(e)})}reject(e){return new Promise((t,n)=>{this._promiseExecutors.forEach(t=>t.reject(e)),this._promiseExecutors=[],n(e)})}}class PlanElementViewModel extends class{constructor(e){this._coreReference=e.clone()}clearReference(){this._coreReference.delete(),this._coreReference=null}getKernelObject(){return this._coreReference}}{constructor(e){super(e),this._objectWaiter=new Waiter;const t=convertToTHREE(e.getCenter());this._container=new THREE.Object3D,this._container.position.copy(t),this._boundingBox=this._generateBoundingBox(),fadeIn(this._boundingBox),this._container.add(this._boundingBox),2!==this.getPlanElement().getType().value&&(this._object=new THREE.Object3D,this._container.add(this._object))}getSize(){return this._object?(new THREE.Box3).setFromObject(this._object).getSize(new THREE.Vector3):new THREE.Vector3}update(){this._container.position.copy(convertToTHREE(this.getPlanElement().getCenter())),this._boundingBox&&this._updateBoundingBox()}_updateBoundingBox(){const e=this.getSize();this._boundingBox.geometry=new THREE.BoxGeometry(e.x,e.y,e.z),this._boundingBox.position.y=e.y/2}getPosition(){return this._container.position}getRotation(){return this._container.rotation.y}getBounds(){let e;return this.getPlanElement().boxForMeasurement?(e=kernelBoxToThreeBox(this.getPlanElement().boxForMeasurement),e.applyMatrix4(this.getContainer().matrix)):(e=new THREE.Box3,e.setFromObject(this._container)),e}getBoundingBox(){return this._boundingBox}getPlanElement(){return this._coreReference}setObject(e){this._object=e,this._objectWaiter.resolve(e)}getObject(){return this._object}async getObjectAsync(){return this._object?Promise.resolve(this._object):this._objectWaiter.create()}addMesh(e){this._object.add(e),this.hidePreviewBox()}getMesh(e){if(!this._object||0===this._object.children.length)return null;const t=getMaterialId(e,this.getPlanElement().getType());return this._object.children.find(e=>e.userData.material===t)}getContainer(){return this._container}getId(){return this.getPlanElement().getId()}clear(){dispose(this._container),this._selectionMesh&&dispose(this._selectionMesh)}remove(){var e;null===(e=this._container.parent)||void 0===e||e.remove(this._container),this.clear()}hidePreviewBox(){this._container&&this._boundingBox&&(this._boundingBox.material=(boundingBoxMaterial||(boundingBoxMaterial=new THREE.MeshBasicMaterial,boundingBoxMaterial.visible=!1),boundingBoxMaterial))}_generateBoundingBox(){const e=this.getSize(),t=new THREE.BoxGeometry(e.x,e.y,e.z);let n=new THREE.Color("#DDDDDD");const i=this.getPlanElement().customColor;i>0&&(n=(e=>{let t=new THREE.Color;return t.setRGB((e>>16)/255,(e>>8&255)/255,(e>>0&255)/255),t})(i));let s=new THREE.MeshStandardMaterial({color:n,opacity:1,transparent:!0}),o=new THREE.Mesh(t,s);return o.name="bounding box",o.position.y=e.y/2,o.castShadow=!1,o.receiveShadow=!1,o.layers.set(6),o}select(){this._isSelected=!0,this._selectionMesh&&this._container.add(this._selectionMesh)}deselect(){this._isSelected=!1,this._selectionMesh&&this._container.remove(this._selectionMesh)}hoverOn(){}hoverOff(){}setPrimaryColor(e){this._primaryColor=e}}class PlanObjectViewModel extends PlanElementViewModel{constructor(e){super(e),this._initDone=!1,this._initFailed=null,this._initWaiter=new Waiter,this._container.rotation.y=e.rotation}finishInit(){return this._initDone=!0,this._initFailed=null,this._initWaiter.resolve()}failInit(e){return this._initFailed=e,this._initDone=!1,this._initWaiter.reject(this._initFailed)}isInitDone(){return this._initDone?Promise.resolve():this._initFailed?Promise.reject(this._initFailed):this._initWaiter.create()}getPlanObject(){return this.getPlanElement()}getSize(){return convertToThreeDimensions(this.getPlanObject().size)}update(){super.update(),this._container.rotation.y=this.getPlanObject().rotation}}class ConfiguratorPlanObjectViewModel extends PlanObjectViewModel{constructor(e){super(e),this._container.name="Configurable "+this._container.name}addRootComponent(e){this.setObject(e),this._rootComponentId=e.id,this._rootComponentRuntimeId=e.runtimeId,this._container.add(this.getObject())}getConfigurationRuntimeId(){return this.getPlanObject().getConfigurationRuntimeId()}getRootComponentId(){return this._rootComponentId}getRootComponentRuntimeId(){return this._rootComponentRuntimeId}finishConstruction(){return this.finishInit()}failConstruction(){return this.failInit(new Error("Construction of configuration failed"))}}var defaultSettings={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(defaultSettings));e.APP,e.features}}();var Env=JSON.parse(JSON.stringify(defaultSettings));class StaticPlanObjectViewModel extends PlanObjectViewModel{constructor(e){super(e),this._container.name="Static "+this._container.name}setRapiItem(e){return this._rapiItem?Promise.resolve():this._addStaticItem(e)}async _addStaticItem(e){this._rapiItem=e;let t=this.getPlanObject();if(this._glbUrl=getGlbUrl(e),!this._glbUrl)return Promise.reject("No glb url found");let n=e.scaleable?convertToThreeDimensions(t.size):void 0,i=new THREE.Vector3(1,1,1);t.flipX&&(i.x*=-1),t.flipY&&(i.z*=-1);try{const s=await this._staticItemLoader.loadGLB(this._glbUrl,void 0,void 0,n,i,t.customColor,e.colorable);s.name=e.label,this.setObject(s),((e,t)=>{let n=(new THREE.Box3).setFromObject(e),i=n.getSize(new THREE.Vector3),s=Math.min(i.x,i.y,i.z),o=!0;s>5&&(console.warn("GLB seems to be too big ("+s+")",t),o=!1),n.min.y<-.01&&(console.warn("GLB seems to be under the floor ("+n.min.y+"): ",t),o=!1)})(s,this._glbUrl),fadeIn(s),this._container.add(this.getObject()),this.hidePreviewBox(),await this.finishInit()}catch(e){await this.failInit(e)}}getRapiItem(){return this._rapiItem}needsRapiItem(){return!this._glbUrl}getGLBUrl(){return this._glbUrl}}__decorate([inject],StaticPlanObjectViewModel.prototype,"_staticItemLoader",void 0);const wallDimensionToTransferable=e=>{const{id:t,textRotation:n,length:i,lengthFormatted:s}=e;return{id:t,fromPosition3d:threeVectorToTransferableXYZ(e.fromPosition3d),toPosition3d:threeVectorToTransferableXYZ(e.toPosition3d),textPosition3d:threeVectorToTransferableXYZ(e.textPosition3d),fromPosition2d:threeVectorToTransferableXY(e.fromPosition2d),toPosition2d:threeVectorToTransferableXY(e.toPosition2d),textPosition2d:threeVectorToTransferableXY(e.textPosition2d),textDirection:threeVectorToTransferableXYZ(e.textDirection),textRotation:n,length:i,lengthFormatted:s}};let WALL_TOP_VIEW_MATERIAL;const getTopViewMaterial=()=>(WALL_TOP_VIEW_MATERIAL||(WALL_TOP_VIEW_MATERIAL=new THREE.MeshPhysicalMaterial({color:0})),WALL_TOP_VIEW_MATERIAL);class WallPlanElementViewModel extends PlanElementViewModel{constructor(e){super(e),this._topView=!1,this._container.name="Wall Plan Element"}get isSelected(){return this._isSelected}getWallDimension(e=.2){const t=this.getPlanElement(),n=convertToTHREE(t.getCenter()),i=t.getPreferredSide();let s,o;0===i?(s=convertToTHREE(t.getCornerFromLeft()),o=convertToTHREE(t.getCornerToLeft())):(s=convertToTHREE(t.getCornerFromRight()),o=convertToTHREE(t.getCornerToRight()));const r=s.clone().add(o).divideScalar(2),a=s.clone().sub(o),l=a.clone().cross(new THREE.Vector3(0,1,0)).normalize();l.clone().dot(r.clone().sub(n))<0&&l.multiplyScalar(-1);const c=l.multiplyScalar(e),h=s.add(c),d=o.add(c),_=a.clone();a.dot(new THREE.Vector3(1,0,0))<0&&_.multiplyScalar(-1);const u=Math.atan2(_.z,_.x),p=h.clone().add(d).divideScalar(2);return{id:t.getId(),fromPosition3d:h,toPosition3d:d,textPosition3d:p,textDirection:_,textRotation:u,length:t.getLength(i)}}addMesh(e){e.traverse(e=>{this._setMaterial(e)}),e.layers.set(9),super.addMesh(e);const t=(new THREE.Box3).setFromObject(this.getObject()).getSize(new THREE.Vector3);this._boundingBox.geometry=new THREE.BoxGeometry(t.x,t.y,t.z),this._boundingBox.position.y=t.y/2}show(){var e,t;this.getContainer().visible=!0,null===(e=this.getObject())||void 0===e||e.traverse(e=>{e.layers.set(9)}),null===(t=this.getBoundingBox())||void 0===t||t.layers.set(6)}hide(){var e,t;this.getContainer().visible=!1,null===(e=this.getObject())||void 0===e||e.traverse(e=>{e.layers.disableAll()}),null===(t=this.getBoundingBox())||void 0===t||t.layers.disableAll()}_enableTopView(){this._container.traverse(e=>{this._setTopMaterial(e)})}_setTopMaterial(e){e instanceof THREE.Mesh&&!e.userData.originalMaterial&&e.material&&e!==this._boundingBox&&(e.userData.originalMaterial=e.material,e.material=getTopViewMaterial())}_disableTopView(){this._container.traverse(e=>{e instanceof THREE.Mesh&&e.userData.originalMaterial&&(e.material=e.userData.originalMaterial,delete e.userData.originalMaterial)})}setTopView(e){this._topView=e,this._topView?this._enableTopView():this._disableTopView()}getKernelObject(){return super.getKernelObject()}_setMaterial(e){e instanceof THREE.Mesh&&e.material&&e!==this._boundingBox&&(e.userData.originalMaterial||(e.userData.originalMaterial=e.material),this._topView&&this._isSelected?e.material=new THREE.MeshBasicMaterial({color:10526880,side:THREE.DoubleSide}):this._topView&&!this._isSelected?e.material=getTopViewMaterial():(e.material=e.userData.originalMaterial,delete e.userData.originalMaterial))}select(){super.select(),this._container.traverse(e=>{this._setMaterial(e)})}deselect(){super.deselect(),this._container.traverse(e=>{this._setMaterial(e)})}}class FloorPlanElementViewModel extends PlanElementViewModel{constructor(e){super(e),this._container.name="Floor Plan Element"}addMesh(e){this.getObject().clear(),super.addMesh(e),e.layers.set(9),e.castShadow=!1;const t=(new THREE.Box3).setFromObject(this.getObject()).getSize(new THREE.Vector3);this._boundingBox.geometry=new THREE.BoxGeometry(t.x,.01,t.z)}}class CeilingPlanElementViewModel extends PlanElementViewModel{constructor(e){super(e),this._container.name="Ceiling Plan Element"}addMesh(e){super.addMesh(e),e.castShadow=!1;const t=(new THREE.Box3).setFromObject(this.getObject()).getSize(new THREE.Vector3);this._boundingBox.geometry=new THREE.BoxGeometry(t.x,.01,t.z)}}const META_INFO=new Map;class Benchmark{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 i=t>0?e+"_"+n+t:e,s=i+"_start";return window.performance.mark(s),i}static addMeta(e,t){const n=Benchmark.getMeta(e);META_INFO.set(e,Object.assign(n,t))}static getMeta(e){return META_INFO.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 i=0,s=t.length;i<s;i++){const s=t[i];e&&-1===s.name.indexOf(e)||n.push({Start:parseFloat(s.startTime.toFixed(2)),Name:s.name,Duration:parseFloat(s.duration.toFixed(2))})}console.table(n)}}class AppContext{static init(e={}){const{kernelInstance:t,kernelContainer:n,planObjectId:i}=e;AppContext.kernelInstance=t,AppContext.kernelContainer=n,AppContext.planObjectId=i}static cleanUp(){AppContext.useHDGeometry=!1,AppContext.kernelInstance=null,AppContext.kernelContainer=null,AppContext.planObjectId=null}}AppContext.useHDGeometry=!1,AppContext.kernelInstance=null,AppContext.kernelContainer=null,AppContext.planObjectId=null;const WAITERS=new Map,_endOperation=function(e,t,n){let i=WAITERS.get(e);if(i){const s=n?[n]:void 0;i.forEach(({resolve:e,reject:n})=>t?e.apply(e,s):n.apply(n,s)),WAITERS.delete(e)}};class AsyncHelper{static finishOperation(e,t){_endOperation(e,!0,t)}static failOperation(e,t){_endOperation(e,!1,t)}static waitFor(e,t){return new Promise((n,i)=>{let s=WAITERS.get(e);s||(WAITERS.set(e,[]),s=WAITERS.get(e)),s.push({resolve:n,reject:i}),"function"==typeof t&&t.apply(t)})}}const isRange=function(e){return e.validRange&&"string"==typeof e.validRange.type},isOptions=function(e){return e.validValues&&e.validValues.length>0},isMaterial=function(e){return"Material"===e.type};let MEM_URL,WASM_URL,WASM_LOADER,ASM_LOADER,CACHE_COMPILATION;const KERNEL_PATHS={WASM:{CONFIGURATOR:{URL:"static/ConfiguratorKernel-fa95f23ce304f1db.wasm",LOADER:"static/ConfiguratorKernel-4a120e5209cf1cd0.js"},PLANNER:{URL:"static/RoomleCore-72494809ac9e04bb.wasm",LOADER:"static/RoomleCore-6c1973038e81be15.js"}},ASM:{CONFIGURATOR:{MEM_URL:"static/ConfiguratorKernelJs-b884d72267d0ed0f.mem",LOADER:"static/ConfiguratorKernelJs-843b32f9cf068595.js"},PLANNER:{MEM_URL:"static/RoomleCoreJs-a1ed5d94a85e5ef0.mem",LOADER:"static/RoomleCoreJs-bf2ff14d27bce33b.js"}}},USE_WASM=!!window.WebAssembly;class CommonKernelAccess{_utilityToLongArray(e){const t=new this._kernelContainer.LongArray;return e.forEach(e=>t.push_back(e)),t}constructor(e){this._requestedMaterialIds=[],this._configuratorKernelCallbackListener=new Set,this._cachedGroupIds=[],this._waitingForGroups=!1,this._subComponentsWaiters=new Map,this._shouldWait=!0,this._creator_=e,window.KernelCallback={isReady:this.isReady.bind(this)},this._lifeCycleManager.addEventListener(this)}init(e){this._kernelType=e,this._setupKernelPaths(e),this._setupEmsModule(e),this._useWASM=USE_WASM,this._kernelPath=USE_WASM?WASM_LOADER:ASM_LOADER}_initKernel(){const{unit:e,unitStringType:t}=this._initData;this._kernelInstance.setEnvironmentVariable("unit",e||"cm"),this._kernelInstance.setEnvironmentVariable("unitString",t||"short"),this._kernelInstance.useEnvironmentGeometry(1===this._kernelType);const{overrideCountry:n,locale:i}=this._globalInitData;n&&(this._kernelInstance.resetPriceListIds(),this._kernelInstance.addPriceList(n)),this._kernelInstance.setEnvironmentVariable("language",i)}get kernelContainer(){return this._kernelContainer}get kernelInstance(){return this._kernelInstance}_setupKernelPaths(e){const t=0===e?"PLANNER":"CONFIGURATOR";MEM_URL=KERNEL_PATHS.ASM[t].MEM_URL,WASM_URL=KERNEL_PATHS.WASM[t].URL,WASM_LOADER=KERNEL_PATHS.WASM[t].LOADER,ASM_LOADER=KERNEL_PATHS.ASM[t].LOADER,CACHE_COMPILATION=!0}_setupEmsModule(e){const t=this;this._kernelContainer={locateFile(t){const n=0===e?/RoomleCoreJs[\-a-z0-9]*\.js\.mem/:/ConfiguratorKernelJs[\-a-z0-9]*\.js\.mem/;return t.match(n)?getAssetPath()+MEM_URL:t},wasmBinaryFile:getAssetPath()+WASM_URL,preRun:[],postRun:[],setStatus:null,print(e){t._kernelIo.log(e)},printErr(e){t._kernelIo.error(e)},quit(e){0!==e&&t._kernelIo.throw(e&&e.toString?e.toString():"Unknown error while C/C++ main executes")}},CACHE_COMPILATION&&USE_WASM&&(this._kernelContainer.instantiateWasm=function(e,t){return((e,t,n)=>{const i="function"==typeof WebAssembly.instantiateStreaming;Benchmark.addMeta("kernel_is_ready",{cachedInIndexedDB:!1});let s=null;i?(Benchmark.start("kernel_stream_compile"),s=WebAssembly.instantiateStreaming(fetch(getAssetPath()+e),t),Benchmark.end("kernel_stream_compile")):(Benchmark.start("kernel_legacy_compile"),s=fetch(getAssetPath()+e).then(e=>e.arrayBuffer()).then(e=>WebAssembly.instantiate(e,t))),Benchmark.addMeta("kernel_is_ready",{instantiateStreaming:i}),s.then(e=>{Benchmark.end(i?"kernel_stream_compile":"kernel_legacy_compile"),n(e.instance)},e=>console.error(e))})(WASM_URL,e,t),{}})}_passSubComponentsToKernel(e,t){const n=e.id,i=t.get(n);if(i)for(let t=0,s=i.length;t<s;t++){const{parentId:s,partId:o}=i[t];this._kernelIo.setMeta({componentId:n}),this._kernelInstance.loadedSubComponent(s,o,n,e.configuration)}}_fetchSubComponents(e){let t=[...e.keys()];t.length&&this._rapiAccess.getComponents(t).then(t=>{for(let n=0,i=t.length;n<i;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}),Env.isProduction||Env.isUnitTesting||this.addDebugInfo(),window.KernelCallback&&(window.KernelCallback=null,delete window.KernelCallback),this._unitFormatter.init(this._kernelContainer)}addDebugInfo(){const e=function(t,n=[]){const i=Object.getPrototypeOf(t),s=i?Object.getOwnPropertyNames(i):[],o=t?Object.getOwnPropertyNames(t):[];return i?e(i,[...n,...o,...s]):[...o,...s,...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 i=this.kernelInstance.getPlanObject(e),s=(new Date).toISOString(),o=this.kernelInstance.getComponentId(e),r=getCatalogIdFromItemOrConfigurationId(o),a=(null===(n=i.boxForMeasurement)||void 0===n?void 0:n.size)||i.bounds;t({created:s,lastAccess:s,configuration:this.kernelInstance.getSerializedConfiguration(e),configurationHash:this.kernelInstance.getHashOfConfiguration(e),parts:JSON.stringify(this.kernelInstance.getPartList(e)),rootComponentId:o,width:a.x,height:a.z,depth:a.y,catalog:r,orderable:!1,requestable:!1})})}loadComponent(e,t,n){this._rapiAccess.getComponent(t.componentId).then(i=>{var s;let o=i.configuration;o||(o="error",null===(s=this._configuratorUiCallbacks)||void 0===s||s.onContentProblem({rapiPath:"components",ids:[t.componentId],message:t.componentId+" has no configuration"})),this._kernelIo.setMeta({componentId:t.componentId}),this._kernelInstance.loadComponent(e,o,t,n),this._flushSubComponentsWaiters()},i=>{var s;this._kernelInstance.loadComponent(e,"error",t,n),this.onLoadComponentError(i,t.componentId),null===(s=this._configuratorUiCallbacks)||void 0===s||s.onError(new Error(`Component with id "${t.componentId}" can not be loaded. "${i}"`)),this._flushSubComponentsWaiters()})}loadSubComponent(e,t,n){if(this._shouldWait){let i=this._subComponentsWaiters.get(n);i||this._subComponentsWaiters.set(n,[]),i=this._subComponentsWaiters.get(n),i.push({parentId:e,partId:t}),this._subComponentsWaiters.set(n,i)}else this._rapiAccess.getComponent(n).then(i=>{var s;let o=i.configuration;o||(o="error",null===(s=this._configuratorUiCallbacks)||void 0===s||s.onContentProblem({rapiPath:"components",ids:[n],message:"SubComponent "+n+" has no configuration"})),this._kernelIo.setMeta({componentId:n,parentId:e}),this._kernelInstance.loadedSubComponent(e,t,n,o)})}requestDeleteComponent(e){e&&this._kernelInstance.deleteComponent(e)}dockComponentWithPosition(e,t,n,i,s){var o;this._kernelInstance.dockComponentWithPosition(n,i,e,t,s);const r=this._kernelInstance.getComponentId(n),a=this._kernelInstance.getComponentId(e);null===(o=this._configuratorUiCallbacks)||void 0===o||o.onUserInitiatedDockDone(r,i,a,t,s)}Editor3dAddBakedMesh(e,t,n,i,s,o,r){this._configuratorKernelCallbackListener.forEach(a=>a.Editor3dAddBakedMesh(e,t,n,i,s,o,r))}Editor3dAddNamedMesh(e,t,n,i,s,o,r,a,l,c,h){this._configuratorKernelCallbackListener.forEach(d=>d.Editor3dAddNamedMesh(e,t,n,i,s,o,r,a,l,c,h))}Editor3ChangedNamedMesh(e,t,n,i,s,o){this._configuratorKernelCallbackListener.forEach(r=>r.Editor3ChangedNamedMesh(e,t,n,i,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,i){this._configuratorKernelCallbackListener.forEach(s=>s.Editor3dComponentCreated(e,t,n,i,!1))}Editor3dComponentDocked(e,t,n,i){this._configuratorKernelCallbackListener.forEach(s=>s.Editor3dComponentDocked(e,t,n,i))}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){(Array.isArray(e)?e:[e]).forEach(e=>{-1===this._cachedGroupIds.indexOf(e)&&this._cachedGroupIds.push(e)}),this._waitingForGroups||(this._waitingForGroups=!0,AsyncHelper.waitFor(4).then(()=>{this._rapiAccess.getMaterialsByGroup(this._cachedGroupIds).then(e=>{let t=[];e.forEach(e=>{const n=[];e.materials.forEach(e=>n.push(e.id));const i=e.legacyId||e.id;e.legacyId||console.warn("Material group has no legacy id, please check content why this is the case"),t.push({group:i,materials:n})}),t.length&&this._kernelInstance.setMaterialsInGroup(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){let t=Array.isArray(e)?e:[e];if(this._requestedMaterialIds.push(...t),await wait(0),!this._requestedMaterialIds.length)return;const n=[...this._requestedMaterialIds];this._requestedMaterialIds=[];const i=await this._rapiAccess.getMaterials(n);let s=[];i.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()&&s.push({id:e.id,properties:t})}),s.length&&this._kernelInstance.setMaterialProperties(s)}registerCallbacks(){this._kernelContainer.registerConfiguratorCallback(this)}pause(){this.cleanUpCallbacks()}resume(){this.cleanUpCallbacks(),this.registerCallbacks()}destroy(){}_handleCortoMesh(e,t,n){var i;try{this._kernelInstance.addMeshCorto(t,n,new Uint8Array(e))}catch(e){console.error(e),null===(i=this._configuratorUiCallbacks)||void 0===i||i.onMemoryCorruption()}}_calcPrice(){const e=new Map;if(this._initData.useRoomlePrice){let e=this._kernelInstance.getFullPartList();if(e&&e.fullList&&e.fullList.length){const t=e.fullList[0].currencySymbol,n=e.fullList.reduce((e,t)=>e+(t.count?t.count:0)*(t.price?t.price:0),0);this._configuratorUiCallbacks.onUpdatePrice(t,n)}}else if(this._initData.usePriceService){let t=this._kernelInstance.getFullPartList();if(t&&t.fullList&&t.fullList.length){const n=t.fullList.reduce((t,n)=>{const i=kernelPartToPriceId(n);return i&&(e.set(i,n),t.push(i)),t},[]);return new Promise((i,s)=>{this._rapiAccess.getPrices(n).then(n=>{if(!n.length)return s(new Error("prices are empty"));const o=objectArrayToMap(n,"priceId");let r=0;return t.fullList.forEach(e=>{const t=kernelPartToPriceId(e);if(!o.has(t))return void console.warn("PriceId: "+t+" has no corresponding kernel-part");const{price:n,currencySymbol:i}=o.get(t);e.price=n,e.currencySymbol=i,r+=n*e.count}),this._configuratorUiCallbacks.onUpdatePrice(n[0].currencySymbol,r),i({totalSum:r,partMap:e})},e=>{console.error(e),s(e)})})}}return Promise.resolve({totalSum:0,partMap:e})}async addUiDataAndPriceToPartList(e,t){const{fullList:n,originPart:i}=e,s=e.perMainComponent;let o;this.addUiDataToPartList(n,t);try{const e=await this._calcPrice();o=e.partMap}catch(e){console.error(e),o=new Map}const r=this._initData.usePriceService||this._initData.useRoomlePrice,a=e=>{r||(e.price=null,e.currencySymbol=null);const t=kernelPartToPriceId(e);if(!t)return;if(!o.has(t))return;const{price:n,currencySymbol:i}=o.get(t);"number"==typeof n&&(e.price=n,e.currencySymbol=i)};return n.forEach(a),s.forEach(({fullList:e,perMainComponent:n})=>{n.length>0&&console.error("Not implemented! perMainComponent is deeper than one level"),this.addUiDataToPartList(e,t),e.forEach(a)}),{fullList:n,perMainComponent:s,originPart:i}}addUiDataToPartList(e,t){const n=[];return e.forEach(e=>{const t=this._rapiAccess.peekComponent(e.componentId);!t||e.labelIsCalculated&&e.label||(e.label=t.label),e.parameters.forEach(e=>{if(this._unitFormatter.formatPartListParameter(e),isMaterial(e)){const t=this._rapiAccess.peekMaterial(e.value);t?e.valueLabel=t.label||t.name||e.value:-1===n.indexOf(e.value)&&n.push(e.value)}})}),n.length&&this._rapiAccess.getMaterials(n).then(e=>{const n=this._lastPartListHash!==t;Array.isArray(e)&&e.length&&n&&(this._lastPartListHash=t,this.requestPartListAndUpdatePricesOfParts())}),e}async requestPartListAndUpdatePricesOfParts(e,t){let n=this._kernelInstance.getFullPartList();e||(e=this._kernelInstance.getHashOfConfiguration(this._configuratorContext.planObjectId));const i=await this.addUiDataAndPriceToPartList(n,e);this._configuratorUiCallbacks.onPartListUpdate(i,btoa(e))}}__decorate([inject],CommonKernelAccess.prototype,"_rapiAccess",void 0),__decorate([inject],CommonKernelAccess.prototype,"_scriptLoader",void 0),__decorate([inject],CommonKernelAccess.prototype,"_kernelIo",void 0),__decorate([inject],CommonKernelAccess.prototype,"_dataSyncer",void 0),__decorate([inject],CommonKernelAccess.prototype,"_lifeCycleManager",void 0),__decorate([inject],CommonKernelAccess.prototype,"_configuratorUiCallbacks",void 0),__decorate([inject],CommonKernelAccess.prototype,"_globalCallback",void 0),__decorate([inject],CommonKernelAccess.prototype,"_initData",void 0),__decorate([inject],CommonKernelAccess.prototype,"_unitFormatter",void 0),__decorate([inject],CommonKernelAccess.prototype,"_configuratorContext",void 0),__decorate([inject],CommonKernelAccess.prototype,"_globalInitData",void 0);const{APP:APP$1}=Env,{RAPI}=APP$1,headers=RAPI.headers,itemHeaders=RAPI.itemHeaders,TOKEN_IDENTIFIER=headers.token,LEGACY_GROUP_INDICATOR=uuid();let RAPI_MATERIAL_GROUP_CACHE=new Map,ITEM_ADDITIONAL_CONTENT_CACHE=new Map,RAPI_RELATIONS_CACHE=new Map,RAPI_CACHE=new Map,MESHES_TO_CATALOG_CACHE=new Map,RAPI_PACKAGE_CACHE=new Map,RAPI_PRELOAD_CACHE=new Map,WAITERS_FOR_URL=new Map,RAPI_ERROR_CACHE=new Map;const getCachedMaterialGroup=e=>RAPI_MATERIAL_GROUP_CACHE.get(e)||RAPI_MATERIAL_GROUP_CACHE.get(LEGACY_GROUP_INDICATOR+e),hasMaterialTags=e=>e&&e.tags&&e.tags.length,materialHasNoTagsButGroup=e=>!hasMaterialTags(e)&&e.group;class RapiAccess{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,i)=>{if(!navigator.onLine)return n();if(this._dataSyncer.getIsCatalogSynced(getCatalogIdFromItemOrConfigurationId(e)))return n();if(RAPI_PRELOAD_CACHE.get(e))return n();const s=t?"?itemId=":"?configurationId=";this._get("/preloads/components/"+s+e,"preloads/components").then(t=>{if(RAPI_PRELOAD_CACHE.get(e))return n();t.forEach(e=>{this._prepareData(e,"components")}),RAPI_PRELOAD_CACHE.set(e,!0),n()},i)})}changeUseOfHDGeometry(){const e=RAPI_CACHE.get("components");RAPI_PRELOAD_CACHE.clear(),RAPI_PACKAGE_CACHE.clear(),e&&RAPI_CACHE.delete("components")}getHSCPackage(e){return new Promise((t,n)=>{if(RAPI_PACKAGE_CACHE.get(e))return t();this._get("/catalogs/"+e+"/package","package").then(n=>{if(RAPI_PACKAGE_CACHE.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")}),RAPI_PACKAGE_CACHE.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:itemHeaders})}getComponents(e){return this._getByIds(e,"components")}getItems(e){return this._getByIds(e,"items",{additionalHeaders:itemHeaders})}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="crt",n=50){return this._getById(e,"meshes",{pathSuffix:"/data?format="+t+"&targetQuality="+n.toString()})}getMeshesOfCatalog(e){return new Promise((t,n)=>{const i=MESHES_TO_CATALOG_CACHE.get(e);i?t(i):this._get("/meshes?catalog="+e,"catalogMeshes").then(n=>{MESHES_TO_CATALOG_CACHE.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 i=ITEM_ADDITIONAL_CONTENT_CACHE.get(e.id.toString());i?n.push(...i):t.push(e.id.toString())}),new Promise((e,i)=>{0!==t.length?this._getByIdsPackets(t,"itemAdditionalContents",{filterKey:"itemIds"}).then(t=>{t.forEach(e=>{let t=ITEM_ADDITIONAL_CONTENT_CACHE.get(e.itemId);t||(t=[]);for(let n=0,i=t.length;n<i;n++)if(t[n].id===e.id)return;t.push(e),ITEM_ADDITIONAL_CONTENT_CACHE.set(e.itemId,t)}),e([...t,...n])},i):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")}peekItem(e){return this._peekData(e,"items")}peekConfiguration(e){return this._peekData(e,"configurations")}async getMaterials(e){return(await this._getByIds(e,"materials",{embed:["textures"]})).filter(e=>e.active)}getPlan(e){return this._getById(e,"plans")}static clearCaches(){RAPI_MATERIAL_GROUP_CACHE=new Map,RAPI_RELATIONS_CACHE=new Map,RAPI_CACHE=new Map,RAPI_PACKAGE_CACHE=new Map,RAPI_PRELOAD_CACHE=new Map,WAITERS_FOR_URL=new Map,ITEM_ADDITIONAL_CONTENT_CACHE=new Map}cleanUp(){RapiAccess.clearCaches()}getMaterialsByGroup(e){const t=e.slice(),n=[];let i=t.length;for(let e=0;e<i;e++){const s=getCachedMaterialGroup(t[e]);if(s){const o=s.length;for(let e=0;e<o;e++){const t=this._getCache("materials").get(s[e]);n.push(t)}t.splice(e,1),i--,e--}}return new Promise((e,i)=>{0!==t.length&&navigator.onLine?this._getByIdsPackets(t,"materials",{filterKey:"groups",embed:["textures"]}).then(t=>{e(this.combineMaterialsToGroups([...t,...n]))},i):e(this.combineMaterialsToGroups(n))})}_flushOfflineQueue(){return new Promise((e,t)=>{const n=this._localStorage.getItem("hsc_configurations_offline_queue_v1"),i=[];for(let e in n)if(n.hasOwnProperty(e)){const t=n[e];i.push(new Promise((e,n)=>{this.saveConfiguration(t.data).then(i=>{const s=[];t.perspectiveImage&&!i.perspectiveImage&&s.push(this.savePerspectiveImage(i,t.perspectiveImage)),t.topImage&&!i.topImage&&s.push(this.savePerspectiveImage(i,t.topImage)),Promise.all(s).then(e,n)},n)}))}Promise.all(i).then(()=>{this._localStorage.setItem("hsc_configurations_offline_queue_v1",{}),e()},t)})}_setQueuedConfiguration(e,t={}){const n=e.configurationHash,{perspectiveImage:i,topImage:s}=t;let o=this._localStorage.getItem("hsc_configurations_offline_queue_v1")||{},r=o[n]||{};r.data=e,r.perspectiveImage=i,r.topImage=s,o[n]=r,this._localStorage.setItem("hsc_configurations_offline_queue_v1",o)}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,i)=>this._fetchJson("/shortIds","shortIds",{method:"POST",resolve:n,reject:i,data:JSON.stringify({shortId:{type:t,referencedId:e}}),accept:"application/json",contentType:"application/json; charset=UTF-8"}))}_peekData(e,t){const n=RAPI_CACHE.get(t);return n&&n.get(e)||null}_saveConfigurationImage(e,t,n){if(!navigator.onLine){const i={};return i[n]=t,this._setQueuedConfiguration(e,i),this._markConfigurationAsLocally(e),e[n]=t.image,Promise.resolve(e)}const i=this._formDataUtil.create(t.image,e.configurationHash,IMAGE_FORMATS.PNG,n);return this._save("/configurations/"+e.id+"/"+n,i,"configurations",{accept:"application/json"})}_markConfigurationAsLocally(e){e.isLocally=!0,e.id=e.configurationHash}_save(e,t,n,i={}){const s=t instanceof FormData?t:JSON.stringify(t);return new Promise((t,o)=>{const r={method:i.method||"POST",data:s,resolve:t,reject:o};i.contentType&&(r.contentType=i.contentType),i.accept&&(r.accept=i.accept),this._fetchJson(e,n,r)})}combineMaterialsToGroups(e){return new Promise((t,n)=>{const i=new Map,s={id:null,label:null,materials:[]},o=[];for(let t=0,n=e.length;t<n;t++){const n=e[t],r=n.tags&&n.tags.length?n.tags.map(e=>({isTag:!0,id:e})):[];n.group&&r.push({isTag:!1,id:LEGACY_GROUP_INDICATOR+n.group,legacyId:n.group}),r.length||r.push({isTag:!1,id:null}),n.tags&&n.tags.length&&n.tags.forEach(e=>-1===o.indexOf(e)?o.push(e):null),r.forEach(({isTag:e,id:t,legacyId:o})=>{const r=n.id;let a=t?getCachedMaterialGroup(t):[];a||(RAPI_MATERIAL_GROUP_CACHE.set(t,[]),a=getCachedMaterialGroup(t)),-1===a.indexOf(r.toString())&&a.push(r.toString());const l=hasMaterialTags(n),c=l&&e,h=materialHasNoTagsButGroup(n);if(c||h&&!e||!l&&!h&&!t){let e=t?i.get(t):s;e||(i.set(t,{id:t,label:n.groupLabel,legacyId:o,materials:[]}),e=i.get(t)),e.materials.push(n)}})}const r=s.materials.length?[s]:[];this.getTags(o).then(e=>{const n=e.reduce((e,t)=>(e[t.id]=t,e),{});return i.forEach((e,t)=>{r.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(r)},n)})}_getByIds(e,t,n={}){const i=this._getCache(t),s=this._getErrorCache(t),o=[],r=[...new Set(e)];let a=r.length;if(i&&i.size){const e=(new Date).getTime();for(let t=0;t<a;t++){const n=r[t],l=i.get(n),c=s.get(n);let h=!1;null!=l?(o.push(l),h=!0):h=void 0!==c&&(e-c.timestamp<6e4||!1===navigator.onLine),h&&(r.splice(t,1),a--,t--)}}return new Promise((e,i)=>{0!==r.length&&navigator.onLine?this._getByIdsPackets(r,t,n).then(t=>{e([...t,...o])},i):e(o)})}_getByIdsPackets(e,t,n={}){const i=n.filterKey||"ids";let s,o="/"+t+"/",r="?",a=[];const l=e.length;if(!l)return new Promise(e=>e([]));let c=!0,h=[];for(s=0;s<l;s++){c=!1;const n=e[s],l=r+i+"[]="+n,d=l.length+o.length;h.push(n),r="&",d<=1500?o+=l:(d>1500&&(h.pop(),s--),a.push({url:o,ids:h}),c=!0,o="/"+t+"/",r="?",h=[])}c||a.push({url:o,ids:h});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,i={}){return new Promise((s,o)=>{this._get(t,n,i).then(t=>{for(let n=0,s=t.length;n<s;n++){const s=i&&i.cacheKey?t[n][i.cacheKey]:t[n].id,o=e.indexOf(s.toString());-1!==o&&e.splice(o,1)}const o=e.length;if(o){const t=this._getCache(n),i=this._getErrorCache(n),s=(new Date).getTime();for(let n=0;n<o;n++)i.set(e[n],{code:0,timestamp:s}),t.delete(e[n]);this._errorHandler.dispatch(2,[n,e.map(e=>'"'+e+'"').join(",")])}s(t)},o)})}_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 i=this._getCache(t).get(e);if(i)return new Promise(e=>e(i));if(!navigator.onLine)return Promise.reject("Nothing cached but tried to fetch in offline mode");const s={...n,id:e},o=n.pathSuffix||"";return this._get("/"+t+"/"+e+o,t,s)}_get(e,t,n={}){const i=AppContext.useHDGeometry?"includeGeometryHD=true":"";let s=-1===e.indexOf("?")?"?":"&";return""!==i&&(e+=s+i),n.embed&&Array.isArray(n.embed)&&n.embed.forEach(t=>{e+=s+"embed"+(t[0].toUpperCase()+t.substr(1))+"=true",s="&"}),new Promise((i,s)=>{const o=WAITERS_FOR_URL.get(e);Array.isArray(o)&&o.length>0?o.push({resolve:i,reject:s}):(WAITERS_FOR_URL.set(e,[{resolve:i,reject:s}]),this._fetchJson(e,t,n))})}_fetchJson(e,t,n={}){this._fetch(e,n).then(handleJsonResponse.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 i=RAPI.server;const s=this._globalInitData.overrideRapi;s&&(i="live"===s?RAPI.liveServer:RAPI.testServer),(this._globalInitData.customApiUrl||""===this._globalInitData.customApiUrl)&&(i=this._globalInitData.customApiUrl);const o=new Request(i+e,n);this._globalCallback.onNetworkRequest(e,n,t);const r=await this._globalCallback.onCheckExternalCache(e,n);return r?{headers:{get:()=>"application/json"},json:()=>Promise.resolve(r)}:this._networkLayer.fetch(o,{},{checkResponse:e=>this._globalCallback.onValidateNetworkResponse("rapi-access",e)})}_createHeaders(e={}){const t={...headers};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:i,accept:s,additionalHeaders:o,data:r}=e;if(i&&(t["content-type"]=e.contentType),s&&(t.accept=e.accept),o)for(let e in o)o.hasOwnProperty(e)&&(t[e]=o[e]);this._globalInitData.configuratorId&&(t.configurator=this._globalInitData.configuratorId);const a=this._currentToken||TOKEN_IDENTIFIER;t.token="03-"+window.btoa((new Date).toISOString()+";"+a+";"+headers.apiKey);const l=new Headers(t);return r instanceof FormData&&l.delete("content-type"),l}_handleJson(e,t,n={}){return i=>{let s=null,o=null;"number"==typeof i&&(s=i);for(let e in i)"meta"!==e&&i.hasOwnProperty(e)&&(s=i[e],o=e);if("error"===o)return this._handleError(e,n)(new Error(JSON.stringify(s)));if(!s)throw new TypeError("RAPI returned empty JSON");if(Array.isArray(s))for(let e=0,i=s.length;e<i;e++)this._prepareData(s[e],t,n),this._prepareEmbeddedData(s[e],t,n);else this._prepareData(s,t,n),this._prepareEmbeddedData(s,t,n);n.resolve?n.resolve(s):this._notifyWaiters(e,null,s)}}_prepareEmbeddedData(e,t,n={}){n.embed&&Array.isArray(n.embed)&&n.embed.forEach(i=>{const s=e[i.slice(0,-1)+"Objects"];if(Array.isArray(s)){for(let e=0,t=s.length;e<t;e++)this._prepareData(s[e],i,n);this._prepareRelationalData(t,i,e.id,s)}else s&&(this._prepareData(s,i,n),this._prepareRelationalData(t,i,e.id,[s]))})}_getCache(e){return this._getCacheFrom(e,RAPI_CACHE)}_getErrorCache(e){return this._getCacheFrom(e,RAPI_ERROR_CACHE)}_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 i=this._getCache(t);const s=n&&n.cacheKey?e[n.cacheKey]:e.id;if(s||n&&n.id||"tenants/me"===t)if("tenants/me"!==t){{const t=s||n.id;this._setCache(t,e,i)}e.__rapi_path__=t}else this._setCache("0",e,i);else"shortIds"!==t&&console.error("Can not cache because there is no ID!")}_getRelationsCacheFor(e,t,n){let i=RAPI_RELATIONS_CACHE.get(t);if(!i){const s=new Map,o=new Map;o.set(n,void 0),s.set(e,o),RAPI_RELATIONS_CACHE.set(t,s),i=RAPI_RELATIONS_CACHE.get(t)}let s=i.get(e);if(!s){const t=new Map;t.set(n,void 0),i.set(e,t),s=i.get(e)}return s.get(n)}_prepareGroups(e){const t=e.group,n=e.id;let i=getCachedMaterialGroup(t);i||(RAPI_MATERIAL_GROUP_CACHE.set(t,[]),i=getCachedMaterialGroup(t)),-1===i.indexOf(n.toString())&&i.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 i=e.id;if(!i)return Promise.resolve([]);const s=e.__rapi_path__,o=t.rapiPath;let r=this._getCache(o),a=this._getRelationsCacheFor(i.toString(),s,o),l=[];return a?(a.forEach(e=>l.push(r.get(e))),new Promise(e=>e(l))):navigator.onLine?new Promise((e,t)=>{this._get("/"+s+"/"+i+"/"+o,o,n).then(t=>{this._prepareRelationalData(s,o,i,t),e(t)},t)}):Promise.resolve([])}_prepareRelationalData(e,t,n,i){RAPI_RELATIONS_CACHE.has(e)||RAPI_RELATIONS_CACHE.set(e,new Map);let s=RAPI_RELATIONS_CACHE.get(e);const o=n.toString();s.has(o)||s.set(o,new Map);let r=s.get(o),a=this._getCache(t),l=[];for(let e=0,t=i.length;e<t;e++){const t=i[e],n=t.id.toString();l.push(n),a.set(n,t)}r.set(t,l)}_notifyWaiters(e,t,n){const i=WAITERS_FOR_URL.get(e);if(i&&i.length){for(let e=0,s=i.length;e<s;e++)t?i[e].reject(t):i[e].resolve(n);WAITERS_FOR_URL.delete(e)}}_tenantMe(){return new Promise((e,t)=>{const n=this._getCache("tenants/me"),i=this._globalInitData.overrideTenant?this._globalInitData.overrideTenant:n.get("0");if(i)return e(i);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 i="/configurations/"+e+"/shares",s=new FormData;return s.append("email",t),s.append("type",n.toString()),new Promise((e,t)=>{const n={method:"POST",data:s,resolve:e,reject:t,accept:"application/json",contentType:"application/json; charset=UTF-8"};this._fetch(i,n).then(n.resolve,n.reject)})}export3D(e,t,n,i={}){const s="/configurations/"+e+"/3d-exports",o={formats:[{file_format:n,pack_external_data:!0,...i}]},r=JSON.stringify(o),a=new FormData;return a.append("email",t),a.append("settings",r),new Promise((e,t)=>{const n={method:"POST",data:a,resolve:e,reject:t};this._fetch(s,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:i}=new URL(n);return i})())&&(NAMES_FOR_LOCALHOST.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,i={module:3,action:1,actionId:e,actionLabel:n};await this.sendUserAction(i),this._itemLoaded=!0}signinUser(e,t){return new Promise((n,i)=>{const s={method:"POST",accept:"application/json",contentType:"application/json; charset=UTF-8",data:JSON.stringify({identification:e,passwordMD5:t}),cacheKey:"token",resolve:n,reject:i};this._fetchJson("/auth/signin","auth",s)})}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}}}__decorate([inject],RapiAccess.prototype,"_formDataUtil",void 0),__decorate([inject],RapiAccess.prototype,"_errorHandler",void 0),__decorate([inject],RapiAccess.prototype,"_dataSyncer",void 0),__decorate([inject],RapiAccess.prototype,"_networkLayer",void 0),__decorate([inject],RapiAccess.prototype,"_localStorage",void 0),__decorate([inject],RapiAccess.prototype,"_globalInitData",void 0),__decorate([inject],RapiAccess.prototype,"_globalCallback",void 0);const PULSE_DURATION=1500,PULSE_LOOPS=5;function RoomleComponentFactoryInitializer(){class e extends THREE.Object3D{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,i){e&&(this.runtimeId=e,this.name=e.toString()),t&&(this.roomlePosition=Object.assign({},t)),n&&(this.roomleRotation=Object.assign({},n)),i&&(this.parentObjectId=i)}constructor(e,t,n,i){super(),this._selected=!1,this.geometryChanged=!0,this.meshes=[],this.castShadow=!1,this.receiveShadow=!0,this._setValues(e,t,n,i)}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(convertToThreeMatrix(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.runtimeId,this.meshes)}removeMesh(e){const t=this.meshes.indexOf(e);this.remove(e),disposeMesh(e),t<0||this.meshes.splice(t,1)}removeAllMeshes(e=!0){this.meshes.forEach(t=>{this.remove(t),e&&disposeMesh(t)}),this.meshes=[],this._removeLoadingMesh(),this.remove(this._boundingBoxMesh),disposeMesh(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.runtimeId+" 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 i=new THREE.BoxGeometry(e,t,n);this._loadingMesh=new THREE.Mesh(i,new THREE.MeshStandardMaterial({transparent:!0,opacity:1,color:new THREE.Color("#DDDDDD")})),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),disposeMesh(this._loadingMesh),this._loadingMesh=null)}loadingFinished(){this._removeLoadingMesh(),this._showAllMeshes()}deselect(){this._selected=!1}hoverOn(){setCursor("pointer")}hoverOff(){setCursor("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 i;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 i=0,s=n.length;i<s;i++)e.copy(n[i]),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 i=0,s=n.count;i<s;i++)e.fromBufferAttribute(n,i).applyMatrix4(t.matrix),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,s=this._boundingBox.max.z-this._boundingBox.min.z;i=new THREE.BoxGeometry(t,n,s)}else{this._kernelBoundingBox=kernelBoxToThreeBox(t),this._boundingBox=this._kernelBoundingBox.clone();let{x:e,y:n,z:s}=this._boundingBox.getSize(new THREE.Vector3);i=new THREE.BoxGeometry(e,n,s)}this._boundingBoxMesh=new THREE.Mesh(i,new THREE.MeshStandardMaterial({color:"#FFFFFF",transparent:!0,opacity:0,polygonOffset:!0,polygonOffsetFactor:-1,visible:!1})),this._boundingBoxMesh.name="bounding box mesh";let s=this._boundingBox.getCenter(new THREE.Vector3);this._boundingBoxMesh.position.add(s),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(i,s),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(i=>{i instanceof e&&!n&&(n=i.runtimeId===t||i.isChild(t))}),n}getKernelPosition(e){let t=this.parent.localToWorld(this.position);return convertToKernel(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,i,s){super(t,n,i,s),this._stringId=null,this.receivedPointAssociation=!1,this.castShadow=!1,this.receiveShadow=!1,this._creator_=e}get stringId(){return this._stringId?this._stringId:this.runtimeId.toString()}addMesh(e,t){super.addMesh(e,t),e.material instanceof THREE.MeshStandardMaterial&&(e.material.opacity=.8,e.material.roughness=1,e.material.metalness=0,e.material.color=new THREE.Color(this._initData.colors.PREVIEW_DOCKING_COLOR)),e.renderOrder=1,e.castShadow=!1,e.receiveShadow=!1}startPulsating(){var e,t;if(null===(t=null===(e=this._initData)||void 0===e?void 0:e.featureFlags)||void 0===t?void 0:t.pulsePreview)for(const e of this.meshes){const t={opacity:.8},n={opacity:.3};new TWEEN.Tween(t).to(n,1500).easing(TWEEN.Easing.Sinusoidal.In).onUpdate(()=>{t.opacity,e.material.opacity=t.opacity}).yoyo(!0).repeat(5).start()}}hoverOn(){this.remove(this._dockline),this.meshes.forEach(({material:e})=>{e.opacity=.9,e.roughness=1,e.metalness=0,e.color=new THREE.Color(this._initData.colors.PREVIEW_DOCKING_COLOR)}),setCursor("pointer")}hoverOff(){this.add(this._dockline),this.meshes.forEach(({material:e})=>{e.opacity=.8,e.roughness=1,e.metalness=0,e.color=new THREE.Color(this._initData.colors.PREVIEW_DOCKING_COLOR)}),setCursor("default")}clonePreview(t){const i=new n(this._creator_,this.runtimeId,this.roomlePosition,this.roomleRotation,this.parentObjectId);return i._stringId=this.runtimeId+"_"+t,this.children.forEach(e=>{e instanceof THREE.Mesh&&0===e.userData.meshType&&i.meshes.push(e.clone(!0))}),i.meshes.forEach(e=>{e.material=e.material.clone(),e.geometry=e.geometry.clone(),i.add(e)}),this._dockline&&(i._dockline=e.cloneDockLine(this._dockline,this._boundingBox)),this._boundingBoxMesh&&(i._boundingBoxMesh=this._boundingBoxMesh.clone(!0)),this._boundingBox&&(i._boundingBox=this._boundingBox.clone()),i}preparePreview(){this.add(this._dockline),this.add(this._boundingBoxMesh)}}__decorate([inject],n.prototype,"_initData",void 0);class i extends n{constructor(e,t,n,i,s,o){super(e,t,n,i,s),o&&(this._stringId=this.runtimeId+"_has_additional_dock_point_copy")}set roomleLineFrom(e){this._roomleLineFrom=e,this.lineFrom=convertToTHREE(e)}get roomleLineFrom(){return this._roomleLineFrom}set roomleLineTo(e){this._roomleLineTo=e;let t=convertToTHREE(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=convertToTHREE(e)}get roomlePositionFrom(){return this._roomlePositionFrom}set roomlePositionTo(e){this._roomlePositionTo=e;let t=convertToTHREE(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,setCursor("pointer")}hoverOff(){this._dockline.visible=!1,setCursor("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 i=n.length(),s=n.normalize(),o=new THREE.ArrowHelper(s,t),r=new THREE.CylinderGeometry(.01,.01,i,16,1);this.lineMesh=new THREE.Mesh(r,new THREE.MeshStandardMaterial({color:"#DDDDDD",transparent:!0,opacity:.4})),this.lineMesh.name="line mesh";const a=(new THREE.Quaternion).setFromEuler(o.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 c=this._boundingBox.getCenter(new THREE.Vector3).applyEuler(this.docklineRotation),h=null,d=0,_=Math.abs(s.x),u=Math.abs(s.y),p=Math.abs(s.z);_>=u&&_>=p?(h=new THREE.Vector3(c.x,0,0),d=Math.sqrt(c.y*c.y+c.z*c.z)):u>=_&&u>=p?(h=new THREE.Vector3(0,c.y,0),d=Math.sqrt(c.x*c.x+c.z*c.z)):p>=u&&p>=_&&(h=new THREE.Vector3(0,0,c.z),d=Math.sqrt(c.y*c.y+c.x*c.x)),d=d>0?d:.01;let g=(new THREE.Vector3).subVectors(this.positionTo.clone(),this.positionFrom.clone()).length()+h.length(),m=new THREE.CylinderGeometry(1.1*d,1.1*d,g,32,1);this.boundingLineMesh=new THREE.Mesh(m,new THREE.MeshStandardMaterial({color:"#ffffff",transparent:!0,opacity:.5})),this.boundingLineMesh.name="bounding line mesh",this.boundingLineMesh.userData.ignoreComponentRaycast=!0;let E=this.positionTo.clone(),f=this.positionFrom.clone(),C=(new THREE.Vector3).subVectors(E,f).normalize(),y=new THREE.ArrowHelper(C,f);const w=(new THREE.Quaternion).setFromEuler(y.rotation);this.boundingLineMesh.quaternion.multiply(w),this.boundingLineMesh.renderOrder=3;let M=(new THREE.Vector3).addVectors(this.positionTo.clone(),this.positionFrom.clone()).multiplyScalar(.5).add(c);this.boundingLineMesh.position.copy((new THREE.Vector3).subVectors(M,this.position.clone())),this.add(this.boundingLineMesh)}clonePreviewLine(t){let n=new i(this._creator_,this.runtimeId,this.roomlePosition,this.roomleRotation,this.parentObjectId,this.receivedPointAssociation);return n._stringId=this.runtimeId+"_"+t,this.children.forEach(e=>{e instanceof THREE.Mesh&&0===e.userData.meshType&&n.meshes.push(e.clone(!0))}),n.meshes.forEach(e=>{e.material=e.material.clone(),e.geometry=e.geometry.clone(),n.add(e)}),this._dockline&&(n._dockline=e.cloneDockLine(this._dockline,this._boundingBox)),this._boundingBoxMesh&&(n._boundingBoxMesh=this._boundingBoxMesh.clone(!0)),this._boundingBox&&(n._boundingBox=this._boundingBox.clone()),n}getPositionForIntersectionPoint(e){let t=this._boundingBox.getCenter(new THREE.Vector3).applyEuler(this.docklineRotation),n=this.positionTo.clone().add(t),i=this.positionFrom.clone().add(t),s=new THREE.Line3(i,n).closestPointToPoint(e,!0,new THREE.Vector3);return(isNaN(s.x)||isNaN(s.y)||isNaN(s.z))&&s.copy(e),s.sub(t)}updatePreviewPosition(e){let t=this.getPositionForIntersectionPoint(e),n=this.parent.localToWorld(t);this._newPosition=this.worldToLocal(n);let i=this._boundingBox.getCenter(new THREE.Vector3).applyEuler(this.docklineRotation);this._dockline.position.copy((new THREE.Vector3).addVectors(this._newPosition,i)),this._dockline.rotation.copy(this.docklineRotation)}hideSelectionLine(){this._dockline.visible=!1}getKernelPosition(e){if(this._newPosition){let t=this.localToWorld(this._newPosition);return convertToKernel(e.worldToLocal(t))}return super.getKernelPosition(e)}}class s extends THREE.OrthographicCamera{constructor(e,t,n,i,s,o,r){super(e,t,n,i,s,o),r||(r={left:0,top:1,right:1,bottom:0}),this.offset=r}set offset(e){this._offset=e,this.updateProjectionMatrix()}get offset(){return this._offset}updateProjectionMatrix(){this._offset?(this.projectionMatrix=this._calculateProjectionMatrix(),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()):super.updateProjectionMatrix()}_calculateProjectionMatrix(){const e=this._calculate2DPlanes();if(this._offset.left>=this._offset.right||this._offset.bottom>this._offset.top)return(new THREE.Matrix4).makeOrthographic(e.left,e.right,e.top,e.bottom,this.near,this.far);const t=this._scaleRange(e.left,e.right,this._offset.left,this._offset.right);let n=t.from,i=t.to;const s=this._scaleRange(e.bottom,e.top,this._offset.bottom,this._offset.top);let o=s.from,r=s.to;const a=(e.right-e.left)/(e.top-e.bottom),l=(i-n)/(r-o);if(l>a){const e=(o+r)/2,t=(r-o)*l/a;o=e-t/2,r=e+t/2}else{const e=(n+i)/2,t=(i-n)*a/l;n=e-t/2,i=e+t/2}return(new THREE.Matrix4).makeOrthographic(n,i,r,o,this.near,this.far)}_scaleRange(e,t,n,i){const s=(t-e)/(i-n);return{from:e-s*n,to:t+s*(1-i)}}_calculate2DPlanes(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let s=n-e,o=n+e,r=i+t,a=i-t;if(null!==this.view&&this.view.enabled){const e=(this.right-this.left)/this.view.fullWidth/this.zoom,t=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=e*this.view.offsetX,o=s+e*this.view.width,r-=t*this.view.offsetY,a=r-t*this.view.height}return{left:s,right:o,top:r,bottom:a}}}class o extends THREE.PerspectiveCamera{constructor(e,t,n,i,s){super(e,t,n,i),s||(s={left:0,top:1,right:1,bottom:0}),this.offset=s}set offset(e){this._offset=e,this.updateProjectionMatrix()}get offset(){return this._offset}_calculateProjectionMatrix(){let e,t,n,i,s=this.fov*(2*Math.PI/360)/2;n=Math.tan(s),i=-n;let o=Math.atan(this.aspect*Math.tan(s));t=Math.tan(o),e=-t;let r=this._offset.left,a=this._offset.right,l=this._offset.top,c=this._offset.bottom,h=new THREE.Vector2(a-r,l-c),d=new THREE.Vector2(r+h.x/2,c+h.y/2);if(h.x<h.y){let s=(1-d.x)/(h.x/2),o=d.x/(h.x/2);t*=s,e*=o;let r=(s+o)/2;n*=r,i*=r}else{let s=(1-d.y)/(h.y/2),o=d.y/(h.y/2);n*=s,i*=o;let r=(o+s)/2;e*=r,t*=r}e*=this.near,t*=this.near,n*=this.near,i*=this.near;let _=this.near*Math.tan(Math.PI/180*.5*this.fov)/this.zoom*2,u=this.aspect*_;return this.view&&this.view.enabled&&(e+=this.view.offsetX*u/this.view.fullWidth,n-=this.view.offsetY*_/this.view.fullHeight,t+=this.view.offsetX*u/this.view.fullWidth,i-=this.view.offsetY*_/this.view.fullHeight),(new THREE.Matrix4).makePerspective(e,t,n,i,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,i,s){return new e(t,n,i,s)},createPreview:function(e,t,i){return new n(i,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,t){let n=new i(t,e.id,e.roomlePosition,e.roomleRotation,e.parentObjectId,e.receivedPointAssociation);return e.meshes.forEach(e=>{let t=e.clone();t.material=e.material.clone(),t.geometry=e.geometry.clone(),n.addMesh(t)}),n.computeBoundingBox(),n},isPreview:function(e){return e instanceof n},isPreviewLine:function(e){return e instanceof i},createPerspectiveCamera:function(e,t,n,i,s){return new o(e,t,n,i,s)},createOrthographicCamera:function(e,t,n,i,o,r,a){return new s(e,t,n,i,o,r,a)}}}const DEFAULT_CONVERSATION_ID=9;class ConfiguratorViewModel{constructor(e){this._mergeThreshold=3,this._componentsToMerge=new OccurrenceMap,this._mergeInProgress=!1,this._components=new Map,this._previews=new Map,this._componentNumberOfPossibleChildren=new Map,this._creator_=e,this._getKernelAccess().addConfiguratorListener(this),this._componentFactory=RoomleComponentFactoryInitializer()}get materialQueue(){return this.getMeshGenerator().materialQueue}_getKernelAccess(){return RoomleDependencyInjection.lookup("planner-kernel-access",this._creator_)}_applyMeshTransform(e,t,n,i,s){if(n){const i=e.userData.transform=convertToThreeMatrix(n);t&&(e.userData.transform=i),e.applyMatrix4(i)}this._applyMeshUVTransform(e,t,i,s)}_applyMeshUVTransform(e,t,n,i){if(6!==(null==n?void 0:n.length)||(e=>1===e[0]&&0===e[1]&&0===e[2]&&1===e[3]&&0===e[4]&&0===e[5])(n))t&&(t.uvTransform=void 0),i&&(e.geometry=i);else{const s=(e=>{const t=new THREE.Matrix4;return t.set(e[0],e[2],0,e[4],e[1],e[3],0,e[5],0,0,1,0,0,0,0,1),t})(n);t&&(t.uvTransform=s);const o=null!=i?i:e.geometry;if(o&&o.attributes.uv){const t=o.clone();t.attributes.uv.applyMatrix4(s),e.geometry=t}}}_addMeshToSubPart(e,t,n,i,s,o,r,a,l){const c=this._generateMesh(e,t,n,o,r,a,l);this._applyMeshTransform(c,null,i,s),this._subPartObject.add(c)}_addMeshToComponent(e,t,n,i,s,o,r,a,l,c,h){if(this._subPartGuard&&this._subPartGuard.info===e)return void this._addMeshToSubPart(e,null,i,null,null,r,a,l,c);const d=this.getComponent(e);if(!d)return;const _=this._componentFactory.isPreview(d),u=this._generateMesh(e,n,_?null:i,r,a,l,c);u.userData.meshId=t,u.userData.geometryId=n,u.userData.materialId=i,this._applyMeshTransform(u,u.userData,s,o),_&&u.layers.set(5),d&&d.addMesh(u),d.meshes.length>this._mergeThreshold&&this._componentsToMerge.set(e,d.meshes.length)}async _changeMeshOfComponent(e,t,n,i,s,o){const r=this.getComponent(e);if(!r)return;const a=r.getMeshById(t);if(a){a.userData.geometryId!==n&&console.warn("Geometry of mesh has changed!"),a.userData.materialId=i;const e=a.material.clone();await this._configuratorMeshGenerator.setMaterial(a,i),e.opacity!==a.material.opacity&&this._requestRenderCallback&&this._requestRenderCallback(),s&&(a.position.set(0,0,0),a.scale.set(1,1,1),a.rotation.set(0,0,0));const t=this._configuratorMeshGenerator.getGeometry(n);this._applyMeshTransform(a,a.userData,s,o,t)}}_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)}getNumberOfPossibleChildrenForComponent(e){if(this._componentNumberOfPossibleChildren.has(e))return this._componentNumberOfPossibleChildren.get(e);const t=this._getKernelAccess().kernelInstance.getPlanComponentPossibleChildren(e).length;return this._componentNumberOfPossibleChildren.set(e,t),t}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=[],i=[];t.meshes.forEach(t=>{const s=t.userData.material;if(!s)return void console.warn("mesh has no material id set");if(!e.has(s)){const i=new THREE.Mesh(new THREE.Geometry,t.material);i.userData.material=s,i.receiveShadow=!0,i.castShadow=!0,i.layers.set(3),this._setMaterial(i,s),n.push(i),e.set(s,i)}const o=e.get(s).geometry;t.userData.transform?o.merge(t.geometry,t.userData.transform):o.merge(t.geometry),i.push(t)}),n.forEach(e=>t.addMesh(e)),i.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,i){let s=this._components.get(t),o=this._components.get(e);o&&(o.roomlePosition=n,o.roomleRotation=i,s&&s.add(o))}dockComponentWithPosition(e,t){let n,i=this._components.get(e.parentId);n=t?t.getKernelPosition(i):e.getKernelPosition(i);const s=Benchmark.start("dock_component_with_position_"+e.childId);this._getKernelAccess().dockComponentWithPosition(e.parentId,e.parentDockId,e.childId,e.childDockId,n),this._configuratorContext.dockingRootComponentId=null,Benchmark.end(s)}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,i,s,o,r){this._addMeshToComponent(e,null,null,t,null,null,n,i,s,o,r)}Editor3dAddDockPreview(e,t){const n=this._componentFactory.createPreview(t,e,this._creator_);this._previews.set(t.toString(),n)}Editor3dAddNamedMesh(e,t,n,i,s,o,r,a,l,c,h){this._addMeshToComponent(e,t,n,i,s,h,o,r,a,l,c)}async Editor3ChangedNamedMesh(e,t,n,i,s,o){await this._changeMeshOfComponent(e,t,n,i,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,i,s){s&&(this._configuratorContext.rootComponentId=e);let o=null;this._components.has(e)?(o=this._components.get(e),o.removeAllMeshes()):(o=this._componentFactory.create(e,t,n,i),o.layers.set(3)),this._components.set(e,o),s&&this._addRootComponent(o)}Editor3dComponentDocked(e,t,n,i){this.dockComponent(e,t,n,i)}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 i=this._previews.get(e.toString());i&&i.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)];AsyncHelper.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 i=this._componentFactory.createPreviewLine(n,this._creator_),s=this._components.get(this._configuratorContext.rootComponentId);for(let t=0;t<e.length;t++){let n;n=0===t?i:i.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=(o=e[t].rotation,new THREE.Euler(o.x,o.z,-o.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),s.add(n),n.preparePreview(),this._previews.set(n.stringId,n)}var o}Editor3dSetPreviewPointAssociations(e,t){let n=this._previews.get(t.toString());if(!n)return;let i=this._components.get(this._configuratorContext.rootComponentId);for(let t=0;t<e.length;t++){let s;0===t?s=n:(s=n.clonePreview(t),this._previews.set(s.stringId,s)),s.name="Preview Point",s.parentDockId=e[t].parentDockId,s.parentId=e[t].parentId,s.childDockId=e[t].childDockId,s.childId=e[t].childId,s.preparePreview(),s.receivedPointAssociation=!0,s.userData.ignoreComponentRaycast=!0,i.add(s),s.roomlePosition=e[t].position,s.roomleRotation=e[t].rotation,s.startPulsating()}}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,i,s){10===e&&(this._configuratorContext.dockingRootComponentId=n);let o=0===t;o?this._getKernelAccess().kernelInstance.requestPlanComponentConstructionRecursive(n):this._getKernelAccess().kernelInstance.requestPlanObjectConstruction(t);let r=this._getKernelAccess().kernelInstance.getComponent(n),a=this._components.get(n);a&&(a.computeBoundingBox(r.boxForMeasurement),a.hash=r.hash),this._listener&&this._listener.configurationLoaded(a,o&&void 0!==a.boundingBoxMesh)}finishParameterChange(e,t){this.materialQueue.registerCallback(e)}planObjectConfigurationUpdated(e,t,n){let i=this._getKernelAccess().kernelInstance.getPlanObject(e);this._updatePlanObject(i)}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._componentNumberOfPossibleChildren.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 kernelBoxToThreeBox(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,i,s,o,r,a,l){return this._configuratorMeshGenerator.generateMesh(e,t,n,i,s,o,r)}_setMaterial(e,t,n){this._configuratorMeshGenerator.setMaterial(e,t)}constructComponents(e){this._getKernelAccess().kernelInstance.requestPlanObjectConstruction(e)}requestSubPartConstruction(e){return this._subPartGuard=new AsyncGuard(e),this._getKernelAccess().requestPlanComponentConstruction(e),this._subPartGuard.wait()}getMeshGenerator(){return this._configuratorMeshGenerator}setRequestRenderCallback(e){this._requestRenderCallback=e}}__decorate([inject],ConfiguratorViewModel.prototype,"_configuratorMeshGenerator",void 0),__decorate([inject],ConfiguratorViewModel.prototype,"_configuratorContext",void 0),__decorate([inject],ConfiguratorViewModel.prototype,"_cacheHolder",void 0),__decorate([inject],ConfiguratorViewModel.prototype,"_initData",void 0);class OccurrenceMap extends Map{largestValue(){let e=this.entries().next().value[0],t=0;return this.forEach((n,i)=>{n>t&&(e=i,t=n)}),e}}const ASYNC_PARAMTER_CHANGES=["material"];class ConfiguratorKernelAccess extends CommonKernelAccess{constructor(e){super(e),this.externalMeshQueue=new PromiseQueue,this.muteKernelCallbacks=!1,this.listOfVariants=(e,t)=>{}}init(e){super.init(e),Benchmark.addMeta("kernel_is_ready",{isWasm:this._useWASM}),AppContext.kernelInstance?(this._kernelContainer=AppContext.kernelContainer,setTimeout(()=>this._loadSuccess(),0)):this._scriptLoader.fetch(this._kernelPath,{id:"kernel"}).then(this._loadSuccess.bind(this),this._loadError.bind(this))}_loadSuccess(){Benchmark.start("kernel_is_ready"),window.ConfiguratorKernel&&(AppContext.kernelInstance?setTimeout(()=>this.isReady(),0):(window.ConfiguratorKernel(this._kernelContainer),window.ConfiguratorKernel=null))}_loadError(){this._configuratorKernelAccessCallback.loadError()}selectedComponent(e){this._updateComponentDependencies(e)}uiRequestConfiguration(e){const t=this._kernelInstance.getSerializedConfiguration(e);AsyncHelper.finishOperation(1,t)}_updateComponentParameters(e){let t=this._kernelInstance.getComponentParameters(e);const n=this._kernelInstance.getComponent(e);this._configuratorKernelAccessCallback.updateParameters(t,n.parameterGroups,e,1)}selectionChange(e,t){let n=!1,i=[];if(e){let t=this._kernelInstance.getComponent(e);t.componentId=this._kernelInstance.getComponentId(e),t&&t.childIds&&t.childIds.length>0&&(n=!0),i.push(t)}this._configuratorUiCallbacks.onSelectionChange("standard",t,n,i)}multiSelectionChange(e,t){this._updateCommonComponentDependencies(e);let n=!1,i=!1,s=[];e&&e.forEach(e=>{let o=this._kernelInstance.getComponent(e);o.componentId=this._kernelInstance.getComponentId(e),o&&o.childIds&&o.childIds.length>0&&(n=!0),o.id===t&&(i=!0),s.push(o)}),this._configuratorUiCallbacks.onSelectionChange("multiselect",i,n,s)}_updateCommonComponentDependencies(e){const{parameters:t,parameterGroups:n}=this._kernelInstance.getCommonPlanComponentParameters(this._utilityToLongArray(e));this._configuratorKernelAccessCallback.updateParameters(t,n,e,2)}_updateComponentChildren(e){const t=this._kernelInstance.getPlanComponentPossibleChildren(e);this._configuratorKernelAccessCallback.updatePossibleChildren(e,t,1)}_updateComponentDependencies(e){this._updateComponentParameters(e),this._updateComponentChildren(e)}_updatePlanObjectParameters(e){let t,n=this._kernelInstance.getPlanObjectParameters(e);if(0===n.length){let i=this._kernelInstance.getRootPlanComponentIdFromObjectId(e);n=this._kernelInstance.getComponentParameters(i),this._enableRootComponentParametersAsGlobal(),t=this._kernelInstance.getComponent(i)}else this._configuratorContext.rootComponentParametersAsGlobal=!1,t=this._kernelInstance.getPlanObject(e);this._configuratorKernelAccessCallback.updateParameters(n,t.parameterGroups,e,0)}_enableRootComponentParametersAsGlobal(){this._configuratorContext.selectedRuntimeComponentId||(this._configuratorContext.rootComponentParametersAsGlobal=!0)}_updatePlanObjectChildren(e){const t=this._kernelInstance.getPlanObjectPossibleChildren(e);this._configuratorKernelAccessCallback.updatePossibleChildren(e,t,0)}updatePlanObjectDependencies(e){this._updatePlanObjectParameters(e),this._updatePlanObjectChildren(e)}_updateConfigurationHasChildren(e,t=null){t||(t=this._kernelInstance.getComponent(this._kernelInstance.getRootPlanComponentIdFromObjectId(e)));const n=t.childIds.size?t.childIds.size():t.childIds.length;this._configuratorUiCallbacks.onConfigurationHasChildren(n>0)}dockComponent(e,t,n,i){const s=this._kernelInstance.getComponentId(n),o=this._kernelInstance.getComponentId(e);this._kernelInstance.dockComponent(n,i,e,t),this._configuratorUiCallbacks.onUserInitiatedDockDone(s,i,o,t,null)}changeUseOfHDGeometry(e,t){this._rapiAccess.changeUseOfHDGeometry();const n=e.planObjectId,i=e.lastLoadedRapiId?e.lastLoadedRapiId:this._kernelInstance.getComponentId(n),s=this._kernelInstance.getSerializedConfiguration(n);this._kernelInstance.clearAll(),this._kernelInstance.useHDGeometry(t),AsyncHelper.finishOperation(3,[s,i])}webGlPreviewDockings(e,t){AsyncHelper.waitFor(4).then(({componentId:n})=>{t&&this.requestPlanComponentConstruction(n),this._kernelInstance.requestPreviewGeometry(n,e.planObjectId)}),e.lastPossibleChild&&e.lastPossibleChild.isComponent&&(this._kernelIo.setMeta({componentId:e.lastPossibleChild.id}),this._kernelInstance.loadPlainComponent(10,e.lastPossibleChild.id,e.lastPossibleChild.configuration)),e.lastPossibleChild&&e.lastPossibleChild.isItem&&this._kernelInstance.loadFreeFlyingConfiguration(10,e.lastPossibleChild.configuration)}previewDockingsWithDrag(e,t){this._kernelInstance.requestPreviewGeometry(e,t)}loadConfiguration(e){this._initData.id?this._memoryManager.loadingConfiguration(this._initData.id):this._memoryManager.loadingConfigurationString(),this._memoryManager.shouldHardReset()?this._kernelInstance.clearAll():this._kernelInstance.clearScene(),this._kernelInstance.loadConfiguration(9,e,{x:0,y:0,z:0})}changeCommonComponentParameter(e,t,n,i,s,o){"string"==typeof i?this._kernelInstance.setPlanComponentParameters(this._utilityToLongArray(e),t,i):console.warn("tried to set a parameter to a none string value!",i,t,n),this._finishParameterChange(n,s,o),this._updateCommonComponentDependencies(e)}changeComponentParameter(e,t,n,i,s,o){"string"==typeof i?this._kernelInstance.setComponentParameter(e,t,i):console.warn("tried to set a parameter to a none string value!",i,t,n),this._finishParameterChange(n,s,o),this._updateComponentDependencies(e)}changePlanObjectParameter(e,t,n,i,s,o){"string"==typeof i?this._kernelInstance.setPlanObjectParameter(e,t,i):console.warn("tried to set a parameter to a none string value!",i,t,n),this._finishParameterChange(n,s,o)}_finishParameterChange(e,t,n){-1===ASYNC_PARAMTER_CHANGES.indexOf(e)?setTimeout(()=>t(),0):this._configuratorKernelCallbackListener.forEach(e=>e.finishParameterChange(t,n))}requestDeleteComponents(e){e&&this._kernelInstance.deletePlanComponents(this._utilityToLongArray(e))}loadComponentIntoKernel(e,t){this._kernelIo.setMeta({componentId:t}),this._kernelInstance.loadComponentDefinition(10,e)}async requestPartListAndUpdatePricesOfParts(e,t){let n=this._kernelInstance.getFullPartList();e||(e=this._kernelInstance.getHashOfConfiguration(this._configuratorContext.planObjectId));const i=await this.addUiDataAndPriceToPartList(n,e);this._configuratorUiCallbacks.onPartListUpdate(i,btoa(e))}requestSync(e,t){this.planObjectCreated(e,t),this._kernelInstance.syncPlanObjectToView(e,t)}getGlobalParameters(e,t){return new Promise(n=>{let i=this._kernelInstance.getPlanObjectParameters,s=e;t&&(i=this._kernelInstance.getComponentParameters,s=this._kernelInstance.getRootPlanComponentIdFromObjectId(e)),n(i.apply(this._kernelInstance,[s]))})}getPartList(){return new Promise(e=>{e(this._kernelInstance.getFullPartList())})}getConfigurationHash(e){return new Promise(t=>t(this._kernelInstance.getHashOfConfiguration(e.planObjectId)))}requestPlanObjectConstruction(e){this._kernelInstance.requestPlanObjectConstruction(e)}isReady(){super.isReady(),Benchmark.end("kernel_is_ready"),this._setupKernel(),Env.isProduction||(window.__RML__DEBUG__.Kernel=this._kernelInstance,window.__RML__DEBUG__.KernelContainer=this._kernelContainer,window.__RML__DEBUG__.Helper={convertCObject}),this._configuratorKernelAccessCallback.isReady(),this._configuratorUiCallbacks.onConfiguratorKernelIsReady(this._kernelContainer,this._kernelInstance),AppContext.planObjectId&&this.planObjectCreated(-1,AppContext.planObjectId)}_setupKernel(){1===this._kernelType&&(Benchmark.start("kernel_create_instance"),AppContext.kernelInstance?this._kernelInstance=AppContext.kernelInstance:this._kernelInstance=new this._kernelContainer.Kernel,Benchmark.end("kernel_create_instance")),this._initKernel()}onLoadComponentError(e,t){this._configuratorUiCallbacks.onComponentLoadError(e,t)}configurationLoaded(e,t,n,i,s){AsyncHelper.finishOperation(4,{conversationId:e,objectId:t,componentId:n,hash:i,errors:convertCObject(s)}),this._configuratorKernelCallbackListener.forEach(o=>o.configurationLoaded(e,t,n,i,s))}componentDefinitionLoaded(e,t){AsyncHelper.finishOperation(0,t)}componentDefinitionLoadingError(e,t){this._kernelIo.error(t),AsyncHelper.failOperation(0,new Error(t))}configurationLoadingError(e,t){let n="Configuration loading error";if(t){const e=convertCObject(t);Array.isArray(e)&&(n=e.join("\n"),e.forEach(e=>this._kernelIo.error(e)))}AsyncHelper.failOperation(4,new Error(n)),AsyncHelper.failOperation(2,new Error(n))}componentConfigurationUpdated(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.componentConfigurationUpdated(e,t)),this._kernelInstance.requestDeltaPlanComponentConstruction(e)}setActiveGroupInView(e){this._kernelInstance.setActiveGroupInView(e)}setActiveGroupInViewForPlanObject(e,t){this._kernelInstance.setActiveGroupInViewForPlanObject(e,t||this._configuratorContext.planObjectId)}componentParameters(){}requestComponentDimensions(){}planObjectCreated(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.planObjectCreated(e,t))}planObjectUpdated(e){const t=this._kernelInstance.getPlanObject(e);this._onBoundsUpdate(t),this._configuratorKernelCallbackListener.forEach(e=>e.planObjectUpdated(t))}planObjectConfigurationUpdated(e,t,n){this.updatePlanObjectDependencies(e);let i=this._kernelInstance.getComponent(this._kernelInstance.getRootPlanComponentIdFromObjectId(e));this._configuratorKernelCallbackListener.forEach(i=>i.planObjectConfigurationUpdated(e,t,n));const s=this._kernelInstance.getPlanObject(e);return this._onBoundsUpdate(s),this._configuratorHistory.push(t),this._updateConfigurationHasChildren(e,i),this.requestPartListAndUpdatePricesOfParts(n)}_onBoundsUpdate(e){if(!e.boxForMeasurement)return;const t={width:this._unitFormatter.formatMMValueToUnitString(e.boxForMeasurement.size.x),height:this._unitFormatter.formatMMValueToUnitString(e.boxForMeasurement.size.z),depth:this._unitFormatter.formatMMValueToUnitString(e.boxForMeasurement.size.y),kernelBounds:e.boxForMeasurement};this._configuratorUiCallbacks.onBoundsUpdate(t)}planObjectDeleted(){}requestPlanObjectDimensions(){}async requestExternalMesh(e,t){let n=()=>{};const i=new Promise((e,t)=>{n=e});let s;this.externalMeshQueue.push(i);try{s=await this._rapiAccess.getMesh(e,"crt",t)}catch(t){throw this._configuratorUiCallbacks.onError(new Error(`Mesh with id "${e}" can not be loaded. "${t}"`)),console.error(t),t}try{const i=await fetch(new Request(this._dataSyncer.requestAsset(s.url,!0))),o=await i.arrayBuffer();this._handleCortoMesh(o,e,t),n()}catch(t){throw this._configuratorUiCallbacks.onError(new Error(`Mesh with id "${e}" breaks. "${t}"`)),console.error(t),t}}Editor3dComponentCreated(e,t,n,i){this._configuratorKernelCallbackListener.forEach(s=>s.Editor3dComponentCreated(e,t,n,i,!1)),i&&i>0&&this._configuratorKernelCallbackListener.forEach(s=>s.Editor3dComponentDocked(e,i,t,n))}Editor3dRootComponentCreated(e,t,n,i){this._configuratorKernelCallbackListener.forEach(s=>s.Editor3dComponentCreated(e,t,n,i,!0))}Editor3dPlanObjectConstructionDone(e){return this._configuratorKernelCallbackListener.forEach(t=>t.Editor3dPlanObjectConstructionDone(e)),this.updatePlanObjectDependencies(e),this._updateConfigurationHasChildren(e),Benchmark.end("ui_load_configuration"),this._calcPrice()}Editor3dBeginGroup(){}Editor3dEndGroup(){}Editor3dSetMaterial(){}Editor3dLoadMaterial(){}Editor3dAddDockPreview(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.Editor3dAddDockPreview(e,t))}Editor3dSetPreviewPointAssociations(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.Editor3dSetPreviewPointAssociations(e,t))}Editor3dSetPreviewLineAssociations(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.Editor3dSetPreviewLineAssociations(e,t))}Editor3dPreviewConstructionDone(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.Editor3dPreviewConstructionDone(e,t))}Editor3dTranslateBy(){}Editor3dRotateBy(){}Editor3dRotateAround(){}Editor3dAddCube(){}Editor3dAddCubeUVMod(){}Editor3dAddSphere(){}Editor3dAddSphereUVMod(){}Editor3dAddRectangle(){}Editor3dAddRectangleUVMod(){}Editor3dAddMesh(){}Editor3dAddMeshUVMod(){}Editor3dAddMeshUVCoord(){}Editor3dAddCylinder(){}Editor3dAddCylinderUVMod(){}Editor3dAddPrism(){}Editor3dAddPrismUVMod(){}Editor3dAddFittingPoint(){}Editor3dAddFittingLine(){}Editor3dSelectObject(){}Editor3dCopy(){}Editor3dUpdatePlanObjectPosition(){}Editor3dUpdatePlanObjectRotation(){}Editor3dUpdatePlanObjectTransform(){}Editor3dUpdatePlanComponentPosition(){}Editor3dUpdatePlanComponentRotation(){}Editor3dUpdatePlanComponentTransform(){}getRuntimeComponentIdOfRootComponent(e){return this._kernelInstance?this._kernelInstance.getRootPlanComponentIdFromObjectId(e):(console.warn("this._kernelInstance not ready now"),0)}getRuntimeComponentId(e){return this._kernelInstance.getComponentId(e)}getParameterGroups(){if(!this._configuratorContext.planObjectId)return[];const e=this._kernelInstance.getRootPlanComponentIdFromObjectId(this._configuratorContext.planObjectId);return this._kernelInstance.getComponent(e).parameterGroups}resume(){this.muteKernelCallbacks||super.resume()}getSerializedConfiguration(e){return this._kernelInstance.getSerializedConfiguration(e)}getCurrentConfigurationHash(e){return this._kernelInstance.getHashOfConfiguration(e)}listOfVariantsError(e,t){this._kernelIo.setMeta({rapiId:e}),this._kernelIo.error(t)}}__decorate([inject],ConfiguratorKernelAccess.prototype,"_memoryManager",void 0),__decorate([inject],ConfiguratorKernelAccess.prototype,"_configuratorKernelAccessCallback",void 0),__decorate([inject],ConfiguratorKernelAccess.prototype,"_initData",void 0),__decorate([inject],ConfiguratorKernelAccess.prototype,"_configuratorHistory",void 0);class NodePlanElementViewModel extends PlanElementViewModel{constructor(e){super(e),this._topView=!1;const t=this.getPlanElement().getMaxWallHeight();this._container.position.y=(t<0?2800:t)/1e3+.01,this._container.name="Node Plan Element",this.addMesh(this._nodeUiMesh)}update(){super.update(),this._container.position.y=this.getPlanElement().getMaxWallHeight()/1e3+.01}_initNodeMesh(){if(this._nodeUiMesh)return;const e=new THREE.SphereGeometry(.05,32),t=new THREE.MeshBasicMaterial({color:16777215});this._sphere=new THREE.Mesh(e,t);const n=new THREE.RingGeometry(.05,.07,32),i=new THREE.MeshBasicMaterial({color:0,side:THREE.DoubleSide});this._innerRingMesh=new THREE.Mesh(n,i),this._innerRingMesh.rotation.set(Math.PI/2,0,0);const s=new THREE.RingGeometry(.07,.08,32),o=new THREE.MeshBasicMaterial({color:16777215,side:THREE.DoubleSide});this._outerRingMesh=new THREE.Mesh(s,o),this._outerRingMesh.rotation.set(Math.PI/2,0,0),this._nodeUiMesh=new THREE.Mesh,this._nodeUiMesh.add(this._sphere),this._nodeUiMesh.add(this._innerRingMesh),this._nodeUiMesh.add(this._outerRingMesh)}setTopView(e){this._topView=e,this._topView||(this._nodeUiMesh.visible=!1)}getSize(){return this._initNodeMesh(),(new THREE.Box3).setFromObject(this._nodeUiMesh).getSize(new THREE.Vector3)}show(){this._nodeUiMesh.visible=this._topView}hide(){this._nodeUiMesh.visible=!1}select(){this._innerRingMesh.material=new THREE.MeshBasicMaterial({color:10526880,side:THREE.DoubleSide}),super.select()}deselect(){this._innerRingMesh.material=new THREE.MeshBasicMaterial({color:0,side:THREE.DoubleSide}),super.deselect()}hoverOn(){this._sphere.geometry=new THREE.SphereGeometry(.07,32),this._innerRingMesh.geometry=new THREE.RingGeometry(.07,.07+.02,32),this._outerRingMesh.geometry=new THREE.RingGeometry(.07+.02,.1,32),super.hoverOn()}hoverOff(){this._sphere.geometry=new THREE.SphereGeometry(.05,32),this._innerRingMesh.geometry=new THREE.RingGeometry(.05,.07,32),this._outerRingMesh.geometry=new THREE.RingGeometry(.07,.08,32),super.hoverOff()}_generateBoundingBox(){const e=super._generateBoundingBox();return e.layers.set(9),e}}class ConstructionPlanObjectViewModel extends StaticPlanObjectViewModel{constructor(e){super(e),this._container.name="Construction "+this._container.name}setTopView(e){e?this._enableTopView():this._disableTopView()}_enableTopView(){if(!this._topViewContainer){this._topViewContainer=new THREE.Group;const e=this.getPlanElement(),{x:t,z:n}=convertToThreeDimensions(e.size),i=new THREE.BoxGeometry(t,.01,n);if(this._topGreyMesh=new THREE.Mesh(i,new THREE.MeshStandardMaterial({transparent:!0,opacity:1,color:11645361})),this._topViewContainer.add(this._topGreyMesh),"window"===e.getObjectType()){const e=new THREE.BoxGeometry(t,.02,.05);this._topBlackMesh=new THREE.Mesh(e,new THREE.MeshStandardMaterial({transparent:!0,opacity:1,color:0})),this._topViewContainer.add(this._topBlackMesh)}this._topViewContainer.position.y=5,this._container.add(this._topViewContainer)}this._topViewContainer.visible=!0}_disableTopView(){this._topViewContainer.visible=!1}getPlanElement(){return super.getPlanElement()}_generateBoundingBox(){const e=super._generateBoundingBox(),t=this.getSize();return e.geometry=new THREE.BoxGeometry(t.x,5,t.z),e}_updateBoundingBox(){super._updateBoundingBox();const e=this.getSize();this._boundingBox.geometry=new THREE.BoxGeometry(e.x,5,e.z)}getTopViewContainer(){return this._topViewContainer}update(){if(super.update(),!this._topGreyMesh)return;const{x:e,z:t}=convertToThreeDimensions(this.getPlanElement().size);this._topGreyMesh.geometry=new THREE.BoxGeometry(e,.01,t),this._topBlackMesh&&(this._topBlackMesh.geometry=new THREE.BoxGeometry(e,.02,.05))}}class PlannerKernelAccess extends ConfiguratorKernelAccess{get kernelContainer(){return this._kernelContainer}constructor(e){super(e),this._plannerKernelCallbackListener=new Set}_loadSuccess(){super._loadSuccess(),window.RoomleCore&&window.RoomleCore(this._kernelContainer)}_loadError(){super._loadError(),console.error("kernel load error")}_createPlanInteractionHandler(){this._planInteractionHandler=new this._kernelContainer.PlanInteractionHandler,this._planInteractionHandler.init(this._planInteractionHandler,1,50,!0,!0,this._kernelContainer.DrawingType.CLICK_PER_CLICK),this._roomlePlannerUiCallback.onPlanInteractionHandlerCreated(this._planInteractionHandler)}addPlannerListener(e){this._plannerKernelCallbackListener.add(e)}removePlannerListener(e){this._plannerKernelCallbackListener.delete(e)}isReady(){super.isReady(),this.registerCallbacks(),this._roomlePlannerUiCallback.onPlannerKernelIsReady(this._kernelContainer),this._roomlePlannerUiCallback.onConfiguratorKernelIsReady(this._kernelContainer,this._kernelInstance),Env.isProduction||(window.__RML__DEBUG__.ConfiguratorKernel=this._kernelInstance,window.__RML__DEBUG__.PlannerKernelContainer=this._kernelContainer),this._kernelAccessCallback.isReady()}_setupKernel(){0===this._kernelType&&(this._createPlanInteractionHandler(),AppContext.kernelInstance?this._kernelInstance=AppContext.kernelInstance:this._kernelInstance=this._planInteractionHandler.getConfiguratorKernel()),super._setupKernel()}get callbacks(){return this._roomlePlannerUiCallback}get planInteractionHandler(){return this._planInteractionHandler}get planModelViewHelper(){return this._kernelContainer.PlanModelViewHelper}catalogItemLoaded(e){const t=this._rapiItemToKernelItem(e);this._kernelContainer.catalogItemLoaded(t)}async insertItems(e){this.planInteractionHandler.startInteraction();let t=new this._kernelContainer.CatalogItemPtrList;e.forEach(e=>{let n=e.count||1;for(let i=0;i<n;i++)e.count||(e.count=0),t.push_back(this._rapiItemToKernelItem(e))});const n=this.planInteractionHandler.getPlan().extRef.jsObject,i=n.getPlanObjectViewModelsFromRapiId().reduce((e,t)=>(e[t.getId()]=!0,e),{});this.planInteractionHandler.addPlanObjects(t),await Promise.allSettled([Promise.allSettled(n.getStaticPlanObjectViewModels().map(async e=>{if(e.needsRapiItem()){const t=await this._rapiAccess.getItem(e.getPlanObject().getCatalogItemId());e.setRapiItem(t)}})),Promise.allSettled(n.getConfigurablePlanObjectViewModels().map(e=>e.isInitDone()))]);const s=n.getPlanObjectViewModelsFromRapiId().map(e=>e.getId()).filter(e=>!i[e]);return this.planInteractionHandler.endInteraction(),s}_rapiItemToKernelItem(e){let t=new this._kernelContainer.CatalogItem(e.id),n=t.size;return n.x=e.width||0,n.y=e.depth||0,n.z=e.height||0,t.size=n,t.flipable=e.flipable,e.layer&&(t.layer=e.layer),t.orderable=e.orderable,t.scaleable=e.scaleable,t.type=e.type||"other",t.detailType=e.detailType||t.type||"other",t.configuration=e.configuration||"",t}planObjectDeleted(){}requestPlanObjectDimensions(){}cleanUpCallbacks(){var e;super.cleanUpCallbacks(),(null===(e=this._kernelContainer)||void 0===e?void 0:e.unregisterPlannerCallback)&&this._kernelContainer.unregisterPlannerCallback(this)}registerCallbacks(){var e;super.registerCallbacks(),(null===(e=this._kernelContainer)||void 0===e?void 0:e.registerPlannerCallback)&&this._kernelContainer.registerPlannerCallback(this)}planElementRemoved(e){this._plannerKernelCallbackListener.forEach(t=>t.planElementRemoved(e)),this._plannerKernelCallbackListener.forEach(t=>t.removePlanObjectFromScene(e.extRef.jsObject)),this._decoupleReferences(e)}handlerSwitchedPlans(e,t){this._decoupleReferences(e),t&&this._plannerKernelCallbackListener.forEach(n=>n.handlerSwitchedPlans(e,t))}planBoundsChanged(){this._plannerKernelCallbackListener.forEach(e=>e.planBoundsChanged())}planCleared(){this._plannerKernelCallbackListener.forEach(e=>e.planCleared())}planCompletelyLoaded(e){this._plannerKernelCallbackListener.forEach(t=>t.planCompletelyLoaded(e))}planElement3dMeshChanged(e,t){if(t.extRef){const e=t.extRef.jsObject;for(let t=e.getObject().children.length-1;t>=0;t--)e.getObject().remove(e.getObject().children[t])}this.planModelViewHelper.requestMesh3d(t)}async _onStaticItemAdded(e,t){let n;n=this.isConstructionPlanElement(t)?new ConstructionPlanObjectViewModel(t):new StaticPlanObjectViewModel(t),this.coupleReferences(n,t),e.extRef.jsObject.addPlanElementViewModel(n);const i=t.getCatalogItemId();if(i){const e=await this._rapiAccess.getItem(i);n.setRapiItem(e),this._plannerKernelCallbackListener.forEach(e=>e.addPlanObjectToScene(n))}}_onConfigurableItemAdded(e,t){const n=new ConfiguratorPlanObjectViewModel(t);this.coupleReferences(n,t),e.extRef.jsObject.addPlanElementViewModel(n),this._plannerKernelCallbackListener.forEach(e=>e.addPlanObjectToScene(n))}async planElementAdded(e,t){if(e&&e.extRef)if(t.getType()===this._kernelContainer.PlanElementType.OBJECT)t.hasConfiguration()?this._onConfigurableItemAdded(e,t):await this._onStaticItemAdded(e,t);else{const n=t;let i;if(t.getType()===this._kernelContainer.PlanElementType.WALL?i=new WallPlanElementViewModel(n):t.getType()===this._kernelContainer.PlanElementType.FLOOR?i=new FloorPlanElementViewModel(n):t.getType()===this._kernelContainer.PlanElementType.CEILING?i=new CeilingPlanElementViewModel(n):t.getType()===this._kernelContainer.PlanElementType.NODE&&(i=new NodePlanElementViewModel(n)),!i)return;this.coupleReferences(i,n),e.extRef.jsObject.addPlanElementViewModel(i),i.setPrimaryColor(this._initData.colors.PRIMARY),this.planModelViewHelper.requestMesh3d(t),this._plannerKernelCallbackListener.forEach(e=>e.addPlanObjectToScene(null))}}planElementChanged(e,t){if(t.extRef){let n=t.extRef.jsObject;n.update(),this._plannerKernelCallbackListener.forEach(t=>t.planElementChanged(e,n))}}planHistoryStateChanged(){this.planInteractionHandler&&(this._plannerKernelCallbackListener.forEach(e=>e.planHistoryStateChanged()),this._roomlePlannerUiCallback.onHistoryChange(this.planInteractionHandler.isUndoPossible(),this.planInteractionHandler.isRedoPossible()))}planObjectConfigurationCreated(e,t){}planObjectConfigurationLoaded(e,t,n){e&&e.extRef&&t&&t.extRef&&t.extRef.jsObject.getPlanObject().getConfigurationRuntimeId()>0&&this._plannerKernelCallbackListener.forEach(i=>i.planObjectConfigurationLoaded(e,t,n))}requestCatalogItem(e){}startedDrawing(){this._plannerKernelCallbackListener.forEach(e=>e.startedDrawing())}stoppedDrawing(){this._plannerKernelCallbackListener.forEach(e=>e.stoppedDrawing())}updateMesh2d(){}beginConstruction(){}addMesh(e,t,n,i,s,o){this._plannerKernelCallbackListener.forEach(r=>r.addMesh(e,t,n,i,s,o))}endConstruction(){}beginPlanConstruction(e){this._plannerKernelCallbackListener.forEach(t=>t.beginPlanConstruction(e))}addPlanMesh(e,t,n,i,s,o,r){this._plannerKernelCallbackListener.forEach(a=>a.addPlanMesh(e,t,n,i,s,o,r))}endPlanConstruction(e){this._plannerKernelCallbackListener.forEach(t=>t.endPlanConstruction(e))}async addPlanObjectFromItem(e,t,n){if(!t&&!n){const t=await this.insertItems([e]);if(1!==t.length)throw new Error("It was expected that 1 element is added but"+t.length+"were added");return t[0]}n=n||0===n?n:0,t=t||{x:0,y:0,z:0};const i=this._planInteractionHandler.addPlanObjectFromItem(this._rapiItemToKernelItem(e),t,n),s=this._planInteractionHandler.getPlan().extRef.jsObject;let o;return i.hasConfiguration()?(o=s.getConfigurablePlanObjectForId(i.getId()),o||console.warn("Could not find configuration")):(o=s.getStaticPlanObjectForId(i.getId()),o?await o.setRapiItem(e):console.warn("Could not find static item")),await o.isInitDone(),o.getId()}coupleReferences(e,t){let n=new this._kernelContainer.EMSReference;n.jsObject=e,t.extRef=n}_decoupleReferences(e){e&&e.extRef&&(e.extRef.jsObject.clearReference(),e.extRef.jsObject=null,e.extRef.delete(),e.extRef=null)}isConstructionPlanElement(e){return e instanceof this.kernelContainer.ConstructionObject}}__decorate([inject],PlannerKernelAccess.prototype,"_kernelAccessCallback",void 0),__decorate([inject],PlannerKernelAccess.prototype,"_roomlePlannerUiCallback",void 0);class PlannerMeshGenerator extends MeshGenerator{constructor(e){super(e),this._wallMeshes=[],this._defaultMaterial=new THREE.MeshPhysicalMaterial({color:"#ffffff",side:THREE.DoubleSide}),this._environmentLoader.setEnvMap(this._defaultMaterial),this._defaultMaterialFloor=new THREE.MeshPhysicalMaterial({color:"#ffffff"}),this._environmentLoader.setEnvMap(this._defaultMaterialFloor),this._environmentLoader.onEnvMapUpdate(()=>{this._environmentLoader.setEnvMap(this._defaultMaterial),this._environmentLoader.setEnvMap(this._defaultMaterialFloor)})}generateGeometry(e=null,t,n,i,s,o=!1){let r;return r=o?this._generateGeometry(e,t,n,i,s).clone():this._generateGeometry(e,t,n,i,s),r}generateMesh(e=0,t=null,n,i,s,o,r,a,l=!1){let c;c=l?this._generateGeometry(t,i,s,o,r).clone():this._generateGeometry(t,i,s,o,r);const h=this._createMesh(e,t,c);return h.userData.materialId=n,h.layers.set(4),n&&this.setMaterial(h,n,a).then(()=>{e&&t&&n&&this._geometryComponentMaterialCache.set(this._getComponentMeshId(e,t),n);const i=a&&3===a.value,s=a&&1===a.value;h.castShadow=!i&&!s}),this._checkWallMaterial(h,a),h}async setMaterial(e,t,n){if(e.userData.material=getMaterialId(t,n),e.userData.materialId=t,isString(t))t?await this._assignMaterial(e,t):(console.warn("Used default material because material is empty"),this.changeMaterialOfMesh(e,this._getDefaultMaterial(n)));else{if(!t)return void this.changeMaterialOfMesh(e,this._configuratorPreviewMaterial);2===(t=t).getSourceType().value?await this._assignMaterial(e,t.materialId):1===t.getSourceType().value?await this._assignItem(e,t.catalogItemId):3===t.getSourceType().value?await this._assignRGB(e,t.rgbValue):0===t.getSourceType().value?this.changeMaterialOfMesh(e,this._getDefaultMaterial(n)):(this.changeMaterialOfMesh(e,this._getDefaultMaterial(n)),1!==n.value&&7!==n.value&&3!==n.value&&console.warn("Used default material because material is not supported",t))}}_getDefaultMaterial(e){return 3===(null==e?void 0:e.value)?this._defaultMaterialFloor:this._defaultMaterial}set maxAnisotropy(e){this._maxAnisotropy=e}_checkWallMaterial(e,t){t&&1===t.value&&(e.renderOrder=5,this._wallMeshes.push(e))}clear(){super.clear(),this.clearWallMeshes()}clearWallMeshes(){this._wallMeshes.forEach(e=>{disposeMesh(e)}),this._wallMeshes=[]}get wallMeshes(){return this._wallMeshes}}let KERNEL_UNIT={InchFeet:null,MM:null,CM:null},KERNEL_UNIT_STRING_TYPE={NoUnitString:null,LongUnitString:null,ShortUnitString:null};class UnitFormatter{constructor(e){this._formatter=null,this._precision=0,this._creator_=e}init(e){const t=new e.UnitMeasureFormatter;KERNEL_UNIT=e.Unit,KERNEL_UNIT_STRING_TYPE=e.UnitStringType,this._initActualUnit(),this._initActualUnitStringType();const{precisionCm:n,precisionInch:i}=this._initData;this._actualUnit===KERNEL_UNIT.InchFeet?this._precision=void 0!==i?parseInt(i,10):2:this._actualUnit===KERNEL_UNIT.CM&&(this._precision=void 0!==n?parseInt(n,10):1),t.init("mm","cm","'","ft",'"',"inch","m²","sqft",!0,this._precision),this._formatter=t}_initActualUnit(){const{unit:e}=this._initData;switch(e){case"cm":this._actualUnit=KERNEL_UNIT.CM;break;case"mm":this._actualUnit=KERNEL_UNIT.MM;break;case"inchfeet":this._actualUnit=KERNEL_UNIT.InchFeet;break;default:this._actualUnit=KERNEL_UNIT.CM}}_initActualUnitStringType(){const{unitStringType:e}=this._initData;switch(e){case"none":this._actualUnitStringType=KERNEL_UNIT_STRING_TYPE.NoUnitString;break;case"long":this._actualUnitStringType=KERNEL_UNIT_STRING_TYPE.LongUnitString;break;case"short":this._actualUnitStringType=KERNEL_UNIT_STRING_TYPE.ShortUnitString;break;default:this._actualUnitStringType=KERNEL_UNIT_STRING_TYPE.ShortUnitString}}_isFormatterReady(){return!!this._formatter||(console.warn("Formatter is not ready..."),!1)}formatAngleValueToUnitString(e,t){const n="Integer"===t.type?0:2;return e.toFixed(n)+"°"}parseAngleValueFromUnitString(e){return e.replace("°","").replace(/\s/g,"")}parseValue(e,t){return null===t.unitType||"unknown"===t.unitType||"count"===t.unitType?e:"length"===t.unitType?this.parseMMValueFromUnitString(e,t.unitType):"angle"===t.unitType||"area"===t.unitType?this.parseAngleValueFromUnitString(e):e}formatValueToUnitString(e,t){return null===t.unitType||"unknown"===t.unitType||"count"===t.unitType?"Integer"===t.type?e.toString():parseFloat(e.toString()).toFixed(2):"length"===t.unitType?this.formatMMValueToUnitString(e,t.unitType):"angle"===t.unitType?this.formatAngleValueToUnitString(e,t):"area"===t.unitType?this.formatSquareMMValueToUnitString(e):e}isParseableNumber(e){return this._isFormatterReady()?this._formatter.isParseableNumber(e):null}isParseableUnitString(e,t){return this._isFormatterReady()?"angle"===t.unitType?this._formatter.isParseableUnitString(this.parseAngleValueFromUnitString(e),this._actualUnit):this._formatter.isParseableUnitString(e,this._actualUnit):null}parseMMValueFromUnitString(e,t){return this._isFormatterReady()?"count"===t?parseFloat(e):this._formatter.parseMMValueFromUnitString(e,this._actualUnit):null}parseNumber(e){return this._isFormatterReady()?this._formatter.parseNumber(e):null}formatNumber(e,t=0){return this._isFormatterReady()?this._formatter.formatNumber(e,t):null}formatSquareMMValueToUnitString(e){return this._isFormatterReady()?this._formatter.formatSquareMMValueToUnitString(e,this._actualUnit):null}formatMMValueToUnitString(e,t){return this._isFormatterReady()?"count"===t?e.toString():this._formatter.formatMMValueToUnitString(e,this._actualUnit,this._actualUnitStringType):null}formatMMValueWithReqMaxLength(e,t){return this._isFormatterReady()?this._formatter.formatMMValueWithReqMaxLength(e,this._actualUnit,t):null}_formatParameterValue(e,t){return"length"===t?this.formatMMValueToUnitString(parseFloat(e)):"area"===t?this.formatSquareMMValueToUnitString(parseFloat(e)):e}formatPartListParameter(e){(function(e){return"length"===e.unitType||"area"===e.unitType})(e)&&(e.valueLabel=this._formatParameterValue(e.value,e.unitType))}formatParameter(e){if(e.valueLabel=this._formatParameterValue(e.value,e.unitType),isMaterial(e))e.uiType="Material";else if(function(e){return"Boolean"===e.type}(e))e.uiType="Boolean";else if(isRange(e)){e.uiType="Range";const t=null!==e.validRange.valueFrom?e.validRange.valueFrom:Number.MIN_SAFE_INTEGER,n=null!==e.validRange.valueTo?e.validRange.valueTo:Number.MAX_SAFE_INTEGER;e.validRangeLabels={valueFrom:this._formatParameterValue(t.toString(),e.unitType),valueTo:this._formatParameterValue(n.toString(),e.unitType),type:e.validRange.type}}else isOptions(e)?(e.uiType="Options",function(e){return!!isOptions(e)&&Array.isArray(e.validValues)&&e.validValues.length>0&&"string"==typeof e.validValues[0].thumbnail}(e)&&(e.uiType="Thumbnails")):(console.error("Could not detect uiType of param"),e.uiType=null)}isInch(){return this._actualUnit===KERNEL_UNIT.InchFeet}getPrecision(){return this._precision}getAllowedDelta(){const e=1/Math.pow(10,this._precision);return this.isInch()?25.4*e:e}setUnitInitData(e){this._initData.unit=e,this._initActualUnit(),this._initActualUnitStringType()}}__decorate([inject],UnitFormatter.prototype,"_initData",void 0);class ConfiguratorHistory{constructor(e){this._history=[],this._index=0,this._creator_=e}undo(){if(!this.canUndo())return null;this._index++;const[e]=this._history.slice(this._index);return this._index===this._history.length-1?this._configuratorUiCallbacks.onHistoryChange(!1,!0):this._configuratorUiCallbacks.onHistoryChange(!0,!0),e}redo(){if(!this.canRedo())return null;this._index--;const[e]=this._history.slice(this._index);return 0===this._index?this._configuratorUiCallbacks.onHistoryChange(!0,!1):this._configuratorUiCallbacks.onHistoryChange(!0,!0),e}push(e){const[t]=this._history.slice(this._index);t!==e&&(this._history=this._history.slice(this._index),this._history.unshift(e),this._index=0,1===this._history.length?this._configuratorUiCallbacks.onHistoryChange(!1,!1):this._configuratorUiCallbacks.onHistoryChange(!0,!1))}canUndo(){return this._index!==this._history.length-1}canRedo(){return 0!==this._index}getHistory(){return this._history}clearHistory(){this._history=[],this._index=0}}__decorate([inject],ConfiguratorHistory.prototype,"_configuratorUiCallbacks",void 0);const PLAN_ELEMENT_CHANGE_TYPES={ADDED:"added",CHANGED:"changed",REMOVED:"removed"};class RoomleToolsCore{constructor(e){this._kernelCallbacks={isReady:()=>{},throw:e=>console.error("Kernel exception",e),log:e=>{},error:(e,t,n,i)=>{},message:e=>{this._analyzeComponentCallback&&this._analyzeComponentCallback(e)}},this._creator_=e}async init(){if(this._toolsCoreInstance)return Promise.resolve();const e=this,t={locateFile:e=>"RoomleToolsCore.wasm"===e?getAssetPath()+"static/RoomleToolsCore-152f43851b519f0a.wasm":e,wasmBinaryFile:getAssetPath()+"static/RoomleToolsCore-152f43851b519f0a.wasm",preRun:[],postRun:[],setStatus:null,print(t){e._kernelIo.log(t)},printErr(t){e._kernelIo.error(t)},quit(t){0!==t&&e._kernelIo.throw(t&&t.toString?t.toString():"Unknown error while C/C++ main executes")}};await this._scriptLoader.fetch("static/RoomleToolsCore-1fbf3bc88981cea9.js",{id:"core-tool"});const n=await window.RoomleToolsCore(t);n.setContext(this._kernelCallbacks),this._toolsCoreInstance=new n.ToolsCoreInterface}analyzeComponent(e,t){const n=[];return this._analyzeComponentCallback=e=>{n.push(e)},this._toolsCoreInstance.analyzeComponent(e,t),this._analyzeComponentCallback=null,Promise.resolve(n)}}__decorate([inject],RoomleToolsCore.prototype,"_scriptLoader",void 0),__decorate([inject],RoomleToolsCore.prototype,"_kernelIo",void 0);const INJECTABLES=[new DependencyInjectionAssignment("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 i=n.length;for(let e=0;e<i;e++){const i=n[e];i.apply(i,t)}}unsubscribe(e,t){if(!this._listeners[e])return;const n=this._listeners[e];let i=n.length;for(let e=0;e<i;e++)if(n[e]===t)return n.splice(e,1),i--,void e--}softReject(e,t,n){return this.dispatch(n,[t]),e()}}),new DependencyInjectionAssignment("form-data-util",FormDataUtil),new DependencyInjectionAssignment("environment-loader",EnvironmentLoader),new DependencyInjectionAssignment("static-item-loader",StaticItemLoader,0),new DependencyInjectionAssignment("form-data-util",FormDataUtil),new DependencyInjectionAssignment("single-promise-factory",class{constructor(e){this._promises=new Map,this._creator_=e}create(e,t,n){return new Promise((i,s)=>{let o=this._promises.get(e),r=!0;if(!o){const t=new Map;this._promises.set(e,t),o=this._promises.get(e),r=!1}o.get(t)||(o.set(t,[]),r=!1);const a=o.get(t);a.push({resolve:i,reject:s}),o.set(t,a);const l=()=>{o.delete(t),0===o.size&&this._promises.delete(e)};r||new Promise(n).then(e=>{o.get(t).forEach(({resolve:t})=>t(e)),l()},e=>{o.get(t).forEach(({reject:t})=>t(e)),l()})})}},1),new DependencyInjectionAssignment("dynamic-light-setting-loader",DynamicLightSettingLoader),new DependencyInjectionAssignment("dynamic-quality-setting-loader",DynamicQualitySettingLoader),new DependencyInjectionAssignment("network-layer",NetworkLayer),new DependencyInjectionAssignment("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 DependencyInjectionAssignment("network-layer",NetworkLayer),new DependencyInjectionAssignment("kernel-io",KernelIo,0),new DependencyInjectionAssignment("data-syncer",DataSyncer),new DependencyInjectionAssignment("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 DependencyInjectionAssignment("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 i=0;i<n;i++)t[i]===e&&(t.splice(i,1),i--,n--)}pause(){this._listeners.forEach(e=>e.pause())}resume(){this._listeners.forEach(e=>e.resume())}destroy(){this._listeners.forEach(e=>e.destroy())}},1),new DependencyInjectionAssignment("three-loader",ThreeLoader),new DependencyInjectionAssignment("local-storage-helper",LocalStorageHelper),new DependencyInjectionAssignment("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())disposeObject(e);for(const e of this._materialCache.values())disposeMaterial(e);for(const e of this._geometryCache.values())disposeGeometry(e);this._componentCache.clear(),this._geometryCache.clear(),this._materialCache.clear()}},0),new DependencyInjectionAssignment("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 DependencyInjectionAssignment("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(i=>i.updatePossibleChildren(e,t,n))}updateParameters(e,t,n,i){this._callbackListener.forEach(s=>s.updateParameters(e,t,n,i))}loadError(e){this._callbackListener.forEach(t=>t.loadError(e))}},1),new DependencyInjectionAssignment("configurator-context",class{constructor(){this.planObjectId=0,this.planElementId=0,this.rootComponentId=0,this.dockingRootComponentId=0,this.baseContext=null,this.rootComponentParametersAsGlobal=!1,this.lastLoadedRapiId=null,this.selectedRuntimeComponentIds=[],this.selectionMode="standard"}get selectedRuntimeComponentId(){return this.selectedRuntimeComponentIds.length>0?this.selectedRuntimeComponentIds[0]:null}},1),new DependencyInjectionAssignment("init-data",InitData,1),new DependencyInjectionAssignment("global-init-data",GlobalInitData,0),new DependencyInjectionAssignment("global-callback",GlobalCallback,0),new DependencyInjectionAssignment("dom-helper",DomHelper,1),new DependencyInjectionAssignment("unit-formatter",UnitFormatter,0),new DependencyInjectionAssignment("plugin-system",PluginSystem,1),new DependencyInjectionAssignment("configurator-mesh-generator",ConfiguratorMeshGenerator),new DependencyInjectionAssignment("configurator-input-manager",class extends InputManager{},1),new DependencyInjectionAssignment("selection-handler",class extends EventDispatcher{constructor(){super(...arguments),this._selectionMode="standard",this._selectedComponents=new Map}check(e){"standard"===this._selectionMode&&this._checkStandard(e),"multiselect"===this._selectionMode&&this._checkMulti(e)}cancelSelection(){0!==this._selectedComponents.size&&this._selectedComponents.forEach((e,t)=>{e.deselect(),this._selectedComponents.delete(t),this.dispatchEvent(1,new SelectionHandlerEvent({component:e}))})}_checkStandard(e){this._selectedComponents.has(e.runtimeId)?this.dispatchEvent(0,new SelectionHandlerEvent({component:e,consecutive:!0})):(this._selectedComponents.size>0&&this._selectedComponents.forEach((e,t)=>{this._selectedComponents.delete(t),this.dispatchEvent(1,new SelectionHandlerEvent({component:e,resetCamera:!1}))}),this._selectedComponents.set(e.runtimeId,e),this.dispatchEvent(0,new SelectionHandlerEvent({component:e,consecutive:!1})))}_checkMulti(e){if(this._selectedComponents.has(e.runtimeId))return this._selectedComponents.delete(e.runtimeId),void this.dispatchEvent(1,new SelectionHandlerEvent({component:e,resetCamera:0===this._selectedComponents.size}));this._selectedComponents.set(e.runtimeId,e),this.dispatchEvent(0,new SelectionHandlerEvent({component:e}))}setSelectionMode(e){this._selectionMode=e}getSelectionMode(){return this._selectionMode}hasSelection(){return this._selectedComponents.size>0}getSelectedRuntimeComponentIds(){let e=[];return this._selectedComponents.forEach(t=>e.push(t.runtimeId)),e}isSelected(e){return this._selectedComponents.has(e.runtimeId)}},1),new DependencyInjectionAssignment("component-dimensioning-helper",ComponentDimensioningHelper,1),new DependencyInjectionAssignment("component-dimensioning-helper",ComponentDimensioningHelper,1),new DependencyInjectionAssignment("planner-kernel-access",PlannerKernelAccess),new DependencyInjectionAssignment("planner-mesh-generator",PlannerMeshGenerator,1),new DependencyInjectionAssignment("unit-formatter",UnitFormatter),new DependencyInjectionAssignment("configurator-history",ConfiguratorHistory,1),new DependencyInjectionAssignment("roomle-planner-ui-callback",class extends UiCallback{constructor(e){super(e),this.onItemsLoaded=()=>{},this.onCameraChanged=e=>{},this.onTotalFloorAreaChanged=e=>{},this.onPlanInteractionHandlerCreated=e=>{},this.onPlannerKernelIsReady=e=>{},this.onConfiguratorKernelIsReady=(e,t)=>{},this.onSelectionChange=(e,t,n,i,s)=>{},this.onSelectionCancel=()=>{},this.onPlanChanged=()=>{},this.onPlanElementChanged=(e,t)=>{},this.onCompletelyLoaded=()=>{},this.onRotationCancel=()=>{},this.onHistoryChange=(e,t)=>{},this.onUpdateWallDimensions=e=>{},this.disableWallDimensions=()=>{},this.onUpdatePlanObjectPositions=e=>{},this.onDrawCancel=()=>{}}}),new DependencyInjectionAssignment("configurator-ui-callbacks",class extends UiCallback{constructor(e){super(e),this.onKernelIsReady=null,this.onComponentPositionsUpdated=null,this.onUpdateParameters=e=>{},this.onUpdatePossibleChildren=(e,t)=>{},this.onUpdatePrice=(e,t)=>{},this.onSelectionChange=(e,t,n,i)=>{},this.onSelectionCancel=()=>{},this.onPartListUpdate=(e,t)=>{},this.onBoundsUpdate=e=>{},this.onLoadConfiguration=()=>{},this.onConfigurationReady=(e,t,n)=>{},this.onOpenTag=e=>{},this.onOpenAddOns=()=>{},this.onClickOutside=()=>{},this.onNoDockingsAvailable=()=>{},this.onUiIntersectionChange=e=>{},this.onZoomChange=(e,t)=>{},this.onDimensionsVisibilityChange=e=>{},this.onErrorDueToOffline=e=>{},this.onError=e=>{},this.onDockingsPreviewRemoved=()=>{},this.onConfigurationHasChildren=e=>{},this.onTrackTiming=(e,t,n,i)=>{},this.onUserInitiatedDockDone=(e,t,n,i,s)=>{},this.onAddonPlusHover=()=>{},this.onAddonPlusHoverOff=()=>{},this.onAddonPlusShown=()=>{},this.onAddonPlusHidden=()=>{},this.onContentProblem=e=>{},this.onSyncStarted=()=>{},this.onSyncDone=()=>{},this.onOpenFloorMaterials=()=>{},this.onOpenPartList=()=>{},this.onComponentLoadError=(e,t)=>{},this.onConfigurationLoadError=()=>{},this.onChangeTypeChangeTag=e=>{},this.onRemoveTypeChangeTag=e=>{},this.onConfigurationLabelChange=(e,t,n)=>{},this.onMemoryCorruption=()=>{},this.onConfiguratorKernelIsReady=(e,t)=>{},this.onConfigurationSaved=e=>{},this.onCameraPositionChanges=()=>{},this.onHistoryChange=(e,t)=>{}}},1),new DependencyInjectionAssignment("roomle-tools-core",RoomleToolsCore,0)];class RoomleDependencyInjection{static _ensureContainer(){window.__RML__DI__||(window.__RML__DI__=new Container,window.__RML__DI__.addDependencyInjectionAssignments(INJECTABLES))}static setup(e){RoomleDependencyInjection.addToContainer(e)}static lookup(e,t){return window.__RML__DI__?window.__RML__DI__.lookup(e,t):null}static getContext(e){return RoomleDependencyInjection._ensureContainer(),window.__RML__DI__.getContext(e)}static cleanUp(e){return window.__RML__DI__?window.__RML__DI__.cleanUp(e):null}static addToContainer(e){RoomleDependencyInjection._ensureContainer(),window.__RML__DI__.addDependencyInjectionAssignments(e)}}export{addTexture as $,AppContext as A,Benchmark as B,ConfiguratorViewModel as C,DependencyInjectionAssignment as D,EventDispatcher as E,FloorPlanElementViewModel as F,isIdItemId as G,AsyncHelper as H,INJECTABLES as I,isRange as J,isMaterial as K,Logger as L,convertCObject as M,NodePlanElementViewModel as N,position3VectorsAreEqual as O,PlannerKernelAccess as P,position2VectorsAreEqual as Q,RapiAccess as R,StaticPlanObjectViewModel as S,compareBox3Size as T,getIdealDistance as U,AsyncGuard as V,WallPlanElementViewModel as W,vectorIsEqual as X,fadeIn as Y,createMaterial as Z,__decorate as _,DataSyncer as a,rotationQuaternionsAreEqual as a0,getDelta as a1,MIN_MOVE_DISTANCE as a2,sanitizedCameraMode as a3,DynamicQualitySettingLoader as a4,transitionTransparencyOfMaterial as a5,isSafari as a6,convertToTHREE as a7,threeVectorToTransferableXY as a8,PLAN_ELEMENT_CHANGE_TYPES as a9,hideWallsBasedOnCamera as aa,setWallTransparency as ab,getDrawingMinBounds as ac,wallDimensionToTransferable as ad,GLTF_LOADER_FILE_NAME as ae,DRACO_LOADER_FILE_NAME as af,InputManager as ag,PlannerMeshGenerator as ah,setMaterial as ai,getMaterialShading as aj,addExistingTexture as ak,UiCallback as al,EnvironmentLoader as am,ConfiguratorMeshGenerator as an,GlobalCallback as ao,GlobalInitData as ap,InitData as aq,AsyncDependencyLoader as ar,ScenePluginDefaultImplementation as as,RoomleDependencyInjection as b,ConfiguratorPlanObjectViewModel as c,ConstructionPlanObjectViewModel as d,CAMERA_TYPE as e,CeilingPlanElementViewModel as f,disposeMesh as g,convertToKernel as h,inject as i,getScreenXY as j,kernelBoxToThreeBox as k,getGUI as l,toDegrees as m,CANVAS_ID as n,Env as o,PULSE_LOOPS as p,PULSE_DURATION as q,DynamicLightSettingLoader as r,PREDEFINED_LIGHTSETTING as s,toRadiant as t,dispose as u,vectorIsZero as v,getYRotationOfObject as w,RoomleComponentFactoryInitializer as x,DEFAULT_CONVERSATION_ID as y,getCatalogIdFromItemOrConfigurationId as z};
16
+ //# sourceMappingURL=roomle-dependency-injection-0d6b01a8.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"roomle-dependency-injection-6d855646.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","../../packages/configurator-core/public/fonts/rubik_regular.json","../../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/wasm/RoomleToolsCore.wasm","../../node_modules/roomle-core-hsc/wasm/RoomleToolsCore.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-05824b47cdb951e4.json\"","export default \"static/equal-319f6b83c827913f.json\"","export default \"static/asset-loader.worker-d8f85c01953acd85.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-513b41a25d232f83.json\"","export default \"static/rthree-750136f8399d9f72.js\"","export default \"static/rubik_regular-bc008a7de2daee79.json\"","export default \"static/ConfiguratorKernel-fa95f23ce304f1db.wasm\"","export default \"static/ConfiguratorKernel-4a120e5209cf1cd0.js\"","export default \"static/RoomleCore-72494809ac9e04bb.wasm\"","export default \"static/RoomleCore-6c1973038e81be15.js\"","export default \"static/ConfiguratorKernelJs-b884d72267d0ed0f.mem\"","export default \"static/ConfiguratorKernelJs-843b32f9cf068595.js\"","export default \"static/RoomleCoreJs-a1ed5d94a85e5ef0.mem\"","export default \"static/RoomleCoreJs-bf2ff14d27bce33b.js\"","export default \"static/RoomleToolsCore-152f43851b519f0a.wasm\"","export default \"static/RoomleToolsCore-1fbf3bc88981cea9.js\""],"names":[],"mappings":";;;;;;;;;;;;;;uuYAAe,+DCAA,qvECAA,yGCAA,wGCAA,kGCAA,oGCAA,oGCAA,wEDAA,w4KEAA,6tHCAf,0BAAe,+DCAA,wFCAA,qECAA,gECAA,uOJAA,uFCAA,2mEIAA,2QCAA,+9zBCAA,4zaCAA,yDCAA,8DCAA,iDCAA,qECAA,0DCAA,oECAA,kDCAA,mr3FCAA,+EAAA,0RCAA"}
1
+ {"version":3,"file":"roomle-dependency-injection-0d6b01a8.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","../../packages/configurator-core/public/fonts/rubik_regular.json","../../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/wasm/RoomleToolsCore.wasm","../../node_modules/roomle-core-hsc/wasm/RoomleToolsCore.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-05824b47cdb951e4.json\"","export default \"static/equal-319f6b83c827913f.json\"","export default \"static/asset-loader.worker-d8f85c01953acd85.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-a517109fc4195f66.json\"","export default \"static/rthree-750136f8399d9f72.js\"","export default \"static/rubik_regular-bc008a7de2daee79.json\"","export default \"static/ConfiguratorKernel-fa95f23ce304f1db.wasm\"","export default \"static/ConfiguratorKernel-4a120e5209cf1cd0.js\"","export default \"static/RoomleCore-72494809ac9e04bb.wasm\"","export default \"static/RoomleCore-6c1973038e81be15.js\"","export default \"static/ConfiguratorKernelJs-b884d72267d0ed0f.mem\"","export default \"static/ConfiguratorKernelJs-843b32f9cf068595.js\"","export default \"static/RoomleCoreJs-a1ed5d94a85e5ef0.mem\"","export default \"static/RoomleCoreJs-bf2ff14d27bce33b.js\"","export default \"static/RoomleToolsCore-152f43851b519f0a.wasm\"","export default \"static/RoomleToolsCore-1fbf3bc88981cea9.js\""],"names":[],"mappings":";;;;;;;;;;;;;;uuYAAe,+DCAA,qvECAA,yGCAA,wGCAA,kGCAA,oGCAA,oGCAA,wEDAA,w4KEAA,6tHCAf,0BAAe,+DCAA,wFCAA,qECAA,gECAA,uOJAA,uFCAA,2mEIAA,2QCAA,+9zBCAA,++aCAA,yDCAA,8DCAA,iDCAA,qECAA,0DCAA,oECAA,kDCAA,436FCAA,+EAAA,0RCAA"}