@roomle/web-sdk 2.57.0-alpha.1 → 2.57.0-alpha.3

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 (196) hide show
  1. package/lib/{banana-for-scale-d41aab40.js → banana-for-scale-037282f5.js} +2 -2
  2. package/lib/{banana-for-scale-d41aab40.js.map → banana-for-scale-037282f5.js.map} +1 -1
  3. package/lib/{banana-for-scale-f99d7647.nomodule.js → banana-for-scale-e1845481.nomodule.js} +2 -2
  4. package/lib/{banana-for-scale-f99d7647.nomodule.js.map → banana-for-scale-e1845481.nomodule.js.map} +1 -1
  5. package/lib/{component-dimensioning-be27c825.js → component-dimensioning-40b5a947.js} +2 -2
  6. package/lib/component-dimensioning-40b5a947.js.map +1 -0
  7. package/lib/{component-dimensioning-e456ea8d.nomodule.js → component-dimensioning-f0013a5b.nomodule.js} +2 -2
  8. package/lib/component-dimensioning-f0013a5b.nomodule.js.map +1 -0
  9. package/lib/{component-raycast-helper-b28eb450.js → component-raycast-helper-d89f36b8.js} +2 -2
  10. package/lib/component-raycast-helper-d89f36b8.js.map +1 -0
  11. package/lib/{component-raycast-helper-9e82f7c8.nomodule.js → component-raycast-helper-e8761cef.nomodule.js} +2 -2
  12. package/lib/component-raycast-helper-e8761cef.nomodule.js.map +1 -0
  13. package/lib/{configurator-de6838a4.js → configurator-21cc7ece.js} +2 -2
  14. package/lib/configurator-21cc7ece.js.map +1 -0
  15. package/lib/{configurator-e0c325ce.nomodule.js → configurator-bcc039f0.nomodule.js} +2 -2
  16. package/lib/configurator-bcc039f0.nomodule.js.map +1 -0
  17. package/lib/configurator-main-b6905cb7.js +2 -0
  18. package/lib/configurator-main-b6905cb7.js.map +1 -0
  19. package/lib/configurator-main.nomodule.js +1 -1
  20. package/lib/{continuous-drawing-helper-997c2fd4.js → continuous-drawing-helper-50831659.js} +2 -2
  21. package/lib/continuous-drawing-helper-50831659.js.map +1 -0
  22. package/lib/{continuous-drawing-helper-492c955e.nomodule.js → continuous-drawing-helper-56bf8264.nomodule.js} +2 -2
  23. package/lib/continuous-drawing-helper-56bf8264.nomodule.js.map +1 -0
  24. package/lib/{default-light-setting-08fa18a7.js → default-light-setting-074cc98e.js} +2 -2
  25. package/lib/default-light-setting-074cc98e.js.map +1 -0
  26. package/lib/{default-light-setting-19127f94.nomodule.js → default-light-setting-d4e0610d.nomodule.js} +2 -2
  27. package/lib/default-light-setting-d4e0610d.nomodule.js.map +1 -0
  28. package/lib/{dimensioning-helper-d946c0e1.nomodule.js → dimensioning-helper-2f9a7d81.nomodule.js} +2 -2
  29. package/lib/{dimensioning-helper-d946c0e1.nomodule.js.map → dimensioning-helper-2f9a7d81.nomodule.js.map} +1 -1
  30. package/lib/{dimensioning-helper-805ba85c.js → dimensioning-helper-5a346d42.js} +2 -2
  31. package/lib/{dimensioning-helper-805ba85c.js.map → dimensioning-helper-5a346d42.js.map} +1 -1
  32. package/lib/{glb-viewer-777e1765.js → glb-viewer-9a569cac.js} +2 -2
  33. package/lib/{glb-viewer-777e1765.js.map → glb-viewer-9a569cac.js.map} +1 -1
  34. package/lib/{glb-viewer-46128ddd.nomodule.js → glb-viewer-b0661799.nomodule.js} +2 -2
  35. package/lib/{glb-viewer-46128ddd.nomodule.js.map → glb-viewer-b0661799.nomodule.js.map} +1 -1
  36. package/lib/glb-viewer-main-5e7660f3.js +2 -0
  37. package/lib/glb-viewer-main-5e7660f3.js.map +1 -0
  38. package/lib/glb-viewer-main.nomodule.js +1 -1
  39. package/lib/legacy/{banana-for-scale-b16f2882.legacy.js → banana-for-scale-357b1e20.legacy.js} +2 -2
  40. package/lib/legacy/{banana-for-scale-b16f2882.legacy.js.map → banana-for-scale-357b1e20.legacy.js.map} +1 -1
  41. package/lib/legacy/{component-dimensioning-9dbef8a8.legacy.js → component-dimensioning-6898cf6b.legacy.js} +2 -2
  42. package/lib/legacy/component-dimensioning-6898cf6b.legacy.js.map +1 -0
  43. package/lib/legacy/{component-raycast-helper-3a87b75b.legacy.js → component-raycast-helper-f66260bb.legacy.js} +2 -2
  44. package/lib/legacy/component-raycast-helper-f66260bb.legacy.js.map +1 -0
  45. package/lib/legacy/{configurator-d8cab2f1.legacy.js → configurator-9b9d6a25.legacy.js} +2 -2
  46. package/lib/legacy/configurator-9b9d6a25.legacy.js.map +1 -0
  47. package/lib/legacy/configurator-main.legacy.js +1 -1
  48. package/lib/legacy/{continuous-drawing-helper-fc6a4859.legacy.js → continuous-drawing-helper-333180af.legacy.js} +2 -2
  49. package/lib/legacy/continuous-drawing-helper-333180af.legacy.js.map +1 -0
  50. package/lib/legacy/{default-light-setting-3211fec0.legacy.js → default-light-setting-1bb5abab.legacy.js} +2 -2
  51. package/lib/legacy/default-light-setting-1bb5abab.legacy.js.map +1 -0
  52. package/lib/legacy/{dimensioning-helper-4876f20b.legacy.js → dimensioning-helper-89d717ea.legacy.js} +2 -2
  53. package/lib/legacy/{dimensioning-helper-4876f20b.legacy.js.map → dimensioning-helper-89d717ea.legacy.js.map} +1 -1
  54. package/lib/legacy/{glb-viewer-992880ed.legacy.js → glb-viewer-cd1f62ec.legacy.js} +2 -2
  55. package/lib/legacy/{glb-viewer-992880ed.legacy.js.map → glb-viewer-cd1f62ec.legacy.js.map} +1 -1
  56. package/lib/legacy/glb-viewer-main.legacy.js +1 -1
  57. package/lib/legacy/{material-viewer-0a1a8eb2.legacy.js → material-viewer-da51dcfc.legacy.js} +2 -2
  58. package/lib/legacy/material-viewer-da51dcfc.legacy.js.map +1 -0
  59. package/lib/legacy/material-viewer-main.legacy.js +1 -1
  60. package/lib/legacy/{pixotron-25e3e6fd.legacy.js → pixotron-6e4129d6.legacy.js} +2 -2
  61. package/lib/legacy/{pixotron-25e3e6fd.legacy.js.map → pixotron-6e4129d6.legacy.js.map} +1 -1
  62. package/lib/legacy/{planner-024d739b.legacy.js → planner-4665835b.legacy.js} +2 -2
  63. package/lib/legacy/{planner-024d739b.legacy.js.map → planner-4665835b.legacy.js.map} +1 -1
  64. package/lib/legacy/planner-main.legacy.js +1 -1
  65. package/lib/legacy/{roomle-configurator-baa4c5db.legacy.js → roomle-configurator-f848bb64.legacy.js} +2 -2
  66. package/lib/legacy/{roomle-configurator-baa4c5db.legacy.js.map → roomle-configurator-f848bb64.legacy.js.map} +1 -1
  67. package/lib/legacy/roomle-dependency-injection-c0eca260.legacy.js +16 -0
  68. package/lib/legacy/{roomle-dependency-injection-df487870.legacy.js.map → roomle-dependency-injection-c0eca260.legacy.js.map} +1 -1
  69. package/lib/legacy/roomle-sdk.legacy.js +1 -1
  70. package/lib/legacy/{script-loader-571941d9.legacy.js → script-loader-f003b92b.legacy.js} +2 -2
  71. package/lib/legacy/script-loader-f003b92b.legacy.js.map +1 -0
  72. package/lib/legacy/static/ConfiguratorKernel-a5ef853db0c81167.wasm +0 -0
  73. package/lib/legacy/static/{ConfiguratorKernel-d74ac1d836436ed8.js → ConfiguratorKernel-ab768dabc2374c1e.js} +77 -77
  74. package/lib/legacy/static/ConfiguratorKernelJs-d3180b4757558f07.mem +0 -0
  75. package/lib/legacy/static/ConfiguratorKernelJs-f8f05c4a926f93a6.js +147 -0
  76. package/lib/legacy/static/RoomleCore-21d3bab6ea62ed1f.wasm +0 -0
  77. package/lib/legacy/static/{RoomleCore-435f2f2c0751f8ed.js → RoomleCore-a7a39cbf7926accc.js} +88 -87
  78. package/lib/legacy/static/RoomleCoreJs-1c347f2376f46d6c.js +156 -0
  79. package/lib/legacy/static/RoomleCoreJs-2c6123dece4d9374.mem +0 -0
  80. package/lib/legacy/static/RoomleToolsCore-631eebe319245d3a.wasm +0 -0
  81. package/lib/legacy/static/{RoomleToolsCore-f6a3d0c5b5ecc883.js → RoomleToolsCore-791e4a0fe83ae28a.js} +1 -1
  82. package/lib/{static/shaders-cb28a06c8c799d0b.json → legacy/static/shaders-678c65760292c13b.json} +1 -1
  83. package/lib/legacy/{stats-helper-1cb19fc1.legacy.js → stats-helper-feb39215.legacy.js} +2 -2
  84. package/lib/legacy/{stats-helper-1cb19fc1.legacy.js.map → stats-helper-feb39215.legacy.js.map} +1 -1
  85. package/lib/legacy/{tools-core-70c23a24.legacy.js → tools-core-805a9c7f.legacy.js} +2 -2
  86. package/lib/legacy/tools-core-805a9c7f.legacy.js.map +1 -0
  87. package/lib/{material-viewer-a98fcbad.nomodule.js → material-viewer-38a600cf.nomodule.js} +2 -2
  88. package/lib/material-viewer-38a600cf.nomodule.js.map +1 -0
  89. package/lib/{material-viewer-3946801b.js → material-viewer-b745d62c.js} +2 -2
  90. package/lib/material-viewer-b745d62c.js.map +1 -0
  91. package/lib/material-viewer-main-0365d13a.js +2 -0
  92. package/lib/material-viewer-main-0365d13a.js.map +1 -0
  93. package/lib/material-viewer-main.nomodule.js +1 -1
  94. package/lib/{pixotron-55cd627f.js → pixotron-84f3fe97.js} +2 -2
  95. package/lib/{pixotron-55cd627f.js.map → pixotron-84f3fe97.js.map} +1 -1
  96. package/lib/{pixotron-d99a332f.nomodule.js → pixotron-dbdff274.nomodule.js} +2 -2
  97. package/lib/{pixotron-d99a332f.nomodule.js.map → pixotron-dbdff274.nomodule.js.map} +1 -1
  98. package/lib/{planner-2658b7f5.js → planner-0d26d587.js} +2 -2
  99. package/lib/{planner-2658b7f5.js.map → planner-0d26d587.js.map} +1 -1
  100. package/lib/{planner-4f9ec5be.nomodule.js → planner-ccefa90c.nomodule.js} +2 -2
  101. package/lib/{planner-4f9ec5be.nomodule.js.map → planner-ccefa90c.nomodule.js.map} +1 -1
  102. package/lib/planner-main-3c9dc382.js +2 -0
  103. package/lib/planner-main-3c9dc382.js.map +1 -0
  104. package/lib/planner-main.nomodule.js +1 -1
  105. package/lib/{roomle-configurator-5ecc9a25.nomodule.js → roomle-configurator-1c9b173b.nomodule.js} +2 -2
  106. package/lib/{roomle-configurator-5ecc9a25.nomodule.js.map → roomle-configurator-1c9b173b.nomodule.js.map} +1 -1
  107. package/lib/{roomle-configurator-c3fc80b6.js → roomle-configurator-6fe104f8.js} +2 -2
  108. package/lib/{roomle-configurator-c3fc80b6.js.map → roomle-configurator-6fe104f8.js.map} +1 -1
  109. package/lib/roomle-dependency-injection-12adbb70.js +16 -0
  110. package/lib/{roomle-dependency-injection-12caf412.js.map → roomle-dependency-injection-12adbb70.js.map} +1 -1
  111. package/lib/roomle-dependency-injection-535b53cc.nomodule.js +16 -0
  112. package/lib/{roomle-dependency-injection-5753b429.nomodule.js.map → roomle-dependency-injection-535b53cc.nomodule.js.map} +1 -1
  113. package/lib/{roomle-sdk-94e2ff55.js → roomle-sdk-da864a2d.js} +2 -2
  114. package/lib/roomle-sdk-da864a2d.js.map +1 -0
  115. package/lib/roomle-sdk.nomodule.js +1 -1
  116. package/lib/{script-loader-c8296bef.nomodule.js → script-loader-682500f5.nomodule.js} +2 -2
  117. package/lib/script-loader-682500f5.nomodule.js.map +1 -0
  118. package/lib/{script-loader-c5793b29.js → script-loader-a64acc5a.js} +2 -2
  119. package/lib/script-loader-a64acc5a.js.map +1 -0
  120. package/lib/static/ConfiguratorKernel-a5ef853db0c81167.wasm +0 -0
  121. package/lib/static/ConfiguratorKernel-ab768dabc2374c1e.js +1 -0
  122. package/lib/static/ConfiguratorKernel-ab768dabc2374c1e.js.map +1 -0
  123. package/lib/static/ConfiguratorKernelJs-d3180b4757558f07.mem +0 -0
  124. package/lib/static/ConfiguratorKernelJs-f8f05c4a926f93a6.js +147 -0
  125. package/lib/static/RoomleCore-21d3bab6ea62ed1f.wasm +0 -0
  126. package/lib/static/RoomleCore-a7a39cbf7926accc.js +1 -0
  127. package/lib/static/RoomleCore-a7a39cbf7926accc.js.map +1 -0
  128. package/lib/static/RoomleCoreJs-1c347f2376f46d6c.js +156 -0
  129. package/lib/static/RoomleCoreJs-2c6123dece4d9374.mem +0 -0
  130. package/lib/static/RoomleToolsCore-631eebe319245d3a.wasm +0 -0
  131. package/lib/static/{RoomleToolsCore-f6a3d0c5b5ecc883.js → RoomleToolsCore-791e4a0fe83ae28a.js} +1 -1
  132. package/lib/static/{RoomleToolsCore-f6a3d0c5b5ecc883.js.map → RoomleToolsCore-791e4a0fe83ae28a.js.map} +1 -1
  133. package/lib/{legacy/static/shaders-cb28a06c8c799d0b.json → static/shaders-678c65760292c13b.json} +1 -1
  134. package/lib/{stats-helper-a910b462.nomodule.js → stats-helper-2db48fe1.nomodule.js} +2 -2
  135. package/lib/{stats-helper-a910b462.nomodule.js.map → stats-helper-2db48fe1.nomodule.js.map} +1 -1
  136. package/lib/{stats-helper-841fdfb9.js → stats-helper-b5757d44.js} +2 -2
  137. package/lib/{stats-helper-841fdfb9.js.map → stats-helper-b5757d44.js.map} +1 -1
  138. package/lib/{tools-core-5babca41.nomodule.js → tools-core-a9dd13de.nomodule.js} +2 -2
  139. package/lib/tools-core-a9dd13de.nomodule.js.map +1 -0
  140. package/lib/{tools-core-987bb451.js → tools-core-f5174754.js} +2 -2
  141. package/lib/tools-core-f5174754.js.map +1 -0
  142. package/package.json +2 -2
  143. package/lib/component-dimensioning-be27c825.js.map +0 -1
  144. package/lib/component-dimensioning-e456ea8d.nomodule.js.map +0 -1
  145. package/lib/component-raycast-helper-9e82f7c8.nomodule.js.map +0 -1
  146. package/lib/component-raycast-helper-b28eb450.js.map +0 -1
  147. package/lib/configurator-de6838a4.js.map +0 -1
  148. package/lib/configurator-e0c325ce.nomodule.js.map +0 -1
  149. package/lib/configurator-main-438d3a58.js +0 -2
  150. package/lib/configurator-main-438d3a58.js.map +0 -1
  151. package/lib/continuous-drawing-helper-492c955e.nomodule.js.map +0 -1
  152. package/lib/continuous-drawing-helper-997c2fd4.js.map +0 -1
  153. package/lib/default-light-setting-08fa18a7.js.map +0 -1
  154. package/lib/default-light-setting-19127f94.nomodule.js.map +0 -1
  155. package/lib/glb-viewer-main-73ac0da3.js +0 -2
  156. package/lib/glb-viewer-main-73ac0da3.js.map +0 -1
  157. package/lib/legacy/component-dimensioning-9dbef8a8.legacy.js.map +0 -1
  158. package/lib/legacy/component-raycast-helper-3a87b75b.legacy.js.map +0 -1
  159. package/lib/legacy/configurator-d8cab2f1.legacy.js.map +0 -1
  160. package/lib/legacy/continuous-drawing-helper-fc6a4859.legacy.js.map +0 -1
  161. package/lib/legacy/default-light-setting-3211fec0.legacy.js.map +0 -1
  162. package/lib/legacy/material-viewer-0a1a8eb2.legacy.js.map +0 -1
  163. package/lib/legacy/roomle-dependency-injection-df487870.legacy.js +0 -16
  164. package/lib/legacy/script-loader-571941d9.legacy.js.map +0 -1
  165. package/lib/legacy/static/ConfiguratorKernel-b3db99d56b9f5196.wasm +0 -0
  166. package/lib/legacy/static/ConfiguratorKernelJs-131a27ea2e48bc8e.mem +0 -0
  167. package/lib/legacy/static/ConfiguratorKernelJs-66e23858ee842c75.js +0 -146
  168. package/lib/legacy/static/RoomleCore-5020f57fd0b2edd5.wasm +0 -0
  169. package/lib/legacy/static/RoomleCoreJs-4ee873a38a54dee2.js +0 -155
  170. package/lib/legacy/static/RoomleCoreJs-e9e828afe3e9d239.mem +0 -0
  171. package/lib/legacy/static/RoomleToolsCore-305c91454f11d873.wasm +0 -0
  172. package/lib/legacy/tools-core-70c23a24.legacy.js.map +0 -1
  173. package/lib/material-viewer-3946801b.js.map +0 -1
  174. package/lib/material-viewer-a98fcbad.nomodule.js.map +0 -1
  175. package/lib/material-viewer-main-4b177515.js +0 -2
  176. package/lib/material-viewer-main-4b177515.js.map +0 -1
  177. package/lib/planner-main-1791d2b5.js +0 -2
  178. package/lib/planner-main-1791d2b5.js.map +0 -1
  179. package/lib/roomle-dependency-injection-12caf412.js +0 -16
  180. package/lib/roomle-dependency-injection-5753b429.nomodule.js +0 -16
  181. package/lib/roomle-sdk-94e2ff55.js.map +0 -1
  182. package/lib/script-loader-c5793b29.js.map +0 -1
  183. package/lib/script-loader-c8296bef.nomodule.js.map +0 -1
  184. package/lib/static/ConfiguratorKernel-b3db99d56b9f5196.wasm +0 -0
  185. package/lib/static/ConfiguratorKernel-d74ac1d836436ed8.js +0 -1
  186. package/lib/static/ConfiguratorKernel-d74ac1d836436ed8.js.map +0 -1
  187. package/lib/static/ConfiguratorKernelJs-131a27ea2e48bc8e.mem +0 -0
  188. package/lib/static/ConfiguratorKernelJs-66e23858ee842c75.js +0 -146
  189. package/lib/static/RoomleCore-435f2f2c0751f8ed.js +0 -1
  190. package/lib/static/RoomleCore-435f2f2c0751f8ed.js.map +0 -1
  191. package/lib/static/RoomleCore-5020f57fd0b2edd5.wasm +0 -0
  192. package/lib/static/RoomleCoreJs-4ee873a38a54dee2.js +0 -155
  193. package/lib/static/RoomleCoreJs-e9e828afe3e9d239.mem +0 -0
  194. package/lib/static/RoomleToolsCore-305c91454f11d873.wasm +0 -0
  195. package/lib/tools-core-5babca41.nomodule.js.map +0 -1
  196. package/lib/tools-core-987bb451.js.map +0 -1
