@roomle/web-sdk 2.33.0 → 2.34.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (167) hide show
  1. package/lib/{banana-for-scale-1d3127e8.js → banana-for-scale-3442b519.js} +2 -2
  2. package/lib/{banana-for-scale-1d3127e8.js.map → banana-for-scale-3442b519.js.map} +1 -1
  3. package/lib/{banana-for-scale-a63fb2df.nomodule.js → banana-for-scale-939e4df7.nomodule.js} +2 -2
  4. package/lib/{banana-for-scale-a63fb2df.nomodule.js.map → banana-for-scale-939e4df7.nomodule.js.map} +1 -1
  5. package/lib/{component-dimensioning-cd3fa46e.js → component-dimensioning-707b0007.js} +2 -2
  6. package/lib/component-dimensioning-707b0007.js.map +1 -0
  7. package/lib/{component-dimensioning-6c0c9199.nomodule.js → component-dimensioning-a2828832.nomodule.js} +2 -2
  8. package/lib/component-dimensioning-a2828832.nomodule.js.map +1 -0
  9. package/lib/{configurator-3cf0afc7.js → configurator-92943a85.js} +2 -2
  10. package/lib/{configurator-3cf0afc7.js.map → configurator-92943a85.js.map} +1 -1
  11. package/lib/{configurator-9ec75ff2.nomodule.js → configurator-9f1bcb78.nomodule.js} +2 -2
  12. package/lib/{configurator-9ec75ff2.nomodule.js.map → configurator-9f1bcb78.nomodule.js.map} +1 -1
  13. package/lib/configurator-main-262ae1ac.js +2 -0
  14. package/lib/configurator-main-262ae1ac.js.map +1 -0
  15. package/lib/configurator-main.nomodule.js +1 -1
  16. package/lib/{configurator-mesh-generator-3497564c.nomodule.js → configurator-mesh-generator-ab964e61.nomodule.js} +2 -2
  17. package/lib/configurator-mesh-generator-ab964e61.nomodule.js.map +1 -0
  18. package/lib/{configurator-mesh-generator-3151246c.js → configurator-mesh-generator-fdbe8e27.js} +2 -2
  19. package/lib/configurator-mesh-generator-fdbe8e27.js.map +1 -0
  20. package/lib/{default-light-setting-6852d456.nomodule.js → default-light-setting-1980d70c.nomodule.js} +2 -2
  21. package/lib/default-light-setting-1980d70c.nomodule.js.map +1 -0
  22. package/lib/{default-light-setting-825bb619.js → default-light-setting-5690f3c6.js} +2 -2
  23. package/lib/default-light-setting-5690f3c6.js.map +1 -0
  24. package/lib/{dimensioning-helper-edfc5933.nomodule.js → dimensioning-helper-8f8c7de4.nomodule.js} +2 -2
  25. package/lib/{dimensioning-helper-edfc5933.nomodule.js.map → dimensioning-helper-8f8c7de4.nomodule.js.map} +1 -1
  26. package/lib/{dimensioning-helper-46403799.js → dimensioning-helper-a2f701e1.js} +2 -2
  27. package/lib/{dimensioning-helper-46403799.js.map → dimensioning-helper-a2f701e1.js.map} +1 -1
  28. package/lib/{glb-viewer-67e22889.js → glb-viewer-44cb38e7.js} +2 -2
  29. package/lib/{glb-viewer-67e22889.js.map → glb-viewer-44cb38e7.js.map} +1 -1
  30. package/lib/{glb-viewer-564c48c8.nomodule.js → glb-viewer-eac461db.nomodule.js} +2 -2
  31. package/lib/{glb-viewer-564c48c8.nomodule.js.map → glb-viewer-eac461db.nomodule.js.map} +1 -1
  32. package/lib/glb-viewer-main-0ef0fd4e.js +2 -0
  33. package/lib/glb-viewer-main-0ef0fd4e.js.map +1 -0
  34. package/lib/glb-viewer-main.nomodule.js +1 -1
  35. package/lib/{image-renderer-d3652216.js → image-renderer-5777b9d7.js} +2 -2
  36. package/lib/{image-renderer-d3652216.js.map → image-renderer-5777b9d7.js.map} +1 -1
  37. package/lib/{image-renderer-5394fa5b.nomodule.js → image-renderer-bf04d0a9.nomodule.js} +2 -2
  38. package/lib/{image-renderer-5394fa5b.nomodule.js.map → image-renderer-bf04d0a9.nomodule.js.map} +1 -1
  39. package/lib/legacy/{banana-for-scale-2ae53764.legacy.js → banana-for-scale-6af330cd.legacy.js} +2 -2
  40. package/lib/legacy/{banana-for-scale-2ae53764.legacy.js.map → banana-for-scale-6af330cd.legacy.js.map} +1 -1
  41. package/lib/legacy/{component-dimensioning-eeddfbe4.legacy.js → component-dimensioning-2c1ef0a0.legacy.js} +2 -2
  42. package/lib/legacy/component-dimensioning-2c1ef0a0.legacy.js.map +1 -0
  43. package/lib/legacy/{configurator-b980d570.legacy.js → configurator-aaf3a182.legacy.js} +2 -2
  44. package/lib/legacy/{configurator-b980d570.legacy.js.map → configurator-aaf3a182.legacy.js.map} +1 -1
  45. package/lib/legacy/configurator-main.legacy.js +1 -1
  46. package/lib/legacy/{configurator-mesh-generator-32a1a893.legacy.js → configurator-mesh-generator-929313c6.legacy.js} +2 -2
  47. package/lib/legacy/configurator-mesh-generator-929313c6.legacy.js.map +1 -0
  48. package/lib/legacy/{default-light-setting-0c03b9e5.legacy.js → default-light-setting-135fb853.legacy.js} +2 -2
  49. package/lib/legacy/default-light-setting-135fb853.legacy.js.map +1 -0
  50. package/lib/legacy/{dimensioning-helper-82ad5e54.legacy.js → dimensioning-helper-d2d6f040.legacy.js} +2 -2
  51. package/lib/legacy/{dimensioning-helper-82ad5e54.legacy.js.map → dimensioning-helper-d2d6f040.legacy.js.map} +1 -1
  52. package/lib/legacy/{glb-viewer-cb5014ee.legacy.js → glb-viewer-efc13817.legacy.js} +2 -2
  53. package/lib/legacy/{glb-viewer-cb5014ee.legacy.js.map → glb-viewer-efc13817.legacy.js.map} +1 -1
  54. package/lib/legacy/glb-viewer-main.legacy.js +1 -1
  55. package/lib/legacy/{image-renderer-5dc590d6.legacy.js → image-renderer-3059c670.legacy.js} +2 -2
  56. package/lib/legacy/{image-renderer-5dc590d6.legacy.js.map → image-renderer-3059c670.legacy.js.map} +1 -1
  57. package/lib/legacy/{material-viewer-d7122341.legacy.js → material-viewer-014c4b3c.legacy.js} +2 -2
  58. package/lib/legacy/material-viewer-014c4b3c.legacy.js.map +1 -0
  59. package/lib/legacy/material-viewer-main.legacy.js +1 -1
  60. package/lib/legacy/{mesh-generator-bcc95cb6.legacy.js → mesh-generator-e4d5131c.legacy.js} +2 -2
  61. package/lib/legacy/mesh-generator-e4d5131c.legacy.js.map +1 -0
  62. package/lib/legacy/{pixotron-35cea8f8.legacy.js → pixotron-3225a8b2.legacy.js} +2 -2
  63. package/lib/legacy/{pixotron-35cea8f8.legacy.js.map → pixotron-3225a8b2.legacy.js.map} +1 -1
  64. package/lib/legacy/{planner-b9154820.legacy.js → planner-586ddb9d.legacy.js} +2 -2
  65. package/lib/legacy/{planner-b9154820.legacy.js.map → planner-586ddb9d.legacy.js.map} +1 -1
  66. package/lib/legacy/planner-main.legacy.js +1 -1
  67. package/lib/legacy/{rapi-access-ab9c7de3.legacy.js → rapi-access-3bfec303.legacy.js} +2 -2
  68. package/lib/legacy/{rapi-access-ab9c7de3.legacy.js.map → rapi-access-3bfec303.legacy.js.map} +1 -1
  69. package/lib/legacy/roomle-sdk.legacy.js +1 -1
  70. package/lib/legacy/static/ConfiguratorKernel-3c16a462912d4363.wasm +0 -0
  71. package/lib/legacy/static/{ConfiguratorKernel-e9bbd4998a056b0b.js → ConfiguratorKernel-805ef8c9e2946584.js} +72 -73
  72. package/lib/legacy/static/ConfiguratorKernelJs-46632e2744e151e6.js +143 -0
  73. package/lib/legacy/static/ConfiguratorKernelJs-a7b190fe9a79da9f.mem +0 -0
  74. package/lib/legacy/static/{RoomleCore-18f96bc7c4c9fe8e.js → RoomleCore-41a17c2814f0726e.js} +81 -82
  75. package/lib/legacy/static/RoomleCore-eefc95fcacfbbdb7.wasm +0 -0
  76. package/lib/legacy/static/RoomleCoreJs-5e547e7bf5b9b475.js +151 -0
  77. package/lib/legacy/static/RoomleCoreJs-f7d9879c184a770d.mem +0 -0
  78. package/lib/legacy/static/shaders-783e0f3c8bfe6cc2.json +1 -0
  79. package/lib/legacy/{stats-helper-0331e2a2.legacy.js → stats-helper-40981b2e.legacy.js} +2 -2
  80. package/lib/legacy/{stats-helper-0331e2a2.legacy.js.map → stats-helper-40981b2e.legacy.js.map} +1 -1
  81. package/lib/{material-viewer-840eebf7.js → material-viewer-68be1ea0.js} +2 -2
  82. package/lib/material-viewer-68be1ea0.js.map +1 -0
  83. package/lib/{material-viewer-9c55d420.nomodule.js → material-viewer-d450271d.nomodule.js} +2 -2
  84. package/lib/material-viewer-d450271d.nomodule.js.map +1 -0
  85. package/lib/material-viewer-main-df962eec.js +2 -0
  86. package/lib/material-viewer-main-df962eec.js.map +1 -0
  87. package/lib/material-viewer-main.nomodule.js +1 -1
  88. package/lib/{mesh-generator-7b9048c1.js → mesh-generator-68230db7.js} +2 -2
  89. package/lib/mesh-generator-68230db7.js.map +1 -0
  90. package/lib/{mesh-generator-95709715.nomodule.js → mesh-generator-7425611d.nomodule.js} +2 -2
  91. package/lib/mesh-generator-7425611d.nomodule.js.map +1 -0
  92. package/lib/{pixotron-2bc1795a.nomodule.js → pixotron-9fb32201.nomodule.js} +2 -2
  93. package/lib/{pixotron-2bc1795a.nomodule.js.map → pixotron-9fb32201.nomodule.js.map} +1 -1
  94. package/lib/{pixotron-bb62a4ac.js → pixotron-e06b4406.js} +2 -2
  95. package/lib/{pixotron-bb62a4ac.js.map → pixotron-e06b4406.js.map} +1 -1
  96. package/lib/{planner-625e04ba.nomodule.js → planner-c8feb6cc.nomodule.js} +2 -2
  97. package/lib/{planner-625e04ba.nomodule.js.map → planner-c8feb6cc.nomodule.js.map} +1 -1
  98. package/lib/{planner-93dd1048.js → planner-cc924d07.js} +2 -2
  99. package/lib/{planner-93dd1048.js.map → planner-cc924d07.js.map} +1 -1
  100. package/lib/planner-main-0b4d1c48.js +2 -0
  101. package/lib/planner-main-0b4d1c48.js.map +1 -0
  102. package/lib/planner-main.nomodule.js +1 -1
  103. package/lib/{rapi-access-693b87b1.js → rapi-access-9de4b8ee.js} +2 -2
  104. package/lib/{rapi-access-693b87b1.js.map → rapi-access-9de4b8ee.js.map} +1 -1
  105. package/lib/{rapi-access-ec9bc9d3.nomodule.js → rapi-access-c3754bb1.nomodule.js} +2 -2
  106. package/lib/{rapi-access-ec9bc9d3.nomodule.js.map → rapi-access-c3754bb1.nomodule.js.map} +1 -1
  107. package/lib/{roomle-sdk-a81664de.js → roomle-sdk-25237d27.js} +2 -2
  108. package/lib/roomle-sdk-25237d27.js.map +1 -0
  109. package/lib/roomle-sdk.nomodule.js +1 -1
  110. package/lib/static/ConfiguratorKernel-3c16a462912d4363.wasm +0 -0
  111. package/lib/static/ConfiguratorKernel-805ef8c9e2946584.js +1 -0
  112. package/lib/static/ConfiguratorKernel-805ef8c9e2946584.js.map +1 -0
  113. package/lib/static/ConfiguratorKernelJs-46632e2744e151e6.js +143 -0
  114. package/lib/static/ConfiguratorKernelJs-a7b190fe9a79da9f.mem +0 -0
  115. package/lib/static/RoomleCore-41a17c2814f0726e.js +1 -0
  116. package/lib/static/RoomleCore-41a17c2814f0726e.js.map +1 -0
  117. package/lib/static/RoomleCore-eefc95fcacfbbdb7.wasm +0 -0
  118. package/lib/static/RoomleCoreJs-5e547e7bf5b9b475.js +151 -0
  119. package/lib/static/RoomleCoreJs-f7d9879c184a770d.mem +0 -0
  120. package/lib/static/shaders-783e0f3c8bfe6cc2.json +1 -0
  121. package/lib/{stats-helper-90311a20.nomodule.js → stats-helper-2ba40e23.nomodule.js} +2 -2
  122. package/lib/{stats-helper-90311a20.nomodule.js.map → stats-helper-2ba40e23.nomodule.js.map} +1 -1
  123. package/lib/{stats-helper-47b1c13e.js → stats-helper-f8ec7e6b.js} +2 -2
  124. package/lib/{stats-helper-47b1c13e.js.map → stats-helper-f8ec7e6b.js.map} +1 -1
  125. package/package.json +2 -2
  126. package/lib/component-dimensioning-6c0c9199.nomodule.js.map +0 -1
  127. package/lib/component-dimensioning-cd3fa46e.js.map +0 -1
  128. package/lib/configurator-main-2b41551f.js +0 -2
  129. package/lib/configurator-main-2b41551f.js.map +0 -1
  130. package/lib/configurator-mesh-generator-3151246c.js.map +0 -1
  131. package/lib/configurator-mesh-generator-3497564c.nomodule.js.map +0 -1
  132. package/lib/default-light-setting-6852d456.nomodule.js.map +0 -1
  133. package/lib/default-light-setting-825bb619.js.map +0 -1
  134. package/lib/glb-viewer-main-2dfab30f.js +0 -2
  135. package/lib/glb-viewer-main-2dfab30f.js.map +0 -1
  136. package/lib/legacy/component-dimensioning-eeddfbe4.legacy.js.map +0 -1
  137. package/lib/legacy/configurator-mesh-generator-32a1a893.legacy.js.map +0 -1
  138. package/lib/legacy/default-light-setting-0c03b9e5.legacy.js.map +0 -1
  139. package/lib/legacy/material-viewer-d7122341.legacy.js.map +0 -1
  140. package/lib/legacy/mesh-generator-bcc95cb6.legacy.js.map +0 -1
  141. package/lib/legacy/static/ConfiguratorKernel-4153106c16b35980.wasm +0 -0
  142. package/lib/legacy/static/ConfiguratorKernelJs-02aa8157cf299656.js +0 -143
  143. package/lib/legacy/static/ConfiguratorKernelJs-795532b819912c59.mem +0 -0
  144. package/lib/legacy/static/RoomleCore-daed88a09e86faf7.wasm +0 -0
  145. package/lib/legacy/static/RoomleCoreJs-10b4a8ee2a89da25.mem +0 -0
  146. package/lib/legacy/static/RoomleCoreJs-1e5e3331b2d12a5a.js +0 -151
  147. package/lib/legacy/static/shaders-34f19089b7cddbfe.json +0 -1
  148. package/lib/material-viewer-840eebf7.js.map +0 -1
  149. package/lib/material-viewer-9c55d420.nomodule.js.map +0 -1
  150. package/lib/material-viewer-main-27d70f5b.js +0 -2
  151. package/lib/material-viewer-main-27d70f5b.js.map +0 -1
  152. package/lib/mesh-generator-7b9048c1.js.map +0 -1
  153. package/lib/mesh-generator-95709715.nomodule.js.map +0 -1
  154. package/lib/planner-main-3e727a01.js +0 -2
  155. package/lib/planner-main-3e727a01.js.map +0 -1
  156. package/lib/roomle-sdk-a81664de.js.map +0 -1
  157. package/lib/static/ConfiguratorKernel-4153106c16b35980.wasm +0 -0
  158. package/lib/static/ConfiguratorKernel-e9bbd4998a056b0b.js +0 -1
  159. package/lib/static/ConfiguratorKernel-e9bbd4998a056b0b.js.map +0 -1
  160. package/lib/static/ConfiguratorKernelJs-02aa8157cf299656.js +0 -143
  161. package/lib/static/ConfiguratorKernelJs-795532b819912c59.mem +0 -0
  162. package/lib/static/RoomleCore-18f96bc7c4c9fe8e.js +0 -1
  163. package/lib/static/RoomleCore-18f96bc7c4c9fe8e.js.map +0 -1
  164. package/lib/static/RoomleCore-daed88a09e86faf7.wasm +0 -0
  165. package/lib/static/RoomleCoreJs-10b4a8ee2a89da25.mem +0 -0
  166. package/lib/static/RoomleCoreJs-1e5e3331b2d12a5a.js +0 -151
  167. package/lib/static/shaders-34f19089b7cddbfe.json +0 -1
