@roomle/web-sdk 2.45.0 → 2.46.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (240) hide show
  1. package/lib/{banana-for-scale-a730cd5f.nomodule.js → banana-for-scale-1bdb2f22.nomodule.js} +2 -2
  2. package/lib/{banana-for-scale-a730cd5f.nomodule.js.map → banana-for-scale-1bdb2f22.nomodule.js.map} +1 -1
  3. package/lib/{banana-for-scale-ae60367a.js → banana-for-scale-27a7decd.js} +2 -2
  4. package/lib/{banana-for-scale-ae60367a.js.map → banana-for-scale-27a7decd.js.map} +1 -1
  5. package/lib/{budgeteer-measure-23a42ba1.js → budgeteer-measure-f1fc4b10.js} +2 -2
  6. package/lib/{budgeteer-measure-23a42ba1.js.map → budgeteer-measure-f1fc4b10.js.map} +1 -1
  7. package/lib/budgeteer-measure.nomodule.js +1 -1
  8. package/lib/{component-dimensioning-b2be1251.js → component-dimensioning-1d5e1282.js} +2 -2
  9. package/lib/component-dimensioning-1d5e1282.js.map +1 -0
  10. package/lib/{component-dimensioning-acc398bb.nomodule.js → component-dimensioning-3b223072.nomodule.js} +2 -2
  11. package/lib/component-dimensioning-3b223072.nomodule.js.map +1 -0
  12. package/lib/{component-raycast-helper-d44c98a7.js → component-raycast-helper-47bfe80e.js} +2 -2
  13. package/lib/component-raycast-helper-47bfe80e.js.map +1 -0
  14. package/lib/{component-raycast-helper-1a19d7d5.nomodule.js → component-raycast-helper-5acb7f5d.nomodule.js} +2 -2
  15. package/lib/component-raycast-helper-5acb7f5d.nomodule.js.map +1 -0
  16. package/lib/{configurator-a263eb41.nomodule.js → configurator-4236d7a9.nomodule.js} +2 -2
  17. package/lib/configurator-4236d7a9.nomodule.js.map +1 -0
  18. package/lib/{configurator-70640302.js → configurator-cd787198.js} +2 -2
  19. package/lib/configurator-cd787198.js.map +1 -0
  20. package/lib/configurator-main-134ef36c.js +2 -0
  21. package/lib/configurator-main-134ef36c.js.map +1 -0
  22. package/lib/configurator-main.nomodule.js +1 -1
  23. package/lib/continuous-drawing-helper-e912f25e.nomodule.js +2 -0
  24. package/lib/continuous-drawing-helper-e912f25e.nomodule.js.map +1 -0
  25. package/lib/continuous-drawing-helper-fd484d47.js +2 -0
  26. package/lib/continuous-drawing-helper-fd484d47.js.map +1 -0
  27. package/lib/{default-light-setting-962e7c2c.nomodule.js → default-light-setting-83252d91.nomodule.js} +2 -2
  28. package/lib/default-light-setting-83252d91.nomodule.js.map +1 -0
  29. package/lib/{default-light-setting-a96e608b.js → default-light-setting-a6196675.js} +2 -2
  30. package/lib/default-light-setting-a6196675.js.map +1 -0
  31. package/lib/definitions/common-core/__tests__/camera-mode-helper.d.ts +1 -0
  32. package/lib/definitions/common-core/src/cameracontrol/camera-control-3d.d.ts +1 -0
  33. package/lib/definitions/common-core/src/cameracontrol/camera-type.d.ts +7 -5
  34. package/lib/definitions/common-core/src/types.d.ts +1 -0
  35. package/lib/definitions/common-core/src/utils/common-utils.d.ts +1 -0
  36. package/lib/definitions/common-core/src/utils/init-data.d.ts +2 -1
  37. package/lib/definitions/common-core/src/utils/shims.d.ts +2 -1
  38. package/lib/definitions/common-core/src/utils/threejs-utils.d.ts +0 -1
  39. package/lib/definitions/common-core/src/webgl/roomle-component-factory.d.ts +4 -4
  40. package/lib/definitions/common-core/src/webgl/scene-manager.d.ts +3 -2
  41. package/lib/definitions/configurator-core/src/webgl/configurator-scene-manager.d.ts +3 -2
  42. package/lib/definitions/glb-viewer-core/src/webgl/glb-viewer-scene-manager.d.ts +2 -1
  43. package/lib/definitions/material-viewer/src/webgl/material-viewer-scene-manager.d.ts +2 -1
  44. package/lib/definitions/planner-core/src/roomle-planner-ui-callback.d.ts +2 -1
  45. package/lib/definitions/planner-core/src/view-model/plan-view-model.d.ts +4 -1
  46. package/lib/definitions/planner-core/src/webgl/continuous-drawing-helper.d.ts +14 -0
  47. package/lib/definitions/planner-core/src/webgl/planner-scene-event-handler.d.ts +8 -4
  48. package/lib/definitions/planner-core/src/webgl/planner-scene-manager.d.ts +5 -3
  49. package/lib/{dimensioning-helper-e2a525bd.nomodule.js → dimensioning-helper-3c718e11.nomodule.js} +2 -2
  50. package/lib/{dimensioning-helper-e2a525bd.nomodule.js.map → dimensioning-helper-3c718e11.nomodule.js.map} +1 -1
  51. package/lib/{dimensioning-helper-f5f024a1.js → dimensioning-helper-c4879a4d.js} +2 -2
  52. package/lib/{dimensioning-helper-f5f024a1.js.map → dimensioning-helper-c4879a4d.js.map} +1 -1
  53. package/lib/{glb-viewer-1d0c09a6.js → glb-viewer-5454f62c.js} +2 -2
  54. package/lib/{glb-viewer-1d0c09a6.js.map → glb-viewer-5454f62c.js.map} +1 -1
  55. package/lib/{glb-viewer-1a97af38.nomodule.js → glb-viewer-b81ff176.nomodule.js} +2 -2
  56. package/lib/{glb-viewer-1a97af38.nomodule.js.map → glb-viewer-b81ff176.nomodule.js.map} +1 -1
  57. package/lib/glb-viewer-main-6d49657b.js +2 -0
  58. package/lib/glb-viewer-main-6d49657b.js.map +1 -0
  59. package/lib/glb-viewer-main.nomodule.js +1 -1
  60. package/lib/legacy/{banana-for-scale-6f4c26db.legacy.js → banana-for-scale-f2dce622.legacy.js} +2 -2
  61. package/lib/legacy/{banana-for-scale-6f4c26db.legacy.js.map → banana-for-scale-f2dce622.legacy.js.map} +1 -1
  62. package/lib/legacy/budgeteer-measure.legacy.js +1 -1
  63. package/lib/legacy/{component-dimensioning-ef53ff7d.legacy.js → component-dimensioning-287f04b0.legacy.js} +2 -2
  64. package/lib/legacy/component-dimensioning-287f04b0.legacy.js.map +1 -0
  65. package/lib/legacy/{component-raycast-helper-64510d1e.legacy.js → component-raycast-helper-1fa0846a.legacy.js} +2 -2
  66. package/lib/legacy/component-raycast-helper-1fa0846a.legacy.js.map +1 -0
  67. package/lib/legacy/{configurator-1a1b2bff.legacy.js → configurator-475b6238.legacy.js} +2 -2
  68. package/lib/legacy/configurator-475b6238.legacy.js.map +1 -0
  69. package/lib/legacy/configurator-main.legacy.js +1 -1
  70. package/lib/legacy/continuous-drawing-helper-8a636c97.legacy.js +2 -0
  71. package/lib/legacy/continuous-drawing-helper-8a636c97.legacy.js.map +1 -0
  72. package/lib/legacy/{default-light-setting-43525146.legacy.js → default-light-setting-c0b9ed96.legacy.js} +2 -2
  73. package/lib/legacy/default-light-setting-c0b9ed96.legacy.js.map +1 -0
  74. package/lib/legacy/{dimensioning-helper-bb399482.legacy.js → dimensioning-helper-65823a99.legacy.js} +2 -2
  75. package/lib/legacy/{dimensioning-helper-bb399482.legacy.js.map → dimensioning-helper-65823a99.legacy.js.map} +1 -1
  76. package/lib/legacy/{glb-viewer-12461664.legacy.js → glb-viewer-f9319d13.legacy.js} +2 -2
  77. package/lib/legacy/{glb-viewer-12461664.legacy.js.map → glb-viewer-f9319d13.legacy.js.map} +1 -1
  78. package/lib/legacy/glb-viewer-main.legacy.js +1 -1
  79. package/lib/legacy/main-thread-to-worker-876e61ea.legacy.js +2 -0
  80. package/lib/legacy/main-thread-to-worker-876e61ea.legacy.js.map +1 -0
  81. package/lib/legacy/{material-viewer-da9cfa94.legacy.js → material-viewer-7f5b8fc3.legacy.js} +2 -2
  82. package/lib/legacy/material-viewer-7f5b8fc3.legacy.js.map +1 -0
  83. package/lib/legacy/material-viewer-main.legacy.js +1 -1
  84. package/lib/legacy/pixotron-2921c354.legacy.js +2 -0
  85. package/lib/legacy/{pixotron-3a76eda5.legacy.js.map → pixotron-2921c354.legacy.js.map} +1 -1
  86. package/lib/legacy/planner-b394e9d1.legacy.js +2 -0
  87. package/lib/legacy/{planner-428bd718.legacy.js.map → planner-b394e9d1.legacy.js.map} +1 -1
  88. package/lib/legacy/planner-main.legacy.js +1 -1
  89. package/lib/legacy/roomle-configurator-af5f4afd.legacy.js +2 -0
  90. package/lib/legacy/{roomle-configurator-86d6dc40.legacy.js.map → roomle-configurator-af5f4afd.legacy.js.map} +1 -1
  91. package/lib/legacy/roomle-dependency-injection-2357c23d.legacy.js +16 -0
  92. package/lib/legacy/{roomle-dependency-injection-e9bccfbf.legacy.js.map → roomle-dependency-injection-2357c23d.legacy.js.map} +1 -1
  93. package/lib/legacy/roomle-sdk.legacy.js +1 -1
  94. package/lib/legacy/{script-loader-98008d97.legacy.js → script-loader-42b928fa.legacy.js} +2 -2
  95. package/lib/legacy/script-loader-42b928fa.legacy.js.map +1 -0
  96. package/lib/legacy/static/ConfiguratorKernel-0440412da04815a4.wasm +0 -0
  97. package/lib/legacy/static/{ConfiguratorKernel-c640d13c98053aa0.js → ConfiguratorKernel-7379fad379e43554.js} +73 -73
  98. package/lib/legacy/static/ConfiguratorKernelJs-19de39a7f603fd54.js +147 -0
  99. package/lib/legacy/static/ConfiguratorKernelJs-88b750f5c9c8432f.mem +0 -0
  100. package/lib/legacy/static/RoomleCore-3e492db19e5c5b67.js +130 -0
  101. package/lib/legacy/static/RoomleCore-fb7efc9b3b8bf667.wasm +0 -0
  102. package/lib/legacy/static/RoomleCoreJs-28c83db45a762721.js +155 -0
  103. package/lib/legacy/static/RoomleCoreJs-c42ddb552d394618.mem +0 -0
  104. package/lib/legacy/static/{RoomleToolsCore-f7b3d1a2963be51d.js → RoomleToolsCore-87616e8b600adf71.js} +25 -24
  105. package/lib/legacy/static/RoomleToolsCore-a72d23603dcfd40d.wasm +0 -0
  106. package/lib/legacy/static/{shaders-32c877bd71067eb5.json → shaders-fbbbfecf19ee7e11.json} +1 -1
  107. package/lib/legacy/{stats-helper-727d198c.legacy.js → stats-helper-e9dbe6bb.legacy.js} +2 -2
  108. package/lib/legacy/{stats-helper-727d198c.legacy.js.map → stats-helper-e9dbe6bb.legacy.js.map} +1 -1
  109. package/lib/legacy/{tools-core-4c30a8dd.legacy.js → tools-core-01739480.legacy.js} +2 -2
  110. package/lib/legacy/tools-core-01739480.legacy.js.map +1 -0
  111. package/lib/main-thread-to-worker-1c4e6a69.nomodule.js +2 -0
  112. package/lib/main-thread-to-worker-1c4e6a69.nomodule.js.map +1 -0
  113. package/lib/main-thread-to-worker-811523e8.js +2 -0
  114. package/lib/main-thread-to-worker-811523e8.js.map +1 -0
  115. package/lib/{material-viewer-8674dd62.nomodule.js → material-viewer-52887332.nomodule.js} +2 -2
  116. package/lib/material-viewer-52887332.nomodule.js.map +1 -0
  117. package/lib/{material-viewer-0830f9f3.js → material-viewer-9c82f4d5.js} +2 -2
  118. package/lib/material-viewer-9c82f4d5.js.map +1 -0
  119. package/lib/material-viewer-main-f5946225.js +2 -0
  120. package/lib/material-viewer-main-f5946225.js.map +1 -0
  121. package/lib/material-viewer-main.nomodule.js +1 -1
  122. package/lib/pixotron-8d3fd03b.js +2 -0
  123. package/lib/{pixotron-b045bf60.js.map → pixotron-8d3fd03b.js.map} +1 -1
  124. package/lib/pixotron-a20e56eb.nomodule.js +2 -0
  125. package/lib/{pixotron-2f1637f1.nomodule.js.map → pixotron-a20e56eb.nomodule.js.map} +1 -1
  126. package/lib/planner-a1a9cbdb.nomodule.js +2 -0
  127. package/lib/{planner-b9e26686.nomodule.js.map → planner-a1a9cbdb.nomodule.js.map} +1 -1
  128. package/lib/planner-af20276d.js +2 -0
  129. package/lib/{planner-0841b674.js.map → planner-af20276d.js.map} +1 -1
  130. package/lib/planner-main-3b9c8007.js +2 -0
  131. package/lib/planner-main-3b9c8007.js.map +1 -0
  132. package/lib/planner-main.nomodule.js +1 -1
  133. package/lib/roomle-configurator-02637fac.nomodule.js +2 -0
  134. package/lib/{roomle-configurator-96b57809.nomodule.js.map → roomle-configurator-02637fac.nomodule.js.map} +1 -1
  135. package/lib/roomle-configurator-bb99db27.js +2 -0
  136. package/lib/{roomle-configurator-66618db6.js.map → roomle-configurator-bb99db27.js.map} +1 -1
  137. package/lib/roomle-dependency-injection-3a8c8238.nomodule.js +16 -0
  138. package/lib/{roomle-dependency-injection-f9179c7c.nomodule.js.map → roomle-dependency-injection-3a8c8238.nomodule.js.map} +1 -1
  139. package/lib/roomle-dependency-injection-5b2225f0.js +16 -0
  140. package/lib/{roomle-dependency-injection-1796e54b.js.map → roomle-dependency-injection-5b2225f0.js.map} +1 -1
  141. package/lib/{roomle-sdk-9e76d315.js → roomle-sdk-e35e3fbd.js} +2 -2
  142. package/lib/roomle-sdk-e35e3fbd.js.map +1 -0
  143. package/lib/roomle-sdk.nomodule.js +1 -1
  144. package/lib/{script-loader-c3603d6e.js → script-loader-0219a8d4.js} +2 -2
  145. package/lib/script-loader-0219a8d4.js.map +1 -0
  146. package/lib/{script-loader-1d1b48c6.nomodule.js → script-loader-f9291036.nomodule.js} +2 -2
  147. package/lib/script-loader-f9291036.nomodule.js.map +1 -0
  148. package/lib/static/ConfiguratorKernel-0440412da04815a4.wasm +0 -0
  149. package/lib/static/ConfiguratorKernel-7379fad379e43554.js +1 -0
  150. package/lib/static/ConfiguratorKernel-7379fad379e43554.js.map +1 -0
  151. package/lib/static/ConfiguratorKernelJs-19de39a7f603fd54.js +147 -0
  152. package/lib/static/ConfiguratorKernelJs-88b750f5c9c8432f.mem +0 -0
  153. package/lib/static/RoomleCore-3e492db19e5c5b67.js +1 -0
  154. package/lib/static/RoomleCore-3e492db19e5c5b67.js.map +1 -0
  155. package/lib/static/RoomleCore-fb7efc9b3b8bf667.wasm +0 -0
  156. package/lib/static/RoomleCoreJs-28c83db45a762721.js +155 -0
  157. package/lib/static/RoomleCoreJs-c42ddb552d394618.mem +0 -0
  158. package/lib/static/{RoomleToolsCore-f7b3d1a2963be51d.js → RoomleToolsCore-87616e8b600adf71.js} +1 -1
  159. package/lib/static/RoomleToolsCore-87616e8b600adf71.js.map +1 -0
  160. package/lib/static/RoomleToolsCore-a72d23603dcfd40d.wasm +0 -0
  161. package/lib/static/{shaders-32c877bd71067eb5.json → shaders-fbbbfecf19ee7e11.json} +1 -1
  162. package/lib/static/worker-to-main-thread-73234f7a.js +1 -0
  163. package/lib/static/worker-to-main-thread-73234f7a.js.map +1 -0
  164. package/lib/{stats-helper-09adb3b3.js → stats-helper-0c0034fd.js} +2 -2
  165. package/lib/{stats-helper-09adb3b3.js.map → stats-helper-0c0034fd.js.map} +1 -1
  166. package/lib/{stats-helper-88ec6449.nomodule.js → stats-helper-39872afa.nomodule.js} +2 -2
  167. package/lib/{stats-helper-88ec6449.nomodule.js.map → stats-helper-39872afa.nomodule.js.map} +1 -1
  168. package/lib/{tools-core-36268878.nomodule.js → tools-core-02001723.nomodule.js} +2 -2
  169. package/lib/tools-core-02001723.nomodule.js.map +1 -0
  170. package/lib/{tools-core-8b7f5964.js → tools-core-63244e3d.js} +2 -2
  171. package/lib/tools-core-63244e3d.js.map +1 -0
  172. package/package.json +3 -3
  173. package/lib/component-dimensioning-acc398bb.nomodule.js.map +0 -1
  174. package/lib/component-dimensioning-b2be1251.js.map +0 -1
  175. package/lib/component-raycast-helper-1a19d7d5.nomodule.js.map +0 -1
  176. package/lib/component-raycast-helper-d44c98a7.js.map +0 -1
  177. package/lib/configurator-70640302.js.map +0 -1
  178. package/lib/configurator-a263eb41.nomodule.js.map +0 -1
  179. package/lib/configurator-main-73c1420c.js +0 -2
  180. package/lib/configurator-main-73c1420c.js.map +0 -1
  181. package/lib/default-light-setting-962e7c2c.nomodule.js.map +0 -1
  182. package/lib/default-light-setting-a96e608b.js.map +0 -1
  183. package/lib/glb-viewer-main-1aa8ce86.js +0 -2
  184. package/lib/glb-viewer-main-1aa8ce86.js.map +0 -1
  185. package/lib/legacy/component-dimensioning-ef53ff7d.legacy.js.map +0 -1
  186. package/lib/legacy/component-raycast-helper-64510d1e.legacy.js.map +0 -1
  187. package/lib/legacy/configurator-1a1b2bff.legacy.js.map +0 -1
  188. package/lib/legacy/default-light-setting-43525146.legacy.js.map +0 -1
  189. package/lib/legacy/main-thread-to-worker-cc24f989.legacy.js +0 -2
  190. package/lib/legacy/main-thread-to-worker-cc24f989.legacy.js.map +0 -1
  191. package/lib/legacy/material-viewer-da9cfa94.legacy.js.map +0 -1
  192. package/lib/legacy/pixotron-3a76eda5.legacy.js +0 -2
  193. package/lib/legacy/planner-428bd718.legacy.js +0 -2
  194. package/lib/legacy/roomle-configurator-86d6dc40.legacy.js +0 -2
  195. package/lib/legacy/roomle-dependency-injection-e9bccfbf.legacy.js +0 -16
  196. package/lib/legacy/script-loader-98008d97.legacy.js.map +0 -1
  197. package/lib/legacy/static/ConfiguratorKernel-ebefec2d59e8ede0.wasm +0 -0
  198. package/lib/legacy/static/ConfiguratorKernelJs-06aa43bd970934fe.js +0 -147
  199. package/lib/legacy/static/ConfiguratorKernelJs-595bd7f441c5e762.mem +0 -0
  200. package/lib/legacy/static/RoomleCore-2518cd28b7f0a1e6.wasm +0 -0
  201. package/lib/legacy/static/RoomleCore-c37925043f0fe2c6.js +0 -130
  202. package/lib/legacy/static/RoomleCoreJs-462b8ba65307083d.mem +0 -0
  203. package/lib/legacy/static/RoomleCoreJs-90ec485a358851fc.js +0 -155
  204. package/lib/legacy/static/RoomleToolsCore-15f6b6e5ba07845f.wasm +0 -0
  205. package/lib/legacy/tools-core-4c30a8dd.legacy.js.map +0 -1
  206. package/lib/main-thread-to-worker-6a4eb1ee.nomodule.js +0 -2
  207. package/lib/main-thread-to-worker-6a4eb1ee.nomodule.js.map +0 -1
  208. package/lib/main-thread-to-worker-88f74244.js +0 -2
  209. package/lib/main-thread-to-worker-88f74244.js.map +0 -1
  210. package/lib/material-viewer-0830f9f3.js.map +0 -1
  211. package/lib/material-viewer-8674dd62.nomodule.js.map +0 -1
  212. package/lib/material-viewer-main-e7466e34.js +0 -2
  213. package/lib/material-viewer-main-e7466e34.js.map +0 -1
  214. package/lib/pixotron-2f1637f1.nomodule.js +0 -2
  215. package/lib/pixotron-b045bf60.js +0 -2
  216. package/lib/planner-0841b674.js +0 -2
  217. package/lib/planner-b9e26686.nomodule.js +0 -2
  218. package/lib/planner-main-c1b14647.js +0 -2
  219. package/lib/planner-main-c1b14647.js.map +0 -1
  220. package/lib/roomle-configurator-66618db6.js +0 -2
  221. package/lib/roomle-configurator-96b57809.nomodule.js +0 -2
  222. package/lib/roomle-dependency-injection-1796e54b.js +0 -16
  223. package/lib/roomle-dependency-injection-f9179c7c.nomodule.js +0 -16
  224. package/lib/roomle-sdk-9e76d315.js.map +0 -1
  225. package/lib/script-loader-1d1b48c6.nomodule.js.map +0 -1
  226. package/lib/script-loader-c3603d6e.js.map +0 -1
  227. package/lib/static/ConfiguratorKernel-c640d13c98053aa0.js +0 -1
  228. package/lib/static/ConfiguratorKernel-c640d13c98053aa0.js.map +0 -1
  229. package/lib/static/ConfiguratorKernel-ebefec2d59e8ede0.wasm +0 -0
  230. package/lib/static/ConfiguratorKernelJs-06aa43bd970934fe.js +0 -147
  231. package/lib/static/ConfiguratorKernelJs-595bd7f441c5e762.mem +0 -0
  232. package/lib/static/RoomleCore-2518cd28b7f0a1e6.wasm +0 -0
  233. package/lib/static/RoomleCore-c37925043f0fe2c6.js +0 -1
  234. package/lib/static/RoomleCore-c37925043f0fe2c6.js.map +0 -1
  235. package/lib/static/RoomleCoreJs-462b8ba65307083d.mem +0 -0
  236. package/lib/static/RoomleCoreJs-90ec485a358851fc.js +0 -155
  237. package/lib/static/RoomleToolsCore-15f6b6e5ba07845f.wasm +0 -0
  238. package/lib/static/RoomleToolsCore-f7b3d1a2963be51d.js.map +0 -1
  239. package/lib/tools-core-36268878.nomodule.js.map +0 -1
  240. package/lib/tools-core-8b7f5964.js.map +0 -1