@@ -1,16 +0,0 @@
1
- System.register(["./main-thread-to-worker-185bcf70.nomodule.js"],(function(e,t){var n,i,s,o,r,a,l,h,c,d,u,_,p,g,m,f,E,w;return{setters:[function(e){n=e.a,i=e.g,s=e.M,o=e.h,r=e.R,a=e.d,l=e.s,h=e.b,c=e.c,d=e.e,u=e.r,_=e.f,p=e.w,g=e.o,m=e.i,f=e.u,E=e.j,w=e.k}],execute:function(){e({_:v,i:ie,x:Nt});class C{constructor(){this._context=new Map,this._lookups=new Map,this._singletons=new Map}getContext(e){if(this._context.has(e)){const t=this._context.get(e);return this._context.set(e,t+1),e+t}return this._context.set(e,1),e+0}addDependencyInjectionAssignments(e){e.forEach(e=>{this._lookups.set(e.className,e)})}lookup(e,t){if(!this._lookups.has(e))return null;const n=this._lookups.get(e);if(1===n.type&&void 0===t){const t="Dependency "+e+" has definition context but no context was defined!";return console.trace(t),console.error(t),null}let i=t&&1===n.type?t:"global";if(i+="_"+e,2===n.type)return new n.classDefinition;if(this._singletons.has(i))return this._singletons.get(i);const s=new n.classDefinition(t);return this._singletons.set(i,s),s}cleanUp(e){if(e){let t=[];this._singletons.forEach((n,i)=>{i.startsWith(e)&&t.push(i)}),t.forEach(e=>{this._singletons.delete(e)})}else this._singletons.clear(),this._singletons=new Map}}class y{constructor(e,t,n){this.className=e,this.classDefinition=t,this.type=void 0===n?0:n}}e("D",y);const b={JPG:".jpg",JPEG:".jpeg",PNG:".png",GIF:".gif"};class M{_base64toBlob(e,t){t=t||"";const n=atob(e),i=n.length,s=Math.ceil(i/1024),o=new Array(s);for(let e=0;e<s;++e){let t=1024*e,s=Math.min(t+1024,i);const r=new Array(s-t);for(let e=t,i=0;e<s;++i,++e)r[i]=n[e].charCodeAt(0);o[e]=new Uint8Array(r)}return new Blob(o,{type:t})}_createFormData(e,t,n,i){const s=new FormData;-1!==e.indexOf(",")&&(e=e.substr(e.indexOf(",")+1));const o=-1===Object.keys(b).map(e=>b[e]).indexOf(n)?"application":"image",r=this._base64toBlob(e,o+"/"+n.substr(1));return s.append(i,r,t+n),s}create(e,t,n,i){return this._createFormData(e,t,n,i)}}
2
- /*! *****************************************************************************
3
- Copyright (c) Microsoft Corporation.
4
-
5
- Permission to use, copy, modify, and/or distribute this software for any
6
- purpose with or without fee is hereby granted.
7
-
8
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
9
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
10
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
11
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
12
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
13
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
14
- PERFORMANCE OF THIS SOFTWARE.
15
- ***************************************************************************** */function v(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}class P{constructor(){this._size=256,this._maxLod=0,this._encoding=THREE.LinearEncoding,this._type=THREE.UnsignedByteType,this._format=THREE.RGBAFormat,this._cubeTextures=[],this._lightDirection=new THREE.Vector3,this._path=""}setPath(e){this._path=e}load(e){return new Promise(t=>{(new THREE.FileLoader).setResponseType("arraybuffer").load(this._path+e,e=>{this.parseData_(e),t(this._cubeTexture)})})}parseHeader_(e){let t=new DataView(e,0,30);this._size=t.getUint16(0),this._maxLod=t.getUint8(2),this._encoding=t.getUint16(3),this._type=t.getUint16(5),this._format=t.getUint16(7),this._lightDirection.x=t.getFloat32(9),this._lightDirection.y=t.getFloat32(13),this._lightDirection.z=t.getFloat32(17)}parseBufferData_(e,t){let n=this._size;const i=Math.log2(this._size)+1;this._cubeTextures=[];for(let s=0;s<i;s++){let i=new THREE.CubeTexture;this._cubeTextures.push(i),i.format=THREE.RGBAFormat,i.encoding=this._encoding,i.type=this._type,i.minFilter=THREE.LinearMipMapLinearFilter,i.magFilter=THREE.LinearFilter,i.generateMipmaps=!1;for(let s=0;s<6;s++){let o=new Uint8Array(e,t,4*n*n),r=new THREE.DataTexture(o,n,n);r.format=i.format,r.encoding=i.encoding,r.type=i.type,r.generateMipmaps=!1,t+=4*n*n,i.images[s]=r,r.needsUpdate=!0}i.needsUpdate=!0,n/=2}this._cubeTexture=new THREE.CubeTexture,this._cubeTexture.format=THREE.RGBAFormat,this._cubeTexture.encoding=this._encoding,this._cubeTexture.type=this._type,this._cubeTexture.minFilter=THREE.LinearMipMapLinearFilter,this._cubeTexture.magFilter=THREE.LinearFilter,this._cubeTexture.generateMipmaps=!1;for(let e=0;e<6;e++){this._cubeTexture.image[e]=this._cubeTextures[0].images[e];for(let e=1;e<i;e++)this._cubeTexture.mipmaps[e-1]=this._cubeTextures[e],this._cubeTextures[e].needsUpdate=!0}this._cubeTexture.needsUpdate=!0,this._cubeTexture.maxLod=this._maxLod-1}convertToRGBABuffer(e){let t=new Uint8Array(e,30,e.byteLength-30),n=4;this._format===THREE.RGBFormat&&(n=3);const i=4*t.length/n;let s=new ArrayBuffer(i),o=new DataView(s),r=0,a=t.length/n;if(3===n)for(let e=0;e<a;e++)o.setUint8(r++,t[e]),o.setUint8(r++,t[e+a]),o.setUint8(r++,t[e+2*a]),o.setUint8(r++,255);else for(let e=0;e<a;e++)o.setUint8(r++,t[e]),o.setUint8(r++,t[e+a]),o.setUint8(r++,t[e+2*a]),o.setUint8(r++,t[e+3*a]);return s}parseData_(e){this.parseHeader_(e);let t=30;t=0;let n=this.convertToRGBABuffer(e);this.parseBufferData_(n,0)}}const T=e("t",(function(e){return e*(Math.PI/180)})),I=e("m",(function(e){return e*(180/Math.PI)})),R=(e("U",(function(e,t,n,i,s,o){e=Math.sqrt(e*e+n*n);const r=s/o,a=2*Math.atan(Math.tan(i*Math.PI/180/2)*r)*180/Math.PI,l=T(i),h=t/2/Math.tan(l/2),c=e/(2*Math.atan(Math.PI*a/360));return Math.max(h,c)})),function(e){return Math.round(1e3*e)/1e3}),k=(e("a1",(function(e,t){return Math.abs(e.y-t.y)+Math.abs(e.x-t.x)})),e("a7",e=>new THREE.Vector3(e.x/1e3,e.z/1e3,e.y/-1e3))),x=e=>new THREE.Vector3(e.x/1e3,e.z/1e3,e.y/1e3),S=e("h",e=>({x:Math.round(1e3*e.x),y:Math.round(-1e3*e.z),z:Math.round(1e3*e.y)})),D=e=>decodeURIComponent(encodeURIComponent(e)),L=e("M",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=H(e);for(let e=0;e<t.length;e++)t[e]=L(t[e]);return"string"==typeof t?D(t):t}if("object"==typeof e)for(let t in e)e.hasOwnProperty(t)&&(e[t]=L(e[t]));return"string"==typeof e?D(e):e}),H=e=>{let t=[];if(e){let n=e.size();for(let i=0;i<n;i++)t.push(e.get(i))}return t},O=e=>{let t=new THREE.Matrix4,n=L(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)},A=(e("j",(e,t,n,i)=>{if(!e||!t||0===n||0===i)return new THREE.Vector3;let s=e.clone(),o=n/2,r=i/2;return s.project(t),s.x=Math.floor(s.x*o+o),s.y=Math.floor(-s.y*r+r),s.z=e.distanceTo(t.position),s}),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),i=new THREE.Vector3(e.origin.x/1e3,e.origin.z/1e3,e.origin.y/-1e3),s=new THREE.Vector3(0,0,-n.z).add(i).sub(t),o=new THREE.Vector3(n.x,n.y,0).add(i).add(t);return new THREE.Box3(s,o)}));e("O",(e,t)=>{let n=R(e.x),i=R(e.y),s=R(e.z),o=R(t.x),r=R(t.y),a=R(t.z);return n===o&&i===r&&s===a}),e("a0",(e,t)=>{let n=R(e.w),i=R(e.x),s=R(e.y),o=R(e.z),r=R(t.w),a=R(t.x),l=R(t.y),h=R(t.z);return n===r&&i===a&&s===l&&o===h}),e("Q",(e,t)=>{let n=R(e.x),i=R(e.y),s=R(t.x),o=R(t.y);return n===s&&i===o});let U=null;const j=()=>{if(U)return U;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},B=(e,t,n,i)=>{const s=new Uint8Array(4),o=Math.floor(255*e),r=Math.floor(255*t),a=Math.floor(255*n),l=Math.floor(255*i);for(let e=0;e<4;e++){const t=4*e;s[t]=o,s[t+1]=r,s[t+2]=a,s[t+3]=l}const h=new THREE.DataTexture(s,1,1,THREE.RGBAFormat);return h.needsUpdate=!0,h},F=e("Z",(e,t)=>V(null,e,t)),V=e("aj",(e,t,i)=>{if(e||(e=G()),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==i||i.setEnvMap(e),t.shading.doubleSided?e.side=THREE.DoubleSide:e.side=THREE.FrontSide,e.map||(U||(U=j()),e.map=U),e}),G=()=>new THREE.MeshPhysicalMaterial({});e("ak",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;const z=e("$",(e,t,n,i,s,o,r=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=>{W(e,t,n,i,s,o,r),a()},l)}))),W=e("al",(e,t,n,i,s,o,r=16)=>{e.anisotropy=i,e.wrapS=THREE.RepeatWrapping,e.wrapT=THREE.RepeatWrapping,"ORM"===t.mapping&&r<=8?console.warn("ORM maps are not supported on devices with only "+r+" texture units"):(e.repeat.set(s,o),"XYZ"===t.mapping?(n.normalMap=e,n.map===j()&&(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)}),N=(e("l",(e=!0)=>window.dat&&window.dat.GUI?(window.__RML_GUI__||(window.__RML_GUI__=new dat.GUI({autoPlace:e})),window.__RML_GUI__):null),e("aa",(e,t)=>{for(const n of t){const t=n.getKernelObject();let i;if(2===t.wallType.value&&(i=k(t.rightNormal)),1===t.wallType.value&&(i=k(t.leftNormal)),!i)continue;let s=k(n.getPlanElement().getCenter());s=s.applyMatrix4(e.matrixWorldInverse),i=i.transformDirection(e.matrixWorldInverse),s.dot(i)>=0?n.show():n.isSelected||n.hide()}}),e("ab",(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}),e("a5",(e,t)=>{e.traverse(e=>{if(e instanceof THREE.Mesh&&TWEEN){const n=e.material;e.userData.tween&&e.userData.tween.stop();const i={opacity:n.opacity};t.transparent&&(n.transparent=t.transparent),e.userData.tween=new TWEEN.Tween(i).to(t,250).easing(TWEEN.Easing.Linear.None).onUpdate(()=>{n.opacity=i.opacity}).onStop(()=>{t.transparent||(n.transparent=t.transparent),n.opacity=t.opacity,n.needsUpdate=!0,e.userData.tween=void 0}).onComplete(()=>{t.transparent||(n.transparent=t.transparent),n.needsUpdate=!0,e.userData.tween=void 0}).start()}})}),e("Y",e=>{e.traverse(e=>{if(e instanceof THREE.Mesh&&TWEEN){let t=e.material;if(0===t.opacity)return;let n={opacity:0,transparent:!0},i={opacity:t.opacity,transparent:t.transparent};t.transparent=n.transparent,t.opacity=n.opacity,new TWEEN.Tween(n).to(i,500).easing(TWEEN.Easing.Linear.None).onUpdate(()=>{t.opacity=n.opacity}).onComplete(()=>{t.transparent=i.transparent}).start()}})})),q=e("u",e=>{"Mesh"===e.type?X(e):J(e)}),J=e=>{e&&e.children&&0!==e.children.length&&e.children.forEach(e=>{X(e)})},X=e("g",e=>{e&&(e.material&&Q(e.material),e.geometry&&Y(e.geometry),e.children&&e.children.length>0&&J(e))}),Y=e=>{e&&e.dispose()},Q=e=>{e&&(e.map&&e.map.dispose(),e.normalMap&&e.normalMap.dispose(),e.dispose())};let $;e("v",e=>0===e.x&&0===e.y&&0===e.z);const Z=(e,t)=>{let n="";return e||""===e?(e.materialId&&""!==e.materialId?n=e.materialId:e.catalogItemId&&""!==e.catalogItemId?n=e.catalogItemId:e.rgbValue>0?n="rgb"+JSON.stringify(e.rgbValue):e.length>0?n=e:t&&1===t.value?n="default_wall_material_"+e.getSourceType().value:t&&7===t.value&&(n="default_ceiling_material_"+e.getSourceType().value),n):null},ee=(e("X",(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("w",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}),e("T",(e,t)=>{if(!e||!t)return 0;const n=e.clone().expandByScalar(.001).containsBox(t),i=t.clone().expandByScalar(.001).containsBox(e);return i&&n||!i&&!n?0:!0===n?1:-1}),e("ac",(e,t,n,i=1)=>{const s=t>n,o=s?15:0,r=s?0:10,a=e.getSize(new THREE.Vector3),l=e.getCenter(new THREE.Vector3);let h=a.x>2*o?a.x/2:o,c=a.z>2*r?a.z/2:r;return h*=i,c*=i,new THREE.Box3(new THREE.Vector3(l.x-h,l.y,l.z-c),new THREE.Vector3(l.x+h,l.y,l.z+c))}),e("a8",e=>{const{x:t,y:n}=e;return{x:t,y:n}})),te=e=>{const{x:t,y:n,z:i}=e;return{x:t,y:n,z:i}},ne=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 ie(e,t){const n=Symbol("property-cache");Object.defineProperty(e,t,{get(){if(!this[n]){const e=window.__RML__DI__.lookup(ne(t),this._creator_);e?this[n]=e:console.error("Dependency "+ne(t)+" not found! Add dependency to /utils/injectables.ts")}return this[n]}})}class se{static setEnvironmentMap(e,t){e&&t&&(e.envMap=t,e.envMapIntensity=1,e.needsUpdate=!0)}constructor(e){this._hdrCubeUrl="static/roomle-91862a5e7f3f46e5.envmap",this._hdrCubeUrlLowres="static/roomle64-adb0f447a54b5143.envmap",this._envMapReader=new P,this._onEnvMapUpdate=[],this._creator_=e;const t=new THREE.Color("#DDDDDD");this._environmentMap=((e,t,n,i)=>{const s=new THREE.CubeTexture;s.format=THREE.RGBAFormat,s.generateMipmaps=!1;for(let i=0;i<6;++i){const o=B(e,t,n,1);o.format=s.format,o.type=s.type,o.minFilter=s.minFilter,o.magFilter=s.magFilter,o.generateMipmaps=s.generateMipmaps,o.needsUpdate=!0,s.images[i]=o}return s.needsUpdate=!0,s})(t.r,t.g,t.b),this._envMapReader.setPath(i()),this._loadHDREnvMap(this._hdrCubeUrlLowres)}getEnvironmentMap(){return this._environmentMap}_processPMREM(e){const t=new THREE.PMREMGenerator(this._renderer);let n=t.fromCubemap(e);return e.magFilter=THREE.LinearFilter,e.needsUpdate=!0,t.dispose(),n.texture}_loadHDREnvMap(e){return this._initData.disableEnvMap?Promise.resolve():new Promise(t=>{this._envMapReader.load(e).then(n=>{n.encoding=THREE.sRGBEncoding;const i=this._renderer.extensions.get("EXT_shader_texture_lod");this._environmentMap=i?this._processPMREM(n):n,e!==this._hdrCubeUrl&&(this._environmentMap.encoding=THREE.sRGBEncoding,window.requestIdleCallback(this._loadHDREnvMap.bind(this,this._hdrCubeUrl))),this._updateEnvironmentMap(),t(),this._envChangedCallback&&this._envChangedCallback()})})}setRendererAndScene(e,t){this._renderer=e,this._scene=t}registerEnvironmentChangedCallback(e){this._envChangedCallback=e}_updateEnvironmentMap(){this._initData.disableEnvMap||(this._scene.traverse(e=>{e instanceof THREE.Mesh&&(e.material instanceof THREE.MeshStandardMaterial||"MeshPhysicalMaterial"===e.material.type)&&se.setEnvironmentMap(e.material,this._environmentMap)}),this._onEnvMapUpdate.forEach(e=>e()),this._onEnvMapUpdate=[])}onEnvMapUpdate(e){this._onEnvMapUpdate.push(e)}setEnvMap(e){this._initData.disableEnvMap||se.setEnvironmentMap(e,this.getEnvironmentMap())}}e("an",se),v([ie],se.prototype,"_initData",void 0);const oe=e("s",{SOFA:"sofa",SHELF:"shelf",SHELF_FRONT:"shelf_front",BAKED:"baked",CAMERA:"camera",EQUAL:"equal"});class re{static createDynamicLightSettingSource(e,t){let n={};if(e)n.url=e;else if(t)switch(t){case oe.SHELF:n.url=i()+"static/shelf-2975dd3f2fa9c763.json";break;case oe.SHELF_FRONT:n.url=i()+"static/shelf_front-8c9566a4512f0de8.json";break;case oe.SOFA:n.url=i()+"static/sofa-997b116bc5f2e92e.json";break;case oe.BAKED:n.url=i()+"static/baked-6485a2b1daeb69e8.json";break;case oe.CAMERA:n.url=i()+"static/camera-05824b47cdb951e4.json";break;case oe.EQUAL:n.url=i()+"static/equal-319f6b83c827913f.json";break;default:n.url=i()+"static/camera-05824b47cdb951e4.json"}else n=null;return n}parse(e){let t=JSON.parse(e);return t.lights?this.load(t):[]}load(e){let t=[];return e.lights?(e.lights.forEach(e=>{let n;switch(e.type){case"ambient":n=this._parseAmbientLight(e);break;case"rectarea":n=this._parseRectAreaLight(e);break;case"spot":n=this._parseSpotLight(e);break;case"directional":n=this._parseDirectionalLight(e)}n&&t.push(n)}),t):[]}_parseAmbientLight(e){let t=new THREE.AmbientLight;return this._parseCommon(t,e),t}_parseRectAreaLight(e){let t=new THREE.RectAreaLight;this._parseCommon(t,e);let{intensity:n,castShadow:i,target:s,width:o,height:r}=e;return t.width=o||.8,t.height=r||.8,t.castShadow=i||!1,t.matrixAutoUpdate=!0,t.intensity=(n||240)/((o||.8)*(r||.8)),t.lookAt(s?new THREE.Vector3(s.x,s.y,s.z):new THREE.Vector3(0,0,0)),t}_parseSpotLight(e){let t=new THREE.SpotLight;this._parseCommon(t,e);let{angle:n,penumbra:i,target:s,castShadow:o}=e;return t.angle=(n||100)*Math.PI/180,t.penumbra=i||.5,t.lookAt(s?new THREE.Vector3(s.x,s.y,s.z):new THREE.Vector3(0,0,0)),t.shadow.camera.near=.1,t.shadow.camera.far=10,t.shadow.mapSize=new THREE.Vector2(1024,1024),t.castShadow=o||!1,t}_parseDirectionalLight(e){let t=new THREE.DirectionalLight;this._parseCommon(t,e);let{target:n,castShadow:i}=e;return t.castShadow=i||!1,t.shadow.camera.near=.1,t.shadow.camera.far=100,t.shadow.mapSize=new THREE.Vector2(1024,1024),t.shadow.bias=-5e-5,t.lookAt(n?new THREE.Vector3(n.x,n.y,n.z):new THREE.Vector3(0,0,0)),t}_parseCommon(e,t){let{name:n,intensity:i,color:s,position:o,movesWithCamera:r}=t;e.name=n||"",e.intensity=i||1,e.color=new THREE.Color(s||"#ffffff"),e.position.copy(o?new THREE.Vector3(o.x,o.y,o.z):new THREE.Vector3(0,0,0)),e.visible=!0,e.layers.set(1),e.userData.movesWithCamera=r}}e("r",re);const ae=["127.0.0.1","localhost","0.0.0.0"],le=(e("G",(function(e){return!(!e||"string"!=typeof e||e.split(":").length>2)})),e("z",e=>{if(!e||"string"!=typeof e)return null;const t=e.split(":");return t.length<2?null:t[0]})),he=({articleNr:e,componentId:t})=>e&&""!==e?t.split(":")[0]+":"+e:null,ce=(e,t)=>null!=e?"string"==typeof e?"true"===e:!0===e:("string"==typeof t&&(t=parseInt(t,10)),t>=200&&t<300);class de{constructor(){this._queue=[],this._pendingRequests=0}_nextSlot(){if(this._pendingRequests-=1,!this._queue.length)return;const{request:e,resolve:t,reject:n}=this._queue.shift();this._fetch(e).then(t,n)}_fetch(e,t={},n={}){return this._pendingRequests+=1,new Promise((i,s)=>{self.fetch(e,t).then(async function(e){this._nextSlot();const t=!n.checkResponse||!1!==await n.checkResponse(e);if(ce(e.ok,e.status)&&t)i(...arguments);else{const t=(null==e?void 0:e.url)||"URL unknown";s(new Error(e.statusText||'Http error "'+(e&&e.status?e.status:"unknown")+'", for "'+t+'"'))}}.bind(this),e=>{this._nextSlot(),s(e)})})}fetch(e,t={},n={}){return this._pendingRequests>=40?new Promise((t,n)=>this._queue.push({request:e,resolve:t,reject:n})):this._fetch(e,t,n)}}class ue{info(...e){console}log(...e){console}warn(...e){console.warn.apply(console,e)}error(...e){console.warn.apply(console,e)}}e("L",ue);class _e extends ue{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)}}v([ie],_e.prototype,"_globalCallback",void 0);const pe=new Map,ge=new Map,me=new Map,fe=new Map;class Ee{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(()=>{fe.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&&!me.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(()=>{me.set(e,!0),n()},e=>this._softReject(n,'_syncFloorTag error: "'+e+'"'))})):Promise.resolve()}_syncTypeChangeTag(e){const t=[];return e&&!fe.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(()=>{me.set(e,!0),n()},e=>this._softReject(n,'_syncTypeChangeTag error: "'+e+'"'))})):Promise.resolve()}getIsCatalogSynced(e){return!!ge.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(i()+"static/asset-loader.worker-d8f85c01953acd85.js"),this._mainThreadToWorker=new s(this,this._worker),this._isStarting=!0,this._mainThreadToWorker.sendToWorker(1))})}onCommand(e,t,n){switch(e){case 4:this._isStarted=!0,this._bootCallbacks.forEach(({resolve:e})=>e());break;case 3:this._mainThreadToWorker.resolvePromises(t,n)}}_handleCatalog(e){return this._singlePromiseFactory.create(0,e,t=>this.getIsCatalogSynced(e)?t():this._rapiAccess.getCatalog(e).then(e=>Promise.all([this._handleContentWithAssets(this._rapiAccess.getComponentsOf(e),["perspectiveImage"]),this._handleItemsAndAdditionalContents(e),this._handleMaterialsAndTextures(e),this._handleExternalMeshes(e),this._handleTags(e.tags)])).then(()=>{ge.set(e,!0),t()},e=>this._softReject(t,'Catalog sync error: "'+e+'"')))}_handleTags(e){return this._handleContentWithAssets(this._rapiAccess.getTags(e),["pngIcon","svgIcon"])}_handleExternalMeshes(e){return new Promise(t=>{this._rapiAccess.getMeshesOfCatalog(e.id).then(e=>{const n=[];e.forEach(e=>{n.push(this._handleContentWithAssets(Promise.all([this._rapiAccess.getMesh(e.id)]),["url"]))}),Promise.all(n).then(t,e=>this._softReject(t,'Sync crt files error: "'+e+'"'))},e=>this._softReject(t,'getMeshesOfCatalog error: "'+e+'"'))})}_handleItemsAndAdditionalContents(e){return new Promise(t=>{this._rapiAccess.getItemsOf(e).then(e=>{const n=[];n.push(this._handleContentWithAssets(Promise.resolve(e),["perspectiveImage"])),this._rapiAccess.getAdditionalContentsOfItems(e).then(e=>{const t=e.filter(e=>-1!==[5,6,4].indexOf(e.type));n.push(this._handleContentWithAssets(Promise.resolve(t),["content"]))},e=>this._softReject(t,'getAdditionalContentsOfItems error: "'+e+'"')),Promise.all(n).then(t,e=>this._softReject(t,'AdditionalContent image sync error:"'+e+'"'))})})}_handleMaterialsAndTextures(e){return new Promise(t=>{this._rapiAccess.getMaterialsOf(e).then(e=>{const n=[];n.push(this._handleContentWithAssets(Promise.resolve(e),["thumbnail"])),e.forEach(e=>{n.push(this._handleContentWithAssets(this._rapiAccess.getTexturesOf(e),["image"]))}),Promise.all(n).then(t,e=>this._softReject(t,'getTexturesOf error: "'+e+'"'))},e=>this._softReject(t,'getMaterialsOf error: "'+e+'"'))})}_handleContentWithAssets(e,t){return new Promise(n=>e.then(e=>this._fetchAssets(e,t).then(n,e=>this._softReject(n,'_handleContentWithAssets error: "'+e+'"')),e=>this._softReject(n,'_handleContentWithAssets promise error: "'+e+'"')))}_fetchAssets(e,t){const n=[];e||(e=[]);for(let i=0,s=e.length;i<s;i++){const s=e[i];t.forEach(e=>{const t=s[e];t&&n.push(this._preCacheAsset(t))})}return Promise.all(n)}_preCacheAsset(e){return new Promise(t=>{if(pe.get(e))return t();this._assetUrlToBase64(e).then(n=>{pe.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:pe.get(e)||(t?e:null)}setAlwaysUseCache(e){this._alwaysUseCache=e}preFillAssetCache(e,t){pe.set(e,t)}}e("a",Ee),v([ie],Ee.prototype,"_rapiAccess",void 0),v([ie],Ee.prototype,"_singlePromiseFactory",void 0),v([ie],Ee.prototype,"_errorHandler",void 0),v([ie],Ee.prototype,"_configuratorUiCallbacks",void 0),v([ie],Ee.prototype,"_initData",void 0);class we{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("V",we);var Ce=e("af","static/GLTFLoader-5b296b5fb14cfe1a.js"),ye=e("ag","static/DRACOLoader-5edeeab4a8dbc0bd.js");const be={"draco_wasm_wrapper.js":"static/draco_wasm_wrapper-d775f9f135cb30ff.js","draco_decoder.wasm":"static/draco_decoder-979e668167e37c95.wasm","draco_decoder.js":"static/draco_decoder-3866672a1fa2f980.js"};class Me{constructor(e){if(this._gltfLoaderGuard=new we,this._creator_=e,THREE.GLTFLoader&&THREE.DRACOLoader)this._initLoaders();else{let e=this._scriptLoader.fetch(Ce,{id:"gltf-loader"}),t=this._scriptLoader.fetch(ye,{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 s=be[e];if(!s)throw new Error('Can not load draco dependency "'+e+'" did three.js update DracoLoader lib? Available files'+JSON.stringify(be));return t(i()+s,n)},this._gltfLoader.setDRACOLoader(e),this._gltfLoaderGuard.resolve(this._gltfLoader)}async loadGLB(e,t,n,i,s,o,r,a){return await this._gltfLoaderGuard.wait(),new Promise((l,h)=>{this._gltfLoader.load(e,e=>{l(this._handleGLTFScene("GLB",e,t,n,i,s,o,r))},e=>{a&&a(e.loaded/e.total)},e=>{h(e)})})}async loadGLTF(e,t,n,i,s,o,r,a){return await this._gltfLoaderGuard.wait(),new Promise((l,h)=>{this._gltfLoader.parse(e,null,e=>{l(this._handleGLTFScene("GLTF",e,t,n,i,s,o,r))},e=>{a&&a(e.loaded/e.total)},e=>{h(e)})})}_handleGLTFScene(e,t,n,i,s,o,r,a){if(!t||!t.scene||!t.scene.children||0===t.scene.children.length)return null;n&&t.scene.position.copy(n),i&&(t.scene.rotation.y=i);const l=new THREE.Box3;if(l.setFromObject(t.scene),s){const{x:e,y:n,z:i}=l.getSize(new THREE.Vector3);let o=new THREE.Vector3(s.x/e,s.y/n,s.z/i);t.scene.scale.copy(o)}return o&&t.scene.scale.multiply(o),t.scene.type=e,t.scene.traverse(e=>{if(e instanceof THREE.Mesh){if(e.layers.set(3),e.material instanceof THREE.MeshStandardMaterial){const t=e.material;if(this._environmentLoader.setEnvMap(t),a&&r&&r>0){let e=new THREE.Color(r);t.color=e.copyGammaToLinear(e),t.roughness=.5,t.metalness=.1}t.needsUpdate=!0}e.castShadow=!0,e.receiveShadow=!0}}),{boundingBox:l,scene:t.scene}}}v([ie],Me.prototype,"_environmentLoader",void 0),v([ie],Me.prototype,"_scriptLoader",void 0);class ve{constructor(e){this._jsonLoaded=!1,this._creator_=e}_loadShaders(){return new Promise((e,t)=>{if(this._jsonLoaded)return e();this._networkLayer.fetch(i()+"static/shaders-cb28a06c8c799d0b.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-750136f8399d9f72.js",{id:"three-lib"}).then(e,t)},t))}}v([ie],ve.prototype,"_scriptLoader",void 0),v([ie],ve.prototype,"_networkLayer",void 0);class Pe{constructor(e){this._context_=e}getStore(e="rml_default"){return this._localStorage.getItem(e)||{entries:[]}}saveStore(e,t){this._localStorage.setItem(e,t)}addItem(e,t,n="rml_default",i=5){const s=this.getStore(n),o=s.entries.find(t=>t.id===e);if(o?(o.payload=t,o.date=Date.now()):s.entries.push({id:e,date:Date.now(),payload:t}),s.entries.length>i)for(s.entries.sort((e,t)=>t.date-e.date);s.entries.length>i;)s.entries.pop();this.saveStore(n,s)}getItem(e,t="rml_default"){const n=this.getStore(t).entries.find(t=>t.id===e);return n?n.payload:null}}v([ie],Pe.prototype,"_localStorage",void 0);class Te{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("a4",Te);const Ie=e("e",{CAMERA_2D:"2D",CAMERA_3D:"3D",CAMERA_FP:"FP"});e("a3",e=>{if(!e)return Ie.CAMERA_3D;let t=e.toUpperCase();return-1===Object.values(Ie).indexOf(t)&&(t=Ie.CAMERA_3D),t});class Re{constructor(e){this.autoQuality=!0,this.colors=r,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.restrictionLevel=0,this.dls=null,this.ls=null,this.cameraSpacing=0,this.transparentHighlighting=!0,this.featureFlags={pulsePreview:!1,reDock:!1},this.mode=Ie.CAMERA_3D,this.edit=!1,this.moc=!1,this._creator_=e}setOverrides(e){a(this,e)}}e("ar",Re);const ke=["language","browserLanguage","userLanguage","systemLanguage"];e("a6",/^((?!chrome|android).)*safari/i.test(navigator.userAgent));class xe{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=ke.length;e<n;e++){const n=t[ke[e]];if(n)return n.substr(0,2)}return"en"})()||"en",this.overrideCountry=null,this._creator_=e}setOverrides(e){a(this,e)}}e("aq",xe);class Se{_setMute(e){l(this,"_isMute",!0),this._isMute=e,l(this,"_isMute",!1)}mute(){this._setMute(!0)}unmute(){this._setMute(!1)}constructor(e){return this._isMute=!1,this.cameraStartsMoving=()=>{},this._creator_=e,h(this,"_isMute",{enumerable:!1,writable:!1}),h(Se.prototype,"_setMute",{enumerable:!1,writable:!1}),h(Se.prototype,"mute",{enumerable:!1,writable:!1}),h(Se.prototype,"unmute",{enumerable:!1,writable:!1}),new Proxy(this,this)}get(e,t){return this._isMute&&"function"==typeof this[t]&&"on"===t.substr(0,2)?()=>{}:this[t]}}e("am",Se);class De extends Se{constructor(){super(...arguments),this.onNetworkRequest=(e,t,n)=>{},this.onKernelMsg=(e,t,n={})=>{},this.onCheckExternalCache=async(e,t)=>Promise.resolve(null),this.onValidateNetworkResponse=(e,t)=>Promise.resolve(!0)}}e("ap",De),e("n",{HSC:"rml-configurator",HSP:"rml-hsp",GLB:"rml-glb",RMV:"rml-mv"});class Le{get element(){return this._container}constructor(e){this._creator_=e,this._lifeCycleManager.addEventListener(this)}setDomElement(e){if(!this._container){this._container=document.createElement("div"),this._container.classList.add("rml-threejs-canvas-container"),this._container.setAttribute("ondragover","return false"),this._container.style.position="relative",this._container.style.width="100%",this._container.style.height="100%";const t=document.createElement("style");t.innerText=".rml-threejs-canvas-container canvas{position:absolute;top:0;left:0;right:0;bottom:0;z-index:100; opacity:1;}",this._container.appendChild(t),e.appendChild(this._container)}this._element=e}getClientDimensions(){return new THREE.Vector2(this._element.clientWidth,this._element.clientHeight)}_removeDomElement(e){if(!e)return;const t=e.parentElement;t&&t.removeChild(e)}reset(){this._element=null,this._removeDomElement(this._container),this._container=null}pause(){this.reset()}resume(){}destroy(){}}v([ie],Le.prototype,"_lifeCycleManager",void 0),e("at",class{constructor(e){this._creator_=e}setScene(e){}setUiScene(e){}updateBounds(e){}clearScene(e,t){}moveCameraEnd(e){}moveCameraStart(e){}needsUiScene(){return!1}});class He{constructor(e){this._plugins=[],this._creator_=e}async init(e,n,i){this._scene=e,this._uiScene=n,this._cameraPosition=i;const{bananaForScale:s}=this._initData;s&&await t.import("./banana-for-scale-f99d7647.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)}}v([ie],He.prototype,"_initData",void 0);class Oe{constructor(e,t){this._waitingPromises=[],this._finishPromiseExecutor=[],this._errorCallback=()=>{},Promise.allSettled=Promise.allSettled||(e=>Promise.all(e.map(e=>e.then(e=>({status:"fulfilled",value:e})).catch(e=>({status:"rejected",reason:e}))))),e&&this.registerCallback(e),t&&(this._errorCallback=t)}push(e){this._waitingPromises.push(e),Promise.all(this._waitingPromises).then(e=>{e.length===this._waitingPromises.length&&(this._callback&&this._callback(e),this._waitingPromises=[])},this._errorCallback)}finished(e=!1){return new Promise((t,n)=>{this._finishPromiseExecutor.push({resolve:t,reject:n});const i=e?"allSettled":"all";Promise[i](this._waitingPromises).then(e=>{if("allSettled"===i){const t=[];e.forEach(({value:e,status:n})=>{"fulfilled"===n&&t.push(e)}),this._resolveAllExecutors(t)}else this._resolveAllExecutors(e)},e=>{this._rejectAllExecutors(e)})})}registerCallback(e){this._callback=e}unregisterCallback(){this._callback=null}_resolveAllExecutors(e){this._finishPromiseExecutor.forEach(({resolve:t})=>t(e)),this._finishPromiseExecutor=[]}_rejectAllExecutors(e){this._finishPromiseExecutor.forEach(({reject:t})=>t(e)),this._finishPromiseExecutor=[]}clear(){const e=this._waitingPromises.length>0;this._waitingPromises=[],e?this._rejectAllExecutors(new Error("Promise queue has been cleared")):this._resolveAllExecutors([])}get length(){return this._waitingPromises.length}}class Ae{constructor(e){this.materialQueue=new Oe,this._geometryComponentMaterialCache=new Map,this._maxAnisotropy=1,this._maxTextures=16,this._textureLoader=new THREE.TextureLoader,this._configuratorPreviewMaterial=new THREE.MeshStandardMaterial({color:"#DDDDDD",transparent:!0,opacity:1,roughness:1,envMap:null}),this._creator_=e,this._previewMaterial=new THREE.MeshStandardMaterial({color:"#DDDDDD",roughness:1,metalness:0}),this._environmentLoader.setEnvMap(this._previewMaterial)}getGeometry(e){return e&&this._cacheHolder.geometryCache.has(e)?this._cacheHolder.geometryCache.get(e):null}_generateGeometry(e,t,n,i,s){let o;return e&&this._cacheHolder.geometryCache.has(e)?o=this._cacheHolder.geometryCache.get(e):(o=new THREE.BufferGeometry,o.setIndex(new THREE.Uint32BufferAttribute(n,1)),o.setAttribute("position",new THREE.Float32BufferAttribute(t,3)),o.setAttribute("normal",new THREE.Float32BufferAttribute(s,3)),o.setAttribute("uv",new THREE.Float32BufferAttribute(i,2)),o.scale(.001,.001,.001),o.rotateX(-Math.PI/2),e&&this._cacheHolder.geometryCache.set(e,o)),o}changeMaterialOfMesh(e,t,n){e&&t?(e.material=t,e.material.transparent||0===e.material.opacity||e.material.transmission>0?(e.castShadow=!1,e.receiveShadow=!1):(e.castShadow=!0,e.receiveShadow=!0),e.material.needsUpdate=!0,this._materialLoaded&&this._materialLoaded(t),this._updateMaterialProperties(e,n)):console.warn("could not assign material to mesh",{mesh:e},{material:t})}_updateMaterialProperties(e,t){var n;if(e.userData.materialAttributes=t,t&&e.material instanceof THREE.MeshStandardMaterial){const i=e.material.clone();i.userData.materialAttributes=t,t.color&&(i.color=new THREE.Color(t.color)),t.alpha&&(i.opacity=parseFloat(t.alpha)),t.roughness&&(i.roughness=parseFloat(t.roughness)),t.metallic&&(i.metalness=parseFloat(t.metallic)),i instanceof THREE.MeshPhysicalMaterial&&t.transmission&&(i.transmission=parseFloat(t.transmission)),i.transparent=i.opacity<1;const s=e.material;e.material=i,(null===(n=s.userData)||void 0===n?void 0:n.materialAttributes)&&s.dispose()}}_createMaterial(e,t,n,i,s){if(this._cacheHolder.materialCache.has(e))t();else if(e.startsWith("benchmarkMaterial")){let o=c(e),r=F(o,this._environmentLoader);this._loadBenchmarkTextures(o,r,i,s).then(t,n)}else this._rapiAccess.getMaterial(e).then(e=>{let o=F(e,this._environmentLoader);this._loadTextures(e,o,i,s).then(t,n)},n)}_loadBenchmarkTextures(e,t,n=1,i=1){return new Promise((s,o)=>{const r=d(e.id);z(this._dataSyncer.requestAsset(r.image,!0),r,t,this._maxAnisotropy,n/(0===r.mmWidth?1:r.mmWidth),i/(0===r.mmHeight?1:r.mmHeight),this._maxTextures).then(()=>{this._cacheHolder.materialCache.set(e.id,t),s()},o)})}_loadTextures(e,t,n=1,i=1){return new Promise((s,o)=>{if(!e.textures||e.textures&&0===e.textures.length)return this._cacheHolder.materialCache.set(e.id,t),s();this._rapiAccess.getTexturesOf(e).then(r=>{let a=[];r.forEach(e=>{a.push(z(this._dataSyncer.requestAsset(e.image,!0),e,t,this._maxAnisotropy,n/(0===e.mmWidth?1:e.mmWidth),i/(0===e.mmHeight?1:e.mmHeight),this._maxTextures))}),Promise.all(a).then(()=>{this._cacheHolder.materialCache.set(e.id,t),s()},o)})})}_loadMaterial(e,t,n){return new Promise((i,s)=>{this._singlePromiseFactory.create(6,e,(i,s)=>this._createMaterial(e,i,s,t,n)).then(()=>{setTimeout(()=>i(this._cacheHolder.materialCache.get(e)),0)},s)})}_assignMaterial(e,t,n){return this._cacheHolder.materialCache.has(t)?(this.changeMaterialOfMesh(e,this._cacheHolder.materialCache.get(t),n),Promise.resolve()):new Promise((i,s)=>{this._loadMaterial(t).then(s=>{e.userData.materialId===t&&this.changeMaterialOfMesh(e,s,n),i()},s)})}get maxAnisotropy(){return this._maxAnisotropy}set maxAnisotropy(e){this._maxAnisotropy=e}get maxTextures(){return this._maxTextures}set maxTextures(e){this._maxTextures=e}clear(){this._cacheHolder.clear()}_assignRGB(e,t){return new Promise(n=>{let i,s="rgb"+JSON.stringify(t);this._cacheHolder.materialCache.has(s)?i=this._cacheHolder.materialCache.get(s):(i=new THREE.MeshStandardMaterial({color:t}),this._environmentLoader.setEnvMap(i),this._cacheHolder.materialCache.set(s,i)),this.changeMaterialOfMesh(e,i),setTimeout(()=>n(),0)})}_assignItem(e,t){return new Promise((n,i)=>{if(this._cacheHolder.materialCache.has(t))return this.changeMaterialOfMesh(e,this._cacheHolder.materialCache.get(t)),void n();this._rapiAccess.getItem(t).then(s=>{if(s.topImage)this._textureLoader.load(s.topImage,i=>{i.anisotropy=this._maxAnisotropy,i.wrapS=THREE.RepeatWrapping,i.wrapT=THREE.RepeatWrapping;let o=new THREE.Vector2(1,1);s.width>0&&(o.x=1/s.width),s.depth>0&&(o.y=1/s.depth),i.repeat.set(o.x,o.y);const r=new THREE.MeshPhysicalMaterial({map:i,roughness:.5,metalness:.1});this._environmentLoader.setEnvMap(r),this._cacheHolder.materialCache.set(t,r),this.changeMaterialOfMesh(e,r),setTimeout(()=>n(),0)});else{const e="can not set material, catalog item top image is not set";console.warn(e),i(e)}},i)})}setMaterialLoadedListener(e){this._materialLoaded=e}removeMaterialLoadedListener(){this._materialLoaded=void 0}_createMesh(e,t,n){if(e&&t){const i=this._getComponentMeshId(e,t);if(this._geometryComponentMaterialCache.has(i)){const e=this._geometryComponentMaterialCache.get(i);if(this._cacheHolder.materialCache.has(e)){const t=this._cacheHolder.materialCache.get(e);return new THREE.Mesh(n,t)}}}return new THREE.Mesh(n,this._configuratorPreviewMaterial.clone())}_getComponentMeshId(e,t){return e+"_"+t}}v([ie],Ae.prototype,"_rapiAccess",void 0),v([ie],Ae.prototype,"_environmentLoader",void 0),v([ie],Ae.prototype,"_dataSyncer",void 0),v([ie],Ae.prototype,"_singlePromiseFactory",void 0),v([ie],Ae.prototype,"_cacheHolder",void 0),v([ie],Ae.prototype,"_plannerMeshGenerator",void 0);class Ue extends Ae{constructor(e){super(e),this._environmentLoader.setEnvMap(this._configuratorPreviewMaterial)}generateMesh(e=0,t=null,n,i,s,o,r,a=!1,l){let h;h=a?this._generateGeometry(t,i,s,o,r).clone():this._generateGeometry(t,i,s,o,r);const c=this._createMesh(e,t,h);return c.userData.materialId=n,c.layers.set(4),n&&this.materialQueue.push(this._assignMaterial(c,n,l).then(()=>{e&&t&&this._geometryComponentMaterialCache.set(this._getComponentMeshId(e,t),n)})),c}setMaterial(e,t,n,i){return this._assignMaterial(e,t,i)}loadMaterial(e,t,n){return super._loadMaterial(e,t,n)}loadTextures(e,t,n,i){return super._loadTextures(e,t,n,i)}}e("ao",Ue);class je{constructor(){this._listeners={},this._disabled=!1}_addEventListener(e,t,n){this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push({callback:t,scope:n})}addEventListener(e,t,n){this._addEventListener(e,t,n)}dispatchEvent(e,t){if(!this._listeners[e]||this._disabled)return;const n=this._listeners[e];let i=n.length;for(let e=0;e<i;e++){const i=n[e];t?i.callback.apply(i.scope,[t]):i.callback.call(i.scope)}}removeEventListener(e,t){const n=this._listeners[e];if(n)for(let e=0,i=n.length;e<i;e++)if(n[e].callback===t)return void n.splice(e,1)}enableEvents(){this._disabled=!1}disableEvents(){this._disabled=!0}}e("E",je);const Be={SCROLL:"scroll",MOUSE_MOVE:"mousemove",MOUSE_DOWN:"mousedown",MOUSE_UP:"mouseup",MOUSE_LEAVE:"mouseleave",MOUSE_ENTER:"mouseenter",MOUSE_WHEEL:"wheel",TOUCH_MOVE:"touchmove",TOUCH_START:"touchstart",TOUCH_END:"touchend",CONTEXT_MENU:"contextmenu",DOUBLE_CLICK:"dblclick"};class Fe{constructor(e,t,n,i,s){this.position=e,this.positionRelative=t,this.type=n,this.rotation=i,this.event=s}}const Ve=e("a2",5*window.devicePixelRatio),Ge=3*window.devicePixelRatio;class Ke extends je{constructor(e){super(),this._elementHit=!1,this._delta=-1,this._state=0,this._pinchDistance=-1,this._rotationAngle=-1,this._lastMouseWheelEvent=null,this._lastTouchEvent=null,this._events=Object.keys(Be).map(e=>Be[e]),this._boundingClientRectInvalid=!0,this._creator_=e,this._downPosition={x:0,y:0},this._downPositionRelative={x:0,y:0},this._boundingClientRect=this._getBoundingClientRect()}enableDragIn(e){this._setState(1),this._dragEnabled=!0,e&&(this._dragMV=this._dragM.bind(this),this._dragEV=this._dragE.bind(this),this._dragTarget=e.currentTarget||e.target,this._delta=-1,this._dragMVName="drag",this._dragEVName="dragend",window.TouchEvent&&e instanceof TouchEvent?(this._dragMVName="touchmove",this._dragEVName="touchend"):e.dataTransfer&&e.dataTransfer.setData&&e.dataTransfer.setData("text/plain"," "),this._firefoxDragPosition={x:0,y:0},document.ondragover=e=>{e=e||window.event,this._firefoxDragPosition.x=e.pageX,this._firefoxDragPosition.y=e.pageY},this._dragTarget.addEventListener(this._dragMVName,this._dragMV,!1),this._dragTarget.addEventListener(this._dragEVName,this._dragEV,!1))}_dragM(e){let t=e,n=null,i=null;window.TouchEvent&&e instanceof TouchEvent?(n=this._getTouchPosition(t),i=this._getTouchPositionRelative(t)):(n=this._getMousePosition(t),i=this._getMousePositionRelative(t)),n.x>0&&n.y>0&&this._move(n,i)}_dragE(e){let t=e;document.ondragover=null,this._firefoxDragPosition=null,this._dragTarget.removeEventListener(this._dragMVName,this._dragMV),this._dragTarget.removeEventListener(this._dragEVName,this._dragEV),window.TouchEvent&&e instanceof TouchEvent?this._onUp(this._getTouchPosition(t),this._getTouchPositionRelative(t),2):this._onUp(this._getMousePosition(t),this._getMousePositionRelative(t),1)}addEvents(e){this._events.forEach(t=>e.addEventListener(t,this,!1)),null===window||void 0===window||window.addEventListener("scroll",this,!1)}removeEvents(e){this._events.forEach(t=>e.removeEventListener(t,this,!1)),null===window||void 0===window||window.removeEventListener("scroll",this,!1)}_move2(e){if(this._lastTouchEvent&&e.timeStamp-this._lastTouchEvent.timeStamp<16)return;const t=e.touches[0],n=e.touches[1],i=t.pageX-n.pageX,s=t.pageY-n.pageY,o=Math.abs(i)+Math.abs(s);this._pinchDistance>-1&&(o>this._pinchDistance+Ge?(this._setState(3),this.dispatchEvent(7,new Fe(this._getTouchPosition(e),this._getTouchPositionRelative(e)))):o<this._pinchDistance-Ge?(this._setState(3),this.dispatchEvent(8,new Fe(this._getTouchPosition(e),this._getTouchPositionRelative(e)))):o<=this._pinchDistance+Ge&&o>=this._pinchDistance-Ge&&(this._setState(5),this.dispatchEvent(11,new Fe(this._getTouchPosition(e),this._getTouchPositionRelative(e))))),this._pinchDistance=o,this._lastTouchEvent=e}_setState(e){this._state=e}_move(e,t,n,i){void 0===n&&(n=0),void 0===this._dragEnabled&&(this._dragEnabled=!1),1===this._state&&this._canDrag(n)&&(this._delta=this._getDelta(e),(this._delta>Ve||this._elementHit)&&(this._setState(2),this._longClickTimer&&clearTimeout(this._longClickTimer),this.dispatchEvent(0,new Fe(this._downPosition,this._downPositionRelative)))),2===this._state&&this.dispatchEvent(1,new Fe(e,t)),this.dispatchEvent(6,new Fe(e,t,n,null,i))}_longClick(e){2!==e&&(this._setState(2),this._longClickTimer&&clearTimeout(this._longClickTimer),this.dispatchEvent(0,new Fe(this._downPosition,this._downPositionRelative)),this.dispatchEvent(1,new Fe(this._downPosition,this._downPositionRelative))),this.dispatchEvent(14,new Fe(this._downPosition,this._downPositionRelative,2))}_onUp(e,t,n){this.dispatchEvent(4,new Fe(e,t,n)),this._getDelta(e)<=Ve&&this.dispatchEvent(5,new Fe(e,t)),2===this._state&&this.dispatchEvent(2,new Fe(e,t)),4===this._state&&(this.dispatchEvent(10,new Fe(e,t)),this._rotationAngle=-1),3===this._state&&(this._pinchDistance=-1),this._lastTouchEvent=null,this._setState(0),this._dragTarget=null,this._elementHit=!1,this._longClickTimer&&clearTimeout(this._longClickTimer)}_getTouchPosition(e){if(e.touches.length){let{clientX:t,clientY:n}=e.touches[0];if(e.touches.length>1){const i=e.touches[1],s=i.clientX,o=i.clientY;t=(t+s)/2,n=(n+o)/2}return{x:t,y:n}}const t=e.changedTouches[0];return{x:t.clientX,y:t.clientY}}_getTouchPositionRelative(e){const t=this._getBoundingClientRect(),{clientWidth:n,clientHeight:i}=this._domHelper.element;if(e.touches.length){const{clientX:s,clientY:o}=e.touches[0];return{x:(s-t.left)/n*2-1,y:-(o-t.top)/i*2+1}}const s=e.changedTouches[0];return{x:(s.clientX-t.left)/n*2-1,y:-(s.clientY-t.top)/i*2+1}}_getMousePosition(e){if(0!==e.clientX&&0!==e.clientY)return{x:e.clientX,y:e.clientY};{let{x:t,y:n}=this._getFireFoxMousePosition(e);return{x:t,y:n}}}_getFireFoxMousePosition(e){let{x:t,y:n}=this._domHelper.getClientDimensions();return{x:t-(t+e.offsetX),y:n-(n+e.offsetY)}}_getMousePositionRelative(e){const t=this._getBoundingClientRect();return 0!==e.clientX&&0!==e.clientY?{x:(e.clientX-t.left)/this._domHelper.element.clientWidth*2-1,y:-(e.clientY-t.top)/this._domHelper.element.clientHeight*2+1}:this._firefoxDragPosition&&0!==this._firefoxDragPosition.x&&0!==this._firefoxDragPosition.y?{x:(this._firefoxDragPosition.x-t.left)/this._domHelper.element.clientWidth*2-1,y:-(this._firefoxDragPosition.y-t.top)/this._domHelper.element.clientHeight*2+1}:{x:0,y:0}}_getDelta(e){return Math.abs(this._downPosition.y-e.y)+Math.abs(this._downPosition.x-e.x)}setDragEnabled(e){this._dragEnabled=e}handleEvent(e){switch(e.type){case Be.SCROLL:this._boundingClientRectInvalid=!0;break;case Be.MOUSE_MOVE:this._onMouseMove(e);break;case Be.DOUBLE_CLICK:this._onDoubleClick(e);break;case Be.MOUSE_DOWN:this._onMouseDown(e);break;case Be.MOUSE_UP:this._onMouseUp(e);break;case Be.MOUSE_LEAVE:this._onMouseLeave(e);break;case Be.MOUSE_ENTER:this._onMouseEnter(e);break;case Be.MOUSE_WHEEL:this._onMouseWheel(e);break;case Be.TOUCH_MOVE:this._onTouchMove(e);break;case Be.TOUCH_START:this._onTouchStart(e);break;case Be.TOUCH_END:this._onTouchEnd(e);break;case Be.CONTEXT_MENU:this._onContextMenu(e)}}_onMouseDown(e){if(e.preventDefault(),2===e.detail)return;let{x:t,y:n}=this._getMousePosition(e);this._downPosition={x:t,y:n},this._downPositionRelative=this._getMousePositionRelative(e),this.dispatchEvent(3,new Fe({x:t,y:n},this._downPositionRelative,1)),this._setState(1)}_onMouseUp(e){e.preventDefault(),2!==e.detail&&this._onUp(this._getMousePosition(e),this._getMousePositionRelative(e),1)}_onMouseMove(e){e.preventDefault(),this._move(this._getMousePosition(e),this._getMousePositionRelative(e),1,e)}_onDoubleClick(e){e.preventDefault(),this.dispatchEvent(12,new Fe(this._getMousePosition(e),this._getMousePositionRelative(e),1))}_onMouseLeave(e){var t;this._delta=-1,(null===(t=e.relatedTarget)||void 0===t?void 0:t.closest('[data-rml-sdk="ignore-mouse-leave"]'))||this._onMouseUp(e)}_onMouseEnter(e){e.preventDefault()}_onMouseWheel(e){if(this._lastMouseWheelEvent&&e.timeStamp-this._lastMouseWheelEvent.timeStamp<40)return e.preventDefault(),void e.stopPropagation();e.deltaY<0?this.dispatchEvent(7,new Fe(this._getMousePosition(e),this._getMousePositionRelative(e),1,0,e)):this.dispatchEvent(8,new Fe(this._getMousePosition(e),this._getMousePositionRelative(e),1,0,e)),this._lastMouseWheelEvent=e}_onTouchMove(e){if(e.preventDefault(),!this._dragTarget)if(1===e.touches.length)this._move(this._getTouchPosition(e),this._getTouchPositionRelative(e),2);else if(2===e.touches.length)if(this._elementHit||4===this._state){const i=e.touches[0],s=e.touches[1],o=function(e){let t=I(e);return t<0&&(t=180+(180+t)),t}((t={x:i.pageX,y:i.pageY},n={x:s.pageX,y:s.pageY},Math.atan2(n.y-t.y,n.x-t.x)));this._rotationAngle<0&&(this._rotationAngle=o);const r=o-this._rotationAngle;this._rotationAngle=o,this.dispatchEvent(9,new Fe(this._getTouchPosition(e),this._getTouchPositionRelative(e),2,T(r))),this._setState(4)}else this._move2(e);var t,n}_onTouchStart(e){if(e.preventDefault(),1===e.touches.length){let{x:t,y:n}=this._getTouchPosition(e);this._downPosition={x:t,y:n},this._downPositionRelative=this._getTouchPositionRelative(e),this.dispatchEvent(3,new Fe({x:t,y:n},this._downPositionRelative,2)),this._setState(1),this._longClickTimer=window.setTimeout(this._longClick.bind(this,2),350)}else 2===e.touches.length&&(1!==this._state&&2!==this._state||this._onUp(this._getTouchPosition(e),this._getTouchPositionRelative(e),2),this._setState(3))}_onTouchEnd(e){e.preventDefault(),e.touches.length>1&&5===this._state||3===this._state||(this.dispatchEvent(13,new Fe(this._getTouchPosition(e),this._getTouchPositionRelative(e),2)),this._onUp(this._getTouchPosition(e),this._getTouchPositionRelative(e),2))}_onContextMenu(e){e.preventDefault()}_canDrag(e){return this._dragEnabled}onElementHit(){this._elementHit=!0}_getBoundingClientRect(){return this._boundingClientRectInvalid&&(this._boundingClientRect=this._domHelper.element.getBoundingClientRect(),this._boundingClientRectInvalid=!1),this._boundingClientRect}updateSize(){this._boundingClientRectInvalid=!0}}e("ah",Ke),v([ie],Ke.prototype,"_domHelper",void 0);class ze{constructor(e){const{component:t,resetCamera:n,consecutive:i}=e;this.component=t,this.resetCamera=void 0===n||n,this.consecutive=void 0===i||i}}const We=new Map,Ne=new Map;class qe{static loadFont(e){if(Ne.has(e))return new Promise(t=>{t(Ne.get(e))});if(We.has(e))return new Promise((t,n)=>{We.get(e).push({resolve:t,reject:n})});let t=new THREE.FontLoader;return new Promise((n,s)=>{We.set(e,[{resolve:n,reject:s}]),t.load(i()+e,t=>{Ne.set(e,t),qe._resolveAll(e,t)})})}static _resolveAll(e,t){We.has(e)&&We.get(e).forEach(e=>e.resolve(t)),We.delete(e)}}e("as",qe);class Je{constructor(e){this._activeComponents=[],this._componentDimensioningsExist=new Map,this._creator_=e}setCamera(e){this._camera=e}add(e){if(this._componentDimensioningsExist.has(e.runtimeId)&&!this._componentDimensioningsExist.get(e.runtimeId))return!1;const n=this._plannerKernelAccess.kernelInstance.getComponent(e.runtimeId),i=n.dimensionings;if(this._componentDimensioningsExist.set(e.runtimeId,i.length>0),!i||0===i.length||this._camera.position.z<0)return!1;const s=A(n.boxForMeasurement),o={x:this._camera.position.x,y:this._camera.position.z};return t.import("./component-dimensioning-e456ea8d.nomodule.js").then(t=>{qe.loadFont("static/rubik_regular-bc008a7de2daee79.json").then(n=>{i.forEach(i=>{var r;e.add(new t.default(((r=i).from=r.from/1e3,r.to=r.to/1e3,1===r.type.value?(r.type={value:2},r.from*=-1,r.to*=-1):2===r.type.value&&(r.type={value:1}),r),s,n,o))})})}),this._activeComponents.push(e),!0}remove(e,n=!0){return new Promise(i=>{t.import("./component-dimensioning-e456ea8d.nomodule.js").then(t=>{let s=[];e.children.forEach(e=>{e instanceof t.default&&s.push(e)}),s.forEach(t=>{e.remove(t),q(t)}),n&&u(this._activeComponents,e),i()})})}hasComponentDimensions(){return this._activeComponents.length>0}async reset(){for(const e of this._activeComponents)await this.remove(e);this._activeComponents=[]}invalidateDimensioningsCache(e){e?this._componentDimensioningsExist.delete(e):this._componentDimensioningsExist.clear()}}v([ie],Je.prototype,"_plannerKernelAccess",void 0);class Xe{constructor(){this._promiseExecutors=[]}create(){return new Promise((e,t)=>{this._promiseExecutors.push({resolve:e,reject:t})})}resolve(e){return new Promise(t=>{this._promiseExecutors.forEach(t=>t.resolve(e)),this._promiseExecutors=[],t(e)})}reject(e){return new Promise((t,n)=>{this._promiseExecutors.forEach(t=>t.reject(e)),this._promiseExecutors=[],n(e)})}}class Ye extends class{constructor(e){this._coreReference=e.clone()}clearReference(){this._coreReference.delete(),this._coreReference=null}getKernelObject(){return this._coreReference}}{constructor(e){super(e),this._objectWaiter=new Xe,this._topView=!1;const t=k(e.getCenter());this._container=new THREE.Object3D,this._container.position.copy(t),this._boundingBox=this._generateBoundingBox(),N(this._boundingBox),this._container.add(this._boundingBox),2!==this.getPlanElement().getType().value&&(this._object=new THREE.Object3D,this._container.add(this._object))}getSize(){return this._object?(new THREE.Box3).setFromObject(this._object).getSize(new THREE.Vector3):new THREE.Vector3}update(){this._container.position.copy(k(this.getPlanElement().getMeshCenter())),this._boundingBox&&this._updateBoundingBox()}_updateBoundingBox(){const e=this.getSize();this._boundingBox.geometry=new THREE.BoxGeometry(e.x,e.y,e.z),this._boundingBox.position.y=e.y/2}getPosition(){return this._container.position}getRotation(){return this._container.rotation.y}getBounds(){let e;return this.getPlanElement().boxForMeasurement?(e=A(this.getPlanElement().boxForMeasurement),e.applyMatrix4(this.getContainer().matrix)):(e=new THREE.Box3,e.setFromObject(this._container)),e}getBoundingBox(){return this._boundingBox}getPlanElement(){return this._coreReference}setObject(e){this._object=e,this._objectWaiter.resolve(e)}getObject(){return this._object}async getObjectAsync(){return this._object?Promise.resolve(this._object):this._objectWaiter.create()}addMesh(e){this._object.add(e),this.hidePreviewBox()}getMesh(e){if(!this._object||0===this._object.children.length)return null;const t=Z(e,this.getPlanElement().getType());return this._object.children.find(e=>e.userData.material===t)}getContainer(){return this._container}getId(){return this.getPlanElement().getId()}clear(){q(this._container),this._selectionMesh&&q(this._selectionMesh)}remove(){var e;null===(e=this._container.parent)||void 0===e||e.remove(this._container),this.clear()}hidePreviewBox(){this._container&&this._boundingBox&&(this._boundingBox.material=($||($=new THREE.MeshBasicMaterial,$.visible=!1),$))}_generateBoundingBox(){const e=this.getSize(),t=new THREE.BoxGeometry(e.x,e.y,e.z);let n=new THREE.Color("#DDDDDD");const i=this.getPlanElement().customColor;i>0&&(n=(e=>{let t=new THREE.Color;return t.setRGB((e>>16)/255,(e>>8&255)/255,(e>>0&255)/255),t})(i));let s=new THREE.MeshStandardMaterial({color:n,opacity:1,transparent:!0}),o=new THREE.Mesh(t,s);return o.name="bounding box",o.position.y=e.y/2,o.castShadow=!1,o.receiveShadow=!1,o.layers.set(6),o}select(){this._isSelected=!0,this._selectionMesh&&this._container.add(this._selectionMesh)}deselect(){this._isSelected=!1,this._selectionMesh&&this._container.remove(this._selectionMesh)}hoverOn(){}hoverOff(){}setPrimaryColor(e){this._primaryColor=e}setTopView(e){this._topView=e}}class Qe extends Ye{constructor(e){super(e),this._initDone=!1,this._initFailed=null,this._initWaiter=new Xe,this._container.rotation.y=e.rotation}finishInit(){return this._initDone=!0,this._initFailed=null,this._initWaiter.resolve()}failInit(e){return this._initFailed=e,this._initDone=!1,this._initWaiter.reject(this._initFailed)}isInitDone(){return this._initDone?Promise.resolve():this._initFailed?Promise.reject(this._initFailed):this._initWaiter.create()}getPlanObject(){return this.getPlanElement()}getSize(){return x(this.getPlanObject().size)}update(){super.update(),this._container.rotation.y=this.getPlanObject().rotation}}class $e extends Qe{constructor(e){super(e),this._container.name="Configurable "+this._container.name}addRootComponent(e){this.setObject(e),this._rootComponentId=e.id,this._rootComponentRuntimeId=e.runtimeId,this._container.add(this.getObject())}getConfigurationRuntimeId(){return this.getPlanObject().getConfigurationRuntimeId()}getRootComponentId(){return this._rootComponentId}getRootComponentRuntimeId(){return this._rootComponentRuntimeId}finishConstruction(){return this.finishInit()}failConstruction(){return this.failInit(new Error("Construction of configuration failed"))}}e("c",$e);var Ze={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(Ze));e.APP,e.features}}();const et=JSON.parse(JSON.stringify(Ze));var tt=e("o",et);class nt extends Qe{constructor(e){super(e),this._originalSize=new THREE.Vector3,this._container.name="Static "+this._container.name}setRapiItem(e){return this._rapiItem?Promise.resolve():this._addStaticItem(e)}async _addStaticItem(e){this._rapiItem=e;let t=this.getPlanObject();if(this._glbUrl=_(e),!this._glbUrl)return Promise.reject("No glb url found");let n=e.scaleable?x(t.size):void 0,i=new THREE.Vector3(1,1,1);t.flipX&&(i.x*=-1),t.flipY&&(i.z*=-1);try{const s=await this._staticItemLoader.loadGLB(this._glbUrl,void 0,void 0,n,i,t.customColor,e.colorable);this._originalSize.copy(s.boundingBox.getSize(new THREE.Vector3)),s.scene.name=e.label,this.setObject(s.scene),((e,t)=>{let n=(new THREE.Box3).setFromObject(e),i=n.getSize(new THREE.Vector3),s=Math.min(i.x,i.y,i.z),o=!0;s>5&&(console.warn("GLB seems to be too big ("+s+")",t),o=!1),n.min.y<-.01&&(console.warn("GLB seems to be under the floor ("+n.min.y+"): ",t),o=!1)})(s.scene,this._glbUrl),N(s.scene),this._container.add(this.getObject()),this.hidePreviewBox(),await this.finishInit()}catch(e){await this.failInit(e)}}getRapiItem(){return this._rapiItem}needsRapiItem(){return!this._glbUrl}getGLBUrl(){return this._glbUrl}update(){const e=x(this.getPlanElement().size),t=this.getObject();if(!t)return;if(e){const{x:n,y:i,z:s}=this._originalSize;let o=new THREE.Vector3(e.x/n,e.y/i,e.z/s);t.scale.copy(o)}this.getPlanElement().flipX&&(t.scale.x*=-1),this.getPlanElement().flipY&&(t.scale.z*=-1);const n=this.getPlanElement().customColor;t.traverse(e=>{if(e instanceof THREE.Mesh&&e.material instanceof THREE.MeshStandardMaterial){const t=e.material;if(this._rapiItem.colorable&&n&&n>0){let e=new THREE.Color(n);t.color=e.copyGammaToLinear(e)}t.needsUpdate=!0}}),super.update()}}let it;e("S",nt),v([ie],nt.prototype,"_staticItemLoader",void 0),e("ad",e=>{const{id:t,textRotation:n,length:i,lengthFormatted:s}=e;return{id:t,fromPosition3d:te(e.fromPosition3d),toPosition3d:te(e.toPosition3d),textPosition3d:te(e.textPosition3d),fromPosition2d:ee(e.fromPosition2d),toPosition2d:ee(e.toPosition2d),textPosition2d:ee(e.textPosition2d),textDirection:te(e.textDirection),textRotation:n,length:i,lengthFormatted:s}});const st=()=>(it||(it=new THREE.MeshPhysicalMaterial({color:0})),it);class ot extends Ye{constructor(e){super(e),this._container.name="Wall Plan Element"}get isSelected(){return this._isSelected}getWallDimension(e=.2){const t=this.getPlanElement(),n=k(t.getCenter()),i=t.getPreferredSide();let s,o;0===i?(s=k(t.getCornerFromLeft()),o=k(t.getCornerToLeft())):(s=k(t.getCornerFromRight()),o=k(t.getCornerToRight()));const r=s.clone().add(o).divideScalar(2),a=s.clone().sub(o),l=a.clone().cross(new THREE.Vector3(0,1,0)).normalize();l.clone().dot(r.clone().sub(n))<0&&l.multiplyScalar(-1);const h=l.multiplyScalar(e),c=s.add(h),d=o.add(h),u=a.clone();a.dot(new THREE.Vector3(1,0,0))<0&&u.multiplyScalar(-1);const _=Math.atan2(u.z,u.x),p=c.clone().add(d).divideScalar(2);return{id:t.getId(),fromPosition3d:c,toPosition3d:d,textPosition3d:p,textDirection:u,textRotation:_,length:t.getLength(i)}}addMesh(e){e.traverse(e=>{this._setMaterial(e)}),e.layers.set(9),super.addMesh(e);const t=(new THREE.Box3).setFromObject(this.getObject()).getSize(new THREE.Vector3);this._boundingBox.geometry=new THREE.BoxGeometry(t.x,t.y,t.z),this._boundingBox.position.y=t.y/2}show(){var e,t;this.getContainer().visible=!0,null===(e=this.getObject())||void 0===e||e.traverse(e=>{e.layers.set(9)}),null===(t=this.getBoundingBox())||void 0===t||t.layers.set(6)}hide(){var e,t;this.getContainer().visible=!1,null===(e=this.getObject())||void 0===e||e.traverse(e=>{e.layers.disableAll()}),null===(t=this.getBoundingBox())||void 0===t||t.layers.disableAll()}_enableTopView(){this._container.traverse(e=>{this._setTopMaterial(e)})}_setTopMaterial(e){e instanceof THREE.Mesh&&!e.userData.originalMaterial&&e.material&&e!==this._boundingBox&&(e.userData.originalMaterial=e.material,e.material=st())}_disableTopView(){this._container.traverse(e=>{e instanceof THREE.Mesh&&e.userData.originalMaterial&&(e.material=e.userData.originalMaterial,delete e.userData.originalMaterial)})}setTopView(e){super.setTopView(e),e?this._enableTopView():this._disableTopView()}getKernelObject(){return super.getKernelObject()}_setMaterial(e){e instanceof THREE.Mesh&&e.material&&e!==this._boundingBox&&(e.userData.originalMaterial||(e.userData.originalMaterial=e.material),this._topView&&this._isSelected?e.material=new THREE.MeshBasicMaterial({color:10526880,side:THREE.DoubleSide}):this._topView&&!this._isSelected?e.material=st():(e.material=e.userData.originalMaterial,delete e.userData.originalMaterial))}select(){super.select(),this._container.traverse(e=>{this._setMaterial(e)})}deselect(){super.deselect(),this._container.traverse(e=>{this._setMaterial(e)})}}e("W",ot);class rt extends Ye{constructor(e){super(e),this._container.name="Floor Plan Element"}addMesh(e){this.getObject().clear(),super.addMesh(e),e.layers.set(9),e.castShadow=!1}}e("F",rt);class at extends Ye{constructor(e){super(e),this._container.name="Ceiling Plan Element"}addMesh(e){super.addMesh(e),e.castShadow=!1;const t=(new THREE.Box3).setFromObject(this.getObject()).getSize(new THREE.Vector3);this._boundingBox.geometry=new THREE.BoxGeometry(t.x,.01,t.z)}}e("f",at);const lt=new Map;class ht{static start(e){if(!window.performance||!window.performance.getEntriesByName)return"";let t=window.performance.getEntriesByName(e).length++,n="";t<100&&(n="0"),t<10&&(n="0"+n);const i=t>0?e+"_"+n+t:e,s=i+"_start";return window.performance.mark(s),i}static addMeta(e,t){const n=ht.getMeta(e);lt.set(e,Object.assign(n,t))}static getMeta(e){return lt.get(e)||{}}static end(e){}static getMeasure(e){return[]}static showBenchmarks(e){const t=window.performance.getEntriesByType("measure");t.sort((function(e,t){return e.startTime-t.startTime}));const n=[];for(let i=0,s=t.length;i<s;i++){const s=t[i];e&&-1===s.name.indexOf(e)||n.push({Start:parseFloat(s.startTime.toFixed(2)),Name:s.name,Duration:parseFloat(s.duration.toFixed(2))})}console.table(n)}}e("B",ht);class ct{static init(e={}){const{kernelInstance:t,kernelContainer:n,planObjectId:i}=e;ct.kernelInstance=t,ct.kernelContainer=n,ct.planObjectId=i}static cleanUp(){ct.useHDGeometry=!1,ct.kernelInstance=null,ct.kernelContainer=null,ct.planObjectId=null}}e("A",ct),ct.useHDGeometry=!1,ct.kernelInstance=null,ct.kernelContainer=null,ct.planObjectId=null;const dt=new Map,ut=function(e,t,n){let i=dt.get(e);if(i){const s=n?[n]:void 0;i.forEach(({resolve:e,reject:n})=>t?e.apply(e,s):n.apply(n,s)),dt.delete(e)}};class _t{static finishOperation(e,t){ut(e,!0,t)}static failOperation(e,t){ut(e,!1,t)}static waitFor(e,t){return new Promise((n,i)=>{let s=dt.get(e);s||(dt.set(e,[]),s=dt.get(e)),s.push({resolve:n,reject:i}),"function"==typeof t&&t.apply(t)})}}e("H",_t);const pt=e("J",(function(e){return e.validRange&&"string"==typeof e.validRange.type})),gt=function(e){return e.validValues&&e.validValues.length>0},mt=e("K",(function(e){return"Material"===e.type}));let ft,Et,wt,Ct,yt;const bt={WASM:{CONFIGURATOR:{URL:"static/ConfiguratorKernel-b3db99d56b9f5196.wasm",LOADER:"static/ConfiguratorKernel-d74ac1d836436ed8.js"},PLANNER:{URL:"static/RoomleCore-5020f57fd0b2edd5.wasm",LOADER:"static/RoomleCore-435f2f2c0751f8ed.js"}},ASM:{CONFIGURATOR:{MEM_URL:"static/ConfiguratorKernelJs-131a27ea2e48bc8e.mem",LOADER:"static/ConfiguratorKernelJs-66e23858ee842c75.js"},PLANNER:{MEM_URL:"static/RoomleCoreJs-e9e828afe3e9d239.mem",LOADER:"static/RoomleCoreJs-4ee873a38a54dee2.js"}}},Mt=!!window.WebAssembly;class vt{_utilityToLongArray(e){const t=new this._kernelContainer.LongArray;return e.forEach(e=>t.push_back(e)),t}constructor(e){this._requestedItemIds=[],this._requestedMaterialIds=[],this._configuratorKernelCallbackListener=new Set,this._cachedGroupIds=[],this._waitingForGroups=!1,this._subComponentsWaiters=new Map,this._shouldWait=!0,this._creator_=e,window.KernelCallback={isReady:this.isReady.bind(this)},this._lifeCycleManager.addEventListener(this)}init(e){this._kernelType=e,this._setupKernelPaths(e),this._setupEmsModule(e),this._useWASM=Mt,this._kernelPath=Mt?wt:Ct}_initKernel(){const{unitStringType:e,restrictionLevel:t}=this._initData;this._kernelInstance.setLevel(t),this._unitFormatter.init(this._kernelContainer),this._kernelInstance.setEnvironmentVariable("unit",this._unitFormatter._actualUnitString||"cm"),this._kernelInstance.setEnvironmentVariable("unitString",e||"short"),this._kernelInstance.useEnvironmentGeometry(1===this._kernelType);const{overrideCountry:n,locale:i}=this._globalInitData;n&&(this._kernelInstance.resetPriceListIds(),this._kernelInstance.addPriceList(n)),this._kernelInstance.setEnvironmentVariable("language",i)}get kernelContainer(){return this._kernelContainer}get kernelInstance(){return this._kernelInstance}_setupKernelPaths(e){const t=0===e?"PLANNER":"CONFIGURATOR";ft=bt.ASM[t].MEM_URL,Et=bt.WASM[t].URL,wt=bt.WASM[t].LOADER,Ct=bt.ASM[t].LOADER,yt=!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)?i()+ft:t},wasmBinaryFile:i()+Et,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")}},yt&&Mt&&(this._kernelContainer.instantiateWasm=function(e,t){return((e,t,n)=>{const s="function"==typeof WebAssembly.instantiateStreaming;ht.addMeta("kernel_is_ready",{cachedInIndexedDB:!1});let o=null;s?(ht.start("kernel_stream_compile"),o=WebAssembly.instantiateStreaming(fetch(i()+e),t),ht.end("kernel_stream_compile")):(ht.start("kernel_legacy_compile"),o=fetch(i()+e).then(e=>e.arrayBuffer()).then(e=>WebAssembly.instantiate(e,t))),ht.addMeta("kernel_is_ready",{instantiateStreaming:s}),o.then(e=>{ht.end(s?"kernel_stream_compile":"kernel_legacy_compile"),n(e.instance)},e=>console.error(e))})(Et,e,t),{}})}_passSubComponentsToKernel(e,t){const n=e.id,i=t.get(n);if(i)for(let t=0,s=i.length;t<s;t++){const{parentId:s,partId:o}=i[t];this._kernelIo.setMeta({componentId:n}),this._kernelInstance.loadedSubComponent(s,o,n,e.configuration)}}_fetchSubComponents(e){let t=[...e.keys()];t.length&&this._rapiAccess.getComponents(t).then(t=>{for(let n=0,i=t.length;n<i;n++)this._passSubComponentsToKernel(t[n],e);this._flushSubComponentsWaiters()})}_flushSubComponentsWaiters(){this._fetchSubComponents(this._subComponentsWaiters),this._subComponentsWaiters=new Map,this._shouldWait=!1}isReady(){this._kernelContainer.setExternalHelpers(this._kernelIo,{convertCObject:L}),tt.isProduction||tt.isUnitTesting||this.addDebugInfo(),window.KernelCallback&&(window.KernelCallback=null,delete window.KernelCallback)}addDebugInfo(){const e=function(t,n=[]){const i=Object.getPrototypeOf(t),s=i?Object.getOwnPropertyNames(i):[],o=t?Object.getOwnPropertyNames(t):[];return i?e(i,[...n,...o,...s]):[...o,...s,...n]},t=e(this),n=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toString","valueOf"];[...new Set(t)].forEach(e=>{if(!e.startsWith("_")&&"function"==typeof this[e]&&-1===n.indexOf(e))try{const t=this[e].bind(this);this[e]=function(...n){return this._kernelIo.log("[ KernelCommunication ]: "+e),t(...n)}}catch(e){}})}getConfigurationData(e){return new Promise(t=>{var n;const i=this.kernelInstance.getPlanObject(e),s=(new Date).toISOString(),o=this.kernelInstance.getComponentId(e),r=le(o),a=(null===(n=i.boxForMeasurement)||void 0===n?void 0:n.size)||i.bounds;t({created:s,lastAccess:s,configuration:this.kernelInstance.getSerializedConfiguration(e),configurationHash:this.kernelInstance.getHashOfConfiguration(e),parts:JSON.stringify(this.kernelInstance.getPartList(e)),rootComponentId:o,width:a.x,height:a.z,depth:a.y,catalog:r,orderable:!1,requestable:!1})})}loadComponent(e,t,n){this._rapiAccess.getComponent(t.componentId).then(i=>{var s;let o=i.configuration;o||(o="error",null===(s=this._configuratorUiCallbacks)||void 0===s||s.onContentProblem({rapiPath:"components",ids:[t.componentId],message:t.componentId+" has no configuration"})),this._kernelIo.setMeta({componentId:t.componentId}),this._kernelInstance.loadComponent(e,o,t,n),this._flushSubComponentsWaiters()},i=>{var s;this._kernelInstance.loadComponent(e,"error",t,n),this.onLoadComponentError(i,t.componentId),null===(s=this._configuratorUiCallbacks)||void 0===s||s.onError(new Error(`Component with id "${t.componentId}" can not be loaded. "${i}"`)),this._flushSubComponentsWaiters()})}loadSubComponent(e,t,n){if(this._shouldWait){let i=this._subComponentsWaiters.get(n);i||this._subComponentsWaiters.set(n,[]),i=this._subComponentsWaiters.get(n),i.push({parentId:e,partId:t}),this._subComponentsWaiters.set(n,i)}else this._rapiAccess.getComponent(n).then(i=>{var s;let o=i.configuration;o||(o="error",null===(s=this._configuratorUiCallbacks)||void 0===s||s.onContentProblem({rapiPath:"components",ids:[n],message:"SubComponent "+n+" has no configuration"})),this._kernelIo.setMeta({componentId:n,parentId:e}),this._kernelInstance.loadedSubComponent(e,t,n,o)})}async loadItemConfigurations(e,t){let n=Array.isArray(t)?t:[t];if(this._requestedItemIds.push(...n),await p(0),!this._requestedItemIds.length)return;const i=[...this._requestedItemIds];this._requestedItemIds=[],(await this._rapiAccess.getItems(i)).forEach(t=>{this._kernelInstance.loadedItemConfiguration(e,t.id,t.configuration)})}requestDeleteComponent(e){var t,n;e&&((null===(n=null===(t=this._initData)||void 0===t?void 0:t.featureFlags)||void 0===n?void 0:n.reDock)?this._kernelInstance.deletePlanComponent(e):this._kernelInstance.deleteComponent(e))}dockComponentWithPosition(e,t,n,i,s){var o;this._kernelInstance.dockComponentWithPosition(n,i,e,t,s);const r=this._kernelInstance.getComponentId(n),a=this._kernelInstance.getComponentId(e);null===(o=this._configuratorUiCallbacks)||void 0===o||o.onUserInitiatedDockDone(r,i,a,t,s)}Editor3dAddBakedMesh(e,t,n,i,s,o,r,a){this._configuratorKernelCallbackListener.forEach(l=>l.Editor3dAddBakedMesh(e,t,n,i,s,o,r,a))}Editor3dAddNamedMesh(e,t,n,i,s,o,r,a,l,h,c,d){this._configuratorKernelCallbackListener.forEach(u=>u.Editor3dAddNamedMesh(e,t,n,i,s,o,r,a,l,h,c,d))}Editor3ChangedNamedMesh(e,t,n,i,s,o,r){this._configuratorKernelCallbackListener.forEach(a=>a.Editor3ChangedNamedMesh(e,t,n,i,s,o,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,i){this._configuratorKernelCallbackListener.forEach(s=>s.Editor3dComponentCreated(e,t,n,i,!1))}Editor3dComponentDocked(e,t,n,i){this._configuratorKernelCallbackListener.forEach(s=>s.Editor3dComponentDocked(e,t,n,i))}Editor3dGeometryReady(e){this._configuratorKernelCallbackListener.forEach(t=>t.Editor3dGeometryReady(e)),this.requestPlanComponentConstruction(e)}Editor3dGeometryNotReady(e){this._configuratorKernelCallbackListener.forEach(t=>t.Editor3dGeometryNotReady(e))}componentDeleted(e){this._configuratorKernelCallbackListener.forEach(t=>t.componentDeleted(e))}componentMetaUpdated(e){let t=this._kernelInstance.getComponent(e);this._configuratorKernelCallbackListener.forEach(e=>e.componentMetaUpdated(t))}sceneCleared(){this._configuratorKernelCallbackListener.forEach(e=>e.sceneCleared())}requestMaterialsInGroup(e){(Array.isArray(e)?e:[e]).forEach(e=>{-1===this._cachedGroupIds.indexOf(e)&&this._cachedGroupIds.push(e)}),this._waitingForGroups||(this._waitingForGroups=!0,_t.waitFor(4).then(()=>{this._rapiAccess.getMaterialsByGroup(this._cachedGroupIds).then(e=>{let t=[];e.forEach(e=>{const n=[];e.materials.forEach(e=>n.push(e.id));const i=e.legacyId||e.id;e.legacyId||console.warn("Material group has no legacy id, please check content why this is the case"),t.push({group:i,materials:n})}),t.length&&this._kernelInstance.setMaterialsInGroup(t),this._cachedGroupIds=[]},e=>{var t;console.error(e),null===(t=this._configuratorUiCallbacks)||void 0===t||t.onError(new Error(`Material group with ids "${this._cachedGroupIds.join(",")}" can not be loaded. "${e}"`)),this._cachedGroupIds=[]})}))}requestPlanComponentConstruction(e){this._kernelInstance.requestDeltaPlanComponentConstruction(e)}addConfiguratorListener(e){this._configuratorKernelCallbackListener.add(e)}removeConfiguratorListener(e){this._configuratorKernelCallbackListener.delete(e)}cleanUpCallbacks(){"function"==typeof this._kernelContainer.unregisterConfiguratorCallback&&this._kernelContainer.unregisterConfiguratorCallback(this)}async requestMaterialProperties(e){let t=Array.isArray(e)?e:[e];if(this._requestedMaterialIds.push(...t),await p(0),!this._requestedMaterialIds.length)return;const n=[...this._requestedMaterialIds];this._requestedMaterialIds=[];const i=await this._rapiAccess.getMaterials(n);let s=[];i.forEach(e=>{const t=new this._kernelContainer.StringStringMap,n=e.properties||{};for(let e in n)n.hasOwnProperty(e)&&t.set(e,n[e]);t.size()&&s.push({id:e.id,properties:t})}),s.length&&this._kernelInstance.setMaterialProperties(s)}registerCallbacks(){this._kernelContainer.registerConfiguratorCallback(this)}pause(){this.cleanUpCallbacks()}resume(){this.cleanUpCallbacks(),this.registerCallbacks()}destroy(){}_handleCortoMesh(e,t,n){var i;try{this._kernelInstance.addMeshCorto(t,n,new Uint8Array(e))}catch(e){console.error(e),null===(i=this._configuratorUiCallbacks)||void 0===i||i.onMemoryCorruption()}}calcPartsPriceSum(e){return this._calcPrice(e)}_calcPrice(e){const t=new Map;e||(e=this._kernelInstance.getFullPartList());const n=!!e&&!!e.fullList&&!!e.fullList.length;if(this._initData.useRoomlePrice&&n){const n=e.fullList[0].currencySymbol,i=e.fullList.reduce((e,t)=>e+(t.count?t.count:0)*(t.price?t.price:0),0),s=m(i,2);return this._configuratorUiCallbacks.onUpdatePrice(n,s),Promise.resolve({totalSum:s,partMap:t})}if(this._initData.usePriceService&&n){const n=e.fullList.reduce((e,n)=>{const i=he(n);return i&&(t.set(i,n),e.push(i)),e},[]);return new Promise((i,s)=>{this._rapiAccess.getPrices(n).then(n=>{if(!n.length)return s(new Error("prices are empty"));let o=0;const r=g(n,"priceId");for(const t of e.fullList){const e=he(t);if(!r.has(e)){console.warn("PriceId: "+e+" has no corresponding kernel-part");continue}const{price:n,currencySymbol:i}=r.get(e);t.price=n,t.currencySymbol=i,o+=n*t.count}return o=m(o,2),this._configuratorUiCallbacks.onUpdatePrice(n[0].currencySymbol,o),i({totalSum:o,partMap:t})},e=>{console.error(e),s(e)})})}return Promise.resolve({totalSum:0,partMap:t})}async addUiDataAndPriceToPartList(e,t){const{fullList:n,originPart:i}=e,s=e.perMainComponent;let o;this.addUiDataToPartList(n,t);try{const e=await this._calcPrice();o=e.partMap}catch(e){console.error(e),o=new Map}const r=this._initData.usePriceService||this._initData.useRoomlePrice,a=e=>{r||(e.price=null,e.currencySymbol=null);const t=he(e);if(!t)return;if(!o.has(t))return;const{price:n,currencySymbol:i}=o.get(t);"number"==typeof n&&(e.price=n,e.currencySymbol=i)};return n.forEach(a),s.forEach(({fullList:e,perMainComponent:n})=>{n.length>0&&console.error("Not implemented! perMainComponent is deeper than one level"),this.addUiDataToPartList(e,t),e.forEach(a)}),{fullList:n,perMainComponent:s,originPart:i}}addUiDataToPartList(e,t){const n=[];return e.forEach(e=>{const t=this._rapiAccess.peekComponent(e.componentId);!t||e.labelIsCalculated&&e.label||(e.label=t.label),e.parameters.forEach(e=>{if(this._unitFormatter.formatPartListParameter(e),mt(e)){const t=this._rapiAccess.peekMaterial(e.value);t?e.valueLabel=t.label||t.name||e.value:-1===n.indexOf(e.value)&&n.push(e.value)}})}),n.length&&this._rapiAccess.getMaterials(n).then(e=>{const n=this._lastPartListHash!==t;Array.isArray(e)&&e.length&&n&&(this._lastPartListHash=t,this.requestPartListAndUpdatePricesOfParts())}),e}async requestPartListAndUpdatePricesOfParts(e,t){let n=this._kernelInstance.getFullPartList();e||(e=this._kernelInstance.getHashOfConfiguration(this._configuratorContext.planObjectId));const i=await this.addUiDataAndPriceToPartList(n,e);this._configuratorUiCallbacks.onPartListUpdate(i,btoa(e))}}v([ie],vt.prototype,"_rapiAccess",void 0),v([ie],vt.prototype,"_scriptLoader",void 0),v([ie],vt.prototype,"_kernelIo",void 0),v([ie],vt.prototype,"_dataSyncer",void 0),v([ie],vt.prototype,"_lifeCycleManager",void 0),v([ie],vt.prototype,"_configuratorUiCallbacks",void 0),v([ie],vt.prototype,"_globalCallback",void 0),v([ie],vt.prototype,"_initData",void 0),v([ie],vt.prototype,"_unitFormatter",void 0),v([ie],vt.prototype,"_configuratorContext",void 0),v([ie],vt.prototype,"_globalInitData",void 0);const{APP:Pt}=tt,{RAPI:Tt}=Pt,It=Tt.headers,Rt=Tt.itemHeaders,kt=It.token,xt=(e("ae",e=>e.startsWith("ps_")),f());let St=new Map,Dt=new Map,Lt=new Map,Ht=new Map,Ot=new Map,At=new Map,Ut=new Map,jt=new Map,Bt=new Map;const Ft=e=>St.get(e)||St.get(xt+e),Vt=e=>e&&e.tags&&e.tags.length,Gt=e=>!Vt(e)&&e.group;class Kt{constructor(e){this._itemLoaded=!1,this._currentToken=null,this._creator_=e,window.addEventListener("online",this._flushOfflineQueue.bind(this))}getPreloadForItem(e){return this._getPreload(e,!0)}getPreloadForConfiguration(e){return this._getPreload(e,!1)}_getPreload(e,t){return new Promise((n,i)=>{if(!navigator.onLine)return n();if(this._dataSyncer.getIsCatalogSynced(le(e)))return n();if(Ut.get(e))return n();const s=t?"?itemId=":"?configurationId=";this._get("/preloads/components/"+s+e,"preloads/components").then(t=>{if(Ut.get(e))return n();t.forEach(e=>{this._prepareData(e,"components")}),Ut.set(e,!0),n()},i)})}changeUseOfHDGeometry(){const e=Ht.get("components");Ut.clear(),At.clear(),e&&Ht.delete("components")}getHSCPackage(e){return new Promise((t,n)=>{if(At.get(e))return t();this._get("/catalogs/"+e+"/package","package").then(n=>{if(At.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")}),At.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:Rt})}getComponents(e){return this._getByIds(e,"components")}getItems(e){return this._getByIds(e,"items",{additionalHeaders:Rt})}getTag(e){return this._getById(e,"tags")}getTags(e){return this._getByIds(e,"tags")}getTexture(e){return this._getById(e,"textures")}getCatalog(e){return this._getById(e,"catalogs")}getMesh(e,t="crt",n=50){return this._getById(e,"meshes",{pathSuffix:"/data?format="+t+"&targetQuality="+n.toString()})}getMeshesOfCatalog(e){return new Promise((t,n)=>{const i=Ot.get(e);i?t(i):this._get("/meshes?catalog="+e,"catalogMeshes").then(n=>{Ot.set(e,n),t(n)},n)})}getTexturesOf(e){return this._getRelationData(e,{rapiPath:"textures"})}getItemsOf(e){return this._getRelationData(e,{rapiPath:"items"})}async getMaterialsOf(e){return(await this._getRelationData(e,{rapiPath:"materials"},{embed:["textures"]})).filter(e=>e.active)}getComponentsOf(e){return this._getRelationData(e,{rapiPath:"components"})}getAdditionalContentsOfItems(e){const t=[],n=[];return e.forEach(e=>{const i=Dt.get(e.id.toString());i?n.push(...i):t.push(e.id.toString())}),new Promise((e,i)=>{0!==t.length?this._getByIdsPackets(t,"itemAdditionalContents",{filterKey:"itemIds"}).then(t=>{t.forEach(e=>{let t=Dt.get(e.itemId);t||(t=[]);for(let n=0,i=t.length;n<i;n++)if(t[n].id===e.id)return;t.push(e),Dt.set(e.itemId,t)}),e([...t,...n])},i):e(n)})}getMaterial(e){return this._getById(e,"materials",{embed:["textures"]})}peekMaterial(e){return this._peekData(e,"materials")}peekComponent(e){return this._peekData(e,"components")}peekItem(e){return this._peekData(e,"items")}peekConfiguration(e){return this._peekData(e,"configurations")}async getMaterials(e){return(await this._getByIds(e,"materials",{embed:["textures"]})).filter(e=>e.active)}getPlan(e){return this._getById(e,"plans")}getPlanSnapshot(e){return this._getById(e,"planSnapshots")}static clearCaches(){St=new Map,Lt=new Map,Ht=new Map,At=new Map,Ut=new Map,jt=new Map,Dt=new Map}cleanUp(){Kt.clearCaches()}getMaterialsByGroup(e){const t=e.slice(),n=[];let i=t.length;for(let e=0;e<i;e++){const s=Ft(t[e]);if(s){const o=s.length;for(let e=0;e<o;e++){const t=this._getCache("materials").get(s[e]);n.push(t)}t.splice(e,1),i--,e--}}return new Promise((e,i)=>{0!==t.length&&navigator.onLine?this._getByIdsPackets(t,"materials",{filterKey:"groups",embed:["textures"]}).then(t=>{e(this.combineMaterialsToGroups([...t,...n]))},i):e(this.combineMaterialsToGroups(n))})}_flushOfflineQueue(){return new Promise((e,t)=>{const n=this._localStorage.getItem("hsc_configurations_offline_queue_v1"),i=[];for(let e in n)if(n.hasOwnProperty(e)){const t=n[e];i.push(new Promise((e,n)=>{this.saveConfiguration(t.data).then(i=>{const s=[];t.perspectiveImage&&!i.perspectiveImage&&s.push(this.savePerspectiveImage(i,t.perspectiveImage)),t.topImage&&!i.topImage&&s.push(this.savePerspectiveImage(i,t.topImage)),Promise.all(s).then(e,n)},n)}))}Promise.all(i).then(()=>{this._localStorage.setItem("hsc_configurations_offline_queue_v1",{}),e()},t)})}_setQueuedConfiguration(e,t={}){const n=e.configurationHash,{perspectiveImage:i,topImage:s}=t;let o=this._localStorage.getItem("hsc_configurations_offline_queue_v1")||{},r=o[n]||{};r.data=e,r.perspectiveImage=i,r.topImage=s,o[n]=r,this._localStorage.setItem("hsc_configurations_offline_queue_v1",o)}async saveConfiguration(e){return navigator.onLine?await this._save("/configurations",{configuration:e},"configurations",{accept:"application/json",contentType:"application/json; charset=UTF-8"}):(e.perspectiveImage=null,e.topImage=null,this._setQueuedConfiguration(e),this._markConfigurationAsLocally(e),Promise.resolve(e))}saveTopImage(e,t){return this._saveConfigurationImage(e,t,"topImage")}savePerspectiveImage(e,t){return this._saveConfigurationImage(e,t,"perspectiveImage")}savePlanSnapshotTopImage(e,t){return this._savePlanSnapshotImage(e,t,"topImage")}savePlanSnapshotPerspectiveImage(e,t){return this._savePlanSnapshotImage(e,t,"perspectiveImage")}getShortUrl(e,t){return new Promise((n,i)=>this._fetchJson("/shortIds","shortIds",{method:"POST",resolve:n,reject:i,data:JSON.stringify({shortId:{type:t,referencedId:e}}),accept:"application/json",contentType:"application/json; charset=UTF-8"}))}_peekData(e,t){const n=Ht.get(t);return n&&n.get(e)||null}_saveConfigurationImage(e,t,n){if(!navigator.onLine){const i={};return i[n]=t,this._setQueuedConfiguration(e,i),this._markConfigurationAsLocally(e),e[n]=t.image,Promise.resolve(e)}const i=this._formDataUtil.create(t.image,e.configurationHash,b.PNG,n);return this._save("/configurations/"+e.id+"/"+n,i,"configurations",{accept:"application/json"})}_savePlanSnapshotImage(e,t,n){const i=this._formDataUtil.create(t.image,e.id,b.PNG,"file");return i.append("type",n),this._save("/planSnapshots/"+e.id,i,"planSnapshots",{accept:"application/json",method:"PUT"})}_markConfigurationAsLocally(e){e.isLocally=!0,e.id=e.configurationHash}_save(e,t,n,i={}){const s=t instanceof FormData?t:JSON.stringify(t);return new Promise((t,o)=>{const r={method:i.method||"POST",data:s,resolve:t,reject:o};i.contentType&&(r.contentType=i.contentType),i.accept&&(r.accept=i.accept),this._fetchJson(e,n,r)})}combineMaterialsToGroups(e){return new Promise((t,n)=>{const i=new Map,s={id:null,label:null,materials:[]},o=[];for(let t=0,n=e.length;t<n;t++){const n=e[t],r=n.tags&&n.tags.length?n.tags.map(e=>({isTag:!0,id:e})):[];n.group&&r.push({isTag:!1,id:xt+n.group,legacyId:n.group}),r.length||r.push({isTag:!1,id:null}),n.tags&&n.tags.length&&n.tags.forEach(e=>-1===o.indexOf(e)?o.push(e):null),r.forEach(({isTag:e,id:t,legacyId:o})=>{const r=n.id;let a=t?Ft(t):[];a||(St.set(t,[]),a=Ft(t)),-1===a.indexOf(r.toString())&&a.push(r.toString());const l=Vt(n),h=l&&e,c=Gt(n);if(h||c&&!e||!l&&!c&&!t){let e=t?i.get(t):s;e||(i.set(t,{id:t,label:n.groupLabel,legacyId:o,materials:[]}),e=i.get(t)),e.materials.push(n)}})}const r=s.materials.length?[s]:[];this.getTags(o).then(e=>{const n=e.reduce((e,t)=>(e[t.id]=t,e),{});return i.forEach((e,t)=>{r.push({id:t,label:n[t]?n[t].label:e.label,materials:e.materials,legacyId:e.legacyId,sort:n[t]?n[t].sort:void 0})}),t(r)},n)})}_getByIds(e,t,n={}){const i=this._getCache(t),s=this._getErrorCache(t),o=[],r=[...new Set(e)];let a=r.length;if(i&&i.size){const e=(new Date).getTime();for(let t=0;t<a;t++){const n=r[t],l=i.get(n),h=s.get(n);let c=!1;null!=l?(o.push(l),c=!0):c=void 0!==h&&(e-h.timestamp<6e4||!1===navigator.onLine),c&&(r.splice(t,1),a--,t--)}}return new Promise((e,i)=>{0!==r.length&&navigator.onLine?this._getByIdsPackets(r,t,n).then(t=>{e([...t,...o])},i):e(o)})}_getByIdsPackets(e,t,n={}){const i=n.filterKey||"ids";let s,o="/"+t+"/",r="?",a=[];const l=e.length;if(!l)return new Promise(e=>e([]));let h=!0,c=[];for(s=0;s<l;s++){h=!1;const n=e[s],l=r+i+"[]="+n,d=l.length+o.length;c.push(n),r="&",d<=1500?o+=l:(d>1500&&(c.pop(),s--),a.push({url:o,ids:c}),h=!0,o="/"+t+"/",r="?",c=[])}h||a.push({url:o,ids:c});const d=[];return a.forEach(e=>d.push(this._getByIdsSingle(e.ids,e.url,t,n))),new Promise((e,t)=>{Promise.all(d).then(t=>{const n=[];t.length&&t.forEach(e=>n.push(...e)),e(n)},t)})}_getByIdsSingle(e,t,n,i={}){return new Promise((s,o)=>{this._get(t,n,i).then(t=>{for(let n=0,s=t.length;n<s;n++){const s=i&&i.cacheKey?t[n][i.cacheKey]:t[n].id,o=e.indexOf(s.toString());-1!==o&&e.splice(o,1)}const o=e.length;if(o){const t=this._getCache(n),i=this._getErrorCache(n),s=(new Date).getTime();for(let n=0;n<o;n++)i.set(e[n],{code:0,timestamp:s}),t.delete(e[n]);this._errorHandler.dispatch(2,[n,e.map(e=>'"'+e+'"').join(",")])}s(t)},o)})}_getById(e,t,n={}){if(!e||""===e||"string"!=typeof e)return console.error("no id passed to _getById"),Promise.reject(new Error("no id passed to _getById"));const i=this._getCache(t).get(e);if(i)return new Promise(e=>e(i));if(!navigator.onLine)return Promise.reject("Nothing cached but tried to fetch in offline mode");const s={...n,id:e},o=n.pathSuffix||"";return this._get("/"+t+"/"+e+o,t,s)}_get(e,t,n={}){const i=ct.useHDGeometry?"includeGeometryHD=true":"";let s=-1===e.indexOf("?")?"?":"&";return""!==i&&(e+=s+i),n.embed&&Array.isArray(n.embed)&&n.embed.forEach(t=>{e+=s+"embed"+(t[0].toUpperCase()+t.substr(1))+"=true",s="&"}),new Promise((i,s)=>{const o=jt.get(e);Array.isArray(o)&&o.length>0?o.push({resolve:i,reject:s}):(jt.set(e,[{resolve:i,reject:s}]),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 i=Tt.server;const s=this._globalInitData.overrideRapi;s&&(i="live"===s?Tt.liveServer:Tt.testServer),(this._globalInitData.customApiUrl||""===this._globalInitData.customApiUrl)&&(i=this._globalInitData.customApiUrl);const o=new Request(i+e,n);this._globalCallback.onNetworkRequest(e,n,t);const r=await this._globalCallback.onCheckExternalCache(e,n);return r?{headers:{get:()=>"application/json"},json:()=>Promise.resolve(r)}:this._networkLayer.fetch(o,{},{checkResponse:e=>this._globalCallback.onValidateNetworkResponse("rapi-access",e)})}_createHeaders(e={}){const t={...It};this._globalInitData.overrideTenant&&(t.currentTenant=this._globalInitData.overrideTenant),this._globalInitData.overrideCountry&&(t.country=this._globalInitData.overrideCountry);const n=this._globalInitData.locale||"en";t.language=n,t.locale=n;const{contentType:i,accept:s,additionalHeaders:o,data:r}=e;if(i&&(t["content-type"]=e.contentType),s&&(t.accept=e.accept),o)for(let e in o)o.hasOwnProperty(e)&&(t[e]=o[e]);this._globalInitData.configuratorId&&(t.configurator=this._globalInitData.configuratorId);const a=this._currentToken||kt;t.token="03-"+window.btoa((new Date).toISOString()+";"+a+";"+It.apiKey);const l=new Headers(t);return r instanceof FormData&&l.delete("content-type"),l}_handleJson(e,t,n={}){return i=>{let s=null,o=null;"number"==typeof i&&(s=i);for(let e in i)"meta"!==e&&i.hasOwnProperty(e)&&(s=i[e],o=e);if("error"===o)return this._handleError(e,n)(new Error(JSON.stringify(s)));if(!s)throw new TypeError("RAPI returned empty JSON");if(Array.isArray(s))for(let e=0,i=s.length;e<i;e++)this._prepareData(s[e],t,n),this._prepareEmbeddedData(s[e],t,n);else this._prepareData(s,t,n),this._prepareEmbeddedData(s,t,n);n.resolve?n.resolve(s):this._notifyWaiters(e,null,s)}}_prepareEmbeddedData(e,t,n={}){n.embed&&Array.isArray(n.embed)&&n.embed.forEach(i=>{const s=e[i.slice(0,-1)+"Objects"];if(Array.isArray(s)){for(let e=0,t=s.length;e<t;e++)this._prepareData(s[e],i,n);this._prepareRelationalData(t,i,e.id,s)}else s&&(this._prepareData(s,i,n),this._prepareRelationalData(t,i,e.id,[s]))})}_getCache(e){return this._getCacheFrom(e,Ht)}_getErrorCache(e){return this._getCacheFrom(e,Bt)}_getCacheFrom(e,t){let n=t.get(e);return n||(t.set(e,new Map),n=t.get(e)),n}_setCache(e,t,n){n.set(e.toString(),t)}_prepareData(e,t,n=null){let i=this._getCache(t);const s=n&&n.cacheKey?e[n.cacheKey]:e.id;if(s||n&&n.id||"tenants/me"===t)if("tenants/me"!==t){{const t=s||n.id;this._setCache(t,e,i)}e.__rapi_path__=t}else this._setCache("0",e,i);else"shortIds"!==t&&console.error("Can not cache because there is no ID!")}_getRelationsCacheFor(e,t,n){let i=Lt.get(t);if(!i){const s=new Map,o=new Map;o.set(n,void 0),s.set(e,o),Lt.set(t,s),i=Lt.get(t)}let s=i.get(e);if(!s){const t=new Map;t.set(n,void 0),i.set(e,t),s=i.get(e)}return s.get(n)}_prepareGroups(e){const t=e.group,n=e.id;let i=Ft(t);i||(St.set(t,[]),i=Ft(t)),-1===i.indexOf(n.toString())&&i.push(n.toString())}_handleError(e,t={}){return n=>{navigator.onLine?(n.rmlErrorCode=1,n.message='Failed to load "'+e+'" because of "'+n.message+'"',this._errorHandler.dispatch(1,[n])):(n.rmlErrorCode=0,n.message='Failed to load "'+e+'" because of "'+n.message+'"',this._errorHandler.dispatch(0,[n])),t.reject?t.reject(n):this._notifyWaiters(e,n,null)}}_getRelationData(e,t,n={}){const i=e.id;if(!i)return Promise.resolve([]);const s=e.__rapi_path__,o=t.rapiPath;let r=this._getCache(o),a=this._getRelationsCacheFor(i.toString(),s,o),l=[];return a?(a.forEach(e=>l.push(r.get(e))),new Promise(e=>e(l))):navigator.onLine?new Promise((e,t)=>{this._get("/"+s+"/"+i+"/"+o,o,n).then(t=>{this._prepareRelationalData(s,o,i,t),e(t)},t)}):Promise.resolve([])}_prepareRelationalData(e,t,n,i){Lt.has(e)||Lt.set(e,new Map);let s=Lt.get(e);const o=n.toString();s.has(o)||s.set(o,new Map);let r=s.get(o),a=this._getCache(t),l=[];for(let e=0,t=i.length;e<t;e++){const t=i[e],n=t.id.toString();l.push(n),a.set(n,t)}r.set(t,l)}_notifyWaiters(e,t,n){const i=jt.get(e);if(i&&i.length){for(let e=0,s=i.length;e<s;e++)t?i[e].reject(t):i[e].resolve(n);jt.delete(e)}}_tenantMe(){return new Promise((e,t)=>{const n=this._getCache("tenants/me"),i=this._globalInitData.overrideTenant?this._globalInitData.overrideTenant:n.get("0");if(i)return e(i);this._fetchJson("/tenants/me","tenants/me",{resolve:t=>e(t),reject:t})})}async getTenant(e){return e||(e=await this._tenantMe()),this._getById(e.toString(),"tenants")}getCurrentSkin(){return this._tenantMe().then(e=>this._getById(e.toString(),"tenants").then(e=>this._getById(e.skin.toString(),"skins")))}getPrices(e){return this._getByIds(e,"prices",{filterKey:"priceIds",cacheKey:"priceId"})}async getConfiguratorSettings(e){const t=await this._getById(e,"configurators");return t.allowedHosts||(t.allowedHosts=[]),t.allowedHosts&&!Array.isArray(t.allowedHosts)&&(t.allowedHosts=t.allowedHosts.split(" ")),t}sendUserAction(e){return this._save("/userActions",{userAction:e},"userActions",{accept:"application/json",contentType:"application/json; charset=UTF-8"})}shareConfiguration(e,t,n){const i="/configurations/"+e+"/shares",s=new FormData;return s.append("email",t),s.append("type",n.toString()),new Promise((e,t)=>{const n={method:"POST",data:s,resolve:e,reject:t,accept:"application/json",contentType:"application/json; charset=UTF-8"};this._fetch(i,n).then(n.resolve,n.reject)})}export3D(e,t,n,i={}){const s="/configurations/"+e+"/3d-exports",o={formats:[{file_format:n,pack_external_data:!0,...i}]},r=JSON.stringify(o),a=new FormData;return a.append("email",t),a.append("settings",r),new Promise((e,t)=>{const n={method:"POST",data:a,resolve:e,reject:t};this._fetch(s,n).then(n.resolve,n.reject)})}async trackView(e){if(this._itemLoaded||(t=(()=>{var e;const t=(()=>{if(window.__RML__ENV__&&window.__RML__ENV__.skipIframeCheck)return!1;try{return window.self!==window.top}catch(e){return!0}})();let n=null===(e=null===window||void 0===window?void 0:window.location)||void 0===e?void 0:e.href;if(!n)return null;if(t){if(!document.referrer)return null;n=document.referrer}const{hostname:i}=new URL(n);return i})())&&(ae.includes(t)||t.endsWith("gitlab.io")||t.endsWith("gitlab.com")||t.endsWith("codesandbox.io")||t.endsWith("stackblitz.com")||/^(admin.*.roomle.com)$/.test(t)))return;var t;const{configuratorId:n}=this._globalInitData,i={module:3,action:1,actionId:e,actionLabel:n};await this.sendUserAction(i),this._itemLoaded=!0}signinUser(e,t){return new Promise((n,i)=>{const s={method:"POST",accept:"application/json",contentType:"application/json; charset=UTF-8",data:JSON.stringify({identification:e,passwordMD5:t}),cacheKey:"token",resolve:n,reject:i};this._fetchJson("/auth/signin","auth",s)})}async signoutUser(e){const t=this._currentToken;t!==e&&this.setCurrentToken(e),await this._fetch("/auth/signout",{}),t&&t!==e?this.setCurrentToken(t):this.removeCurrentToken()}async savePlan(e){const t=e.id?"/plans/"+e.id:"/plans";return this._save(t,{plan:e},"plans",{method:e.id?"PUT":"POST",accept:"application/json",contentType:"application/json; charset=UTF-8"})}async savePlanSnapshot(e){return this._save("/planSnapshots",{planSnapshot:e},"planSnapshots",{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}}}e("R",Kt),v([ie],Kt.prototype,"_formDataUtil",void 0),v([ie],Kt.prototype,"_errorHandler",void 0),v([ie],Kt.prototype,"_dataSyncer",void 0),v([ie],Kt.prototype,"_networkLayer",void 0),v([ie],Kt.prototype,"_localStorage",void 0),v([ie],Kt.prototype,"_globalInitData",void 0),v([ie],Kt.prototype,"_globalCallback",void 0);const zt=e("q",1500),Wt=e("p",5);function Nt(){class e extends THREE.Object3D{static _generateOutline(e,t){let n=new THREE.LineSegments(new THREE.EdgesGeometry(e),new THREE.LineDashedMaterial({color:"#000000",dashSize:.03,gapSize:.01,linewidth:1}));return n.translateOnAxis(t,1),n.userData.ignoreComponentRaycast=!0,n}static cloneDockLine(e,t){let n=new THREE.LineSegments(e.geometry,e.material);return n.translateOnAxis(t.getCenter(new THREE.Vector3),1),n.name="dockline",n.layers.set(5),n.userData.ignoreComponentRaycast=!0,n}_setValues(e,t,n,i){e&&(this.runtimeId=e,this.name=e.toString()),t&&(this.roomlePosition=Object.assign({},t)),n&&(this.roomleRotation=Object.assign({},n)),i&&(this.parentObjectId=i)}constructor(e,t,n,i){super(),this._selected=!1,this.geometryChanged=!0,this.meshes=[],this.castShadow=!1,this.receiveShadow=!0,this._setValues(e,t,n,i)}get loadingMesh(){return this._loadingMesh}get boundingBoxMesh(){return this._boundingBoxMesh}get boundingBox(){return this._boundingBox}set roomlePosition(e){this._roomlePosition=e,e&&this.position.set(e.x/1e3,e.z/1e3,e.y/-1e3)}get roomlePosition(){return this._roomlePosition}set roomleRotation(e){this._roomleRotation=e,e&&this.rotation.set(e.x,e.z,-e.y)}get roomleRotation(){return this._roomleRotation}replaceMeshes(e){this.removeAllMeshes(),e.forEach(e=>{this.addMesh(new THREE.Mesh(e.geometry,e.material))})}addMesh(e,t){e.renderOrder=2,e.userData.meshType=0,t&&e.applyMatrix4(O(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),X(e),t<0||this.meshes.splice(t,1)}removeAllMeshes(e=!0){this.meshes.forEach(t=>{this.remove(t),e&&X(t)}),this.meshes=[],this._removeLoadingMesh(),this.remove(this._boundingBoxMesh),X(this._boundingBoxMesh),this._boundingBoxMesh=null}_hideAllMeshes(){this.meshes.forEach(e=>e.visible=!1)}_showAllMeshes(){this.meshes.forEach(e=>e.visible=!0)}select(){this._selected=!0}loading(){if(!this._kernelBoundingBox)return void console.warn("Bounding box (box for measurements) for component "+this.runtimeId+" not set, can not show external mesh loading box!");this._removeLoadingMesh(),this._hideAllMeshes();const{x:e,y:t,z:n}=this._kernelBoundingBox.getSize(new THREE.Vector3);let i=new THREE.BoxGeometry(e,t,n);this._loadingMesh=new THREE.Mesh(i,new THREE.MeshStandardMaterial({transparent:!0,opacity:1,color:new THREE.Color("#DDDDDD")})),this._loadingMesh.name="loading mesh",this._loadingMesh.receiveShadow=!1,this._loadingMesh.castShadow=!1,this._loadingMesh.layers.set(5),this._loadingMesh.translateOnAxis(this._kernelBoundingBox.getCenter(new THREE.Vector3),1),this._loadingMesh.renderOrder=3,this.add(this._loadingMesh)}_removeLoadingMesh(){this._loadingMesh&&(this.remove(this._loadingMesh),X(this._loadingMesh),this._loadingMesh=null)}loadingFinished(){this._removeLoadingMesh(),this._showAllMeshes()}deselect(){this._selected=!1}hoverOn(){E("pointer")}hoverOff(){E("default")}removeFromParent(){this.parent&&(this.parent.remove(this),this.removeAllMeshes())}computeBoundingBox(t,n=!1){if(this._boundingBoxMesh&&this.remove(this._boundingBoxMesh),!n&&t&&0===t.size.x&&0===t.size.y&&0===t.size.z)return;let i;if(!t||n){this._boundingBox=new THREE.Box3;let e=new THREE.Vector3;this.meshes.forEach(t=>{if(t.geometry instanceof THREE.Geometry){let n=t.geometry.vertices;for(let i=0,s=n.length;i<s;i++)e.copy(n[i]),e.applyMatrix4(t.matrix),this._boundingBox.expandByPoint(e)}else if(t.geometry instanceof THREE.BufferGeometry){let n=t.geometry.attributes.position;if(void 0!==n)for(let i=0,s=n.count;i<s;i++)e.fromBufferAttribute(n,i).applyMatrix4(t.matrix),this._boundingBox.expandByPoint(e)}}),this._kernelBoundingBox=this._boundingBox.clone();let t=this._boundingBox.max.x-this._boundingBox.min.x,n=this._boundingBox.max.y-this._boundingBox.min.y,s=this._boundingBox.max.z-this._boundingBox.min.z;i=new THREE.BoxGeometry(t,n,s)}else{this._kernelBoundingBox=A(t),this._boundingBox=this._kernelBoundingBox.clone();let{x:e,y:n,z:s}=this._boundingBox.getSize(new THREE.Vector3);i=new THREE.BoxGeometry(e,n,s)}this._boundingBoxMesh=new THREE.Mesh(i,new THREE.MeshStandardMaterial({color:"#FFFFFF",transparent:!0,opacity:0,polygonOffset:!0,polygonOffsetFactor:-1,visible:!1})),this._boundingBoxMesh.name="bounding box mesh";let s=this._boundingBox.getCenter(new THREE.Vector3);this._boundingBoxMesh.position.add(s),this._boundingBoxMesh.layers.set(5),this._boundingBoxMesh.renderOrder=3,this._boundingBoxMesh.castShadow=!1,this._boundingBoxMesh.receiveShadow=!1,this.add(this._boundingBoxMesh),this._dockline=e._generateOutline(i,s),this._dockline.name="bounding box outline",this._dockline.layers.set(5),this._selected&&this.add(this._dockline)}recursiveMeshes(){let t=this.meshes.slice();return this.children.forEach(n=>{n instanceof e&&t.push(...n.recursiveMeshes())}),t}isChild(t){let n=!1;return this.children.forEach(i=>{i instanceof e&&!n&&(n=i.runtimeId===t||i.isChild(t))}),n}getKernelPosition(e){let t=this.parent.localToWorld(this.position);return S(e.worldToLocal(t))}}class t extends e{constructor(e,t){super(e,null,null,null),this.glbUrl=t}}class n extends e{constructor(e,t,n,i,s){super(t,n,i,s),this._stringId=null,this.receivedPointAssociation=!1,this.castShadow=!1,this.receiveShadow=!1,this._creator_=e}get stringId(){return this._stringId?this._stringId:this.runtimeId.toString()}addMesh(e,t){super.addMesh(e,t),e.material instanceof THREE.MeshStandardMaterial&&(e.material.opacity=.8,e.material.roughness=1,e.material.metalness=0,e.material.color=new THREE.Color(this._initData.colors.PREVIEW_DOCKING_COLOR)),e.renderOrder=1,e.castShadow=!1,e.receiveShadow=!1}startPulsating(){var e,t;if(null===(t=null===(e=this._initData)||void 0===e?void 0:e.featureFlags)||void 0===t?void 0:t.pulsePreview)for(const e of this.meshes){const t={opacity:.8},n={opacity:.3};new TWEEN.Tween(t).to(n,zt).easing(TWEEN.Easing.Sinusoidal.In).onUpdate(()=>{e.material.opacity=t.opacity}).yoyo(!0).repeat(Wt).start()}}hoverOn(){this.remove(this._dockline),this.meshes.forEach(({material:e})=>{e.opacity=.9,e.roughness=1,e.metalness=0,e.color=new THREE.Color(this._initData.colors.PREVIEW_DOCKING_COLOR)}),E("pointer")}hoverOff(){this.add(this._dockline),this.meshes.forEach(({material:e})=>{e.opacity=.8,e.roughness=1,e.metalness=0,e.color=new THREE.Color(this._initData.colors.PREVIEW_DOCKING_COLOR)}),E("default")}clonePreview(t){const i=new n(this._creator_,this.runtimeId,this.roomlePosition,this.roomleRotation,this.parentObjectId);return i._stringId=this.runtimeId+"_"+t,this.children.forEach(e=>{e instanceof THREE.Mesh&&0===e.userData.meshType&&i.meshes.push(e.clone(!0))}),i.meshes.forEach(e=>{e.material=e.material.clone(),e.geometry=e.geometry.clone(),i.add(e)}),this._dockline&&(i._dockline=e.cloneDockLine(this._dockline,this._boundingBox)),this._boundingBoxMesh&&(i._boundingBoxMesh=this._boundingBoxMesh.clone(!0)),this._boundingBox&&(i._boundingBox=this._boundingBox.clone()),i}preparePreview(){this.add(this._dockline),this.add(this._boundingBoxMesh)}}v([ie],n.prototype,"_initData",void 0);class i extends n{constructor(e,t,n,i,s,o){super(e,t,n,i,s),o&&(this._stringId=this.runtimeId+"_has_additional_dock_point_copy")}set roomleLineFrom(e){this._roomleLineFrom=e,this.lineFrom=k(e)}get roomleLineFrom(){return this._roomleLineFrom}set roomleLineTo(e){this._roomleLineTo=e;let t=k(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=k(e)}get roomlePositionFrom(){return this._roomlePositionFrom}set roomlePositionTo(e){this._roomlePositionTo=e;let t=k(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,E("pointer")}hoverOff(){this._dockline.visible=!1,E("default")}preparePreview(){super.preparePreview(),this._dockline.visible=!1;let e=this.lineTo.clone(),t=this.lineFrom.clone();const n=(new THREE.Vector3).subVectors(e,t);let i=n.length(),s=n.normalize(),o=new THREE.ArrowHelper(s,t),r=new THREE.CylinderGeometry(.01,.01,i,16,1);this.lineMesh=new THREE.Mesh(r,new THREE.MeshStandardMaterial({color:"#DDDDDD",transparent:!0,opacity:.4})),this.lineMesh.name="line mesh";const a=(new THREE.Quaternion).setFromEuler(o.rotation);this.lineMesh.quaternion.multiply(a),this.lineMesh.renderOrder=1;let l=(new THREE.Vector3).addVectors(e,t).multiplyScalar(.5);this.lineMesh.position.copy((new THREE.Vector3).subVectors(l,this.position.clone())),this.add(this.lineMesh);let h=this._boundingBox.getCenter(new THREE.Vector3).applyEuler(this.docklineRotation),c=null,d=0,u=Math.abs(s.x),_=Math.abs(s.y),p=Math.abs(s.z);u>=_&&u>=p?(c=new THREE.Vector3(h.x,0,0),d=Math.sqrt(h.y*h.y+h.z*h.z)):_>=u&&_>=p?(c=new THREE.Vector3(0,h.y,0),d=Math.sqrt(h.x*h.x+h.z*h.z)):p>=_&&p>=u&&(c=new THREE.Vector3(0,0,h.z),d=Math.sqrt(h.y*h.y+h.x*h.x)),d=d>0?d:.01;let g=(new THREE.Vector3).subVectors(this.positionTo.clone(),this.positionFrom.clone()).length()+c.length(),m=new THREE.CylinderGeometry(1.1*d,1.1*d,g,32,1);this.boundingLineMesh=new THREE.Mesh(m,new THREE.MeshStandardMaterial({color:"#ffffff",transparent:!0,opacity:0})),this.boundingLineMesh.name="bounding line mesh",this.boundingLineMesh.userData.ignoreComponentRaycast=!0,this.boundingLineMesh.layers.set(5);let f=this.positionTo.clone(),E=this.positionFrom.clone(),w=(new THREE.Vector3).subVectors(f,E).normalize(),C=new THREE.ArrowHelper(w,E);const y=(new THREE.Quaternion).setFromEuler(C.rotation);this.boundingLineMesh.quaternion.multiply(y),this.boundingLineMesh.renderOrder=3;let b=(new THREE.Vector3).addVectors(this.positionTo.clone(),this.positionFrom.clone()).multiplyScalar(.5).add(h);this.boundingLineMesh.position.copy((new THREE.Vector3).subVectors(b,this.position.clone())),this.add(this.boundingLineMesh)}clonePreviewLine(t){let n=new i(this._creator_,this.runtimeId,this.roomlePosition,this.roomleRotation,this.parentObjectId,this.receivedPointAssociation);return n._stringId=this.runtimeId+"_"+t,this.children.forEach(e=>{e instanceof THREE.Mesh&&0===e.userData.meshType&&n.meshes.push(e.clone(!0))}),n.meshes.forEach(e=>{e.material=e.material.clone(),e.geometry=e.geometry.clone(),n.add(e)}),this._dockline&&(n._dockline=e.cloneDockLine(this._dockline,this._boundingBox)),this._boundingBoxMesh&&(n._boundingBoxMesh=this._boundingBoxMesh.clone(!0)),this._boundingBox&&(n._boundingBox=this._boundingBox.clone()),n}getPositionForIntersectionPoint(e){let t=this._boundingBox.getCenter(new THREE.Vector3).applyEuler(this.docklineRotation),n=this.positionTo.clone().add(t),i=this.positionFrom.clone().add(t),s=new THREE.Line3(i,n).closestPointToPoint(e,!0,new THREE.Vector3);return(isNaN(s.x)||isNaN(s.y)||isNaN(s.z))&&s.copy(e),s.sub(t)}updatePreviewPosition(e){let t=this.getPositionForIntersectionPoint(e),n=this.parent.localToWorld(t);this._newPosition=this.worldToLocal(n);let i=this._boundingBox.getCenter(new THREE.Vector3).applyEuler(this.docklineRotation);this._dockline.position.copy((new THREE.Vector3).addVectors(this._newPosition,i)),this._dockline.rotation.copy(this.docklineRotation)}hideSelectionLine(){this._dockline.visible=!1}getKernelPosition(e){if(this._newPosition){let t=this.localToWorld(this._newPosition);return S(e.worldToLocal(t))}return super.getKernelPosition(e)}}class s extends THREE.OrthographicCamera{constructor(e,t,n,i,s,o,r){super(e,t,n,i,s,o),r||(r={left:0,top:1,right:1,bottom:0}),this.offset=r}set offset(e){this._offset=e,this.updateProjectionMatrix()}get offset(){return this._offset}updateProjectionMatrix(){this._offset?(this.projectionMatrix=this._calculateProjectionMatrix(),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()):super.updateProjectionMatrix()}_calculateProjectionMatrix(){const e=this._calculate2DPlanes();if(this._offset.left>=this._offset.right||this._offset.bottom>this._offset.top)return(new THREE.Matrix4).makeOrthographic(e.left,e.right,e.top,e.bottom,this.near,this.far);const t=this._scaleRange(e.left,e.right,this._offset.left,this._offset.right);let n=t.from,i=t.to;const s=this._scaleRange(e.bottom,e.top,this._offset.bottom,this._offset.top);let o=s.from,r=s.to;const a=(e.right-e.left)/(e.top-e.bottom),l=(i-n)/(r-o);if(l>a){const e=(o+r)/2,t=(r-o)*l/a;o=e-t/2,r=e+t/2}else{const e=(n+i)/2,t=(i-n)*a/l;n=e-t/2,i=e+t/2}return(new THREE.Matrix4).makeOrthographic(n,i,r,o,this.near,this.far)}_scaleRange(e,t,n,i){const s=(t-e)/(i-n);return{from:e-s*n,to:t+s*(1-i)}}_calculate2DPlanes(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let s=n-e,o=n+e,r=i+t,a=i-t;if(null!==this.view&&this.view.enabled){const e=(this.right-this.left)/this.view.fullWidth/this.zoom,t=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=e*this.view.offsetX,o=s+e*this.view.width,r-=t*this.view.offsetY,a=r-t*this.view.height}return{left:s,right:o,top:r,bottom:a}}}class o extends THREE.PerspectiveCamera{constructor(e,t,n,i,s){super(e,t,n,i),s||(s={left:0,top:1,right:1,bottom:0}),this.offset=s}set offset(e){this._offset=e,this.updateProjectionMatrix()}get offset(){return this._offset}_calculateProjectionMatrix(){let e,t,n,i,s=this.fov*(2*Math.PI/360)/2;n=Math.tan(s),i=-n;let o=Math.atan(this.aspect*Math.tan(s));t=Math.tan(o),e=-t;let r=this._offset.left,a=this._offset.right,l=this._offset.top,h=this._offset.bottom,c=new THREE.Vector2(a-r,l-h),d=new THREE.Vector2(r+c.x/2,h+c.y/2);if(c.x<c.y){let s=(1-d.x)/(c.x/2),o=d.x/(c.x/2);t*=s,e*=o;let r=(s+o)/2;n*=r,i*=r}else{let s=(1-d.y)/(c.y/2),o=d.y/(c.y/2);n*=s,i*=o;let r=(o+s)/2;e*=r,t*=r}e*=this.near,t*=this.near,n*=this.near,i*=this.near;let u=this.near*Math.tan(Math.PI/180*.5*this.fov)/this.zoom*2,_=this.aspect*u;return this.view&&this.view.enabled&&(e+=this.view.offsetX*_/this.view.fullWidth,n-=this.view.offsetY*u/this.view.fullHeight,t+=this.view.offsetX*_/this.view.fullWidth,i-=this.view.offsetY*u/this.view.fullHeight),(new THREE.Matrix4).makePerspective(e,t,n,i,this.near,this.far)}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){this._offset?(this.projectionMatrix=this._calculateProjectionMatrix(),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()):super.updateProjectionMatrix()}}return{create:function(t,n,i,s){return new e(t,n,i,s)},createPreview:function(e,t,i){return new n(i,e,{x:0,y:0,z:0},{x:0,y:0,z:0},t)},createStatic:function(e,n){return new t(e,n)},createPreviewLine:function(e,t){let n=new i(t,e.id,e.roomlePosition,e.roomleRotation,e.parentObjectId,e.receivedPointAssociation);return e.meshes.forEach(e=>{let t=e.clone();t.material=e.material.clone(),t.geometry=e.geometry.clone(),n.addMesh(t)}),n.computeBoundingBox(),n},isPreview:function(e){return e instanceof n},isPreviewLine:function(e){return e instanceof i},createPerspectiveCamera:function(e,t,n,i,s){return new o(e,t,n,i,s)},createOrthographicCamera:function(e,t,n,i,o,r,a){return new s(e,t,n,i,o,r,a)}}}const qt=e("y",9);class Jt{constructor(e){this._mergeThreshold=3,this._componentsToMerge=new Xt,this._mergeInProgress=!1,this._components=new Map,this._previews=new Map,this._componentNumberOfPossibleChildren=new Map,this._creator_=e,this._getKernelAccess().addConfiguratorListener(this),this._componentFactory=Nt()}get materialQueue(){return this.getMeshGenerator().materialQueue}_getKernelAccess(){return dn.lookup("planner-kernel-access",this._creator_)}_applyMeshTransform(e,t,n,i,s){if(n){const i=e.userData.transform=O(n);t&&(e.userData.transform=i),e.applyMatrix4(i)}this._applyMeshUVTransform(e,t,i,s)}_applyMeshUVTransform(e,t,n,i){if(6!==(null==n?void 0:n.length)||(e=>1===e[0]&&0===e[1]&&0===e[2]&&1===e[3]&&0===e[4]&&0===e[5])(n))t&&(t.uvTransform=void 0),i&&(e.geometry=i);else{const s=(e=>{const t=new THREE.Matrix4;return t.set(e[0],e[2],0,e[4],e[1],e[3],0,e[5],0,0,1,0,0,0,0,1),t})(n);t&&(t.uvTransform=s);const o=null!=i?i:e.geometry;if(o&&o.attributes.uv){const t=o.clone();t.attributes.uv.applyMatrix4(s),e.geometry=t}}}_addMeshToSubPart(e,t,n,i,s,o,r,a,l,h){const c=this._generateMesh(e,t,n,o,r,a,l,void 0,void 0,h);this._applyMeshTransform(c,null,i,s),this._subPartObject.add(c)}_addMeshToComponent(e,t,n,i,s,o,r,a,l,h,c,d){if(this._subPartGuard&&this._subPartGuard.info===e)return void this._addMeshToSubPart(e,null,i,null,null,r,a,l,h,d);const u=this.getComponent(e);if(!u)return;const _=this._componentFactory.isPreview(u),p=this._generateMesh(e,n,_?null:i,r,a,l,h,void 0,void 0,d);p.userData.meshId=t,p.userData.geometryId=n,p.userData.materialId=i,this._applyMeshTransform(p,p.userData,s,o),_&&p.layers.set(5),u&&u.addMesh(p),u.meshes.length>this._mergeThreshold&&this._componentsToMerge.set(e,u.meshes.length)}async _changeMeshOfComponent(e,t,n,i,s,o,r){const a=this.getComponent(e);if(!a)return;const l=a.getMeshById(t);if(l){l.userData.geometryId!==n&&console.warn("Geometry of mesh has changed!"),l.userData.materialId=i,l.userData.materialAttributes=r;const e=l.material.clone();await this._configuratorMeshGenerator.setMaterial(l,i,void 0,r),e.opacity!==l.material.opacity&&this._requestRenderCallback&&this._requestRenderCallback(),s&&(l.position.set(0,0,0),l.scale.set(1,1,1),l.rotation.set(0,0,0));const t=this._configuratorMeshGenerator.getGeometry(n);this._applyMeshTransform(l,l.userData,s,o,t)}}_removeMeshFromComponent(e,t){const n=this.getComponent(e);n&&n.removeMeshById(t)}getComponent(e){let t=this._components.get(e);return t||(t=this._previews.get(e.toString()),t)?t:(console.warn("component not found!",e),null)}getNumberOfPossibleChildrenForComponent(e){if(this._componentNumberOfPossibleChildren.has(e))return this._componentNumberOfPossibleChildren.get(e);const t=this._getKernelAccess().kernelInstance.getPlanComponentPossibleChildren(e).length;return this._componentNumberOfPossibleChildren.set(e,t),t}tryToMergeComponents(){this._initData.moc||this._mergeInProgress||(this._mergeInProgress=!0,this._componentsToMerge.size,this._requestMergeComponents())}_requestMergeComponents(){window.requestIdleCallback(this._mergeNextComponent.bind(this))}_mergeNextComponent(){if(this._componentsToMerge.size>0){const e=this._componentsToMerge.largestValue();this._componentsToMerge.delete(e),this._mergeComponent(e),this._requestMergeComponents()}else this._mergeInProgress=!1,this._geometriesMerged&&this._geometriesMerged(),this._components.forEach(e=>{e.loadingMesh&&console.warn("component still has loading mesh: ",e.hash)})}_mergeComponent(e){const t=this._components.get(e);if(t&&!(t.meshes.length<=this._mergeThreshold))if(this._cacheHolder.componentCache.has(t.hash)){const e=this._cacheHolder.componentCache.get(t.hash).meshes;t.replaceMeshes(e)}else{const e=new Map,n=[],i=[];t.meshes.forEach(t=>{const s=t.userData.materialId;if(!s)return void console.warn("mesh has no material id set");if(!e.has(s)){const i=new THREE.Mesh(new THREE.Geometry,t.material);i.userData.materialId=s,i.receiveShadow=!0,i.castShadow=!0,i.layers.set(3),this._setMaterial(i,s),n.push(i),e.set(s,i)}const o=e.get(s).geometry;t.userData.transform?o.merge(t.geometry,t.userData.transform):o.merge(t.geometry),i.push(t)}),n.forEach(e=>t.addMesh(e)),i.forEach(e=>t.removeMesh(e)),this._cacheHolder.componentCache.set(t.hash,t)}}_addRootComponent(e){this._listener&&this._listener.display(e)}removeDockingComponent(){this._getKernelAccess().requestDeleteComponent(this._configuratorContext.dockingRootComponentId),this._configuratorContext.dockingRootComponentId=null}dockComponent(e,t,n,i){let s=this._components.get(t),o=this._components.get(e);o&&(o.roomlePosition=n,o.roomleRotation=i,s&&s.add(o))}dockComponentWithPosition(e,t){let n,i=this._components.get(e.parentId);n=t?t.getKernelPosition(i):e.getKernelPosition(i);const s=ht.start("dock_component_with_position_"+e.childId);this._getKernelAccess().dockComponentWithPosition(e.parentId,e.parentDockId,e.childId,e.childDockId,n),this._configuratorContext.dockingRootComponentId=null,ht.end(s)}removePreviews(){this._previews.size>0&&(this._previews.forEach(e=>{e.removeFromParent(),e.removeAllMeshes()}),this._previews.clear())}_updatePlanObject(e){const t=this._components.get(e.rootPlanComponentId);let n=!0;t&&(n=t.geometryChanged),this._listener&&this._listener.planObjectUpdated(e,n)}Editor3dAddBakedMesh(e,t,n,i,s,o,r,a){this._addMeshToComponent(e,null,null,t,null,null,n,i,s,o,r,a)}Editor3dAddDockPreview(e,t){const n=this._componentFactory.createPreview(t,e,this._creator_);this._previews.set(t.toString(),n)}Editor3dAddNamedMesh(e,t,n,i,s,o,r,a,l,h,c,d){this._addMeshToComponent(e,t,n,i,s,c,o,r,a,l,h,d)}async Editor3ChangedNamedMesh(e,t,n,i,s,o,r){await this._changeMeshOfComponent(e,t,n,i,s,o,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,i,s){s&&(this._configuratorContext.rootComponentId=e);let o=null;this._components.has(e)?(o=this._components.get(e),o.removeAllMeshes()):(o=this._componentFactory.create(e,t,n,i),o.layers.set(3)),this._components.set(e,o),s&&this._addRootComponent(o)}Editor3dComponentDocked(e,t,n,i){this.dockComponent(e,t,n,i)}Editor3dEndConstruction(e){if(this._subPartGuard&&this._subPartGuard.info===e)return void this._subPartGuard.resolve(this._subPartObject);const t=this._getKernelAccess().kernelInstance.getComponent(e),n=this._components.get(e);n&&(n.computeBoundingBox(t.boxForMeasurement),n.boundingBoxMesh&&this._listener&&this._listener.addComponentHandlers(n));let i=this._previews.get(e.toString());i&&i.computeBoundingBox(t.boxForMeasurement,!0)}Editor3dGeometryReady(e){const t=this._components.get(e);t&&t.loadingFinished()}Editor3dGeometryNotReady(e){const t=this._components.get(e);t&&t.loading()}Editor3dPlanObjectConstructionDone(e){const t=this._getKernelAccess().kernelInstance.getPlanObject(e),n=[t,this._getKernelAccess().kernelInstance.getFullPartList(),this._getKernelAccess().kernelInstance.getHashOfConfiguration(e),this._getKernelAccess().kernelInstance.getComponentId(t.rootPlanComponentId)];_t.finishOperation(2,n),this._updatePlanObject(t),this._listener&&this._listener.planObjectConstructionDone(t)}Editor3dPreviewConstructionDone(e,t){let n=!1;this._previews.forEach(e=>{null!==e.parent&&(this._listener&&(this._componentFactory.isPreviewLine(e)?this._listener.addPreviewLineHandlers(e):this._listener.addPreviewHandlers(e)),n=!0)}),this._listener&&this._listener.previewConstructionDone(this._components.get(e),n)}Editor3dSetPreviewLineAssociations(e,t){let n=this._previews.get(t.toString());if(n.clear(),!n)return;let i=this._componentFactory.createPreviewLine(n,this._creator_),s=this._components.get(this._configuratorContext.rootComponentId);for(let t=0;t<e.length;t++){let n;n=0===t?i:i.clonePreviewLine(t),n.name="Preview Line",n.parentDockId=e[t].parentDockId,n.parentId=e[t].parentId,n.childDockId=e[t].childDockId,n.childId=e[t].childId,n.docklineRotation=(o=e[t].rotation,new THREE.Euler(o.x,o.z,-o.y)),n.roomlePosition=e[t].position,e[t].lineFrom.x>e[t].lineTo.x||e[t].lineFrom.y>e[t].lineTo.y||e[t].lineFrom.z>e[t].lineTo.z?(n.roomleLineFrom=e[t].lineTo,n.roomleLineTo=e[t].lineFrom):(n.roomleLineFrom=e[t].lineFrom,n.roomleLineTo=e[t].lineTo),e[t].positionFrom.x>e[t].positionTo.x||e[t].positionFrom.y>e[t].positionTo.y||e[t].positionFrom.z>e[t].positionTo.z?(n.roomlePositionFrom=e[t].positionTo,n.roomlePositionTo=e[t].positionFrom):(n.roomlePositionFrom=e[t].positionFrom,n.roomlePositionTo=e[t].positionTo),s.add(n),n.preparePreview(),this._previews.set(n.stringId,n)}var o}Editor3dSetPreviewPointAssociations(e,t){let n=this._previews.get(t.toString());if(!n)return;let i=this._components.get(this._configuratorContext.rootComponentId);for(let t=0;t<e.length;t++){let s;0===t?s=n:(s=n.clonePreview(t),this._previews.set(s.stringId,s)),s.name="Preview Point",s.parentDockId=e[t].parentDockId,s.parentId=e[t].parentId,s.childDockId=e[t].childDockId,s.childId=e[t].childId,s.preparePreview(),s.receivedPointAssociation=!0,s.userData.ignoreComponentRaycast=!0,i.add(s),s.roomlePosition=e[t].position,s.roomleRotation=e[t].rotation,s.startPulsating()}}componentDeleted(e){const t=this._components.get(e);t&&(this._listener&&this._listener.componentDeleted(t),t.removeFromParent(),t.removeAllMeshes(),this._components.delete(e))}componentMetaUpdated(e){const t=this._getRuntimeComponent(e.id);t&&(t.hash=e.hash,t.roomlePosition=e.position,t.roomleRotation=e.rotation,e.boxForMeasurement&&t.computeBoundingBox(e.boxForMeasurement),this._listener&&this._listener.componentUpdated(t,e))}componentConfigurationUpdated(e,t){const n=this._getRuntimeComponent(e);n&&(n.geometryChanged=t)}_getRuntimeComponent(e){let t=this._components.get(e);return t||(t=this._previews.get(e.toString()),t)?t:null}configurationLoaded(e,t,n,i,s){10===e&&(this._configuratorContext.dockingRootComponentId=n);let o=0===t;o?this._getKernelAccess().kernelInstance.requestPlanComponentConstructionRecursive(n):this._getKernelAccess().kernelInstance.requestPlanObjectConstruction(t);let r=this._getKernelAccess().kernelInstance.getComponent(n),a=this._components.get(n);a&&(a.computeBoundingBox(r.boxForMeasurement),a.hash=r.hash),this._listener&&this._listener.configurationLoaded(a,o&&void 0!==a.boundingBoxMesh)}finishParameterChange(e,t){this.materialQueue.registerCallback(e)}planObjectConfigurationUpdated(e,t,n){let i=this._getKernelAccess().kernelInstance.getPlanObject(e);this._updatePlanObject(i)}planObjectCreated(e,t){this._configuratorContext.planObjectId=t,this._listener&&this._listener.clearScene()}planObjectUpdated(e){this._updatePlanObject(e)}sceneCleared(){this._components.forEach((function(e){e.removeFromParent(),e.removeAllMeshes()})),this._components.clear(),this._componentNumberOfPossibleChildren.clear(),this._previews.forEach(e=>{e.removeFromParent(),e.removeAllMeshes()}),this._previews.clear()}setListener(e){this._listener=e}getBoundingBox(){if(this._configuratorContext.planObjectId){const e=this._getKernelAccess().kernelInstance.getPlanObject(this._configuratorContext.planObjectId);if(e&&e.boxForMeasurement)return A(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())}hasPreviewLines(){for(const e of this._previews.values())if(this._componentFactory.isPreviewLine(e))return!0;return!1}isPreviewLine(e){return this._componentFactory.isPreviewLine(e)}isPreview(e){return this._componentFactory.isPreview(e)}setGeometriesMergedListener(e){this._geometriesMerged=e}removeGeometriesMergedListener(){this._geometriesMerged=void 0}setMergeThreshold(e){this._mergeThreshold=e}_generateMesh(e=0,t=null,n,i,s,o,r,a,l,h){return this._configuratorMeshGenerator.generateMesh(e,t,n,i,s,o,r,!1,h)}_setMaterial(e,t,n){this._configuratorMeshGenerator.setMaterial(e,t)}constructComponents(e){this._getKernelAccess().kernelInstance.requestPlanObjectConstruction(e)}requestSubPartConstruction(e){return this._subPartGuard=new we(e),this._getKernelAccess().requestPlanComponentConstruction(e),this._subPartGuard.wait()}getMeshGenerator(){return this._configuratorMeshGenerator}setRequestRenderCallback(e){this._requestRenderCallback=e}}e("C",Jt),v([ie],Jt.prototype,"_configuratorMeshGenerator",void 0),v([ie],Jt.prototype,"_configuratorContext",void 0),v([ie],Jt.prototype,"_cacheHolder",void 0),v([ie],Jt.prototype,"_initData",void 0);class Xt extends Map{largestValue(){let e=this.entries().next().value[0],t=0;return this.forEach((n,i)=>{n>t&&(e=i,t=n)}),e}}const Yt=["material"];class Qt extends vt{constructor(e){super(e),this.externalMeshQueue=new Oe,this.muteKernelCallbacks=!1,this.listOfVariants=(e,t)=>{}}init(e){super.init(e),ht.addMeta("kernel_is_ready",{isWasm:this._useWASM}),ct.kernelInstance?(this._kernelContainer=ct.kernelContainer,setTimeout(()=>this._loadSuccess(),0)):this._scriptLoader.fetch(this._kernelPath,{id:"kernel"}).then(this._loadSuccess.bind(this),this._loadError.bind(this))}_loadSuccess(){ht.start("kernel_is_ready"),window.ConfiguratorKernel&&(ct.kernelInstance?setTimeout(()=>this.isReady(),0):(window.ConfiguratorKernel(this._kernelContainer),window.ConfiguratorKernel=null))}_loadError(){this._configuratorKernelAccessCallback.loadError()}selectedComponent(e){this._updateComponentDependencies(e)}uiRequestConfiguration(e){const t=this._kernelInstance.getSerializedConfiguration(e);_t.finishOperation(1,t)}_updateComponentParameters(e){let t=this._kernelInstance.getComponentParameters(e);const n=this._kernelInstance.getComponent(e);this._configuratorKernelAccessCallback.updateParameters(t,n.parameterGroups,e,1)}selectionChange(e,t){let n=!1,i=[];if(e){let t=this._kernelInstance.getComponent(e);t.componentId=this._kernelInstance.getComponentId(e),t&&t.childIds&&t.childIds.length>0&&(n=!0),i.push(t)}this._configuratorUiCallbacks.onSelectionChange("standard",t,n,i)}multiSelectionChange(e,t){this._updateCommonComponentDependencies(e);let n=!1,i=!1,s=[];e&&e.forEach(e=>{let o=this._kernelInstance.getComponent(e);o.componentId=this._kernelInstance.getComponentId(e),o&&o.childIds&&o.childIds.length>0&&(n=!0),o.id===t&&(i=!0),s.push(o)}),this._configuratorUiCallbacks.onSelectionChange("multiselect",i,n,s)}_updateCommonComponentDependencies(e){const{parameters:t,parameterGroups:n}=this._kernelInstance.getCommonPlanComponentParameters(this._utilityToLongArray(e));this._configuratorKernelAccessCallback.updateParameters(t,n,e,2)}_updateComponentChildren(e){const t=this._kernelInstance.getPlanComponentPossibleChildren(e);this._configuratorKernelAccessCallback.updatePossibleChildren(e,t,1)}_updateComponentDependencies(e){this._updateComponentParameters(e),this._updateComponentChildren(e)}_updatePlanObjectParameters(e){let t,n=this._kernelInstance.getPlanObjectParameters(e);if(0===n.length){let i=this._kernelInstance.getRootPlanComponentIdFromObjectId(e);n=this._kernelInstance.getComponentParameters(i),this._enableRootComponentParametersAsGlobal(),t=this._kernelInstance.getComponent(i)}else this._configuratorContext.rootComponentParametersAsGlobal=!1,t=this._kernelInstance.getPlanObject(e);this._configuratorKernelAccessCallback.updateParameters(n,t.parameterGroups,e,0)}_enableRootComponentParametersAsGlobal(){this._configuratorContext.selectedRuntimeComponentId||(this._configuratorContext.rootComponentParametersAsGlobal=!0)}_updatePlanObjectChildren(e){const t=this._kernelInstance.getPlanObjectPossibleChildren(e);this._configuratorKernelAccessCallback.updatePossibleChildren(e,t,0)}updatePlanObjectDependencies(e){this._updatePlanObjectParameters(e),this._updatePlanObjectChildren(e)}_updateConfigurationHasChildren(e,t=null){t||(t=this._kernelInstance.getComponent(this._kernelInstance.getRootPlanComponentIdFromObjectId(e)));const n=t.childIds.size?t.childIds.size():t.childIds.length;this._configuratorUiCallbacks.onConfigurationHasChildren(n>0)}dockComponent(e,t,n,i){const s=this._kernelInstance.getComponentId(n),o=this._kernelInstance.getComponentId(e);this._kernelInstance.dockComponent(n,i,e,t),this._configuratorUiCallbacks.onUserInitiatedDockDone(s,i,o,t,null)}changeUseOfHDGeometry(e,t){this._rapiAccess.changeUseOfHDGeometry();const n=e.planObjectId,i=e.lastLoadedRapiId?e.lastLoadedRapiId:this._kernelInstance.getComponentId(n),s=this._kernelInstance.getSerializedConfiguration(n);this._kernelInstance.clearAll(),this._kernelInstance.useHDGeometry(t),_t.finishOperation(3,[s,i])}webGlPreviewDockings(e,t){_t.waitFor(4).then(({componentId:n})=>{t&&this.requestPlanComponentConstruction(n),this._kernelInstance.requestPreviewGeometry(n,e.planObjectId)}),e.lastPossibleChild&&e.lastPossibleChild.isComponent&&(this._kernelIo.setMeta({componentId:e.lastPossibleChild.id}),this._kernelInstance.loadPlainComponent(10,e.lastPossibleChild.id,e.lastPossibleChild.configuration)),e.lastPossibleChild&&e.lastPossibleChild.isItem&&this._kernelInstance.loadFreeFlyingConfiguration(10,e.lastPossibleChild.configuration)}previewDockingsWithDrag(e,t){this._kernelInstance.requestPreviewGeometry(e,t)}loadConfiguration(e){this._initData.id?this._memoryManager.loadingConfiguration(this._initData.id):this._memoryManager.loadingConfigurationString(),this._memoryManager.shouldHardReset()?this._kernelInstance.clearAll():this._kernelInstance.clearScene(),this._kernelInstance.loadConfiguration(qt,e,{x:0,y:0,z:0})}changeCommonComponentParameter(e,t,n,i,s,o){"string"==typeof i?this._kernelInstance.setPlanComponentParameters(this._utilityToLongArray(e),t,i):console.warn("tried to set a parameter to a none string value!",i,t,n),this._finishParameterChange(n,s,o),this._updateCommonComponentDependencies(e)}changeComponentParameter(e,t,n,i,s,o){"string"==typeof i?this._kernelInstance.setComponentParameter(e,t,i):console.warn("tried to set a parameter to a none string value!",i,t,n),this._finishParameterChange(n,s,o),this._updateComponentDependencies(e)}changePlanObjectParameter(e,t,n,i,s,o){"string"==typeof i?this._kernelInstance.setPlanObjectParameter(e,t,i):console.warn("tried to set a parameter to a none string value!",i,t,n),this._finishParameterChange(n,s,o)}_finishParameterChange(e,t,n){-1===Yt.indexOf(e)?setTimeout(()=>t(),0):this._configuratorKernelCallbackListener.forEach(e=>e.finishParameterChange(t,n))}requestDeleteComponents(e){e&&this._kernelInstance.deletePlanComponents(this._utilityToLongArray(e))}requestDeletePlanComponent(e){var t,n;e&&(null===(n=null===(t=this._initData)||void 0===t?void 0:t.featureFlags)||void 0===n?void 0:n.reDock)&&this._kernelInstance.deletePlanComponent(e)}loadComponentIntoKernel(e,t){this._kernelIo.setMeta({componentId:t}),this._kernelInstance.loadComponentDefinition(10,e)}async requestPartListAndUpdatePricesOfParts(e,t){let n=this._kernelInstance.getFullPartList();e||(e=this._kernelInstance.getHashOfConfiguration(this._configuratorContext.planObjectId));const i=await this.addUiDataAndPriceToPartList(n,e);this._configuratorUiCallbacks.onPartListUpdate(i,btoa(e))}requestSync(e,t){this.planObjectCreated(e,t),this._kernelInstance.syncPlanObjectToView(e,t)}getGlobalParameters(e,t){return new Promise(n=>{let i=this._kernelInstance.getPlanObjectParameters,s=e;t&&(i=this._kernelInstance.getComponentParameters,s=this._kernelInstance.getRootPlanComponentIdFromObjectId(e)),n(i.apply(this._kernelInstance,[s]))})}getPartList(){return new Promise(e=>{e(this._kernelInstance.getFullPartList())})}getConfigurationHash(e){return new Promise(t=>t(this._kernelInstance.getHashOfConfiguration(e.planObjectId)))}requestPlanObjectConstruction(e){this._kernelInstance.requestPlanObjectConstruction(e)}isReady(){super.isReady(),ht.end("kernel_is_ready"),this._setupKernel(),tt.isProduction||(window.__RML__DEBUG__.Kernel=this._kernelInstance,window.__RML__DEBUG__.KernelContainer=this._kernelContainer,window.__RML__DEBUG__.Helper={convertCObject:L}),this._configuratorKernelAccessCallback.isReady(),this._configuratorUiCallbacks.onConfiguratorKernelIsReady(this._kernelContainer,this._kernelInstance),ct.planObjectId&&this.planObjectCreated(-1,ct.planObjectId)}_setupKernel(){1===this._kernelType&&(ht.start("kernel_create_instance"),ct.kernelInstance?this._kernelInstance=ct.kernelInstance:this._kernelInstance=new this._kernelContainer.Kernel,ht.end("kernel_create_instance")),this._initKernel()}onLoadComponentError(e,t){this._configuratorUiCallbacks.onComponentLoadError(e,t)}configurationLoaded(e,t,n,i,s,o){_t.finishOperation(4,{conversationId:e,objectId:t,componentId:n,hash:i,errors:L(s)}),this._configuratorKernelCallbackListener.forEach(o=>o.configurationLoaded(e,t,n,i,s))}componentDefinitionLoaded(e,t){_t.finishOperation(0,t)}componentDefinitionLoadingError(e,t){this._kernelIo.error(t),_t.failOperation(0,new Error(t))}configurationLoadingError(e,t){let n="Configuration loading error";if(t){const e=L(t);Array.isArray(e)&&(n=e.join("\n"),e.forEach(e=>this._kernelIo.error(e)))}_t.failOperation(4,new Error(n)),_t.failOperation(2,new Error(n))}componentConfigurationUpdated(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.componentConfigurationUpdated(e,t)),this._kernelInstance.requestDeltaPlanComponentConstruction(e)}setActiveGroupInView(e){this._kernelInstance.setActiveGroupInView(e)}setActiveGroupInViewForPlanObject(e,t){this._kernelInstance.setActiveGroupInViewForPlanObject(e,t||this._configuratorContext.planObjectId)}componentParameters(){}requestComponentDimensions(){}planObjectCreated(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.planObjectCreated(e,t))}planObjectUpdated(e){const t=this._kernelInstance.getPlanObject(e);this._onBoundsUpdate(t),this._configuratorKernelCallbackListener.forEach(e=>e.planObjectUpdated(t))}planObjectConfigurationUpdated(e,t,n,i,s){this.updatePlanObjectDependencies(e);let o=this._kernelInstance.getComponent(this._kernelInstance.getRootPlanComponentIdFromObjectId(e));this._configuratorKernelCallbackListener.forEach(i=>i.planObjectConfigurationUpdated(e,t,n));const r=this._kernelInstance.getPlanObject(e);return this._onBoundsUpdate(r),this._configuratorHistory.push(t),this._updateConfigurationHasChildren(e,o),this.requestPartListAndUpdatePricesOfParts(n)}_onBoundsUpdate(e){if(!e.boxForMeasurement)return;const t={width:this._unitFormatter.formatMMValueToUnitString(e.boxForMeasurement.size.x),height:this._unitFormatter.formatMMValueToUnitString(e.boxForMeasurement.size.z),depth:this._unitFormatter.formatMMValueToUnitString(e.boxForMeasurement.size.y),kernelBounds:e.boxForMeasurement};this._configuratorUiCallbacks.onBoundsUpdate(t)}planObjectDeleted(){}requestPlanObjectDimensions(){}async requestExternalMesh(e,t){let n=()=>{};const i=new Promise((e,t)=>{n=e});let s;this.externalMeshQueue.push(i);try{s=await this._rapiAccess.getMesh(e,"crt",t)}catch(t){throw this._configuratorUiCallbacks.onError(new Error(`Mesh with id "${e}" can not be loaded. "${t}"`)),console.error(t),t}try{const i=await fetch(new Request(this._dataSyncer.requestAsset(s.url,!0))),o=await i.arrayBuffer();this._handleCortoMesh(o,e,t),n()}catch(t){throw this._configuratorUiCallbacks.onError(new Error(`Mesh with id "${e}" breaks. "${t}"`)),console.error(t),t}}Editor3dComponentCreated(e,t,n,i){this._configuratorKernelCallbackListener.forEach(s=>s.Editor3dComponentCreated(e,t,n,i,!1)),i&&i>0&&this._configuratorKernelCallbackListener.forEach(s=>s.Editor3dComponentDocked(e,i,t,n))}Editor3dRootComponentCreated(e,t,n,i){this._configuratorKernelCallbackListener.forEach(s=>s.Editor3dComponentCreated(e,t,n,i,!0))}Editor3dPlanObjectConstructionDone(e){return this._configuratorKernelCallbackListener.forEach(t=>t.Editor3dPlanObjectConstructionDone(e)),this.updatePlanObjectDependencies(e),this._updateConfigurationHasChildren(e),ht.end("ui_load_configuration"),this._calcPrice()}Editor3dBeginGroup(){}Editor3dEndGroup(){}Editor3dSetMaterial(){}Editor3dLoadMaterial(){}Editor3dAddDockPreview(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.Editor3dAddDockPreview(e,t))}Editor3dSetPreviewPointAssociations(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.Editor3dSetPreviewPointAssociations(e,t))}Editor3dSetPreviewLineAssociations(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.Editor3dSetPreviewLineAssociations(e,t))}Editor3dPreviewConstructionDone(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.Editor3dPreviewConstructionDone(e,t))}Editor3dTranslateBy(){}Editor3dRotateBy(){}Editor3dRotateAround(){}Editor3dAddCube(){}Editor3dAddCubeUVMod(){}Editor3dAddSphere(){}Editor3dAddSphereUVMod(){}Editor3dAddRectangle(){}Editor3dAddRectangleUVMod(){}Editor3dAddMesh(){}Editor3dAddMeshUVMod(){}Editor3dAddMeshUVCoord(){}Editor3dAddCylinder(){}Editor3dAddCylinderUVMod(){}Editor3dAddPrism(){}Editor3dAddPrismUVMod(){}Editor3dAddFittingPoint(){}Editor3dAddFittingLine(){}Editor3dSelectObject(){}Editor3dCopy(){}Editor3dUpdatePlanObjectPosition(){}Editor3dUpdatePlanObjectRotation(){}Editor3dUpdatePlanObjectTransform(){}Editor3dUpdatePlanComponentPosition(){}Editor3dUpdatePlanComponentRotation(){}Editor3dUpdatePlanComponentTransform(){}getRuntimeComponentIdOfRootComponent(e){return this._kernelInstance?this._kernelInstance.getRootPlanComponentIdFromObjectId(e):(console.warn("this._kernelInstance not ready now"),0)}getRuntimeComponentId(e){return this._kernelInstance.getComponentId(e)}getParameterGroups(){if(!this._configuratorContext.planObjectId)return[];const e=this._kernelInstance.getRootPlanComponentIdFromObjectId(this._configuratorContext.planObjectId);return this._kernelInstance.getComponent(e).parameterGroups}resume(){this.muteKernelCallbacks||super.resume()}getSerializedConfiguration(e){return this._kernelInstance.getSerializedConfiguration(e)}createNewSerializedConfiguration(e){return this._kernelInstance.createNewSerializedConfiguration(e)}getCurrentConfigurationHash(e){return this._kernelInstance.getHashOfConfiguration(e)}listOfVariantsError(e,t){this._kernelIo.setMeta({rapiId:e}),this._kernelIo.error(t)}}v([ie],Qt.prototype,"_memoryManager",void 0),v([ie],Qt.prototype,"_configuratorKernelAccessCallback",void 0),v([ie],Qt.prototype,"_initData",void 0),v([ie],Qt.prototype,"_configuratorHistory",void 0);class $t extends Ye{constructor(e){super(e);const t=this.getPlanElement().getMaxWallHeight();this._container.position.y=(t<0?2800:t)/1e3+.01,this._container.name="Node Plan Element",this.addMesh(this._nodeUiMesh)}update(){super.update(),this._container.position.y=this.getPlanElement().getMaxWallHeight()/1e3+.01}_initNodeMesh(){if(this._nodeUiMesh)return;const e=new THREE.SphereGeometry(.05,32),t=new THREE.MeshBasicMaterial({color:16777215});this._sphere=new THREE.Mesh(e,t);const n=new THREE.RingGeometry(.05,.07,32),i=new THREE.MeshBasicMaterial({color:0,side:THREE.DoubleSide});this._innerRingMesh=new THREE.Mesh(n,i),this._innerRingMesh.rotation.set(Math.PI/2,0,0);const s=new THREE.RingGeometry(.07,.08,32),o=new THREE.MeshBasicMaterial({color:16777215,side:THREE.DoubleSide});this._outerRingMesh=new THREE.Mesh(s,o),this._outerRingMesh.rotation.set(Math.PI/2,0,0),this._nodeUiMesh=new THREE.Mesh,this._nodeUiMesh.add(this._sphere),this._nodeUiMesh.add(this._innerRingMesh),this._nodeUiMesh.add(this._outerRingMesh)}setTopView(e){super.setTopView(e),e||(this._nodeUiMesh.visible=!1)}getSize(){return this._initNodeMesh(),(new THREE.Box3).setFromObject(this._nodeUiMesh).getSize(new THREE.Vector3)}show(){this._nodeUiMesh.visible=this._topView}hide(){this._nodeUiMesh.visible=!1}select(){this._innerRingMesh.material=new THREE.MeshBasicMaterial({color:10526880,side:THREE.DoubleSide}),super.select()}deselect(){this._innerRingMesh.material=new THREE.MeshBasicMaterial({color:0,side:THREE.DoubleSide}),super.deselect()}hoverOn(){this._sphere.geometry=new THREE.SphereGeometry(.07,32),this._innerRingMesh.geometry=new THREE.RingGeometry(.07,.07+.02,32),this._outerRingMesh.geometry=new THREE.RingGeometry(.07+.02,.1,32),super.hoverOn()}hoverOff(){this._sphere.geometry=new THREE.SphereGeometry(.05,32),this._innerRingMesh.geometry=new THREE.RingGeometry(.05,.07,32),this._outerRingMesh.geometry=new THREE.RingGeometry(.07,.08,32),super.hoverOff()}_generateBoundingBox(){const e=super._generateBoundingBox();return e.layers.set(9),e}}e("N",$t);class Zt extends nt{constructor(e){super(e),this._container.name="Construction "+this._container.name}setTopView(e){super.setTopView(e),e?this._enableTopView():this._disableTopView(),this._updateBoundingBox()}_enableTopView(){if(!this._topViewContainer){this._topViewContainer=new THREE.Group;const e=this.getPlanElement(),{x:t,z:n}=x(e.size),i=new THREE.BoxGeometry(t,.01,n);if(this._topGreyMesh=new THREE.Mesh(i,new THREE.MeshStandardMaterial({transparent:!0,opacity:1,color:11645361})),this._topViewContainer.add(this._topGreyMesh),"window"===e.getObjectType()){const e=new THREE.BoxGeometry(t,.02,.05);this._topBlackMesh=new THREE.Mesh(e,new THREE.MeshStandardMaterial({transparent:!0,opacity:1,color:0})),this._topViewContainer.add(this._topBlackMesh)}this._topViewContainer.position.y=5,this._container.add(this._topViewContainer)}this._topViewContainer.visible=!0}_disableTopView(){this._topViewContainer&&(this._topViewContainer.visible=!1)}getPlanElement(){return super.getPlanElement()}_generateBoundingBox(){const e=super._generateBoundingBox(),t=this.getSize();return e.geometry=new THREE.BoxGeometry(t.x,this._topView?5:t.y,t.z),e}_updateBoundingBox(){super._updateBoundingBox();const e=this.getSize();this._boundingBox.geometry=new THREE.BoxGeometry(e.x,this._topView?5:e.y,e.z)}getTopViewContainer(){return this._topViewContainer}update(){if(super.update(),!this._topGreyMesh)return;const{x:e,z:t}=x(this.getPlanElement().size);this._topGreyMesh.geometry=new THREE.BoxGeometry(e,.01,t),this._topBlackMesh&&(this._topBlackMesh.geometry=new THREE.BoxGeometry(e,.02,.05))}}e("d",Zt);class en extends Qt{get kernelContainer(){return this._kernelContainer}constructor(e){super(e),this._plannerKernelCallbackListener=new Set}_loadSuccess(){super._loadSuccess(),window.RoomleCore&&window.RoomleCore(this._kernelContainer)}_loadError(){super._loadError(),console.error("kernel load error")}_createPlanInteractionHandler(){this._planInteractionHandler=new this._kernelContainer.PlanInteractionHandler,this._planInteractionHandler.init(this._planInteractionHandler,1,50,!0,!0,this._kernelContainer.DrawingType.CLICK_PER_CLICK),this._roomlePlannerUiCallback.onPlanInteractionHandlerCreated(this._planInteractionHandler)}addPlannerListener(e){this._plannerKernelCallbackListener.add(e)}removePlannerListener(e){this._plannerKernelCallbackListener.delete(e)}isReady(){super.isReady(),this.registerCallbacks(),this._roomlePlannerUiCallback.onPlannerKernelIsReady(this._kernelContainer),this._roomlePlannerUiCallback.onConfiguratorKernelIsReady(this._kernelContainer,this._kernelInstance),tt.isProduction||(window.__RML__DEBUG__.ConfiguratorKernel=this._kernelInstance,window.__RML__DEBUG__.PlannerKernelContainer=this._kernelContainer),this._kernelAccessCallback.isReady()}_setupKernel(){0===this._kernelType&&(this._createPlanInteractionHandler(),ct.kernelInstance?this._kernelInstance=ct.kernelInstance:this._kernelInstance=this._planInteractionHandler.getConfiguratorKernel()),super._setupKernel()}get callbacks(){return this._roomlePlannerUiCallback}get planInteractionHandler(){return this._planInteractionHandler}get planModelViewHelper(){return this._kernelContainer.PlanModelViewHelper}catalogItemLoaded(e){const t=this._rapiItemToKernelItem(e);this._kernelContainer.catalogItemLoaded(t)}async insertItems(e){this.planInteractionHandler.startInteraction();let t=new this._kernelContainer.CatalogItemPtrList;e.forEach(e=>{let n=e.count||1;for(let i=0;i<n;i++)e.count||(e.count=0),t.push_back(this._rapiItemToKernelItem(e))});const n=this.planInteractionHandler.getPlan().extRef.jsObject,i=n.getPlanObjectViewModelsFromRapiId().reduce((e,t)=>(e[t.getId()]=!0,e),{});this.planInteractionHandler.addPlanObjects(t),await Promise.allSettled([Promise.allSettled(n.getStaticPlanObjectViewModels().map(async e=>{if(e.needsRapiItem()){const t=await this._rapiAccess.getItem(e.getPlanObject().getCatalogItemId());e.setRapiItem(t)}})),Promise.allSettled(n.getConfigurablePlanObjectViewModels().map(e=>e.isInitDone()))]);const s=n.getPlanObjectViewModelsFromRapiId().map(e=>e.getId()).filter(e=>!i[e]);return this.planInteractionHandler.endInteraction(),s}_rapiItemToKernelItem(e){let t=new this._kernelContainer.CatalogItem(e.id),n=t.size;return n.x=e.width||0,n.y=e.depth||0,n.z=e.height||0,t.size=n,t.flipable=e.flipable,e.layer&&(t.layer=e.layer),t.orderable=e.orderable,t.scaleable=e.scaleable,t.type=e.type||"other",t.detailType=e.detailType||t.type||"other",t.configuration=e.configuration||"",t}planObjectDeleted(){}requestPlanObjectDimensions(){}cleanUpCallbacks(){var e;super.cleanUpCallbacks(),(null===(e=this._kernelContainer)||void 0===e?void 0:e.unregisterPlannerCallback)&&this._kernelContainer.unregisterPlannerCallback(this)}registerCallbacks(){var e;super.registerCallbacks(),(null===(e=this._kernelContainer)||void 0===e?void 0:e.registerPlannerCallback)&&this._kernelContainer.registerPlannerCallback(this)}planElementRemoved(e){this._plannerKernelCallbackListener.forEach(t=>t.planElementRemoved(e)),this._plannerKernelCallbackListener.forEach(t=>t.removePlanObjectFromScene(e.extRef.jsObject)),this._decoupleReferences(e)}handlerSwitchedPlans(e,t){this._decoupleReferences(e),t&&this._plannerKernelCallbackListener.forEach(n=>n.handlerSwitchedPlans(e,t))}planBoundsChanged(){this._plannerKernelCallbackListener.forEach(e=>e.planBoundsChanged())}planCleared(){this._plannerKernelCallbackListener.forEach(e=>e.planCleared())}planCompletelyLoaded(e){this._plannerKernelCallbackListener.forEach(t=>t.planCompletelyLoaded(e))}planElement3dMeshChanged(e,t){if(t.extRef){const e=t.extRef.jsObject;for(let t=e.getObject().children.length-1;t>=0;t--)e.getObject().remove(e.getObject().children[t])}this.planModelViewHelper.requestMesh3d(t)}async _onStaticItemAdded(e,t){let n;n=this.isConstructionPlanElement(t)?new Zt(t):new nt(t),this.coupleReferences(n,t),e.extRef.jsObject.addPlanElementViewModel(n);const i=t.getCatalogItemId();if(i){const e=await this._rapiAccess.getItem(i);n.setRapiItem(e),this._plannerKernelCallbackListener.forEach(e=>e.addPlanObjectToScene(n))}}_onConfigurableItemAdded(e,t){const n=new $e(t);this.coupleReferences(n,t),e.extRef.jsObject.addPlanElementViewModel(n),this._plannerKernelCallbackListener.forEach(e=>e.addPlanObjectToScene(n))}async planElementAdded(e,t){if(e&&e.extRef)if(t.getType()===this._kernelContainer.PlanElementType.OBJECT)t.hasConfiguration()?this._onConfigurableItemAdded(e,t):await this._onStaticItemAdded(e,t);else{const n=t;let i;if(t.getType()===this._kernelContainer.PlanElementType.WALL?i=new ot(n):t.getType()===this._kernelContainer.PlanElementType.FLOOR?i=new rt(n):t.getType()===this._kernelContainer.PlanElementType.CEILING?i=new at(n):t.getType()===this._kernelContainer.PlanElementType.NODE&&(i=new $t(n)),!i)return;this.coupleReferences(i,n),e.extRef.jsObject.addPlanElementViewModel(i),i.setPrimaryColor(this._initData.colors.PRIMARY),this.planModelViewHelper.requestMesh3d(t),this._plannerKernelCallbackListener.forEach(e=>e.addPlanObjectToScene(null))}}planElementChanged(e,t){if(t.extRef){let n=t.extRef.jsObject;n.update(),this._plannerKernelCallbackListener.forEach(t=>t.planElementChanged(e,n))}}planHistoryStateChanged(){this.planInteractionHandler&&(this._plannerKernelCallbackListener.forEach(e=>e.planHistoryStateChanged()),this._roomlePlannerUiCallback.onHistoryChange(this.planInteractionHandler.isUndoPossible(),this.planInteractionHandler.isRedoPossible()))}planObjectConfigurationCreated(e,t){}planObjectConfigurationLoaded(e,t,n){e&&e.extRef&&t&&t.extRef&&t.extRef.jsObject.getPlanObject().getConfigurationRuntimeId()>0&&this._plannerKernelCallbackListener.forEach(i=>i.planObjectConfigurationLoaded(e,t,n))}requestCatalogItem(e){}startedDrawing(){this._plannerKernelCallbackListener.forEach(e=>e.startedDrawing())}stoppedDrawing(){this._plannerKernelCallbackListener.forEach(e=>e.stoppedDrawing())}updateMesh2d(){}beginConstruction(){}addMesh(e,t,n,i,s,o){this._plannerKernelCallbackListener.forEach(r=>r.addMesh(e,t,n,i,s,o))}endConstruction(){}beginPlanConstruction(e){this._plannerKernelCallbackListener.forEach(t=>t.beginPlanConstruction(e))}addPlanMesh(e,t,n,i,s,o,r){this._plannerKernelCallbackListener.forEach(a=>a.addPlanMesh(e,t,n,i,s,o,r))}endPlanConstruction(e){this._plannerKernelCallbackListener.forEach(t=>t.endPlanConstruction(e))}async addPlanObjectFromItem(e,t,n){if(!t&&!n){const t=await this.insertItems([e]);if(1!==t.length)throw new Error("It was expected that 1 element is added but"+t.length+"were added");return t[0]}n=n||0===n?n:0,t=t||{x:0,y:0,z:0};const i=this._planInteractionHandler.addPlanObjectFromItem(this._rapiItemToKernelItem(e),t,n),s=this._planInteractionHandler.getPlan().extRef.jsObject;let o;return i.hasConfiguration()?(o=s.getConfigurablePlanObjectForId(i.getId()),o||console.warn("Could not find configuration")):(o=s.getStaticPlanObjectViewModelForId(i.getId()),o?await o.setRapiItem(e):console.warn("Could not find static item")),await o.isInitDone(),o.getId()}coupleReferences(e,t){let n=new this._kernelContainer.EMSReference;n.jsObject=e,t.extRef=n}_decoupleReferences(e){e&&e.extRef&&(e.extRef.jsObject.clearReference(),e.extRef.jsObject=null,e.extRef.delete(),e.extRef=null)}isConstructionPlanElement(e){return e instanceof this.kernelContainer.ConstructionObject}}e("P",en),v([ie],en.prototype,"_kernelAccessCallback",void 0),v([ie],en.prototype,"_roomlePlannerUiCallback",void 0);class tn extends Ae{constructor(e){super(e),this._wallMeshes=[],this._defaultMaterial=new THREE.MeshPhysicalMaterial({color:"#ffffff",side:THREE.DoubleSide}),this._environmentLoader.setEnvMap(this._defaultMaterial),this._defaultMaterialFloor=new THREE.MeshPhysicalMaterial({color:"#ffffff"}),this._environmentLoader.setEnvMap(this._defaultMaterialFloor),this._environmentLoader.onEnvMapUpdate(()=>{this._environmentLoader.setEnvMap(this._defaultMaterial),this._environmentLoader.setEnvMap(this._defaultMaterialFloor)})}generateGeometry(e=null,t,n,i,s,o=!1){let r;return r=o?this._generateGeometry(e,t,n,i,s).clone():this._generateGeometry(e,t,n,i,s),r}generateMesh(e=0,t=null,n,i,s,o,r,a,l=!1,h){let c;c=l?this._generateGeometry(t,i,s,o,r).clone():this._generateGeometry(t,i,s,o,r);const d=this._createMesh(e,t,c);return d.userData.materialId=n,d.layers.set(4),n&&this.setMaterial(d,n,a,h).then(()=>{e&&t&&n&&this._geometryComponentMaterialCache.set(this._getComponentMeshId(e,t),n);const i=a&&3===a.value,s=a&&1===a.value;d.castShadow=!i&&!s}),this._checkWallMaterial(d,a),d}async setMaterial(e,t,n,i){if(e.userData.materialId=Z(t,n),w(t))t?await this._assignMaterial(e,t,i):(console.warn("Used default material because material is empty"),this.changeMaterialOfMesh(e,this._getDefaultMaterial(n)));else{if(!t)return void this.changeMaterialOfMesh(e,this._configuratorPreviewMaterial);2===(t=t).getSourceType().value?await this._assignMaterial(e,t.materialId,i):1===t.getSourceType().value?await this._assignItem(e,t.catalogItemId):3===t.getSourceType().value?await this._assignRGB(e,t.rgbValue):0===t.getSourceType().value?this.changeMaterialOfMesh(e,this._getDefaultMaterial(n)):(this.changeMaterialOfMesh(e,this._getDefaultMaterial(n)),1!==n.value&&7!==n.value&&3!==n.value&&console.warn("Used default material because material is not supported",t))}}_getDefaultMaterial(e){return 3===(null==e?void 0:e.value)?this._defaultMaterialFloor:this._defaultMaterial}set maxAnisotropy(e){this._maxAnisotropy=e}_checkWallMaterial(e,t){t&&1===t.value&&(e.renderOrder=5,this._wallMeshes.push(e))}clear(){super.clear(),this.clearWallMeshes()}clearWallMeshes(){this._wallMeshes.forEach(e=>{X(e)}),this._wallMeshes=[]}get wallMeshes(){return this._wallMeshes}}e("ai",tn);let nn={InchFeet:null,Feet:null,MM:null,CM:null,Inch:null},sn={NoUnitString:null,LongUnitString:null,ShortUnitString:null};const on=["mm","cm","feet"],rn=["inch","inchfeet"];class an{constructor(e){this._formatter=null,this._precision=0,this._creator_=e}init(e){const t=new e.UnitMeasureFormatter;nn=e.Unit,sn=e.UnitStringType,this._initActualUnit(),this._initMeasurementSystemType(),this._initActualUnitStringType();const{precisionCm:n,precisionInch:i}=this._initData;this._actualUnit===nn.InchFeet?this._precision=void 0!==i?parseInt(i,10):2:this._actualUnit===nn.CM&&(this._precision=void 0!==n?parseInt(n,10):1),t.init("mm","cm","'","ft",'"',"inch","m²","sqft",!0,this._precision,!0),this._formatter=t}_initMeasurementSystemType(){let{measurementSystem:e,unit:t}=this._initData;if(this._actualMeasurementString=e,e||!t){if("metric"===e){t||(t="cm");const e=on.find(e=>e===t);e?(this._actualUnit=this._getKernelUnitEnum(t),this._actualUnitString=e):(console.warn("Unit is not a metric unit, using CM"),this._actualUnit=nn.CM,this._actualUnitString="cm")}if("imperial"===e){t||(t="inch");const e=rn.find(e=>e===t);e?(this._actualUnit=this._getKernelUnitEnum(t),this._actualUnitString=e):(console.warn("Unit is not an imperial unit, using Inches"),this._actualUnit=nn.Inch,this._actualUnitString="inch")}}else{this._actualUnitString=t;const e=on.find(e=>e===t);this._actualMeasurementString=e?"metric":"imperial"}}_initActualUnit(){const{unit:e}=this._initData;this._actualUnit=this._getKernelUnitEnum(e)}_getKernelUnitEnum(e){switch(e){case"cm":return nn.CM;case"mm":return nn.MM;case"inchfeet":return nn.InchFeet;case"feet":return nn.Feet;case"inch":return nn.Inch;default:return nn.CM}}_initActualUnitStringType(){const{unitStringType:e}=this._initData;switch(e){case"none":this._actualUnitStringType=sn.NoUnitString;break;case"long":this._actualUnitStringType=sn.LongUnitString;break;case"short":this._actualUnitStringType=sn.ShortUnitString;break;default:this._actualUnitStringType=sn.ShortUnitString}}_isFormatterReady(){return!!this._formatter||(console.warn("Formatter is not ready..."),!1)}formatAngleValueToUnitString(e,t){const n="Integer"===t.type?0:2;return e.toFixed(n)+"°"}parseAngleValueFromUnitString(e){return e.replace("°","").replace(/\s/g,"")}parseValue(e,t){return null===t.unitType||"unknown"===t.unitType||"count"===t.unitType?e:"length"===t.unitType?this.parseMMValueFromUnitString(e,t.unitType):"angle"===t.unitType||"area"===t.unitType?this.parseAngleValueFromUnitString(e):e}formatValueToUnitString(e,t){return null===t.unitType||"unknown"===t.unitType||"count"===t.unitType?"Integer"===t.type?e.toString():parseFloat(e.toString()).toFixed(2):"length"===t.unitType?this.formatMMValueToUnitString(e,t.unitType):"angle"===t.unitType?this.formatAngleValueToUnitString(e,t):"area"===t.unitType?this.formatSquareMMValueToUnitString(e):e}isParseableNumber(e){return this._isFormatterReady()?this._formatter.isParseableNumber(e):null}isParseableUnitString(e,t){return this._isFormatterReady()?"angle"===t.unitType?this._formatter.isParseableUnitString(this.parseAngleValueFromUnitString(e),this._actualUnit):this._formatter.isParseableUnitString(e,this._actualUnit):null}parseMMValueFromUnitString(e,t){return this._isFormatterReady()?"count"===t?parseFloat(e):this._formatter.parseMMValueFromUnitString(e,this._actualUnit):null}parseNumber(e){return this._isFormatterReady()?this._formatter.parseNumber(e):null}formatNumber(e,t=0){return this._isFormatterReady()?this._formatter.formatNumber(e,t):null}formatSquareMMValueToUnitString(e){return this._isFormatterReady()?this._formatter.formatSquareMMValueToUnitString(e,this._actualUnit):null}formatMMValueToUnitString(e,t){return this._isFormatterReady()?"count"===t?e.toString():this._formatter.formatMMValueToUnitString(e,this._actualUnit,this._actualUnitStringType):null}formatMMValueWithReqMaxLength(e,t){return this._isFormatterReady()?this._formatter.formatMMValueWithReqMaxLength(e,this._actualUnit,t):null}_formatParameterValue(e,t){return"length"===t?this.formatMMValueToUnitString(parseFloat(e)):"area"===t?this.formatSquareMMValueToUnitString(parseFloat(e)):e}formatPartListParameter(e){(function(e){return"length"===e.unitType||"area"===e.unitType})(e)&&(e.valueLabel=this._formatParameterValue(e.value,e.unitType))}formatParameter(e){if(e.valueLabel=this._formatParameterValue(e.value,e.unitType),mt(e))e.uiType="Material";else if(function(e){return"Boolean"===e.type}(e))e.uiType="Boolean";else if(pt(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 gt(e)?(e.uiType="Options",function(e){return!!gt(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===nn.InchFeet}getPrecision(){return this._precision}getAllowedDelta(){const e=1/Math.pow(10,this._precision);return this.isInch()?25.4*e:e}setUnitInitData(e,t=""){this._initData.unit=e,this._initData.measurementSystem=t,this._initActualUnit(),this._initMeasurementSystemType(),this._initActualUnitStringType(),this._plannerKernelAccess.kernelInstance.setEnvironmentVariable("unit",this._actualUnitString)}}v([ie],an.prototype,"_initData",void 0),v([ie],an.prototype,"_plannerKernelAccess",void 0);class ln{constructor(e){this._history=[],this._index=0,this._creator_=e}undo(){if(!this.canUndo())return null;this._index++;const[e]=this._history.slice(this._index);return this._index===this._history.length-1?this._configuratorUiCallbacks.onHistoryChange(!1,!0):this._configuratorUiCallbacks.onHistoryChange(!0,!0),e}redo(){if(!this.canRedo())return null;this._index--;const[e]=this._history.slice(this._index);return 0===this._index?this._configuratorUiCallbacks.onHistoryChange(!0,!1):this._configuratorUiCallbacks.onHistoryChange(!0,!0),e}push(e){const[t]=this._history.slice(this._index);t!==e&&(this._history=this._history.slice(this._index),this._history.unshift(e),this._index=0,1===this._history.length?this._configuratorUiCallbacks.onHistoryChange(!1,!1):this._configuratorUiCallbacks.onHistoryChange(!0,!1))}canUndo(){return this._index!==this._history.length-1}canRedo(){return 0!==this._index}getHistory(){return this._history}clearHistory(){this._history=[],this._index=0}}v([ie],ln.prototype,"_configuratorUiCallbacks",void 0),e("a9",{ADDED:"added",CHANGED:"changed",REMOVED:"removed"});class hn{constructor(e){this._kernelCallbacks={isReady:()=>{},throw:e=>console.error("Kernel exception",e),log:e=>{},error:(e,t,n,i)=>{},message:e=>{this._analyzeComponentCallback&&this._analyzeComponentCallback(e)}},this._creator_=e}async init(){if(this._toolsCoreInstance)return Promise.resolve();const e=this,t={locateFile:e=>"RoomleToolsCore.wasm"===e?i()+"static/RoomleToolsCore-305c91454f11d873.wasm":e,wasmBinaryFile:i()+"static/RoomleToolsCore-305c91454f11d873.wasm",preRun:[],postRun:[],setStatus:null,print(t){e._kernelIo.log(t)},printErr(t){e._kernelIo.error(t)},quit(t){0!==t&&e._kernelIo.throw(t&&t.toString?t.toString():"Unknown error while C/C++ main executes")}};await this._scriptLoader.fetch("static/RoomleToolsCore-f6a3d0c5b5ecc883.js",{id:"core-tool"});const n=await window.RoomleToolsCore(t);n.setContext(this._kernelCallbacks),this._toolsCoreInstance=new n.ToolsCoreInterface}analyzeComponent(e,t){const n=[];return this._analyzeComponentCallback=e=>{n.push(e)},this._toolsCoreInstance.analyzeComponent(e,t),this._analyzeComponentCallback=null,Promise.resolve(n)}}v([ie],hn.prototype,"_scriptLoader",void 0),v([ie],hn.prototype,"_kernelIo",void 0);const cn=e("I",[new y("error-handler",class{constructor(){this._listeners={}}_subscribe(e,t){this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(t)}subscribe(e,t){this._subscribe(e,t)}dispatch(e,t){if(!this._listeners[e])return;const n=this._listeners[e];let i=n.length;for(let e=0;e<i;e++){const i=n[e];i.apply(i,t)}}unsubscribe(e,t){if(!this._listeners[e])return;const n=this._listeners[e];let i=n.length;for(let e=0;e<i;e++)if(n[e]===t)return n.splice(e,1),i--,void e--}softReject(e,t,n){return this.dispatch(n,[t]),e()}}),new y("form-data-util",M),new y("environment-loader",se),new y("static-item-loader",Me,0),new y("form-data-util",M),new y("single-promise-factory",class{constructor(e){this._promises=new Map,this._creator_=e}create(e,t,n){return new Promise((i,s)=>{let o=this._promises.get(e),r=!0;if(!o){const t=new Map;this._promises.set(e,t),o=this._promises.get(e),r=!1}o.get(t)||(o.set(t,[]),r=!1);const a=o.get(t);a.push({resolve:i,reject:s}),o.set(t,a);const l=()=>{o.delete(t),0===o.size&&this._promises.delete(e)};r||new Promise(n).then(e=>{o.get(t).forEach(({resolve:t})=>t(e)),l()},e=>{o.get(t).forEach(({reject:t})=>t(e)),l()})})}},1),new y("dynamic-light-setting-loader",re),new y("dynamic-quality-setting-loader",Te),new y("network-layer",de),new y("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 y("network-layer",de),new y("kernel-io",_e,0),new y("data-syncer",Ee),new y("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 y("life-cycle-manager",class{constructor(){this._listeners=[]}addEventListener(e){this._listeners.push(e)}removeEventListener(e){const t=this._listeners;let n=t.length;if(n)for(let i=0;i<n;i++)t[i]===e&&(t.splice(i,1),i--,n--)}pause(){this._listeners.forEach(e=>e.pause())}resume(){this._listeners.forEach(e=>e.resume())}destroy(){this._listeners.forEach(e=>e.destroy())}},1),new y("three-loader",ve),new y("local-storage-helper",Pe),new y("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())J(e);for(const e of this._materialCache.values())Q(e);for(const e of this._geometryCache.values())Y(e);this._componentCache.clear(),this._geometryCache.clear(),this._materialCache.clear()}},0),new y("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 y("configurator-kernel-access-callback",class{constructor(e){this._callbackListener=new Set,this._creator_=e}addListener(e){this._callbackListener.add(e)}removeListener(e){this._callbackListener.delete(e)}isReady(){this._callbackListener.forEach(e=>e.isReady())}updatePossibleChildren(e,t,n){this._callbackListener.forEach(i=>i.updatePossibleChildren(e,t,n))}updateParameters(e,t,n,i){this._callbackListener.forEach(s=>s.updateParameters(e,t,n,i))}loadError(e){this._callbackListener.forEach(t=>t.loadError(e))}},1),new y("configurator-context",class{constructor(){this.planObjectId=0,this.planElementId=0,this.rootComponentId=0,this.dockingRootComponentId=0,this.baseContext=null,this.rootComponentParametersAsGlobal=!1,this.lastLoadedRapiId=null,this.selectedRuntimeComponentIds=[],this.selectionMode="standard"}get selectedRuntimeComponentId(){return this.selectedRuntimeComponentIds.length>0?this.selectedRuntimeComponentIds[0]:null}},1),new y("init-data",Re,1),new y("global-init-data",xe,0),new y("global-callback",De,0),new y("dom-helper",Le,1),new y("unit-formatter",an,0),new y("plugin-system",He,1),new y("configurator-mesh-generator",Ue),new y("configurator-input-manager",class extends Ke{},1),new y("selection-handler",class extends je{constructor(){super(...arguments),this._selectionMode="standard",this._selectedComponents=new Map}check(e){"standard"===this._selectionMode&&this._checkStandard(e),"multiselect"===this._selectionMode&&this._checkMulti(e)}cancelSelection(){0!==this._selectedComponents.size&&this._selectedComponents.forEach((e,t)=>{e.deselect(),this._selectedComponents.delete(t),this.dispatchEvent(1,new ze({component:e}))})}_checkStandard(e){this._selectedComponents.has(e.runtimeId)?this.dispatchEvent(0,new ze({component:e,consecutive:!0})):(this._selectedComponents.size>0&&this._selectedComponents.forEach((e,t)=>{this._selectedComponents.delete(t),this.dispatchEvent(1,new ze({component:e,resetCamera:!1}))}),this._selectedComponents.set(e.runtimeId,e),this.dispatchEvent(0,new ze({component:e,consecutive:!1})))}_checkMulti(e){if(this._selectedComponents.has(e.runtimeId))return this._selectedComponents.delete(e.runtimeId),void this.dispatchEvent(1,new ze({component:e,resetCamera:0===this._selectedComponents.size}));this._selectedComponents.set(e.runtimeId,e),this.dispatchEvent(0,new ze({component:e}))}setSelectionMode(e){this._selectionMode=e}getSelectionMode(){return this._selectionMode}hasSelection(){return this._selectedComponents.size>0}getSelectedRuntimeComponentIds(){let e=[];return this._selectedComponents.forEach(t=>e.push(t.runtimeId)),e}isSelected(e){return this._selectedComponents.has(e.runtimeId)}},1),new y("component-dimensioning-helper",Je,1),new y("component-dimensioning-helper",Je,1),new y("planner-kernel-access",en),new y("planner-mesh-generator",tn,1),new y("unit-formatter",an),new y("configurator-history",ln,1),new y("roomle-planner-ui-callback",class extends Se{constructor(e){super(e),this.onItemsLoaded=()=>{},this.onCameraChanged=e=>{},this.onCameraIdle=()=>{},this.onTotalFloorAreaChanged=e=>{},this.onPlanInteractionHandlerCreated=e=>{},this.onPlannerKernelIsReady=e=>{},this.onConfiguratorKernelIsReady=(e,t)=>{},this.onSelectionChange=(e,t,n,i,s)=>{},this.onSelectionCancel=e=>{},this.onPlanChanged=()=>{},this.onPlanElementChanged=(e,t)=>{},this.onCompletelyLoaded=()=>{},this.onRotationCancel=()=>{},this.onHistoryChange=(e,t)=>{},this.onUpdateWallDimensions=e=>{},this.disableWallDimensions=()=>{},this.onUpdatePlanObjectPositions=e=>{},this.onDrawCancel=()=>{}}}),new y("configurator-ui-callbacks",class extends Se{constructor(e){super(e),this.onKernelIsReady=null,this.onComponentPositionsUpdated=null,this.onUpdateParameters=e=>{},this.onUpdatePossibleChildren=(e,t)=>{},this.onUpdatePrice=(e,t)=>{},this.onSelectionChange=(e,t,n,i)=>{},this.onSelectionCancel=()=>{},this.onPartListUpdate=(e,t)=>{},this.onBoundsUpdate=e=>{},this.onLoadConfiguration=()=>{},this.onConfigurationReady=(e,t,n)=>{},this.onOpenTag=e=>{},this.onOpenAddOns=()=>{},this.onClickOutside=()=>{},this.onNoDockingsAvailable=()=>{},this.onUiIntersectionChange=e=>{},this.onZoomChange=(e,t)=>{},this.onDimensionsVisibilityChange=e=>{},this.onErrorDueToOffline=e=>{},this.onError=e=>{},this.onDockingsPreviewRemoved=()=>{},this.onConfigurationHasChildren=e=>{},this.onTrackTiming=(e,t,n,i)=>{},this.onUserInitiatedDockDone=(e,t,n,i,s)=>{},this.onAddonPlusHover=()=>{},this.onAddonPlusHoverOff=()=>{},this.onAddonPlusShown=()=>{},this.onAddonPlusHidden=()=>{},this.onContentProblem=e=>{},this.onSyncStarted=()=>{},this.onSyncDone=()=>{},this.onOpenFloorMaterials=()=>{},this.onOpenPartList=()=>{},this.onComponentLoadError=(e,t)=>{},this.onConfigurationLoadError=()=>{},this.onChangeTypeChangeTag=e=>{},this.onRemoveTypeChangeTag=e=>{},this.onConfigurationLabelChange=(e,t,n)=>{},this.onMemoryCorruption=()=>{},this.onConfiguratorKernelIsReady=(e,t)=>{},this.onConfigurationSaved=e=>{},this.onCameraPositionChanges=()=>{},this.onHistoryChange=(e,t)=>{}}},1),new y("roomle-tools-core",hn,0)]);class dn{static _ensureContainer(){window.__RML__DI__||(window.__RML__DI__=new C,window.__RML__DI__.addDependencyInjectionAssignments(cn))}static setup(e){dn.addToContainer(e)}static lookup(e,t){return window.__RML__DI__?window.__RML__DI__.lookup(e,t):null}static getContext(e){return dn._ensureContainer(),window.__RML__DI__.getContext(e)}static cleanUp(e){return window.__RML__DI__?window.__RML__DI__.cleanUp(e):null}static addToContainer(e){dn._ensureContainer(),window.__RML__DI__.addDependencyInjectionAssignments(e)}}e("b",dn)}}}));
16
- //# sourceMappingURL=roomle-dependency-injection-5753b429.nomodule.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"roomle-sdk-94e2ff55.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"script-loader-c5793b29.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"script-loader-c8296bef.nomodule.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- var _scriptDir,ConfiguratorKernel=(_scriptDir="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,function(t){var n,r,e;t=t||{},n||(n=void 0!==t?t:{}),n.ready=new Promise((function(t,n){r=t,e=n}));var c=Object.assign({},n),i="./this.program",a=(t,n)=>{throw n},o="";"undefined"!=typeof document&&document.currentScript&&(o=document.currentScript.src),_scriptDir&&(o=_scriptDir),o=0!==o.indexOf("blob:")?o.substr(0,o.replace(/[?#].*/,"").lastIndexOf("/")+1):"";var u=n.print||console.log.bind(console),f=n.printErr||console.warn.bind(console);Object.assign(n,c),c=null,n.thisProgram&&(i=n.thisProgram),n.quit&&(a=n.quit);var s,l=0;n.wasmBinary&&(s=n.wasmBinary);var h=n.noExitRuntime||!0;"object"!=typeof WebAssembly&&N("no native wasm support detected");var v,p=!1,d="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function y(t,n,r){var e=n+r;for(r=n;t[r]&&!(r>=e);)++r;if(16<r-n&&t.subarray&&d)return d.decode(t.subarray(n,r));for(e="";n<r;){var c=t[n++];if(128&c){var i=63&t[n++];if(192==(224&c))e+=String.fromCharCode((31&c)<<6|i);else{var a=63&t[n++];65536>(c=224==(240&c)?(15&c)<<12|i<<6|a:(7&c)<<18|i<<12|a<<6|63&t[n++])?e+=String.fromCharCode(c):(c-=65536,e+=String.fromCharCode(55296|c>>10,56320|1023&c))}}else e+=String.fromCharCode(c)}return e}function g(t,n,r,e){if(0<e){e=r+e-1;for(var c=0;c<t.length;++c){var i=t.charCodeAt(c);if(55296<=i&&57343>=i&&(i=65536+((1023&i)<<10)|1023&t.charCodeAt(++c)),127>=i){if(r>=e)break;n[r++]=i}else{if(2047>=i){if(r+1>=e)break;n[r++]=192|i>>6}else{if(65535>=i){if(r+2>=e)break;n[r++]=224|i>>12}else{if(r+3>=e)break;n[r++]=240|i>>18,n[r++]=128|i>>12&63}n[r++]=128|i>>6&63}n[r++]=128|63&i}}n[r]=0}}function m(t){for(var n=0,r=0;r<t.length;++r){var e=t.charCodeAt(r);55296<=e&&57343>=e&&(e=65536+((1023&e)<<10)|1023&t.charCodeAt(++r)),127>=e?++n:n=2047>=e?n+2:65535>=e?n+3:n+4}return n}var b,w,_,A,T,C,j,k,P,$="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0;function D(t,n){for(var r=t>>1,e=r+n/2;!(r>=e)&&T[r];)++r;if(32<(r<<=1)-t&&$)return $.decode(_.subarray(t,r));for(r="",e=0;!(e>=n/2);++e){var c=A[t+2*e>>1];if(0==c)break;r+=String.fromCharCode(c)}return r}function E(t,n,r){if(void 0===r&&(r=2147483647),2>r)return 0;var e=n;r=(r-=2)<2*t.length?r/2:t.length;for(var c=0;c<r;++c)A[n>>1]=t.charCodeAt(c),n+=2;return A[n>>1]=0,n-e}function F(t){return 2*t.length}function W(t,n){for(var r=0,e="";!(r>=n/4);){var c=C[t+4*r>>2];if(0==c)break;++r,65536<=c?(c-=65536,e+=String.fromCharCode(55296|c>>10,56320|1023&c)):e+=String.fromCharCode(c)}return e}function O(t,n,r){if(void 0===r&&(r=2147483647),4>r)return 0;var e=n;r=e+r-4;for(var c=0;c<t.length;++c){var i=t.charCodeAt(c);if(55296<=i&&57343>=i&&(i=65536+((1023&i)<<10)|1023&t.charCodeAt(++c)),C[n>>2]=i,(n+=4)+4>r)break}return C[n>>2]=0,n-e}function S(t){for(var n=0,r=0;r<t.length;++r){var e=t.charCodeAt(r);55296<=e&&57343>=e&&++r,n+=4}return n}function M(){var t=v.buffer;b=t,n.HEAP8=w=new Int8Array(t),n.HEAP16=A=new Int16Array(t),n.HEAP32=C=new Int32Array(t),n.HEAPU8=_=new Uint8Array(t),n.HEAPU16=T=new Uint16Array(t),n.HEAPU32=j=new Uint32Array(t),n.HEAPF32=k=new Float32Array(t),n.HEAPF64=P=new Float64Array(t)}var x,R=[],I=[],U=[],H=[];function Y(){var t=n.preRun.shift();R.unshift(t)}var V,B=0,q=null,z=null;function N(t){throw n.onAbort&&n.onAbort(t),f(t="Aborted("+t+")"),p=!0,t=new WebAssembly.RuntimeError(t+". Build with -s ASSERTIONS=1 for more info."),e(t),t}function K(){return V.startsWith("data:application/octet-stream;base64,")}if(n.preloadedImages={},n.preloadedAudios={},V="ConfiguratorKernel.wasm",!K()){var G=V;V=n.locateFile?n.locateFile(G,o):o+G}function L(){var t=V;try{if(t==V&&s)return new Uint8Array(s);throw"both async and sync fetching of the wasm failed"}catch(t){N(t)}}function J(t){for(;0<t.length;){var r=t.shift();if("function"==typeof r)r(n);else{var e=r.sd;"number"==typeof e?void 0===r.Gc?X(e)():X(e)(r.Gc):e(void 0===r.Gc?null:r.Gc)}}}function X(t){return x.get(t)}function Z(t){this.Oc=t,this.ac=t-16,this.Hc=function(t){C[this.ac+4>>2]=t},this.uc=function(){return C[this.ac+4>>2]},this.mc=function(t){C[this.ac+8>>2]=t},this.Zc=function(){return C[this.ac+8>>2]},this.oc=function(){C[this.ac>>2]=0},this.Mc=function(t){w[this.ac+12>>0]=t?1:0},this.Yc=function(){return 0!=w[this.ac+12>>0]},this.Bc=function(t){w[this.ac+13>>0]=t?1:0},this.Qc=function(){return 0!=w[this.ac+13>>0]},this.lc=function(t,n){this.Hc(t),this.mc(n),this.oc(),this.Mc(!1),this.Bc(!1)},this.Fc=function(){C[this.ac>>2]+=1},this.hd=function(){var t=C[this.ac>>2];return C[this.ac>>2]=t-1,1===t}}function Q(t){this.Ic=function(){Dn(this.ac),this.ac=0},this.mc=function(t){C[this.ac>>2]=t},this.qc=function(){return C[this.ac>>2]},this.lc=function(t){C[this.ac+4>>2]=t},this.oc=function(){return this.ac+4},this.Hc=function(){return C[this.ac+4>>2]},this.Tc=function(){if(Rn(this.rc().uc()))return C[this.qc()>>2];var t=this.Hc();return 0!==t?t:this.qc()},this.rc=function(){return new Z(this.qc())},void 0===t?(this.ac=En(8),this.lc(0)):this.ac=t}var tt=[],nt=0;function rt(t){return Dn(new Z(t).ac)}function et(t){if(t.hd()&&!t.Qc()){var n=t.Zc();n&&X(n)(t.Oc),rt(t.Oc)}}var ct=0;function it(){var t=tt.pop();t||N("no exception to throw");var n=t.rc(),r=t.qc();throw n.Qc()?t.Ic():(tt.push(t),n.Bc(!0),n.Mc(!1),nt++),ct=r,r}var at={};function ot(t){for(;t.length;){var n=t.pop();t.pop()(n)}}function ut(t){return this.fromWireType(j[t>>2])}var ft={},st={},lt={};function ht(t){if(void 0===t)return"_unknown";var n=(t=t.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return 48<=n&&57>=n?"_"+t:t}function vt(t,n){return t=ht(t),new Function("body","return function "+t+'() {\n "use strict"; return body.apply(this, arguments);\n};\n')(n)}function pt(t){var n=Error,r=vt(t,(function(n){this.name=t,this.message=n,void 0!==(n=Error(n).stack)&&(this.stack=this.toString()+"\n"+n.replace(/^Error(:[^\n]*)?\n/,""))}));return r.prototype=Object.create(n.prototype),r.prototype.constructor=r,r.prototype.toString=function(){return void 0===this.message?this.name:this.name+": "+this.message},r}var dt=void 0;function yt(t){throw new dt(t)}function gt(t,n,r){function e(n){(n=r(n)).length!==t.length&&yt("Mismatched type converter count");for(var e=0;e<t.length;++e)Tt(t[e],n[e])}t.forEach((function(t){lt[t]=n}));var c=Array(n.length),i=[],a=0;n.forEach((function(t,n){st.hasOwnProperty(t)?c[n]=st[t]:(i.push(t),ft.hasOwnProperty(t)||(ft[t]=[]),ft[t].push((function(){c[n]=st[t],++a===i.length&&e(c)})))})),0===i.length&&e(c)}function mt(t){switch(t){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+t)}}var bt=void 0;function wt(t){for(var n="";_[t];)n+=bt[_[t++]];return n}var _t=void 0;function At(t){throw new _t(t)}function Tt(t,n,r={}){if(!("argPackAdvance"in n))throw new TypeError("registerType registeredInstance requires argPackAdvance");var e=n.name;if(t||At('type "'+e+'" must have a positive integer typeid pointer'),st.hasOwnProperty(t)){if(r.cd)return;At("Cannot register type '"+e+"' twice")}st[t]=n,delete lt[t],ft.hasOwnProperty(t)&&(n=ft[t],delete ft[t],n.forEach((function(t){t()})))}function Ct(t){At(t.$b.cc.bc.name+" instance already deleted")}var jt=!1;function kt(){}function Pt(t){--t.count.value,0===t.count.value&&(t.ec?t.ic.kc(t.ec):t.cc.bc.kc(t.ac))}var $t={},Dt=[];function Et(){for(;Dt.length;){var t=Dt.pop();t.$b.pc=!1,t.delete()}}var Ft=void 0,Wt={};function Ot(t,n){return n.cc&&n.ac||yt("makeClassHandle requires ptr and ptrType"),!!n.ic!=!!n.ec&&yt("Both smartPtrType and smartPtr must be specified"),n.count={value:1},St(Object.create(t,{$b:{value:n}}))}function St(t){return"undefined"==typeof FinalizationRegistry?(St=t=>t,t):(jt=new FinalizationRegistry(t=>{Pt(t.$b)}),kt=t=>{jt.unregister(t)},(St=t=>{var n=t.$b;return n.ec&&jt.register(t,{$b:n},t),t})(t))}function Mt(){}function xt(t,n,r){if(void 0===t[n].dc){var e=t[n];t[n]=function(){return t[n].dc.hasOwnProperty(arguments.length)||At("Function '"+r+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+t[n].dc+")!"),t[n].dc[arguments.length].apply(this,arguments)},t[n].dc=[],t[n].dc[e.yc]=e}}function Rt(t,r,e){n.hasOwnProperty(t)?((void 0===e||void 0!==n[t].dc&&void 0!==n[t].dc[e])&&At("Cannot register public name '"+t+"' twice"),xt(n,t,t),n.hasOwnProperty(e)&&At("Cannot register multiple overloads of a function with the same number of arguments ("+e+")!"),n[t].dc[e]=r):(n[t]=r,void 0!==e&&(n[t].ud=e))}function It(t,n,r,e,c,i,a,o){this.name=t,this.constructor=n,this.sc=r,this.kc=e,this.jc=c,this.Wc=i,this.xc=a,this.Uc=o,this.fd=[]}function Ut(t,n,r){for(;n!==r;)n.xc||At("Expected null or instance of "+r.name+", got an instance of "+n.name),t=n.xc(t),n=n.jc;return t}function Ht(t,n){return null===n?(this.Jc&&At("null is not a valid "+this.name),0):(n.$b||At('Cannot pass "'+an(n)+'" as a '+this.name),n.$b.ac||At("Cannot pass deleted object as a pointer of type "+this.name),Ut(n.$b.ac,n.$b.cc.bc,this.bc))}function Yt(t,n){if(null===n){if(this.Jc&&At("null is not a valid "+this.name),this.Ac){var r=this.Kc();return null!==t&&t.push(this.kc,r),r}return 0}if(n.$b||At('Cannot pass "'+an(n)+'" as a '+this.name),n.$b.ac||At("Cannot pass deleted object as a pointer of type "+this.name),!this.zc&&n.$b.cc.zc&&At("Cannot convert argument of type "+(n.$b.ic?n.$b.ic.name:n.$b.cc.name)+" to parameter type "+this.name),r=Ut(n.$b.ac,n.$b.cc.bc,this.bc),this.Ac)switch(void 0===n.$b.ec&&At("Passing raw pointer to smart pointer is illegal"),this.md){case 0:n.$b.ic===this?r=n.$b.ec:At("Cannot convert argument of type "+(n.$b.ic?n.$b.ic.name:n.$b.cc.name)+" to parameter type "+this.name);break;case 1:r=n.$b.ec;break;case 2:if(n.$b.ic===this)r=n.$b.ec;else{var e=n.clone();r=this.gd(r,rn((function(){e.delete()}))),null!==t&&t.push(this.kc,r)}break;default:At("Unsupporting sharing policy")}return r}function Vt(t,n){return null===n?(this.Jc&&At("null is not a valid "+this.name),0):(n.$b||At('Cannot pass "'+an(n)+'" as a '+this.name),n.$b.ac||At("Cannot pass deleted object as a pointer of type "+this.name),n.$b.cc.zc&&At("Cannot convert argument of type "+n.$b.cc.name+" to parameter type "+this.name),Ut(n.$b.ac,n.$b.cc.bc,this.bc))}function Bt(t,n,r,e,c,i,a,o,u,f,s){this.name=t,this.bc=n,this.Jc=r,this.zc=e,this.Ac=c,this.ed=i,this.md=a,this.Rc=o,this.Kc=u,this.gd=f,this.kc=s,c||void 0!==n.jc?this.toWireType=Yt:(this.toWireType=e?Ht:Vt,this.hc=null)}function qt(t,r,e){n.hasOwnProperty(t)||yt("Replacing nonexistant public symbol"),void 0!==n[t].dc&&void 0!==e?n[t].dc[e]=r:(n[t]=r,n[t].yc=e)}function zt(t,r){var e=(t=wt(t)).includes("j")?function(t,r){var e=[];return function(){if(e.length=0,Object.assign(e,arguments),t.includes("j")){var c=n["dynCall_"+t];c=e&&e.length?c.apply(null,[r].concat(e)):c.call(null,r)}else c=X(r).apply(null,e);return c}}(t,r):X(r);return"function"!=typeof e&&At("unknown function pointer with signature "+t+": "+r),e}var Nt=void 0;function Kt(t){var n=wt(t=Fn(t));return Dn(t),n}function Gt(t,n){var r=[],e={};throw n.forEach((function t(n){e[n]||st[n]||(lt[n]?lt[n].forEach(t):(r.push(n),e[n]=!0))})),new Nt(t+": "+r.map(Kt).join([", "]))}function Lt(t,n){for(var r=[],e=0;e<t;e++)r.push(C[(n>>2)+e]);return r}function Jt(t){var n=Function;if(!(n instanceof Function))throw new TypeError("new_ called with constructor type "+typeof n+" which is not a function");var r=vt(n.name||"unknownFunctionName",(function(){}));return r.prototype=n.prototype,r=new r,(t=n.apply(r,t))instanceof Object?t:r}function Xt(t,n,r,e,c){var i=n.length;2>i&&At("argTypes array size mismatch! Must at least get return value and 'this' types!");var a=null!==n[1]&&null!==r,o=!1;for(r=1;r<n.length;++r)if(null!==n[r]&&void 0===n[r].hc){o=!0;break}var u="void"!==n[0].name,f="",s="";for(r=0;r<i-2;++r)f+=(0!==r?", ":"")+"arg"+r,s+=(0!==r?", ":"")+"arg"+r+"Wired";t="return function "+ht(t)+"("+f+") {\nif (arguments.length !== "+(i-2)+") {\nthrowBindingError('function "+t+" called with ' + arguments.length + ' arguments, expected "+(i-2)+" args!');\n}\n",o&&(t+="var destructors = [];\n");var l=o?"destructors":"null";for(f="throwBindingError invoker fn runDestructors retType classParam".split(" "),e=[At,e,c,ot,n[0],n[1]],a&&(t+="var thisWired = classParam.toWireType("+l+", this);\n"),r=0;r<i-2;++r)t+="var arg"+r+"Wired = argType"+r+".toWireType("+l+", arg"+r+"); // "+n[r+2].name+"\n",f.push("argType"+r),e.push(n[r+2]);if(a&&(s="thisWired"+(0<s.length?", ":"")+s),t+=(u?"var rv = ":"")+"invoker(fn"+(0<s.length?", ":"")+s+");\n",o)t+="runDestructors(destructors);\n";else for(r=a?1:2;r<n.length;++r)i=1===r?"thisWired":"arg"+(r-2)+"Wired",null!==n[r].hc&&(t+=i+"_dtor("+i+"); // "+n[r].name+"\n",f.push(i+"_dtor"),e.push(n[r].hc));return u&&(t+="var ret = retType.fromWireType(rv);\nreturn ret;\n"),f.push(t+"}\n"),Jt(f).apply(null,e)}var Zt=[],Qt=[{},{value:void 0},{value:null},{value:!0},{value:!1}];function tn(t){4<t&&0==--Qt[t].Lc&&(Qt[t]=void 0,Zt.push(t))}function nn(t){return t||At("Cannot use deleted val. handle = "+t),Qt[t].value}function rn(t){switch(t){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:var n=Zt.length?Zt.pop():Qt.length;return Qt[n]={Lc:1,value:t},n}}function en(t,n,r){switch(n){case 0:return function(t){return this.fromWireType((r?w:_)[t])};case 1:return function(t){return this.fromWireType((r?A:T)[t>>1])};case 2:return function(t){return this.fromWireType((r?C:j)[t>>2])};default:throw new TypeError("Unknown integer type: "+t)}}function cn(t,n){var r=st[t];return void 0===r&&At(n+" has unknown type "+Kt(t)),r}function an(t){if(null===t)return"null";var n=typeof t;return"object"===n||"array"===n||"function"===n?t.toString():""+t}function on(t,n){switch(n){case 2:return function(t){return this.fromWireType(k[t>>2])};case 3:return function(t){return this.fromWireType(P[t>>3])};default:throw new TypeError("Unknown float type: "+t)}}function un(t,n,r){switch(n){case 0:return r?function(t){return w[t]}:function(t){return _[t]};case 1:return r?function(t){return A[t>>1]}:function(t){return T[t>>1]};case 2:return r?function(t){return C[t>>2]}:function(t){return j[t>>2]};default:throw new TypeError("Unknown integer type: "+t)}}function fn(t,n){for(var r=Array(t),e=0;e<t;++e)r[e]=cn(C[(n>>2)+e],"parameter "+e);return r}var sn={};function ln(t){var n=sn[t];return void 0===n?wt(t):n}var hn=[];function vn(){return"object"==typeof globalThis?globalThis:Function("return this")()}var pn=[],dn={},yn={};function gn(){if(!mn){var t,n={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:i||"./this.program"};for(t in yn)void 0===yn[t]?delete n[t]:n[t]=yn[t];var r=[];for(t in n)r.push(t+"="+n[t]);mn=r}return mn}var mn,bn=[null,[],[]],wn={};function _n(t){return 0==t%4&&(0!=t%100||0==t%400)}function An(t,n){for(var r=0,e=0;e<=n;r+=t[e++]);return r}var Tn=[31,29,31,30,31,30,31,31,30,31,30,31],Cn=[31,28,31,30,31,30,31,31,30,31,30,31];function jn(t,n){for(t=new Date(t.getTime());0<n;){var r=t.getMonth(),e=(_n(t.getFullYear())?Tn:Cn)[r];if(!(n>e-t.getDate())){t.setDate(t.getDate()+n);break}n-=e-t.getDate()+1,t.setDate(1),11>r?t.setMonth(r+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return t}dt=n.InternalError=pt("InternalError");for(var kn=Array(256),Pn=0;256>Pn;++Pn)kn[Pn]=String.fromCharCode(Pn);bt=kn,_t=n.BindingError=pt("BindingError"),Mt.prototype.isAliasOf=function(t){if(!(this instanceof Mt&&t instanceof Mt))return!1;var n=this.$b.cc.bc,r=this.$b.ac,e=t.$b.cc.bc;for(t=t.$b.ac;n.jc;)r=n.xc(r),n=n.jc;for(;e.jc;)t=e.xc(t),e=e.jc;return n===e&&r===t},Mt.prototype.clone=function(){if(this.$b.ac||Ct(this),this.$b.vc)return this.$b.count.value+=1,this;var t=St,n=Object,r=n.create,e=Object.getPrototypeOf(this),c=this.$b;return(t=t(r.call(n,e,{$b:{value:{count:c.count,pc:c.pc,vc:c.vc,ac:c.ac,cc:c.cc,ec:c.ec,ic:c.ic}}}))).$b.count.value+=1,t.$b.pc=!1,t},Mt.prototype.delete=function(){this.$b.ac||Ct(this),this.$b.pc&&!this.$b.vc&&At("Object already scheduled for deletion"),kt(this),Pt(this.$b),this.$b.vc||(this.$b.ec=void 0,this.$b.ac=void 0)},Mt.prototype.isDeleted=function(){return!this.$b.ac},Mt.prototype.deleteLater=function(){return this.$b.ac||Ct(this),this.$b.pc&&!this.$b.vc&&At("Object already scheduled for deletion"),Dt.push(this),1===Dt.length&&Ft&&Ft(Et),this.$b.pc=!0,this},n.getInheritedInstanceCount=function(){return Object.keys(Wt).length},n.getLiveInheritedInstances=function(){var t,n=[];for(t in Wt)Wt.hasOwnProperty(t)&&n.push(Wt[t]);return n},n.flushPendingDeletes=Et,n.setDelayFunction=function(t){Ft=t,Dt.length&&Ft&&Ft(Et)},Bt.prototype.Xc=function(t){return this.Rc&&(t=this.Rc(t)),t},Bt.prototype.Nc=function(t){this.kc&&this.kc(t)},Bt.prototype.argPackAdvance=8,Bt.prototype.readValueFromPointer=ut,Bt.prototype.deleteObject=function(t){null!==t&&t.delete()},Bt.prototype.fromWireType=function(t){function n(){return this.Ac?Ot(this.bc.sc,{cc:this.ed,ac:r,ic:this,ec:t}):Ot(this.bc.sc,{cc:this,ac:t})}var r=this.Xc(t);if(!r)return this.Nc(t),null;var e=function(t,n){for(void 0===n&&At("ptr should not be undefined");t.jc;)n=t.xc(n),t=t.jc;return Wt[n]}(this.bc,r);if(void 0!==e)return 0===e.$b.count.value?(e.$b.ac=r,e.$b.ec=t,e.clone()):(e=e.clone(),this.Nc(t),e);if(e=this.bc.Wc(r),!(e=$t[e]))return n.call(this);e=this.zc?e.Sc:e.pointerType;var c=function t(n,r,e){return r===e?n:void 0===e.jc||null===(n=t(n,r,e.jc))?null:e.Uc(n)}(r,this.bc,e.bc);return null===c?n.call(this):this.Ac?Ot(e.bc.sc,{cc:e,ac:c,ic:this,ec:t}):Ot(e.bc.sc,{cc:e,ac:c})},Nt=n.UnboundTypeError=pt("UnboundTypeError"),n.count_emval_handles=function(){for(var t=0,n=5;n<Qt.length;++n)void 0!==Qt[n]&&++t;return t},n.get_first_emval=function(){for(var t=5;t<Qt.length;++t)if(void 0!==Qt[t])return Qt[t];return null};var $n={o:function(t){return En(t+16)+16},p:function(t){var n=(t=new Q(t)).rc();return n.Yc()||(n.Mc(!0),nt--),n.Bc(!1),tt.push(t),n.Fc(),t.Tc()},Oa:function(t){throw f("Unexpected exception thrown, this is not properly supported - aborting"),p=!0,t},Ua:function(){if(!tt.length)return 0;var t=tt[tt.length-1];return t.rc().Fc(),t.qc()},ya:function(t){t&&et(new Z(t))},t:function(){On(0);var t=tt.pop();et(t.rc()),t.Ic(),ct=0},b:function(){var t=ct;if(!t)return l=0;var n=new Z(t).uc(),r=new Q;if(r.mc(t),r.lc(t),!n)return l=0,0|r.ac;t=Array.prototype.slice.call(arguments);for(var e=0;e<t.length;e++){var c=t[e];if(0===c||c===n)break;if(xn(c,n,r.oc()))return l=c,0|r.ac}return l=n,0|r.ac},i:function(){var t=ct;if(!t)return l=0;var n=new Z(t).uc(),r=new Q;if(r.mc(t),r.lc(t),!n)return l=0,0|r.ac;t=Array.prototype.slice.call(arguments);for(var e=0;e<t.length;e++){var c=t[e];if(0===c||c===n)break;if(xn(c,n,r.oc()))return l=c,0|r.ac}return l=n,0|r.ac},G:function(){var t=ct;if(!t)return l=0;var n=new Z(t).uc(),r=new Q;if(r.mc(t),r.lc(t),!n)return l=0,0|r.ac;t=Array.prototype.slice.call(arguments);for(var e=0;e<t.length;e++){var c=t[e];if(0===c||c===n)break;if(xn(c,n,r.oc()))return l=c,0|r.ac}return l=n,0|r.ac},ea:function(){var t=ct;if(!t)return l=0;var n=new Z(t).uc(),r=new Q;if(r.mc(t),r.lc(t),!n)return l=0,0|r.ac;t=Array.prototype.slice.call(arguments);for(var e=0;e<t.length;e++){var c=t[e];if(0===c||c===n)break;if(xn(c,n,r.oc()))return l=c,0|r.ac}return l=n,0|r.ac},q:rt,xa:function(t){t&&new Z(t).Fc()},wa:it,Ta:function(t){if(t){var n=new Q;n.mc(t),t=n.rc(),tt.push(n),t.Bc(!0),it()}},B:function(t,n,r){throw new Z(t).lc(n,r),ct=t,nt++,t},Va:function(){return nt},e:function(t){var n=(t=new Q(t)).qc();throw ct||(ct=n),t.Ic(),n},ab:function(t){var n=at[t];delete at[t];var r=n.Kc,e=n.kc,c=n.Pc;gt([t],c.map((function(t){return t.bd})).concat(c.map((function(t){return t.kd}))),(function(t){var i={};return c.forEach((function(n,r){var e=t[r],a=n.$c,o=n.ad,u=t[r+c.length],f=n.jd,s=n.ld;i[n.Vc]={read:function(t){return e.fromWireType(a(o,t))},write:function(t,n){var r=[];f(s,t,u.toWireType(r,n)),ot(r)}}})),[{name:n.name,fromWireType:function(t){var n,r={};for(n in i)r[n]=i[n].read(t);return e(t),r},toWireType:function(t,n){for(var c in i)if(!(c in n))throw new TypeError('Missing field: "'+c+'"');var a=r();for(c in i)i[c].write(a,n[c]);return null!==t&&t.push(e,a),a},argPackAdvance:8,readValueFromPointer:ut,hc:e}]}))},mb:function(){},Za:function(t,n,r,e,c){var i=mt(r);Tt(t,{name:n=wt(n),fromWireType:function(t){return!!t},toWireType:function(t,n){return n?e:c},argPackAdvance:8,readValueFromPointer:function(t){if(1===r)var e=w;else if(2===r)e=A;else{if(4!==r)throw new TypeError("Unknown boolean type size: "+n);e=C}return this.fromWireType(e[t>>i])},hc:null})},A:function(t,n,r,e,c,i,a,o,u,f,s,l,h){s=wt(s),i=zt(c,i),o&&(o=zt(a,o)),f&&(f=zt(u,f)),h=zt(l,h);var v=ht(s);Rt(v,(function(){Gt("Cannot construct "+s+" due to unbound types",[e])})),gt([t,n,r],e?[e]:[],(function(n){if(n=n[0],e)var r=n.bc,c=r.sc;else c=Mt.prototype;n=vt(v,(function(){if(Object.getPrototypeOf(this)!==a)throw new _t("Use 'new' to construct "+s);if(void 0===u.nc)throw new _t(s+" has no accessible constructor");var t=u.nc[arguments.length];if(void 0===t)throw new _t("Tried to invoke ctor of "+s+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(u.nc).toString()+") parameters instead!");return t.apply(this,arguments)}));var a=Object.create(c,{constructor:{value:n}});n.prototype=a;var u=new It(s,n,a,h,r,i,o,f);r=new Bt(s,u,!0,!1,!1),c=new Bt(s+"*",u,!1,!1,!1);var l=new Bt(s+" const*",u,!1,!0,!1);return $t[t]={pointerType:c,Sc:l},qt(v,n),[r,c,l]}))},z:function(t,n,r,e,c,i){0<n||N(void 0);var a=Lt(n,r);c=zt(e,c),gt([],[t],(function(t){var r="constructor "+(t=t[0]).name;if(void 0===t.bc.nc&&(t.bc.nc=[]),void 0!==t.bc.nc[n-1])throw new _t("Cannot register multiple constructors with identical number of parameters ("+(n-1)+") for class '"+t.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!");return t.bc.nc[n-1]=()=>{Gt("Cannot construct "+t.name+" due to unbound types",a)},gt([],a,(function(e){return e.splice(1,0,null),t.bc.nc[n-1]=Xt(r,e,null,c,i),[]})),[]}))},m:function(t,n,r,e,c,i,a,o){var u=Lt(r,e);n=wt(n),i=zt(c,i),gt([],[t],(function(t){function e(){Gt("Cannot call "+c+" due to unbound types",u)}var c=(t=t[0]).name+"."+n;n.startsWith("@@")&&(n=Symbol[n.substring(2)]),o&&t.bc.fd.push(n);var f=t.bc.sc,s=f[n];return void 0===s||void 0===s.dc&&s.className!==t.name&&s.yc===r-2?(e.yc=r-2,e.className=t.name,f[n]=e):(xt(f,n,c),f[n].dc[r-2]=e),gt([],u,(function(e){return e=Xt(c,e,t,i,a),void 0===f[n].dc?(e.yc=r-2,f[n]=e):f[n].dc[r-2]=e,[]})),[]}))},Ya:function(t,n){Tt(t,{name:n=wt(n),fromWireType:function(t){var n=nn(t);return tn(t),n},toWireType:function(t,n){return rn(n)},argPackAdvance:8,readValueFromPointer:ut,hc:null})},Z:function(t,n,r,e){function c(){}r=mt(r),n=wt(n),c.values={},Tt(t,{name:n,constructor:c,fromWireType:function(t){return this.constructor.values[t]},toWireType:function(t,n){return n.value},argPackAdvance:8,readValueFromPointer:en(n,r,e),hc:null}),Rt(n,c)},Y:function(t,n,r){var e=cn(t,"enum");n=wt(n),t=e.constructor,e=Object.create(e.constructor.prototype,{value:{value:r},constructor:{value:vt(e.name+"_"+n,(function(){}))}}),t.values[r]=e,t[n]=e},za:function(t,n,r){r=mt(r),Tt(t,{name:n=wt(n),fromWireType:function(t){return t},toWireType:function(t,n){return n},argPackAdvance:8,readValueFromPointer:on(n,r),hc:null})},_:function(t,n,r,e,c,i){var a=Lt(n,r);t=wt(t),c=zt(e,c),Rt(t,(function(){Gt("Cannot call "+t+" due to unbound types",a)}),n-1),gt([],a,(function(r){return qt(t,Xt(t,[r[0],null].concat(r.slice(1)),null,c,i),n-1),[]}))},Q:function(t,n,r,e,c){n=wt(n),-1===c&&(c=4294967295),c=mt(r);var i=t=>t;if(0===e){var a=32-8*r;i=t=>t<<a>>>a}r=n.includes("unsigned")?function(t,n){return n>>>0}:function(t,n){return n},Tt(t,{name:n,fromWireType:i,toWireType:r,argPackAdvance:8,readValueFromPointer:un(n,c,0!==e),hc:null})},J:function(t,n,r){function e(t){var n=j;return new c(b,n[1+(t>>=2)],n[t])}var c=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][n];Tt(t,{name:r=wt(r),fromWireType:e,argPackAdvance:8,readValueFromPointer:e},{cd:!0})},pa:function(t,n,r,e,c,i,a,o,u,f,s,l){r=wt(r),i=zt(c,i),o=zt(a,o),f=zt(u,f),l=zt(s,l),gt([t],[n],(function(t){return t=t[0],[new Bt(r,t.bc,!1,!1,!0,t,e,i,o,f,l)]}))},Aa:function(t,n){var r="std::string"===(n=wt(n));Tt(t,{name:n,fromWireType:function(t){var n=j[t>>2];if(r)for(var e=t+4,c=0;c<=n;++c){var i=t+4+c;if(c==n||0==_[i]){if(e=e?y(_,e,i-e):"",void 0===a)var a=e;else a+=String.fromCharCode(0),a+=e;e=i+1}}else{for(a=Array(n),c=0;c<n;++c)a[c]=String.fromCharCode(_[t+4+c]);a=a.join("")}return Dn(t),a},toWireType:function(t,n){n instanceof ArrayBuffer&&(n=new Uint8Array(n));var e="string"==typeof n;e||n instanceof Uint8Array||n instanceof Uint8ClampedArray||n instanceof Int8Array||At("Cannot pass non-string to std::string");var c=(r&&e?()=>m(n):()=>n.length)(),i=En(4+c+1);if(j[i>>2]=c,r&&e)g(n,_,i+4,c+1);else if(e)for(e=0;e<c;++e){var a=n.charCodeAt(e);255<a&&(Dn(i),At("String has UTF-16 code units that do not fit in 8 bits")),_[i+4+e]=a}else for(e=0;e<c;++e)_[i+4+e]=n[e];return null!==t&&t.push(Dn,i),i},argPackAdvance:8,readValueFromPointer:ut,hc:function(t){Dn(t)}})},oa:function(t,n,r){if(r=wt(r),2===n)var e=D,c=E,i=F,a=()=>T,o=1;else 4===n&&(e=W,c=O,i=S,a=()=>j,o=2);Tt(t,{name:r,fromWireType:function(t){for(var r,c=j[t>>2],i=a(),u=t+4,f=0;f<=c;++f){var s=t+4+f*n;f!=c&&0!=i[s>>o]||(u=e(u,s-u),void 0===r?r=u:(r+=String.fromCharCode(0),r+=u),u=s+n)}return Dn(t),r},toWireType:function(t,e){"string"!=typeof e&&At("Cannot pass non-string to C++ string type "+r);var a=i(e),u=En(4+a+n);return j[u>>2]=a>>o,c(e,u+4,a+n),null!==t&&t.push(Dn,u),u},argPackAdvance:8,readValueFromPointer:ut,hc:function(t){Dn(t)}})},D:function(t,n,r,e,c,i){at[t]={name:wt(n),Kc:zt(r,e),kc:zt(c,i),Pc:[]}},u:function(t,n,r,e,c,i,a,o,u,f){at[t].Pc.push({Vc:wt(n),bd:r,$c:zt(e,c),ad:i,kd:a,jd:zt(o,u),ld:f})},_a:function(t,n){Tt(t,{dd:!0,name:n=wt(n),argPackAdvance:0,fromWireType:function(){},toWireType:function(){}})},ra:function(t,n,r){t=nn(t),n=cn(n,"emval::as");var e=[],c=rn(e);return C[r>>2]=c,n.toWireType(e,t)},$a:function(t,n,r,e){t=nn(t),r=fn(n,r);for(var c=Array(n),i=0;i<n;++i){var a=r[i];c[i]=a.readValueFromPointer(e),e+=a.argPackAdvance}return rn(t=t.apply(void 0,c))},V:function(t,n,r,e,c){t=hn[t],n=nn(n),r=ln(r);var i=[];return C[e>>2]=rn(i),t(n,r,i,c)},F:function(t,n,r,e){(t=hn[t])(n=nn(n),r=ln(r),null,e)},ka:tn,Ka:function(t){return 0===t?rn(vn()):(t=ln(t),rn(vn()[t]))},x:function(t,n){var r=fn(t,n),e=r[0];n=e.name+"_$"+r.slice(1).map((function(t){return t.name})).join("_")+"$";var c=pn[n];if(void 0!==c)return c;c=["retType"];for(var i=[e],a="",o=0;o<t-1;++o)a+=(0!==o?", ":"")+"arg"+o,c.push("argType"+o),i.push(r[1+o]);var u="return function "+ht("methodCaller_"+n)+"(handle, name, destructors, args) {\n",f=0;for(o=0;o<t-1;++o)u+=" var arg"+o+" = argType"+o+".readValueFromPointer(args"+(f?"+"+f:"")+");\n",f+=r[o+1].argPackAdvance;for(u+=" var rv = handle[name]("+a+");\n",o=0;o<t-1;++o)r[o+1].deleteObject&&(u+=" argType"+o+".deleteObject(arg"+o+");\n");return e.dd||(u+=" return retType.toWireType(destructors, rv);\n"),c.push(u+"};\n"),c=function(t){var n=hn.length;return hn.push(t),n}(t=Jt(c).apply(null,i)),pn[n]=c},cb:function(t){return t=ln(t),rn(n[t])},gb:function(t,n){return rn((t=nn(t))[n=nn(n)])},qa:function(t){4<t&&(Qt[t].Lc+=1)},bb:function(t,r,e,c){t=nn(t);var i=dn[r];if(!i){i="";for(var a=0;a<r;++a)i+=(0!==a?", ":"")+"arg"+a;var o="return function emval_allocator_"+r+"(constructor, argTypes, args) {\n";for(a=0;a<r;++a)o+="var argType"+a+" = requireRegisteredType(Module['HEAP32'][(argTypes >>> 2) + "+a+'], "parameter '+a+'");\nvar arg'+a+" = argType"+a+".readValueFromPointer(args);\nargs += argType"+a+"['argPackAdvance'];\n";i=new Function("requireRegisteredType","Module","valueToHandle",o+"var obj = new constructor("+i+");\nreturn valueToHandle(obj);\n}\n")(cn,n,rn),dn[r]=i}return i(t,e,c)},Na:function(){return rn([])},fb:function(t){return rn(ln(t))},Ma:function(){return rn({})},eb:function(t){ot(nn(t)),tn(t)},sb:function(t,n,r){t=nn(t),n=nn(n),r=nn(r),t[n]=r},db:function(t,n){return(t=nn(t))===nn(n)},E:function(t,n){return rn(t=(t=cn(t,"_emval_take_value")).readValueFromPointer(n))},ma:function(){N("")},na:function(t){var n=_.length;if(2147483648<(t>>>=0))return!1;for(var r=1;4>=r;r*=2){var e=n*(1+.2/r);e=Math.min(e,t+100663296);var c=Math;e=Math.max(t,e),c=c.min.call(c,2147483648,e+(65536-e%65536)%65536);t:{try{v.grow(c-b.byteLength+65535>>>16),M();var i=1;break t}catch(t){}i=void 0}if(i)return!0}return!1},Wa:function(t,n){var r=0;return gn().forEach((function(e,c){var i=n+r;for(c=C[t+4*c>>2]=i,i=0;i<e.length;++i)w[c++>>0]=e.charCodeAt(i);w[c>>0]=0,r+=e.length+1})),0},Xa:function(t,n){var r=gn();C[t>>2]=r.length;var e=0;return r.forEach((function(t){e+=t.length+1})),C[n>>2]=e,0},Qa:function(){return 0},Sa:function(t,n,r,e){return t=wn.td(t),n=wn.rd(t,n,r),C[e>>2]=n,0},lb:function(){},Ra:function(t,n,r,e){for(var c=0,i=0;i<r;i++){var a=C[n>>2],o=C[n+4>>2];n+=8;for(var s=0;s<o;s++){var l=_[a+s],h=bn[t];0===l||10===l?((1===t?u:f)(y(h,0)),h.length=0):h.push(l)}c+=o}return C[e>>2]=c,0},a:function(){return l},La:function(t,n){var r=Sn();try{return X(t)(n)}catch(t){if(Mn(r),t!==t+0)throw t;On(1,0)}},X:function(t,n,r){var e=Sn();try{return X(t)(n,r)}catch(t){if(Mn(e),t!==t+0)throw t;On(1,0)}},Da:function(t,n,r,e){var c=Sn();try{return X(t)(n,r,e)}catch(t){if(Mn(c),t!==t+0)throw t;On(1,0)}},I:function(t,n){var r=Sn();try{return X(t)(n)}catch(t){if(Mn(r),t!==t+0)throw t;On(1,0)}},rb:function(t,n,r){var e=Sn();try{return X(t)(n,r)}catch(t){if(Mn(e),t!==t+0)throw t;On(1,0)}},K:function(t,n,r){var e=Sn();try{return X(t)(n,r)}catch(t){if(Mn(e),t!==t+0)throw t;On(1,0)}},vb:function(t,n,r,e,c){var i=Sn();try{return X(t)(n,r,e,c)}catch(t){if(Mn(i),t!==t+0)throw t;On(1,0)}},W:function(t,n,r,e,c){var i=Sn();try{return X(t)(n,r,e,c)}catch(t){if(Mn(i),t!==t+0)throw t;On(1,0)}},H:function(t,n,r,e){var c=Sn();try{return X(t)(n,r,e)}catch(t){if(Mn(c),t!==t+0)throw t;On(1,0)}},S:function(t){var n=Sn();try{return X(t)()}catch(t){if(Mn(n),t!==t+0)throw t;On(1,0)}},$:function(t,n){var r=Sn();try{return X(t)(n)}catch(t){if(Mn(r),t!==t+0)throw t;On(1,0)}},Ja:function(t,n,r,e){var c=Sn();try{return X(t)(n,r,e)}catch(t){if(Mn(c),t!==t+0)throw t;On(1,0)}},g:function(t,n){var r=Sn();try{return X(t)(n)}catch(t){if(Mn(r),t!==t+0)throw t;On(1,0)}},la:function(t,n,r){var e=Sn();try{return X(t)(n,r)}catch(t){if(Mn(e),t!==t+0)throw t;On(1,0)}},ja:function(t,n,r){var e=Sn();try{return X(t)(n,r)}catch(t){if(Mn(e),t!==t+0)throw t;On(1,0)}},Ab:function(t,n,r,e,c,i,a,o,u){var f=Sn();try{return X(t)(n,r,e,c,i,a,o,u)}catch(t){if(Mn(f),t!==t+0)throw t;On(1,0)}},c:function(t,n,r){var e=Sn();try{return X(t)(n,r)}catch(t){if(Mn(e),t!==t+0)throw t;On(1,0)}},tb:function(t,n,r,e){var c=Sn();try{return X(t)(n,r,e)}catch(t){if(Mn(c),t!==t+0)throw t;On(1,0)}},ub:function(t,n,r,e,c){var i=Sn();try{return X(t)(n,r,e,c)}catch(t){if(Mn(i),t!==t+0)throw t;On(1,0)}},h:function(t,n,r,e){var c=Sn();try{return X(t)(n,r,e)}catch(t){if(Mn(c),t!==t+0)throw t;On(1,0)}},Ha:function(t,n,r,e,c,i,a,o,u,f,s,l,h,v){var p=Sn();try{return X(t)(n,r,e,c,i,a,o,u,f,s,l,h,v)}catch(t){if(Mn(p),t!==t+0)throw t;On(1,0)}},ua:function(t,n,r,e,c,i,a,o){var u=Sn();try{return X(t)(n,r,e,c,i,a,o)}catch(t){if(Mn(u),t!==t+0)throw t;On(1,0)}},n:function(t,n,r,e,c){var i=Sn();try{return X(t)(n,r,e,c)}catch(t){if(Mn(i),t!==t+0)throw t;On(1,0)}},Ca:function(t,n,r,e,c,i){var a=Sn();try{return X(t)(n,r,e,c,i)}catch(t){if(Mn(a),t!==t+0)throw t;On(1,0)}},w:function(t,n,r,e,c,i){var a=Sn();try{return X(t)(n,r,e,c,i)}catch(t){if(Mn(a),t!==t+0)throw t;On(1,0)}},y:function(t,n,r,e,c,i,a){var o=Sn();try{return X(t)(n,r,e,c,i,a)}catch(t){if(Mn(o),t!==t+0)throw t;On(1,0)}},N:function(t,n,r,e,c,i,a,o){var u=Sn();try{return X(t)(n,r,e,c,i,a,o)}catch(t){if(Mn(u),t!==t+0)throw t;On(1,0)}},da:function(t,n,r,e,c,i,a,o,u){var f=Sn();try{return X(t)(n,r,e,c,i,a,o,u)}catch(t){if(Mn(f),t!==t+0)throw t;On(1,0)}},M:function(t,n,r,e,c,i,a,o,u,f){var s=Sn();try{return X(t)(n,r,e,c,i,a,o,u,f)}catch(t){if(Mn(s),t!==t+0)throw t;On(1,0)}},ca:function(t,n,r,e,c,i,a,o,u,f,s,l){var h=Sn();try{return X(t)(n,r,e,c,i,a,o,u,f,s,l)}catch(t){if(Mn(h),t!==t+0)throw t;On(1,0)}},hb:function(t,n,r,e){var c=Sn();try{return Hn(t,n,r,e)}catch(t){if(Mn(c),t!==t+0)throw t;On(1,0)}},kb:function(t,n,r){var e=Sn();try{return Un(t,n,r)}catch(t){if(Mn(e),t!==t+0)throw t;On(1,0)}},l:function(t){var n=Sn();try{X(t)()}catch(t){if(Mn(n),t!==t+0)throw t;On(1,0)}},k:function(t,n){var r=Sn();try{X(t)(n)}catch(t){if(Mn(r),t!==t+0)throw t;On(1,0)}},aa:function(t,n,r){var e=Sn();try{X(t)(n,r)}catch(t){if(Mn(e),t!==t+0)throw t;On(1,0)}},va:function(t,n,r,e){var c=Sn();try{X(t)(n,r,e)}catch(t){if(Mn(c),t!==t+0)throw t;On(1,0)}},Fa:function(t,n,r){var e=Sn();try{X(t)(n,r)}catch(t){if(Mn(e),t!==t+0)throw t;On(1,0)}},ia:function(t,n,r,e,c,i,a,o,u,f,s){var l=Sn();try{X(t)(n,r,e,c,i,a,o,u,f,s)}catch(t){if(Mn(l),t!==t+0)throw t;On(1,0)}},Eb:function(t,n,r,e,c,i,a,o,u){var f=Sn();try{X(t)(n,r,e,c,i,a,o,u)}catch(t){if(Mn(f),t!==t+0)throw t;On(1,0)}},yb:function(t,n,r,e,c,i,a,o,u,f,s){var l=Sn();try{X(t)(n,r,e,c,i,a,o,u,f,s)}catch(t){if(Mn(l),t!==t+0)throw t;On(1,0)}},Db:function(t,n,r,e,c,i,a,o){var u=Sn();try{X(t)(n,r,e,c,i,a,o)}catch(t){if(Mn(u),t!==t+0)throw t;On(1,0)}},Cb:function(t,n,r,e,c,i,a,o,u,f,s,l){var h=Sn();try{X(t)(n,r,e,c,i,a,o,u,f,s,l)}catch(t){if(Mn(h),t!==t+0)throw t;On(1,0)}},Bb:function(t,n,r,e,c,i,a){var o=Sn();try{X(t)(n,r,e,c,i,a)}catch(t){if(Mn(o),t!==t+0)throw t;On(1,0)}},xb:function(t,n,r,e){var c=Sn();try{X(t)(n,r,e)}catch(t){if(Mn(c),t!==t+0)throw t;On(1,0)}},wb:function(t,n,r,e,c,i,a,o,u){var f=Sn();try{X(t)(n,r,e,c,i,a,o,u)}catch(t){if(Mn(f),t!==t+0)throw t;On(1,0)}},Ga:function(t,n,r,e,c,i,a,o){var u=Sn();try{X(t)(n,r,e,c,i,a,o)}catch(t){if(Mn(u),t!==t+0)throw t;On(1,0)}},d:function(t,n,r){var e=Sn();try{X(t)(n,r)}catch(t){if(Mn(e),t!==t+0)throw t;On(1,0)}},ta:function(t,n,r,e){var c=Sn();try{X(t)(n,r,e)}catch(t){if(Mn(c),t!==t+0)throw t;On(1,0)}},O:function(t,n,r,e,c){var i=Sn();try{X(t)(n,r,e,c)}catch(t){if(Mn(i),t!==t+0)throw t;On(1,0)}},L:function(t,n,r,e,c,i){var a=Sn();try{X(t)(n,r,e,c,i)}catch(t){if(Mn(a),t!==t+0)throw t;On(1,0)}},Ea:function(t,n,r,e){var c=Sn();try{X(t)(n,r,e)}catch(t){if(Mn(c),t!==t+0)throw t;On(1,0)}},pb:function(t,n,r,e,c){var i=Sn();try{X(t)(n,r,e,c)}catch(t){if(Mn(i),t!==t+0)throw t;On(1,0)}},Ia:function(t,n,r,e,c,i,a){var o=Sn();try{X(t)(n,r,e,c,i,a)}catch(t){if(Mn(o),t!==t+0)throw t;On(1,0)}},f:function(t,n,r,e){var c=Sn();try{X(t)(n,r,e)}catch(t){if(Mn(c),t!==t+0)throw t;On(1,0)}},P:function(t,n,r,e,c,i,a){var o=Sn();try{X(t)(n,r,e,c,i,a)}catch(t){if(Mn(o),t!==t+0)throw t;On(1,0)}},zb:function(t,n,r,e,c,i,a,o){var u=Sn();try{X(t)(n,r,e,c,i,a,o)}catch(t){if(Mn(u),t!==t+0)throw t;On(1,0)}},fa:function(t,n,r,e,c,i,a){var o=Sn();try{X(t)(n,r,e,c,i,a)}catch(t){if(Mn(o),t!==t+0)throw t;On(1,0)}},j:function(t,n,r,e,c){var i=Sn();try{X(t)(n,r,e,c)}catch(t){if(Mn(i),t!==t+0)throw t;On(1,0)}},ha:function(t,n,r,e,c,i){var a=Sn();try{X(t)(n,r,e,c,i)}catch(t){if(Mn(a),t!==t+0)throw t;On(1,0)}},qb:function(t,n,r,e,c,i,a,o){var u=Sn();try{X(t)(n,r,e,c,i,a,o)}catch(t){if(Mn(u),t!==t+0)throw t;On(1,0)}},sa:function(t,n,r,e,c,i,a){var o=Sn();try{X(t)(n,r,e,c,i,a)}catch(t){if(Mn(o),t!==t+0)throw t;On(1,0)}},s:function(t,n,r,e,c,i){var a=Sn();try{X(t)(n,r,e,c,i)}catch(t){if(Mn(a),t!==t+0)throw t;On(1,0)}},v:function(t,n,r,e,c,i,a){var o=Sn();try{X(t)(n,r,e,c,i,a)}catch(t){if(Mn(o),t!==t+0)throw t;On(1,0)}},C:function(t,n,r,e,c,i,a,o){var u=Sn();try{X(t)(n,r,e,c,i,a,o)}catch(t){if(Mn(u),t!==t+0)throw t;On(1,0)}},U:function(t,n,r,e,c,i,a,o,u){var f=Sn();try{X(t)(n,r,e,c,i,a,o,u)}catch(t){if(Mn(f),t!==t+0)throw t;On(1,0)}},R:function(t,n,r,e,c,i,a,o,u,f){var s=Sn();try{X(t)(n,r,e,c,i,a,o,u,f)}catch(t){if(Mn(s),t!==t+0)throw t;On(1,0)}},T:function(t,n,r,e,c,i,a,o,u,f,s){var l=Sn();try{X(t)(n,r,e,c,i,a,o,u,f,s)}catch(t){if(Mn(l),t!==t+0)throw t;On(1,0)}},nb:function(t,n,r,e,c,i,a,o,u,f,s,l){var h=Sn();try{X(t)(n,r,e,c,i,a,o,u,f,s,l)}catch(t){if(Mn(h),t!==t+0)throw t;On(1,0)}},ga:function(t,n,r,e,c,i,a,o,u,f,s,l,h){var v=Sn();try{X(t)(n,r,e,c,i,a,o,u,f,s,l,h)}catch(t){if(Mn(v),t!==t+0)throw t;On(1,0)}},ob:function(t,n,r,e,c,i,a,o,u,f,s,l,h,v){var p=Sn();try{X(t)(n,r,e,c,i,a,o,u,f,s,l,h,v)}catch(t){if(Mn(p),t!==t+0)throw t;On(1,0)}},ba:function(t,n,r,e,c,i,a,o,u,f,s,l,h,v,p,d){var y=Sn();try{X(t)(n,r,e,c,i,a,o,u,f,s,l,h,v,p,d)}catch(t){if(Mn(y),t!==t+0)throw t;On(1,0)}},ib:function(t,n,r,e,c,i,a){var o=Sn();try{In(t,n,r,e,c,i,a)}catch(t){if(Mn(o),t!==t+0)throw t;On(1,0)}},jb:function(t,n,r,e){var c=Sn();try{Yn(t,n,r,e)}catch(t){if(Mn(c),t!==t+0)throw t;On(1,0)}},r:function(t){return t},Ba:function(t){l=t},Pa:function(t,n,r,e){return function(t,n,r,e){function c(t,n,r){for(t="number"==typeof t?t.toString():t||"";t.length<n;)t=r[0]+t;return t}function i(t,n){return c(t,n,"0")}function a(t,n){function r(t){return 0>t?-1:0<t?1:0}var e;return 0===(e=r(t.getFullYear()-n.getFullYear()))&&0===(e=r(t.getMonth()-n.getMonth()))&&(e=r(t.getDate()-n.getDate())),e}function o(t){switch(t.getDay()){case 0:return new Date(t.getFullYear()-1,11,29);case 1:return t;case 2:return new Date(t.getFullYear(),0,3);case 3:return new Date(t.getFullYear(),0,2);case 4:return new Date(t.getFullYear(),0,1);case 5:return new Date(t.getFullYear()-1,11,31);case 6:return new Date(t.getFullYear()-1,11,30)}}function u(t){t=jn(new Date(t.fc+1900,0,1),t.Ec);var n=new Date(t.getFullYear()+1,0,4),r=o(new Date(t.getFullYear(),0,4));return n=o(n),0>=a(r,t)?0>=a(n,t)?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var f=C[e+40>>2];for(var s in e={pd:C[e>>2],od:C[e+4>>2],Cc:C[e+8>>2],wc:C[e+12>>2],tc:C[e+16>>2],fc:C[e+20>>2],Dc:C[e+24>>2],Ec:C[e+28>>2],vd:C[e+32>>2],nd:C[e+36>>2],qd:f&&f?y(_,f,void 0):""},r=r?y(_,r,void 0):"",f={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})r=r.replace(new RegExp(s,"g"),f[s]);var l="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),h="January February March April May June July August September October November December".split(" ");for(s in f={"%a":function(t){return l[t.Dc].substring(0,3)},"%A":function(t){return l[t.Dc]},"%b":function(t){return h[t.tc].substring(0,3)},"%B":function(t){return h[t.tc]},"%C":function(t){return i((t.fc+1900)/100|0,2)},"%d":function(t){return i(t.wc,2)},"%e":function(t){return c(t.wc,2," ")},"%g":function(t){return u(t).toString().substring(2)},"%G":function(t){return u(t)},"%H":function(t){return i(t.Cc,2)},"%I":function(t){return 0==(t=t.Cc)?t=12:12<t&&(t-=12),i(t,2)},"%j":function(t){return i(t.wc+An(_n(t.fc+1900)?Tn:Cn,t.tc-1),3)},"%m":function(t){return i(t.tc+1,2)},"%M":function(t){return i(t.od,2)},"%n":function(){return"\n"},"%p":function(t){return 0<=t.Cc&&12>t.Cc?"AM":"PM"},"%S":function(t){return i(t.pd,2)},"%t":function(){return"\t"},"%u":function(t){return t.Dc||7},"%U":function(t){var n=new Date(t.fc+1900,0,1),r=0===n.getDay()?n:jn(n,7-n.getDay());return 0>a(r,t=new Date(t.fc+1900,t.tc,t.wc))?i(Math.ceil((31-r.getDate()+(An(_n(t.getFullYear())?Tn:Cn,t.getMonth()-1)-31)+t.getDate())/7),2):0===a(r,n)?"01":"00"},"%V":function(t){var n=new Date(t.fc+1901,0,4),r=o(new Date(t.fc+1900,0,4));n=o(n);var e=jn(new Date(t.fc+1900,0,1),t.Ec);return 0>a(e,r)?"53":0>=a(n,e)?"01":i(Math.ceil((r.getFullYear()<t.fc+1900?t.Ec+32-r.getDate():t.Ec+1-r.getDate())/7),2)},"%w":function(t){return t.Dc},"%W":function(t){var n=new Date(t.fc,0,1),r=1===n.getDay()?n:jn(n,0===n.getDay()?1:7-n.getDay()+1);return 0>a(r,t=new Date(t.fc+1900,t.tc,t.wc))?i(Math.ceil((31-r.getDate()+(An(_n(t.getFullYear())?Tn:Cn,t.getMonth()-1)-31)+t.getDate())/7),2):0===a(r,n)?"01":"00"},"%y":function(t){return(t.fc+1900).toString().substring(2)},"%Y":function(t){return t.fc+1900},"%z":function(t){var n=0<=(t=t.nd);return t=Math.abs(t)/60,(n?"+":"-")+String("0000"+(t/60*100+t%60)).slice(-4)},"%Z":function(t){return t.qd},"%%":function(){return"%"}},r=r.replace(/%%/g,"\0\0"),f)r.includes(s)&&(r=r.replace(new RegExp(s,"g"),f[s](e)));return(s=function(t){var n=Array(m(t)+1);return g(t,n,0,n.length),n}(r=r.replace(/\0\0/g,"%"))).length>n?0:(w.set(s,t),s.length-1)}(t,n,r,e)}};!function(){function t(t){n.asm=t.exports,v=n.asm.Fb,M(),x=n.asm.Mb,I.unshift(n.asm.Gb),B--,n.monitorRunDependencies&&n.monitorRunDependencies(B),0==B&&(null!==q&&(clearInterval(q),q=null),z&&(t=z,z=null,t()))}function r(n){t(n.instance)}function c(t){return(s||"function"!=typeof fetch?Promise.resolve().then((function(){return L()})):fetch(V,{credentials:"same-origin"}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+V+"'";return t.arrayBuffer()})).catch((function(){return L()}))).then((function(t){return WebAssembly.instantiate(t,i)})).then((function(t){return t})).then(t,(function(t){f("failed to asynchronously prepare wasm: "+t),N(t)}))}var i={a:$n};if(B++,n.monitorRunDependencies&&n.monitorRunDependencies(B),n.instantiateWasm)try{return n.instantiateWasm(i,t)}catch(t){return f("Module.instantiateWasm callback failed with error: "+t),!1}(s||"function"!=typeof WebAssembly.instantiateStreaming||K()||"function"!=typeof fetch?c(r):fetch(V,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,i).then(r,(function(t){return f("wasm streaming compile failed: "+t),f("falling back to ArrayBuffer instantiation"),c(r)}))}))).catch(e)}(),n.___wasm_call_ctors=function(){return(n.___wasm_call_ctors=n.asm.Gb).apply(null,arguments)};var Dn=n._free=function(){return(Dn=n._free=n.asm.Hb).apply(null,arguments)},En=n._malloc=function(){return(En=n._malloc=n.asm.Ib).apply(null,arguments)};n._main=function(){return(n._main=n.asm.Jb).apply(null,arguments)};var Fn=n.___getTypeName=function(){return(Fn=n.___getTypeName=n.asm.Kb).apply(null,arguments)};n.___embind_register_native_and_builtin_types=function(){return(n.___embind_register_native_and_builtin_types=n.asm.Lb).apply(null,arguments)};var Wn,On=n._setThrew=function(){return(On=n._setThrew=n.asm.Nb).apply(null,arguments)},Sn=n.stackSave=function(){return(Sn=n.stackSave=n.asm.Ob).apply(null,arguments)},Mn=n.stackRestore=function(){return(Mn=n.stackRestore=n.asm.Pb).apply(null,arguments)},xn=n.___cxa_can_catch=function(){return(xn=n.___cxa_can_catch=n.asm.Qb).apply(null,arguments)},Rn=n.___cxa_is_pointer_type=function(){return(Rn=n.___cxa_is_pointer_type=n.asm.Rb).apply(null,arguments)},In=n.dynCall_viiiji=function(){return(In=n.dynCall_viiiji=n.asm.Sb).apply(null,arguments)},Un=n.dynCall_jii=function(){return(Un=n.dynCall_jii=n.asm.Tb).apply(null,arguments)},Hn=n.dynCall_iij=function(){return(Hn=n.dynCall_iij=n.asm.Ub).apply(null,arguments)},Yn=n.dynCall_vij=function(){return(Yn=n.dynCall_vij=n.asm.Vb).apply(null,arguments)};function Vn(t){this.name="ExitStatus",this.message="Program terminated with exit("+t+")",this.status=t}function Bn(){function t(){if(!Wn&&(Wn=!0,n.calledRun=!0,!p)){if(J(I),J(U),r(n),n.onRuntimeInitialized&&n.onRuntimeInitialized(),qn){var t=n._main;try{var e=t(0,0);h||(n.onExit&&n.onExit(e),p=!0),a(e,new Vn(e))}catch(t){t instanceof Vn||"unwind"==t||a(1,t)}}if(n.postRun)for("function"==typeof n.postRun&&(n.postRun=[n.postRun]);n.postRun.length;)t=n.postRun.shift(),H.unshift(t);J(H)}}if(!(0<B)){if(n.preRun)for("function"==typeof n.preRun&&(n.preRun=[n.preRun]);n.preRun.length;)Y();J(R),0<B||(n.setStatus?(n.setStatus("Running..."),setTimeout((function(){setTimeout((function(){n.setStatus("")}),1),t()}),1)):t())}}if(n.dynCall_viijii=function(){return(n.dynCall_viijii=n.asm.Wb).apply(null,arguments)},n.dynCall_jiji=function(){return(n.dynCall_jiji=n.asm.Xb).apply(null,arguments)},n.dynCall_iiiiij=function(){return(n.dynCall_iiiiij=n.asm.Yb).apply(null,arguments)},n.dynCall_iiiiijj=function(){return(n.dynCall_iiiiijj=n.asm.Zb).apply(null,arguments)},n.dynCall_iiiiiijj=function(){return(n.dynCall_iiiiiijj=n.asm._b).apply(null,arguments)},z=function t(){Wn||Bn(),Wn||(z=t)},n.run=Bn,n.preInit)for("function"==typeof n.preInit&&(n.preInit=[n.preInit]);0<n.preInit.length;)n.preInit.pop()();var qn=!0;return n.noInitialRun&&(qn=!1),Bn(),t.ready});"object"==typeof exports&&"object"==typeof module?module.exports=ConfiguratorKernel:"function"==typeof define&&define.amd?define([],(function(){return ConfiguratorKernel})):"object"==typeof exports&&(exports.ConfiguratorKernel=ConfiguratorKernel);