@@ -12,5 +12,5 @@ System.register(["./main-thread-to-worker-97315397.nomodule.js"],(function(e,t){
12
12
  LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
13
  OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
14
  PERFORMANCE OF THIS SOFTWARE.
15
- ***************************************************************************** */function y(e,t,n,s){var r,o=arguments.length,i=o<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,n,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(i=(o<3?r(i):o>3?r(t,n,i):r(t,n))||i);return o>3&&i&&Object.defineProperty(t,n,i),i}class w{constructor(){this._size=256,this._maxLod=0,this._encoding=THREE.LinearEncoding,this._type=THREE.UnsignedByteType,this._format=THREE.RGBAFormat,this._cubeTextures=[],this._lightDirection=new THREE.Vector3,this._path=""}setPath(e){this._path=e}load(e){return new Promise(t=>{(new THREE.FileLoader).setResponseType("arraybuffer").load(this._path+e,e=>{this.parseData_(e),t(this._cubeTexture)})})}parseHeader_(e){let t=new DataView(e,0,30);this._size=t.getUint16(0),this._maxLod=t.getUint8(2),this._encoding=t.getUint16(3),this._type=t.getUint16(5),this._format=t.getUint16(7),this._lightDirection.x=t.getFloat32(9),this._lightDirection.y=t.getFloat32(13),this._lightDirection.z=t.getFloat32(17)}parseBufferData_(e,t){let n=this._size;const s=Math.log2(this._size)+1;this._cubeTextures=[];for(let r=0;r<s;r++){let s=new THREE.CubeTexture;this._cubeTextures.push(s),s.format=THREE.RGBAFormat,s.encoding=this._encoding,s.type=this._type,s.minFilter=THREE.LinearMipMapLinearFilter,s.magFilter=THREE.LinearFilter,s.generateMipmaps=!1;for(let r=0;r<6;r++){let o=new Uint8Array(e,t,4*n*n),i=new THREE.DataTexture(o,n,n);i.format=s.format,i.encoding=s.encoding,i.type=s.type,i.generateMipmaps=!1,t+=4*n*n,s.images[r]=i,i.needsUpdate=!0}s.needsUpdate=!0,n/=2}this._cubeTexture=new THREE.CubeTexture,this._cubeTexture.format=THREE.RGBAFormat,this._cubeTexture.encoding=this._encoding,this._cubeTexture.type=this._type,this._cubeTexture.minFilter=THREE.LinearMipMapLinearFilter,this._cubeTexture.magFilter=THREE.LinearFilter,this._cubeTexture.generateMipmaps=!1;for(let e=0;e<6;e++){this._cubeTexture.image[e]=this._cubeTextures[0].images[e];for(let e=1;e<s;e++)this._cubeTexture.mipmaps[e-1]=this._cubeTextures[e],this._cubeTextures[e].needsUpdate=!0}this._cubeTexture.needsUpdate=!0,this._cubeTexture.maxLod=this._maxLod-1}convertToRGBABuffer(e){let t=new Uint8Array(e,30,e.byteLength-30),n=4;this._format===THREE.RGBFormat&&(n=3);const s=4*t.length/n;let r=new ArrayBuffer(s),o=new DataView(r),i=0,a=t.length/n;if(3===n)for(let e=0;e<a;e++)o.setUint8(i++,t[e]),o.setUint8(i++,t[e+a]),o.setUint8(i++,t[e+2*a]),o.setUint8(i++,255);else for(let e=0;e<a;e++)o.setUint8(i++,t[e]),o.setUint8(i++,t[e+a]),o.setUint8(i++,t[e+2*a]),o.setUint8(i++,t[e+3*a]);return r}parseData_(e){this.parseHeader_(e);let t=30;t=0;let n=this.convertToRGBABuffer(e);this.parseBufferData_(n,0)}}const E=e("t",(function(e){return e*(Math.PI/180)})),b=(e("v",(function(e,t,n,s,r,o){e=Math.sqrt(e*e+n*n);const i=r/o,a=2*Math.atan(Math.tan(s*Math.PI/180/2)*i)*180/Math.PI,l=E(s),c=t/2/Math.tan(l/2),h=e/(2*Math.atan(Math.PI*a/360));return Math.max(c,h)})),function(e){return Math.round(1e3*e)/1e3}),M=(e("M",(function(e,t){return Math.abs(e.y-t.y)+Math.abs(e.x-t.x)})),e("x",(function(e,t){return Math.atan2(t.y-e.y,t.x-e.x)})),e("w",(function(e){let t=function(e){return e*(180/Math.PI)}(e);return t<0&&(t=180+(180+t)),t})),e("X","#DDDDDD")),v=(e("a5",1),e("a6",0),e("Z",1)),C=(e("g",(e,t,n,s)=>{if(!e||!t||0===n||0===s)return new THREE.Vector3;let r=e.clone(),o=n/2,i=s/2;return r.project(t),r.x=Math.floor(r.x*o+o),r.y=Math.floor(-r.y*i+i),r.z=e.distanceTo(t.position),r}),e("k",(e,t)=>{t||(t=new THREE.Vector3(0,0,0));let n=new THREE.Vector3(e.size.x/1e3,e.size.z/1e3,e.size.y/1e3),s=new THREE.Vector3(e.origin.x/1e3,e.origin.z/1e3,e.origin.y/-1e3),r=new THREE.Vector3(0,0,-n.z).add(s).sub(t),o=new THREE.Vector3(n.x,n.y,0).add(s).add(t);return new THREE.Box3(r,o)}));e("b",e=>(e.from=e.from/1e3,e.to=e.to/1e3,1===e.type.value?(e.type={value:2},e.from*=-1,e.to*=-1):2===e.type.value&&(e.type={value:1}),e)),e("s",(e,t)=>{let n=b(e.x),s=b(e.y),r=b(e.z),o=b(t.x),i=b(t.y),a=b(t.z);return n===o&&s===i&&r===a}),e("K",(e,t)=>{let n=b(e.w),s=b(e.x),r=b(e.y),o=b(e.z),i=b(t.w),a=b(t.x),l=b(t.y),c=b(t.z);return n===i&&s===a&&r===l&&o===c}),e("u",(e,t)=>{let n=b(e.x),s=b(e.y),r=b(t.x),o=b(t.y);return n===r&&s===o});let T=null;const P=()=>{if(T)return T;const e=new Uint8Array(4);for(let t=0;t<1;t++){const n=4*t;e[n]=255,e[n+1]=255,e[n+2]=255,e[n+3]=255}const t=new THREE.DataTexture(e,1,1,THREE.RGBAFormat);return t.needsUpdate=!0,t},R=(e,t,n,s)=>{const r=new Uint8Array(4),o=Math.floor(255*e),i=Math.floor(255*t),a=Math.floor(255*n),l=Math.floor(255*s);for(let e=0;e<4;e++){const t=4*e;r[t]=o,r[t+1]=i,r[t+2]=a,r[t+3]=l}const c=new THREE.DataTexture(r,1,1,THREE.RGBAFormat);return c.needsUpdate=!0,c},I=(e("G",(e,t)=>I(null,e,t)),e("ac",(e,t,s)=>{if(e||(e=S()),e.name=t.id?t.id.toString():"",void 0!==t.shading.metallic&&(e.metalness=1===t.shading.metallic?1:.5,e.reflectivity=n(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=n(t.shading.occlusion,1),e.roughness=n(t.shading.roughness,.5),e.alphaTest=n(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==s||s.setEnvMap(e),t.shading.doubleSided?e.side=THREE.DoubleSide:e.side=THREE.FrontSide,e.map||(T||(T=P()),e.map=T),e})),S=()=>new THREE.MeshPhysicalMaterial({});e("ad",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 k=null;e("H",(e,t,n,s,r,o,i=16)=>(k||(k=new THREE.TextureLoader,k.crossOrigin=""),new Promise((a,l)=>{if(!e)return console.warn("trying to add a texture without image",t),void a();k.load(e,e=>{x(e,t,n,s,r,o,i),a()},l)})));const x=e("ae",(e,t,n,s,r,o,i=16)=>{e.anisotropy=s,e.wrapS=THREE.RepeatWrapping,e.wrapT=THREE.RepeatWrapping,"ORM"===t.mapping&&i<=8?console.warn("ORM maps are not supported on devices with only "+i+" texture units"):(e.repeat.set(r,o),"XYZ"===t.mapping?(n.normalMap=e,n.map===P()&&(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)}),L=(e("J",(e=!0)=>window.dat&&window.dat.GUI?(window.__RML_GUI__||(window.__RML_GUI__=new dat.GUI({autoPlace:e})),window.__RML_GUI__):null),e("a8",(e,t,n=!0)=>{let s=e.getWorldDirection(new THREE.Vector3),r=Math.abs(s.y);r<.5&&!t.transparent&&L(t,!0,n),r>.5&&t.transparent&&L(t,!1,n)}),e("a9",(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})),A=(e("Y",e=>{let t=new THREE.Color;return t.setRGB((e>>16)/255,(e>>8&255)/255,(e>>0&255)/255),t}),e("c",(e,t)=>{e.traverse(e=>{if(e instanceof THREE.Mesh&&TWEEN){const n=e.material;e.userData.tween&&e.userData.tween.stop();const s={opacity:n.opacity};t.transparent&&(n.transparent=t.transparent),e.userData.tween=new TWEEN.Tween(s).to(t,250).easing(TWEEN.Easing.Linear.None).onUpdate(()=>{n.opacity=s.opacity}).onStop(()=>{t.transparent||(n.transparent=t.transparent),n.opacity=t.opacity,n.needsUpdate=!0,e.userData.tween=void 0}).onComplete(()=>{t.transparent||(n.transparent=t.transparent),n.needsUpdate=!0,e.userData.tween=void 0}).start()}})}),e("F",e=>{e.traverse(e=>{if(e instanceof THREE.Mesh&&TWEEN){let t=e.material;if(0===t.opacity)return;let n={opacity:0,transparent:!0},s={opacity:t.opacity,transparent:t.transparent};t.transparent=n.transparent,t.opacity=n.opacity,new TWEEN.Tween(n).to(s,500).easing(TWEEN.Easing.Linear.None).onUpdate(()=>{t.opacity=n.opacity}).onComplete(()=>{t.transparent=s.transparent}).start()}})}),e("a1",(e,t)=>{let n=(new THREE.Box3).setFromObject(e),s=n.getSize(new THREE.Vector3),r=Math.min(s.x,s.y,s.z),o=!0;return r>5&&(console.warn("GLB seems to be too big ("+r+")",t),o=!1),n.min.y<-.01&&(console.warn("GLB seems to be under the floor ("+n.min.y+"): ",t),o=!1),o}),e("d",e=>{"Mesh"===e.type?D(e):A(e)}),e=>{e&&e.children&&0!==e.children.length&&e.children.forEach(e=>{D(e)})}),D=e("a4",e=>{e&&(e.material&&F(e.material),e.geometry&&H(e.geometry),e.children&&e.children.length>0&&A(e))}),H=e=>{e&&e.dispose()},F=e=>{e&&(e.map&&e.map.dispose(),e.normalMap&&e.normalMap.dispose(),e.dispose())};let O;e("W",()=>(O||(O=new THREE.MeshBasicMaterial,O.visible=!1),O)),e("$",(e,t)=>{let n=t.x/2,s=t.z/2,r=new THREE.Vector3(-n,.01,s),o=[r,new THREE.Vector3(r.x,r.y,r.z+.2),new THREE.Vector3(r.x-.2,r.y,r.z+.2),new THREE.Vector3(r.x-.2,r.y,r.z)],i=[new THREE.Face3(3,2,0),new THREE.Face3(2,1,0)],a=new THREE.Geometry;return a.vertices.push(...o),a.faces.push(...i),a.computeFaceNormals(),a.computeVertexNormals(),a}),e("a3",e=>0===e.x&&0===e.y&&0===e.z),e("V",(e,t)=>{let n="";return e.materialId&&""!==e.materialId?n=e.materialId:e.catalogItemId&&""!==e.catalogItemId?n=e.catalogItemId:e.rgbValue>0?n="rbg"+JSON.stringify(e.rgbValue):e.length>0?n=e:t&&1===t.value?n="default_wall_material_"+e.getSourceType().value:t&&7===t.value&&(n="default_ceiling_material_"+e.getSourceType().value),n}),e("z",(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),e("a",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});const U=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 B(e,t){const n=Symbol("property-cache");Object.defineProperty(e,t,{get(){if(!this[n]){const e=window.__RML__DI__.lookup(U(t),this._creator_);e?this[n]=e:console.error("Dependency "+U(t)+" not found! Add dependency to /utils/injectables.ts")}return this[n]}})}let j=e("af",(()=>{class e{constructor(e){this._hdrCubeUrl="static/roomle-91862a5e7f3f46e5.envmap",this._hdrCubeUrlLowres="static/roomle64-adb0f447a54b5143.envmap",this._envMapReader=new w,this._creator_=e;const t=new THREE.Color(M);this._environmentMap=((e,t,n,s)=>{const r=new THREE.CubeTexture;r.format=THREE.RGBAFormat,r.generateMipmaps=!1;for(let o=0;o<6;++o){const i=R(e,t,n,s);i.format=r.format,i.type=r.type,i.minFilter=r.minFilter,i.magFilter=r.magFilter,i.generateMipmaps=r.generateMipmaps,i.needsUpdate=!0,r.images[o]=i}return r.needsUpdate=!0,r})(t.r,t.g,t.b,v),this._envMapReader.setPath(s()),this._loadHDREnvMap(this._hdrCubeUrlLowres)}static setEnvironmentMap(e,t){e&&t&&(e.envMap=t,e.envMapIntensity=1,e.needsUpdate=!0)}getEnvironmentMap(){return this._environmentMap}_processPMREM(e){const t=new THREE.PMREMGenerator(this._renderer);let n=t.fromCubemap(e);return e.magFilter=THREE.LinearFilter,e.needsUpdate=!0,t.dispose(),n.texture}_loadHDREnvMap(e){return this._initData.disableEnvMap?Promise.resolve():new Promise(t=>{this._envMapReader.load(e).then(n=>{n.encoding=THREE.sRGBEncoding;const s=this._renderer.extensions.get("EXT_shader_texture_lod");this._environmentMap=s?this._processPMREM(n):n,e!==this._hdrCubeUrl&&(this._environmentMap.encoding=THREE.sRGBEncoding,window.requestIdleCallback(this._loadHDREnvMap.bind(this,this._hdrCubeUrl))),this._updateEnvironmentMap(),t(),this._envChangedCallback&&this._envChangedCallback()})})}setRendererAndScene(e,t){this._renderer=e,this._scene=t}registerEnvironmentChangedCallback(e){this._envChangedCallback=e}_updateEnvironmentMap(){this._initData.disableEnvMap||this._scene.traverse(t=>{t instanceof THREE.Mesh&&(t.material instanceof THREE.MeshStandardMaterial||"MeshPhysicalMaterial"===t.material.type)&&e.setEnvironmentMap(t.material,this._environmentMap)})}setEnvMap(t){this._initData.disableEnvMap||e.setEnvironmentMap(t,this.getEnvironmentMap())}}return y([B],e.prototype,"_initData",void 0),e})());const G=e("P",{SOFA:"sofa",SHELF:"shelf",SHELF_FRONT:"shelf_front",BAKED:"baked",CAMERA:"camera",EQUAL:"equal"});class V{static createDynamicLightSettingSource(e,t){let n={};if(e)n.url=e;else if(t)switch(t){case G.SHELF:n.url=s()+"static/shelf-2975dd3f2fa9c763.json";break;case G.SHELF_FRONT:n.url=s()+"static/shelf_front-8c9566a4512f0de8.json";break;case G.SOFA:n.url=s()+"static/sofa-997b116bc5f2e92e.json";break;case G.BAKED:n.url=s()+"static/baked-6485a2b1daeb69e8.json";break;case G.CAMERA:n.url=s()+"static/camera-f4cef679615485dc.json";break;case G.EQUAL:n.url=s()+"static/equal-319f6b83c827913f.json";break;default:n.url=s()+"static/camera-f4cef679615485dc.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:s,target:r,width:o,height:i}=e;return t.width=o||.8,t.height=i||.8,t.castShadow=s||!1,t.matrixAutoUpdate=!0,t.intensity=(n||240)/((o||.8)*(i||.8)),t.lookAt(r?new THREE.Vector3(r.x,r.y,r.z):new THREE.Vector3(0,0,0)),t}_parseSpotLight(e){let t=new THREE.SpotLight;this._parseCommon(t,e);let{angle:n,penumbra:s,target:r,castShadow:o}=e;return t.angle=(n||100)*Math.PI/180,t.penumbra=s||.5,t.lookAt(r?new THREE.Vector3(r.x,r.y,r.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:s}=e;return t.castShadow=s||!1,t.shadow.camera.near=.1,t.shadow.camera.far=100,t.shadow.mapSize=new THREE.Vector2(1024,1024),t.shadow.bias=-5e-5,t.lookAt(n?new THREE.Vector3(n.x,n.y,n.z):new THREE.Vector3(0,0,0)),t}_parseCommon(e,t){let{name:n,intensity:s,color:r,position:o,movesWithCamera:i}=t;e.name=n||"",e.intensity=s||1,e.color=new THREE.Color(r||"#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=i}}e("D",V);const N=["127.0.0.1","localhost","0.0.0.0"],z=(e("m",(function(e){return!(!e||"string"!=typeof e||e.split(":").length>2)})),e("l",e=>{if(!e||"string"!=typeof e)return null;const t=e.split(":");return t.length<2?null:t[0]})),W=({articleNr:e,componentId:t})=>e&&""!==e?t.split(":")[0]+":"+e:null,K=(e,t)=>null!=e?"string"==typeof e?"true"===e:!0===e:("string"==typeof t&&(t=parseInt(t,10)),t>=200&&t<300);class q{constructor(){this._queue=[],this._pendingRequests=0}_nextSlot(){if(this._pendingRequests-=1,!this._queue.length)return;const{request:e,resolve:t,reject:n}=this._queue.shift();this._fetch(e).then(t,n)}_fetch(e,t={}){return this._pendingRequests+=1,new Promise((n,s)=>{self.fetch(e,t).then(function(e){if(this._nextSlot(),K(e.ok,e.status))n(...arguments);else{const t=(null==e?void 0:e.url)||"URL unknown";s(new Error(e.statusText||'Http error "'+(e&&e.status?e.status:"unknown")+'", for "'+t+'"'))}}.bind(this),e=>{this._nextSlot(),s(e)})})}fetch(e,t={}){return this._pendingRequests>=40?new Promise((t,n)=>this._queue.push({request:e,resolve:t,reject:n})):this._fetch(e,t)}}class J{info(...e){console}log(...e){console}warn(...e){console.warn.apply(console,e)}error(...e){console.warn.apply(console,e)}}e("L",J);let Q=(()=>{class e extends J{constructor(e){super(),this._creator_=e}setMeta(e){this._meta=e}get meta(){return this._meta?this._meta:{}}throw(e){const t="[Kernel Exception]: "+e;this._globalCallback.onKernelMsg("exception",e,this.meta),this.error(t)}error(e){this._globalCallback.onKernelMsg("error",e,this.meta),super.error(e)}warn(e){this._globalCallback.onKernelMsg("warning",e,this.meta),super.warn(e)}}return y([B],e.prototype,"_globalCallback",void 0),e})();const Z=new Map,$=new Map,X=new Map,Y=new Map;let ee=e("h",(()=>{class e{constructor(e){this._bootCallbacks=[],this._isStarted=!1,this._isStarting=!1,this._alwaysUseCache=!1,this._creator_=e}start(e){return this._configuratorUiCallbacks.onSyncStarted(),this._startWorker().then(()=>this._handleCatalog(e)).then(()=>{const{typeChangeTag:e,floorMaterialsTag:t}=this._initData;Promise.all([this._syncFloorTag(t),this._syncTypeChangeTag(e)]).then(()=>{Y.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&&!X.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(()=>{X.set(e,!0),n()},e=>this._softReject(n,'_syncFloorTag error: "'+e+'"'))})):Promise.resolve()}_syncTypeChangeTag(e){const t=[];return e&&!Y.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(()=>{X.set(e,!0),n()},e=>this._softReject(n,'_syncTypeChangeTag error: "'+e+'"'))})):Promise.resolve()}getIsCatalogSynced(e){return!!$.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(s()+"static/asset-loader.worker-796c70f59b977071.js"),this._mainThreadToWorker=new r(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(()=>{$.set(e,!0),t()},e=>this._softReject(t,'Catalog sync error: "'+e+'"')))}_handleTags(e){return this._handleContentWithAssets(this._rapiAccess.getTags(e),["pngIcon","svgIcon"])}_handleExternalMeshes(e){return new Promise(t=>{this._rapiAccess.getMeshesOfCatalog(e.id).then(e=>{const n=[];e.forEach(e=>{n.push(this._handleContentWithAssets(Promise.all([this._rapiAccess.getMesh(e.id)]),["url"]))}),Promise.all(n).then(t,e=>this._softReject(t,'Sync crt files error: "'+e+'"'))},e=>this._softReject(t,'getMeshesOfCatalog error: "'+e+'"'))})}_handleItemsAndAdditionalContents(e){return new Promise(t=>{this._rapiAccess.getItemsOf(e).then(e=>{const n=[];n.push(this._handleContentWithAssets(Promise.resolve(e),["perspectiveImage"])),this._rapiAccess.getAdditionalContentsOfItems(e).then(e=>{const t=e.filter(e=>-1!==[5,6,4].indexOf(e.type));n.push(this._handleContentWithAssets(Promise.resolve(t),["content"]))},e=>this._softReject(t,'getAdditionalContentsOfItems error: "'+e+'"')),Promise.all(n).then(t,e=>this._softReject(t,'AdditionalContent image sync error:"'+e+'"'))})})}_handleMaterialsAndTextures(e){return new Promise(t=>{this._rapiAccess.getMaterialsOf(e).then(e=>{const n=[];n.push(this._handleContentWithAssets(Promise.resolve(e),["thumbnail"])),e.forEach(e=>{n.push(this._handleContentWithAssets(this._rapiAccess.getTexturesOf(e),["image"]))}),Promise.all(n).then(t,e=>this._softReject(t,'getTexturesOf error: "'+e+'"'))},e=>this._softReject(t,'getMaterialsOf error: "'+e+'"'))})}_handleContentWithAssets(e,t){return new Promise(n=>e.then(e=>this._fetchAssets(e,t).then(n,e=>this._softReject(n,'_handleContentWithAssets error: "'+e+'"')),e=>this._softReject(n,'_handleContentWithAssets promise error: "'+e+'"')))}_fetchAssets(e,t){const n=[];e||(e=[]);for(let s=0,r=e.length;s<r;s++){const r=e[s];t.forEach(e=>{const t=r[e];t&&n.push(this._preCacheAsset(t))})}return Promise.all(n)}_preCacheAsset(e){return new Promise(t=>{if(Z.get(e))return t();this._assetUrlToBase64(e).then(n=>{Z.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:Z.get(e)||(t?e:null)}setAlwaysUseCache(e){this._alwaysUseCache=e}preFillAssetCache(e,t){Z.set(e,t)}}return y([B],e.prototype,"_rapiAccess",void 0),y([B],e.prototype,"_singlePromiseFactory",void 0),y([B],e.prototype,"_errorHandler",void 0),y([B],e.prototype,"_configuratorUiCallbacks",void 0),y([B],e.prototype,"_initData",void 0),e})());class te{constructor(e){this.info=e,this._init()}_init(){this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}resolve(e){e&&this._resolve(e),this._resolve()}reject(e){this._reject(e)}wait(){return this._promise}reset(){this._init()}}e("y",te);var ne=e("aa","static/GLTFLoader-5b296b5fb14cfe1a.js"),se=e("ab","static/DRACOLoader-5edeeab4a8dbc0bd.js");const re={"draco_wasm_wrapper.js":"static/draco_wasm_wrapper-d775f9f135cb30ff.js","draco_decoder.wasm":"static/draco_decoder-979e668167e37c95.wasm","draco_decoder.js":"static/draco_decoder-3866672a1fa2f980.js"};let oe=(()=>{class e{constructor(e){if(this._gltfLoaderGuard=new te,this._creator_=e,THREE.GLTFLoader&&THREE.DRACOLoader)this._initLoaders();else{let e=this._scriptLoader.fetch(ne,{id:"gltf-loader"}),t=this._scriptLoader.fetch(se,{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 r=re[e];if(!r)throw new Error('Can not load draco dependency "'+e+'" did three.js update DracoLoader lib? Available files'+JSON.stringify(re));return t(s()+r,n)},this._gltfLoader.setDRACOLoader(e),this._gltfLoaderGuard.resolve(this._gltfLoader)}async loadGLB(e,t,n,s,r,o,i,a){return await this._gltfLoaderGuard.wait(),new Promise((l,c)=>{this._gltfLoader.load(e,e=>{l(this._handleGLTFScene("GLB",e,t,n,s,r,o,i))},e=>{a&&a(e.loaded/e.total)},e=>{c(e)})})}async loadGLTF(e,t,n,s,r,o,i,a){return await this._gltfLoaderGuard.wait(),new Promise((l,c)=>{this._gltfLoader.parse(e,null,e=>{l(this._handleGLTFScene("GLTF",e,t,n,s,r,o,i))},e=>{a&&a(e.loaded/e.total)},e=>{c(e)})})}_handleGLTFScene(e,t,n,s,r,o,i,a){if(!t||!t.scene||!t.scene.children||0===t.scene.children.length)return null;if(n&&t.scene.position.copy(n),s&&(t.scene.rotation.y=s),r){const e=new THREE.Box3;e.setFromObject(t.scene);const{x:n,y:s,z:o}=e.getSize(new THREE.Vector3);let i=new THREE.Vector3(r.x/n,r.y/s,r.z/o);t.scene.scale.copy(i)}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&&i&&i>0){let e=new THREE.Color(i);t.color=e.copyGammaToLinear(e),t.roughness=.5,t.metalness=.1}t.needsUpdate=!0}e.castShadow=!0,e.receiveShadow=!0}}),t.scene}}return y([B],e.prototype,"_environmentLoader",void 0),y([B],e.prototype,"_scriptLoader",void 0),e})(),ie=(()=>{class e{constructor(e){this._jsonLoaded=!1,this._creator_=e}_loadShaders(){return new Promise((e,t)=>{if(this._jsonLoaded)return e();this._networkLayer.fetch(s()+"static/shaders-34f19089b7cddbfe.json",{credentials:"same-origin"}).then(o,t).then(t=>{window._rsl=t,this._jsonLoaded=!0,e()},t)})}fetch(){return window._rsl||(window._rsl={}),new Promise((e,t)=>this._loadShaders().then(()=>{this._scriptLoader.fetch("static/rthree-508a6ceb9a1516ce.js",{id:"three-lib"}).then(e,t)},t))}}return y([B],e.prototype,"_scriptLoader",void 0),y([B],e.prototype,"_networkLayer",void 0),e})(),ae=(()=>{class e{constructor(e){this._context_=e}getStore(e="rml_default"){return this._localStorage.getItem(e)||{entries:[]}}saveStore(e,t){this._localStorage.setItem(e,t)}addItem(e,t,n="rml_default",s=5){const r=this.getStore(n),o=r.entries.find(t=>t.id===e);if(o?(o.payload=t,o.date=Date.now()):r.entries.push({id:e,date:Date.now(),payload:t}),r.entries.length>s)for(r.entries.sort((e,t)=>t.date-e.date);r.entries.length>s;)r.entries.pop();this.saveStore(n,r)}getItem(e,t="rml_default"){const n=this.getStore(t).entries.find(t=>t.id===e);return n?n.payload:null}}return y([B],e.prototype,"_localStorage",void 0),e})();class le{set(e,t){t&&(void 0!==t.enableAA&&(e.enableAA=t.enableAA),this._setSAOPass(e,t),this._setShadowPass(e,t),this._setGroundShadow(e,t))}_setSAOPass(e,t){if(t.SAOPass){const n=t.SAOPass;void 0!==n.enabled&&(e.getSAOPass().enabled=n.enabled),void 0!==n.smoothTransition&&(e.getSAOPass().smoothTransition=n.smoothTransition),n.occlusionWorldRadius&&(e.getSAOPass().occlusionWorldRadius=n.occlusionWorldRadius),n.intensity&&(e.getSAOPass().intensity=n.intensity),n.bias&&(e.getSAOPass().bias=n.bias),n.numSamples&&(e.getSAOPass().numSamples=n.numSamples)}}_setShadowPass(e,t){if(t.shadowPass){const n=t.shadowPass;void 0!==n.enabled&&(e.getShadowPass().enabled=n.enabled),void 0!==n.smoothTransition&&(e.getShadowPass().smoothTransition=n.smoothTransition),void 0!==n.enableAccumulation&&(e.getShadowPass().enableAccumulation=n.enableAccumulation),n.shadowRadius&&(e.getShadowPass().shadowRadius=n.shadowRadius),n.shadowBiasMultiplier&&(e.getShadowPass().shadowBiasMultiplier=n.shadowBiasMultiplier),n.numSamples&&(e.getShadowPass().numSamples=n.numSamples)}}_setGroundShadow(e,t){if(t.groundShadow){const n=t.groundShadow;void 0!==n.enable&&(e.getShadowPlanePass().enable=n.enable),void 0!==n.smoothTransition&&(e.getShadowPlanePass().smoothTransition=n.smoothTransition),n.numSamples&&(e.getShadowPlanePass().numSamples=n.numSamples),n.numSamplesPerFrame&&(e.getShadowPlanePass().numSamplesPerFrame=n.numSamplesPerFrame)}}}e("N",le);const ce=e("T",e=>new THREE.Vector3(e.x/1e3,e.z/1e3,e.y/-1e3)),he=(e("a0",e=>new THREE.Vector3(e.x/1e3,e.z/1e3,e.y/1e3)),e("a7",e=>({x:1e3*e.x,y:-1e3*e.z,z:1e3*e.y}))),de=e=>decodeURIComponent(encodeURIComponent(e)),ue=e("q",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=pe(e);for(let e=0;e<t.length;e++)t[e]=ue(t[e]);return"string"==typeof t?de(t):t}if("object"==typeof e)for(let t in e)e.hasOwnProperty(t)&&(e[t]=ue(e[t]));return"string"==typeof e?de(e):e}),pe=e=>{let t=[];if(e){let n=e.size();for(let s=0;s<n;s++)t.push(e.get(s))}return t},ge=e=>{let t=new THREE.Matrix4,n=ue(e);return t.fromArray(n),t.transpose(),(e=>{let t=new THREE.Matrix4;t.set(1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1),t.scale(new THREE.Vector3(.001,.001,.001));let n=new THREE.Matrix4;return n.set(1,0,0,0,0,0,-1,0,0,1,0,0,0,0,0,1),n.scale(new THREE.Vector3(1e3,1e3,1e3)),t.multiply(e).multiply(n)})(t)};function me(){class e extends THREE.Object3D{constructor(e,t,n,s){super(),this._selected=!1,this.geometryChanged=!0,this.meshes=[],this.castShadow=!1,this.receiveShadow=!0,this._setValues(e,t,n,s)}static _generateOutline(e,t){let n=new THREE.LineSegments(new THREE.EdgesGeometry(e),new THREE.LineDashedMaterial({color:"#000000",dashSize:.03,gapSize:.01,linewidth:1}));return n.translateOnAxis(t,1),n.userData.ignoreComponentRaycast=!0,n}static cloneDockLine(e,t){let n=new THREE.LineSegments(e.geometry,e.material);return n.translateOnAxis(t.getCenter(new THREE.Vector3),1),n.name="dockline",n.layers.set(5),n.userData.ignoreComponentRaycast=!0,n}_setValues(e,t,n,s){e&&(this.runtimeId=e,this.name=e.toString()),t&&(this.roomlePosition=Object.assign({},t)),n&&(this.roomleRotation=Object.assign({},n)),s&&(this.parentObjectId=s)}get loadingMesh(){return this._loadingMesh}get boundingBoxMesh(){return this._boundingBoxMesh}get boundingBox(){return this._boundingBox}set roomlePosition(e){this._roomlePosition=e,e&&this.position.set(e.x/1e3,e.z/1e3,e.y/-1e3)}get roomlePosition(){return this._roomlePosition}set roomleRotation(e){this._roomleRotation=e,e&&this.rotation.set(e.x,e.z,-e.y)}get roomleRotation(){return this._roomleRotation}replaceMeshes(e){this.removeAllMeshes(),e.forEach(e=>{this.addMesh(new THREE.Mesh(e.geometry,e.material))})}addMesh(e,t){e.renderOrder=2,e.userData.meshType=0,t&&e.applyMatrix4(ge(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),D(e),t<0||this.meshes.splice(t,1)}removeAllMeshes(e=!0){this.meshes.forEach(t=>{this.remove(t),e&&D(t)}),this.meshes=[],this._removeLoadingMesh(),this.remove(this._boundingBoxMesh),D(this._boundingBoxMesh),this._boundingBoxMesh=null}_hideAllMeshes(){this.meshes.forEach(e=>e.visible=!1)}_showAllMeshes(){this.meshes.forEach(e=>e.visible=!0)}select(){this._selected=!0}loading(){if(!this._kernelBoundingBox)return void console.warn("Bounding box (box for measurements) for component "+this.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 s=new THREE.BoxGeometry(e,t,n);this._loadingMesh=new THREE.Mesh(s,new THREE.MeshStandardMaterial({transparent:!0,opacity:v,color:new THREE.Color(M)})),this._loadingMesh.name="loading mesh",this._loadingMesh.receiveShadow=!1,this._loadingMesh.castShadow=!1,this._loadingMesh.layers.set(5),this._loadingMesh.translateOnAxis(this._kernelBoundingBox.getCenter(new THREE.Vector3),1),this._loadingMesh.renderOrder=3,this.add(this._loadingMesh)}_removeLoadingMesh(){this._loadingMesh&&(this.remove(this._loadingMesh),D(this._loadingMesh),this._loadingMesh=null)}loadingFinished(){this._removeLoadingMesh(),this._showAllMeshes()}deselect(){this._selected=!1}hoverOn(){i("pointer")}hoverOff(){i("default")}removeFromParent(){this.parent&&(this.parent.remove(this),this.removeAllMeshes())}computeBoundingBox(t,n=!1){if(this._boundingBoxMesh&&this.remove(this._boundingBoxMesh),!n&&t&&0===t.size.x&&0===t.size.y&&0===t.size.z)return;let s;if(!t||n){this._boundingBox=new THREE.Box3;let e=new THREE.Vector3;this.meshes.forEach(t=>{if(t.geometry instanceof THREE.Geometry){let n=t.geometry.vertices;for(let s=0,r=n.length;s<r;s++)e.copy(n[s]),e.applyMatrix4(t.matrix),this._boundingBox.expandByPoint(e)}else if(t.geometry instanceof THREE.BufferGeometry){let n=t.geometry.attributes.position;if(void 0!==n)for(let s=0,r=n.count;s<r;s++)e.fromBufferAttribute(n,s).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,r=this._boundingBox.max.z-this._boundingBox.min.z;s=new THREE.BoxGeometry(t,n,r)}else{this._kernelBoundingBox=C(t),this._boundingBox=this._kernelBoundingBox.clone();let{x:e,y:n,z:r}=this._boundingBox.getSize(new THREE.Vector3);s=new THREE.BoxGeometry(e,n,r)}this._boundingBoxMesh=new THREE.Mesh(s,new THREE.MeshStandardMaterial({color:"#FFFFFF",transparent:!0,opacity:0,polygonOffset:!0,polygonOffsetFactor:-1,visible:!1})),this._boundingBoxMesh.name="bounding box mesh";let r=this._boundingBox.getCenter(new THREE.Vector3);this._boundingBoxMesh.position.add(r),this._boundingBoxMesh.layers.set(5),this._boundingBoxMesh.renderOrder=3,this._boundingBoxMesh.castShadow=!1,this._boundingBoxMesh.receiveShadow=!1,this.add(this._boundingBoxMesh),this._dockline=e._generateOutline(s,r),this._dockline.name="bounding box outline",this._dockline.layers.set(5),this._selected&&this.add(this._dockline)}recursiveMeshes(){let t=this.meshes.slice();return this.children.forEach(n=>{n instanceof e&&t.push(...n.recursiveMeshes())}),t}isChild(t){let n=!1;return this.children.forEach(s=>{s instanceof e&&!n&&(n=s.runtimeId===t||s.isChild(t))}),n}getKernelPosition(e){let t=this.parent.localToWorld(this.position);return he(e.worldToLocal(t))}}class t extends e{constructor(e,t){super(e,null,null,null),this.glbUrl=t}}class n extends e{constructor(e,t,n,s){super(e,t,n,s),this._stringId=null,this.receivedPointAssociation=!1,this.castShadow=!1,this.receiveShadow=!1}get stringId(){return this._stringId?this._stringId:this.runtimeId.toString()}addMesh(e,t){super.addMesh(e,t),e.material instanceof THREE.MeshStandardMaterial&&(e.material.opacity=.6,e.material.roughness=1,e.material.metalness=0,e.material.color=new THREE.Color("#DDDDDD")),e.renderOrder=1,e.castShadow=!1,e.receiveShadow=!1}hoverOn(){this.remove(this._dockline),this.meshes.forEach(({material:e})=>{e.opacity=.9,e.roughness=1,e.metalness=0,e.color=new THREE.Color("#DDDDDD")}),i("pointer")}hoverOff(){this.add(this._dockline),this.meshes.forEach(({material:e})=>{e.opacity=.6,e.roughness=1,e.metalness=0,e.color=new THREE.Color("#DDDDDD")}),i("default")}clonePreview(t){const s=new n(this.runtimeId,this.roomlePosition,this.roomleRotation,this.parentObjectId);return s._stringId=this.runtimeId+"_"+t,this.children.forEach(e=>{e instanceof THREE.Mesh&&0===e.userData.meshType&&s.meshes.push(e.clone(!0))}),s.meshes.forEach(e=>{e.material=e.material.clone(),e.geometry=e.geometry.clone(),s.add(e)}),this._dockline&&(s._dockline=e.cloneDockLine(this._dockline,this._boundingBox)),this._boundingBoxMesh&&(s._boundingBoxMesh=this._boundingBoxMesh.clone(!0)),this._boundingBox&&(s._boundingBox=this._boundingBox.clone()),s}preparePreview(){this.add(this._dockline),this.add(this._boundingBoxMesh)}}class s extends n{constructor(e,t,n,s,r){super(e,t,n,s),r&&(this._stringId=this.runtimeId+"_has_additional_dock_point_copy")}set roomleLineFrom(e){this._roomleLineFrom=e,this.lineFrom=ce(e)}get roomleLineFrom(){return this._roomleLineFrom}set roomleLineTo(e){this._roomleLineTo=e;let t=ce(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=ce(e)}get roomlePositionFrom(){return this._roomlePositionFrom}set roomlePositionTo(e){this._roomlePositionTo=e;let t=ce(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,i("pointer")}hoverOff(){this._dockline.visible=!1,i("default")}preparePreview(){super.preparePreview(),this._dockline.visible=!1;let e=this.lineTo.clone(),t=this.lineFrom.clone();const n=(new THREE.Vector3).subVectors(e,t);let s=n.length(),r=n.normalize(),o=new THREE.ArrowHelper(r,t),i=new THREE.CylinderGeometry(.01,.01,s,16,1);this.lineMesh=new THREE.Mesh(i,new THREE.MeshStandardMaterial({color:M,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,u=Math.abs(r.x),p=Math.abs(r.y),g=Math.abs(r.z);u>=p&&u>=g?(h=new THREE.Vector3(c.x,0,0),d=Math.sqrt(c.y*c.y+c.z*c.z)):p>=u&&p>=g?(h=new THREE.Vector3(0,c.y,0),d=Math.sqrt(c.x*c.x+c.z*c.z)):g>=p&&g>=u&&(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 m=(new THREE.Vector3).subVectors(this.positionTo.clone(),this.positionFrom.clone()).length()+h.length(),_=new THREE.CylinderGeometry(1.1*d,1.1*d,m,32,1);this.boundingLineMesh=new THREE.Mesh(_,new THREE.MeshStandardMaterial({color:"#ffffff",transparent:!0,opacity:0})),this.boundingLineMesh.name="bounding line mesh",this.boundingLineMesh.userData.ignoreComponentRaycast=!0;let f=this.positionTo.clone(),y=this.positionFrom.clone(),w=(new THREE.Vector3).subVectors(f,y).normalize(),E=new THREE.ArrowHelper(w,y);const b=(new THREE.Quaternion).setFromEuler(E.rotation);this.boundingLineMesh.quaternion.multiply(b),this.boundingLineMesh.renderOrder=3;let v=(new THREE.Vector3).addVectors(this.positionTo.clone(),this.positionFrom.clone()).multiplyScalar(.5).add(c);this.boundingLineMesh.position.copy((new THREE.Vector3).subVectors(v,this.position.clone())),this.add(this.boundingLineMesh)}clonePreviewLine(t){let n=new s(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),s=this.positionFrom.clone().add(t),r=new THREE.Line3(s,n).closestPointToPoint(e,!0,new THREE.Vector3);return(isNaN(r.x)||isNaN(r.y)||isNaN(r.z))&&r.copy(e),r.sub(t)}updatePreviewPosition(e){let t=this.getPositionForIntersectionPoint(e),n=this.parent.localToWorld(t);this._newPosition=this.worldToLocal(n);let s=this._boundingBox.getCenter(new THREE.Vector3).applyEuler(this.docklineRotation);this._dockline.position.copy((new THREE.Vector3).addVectors(this._newPosition,s)),this._dockline.rotation.copy(this.docklineRotation)}hideSelectionLine(){this._dockline.visible=!1}getKernelPosition(e){if(this._newPosition){let t=this.localToWorld(this._newPosition);return he(e.worldToLocal(t))}return super.getKernelPosition(e)}}class r extends THREE.PerspectiveCamera{constructor(e,t,n,s,r){super(e,t,n,s),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}_calculateProjectionMatrix(){let e,t,n,s,r=this.fov*(2*Math.PI/360)/2;n=Math.tan(r),s=-n;let o=Math.atan(this.aspect*Math.tan(r));t=Math.tan(o),e=-t;let i=this._offset.left,a=this._offset.right,l=this._offset.top,c=this._offset.bottom,h=new THREE.Vector2(a-i,l-c),d=new THREE.Vector2(i+h.x/2,c+h.y/2);if(h.x<h.y){let r=(1-d.x)/(h.x/2),o=d.x/(h.x/2);t*=r,e*=o;let i=(r+o)/2;n*=i,s*=i}else{let r=(1-d.y)/(h.y/2),o=d.y/(h.y/2);n*=r,s*=o;let i=(o+r)/2;e*=i,t*=i}e*=this.near,t*=this.near,n*=this.near,s*=this.near;let u=this.near*Math.tan(Math.PI/180*.5*this.fov)/this.zoom*2,p=this.aspect*u;return this.view&&this.view.enabled&&(e+=this.view.offsetX*p/this.view.fullWidth,n-=this.view.offsetY*u/this.view.fullHeight,t+=this.view.offsetX*p/this.view.fullWidth,s-=this.view.offsetY*u/this.view.fullHeight),(new THREE.Matrix4).makePerspective(e,t,n,s,this.near,this.far)}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){this._offset?(this.projectionMatrix=this._calculateProjectionMatrix(),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()):super.updateProjectionMatrix()}}return{create:function(t,n,s,r){return new e(t,n,s,r)},createPreview:function(e,t){return new n(e,{x:0,y:0,z:0},{x:0,y:0,z:0},t)},createStatic:function(e,n){return new t(e,n)},createPreviewLine:function(e){let t=new s(e.id,e.roomlePosition,e.roomleRotation,e.parentObjectId,e.receivedPointAssociation);return e.meshes.forEach(e=>{let n=e.clone();n.material=e.material.clone(),n.geometry=e.geometry.clone(),t.addMesh(n)}),t.computeBoundingBox(),t},isPreview:function(e){return e instanceof n},isPreviewLine:function(e){return e instanceof s},createCamera:function(e,t,n,s,o){return new r(e,t,n,s,o)}}}const _e=new Map,fe=function(e,t,n){let s=_e.get(e);if(s){const r=n?[n]:void 0;s.forEach(({resolve:e,reject:n})=>t?e.apply(e,r):n.apply(n,r)),_e.delete(e)}};class ye{static finishOperation(e,t){fe(e,!0,t)}static failOperation(e,t){fe(e,!1,t)}static waitFor(e,t){return new Promise((n,s)=>{let r=_e.get(e);r||(_e.set(e,[]),r=_e.get(e)),r.push({resolve:n,reject:s}),"function"==typeof t&&t.apply(t)})}}e("n",ye);const we=new Map;class Ee{static start(e){if(!window.performance||!window.performance.getEntriesByName)return"";let t=window.performance.getEntriesByName(e).length++,n="";t<100&&(n="0"),t<10&&(n="0"+n);const s=t>0?e+"_"+n+t:e,r=s+"_start";return window.performance.mark(r),s}static addMeta(e,t){const n=Ee.getMeta(e);we.set(e,Object.assign(n,t))}static getMeta(e){return we.get(e)||{}}static end(e){}static getMeasure(e){return[]}static showBenchmarks(e){const t=window.performance.getEntriesByType("measure");t.sort((function(e,t){return e.startTime-t.startTime}));const n=[];for(let s=0,r=t.length;s<r;s++){const r=t[s];e&&-1===r.name.indexOf(e)||n.push({Start:parseFloat(r.startTime.toFixed(2)),Name:r.name,Duration:parseFloat(r.duration.toFixed(2))})}console.table(n)}}e("B",Ee);var be={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"}};void 0!==t&&t.exports||(window.IS_DEBUG=!0),function(e=!1){if(e){let e=JSON.parse(JSON.stringify(be));e.APP,e.features}}();const Me=JSON.parse(JSON.stringify(be));var ve=e("E",Me);const Ce=e("o",(function(e){return e.validRange&&"string"==typeof e.validRange.type})),Te=function(e){return e.validValues&&e.validValues.length>0},Pe=function(e){return"length"===e.unitType||"area"===e.unitType},Re=e("p",(function(e){return"Material"===e.type}));let Ie,Se,ke,xe,Le;const Ae={WASM:{CONFIGURATOR:{URL:"static/ConfiguratorKernel-4153106c16b35980.wasm",LOADER:"static/ConfiguratorKernel-e9bbd4998a056b0b.js"},PLANNER:{URL:"static/RoomleCore-daed88a09e86faf7.wasm",LOADER:"static/RoomleCore-18f96bc7c4c9fe8e.js"}},ASM:{CONFIGURATOR:{MEM_URL:"static/ConfiguratorKernelJs-795532b819912c59.mem",LOADER:"static/ConfiguratorKernelJs-02aa8157cf299656.js"},PLANNER:{MEM_URL:"static/RoomleCoreJs-10b4a8ee2a89da25.mem",LOADER:"static/RoomleCoreJs-1e5e3331b2d12a5a.js"}}},De=!!window.WebAssembly;e("O",(()=>{class e{constructor(e,t){this._requestedMaterialIds=[],this._configuratorKernelCallbackListener=new Set,this._cachedGroupIds=[],this._waitingForGroups=!1,this._subComponentsWaiters=new Map,this._shouldWait=!0,this._creator_=e,this._setupKernelPaths(t),this._setupEmsModule(t),this._useWASM=De,this._kernelPath=De?ke:xe,window.KernelCallback={isReady:this.isReady.bind(this)},this._lifeCycleManager.addEventListener(this)}_utilityToLongArray(e){const t=new this._kernelContainer.LongArray;return e.forEach(e=>t.push_back(e)),t}get kernelContainer(){return this._kernelContainer}get kernelInstance(){return this._kernelInstance}_setupKernelPaths(e){const t=0===e?"PLANNER":"CONFIGURATOR";Ie=Ae.ASM[t].MEM_URL,Se=Ae.WASM[t].URL,ke=Ae.WASM[t].LOADER,xe=Ae.ASM[t].LOADER,Le=!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)?s()+Ie:t},wasmBinaryFile:s()+Se,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")}},Le&&De&&(this._kernelContainer.instantiateWasm=function(e,t){return((e,t,n)=>{const r="function"==typeof WebAssembly.instantiateStreaming;Ee.addMeta("kernel_is_ready",{cachedInIndexedDB:!1});let o=null;r?(Ee.start("kernel_stream_compile"),o=WebAssembly.instantiateStreaming(fetch(s()+e),t),Ee.end("kernel_stream_compile")):(Ee.start("kernel_legacy_compile"),o=fetch(s()+e).then(e=>e.arrayBuffer()).then(e=>WebAssembly.instantiate(e,t))),Ee.addMeta("kernel_is_ready",{instantiateStreaming:r}),o.then(e=>{Ee.end(r?"kernel_stream_compile":"kernel_legacy_compile"),n(e.instance)},e=>console.error(e))})(Se,e,t),{}})}_passSubComponentsToKernel(e,t){const n=e.id,s=t.get(n);if(s)for(let t=0,r=s.length;t<r;t++){const{parentId:r,partId:o}=s[t];this._kernelIo.setMeta({componentId:n}),this._kernelInstance.loadedSubComponent(r,o,n,e.configuration)}}_fetchSubComponents(e){let t=[...e.keys()];t.length&&this._rapiAccess.getComponents(t).then(t=>{for(let n=0,s=t.length;n<s;n++)this._passSubComponentsToKernel(t[n],e);this._flushSubComponentsWaiters()})}_flushSubComponentsWaiters(){this._fetchSubComponents(this._subComponentsWaiters),this._subComponentsWaiters=new Map,this._shouldWait=!1}isReady(){this._kernelContainer.setExternalHelpers(this._kernelIo,{convertCObject:ue}),ve.isProduction||ve.isUnitTesting||this.addDebugInfo(),window.KernelCallback&&(window.KernelCallback=null,delete window.KernelCallback),this._unitFormatter.init(this._kernelContainer)}addDebugInfo(){const e=function(t,n=[]){const s=Object.getPrototypeOf(t),r=s?Object.getOwnPropertyNames(s):[],o=t?Object.getOwnPropertyNames(t):[];return s?e(s,[...n,...o,...r]):[...o,...r,...n]},t=e(this),n=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toString","valueOf"];[...new Set(t)].forEach(e=>{if(!e.startsWith("_")&&"function"==typeof this[e]&&-1===n.indexOf(e))try{const t=this[e].bind(this);this[e]=function(...n){return this._kernelIo.log("[ KernelCommunication ]: "+e),t(...n)}}catch(e){}})}getConfigurationData(e){return new Promise(t=>{var n;const s=this.kernelInstance.getPlanObject(e),r=(new Date).toISOString(),o=this.kernelInstance.getComponentId(e),i=z(o),a=(null===(n=s.boxForMeasurement)||void 0===n?void 0:n.size)||s.bounds;t({created:r,lastAccess:r,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:i,orderable:!1,requestable:!1})})}loadComponent(e,t,n){this._rapiAccess.getComponent(t.componentId).then(s=>{var r;let o=s.configuration;o||(o="error",null===(r=this._configuratorUiCallbacks)||void 0===r||r.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()},s=>{var r;this._kernelInstance.loadComponent(e,"error",t,n),this.onLoadComponentError(s,t.componentId),null===(r=this._configuratorUiCallbacks)||void 0===r||r.onError(new Error(`Component with id "${t.componentId}" can not be loaded. "${s}"`)),this._flushSubComponentsWaiters()})}loadSubComponent(e,t,n){if(this._shouldWait){let s=this._subComponentsWaiters.get(n);s||this._subComponentsWaiters.set(n,[]),s=this._subComponentsWaiters.get(n),s.push({parentId:e,partId:t}),this._subComponentsWaiters.set(n,s)}else this._rapiAccess.getComponent(n).then(s=>{var r;let o=s.configuration;o||(o="error",null===(r=this._configuratorUiCallbacks)||void 0===r||r.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,s,r){var o;this._kernelInstance.dockComponentWithPosition(n,s,e,t,r);const i=this._kernelInstance.getComponentId(n),a=this._kernelInstance.getComponentId(e);null===(o=this._configuratorUiCallbacks)||void 0===o||o.onUserInitiatedDockDone(i,s,a,t,r)}Editor3dAddBakedMesh(e,t,n,s,r,o,i){this._configuratorKernelCallbackListener.forEach(a=>a.Editor3dAddBakedMesh(e,t,n,s,r,o,i))}Editor3dAddNamedMesh(e,t,n,s,r,o,i,a,l,c){this._configuratorKernelCallbackListener.forEach(h=>h.Editor3dAddNamedMesh(e,t,n,s,r,o,i,a,l,c))}Editor3ChangedNamedMesh(e,t,n,s,r){this._configuratorKernelCallbackListener.forEach(o=>o.Editor3ChangedNamedMesh(e,t,n,s,r))}Editor3dRemoveNamedMesh(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.Editor3dRemoveNamedMesh(e,t))}Editor3dBeginConstruction(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.Editor3dBeginConstruction(e,t))}Editor3dEndConstruction(e){this._configuratorKernelCallbackListener.forEach(t=>t.Editor3dEndConstruction(e))}Editor3dComponentCreated(e,t,n,s){this._configuratorKernelCallbackListener.forEach(r=>r.Editor3dComponentCreated(e,t,n,s,!1))}Editor3dComponentDocked(e,t,n,s){this._configuratorKernelCallbackListener.forEach(r=>r.Editor3dComponentDocked(e,t,n,s))}Editor3dGeometryReady(e){this._configuratorKernelCallbackListener.forEach(t=>t.Editor3dGeometryReady(e)),this.requestPlanComponentConstruction(e)}Editor3dGeometryNotReady(e){this._configuratorKernelCallbackListener.forEach(t=>t.Editor3dGeometryNotReady(e))}componentDeleted(e){this._configuratorKernelCallbackListener.forEach(t=>t.componentDeleted(e))}componentMetaUpdated(e){let t=this._kernelInstance.getComponent(e);this._configuratorKernelCallbackListener.forEach(e=>e.componentMetaUpdated(t))}sceneCleared(){this._configuratorKernelCallbackListener.forEach(e=>e.sceneCleared())}requestMaterialsInGroup(e){(Array.isArray(e)?e:[e]).forEach(e=>{-1===this._cachedGroupIds.indexOf(e)&&this._cachedGroupIds.push(e)}),this._waitingForGroups||(this._waitingForGroups=!0,ye.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 s=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:s,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 a(0),!this._requestedMaterialIds.length)return;const n=[...this._requestedMaterialIds];this._requestedMaterialIds=[];const s=await this._rapiAccess.getMaterials(n);let r=[];s.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()&&r.push({id:e.id,properties:t})}),r.length&&this._kernelInstance.setMaterialProperties(r)}registerCallbacks(){this._kernelContainer.registerConfiguratorCallback(this)}pause(){this.cleanUpCallbacks()}resume(){this.cleanUpCallbacks(),this.registerCallbacks()}destroy(){}_handleCortoMesh(e,t,n){var s;try{this._kernelInstance.addMeshCorto(t,n,new Uint8Array(e))}catch(e){console.error(e),null===(s=this._configuratorUiCallbacks)||void 0===s||s.onMemoryCorruption()}}_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 s=W(n);return s&&(e.set(s,n),t.push(s)),t},[]);return new Promise((s,r)=>{this._rapiAccess.getPrices(n).then(n=>{if(!n.length)return r(new Error("prices are empty"));const o=l(n,"priceId");let i=0;return t.fullList.forEach(e=>{const t=W(e);if(!o.has(t))return void console.warn("PriceId: "+t+" has no corresponding kernel-part");const{price:n,currencySymbol:s}=o.get(t);e.price=n,e.currencySymbol=s,i+=n*e.count}),this._configuratorUiCallbacks.onUpdatePrice(n[0].currencySymbol,i),s({totalSum:i,partMap:e})},e=>{console.error(e),r(e)})})}}return Promise.resolve({totalSum:0,partMap:e})}async addUiDataAndPriceToPartList(e,t){const{fullList:n,originPart:s}=e,r=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 i=this._initData.usePriceService||this._initData.useRoomlePrice,a=e=>{i||(e.price=null,e.currencySymbol=null);const t=W(e);if(!t)return;if(!o.has(t))return;const{price:n,currencySymbol:s}=o.get(t);"number"==typeof n&&(e.price=n,e.currencySymbol=s)};return n.forEach(a),r.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:r,originPart:s}}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),Re(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 s=await this.addUiDataAndPriceToPartList(n,e);this._configuratorUiCallbacks.onPartListUpdate(s,btoa(e))}}return y([B],e.prototype,"_rapiAccess",void 0),y([B],e.prototype,"_scriptLoader",void 0),y([B],e.prototype,"_kernelIo",void 0),y([B],e.prototype,"_dataSyncer",void 0),y([B],e.prototype,"_lifeCycleManager",void 0),y([B],e.prototype,"_configuratorUiCallbacks",void 0),y([B],e.prototype,"_globalCallback",void 0),y([B],e.prototype,"_initData",void 0),y([B],e.prototype,"_unitFormatter",void 0),y([B],e.prototype,"_configuratorContext",void 0),y([B],e.prototype,"_globalInitData",void 0),e})());const He=e("Q",10);e("j",9);let Fe=e("a2",(()=>{class e{constructor(e){this._mergeThreshold=3,this._componentsToMerge=new Oe,this._mergeInProgress=!1,this._components=new Map,this._previews=new Map,this._creator_=e,this._getKernelAccess().addConfiguratorListener(this),this._componentFactory=me()}get materialQueue(){return this.getMeshGenerator().materialQueue}_getKernelAccess(){return Qe.lookup("kernel-access",this._creator_)}clearReference(){this._getKernelAccess().removeConfiguratorListener(this)}_addMeshToSubPart(e,t,n,s,r,o,i,a){let l=this._generateMesh(e,t,n,r,o,i,a);s&&l.applyMatrix4(ge(s)),this._subPartObject.add(l)}_addMeshToComponent(e,t,n,s,r,o,i,a,l,c){if(this._subPartGuard&&this._subPartGuard.info===e)return void this._addMeshToSubPart(e,null,s,null,o,i,a,l);const h=this.getComponent(e);if(!h)return;const d=this._componentFactory.isPreview(h),u=this._generateMesh(e,n,d?null:s,o,i,a,l);u.userData.meshId=t,u.userData.geometryId=n,u.userData.materialId=s,r&&(u.userData.transform=ge(r),u.applyMatrix4(u.userData.transform)),d&&u.layers.set(4),h&&h.addMesh(u),h.meshes.length>this._mergeThreshold&&this._componentsToMerge.set(e,h.meshes.length)}_changeMeshOfComponent(e,t,n,s,r){const o=this.getComponent(e);if(!o)return;const i=o.getMeshById(t);i&&(i.userData.geometryId!==n&&console.warn("Geometry of mesh has changed!"),i.userData.materialId=s,this._configuratorMeshGenerator.setMaterial(i,s),r&&(i.userData.transform=ge(r),i.position.set(0,0,0),i.scale.set(1,1,1),i.rotation.set(0,0,0),i.applyMatrix4(i.userData.transform)))}_removeMeshFromComponent(e,t){const n=this.getComponent(e);n&&n.removeMeshById(t)}getComponent(e){let t=this._components.get(e);return t||(t=this._previews.get(e.toString()),t)?t:(console.warn("component not found!",e),null)}tryToMergeComponents(){this._initData.moc||this._mergeInProgress||(this._mergeInProgress=!0,this._componentsToMerge.size,this._requestMergeComponents())}_requestMergeComponents(){window.requestIdleCallback(this._mergeNextComponent.bind(this))}_mergeNextComponent(){if(this._componentsToMerge.size>0){const e=this._componentsToMerge.largestValue();this._componentsToMerge.delete(e),this._mergeComponent(e),this._requestMergeComponents()}else this._mergeInProgress=!1,this._geometriesMerged&&this._geometriesMerged(),this._components.forEach(e=>{e.loadingMesh&&console.warn("component still has loading mesh: ",e.hash)})}_mergeComponent(e){const t=this._components.get(e);if(t&&!(t.meshes.length<=this._mergeThreshold))if(this._cacheHolder.componentCache.has(t.hash)){const e=this._cacheHolder.componentCache.get(t.hash).meshes;t.replaceMeshes(e)}else{const e=new Map,n=[],s=[];t.meshes.forEach(t=>{const r=t.userData.material;if(!r)return void console.warn("mesh has no material id set");if(!e.has(r)){const s=new THREE.Mesh(new THREE.Geometry,t.material);s.userData.material=r,s.receiveShadow=!0,s.castShadow=!0,s.layers.set(3),this._setMaterial(s,r),n.push(s),e.set(r,s)}const o=e.get(r).geometry;t.userData.transform?o.merge(t.geometry,t.userData.transform):o.merge(t.geometry),s.push(t)}),n.forEach(e=>t.addMesh(e)),s.forEach(e=>t.removeMesh(e)),this._cacheHolder.componentCache.set(t.hash,t)}}_addRootComponent(e){this._listener&&this._listener.display(e)}removeDockingComponent(){this._getKernelAccess().requestDeleteComponent(this._configuratorContext.dockingRootComponentId),this._configuratorContext.dockingRootComponentId=null}dockComponent(e,t,n,s){let r=this._components.get(t),o=this._components.get(e);o&&(o.roomlePosition=n,o.roomleRotation=s,r&&r.add(o))}dockComponentWithPosition(e,t){let n,s=this._components.get(e.parentId);n=t?t.getKernelPosition(s):e.getKernelPosition(s);const r=Ee.start("dock_component_with_position_"+e.childId);this._getKernelAccess().dockComponentWithPosition(e.parentId,e.parentDockId,e.childId,e.childDockId,n),this._configuratorContext.dockingRootComponentId=null,Ee.end(r)}removePreviews(){this._previews.size>0&&(this._previews.forEach(e=>{e.removeFromParent(),e.removeAllMeshes()}),this._previews.clear())}_updatePlanObject(e){const t=this._components.get(e.rootPlanComponentId);let n=!0;t&&(n=t.geometryChanged),this._listener&&this._listener.planObjectUpdated(e,n)}Editor3dAddBakedMesh(e,t,n,s,r,o,i){this._addMeshToComponent(e,null,null,t,null,n,s,r,o,i)}Editor3dAddDockPreview(e,t){let n=this._componentFactory.createPreview(t,e);this._previews.set(t.toString(),n)}Editor3dAddNamedMesh(e,t,n,s,r,o,i,a,l,c){this._addMeshToComponent(e,t,n,s,r,o,i,a,l,c)}Editor3ChangedNamedMesh(e,t,n,s,r){this._changeMeshOfComponent(e,t,n,s,r)}Editor3dRemoveNamedMesh(e,t){this._removeMeshFromComponent(e,t)}Editor3dBeginConstruction(e,t){if(!t){const t=this._components.get(e);t&&t.removeAllMeshes()}this._subPartGuard&&e===this._subPartGuard.info&&(this._subPartObject=new THREE.Object3D)}Editor3dComponentCreated(e,t,n,s,r){r&&(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,s),o.layers.set(3)),this._components.set(e,o),r&&this._addRootComponent(o)}Editor3dComponentDocked(e,t,n,s){this.dockComponent(e,t,n,s)}Editor3dEndConstruction(e){if(this._subPartGuard&&this._subPartGuard.info===e)return void this._subPartGuard.resolve(this._subPartObject);const t=this._getKernelAccess().kernelInstance.getComponent(e),n=this._components.get(e);n&&(n.computeBoundingBox(t.boxForMeasurement),n.boundingBoxMesh&&this._listener&&this._listener.addComponentHandlers(n));let s=this._previews.get(e.toString());s&&s.computeBoundingBox(t.boxForMeasurement,!0)}Editor3dGeometryReady(e){const t=this._components.get(e);t&&t.loadingFinished()}Editor3dGeometryNotReady(e){const t=this._components.get(e);t&&t.loading()}Editor3dPlanObjectConstructionDone(e){const t=this._getKernelAccess().kernelInstance.getPlanObject(e),n=[t,this._getKernelAccess().kernelInstance.getFullPartList(),this._getKernelAccess().kernelInstance.getHashOfConfiguration(e),this._getKernelAccess().kernelInstance.getComponentId(t.rootPlanComponentId)];ye.finishOperation(2,n),this._updatePlanObject(t),this._listener&&this._listener.planObjectConstructionDone(t)}Editor3dPreviewConstructionDone(e,t){let n=!1;this._previews.forEach(e=>{null!==e.parent&&(this._listener&&(this._componentFactory.isPreviewLine(e)?this._listener.addPreviewLineHandlers(e):this._listener.addPreviewHandlers(e)),n=!0)}),this._listener&&this._listener.previewConstructionDone(this._components.get(e),n)}Editor3dSetPreviewLineAssociations(e,t){let n=this._previews.get(t.toString());if(n.clear(),!n)return;let s=this._componentFactory.createPreviewLine(n),r=this._components.get(this._configuratorContext.rootComponentId);for(let t=0;t<e.length;t++){let n;n=0===t?s:s.clonePreviewLine(t),n.name="Preview Line",n.parentDockId=e[t].parentDockId,n.parentId=e[t].parentId,n.childDockId=e[t].childDockId,n.childId=e[t].childId,n.docklineRotation=(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),r.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 s=this._components.get(this._configuratorContext.rootComponentId);for(let t=0;t<e.length;t++){let r;0===t?r=n:(r=n.clonePreview(t),this._previews.set(r.stringId,r)),r.name="Preview Point",r.parentDockId=e[t].parentDockId,r.parentId=e[t].parentId,r.childDockId=e[t].childDockId,r.childId=e[t].childId,r.preparePreview(),r.receivedPointAssociation=!0,r.userData.ignoreComponentRaycast=!0,s.add(r),r.roomlePosition=e[t].position,r.roomleRotation=e[t].rotation}}componentDeleted(e){const t=this._components.get(e);t&&(this._listener&&this._listener.componentDeleted(t),t.removeFromParent(),t.removeAllMeshes(),this._components.delete(e))}componentMetaUpdated(e){const t=this._getRuntimeComponent(e.id);t&&(t.hash=e.hash,t.roomlePosition=e.position,t.roomleRotation=e.rotation,e.boxForMeasurement&&t.computeBoundingBox(e.boxForMeasurement),this._listener&&this._listener.componentUpdated(t,e))}componentConfigurationUpdated(e,t){const n=this._getRuntimeComponent(e);n&&(n.geometryChanged=t)}_getRuntimeComponent(e){let t=this._components.get(e);return t||(t=this._previews.get(e.toString()),t)?t:null}configurationLoaded(e,t,n,s,r){e===He&&(this._configuratorContext.dockingRootComponentId=n);let o=0===t;o?this._getKernelAccess().kernelInstance.requestPlanComponentConstructionRecursive(n):this._getKernelAccess().kernelInstance.requestPlanObjectConstruction(t);let i=this._getKernelAccess().kernelInstance.getComponent(n),a=this._components.get(n);a&&(a.computeBoundingBox(i.boxForMeasurement),a.hash=i.hash),this._listener&&this._listener.configurationLoaded(a,o&&void 0!==a.boundingBoxMesh)}finishParameterChange(e,t){this.materialQueue.registerCallback(e)}planObjectConfigurationUpdated(e,t,n){let s=this._getKernelAccess().kernelInstance.getPlanObject(e);this._updatePlanObject(s)}planObjectCreated(e,t){this._configuratorContext.planObjectId=t,this._listener&&this._listener.clearScene()}planObjectUpdated(e){this._updatePlanObject(e)}sceneCleared(){this._components.forEach((function(e){e.removeFromParent(),e.removeAllMeshes()})),this._components.clear(),this._previews.forEach(e=>{e.removeFromParent(),e.removeAllMeshes()}),this._previews.clear()}setListener(e){this._listener=e}getBoundingBox(){if(this._configuratorContext.planObjectId){const e=this._getKernelAccess().kernelInstance.getPlanObject(this._configuratorContext.planObjectId);if(e&&e.boxForMeasurement)return C(e.boxForMeasurement)}else if(this._configuratorContext.rootComponentId){const e=this._components.get(this._configuratorContext.rootComponentId);return(new THREE.Box3).setFromObject(e)}return null}getBoundingBoxWithPreviews(){const e=this._components.get(this._configuratorContext.rootComponentId);return e?(new THREE.Box3).setFromObject(e):null}hasPreviews(){return this._previews.size>0}clearRootComponent(){var e;null===(e=this._components.get(this._configuratorContext.rootComponentId))||void 0===e||e.hoverOff()}debugSceneGraph(e){e?this._components.has(e)?this._components.get(e):this._previews.has(e.toString())&&this._previews.get(e.toString()):this._configuratorContext}getComponentsForIds(e){let t=[];return e.forEach(e=>{const n=this._components.get(e);n&&t.push(n)}),t}getComponents(){return Array.from(this._components.values())}getPreviews(){return Array.from(this._previews.values())}isPreviewLine(e){return this._componentFactory.isPreviewLine(e)}isPreview(e){return this._componentFactory.isPreview(e)}setGeometriesMergedListener(e){this._geometriesMerged=e}removeGeometriesMergedListener(){this._geometriesMerged=void 0}setMergeThreshold(e){this._mergeThreshold=e}_generateMesh(e=0,t=null,n,s,r,o,i,a,l){return this._configuratorMeshGenerator.generateMesh(e,t,n,s,r,o,i)}_setMaterial(e,t,n){this._configuratorMeshGenerator.setMaterial(e,t)}constructComponents(e){this._getKernelAccess().kernelInstance.requestPlanObjectConstruction(e)}requestSubPartConstruction(e){return this._subPartGuard=new te(e),this._getKernelAccess().requestPlanComponentConstruction(e),this._subPartGuard.wait()}getMeshGenerator(){return this._configuratorMeshGenerator}}return y([B],e.prototype,"_configuratorMeshGenerator",void 0),y([B],e.prototype,"_configuratorContext",void 0),y([B],e.prototype,"_cacheHolder",void 0),y([B],e.prototype,"_initData",void 0),e})());class Oe extends Map{largestValue(){let e=this.entries().next().value[0],t=0;return this.forEach((n,s)=>{n>t&&(e=s,t=n)}),e}}class Ue{constructor(e){this.autoQuality=!0,this.colors=c,this.unit=null,this.unitStringType=null,this.meshSelection=!0,this.stats=!1,this._measureTraffic=!1,this.gammaOutput=!0,this.disableDebugGUI=!1,this.disableEnvMap=!1,this.dls=null,this.ls=null,this.cameraSpacing=0,this.transparentHighlighting=!0,this.mode="3D",this.edit=!1,this.moc=!1,this._creator_=e}setOverrides(e){h(this,e)}}e("ai",Ue);const Be=["language","browserLanguage","userLanguage","systemLanguage"];class je{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=Be.length;e<n;e++){const n=t[Be[e]];if(n)return n.substr(0,2)}return"en"})()||"en",this.overrideCountry=null,this._creator_=e}setOverrides(e){h(this,e)}}e("ah",je);class Ge{constructor(e){return this._isMute=!1,this._creator_=e,d(this,"_isMute",{enumerable:!1,writable:!1}),d(Ge.prototype,"_setMute",{enumerable:!1,writable:!1}),d(Ge.prototype,"mute",{enumerable:!1,writable:!1}),d(Ge.prototype,"unmute",{enumerable:!1,writable:!1}),new Proxy(this,this)}_setMute(e){u(this,"_isMute",!0),this._isMute=e,u(this,"_isMute",!1)}mute(){this._setMute(!0)}unmute(){this._setMute(!1)}get(e,t){return this._isMute&&"function"==typeof this[t]&&"on"===t.substr(0,2)?()=>{}:this[t]}}e("U",Ge);class Ve extends Ge{constructor(){super(...arguments),this.onNetworkRequest=(e,t,n)=>{},this.onKernelMsg=(e,t,n={})=>{},this.onCheckExternalCache=async(e,t)=>Promise.resolve(null)}}e("ag",Ve),e("C",{HSC:"rml-hsc",HSP:"rml-hsp",GLB:"rml-glb",RMV:"rml-mv"});let Ne=(()=>{class e{constructor(e){this._creator_=e,this._lifeCycleManager.addEventListener(this)}get element(){return this._container}setDomElement(e){if(!this._container){this._container=document.createElement("div"),this._container.classList.add("rml-threejs-canvas-container"),this._container.setAttribute("ondragover","return false"),this._container.style.position="relative",this._container.style.width="100%",this._container.style.height="100%";const t=document.createElement("style");t.innerText=".rml-threejs-canvas-container canvas{position:absolute;top:0;left:0;right:0;bottom:0;}.rml-threejs-canvas-container .foreground{z-index:100; opacity:1;}.rml-threejs-canvas-container .background{z-index:-1; opacity:0;}",this._container.appendChild(t),e.appendChild(this._container)}this._element=e}getClientDimensions(){return new THREE.Vector2(this._element.clientWidth,this._element.clientHeight)}_removeDomElement(e){if(!e)return;const t=e.parentElement;t&&t.removeChild(e)}reset(){this._element=null,this._removeDomElement(this._container),this._container=null}pause(){this.reset()}resume(){}destroy(){}}return y([B],e.prototype,"_lifeCycleManager",void 0),e})(),ze={InchFeet:null,MM:null,CM:null},We={NoUnitString:null,LongUnitString:null,ShortUnitString:null},Ke=(()=>{class e{constructor(e){this._formatter=null,this._precision=0,this._creator_=e}init(e){const t=new e.UnitMeasureFormatter;ze=e.Unit,We=e.UnitStringType,this._initActualUnit(),this._initActualUnitStringType();const{precisionCm:n,precisionInch:s}=this._initData;this._actualUnit===ze.InchFeet?this._precision=void 0!==s?parseInt(s,10):2:this._actualUnit===ze.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=ze.CM;break;case"mm":this._actualUnit=ze.MM;break;case"inchfeet":this._actualUnit=ze.InchFeet;break;default:this._actualUnit=ze.CM}}_initActualUnitStringType(){const{unitStringType:e}=this._initData;switch(e){case"none":this._actualUnitStringType=We.NoUnitString;break;case"long":this._actualUnitStringType=We.LongUnitString;break;case"short":this._actualUnitStringType=We.ShortUnitString;break;default:this._actualUnitStringType=We.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){Pe(e)&&(e.valueLabel=this._formatParameterValue(e.value,e.unitType))}formatParameter(e){if(Pe(e)&&Array.isArray(e.validValues)&&e.validValues.forEach(({value:t},n)=>{e.validValues[n].label=this._formatParameterValue(t,e.unitType)}),e.valueLabel=this._formatParameterValue(e.value,e.unitType),Re(e))e.uiType="Material";else if(function(e){return"Boolean"===e.type}(e))e.uiType="Boolean";else if(Ce(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 Te(e)?(e.uiType="Options",function(e){return!!Te(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===ze.InchFeet}getPrecision(){return this._precision}getAllowedDelta(){const e=1/Math.pow(10,this._precision);return this.isInch()?25.4*e:e}}return y([B],e.prototype,"_initData",void 0),e})();e("aj",class{constructor(e){this._creator_=e}setScene(e){}setUiScene(e){}updateBounds(e){}clearScene(e,t){}moveCameraEnd(e){}moveCameraStart(e){}needsUiScene(){return!1}});let qe=(()=>{class e{constructor(e){this._plugins=[],this._creator_=e}async init(e,n,s){this._scene=e,this._uiScene=n,this._cameraPosition=s;const{bananaForScale:r}=this._initData;r&&await t.import("./banana-for-scale-a63fb2df.nomodule.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)}}return y([B],e.prototype,"_initData",void 0),e})();const Je=e("I",[new m("error-handler",class{constructor(){this._listeners={}}_subscribe(e,t){this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(t)}subscribe(e,t){this._subscribe(e,t)}dispatch(e,t){if(!this._listeners[e])return;const n=this._listeners[e];let s=n.length;for(let e=0;e<s;e++){const s=n[e];s.apply(s,t)}}unsubscribe(e,t){if(!this._listeners[e])return;const n=this._listeners[e];let s=n.length;for(let e=0;e<s;e++)if(n[e]===t)return n.splice(e,1),s--,void e--}softReject(e,t,n){return this.dispatch(n,[t]),e()}}),new m("form-data-util",f),new m("environment-loader",j),new m("static-item-loader",oe,0),new m("form-data-util",f),new m("single-promise-factory",class{constructor(e){this._promises=new Map,this._creator_=e}create(e,t,n){return new Promise((s,r)=>{let o=this._promises.get(e),i=!0;if(!o){const t=new Map;this._promises.set(e,t),o=this._promises.get(e),i=!1}o.get(t)||(o.set(t,[]),i=!1);const a=o.get(t);a.push({resolve:s,reject:r}),o.set(t,a);const l=()=>{o.delete(t),0===o.size&&this._promises.delete(e)};i||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 m("dynamic-light-setting-loader",V),new m("dynamic-quality-setting-loader",le),new m("network-layer",q),new m("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 m("network-layer",q),new m("kernel-io",Q,0),new m("data-syncer",ee),new m("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 m("life-cycle-manager",class{constructor(){this._listeners=[]}addEventListener(e){this._listeners.push(e)}removeEventListener(e){const t=this._listeners;let n=t.length;if(n)for(let s=0;s<n;s++)t[s]===e&&(t.splice(s,1),s--,n--)}pause(){this._listeners.forEach(e=>e.pause())}resume(){this._listeners.forEach(e=>e.resume())}destroy(){this._listeners.forEach(e=>e.destroy())}},1),new m("three-loader",ie),new m("local-storage-helper",ae),new m("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())A(e);for(const e of this._materialCache.values())F(e);for(const e of this._geometryCache.values())H(e);this._componentCache.clear(),this._geometryCache.clear(),this._materialCache.clear()}},0),new m("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 m("configurator-kernel-access-callback",class{constructor(e){this._callbackListener=new Set,this._creator_=e}addListener(e){this._callbackListener.add(e)}removeListener(e){this._callbackListener.delete(e)}isReady(){this._callbackListener.forEach(e=>e.isReady())}updatePossibleChildren(e,t,n){this._callbackListener.forEach(s=>s.updatePossibleChildren(e,t,n))}updateParameters(e,t,n,s){this._callbackListener.forEach(r=>r.updateParameters(e,t,n,s))}loadError(e){this._callbackListener.forEach(t=>t.loadError(e))}},1),new m("configurator-view-model",Fe,1),new m("configurator-context",class{constructor(){this.rootComponentParametersAsGlobal=!1,this.lastLoadedRapiId=null,this.selectedRuntimeComponentIds=[],this.selectionMode="standard"}get selectedRuntimeComponentId(){return this.selectedRuntimeComponentIds.length>0?this.selectedRuntimeComponentIds[0]:null}},1),new m("init-data",Ue,1),new m("global-init-data",je,0),new m("global-callback",Ve,0),new m("dom-helper",Ne,1),new m("unit-formatter",Ke,0),new m("plugin-system",qe,1)]);class Qe{static _ensureContainer(){window.__RML__DI__||(window.__RML__DI__=new g,window.__RML__DI__.addDependencyInjectionAssignments(Je))}static setup(e){Qe.addToContainer(e)}static lookup(e,t){return window.__RML__DI__?window.__RML__DI__.lookup(e,t):null}static getContext(e){return Qe._ensureContainer(),window.__RML__DI__.getContext(e)}static cleanUp(e){return window.__RML__DI__?window.__RML__DI__.cleanUp(e):null}static addToContainer(e){Qe._ensureContainer(),window.__RML__DI__.addDependencyInjectionAssignments(e)}}e("r",Qe);let Ze=e("A",(()=>{class e{static init(t={}){const{kernelInstance:n,kernelContainer:s,planObjectId:r}=t;e.kernelInstance=n,e.kernelContainer=s,e.planObjectId=r}static cleanUp(){e.useHDGeometry=!1,e.kernelInstance=null,e.kernelContainer=null,e.planObjectId=null}}return e.useHDGeometry=!1,e.kernelInstance=null,e.kernelContainer=null,e.planObjectId=null,e})());const{APP:$e}=ve,{RAPI:Xe}=$e,Ye=Xe.headers,et=Xe.itemHeaders,tt=Ye.token,nt=e("S","crt"),st=p();let rt=new Map,ot=new Map,it=new Map,at=new Map,lt=new Map,ct=new Map,ht=new Map,dt=new Map,ut=new Map;const pt=e=>rt.get(e)||rt.get(st+e),gt=e=>e&&e.tags&&e.tags.length,mt=e=>!gt(e)&&e.group;e("f",(()=>{class e{constructor(e){this._itemLoaded=!1,this._currentToken=null,this._creator_=e,window.addEventListener("online",this._flushOfflineQueue.bind(this))}getPreloadForItem(e){return this._getPreload(e,!0)}getPreloadForConfiguration(e){return this._getPreload(e,!1)}_getPreload(e,t){return new Promise((n,s)=>{if(!navigator.onLine)return n();if(this._dataSyncer.getIsCatalogSynced(z(e)))return n();if(ht.get(e))return n();const r=t?"?itemId=":"?configurationId=";this._get("/preloads/components/"+r+e,"preloads/components").then(t=>{if(ht.get(e))return n();t.forEach(e=>{this._prepareData(e,"components")}),ht.set(e,!0),n()},s)})}changeUseOfHDGeometry(){const e=at.get("components");ht.clear(),ct.clear(),e&&at.delete("components")}getHSCPackage(e){return new Promise((t,n)=>{if(ct.get(e))return t();this._get("/catalogs/"+e+"/package","package").then(n=>{if(ct.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")}),ct.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:et})}getComponents(e){return this._getByIds(e,"components")}getItems(e){return this._getByIds(e,"items",{additionalHeaders:et})}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=nt,n=50){return this._getById(e,"meshes",{pathSuffix:"/data?format="+t+"&targetQuality="+n.toString()})}getMeshesOfCatalog(e){return new Promise((t,n)=>{const s=lt.get(e);s?t(s):this._get("/meshes?catalog="+e,"catalogMeshes").then(n=>{lt.set(e,n),t(n)},n)})}getTexturesOf(e){return this._getRelationData(e,{rapiPath:"textures"})}getItemsOf(e){return this._getRelationData(e,{rapiPath:"items"})}async getMaterialsOf(e){return(await this._getRelationData(e,{rapiPath:"materials"},{embed:["textures"]})).filter(e=>e.active)}getComponentsOf(e){return this._getRelationData(e,{rapiPath:"components"})}getAdditionalContentsOfItems(e){const t=[],n=[];return e.forEach(e=>{const s=ot.get(e.id.toString());s?n.push(...s):t.push(e.id.toString())}),new Promise((e,s)=>{0!==t.length?this._getByIdsPackets(t,"itemAdditionalContents",{filterKey:"itemIds"}).then(t=>{t.forEach(e=>{let t=ot.get(e.itemId);t||(t=[]);for(let n=0,s=t.length;n<s;n++)if(t[n].id===e.id)return;t.push(e),ot.set(e.itemId,t)}),e([...t,...n])},s):e(n)})}getMaterial(e){return this._getById(e,"materials",{embed:["textures"]})}peekMaterial(e){return this._peekData(e,"materials")}peekComponent(e){return this._peekData(e,"components")}async getMaterials(e){return(await this._getByIds(e,"materials",{embed:["textures"]})).filter(e=>e.active)}getPlan(e){return this._getById(e,"plans")}static clearCaches(){rt=new Map,it=new Map,at=new Map,ct=new Map,ht=new Map,dt=new Map,ot=new Map}cleanUp(){e.clearCaches()}getMaterialsByGroup(e){const t=e.slice(),n=[];let s=t.length;for(let e=0;e<s;e++){const r=pt(t[e]);if(r){const o=r.length;for(let e=0;e<o;e++){const t=this._getCache("materials").get(r[e]);n.push(t)}t.splice(e,1),s--,e--}}return new Promise((e,s)=>{0!==t.length&&navigator.onLine?this._getByIdsPackets(t,"materials",{filterKey:"groups",embed:["textures"]}).then(t=>{e(this.combineMaterialsToGroups([...t,...n]))},s):e(this.combineMaterialsToGroups(n))})}_flushOfflineQueue(){return new Promise((e,t)=>{const n=this._localStorage.getItem("hsc_configurations_offline_queue_v1"),s=[];for(let e in n)if(n.hasOwnProperty(e)){const t=n[e];s.push(new Promise((e,n)=>{this.saveConfiguration(t.data).then(s=>{const r=[];t.perspectiveImage&&!s.perspectiveImage&&r.push(this.savePerspectiveImage(s,t.perspectiveImage)),t.topImage&&!s.topImage&&r.push(this.savePerspectiveImage(s,t.topImage)),Promise.all(r).then(e,n)},n)}))}Promise.all(s).then(()=>{this._localStorage.setItem("hsc_configurations_offline_queue_v1",{}),e()},t)})}_setQueuedConfiguration(e,t={}){const n=e.configurationHash,{perspectiveImage:s,topImage:r}=t;let o=this._localStorage.getItem("hsc_configurations_offline_queue_v1")||{},i=o[n]||{};i.data=e,i.perspectiveImage=s,i.topImage=r,o[n]=i,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,s)=>this._fetchJson("/shortIds","shortIds",{method:"POST",resolve:n,reject:s,data:JSON.stringify({shortId:{type:t,referencedId:e}}),accept:"application/json",contentType:"application/json; charset=UTF-8"}))}_peekData(e,t){const n=at.get(t);return n&&n.get(e)||null}_saveConfigurationImage(e,t,n){if(!navigator.onLine){const s={};return s[n]=t,this._setQueuedConfiguration(e,s),this._markConfigurationAsLocally(e),e[n]=t.image,Promise.resolve(e)}const s=this._formDataUtil.create(t.image,e.configurationHash,_.PNG,n);return this._save("/configurations/"+e.id+"/"+n,s,"configurations",{accept:"application/json"})}_markConfigurationAsLocally(e){e.isLocally=!0,e.id=e.configurationHash}_save(e,t,n,s={}){const r=t instanceof FormData?t:JSON.stringify(t);return new Promise((t,o)=>{const i={method:s.method||"POST",data:r,resolve:t,reject:o};s.contentType&&(i.contentType=s.contentType),s.accept&&(i.accept=s.accept),this._fetchJson(e,n,i)})}combineMaterialsToGroups(e){return new Promise((t,n)=>{const s=new Map,r={id:null,label:null,materials:[]},o=[];for(let t=0,n=e.length;t<n;t++){const n=e[t],i=n.tags&&n.tags.length?n.tags.map(e=>({isTag:!0,id:e})):[];n.group&&i.push({isTag:!1,id:st+n.group,legacyId:n.group}),i.length||i.push({isTag:!1,id:null}),n.tags&&n.tags.length&&n.tags.forEach(e=>-1===o.indexOf(e)?o.push(e):null),i.forEach(({isTag:e,id:t,legacyId:o})=>{const i=n.id;let a=t?pt(t):[];a||(rt.set(t,[]),a=pt(t)),-1===a.indexOf(i.toString())&&a.push(i.toString());const l=gt(n),c=l&&e,h=mt(n);if(c||h&&!e||!l&&!h&&!t){let e=t?s.get(t):r;e||(s.set(t,{id:t,label:n.groupLabel,legacyId:o,materials:[]}),e=s.get(t)),e.materials.push(n)}})}const i=r.materials.length?[r]:[];this.getTags(o).then(e=>{const n=e.reduce((e,t)=>(e[t.id]=t,e),{});return s.forEach((e,t)=>{i.push({id:t,label:n[t]?n[t].label:e.label,materials:e.materials,legacyId:e.legacyId,sort:n[t]?n[t].sort:void 0})}),t(i)},n)})}_getByIds(e,t,n={}){const s=this._getCache(t),r=this._getErrorCache(t),o=[],i=[...new Set(e)];let a=i.length;if(s&&s.size){const e=(new Date).getTime();for(let t=0;t<a;t++){const n=i[t],l=s.get(n),c=r.get(n);let h=!1;null!=l?(o.push(l),h=!0):h=void 0!==c&&(e-c.timestamp<6e4||!1===navigator.onLine),h&&(i.splice(t,1),a--,t--)}}return new Promise((e,s)=>{0!==i.length&&navigator.onLine?this._getByIdsPackets(i,t,n).then(t=>{e([...t,...o])},s):e(o)})}_getByIdsPackets(e,t,n={}){const s=n.filterKey||"ids";let r,o="/"+t+"/",i="?",a=[];const l=e.length;if(!l)return new Promise(e=>e([]));let c=!0,h=[];for(r=0;r<l;r++){c=!1;const n=e[r],l=i+s+"[]="+n,d=l.length+o.length;h.push(n),i="&",d<=1500?o+=l:(d>1500&&(h.pop(),r--),a.push({url:o,ids:h}),c=!0,o="/"+t+"/",i="?",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,s={}){return new Promise((r,o)=>{this._get(t,n,s).then(t=>{for(let n=0,r=t.length;n<r;n++){const r=s&&s.cacheKey?t[n][s.cacheKey]:t[n].id,o=e.indexOf(r.toString());-1!==o&&e.splice(o,1)}const o=e.length;if(o){const t=this._getCache(n),s=this._getErrorCache(n),r=(new Date).getTime();for(let n=0;n<o;n++)s.set(e[n],{code:0,timestamp:r}),t.delete(e[n]);this._errorHandler.dispatch(2,[n,e.map(e=>'"'+e+'"').join(",")])}r(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 s=this._getCache(t).get(e);if(s)return new Promise(e=>e(s));if(!navigator.onLine)return Promise.reject("Nothing cached but tried to fetch in offline mode");const r={...n,id:e},o=n.pathSuffix||"";return this._get("/"+t+"/"+e+o,t,r)}_get(e,t,n={}){const s=Ze.useHDGeometry?"includeGeometryHD=true":"";let r=-1===e.indexOf("?")?"?":"&";return""!==s&&(e+=r+s),n.embed&&Array.isArray(n.embed)&&n.embed.forEach(t=>{e+=r+"embed"+(t[0].toUpperCase()+t.substr(1))+"=true",r="&"}),new Promise((s,r)=>{const o=dt.get(e);Array.isArray(o)&&o.length>0?o.push({resolve:s,reject:r}):(dt.set(e,[{resolve:s,reject:r}]),this._fetchJson(e,t,n))})}_fetchJson(e,t,n={}){this._fetch(e,n).then(o.bind(this)).then(this._handleJson(e,t,n).bind(this)).catch(this._handleError(e,n).bind(this))}async _fetch(e,t){const n={method:t.method?t.method:"GET",headers:this._createHeaders(t),mode:"cors",cache:"default"};t.data&&(n.body=t.data);let s=Xe.server;const r=this._globalInitData.overrideRapi;r&&(s="live"===r?Xe.liveServer:Xe.testServer),(this._globalInitData.customApiUrl||""===this._globalInitData.customApiUrl)&&(s=this._globalInitData.customApiUrl);const o=new Request(s+e,n);this._globalCallback.onNetworkRequest(e,n,t);const i=await this._globalCallback.onCheckExternalCache(e,n);return i?{headers:{get:()=>"application/json"},json:()=>Promise.resolve(i)}:this._networkLayer.fetch(o)}_createHeaders(e={}){const t={...Ye};this._globalInitData.overrideTenant&&(t.currentTenant=this._globalInitData.overrideTenant),this._globalInitData.overrideCountry&&(t.country=this._globalInitData.overrideCountry);const n=this._globalInitData.locale||"en";t.language=n,t.locale=n;const{contentType:s,accept:r,additionalHeaders:o,data:i}=e;if(s&&(t["content-type"]=e.contentType),r&&(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||tt;t.token="03-"+window.btoa((new Date).toISOString()+";"+a+";"+Ye.apiKey);const l=new Headers(t);return i instanceof FormData&&l.delete("content-type"),l}_handleJson(e,t,n={}){return s=>{let r=null,o=null;"number"==typeof s&&(r=s);for(let e in s)"meta"!==e&&s.hasOwnProperty(e)&&(r=s[e],o=e);if("error"===o)return this._handleError(e,n)(new Error(JSON.stringify(r)));if(!r)throw new TypeError("RAPI returned empty JSON");if(Array.isArray(r))for(let e=0,s=r.length;e<s;e++)this._prepareData(r[e],t,n),this._prepareEmbeddedData(r[e],t,n);else this._prepareData(r,t,n),this._prepareEmbeddedData(r,t,n);n.resolve?n.resolve(r):this._notifyWaiters(e,null,r)}}_prepareEmbeddedData(e,t,n={}){n.embed&&Array.isArray(n.embed)&&n.embed.forEach(s=>{const r=e[s.slice(0,-1)+"Objects"];if(Array.isArray(r)){for(let e=0,t=r.length;e<t;e++)this._prepareData(r[e],s,n);this._prepareRelationalData(t,s,e.id,r)}else r&&(this._prepareData(r,s,n),this._prepareRelationalData(t,s,e.id,[r]))})}_getCache(e){return this._getCacheFrom(e,at)}_getErrorCache(e){return this._getCacheFrom(e,ut)}_getCacheFrom(e,t){let n=t.get(e);return n||(t.set(e,new Map),n=t.get(e)),n}_setCache(e,t,n){n.set(e.toString(),t)}_prepareData(e,t,n=null){let s=this._getCache(t);const r=n&&n.cacheKey?e[n.cacheKey]:e.id;if(r||n&&n.id||"tenants/me"===t)if("tenants/me"!==t){{const t=r||n.id;this._setCache(t,e,s)}e.__rapi_path__=t}else this._setCache("0",e,s);else"shortIds"!==t&&console.error("Can not cache because there is no ID!")}_getRelationsCacheFor(e,t,n){let s=it.get(t);if(!s){const r=new Map,o=new Map;o.set(n,void 0),r.set(e,o),it.set(t,r),s=it.get(t)}let r=s.get(e);if(!r){const t=new Map;t.set(n,void 0),s.set(e,t),r=s.get(e)}return r.get(n)}_prepareGroups(e){const t=e.group,n=e.id;let s=pt(t);s||(rt.set(t,[]),s=pt(t)),-1===s.indexOf(n.toString())&&s.push(n.toString())}_handleError(e,t={}){return n=>{navigator.onLine?(n.rmlErrorCode=1,n.message='Failed to load "'+e+'" because of "'+n.message+'"',this._errorHandler.dispatch(1,[n])):(n.rmlErrorCode=0,n.message='Failed to load "'+e+'" because of "'+n.message+'"',this._errorHandler.dispatch(0,[n])),t.reject?t.reject(n):this._notifyWaiters(e,n,null)}}_getRelationData(e,t,n={}){const s=e.id;if(!s)return Promise.resolve([]);const r=e.__rapi_path__,o=t.rapiPath;let i=this._getCache(o),a=this._getRelationsCacheFor(s.toString(),r,o),l=[];return a?(a.forEach(e=>l.push(i.get(e))),new Promise(e=>e(l))):navigator.onLine?new Promise((e,t)=>{this._get("/"+r+"/"+s+"/"+o,o,n).then(t=>{this._prepareRelationalData(r,o,s,t),e(t)},t)}):Promise.resolve([])}_prepareRelationalData(e,t,n,s){it.has(e)||it.set(e,new Map);let r=it.get(e);const o=n.toString();r.has(o)||r.set(o,new Map);let i=r.get(o),a=this._getCache(t),l=[];for(let e=0,t=s.length;e<t;e++){const t=s[e],n=t.id.toString();l.push(n),a.set(n,t)}i.set(t,l)}_notifyWaiters(e,t,n){const s=dt.get(e);if(s&&s.length){for(let e=0,r=s.length;e<r;e++)t?s[e].reject(t):s[e].resolve(n);dt.delete(e)}}_tenantMe(){return new Promise((e,t)=>{const n=this._getCache("tenants/me"),s=this._globalInitData.overrideTenant?this._globalInitData.overrideTenant:n.get("0");if(s)return e(s);this._fetchJson("/tenants/me","tenants/me",{resolve:t=>e(t),reject:t})})}async getTenant(e){return e||(e=await this._tenantMe()),this._getById(e.toString(),"tenants")}getCurrentSkin(){return this._tenantMe().then(e=>this._getById(e.toString(),"tenants").then(e=>this._getById(e.skin.toString(),"skins")))}getPrices(e){return this._getByIds(e,"prices",{filterKey:"priceIds",cacheKey:"priceId"})}async getConfiguratorSettings(e){const t=await this._getById(e,"configurators");return t.allowedHosts||(t.allowedHosts=[]),t.allowedHosts&&!Array.isArray(t.allowedHosts)&&(t.allowedHosts=t.allowedHosts.split(" ")),t}sendUserAction(e){return this._save("/userActions",{userAction:e},"userActions",{accept:"application/json",contentType:"application/json; charset=UTF-8"})}shareConfiguration(e,t,n){const s="/configurations/"+e+"/shares",r=new FormData;return r.append("email",t),r.append("type",n.toString()),new Promise((e,t)=>{const n={method:"POST",data:r,resolve:e,reject:t,accept:"application/json",contentType:"application/json; charset=UTF-8"};this._fetch(s,n).then(n.resolve,n.reject)})}export3D(e,t,n,s={}){const r="/configurations/"+e+"/3d-exports",o={formats:[{file_format:n,pack_external_data:!0,...s}]},i=JSON.stringify(o),a=new FormData;return a.append("email",t),a.append("settings",i),new Promise((e,t)=>{const n={method:"POST",data:a,resolve:e,reject:t};this._fetch(r,n).then(n.resolve,n.reject)})}async trackView(e){if(this._itemLoaded||(t=(()=>{var e;const t=(()=>{if(window.__RML__ENV__&&window.__RML__ENV__.skipIframeCheck)return!1;try{return window.self!==window.top}catch(e){return!0}})();let n=null===(e=null===window||void 0===window?void 0:window.location)||void 0===e?void 0:e.href;if(!n)return null;if(t){if(!document.referrer)return null;n=document.referrer}const{hostname:s}=new URL(n);return s})())&&(N.includes(t)||t.endsWith("gitlab.io")||t.endsWith("gitlab.com")||t.endsWith("codesandbox.io")||t.endsWith("stackblitz.com")||/^(admin.*.roomle.com)$/.test(t)))return;var t;const{configuratorId:n}=this._globalInitData,s={module:3,action:1,actionId:e,actionLabel:n};await this.sendUserAction(s),this._itemLoaded=!0}signinUser(e,t){return new Promise((n,s)=>{const r={method:"POST",accept:"application/json",contentType:"application/json; charset=UTF-8",data:JSON.stringify({identification:e,passwordMD5:t}),cacheKey:"token",resolve:n,reject:s};this._fetchJson("/auth/signin","auth",r)})}async signoutUser(e){const t=this._currentToken;t!==e&&this.setCurrentToken(e),await this._fetch("/auth/signout",{}),t&&t!==e?this.setCurrentToken(t):this.removeCurrentToken()}async savePlan(e){const t=e.id?"/plans/"+e.id:"/plans";return this._save(t,{plan:e},"plans",{method:e.id?"PUT":"POST",accept:"application/json",contentType:"application/json; charset=UTF-8"})}setCurrentToken(e){this._currentToken=e}removeCurrentToken(){this._currentToken=null}createNewPlan(){return{name:"",description:"",changeDate:(new Date).toISOString(),created:(new Date).toISOString(),draftId:null,thumbnail:"data:image/png;base64,missing",planObjects:null,active:!0,open:0,planDirectory:0,changed:0,version:2,floorLevel:0,visibility:9,user:null,tenant:null,assets:[],parent:null,setting:null}}}return y([B],e.prototype,"_formDataUtil",void 0),y([B],e.prototype,"_errorHandler",void 0),y([B],e.prototype,"_dataSyncer",void 0),y([B],e.prototype,"_networkLayer",void 0),y([B],e.prototype,"_localStorage",void 0),y([B],e.prototype,"_globalInitData",void 0),y([B],e.prototype,"_globalCallback",void 0),e})())}}}));
16
- //# sourceMappingURL=rapi-access-ec9bc9d3.nomodule.js.map
15
+ ***************************************************************************** */function y(e,t,n,s){var r,o=arguments.length,i=o<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,n):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(e,t,n,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(i=(o<3?r(i):o>3?r(t,n,i):r(t,n))||i);return o>3&&i&&Object.defineProperty(t,n,i),i}class w{constructor(){this._size=256,this._maxLod=0,this._encoding=THREE.LinearEncoding,this._type=THREE.UnsignedByteType,this._format=THREE.RGBAFormat,this._cubeTextures=[],this._lightDirection=new THREE.Vector3,this._path=""}setPath(e){this._path=e}load(e){return new Promise(t=>{(new THREE.FileLoader).setResponseType("arraybuffer").load(this._path+e,e=>{this.parseData_(e),t(this._cubeTexture)})})}parseHeader_(e){let t=new DataView(e,0,30);this._size=t.getUint16(0),this._maxLod=t.getUint8(2),this._encoding=t.getUint16(3),this._type=t.getUint16(5),this._format=t.getUint16(7),this._lightDirection.x=t.getFloat32(9),this._lightDirection.y=t.getFloat32(13),this._lightDirection.z=t.getFloat32(17)}parseBufferData_(e,t){let n=this._size;const s=Math.log2(this._size)+1;this._cubeTextures=[];for(let r=0;r<s;r++){let s=new THREE.CubeTexture;this._cubeTextures.push(s),s.format=THREE.RGBAFormat,s.encoding=this._encoding,s.type=this._type,s.minFilter=THREE.LinearMipMapLinearFilter,s.magFilter=THREE.LinearFilter,s.generateMipmaps=!1;for(let r=0;r<6;r++){let o=new Uint8Array(e,t,4*n*n),i=new THREE.DataTexture(o,n,n);i.format=s.format,i.encoding=s.encoding,i.type=s.type,i.generateMipmaps=!1,t+=4*n*n,s.images[r]=i,i.needsUpdate=!0}s.needsUpdate=!0,n/=2}this._cubeTexture=new THREE.CubeTexture,this._cubeTexture.format=THREE.RGBAFormat,this._cubeTexture.encoding=this._encoding,this._cubeTexture.type=this._type,this._cubeTexture.minFilter=THREE.LinearMipMapLinearFilter,this._cubeTexture.magFilter=THREE.LinearFilter,this._cubeTexture.generateMipmaps=!1;for(let e=0;e<6;e++){this._cubeTexture.image[e]=this._cubeTextures[0].images[e];for(let e=1;e<s;e++)this._cubeTexture.mipmaps[e-1]=this._cubeTextures[e],this._cubeTextures[e].needsUpdate=!0}this._cubeTexture.needsUpdate=!0,this._cubeTexture.maxLod=this._maxLod-1}convertToRGBABuffer(e){let t=new Uint8Array(e,30,e.byteLength-30),n=4;this._format===THREE.RGBFormat&&(n=3);const s=4*t.length/n;let r=new ArrayBuffer(s),o=new DataView(r),i=0,a=t.length/n;if(3===n)for(let e=0;e<a;e++)o.setUint8(i++,t[e]),o.setUint8(i++,t[e+a]),o.setUint8(i++,t[e+2*a]),o.setUint8(i++,255);else for(let e=0;e<a;e++)o.setUint8(i++,t[e]),o.setUint8(i++,t[e+a]),o.setUint8(i++,t[e+2*a]),o.setUint8(i++,t[e+3*a]);return r}parseData_(e){this.parseHeader_(e);let t=30;t=0;let n=this.convertToRGBABuffer(e);this.parseBufferData_(n,0)}}const E=e("t",(function(e){return e*(Math.PI/180)})),b=(e("v",(function(e,t,n,s,r,o){e=Math.sqrt(e*e+n*n);const i=r/o,a=2*Math.atan(Math.tan(s*Math.PI/180/2)*i)*180/Math.PI,l=E(s),c=t/2/Math.tan(l/2),h=e/(2*Math.atan(Math.PI*a/360));return Math.max(c,h)})),function(e){return Math.round(1e3*e)/1e3}),M=(e("M",(function(e,t){return Math.abs(e.y-t.y)+Math.abs(e.x-t.x)})),e("x",(function(e,t){return Math.atan2(t.y-e.y,t.x-e.x)})),e("w",(function(e){let t=function(e){return e*(180/Math.PI)}(e);return t<0&&(t=180+(180+t)),t})),e("X","#DDDDDD")),v=(e("a5",1),e("a6",0),e("Z",1)),C=(e("g",(e,t,n,s)=>{if(!e||!t||0===n||0===s)return new THREE.Vector3;let r=e.clone(),o=n/2,i=s/2;return r.project(t),r.x=Math.floor(r.x*o+o),r.y=Math.floor(-r.y*i+i),r.z=e.distanceTo(t.position),r}),e("k",(e,t)=>{t||(t=new THREE.Vector3(0,0,0));let n=new THREE.Vector3(e.size.x/1e3,e.size.z/1e3,e.size.y/1e3),s=new THREE.Vector3(e.origin.x/1e3,e.origin.z/1e3,e.origin.y/-1e3),r=new THREE.Vector3(0,0,-n.z).add(s).sub(t),o=new THREE.Vector3(n.x,n.y,0).add(s).add(t);return new THREE.Box3(r,o)}));e("b",e=>(e.from=e.from/1e3,e.to=e.to/1e3,1===e.type.value?(e.type={value:2},e.from*=-1,e.to*=-1):2===e.type.value&&(e.type={value:1}),e)),e("s",(e,t)=>{let n=b(e.x),s=b(e.y),r=b(e.z),o=b(t.x),i=b(t.y),a=b(t.z);return n===o&&s===i&&r===a}),e("K",(e,t)=>{let n=b(e.w),s=b(e.x),r=b(e.y),o=b(e.z),i=b(t.w),a=b(t.x),l=b(t.y),c=b(t.z);return n===i&&s===a&&r===l&&o===c}),e("u",(e,t)=>{let n=b(e.x),s=b(e.y),r=b(t.x),o=b(t.y);return n===r&&s===o});let T=null;const P=()=>{if(T)return T;const e=new Uint8Array(4);for(let t=0;t<1;t++){const n=4*t;e[n]=255,e[n+1]=255,e[n+2]=255,e[n+3]=255}const t=new THREE.DataTexture(e,1,1,THREE.RGBAFormat);return t.needsUpdate=!0,t},R=(e,t,n,s)=>{const r=new Uint8Array(4),o=Math.floor(255*e),i=Math.floor(255*t),a=Math.floor(255*n),l=Math.floor(255*s);for(let e=0;e<4;e++){const t=4*e;r[t]=o,r[t+1]=i,r[t+2]=a,r[t+3]=l}const c=new THREE.DataTexture(r,1,1,THREE.RGBAFormat);return c.needsUpdate=!0,c},I=(e("G",(e,t)=>I(null,e,t)),e("ac",(e,t,s)=>{if(e||(e=S()),e.name=t.id?t.id.toString():"",void 0!==t.shading.metallic&&(e.metalness=1===t.shading.metallic?1:.5,e.reflectivity=n(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=n(t.shading.occlusion,1),e.roughness=n(t.shading.roughness,.5),e.alphaTest=n(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==s||s.setEnvMap(e),t.shading.doubleSided?e.side=THREE.DoubleSide:e.side=THREE.FrontSide,e.map||(T||(T=P()),e.map=T),e})),S=()=>new THREE.MeshPhysicalMaterial({});e("ad",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 k=null;e("H",(e,t,n,s,r,o,i=16)=>(k||(k=new THREE.TextureLoader,k.crossOrigin=""),new Promise((a,l)=>{if(!e)return console.warn("trying to add a texture without image",t),void a();k.load(e,e=>{x(e,t,n,s,r,o,i),a()},l)})));const x=e("ae",(e,t,n,s,r,o,i=16)=>{e.anisotropy=s,e.wrapS=THREE.RepeatWrapping,e.wrapT=THREE.RepeatWrapping,"ORM"===t.mapping&&i<=8?console.warn("ORM maps are not supported on devices with only "+i+" texture units"):(e.repeat.set(r,o),"XYZ"===t.mapping?(n.normalMap=e,n.map===P()&&(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)}),L=(e("J",(e=!0)=>window.dat&&window.dat.GUI?(window.__RML_GUI__||(window.__RML_GUI__=new dat.GUI({autoPlace:e})),window.__RML_GUI__):null),e("a8",(e,t,n=!0)=>{let s=e.getWorldDirection(new THREE.Vector3),r=Math.abs(s.y);r<.5&&!t.transparent&&L(t,!0,n),r>.5&&t.transparent&&L(t,!1,n)}),e("a9",(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})),A=(e("Y",e=>{let t=new THREE.Color;return t.setRGB((e>>16)/255,(e>>8&255)/255,(e>>0&255)/255),t}),e("c",(e,t)=>{e.traverse(e=>{if(e instanceof THREE.Mesh&&TWEEN){const n=e.material;e.userData.tween&&e.userData.tween.stop();const s={opacity:n.opacity};t.transparent&&(n.transparent=t.transparent),e.userData.tween=new TWEEN.Tween(s).to(t,250).easing(TWEEN.Easing.Linear.None).onUpdate(()=>{n.opacity=s.opacity}).onStop(()=>{t.transparent||(n.transparent=t.transparent),n.opacity=t.opacity,n.needsUpdate=!0,e.userData.tween=void 0}).onComplete(()=>{t.transparent||(n.transparent=t.transparent),n.needsUpdate=!0,e.userData.tween=void 0}).start()}})}),e("F",e=>{e.traverse(e=>{if(e instanceof THREE.Mesh&&TWEEN){let t=e.material;if(0===t.opacity)return;let n={opacity:0,transparent:!0},s={opacity:t.opacity,transparent:t.transparent};t.transparent=n.transparent,t.opacity=n.opacity,new TWEEN.Tween(n).to(s,500).easing(TWEEN.Easing.Linear.None).onUpdate(()=>{t.opacity=n.opacity}).onComplete(()=>{t.transparent=s.transparent}).start()}})}),e("a1",(e,t)=>{let n=(new THREE.Box3).setFromObject(e),s=n.getSize(new THREE.Vector3),r=Math.min(s.x,s.y,s.z),o=!0;return r>5&&(console.warn("GLB seems to be too big ("+r+")",t),o=!1),n.min.y<-.01&&(console.warn("GLB seems to be under the floor ("+n.min.y+"): ",t),o=!1),o}),e("d",e=>{"Mesh"===e.type?D(e):A(e)}),e=>{e&&e.children&&0!==e.children.length&&e.children.forEach(e=>{D(e)})}),D=e("a4",e=>{e&&(e.material&&F(e.material),e.geometry&&H(e.geometry),e.children&&e.children.length>0&&A(e))}),H=e=>{e&&e.dispose()},F=e=>{e&&(e.map&&e.map.dispose(),e.normalMap&&e.normalMap.dispose(),e.dispose())};let O;e("W",()=>(O||(O=new THREE.MeshBasicMaterial,O.visible=!1),O)),e("$",(e,t)=>{let n=t.x/2,s=t.z/2,r=new THREE.Vector3(-n,.01,s),o=[r,new THREE.Vector3(r.x,r.y,r.z+.2),new THREE.Vector3(r.x-.2,r.y,r.z+.2),new THREE.Vector3(r.x-.2,r.y,r.z)],i=[new THREE.Face3(3,2,0),new THREE.Face3(2,1,0)],a=new THREE.Geometry;return a.vertices.push(...o),a.faces.push(...i),a.computeFaceNormals(),a.computeVertexNormals(),a}),e("a3",e=>0===e.x&&0===e.y&&0===e.z),e("V",(e,t)=>{let n="";return e.materialId&&""!==e.materialId?n=e.materialId:e.catalogItemId&&""!==e.catalogItemId?n=e.catalogItemId:e.rgbValue>0?n="rbg"+JSON.stringify(e.rgbValue):e.length>0?n=e:t&&1===t.value?n="default_wall_material_"+e.getSourceType().value:t&&7===t.value&&(n="default_ceiling_material_"+e.getSourceType().value),n}),e("z",(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),e("a",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});const U=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 B(e,t){const n=Symbol("property-cache");Object.defineProperty(e,t,{get(){if(!this[n]){const e=window.__RML__DI__.lookup(U(t),this._creator_);e?this[n]=e:console.error("Dependency "+U(t)+" not found! Add dependency to /utils/injectables.ts")}return this[n]}})}let j=e("af",(()=>{class e{constructor(e){this._hdrCubeUrl="static/roomle-91862a5e7f3f46e5.envmap",this._hdrCubeUrlLowres="static/roomle64-adb0f447a54b5143.envmap",this._envMapReader=new w,this._creator_=e;const t=new THREE.Color(M);this._environmentMap=((e,t,n,s)=>{const r=new THREE.CubeTexture;r.format=THREE.RGBAFormat,r.generateMipmaps=!1;for(let o=0;o<6;++o){const i=R(e,t,n,s);i.format=r.format,i.type=r.type,i.minFilter=r.minFilter,i.magFilter=r.magFilter,i.generateMipmaps=r.generateMipmaps,i.needsUpdate=!0,r.images[o]=i}return r.needsUpdate=!0,r})(t.r,t.g,t.b,v),this._envMapReader.setPath(s()),this._loadHDREnvMap(this._hdrCubeUrlLowres)}static setEnvironmentMap(e,t){e&&t&&(e.envMap=t,e.envMapIntensity=1,e.needsUpdate=!0)}getEnvironmentMap(){return this._environmentMap}_processPMREM(e){const t=new THREE.PMREMGenerator(this._renderer);let n=t.fromCubemap(e);return e.magFilter=THREE.LinearFilter,e.needsUpdate=!0,t.dispose(),n.texture}_loadHDREnvMap(e){return this._initData.disableEnvMap?Promise.resolve():new Promise(t=>{this._envMapReader.load(e).then(n=>{n.encoding=THREE.sRGBEncoding;const s=this._renderer.extensions.get("EXT_shader_texture_lod");this._environmentMap=s?this._processPMREM(n):n,e!==this._hdrCubeUrl&&(this._environmentMap.encoding=THREE.sRGBEncoding,window.requestIdleCallback(this._loadHDREnvMap.bind(this,this._hdrCubeUrl))),this._updateEnvironmentMap(),t(),this._envChangedCallback&&this._envChangedCallback()})})}setRendererAndScene(e,t){this._renderer=e,this._scene=t}registerEnvironmentChangedCallback(e){this._envChangedCallback=e}_updateEnvironmentMap(){this._initData.disableEnvMap||this._scene.traverse(t=>{t instanceof THREE.Mesh&&(t.material instanceof THREE.MeshStandardMaterial||"MeshPhysicalMaterial"===t.material.type)&&e.setEnvironmentMap(t.material,this._environmentMap)})}setEnvMap(t){this._initData.disableEnvMap||e.setEnvironmentMap(t,this.getEnvironmentMap())}}return y([B],e.prototype,"_initData",void 0),e})());const G=e("P",{SOFA:"sofa",SHELF:"shelf",SHELF_FRONT:"shelf_front",BAKED:"baked",CAMERA:"camera",EQUAL:"equal"});class V{static createDynamicLightSettingSource(e,t){let n={};if(e)n.url=e;else if(t)switch(t){case G.SHELF:n.url=s()+"static/shelf-2975dd3f2fa9c763.json";break;case G.SHELF_FRONT:n.url=s()+"static/shelf_front-8c9566a4512f0de8.json";break;case G.SOFA:n.url=s()+"static/sofa-997b116bc5f2e92e.json";break;case G.BAKED:n.url=s()+"static/baked-6485a2b1daeb69e8.json";break;case G.CAMERA:n.url=s()+"static/camera-f4cef679615485dc.json";break;case G.EQUAL:n.url=s()+"static/equal-319f6b83c827913f.json";break;default:n.url=s()+"static/camera-f4cef679615485dc.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:s,target:r,width:o,height:i}=e;return t.width=o||.8,t.height=i||.8,t.castShadow=s||!1,t.matrixAutoUpdate=!0,t.intensity=(n||240)/((o||.8)*(i||.8)),t.lookAt(r?new THREE.Vector3(r.x,r.y,r.z):new THREE.Vector3(0,0,0)),t}_parseSpotLight(e){let t=new THREE.SpotLight;this._parseCommon(t,e);let{angle:n,penumbra:s,target:r,castShadow:o}=e;return t.angle=(n||100)*Math.PI/180,t.penumbra=s||.5,t.lookAt(r?new THREE.Vector3(r.x,r.y,r.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:s}=e;return t.castShadow=s||!1,t.shadow.camera.near=.1,t.shadow.camera.far=100,t.shadow.mapSize=new THREE.Vector2(1024,1024),t.shadow.bias=-5e-5,t.lookAt(n?new THREE.Vector3(n.x,n.y,n.z):new THREE.Vector3(0,0,0)),t}_parseCommon(e,t){let{name:n,intensity:s,color:r,position:o,movesWithCamera:i}=t;e.name=n||"",e.intensity=s||1,e.color=new THREE.Color(r||"#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=i}}e("D",V);const N=["127.0.0.1","localhost","0.0.0.0"],z=(e("m",(function(e){return!(!e||"string"!=typeof e||e.split(":").length>2)})),e("l",e=>{if(!e||"string"!=typeof e)return null;const t=e.split(":");return t.length<2?null:t[0]})),W=({articleNr:e,componentId:t})=>e&&""!==e?t.split(":")[0]+":"+e:null,K=(e,t)=>null!=e?"string"==typeof e?"true"===e:!0===e:("string"==typeof t&&(t=parseInt(t,10)),t>=200&&t<300);class q{constructor(){this._queue=[],this._pendingRequests=0}_nextSlot(){if(this._pendingRequests-=1,!this._queue.length)return;const{request:e,resolve:t,reject:n}=this._queue.shift();this._fetch(e).then(t,n)}_fetch(e,t={}){return this._pendingRequests+=1,new Promise((n,s)=>{self.fetch(e,t).then(function(e){if(this._nextSlot(),K(e.ok,e.status))n(...arguments);else{const t=(null==e?void 0:e.url)||"URL unknown";s(new Error(e.statusText||'Http error "'+(e&&e.status?e.status:"unknown")+'", for "'+t+'"'))}}.bind(this),e=>{this._nextSlot(),s(e)})})}fetch(e,t={}){return this._pendingRequests>=40?new Promise((t,n)=>this._queue.push({request:e,resolve:t,reject:n})):this._fetch(e,t)}}class J{info(...e){console}log(...e){console}warn(...e){console.warn.apply(console,e)}error(...e){console.warn.apply(console,e)}}e("L",J);let Q=(()=>{class e extends J{constructor(e){super(),this._creator_=e}setMeta(e){this._meta=e}get meta(){return this._meta?this._meta:{}}throw(e){const t="[Kernel Exception]: "+e;this._globalCallback.onKernelMsg("exception",e,this.meta),this.error(t)}error(e){this._globalCallback.onKernelMsg("error",e,this.meta),super.error(e)}warn(e){this._globalCallback.onKernelMsg("warning",e,this.meta),super.warn(e)}}return y([B],e.prototype,"_globalCallback",void 0),e})();const Z=new Map,$=new Map,X=new Map,Y=new Map;let ee=e("h",(()=>{class e{constructor(e){this._bootCallbacks=[],this._isStarted=!1,this._isStarting=!1,this._alwaysUseCache=!1,this._creator_=e}start(e){return this._configuratorUiCallbacks.onSyncStarted(),this._startWorker().then(()=>this._handleCatalog(e)).then(()=>{const{typeChangeTag:e,floorMaterialsTag:t}=this._initData;Promise.all([this._syncFloorTag(t),this._syncTypeChangeTag(e)]).then(()=>{Y.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&&!X.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(()=>{X.set(e,!0),n()},e=>this._softReject(n,'_syncFloorTag error: "'+e+'"'))})):Promise.resolve()}_syncTypeChangeTag(e){const t=[];return e&&!Y.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(()=>{X.set(e,!0),n()},e=>this._softReject(n,'_syncTypeChangeTag error: "'+e+'"'))})):Promise.resolve()}getIsCatalogSynced(e){return!!$.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(s()+"static/asset-loader.worker-796c70f59b977071.js"),this._mainThreadToWorker=new r(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(()=>{$.set(e,!0),t()},e=>this._softReject(t,'Catalog sync error: "'+e+'"')))}_handleTags(e){return this._handleContentWithAssets(this._rapiAccess.getTags(e),["pngIcon","svgIcon"])}_handleExternalMeshes(e){return new Promise(t=>{this._rapiAccess.getMeshesOfCatalog(e.id).then(e=>{const n=[];e.forEach(e=>{n.push(this._handleContentWithAssets(Promise.all([this._rapiAccess.getMesh(e.id)]),["url"]))}),Promise.all(n).then(t,e=>this._softReject(t,'Sync crt files error: "'+e+'"'))},e=>this._softReject(t,'getMeshesOfCatalog error: "'+e+'"'))})}_handleItemsAndAdditionalContents(e){return new Promise(t=>{this._rapiAccess.getItemsOf(e).then(e=>{const n=[];n.push(this._handleContentWithAssets(Promise.resolve(e),["perspectiveImage"])),this._rapiAccess.getAdditionalContentsOfItems(e).then(e=>{const t=e.filter(e=>-1!==[5,6,4].indexOf(e.type));n.push(this._handleContentWithAssets(Promise.resolve(t),["content"]))},e=>this._softReject(t,'getAdditionalContentsOfItems error: "'+e+'"')),Promise.all(n).then(t,e=>this._softReject(t,'AdditionalContent image sync error:"'+e+'"'))})})}_handleMaterialsAndTextures(e){return new Promise(t=>{this._rapiAccess.getMaterialsOf(e).then(e=>{const n=[];n.push(this._handleContentWithAssets(Promise.resolve(e),["thumbnail"])),e.forEach(e=>{n.push(this._handleContentWithAssets(this._rapiAccess.getTexturesOf(e),["image"]))}),Promise.all(n).then(t,e=>this._softReject(t,'getTexturesOf error: "'+e+'"'))},e=>this._softReject(t,'getMaterialsOf error: "'+e+'"'))})}_handleContentWithAssets(e,t){return new Promise(n=>e.then(e=>this._fetchAssets(e,t).then(n,e=>this._softReject(n,'_handleContentWithAssets error: "'+e+'"')),e=>this._softReject(n,'_handleContentWithAssets promise error: "'+e+'"')))}_fetchAssets(e,t){const n=[];e||(e=[]);for(let s=0,r=e.length;s<r;s++){const r=e[s];t.forEach(e=>{const t=r[e];t&&n.push(this._preCacheAsset(t))})}return Promise.all(n)}_preCacheAsset(e){return new Promise(t=>{if(Z.get(e))return t();this._assetUrlToBase64(e).then(n=>{Z.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:Z.get(e)||(t?e:null)}setAlwaysUseCache(e){this._alwaysUseCache=e}preFillAssetCache(e,t){Z.set(e,t)}}return y([B],e.prototype,"_rapiAccess",void 0),y([B],e.prototype,"_singlePromiseFactory",void 0),y([B],e.prototype,"_errorHandler",void 0),y([B],e.prototype,"_configuratorUiCallbacks",void 0),y([B],e.prototype,"_initData",void 0),e})());class te{constructor(e){this.info=e,this._init()}_init(){this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}resolve(e){e&&this._resolve(e),this._resolve()}reject(e){this._reject(e)}wait(){return this._promise}reset(){this._init()}}e("y",te);var ne=e("aa","static/GLTFLoader-5b296b5fb14cfe1a.js"),se=e("ab","static/DRACOLoader-5edeeab4a8dbc0bd.js");const re={"draco_wasm_wrapper.js":"static/draco_wasm_wrapper-d775f9f135cb30ff.js","draco_decoder.wasm":"static/draco_decoder-979e668167e37c95.wasm","draco_decoder.js":"static/draco_decoder-3866672a1fa2f980.js"};let oe=(()=>{class e{constructor(e){if(this._gltfLoaderGuard=new te,this._creator_=e,THREE.GLTFLoader&&THREE.DRACOLoader)this._initLoaders();else{let e=this._scriptLoader.fetch(ne,{id:"gltf-loader"}),t=this._scriptLoader.fetch(se,{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 r=re[e];if(!r)throw new Error('Can not load draco dependency "'+e+'" did three.js update DracoLoader lib? Available files'+JSON.stringify(re));return t(s()+r,n)},this._gltfLoader.setDRACOLoader(e),this._gltfLoaderGuard.resolve(this._gltfLoader)}async loadGLB(e,t,n,s,r,o,i,a){return await this._gltfLoaderGuard.wait(),new Promise((l,c)=>{this._gltfLoader.load(e,e=>{l(this._handleGLTFScene("GLB",e,t,n,s,r,o,i))},e=>{a&&a(e.loaded/e.total)},e=>{c(e)})})}async loadGLTF(e,t,n,s,r,o,i,a){return await this._gltfLoaderGuard.wait(),new Promise((l,c)=>{this._gltfLoader.parse(e,null,e=>{l(this._handleGLTFScene("GLTF",e,t,n,s,r,o,i))},e=>{a&&a(e.loaded/e.total)},e=>{c(e)})})}_handleGLTFScene(e,t,n,s,r,o,i,a){if(!t||!t.scene||!t.scene.children||0===t.scene.children.length)return null;if(n&&t.scene.position.copy(n),s&&(t.scene.rotation.y=s),r){const e=new THREE.Box3;e.setFromObject(t.scene);const{x:n,y:s,z:o}=e.getSize(new THREE.Vector3);let i=new THREE.Vector3(r.x/n,r.y/s,r.z/o);t.scene.scale.copy(i)}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&&i&&i>0){let e=new THREE.Color(i);t.color=e.copyGammaToLinear(e),t.roughness=.5,t.metalness=.1}t.needsUpdate=!0}e.castShadow=!0,e.receiveShadow=!0}}),t.scene}}return y([B],e.prototype,"_environmentLoader",void 0),y([B],e.prototype,"_scriptLoader",void 0),e})(),ie=(()=>{class e{constructor(e){this._jsonLoaded=!1,this._creator_=e}_loadShaders(){return new Promise((e,t)=>{if(this._jsonLoaded)return e();this._networkLayer.fetch(s()+"static/shaders-783e0f3c8bfe6cc2.json",{credentials:"same-origin"}).then(o,t).then(t=>{window._rsl=t,this._jsonLoaded=!0,e()},t)})}fetch(){return window._rsl||(window._rsl={}),new Promise((e,t)=>this._loadShaders().then(()=>{this._scriptLoader.fetch("static/rthree-508a6ceb9a1516ce.js",{id:"three-lib"}).then(e,t)},t))}}return y([B],e.prototype,"_scriptLoader",void 0),y([B],e.prototype,"_networkLayer",void 0),e})(),ae=(()=>{class e{constructor(e){this._context_=e}getStore(e="rml_default"){return this._localStorage.getItem(e)||{entries:[]}}saveStore(e,t){this._localStorage.setItem(e,t)}addItem(e,t,n="rml_default",s=5){const r=this.getStore(n),o=r.entries.find(t=>t.id===e);if(o?(o.payload=t,o.date=Date.now()):r.entries.push({id:e,date:Date.now(),payload:t}),r.entries.length>s)for(r.entries.sort((e,t)=>t.date-e.date);r.entries.length>s;)r.entries.pop();this.saveStore(n,r)}getItem(e,t="rml_default"){const n=this.getStore(t).entries.find(t=>t.id===e);return n?n.payload:null}}return y([B],e.prototype,"_localStorage",void 0),e})();class le{set(e,t){t&&(void 0!==t.enableAA&&(e.enableAA=t.enableAA),this._setSAOPass(e,t),this._setShadowPass(e,t),this._setGroundShadow(e,t))}_setSAOPass(e,t){if(t.SAOPass){const n=t.SAOPass;void 0!==n.enabled&&(e.getSAOPass().enabled=n.enabled),void 0!==n.smoothTransition&&(e.getSAOPass().smoothTransition=n.smoothTransition),n.occlusionWorldRadius&&(e.getSAOPass().occlusionWorldRadius=n.occlusionWorldRadius),n.intensity&&(e.getSAOPass().intensity=n.intensity),n.bias&&(e.getSAOPass().bias=n.bias),n.numSamples&&(e.getSAOPass().numSamples=n.numSamples)}}_setShadowPass(e,t){if(t.shadowPass){const n=t.shadowPass;void 0!==n.enabled&&(e.getShadowPass().enabled=n.enabled),void 0!==n.smoothTransition&&(e.getShadowPass().smoothTransition=n.smoothTransition),void 0!==n.enableAccumulation&&(e.getShadowPass().enableAccumulation=n.enableAccumulation),n.shadowRadius&&(e.getShadowPass().shadowRadius=n.shadowRadius),n.shadowBiasMultiplier&&(e.getShadowPass().shadowBiasMultiplier=n.shadowBiasMultiplier),n.numSamples&&(e.getShadowPass().numSamples=n.numSamples)}}_setGroundShadow(e,t){if(t.groundShadow){const n=t.groundShadow;void 0!==n.enable&&(e.getShadowPlanePass().enable=n.enable),void 0!==n.smoothTransition&&(e.getShadowPlanePass().smoothTransition=n.smoothTransition),n.numSamples&&(e.getShadowPlanePass().numSamples=n.numSamples),n.numSamplesPerFrame&&(e.getShadowPlanePass().numSamplesPerFrame=n.numSamplesPerFrame)}}}e("N",le);const ce=e("T",e=>new THREE.Vector3(e.x/1e3,e.z/1e3,e.y/-1e3)),he=(e("a0",e=>new THREE.Vector3(e.x/1e3,e.z/1e3,e.y/1e3)),e("a7",e=>({x:1e3*e.x,y:-1e3*e.z,z:1e3*e.y}))),de=e=>decodeURIComponent(encodeURIComponent(e)),ue=e("q",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=pe(e);for(let e=0;e<t.length;e++)t[e]=ue(t[e]);return"string"==typeof t?de(t):t}if("object"==typeof e)for(let t in e)e.hasOwnProperty(t)&&(e[t]=ue(e[t]));return"string"==typeof e?de(e):e}),pe=e=>{let t=[];if(e){let n=e.size();for(let s=0;s<n;s++)t.push(e.get(s))}return t},ge=e=>{let t=new THREE.Matrix4,n=ue(e);return t.fromArray(n),t.transpose(),(e=>{let t=new THREE.Matrix4;t.set(1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1),t.scale(new THREE.Vector3(.001,.001,.001));let n=new THREE.Matrix4;return n.set(1,0,0,0,0,0,-1,0,0,1,0,0,0,0,0,1),n.scale(new THREE.Vector3(1e3,1e3,1e3)),t.multiply(e).multiply(n)})(t)};function me(){class e extends THREE.Object3D{constructor(e,t,n,s){super(),this._selected=!1,this.geometryChanged=!0,this.meshes=[],this.castShadow=!1,this.receiveShadow=!0,this._setValues(e,t,n,s)}static _generateOutline(e,t){let n=new THREE.LineSegments(new THREE.EdgesGeometry(e),new THREE.LineDashedMaterial({color:"#000000",dashSize:.03,gapSize:.01,linewidth:1}));return n.translateOnAxis(t,1),n.userData.ignoreComponentRaycast=!0,n}static cloneDockLine(e,t){let n=new THREE.LineSegments(e.geometry,e.material);return n.translateOnAxis(t.getCenter(new THREE.Vector3),1),n.name="dockline",n.layers.set(5),n.userData.ignoreComponentRaycast=!0,n}_setValues(e,t,n,s){e&&(this.runtimeId=e,this.name=e.toString()),t&&(this.roomlePosition=Object.assign({},t)),n&&(this.roomleRotation=Object.assign({},n)),s&&(this.parentObjectId=s)}get loadingMesh(){return this._loadingMesh}get boundingBoxMesh(){return this._boundingBoxMesh}get boundingBox(){return this._boundingBox}set roomlePosition(e){this._roomlePosition=e,e&&this.position.set(e.x/1e3,e.z/1e3,e.y/-1e3)}get roomlePosition(){return this._roomlePosition}set roomleRotation(e){this._roomleRotation=e,e&&this.rotation.set(e.x,e.z,-e.y)}get roomleRotation(){return this._roomleRotation}replaceMeshes(e){this.removeAllMeshes(),e.forEach(e=>{this.addMesh(new THREE.Mesh(e.geometry,e.material))})}addMesh(e,t){e.renderOrder=2,e.userData.meshType=0,t&&e.applyMatrix4(ge(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),D(e),t<0||this.meshes.splice(t,1)}removeAllMeshes(e=!0){this.meshes.forEach(t=>{this.remove(t),e&&D(t)}),this.meshes=[],this._removeLoadingMesh(),this.remove(this._boundingBoxMesh),D(this._boundingBoxMesh),this._boundingBoxMesh=null}_hideAllMeshes(){this.meshes.forEach(e=>e.visible=!1)}_showAllMeshes(){this.meshes.forEach(e=>e.visible=!0)}select(){this._selected=!0}loading(){if(!this._kernelBoundingBox)return void console.warn("Bounding box (box for measurements) for component "+this.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 s=new THREE.BoxGeometry(e,t,n);this._loadingMesh=new THREE.Mesh(s,new THREE.MeshStandardMaterial({transparent:!0,opacity:v,color:new THREE.Color(M)})),this._loadingMesh.name="loading mesh",this._loadingMesh.receiveShadow=!1,this._loadingMesh.castShadow=!1,this._loadingMesh.layers.set(5),this._loadingMesh.translateOnAxis(this._kernelBoundingBox.getCenter(new THREE.Vector3),1),this._loadingMesh.renderOrder=3,this.add(this._loadingMesh)}_removeLoadingMesh(){this._loadingMesh&&(this.remove(this._loadingMesh),D(this._loadingMesh),this._loadingMesh=null)}loadingFinished(){this._removeLoadingMesh(),this._showAllMeshes()}deselect(){this._selected=!1}hoverOn(){i("pointer")}hoverOff(){i("default")}removeFromParent(){this.parent&&(this.parent.remove(this),this.removeAllMeshes())}computeBoundingBox(t,n=!1){if(this._boundingBoxMesh&&this.remove(this._boundingBoxMesh),!n&&t&&0===t.size.x&&0===t.size.y&&0===t.size.z)return;let s;if(!t||n){this._boundingBox=new THREE.Box3;let e=new THREE.Vector3;this.meshes.forEach(t=>{if(t.geometry instanceof THREE.Geometry){let n=t.geometry.vertices;for(let s=0,r=n.length;s<r;s++)e.copy(n[s]),e.applyMatrix4(t.matrix),this._boundingBox.expandByPoint(e)}else if(t.geometry instanceof THREE.BufferGeometry){let n=t.geometry.attributes.position;if(void 0!==n)for(let s=0,r=n.count;s<r;s++)e.fromBufferAttribute(n,s).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,r=this._boundingBox.max.z-this._boundingBox.min.z;s=new THREE.BoxGeometry(t,n,r)}else{this._kernelBoundingBox=C(t),this._boundingBox=this._kernelBoundingBox.clone();let{x:e,y:n,z:r}=this._boundingBox.getSize(new THREE.Vector3);s=new THREE.BoxGeometry(e,n,r)}this._boundingBoxMesh=new THREE.Mesh(s,new THREE.MeshStandardMaterial({color:"#FFFFFF",transparent:!0,opacity:0,polygonOffset:!0,polygonOffsetFactor:-1,visible:!1})),this._boundingBoxMesh.name="bounding box mesh";let r=this._boundingBox.getCenter(new THREE.Vector3);this._boundingBoxMesh.position.add(r),this._boundingBoxMesh.layers.set(5),this._boundingBoxMesh.renderOrder=3,this._boundingBoxMesh.castShadow=!1,this._boundingBoxMesh.receiveShadow=!1,this.add(this._boundingBoxMesh),this._dockline=e._generateOutline(s,r),this._dockline.name="bounding box outline",this._dockline.layers.set(5),this._selected&&this.add(this._dockline)}recursiveMeshes(){let t=this.meshes.slice();return this.children.forEach(n=>{n instanceof e&&t.push(...n.recursiveMeshes())}),t}isChild(t){let n=!1;return this.children.forEach(s=>{s instanceof e&&!n&&(n=s.runtimeId===t||s.isChild(t))}),n}getKernelPosition(e){let t=this.parent.localToWorld(this.position);return he(e.worldToLocal(t))}}class t extends e{constructor(e,t){super(e,null,null,null),this.glbUrl=t}}class n extends e{constructor(e,t,n,s){super(e,t,n,s),this._stringId=null,this.receivedPointAssociation=!1,this.castShadow=!1,this.receiveShadow=!1}get stringId(){return this._stringId?this._stringId:this.runtimeId.toString()}addMesh(e,t){super.addMesh(e,t),e.material instanceof THREE.MeshStandardMaterial&&(e.material.opacity=.6,e.material.roughness=1,e.material.metalness=0,e.material.color=new THREE.Color("#DDDDDD")),e.renderOrder=1,e.castShadow=!1,e.receiveShadow=!1}hoverOn(){this.remove(this._dockline),this.meshes.forEach(({material:e})=>{e.opacity=.9,e.roughness=1,e.metalness=0,e.color=new THREE.Color("#DDDDDD")}),i("pointer")}hoverOff(){this.add(this._dockline),this.meshes.forEach(({material:e})=>{e.opacity=.6,e.roughness=1,e.metalness=0,e.color=new THREE.Color("#DDDDDD")}),i("default")}clonePreview(t){const s=new n(this.runtimeId,this.roomlePosition,this.roomleRotation,this.parentObjectId);return s._stringId=this.runtimeId+"_"+t,this.children.forEach(e=>{e instanceof THREE.Mesh&&0===e.userData.meshType&&s.meshes.push(e.clone(!0))}),s.meshes.forEach(e=>{e.material=e.material.clone(),e.geometry=e.geometry.clone(),s.add(e)}),this._dockline&&(s._dockline=e.cloneDockLine(this._dockline,this._boundingBox)),this._boundingBoxMesh&&(s._boundingBoxMesh=this._boundingBoxMesh.clone(!0)),this._boundingBox&&(s._boundingBox=this._boundingBox.clone()),s}preparePreview(){this.add(this._dockline),this.add(this._boundingBoxMesh)}}class s extends n{constructor(e,t,n,s,r){super(e,t,n,s),r&&(this._stringId=this.runtimeId+"_has_additional_dock_point_copy")}set roomleLineFrom(e){this._roomleLineFrom=e,this.lineFrom=ce(e)}get roomleLineFrom(){return this._roomleLineFrom}set roomleLineTo(e){this._roomleLineTo=e;let t=ce(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=ce(e)}get roomlePositionFrom(){return this._roomlePositionFrom}set roomlePositionTo(e){this._roomlePositionTo=e;let t=ce(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,i("pointer")}hoverOff(){this._dockline.visible=!1,i("default")}preparePreview(){super.preparePreview(),this._dockline.visible=!1;let e=this.lineTo.clone(),t=this.lineFrom.clone();const n=(new THREE.Vector3).subVectors(e,t);let s=n.length(),r=n.normalize(),o=new THREE.ArrowHelper(r,t),i=new THREE.CylinderGeometry(.01,.01,s,16,1);this.lineMesh=new THREE.Mesh(i,new THREE.MeshStandardMaterial({color:M,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,u=Math.abs(r.x),p=Math.abs(r.y),g=Math.abs(r.z);u>=p&&u>=g?(h=new THREE.Vector3(c.x,0,0),d=Math.sqrt(c.y*c.y+c.z*c.z)):p>=u&&p>=g?(h=new THREE.Vector3(0,c.y,0),d=Math.sqrt(c.x*c.x+c.z*c.z)):g>=p&&g>=u&&(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 m=(new THREE.Vector3).subVectors(this.positionTo.clone(),this.positionFrom.clone()).length()+h.length(),_=new THREE.CylinderGeometry(1.1*d,1.1*d,m,32,1);this.boundingLineMesh=new THREE.Mesh(_,new THREE.MeshStandardMaterial({color:"#ffffff",transparent:!0,opacity:0})),this.boundingLineMesh.name="bounding line mesh",this.boundingLineMesh.userData.ignoreComponentRaycast=!0;let f=this.positionTo.clone(),y=this.positionFrom.clone(),w=(new THREE.Vector3).subVectors(f,y).normalize(),E=new THREE.ArrowHelper(w,y);const b=(new THREE.Quaternion).setFromEuler(E.rotation);this.boundingLineMesh.quaternion.multiply(b),this.boundingLineMesh.renderOrder=3;let v=(new THREE.Vector3).addVectors(this.positionTo.clone(),this.positionFrom.clone()).multiplyScalar(.5).add(c);this.boundingLineMesh.position.copy((new THREE.Vector3).subVectors(v,this.position.clone())),this.add(this.boundingLineMesh)}clonePreviewLine(t){let n=new s(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),s=this.positionFrom.clone().add(t),r=new THREE.Line3(s,n).closestPointToPoint(e,!0,new THREE.Vector3);return(isNaN(r.x)||isNaN(r.y)||isNaN(r.z))&&r.copy(e),r.sub(t)}updatePreviewPosition(e){let t=this.getPositionForIntersectionPoint(e),n=this.parent.localToWorld(t);this._newPosition=this.worldToLocal(n);let s=this._boundingBox.getCenter(new THREE.Vector3).applyEuler(this.docklineRotation);this._dockline.position.copy((new THREE.Vector3).addVectors(this._newPosition,s)),this._dockline.rotation.copy(this.docklineRotation)}hideSelectionLine(){this._dockline.visible=!1}getKernelPosition(e){if(this._newPosition){let t=this.localToWorld(this._newPosition);return he(e.worldToLocal(t))}return super.getKernelPosition(e)}}class r extends THREE.PerspectiveCamera{constructor(e,t,n,s,r){super(e,t,n,s),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}_calculateProjectionMatrix(){let e,t,n,s,r=this.fov*(2*Math.PI/360)/2;n=Math.tan(r),s=-n;let o=Math.atan(this.aspect*Math.tan(r));t=Math.tan(o),e=-t;let i=this._offset.left,a=this._offset.right,l=this._offset.top,c=this._offset.bottom,h=new THREE.Vector2(a-i,l-c),d=new THREE.Vector2(i+h.x/2,c+h.y/2);if(h.x<h.y){let r=(1-d.x)/(h.x/2),o=d.x/(h.x/2);t*=r,e*=o;let i=(r+o)/2;n*=i,s*=i}else{let r=(1-d.y)/(h.y/2),o=d.y/(h.y/2);n*=r,s*=o;let i=(o+r)/2;e*=i,t*=i}e*=this.near,t*=this.near,n*=this.near,s*=this.near;let u=this.near*Math.tan(Math.PI/180*.5*this.fov)/this.zoom*2,p=this.aspect*u;return this.view&&this.view.enabled&&(e+=this.view.offsetX*p/this.view.fullWidth,n-=this.view.offsetY*u/this.view.fullHeight,t+=this.view.offsetX*p/this.view.fullWidth,s-=this.view.offsetY*u/this.view.fullHeight),(new THREE.Matrix4).makePerspective(e,t,n,s,this.near,this.far)}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){this._offset?(this.projectionMatrix=this._calculateProjectionMatrix(),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()):super.updateProjectionMatrix()}}return{create:function(t,n,s,r){return new e(t,n,s,r)},createPreview:function(e,t){return new n(e,{x:0,y:0,z:0},{x:0,y:0,z:0},t)},createStatic:function(e,n){return new t(e,n)},createPreviewLine:function(e){let t=new s(e.id,e.roomlePosition,e.roomleRotation,e.parentObjectId,e.receivedPointAssociation);return e.meshes.forEach(e=>{let n=e.clone();n.material=e.material.clone(),n.geometry=e.geometry.clone(),t.addMesh(n)}),t.computeBoundingBox(),t},isPreview:function(e){return e instanceof n},isPreviewLine:function(e){return e instanceof s},createCamera:function(e,t,n,s,o){return new r(e,t,n,s,o)}}}const _e=new Map,fe=function(e,t,n){let s=_e.get(e);if(s){const r=n?[n]:void 0;s.forEach(({resolve:e,reject:n})=>t?e.apply(e,r):n.apply(n,r)),_e.delete(e)}};class ye{static finishOperation(e,t){fe(e,!0,t)}static failOperation(e,t){fe(e,!1,t)}static waitFor(e,t){return new Promise((n,s)=>{let r=_e.get(e);r||(_e.set(e,[]),r=_e.get(e)),r.push({resolve:n,reject:s}),"function"==typeof t&&t.apply(t)})}}e("n",ye);const we=new Map;class Ee{static start(e){if(!window.performance||!window.performance.getEntriesByName)return"";let t=window.performance.getEntriesByName(e).length++,n="";t<100&&(n="0"),t<10&&(n="0"+n);const s=t>0?e+"_"+n+t:e,r=s+"_start";return window.performance.mark(r),s}static addMeta(e,t){const n=Ee.getMeta(e);we.set(e,Object.assign(n,t))}static getMeta(e){return we.get(e)||{}}static end(e){}static getMeasure(e){return[]}static showBenchmarks(e){const t=window.performance.getEntriesByType("measure");t.sort((function(e,t){return e.startTime-t.startTime}));const n=[];for(let s=0,r=t.length;s<r;s++){const r=t[s];e&&-1===r.name.indexOf(e)||n.push({Start:parseFloat(r.startTime.toFixed(2)),Name:r.name,Duration:parseFloat(r.duration.toFixed(2))})}console.table(n)}}e("B",Ee);var be={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"}};void 0!==t&&t.exports||(window.IS_DEBUG=!0),function(e=!1){if(e){let e=JSON.parse(JSON.stringify(be));e.APP,e.features}}();const Me=JSON.parse(JSON.stringify(be));var ve=e("E",Me);const Ce=e("o",(function(e){return e.validRange&&"string"==typeof e.validRange.type})),Te=function(e){return e.validValues&&e.validValues.length>0},Pe=function(e){return"length"===e.unitType||"area"===e.unitType},Re=e("p",(function(e){return"Material"===e.type}));let Ie,Se,ke,xe,Le;const Ae={WASM:{CONFIGURATOR:{URL:"static/ConfiguratorKernel-3c16a462912d4363.wasm",LOADER:"static/ConfiguratorKernel-805ef8c9e2946584.js"},PLANNER:{URL:"static/RoomleCore-eefc95fcacfbbdb7.wasm",LOADER:"static/RoomleCore-41a17c2814f0726e.js"}},ASM:{CONFIGURATOR:{MEM_URL:"static/ConfiguratorKernelJs-a7b190fe9a79da9f.mem",LOADER:"static/ConfiguratorKernelJs-46632e2744e151e6.js"},PLANNER:{MEM_URL:"static/RoomleCoreJs-f7d9879c184a770d.mem",LOADER:"static/RoomleCoreJs-5e547e7bf5b9b475.js"}}},De=!!window.WebAssembly;e("O",(()=>{class e{constructor(e,t){this._requestedMaterialIds=[],this._configuratorKernelCallbackListener=new Set,this._cachedGroupIds=[],this._waitingForGroups=!1,this._subComponentsWaiters=new Map,this._shouldWait=!0,this._creator_=e,this._setupKernelPaths(t),this._setupEmsModule(t),this._useWASM=De,this._kernelPath=De?ke:xe,window.KernelCallback={isReady:this.isReady.bind(this)},this._lifeCycleManager.addEventListener(this)}_utilityToLongArray(e){const t=new this._kernelContainer.LongArray;return e.forEach(e=>t.push_back(e)),t}get kernelContainer(){return this._kernelContainer}get kernelInstance(){return this._kernelInstance}_setupKernelPaths(e){const t=0===e?"PLANNER":"CONFIGURATOR";Ie=Ae.ASM[t].MEM_URL,Se=Ae.WASM[t].URL,ke=Ae.WASM[t].LOADER,xe=Ae.ASM[t].LOADER,Le=!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)?s()+Ie:t},wasmBinaryFile:s()+Se,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")}},Le&&De&&(this._kernelContainer.instantiateWasm=function(e,t){return((e,t,n)=>{const r="function"==typeof WebAssembly.instantiateStreaming;Ee.addMeta("kernel_is_ready",{cachedInIndexedDB:!1});let o=null;r?(Ee.start("kernel_stream_compile"),o=WebAssembly.instantiateStreaming(fetch(s()+e),t),Ee.end("kernel_stream_compile")):(Ee.start("kernel_legacy_compile"),o=fetch(s()+e).then(e=>e.arrayBuffer()).then(e=>WebAssembly.instantiate(e,t))),Ee.addMeta("kernel_is_ready",{instantiateStreaming:r}),o.then(e=>{Ee.end(r?"kernel_stream_compile":"kernel_legacy_compile"),n(e.instance)},e=>console.error(e))})(Se,e,t),{}})}_passSubComponentsToKernel(e,t){const n=e.id,s=t.get(n);if(s)for(let t=0,r=s.length;t<r;t++){const{parentId:r,partId:o}=s[t];this._kernelIo.setMeta({componentId:n}),this._kernelInstance.loadedSubComponent(r,o,n,e.configuration)}}_fetchSubComponents(e){let t=[...e.keys()];t.length&&this._rapiAccess.getComponents(t).then(t=>{for(let n=0,s=t.length;n<s;n++)this._passSubComponentsToKernel(t[n],e);this._flushSubComponentsWaiters()})}_flushSubComponentsWaiters(){this._fetchSubComponents(this._subComponentsWaiters),this._subComponentsWaiters=new Map,this._shouldWait=!1}isReady(){this._kernelContainer.setExternalHelpers(this._kernelIo,{convertCObject:ue}),ve.isProduction||ve.isUnitTesting||this.addDebugInfo(),window.KernelCallback&&(window.KernelCallback=null,delete window.KernelCallback),this._unitFormatter.init(this._kernelContainer)}addDebugInfo(){const e=function(t,n=[]){const s=Object.getPrototypeOf(t),r=s?Object.getOwnPropertyNames(s):[],o=t?Object.getOwnPropertyNames(t):[];return s?e(s,[...n,...o,...r]):[...o,...r,...n]},t=e(this),n=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toString","valueOf"];[...new Set(t)].forEach(e=>{if(!e.startsWith("_")&&"function"==typeof this[e]&&-1===n.indexOf(e))try{const t=this[e].bind(this);this[e]=function(...n){return this._kernelIo.log("[ KernelCommunication ]: "+e),t(...n)}}catch(e){}})}getConfigurationData(e){return new Promise(t=>{var n;const s=this.kernelInstance.getPlanObject(e),r=(new Date).toISOString(),o=this.kernelInstance.getComponentId(e),i=z(o),a=(null===(n=s.boxForMeasurement)||void 0===n?void 0:n.size)||s.bounds;t({created:r,lastAccess:r,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:i,orderable:!1,requestable:!1})})}loadComponent(e,t,n){this._rapiAccess.getComponent(t.componentId).then(s=>{var r;let o=s.configuration;o||(o="error",null===(r=this._configuratorUiCallbacks)||void 0===r||r.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()},s=>{var r;this._kernelInstance.loadComponent(e,"error",t,n),this.onLoadComponentError(s,t.componentId),null===(r=this._configuratorUiCallbacks)||void 0===r||r.onError(new Error(`Component with id "${t.componentId}" can not be loaded. "${s}"`)),this._flushSubComponentsWaiters()})}loadSubComponent(e,t,n){if(this._shouldWait){let s=this._subComponentsWaiters.get(n);s||this._subComponentsWaiters.set(n,[]),s=this._subComponentsWaiters.get(n),s.push({parentId:e,partId:t}),this._subComponentsWaiters.set(n,s)}else this._rapiAccess.getComponent(n).then(s=>{var r;let o=s.configuration;o||(o="error",null===(r=this._configuratorUiCallbacks)||void 0===r||r.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,s,r){var o;this._kernelInstance.dockComponentWithPosition(n,s,e,t,r);const i=this._kernelInstance.getComponentId(n),a=this._kernelInstance.getComponentId(e);null===(o=this._configuratorUiCallbacks)||void 0===o||o.onUserInitiatedDockDone(i,s,a,t,r)}Editor3dAddBakedMesh(e,t,n,s,r,o,i){this._configuratorKernelCallbackListener.forEach(a=>a.Editor3dAddBakedMesh(e,t,n,s,r,o,i))}Editor3dAddNamedMesh(e,t,n,s,r,o,i,a,l,c){this._configuratorKernelCallbackListener.forEach(h=>h.Editor3dAddNamedMesh(e,t,n,s,r,o,i,a,l,c))}Editor3ChangedNamedMesh(e,t,n,s,r){this._configuratorKernelCallbackListener.forEach(o=>o.Editor3ChangedNamedMesh(e,t,n,s,r))}Editor3dRemoveNamedMesh(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.Editor3dRemoveNamedMesh(e,t))}Editor3dBeginConstruction(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.Editor3dBeginConstruction(e,t))}Editor3dEndConstruction(e){this._configuratorKernelCallbackListener.forEach(t=>t.Editor3dEndConstruction(e))}Editor3dComponentCreated(e,t,n,s){this._configuratorKernelCallbackListener.forEach(r=>r.Editor3dComponentCreated(e,t,n,s,!1))}Editor3dComponentDocked(e,t,n,s){this._configuratorKernelCallbackListener.forEach(r=>r.Editor3dComponentDocked(e,t,n,s))}Editor3dGeometryReady(e){this._configuratorKernelCallbackListener.forEach(t=>t.Editor3dGeometryReady(e)),this.requestPlanComponentConstruction(e)}Editor3dGeometryNotReady(e){this._configuratorKernelCallbackListener.forEach(t=>t.Editor3dGeometryNotReady(e))}componentDeleted(e){this._configuratorKernelCallbackListener.forEach(t=>t.componentDeleted(e))}componentMetaUpdated(e){let t=this._kernelInstance.getComponent(e);this._configuratorKernelCallbackListener.forEach(e=>e.componentMetaUpdated(t))}sceneCleared(){this._configuratorKernelCallbackListener.forEach(e=>e.sceneCleared())}requestMaterialsInGroup(e){(Array.isArray(e)?e:[e]).forEach(e=>{-1===this._cachedGroupIds.indexOf(e)&&this._cachedGroupIds.push(e)}),this._waitingForGroups||(this._waitingForGroups=!0,ye.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 s=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:s,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 a(0),!this._requestedMaterialIds.length)return;const n=[...this._requestedMaterialIds];this._requestedMaterialIds=[];const s=await this._rapiAccess.getMaterials(n);let r=[];s.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()&&r.push({id:e.id,properties:t})}),r.length&&this._kernelInstance.setMaterialProperties(r)}registerCallbacks(){this._kernelContainer.registerConfiguratorCallback(this)}pause(){this.cleanUpCallbacks()}resume(){this.cleanUpCallbacks(),this.registerCallbacks()}destroy(){}_handleCortoMesh(e,t,n){var s;try{this._kernelInstance.addMeshCorto(t,n,new Uint8Array(e))}catch(e){console.error(e),null===(s=this._configuratorUiCallbacks)||void 0===s||s.onMemoryCorruption()}}_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 s=W(n);return s&&(e.set(s,n),t.push(s)),t},[]);return new Promise((s,r)=>{this._rapiAccess.getPrices(n).then(n=>{if(!n.length)return r(new Error("prices are empty"));const o=l(n,"priceId");let i=0;return t.fullList.forEach(e=>{const t=W(e);if(!o.has(t))return void console.warn("PriceId: "+t+" has no corresponding kernel-part");const{price:n,currencySymbol:s}=o.get(t);e.price=n,e.currencySymbol=s,i+=n*e.count}),this._configuratorUiCallbacks.onUpdatePrice(n[0].currencySymbol,i),s({totalSum:i,partMap:e})},e=>{console.error(e),r(e)})})}}return Promise.resolve({totalSum:0,partMap:e})}async addUiDataAndPriceToPartList(e,t){const{fullList:n,originPart:s}=e,r=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 i=this._initData.usePriceService||this._initData.useRoomlePrice,a=e=>{i||(e.price=null,e.currencySymbol=null);const t=W(e);if(!t)return;if(!o.has(t))return;const{price:n,currencySymbol:s}=o.get(t);"number"==typeof n&&(e.price=n,e.currencySymbol=s)};return n.forEach(a),r.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:r,originPart:s}}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),Re(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 s=await this.addUiDataAndPriceToPartList(n,e);this._configuratorUiCallbacks.onPartListUpdate(s,btoa(e))}}return y([B],e.prototype,"_rapiAccess",void 0),y([B],e.prototype,"_scriptLoader",void 0),y([B],e.prototype,"_kernelIo",void 0),y([B],e.prototype,"_dataSyncer",void 0),y([B],e.prototype,"_lifeCycleManager",void 0),y([B],e.prototype,"_configuratorUiCallbacks",void 0),y([B],e.prototype,"_globalCallback",void 0),y([B],e.prototype,"_initData",void 0),y([B],e.prototype,"_unitFormatter",void 0),y([B],e.prototype,"_configuratorContext",void 0),y([B],e.prototype,"_globalInitData",void 0),e})());const He=e("Q",10);e("j",9);let Fe=e("a2",(()=>{class e{constructor(e){this._mergeThreshold=3,this._componentsToMerge=new Oe,this._mergeInProgress=!1,this._components=new Map,this._previews=new Map,this._creator_=e,this._getKernelAccess().addConfiguratorListener(this),this._componentFactory=me()}get materialQueue(){return this.getMeshGenerator().materialQueue}_getKernelAccess(){return Qe.lookup("kernel-access",this._creator_)}clearReference(){this._getKernelAccess().removeConfiguratorListener(this)}_addMeshToSubPart(e,t,n,s,r,o,i,a){let l=this._generateMesh(e,t,n,r,o,i,a);s&&l.applyMatrix4(ge(s)),this._subPartObject.add(l)}_addMeshToComponent(e,t,n,s,r,o,i,a,l,c){if(this._subPartGuard&&this._subPartGuard.info===e)return void this._addMeshToSubPart(e,null,s,null,o,i,a,l);const h=this.getComponent(e);if(!h)return;const d=this._componentFactory.isPreview(h),u=this._generateMesh(e,n,d?null:s,o,i,a,l);u.userData.meshId=t,u.userData.geometryId=n,u.userData.materialId=s,r&&(u.userData.transform=ge(r),u.applyMatrix4(u.userData.transform)),d&&u.layers.set(4),h&&h.addMesh(u),h.meshes.length>this._mergeThreshold&&this._componentsToMerge.set(e,h.meshes.length)}_changeMeshOfComponent(e,t,n,s,r){const o=this.getComponent(e);if(!o)return;const i=o.getMeshById(t);i&&(i.userData.geometryId!==n&&console.warn("Geometry of mesh has changed!"),i.userData.materialId=s,this._configuratorMeshGenerator.setMaterial(i,s),r&&(i.userData.transform=ge(r),i.position.set(0,0,0),i.scale.set(1,1,1),i.rotation.set(0,0,0),i.applyMatrix4(i.userData.transform)))}_removeMeshFromComponent(e,t){const n=this.getComponent(e);n&&n.removeMeshById(t)}getComponent(e){let t=this._components.get(e);return t||(t=this._previews.get(e.toString()),t)?t:(console.warn("component not found!",e),null)}tryToMergeComponents(){this._initData.moc||this._mergeInProgress||(this._mergeInProgress=!0,this._componentsToMerge.size,this._requestMergeComponents())}_requestMergeComponents(){window.requestIdleCallback(this._mergeNextComponent.bind(this))}_mergeNextComponent(){if(this._componentsToMerge.size>0){const e=this._componentsToMerge.largestValue();this._componentsToMerge.delete(e),this._mergeComponent(e),this._requestMergeComponents()}else this._mergeInProgress=!1,this._geometriesMerged&&this._geometriesMerged(),this._components.forEach(e=>{e.loadingMesh&&console.warn("component still has loading mesh: ",e.hash)})}_mergeComponent(e){const t=this._components.get(e);if(t&&!(t.meshes.length<=this._mergeThreshold))if(this._cacheHolder.componentCache.has(t.hash)){const e=this._cacheHolder.componentCache.get(t.hash).meshes;t.replaceMeshes(e)}else{const e=new Map,n=[],s=[];t.meshes.forEach(t=>{const r=t.userData.material;if(!r)return void console.warn("mesh has no material id set");if(!e.has(r)){const s=new THREE.Mesh(new THREE.Geometry,t.material);s.userData.material=r,s.receiveShadow=!0,s.castShadow=!0,s.layers.set(3),this._setMaterial(s,r),n.push(s),e.set(r,s)}const o=e.get(r).geometry;t.userData.transform?o.merge(t.geometry,t.userData.transform):o.merge(t.geometry),s.push(t)}),n.forEach(e=>t.addMesh(e)),s.forEach(e=>t.removeMesh(e)),this._cacheHolder.componentCache.set(t.hash,t)}}_addRootComponent(e){this._listener&&this._listener.display(e)}removeDockingComponent(){this._getKernelAccess().requestDeleteComponent(this._configuratorContext.dockingRootComponentId),this._configuratorContext.dockingRootComponentId=null}dockComponent(e,t,n,s){let r=this._components.get(t),o=this._components.get(e);o&&(o.roomlePosition=n,o.roomleRotation=s,r&&r.add(o))}dockComponentWithPosition(e,t){let n,s=this._components.get(e.parentId);n=t?t.getKernelPosition(s):e.getKernelPosition(s);const r=Ee.start("dock_component_with_position_"+e.childId);this._getKernelAccess().dockComponentWithPosition(e.parentId,e.parentDockId,e.childId,e.childDockId,n),this._configuratorContext.dockingRootComponentId=null,Ee.end(r)}removePreviews(){this._previews.size>0&&(this._previews.forEach(e=>{e.removeFromParent(),e.removeAllMeshes()}),this._previews.clear())}_updatePlanObject(e){const t=this._components.get(e.rootPlanComponentId);let n=!0;t&&(n=t.geometryChanged),this._listener&&this._listener.planObjectUpdated(e,n)}Editor3dAddBakedMesh(e,t,n,s,r,o,i){this._addMeshToComponent(e,null,null,t,null,n,s,r,o,i)}Editor3dAddDockPreview(e,t){let n=this._componentFactory.createPreview(t,e);this._previews.set(t.toString(),n)}Editor3dAddNamedMesh(e,t,n,s,r,o,i,a,l,c){this._addMeshToComponent(e,t,n,s,r,o,i,a,l,c)}Editor3ChangedNamedMesh(e,t,n,s,r){this._changeMeshOfComponent(e,t,n,s,r)}Editor3dRemoveNamedMesh(e,t){this._removeMeshFromComponent(e,t)}Editor3dBeginConstruction(e,t){if(!t){const t=this._components.get(e);t&&t.removeAllMeshes()}this._subPartGuard&&e===this._subPartGuard.info&&(this._subPartObject=new THREE.Object3D)}Editor3dComponentCreated(e,t,n,s,r){r&&(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,s),o.layers.set(3)),this._components.set(e,o),r&&this._addRootComponent(o)}Editor3dComponentDocked(e,t,n,s){this.dockComponent(e,t,n,s)}Editor3dEndConstruction(e){if(this._subPartGuard&&this._subPartGuard.info===e)return void this._subPartGuard.resolve(this._subPartObject);const t=this._getKernelAccess().kernelInstance.getComponent(e),n=this._components.get(e);n&&(n.computeBoundingBox(t.boxForMeasurement),n.boundingBoxMesh&&this._listener&&this._listener.addComponentHandlers(n));let s=this._previews.get(e.toString());s&&s.computeBoundingBox(t.boxForMeasurement,!0)}Editor3dGeometryReady(e){const t=this._components.get(e);t&&t.loadingFinished()}Editor3dGeometryNotReady(e){const t=this._components.get(e);t&&t.loading()}Editor3dPlanObjectConstructionDone(e){const t=this._getKernelAccess().kernelInstance.getPlanObject(e),n=[t,this._getKernelAccess().kernelInstance.getFullPartList(),this._getKernelAccess().kernelInstance.getHashOfConfiguration(e),this._getKernelAccess().kernelInstance.getComponentId(t.rootPlanComponentId)];ye.finishOperation(2,n),this._updatePlanObject(t),this._listener&&this._listener.planObjectConstructionDone(t)}Editor3dPreviewConstructionDone(e,t){let n=!1;this._previews.forEach(e=>{null!==e.parent&&(this._listener&&(this._componentFactory.isPreviewLine(e)?this._listener.addPreviewLineHandlers(e):this._listener.addPreviewHandlers(e)),n=!0)}),this._listener&&this._listener.previewConstructionDone(this._components.get(e),n)}Editor3dSetPreviewLineAssociations(e,t){let n=this._previews.get(t.toString());if(n.clear(),!n)return;let s=this._componentFactory.createPreviewLine(n),r=this._components.get(this._configuratorContext.rootComponentId);for(let t=0;t<e.length;t++){let n;n=0===t?s:s.clonePreviewLine(t),n.name="Preview Line",n.parentDockId=e[t].parentDockId,n.parentId=e[t].parentId,n.childDockId=e[t].childDockId,n.childId=e[t].childId,n.docklineRotation=(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),r.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 s=this._components.get(this._configuratorContext.rootComponentId);for(let t=0;t<e.length;t++){let r;0===t?r=n:(r=n.clonePreview(t),this._previews.set(r.stringId,r)),r.name="Preview Point",r.parentDockId=e[t].parentDockId,r.parentId=e[t].parentId,r.childDockId=e[t].childDockId,r.childId=e[t].childId,r.preparePreview(),r.receivedPointAssociation=!0,r.userData.ignoreComponentRaycast=!0,s.add(r),r.roomlePosition=e[t].position,r.roomleRotation=e[t].rotation}}componentDeleted(e){const t=this._components.get(e);t&&(this._listener&&this._listener.componentDeleted(t),t.removeFromParent(),t.removeAllMeshes(),this._components.delete(e))}componentMetaUpdated(e){const t=this._getRuntimeComponent(e.id);t&&(t.hash=e.hash,t.roomlePosition=e.position,t.roomleRotation=e.rotation,e.boxForMeasurement&&t.computeBoundingBox(e.boxForMeasurement),this._listener&&this._listener.componentUpdated(t,e))}componentConfigurationUpdated(e,t){const n=this._getRuntimeComponent(e);n&&(n.geometryChanged=t)}_getRuntimeComponent(e){let t=this._components.get(e);return t||(t=this._previews.get(e.toString()),t)?t:null}configurationLoaded(e,t,n,s,r){e===He&&(this._configuratorContext.dockingRootComponentId=n);let o=0===t;o?this._getKernelAccess().kernelInstance.requestPlanComponentConstructionRecursive(n):this._getKernelAccess().kernelInstance.requestPlanObjectConstruction(t);let i=this._getKernelAccess().kernelInstance.getComponent(n),a=this._components.get(n);a&&(a.computeBoundingBox(i.boxForMeasurement),a.hash=i.hash),this._listener&&this._listener.configurationLoaded(a,o&&void 0!==a.boundingBoxMesh)}finishParameterChange(e,t){this.materialQueue.registerCallback(e)}planObjectConfigurationUpdated(e,t,n){let s=this._getKernelAccess().kernelInstance.getPlanObject(e);this._updatePlanObject(s)}planObjectCreated(e,t){this._configuratorContext.planObjectId=t,this._listener&&this._listener.clearScene()}planObjectUpdated(e){this._updatePlanObject(e)}sceneCleared(){this._components.forEach((function(e){e.removeFromParent(),e.removeAllMeshes()})),this._components.clear(),this._previews.forEach(e=>{e.removeFromParent(),e.removeAllMeshes()}),this._previews.clear()}setListener(e){this._listener=e}getBoundingBox(){if(this._configuratorContext.planObjectId){const e=this._getKernelAccess().kernelInstance.getPlanObject(this._configuratorContext.planObjectId);if(e&&e.boxForMeasurement)return C(e.boxForMeasurement)}else if(this._configuratorContext.rootComponentId){const e=this._components.get(this._configuratorContext.rootComponentId);return(new THREE.Box3).setFromObject(e)}return null}getBoundingBoxWithPreviews(){const e=this._components.get(this._configuratorContext.rootComponentId);return e?(new THREE.Box3).setFromObject(e):null}hasPreviews(){return this._previews.size>0}clearRootComponent(){var e;null===(e=this._components.get(this._configuratorContext.rootComponentId))||void 0===e||e.hoverOff()}debugSceneGraph(e){e?this._components.has(e)?this._components.get(e):this._previews.has(e.toString())&&this._previews.get(e.toString()):this._configuratorContext}getComponentsForIds(e){let t=[];return e.forEach(e=>{const n=this._components.get(e);n&&t.push(n)}),t}getComponents(){return Array.from(this._components.values())}getPreviews(){return Array.from(this._previews.values())}isPreviewLine(e){return this._componentFactory.isPreviewLine(e)}isPreview(e){return this._componentFactory.isPreview(e)}setGeometriesMergedListener(e){this._geometriesMerged=e}removeGeometriesMergedListener(){this._geometriesMerged=void 0}setMergeThreshold(e){this._mergeThreshold=e}_generateMesh(e=0,t=null,n,s,r,o,i,a,l){return this._configuratorMeshGenerator.generateMesh(e,t,n,s,r,o,i)}_setMaterial(e,t,n){this._configuratorMeshGenerator.setMaterial(e,t)}constructComponents(e){this._getKernelAccess().kernelInstance.requestPlanObjectConstruction(e)}requestSubPartConstruction(e){return this._subPartGuard=new te(e),this._getKernelAccess().requestPlanComponentConstruction(e),this._subPartGuard.wait()}getMeshGenerator(){return this._configuratorMeshGenerator}}return y([B],e.prototype,"_configuratorMeshGenerator",void 0),y([B],e.prototype,"_configuratorContext",void 0),y([B],e.prototype,"_cacheHolder",void 0),y([B],e.prototype,"_initData",void 0),e})());class Oe extends Map{largestValue(){let e=this.entries().next().value[0],t=0;return this.forEach((n,s)=>{n>t&&(e=s,t=n)}),e}}class Ue{constructor(e){this.autoQuality=!0,this.colors=c,this.unit=null,this.unitStringType=null,this.meshSelection=!0,this.stats=!1,this._measureTraffic=!1,this.gammaOutput=!0,this.disableDebugGUI=!1,this.disableEnvMap=!1,this.dls=null,this.ls=null,this.cameraSpacing=0,this.transparentHighlighting=!0,this.mode="3D",this.edit=!1,this.moc=!1,this._creator_=e}setOverrides(e){h(this,e)}}e("ai",Ue);const Be=["language","browserLanguage","userLanguage","systemLanguage"];class je{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=Be.length;e<n;e++){const n=t[Be[e]];if(n)return n.substr(0,2)}return"en"})()||"en",this.overrideCountry=null,this._creator_=e}setOverrides(e){h(this,e)}}e("ah",je);class Ge{constructor(e){return this._isMute=!1,this._creator_=e,d(this,"_isMute",{enumerable:!1,writable:!1}),d(Ge.prototype,"_setMute",{enumerable:!1,writable:!1}),d(Ge.prototype,"mute",{enumerable:!1,writable:!1}),d(Ge.prototype,"unmute",{enumerable:!1,writable:!1}),new Proxy(this,this)}_setMute(e){u(this,"_isMute",!0),this._isMute=e,u(this,"_isMute",!1)}mute(){this._setMute(!0)}unmute(){this._setMute(!1)}get(e,t){return this._isMute&&"function"==typeof this[t]&&"on"===t.substr(0,2)?()=>{}:this[t]}}e("U",Ge);class Ve extends Ge{constructor(){super(...arguments),this.onNetworkRequest=(e,t,n)=>{},this.onKernelMsg=(e,t,n={})=>{},this.onCheckExternalCache=async(e,t)=>Promise.resolve(null)}}e("ag",Ve),e("C",{HSC:"rml-hsc",HSP:"rml-hsp",GLB:"rml-glb",RMV:"rml-mv"});let Ne=(()=>{class e{constructor(e){this._creator_=e,this._lifeCycleManager.addEventListener(this)}get element(){return this._container}setDomElement(e){if(!this._container){this._container=document.createElement("div"),this._container.classList.add("rml-threejs-canvas-container"),this._container.setAttribute("ondragover","return false"),this._container.style.position="relative",this._container.style.width="100%",this._container.style.height="100%";const t=document.createElement("style");t.innerText=".rml-threejs-canvas-container canvas{position:absolute;top:0;left:0;right:0;bottom:0;}.rml-threejs-canvas-container .foreground{z-index:100; opacity:1;}.rml-threejs-canvas-container .background{z-index:-1; opacity:0;}",this._container.appendChild(t),e.appendChild(this._container)}this._element=e}getClientDimensions(){return new THREE.Vector2(this._element.clientWidth,this._element.clientHeight)}_removeDomElement(e){if(!e)return;const t=e.parentElement;t&&t.removeChild(e)}reset(){this._element=null,this._removeDomElement(this._container),this._container=null}pause(){this.reset()}resume(){}destroy(){}}return y([B],e.prototype,"_lifeCycleManager",void 0),e})(),ze={InchFeet:null,MM:null,CM:null},We={NoUnitString:null,LongUnitString:null,ShortUnitString:null},Ke=(()=>{class e{constructor(e){this._formatter=null,this._precision=0,this._creator_=e}init(e){const t=new e.UnitMeasureFormatter;ze=e.Unit,We=e.UnitStringType,this._initActualUnit(),this._initActualUnitStringType();const{precisionCm:n,precisionInch:s}=this._initData;this._actualUnit===ze.InchFeet?this._precision=void 0!==s?parseInt(s,10):2:this._actualUnit===ze.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=ze.CM;break;case"mm":this._actualUnit=ze.MM;break;case"inchfeet":this._actualUnit=ze.InchFeet;break;default:this._actualUnit=ze.CM}}_initActualUnitStringType(){const{unitStringType:e}=this._initData;switch(e){case"none":this._actualUnitStringType=We.NoUnitString;break;case"long":this._actualUnitStringType=We.LongUnitString;break;case"short":this._actualUnitStringType=We.ShortUnitString;break;default:this._actualUnitStringType=We.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){Pe(e)&&(e.valueLabel=this._formatParameterValue(e.value,e.unitType))}formatParameter(e){if(Pe(e)&&Array.isArray(e.validValues)&&e.validValues.forEach(({value:t},n)=>{e.validValues[n].label=this._formatParameterValue(t,e.unitType)}),e.valueLabel=this._formatParameterValue(e.value,e.unitType),Re(e))e.uiType="Material";else if(function(e){return"Boolean"===e.type}(e))e.uiType="Boolean";else if(Ce(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 Te(e)?(e.uiType="Options",function(e){return!!Te(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===ze.InchFeet}getPrecision(){return this._precision}getAllowedDelta(){const e=1/Math.pow(10,this._precision);return this.isInch()?25.4*e:e}}return y([B],e.prototype,"_initData",void 0),e})();e("aj",class{constructor(e){this._creator_=e}setScene(e){}setUiScene(e){}updateBounds(e){}clearScene(e,t){}moveCameraEnd(e){}moveCameraStart(e){}needsUiScene(){return!1}});let qe=(()=>{class e{constructor(e){this._plugins=[],this._creator_=e}async init(e,n,s){this._scene=e,this._uiScene=n,this._cameraPosition=s;const{bananaForScale:r}=this._initData;r&&await t.import("./banana-for-scale-939e4df7.nomodule.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)}}return y([B],e.prototype,"_initData",void 0),e})();const Je=e("I",[new m("error-handler",class{constructor(){this._listeners={}}_subscribe(e,t){this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(t)}subscribe(e,t){this._subscribe(e,t)}dispatch(e,t){if(!this._listeners[e])return;const n=this._listeners[e];let s=n.length;for(let e=0;e<s;e++){const s=n[e];s.apply(s,t)}}unsubscribe(e,t){if(!this._listeners[e])return;const n=this._listeners[e];let s=n.length;for(let e=0;e<s;e++)if(n[e]===t)return n.splice(e,1),s--,void e--}softReject(e,t,n){return this.dispatch(n,[t]),e()}}),new m("form-data-util",f),new m("environment-loader",j),new m("static-item-loader",oe,0),new m("form-data-util",f),new m("single-promise-factory",class{constructor(e){this._promises=new Map,this._creator_=e}create(e,t,n){return new Promise((s,r)=>{let o=this._promises.get(e),i=!0;if(!o){const t=new Map;this._promises.set(e,t),o=this._promises.get(e),i=!1}o.get(t)||(o.set(t,[]),i=!1);const a=o.get(t);a.push({resolve:s,reject:r}),o.set(t,a);const l=()=>{o.delete(t),0===o.size&&this._promises.delete(e)};i||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 m("dynamic-light-setting-loader",V),new m("dynamic-quality-setting-loader",le),new m("network-layer",q),new m("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 m("network-layer",q),new m("kernel-io",Q,0),new m("data-syncer",ee),new m("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 m("life-cycle-manager",class{constructor(){this._listeners=[]}addEventListener(e){this._listeners.push(e)}removeEventListener(e){const t=this._listeners;let n=t.length;if(n)for(let s=0;s<n;s++)t[s]===e&&(t.splice(s,1),s--,n--)}pause(){this._listeners.forEach(e=>e.pause())}resume(){this._listeners.forEach(e=>e.resume())}destroy(){this._listeners.forEach(e=>e.destroy())}},1),new m("three-loader",ie),new m("local-storage-helper",ae),new m("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())A(e);for(const e of this._materialCache.values())F(e);for(const e of this._geometryCache.values())H(e);this._componentCache.clear(),this._geometryCache.clear(),this._materialCache.clear()}},0),new m("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 m("configurator-kernel-access-callback",class{constructor(e){this._callbackListener=new Set,this._creator_=e}addListener(e){this._callbackListener.add(e)}removeListener(e){this._callbackListener.delete(e)}isReady(){this._callbackListener.forEach(e=>e.isReady())}updatePossibleChildren(e,t,n){this._callbackListener.forEach(s=>s.updatePossibleChildren(e,t,n))}updateParameters(e,t,n,s){this._callbackListener.forEach(r=>r.updateParameters(e,t,n,s))}loadError(e){this._callbackListener.forEach(t=>t.loadError(e))}},1),new m("configurator-view-model",Fe,1),new m("configurator-context",class{constructor(){this.rootComponentParametersAsGlobal=!1,this.lastLoadedRapiId=null,this.selectedRuntimeComponentIds=[],this.selectionMode="standard"}get selectedRuntimeComponentId(){return this.selectedRuntimeComponentIds.length>0?this.selectedRuntimeComponentIds[0]:null}},1),new m("init-data",Ue,1),new m("global-init-data",je,0),new m("global-callback",Ve,0),new m("dom-helper",Ne,1),new m("unit-formatter",Ke,0),new m("plugin-system",qe,1)]);class Qe{static _ensureContainer(){window.__RML__DI__||(window.__RML__DI__=new g,window.__RML__DI__.addDependencyInjectionAssignments(Je))}static setup(e){Qe.addToContainer(e)}static lookup(e,t){return window.__RML__DI__?window.__RML__DI__.lookup(e,t):null}static getContext(e){return Qe._ensureContainer(),window.__RML__DI__.getContext(e)}static cleanUp(e){return window.__RML__DI__?window.__RML__DI__.cleanUp(e):null}static addToContainer(e){Qe._ensureContainer(),window.__RML__DI__.addDependencyInjectionAssignments(e)}}e("r",Qe);let Ze=e("A",(()=>{class e{static init(t={}){const{kernelInstance:n,kernelContainer:s,planObjectId:r}=t;e.kernelInstance=n,e.kernelContainer=s,e.planObjectId=r}static cleanUp(){e.useHDGeometry=!1,e.kernelInstance=null,e.kernelContainer=null,e.planObjectId=null}}return e.useHDGeometry=!1,e.kernelInstance=null,e.kernelContainer=null,e.planObjectId=null,e})());const{APP:$e}=ve,{RAPI:Xe}=$e,Ye=Xe.headers,et=Xe.itemHeaders,tt=Ye.token,nt=e("S","crt"),st=p();let rt=new Map,ot=new Map,it=new Map,at=new Map,lt=new Map,ct=new Map,ht=new Map,dt=new Map,ut=new Map;const pt=e=>rt.get(e)||rt.get(st+e),gt=e=>e&&e.tags&&e.tags.length,mt=e=>!gt(e)&&e.group;e("f",(()=>{class e{constructor(e){this._itemLoaded=!1,this._currentToken=null,this._creator_=e,window.addEventListener("online",this._flushOfflineQueue.bind(this))}getPreloadForItem(e){return this._getPreload(e,!0)}getPreloadForConfiguration(e){return this._getPreload(e,!1)}_getPreload(e,t){return new Promise((n,s)=>{if(!navigator.onLine)return n();if(this._dataSyncer.getIsCatalogSynced(z(e)))return n();if(ht.get(e))return n();const r=t?"?itemId=":"?configurationId=";this._get("/preloads/components/"+r+e,"preloads/components").then(t=>{if(ht.get(e))return n();t.forEach(e=>{this._prepareData(e,"components")}),ht.set(e,!0),n()},s)})}changeUseOfHDGeometry(){const e=at.get("components");ht.clear(),ct.clear(),e&&at.delete("components")}getHSCPackage(e){return new Promise((t,n)=>{if(ct.get(e))return t();this._get("/catalogs/"+e+"/package","package").then(n=>{if(ct.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")}),ct.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:et})}getComponents(e){return this._getByIds(e,"components")}getItems(e){return this._getByIds(e,"items",{additionalHeaders:et})}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=nt,n=50){return this._getById(e,"meshes",{pathSuffix:"/data?format="+t+"&targetQuality="+n.toString()})}getMeshesOfCatalog(e){return new Promise((t,n)=>{const s=lt.get(e);s?t(s):this._get("/meshes?catalog="+e,"catalogMeshes").then(n=>{lt.set(e,n),t(n)},n)})}getTexturesOf(e){return this._getRelationData(e,{rapiPath:"textures"})}getItemsOf(e){return this._getRelationData(e,{rapiPath:"items"})}async getMaterialsOf(e){return(await this._getRelationData(e,{rapiPath:"materials"},{embed:["textures"]})).filter(e=>e.active)}getComponentsOf(e){return this._getRelationData(e,{rapiPath:"components"})}getAdditionalContentsOfItems(e){const t=[],n=[];return e.forEach(e=>{const s=ot.get(e.id.toString());s?n.push(...s):t.push(e.id.toString())}),new Promise((e,s)=>{0!==t.length?this._getByIdsPackets(t,"itemAdditionalContents",{filterKey:"itemIds"}).then(t=>{t.forEach(e=>{let t=ot.get(e.itemId);t||(t=[]);for(let n=0,s=t.length;n<s;n++)if(t[n].id===e.id)return;t.push(e),ot.set(e.itemId,t)}),e([...t,...n])},s):e(n)})}getMaterial(e){return this._getById(e,"materials",{embed:["textures"]})}peekMaterial(e){return this._peekData(e,"materials")}peekComponent(e){return this._peekData(e,"components")}async getMaterials(e){return(await this._getByIds(e,"materials",{embed:["textures"]})).filter(e=>e.active)}getPlan(e){return this._getById(e,"plans")}static clearCaches(){rt=new Map,it=new Map,at=new Map,ct=new Map,ht=new Map,dt=new Map,ot=new Map}cleanUp(){e.clearCaches()}getMaterialsByGroup(e){const t=e.slice(),n=[];let s=t.length;for(let e=0;e<s;e++){const r=pt(t[e]);if(r){const o=r.length;for(let e=0;e<o;e++){const t=this._getCache("materials").get(r[e]);n.push(t)}t.splice(e,1),s--,e--}}return new Promise((e,s)=>{0!==t.length&&navigator.onLine?this._getByIdsPackets(t,"materials",{filterKey:"groups",embed:["textures"]}).then(t=>{e(this.combineMaterialsToGroups([...t,...n]))},s):e(this.combineMaterialsToGroups(n))})}_flushOfflineQueue(){return new Promise((e,t)=>{const n=this._localStorage.getItem("hsc_configurations_offline_queue_v1"),s=[];for(let e in n)if(n.hasOwnProperty(e)){const t=n[e];s.push(new Promise((e,n)=>{this.saveConfiguration(t.data).then(s=>{const r=[];t.perspectiveImage&&!s.perspectiveImage&&r.push(this.savePerspectiveImage(s,t.perspectiveImage)),t.topImage&&!s.topImage&&r.push(this.savePerspectiveImage(s,t.topImage)),Promise.all(r).then(e,n)},n)}))}Promise.all(s).then(()=>{this._localStorage.setItem("hsc_configurations_offline_queue_v1",{}),e()},t)})}_setQueuedConfiguration(e,t={}){const n=e.configurationHash,{perspectiveImage:s,topImage:r}=t;let o=this._localStorage.getItem("hsc_configurations_offline_queue_v1")||{},i=o[n]||{};i.data=e,i.perspectiveImage=s,i.topImage=r,o[n]=i,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,s)=>this._fetchJson("/shortIds","shortIds",{method:"POST",resolve:n,reject:s,data:JSON.stringify({shortId:{type:t,referencedId:e}}),accept:"application/json",contentType:"application/json; charset=UTF-8"}))}_peekData(e,t){const n=at.get(t);return n&&n.get(e)||null}_saveConfigurationImage(e,t,n){if(!navigator.onLine){const s={};return s[n]=t,this._setQueuedConfiguration(e,s),this._markConfigurationAsLocally(e),e[n]=t.image,Promise.resolve(e)}const s=this._formDataUtil.create(t.image,e.configurationHash,_.PNG,n);return this._save("/configurations/"+e.id+"/"+n,s,"configurations",{accept:"application/json"})}_markConfigurationAsLocally(e){e.isLocally=!0,e.id=e.configurationHash}_save(e,t,n,s={}){const r=t instanceof FormData?t:JSON.stringify(t);return new Promise((t,o)=>{const i={method:s.method||"POST",data:r,resolve:t,reject:o};s.contentType&&(i.contentType=s.contentType),s.accept&&(i.accept=s.accept),this._fetchJson(e,n,i)})}combineMaterialsToGroups(e){return new Promise((t,n)=>{const s=new Map,r={id:null,label:null,materials:[]},o=[];for(let t=0,n=e.length;t<n;t++){const n=e[t],i=n.tags&&n.tags.length?n.tags.map(e=>({isTag:!0,id:e})):[];n.group&&i.push({isTag:!1,id:st+n.group,legacyId:n.group}),i.length||i.push({isTag:!1,id:null}),n.tags&&n.tags.length&&n.tags.forEach(e=>-1===o.indexOf(e)?o.push(e):null),i.forEach(({isTag:e,id:t,legacyId:o})=>{const i=n.id;let a=t?pt(t):[];a||(rt.set(t,[]),a=pt(t)),-1===a.indexOf(i.toString())&&a.push(i.toString());const l=gt(n),c=l&&e,h=mt(n);if(c||h&&!e||!l&&!h&&!t){let e=t?s.get(t):r;e||(s.set(t,{id:t,label:n.groupLabel,legacyId:o,materials:[]}),e=s.get(t)),e.materials.push(n)}})}const i=r.materials.length?[r]:[];this.getTags(o).then(e=>{const n=e.reduce((e,t)=>(e[t.id]=t,e),{});return s.forEach((e,t)=>{i.push({id:t,label:n[t]?n[t].label:e.label,materials:e.materials,legacyId:e.legacyId,sort:n[t]?n[t].sort:void 0})}),t(i)},n)})}_getByIds(e,t,n={}){const s=this._getCache(t),r=this._getErrorCache(t),o=[],i=[...new Set(e)];let a=i.length;if(s&&s.size){const e=(new Date).getTime();for(let t=0;t<a;t++){const n=i[t],l=s.get(n),c=r.get(n);let h=!1;null!=l?(o.push(l),h=!0):h=void 0!==c&&(e-c.timestamp<6e4||!1===navigator.onLine),h&&(i.splice(t,1),a--,t--)}}return new Promise((e,s)=>{0!==i.length&&navigator.onLine?this._getByIdsPackets(i,t,n).then(t=>{e([...t,...o])},s):e(o)})}_getByIdsPackets(e,t,n={}){const s=n.filterKey||"ids";let r,o="/"+t+"/",i="?",a=[];const l=e.length;if(!l)return new Promise(e=>e([]));let c=!0,h=[];for(r=0;r<l;r++){c=!1;const n=e[r],l=i+s+"[]="+n,d=l.length+o.length;h.push(n),i="&",d<=1500?o+=l:(d>1500&&(h.pop(),r--),a.push({url:o,ids:h}),c=!0,o="/"+t+"/",i="?",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,s={}){return new Promise((r,o)=>{this._get(t,n,s).then(t=>{for(let n=0,r=t.length;n<r;n++){const r=s&&s.cacheKey?t[n][s.cacheKey]:t[n].id,o=e.indexOf(r.toString());-1!==o&&e.splice(o,1)}const o=e.length;if(o){const t=this._getCache(n),s=this._getErrorCache(n),r=(new Date).getTime();for(let n=0;n<o;n++)s.set(e[n],{code:0,timestamp:r}),t.delete(e[n]);this._errorHandler.dispatch(2,[n,e.map(e=>'"'+e+'"').join(",")])}r(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 s=this._getCache(t).get(e);if(s)return new Promise(e=>e(s));if(!navigator.onLine)return Promise.reject("Nothing cached but tried to fetch in offline mode");const r={...n,id:e},o=n.pathSuffix||"";return this._get("/"+t+"/"+e+o,t,r)}_get(e,t,n={}){const s=Ze.useHDGeometry?"includeGeometryHD=true":"";let r=-1===e.indexOf("?")?"?":"&";return""!==s&&(e+=r+s),n.embed&&Array.isArray(n.embed)&&n.embed.forEach(t=>{e+=r+"embed"+(t[0].toUpperCase()+t.substr(1))+"=true",r="&"}),new Promise((s,r)=>{const o=dt.get(e);Array.isArray(o)&&o.length>0?o.push({resolve:s,reject:r}):(dt.set(e,[{resolve:s,reject:r}]),this._fetchJson(e,t,n))})}_fetchJson(e,t,n={}){this._fetch(e,n).then(o.bind(this)).then(this._handleJson(e,t,n).bind(this)).catch(this._handleError(e,n).bind(this))}async _fetch(e,t){const n={method:t.method?t.method:"GET",headers:this._createHeaders(t),mode:"cors",cache:"default"};t.data&&(n.body=t.data);let s=Xe.server;const r=this._globalInitData.overrideRapi;r&&(s="live"===r?Xe.liveServer:Xe.testServer),(this._globalInitData.customApiUrl||""===this._globalInitData.customApiUrl)&&(s=this._globalInitData.customApiUrl);const o=new Request(s+e,n);this._globalCallback.onNetworkRequest(e,n,t);const i=await this._globalCallback.onCheckExternalCache(e,n);return i?{headers:{get:()=>"application/json"},json:()=>Promise.resolve(i)}:this._networkLayer.fetch(o)}_createHeaders(e={}){const t={...Ye};this._globalInitData.overrideTenant&&(t.currentTenant=this._globalInitData.overrideTenant),this._globalInitData.overrideCountry&&(t.country=this._globalInitData.overrideCountry);const n=this._globalInitData.locale||"en";t.language=n,t.locale=n;const{contentType:s,accept:r,additionalHeaders:o,data:i}=e;if(s&&(t["content-type"]=e.contentType),r&&(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||tt;t.token="03-"+window.btoa((new Date).toISOString()+";"+a+";"+Ye.apiKey);const l=new Headers(t);return i instanceof FormData&&l.delete("content-type"),l}_handleJson(e,t,n={}){return s=>{let r=null,o=null;"number"==typeof s&&(r=s);for(let e in s)"meta"!==e&&s.hasOwnProperty(e)&&(r=s[e],o=e);if("error"===o)return this._handleError(e,n)(new Error(JSON.stringify(r)));if(!r)throw new TypeError("RAPI returned empty JSON");if(Array.isArray(r))for(let e=0,s=r.length;e<s;e++)this._prepareData(r[e],t,n),this._prepareEmbeddedData(r[e],t,n);else this._prepareData(r,t,n),this._prepareEmbeddedData(r,t,n);n.resolve?n.resolve(r):this._notifyWaiters(e,null,r)}}_prepareEmbeddedData(e,t,n={}){n.embed&&Array.isArray(n.embed)&&n.embed.forEach(s=>{const r=e[s.slice(0,-1)+"Objects"];if(Array.isArray(r)){for(let e=0,t=r.length;e<t;e++)this._prepareData(r[e],s,n);this._prepareRelationalData(t,s,e.id,r)}else r&&(this._prepareData(r,s,n),this._prepareRelationalData(t,s,e.id,[r]))})}_getCache(e){return this._getCacheFrom(e,at)}_getErrorCache(e){return this._getCacheFrom(e,ut)}_getCacheFrom(e,t){let n=t.get(e);return n||(t.set(e,new Map),n=t.get(e)),n}_setCache(e,t,n){n.set(e.toString(),t)}_prepareData(e,t,n=null){let s=this._getCache(t);const r=n&&n.cacheKey?e[n.cacheKey]:e.id;if(r||n&&n.id||"tenants/me"===t)if("tenants/me"!==t){{const t=r||n.id;this._setCache(t,e,s)}e.__rapi_path__=t}else this._setCache("0",e,s);else"shortIds"!==t&&console.error("Can not cache because there is no ID!")}_getRelationsCacheFor(e,t,n){let s=it.get(t);if(!s){const r=new Map,o=new Map;o.set(n,void 0),r.set(e,o),it.set(t,r),s=it.get(t)}let r=s.get(e);if(!r){const t=new Map;t.set(n,void 0),s.set(e,t),r=s.get(e)}return r.get(n)}_prepareGroups(e){const t=e.group,n=e.id;let s=pt(t);s||(rt.set(t,[]),s=pt(t)),-1===s.indexOf(n.toString())&&s.push(n.toString())}_handleError(e,t={}){return n=>{navigator.onLine?(n.rmlErrorCode=1,n.message='Failed to load "'+e+'" because of "'+n.message+'"',this._errorHandler.dispatch(1,[n])):(n.rmlErrorCode=0,n.message='Failed to load "'+e+'" because of "'+n.message+'"',this._errorHandler.dispatch(0,[n])),t.reject?t.reject(n):this._notifyWaiters(e,n,null)}}_getRelationData(e,t,n={}){const s=e.id;if(!s)return Promise.resolve([]);const r=e.__rapi_path__,o=t.rapiPath;let i=this._getCache(o),a=this._getRelationsCacheFor(s.toString(),r,o),l=[];return a?(a.forEach(e=>l.push(i.get(e))),new Promise(e=>e(l))):navigator.onLine?new Promise((e,t)=>{this._get("/"+r+"/"+s+"/"+o,o,n).then(t=>{this._prepareRelationalData(r,o,s,t),e(t)},t)}):Promise.resolve([])}_prepareRelationalData(e,t,n,s){it.has(e)||it.set(e,new Map);let r=it.get(e);const o=n.toString();r.has(o)||r.set(o,new Map);let i=r.get(o),a=this._getCache(t),l=[];for(let e=0,t=s.length;e<t;e++){const t=s[e],n=t.id.toString();l.push(n),a.set(n,t)}i.set(t,l)}_notifyWaiters(e,t,n){const s=dt.get(e);if(s&&s.length){for(let e=0,r=s.length;e<r;e++)t?s[e].reject(t):s[e].resolve(n);dt.delete(e)}}_tenantMe(){return new Promise((e,t)=>{const n=this._getCache("tenants/me"),s=this._globalInitData.overrideTenant?this._globalInitData.overrideTenant:n.get("0");if(s)return e(s);this._fetchJson("/tenants/me","tenants/me",{resolve:t=>e(t),reject:t})})}async getTenant(e){return e||(e=await this._tenantMe()),this._getById(e.toString(),"tenants")}getCurrentSkin(){return this._tenantMe().then(e=>this._getById(e.toString(),"tenants").then(e=>this._getById(e.skin.toString(),"skins")))}getPrices(e){return this._getByIds(e,"prices",{filterKey:"priceIds",cacheKey:"priceId"})}async getConfiguratorSettings(e){const t=await this._getById(e,"configurators");return t.allowedHosts||(t.allowedHosts=[]),t.allowedHosts&&!Array.isArray(t.allowedHosts)&&(t.allowedHosts=t.allowedHosts.split(" ")),t}sendUserAction(e){return this._save("/userActions",{userAction:e},"userActions",{accept:"application/json",contentType:"application/json; charset=UTF-8"})}shareConfiguration(e,t,n){const s="/configurations/"+e+"/shares",r=new FormData;return r.append("email",t),r.append("type",n.toString()),new Promise((e,t)=>{const n={method:"POST",data:r,resolve:e,reject:t,accept:"application/json",contentType:"application/json; charset=UTF-8"};this._fetch(s,n).then(n.resolve,n.reject)})}export3D(e,t,n,s={}){const r="/configurations/"+e+"/3d-exports",o={formats:[{file_format:n,pack_external_data:!0,...s}]},i=JSON.stringify(o),a=new FormData;return a.append("email",t),a.append("settings",i),new Promise((e,t)=>{const n={method:"POST",data:a,resolve:e,reject:t};this._fetch(r,n).then(n.resolve,n.reject)})}async trackView(e){if(this._itemLoaded||(t=(()=>{var e;const t=(()=>{if(window.__RML__ENV__&&window.__RML__ENV__.skipIframeCheck)return!1;try{return window.self!==window.top}catch(e){return!0}})();let n=null===(e=null===window||void 0===window?void 0:window.location)||void 0===e?void 0:e.href;if(!n)return null;if(t){if(!document.referrer)return null;n=document.referrer}const{hostname:s}=new URL(n);return s})())&&(N.includes(t)||t.endsWith("gitlab.io")||t.endsWith("gitlab.com")||t.endsWith("codesandbox.io")||t.endsWith("stackblitz.com")||/^(admin.*.roomle.com)$/.test(t)))return;var t;const{configuratorId:n}=this._globalInitData,s={module:3,action:1,actionId:e,actionLabel:n};await this.sendUserAction(s),this._itemLoaded=!0}signinUser(e,t){return new Promise((n,s)=>{const r={method:"POST",accept:"application/json",contentType:"application/json; charset=UTF-8",data:JSON.stringify({identification:e,passwordMD5:t}),cacheKey:"token",resolve:n,reject:s};this._fetchJson("/auth/signin","auth",r)})}async signoutUser(e){const t=this._currentToken;t!==e&&this.setCurrentToken(e),await this._fetch("/auth/signout",{}),t&&t!==e?this.setCurrentToken(t):this.removeCurrentToken()}async savePlan(e){const t=e.id?"/plans/"+e.id:"/plans";return this._save(t,{plan:e},"plans",{method:e.id?"PUT":"POST",accept:"application/json",contentType:"application/json; charset=UTF-8"})}setCurrentToken(e){this._currentToken=e}removeCurrentToken(){this._currentToken=null}createNewPlan(){return{name:"",description:"",changeDate:(new Date).toISOString(),created:(new Date).toISOString(),draftId:null,thumbnail:"data:image/png;base64,missing",planObjects:null,active:!0,open:0,planDirectory:0,changed:0,version:2,floorLevel:0,visibility:9,user:null,tenant:null,assets:[],parent:null,setting:null}}}return y([B],e.prototype,"_formDataUtil",void 0),y([B],e.prototype,"_errorHandler",void 0),y([B],e.prototype,"_dataSyncer",void 0),y([B],e.prototype,"_networkLayer",void 0),y([B],e.prototype,"_localStorage",void 0),y([B],e.prototype,"_globalInitData",void 0),y([B],e.prototype,"_globalCallback",void 0),e})())}}}));
16
+ //# sourceMappingURL=rapi-access-c3754bb1.nomodule.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"rapi-access-ec9bc9d3.nomodule.js","sources":["../../packages/common-core/public/textures/env/roomle.envmap","../../packages/common-core/public/textures/env/roomle64.envmap","../../packages/common-core/public/predefined_lightsettings/shelf.json","../../packages/common-core/public/predefined_lightsettings/shelf_front.json","../../packages/common-core/public/predefined_lightsettings/sofa.json","../../packages/common-core/public/predefined_lightsettings/baked.json","../../packages/common-core/public/predefined_lightsettings/camera.json","../../packages/common-core/public/predefined_lightsettings/equal.json","../../packages/workers/generated/asset-loader.worker.js","../../node_modules/three/examples/js/loaders/GLTFLoader.js","../../node_modules/three/examples/js/loaders/DRACOLoader.js","../../node_modules/three/examples/js/libs/draco/draco_wasm_wrapper.js","../../node_modules/three/examples/js/libs/draco/draco_decoder.wasm","../../node_modules/three/examples/js/libs/draco/draco_decoder.js","../../packages/common-core/generated/shaders.json","../../packages/common-core/generated/rthree.js","../../node_modules/roomle-core-hsc/wasm/ConfiguratorKernel.wasm","../../node_modules/roomle-core-hsc/wasm/ConfiguratorKernel.js","../../node_modules/roomle-core-hsc/wasm/RoomleCore.wasm","../../node_modules/roomle-core-hsc/wasm/RoomleCore.js","../../node_modules/roomle-core-hsc/ConfiguratorKernelJs.mem","../../node_modules/roomle-core-hsc/ConfiguratorKernelJs.js","../../node_modules/roomle-core-hsc/RoomleCoreJs.mem","../../node_modules/roomle-core-hsc/RoomleCoreJs.js"],"sourcesContent":["export default \"static/roomle-91862a5e7f3f46e5.envmap\"","export default \"static/roomle64-adb0f447a54b5143.envmap\"","export default \"static/shelf-2975dd3f2fa9c763.json\"","export default \"static/shelf_front-8c9566a4512f0de8.json\"","export default \"static/sofa-997b116bc5f2e92e.json\"","export default \"static/baked-6485a2b1daeb69e8.json\"","export default \"static/camera-f4cef679615485dc.json\"","export default \"static/equal-319f6b83c827913f.json\"","export default \"static/asset-loader.worker-796c70f59b977071.js\"","export default \"static/GLTFLoader-5b296b5fb14cfe1a.js\"","export default \"static/DRACOLoader-5edeeab4a8dbc0bd.js\"","export default \"static/draco_wasm_wrapper-d775f9f135cb30ff.js\"","export default \"static/draco_decoder-979e668167e37c95.wasm\"","export default \"static/draco_decoder-3866672a1fa2f980.js\"","export default \"static/shaders-34f19089b7cddbfe.json\"","export default \"static/rthree-508a6ceb9a1516ce.js\"","export default \"static/ConfiguratorKernel-4153106c16b35980.wasm\"","export default \"static/ConfiguratorKernel-e9bbd4998a056b0b.js\"","export default \"static/RoomleCore-daed88a09e86faf7.wasm\"","export default \"static/RoomleCore-18f96bc7c4c9fe8e.js\"","export default \"static/ConfiguratorKernelJs-795532b819912c59.mem\"","export default \"static/ConfiguratorKernelJs-02aa8157cf299656.js\"","export default \"static/RoomleCoreJs-10b4a8ee2a89da25.mem\"","export default \"static/RoomleCoreJs-1e5e3331b2d12a5a.js\""],"names":[],"mappings":";;;;;;;;;;;;;;sjVAAe,+DCAA,giECAA,wECAA,uECAA,iECAA,mECAA,mECAA,6DDAA,uiKEAA,ikHCAA,mDCAA,4ECAA,qECAA,gECAA,svECAA,0PCAA,+pkBCAA,yDCAA,8DCAA,iDCAA,qECAA,0DCAA,oECAA,kDCAA"}
1
+ {"version":3,"file":"rapi-access-c3754bb1.nomodule.js","sources":["../../packages/common-core/public/textures/env/roomle.envmap","../../packages/common-core/public/textures/env/roomle64.envmap","../../packages/common-core/public/predefined_lightsettings/shelf.json","../../packages/common-core/public/predefined_lightsettings/shelf_front.json","../../packages/common-core/public/predefined_lightsettings/sofa.json","../../packages/common-core/public/predefined_lightsettings/baked.json","../../packages/common-core/public/predefined_lightsettings/camera.json","../../packages/common-core/public/predefined_lightsettings/equal.json","../../packages/workers/generated/asset-loader.worker.js","../../node_modules/three/examples/js/loaders/GLTFLoader.js","../../node_modules/three/examples/js/loaders/DRACOLoader.js","../../node_modules/three/examples/js/libs/draco/draco_wasm_wrapper.js","../../node_modules/three/examples/js/libs/draco/draco_decoder.wasm","../../node_modules/three/examples/js/libs/draco/draco_decoder.js","../../packages/common-core/generated/shaders.json","../../packages/common-core/generated/rthree.js","../../node_modules/roomle-core-hsc/wasm/ConfiguratorKernel.wasm","../../node_modules/roomle-core-hsc/wasm/ConfiguratorKernel.js","../../node_modules/roomle-core-hsc/wasm/RoomleCore.wasm","../../node_modules/roomle-core-hsc/wasm/RoomleCore.js","../../node_modules/roomle-core-hsc/ConfiguratorKernelJs.mem","../../node_modules/roomle-core-hsc/ConfiguratorKernelJs.js","../../node_modules/roomle-core-hsc/RoomleCoreJs.mem","../../node_modules/roomle-core-hsc/RoomleCoreJs.js"],"sourcesContent":["export default \"static/roomle-91862a5e7f3f46e5.envmap\"","export default \"static/roomle64-adb0f447a54b5143.envmap\"","export default \"static/shelf-2975dd3f2fa9c763.json\"","export default \"static/shelf_front-8c9566a4512f0de8.json\"","export default \"static/sofa-997b116bc5f2e92e.json\"","export default \"static/baked-6485a2b1daeb69e8.json\"","export default \"static/camera-f4cef679615485dc.json\"","export default \"static/equal-319f6b83c827913f.json\"","export default \"static/asset-loader.worker-796c70f59b977071.js\"","export default \"static/GLTFLoader-5b296b5fb14cfe1a.js\"","export default \"static/DRACOLoader-5edeeab4a8dbc0bd.js\"","export default \"static/draco_wasm_wrapper-d775f9f135cb30ff.js\"","export default \"static/draco_decoder-979e668167e37c95.wasm\"","export default \"static/draco_decoder-3866672a1fa2f980.js\"","export default \"static/shaders-783e0f3c8bfe6cc2.json\"","export default \"static/rthree-508a6ceb9a1516ce.js\"","export default \"static/ConfiguratorKernel-3c16a462912d4363.wasm\"","export default \"static/ConfiguratorKernel-805ef8c9e2946584.js\"","export default \"static/RoomleCore-eefc95fcacfbbdb7.wasm\"","export default \"static/RoomleCore-41a17c2814f0726e.js\"","export default \"static/ConfiguratorKernelJs-a7b190fe9a79da9f.mem\"","export default \"static/ConfiguratorKernelJs-46632e2744e151e6.js\"","export default \"static/RoomleCoreJs-f7d9879c184a770d.mem\"","export default \"static/RoomleCoreJs-5e547e7bf5b9b475.js\""],"names":[],"mappings":";;;;;;;;;;;;;;sjVAAe,+DCAA,giECAA,wECAA,uECAA,iECAA,mECAA,mECAA,6DDAA,uiKEAA,ikHCAA,mDCAA,4ECAA,qECAA,gECAA,svECAA,0PCAA,+pkBCAA,yDCAA,8DCAA,iDCAA,qECAA,0DCAA,oECAA,kDCAA"}
@@ -1,2 +1,2 @@
1
- import{r as RoomleDependencyInjection,e as DependencyInjectionAssignment,f as RapiAccess,ag as GlobalCallback,ah as GlobalInitData,ai as InitData}from"./rapi-access-693b87b1.js";import"./main-thread-to-worker-9d399850.js";export default class{static getConfigurator(e,n){return n=this._setupDI("configurator",e,n),new Promise((e,t)=>import("./configurator-3cf0afc7.js").then((function(e){return e.c})).then(({Configurator:t})=>e(new t(n)),t))}static getPlanner(e,n){return n=this._setupDI("planner",e,n),new Promise((e,t)=>import("./planner-93dd1048.js").then(({Planner:t})=>e(new t(n)),t))}static async getGlbViewer(e,n){return n=this._setupDI("glb-viewer",e,n),new Promise((e,t)=>import("./glb-viewer-67e22889.js").then(({GlbViewer:t})=>e(new t(n)),t))}static getMaterialViewer(e,n){return n=this._setupDI("configurator",e,n),new Promise((e,t)=>import("./material-viewer-840eebf7.js").then(({MaterialViewer:t})=>e(new t(n)),t))}static getRapiAccess(){return RoomleDependencyInjection.addToContainer([new DependencyInjectionAssignment("rapi-access",RapiAccess,0),new DependencyInjectionAssignment("global-callback",GlobalCallback,0)]),Promise.resolve(RoomleDependencyInjection.lookup("rapi-access"))}static get callbacks(){return RoomleDependencyInjection.addToContainer([new DependencyInjectionAssignment("global-callback",GlobalCallback,0)]),Promise.resolve(RoomleDependencyInjection.lookup("global-callback"))}static setGlobalInitData(e){e&&(RoomleDependencyInjection.addToContainer([new DependencyInjectionAssignment("global-init-data",GlobalInitData,0)]),RoomleDependencyInjection.lookup("global-init-data").setOverrides(e))}static getContext(e){return RoomleDependencyInjection.getContext(e)}static _setupDI(e,n,t){return n&&(RoomleDependencyInjection.addToContainer([new DependencyInjectionAssignment("init-data",InitData,1)]),t||(t=RoomleDependencyInjection.getContext(e)),RoomleDependencyInjection.lookup("init-data",t).setOverrides(n)),t}}
2
- //# sourceMappingURL=roomle-sdk-a81664de.js.map
1
+ import{r as RoomleDependencyInjection,e as DependencyInjectionAssignment,f as RapiAccess,ag as GlobalCallback,ah as GlobalInitData,ai as InitData}from"./rapi-access-9de4b8ee.js";import"./main-thread-to-worker-9d399850.js";export default class{static getConfigurator(e,n){return n=this._setupDI("configurator",e,n),new Promise((e,t)=>import("./configurator-92943a85.js").then((function(e){return e.c})).then(({Configurator:t})=>e(new t(n)),t))}static getPlanner(e,n){return n=this._setupDI("planner",e,n),new Promise((e,t)=>import("./planner-cc924d07.js").then(({Planner:t})=>e(new t(n)),t))}static async getGlbViewer(e,n){return n=this._setupDI("glb-viewer",e,n),new Promise((e,t)=>import("./glb-viewer-44cb38e7.js").then(({GlbViewer:t})=>e(new t(n)),t))}static getMaterialViewer(e,n){return n=this._setupDI("configurator",e,n),new Promise((e,t)=>import("./material-viewer-68be1ea0.js").then(({MaterialViewer:t})=>e(new t(n)),t))}static getRapiAccess(){return RoomleDependencyInjection.addToContainer([new DependencyInjectionAssignment("rapi-access",RapiAccess,0),new DependencyInjectionAssignment("global-callback",GlobalCallback,0)]),Promise.resolve(RoomleDependencyInjection.lookup("rapi-access"))}static get callbacks(){return RoomleDependencyInjection.addToContainer([new DependencyInjectionAssignment("global-callback",GlobalCallback,0)]),Promise.resolve(RoomleDependencyInjection.lookup("global-callback"))}static setGlobalInitData(e){e&&(RoomleDependencyInjection.addToContainer([new DependencyInjectionAssignment("global-init-data",GlobalInitData,0)]),RoomleDependencyInjection.lookup("global-init-data").setOverrides(e))}static getContext(e){return RoomleDependencyInjection.getContext(e)}static _setupDI(e,n,t){return n&&(RoomleDependencyInjection.addToContainer([new DependencyInjectionAssignment("init-data",InitData,1)]),t||(t=RoomleDependencyInjection.getContext(e)),RoomleDependencyInjection.lookup("init-data",t).setOverrides(n)),t}}
2
+ //# sourceMappingURL=roomle-sdk-25237d27.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"roomle-sdk-25237d27.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +1,2 @@
1
- System.register(["./rapi-access-ec9bc9d3.nomodule.js","./main-thread-to-worker-97315397.nomodule.js"],(function(e,t){var n,r,a,o,i,s;return{setters:[function(e){n=e.r,r=e.e,a=e.f,o=e.ag,i=e.ah,s=e.ai},function(){}],execute:function(){e("default",class{static getConfigurator(e,n){return n=this._setupDI("configurator",e,n),new Promise((e,r)=>t.import("./configurator-9ec75ff2.nomodule.js").then((function(e){return e.c})).then(({Configurator:t})=>e(new t(n)),r))}static getPlanner(e,n){return n=this._setupDI("planner",e,n),new Promise((e,r)=>t.import("./planner-625e04ba.nomodule.js").then(({Planner:t})=>e(new t(n)),r))}static async getGlbViewer(e,n){return n=this._setupDI("glb-viewer",e,n),new Promise((e,r)=>t.import("./glb-viewer-564c48c8.nomodule.js").then(({GlbViewer:t})=>e(new t(n)),r))}static getMaterialViewer(e,n){return n=this._setupDI("configurator",e,n),new Promise((e,r)=>t.import("./material-viewer-9c55d420.nomodule.js").then(({MaterialViewer:t})=>e(new t(n)),r))}static getRapiAccess(){return n.addToContainer([new r("rapi-access",a,0),new r("global-callback",o,0)]),Promise.resolve(n.lookup("rapi-access"))}static get callbacks(){return n.addToContainer([new r("global-callback",o,0)]),Promise.resolve(n.lookup("global-callback"))}static setGlobalInitData(e){e&&(n.addToContainer([new r("global-init-data",i,0)]),n.lookup("global-init-data").setOverrides(e))}static getContext(e){return n.getContext(e)}static _setupDI(e,t,a){return t&&(n.addToContainer([new r("init-data",s,1)]),a||(a=n.getContext(e)),n.lookup("init-data",a).setOverrides(t)),a}})}}}));
1
+ System.register(["./rapi-access-c3754bb1.nomodule.js","./main-thread-to-worker-97315397.nomodule.js"],(function(e,t){var n,r,a,o,i,s;return{setters:[function(e){n=e.r,r=e.e,a=e.f,o=e.ag,i=e.ah,s=e.ai},function(){}],execute:function(){e("default",class{static getConfigurator(e,n){return n=this._setupDI("configurator",e,n),new Promise((e,r)=>t.import("./configurator-9f1bcb78.nomodule.js").then((function(e){return e.c})).then(({Configurator:t})=>e(new t(n)),r))}static getPlanner(e,n){return n=this._setupDI("planner",e,n),new Promise((e,r)=>t.import("./planner-c8feb6cc.nomodule.js").then(({Planner:t})=>e(new t(n)),r))}static async getGlbViewer(e,n){return n=this._setupDI("glb-viewer",e,n),new Promise((e,r)=>t.import("./glb-viewer-eac461db.nomodule.js").then(({GlbViewer:t})=>e(new t(n)),r))}static getMaterialViewer(e,n){return n=this._setupDI("configurator",e,n),new Promise((e,r)=>t.import("./material-viewer-d450271d.nomodule.js").then(({MaterialViewer:t})=>e(new t(n)),r))}static getRapiAccess(){return n.addToContainer([new r("rapi-access",a,0),new r("global-callback",o,0)]),Promise.resolve(n.lookup("rapi-access"))}static get callbacks(){return n.addToContainer([new r("global-callback",o,0)]),Promise.resolve(n.lookup("global-callback"))}static setGlobalInitData(e){e&&(n.addToContainer([new r("global-init-data",i,0)]),n.lookup("global-init-data").setOverrides(e))}static getContext(e){return n.getContext(e)}static _setupDI(e,t,a){return t&&(n.addToContainer([new r("init-data",s,1)]),a||(a=n.getContext(e)),n.lookup("init-data",a).setOverrides(t)),a}})}}}));
2
2
  //# sourceMappingURL=roomle-sdk.nomodule.js.map