@@ -1,16 +0,0 @@
1
- System.register(["./main-thread-to-worker-6a4eb1ee.nomodule.js"],(function(e,t){var n,i,s,o,r,a,l,h,c,d,u,_,p,g,m,f,E;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.u,f=e.i,E=e.j}],execute:function(){e({_:M,i:Y,r:Kt});class w{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 C{constructor(e,t,n){this.className=e,this.classDefinition=t,this.type=void 0===n?0:n}}e("D",C);const b={JPG:".jpg",JPEG:".jpeg",PNG:".png",GIF:".gif"};class y{_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 M(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 v{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 P=e("t",(function(e){return e*(Math.PI/180)})),T=e("j",(function(e){return e*(180/Math.PI)})),I=(e("M",(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=P(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}),R=(e("Y",(function(e,t){return Math.abs(e.y-t.y)+Math.abs(e.x-t.x)})),e("g",(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("H",(e,t)=>{let n=I(e.x),i=I(e.y),s=I(e.z),o=I(t.x),r=I(t.y),a=I(t.z);return n===o&&i===r&&s===a}),e("X",(e,t)=>{let n=I(e.w),i=I(e.x),s=I(e.y),o=I(e.z),r=I(t.w),a=I(t.x),l=I(t.y),h=I(t.z);return n===r&&i===a&&s===l&&o===h}),e("J",(e,t)=>{let n=I(e.x),i=I(e.y),s=I(t.x),o=I(t.y);return n===s&&i===o});let k=null;const x=()=>{if(k)return k;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},S=(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},D=e("U",(e,t)=>L(null,e,t)),L=e("ac",(e,t,i)=>{if(e||(e=H()),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||(k||(k=x()),e.map=k),e}),H=()=>new THREE.MeshPhysicalMaterial({});e("ad",e=>{let t=e.color.clone().convertLinearToSRGB(),n={alpha:e.opacity,metallic:e.reflectivity,basecolor:{r:t.r,g:t.g,b:t.b},roughness:e.roughness,doubleSided:e.side===THREE.DoubleSide,alphaCutoff:e.alphaTest,transmission:e.transmission};return 1===e.metalness?n.metallic=1:n.metallic=e.reflectivity,n});let O=null;const A=e("V",(e,t,n,i,s,o,r=16)=>(O||(O=new THREE.TextureLoader,O.crossOrigin=""),new Promise((a,l)=>{if(!e)return console.warn("trying to add a texture without image",t),void a();O.load(e,e=>{U(e,t,n,i,s,o,r),a()},l)}))),U=e("ae",(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===x()&&(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)}),j=(e("h",(e=!0)=>window.dat&&window.dat.GUI?(window.__RML_GUI__||(window.__RML_GUI__=new dat.GUI({autoPlace:e})),window.__RML_GUI__):null),e("a4",(e,t,n=!0)=>{let i=e.getWorldDirection(new THREE.Vector3),s=Math.abs(i.y);s<.5&&!t.transparent&&j(t,!0,n),s>.5&&t.transparent&&j(t,!1,n)}),e("a5",(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})),F=(e("a0",(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("T",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()}})})),B=e("p",e=>{"Mesh"===e.type?G(e):V(e)}),V=e=>{e&&e.children&&0!==e.children.length&&e.children.forEach(e=>{G(e)})},G=e("e",e=>{e&&(e.material&&z(e.material),e.geometry&&K(e.geometry),e.children&&e.children.length>0&&V(e))}),K=e=>{e&&e.dispose()},z=e=>{e&&(e.map&&e.map.dispose(),e.normalMap&&e.normalMap.dispose(),e.dispose())};let W;e("v",e=>0===e.x&&0===e.y&&0===e.z);const N=(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="rbg"+JSON.stringify(e.rgbValue):e.length>0?n=e:t&&1===t.value?n="default_wall_material_"+e.getSourceType().value:t&&7===t.value&&(n="default_ceiling_material_"+e.getSourceType().value),n):null},q=(e("Q",(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("q",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("K",(e,t)=>{if(!e||!t)return 0;const n=e.containsBox(t);return t.containsBox(e)&&n?0:!0===n?1:-1}),e("a6",(e,t,n)=>{const i=t>n,s=i?15:0,o=i?0:10,r=e.getSize(new THREE.Vector3),a=e.getCenter(new THREE.Vector3),l=r.x>2*s?r.x/2:s,h=r.z>2*o?r.z/2:o;return new THREE.Box3(new THREE.Vector3(a.x-l,a.y,a.z-h),new THREE.Vector3(a.x+l,a.y,a.z+h))}),e("a3",e=>{const{x:t,y:n}=e;return{x:t,y:n}})),J=e=>{const{x:t,y:n,z:i}=e;return{x:t,y:n,z:i}},X=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 Y(e,t){const n=Symbol("property-cache");Object.defineProperty(e,t,{get(){if(!this[n]){const e=window.__RML__DI__.lookup(X(t),this._creator_);e?this[n]=e:console.error("Dependency "+X(t)+" not found! Add dependency to /utils/injectables.ts")}return this[n]}})}class Q{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 v,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=S(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)&&Q.setEnvironmentMap(e.material,this._environmentMap)}),this._onEnvMapUpdate.forEach(e=>e()),this._onEnvMapUpdate=[])}onEnvMapUpdate(e){this._onEnvMapUpdate.push(e)}setEnvMap(e){this._initData.disableEnvMap||Q.setEnvironmentMap(e,this.getEnvironmentMap())}}e("ag",Q),M([Y],Q.prototype,"_initData",void 0);const $=e("o",{SOFA:"sofa",SHELF:"shelf",SHELF_FRONT:"shelf_front",BAKED:"baked",CAMERA:"camera",EQUAL:"equal"});class Z{static createDynamicLightSettingSource(e,t){let n={};if(e)n.url=e;else if(t)switch(t){case $.SHELF:n.url=i()+"static/shelf-2975dd3f2fa9c763.json";break;case $.SHELF_FRONT:n.url=i()+"static/shelf_front-8c9566a4512f0de8.json";break;case $.SOFA:n.url=i()+"static/sofa-997b116bc5f2e92e.json";break;case $.BAKED:n.url=i()+"static/baked-6485a2b1daeb69e8.json";break;case $.CAMERA:n.url=i()+"static/camera-05824b47cdb951e4.json";break;case $.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("n",Z);const ee=["127.0.0.1","localhost","0.0.0.0"],te=(e("w",(function(e){return!(!e||"string"!=typeof e||e.split(":").length>2)})),e("u",e=>{if(!e||"string"!=typeof e)return null;const t=e.split(":");return t.length<2?null:t[0]})),ne=({articleNr:e,componentId:t})=>e&&""!==e?t.split(":")[0]+":"+e:null,ie=(e,t)=>null!=e?"string"==typeof e?"true"===e:!0===e:("string"==typeof t&&(t=parseInt(t,10)),t>=200&&t<300);class se{constructor(){this._queue=[],this._pendingRequests=0}_nextSlot(){if(this._pendingRequests-=1,!this._queue.length)return;const{request:e,resolve:t,reject:n}=this._queue.shift();this._fetch(e).then(t,n)}_fetch(e,t={}){return this._pendingRequests+=1,new Promise((n,i)=>{self.fetch(e,t).then(function(e){if(this._nextSlot(),ie(e.ok,e.status))n(...arguments);else{const t=(null==e?void 0:e.url)||"URL unknown";i(new Error(e.statusText||'Http error "'+(e&&e.status?e.status:"unknown")+'", for "'+t+'"'))}}.bind(this),e=>{this._nextSlot(),i(e)})})}fetch(e,t={}){return this._pendingRequests>=40?new Promise((t,n)=>this._queue.push({request:e,resolve:t,reject:n})):this._fetch(e,t)}}class oe{info(...e){console}log(...e){console}warn(...e){console.warn.apply(console,e)}error(...e){console.warn.apply(console,e)}}e("L",oe);class re extends oe{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)}}M([Y],re.prototype,"_globalCallback",void 0);const ae=new Map,le=new Map,he=new Map,ce=new Map;class de{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(()=>{ce.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&&!he.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(()=>{he.set(e,!0),n()},e=>this._softReject(n,'_syncFloorTag error: "'+e+'"'))})):Promise.resolve()}_syncTypeChangeTag(e){const t=[];return e&&!ce.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(()=>{he.set(e,!0),n()},e=>this._softReject(n,'_syncTypeChangeTag error: "'+e+'"'))})):Promise.resolve()}getIsCatalogSynced(e){return!!le.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-caa87aba0f76ce49.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(()=>{le.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(ae.get(e))return t();this._assetUrlToBase64(e).then(n=>{ae.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:ae.get(e)||(t?e:null)}setAlwaysUseCache(e){this._alwaysUseCache=e}preFillAssetCache(e,t){ae.set(e,t)}}e("a",de),M([Y],de.prototype,"_rapiAccess",void 0),M([Y],de.prototype,"_singlePromiseFactory",void 0),M([Y],de.prototype,"_errorHandler",void 0),M([Y],de.prototype,"_configuratorUiCallbacks",void 0),M([Y],de.prototype,"_initData",void 0);class ue{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("O",ue);var _e=e("a8","static/GLTFLoader-5b296b5fb14cfe1a.js"),pe=e("a9","static/DRACOLoader-5edeeab4a8dbc0bd.js");const ge={"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 ue,this._creator_=e,THREE.GLTFLoader&&THREE.DRACOLoader)this._initLoaders();else{let e=this._scriptLoader.fetch(_e,{id:"gltf-loader"}),t=this._scriptLoader.fetch(pe,{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=ge[e];if(!s)throw new Error('Can not load draco dependency "'+e+'" did three.js update DracoLoader lib? Available files'+JSON.stringify(ge));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;if(n&&t.scene.position.copy(n),i&&(t.scene.rotation.y=i),s){const e=new THREE.Box3;e.setFromObject(t.scene);const{x:n,y:i,z:o}=e.getSize(new THREE.Vector3);let r=new THREE.Vector3(s.x/n,s.y/i,s.z/o);t.scene.scale.copy(r)}return o&&t.scene.scale.multiply(o),t.scene.type=e,t.scene.traverse(e=>{if(e instanceof THREE.Mesh){if(e.layers.set(3),e.material instanceof THREE.MeshStandardMaterial){const t=e.material;if(this._environmentLoader.setEnvMap(t),a&&r&&r>0){let e=new THREE.Color(r);t.color=e.copyGammaToLinear(e),t.roughness=.5,t.metalness=.1}t.needsUpdate=!0}e.castShadow=!0,e.receiveShadow=!0}}),t.scene}}M([Y],me.prototype,"_environmentLoader",void 0),M([Y],me.prototype,"_scriptLoader",void 0);class fe{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-32c877bd71067eb5.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))}}M([Y],fe.prototype,"_scriptLoader",void 0),M([Y],fe.prototype,"_networkLayer",void 0);class Ee{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}}M([Y],Ee.prototype,"_localStorage",void 0);class we{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("$",we);class Ce{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.dls=null,this.ls=null,this.cameraSpacing=0,this.transparentHighlighting=!0,this.mode="3D",this.edit=!1,this.moc=!1,this._creator_=e}setOverrides(e){a(this,e)}}e("ak",Ce);const be=["language","browserLanguage","userLanguage","systemLanguage"];e("a1",/^((?!chrome|android).)*safari/i.test(navigator.userAgent));class ye{constructor(e){this.locale=((e=null)=>{const t=window.navigator;if(e)return e.substr(0,2);if(Array.isArray(t.languages)&&t.languages.length>0)return t.languages[0].substr(0,2);for(let e=0,n=be.length;e<n;e++){const n=t[be[e]];if(n)return n.substr(0,2)}return"en"})()||"en",this.overrideCountry=null,this._creator_=e}setOverrides(e){a(this,e)}}e("aj",ye);class Me{_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(Me.prototype,"_setMute",{enumerable:!1,writable:!1}),h(Me.prototype,"mute",{enumerable:!1,writable:!1}),h(Me.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("af",Me);class ve extends Me{constructor(){super(...arguments),this.onNetworkRequest=(e,t,n)=>{},this.onKernelMsg=(e,t,n={})=>{},this.onCheckExternalCache=async(e,t)=>Promise.resolve(null)}}e("ai",ve),e("l",{HSC:"rml-configurator",HSP:"rml-hsp",GLB:"rml-glb",RMV:"rml-mv"});class Pe{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(){}}M([Y],Pe.prototype,"_lifeCycleManager",void 0),e("am",class{constructor(e){this._creator_=e}setScene(e){}setUiScene(e){}updateBounds(e){}clearScene(e,t){}moveCameraEnd(e){}moveCameraStart(e){}needsUiScene(){return!1}});class Te{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-a730cd5f.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)}}M([Y],Te.prototype,"_initData",void 0);class Ie{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 Re{constructor(e){this.materialQueue=new Ie,this._geometryComponentMaterialCache=new Map,this._maxAnisotropy=1,this._maxTextures=16,this._textureLoader=new THREE.TextureLoader,this._configuratorPreviewMaterial=new THREE.MeshStandardMaterial({color:"#DDDDDD",transparent:!0,opacity:1,roughness:1,envMap:null}),this._creator_=e,this._previewMaterial=new THREE.MeshStandardMaterial({color:"#DDDDDD",roughness:1,metalness:0}),this._environmentLoader.setEnvMap(this._previewMaterial)}getGeometry(e){return e&&this._cacheHolder.geometryCache.has(e)?this._cacheHolder.geometryCache.get(e):null}_generateGeometry(e,t,n,i,s){let o;return e&&this._cacheHolder.geometryCache.has(e)?o=this._cacheHolder.geometryCache.get(e):(o=new THREE.BufferGeometry,o.setIndex(new THREE.Uint32BufferAttribute(n,1)),o.setAttribute("position",new THREE.Float32BufferAttribute(t,3)),o.setAttribute("normal",new THREE.Float32BufferAttribute(s,3)),o.setAttribute("uv",new THREE.Float32BufferAttribute(i,2)),o.scale(.001,.001,.001),o.rotateX(-Math.PI/2),e&&this._cacheHolder.geometryCache.set(e,o)),o}changeMaterialOfMesh(e,t){e&&t?(e.material=t,e.material.transparent||0===e.material.opacity||e.material.transmission>0?(e.castShadow=!1,e.receiveShadow=!1):(e.castShadow=!0,e.receiveShadow=!0),e.material.needsUpdate=!0,this._materialLoaded&&this._materialLoaded(t)):console.warn("could not assign material to mesh",{mesh:e},{material:t})}_createMaterial(e,t,n,i,s){if(this._cacheHolder.materialCache.has(e))t();else if(e.startsWith("benchmarkMaterial")){let o=c(e),r=D(o,this._environmentLoader);this._loadBenchmarkTextures(o,r,i,s).then(t,n)}else this._rapiAccess.getMaterial(e).then(e=>{let o=D(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);A(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(A(this._dataSyncer.requestAsset(e.image,!0),e,t,this._maxAnisotropy,n/(0===e.mmWidth?1:e.mmWidth),i/(0===e.mmHeight?1:e.mmHeight),this._maxTextures))}),Promise.all(a).then(()=>{this._cacheHolder.materialCache.set(e.id,t),s()},o)})})}_loadMaterial(e,t,n){return new Promise((i,s)=>{this._singlePromiseFactory.create(6,e,(i,s)=>this._createMaterial(e,i,s,t,n)).then(()=>{setTimeout(()=>i(this._cacheHolder.materialCache.get(e)),0)},s)})}_assignMaterial(e,t){return this._cacheHolder.materialCache.has(t)?(this.changeMaterialOfMesh(e,this._cacheHolder.materialCache.get(t)),Promise.resolve()):new Promise((n,i)=>{this._loadMaterial(t).then(i=>{e.userData.materialId===t&&this.changeMaterialOfMesh(e,i),n()},i)})}get maxAnisotropy(){return this._maxAnisotropy}set maxAnisotropy(e){this._maxAnisotropy=e}get maxTextures(){return this._maxTextures}set maxTextures(e){this._maxTextures=e}clear(){this._cacheHolder.clear()}_assignRGB(e,t){return new Promise(n=>{let i,s="rbg"+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}}M([Y],Re.prototype,"_rapiAccess",void 0),M([Y],Re.prototype,"_environmentLoader",void 0),M([Y],Re.prototype,"_dataSyncer",void 0),M([Y],Re.prototype,"_singlePromiseFactory",void 0),M([Y],Re.prototype,"_cacheHolder",void 0),M([Y],Re.prototype,"_plannerMeshGenerator",void 0);class ke extends Re{constructor(e){super(e),this._environmentLoader.setEnvMap(this._configuratorPreviewMaterial)}generateMesh(e=0,t=null,n,i,s,o,r,a=!1){let l;l=a?this._generateGeometry(t,i,s,o,r).clone():this._generateGeometry(t,i,s,o,r);const h=this._createMesh(e,t,l);return h.userData.materialId=n,n&&this.materialQueue.push(this._assignMaterial(h,n).then(()=>{e&&t&&this._geometryComponentMaterialCache.set(this._getComponentMeshId(e,t),n)})),h}setMaterial(e,t,n){return this._assignMaterial(e,t)}loadMaterial(e,t,n){return super._loadMaterial(e,t,n)}loadTextures(e,t,n,i){return super._loadTextures(e,t,n,i)}}e("ah",ke);class xe{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",xe);const Se={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 De{constructor(e,t,n,i,s){this.position=e,this.positionRelative=t,this.type=n,this.rotation=i,this.event=s}}const Le=e("Z",5*window.devicePixelRatio),He=3*window.devicePixelRatio;class Oe extends xe{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(Se).map(e=>Se[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+He?(this._setState(3),this.dispatchEvent(7,new De(this._getTouchPosition(e),this._getTouchPositionRelative(e)))):o<this._pinchDistance-He?(this._setState(3),this.dispatchEvent(8,new De(this._getTouchPosition(e),this._getTouchPositionRelative(e)))):o<=this._pinchDistance+He&&o>=this._pinchDistance-He&&(this._setState(5),this.dispatchEvent(11,new De(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>Le&&(this._setState(2),this._longClickTimer&&clearTimeout(this._longClickTimer),this.dispatchEvent(0,new De(this._downPosition,this._downPositionRelative)))),2===this._state&&this.dispatchEvent(1,new De(e,t)),this.dispatchEvent(6,new De(e,t,n,null,i))}_longClick(e){2!==e&&(this._setState(2),this._longClickTimer&&clearTimeout(this._longClickTimer),this.dispatchEvent(0,new De(this._downPosition,this._downPositionRelative)),this.dispatchEvent(1,new De(this._downPosition,this._downPositionRelative))),this.dispatchEvent(14,new De(this._downPosition,this._downPositionRelative,2))}_onUp(e,t,n){this.dispatchEvent(4,new De(e,t,n)),this._getDelta(e)<=Le&&this.dispatchEvent(5,new De(e,t)),2===this._state&&this.dispatchEvent(2,new De(e,t)),4===this._state&&(this.dispatchEvent(10,new De(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 Se.SCROLL:this._boundingClientRectInvalid=!0;break;case Se.MOUSE_MOVE:this._onMouseMove(e);break;case Se.DOUBLE_CLICK:this._onDoubleClick(e);break;case Se.MOUSE_DOWN:this._onMouseDown(e);break;case Se.MOUSE_UP:this._onMouseUp(e);break;case Se.MOUSE_LEAVE:this._onMouseLeave(e);break;case Se.MOUSE_ENTER:this._onMouseEnter(e);break;case Se.MOUSE_WHEEL:this._onMouseWheel(e);break;case Se.TOUCH_MOVE:this._onTouchMove(e);break;case Se.TOUCH_START:this._onTouchStart(e);break;case Se.TOUCH_END:this._onTouchEnd(e);break;case Se.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 De({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 De(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 De(this._getMousePosition(e),this._getMousePositionRelative(e),1,0,e)):this.dispatchEvent(8,new De(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=T(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 De(this._getTouchPosition(e),this._getTouchPositionRelative(e),2,P(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 De({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 De(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("aa",Oe),M([Y],Oe.prototype,"_domHelper",void 0);class Ae{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 Ue=new Map,je=new Map;class Fe{static loadFont(e){if(je.has(e))return new Promise(t=>{t(je.get(e))});if(Ue.has(e))return new Promise((t,n)=>{Ue.get(e).push({resolve:t,reject:n})});let t=new THREE.FontLoader;return new Promise((n,s)=>{Ue.set(e,[{resolve:n,reject:s}]),t.load(i()+e,t=>{je.set(e,t),Fe._resolveAll(e,t)})})}static _resolveAll(e,t){Ue.has(e)&&Ue.get(e).forEach(e=>e.resolve(t)),Ue.delete(e)}}e("al",Fe);class Be{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=R(n.boxForMeasurement),o={x:this._camera.position.x,y:this._camera.position.z};return t.import("./component-dimensioning-acc398bb.nomodule.js").then(t=>{Fe.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-acc398bb.nomodule.js").then(t=>{let s=[];e.children.forEach(e=>{e instanceof t.default&&s.push(e)}),s.forEach(t=>{e.remove(t),B(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()}}M([Y],Be.prototype,"_plannerKernelAccess",void 0);const Ve=e("a2",e=>new THREE.Vector3(e.x/1e3,e.z/1e3,e.y/-1e3)),Ge=e=>new THREE.Vector3(e.x/1e3,e.z/1e3,e.y/1e3),Ke=e("f",e=>({x:Math.round(1e3*e.x),y:Math.round(-1e3*e.z),z:Math.round(1e3*e.y)})),ze=e=>decodeURIComponent(encodeURIComponent(e)),We=e("G",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=Ne(e);for(let e=0;e<t.length;e++)t[e]=We(t[e]);return"string"==typeof t?ze(t):t}if("object"==typeof e)for(let t in e)e.hasOwnProperty(t)&&(e[t]=We(e[t]));return"string"==typeof e?ze(e):e}),Ne=e=>{let t=[];if(e){let n=e.size();for(let i=0;i<n;i++)t.push(e.get(i))}return t},qe=e=>{let t=new THREE.Matrix4,n=We(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)};class Je{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 Xe 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 Je;const t=Ve(e.getCenter());this._container=new THREE.Object3D,this._container.position.copy(t),this._boundingBox=this._generateBoundingBox(),F(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(){if(this._container.position.copy(Ve(this.getPlanElement().getCenter())),this._boundingBox){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=R(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=N(e,this.getPlanElement().getType());return this._object.children.find(e=>e.userData.material===t)}getContainer(){return this._container}getId(){return this.getPlanElement().getId()}clear(){B(this._container),this._selectionMesh&&B(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=(W||(W=new THREE.MeshBasicMaterial,W.visible=!1),W))}_generateBoundingBox(){const e=this.getSize(),t=new THREE.BoxGeometry(e.x,e.y,e.z);let n=new THREE.Color("#DDDDDD");const i=this.getPlanElement().customColor;i>0&&(n=(e=>{let t=new THREE.Color;return t.setRGB((e>>16)/255,(e>>8&255)/255,(e>>0&255)/255),t})(i));let s=new THREE.MeshStandardMaterial({color:n,opacity:1,transparent:!0}),o=new THREE.Mesh(t,s);return o.name="bounding box",o.position.y=e.y/2,o.castShadow=!1,o.receiveShadow=!1,o.layers.set(6),o}select(){this._isSelected=!0,this._selectionMesh&&this._container.add(this._selectionMesh)}deselect(){this._isSelected=!1,this._selectionMesh&&this._container.remove(this._selectionMesh)}hoverOn(){}hoverOff(){}setPrimaryColor(e){this._primaryColor=e}}class Ye extends Xe{constructor(e){super(e),this._initDone=!1,this._initFailed=null,this._initWaiter=new Je,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 Ge(this.getPlanObject().size)}update(){super.update(),this._container.rotation.y=this.getPlanObject().rotation}}class Qe extends Ye{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",Qe);var $e={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($e));e.APP,e.features}}();const Ze=JSON.parse(JSON.stringify($e));var et=e("m",Ze);class tt extends Ye{constructor(e){super(e),this._container.name="Static "+this._container.name}setRapiItem(e){return this._rapiItem?Promise.resolve():this._addStaticItem(e)}async _addStaticItem(e){this._rapiItem=e;let t=this.getPlanObject();if(this._glbUrl=_(e),!this._glbUrl)return Promise.reject("No glb url found");let n=e.scaleable?Ge(t.size):void 0,i=new THREE.Vector3(1,1,1);t.flipX&&(i.x*=-1),t.flipY&&(i.z*=-1);try{const s=await this._staticItemLoader.loadGLB(this._glbUrl,void 0,void 0,n,i,t.customColor,e.colorable);s.name=e.label,this.setObject(s),((e,t)=>{let n=(new THREE.Box3).setFromObject(e),i=n.getSize(new THREE.Vector3),s=Math.min(i.x,i.y,i.z),o=!0;s>5&&(console.warn("GLB seems to be too big ("+s+")",t),o=!1),n.min.y<-.01&&(console.warn("GLB seems to be under the floor ("+n.min.y+"): ",t),o=!1)})(s,this._glbUrl),F(s),this._container.add(this.getObject()),this.hidePreviewBox(),await this.finishInit()}catch(e){await this.failInit(e)}}getRapiItem(){return this._rapiItem}needsRapiItem(){return!this._glbUrl}getGLBUrl(){return this._glbUrl}}let nt;e("S",tt),M([Y],tt.prototype,"_staticItemLoader",void 0),e("a7",e=>{const{id:t,textRotation:n,length:i,lengthFormatted:s}=e;return{id:t,fromPosition3d:J(e.fromPosition3d),toPosition3d:J(e.toPosition3d),textPosition3d:J(e.textPosition3d),fromPosition2d:q(e.fromPosition2d),toPosition2d:q(e.toPosition2d),textPosition2d:q(e.textPosition2d),textDirection:J(e.textDirection),textRotation:n,length:i,lengthFormatted:s}});const it=()=>(nt||(nt=new THREE.MeshPhysicalMaterial({color:0})),nt);class st extends Xe{constructor(e){super(e),this._topView=!1,this._container.name="Wall Plan Element"}getWallDimension(e=.2){const t=this.getPlanElement(),n=Ve(t.getCenter()),i=t.getPreferredSide();let s,o;0===i?(s=Ve(t.getCornerFromLeft()),o=Ve(t.getCornerToLeft())):(s=Ve(t.getCornerFromRight()),o=Ve(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.enable(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}_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=it())}_disableTopView(){this._container.traverse(e=>{e instanceof THREE.Mesh&&e.userData.originalMaterial&&(e.material=e.userData.originalMaterial,delete e.userData.originalMaterial)})}setTopView(e){this._topView=e,this._topView?this._enableTopView():this._disableTopView()}getKernelObject(){return super.getKernelObject()}_setMaterial(e){e instanceof THREE.Mesh&&e.material&&e!==this._boundingBox&&(e.userData.originalMaterial||(e.userData.originalMaterial=e.material),this._topView&&this._isSelected?e.material=new THREE.MeshBasicMaterial({color:10526880,side:THREE.DoubleSide}):this._topView&&!this._isSelected?e.material=it():(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",st);class ot extends Xe{constructor(e){super(e),this._container.name="Floor Plan Element"}addMesh(e){super.addMesh(e),e.castShadow=!1;const t=(new THREE.Box3).setFromObject(this.getObject()).getSize(new THREE.Vector3);this._boundingBox.geometry=new THREE.BoxGeometry(t.x,.01,t.z)}}e("F",ot);class rt extends Xe{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("d",rt);const at=new Map;class lt{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=lt.getMeta(e);at.set(e,Object.assign(n,t))}static getMeta(e){return at.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",lt);class ht{static init(e={}){const{kernelInstance:t,kernelContainer:n,planObjectId:i}=e;ht.kernelInstance=t,ht.kernelContainer=n,ht.planObjectId=i}static cleanUp(){ht.useHDGeometry=!1,ht.kernelInstance=null,ht.kernelContainer=null,ht.planObjectId=null}}e("A",ht),ht.useHDGeometry=!1,ht.kernelInstance=null,ht.kernelContainer=null,ht.planObjectId=null;const ct=new Map,dt=function(e,t,n){let i=ct.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)),ct.delete(e)}};class ut{static finishOperation(e,t){dt(e,!0,t)}static failOperation(e,t){dt(e,!1,t)}static waitFor(e,t){return new Promise((n,i)=>{let s=ct.get(e);s||(ct.set(e,[]),s=ct.get(e)),s.push({resolve:n,reject:i}),"function"==typeof t&&t.apply(t)})}}e("x",ut);const _t=e("y",(function(e){return e.validRange&&"string"==typeof e.validRange.type})),pt=function(e){return e.validValues&&e.validValues.length>0},gt=e("z",(function(e){return"Material"===e.type}));let mt,ft,Et,wt,Ct;const bt={WASM:{CONFIGURATOR:{URL:"static/ConfiguratorKernel-ebefec2d59e8ede0.wasm",LOADER:"static/ConfiguratorKernel-c640d13c98053aa0.js"},PLANNER:{URL:"static/RoomleCore-2518cd28b7f0a1e6.wasm",LOADER:"static/RoomleCore-c37925043f0fe2c6.js"}},ASM:{CONFIGURATOR:{MEM_URL:"static/ConfiguratorKernelJs-595bd7f441c5e762.mem",LOADER:"static/ConfiguratorKernelJs-06aa43bd970934fe.js"},PLANNER:{MEM_URL:"static/RoomleCoreJs-462b8ba65307083d.mem",LOADER:"static/RoomleCoreJs-90ec485a358851fc.js"}}},yt=!!window.WebAssembly;class Mt{_utilityToLongArray(e){const t=new this._kernelContainer.LongArray;return e.forEach(e=>t.push_back(e)),t}constructor(e){this._requestedMaterialIds=[],this._configuratorKernelCallbackListener=new Set,this._cachedGroupIds=[],this._waitingForGroups=!1,this._subComponentsWaiters=new Map,this._shouldWait=!0,this._creator_=e,window.KernelCallback={isReady:this.isReady.bind(this)},this._lifeCycleManager.addEventListener(this)}init(e){this._kernelType=e,this._setupKernelPaths(e),this._setupEmsModule(e),this._useWASM=yt,this._kernelPath=yt?Et:wt}_initKernel(){const{unit:e,unitStringType:t}=this._initData;this._kernelInstance.setEnvironmentVariable("unit",e||"cm"),this._kernelInstance.setEnvironmentVariable("unitString",t||"short"),this._kernelInstance.useEnvironmentGeometry(1===this._kernelType);const{overrideCountry:n,locale:i}=this._globalInitData;n&&(this._kernelInstance.resetPriceListIds(),this._kernelInstance.addPriceList(n)),this._kernelInstance.setEnvironmentVariable("language",i)}get kernelContainer(){return this._kernelContainer}get kernelInstance(){return this._kernelInstance}_setupKernelPaths(e){const t=0===e?"PLANNER":"CONFIGURATOR";mt=bt.ASM[t].MEM_URL,ft=bt.WASM[t].URL,Et=bt.WASM[t].LOADER,wt=bt.ASM[t].LOADER,Ct=!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()+mt:t},wasmBinaryFile:i()+ft,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")}},Ct&&yt&&(this._kernelContainer.instantiateWasm=function(e,t){return((e,t,n)=>{const s="function"==typeof WebAssembly.instantiateStreaming;lt.addMeta("kernel_is_ready",{cachedInIndexedDB:!1});let o=null;s?(lt.start("kernel_stream_compile"),o=WebAssembly.instantiateStreaming(fetch(i()+e),t),lt.end("kernel_stream_compile")):(lt.start("kernel_legacy_compile"),o=fetch(i()+e).then(e=>e.arrayBuffer()).then(e=>WebAssembly.instantiate(e,t))),lt.addMeta("kernel_is_ready",{instantiateStreaming:s}),o.then(e=>{lt.end(s?"kernel_stream_compile":"kernel_legacy_compile"),n(e.instance)},e=>console.error(e))})(ft,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:We}),et.isProduction||et.isUnitTesting||this.addDebugInfo(),window.KernelCallback&&(window.KernelCallback=null,delete window.KernelCallback),this._unitFormatter.init(this._kernelContainer)}addDebugInfo(){const e=function(t,n=[]){const i=Object.getPrototypeOf(t),s=i?Object.getOwnPropertyNames(i):[],o=t?Object.getOwnPropertyNames(t):[];return i?e(i,[...n,...o,...s]):[...o,...s,...n]},t=e(this),n=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toString","valueOf"];[...new Set(t)].forEach(e=>{if(!e.startsWith("_")&&"function"==typeof this[e]&&-1===n.indexOf(e))try{const t=this[e].bind(this);this[e]=function(...n){return this._kernelIo.log("[ KernelCommunication ]: "+e),t(...n)}}catch(e){}})}getConfigurationData(e){return new Promise(t=>{var n;const i=this.kernelInstance.getPlanObject(e),s=(new Date).toISOString(),o=this.kernelInstance.getComponentId(e),r=te(o),a=(null===(n=i.boxForMeasurement)||void 0===n?void 0:n.size)||i.bounds;t({created:s,lastAccess:s,configuration:this.kernelInstance.getSerializedConfiguration(e),configurationHash:this.kernelInstance.getHashOfConfiguration(e),parts:JSON.stringify(this.kernelInstance.getPartList(e)),rootComponentId:o,width:a.x,height:a.z,depth:a.y,catalog:r,orderable:!1,requestable:!1})})}loadComponent(e,t,n){this._rapiAccess.getComponent(t.componentId).then(i=>{var s;let o=i.configuration;o||(o="error",null===(s=this._configuratorUiCallbacks)||void 0===s||s.onContentProblem({rapiPath:"components",ids:[t.componentId],message:t.componentId+" has no configuration"})),this._kernelIo.setMeta({componentId:t.componentId}),this._kernelInstance.loadComponent(e,o,t,n),this._flushSubComponentsWaiters()},i=>{var s;this._kernelInstance.loadComponent(e,"error",t,n),this.onLoadComponentError(i,t.componentId),null===(s=this._configuratorUiCallbacks)||void 0===s||s.onError(new Error(`Component with id "${t.componentId}" can not be loaded. "${i}"`)),this._flushSubComponentsWaiters()})}loadSubComponent(e,t,n){if(this._shouldWait){let i=this._subComponentsWaiters.get(n);i||this._subComponentsWaiters.set(n,[]),i=this._subComponentsWaiters.get(n),i.push({parentId:e,partId:t}),this._subComponentsWaiters.set(n,i)}else this._rapiAccess.getComponent(n).then(i=>{var s;let o=i.configuration;o||(o="error",null===(s=this._configuratorUiCallbacks)||void 0===s||s.onContentProblem({rapiPath:"components",ids:[n],message:"SubComponent "+n+" has no configuration"})),this._kernelIo.setMeta({componentId:n,parentId:e}),this._kernelInstance.loadedSubComponent(e,t,n,o)})}requestDeleteComponent(e){e&&this._kernelInstance.deleteComponent(e)}dockComponentWithPosition(e,t,n,i,s){var o;this._kernelInstance.dockComponentWithPosition(n,i,e,t,s);const r=this._kernelInstance.getComponentId(n),a=this._kernelInstance.getComponentId(e);null===(o=this._configuratorUiCallbacks)||void 0===o||o.onUserInitiatedDockDone(r,i,a,t,s)}Editor3dAddBakedMesh(e,t,n,i,s,o,r){this._configuratorKernelCallbackListener.forEach(a=>a.Editor3dAddBakedMesh(e,t,n,i,s,o,r))}Editor3dAddNamedMesh(e,t,n,i,s,o,r,a,l,h,c){this._configuratorKernelCallbackListener.forEach(d=>d.Editor3dAddNamedMesh(e,t,n,i,s,o,r,a,l,h,c))}Editor3ChangedNamedMesh(e,t,n,i,s,o){this._configuratorKernelCallbackListener.forEach(r=>r.Editor3ChangedNamedMesh(e,t,n,i,s,o))}Editor3dRemoveNamedMesh(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.Editor3dRemoveNamedMesh(e,t))}Editor3dBeginConstruction(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.Editor3dBeginConstruction(e,t))}Editor3dEndConstruction(e){this._configuratorKernelCallbackListener.forEach(t=>t.Editor3dEndConstruction(e))}Editor3dComponentCreated(e,t,n,i){this._configuratorKernelCallbackListener.forEach(s=>s.Editor3dComponentCreated(e,t,n,i,!1))}Editor3dComponentDocked(e,t,n,i){this._configuratorKernelCallbackListener.forEach(s=>s.Editor3dComponentDocked(e,t,n,i))}Editor3dGeometryReady(e){this._configuratorKernelCallbackListener.forEach(t=>t.Editor3dGeometryReady(e)),this.requestPlanComponentConstruction(e)}Editor3dGeometryNotReady(e){this._configuratorKernelCallbackListener.forEach(t=>t.Editor3dGeometryNotReady(e))}componentDeleted(e){this._configuratorKernelCallbackListener.forEach(t=>t.componentDeleted(e))}componentMetaUpdated(e){let t=this._kernelInstance.getComponent(e);this._configuratorKernelCallbackListener.forEach(e=>e.componentMetaUpdated(t))}sceneCleared(){this._configuratorKernelCallbackListener.forEach(e=>e.sceneCleared())}requestMaterialsInGroup(e){(Array.isArray(e)?e:[e]).forEach(e=>{-1===this._cachedGroupIds.indexOf(e)&&this._cachedGroupIds.push(e)}),this._waitingForGroups||(this._waitingForGroups=!0,ut.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()}}_calcPrice(){const e=new Map;if(this._initData.useRoomlePrice){let e=this._kernelInstance.getFullPartList();if(e&&e.fullList&&e.fullList.length){const t=e.fullList[0].currencySymbol,n=e.fullList.reduce((e,t)=>e+(t.count?t.count:0)*(t.price?t.price:0),0);this._configuratorUiCallbacks.onUpdatePrice(t,n)}}else if(this._initData.usePriceService){let t=this._kernelInstance.getFullPartList();if(t&&t.fullList&&t.fullList.length){const n=t.fullList.reduce((t,n)=>{const i=ne(n);return i&&(e.set(i,n),t.push(i)),t},[]);return new Promise((i,s)=>{this._rapiAccess.getPrices(n).then(n=>{if(!n.length)return s(new Error("prices are empty"));const o=g(n,"priceId");let r=0;return t.fullList.forEach(e=>{const t=ne(e);if(!o.has(t))return void console.warn("PriceId: "+t+" has no corresponding kernel-part");const{price:n,currencySymbol:i}=o.get(t);e.price=n,e.currencySymbol=i,r+=n*e.count}),this._configuratorUiCallbacks.onUpdatePrice(n[0].currencySymbol,r),i({totalSum:r,partMap:e})},e=>{console.error(e),s(e)})})}}return Promise.resolve({totalSum:0,partMap:e})}async addUiDataAndPriceToPartList(e,t){const{fullList:n,originPart:i}=e,s=e.perMainComponent;let o;this.addUiDataToPartList(n,t);try{const e=await this._calcPrice();o=e.partMap}catch(e){console.error(e),o=new Map}const r=this._initData.usePriceService||this._initData.useRoomlePrice,a=e=>{r||(e.price=null,e.currencySymbol=null);const t=ne(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),gt(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))}}M([Y],Mt.prototype,"_rapiAccess",void 0),M([Y],Mt.prototype,"_scriptLoader",void 0),M([Y],Mt.prototype,"_kernelIo",void 0),M([Y],Mt.prototype,"_dataSyncer",void 0),M([Y],Mt.prototype,"_lifeCycleManager",void 0),M([Y],Mt.prototype,"_configuratorUiCallbacks",void 0),M([Y],Mt.prototype,"_globalCallback",void 0),M([Y],Mt.prototype,"_initData",void 0),M([Y],Mt.prototype,"_unitFormatter",void 0),M([Y],Mt.prototype,"_configuratorContext",void 0),M([Y],Mt.prototype,"_globalInitData",void 0);const{APP:vt}=et,{RAPI:Pt}=vt,Tt=Pt.headers,It=Pt.itemHeaders,Rt=Tt.token,kt=m();let xt=new Map,St=new Map,Dt=new Map,Lt=new Map,Ht=new Map,Ot=new Map,At=new Map,Ut=new Map,jt=new Map;const Ft=e=>xt.get(e)||xt.get(kt+e),Bt=e=>e&&e.tags&&e.tags.length,Vt=e=>!Bt(e)&&e.group;class Gt{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(te(e)))return n();if(At.get(e))return n();const s=t?"?itemId=":"?configurationId=";this._get("/preloads/components/"+s+e,"preloads/components").then(t=>{if(At.get(e))return n();t.forEach(e=>{this._prepareData(e,"components")}),At.set(e,!0),n()},i)})}changeUseOfHDGeometry(){const e=Lt.get("components");At.clear(),Ot.clear(),e&&Lt.delete("components")}getHSCPackage(e){return new Promise((t,n)=>{if(Ot.get(e))return t();this._get("/catalogs/"+e+"/package","package").then(n=>{if(Ot.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")}),Ot.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:It})}getComponents(e){return this._getByIds(e,"components")}getItems(e){return this._getByIds(e,"items",{additionalHeaders:It})}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=Ht.get(e);i?t(i):this._get("/meshes?catalog="+e,"catalogMeshes").then(n=>{Ht.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=St.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=St.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),St.set(e.itemId,t)}),e([...t,...n])},i):e(n)})}getMaterial(e){return this._getById(e,"materials",{embed:["textures"]})}peekMaterial(e){return this._peekData(e,"materials")}peekComponent(e){return this._peekData(e,"components")}peekItem(e){return this._peekData(e,"items")}peekConfiguration(e){return this._peekData(e,"configurations")}async getMaterials(e){return(await this._getByIds(e,"materials",{embed:["textures"]})).filter(e=>e.active)}getPlan(e){return this._getById(e,"plans")}static clearCaches(){xt=new Map,Dt=new Map,Lt=new Map,Ot=new Map,At=new Map,Ut=new Map,St=new Map}cleanUp(){Gt.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")}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=Lt.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"})}_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:kt+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||(xt.set(t,[]),a=Ft(t)),-1===a.indexOf(r.toString())&&a.push(r.toString());const l=Bt(n),h=l&&e,c=Vt(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=ht.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=Ut.get(e);Array.isArray(o)&&o.length>0?o.push({resolve:i,reject:s}):(Ut.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=Pt.server;const s=this._globalInitData.overrideRapi;s&&(i="live"===s?Pt.liveServer:Pt.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)}_createHeaders(e={}){const t={...Tt};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||Rt;t.token="03-"+window.btoa((new Date).toISOString()+";"+a+";"+Tt.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,Lt)}_getErrorCache(e){return this._getCacheFrom(e,jt)}_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=Dt.get(t);if(!i){const s=new Map,o=new Map;o.set(n,void 0),s.set(e,o),Dt.set(t,s),i=Dt.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||(xt.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){Dt.has(e)||Dt.set(e,new Map);let s=Dt.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=Ut.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);Ut.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})())&&(ee.includes(t)||t.endsWith("gitlab.io")||t.endsWith("gitlab.com")||t.endsWith("codesandbox.io")||t.endsWith("stackblitz.com")||/^(admin.*.roomle.com)$/.test(t)))return;var t;const{configuratorId:n}=this._globalInitData,i={module:3,action:1,actionId:e,actionLabel:n};await this.sendUserAction(i),this._itemLoaded=!0}signinUser(e,t){return new Promise((n,i)=>{const s={method:"POST",accept:"application/json",contentType:"application/json; charset=UTF-8",data:JSON.stringify({identification:e,passwordMD5:t}),cacheKey:"token",resolve:n,reject:i};this._fetchJson("/auth/signin","auth",s)})}async signoutUser(e){const t=this._currentToken;t!==e&&this.setCurrentToken(e),await this._fetch("/auth/signout",{}),t&&t!==e?this.setCurrentToken(t):this.removeCurrentToken()}async savePlan(e){const t=e.id?"/plans/"+e.id:"/plans";return this._save(t,{plan:e},"plans",{method:e.id?"PUT":"POST",accept:"application/json",contentType:"application/json; charset=UTF-8"})}setCurrentToken(e){this._currentToken=e}removeCurrentToken(){this._currentToken=null}createNewPlan(){return{name:"",description:"",changeDate:(new Date).toISOString(),created:(new Date).toISOString(),draftId:null,thumbnail:"data:image/png;base64,missing",planObjects:null,active:!0,open:0,planDirectory:0,changed:0,version:2,floorLevel:0,visibility:9,user:null,tenant:null,assets:[],parent:null,setting:null}}}function Kt(){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(qe(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),G(e),t<0||this.meshes.splice(t,1)}removeAllMeshes(e=!0){this.meshes.forEach(t=>{this.remove(t),e&&G(t)}),this.meshes=[],this._removeLoadingMesh(),this.remove(this._boundingBoxMesh),G(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),G(this._loadingMesh),this._loadingMesh=null)}loadingFinished(){this._removeLoadingMesh(),this._showAllMeshes()}deselect(){this._selected=!1}hoverOn(){f("pointer")}hoverOff(){f("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=R(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 Ke(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){super(e,t,n,i),this._stringId=null,this.receivedPointAssociation=!1,this.castShadow=!1,this.receiveShadow=!1}get stringId(){return this._stringId?this._stringId:this.runtimeId.toString()}addMesh(e,t){super.addMesh(e,t),e.material instanceof THREE.MeshStandardMaterial&&(e.material.opacity=.6,e.material.roughness=1,e.material.metalness=0,e.material.color=new THREE.Color("#DDDDDD")),e.renderOrder=1,e.castShadow=!1,e.receiveShadow=!1}hoverOn(){this.remove(this._dockline),this.meshes.forEach(({material:e})=>{e.opacity=.9,e.roughness=1,e.metalness=0,e.color=new THREE.Color("#DDDDDD")}),f("pointer")}hoverOff(){this.add(this._dockline),this.meshes.forEach(({material:e})=>{e.opacity=.6,e.roughness=1,e.metalness=0,e.color=new THREE.Color("#DDDDDD")}),f("default")}clonePreview(t){const i=new n(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)}}class i extends n{constructor(e,t,n,i,s){super(e,t,n,i),s&&(this._stringId=this.runtimeId+"_has_additional_dock_point_copy")}set roomleLineFrom(e){this._roomleLineFrom=e,this.lineFrom=Ve(e)}get roomleLineFrom(){return this._roomleLineFrom}set roomleLineTo(e){this._roomleLineTo=e;let t=Ve(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=Ve(e)}get roomlePositionFrom(){return this._roomlePositionFrom}set roomlePositionTo(e){this._roomlePositionTo=e;let t=Ve(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,f("pointer")}hoverOff(){this._dockline.visible=!1,f("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:.5})),this.boundingLineMesh.name="bounding line mesh",this.boundingLineMesh.userData.ignoreComponentRaycast=!0;let f=this.positionTo.clone(),E=this.positionFrom.clone(),w=(new THREE.Vector3).subVectors(f,E).normalize(),C=new THREE.ArrowHelper(w,E);const b=(new THREE.Quaternion).setFromEuler(C.rotation);this.boundingLineMesh.quaternion.multiply(b),this.boundingLineMesh.renderOrder=3;let y=(new THREE.Vector3).addVectors(this.positionTo.clone(),this.positionFrom.clone()).multiplyScalar(.5).add(h);this.boundingLineMesh.position.copy((new THREE.Vector3).subVectors(y,this.position.clone())),this.add(this.boundingLineMesh)}clonePreviewLine(t){let n=new i(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 Ke(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){return new n(e,{x:0,y:0,z:0},{x:0,y:0,z:0},t)},createStatic:function(e,n){return new t(e,n)},createPreviewLine:function(e){let t=new i(e.id,e.roomlePosition,e.roomleRotation,e.parentObjectId,e.receivedPointAssociation);return e.meshes.forEach(e=>{let n=e.clone();n.material=e.material.clone(),n.geometry=e.geometry.clone(),t.addMesh(n)}),t.computeBoundingBox(),t},isPreview:function(e){return e instanceof n},isPreviewLine:function(e){return e instanceof 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)}}}e("R",Gt),M([Y],Gt.prototype,"_formDataUtil",void 0),M([Y],Gt.prototype,"_errorHandler",void 0),M([Y],Gt.prototype,"_dataSyncer",void 0),M([Y],Gt.prototype,"_networkLayer",void 0),M([Y],Gt.prototype,"_localStorage",void 0),M([Y],Gt.prototype,"_globalInitData",void 0),M([Y],Gt.prototype,"_globalCallback",void 0);const zt=e("s",9);class Wt{constructor(e){this._mergeThreshold=3,this._componentsToMerge=new Nt,this._mergeInProgress=!1,this._components=new Map,this._previews=new Map,this._componentNumberOfPossibleChildren=new Map,this._creator_=e,this._getKernelAccess().addConfiguratorListener(this),this._componentFactory=Kt()}get materialQueue(){return this.getMeshGenerator().materialQueue}_getKernelAccess(){return on.lookup("planner-kernel-access",this._creator_)}clearReference(){this._getKernelAccess().removeConfiguratorListener(this)}_applyMeshTransform(e,t,n,i,s){if(n){const i=e.userData.transform=qe(n);t&&(e.userData.transform=i),e.applyMatrix4(i)}this._applyMeshUVTransform(e,t,i,s)}_applyMeshUVTransform(e,t,n,i){if(6!==(null==n?void 0:n.length)||(e=>1===e[0]&&0===e[1]&&0===e[2]&&1===e[3]&&0===e[4]&&0===e[5])(n))t&&(t.uvTransform=void 0),i&&(e.geometry=i);else{const s=(e=>{const t=new THREE.Matrix4;return t.set(e[0],e[2],0,e[4],e[1],e[3],0,e[5],0,0,1,0,0,0,0,1),t})(n);t&&(t.uvTransform=s);const o=null!=i?i:e.geometry;if(o&&o.attributes.uv){const t=o.clone();t.attributes.uv.applyMatrix4(s),e.geometry=t}}}_addMeshToSubPart(e,t,n,i,s,o,r,a,l){const h=this._generateMesh(e,t,n,o,r,a,l);this._applyMeshTransform(h,null,i,s),this._subPartObject.add(h)}_addMeshToComponent(e,t,n,i,s,o,r,a,l,h,c){if(this._subPartGuard&&this._subPartGuard.info===e)return void this._addMeshToSubPart(e,null,i,null,null,r,a,l,h);const d=this.getComponent(e);if(!d)return;const u=this._componentFactory.isPreview(d),_=this._generateMesh(e,n,u?null:i,r,a,l,h);_.userData.meshId=t,_.userData.geometryId=n,_.userData.materialId=i,this._applyMeshTransform(_,_.userData,s,o),u&&_.layers.set(5),d&&d.addMesh(_),d.meshes.length>this._mergeThreshold&&this._componentsToMerge.set(e,d.meshes.length)}_changeMeshOfComponent(e,t,n,i,s,o){const r=this.getComponent(e);if(!r)return;const a=r.getMeshById(t);if(a){a.userData.geometryId!==n&&console.warn("Geometry of mesh has changed!"),a.userData.materialId=i,this._configuratorMeshGenerator.setMaterial(a,i),s&&(a.position.set(0,0,0),a.scale.set(1,1,1),a.rotation.set(0,0,0));const e=this._configuratorMeshGenerator.getGeometry(n);this._applyMeshTransform(a,a.userData,s,o,e)}}_removeMeshFromComponent(e,t){const n=this.getComponent(e);n&&n.removeMeshById(t)}getComponent(e){let t=this._components.get(e);return t||(t=this._previews.get(e.toString()),t)?t:(console.warn("component not found!",e),null)}getNumberOfPossibleChildrenForComponent(e){if(this._componentNumberOfPossibleChildren.has(e))return this._componentNumberOfPossibleChildren.get(e);const t=this._getKernelAccess().kernelInstance.getPlanComponentPossibleChildren(e).length;return this._componentNumberOfPossibleChildren.set(e,t),t}tryToMergeComponents(){this._initData.moc||this._mergeInProgress||(this._mergeInProgress=!0,this._componentsToMerge.size,this._requestMergeComponents())}_requestMergeComponents(){window.requestIdleCallback(this._mergeNextComponent.bind(this))}_mergeNextComponent(){if(this._componentsToMerge.size>0){const e=this._componentsToMerge.largestValue();this._componentsToMerge.delete(e),this._mergeComponent(e),this._requestMergeComponents()}else this._mergeInProgress=!1,this._geometriesMerged&&this._geometriesMerged(),this._components.forEach(e=>{e.loadingMesh&&console.warn("component still has loading mesh: ",e.hash)})}_mergeComponent(e){const t=this._components.get(e);if(t&&!(t.meshes.length<=this._mergeThreshold))if(this._cacheHolder.componentCache.has(t.hash)){const e=this._cacheHolder.componentCache.get(t.hash).meshes;t.replaceMeshes(e)}else{const e=new Map,n=[],i=[];t.meshes.forEach(t=>{const s=t.userData.material;if(!s)return void console.warn("mesh has no material id set");if(!e.has(s)){const i=new THREE.Mesh(new THREE.Geometry,t.material);i.userData.material=s,i.receiveShadow=!0,i.castShadow=!0,i.layers.set(3),this._setMaterial(i,s),n.push(i),e.set(s,i)}const o=e.get(s).geometry;t.userData.transform?o.merge(t.geometry,t.userData.transform):o.merge(t.geometry),i.push(t)}),n.forEach(e=>t.addMesh(e)),i.forEach(e=>t.removeMesh(e)),this._cacheHolder.componentCache.set(t.hash,t)}}_addRootComponent(e){this._listener&&this._listener.display(e)}removeDockingComponent(){this._getKernelAccess().requestDeleteComponent(this._configuratorContext.dockingRootComponentId),this._configuratorContext.dockingRootComponentId=null}dockComponent(e,t,n,i){let s=this._components.get(t),o=this._components.get(e);o&&(o.roomlePosition=n,o.roomleRotation=i,s&&s.add(o))}dockComponentWithPosition(e,t){let n,i=this._components.get(e.parentId);n=t?t.getKernelPosition(i):e.getKernelPosition(i);const s=lt.start("dock_component_with_position_"+e.childId);this._getKernelAccess().dockComponentWithPosition(e.parentId,e.parentDockId,e.childId,e.childDockId,n),this._configuratorContext.dockingRootComponentId=null,lt.end(s)}removePreviews(){this._previews.size>0&&(this._previews.forEach(e=>{e.removeFromParent(),e.removeAllMeshes()}),this._previews.clear())}_updatePlanObject(e){const t=this._components.get(e.rootPlanComponentId);let n=!0;t&&(n=t.geometryChanged),this._listener&&this._listener.planObjectUpdated(e,n)}Editor3dAddBakedMesh(e,t,n,i,s,o,r){this._addMeshToComponent(e,null,null,t,null,null,n,i,s,o,r)}Editor3dAddDockPreview(e,t){const n=this._componentFactory.createPreview(t,e);this._previews.set(t.toString(),n)}Editor3dAddNamedMesh(e,t,n,i,s,o,r,a,l,h,c){this._addMeshToComponent(e,t,n,i,s,c,o,r,a,l,h)}Editor3ChangedNamedMesh(e,t,n,i,s,o){this._changeMeshOfComponent(e,t,n,i,s,o)}Editor3dRemoveNamedMesh(e,t){this._removeMeshFromComponent(e,t)}Editor3dBeginConstruction(e,t){if(!t){const t=this._components.get(e);t&&t.removeAllMeshes()}this._subPartGuard&&e===this._subPartGuard.info&&(this._subPartObject=new THREE.Object3D)}Editor3dComponentCreated(e,t,n,i,s){s&&(this._configuratorContext.rootComponentId=e);let o=null;this._components.has(e)?(o=this._components.get(e),o.removeAllMeshes()):(o=this._componentFactory.create(e,t,n,i),o.layers.set(3)),this._components.set(e,o),s&&this._addRootComponent(o)}Editor3dComponentDocked(e,t,n,i){this.dockComponent(e,t,n,i)}Editor3dEndConstruction(e){if(this._subPartGuard&&this._subPartGuard.info===e)return void this._subPartGuard.resolve(this._subPartObject);const t=this._getKernelAccess().kernelInstance.getComponent(e),n=this._components.get(e);n&&(n.computeBoundingBox(t.boxForMeasurement),n.boundingBoxMesh&&this._listener&&this._listener.addComponentHandlers(n));let i=this._previews.get(e.toString());i&&i.computeBoundingBox(t.boxForMeasurement,!0)}Editor3dGeometryReady(e){const t=this._components.get(e);t&&t.loadingFinished()}Editor3dGeometryNotReady(e){const t=this._components.get(e);t&&t.loading()}Editor3dPlanObjectConstructionDone(e){const t=this._getKernelAccess().kernelInstance.getPlanObject(e),n=[t,this._getKernelAccess().kernelInstance.getFullPartList(),this._getKernelAccess().kernelInstance.getHashOfConfiguration(e),this._getKernelAccess().kernelInstance.getComponentId(t.rootPlanComponentId)];ut.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),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}}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 R(e.boxForMeasurement)}else if(this._configuratorContext.rootComponentId){const e=this._components.get(this._configuratorContext.rootComponentId);return(new THREE.Box3).setFromObject(e)}return null}getBoundingBoxWithPreviews(){const e=this._components.get(this._configuratorContext.rootComponentId);return e?(new THREE.Box3).setFromObject(e):null}hasPreviews(){return this._previews.size>0}clearRootComponent(){var e;null===(e=this._components.get(this._configuratorContext.rootComponentId))||void 0===e||e.hoverOff()}debugSceneGraph(e){e?this._components.has(e)?this._components.get(e):this._previews.has(e.toString())&&this._previews.get(e.toString()):this._configuratorContext}getComponentsForIds(e){let t=[];return e.forEach(e=>{const n=this._components.get(e);n&&t.push(n)}),t}getComponents(){return Array.from(this._components.values())}getPreviews(){return Array.from(this._previews.values())}isPreviewLine(e){return this._componentFactory.isPreviewLine(e)}isPreview(e){return this._componentFactory.isPreview(e)}setGeometriesMergedListener(e){this._geometriesMerged=e}removeGeometriesMergedListener(){this._geometriesMerged=void 0}setMergeThreshold(e){this._mergeThreshold=e}_generateMesh(e=0,t=null,n,i,s,o,r,a,l){return this._configuratorMeshGenerator.generateMesh(e,t,n,i,s,o,r)}_setMaterial(e,t,n){this._configuratorMeshGenerator.setMaterial(e,t)}constructComponents(e){this._getKernelAccess().kernelInstance.requestPlanObjectConstruction(e)}requestSubPartConstruction(e){return this._subPartGuard=new ue(e),this._getKernelAccess().requestPlanComponentConstruction(e),this._subPartGuard.wait()}getMeshGenerator(){return this._configuratorMeshGenerator}}e("C",Wt),M([Y],Wt.prototype,"_configuratorMeshGenerator",void 0),M([Y],Wt.prototype,"_configuratorContext",void 0),M([Y],Wt.prototype,"_cacheHolder",void 0),M([Y],Wt.prototype,"_initData",void 0);class Nt 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 qt=["material"];class Jt extends Mt{constructor(e){super(e),this.externalMeshQueue=new Ie,this.muteKernelCallbacks=!1,this.listOfVariants=(e,t)=>{}}init(e){super.init(e),lt.addMeta("kernel_is_ready",{isWasm:this._useWASM}),ht.kernelInstance?(this._kernelContainer=ht.kernelContainer,setTimeout(()=>this._loadSuccess(),0)):this._scriptLoader.fetch(this._kernelPath,{id:"kernel"}).then(this._loadSuccess.bind(this),this._loadError.bind(this))}_loadSuccess(){lt.start("kernel_is_ready"),window.ConfiguratorKernel&&(ht.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);ut.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),ut.finishOperation(3,[s,i])}webGlPreviewDockings(e,t){ut.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(zt,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===qt.indexOf(e)?setTimeout(()=>t(),0):this._configuratorKernelCallbackListener.forEach(e=>e.finishParameterChange(t,n))}requestDeleteComponents(e){e&&this._kernelInstance.deletePlanComponents(this._utilityToLongArray(e))}loadComponentIntoKernel(e,t){this._kernelIo.setMeta({componentId:t}),this._kernelInstance.loadComponentDefinition(10,e)}async requestPartListAndUpdatePricesOfParts(e,t){let n=this._kernelInstance.getFullPartList();e||(e=this._kernelInstance.getHashOfConfiguration(this._configuratorContext.planObjectId));const i=await this.addUiDataAndPriceToPartList(n,e);this._configuratorUiCallbacks.onPartListUpdate(i,btoa(e))}requestSync(e,t){this.planObjectCreated(e,t),this._kernelInstance.syncPlanObjectToView(e,t)}getGlobalParameters(e,t){return new Promise(n=>{let i=this._kernelInstance.getPlanObjectParameters,s=e;t&&(i=this._kernelInstance.getComponentParameters,s=this._kernelInstance.getRootPlanComponentIdFromObjectId(e)),n(i.apply(this._kernelInstance,[s]))})}getPartList(){return new Promise(e=>{e(this._kernelInstance.getFullPartList())})}getConfigurationHash(e){return new Promise(t=>t(this._kernelInstance.getHashOfConfiguration(e.planObjectId)))}requestPlanObjectConstruction(e){this._kernelInstance.requestPlanObjectConstruction(e)}isReady(){super.isReady(),lt.end("kernel_is_ready"),this._setupKernel(),et.isProduction||(window.__RML__DEBUG__.Kernel=this._kernelInstance,window.__RML__DEBUG__.KernelContainer=this._kernelContainer,window.__RML__DEBUG__.Helper={convertCObject:We}),this._configuratorKernelAccessCallback.isReady(),this._configuratorUiCallbacks.onConfiguratorKernelIsReady(this._kernelContainer,this._kernelInstance),ht.planObjectId&&this.planObjectCreated(-1,ht.planObjectId)}_setupKernel(){1===this._kernelType&&(lt.start("kernel_create_instance"),ht.kernelInstance?this._kernelInstance=ht.kernelInstance:this._kernelInstance=new this._kernelContainer.Kernel,lt.end("kernel_create_instance")),this._initKernel()}onLoadComponentError(e,t){this._configuratorUiCallbacks.onComponentLoadError(e,t)}configurationLoaded(e,t,n,i,s){ut.finishOperation(4,{conversationId:e,objectId:t,componentId:n,hash:i,errors:We(s)}),this._configuratorKernelCallbackListener.forEach(o=>o.configurationLoaded(e,t,n,i,s))}componentDefinitionLoaded(e,t){ut.finishOperation(0,t)}componentDefinitionLoadingError(e,t){this._kernelIo.error(t),ut.failOperation(0,new Error(t))}configurationLoadingError(e,t){let n="Configuration loading error";if(t){const e=We(t);Array.isArray(e)&&(n=e.join("\n"),e.forEach(e=>this._kernelIo.error(e)))}ut.failOperation(4,new Error(n)),ut.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)}componentParameters(){}requestComponentDimensions(){}planObjectCreated(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.planObjectCreated(e,t))}planObjectUpdated(e){const t=this._kernelInstance.getPlanObject(e);this._onBoundsUpdate(t),this._configuratorKernelCallbackListener.forEach(e=>e.planObjectUpdated(t))}planObjectConfigurationUpdated(e,t,n){this.updatePlanObjectDependencies(e);let i=this._kernelInstance.getComponent(this._kernelInstance.getRootPlanComponentIdFromObjectId(e));this._configuratorKernelCallbackListener.forEach(i=>i.planObjectConfigurationUpdated(e,t,n));const s=this._kernelInstance.getPlanObject(e);return this._onBoundsUpdate(s),this._configuratorHistory.push(t),this._updateConfigurationHasChildren(e,i),this.requestPartListAndUpdatePricesOfParts(n)}_onBoundsUpdate(e){if(!e.boxForMeasurement)return;const t={width:this._unitFormatter.formatMMValueToUnitString(e.boxForMeasurement.size.x),height:this._unitFormatter.formatMMValueToUnitString(e.boxForMeasurement.size.z),depth:this._unitFormatter.formatMMValueToUnitString(e.boxForMeasurement.size.y),kernelBounds:e.boxForMeasurement};this._configuratorUiCallbacks.onBoundsUpdate(t)}planObjectDeleted(){}requestPlanObjectDimensions(){}async requestExternalMesh(e,t){let n=()=>{};const i=new Promise((e,t)=>{n=e});let s;this.externalMeshQueue.push(i);try{s=await this._rapiAccess.getMesh(e,"crt",t)}catch(t){throw this._configuratorUiCallbacks.onError(new Error(`Mesh with id "${e}" can not be loaded. "${t}"`)),console.error(t),t}try{const i=await fetch(new Request(this._dataSyncer.requestAsset(s.url,!0))),o=await i.arrayBuffer();this._handleCortoMesh(o,e,t),n()}catch(t){throw this._configuratorUiCallbacks.onError(new Error(`Mesh with id "${e}" breaks. "${t}"`)),console.error(t),t}}Editor3dComponentCreated(e,t,n,i){this._configuratorKernelCallbackListener.forEach(s=>s.Editor3dComponentCreated(e,t,n,i,!1)),i&&i>0&&this._configuratorKernelCallbackListener.forEach(s=>s.Editor3dComponentDocked(e,i,t,n))}Editor3dRootComponentCreated(e,t,n,i){this._configuratorKernelCallbackListener.forEach(s=>s.Editor3dComponentCreated(e,t,n,i,!0))}Editor3dPlanObjectConstructionDone(e){return this._configuratorKernelCallbackListener.forEach(t=>t.Editor3dPlanObjectConstructionDone(e)),this.updatePlanObjectDependencies(e),this._updateConfigurationHasChildren(e),lt.end("ui_load_configuration"),this._calcPrice()}Editor3dBeginGroup(){}Editor3dEndGroup(){}Editor3dSetMaterial(){}Editor3dLoadMaterial(){}Editor3dAddDockPreview(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.Editor3dAddDockPreview(e,t))}Editor3dSetPreviewPointAssociations(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.Editor3dSetPreviewPointAssociations(e,t))}Editor3dSetPreviewLineAssociations(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.Editor3dSetPreviewLineAssociations(e,t))}Editor3dPreviewConstructionDone(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.Editor3dPreviewConstructionDone(e,t))}Editor3dTranslateBy(){}Editor3dRotateBy(){}Editor3dRotateAround(){}Editor3dAddCube(){}Editor3dAddCubeUVMod(){}Editor3dAddSphere(){}Editor3dAddSphereUVMod(){}Editor3dAddRectangle(){}Editor3dAddRectangleUVMod(){}Editor3dAddMesh(){}Editor3dAddMeshUVMod(){}Editor3dAddMeshUVCoord(){}Editor3dAddCylinder(){}Editor3dAddCylinderUVMod(){}Editor3dAddPrism(){}Editor3dAddPrismUVMod(){}Editor3dAddFittingPoint(){}Editor3dAddFittingLine(){}Editor3dSelectObject(){}Editor3dCopy(){}Editor3dUpdatePlanObjectPosition(){}Editor3dUpdatePlanObjectRotation(){}Editor3dUpdatePlanObjectTransform(){}Editor3dUpdatePlanComponentPosition(){}Editor3dUpdatePlanComponentRotation(){}Editor3dUpdatePlanComponentTransform(){}getRuntimeComponentIdOfRootComponent(e){return this._kernelInstance?this._kernelInstance.getRootPlanComponentIdFromObjectId(e):(console.warn("this._kernelInstance not ready now"),0)}getRuntimeComponentId(e){return this._kernelInstance.getComponentId(e)}getParameterGroups(){if(!this._configuratorContext.planObjectId)return[];const e=this._kernelInstance.getRootPlanComponentIdFromObjectId(this._configuratorContext.planObjectId);return this._kernelInstance.getComponent(e).parameterGroups}resume(){this.muteKernelCallbacks||super.resume()}getSerializedConfiguration(e){return this._kernelInstance.getSerializedConfiguration(e)}getCurrentConfigurationHash(e){return this._kernelInstance.getHashOfConfiguration(e)}listOfVariantsError(e,t){this._kernelIo.setMeta({rapiId:e}),this._kernelIo.error(t)}}M([Y],Jt.prototype,"_memoryManager",void 0),M([Y],Jt.prototype,"_configuratorKernelAccessCallback",void 0),M([Y],Jt.prototype,"_initData",void 0),M([Y],Jt.prototype,"_configuratorHistory",void 0);class Xt extends Xe{constructor(e){super(e),this._topView=!1;const t=this.getPlanElement().getMaxWallHeight();this._container.position.y=(t<0?2800:t)/1e3+.01,this._container.name="Node Plan Element",this.addMesh(this._nodeUiMesh)}update(){super.update(),this._container.position.y=this.getPlanElement().getMaxWallHeight()/1e3+.01}_initNodeMesh(){if(this._nodeUiMesh)return;const e=new THREE.SphereGeometry(.05,32),t=new THREE.MeshBasicMaterial({color:16777215});this._sphere=new THREE.Mesh(e,t);const n=new THREE.RingGeometry(.05,.07,32),i=new THREE.MeshBasicMaterial({color:0,side:THREE.DoubleSide});this._innerRingMesh=new THREE.Mesh(n,i),this._innerRingMesh.rotation.set(Math.PI/2,0,0);const s=new THREE.RingGeometry(.07,.08,32),o=new THREE.MeshBasicMaterial({color:16777215,side:THREE.DoubleSide});this._outerRingMesh=new THREE.Mesh(s,o),this._outerRingMesh.rotation.set(Math.PI/2,0,0),this._nodeUiMesh=new THREE.Mesh,this._nodeUiMesh.add(this._sphere),this._nodeUiMesh.add(this._innerRingMesh),this._nodeUiMesh.add(this._outerRingMesh)}setTopView(e){this._topView=e,this._topView||(this._nodeUiMesh.visible=!1)}getSize(){return this._initNodeMesh(),(new THREE.Box3).setFromObject(this._nodeUiMesh).getSize(new THREE.Vector3)}show(){this._nodeUiMesh.visible=this._topView}hide(){this._nodeUiMesh.visible=!1}select(){this._innerRingMesh.material=new THREE.MeshBasicMaterial({color:10526880,side:THREE.DoubleSide}),super.select()}deselect(){this._innerRingMesh.material=new THREE.MeshBasicMaterial({color:0,side:THREE.DoubleSide}),super.deselect()}hoverOn(){this._sphere.geometry=new THREE.SphereGeometry(.07,32),this._innerRingMesh.geometry=new THREE.RingGeometry(.07,.07+.02,32),this._outerRingMesh.geometry=new THREE.RingGeometry(.07+.02,.1,32),super.hoverOn()}hoverOff(){this._sphere.geometry=new THREE.SphereGeometry(.05,32),this._innerRingMesh.geometry=new THREE.RingGeometry(.05,.07,32),this._outerRingMesh.geometry=new THREE.RingGeometry(.07,.08,32),super.hoverOff()}_generateBoundingBox(){const e=super._generateBoundingBox();return e.layers.set(9),e}}e("N",Xt);class Yt extends Jt{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),et.isProduction||(window.__RML__DEBUG__.ConfiguratorKernel=this._kernelInstance,window.__RML__DEBUG__.PlannerKernelContainer=this._kernelContainer),this._kernelAccessCallback.isReady()}_setupKernel(){0===this._kernelType&&(this._createPlanInteractionHandler(),ht.kernelInstance?this._kernelInstance=ht.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){const n=new tt(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 Qe(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 st(n):t.getType()===this._kernelContainer.PlanElementType.FLOOR?i=new ot(n):t.getType()===this._kernelContainer.PlanElementType.CEILING?i=new rt(n):t.getType()===this._kernelContainer.PlanElementType.NODE&&(i=new Xt(n)),!i)return;this.coupleReferences(i,n),e.extRef.jsObject.addPlanElementViewModel(i),i.setPrimaryColor(this._initData.colors.PRIMARY),this.planModelViewHelper.requestMesh3d(t),this._plannerKernelCallbackListener.forEach(e=>e.addPlanObjectToScene(null))}}planElementChanged(e,t){if(t.extRef){let n=t.extRef.jsObject;n.update(),this._plannerKernelCallbackListener.forEach(t=>t.planElementChanged(e,n))}}planHistoryStateChanged(){this.planInteractionHandler&&(this._plannerKernelCallbackListener.forEach(e=>e.planHistoryStateChanged()),this._roomlePlannerUiCallback.onHistoryChange(this.planInteractionHandler.isUndoPossible(),this.planInteractionHandler.isRedoPossible()))}planObjectConfigurationCreated(e,t){}planObjectConfigurationLoaded(e,t,n){e&&e.extRef&&t&&t.extRef&&t.extRef.jsObject.getPlanObject().getConfigurationRuntimeId()>0&&this._plannerKernelCallbackListener.forEach(i=>i.planObjectConfigurationLoaded(e,t,n))}requestCatalogItem(e){}startedDrawing(){this._plannerKernelCallbackListener.forEach(e=>e.startedDrawing())}stoppedDrawing(){this._plannerKernelCallbackListener.forEach(e=>e.stoppedDrawing())}updateMesh2d(){}beginConstruction(){}addMesh(e,t,n,i,s,o){this._plannerKernelCallbackListener.forEach(r=>r.addMesh(e,t,n,i,s,o))}endConstruction(){}beginPlanConstruction(e){this._plannerKernelCallbackListener.forEach(t=>t.beginPlanConstruction(e))}addPlanMesh(e,t,n,i,s,o,r){this._plannerKernelCallbackListener.forEach(a=>a.addPlanMesh(e,t,n,i,s,o,r))}endPlanConstruction(e){this._plannerKernelCallbackListener.forEach(t=>t.endPlanConstruction(e))}async addPlanObjectFromItem(e,t,n){if(!t&&!n){const t=await this.insertItems([e]);if(1!==t.length)throw new Error("It was expected that 1 element is added but"+t.length+"were added");return t[0]}n=n||0===n?n:0,t=t||{x:0,y:0,z:0};const i=this._planInteractionHandler.addPlanObjectFromItem(this._rapiItemToKernelItem(e),t,n),s=this._planInteractionHandler.getPlan().extRef.jsObject;let o;return i.hasConfiguration()?(o=s.getConfigurablePlanObjectForId(i.getId()),o||console.warn("Could not find configuration")):(o=s.getStaticPlanObjectForId(i.getId()),o?await o.setRapiItem(e):console.warn("Could not find static item")),await o.isInitDone(),o.getId()}coupleReferences(e,t){let n=new this._kernelContainer.EMSReference;n.jsObject=e,t.extRef=n}_decoupleReferences(e){e&&e.extRef&&(e.extRef.jsObject.clearReference(),e.extRef.jsObject=null,e.extRef.delete(),e.extRef=null)}}e("P",Yt),M([Y],Yt.prototype,"_kernelAccessCallback",void 0),M([Y],Yt.prototype,"_roomlePlannerUiCallback",void 0);class Qt extends Re{constructor(e){super(e),this._wallMeshes=[],this._defaultMaterial=new THREE.MeshPhysicalMaterial({color:"#ffffff",side:THREE.DoubleSide}),this._environmentLoader.setEnvMap(this._defaultMaterial),this._defaultMaterialFloor=new THREE.MeshPhysicalMaterial({color:"#ffffff"}),this._environmentLoader.setEnvMap(this._defaultMaterialFloor),this._environmentLoader.onEnvMapUpdate(()=>{this._environmentLoader.setEnvMap(this._defaultMaterial),this._environmentLoader.setEnvMap(this._defaultMaterialFloor)})}generateGeometry(e=null,t,n,i,s,o=!1){let r;return r=o?this._generateGeometry(e,t,n,i,s).clone():this._generateGeometry(e,t,n,i,s),r}generateMesh(e=0,t=null,n,i,s,o,r,a,l=!1){let h;h=l?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.setMaterial(c,n,a).then(()=>{e&&t&&n&&this._geometryComponentMaterialCache.set(this._getComponentMeshId(e,t),n);const i=a&&3===a.value;c.castShadow=!i}),this._checkWallMaterial(c,a),c}async setMaterial(e,t,n){if(e.userData.material=N(t,n),e.userData.materialId=t,E(t))t?await this._assignMaterial(e,t):(console.warn("Used default material because material is empty"),this.changeMaterialOfMesh(e,this._getDefaultMaterial(n)));else{if(!t)return void this.changeMaterialOfMesh(e,this._configuratorPreviewMaterial);2===(t=t).getSourceType().value?await this._assignMaterial(e,t.materialId):1===t.getSourceType().value?await this._assignItem(e,t.catalogItemId):3===t.getSourceType().value?await this._assignRGB(e,t.rgbValue):0===t.getSourceType().value?this.changeMaterialOfMesh(e,this._getDefaultMaterial(n)):(this.changeMaterialOfMesh(e,this._getDefaultMaterial(n)),1!==n.value&&7!==n.value&&3!==n.value&&console.warn("Used default material because material is not supported",t))}}_getDefaultMaterial(e){return 3===(null==e?void 0:e.value)?this._defaultMaterialFloor:this._defaultMaterial}set maxAnisotropy(e){this._maxAnisotropy=e}_checkWallMaterial(e,t){t&&1===t.value&&(e.renderOrder=5,this._wallMeshes.push(e))}clear(){super.clear(),this.clearWallMeshes()}clearWallMeshes(){this._wallMeshes.forEach(e=>{G(e)}),this._wallMeshes=[]}get wallMeshes(){return this._wallMeshes}}e("ab",Qt);let $t={InchFeet:null,MM:null,CM:null},Zt={NoUnitString:null,LongUnitString:null,ShortUnitString:null};class en{constructor(e){this._formatter=null,this._precision=0,this._creator_=e}init(e){const t=new e.UnitMeasureFormatter;$t=e.Unit,Zt=e.UnitStringType,this._initActualUnit(),this._initActualUnitStringType();const{precisionCm:n,precisionInch:i}=this._initData;this._actualUnit===$t.InchFeet?this._precision=void 0!==i?parseInt(i,10):2:this._actualUnit===$t.CM&&(this._precision=void 0!==n?parseInt(n,10):1),t.init("mm","cm","'","ft",'"',"inch","m²","sqft",!0,this._precision),this._formatter=t}_initActualUnit(){const{unit:e}=this._initData;switch(e){case"cm":this._actualUnit=$t.CM;break;case"mm":this._actualUnit=$t.MM;break;case"inchfeet":this._actualUnit=$t.InchFeet;break;default:this._actualUnit=$t.CM}}_initActualUnitStringType(){const{unitStringType:e}=this._initData;switch(e){case"none":this._actualUnitStringType=Zt.NoUnitString;break;case"long":this._actualUnitStringType=Zt.LongUnitString;break;case"short":this._actualUnitStringType=Zt.ShortUnitString;break;default:this._actualUnitStringType=Zt.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),gt(e))e.uiType="Material";else if(function(e){return"Boolean"===e.type}(e))e.uiType="Boolean";else if(_t(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 pt(e)?(e.uiType="Options",function(e){return!!pt(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===$t.InchFeet}getPrecision(){return this._precision}getAllowedDelta(){const e=1/Math.pow(10,this._precision);return this.isInch()?25.4*e:e}setUnitInitData(e){this._initData.unit=e,this._initActualUnit(),this._initActualUnitStringType()}}M([Y],en.prototype,"_initData",void 0);class tn{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}}M([Y],tn.prototype,"_configuratorUiCallbacks",void 0);class nn{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-15f6b6e5ba07845f.wasm":e,wasmBinaryFile:i()+"static/RoomleToolsCore-15f6b6e5ba07845f.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-f7b3d1a2963be51d.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)}}M([Y],nn.prototype,"_scriptLoader",void 0),M([Y],nn.prototype,"_kernelIo",void 0);const sn=e("I",[new C("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 C("form-data-util",y),new C("environment-loader",Q),new C("static-item-loader",me,0),new C("form-data-util",y),new C("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 C("dynamic-light-setting-loader",Z),new C("dynamic-quality-setting-loader",we),new C("network-layer",se),new C("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 C("network-layer",se),new C("kernel-io",re,0),new C("data-syncer",de),new C("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 C("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 C("three-loader",fe),new C("local-storage-helper",Ee),new C("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())V(e);for(const e of this._materialCache.values())z(e);for(const e of this._geometryCache.values())K(e);this._componentCache.clear(),this._geometryCache.clear(),this._materialCache.clear()}},0),new C("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 C("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 C("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 C("init-data",Ce,1),new C("global-init-data",ye,0),new C("global-callback",ve,0),new C("dom-helper",Pe,1),new C("unit-formatter",en,0),new C("plugin-system",Te,1),new C("configurator-mesh-generator",ke),new C("configurator-input-manager",class extends Oe{},1),new C("selection-handler",class extends xe{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 Ae({component:e}))})}_checkStandard(e){this._selectedComponents.has(e.runtimeId)?this.dispatchEvent(0,new Ae({component:e,consecutive:!0})):(this._selectedComponents.size>0&&this._selectedComponents.forEach((e,t)=>{this._selectedComponents.delete(t),this.dispatchEvent(1,new Ae({component:e,resetCamera:!1}))}),this._selectedComponents.set(e.runtimeId,e),this.dispatchEvent(0,new Ae({component:e,consecutive:!1})))}_checkMulti(e){if(this._selectedComponents.has(e.runtimeId))return this._selectedComponents.delete(e.runtimeId),void this.dispatchEvent(1,new Ae({component:e,resetCamera:0===this._selectedComponents.size}));this._selectedComponents.set(e.runtimeId,e),this.dispatchEvent(0,new Ae({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 C("component-dimensioning-helper",Be,1),new C("component-dimensioning-helper",Be,1),new C("planner-kernel-access",Yt),new C("planner-mesh-generator",Qt,1),new C("unit-formatter",en),new C("configurator-history",tn,1),new C("roomle-planner-ui-callback",class extends Me{constructor(e){super(e),this.onItemsLoaded=()=>{},this.onCameraChanged=e=>{},this.onTotalFloorAreaChanged=e=>{},this.onPlanInteractionHandlerCreated=e=>{},this.onPlannerKernelIsReady=e=>{},this.onConfiguratorKernelIsReady=(e,t)=>{},this.onSelectionChange=(e,t,n,i,s)=>{},this.onSelectionCancel=()=>{},this.onPlanChanged=()=>{},this.onPlanElementChanged=()=>{},this.onCompletelyLoaded=()=>{},this.onRotationCancel=()=>{},this.onHistoryChange=(e,t)=>{},this.onUpdateWallDimensions=e=>{},this.disableWallDimensions=()=>{},this.onUpdatePlanObjectPositions=e=>{},this.onDrawCancel=()=>{}}}),new C("configurator-ui-callbacks",class extends Me{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 C("roomle-tools-core",nn,0)]);class on{static _ensureContainer(){window.__RML__DI__||(window.__RML__DI__=new w,window.__RML__DI__.addDependencyInjectionAssignments(sn))}static setup(e){on.addToContainer(e)}static lookup(e,t){return window.__RML__DI__?window.__RML__DI__.lookup(e,t):null}static getContext(e){return on._ensureContainer(),window.__RML__DI__.getContext(e)}static cleanUp(e){return window.__RML__DI__?window.__RML__DI__.cleanUp(e):null}static addToContainer(e){on._ensureContainer(),window.__RML__DI__.addDependencyInjectionAssignments(e)}}e("b",on)}}}));
16
- //# sourceMappingURL=roomle-dependency-injection-f9179c7c.nomodule.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"roomle-sdk-9e76d315.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"script-loader-1d1b48c6.nomodule.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"script-loader-c3603d6e.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 i=Object.assign({},n),a="./this.program",o=(t,n)=>{throw n},c="";"undefined"!=typeof document&&document.currentScript&&(c=document.currentScript.src),_scriptDir&&(c=_scriptDir),c=0!==c.indexOf("blob:")?c.substr(0,c.replace(/[?#].*/,"").lastIndexOf("/")+1):"";var u=n.print||console.log.bind(console),f=n.printErr||console.warn.bind(console);Object.assign(n,i),i=null,n.thisProgram&&(a=n.thisProgram),n.quit&&(o=n.quit);var s,l=0;n.wasmBinary&&(s=n.wasmBinary);var h=n.noExitRuntime||!0;"object"!=typeof WebAssembly&&z("no native wasm support detected");var v,p=!1,b="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&&b)return b.decode(t.subarray(n,r));for(e="";n<r;){var i=t[n++];if(128&i){var a=63&t[n++];if(192==(224&i))e+=String.fromCharCode((31&i)<<6|a);else{var o=63&t[n++];65536>(i=224==(240&i)?(15&i)<<12|a<<6|o:(7&i)<<18|a<<12|o<<6|63&t[n++])?e+=String.fromCharCode(i):(i-=65536,e+=String.fromCharCode(55296|i>>10,56320|1023&i))}}else e+=String.fromCharCode(i)}return e}function d(t,n,r,e){if(0<e){e=r+e-1;for(var i=0;i<t.length;++i){var a=t.charCodeAt(i);if(55296<=a&&57343>=a&&(a=65536+((1023&a)<<10)|1023&t.charCodeAt(++i)),127>=a){if(r>=e)break;n[r++]=a}else{if(2047>=a){if(r+1>=e)break;n[r++]=192|a>>6}else{if(65535>=a){if(r+2>=e)break;n[r++]=224|a>>12}else{if(r+3>=e)break;n[r++]=240|a>>18,n[r++]=128|a>>12&63}n[r++]=128|a>>6&63}n[r++]=128|63&a}}n[r]=0}}function g(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 m,w,T,_,S,A,C,W,j,k="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0;function P(t,n){for(var r=t>>1,e=r+n/2;!(r>=e)&&S[r];)++r;if(32<(r<<=1)-t&&k)return k.decode(T.subarray(t,r));for(r="",e=0;!(e>=n/2);++e){var i=_[t+2*e>>1];if(0==i)break;r+=String.fromCharCode(i)}return r}function D(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 i=0;i<r;++i)_[n>>1]=t.charCodeAt(i),n+=2;return _[n>>1]=0,n-e}function E(t){return 2*t.length}function F(t,n){for(var r=0,e="";!(r>=n/4);){var i=A[t+4*r>>2];if(0==i)break;++r,65536<=i?(i-=65536,e+=String.fromCharCode(55296|i>>10,56320|1023&i)):e+=String.fromCharCode(i)}return e}function U(t,n,r){if(void 0===r&&(r=2147483647),4>r)return 0;var e=n;r=e+r-4;for(var i=0;i<t.length;++i){var a=t.charCodeAt(i);if(55296<=a&&57343>=a&&(a=65536+((1023&a)<<10)|1023&t.charCodeAt(++i)),A[n>>2]=a,(n+=4)+4>r)break}return A[n>>2]=0,n-e}function O(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 Y(){var t=v.buffer;m=t,n.HEAP8=w=new Int8Array(t),n.HEAP16=_=new Int16Array(t),n.HEAP32=A=new Int32Array(t),n.HEAPU8=T=new Uint8Array(t),n.HEAPU16=S=new Uint16Array(t),n.HEAPU32=C=new Uint32Array(t),n.HEAPF32=W=new Float32Array(t),n.HEAPF64=j=new Float64Array(t)}var x,M=[],R=[],V=[],I=[];function H(){var t=n.preRun.shift();M.unshift(t)}var X,B=0,$=null,Z=null;function z(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 q(){return X.startsWith("data:application/octet-stream;base64,")}if(n.preloadedImages={},n.preloadedAudios={},X="ConfiguratorKernel.wasm",!q()){var N=X;X=n.locateFile?n.locateFile(N,c):c+N}function K(){var t=X;try{if(t==X&&s)return new Uint8Array(s);throw"both async and sync fetching of the wasm failed"}catch(t){z(t)}}function L(t){for(;0<t.length;){var r=t.shift();if("function"==typeof r)r(n);else{var e=r.kd;"number"==typeof e?void 0===r.zc?G(e)():G(e)(r.zc):e(void 0===r.zc?null:r.zc)}}}function G(t){return x.get(t)}function J(t){this.Gc=t,this.Tb=t-16,this.xc=function(t){A[this.Tb+4>>2]=t},this.mc=function(){return A[this.Tb+4>>2]},this.dc=function(t){A[this.Tb+8>>2]=t},this.Rc=function(){return A[this.Tb+8>>2]},this.fc=function(){A[this.Tb>>2]=0},this.Ec=function(t){w[this.Tb+12>>0]=t?1:0},this.Qc=function(){return 0!=w[this.Tb+12>>0]},this.tc=function(t){w[this.Tb+13>>0]=t?1:0},this.Ic=function(){return 0!=w[this.Tb+13>>0]},this.cc=function(t,n){this.xc(t),this.dc(n),this.fc(),this.Ec(!1),this.tc(!1)},this.yc=function(){A[this.Tb>>2]+=1},this.$c=function(){var t=A[this.Tb>>2];return A[this.Tb>>2]=t-1,1===t}}function Q(t){this.Ac=function(){Pn(this.Tb),this.Tb=0},this.dc=function(t){A[this.Tb>>2]=t},this.ic=function(){return A[this.Tb>>2]},this.cc=function(t){A[this.Tb+4>>2]=t},this.fc=function(){return this.Tb+4},this.xc=function(){return A[this.Tb+4>>2]},this.Kc=function(){if(Mn(this.jc().mc()))return A[this.ic()>>2];var t=this.xc();return 0!==t?t:this.ic()},this.jc=function(){return new J(this.ic())},void 0===t?(this.Tb=Dn(8),this.cc(0)):this.Tb=t}var tt=[],nt=0;function rt(t){return Pn(new J(t).Tb)}function et(t){if(t.$c()&&!t.Ic()){var n=t.Rc();n&&G(n)(t.Gc),rt(t.Gc)}}var it=0;function at(){var t=tt.pop();t||z("no exception to throw");var n=t.jc(),r=t.ic();throw n.Ic()?t.Ac():(tt.push(t),n.tc(!0),n.Ec(!1),nt++),it=r,r}var ot={};function ct(t){for(;t.length;){var n=t.pop();t.pop()(n)}}function ut(t){return this.fromWireType(C[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 bt=void 0;function yt(t){throw new bt(t)}function dt(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)St(t[e],n[e])}t.forEach((function(t){lt[t]=n}));var i=Array(n.length),a=[],o=0;n.forEach((function(t,n){st.hasOwnProperty(t)?i[n]=st[t]:(a.push(t),ft.hasOwnProperty(t)||(ft[t]=[]),ft[t].push((function(){i[n]=st[t],++o===a.length&&e(i)})))})),0===a.length&&e(i)}function gt(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 mt=void 0;function wt(t){for(var n="";T[t];)n+=mt[T[t++]];return n}var Tt=void 0;function _t(t){throw new Tt(t)}function St(t,n,r={}){if(!("argPackAdvance"in n))throw new TypeError("registerType registeredInstance requires argPackAdvance");var e=n.name;if(t||_t('type "'+e+'" must have a positive integer typeid pointer'),st.hasOwnProperty(t)){if(r.Vc)return;_t("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 At(t){_t(t.Sb.Vb.Ub.name+" instance already deleted")}var Ct=!1;function Wt(){}function jt(t){--t.count.value,0===t.count.value&&(t.Xb?t.$b.bc(t.Xb):t.Vb.Ub.bc(t.Tb))}var kt={},Pt=[];function Dt(){for(;Pt.length;){var t=Pt.pop();t.Sb.hc=!1,t.delete()}}var Et=void 0,Ft={};function Ut(t,n){return n.Vb&&n.Tb||yt("makeClassHandle requires ptr and ptrType"),!!n.$b!=!!n.Xb&&yt("Both smartPtrType and smartPtr must be specified"),n.count={value:1},Ot(Object.create(t,{Sb:{value:n}}))}function Ot(t){return"undefined"==typeof FinalizationRegistry?(Ot=t=>t,t):(Ct=new FinalizationRegistry(t=>{jt(t.Sb)}),Wt=t=>{Ct.unregister(t)},(Ot=t=>{var n=t.Sb;return n.Xb&&Ct.register(t,{Sb:n},t),t})(t))}function Yt(){}function xt(t,n,r){if(void 0===t[n].Wb){var e=t[n];t[n]=function(){return t[n].Wb.hasOwnProperty(arguments.length)||_t("Function '"+r+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+t[n].Wb+")!"),t[n].Wb[arguments.length].apply(this,arguments)},t[n].Wb=[],t[n].Wb[e.qc]=e}}function Mt(t,r,e){n.hasOwnProperty(t)?((void 0===e||void 0!==n[t].Wb&&void 0!==n[t].Wb[e])&&_t("Cannot register public name '"+t+"' twice"),xt(n,t,t),n.hasOwnProperty(e)&&_t("Cannot register multiple overloads of a function with the same number of arguments ("+e+")!"),n[t].Wb[e]=r):(n[t]=r,void 0!==e&&(n[t].md=e))}function Rt(t,n,r,e,i,a,o,c){this.name=t,this.constructor=n,this.kc=r,this.bc=e,this.ac=i,this.Oc=a,this.pc=o,this.Mc=c,this.Yc=[]}function Vt(t,n,r){for(;n!==r;)n.pc||_t("Expected null or instance of "+r.name+", got an instance of "+n.name),t=n.pc(t),n=n.ac;return t}function It(t,n){return null===n?(this.Bc&&_t("null is not a valid "+this.name),0):(n.Sb||_t('Cannot pass "'+on(n)+'" as a '+this.name),n.Sb.Tb||_t("Cannot pass deleted object as a pointer of type "+this.name),Vt(n.Sb.Tb,n.Sb.Vb.Ub,this.Ub))}function Ht(t,n){if(null===n){if(this.Bc&&_t("null is not a valid "+this.name),this.sc){var r=this.Cc();return null!==t&&t.push(this.bc,r),r}return 0}if(n.Sb||_t('Cannot pass "'+on(n)+'" as a '+this.name),n.Sb.Tb||_t("Cannot pass deleted object as a pointer of type "+this.name),!this.rc&&n.Sb.Vb.rc&&_t("Cannot convert argument of type "+(n.Sb.$b?n.Sb.$b.name:n.Sb.Vb.name)+" to parameter type "+this.name),r=Vt(n.Sb.Tb,n.Sb.Vb.Ub,this.Ub),this.sc)switch(void 0===n.Sb.Xb&&_t("Passing raw pointer to smart pointer is illegal"),this.dd){case 0:n.Sb.$b===this?r=n.Sb.Xb:_t("Cannot convert argument of type "+(n.Sb.$b?n.Sb.$b.name:n.Sb.Vb.name)+" to parameter type "+this.name);break;case 1:r=n.Sb.Xb;break;case 2:if(n.Sb.$b===this)r=n.Sb.Xb;else{var e=n.clone();r=this.Zc(r,rn((function(){e.delete()}))),null!==t&&t.push(this.bc,r)}break;default:_t("Unsupporting sharing policy")}return r}function Xt(t,n){return null===n?(this.Bc&&_t("null is not a valid "+this.name),0):(n.Sb||_t('Cannot pass "'+on(n)+'" as a '+this.name),n.Sb.Tb||_t("Cannot pass deleted object as a pointer of type "+this.name),n.Sb.Vb.rc&&_t("Cannot convert argument of type "+n.Sb.Vb.name+" to parameter type "+this.name),Vt(n.Sb.Tb,n.Sb.Vb.Ub,this.Ub))}function Bt(t,n,r,e,i,a,o,c,u,f,s){this.name=t,this.Ub=n,this.Bc=r,this.rc=e,this.sc=i,this.Xc=a,this.dd=o,this.Jc=c,this.Cc=u,this.Zc=f,this.bc=s,i||void 0!==n.ac?this.toWireType=Ht:(this.toWireType=e?It:Xt,this.Zb=null)}function $t(t,r,e){n.hasOwnProperty(t)||yt("Replacing nonexistant public symbol"),void 0!==n[t].Wb&&void 0!==e?n[t].Wb[e]=r:(n[t]=r,n[t].qc=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 i=n["dynCall_"+t];i=e&&e.length?i.apply(null,[r].concat(e)):i.call(null,r)}else i=G(r).apply(null,e);return i}}(t,r):G(r);return"function"!=typeof e&&_t("unknown function pointer with signature "+t+": "+r),e}var zt=void 0;function qt(t){var n=wt(t=En(t));return Pn(t),n}function Nt(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 zt(t+": "+r.map(qt).join([", "]))}function Kt(t,n){for(var r=[],e=0;e<t;e++)r.push(A[(n>>2)+e]);return r}function Lt(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 Gt(t,n,r,e,i){var a=n.length;2>a&&_t("argTypes array size mismatch! Must at least get return value and 'this' types!");var o=null!==n[1]&&null!==r,c=!1;for(r=1;r<n.length;++r)if(null!==n[r]&&void 0===n[r].Zb){c=!0;break}var u="void"!==n[0].name,f="",s="";for(r=0;r<a-2;++r)f+=(0!==r?", ":"")+"arg"+r,s+=(0!==r?", ":"")+"arg"+r+"Wired";t="return function "+ht(t)+"("+f+") {\nif (arguments.length !== "+(a-2)+") {\nthrowBindingError('function "+t+" called with ' + arguments.length + ' arguments, expected "+(a-2)+" args!');\n}\n",c&&(t+="var destructors = [];\n");var l=c?"destructors":"null";for(f="throwBindingError invoker fn runDestructors retType classParam".split(" "),e=[_t,e,i,ct,n[0],n[1]],o&&(t+="var thisWired = classParam.toWireType("+l+", this);\n"),r=0;r<a-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(o&&(s="thisWired"+(0<s.length?", ":"")+s),t+=(u?"var rv = ":"")+"invoker(fn"+(0<s.length?", ":"")+s+");\n",c)t+="runDestructors(destructors);\n";else for(r=o?1:2;r<n.length;++r)a=1===r?"thisWired":"arg"+(r-2)+"Wired",null!==n[r].Zb&&(t+=a+"_dtor("+a+"); // "+n[r].name+"\n",f.push(a+"_dtor"),e.push(n[r].Zb));return u&&(t+="var ret = retType.fromWireType(rv);\nreturn ret;\n"),f.push(t+"}\n"),Lt(f).apply(null,e)}var Jt=[],Qt=[{},{value:void 0},{value:null},{value:!0},{value:!1}];function tn(t){4<t&&0==--Qt[t].Dc&&(Qt[t]=void 0,Jt.push(t))}function nn(t){return t||_t("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=Jt.length?Jt.pop():Qt.length;return Qt[n]={Dc:1,value:t},n}}function en(t,n,r){switch(n){case 0:return function(t){return this.fromWireType((r?w:T)[t])};case 1:return function(t){return this.fromWireType((r?_:S)[t>>1])};case 2:return function(t){return this.fromWireType((r?A:C)[t>>2])};default:throw new TypeError("Unknown integer type: "+t)}}function an(t,n){var r=st[t];return void 0===r&&_t(n+" has unknown type "+qt(t)),r}function on(t){if(null===t)return"null";var n=typeof t;return"object"===n||"array"===n||"function"===n?t.toString():""+t}function cn(t,n){switch(n){case 2:return function(t){return this.fromWireType(W[t>>2])};case 3:return function(t){return this.fromWireType(j[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[t]};case 1:return r?function(t){return _[t>>1]}:function(t){return S[t>>1]};case 2:return r?function(t){return A[t>>2]}:function(t){return C[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]=an(A[(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=[],bn={},yn={};function dn(){if(!gn){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",_:a||"./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]);gn=r}return gn}var gn,mn=[null,[],[]],wn={};function Tn(t){return 0==t%4&&(0!=t%100||0==t%400)}function _n(t,n){for(var r=0,e=0;e<=n;r+=t[e++]);return r}var Sn=[31,29,31,30,31,30,31,31,30,31,30,31],An=[31,28,31,30,31,30,31,31,30,31,30,31];function Cn(t,n){for(t=new Date(t.getTime());0<n;){var r=t.getMonth(),e=(Tn(t.getFullYear())?Sn:An)[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}bt=n.InternalError=pt("InternalError");for(var Wn=Array(256),jn=0;256>jn;++jn)Wn[jn]=String.fromCharCode(jn);mt=Wn,Tt=n.BindingError=pt("BindingError"),Yt.prototype.isAliasOf=function(t){if(!(this instanceof Yt&&t instanceof Yt))return!1;var n=this.Sb.Vb.Ub,r=this.Sb.Tb,e=t.Sb.Vb.Ub;for(t=t.Sb.Tb;n.ac;)r=n.pc(r),n=n.ac;for(;e.ac;)t=e.pc(t),e=e.ac;return n===e&&r===t},Yt.prototype.clone=function(){if(this.Sb.Tb||At(this),this.Sb.nc)return this.Sb.count.value+=1,this;var t=Ot,n=Object,r=n.create,e=Object.getPrototypeOf(this),i=this.Sb;return(t=t(r.call(n,e,{Sb:{value:{count:i.count,hc:i.hc,nc:i.nc,Tb:i.Tb,Vb:i.Vb,Xb:i.Xb,$b:i.$b}}}))).Sb.count.value+=1,t.Sb.hc=!1,t},Yt.prototype.delete=function(){this.Sb.Tb||At(this),this.Sb.hc&&!this.Sb.nc&&_t("Object already scheduled for deletion"),Wt(this),jt(this.Sb),this.Sb.nc||(this.Sb.Xb=void 0,this.Sb.Tb=void 0)},Yt.prototype.isDeleted=function(){return!this.Sb.Tb},Yt.prototype.deleteLater=function(){return this.Sb.Tb||At(this),this.Sb.hc&&!this.Sb.nc&&_t("Object already scheduled for deletion"),Pt.push(this),1===Pt.length&&Et&&Et(Dt),this.Sb.hc=!0,this},n.getInheritedInstanceCount=function(){return Object.keys(Ft).length},n.getLiveInheritedInstances=function(){var t,n=[];for(t in Ft)Ft.hasOwnProperty(t)&&n.push(Ft[t]);return n},n.flushPendingDeletes=Dt,n.setDelayFunction=function(t){Et=t,Pt.length&&Et&&Et(Dt)},Bt.prototype.Pc=function(t){return this.Jc&&(t=this.Jc(t)),t},Bt.prototype.Fc=function(t){this.bc&&this.bc(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.sc?Ut(this.Ub.kc,{Vb:this.Xc,Tb:r,$b:this,Xb:t}):Ut(this.Ub.kc,{Vb:this,Tb:t})}var r=this.Pc(t);if(!r)return this.Fc(t),null;var e=function(t,n){for(void 0===n&&_t("ptr should not be undefined");t.ac;)n=t.pc(n),t=t.ac;return Ft[n]}(this.Ub,r);if(void 0!==e)return 0===e.Sb.count.value?(e.Sb.Tb=r,e.Sb.Xb=t,e.clone()):(e=e.clone(),this.Fc(t),e);if(e=this.Ub.Oc(r),!(e=kt[e]))return n.call(this);e=this.rc?e.Lc:e.pointerType;var i=function t(n,r,e){return r===e?n:void 0===e.ac||null===(n=t(n,r,e.ac))?null:e.Mc(n)}(r,this.Ub,e.Ub);return null===i?n.call(this):this.sc?Ut(e.Ub.kc,{Vb:e,Tb:i,$b:this,Xb:t}):Ut(e.Ub.kc,{Vb:e,Tb:i})},zt=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 kn={n:function(t){return Dn(t+16)+16},p:function(t){var n=(t=new Q(t)).jc();return n.Qc()||(n.Ec(!0),nt--),n.tc(!1),tt.push(t),n.yc(),t.Kc()},Ka:function(t){throw f("Unexpected exception thrown, this is not properly supported - aborting"),p=!0,t},Qa:function(){if(!tt.length)return 0;var t=tt[tt.length-1];return t.jc().yc(),t.ic()},ya:function(t){t&&et(new J(t))},u:function(){Un(0);var t=tt.pop();et(t.jc()),t.Ac(),it=0},b:function(){var t=it;if(!t)return l=0;var n=new J(t).mc(),r=new Q;if(r.dc(t),r.cc(t),!n)return l=0,0|r.Tb;t=Array.prototype.slice.call(arguments);for(var e=0;e<t.length;e++){var i=t[e];if(0===i||i===n)break;if(xn(i,n,r.fc()))return l=i,0|r.Tb}return l=n,0|r.Tb},i:function(){var t=it;if(!t)return l=0;var n=new J(t).mc(),r=new Q;if(r.dc(t),r.cc(t),!n)return l=0,0|r.Tb;t=Array.prototype.slice.call(arguments);for(var e=0;e<t.length;e++){var i=t[e];if(0===i||i===n)break;if(xn(i,n,r.fc()))return l=i,0|r.Tb}return l=n,0|r.Tb},G:function(){var t=it;if(!t)return l=0;var n=new J(t).mc(),r=new Q;if(r.dc(t),r.cc(t),!n)return l=0,0|r.Tb;t=Array.prototype.slice.call(arguments);for(var e=0;e<t.length;e++){var i=t[e];if(0===i||i===n)break;if(xn(i,n,r.fc()))return l=i,0|r.Tb}return l=n,0|r.Tb},da:function(){var t=it;if(!t)return l=0;var n=new J(t).mc(),r=new Q;if(r.dc(t),r.cc(t),!n)return l=0,0|r.Tb;t=Array.prototype.slice.call(arguments);for(var e=0;e<t.length;e++){var i=t[e];if(0===i||i===n)break;if(xn(i,n,r.fc()))return l=i,0|r.Tb}return l=n,0|r.Tb},o:rt,xa:function(t){t&&new J(t).yc()},wa:at,Pa:function(t){if(t){var n=new Q;n.dc(t),t=n.jc(),tt.push(n),t.tc(!0),at()}},A:function(t,n,r){throw new J(t).cc(n,r),it=t,nt++,t},Ra:function(){return nt},e:function(t){var n=(t=new Q(t)).ic();throw it||(it=n),t.Ac(),n},_a:function(t){var n=ot[t];delete ot[t];var r=n.Cc,e=n.bc,i=n.Hc;dt([t],i.map((function(t){return t.Uc})).concat(i.map((function(t){return t.bd}))),(function(t){var a={};return i.forEach((function(n,r){var e=t[r],o=n.Sc,c=n.Tc,u=t[r+i.length],f=n.ad,s=n.cd;a[n.Nc]={read:function(t){return e.fromWireType(o(c,t))},write:function(t,n){var r=[];f(s,t,u.toWireType(r,n)),ct(r)}}})),[{name:n.name,fromWireType:function(t){var n,r={};for(n in a)r[n]=a[n].read(t);return e(t),r},toWireType:function(t,n){for(var i in a)if(!(i in n))throw new TypeError('Missing field: "'+i+'"');var o=r();for(i in a)a[i].write(o,n[i]);return null!==t&&t.push(e,o),o},argPackAdvance:8,readValueFromPointer:ut,Zb:e}]}))},ib:function(){},Va:function(t,n,r,e,i){var a=gt(r);St(t,{name:n=wt(n),fromWireType:function(t){return!!t},toWireType:function(t,n){return n?e:i},argPackAdvance:8,readValueFromPointer:function(t){if(1===r)var e=w;else if(2===r)e=_;else{if(4!==r)throw new TypeError("Unknown boolean type size: "+n);e=A}return this.fromWireType(e[t>>a])},Zb:null})},z:function(t,n,r,e,i,a,o,c,u,f,s,l,h){s=wt(s),a=Zt(i,a),c&&(c=Zt(o,c)),f&&(f=Zt(u,f)),h=Zt(l,h);var v=ht(s);Mt(v,(function(){Nt("Cannot construct "+s+" due to unbound types",[e])})),dt([t,n,r],e?[e]:[],(function(n){if(n=n[0],e)var r=n.Ub,i=r.kc;else i=Yt.prototype;n=vt(v,(function(){if(Object.getPrototypeOf(this)!==o)throw new Tt("Use 'new' to construct "+s);if(void 0===u.ec)throw new Tt(s+" has no accessible constructor");var t=u.ec[arguments.length];if(void 0===t)throw new Tt("Tried to invoke ctor of "+s+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(u.ec).toString()+") parameters instead!");return t.apply(this,arguments)}));var o=Object.create(i,{constructor:{value:n}});n.prototype=o;var u=new Rt(s,n,o,h,r,a,c,f);r=new Bt(s,u,!0,!1,!1),i=new Bt(s+"*",u,!1,!1,!1);var l=new Bt(s+" const*",u,!1,!0,!1);return kt[t]={pointerType:i,Lc:l},$t(v,n),[r,i,l]}))},y:function(t,n,r,e,i,a){0<n||z(void 0);var o=Kt(n,r);i=Zt(e,i),dt([],[t],(function(t){var r="constructor "+(t=t[0]).name;if(void 0===t.Ub.ec&&(t.Ub.ec=[]),void 0!==t.Ub.ec[n-1])throw new Tt("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.Ub.ec[n-1]=()=>{Nt("Cannot construct "+t.name+" due to unbound types",o)},dt([],o,(function(e){return e.splice(1,0,null),t.Ub.ec[n-1]=Gt(r,e,null,i,a),[]})),[]}))},m:function(t,n,r,e,i,a,o,c){var u=Kt(r,e);n=wt(n),a=Zt(i,a),dt([],[t],(function(t){function e(){Nt("Cannot call "+i+" due to unbound types",u)}var i=(t=t[0]).name+"."+n;n.startsWith("@@")&&(n=Symbol[n.substring(2)]),c&&t.Ub.Yc.push(n);var f=t.Ub.kc,s=f[n];return void 0===s||void 0===s.Wb&&s.className!==t.name&&s.qc===r-2?(e.qc=r-2,e.className=t.name,f[n]=e):(xt(f,n,i),f[n].Wb[r-2]=e),dt([],u,(function(e){return e=Gt(i,e,t,a,o),void 0===f[n].Wb?(e.qc=r-2,f[n]=e):f[n].Wb[r-2]=e,[]})),[]}))},Ua:function(t,n){St(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,Zb:null})},Z:function(t,n,r,e){function i(){}r=gt(r),n=wt(n),i.values={},St(t,{name:n,constructor:i,fromWireType:function(t){return this.constructor.values[t]},toWireType:function(t,n){return n.value},argPackAdvance:8,readValueFromPointer:en(n,r,e),Zb:null}),Mt(n,i)},Y:function(t,n,r){var e=an(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=gt(r),St(t,{name:n=wt(n),fromWireType:function(t){return t},toWireType:function(t,n){return n},argPackAdvance:8,readValueFromPointer:cn(n,r),Zb:null})},aa:function(t,n,r,e,i,a){var o=Kt(n,r);t=wt(t),i=Zt(e,i),Mt(t,(function(){Nt("Cannot call "+t+" due to unbound types",o)}),n-1),dt([],o,(function(r){return $t(t,Gt(t,[r[0],null].concat(r.slice(1)),null,i,a),n-1),[]}))},O:function(t,n,r,e,i){n=wt(n),-1===i&&(i=4294967295),i=gt(r);var a=t=>t;if(0===e){var o=32-8*r;a=t=>t<<o>>>o}r=n.includes("unsigned")?function(t,n){return n>>>0}:function(t,n){return n},St(t,{name:n,fromWireType:a,toWireType:r,argPackAdvance:8,readValueFromPointer:un(n,i,0!==e),Zb:null})},I:function(t,n,r){function e(t){var n=C;return new i(m,n[1+(t>>=2)],n[t])}var i=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][n];St(t,{name:r=wt(r),fromWireType:e,argPackAdvance:8,readValueFromPointer:e},{Vc:!0})},Ba:function(t,n,r,e,i,a,o,c,u,f,s,l){r=wt(r),a=Zt(i,a),c=Zt(o,c),f=Zt(u,f),l=Zt(s,l),dt([t],[n],(function(t){return t=t[0],[new Bt(r,t.Ub,!1,!1,!0,t,e,a,c,f,l)]}))},Aa:function(t,n){var r="std::string"===(n=wt(n));St(t,{name:n,fromWireType:function(t){var n=C[t>>2];if(r)for(var e=t+4,i=0;i<=n;++i){var a=t+4+i;if(i==n||0==T[a]){if(e=e?y(T,e,a-e):"",void 0===o)var o=e;else o+=String.fromCharCode(0),o+=e;e=a+1}}else{for(o=Array(n),i=0;i<n;++i)o[i]=String.fromCharCode(T[t+4+i]);o=o.join("")}return Pn(t),o},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||_t("Cannot pass non-string to std::string");var i=(r&&e?()=>g(n):()=>n.length)(),a=Dn(4+i+1);if(C[a>>2]=i,r&&e)d(n,T,a+4,i+1);else if(e)for(e=0;e<i;++e){var o=n.charCodeAt(e);255<o&&(Pn(a),_t("String has UTF-16 code units that do not fit in 8 bits")),T[a+4+e]=o}else for(e=0;e<i;++e)T[a+4+e]=n[e];return null!==t&&t.push(Pn,a),a},argPackAdvance:8,readValueFromPointer:ut,Zb:function(t){Pn(t)}})},la:function(t,n,r){if(r=wt(r),2===n)var e=P,i=D,a=E,o=()=>S,c=1;else 4===n&&(e=F,i=U,a=O,o=()=>C,c=2);St(t,{name:r,fromWireType:function(t){for(var r,i=C[t>>2],a=o(),u=t+4,f=0;f<=i;++f){var s=t+4+f*n;f!=i&&0!=a[s>>c]||(u=e(u,s-u),void 0===r?r=u:(r+=String.fromCharCode(0),r+=u),u=s+n)}return Pn(t),r},toWireType:function(t,e){"string"!=typeof e&&_t("Cannot pass non-string to C++ string type "+r);var o=a(e),u=Dn(4+o+n);return C[u>>2]=o>>c,i(e,u+4,o+n),null!==t&&t.push(Pn,u),u},argPackAdvance:8,readValueFromPointer:ut,Zb:function(t){Pn(t)}})},C:function(t,n,r,e,i,a){ot[t]={name:wt(n),Cc:Zt(r,e),bc:Zt(i,a),Hc:[]}},s:function(t,n,r,e,i,a,o,c,u,f){ot[t].Hc.push({Nc:wt(n),Uc:r,Sc:Zt(e,i),Tc:a,bd:o,ad:Zt(c,u),cd:f})},Wa:function(t,n){St(t,{Wc:!0,name:n=wt(n),argPackAdvance:0,fromWireType:function(){},toWireType:function(){}})},ma:function(t,n,r){t=nn(t),n=an(n,"emval::as");var e=[],i=rn(e);return A[r>>2]=i,n.toWireType(e,t)},Za:function(t,n,r,e){t=nn(t),r=fn(n,r);for(var i=Array(n),a=0;a<n;++a){var o=r[a];i[a]=o.readValueFromPointer(e),e+=o.argPackAdvance}return rn(t=t.apply(void 0,i))},T:function(t,n,r,e,i){t=hn[t],n=nn(n),r=ln(r);var a=[];return A[e>>2]=rn(a),t(n,r,a,i)},F:function(t,n,r,e){(t=hn[t])(n=nn(n),r=ln(r),null,e)},fa:tn,Xa: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 i=pn[n];if(void 0!==i)return i;i=["retType"];for(var a=[e],o="",c=0;c<t-1;++c)o+=(0!==c?", ":"")+"arg"+c,i.push("argType"+c),a.push(r[1+c]);var u="return function "+ht("methodCaller_"+n)+"(handle, name, destructors, args) {\n",f=0;for(c=0;c<t-1;++c)u+=" var arg"+c+" = argType"+c+".readValueFromPointer(args"+(f?"+"+f:"")+");\n",f+=r[c+1].argPackAdvance;for(u+=" var rv = handle[name]("+o+");\n",c=0;c<t-1;++c)r[c+1].deleteObject&&(u+=" argType"+c+".deleteObject(arg"+c+");\n");return e.Wc||(u+=" return retType.toWireType(destructors, rv);\n"),i.push(u+"};\n"),i=function(t){var n=hn.length;return hn.push(t),n}(t=Lt(i).apply(null,a)),pn[n]=i},ab:function(t){return t=ln(t),rn(n[t])},vb:function(t,n){return rn((t=nn(t))[n=nn(n)])},ga:function(t){4<t&&(Qt[t].Dc+=1)},$a:function(t,r,e,i){t=nn(t);var a=bn[r];if(!a){a="";for(var o=0;o<r;++o)a+=(0!==o?", ":"")+"arg"+o;var c="return function emval_allocator_"+r+"(constructor, argTypes, args) {\n";for(o=0;o<r;++o)c+="var argType"+o+" = requireRegisteredType(Module['HEAP32'][(argTypes >>> 2) + "+o+'], "parameter '+o+'");\nvar arg'+o+" = argType"+o+".readValueFromPointer(args);\nargs += argType"+o+"['argPackAdvance'];\n";a=new Function("requireRegisteredType","Module","valueToHandle",c+"var obj = new constructor("+a+");\nreturn valueToHandle(obj);\n}\n")(an,n,rn),bn[r]=a}return a(t,e,i)},Ya:function(){return rn([])},ob:function(t){return rn(ln(t))},cb:function(t){ct(nn(t)),tn(t)},bb:function(t,n){return(t=nn(t))===nn(n)},D:function(t,n){return rn(t=(t=an(t,"_emval_take_value")).readValueFromPointer(n))},ja:function(){z("")},ka:function(t){var n=T.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 i=Math;e=Math.max(t,e),i=i.min.call(i,2147483648,e+(65536-e%65536)%65536);t:{try{v.grow(i-m.byteLength+65535>>>16),Y();var a=1;break t}catch(t){}a=void 0}if(a)return!0}return!1},Sa:function(t,n){var r=0;return dn().forEach((function(e,i){var a=n+r;for(i=A[t+4*i>>2]=a,a=0;a<e.length;++a)w[i++>>0]=e.charCodeAt(a);w[i>>0]=0,r+=e.length+1})),0},Ta:function(t,n){var r=dn();A[t>>2]=r.length;var e=0;return r.forEach((function(t){e+=t.length+1})),A[n>>2]=e,0},Ma:function(){return 0},Oa:function(t,n,r,e){return t=wn.ld(t),n=wn.jd(t,n,r),A[e>>2]=n,0},hb:function(){},Na:function(t,n,r,e){for(var i=0,a=0;a<r;a++){var o=A[n>>2],c=A[n+4>>2];n+=8;for(var s=0;s<c;s++){var l=T[o+s],h=mn[t];0===l||10===l?((1===t?u:f)(y(h,0)),h.length=0):h.push(l)}i+=c}return A[e>>2]=i,0},a:function(){return l},Ja:function(t,n){var r=On();try{return G(t)(n)}catch(t){if(Yn(r),t!==t+0)throw t;Un(1,0)}},qa:function(t,n,r){var e=On();try{return G(t)(n,r)}catch(t){if(Yn(e),t!==t+0)throw t;Un(1,0)}},Ea:function(t,n,r,e){var i=On();try{return G(t)(n,r,e)}catch(t){if(Yn(i),t!==t+0)throw t;Un(1,0)}},H:function(t,n){var r=On();try{return G(t)(n)}catch(t){if(Yn(r),t!==t+0)throw t;Un(1,0)}},nb:function(t,n,r){var e=On();try{return G(t)(n,r)}catch(t){if(Yn(e),t!==t+0)throw t;Un(1,0)}},J:function(t,n,r){var e=On();try{return G(t)(n,r)}catch(t){if(Yn(e),t!==t+0)throw t;Un(1,0)}},qb:function(t,n,r,e,i){var a=On();try{return G(t)(n,r,e,i)}catch(t){if(Yn(a),t!==t+0)throw t;Un(1,0)}},P:function(t,n,r,e,i){var a=On();try{return G(t)(n,r,e,i)}catch(t){if(Yn(a),t!==t+0)throw t;Un(1,0)}},X:function(t,n,r,e){var i=On();try{return G(t)(n,r,e)}catch(t){if(Yn(i),t!==t+0)throw t;Un(1,0)}},S:function(t){var n=On();try{return G(t)()}catch(t){if(Yn(n),t!==t+0)throw t;Un(1,0)}},W:function(t,n){var r=On();try{return G(t)(n)}catch(t){if(Yn(r),t!==t+0)throw t;Un(1,0)}},Ia:function(t,n,r,e){var i=On();try{return G(t)(n,r,e)}catch(t){if(Yn(i),t!==t+0)throw t;Un(1,0)}},g:function(t,n){var r=On();try{return G(t)(n)}catch(t){if(Yn(r),t!==t+0)throw t;Un(1,0)}},ia:function(t,n,r){var e=On();try{return G(t)(n,r)}catch(t){if(Yn(e),t!==t+0)throw t;Un(1,0)}},ua:function(t,n,r){var e=On();try{return G(t)(n,r)}catch(t){if(Yn(e),t!==t+0)throw t;Un(1,0)}},c:function(t,n,r){var e=On();try{return G(t)(n,r)}catch(t){if(Yn(e),t!==t+0)throw t;Un(1,0)}},pb:function(t,n,r,e,i){var a=On();try{return G(t)(n,r,e,i)}catch(t){if(Yn(a),t!==t+0)throw t;Un(1,0)}},ta:function(t,n,r,e,i,a,o){var c=On();try{return G(t)(n,r,e,i,a,o)}catch(t){if(Yn(c),t!==t+0)throw t;Un(1,0)}},h:function(t,n,r,e){var i=On();try{return G(t)(n,r,e)}catch(t){if(Yn(i),t!==t+0)throw t;Un(1,0)}},Ga:function(t,n,r,e,i,a,o,c,u,f,s,l,h,v){var p=On();try{return G(t)(n,r,e,i,a,o,c,u,f,s,l,h,v)}catch(t){if(Yn(p),t!==t+0)throw t;Un(1,0)}},q:function(t,n,r,e,i){var a=On();try{return G(t)(n,r,e,i)}catch(t){if(Yn(a),t!==t+0)throw t;Un(1,0)}},Da:function(t,n,r,e,i,a){var o=On();try{return G(t)(n,r,e,i,a)}catch(t){if(Yn(o),t!==t+0)throw t;Un(1,0)}},w:function(t,n,r,e,i,a){var o=On();try{return G(t)(n,r,e,i,a)}catch(t){if(Yn(o),t!==t+0)throw t;Un(1,0)}},E:function(t,n,r,e,i,a,o){var c=On();try{return G(t)(n,r,e,i,a,o)}catch(t){if(Yn(c),t!==t+0)throw t;Un(1,0)}},K:function(t,n,r,e,i,a,o,c){var u=On();try{return G(t)(n,r,e,i,a,o,c)}catch(t){if(Yn(u),t!==t+0)throw t;Un(1,0)}},L:function(t,n,r,e,i,a,o,c,u){var f=On();try{return G(t)(n,r,e,i,a,o,c,u)}catch(t){if(Yn(f),t!==t+0)throw t;Un(1,0)}},_:function(t,n,r,e,i,a,o,c,u,f){var s=On();try{return G(t)(n,r,e,i,a,o,c,u,f)}catch(t){if(Yn(s),t!==t+0)throw t;Un(1,0)}},ca:function(t,n,r,e,i,a,o,c,u,f,s,l){var h=On();try{return G(t)(n,r,e,i,a,o,c,u,f,s,l)}catch(t){if(Yn(h),t!==t+0)throw t;Un(1,0)}},db:function(t,n,r,e){var i=On();try{return In(t,n,r,e)}catch(t){if(Yn(i),t!==t+0)throw t;Un(1,0)}},gb:function(t,n,r){var e=On();try{return Rn(t,n,r)}catch(t){if(Yn(e),t!==t+0)throw t;Un(1,0)}},j:function(t){var n=On();try{G(t)()}catch(t){if(Yn(n),t!==t+0)throw t;Un(1,0)}},l:function(t,n){var r=On();try{G(t)(n)}catch(t){if(Yn(r),t!==t+0)throw t;Un(1,0)}},oa:function(t,n,r){var e=On();try{G(t)(n,r)}catch(t){if(Yn(e),t!==t+0)throw t;Un(1,0)}},va:function(t,n,r,e){var i=On();try{G(t)(n,r,e)}catch(t){if(Yn(i),t!==t+0)throw t;Un(1,0)}},ub:function(t,n,r){var e=On();try{G(t)(n,r)}catch(t){if(Yn(e),t!==t+0)throw t;Un(1,0)}},ha:function(t,n,r,e,i,a,o,c,u,f,s){var l=On();try{G(t)(n,r,e,i,a,o,c,u,f,s)}catch(t){if(Yn(l),t!==t+0)throw t;Un(1,0)}},sb:function(t,n,r,e){var i=On();try{G(t)(n,r,e)}catch(t){if(Yn(i),t!==t+0)throw t;Un(1,0)}},rb:function(t,n,r,e,i,a,o,c){var u=On();try{G(t)(n,r,e,i,a,o,c)}catch(t){if(Yn(u),t!==t+0)throw t;Un(1,0)}},pa:function(t,n,r,e,i,a,o){var c=On();try{G(t)(n,r,e,i,a,o)}catch(t){if(Yn(c),t!==t+0)throw t;Un(1,0)}},d:function(t,n,r){var e=On();try{G(t)(n,r)}catch(t){if(Yn(e),t!==t+0)throw t;Un(1,0)}},ra:function(t,n,r,e){var i=On();try{G(t)(n,r,e)}catch(t){if(Yn(i),t!==t+0)throw t;Un(1,0)}},R:function(t,n,r,e,i){var a=On();try{G(t)(n,r,e,i)}catch(t){if(Yn(a),t!==t+0)throw t;Un(1,0)}},Q:function(t,n,r,e,i,a){var o=On();try{G(t)(n,r,e,i,a)}catch(t){if(Yn(o),t!==t+0)throw t;Un(1,0)}},Fa:function(t,n,r,e){var i=On();try{G(t)(n,r,e)}catch(t){if(Yn(i),t!==t+0)throw t;Un(1,0)}},sa:function(t,n,r,e,i,a){var o=On();try{G(t)(n,r,e,i,a)}catch(t){if(Yn(o),t!==t+0)throw t;Un(1,0)}},kb:function(t,n,r,e,i){var a=On();try{G(t)(n,r,e,i)}catch(t){if(Yn(a),t!==t+0)throw t;Un(1,0)}},Ha:function(t,n,r,e,i,a,o){var c=On();try{G(t)(n,r,e,i,a,o)}catch(t){if(Yn(c),t!==t+0)throw t;Un(1,0)}},f:function(t,n,r,e){var i=On();try{G(t)(n,r,e)}catch(t){if(Yn(i),t!==t+0)throw t;Un(1,0)}},mb:function(t,n,r,e,i){var a=On();try{G(t)(n,r,e,i)}catch(t){if(Yn(a),t!==t+0)throw t;Un(1,0)}},N:function(t,n,r,e,i,a,o){var c=On();try{G(t)(n,r,e,i,a,o)}catch(t){if(Yn(c),t!==t+0)throw t;Un(1,0)}},tb:function(t,n,r,e,i,a){var o=On();try{G(t)(n,r,e,i,a)}catch(t){if(Yn(o),t!==t+0)throw t;Un(1,0)}},k:function(t,n,r,e,i){var a=On();try{G(t)(n,r,e,i)}catch(t){if(Yn(a),t!==t+0)throw t;Un(1,0)}},ea:function(t,n,r,e,i,a){var o=On();try{G(t)(n,r,e,i,a)}catch(t){if(Yn(o),t!==t+0)throw t;Un(1,0)}},lb:function(t,n,r,e,i,a,o,c){var u=On();try{G(t)(n,r,e,i,a,o,c)}catch(t){if(Yn(u),t!==t+0)throw t;Un(1,0)}},na:function(t,n,r,e,i,a,o){var c=On();try{G(t)(n,r,e,i,a,o)}catch(t){if(Yn(c),t!==t+0)throw t;Un(1,0)}},t:function(t,n,r,e,i,a){var o=On();try{G(t)(n,r,e,i,a)}catch(t){if(Yn(o),t!==t+0)throw t;Un(1,0)}},v:function(t,n,r,e,i,a,o){var c=On();try{G(t)(n,r,e,i,a,o)}catch(t){if(Yn(c),t!==t+0)throw t;Un(1,0)}},B:function(t,n,r,e,i,a,o,c){var u=On();try{G(t)(n,r,e,i,a,o,c)}catch(t){if(Yn(u),t!==t+0)throw t;Un(1,0)}},M:function(t,n,r,e,i,a,o,c,u){var f=On();try{G(t)(n,r,e,i,a,o,c,u)}catch(t){if(Yn(f),t!==t+0)throw t;Un(1,0)}},V:function(t,n,r,e,i,a,o,c,u,f){var s=On();try{G(t)(n,r,e,i,a,o,c,u,f)}catch(t){if(Yn(s),t!==t+0)throw t;Un(1,0)}},U:function(t,n,r,e,i,a,o,c,u,f,s){var l=On();try{G(t)(n,r,e,i,a,o,c,u,f,s)}catch(t){if(Yn(l),t!==t+0)throw t;Un(1,0)}},$:function(t,n,r,e,i,a,o,c,u,f,s,l){var h=On();try{G(t)(n,r,e,i,a,o,c,u,f,s,l)}catch(t){if(Yn(h),t!==t+0)throw t;Un(1,0)}},jb:function(t,n,r,e,i,a,o,c,u,f,s,l,h){var v=On();try{G(t)(n,r,e,i,a,o,c,u,f,s,l,h)}catch(t){if(Yn(v),t!==t+0)throw t;Un(1,0)}},ba:function(t,n,r,e,i,a,o,c,u,f,s,l,h,v,p,b){var y=On();try{G(t)(n,r,e,i,a,o,c,u,f,s,l,h,v,p,b)}catch(t){if(Yn(y),t!==t+0)throw t;Un(1,0)}},eb:function(t,n,r,e,i,a,o){var c=On();try{Vn(t,n,r,e,i,a,o)}catch(t){if(Yn(c),t!==t+0)throw t;Un(1,0)}},fb:function(t,n,r,e){var i=On();try{Hn(t,n,r,e)}catch(t){if(Yn(i),t!==t+0)throw t;Un(1,0)}},r:function(t){return t},Ca:function(t){l=t},La:function(t,n,r,e){return function(t,n,r,e){function i(t,n,r){for(t="number"==typeof t?t.toString():t||"";t.length<n;)t=r[0]+t;return t}function a(t,n){return i(t,n,"0")}function o(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 c(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=Cn(new Date(t.Yb+1900,0,1),t.wc);var n=new Date(t.getFullYear()+1,0,4),r=c(new Date(t.getFullYear(),0,4));return n=c(n),0>=o(r,t)?0>=o(n,t)?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var f=A[e+40>>2];for(var s in e={gd:A[e>>2],fd:A[e+4>>2],uc:A[e+8>>2],oc:A[e+12>>2],lc:A[e+16>>2],Yb:A[e+20>>2],vc:A[e+24>>2],wc:A[e+28>>2],nd:A[e+32>>2],ed:A[e+36>>2],hd:f&&f?y(T,f,void 0):""},r=r?y(T,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.vc].substring(0,3)},"%A":function(t){return l[t.vc]},"%b":function(t){return h[t.lc].substring(0,3)},"%B":function(t){return h[t.lc]},"%C":function(t){return a((t.Yb+1900)/100|0,2)},"%d":function(t){return a(t.oc,2)},"%e":function(t){return i(t.oc,2," ")},"%g":function(t){return u(t).toString().substring(2)},"%G":function(t){return u(t)},"%H":function(t){return a(t.uc,2)},"%I":function(t){return 0==(t=t.uc)?t=12:12<t&&(t-=12),a(t,2)},"%j":function(t){return a(t.oc+_n(Tn(t.Yb+1900)?Sn:An,t.lc-1),3)},"%m":function(t){return a(t.lc+1,2)},"%M":function(t){return a(t.fd,2)},"%n":function(){return"\n"},"%p":function(t){return 0<=t.uc&&12>t.uc?"AM":"PM"},"%S":function(t){return a(t.gd,2)},"%t":function(){return"\t"},"%u":function(t){return t.vc||7},"%U":function(t){var n=new Date(t.Yb+1900,0,1),r=0===n.getDay()?n:Cn(n,7-n.getDay());return 0>o(r,t=new Date(t.Yb+1900,t.lc,t.oc))?a(Math.ceil((31-r.getDate()+(_n(Tn(t.getFullYear())?Sn:An,t.getMonth()-1)-31)+t.getDate())/7),2):0===o(r,n)?"01":"00"},"%V":function(t){var n=new Date(t.Yb+1901,0,4),r=c(new Date(t.Yb+1900,0,4));n=c(n);var e=Cn(new Date(t.Yb+1900,0,1),t.wc);return 0>o(e,r)?"53":0>=o(n,e)?"01":a(Math.ceil((r.getFullYear()<t.Yb+1900?t.wc+32-r.getDate():t.wc+1-r.getDate())/7),2)},"%w":function(t){return t.vc},"%W":function(t){var n=new Date(t.Yb,0,1),r=1===n.getDay()?n:Cn(n,0===n.getDay()?1:7-n.getDay()+1);return 0>o(r,t=new Date(t.Yb+1900,t.lc,t.oc))?a(Math.ceil((31-r.getDate()+(_n(Tn(t.getFullYear())?Sn:An,t.getMonth()-1)-31)+t.getDate())/7),2):0===o(r,n)?"01":"00"},"%y":function(t){return(t.Yb+1900).toString().substring(2)},"%Y":function(t){return t.Yb+1900},"%z":function(t){var n=0<=(t=t.ed);return t=Math.abs(t)/60,(n?"+":"-")+String("0000"+(t/60*100+t%60)).slice(-4)},"%Z":function(t){return t.hd},"%%":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(g(t)+1);return d(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.wb,Y(),x=n.asm.Db,R.unshift(n.asm.xb),B--,n.monitorRunDependencies&&n.monitorRunDependencies(B),0==B&&(null!==$&&(clearInterval($),$=null),Z&&(t=Z,Z=null,t()))}function r(n){t(n.instance)}function i(t){return(s||"function"!=typeof fetch?Promise.resolve().then((function(){return K()})):fetch(X,{credentials:"same-origin"}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+X+"'";return t.arrayBuffer()})).catch((function(){return K()}))).then((function(t){return WebAssembly.instantiate(t,a)})).then((function(t){return t})).then(t,(function(t){f("failed to asynchronously prepare wasm: "+t),z(t)}))}var a={a:kn};if(B++,n.monitorRunDependencies&&n.monitorRunDependencies(B),n.instantiateWasm)try{return n.instantiateWasm(a,t)}catch(t){return f("Module.instantiateWasm callback failed with error: "+t),!1}(s||"function"!=typeof WebAssembly.instantiateStreaming||q()||"function"!=typeof fetch?i(r):fetch(X,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,a).then(r,(function(t){return f("wasm streaming compile failed: "+t),f("falling back to ArrayBuffer instantiation"),i(r)}))}))).catch(e)}(),n.___wasm_call_ctors=function(){return(n.___wasm_call_ctors=n.asm.xb).apply(null,arguments)};var Pn=n._free=function(){return(Pn=n._free=n.asm.yb).apply(null,arguments)},Dn=n._malloc=function(){return(Dn=n._malloc=n.asm.zb).apply(null,arguments)};n._main=function(){return(n._main=n.asm.Ab).apply(null,arguments)};var En=n.___getTypeName=function(){return(En=n.___getTypeName=n.asm.Bb).apply(null,arguments)};n.___embind_register_native_and_builtin_types=function(){return(n.___embind_register_native_and_builtin_types=n.asm.Cb).apply(null,arguments)};var Fn,Un=n._setThrew=function(){return(Un=n._setThrew=n.asm.Eb).apply(null,arguments)},On=n.stackSave=function(){return(On=n.stackSave=n.asm.Fb).apply(null,arguments)},Yn=n.stackRestore=function(){return(Yn=n.stackRestore=n.asm.Gb).apply(null,arguments)},xn=n.___cxa_can_catch=function(){return(xn=n.___cxa_can_catch=n.asm.Hb).apply(null,arguments)},Mn=n.___cxa_is_pointer_type=function(){return(Mn=n.___cxa_is_pointer_type=n.asm.Ib).apply(null,arguments)},Rn=n.dynCall_jii=function(){return(Rn=n.dynCall_jii=n.asm.Jb).apply(null,arguments)},Vn=n.dynCall_viiiji=function(){return(Vn=n.dynCall_viiiji=n.asm.Kb).apply(null,arguments)},In=n.dynCall_iij=function(){return(In=n.dynCall_iij=n.asm.Lb).apply(null,arguments)},Hn=n.dynCall_vij=function(){return(Hn=n.dynCall_vij=n.asm.Mb).apply(null,arguments)};function Xn(t){this.name="ExitStatus",this.message="Program terminated with exit("+t+")",this.status=t}function Bn(){function t(){if(!Fn&&(Fn=!0,n.calledRun=!0,!p)){if(L(R),L(V),r(n),n.onRuntimeInitialized&&n.onRuntimeInitialized(),$n){var t=n._main;try{var e=t(0,0);h||(n.onExit&&n.onExit(e),p=!0),o(e,new Xn(e))}catch(t){t instanceof Xn||"unwind"==t||o(1,t)}}if(n.postRun)for("function"==typeof n.postRun&&(n.postRun=[n.postRun]);n.postRun.length;)t=n.postRun.shift(),I.unshift(t);L(I)}}if(!(0<B)){if(n.preRun)for("function"==typeof n.preRun&&(n.preRun=[n.preRun]);n.preRun.length;)H();L(M),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.Nb).apply(null,arguments)},n.dynCall_jiji=function(){return(n.dynCall_jiji=n.asm.Ob).apply(null,arguments)},n.dynCall_iiiiij=function(){return(n.dynCall_iiiiij=n.asm.Pb).apply(null,arguments)},n.dynCall_iiiiijj=function(){return(n.dynCall_iiiiijj=n.asm.Qb).apply(null,arguments)},n.dynCall_iiiiiijj=function(){return(n.dynCall_iiiiiijj=n.asm.Rb).apply(null,arguments)},Z=function t(){Fn||Bn(),Fn||(Z=t)},n.run=Bn,n.preInit)for("function"==typeof n.preInit&&(n.preInit=[n.preInit]);0<n.preInit.length;)n.preInit.pop()();var $n=!0;return n.noInitialRun&&($n=!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);