@roomle/web-sdk 2.29.1 → 2.30.0-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (208) hide show
  1. package/lib/{banana-for-scale-f45e866a.js → banana-for-scale-50441826.js} +2 -2
  2. package/lib/{banana-for-scale-f45e866a.js.map → banana-for-scale-50441826.js.map} +1 -1
  3. package/lib/{banana-for-scale-381d58e8.nomodule.js → banana-for-scale-ef10525e.nomodule.js} +2 -2
  4. package/lib/{banana-for-scale-381d58e8.nomodule.js.map → banana-for-scale-ef10525e.nomodule.js.map} +1 -1
  5. package/lib/{component-dimensioning-c8c82bac.js → component-dimensioning-531ea19d.js} +2 -2
  6. package/lib/component-dimensioning-531ea19d.js.map +1 -0
  7. package/lib/{component-dimensioning-4d04c85d.nomodule.js → component-dimensioning-90a64e1e.nomodule.js} +2 -2
  8. package/lib/component-dimensioning-90a64e1e.nomodule.js.map +1 -0
  9. package/lib/configurator-b4dc0536.nomodule.js +2 -0
  10. package/lib/{configurator-b2187c1b.nomodule.js.map → configurator-b4dc0536.nomodule.js.map} +1 -1
  11. package/lib/configurator-bb9c95ae.js +2 -0
  12. package/lib/{configurator-c8caac15.js.map → configurator-bb9c95ae.js.map} +1 -1
  13. package/lib/configurator-main-34fdbc9b.js +2 -0
  14. package/lib/configurator-main-34fdbc9b.js.map +1 -0
  15. package/lib/configurator-main.nomodule.js +1 -1
  16. package/lib/{configurator-mesh-generator-398ec1fd.nomodule.js → configurator-mesh-generator-d934ee1a.nomodule.js} +2 -2
  17. package/lib/configurator-mesh-generator-d934ee1a.nomodule.js.map +1 -0
  18. package/lib/{configurator-mesh-generator-24cf50c3.js → configurator-mesh-generator-ead98694.js} +2 -2
  19. package/lib/configurator-mesh-generator-ead98694.js.map +1 -0
  20. package/lib/{default-light-setting-00a36539.nomodule.js → default-light-setting-b50c85b0.nomodule.js} +2 -2
  21. package/lib/default-light-setting-b50c85b0.nomodule.js.map +1 -0
  22. package/lib/{default-light-setting-f73fb1f7.js → default-light-setting-d3b0828b.js} +2 -2
  23. package/lib/default-light-setting-d3b0828b.js.map +1 -0
  24. package/lib/definitions/common-core/src/services/cache-holder.d.ts +1 -1
  25. package/lib/definitions/common-core/src/services/common-kernel-access.d.ts +1 -1
  26. package/lib/definitions/common-core/src/static-files/roomle-core.d.ts +0 -1
  27. package/lib/definitions/common-core/src/utils/threejs-utils.d.ts +1 -1
  28. package/lib/definitions/common-core/src/webgl/mesh-generator.d.ts +1 -1
  29. package/lib/definitions/configurator-core/src/roomle-configurator.d.ts +4 -0
  30. package/lib/definitions/configurator-core/src/utils/configurator-history.d.ts +5 -0
  31. package/lib/definitions/planner-core/src/webgl/planner-mesh-generator.d.ts +1 -1
  32. package/lib/{dimensioning-helper-8d17a6cf.js → dimensioning-helper-4a959d4c.js} +2 -2
  33. package/lib/dimensioning-helper-4a959d4c.js.map +1 -0
  34. package/lib/{dimensioning-helper-37d6d07c.nomodule.js → dimensioning-helper-f244b9ce.nomodule.js} +2 -2
  35. package/lib/dimensioning-helper-f244b9ce.nomodule.js.map +1 -0
  36. package/lib/{glb-viewer-dcffd36a.js → glb-viewer-098f3418.js} +2 -2
  37. package/lib/{glb-viewer-dcffd36a.js.map → glb-viewer-098f3418.js.map} +1 -1
  38. package/lib/{glb-viewer-06b94aaf.nomodule.js → glb-viewer-48060835.nomodule.js} +2 -2
  39. package/lib/{glb-viewer-06b94aaf.nomodule.js.map → glb-viewer-48060835.nomodule.js.map} +1 -1
  40. package/lib/glb-viewer-main-daa5570a.js +2 -0
  41. package/lib/glb-viewer-main-daa5570a.js.map +1 -0
  42. package/lib/glb-viewer-main.nomodule.js +1 -1
  43. package/lib/image-renderer-290cb601.js +2 -0
  44. package/lib/{image-renderer-f53d72f9.js.map → image-renderer-290cb601.js.map} +1 -1
  45. package/lib/image-renderer-82f30e18.nomodule.js +2 -0
  46. package/lib/{image-renderer-ba606104.nomodule.js.map → image-renderer-82f30e18.nomodule.js.map} +1 -1
  47. package/lib/legacy/{banana-for-scale-93eb1daf.legacy.js → banana-for-scale-3a255f75.legacy.js} +2 -2
  48. package/lib/legacy/{banana-for-scale-93eb1daf.legacy.js.map → banana-for-scale-3a255f75.legacy.js.map} +1 -1
  49. package/lib/legacy/{component-dimensioning-eee5e237.legacy.js → component-dimensioning-a7dd5cea.legacy.js} +2 -2
  50. package/lib/legacy/component-dimensioning-a7dd5cea.legacy.js.map +1 -0
  51. package/lib/legacy/configurator-3f69ddbf.legacy.js +2 -0
  52. package/lib/legacy/{configurator-7cc4cf7f.legacy.js.map → configurator-3f69ddbf.legacy.js.map} +1 -1
  53. package/lib/legacy/configurator-main.legacy.js +1 -1
  54. package/lib/legacy/{configurator-mesh-generator-6c22760b.legacy.js → configurator-mesh-generator-13425042.legacy.js} +2 -2
  55. package/lib/legacy/configurator-mesh-generator-13425042.legacy.js.map +1 -0
  56. package/lib/legacy/{default-light-setting-50c5540b.legacy.js → default-light-setting-52a06558.legacy.js} +2 -2
  57. package/lib/legacy/default-light-setting-52a06558.legacy.js.map +1 -0
  58. package/lib/legacy/{dimensioning-helper-382c662b.legacy.js → dimensioning-helper-e0abcfad.legacy.js} +2 -2
  59. package/lib/legacy/dimensioning-helper-e0abcfad.legacy.js.map +1 -0
  60. package/lib/legacy/{glb-viewer-cdd65763.legacy.js → glb-viewer-8bc4c40d.legacy.js} +2 -2
  61. package/lib/legacy/{glb-viewer-cdd65763.legacy.js.map → glb-viewer-8bc4c40d.legacy.js.map} +1 -1
  62. package/lib/legacy/glb-viewer-main.legacy.js +1 -1
  63. package/lib/legacy/image-renderer-edf5e462.legacy.js +2 -0
  64. package/lib/legacy/{image-renderer-d0fd5c55.legacy.js.map → image-renderer-edf5e462.legacy.js.map} +1 -1
  65. package/lib/legacy/{material-viewer-0bd75634.legacy.js → material-viewer-a27f3832.legacy.js} +2 -2
  66. package/lib/legacy/material-viewer-a27f3832.legacy.js.map +1 -0
  67. package/lib/legacy/material-viewer-main.legacy.js +1 -1
  68. package/lib/legacy/mesh-generator-722229e3.legacy.js +2 -0
  69. package/lib/legacy/mesh-generator-722229e3.legacy.js.map +1 -0
  70. package/lib/legacy/{pixotron-af54e7f4.legacy.js → pixotron-1f44ad7e.legacy.js} +2 -2
  71. package/lib/legacy/{pixotron-af54e7f4.legacy.js.map → pixotron-1f44ad7e.legacy.js.map} +1 -1
  72. package/lib/legacy/planner-00921b17.legacy.js +2 -0
  73. package/lib/legacy/{planner-9105e629.legacy.js.map → planner-00921b17.legacy.js.map} +1 -1
  74. package/lib/legacy/planner-main.legacy.js +1 -1
  75. package/lib/legacy/rapi-access-df9b6d1a.legacy.js +16 -0
  76. package/lib/legacy/rapi-access-df9b6d1a.legacy.js.map +1 -0
  77. package/lib/legacy/roomle-sdk.legacy.js +1 -1
  78. package/lib/legacy/{scene-manager-444a090a.legacy.js → scene-manager-54b3e37a.legacy.js} +2 -2
  79. package/lib/legacy/scene-manager-54b3e37a.legacy.js.map +1 -0
  80. package/lib/legacy/static/ConfiguratorKernel-3e4350b62d6ccb33.wasm +0 -0
  81. package/lib/legacy/static/{ConfiguratorKernel-7379813e2cd03c0d.js → ConfiguratorKernel-9caa95838538c54f.js} +73 -73
  82. package/lib/legacy/static/ConfiguratorKernelJs-09c978f7fdbef284.js +143 -0
  83. package/lib/legacy/static/ConfiguratorKernelJs-d70d079649d7be16.mem +0 -0
  84. package/lib/legacy/static/{RoomleCore-4da5951bbc66db16.js → RoomleCore-0cc69dbcd8b6156d.js} +83 -83
  85. package/lib/legacy/static/RoomleCore-e255ef00e2f5451a.wasm +0 -0
  86. package/lib/legacy/static/RoomleCoreJs-a8fa921965a7d125.mem +0 -0
  87. package/lib/legacy/static/RoomleCoreJs-b092f47eed9a8777.js +151 -0
  88. package/lib/legacy/static/shaders-14726d8418d5fcba.json +1 -0
  89. package/lib/legacy/{stats-helper-9b3de7cb.legacy.js → stats-helper-ac0ec26b.legacy.js} +2 -2
  90. package/lib/legacy/{stats-helper-9b3de7cb.legacy.js.map → stats-helper-ac0ec26b.legacy.js.map} +1 -1
  91. package/lib/{material-viewer-6a7e9aae.js → material-viewer-3a25244b.js} +2 -2
  92. package/lib/material-viewer-3a25244b.js.map +1 -0
  93. package/lib/{material-viewer-f5945d4d.nomodule.js → material-viewer-f3e2f444.nomodule.js} +2 -2
  94. package/lib/material-viewer-f3e2f444.nomodule.js.map +1 -0
  95. package/lib/material-viewer-main-9bcdf750.js +2 -0
  96. package/lib/material-viewer-main-9bcdf750.js.map +1 -0
  97. package/lib/material-viewer-main.nomodule.js +1 -1
  98. package/lib/mesh-generator-07dc613a.nomodule.js +2 -0
  99. package/lib/mesh-generator-07dc613a.nomodule.js.map +1 -0
  100. package/lib/mesh-generator-9623f79d.js +2 -0
  101. package/lib/mesh-generator-9623f79d.js.map +1 -0
  102. package/lib/{pixotron-27b4f029.js → pixotron-59db1efb.js} +2 -2
  103. package/lib/{pixotron-27b4f029.js.map → pixotron-59db1efb.js.map} +1 -1
  104. package/lib/{pixotron-aa387978.nomodule.js → pixotron-d2d7595f.nomodule.js} +2 -2
  105. package/lib/{pixotron-aa387978.nomodule.js.map → pixotron-d2d7595f.nomodule.js.map} +1 -1
  106. package/lib/planner-04d1e1cf.nomodule.js +2 -0
  107. package/lib/{planner-07855a5f.nomodule.js.map → planner-04d1e1cf.nomodule.js.map} +1 -1
  108. package/lib/planner-76efffc0.js +2 -0
  109. package/lib/{planner-7a62b637.js.map → planner-76efffc0.js.map} +1 -1
  110. package/lib/planner-main-fa78da73.js +2 -0
  111. package/lib/planner-main-fa78da73.js.map +1 -0
  112. package/lib/planner-main.nomodule.js +1 -1
  113. package/lib/rapi-access-0e1335d5.nomodule.js +16 -0
  114. package/lib/rapi-access-0e1335d5.nomodule.js.map +1 -0
  115. package/lib/rapi-access-35c9b031.js +16 -0
  116. package/lib/rapi-access-35c9b031.js.map +1 -0
  117. package/lib/{roomle-sdk-3f00a33b.js → roomle-sdk-f2545255.js} +2 -2
  118. package/lib/roomle-sdk-f2545255.js.map +1 -0
  119. package/lib/roomle-sdk.nomodule.js +1 -1
  120. package/lib/{scene-manager-42f2cb7d.js → scene-manager-b3abd6a6.js} +2 -2
  121. package/lib/scene-manager-b3abd6a6.js.map +1 -0
  122. package/lib/{scene-manager-a81831fa.nomodule.js → scene-manager-b5d55e68.nomodule.js} +2 -2
  123. package/lib/scene-manager-b5d55e68.nomodule.js.map +1 -0
  124. package/lib/static/ConfiguratorKernel-3e4350b62d6ccb33.wasm +0 -0
  125. package/lib/static/ConfiguratorKernel-9caa95838538c54f.js +1 -0
  126. package/lib/static/ConfiguratorKernel-9caa95838538c54f.js.map +1 -0
  127. package/lib/static/ConfiguratorKernelJs-09c978f7fdbef284.js +143 -0
  128. package/lib/static/ConfiguratorKernelJs-d70d079649d7be16.mem +0 -0
  129. package/lib/static/RoomleCore-0cc69dbcd8b6156d.js +1 -0
  130. package/lib/static/RoomleCore-0cc69dbcd8b6156d.js.map +1 -0
  131. package/lib/static/RoomleCore-e255ef00e2f5451a.wasm +0 -0
  132. package/lib/static/RoomleCoreJs-a8fa921965a7d125.mem +0 -0
  133. package/lib/static/RoomleCoreJs-b092f47eed9a8777.js +151 -0
  134. package/lib/static/shaders-14726d8418d5fcba.json +1 -0
  135. package/lib/{stats-helper-b45d08c5.js → stats-helper-16e67740.js} +2 -2
  136. package/lib/{stats-helper-b45d08c5.js.map → stats-helper-16e67740.js.map} +1 -1
  137. package/lib/{stats-helper-e5e90e31.nomodule.js → stats-helper-8fd90e9a.nomodule.js} +2 -2
  138. package/lib/{stats-helper-e5e90e31.nomodule.js.map → stats-helper-8fd90e9a.nomodule.js.map} +1 -1
  139. package/package.json +2 -2
  140. package/lib/component-dimensioning-4d04c85d.nomodule.js.map +0 -1
  141. package/lib/component-dimensioning-c8c82bac.js.map +0 -1
  142. package/lib/configurator-b2187c1b.nomodule.js +0 -2
  143. package/lib/configurator-c8caac15.js +0 -2
  144. package/lib/configurator-main-1a0355ad.js +0 -2
  145. package/lib/configurator-main-1a0355ad.js.map +0 -1
  146. package/lib/configurator-mesh-generator-24cf50c3.js.map +0 -1
  147. package/lib/configurator-mesh-generator-398ec1fd.nomodule.js.map +0 -1
  148. package/lib/default-light-setting-00a36539.nomodule.js.map +0 -1
  149. package/lib/default-light-setting-f73fb1f7.js.map +0 -1
  150. package/lib/dimensioning-helper-37d6d07c.nomodule.js.map +0 -1
  151. package/lib/dimensioning-helper-8d17a6cf.js.map +0 -1
  152. package/lib/glb-viewer-main-7c5e7d38.js +0 -2
  153. package/lib/glb-viewer-main-7c5e7d38.js.map +0 -1
  154. package/lib/image-renderer-ba606104.nomodule.js +0 -2
  155. package/lib/image-renderer-f53d72f9.js +0 -2
  156. package/lib/legacy/component-dimensioning-eee5e237.legacy.js.map +0 -1
  157. package/lib/legacy/configurator-7cc4cf7f.legacy.js +0 -2
  158. package/lib/legacy/configurator-mesh-generator-6c22760b.legacy.js.map +0 -1
  159. package/lib/legacy/default-light-setting-50c5540b.legacy.js.map +0 -1
  160. package/lib/legacy/dimensioning-helper-382c662b.legacy.js.map +0 -1
  161. package/lib/legacy/image-renderer-d0fd5c55.legacy.js +0 -2
  162. package/lib/legacy/material-viewer-0bd75634.legacy.js.map +0 -1
  163. package/lib/legacy/mesh-generator-e621aff0.legacy.js +0 -2
  164. package/lib/legacy/mesh-generator-e621aff0.legacy.js.map +0 -1
  165. package/lib/legacy/planner-9105e629.legacy.js +0 -2
  166. package/lib/legacy/rapi-access-eac1edaa.legacy.js +0 -16
  167. package/lib/legacy/rapi-access-eac1edaa.legacy.js.map +0 -1
  168. package/lib/legacy/scene-manager-444a090a.legacy.js.map +0 -1
  169. package/lib/legacy/static/ConfiguratorKernel-4c09558b00e81ba8.wasm +0 -0
  170. package/lib/legacy/static/ConfiguratorKernelJs-3789a15227520de1.js +0 -143
  171. package/lib/legacy/static/ConfiguratorKernelJs-dd075c23d87b4733.mem +0 -0
  172. package/lib/legacy/static/RoomleCore-43a1c9de57277471.wasm +0 -0
  173. package/lib/legacy/static/RoomleCoreJs-86806817a5b958c9.js +0 -151
  174. package/lib/legacy/static/RoomleCoreJs-cfff2977254b7f93.mem +0 -0
  175. package/lib/legacy/static/corto.em.roomle-05666d318bd656c3.js +0 -182
  176. package/lib/legacy/static/shaders-51665a583ff75bb6.json +0 -1
  177. package/lib/material-viewer-6a7e9aae.js.map +0 -1
  178. package/lib/material-viewer-f5945d4d.nomodule.js.map +0 -1
  179. package/lib/material-viewer-main-ef944983.js +0 -2
  180. package/lib/material-viewer-main-ef944983.js.map +0 -1
  181. package/lib/mesh-generator-bd71e198.nomodule.js +0 -2
  182. package/lib/mesh-generator-bd71e198.nomodule.js.map +0 -1
  183. package/lib/mesh-generator-e06e41c5.js +0 -2
  184. package/lib/mesh-generator-e06e41c5.js.map +0 -1
  185. package/lib/planner-07855a5f.nomodule.js +0 -2
  186. package/lib/planner-7a62b637.js +0 -2
  187. package/lib/planner-main-3ce584f3.js +0 -2
  188. package/lib/planner-main-3ce584f3.js.map +0 -1
  189. package/lib/rapi-access-589f9e14.js +0 -16
  190. package/lib/rapi-access-589f9e14.js.map +0 -1
  191. package/lib/rapi-access-f2371d51.nomodule.js +0 -16
  192. package/lib/rapi-access-f2371d51.nomodule.js.map +0 -1
  193. package/lib/roomle-sdk-3f00a33b.js.map +0 -1
  194. package/lib/scene-manager-42f2cb7d.js.map +0 -1
  195. package/lib/scene-manager-a81831fa.nomodule.js.map +0 -1
  196. package/lib/static/ConfiguratorKernel-4c09558b00e81ba8.wasm +0 -0
  197. package/lib/static/ConfiguratorKernel-7379813e2cd03c0d.js +0 -1
  198. package/lib/static/ConfiguratorKernel-7379813e2cd03c0d.js.map +0 -1
  199. package/lib/static/ConfiguratorKernelJs-3789a15227520de1.js +0 -143
  200. package/lib/static/ConfiguratorKernelJs-dd075c23d87b4733.mem +0 -0
  201. package/lib/static/RoomleCore-43a1c9de57277471.wasm +0 -0
  202. package/lib/static/RoomleCore-4da5951bbc66db16.js +0 -1
  203. package/lib/static/RoomleCore-4da5951bbc66db16.js.map +0 -1
  204. package/lib/static/RoomleCoreJs-86806817a5b958c9.js +0 -151
  205. package/lib/static/RoomleCoreJs-cfff2977254b7f93.mem +0 -0
  206. package/lib/static/corto.em.roomle-05666d318bd656c3.js +0 -1
  207. package/lib/static/corto.em.roomle-05666d318bd656c3.js.map +0 -1
  208. package/lib/static/shaders-51665a583ff75bb6.json +0 -1
@@ -1,2 +1,2 @@
1
- import"./query-params-helper-a271f9dc.js";import{_ as __decorate,i as inject}from"./rapi-access-589f9e14.js";import{g as getAssetPath}from"./main-thread-to-worker-5447c1c5.js";import"./image-renderer-f53d72f9.js";import"./pixotron-27b4f029.js";import{S as ScenePluginDefaultImplementation}from"./configurator-c8caac15.js";import"./mesh-generator-e06e41c5.js";import"./configurator-mesh-generator-24cf50c3.js";import"./default-light-setting-f73fb1f7.js";let BananaForScale=(()=>{class e extends ScenePluginDefaultImplementation{setScene(e){this._scene=e,this._staticItemLoader.loadGLB(getAssetPath()+"static/banana_div2-1351c98ec2986be1.glb").then(e=>{this._banana=e,this.updateBounds(null)})}updateBounds(e){if(e&&(this._bounds=e),this._bounds){if(this._banana){const e=this._bounds.getSize(new THREE.Vector3),t=this._bounds.getCenter(new THREE.Vector3).clone();t.x-=e.x/2+.18,t.z+=e.z/2+.05,t.y=0;let a=.03;this._banana.scale.copy(new THREE.Vector3(a,a,a)),this._banana.rotation.y=.6,this._banana.position.copy(t)}this._scene.children.includes(this._banana)||this.addToScene()}}clearScene(e,t){super.clearScene(e,t),this.removeFromScene()}addToScene(){this._scene&&this._banana&&this._scene.add(this._banana)}removeFromScene(){this._scene&&this._banana&&this._scene.remove(this._banana)}}return __decorate([inject],e.prototype,"_staticItemLoader",void 0),e})();export default BananaForScale;
2
- //# sourceMappingURL=banana-for-scale-f45e866a.js.map
1
+ import"./query-params-helper-a271f9dc.js";import{_ as __decorate,i as inject}from"./rapi-access-35c9b031.js";import{g as getAssetPath}from"./main-thread-to-worker-5447c1c5.js";import"./image-renderer-290cb601.js";import"./pixotron-59db1efb.js";import{S as ScenePluginDefaultImplementation}from"./configurator-bb9c95ae.js";import"./mesh-generator-9623f79d.js";import"./configurator-mesh-generator-ead98694.js";import"./default-light-setting-d3b0828b.js";let BananaForScale=(()=>{class e extends ScenePluginDefaultImplementation{setScene(e){this._scene=e,this._staticItemLoader.loadGLB(getAssetPath()+"static/banana_div2-1351c98ec2986be1.glb").then(e=>{this._banana=e,this.updateBounds(null)})}updateBounds(e){if(e&&(this._bounds=e),this._bounds){if(this._banana){const e=this._bounds.getSize(new THREE.Vector3),t=this._bounds.getCenter(new THREE.Vector3).clone();t.x-=e.x/2+.18,t.z+=e.z/2+.05,t.y=0;let a=.03;this._banana.scale.copy(new THREE.Vector3(a,a,a)),this._banana.rotation.y=.6,this._banana.position.copy(t)}this._scene.children.includes(this._banana)||this.addToScene()}}clearScene(e,t){super.clearScene(e,t),this.removeFromScene()}addToScene(){this._scene&&this._banana&&this._scene.add(this._banana)}removeFromScene(){this._scene&&this._banana&&this._scene.remove(this._banana)}}return __decorate([inject],e.prototype,"_staticItemLoader",void 0),e})();export default BananaForScale;
2
+ //# sourceMappingURL=banana-for-scale-50441826.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"banana-for-scale-f45e866a.js","sources":["../../packages/configurator-core/public/geometry/banana_div2.glb"],"sourcesContent":["export default \"static/banana_div2-1351c98ec2986be1.glb\""],"names":[],"mappings":"ulBAAe"}
1
+ {"version":3,"file":"banana-for-scale-50441826.js","sources":["../../packages/configurator-core/public/geometry/banana_div2.glb"],"sourcesContent":["export default \"static/banana_div2-1351c98ec2986be1.glb\""],"names":[],"mappings":"ulBAAe"}
@@ -1,2 +1,2 @@
1
- System.register(["./query-params-helper-c231e1b8.nomodule.js","./rapi-access-f2371d51.nomodule.js","./main-thread-to-worker-4fc95d50.nomodule.js","./image-renderer-ba606104.nomodule.js","./pixotron-aa387978.nomodule.js","./configurator-b2187c1b.nomodule.js","./mesh-generator-bd71e198.nomodule.js","./configurator-mesh-generator-398ec1fd.nomodule.js","./default-light-setting-00a36539.nomodule.js"],(function(e){var n,t,o,a;return{setters:[function(){},function(e){n=e._,t=e.i},function(e){o=e.g},function(){},function(){},function(e){a=e.S},function(){},function(){},function(){}],execute:function(){e("default",(()=>{class e extends a{setScene(e){this._scene=e,this._staticItemLoader.loadGLB(o()+"static/banana_div2-1351c98ec2986be1.glb").then(e=>{this._banana=e,this.updateBounds(null)})}updateBounds(e){if(e&&(this._bounds=e),this._bounds){if(this._banana){const e=this._bounds.getSize(new THREE.Vector3),n=this._bounds.getCenter(new THREE.Vector3).clone();n.x-=e.x/2+.18,n.z+=e.z/2+.05,n.y=0;let t=.03;this._banana.scale.copy(new THREE.Vector3(t,t,t)),this._banana.rotation.y=.6,this._banana.position.copy(n)}this._scene.children.includes(this._banana)||this.addToScene()}}clearScene(e,n){super.clearScene(e,n),this.removeFromScene()}addToScene(){this._scene&&this._banana&&this._scene.add(this._banana)}removeFromScene(){this._scene&&this._banana&&this._scene.remove(this._banana)}}return n([t],e.prototype,"_staticItemLoader",void 0),e})())}}}));
2
- //# sourceMappingURL=banana-for-scale-381d58e8.nomodule.js.map
1
+ System.register(["./query-params-helper-c231e1b8.nomodule.js","./rapi-access-0e1335d5.nomodule.js","./main-thread-to-worker-4fc95d50.nomodule.js","./image-renderer-82f30e18.nomodule.js","./pixotron-d2d7595f.nomodule.js","./configurator-b4dc0536.nomodule.js","./mesh-generator-07dc613a.nomodule.js","./configurator-mesh-generator-d934ee1a.nomodule.js","./default-light-setting-b50c85b0.nomodule.js"],(function(e){var n,t,o,s;return{setters:[function(){},function(e){n=e._,t=e.i},function(e){o=e.g},function(){},function(){},function(e){s=e.S},function(){},function(){},function(){}],execute:function(){e("default",(()=>{class e extends s{setScene(e){this._scene=e,this._staticItemLoader.loadGLB(o()+"static/banana_div2-1351c98ec2986be1.glb").then(e=>{this._banana=e,this.updateBounds(null)})}updateBounds(e){if(e&&(this._bounds=e),this._bounds){if(this._banana){const e=this._bounds.getSize(new THREE.Vector3),n=this._bounds.getCenter(new THREE.Vector3).clone();n.x-=e.x/2+.18,n.z+=e.z/2+.05,n.y=0;let t=.03;this._banana.scale.copy(new THREE.Vector3(t,t,t)),this._banana.rotation.y=.6,this._banana.position.copy(n)}this._scene.children.includes(this._banana)||this.addToScene()}}clearScene(e,n){super.clearScene(e,n),this.removeFromScene()}addToScene(){this._scene&&this._banana&&this._scene.add(this._banana)}removeFromScene(){this._scene&&this._banana&&this._scene.remove(this._banana)}}return n([t],e.prototype,"_staticItemLoader",void 0),e})())}}}));
2
+ //# sourceMappingURL=banana-for-scale-ef10525e.nomodule.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"banana-for-scale-381d58e8.nomodule.js","sources":["../../packages/configurator-core/public/geometry/banana_div2.glb"],"sourcesContent":["export default \"static/banana_div2-1351c98ec2986be1.glb\""],"names":[],"mappings":"0rBAAe"}
1
+ {"version":3,"file":"banana-for-scale-ef10525e.nomodule.js","sources":["../../packages/configurator-core/public/geometry/banana_div2.glb"],"sourcesContent":["export default \"static/banana_div2-1351c98ec2986be1.glb\""],"names":[],"mappings":"0rBAAe"}
@@ -1,2 +1,2 @@
1
- import{_ as __decorate,i as inject}from"./rapi-access-589f9e14.js";import"./main-thread-to-worker-5447c1c5.js";const LINE_MATERIAL="component_dimensioning_line_material",PLANE_MATERIAL="component_dimensioning_plane_material",TEXT_MATERIAL="component_dimensioning_text_material";let ComponentDimensioning=(()=>{class e extends THREE.Object3D{constructor(e,i,t,n){super(),this._center=i.getCenter(new THREE.Vector3),this._size=i.getSize(new THREE.Vector3),this._origin=this._center.clone().sub(this._size.clone().multiplyScalar(.5)),this._dimensioning=e,this._level=this._dimensioning.maxLevel-this._dimensioning.level,this._font=t,this._cameraPosition=n,this._init()}_initMaterials(){this._cacheHolder.materialCache.has(LINE_MATERIAL)?this._lineMaterial=this._cacheHolder.materialCache.get(LINE_MATERIAL):(this._lineMaterial=new THREE.LineBasicMaterial({color:3618615}),this._cacheHolder.materialCache.set(LINE_MATERIAL,this._lineMaterial)),this._cacheHolder.materialCache.has(PLANE_MATERIAL)?this._planeMaterial=this._cacheHolder.materialCache.get(PLANE_MATERIAL):(this._planeMaterial=new THREE.MeshBasicMaterial({color:16777215,side:THREE.DoubleSide,opacity:.8,transparent:!0}),this._cacheHolder.materialCache.set(PLANE_MATERIAL,this._planeMaterial)),this._cacheHolder.materialCache.has(TEXT_MATERIAL)?this._textMaterial=this._cacheHolder.materialCache.get(TEXT_MATERIAL):(this._textMaterial=new THREE.MeshPhongMaterial({color:3618615}),this._cacheHolder.materialCache.set(TEXT_MATERIAL,this._textMaterial))}_init(){this._initMaterials();let e=new THREE.Geometry;this._line=new THREE.Line(e,this._lineMaterial),this._line.name="component dimension line "+this._dimensioning.type.value,this._text=new THREE.Mesh(e,this._textMaterial),this._text.name="component dimension text "+this._dimensioning.type.value,this._plane=new THREE.Mesh(e,this._planeMaterial),this._plane.name="component dimension plane "+this._dimensioning.type.value;let i,t=new THREE.Geometry,n=Math.round(Math.max(this._size.y,this._size.x,this._size.z)),s=Math.abs(this._dimensioning.to-this._dimensioning.from),o=.025+(n<4?0:.005*n);s<.3&&(o*=.5+s);let a={font:this._font,size:o,height:.001,curveSegments:2,bevelEnabled:!0,bevelThickness:.001,bevelSize:.001},h=this._dimensioning.label?this._dimensioning.label:this._unitFormatter.formatMMValueToUnitString(1e3*s),_=new THREE.TextGeometry(h,a);_.computeBoundingBox();let r=_.boundingBox.getSize(new THREE.Vector3).y;if(0===this._dimensioning.type.value&&(i=this._getXEdge(r),this._addXEdgeSideLines(r)),1===this._dimensioning.type.value&&(i=this._getYEdge(r),this._addYEdgeSideLines(r)),2===this._dimensioning.type.value&&(i=this._getZEdge(r),this._addZEdgeSideLines(r)),t.vertices.push(i.start,i.end),this._line.geometry.dispose(),this._line.geometry=t,this.add(this._line),this._text.geometry=_,0===this._dimensioning.type.value&&this._addText(i,_,new THREE.Quaternion,new THREE.Vector3(0,.04,0)),1===this._dimensioning.type.value){let e=new THREE.Quaternion,t=this._getXSign()>0?Math.PI/2:Math.PI/2*3;e.setFromAxisAngle(new THREE.Vector3(0,0,1),t),this._addText(i,_,e,new THREE.Vector3(.04,0,0))}if(2===this._dimensioning.type.value){let e=this._getXSign()>0?Math.PI/2:Math.PI/2*3,t=(new THREE.Quaternion).setFromAxisAngle(new THREE.Vector3(-1,0,0),Math.PI/2),n=(new THREE.Quaternion).setFromAxisAngle(new THREE.Vector3(0,0,1),e);this._addText(i,_,t.multiply(n),new THREE.Vector3(.04,0,0))}}_getXEdge(e){let i=this._size.y+.05+(.06+e)*this._level;const t=new THREE.Vector3(0,this._origin.y,this._origin.z);let n=t.clone().add(new THREE.Vector3(this._dimensioning.from,i,0)),s=t.clone().add(new THREE.Vector3(this._dimensioning.to,i,0));return new THREE.Line3(n,s)}_addXEdgeSideLines(e){let i=this._size.y+.05+(.06+e)*(this._level-.5),t=this._size.y+.05+(.06+e)*this._level;const n=new THREE.Vector3(0,this._origin.y,this._origin.z);let s=n.clone().add(new THREE.Vector3(this._dimensioning.from,i,0)),o=n.clone().add(new THREE.Vector3(this._dimensioning.from,t,0)),a=n.clone().add(new THREE.Vector3(this._dimensioning.to,i,0)),h=n.clone().add(new THREE.Vector3(this._dimensioning.to,t,0));this._addLine(s,o),this._addLine(a,h)}_getZEdge(e){let i=(this._getXSign()>0?this._size.x:0)+.05+(.06+e)*this._level;i*=this._getXSign();const t=new THREE.Vector3(this._origin.x,this._origin.y,0);let n=t.clone().add(new THREE.Vector3(i,0,this._dimensioning.from)),s=t.clone().add(new THREE.Vector3(i,0,this._dimensioning.to));return new THREE.Line3(n,s)}_addZEdgeSideLines(e){let i=this._getXSign()>0?this._size.x:0,t=i+.05+(.06+e)*(this._level-.5),n=i+.05+(.06+e)*this._level;t*=this._getXSign(),n*=this._getXSign();const s=new THREE.Vector3(this._origin.x,this._origin.y,0);let o=s.clone().add(new THREE.Vector3(t,0,this._dimensioning.from)),a=s.clone().add(new THREE.Vector3(n,0,this._dimensioning.from)),h=s.clone().add(new THREE.Vector3(t,0,this._dimensioning.to)),_=s.clone().add(new THREE.Vector3(n,0,this._dimensioning.to));this._addLine(o,a),this._addLine(h,_)}_getYEdge(e){let i=(this._getXSign()>0?this._size.x:0)+.05+(.06+e)*this._level;i*=this._getXSign();const t=new THREE.Vector3(this._origin.x,0,this._origin.z);let n=t.clone().add(new THREE.Vector3(i,this._dimensioning.from,0)),s=t.clone().add(new THREE.Vector3(i,this._dimensioning.to,0));return new THREE.Line3(n,s)}_addYEdgeSideLines(e){let i=this._getXSign()>0?this._size.x:0,t=i+.05+(.06+e)*(this._level-.5),n=i+.05+(.06+e)*this._level;t*=this._getXSign(),n*=this._getXSign();const s=new THREE.Vector3(this._origin.x,0,this._origin.z);let o=s.clone().add(new THREE.Vector3(t,this._dimensioning.from,0)),a=s.clone().add(new THREE.Vector3(n,this._dimensioning.from,0)),h=s.clone().add(new THREE.Vector3(t,this._dimensioning.to,0)),_=s.clone().add(new THREE.Vector3(n,this._dimensioning.to,0));this._addLine(o,a),this._addLine(h,_)}_addLine(e,i){let t=new THREE.Geometry;t.vertices.push(e,i),this.add(new THREE.Line(t,this._lineMaterial))}_addText(e,i,t,n){let s=e.getCenter(new THREE.Vector3);n.x*=this._getXSign(),s.add(n);let o=i.boundingBox.getSize(new THREE.Vector3);i.center(),this._text.position.copy(s),this._text.quaternion.copy(t),this.add(this._text);let a=new THREE.PlaneGeometry(o.x+.02,o.y+.02,32);a.center(),this._plane.geometry=a,this._plane.position.copy(s),this._plane.quaternion.copy(t),this.add(this._plane)}_getXSign(){return this._cameraPosition.x>=0?1:-1}}return __decorate([inject],e.prototype,"_cacheHolder",void 0),__decorate([inject],e.prototype,"_unitFormatter",void 0),e})();export default ComponentDimensioning;
2
- //# sourceMappingURL=component-dimensioning-c8c82bac.js.map
1
+ import{_ as __decorate,i as inject}from"./rapi-access-35c9b031.js";import"./main-thread-to-worker-5447c1c5.js";const LINE_MATERIAL="component_dimensioning_line_material",PLANE_MATERIAL="component_dimensioning_plane_material",TEXT_MATERIAL="component_dimensioning_text_material";let ComponentDimensioning=(()=>{class e extends THREE.Object3D{constructor(e,i,t,n){super(),this._center=i.getCenter(new THREE.Vector3),this._size=i.getSize(new THREE.Vector3),this._origin=this._center.clone().sub(this._size.clone().multiplyScalar(.5)),this._dimensioning=e,this._level=this._dimensioning.maxLevel-this._dimensioning.level,this._font=t,this._cameraPosition=n,this._init()}_initMaterials(){this._cacheHolder.materialCache.has(LINE_MATERIAL)?this._lineMaterial=this._cacheHolder.materialCache.get(LINE_MATERIAL):(this._lineMaterial=new THREE.LineBasicMaterial({color:3618615}),this._cacheHolder.materialCache.set(LINE_MATERIAL,this._lineMaterial)),this._cacheHolder.materialCache.has(PLANE_MATERIAL)?this._planeMaterial=this._cacheHolder.materialCache.get(PLANE_MATERIAL):(this._planeMaterial=new THREE.MeshBasicMaterial({color:16777215,side:THREE.DoubleSide,opacity:.8,transparent:!0}),this._cacheHolder.materialCache.set(PLANE_MATERIAL,this._planeMaterial)),this._cacheHolder.materialCache.has(TEXT_MATERIAL)?this._textMaterial=this._cacheHolder.materialCache.get(TEXT_MATERIAL):(this._textMaterial=new THREE.MeshPhongMaterial({color:3618615}),this._cacheHolder.materialCache.set(TEXT_MATERIAL,this._textMaterial))}_init(){this._initMaterials();let e=new THREE.Geometry;this._line=new THREE.Line(e,this._lineMaterial),this._line.name="component dimension line "+this._dimensioning.type.value,this._text=new THREE.Mesh(e,this._textMaterial),this._text.name="component dimension text "+this._dimensioning.type.value,this._plane=new THREE.Mesh(e,this._planeMaterial),this._plane.name="component dimension plane "+this._dimensioning.type.value;let i,t=new THREE.Geometry,n=Math.round(Math.max(this._size.y,this._size.x,this._size.z)),s=Math.abs(this._dimensioning.to-this._dimensioning.from),o=.025+(n<4?0:.005*n);s<.3&&(o*=.5+s);let a={font:this._font,size:o,height:.001,curveSegments:2,bevelEnabled:!0,bevelThickness:.001,bevelSize:.001},h=this._dimensioning.label?this._dimensioning.label:this._unitFormatter.formatMMValueToUnitString(1e3*s),_=new THREE.TextGeometry(h,a);_.computeBoundingBox();let r=_.boundingBox.getSize(new THREE.Vector3).y;if(0===this._dimensioning.type.value&&(i=this._getXEdge(r),this._addXEdgeSideLines(r)),1===this._dimensioning.type.value&&(i=this._getYEdge(r),this._addYEdgeSideLines(r)),2===this._dimensioning.type.value&&(i=this._getZEdge(r),this._addZEdgeSideLines(r)),t.vertices.push(i.start,i.end),this._line.geometry.dispose(),this._line.geometry=t,this.add(this._line),this._text.geometry=_,0===this._dimensioning.type.value&&this._addText(i,_,new THREE.Quaternion,new THREE.Vector3(0,.04,0)),1===this._dimensioning.type.value){let e=new THREE.Quaternion,t=this._getXSign()>0?Math.PI/2:Math.PI/2*3;e.setFromAxisAngle(new THREE.Vector3(0,0,1),t),this._addText(i,_,e,new THREE.Vector3(.04,0,0))}if(2===this._dimensioning.type.value){let e=this._getXSign()>0?Math.PI/2:Math.PI/2*3,t=(new THREE.Quaternion).setFromAxisAngle(new THREE.Vector3(-1,0,0),Math.PI/2),n=(new THREE.Quaternion).setFromAxisAngle(new THREE.Vector3(0,0,1),e);this._addText(i,_,t.multiply(n),new THREE.Vector3(.04,0,0))}}_getXEdge(e){let i=this._size.y+.05+(.06+e)*this._level;const t=new THREE.Vector3(0,this._origin.y,this._origin.z);let n=t.clone().add(new THREE.Vector3(this._dimensioning.from,i,0)),s=t.clone().add(new THREE.Vector3(this._dimensioning.to,i,0));return new THREE.Line3(n,s)}_addXEdgeSideLines(e){let i=this._size.y+.05+(.06+e)*(this._level-.5),t=this._size.y+.05+(.06+e)*this._level;const n=new THREE.Vector3(0,this._origin.y,this._origin.z);let s=n.clone().add(new THREE.Vector3(this._dimensioning.from,i,0)),o=n.clone().add(new THREE.Vector3(this._dimensioning.from,t,0)),a=n.clone().add(new THREE.Vector3(this._dimensioning.to,i,0)),h=n.clone().add(new THREE.Vector3(this._dimensioning.to,t,0));this._addLine(s,o),this._addLine(a,h)}_getZEdge(e){let i=(this._getXSign()>0?this._size.x:0)+.05+(.06+e)*this._level;i*=this._getXSign();const t=new THREE.Vector3(this._origin.x,this._origin.y,0);let n=t.clone().add(new THREE.Vector3(i,0,this._dimensioning.from)),s=t.clone().add(new THREE.Vector3(i,0,this._dimensioning.to));return new THREE.Line3(n,s)}_addZEdgeSideLines(e){let i=this._getXSign()>0?this._size.x:0,t=i+.05+(.06+e)*(this._level-.5),n=i+.05+(.06+e)*this._level;t*=this._getXSign(),n*=this._getXSign();const s=new THREE.Vector3(this._origin.x,this._origin.y,0);let o=s.clone().add(new THREE.Vector3(t,0,this._dimensioning.from)),a=s.clone().add(new THREE.Vector3(n,0,this._dimensioning.from)),h=s.clone().add(new THREE.Vector3(t,0,this._dimensioning.to)),_=s.clone().add(new THREE.Vector3(n,0,this._dimensioning.to));this._addLine(o,a),this._addLine(h,_)}_getYEdge(e){let i=(this._getXSign()>0?this._size.x:0)+.05+(.06+e)*this._level;i*=this._getXSign();const t=new THREE.Vector3(this._origin.x,0,this._origin.z);let n=t.clone().add(new THREE.Vector3(i,this._dimensioning.from,0)),s=t.clone().add(new THREE.Vector3(i,this._dimensioning.to,0));return new THREE.Line3(n,s)}_addYEdgeSideLines(e){let i=this._getXSign()>0?this._size.x:0,t=i+.05+(.06+e)*(this._level-.5),n=i+.05+(.06+e)*this._level;t*=this._getXSign(),n*=this._getXSign();const s=new THREE.Vector3(this._origin.x,0,this._origin.z);let o=s.clone().add(new THREE.Vector3(t,this._dimensioning.from,0)),a=s.clone().add(new THREE.Vector3(n,this._dimensioning.from,0)),h=s.clone().add(new THREE.Vector3(t,this._dimensioning.to,0)),_=s.clone().add(new THREE.Vector3(n,this._dimensioning.to,0));this._addLine(o,a),this._addLine(h,_)}_addLine(e,i){let t=new THREE.Geometry;t.vertices.push(e,i),this.add(new THREE.Line(t,this._lineMaterial))}_addText(e,i,t,n){let s=e.getCenter(new THREE.Vector3);n.x*=this._getXSign(),s.add(n);let o=i.boundingBox.getSize(new THREE.Vector3);i.center(),this._text.position.copy(s),this._text.quaternion.copy(t),this.add(this._text);let a=new THREE.PlaneGeometry(o.x+.02,o.y+.02,32);a.center(),this._plane.geometry=a,this._plane.position.copy(s),this._plane.quaternion.copy(t),this.add(this._plane)}_getXSign(){return this._cameraPosition.x>=0?1:-1}}return __decorate([inject],e.prototype,"_cacheHolder",void 0),__decorate([inject],e.prototype,"_unitFormatter",void 0),e})();export default ComponentDimensioning;
2
+ //# sourceMappingURL=component-dimensioning-531ea19d.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component-dimensioning-531ea19d.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +1,2 @@
1
- System.register(["./rapi-access-f2371d51.nomodule.js","./main-thread-to-worker-4fc95d50.nomodule.js"],(function(e){var i,t;return{setters:[function(e){i=e._,t=e.i},function(){}],execute:function(){const n="component_dimensioning_line_material",s="component_dimensioning_plane_material",o="component_dimensioning_text_material";e("default",(()=>{class e extends THREE.Object3D{constructor(e,i,t,n){super(),this._center=i.getCenter(new THREE.Vector3),this._size=i.getSize(new THREE.Vector3),this._origin=this._center.clone().sub(this._size.clone().multiplyScalar(.5)),this._dimensioning=e,this._level=this._dimensioning.maxLevel-this._dimensioning.level,this._font=t,this._cameraPosition=n,this._init()}_initMaterials(){this._cacheHolder.materialCache.has(n)?this._lineMaterial=this._cacheHolder.materialCache.get(n):(this._lineMaterial=new THREE.LineBasicMaterial({color:3618615}),this._cacheHolder.materialCache.set(n,this._lineMaterial)),this._cacheHolder.materialCache.has(s)?this._planeMaterial=this._cacheHolder.materialCache.get(s):(this._planeMaterial=new THREE.MeshBasicMaterial({color:16777215,side:THREE.DoubleSide,opacity:.8,transparent:!0}),this._cacheHolder.materialCache.set(s,this._planeMaterial)),this._cacheHolder.materialCache.has(o)?this._textMaterial=this._cacheHolder.materialCache.get(o):(this._textMaterial=new THREE.MeshPhongMaterial({color:3618615}),this._cacheHolder.materialCache.set(o,this._textMaterial))}_init(){this._initMaterials();let e=new THREE.Geometry;this._line=new THREE.Line(e,this._lineMaterial),this._line.name="component dimension line "+this._dimensioning.type.value,this._text=new THREE.Mesh(e,this._textMaterial),this._text.name="component dimension text "+this._dimensioning.type.value,this._plane=new THREE.Mesh(e,this._planeMaterial),this._plane.name="component dimension plane "+this._dimensioning.type.value;let i,t=new THREE.Geometry,n=Math.round(Math.max(this._size.y,this._size.x,this._size.z)),s=Math.abs(this._dimensioning.to-this._dimensioning.from),o=.025+(n<4?0:.005*n);s<.3&&(o*=.5+s);let a={font:this._font,size:o,height:.001,curveSegments:2,bevelEnabled:!0,bevelThickness:.001,bevelSize:.001},h=this._dimensioning.label?this._dimensioning.label:this._unitFormatter.formatMMValueToUnitString(1e3*s),_=new THREE.TextGeometry(h,a);_.computeBoundingBox();let d=_.boundingBox.getSize(new THREE.Vector3).y;if(0===this._dimensioning.type.value&&(i=this._getXEdge(d),this._addXEdgeSideLines(d)),1===this._dimensioning.type.value&&(i=this._getYEdge(d),this._addYEdgeSideLines(d)),2===this._dimensioning.type.value&&(i=this._getZEdge(d),this._addZEdgeSideLines(d)),t.vertices.push(i.start,i.end),this._line.geometry.dispose(),this._line.geometry=t,this.add(this._line),this._text.geometry=_,0===this._dimensioning.type.value&&this._addText(i,_,new THREE.Quaternion,new THREE.Vector3(0,.04,0)),1===this._dimensioning.type.value){let e=new THREE.Quaternion,t=this._getXSign()>0?Math.PI/2:Math.PI/2*3;e.setFromAxisAngle(new THREE.Vector3(0,0,1),t),this._addText(i,_,e,new THREE.Vector3(.04,0,0))}if(2===this._dimensioning.type.value){let e=this._getXSign()>0?Math.PI/2:Math.PI/2*3,t=(new THREE.Quaternion).setFromAxisAngle(new THREE.Vector3(-1,0,0),Math.PI/2),n=(new THREE.Quaternion).setFromAxisAngle(new THREE.Vector3(0,0,1),e);this._addText(i,_,t.multiply(n),new THREE.Vector3(.04,0,0))}}_getXEdge(e){let i=this._size.y+.05+(.06+e)*this._level;const t=new THREE.Vector3(0,this._origin.y,this._origin.z);let n=t.clone().add(new THREE.Vector3(this._dimensioning.from,i,0)),s=t.clone().add(new THREE.Vector3(this._dimensioning.to,i,0));return new THREE.Line3(n,s)}_addXEdgeSideLines(e){let i=this._size.y+.05+(.06+e)*(this._level-.5),t=this._size.y+.05+(.06+e)*this._level;const n=new THREE.Vector3(0,this._origin.y,this._origin.z);let s=n.clone().add(new THREE.Vector3(this._dimensioning.from,i,0)),o=n.clone().add(new THREE.Vector3(this._dimensioning.from,t,0)),a=n.clone().add(new THREE.Vector3(this._dimensioning.to,i,0)),h=n.clone().add(new THREE.Vector3(this._dimensioning.to,t,0));this._addLine(s,o),this._addLine(a,h)}_getZEdge(e){let i=(this._getXSign()>0?this._size.x:0)+.05+(.06+e)*this._level;i*=this._getXSign();const t=new THREE.Vector3(this._origin.x,this._origin.y,0);let n=t.clone().add(new THREE.Vector3(i,0,this._dimensioning.from)),s=t.clone().add(new THREE.Vector3(i,0,this._dimensioning.to));return new THREE.Line3(n,s)}_addZEdgeSideLines(e){let i=this._getXSign()>0?this._size.x:0,t=i+.05+(.06+e)*(this._level-.5),n=i+.05+(.06+e)*this._level;t*=this._getXSign(),n*=this._getXSign();const s=new THREE.Vector3(this._origin.x,this._origin.y,0);let o=s.clone().add(new THREE.Vector3(t,0,this._dimensioning.from)),a=s.clone().add(new THREE.Vector3(n,0,this._dimensioning.from)),h=s.clone().add(new THREE.Vector3(t,0,this._dimensioning.to)),_=s.clone().add(new THREE.Vector3(n,0,this._dimensioning.to));this._addLine(o,a),this._addLine(h,_)}_getYEdge(e){let i=(this._getXSign()>0?this._size.x:0)+.05+(.06+e)*this._level;i*=this._getXSign();const t=new THREE.Vector3(this._origin.x,0,this._origin.z);let n=t.clone().add(new THREE.Vector3(i,this._dimensioning.from,0)),s=t.clone().add(new THREE.Vector3(i,this._dimensioning.to,0));return new THREE.Line3(n,s)}_addYEdgeSideLines(e){let i=this._getXSign()>0?this._size.x:0,t=i+.05+(.06+e)*(this._level-.5),n=i+.05+(.06+e)*this._level;t*=this._getXSign(),n*=this._getXSign();const s=new THREE.Vector3(this._origin.x,0,this._origin.z);let o=s.clone().add(new THREE.Vector3(t,this._dimensioning.from,0)),a=s.clone().add(new THREE.Vector3(n,this._dimensioning.from,0)),h=s.clone().add(new THREE.Vector3(t,this._dimensioning.to,0)),_=s.clone().add(new THREE.Vector3(n,this._dimensioning.to,0));this._addLine(o,a),this._addLine(h,_)}_addLine(e,i){let t=new THREE.Geometry;t.vertices.push(e,i),this.add(new THREE.Line(t,this._lineMaterial))}_addText(e,i,t,n){let s=e.getCenter(new THREE.Vector3);n.x*=this._getXSign(),s.add(n);let o=i.boundingBox.getSize(new THREE.Vector3);i.center(),this._text.position.copy(s),this._text.quaternion.copy(t),this.add(this._text);let a=new THREE.PlaneGeometry(o.x+.02,o.y+.02,32);a.center(),this._plane.geometry=a,this._plane.position.copy(s),this._plane.quaternion.copy(t),this.add(this._plane)}_getXSign(){return this._cameraPosition.x>=0?1:-1}}return i([t],e.prototype,"_cacheHolder",void 0),i([t],e.prototype,"_unitFormatter",void 0),e})())}}}));
2
- //# sourceMappingURL=component-dimensioning-4d04c85d.nomodule.js.map
1
+ System.register(["./rapi-access-0e1335d5.nomodule.js","./main-thread-to-worker-4fc95d50.nomodule.js"],(function(e){var i,t;return{setters:[function(e){i=e._,t=e.i},function(){}],execute:function(){const n="component_dimensioning_line_material",s="component_dimensioning_plane_material",o="component_dimensioning_text_material";e("default",(()=>{class e extends THREE.Object3D{constructor(e,i,t,n){super(),this._center=i.getCenter(new THREE.Vector3),this._size=i.getSize(new THREE.Vector3),this._origin=this._center.clone().sub(this._size.clone().multiplyScalar(.5)),this._dimensioning=e,this._level=this._dimensioning.maxLevel-this._dimensioning.level,this._font=t,this._cameraPosition=n,this._init()}_initMaterials(){this._cacheHolder.materialCache.has(n)?this._lineMaterial=this._cacheHolder.materialCache.get(n):(this._lineMaterial=new THREE.LineBasicMaterial({color:3618615}),this._cacheHolder.materialCache.set(n,this._lineMaterial)),this._cacheHolder.materialCache.has(s)?this._planeMaterial=this._cacheHolder.materialCache.get(s):(this._planeMaterial=new THREE.MeshBasicMaterial({color:16777215,side:THREE.DoubleSide,opacity:.8,transparent:!0}),this._cacheHolder.materialCache.set(s,this._planeMaterial)),this._cacheHolder.materialCache.has(o)?this._textMaterial=this._cacheHolder.materialCache.get(o):(this._textMaterial=new THREE.MeshPhongMaterial({color:3618615}),this._cacheHolder.materialCache.set(o,this._textMaterial))}_init(){this._initMaterials();let e=new THREE.Geometry;this._line=new THREE.Line(e,this._lineMaterial),this._line.name="component dimension line "+this._dimensioning.type.value,this._text=new THREE.Mesh(e,this._textMaterial),this._text.name="component dimension text "+this._dimensioning.type.value,this._plane=new THREE.Mesh(e,this._planeMaterial),this._plane.name="component dimension plane "+this._dimensioning.type.value;let i,t=new THREE.Geometry,n=Math.round(Math.max(this._size.y,this._size.x,this._size.z)),s=Math.abs(this._dimensioning.to-this._dimensioning.from),o=.025+(n<4?0:.005*n);s<.3&&(o*=.5+s);let a={font:this._font,size:o,height:.001,curveSegments:2,bevelEnabled:!0,bevelThickness:.001,bevelSize:.001},h=this._dimensioning.label?this._dimensioning.label:this._unitFormatter.formatMMValueToUnitString(1e3*s),_=new THREE.TextGeometry(h,a);_.computeBoundingBox();let d=_.boundingBox.getSize(new THREE.Vector3).y;if(0===this._dimensioning.type.value&&(i=this._getXEdge(d),this._addXEdgeSideLines(d)),1===this._dimensioning.type.value&&(i=this._getYEdge(d),this._addYEdgeSideLines(d)),2===this._dimensioning.type.value&&(i=this._getZEdge(d),this._addZEdgeSideLines(d)),t.vertices.push(i.start,i.end),this._line.geometry.dispose(),this._line.geometry=t,this.add(this._line),this._text.geometry=_,0===this._dimensioning.type.value&&this._addText(i,_,new THREE.Quaternion,new THREE.Vector3(0,.04,0)),1===this._dimensioning.type.value){let e=new THREE.Quaternion,t=this._getXSign()>0?Math.PI/2:Math.PI/2*3;e.setFromAxisAngle(new THREE.Vector3(0,0,1),t),this._addText(i,_,e,new THREE.Vector3(.04,0,0))}if(2===this._dimensioning.type.value){let e=this._getXSign()>0?Math.PI/2:Math.PI/2*3,t=(new THREE.Quaternion).setFromAxisAngle(new THREE.Vector3(-1,0,0),Math.PI/2),n=(new THREE.Quaternion).setFromAxisAngle(new THREE.Vector3(0,0,1),e);this._addText(i,_,t.multiply(n),new THREE.Vector3(.04,0,0))}}_getXEdge(e){let i=this._size.y+.05+(.06+e)*this._level;const t=new THREE.Vector3(0,this._origin.y,this._origin.z);let n=t.clone().add(new THREE.Vector3(this._dimensioning.from,i,0)),s=t.clone().add(new THREE.Vector3(this._dimensioning.to,i,0));return new THREE.Line3(n,s)}_addXEdgeSideLines(e){let i=this._size.y+.05+(.06+e)*(this._level-.5),t=this._size.y+.05+(.06+e)*this._level;const n=new THREE.Vector3(0,this._origin.y,this._origin.z);let s=n.clone().add(new THREE.Vector3(this._dimensioning.from,i,0)),o=n.clone().add(new THREE.Vector3(this._dimensioning.from,t,0)),a=n.clone().add(new THREE.Vector3(this._dimensioning.to,i,0)),h=n.clone().add(new THREE.Vector3(this._dimensioning.to,t,0));this._addLine(s,o),this._addLine(a,h)}_getZEdge(e){let i=(this._getXSign()>0?this._size.x:0)+.05+(.06+e)*this._level;i*=this._getXSign();const t=new THREE.Vector3(this._origin.x,this._origin.y,0);let n=t.clone().add(new THREE.Vector3(i,0,this._dimensioning.from)),s=t.clone().add(new THREE.Vector3(i,0,this._dimensioning.to));return new THREE.Line3(n,s)}_addZEdgeSideLines(e){let i=this._getXSign()>0?this._size.x:0,t=i+.05+(.06+e)*(this._level-.5),n=i+.05+(.06+e)*this._level;t*=this._getXSign(),n*=this._getXSign();const s=new THREE.Vector3(this._origin.x,this._origin.y,0);let o=s.clone().add(new THREE.Vector3(t,0,this._dimensioning.from)),a=s.clone().add(new THREE.Vector3(n,0,this._dimensioning.from)),h=s.clone().add(new THREE.Vector3(t,0,this._dimensioning.to)),_=s.clone().add(new THREE.Vector3(n,0,this._dimensioning.to));this._addLine(o,a),this._addLine(h,_)}_getYEdge(e){let i=(this._getXSign()>0?this._size.x:0)+.05+(.06+e)*this._level;i*=this._getXSign();const t=new THREE.Vector3(this._origin.x,0,this._origin.z);let n=t.clone().add(new THREE.Vector3(i,this._dimensioning.from,0)),s=t.clone().add(new THREE.Vector3(i,this._dimensioning.to,0));return new THREE.Line3(n,s)}_addYEdgeSideLines(e){let i=this._getXSign()>0?this._size.x:0,t=i+.05+(.06+e)*(this._level-.5),n=i+.05+(.06+e)*this._level;t*=this._getXSign(),n*=this._getXSign();const s=new THREE.Vector3(this._origin.x,0,this._origin.z);let o=s.clone().add(new THREE.Vector3(t,this._dimensioning.from,0)),a=s.clone().add(new THREE.Vector3(n,this._dimensioning.from,0)),h=s.clone().add(new THREE.Vector3(t,this._dimensioning.to,0)),_=s.clone().add(new THREE.Vector3(n,this._dimensioning.to,0));this._addLine(o,a),this._addLine(h,_)}_addLine(e,i){let t=new THREE.Geometry;t.vertices.push(e,i),this.add(new THREE.Line(t,this._lineMaterial))}_addText(e,i,t,n){let s=e.getCenter(new THREE.Vector3);n.x*=this._getXSign(),s.add(n);let o=i.boundingBox.getSize(new THREE.Vector3);i.center(),this._text.position.copy(s),this._text.quaternion.copy(t),this.add(this._text);let a=new THREE.PlaneGeometry(o.x+.02,o.y+.02,32);a.center(),this._plane.geometry=a,this._plane.position.copy(s),this._plane.quaternion.copy(t),this.add(this._plane)}_getXSign(){return this._cameraPosition.x>=0?1:-1}}return i([t],e.prototype,"_cacheHolder",void 0),i([t],e.prototype,"_unitFormatter",void 0),e})())}}}));
2
+ //# sourceMappingURL=component-dimensioning-90a64e1e.nomodule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component-dimensioning-90a64e1e.nomodule.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ System.register(["./rapi-access-0e1335d5.nomodule.js","./main-thread-to-worker-4fc95d50.nomodule.js","./image-renderer-82f30e18.nomodule.js","./pixotron-d2d7595f.nomodule.js","./mesh-generator-07dc613a.nomodule.js","./configurator-mesh-generator-d934ee1a.nomodule.js","./default-light-setting-b50c85b0.nomodule.js"],(function(e,t){var n,i,s,o,r,a,l,h,c,d,_,u,p,m,g,f,C,v,y,b,w,E,S,P,I,k,H,R,M,D,x,A,O,T,L,U,V,B,F,j,G,z,q,K,W,N,Q,J,X,Y,$,Z,ee,te,ne,ie,se,oe,re,ae,le,he,ce,de,_e,ue;return{setters:[function(e){n=e._,i=e.i,s=e.C,o=e.B,r=e.A,a=e.a,l=e.D,h=e.b,c=e.k,d=e.E,_=e.c,u=e.M,p=e.G,m=e.g,g=e.d,f=e.R,C=e.e,v=e.t,y=e.f,b=e.P,w=e.h,E=e.j,S=e.l,P=e.m,I=e.n,k=e.L,H=e.o,R=e.p,M=e.q,D=e.r,x=e.s},function(e){A=e.o,O=e.g,T=e.s,L=e.i,U=e.r,V=e.t},function(e){B=e.S,F=e.p,j=e.a,G=e.r,z=e.g,q=e.b,K=e.G,W=e.C},function(e){N=e.E,Q=e.I,J=e.C,X=e.D,Y=e.B,$=e.a,Z=e.F,ee=e.G,te=e.P,ne=e.b,ie=e.c,se=e.S,oe=e.d,re=e.e,ae=e.T,le=e.f,he=e.g,ce=e.M},function(e){de=e.P},function(e){_e=e.C},function(e){ue=e.D}],execute:function(){const pe=function(e){return e.validRange&&"string"==typeof e.validRange.type},me=function(e){return e.validValues&&e.validValues.length>0},ge=function(e){return"length"===e.unitType||"area"===e.unitType},fe=function(e){return"Material"===e.type};let Ce={InchFeet:null,MM:null,CM:null},ve={NoUnitString:null,LongUnitString:null,ShortUnitString:null},ye=(()=>{class e{constructor(e){this._formatter=null,this._precision=0,this._creator_=e}init(e){const t=new e.UnitMeasureFormatter;Ce=e.Unit,ve=e.UnitStringType,this._initActualUnit(),this._initActualUnitStringType();const{precisionCm:n,precisionInch:i}=this._initData;this._actualUnit===Ce.InchFeet?this._precision=void 0!==i?parseInt(i,10):2:this._actualUnit===Ce.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=Ce.CM;break;case"mm":this._actualUnit=Ce.MM;break;case"inchfeet":this._actualUnit=Ce.InchFeet;break;default:this._actualUnit=Ce.CM}}_initActualUnitStringType(){const{unitStringType:e}=this._initData;switch(e){case"none":this._actualUnitStringType=ve.NoUnitString;break;case"long":this._actualUnitStringType=ve.LongUnitString;break;case"short":this._actualUnitStringType=ve.ShortUnitString;break;default:this._actualUnitStringType=ve.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){ge(e)&&(e.valueLabel=this._formatParameterValue(e.value,e.unitType))}formatParameter(e){if(ge(e)&&Array.isArray(e.validValues)&&e.validValues.forEach(({value:t},n)=>{e.validValues[n].label=this._formatParameterValue(t,e.unitType)}),e.valueLabel=this._formatParameterValue(e.value,e.unitType),fe(e))e.uiType="Material";else if(function(e){return"Boolean"===e.type}(e))e.uiType="Boolean";else if(pe(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 me(e)?(e.uiType="Options",function(e){return!!me(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===Ce.InchFeet}getPrecision(){return this._precision}getAllowedDelta(){const e=1/Math.pow(10,this._precision);return this.isInch()?25.4*e:e}}return n([i],e.prototype,"_initData",void 0),e})();const be=["material"];let we=(()=>{class e extends s{constructor(e){super(e,1),this.externalMeshQueue=new de,this.muteKernelCallbacks=!1,this.listOfVariants=(e,t)=>{},o.addMeta("kernel_is_ready",{isWasm:this._useWASM}),r.kernelInstance?(this._kernelContainer=r.kernelContainer,setTimeout(()=>this._loadSuccess(),0)):this._scriptLoader.fetch(this._kernelPath,{id:"kernel"}).then(this._loadSuccess.bind(this),this._loadError.bind(this))}_loadSuccess(){o.start("kernel_is_ready"),r.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);a.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),a.finishOperation(3,[s,i])}webGlPreviewDockings(e,t){a.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(l,e.lastPossibleChild.id,e.lastPossibleChild.configuration)),e.lastPossibleChild&&e.lastPossibleChild.isItem&&this._kernelInstance.loadFreeFlyingConfiguration(l,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(h,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===be.indexOf(e)?setTimeout(()=>t(),0):this._configuratorKernelCallbackListener.forEach(e=>e.finishParameterChange(t,n))}requestDeleteComponents(e){e&&this._kernelInstance.deletePlanComponents(this._utilityToLongArray(e))}_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=c(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=A(n,"priceId");let r=0;return t.fullList.forEach(e=>{const t=c(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})}loadComponentIntoKernel(e,t){this._kernelIo.setMeta({componentId:t}),this._kernelInstance.loadComponentDefinition(10,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=c(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}}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))}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),fe(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}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(),o.end("kernel_is_ready"),o.start("kernel_create_instance"),r.kernelInstance?this._kernelInstance=r.kernelInstance:this._kernelInstance=new this._kernelContainer.Kernel,this._kernelContainer.registerConfiguratorCallback(this),o.end("kernel_create_instance");const{overrideCountry:e,locale:t}=this._globalInitData;e&&(this._kernelInstance.resetPriceListIds(),this._kernelInstance.addPriceList(e)),d.isProduction||(window.__RML__DEBUG__.Kernel=this._kernelInstance,window.__RML__DEBUG__.KernelContainer=this._kernelContainer,window.__RML__DEBUG__.Helper={convertCObject:_}),this._kernelInstance.setEnvironmentVariable("language",t),this._unitFormatter.init(this._kernelContainer),this._configuratorKernelAccessCallback.isReady(),this._configuratorUiCallbacks.onConfiguratorKernelIsReady(this._kernelContainer,this._kernelInstance),r.planObjectId&&this.planObjectCreated(-1,r.planObjectId),this._kernelInstance.useEnvironmentGeometry(!0)}onLoadComponentError(e,t){this._configuratorUiCallbacks.onComponentLoadError(e,t)}configurationLoaded(e,t,n,i,s){a.finishOperation(4,{conversationId:e,objectId:t,componentId:n,hash:i,errors:_(s)}),this._configuratorKernelCallbackListener.forEach(o=>o.configurationLoaded(e,t,n,i,s))}componentDefinitionLoaded(e,t){a.finishOperation(0,t)}componentDefinitionLoadingError(e,t){this._kernelIo.error(t),a.failOperation(0,new Error(t))}configurationLoadingError(e,t){let n="Configuration loading error";if(t){const e=_(t);Array.isArray(e)&&(n=e.join("\n"),e.forEach(e=>this._kernelIo.error(e)))}a.failOperation(4,new Error(n)),a.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,u,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))}Editor3dGeometryNotReady(e){this._configuratorKernelCallbackListener.forEach(t=>t.Editor3dGeometryNotReady(e))}Editor3dPlanObjectConstructionDone(e){return this._configuratorKernelCallbackListener.forEach(t=>t.Editor3dPlanObjectConstructionDone(e)),this.updatePlanObjectDependencies(e),this._updateConfigurationHasChildren(e),o.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)}}return n([i],e.prototype,"_unitFormatter",void 0),n([i],e.prototype,"_memoryManager",void 0),n([i],e.prototype,"_configuratorKernelAccessCallback",void 0),n([i],e.prototype,"_configuratorContext",void 0),n([i],e.prototype,"_initData",void 0),n([i],e.prototype,"_globalInitData",void 0),n([i],e.prototype,"_configuratorHistory",void 0),e})();class Ee{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 Se=new Map,Pe=new Map;class Ie{static loadFont(e){if(Pe.has(e))return new Promise(t=>{t(Pe.get(e))});if(Se.has(e))return new Promise((t,n)=>{Se.get(e).push({resolve:t,reject:n})});let t=new THREE.FontLoader;return new Promise((n,i)=>{Se.set(e,[{resolve:n,reject:i}]),t.load(O()+e,t=>{Pe.set(e,t),Ie._resolveAll(e,t)})})}static _resolveAll(e,t){Se.has(e)&&Se.get(e).forEach(e=>e.resolve(t)),Se.delete(e)}}e("A",Ie);var ke=e("R","static/rubik_regular_sub-eb3f3b61078695cc.json");let He=(()=>{class e{constructor(e,t){this._addOnSpotIcons=new Map,this.previewGhostEnabled=!1,this.addOnSpotsEnabled=!1,this._state=3,this._camera=e,this._textMaterial=new THREE.MeshStandardMaterial({color:8947848});let n=new THREE.Geometry;this._plusText=new THREE.Mesh(n,this._textMaterial),this._plusText.layers.set(4),Ie.loadFont(ke).then(e=>{this._font=e;let t={font:this._font,size:.05,height:.001,curveSegments:2,bevelEnabled:!0,bevelThickness:.001,bevelSize:.001};this._plusTextGeometry=new THREE.TextGeometry("+",t),this._plusTextGeometry.computeBoundingBox(),this._plusText.geometry=this._plusTextGeometry}),this._plusButtonPromise=new Promise((e,n)=>{t.fetch(p,{id:"gltf-loader-js"}).then(()=>{(new THREE.GLTFLoader).load(O()+"static/AddButtonRound-8004fa7dffdf7501.glb",t=>{t&&t.scene&&t.scene.children&&t.scene.children.length>0?(this._onPlusButtonLoaded(t.scene.children[0]),e()):n("loaded scene has no childrens")},e=>{},e=>{console.error(e),n(e)})})})}_onPlusButtonLoaded(e){e&&(this._plusButton=e,this._plusButton.material=this._textMaterial,this._plusButton.layers.set(4),this._plusButton.scale.copy(new THREE.Vector3(.08,.08,.08)))}_performUpdate(e){if(this.addOnSpotsEnabled)for(let e of this._addOnSpotIcons.values())e.forEach(e=>{e.geometry.center();let t=new THREE.Vector3(0,1,0);t.applyQuaternion(this._camera.quaternion),e.up.copy(t),e.lookAt(this._camera.position)})}addAddOnSpots(e,t){Promise.all([this._plusButtonPromise]).then(()=>{this.addOnSpotsEnabled&&this._plusButton&&(this.deleteAddonPointsForComponent(e.roomleId),t.forEach(t=>{const n=this._plusButton.clone();n.name="addOnSpot "+e.roomleId,n.layers.set(8),n.position.copy(this.getPositionForAddOnPosition(new THREE.Vector3(t.position.x,t.position.y,t.position.z))),this._addOnSpotIcons.has(e.roomleId)?this._addOnSpotIcons.get(e.roomleId).push(n):this._addOnSpotIcons.set(e.roomleId,[n]),n.geometry.computeBoundingBox();const i=n.geometry.boundingBox,s=i.getSize(new THREE.Vector3),o=new THREE.BoxGeometry(s.x,s.y,s.z),r=new THREE.Mesh(o,new THREE.MeshStandardMaterial({color:"#FFFFFF",transparent:!0,opacity:0,polygonOffset:!0,polygonOffsetFactor:-1}));r.layers.set(4),r.translateOnAxis(i.getCenter(new THREE.Vector3),1),r.renderOrder=3,r.visible=!0,n.add(r),r.userData={hasListener:!0,priority:3,roomleId:e.roomleId},r.addEventListener("select",()=>{this._onAddonClick&&this._onAddonClick()}),r.addEventListener("hover_on",()=>{T("pointer"),this._configuratorUiCallbacks.onAddonPlusHover()}),r.addEventListener("hover_off",()=>{T("default"),this._configuratorUiCallbacks.onAddonPlusHoverOff()}),e.add(n)}))})}deleteAddonPointsForComponent(e){this.addOnSpotsEnabled&&this._addOnSpotIcons.has(e)&&(this._addOnSpotIcons.get(e).forEach(e=>{e.parent.remove(e)}),this._addOnSpotIcons.delete(e))}getPositionForAddOnPosition(e){let t=new THREE.Vector3;return t.set(e.x/1e3,e.z/1e3,e.y/-1e3),t}update(e=!1){this._performUpdate(e)}changePreviewGhostVisibility(e,t){this.previewGhostEnabled&&(t?(e.add(this._plusText),this._plusText.position.copy((new THREE.Vector3).add(e.boundingBox.getCenter(new THREE.Vector3))),this._plusText.geometry.center()):e.remove(this._plusText))}_changeAddOnSpotVisibility(e){this.addOnSpotsEnabled&&this._addOnSpotsVisible!==e&&(this._addOnSpotsVisible=e)}isAddOnSpotVisible(){return this._addOnSpotsVisible&&this.addOnSpotsEnabled}onAddonClick(e){this._onAddonClick=e}setState(e){1===this._state&&2!==e||1===e&&5===this._state||3!==e&&5===this._state||(4!==e&&1!==e&&5!==e||this._changeAddOnSpotVisibility(!1),3!==e&&2!==e&&0!==e||this._changeAddOnSpotVisibility(!0),this._state=e)}}return n([i],e.prototype,"_configuratorUiCallbacks",void 0),e})();class Re{constructor(e){const{component:t,preview:n,resetCamera:i,consecutive:s,type:o,forceRender:r}=e;this.component=t,this.preview=n,this.resetCamera=void 0===i||i,this.consecutive=void 0===s||s,this.type=o||0,this.forceRender=void 0!==r&&r}}let Me=(()=>{class e extends B{constructor(e,t,n,i,s){super(e,t,n,i),this._cameraMoving=!1,this._addonHelper=s,this._raycastHelper.addEventListener(3,()=>{this._clickOutside()},this),this._selectionHandler.addEventListener(0,({component:e,consecutive:t})=>{this.dispatchEvent(8,new Re({component:e,consecutive:t})),this._inputManager.setDragEnabled(!0)},this),this._selectionHandler.addEventListener(1,({component:e,resetCamera:t})=>{this._selectionHandler.hasSelection()||this._inputManager.setDragEnabled(!1),this.dispatchEvent(9,new Re({component:e,resetCamera:t}))},this),this._addInputListeners(this._inputManager)}_addInputListeners(e){e.addEventListener(7,e=>this._interaction(),this),e.addEventListener(8,e=>this._interaction(),this)}addComponentHandlers(e){this._addComponentHandlers(e,e.boundingBoxMesh,{hasListener:!0,priority:1,roomleId:e.roomleId}),e.meshes.forEach(t=>{this._addComponentHandlers(e,t,{hasListener:!0,priority:2,roomleId:e.roomleId})})}addComponentDragInHandler(e){this._dragIn&&(this._addComponentHandlers(e,e.boundingBoxMesh,{hasListener:!0,priority:1,roomleId:e.roomleId}),this._raycastHelper.enableDragIn(e.boundingBoxMesh))}_addComponentHandlers(e,t,n){t.userData.hasListener||(Object.assign(t.userData,n),t.addEventListener("select",()=>this.clickComponent(e)),t.addEventListener("hover_on",t=>this._hoverOn(e,t.attachment.type)),t.addEventListener("hover_off",t=>this._hoverOff(e,t.attachment.type)),t.addEventListener("drag_start",()=>this._dragStart(e)),t.addEventListener("drag",t=>this._drag(e,t.attachment.position)),t.addEventListener("drag_end",t=>this._dragEnd(e,t.attachment.position)))}addPreviewHandlers(e){let t=e.boundingBoxMesh;t.userData.hasListener||(t.userData={hasListener:!0,priority:3,roomleId:e.roomleId},t.addEventListener("select",()=>this._clickPreview(e)),t.addEventListener("hover_on",()=>this._hoverOnPreview(e)),t.addEventListener("hover_off",()=>this._hoverOffPreview(e)))}addPreviewLineHandlers(e){let t=e.boundingLineMesh;t.userData.hasListener||(t.userData={hasListener:!0,priority:4,roomleId:e.roomleId},t.addEventListener("select",()=>this._clickPreviewLine(e)),t.addEventListener("hover_on",t=>this._hoverOnPreviewLine(e,t.attachment.intersection)),t.addEventListener("hover_move",t=>this._hoverMovePreviewLine(e,t.attachment.intersection)),t.addEventListener("hover_off",()=>this._hoverOffPreviewLine(e)))}_clickPreview(e){this._dragStartPosition&&(e.position.copy(this._dragStartPosition),this._dragStartPosition=null),this.dispatchEvent(7,new Re({preview:e}))}_clickPreviewLine(e){this._dragStartPosition&&(e.position.copy(this._dragStartPosition),this._dragStartPosition=null),this.dispatchEvent(7,new Re({preview:e}))}clickComponent(e){this._debug&&e.roomleId,this._selectionHandler.check(e)}_clickOutside(){this._selectionHandler.cancelSelection(),this.dispatchEvent(3),this._interaction()}_hoverOn(e,t){this._cameraMoving||(this._debug&&e.roomleId,e.hoverOn(),this._interaction(),this.dispatchEvent(1,new Re({component:e,type:t})),this._hoveredComponent=e)}_hoverOff(e,t){this._cameraMoving||(this._debug&&e.roomleId,e.hoverOff(),this._interaction(),this.dispatchEvent(2,new Re({component:e,type:t})),this._hoveredComponent=null)}_hoverOnPreview(e){e.hoverOn(),this._interaction(!0),this._hoveredPreview=e,this._addonHelper&&this._addonHelper.changePreviewGhostVisibility(e,!0)}_hoverOffPreview(e){e.hoverOff(),this._interaction(!0),this._hoveredPreview=null,this._addonHelper&&this._addonHelper.changePreviewGhostVisibility(e,!1)}_hoverOnPreviewLine(e,t){this._updatePositionForPreviewLine(e,t),this._draggedComponent||e.hoverOn(),this._interaction(),this._hoveredPreview=e}_hoverMovePreviewLine(e,t){this._updatePositionForPreviewLine(e,t),this._hoveredPreview=e,this._interaction(!0)}_updatePositionForPreviewLine(e,t){let n=t.object.parent.parent.worldToLocal(t.point);this._previewLineIntersection=n,e&&(this._draggedComponent?this._draggedComponent.visible=!0:e.updatePreviewPosition(n))}_hoverOffPreviewLine(e){this._draggedComponent||e.hoverOff(),this._interaction(),this._hoveredPreview=null,this._previewLineIntersection=null}_setDragComponentShadow(e){this._draggedComponent.traverse(t=>{if(t instanceof THREE.Mesh){const n=t;e&&void 0!==n.castShadowOld?(n.receiveShadow=n.receiveShadowOld,n.castShadow=n.castShadowOld):(n.receiveShadowOld=t.receiveShadow,n.castShadowOld=t.castShadow,n.receiveShadow=!1,n.castShadow=!1)}})}_dragStart(e){e&&(this._selectionHandler.isSelected(e)||this.isDragIn())&&(this._dragStartPosition=e.position.clone(),this._dragStartRotation=e.rotation.clone(),this._draggedComponent=e,this._setDragComponentShadow(!1),this.dispatchEvent(4,new Re({component:e})),this._interaction())}_drag(e,t){if(e&&(this._selectionHandler.isSelected(e)||this.isDragIn())){if(e&&!this._draggedComponent&&(this._draggedComponent=e),this._previewLineIntersection){let e=this._hoveredPreview,t=e.getPositionForIntersectionPoint(this._previewLineIntersection),n=e.parent.localToWorld(t);this._draggedComponent.position.copy(this._draggedComponent.parent.worldToLocal(n)),this._draggedComponent.rotation.copy(e.docklineRotation),e.hideSelectionLine()}else e.parent?e.position.copy(e.parent.worldToLocal(t)):e.position.copy(t);this._hoveredPreview?e.visible=!1:e.visible=!0,this.dispatchEvent(5,new Re({component:e})),this._interaction()}}_dragEnd(e,t){if(e&&(this._selectionHandler.isSelected(e)||this.isDragIn())){if(this._hoveredPreview)if(this._previewLineIntersection){let t=this._hoveredPreview,n=t.getPositionForIntersectionPoint(this._previewLineIntersection),i=t.parent.localToWorld(n);e.position.copy(e.parent.worldToLocal(i)),e.rotation.copy(t.docklineRotation)}else e.position.copy(t);else this._dragStartPosition&&this._dragStartRotation&&(e.position.copy(this._dragStartPosition),e.rotation.copy(this._dragStartRotation),this._dragStartPosition=null,this._dragStartRotation=null,this.addComponentHandlers(e));e.visible=!0,this._setDragComponentShadow(!0),this._draggedComponent=null,this._previewLineIntersection=null,this.dispatchEvent(6,new Re({component:e,preview:this._hoveredPreview})),this._interaction()}}_interaction(e){this.dispatchEvent(0,new Re({forceRender:e}))}hasSelection(){return this._selectionHandler.hasSelection()}update(e,t,n){this._raycastHelper.update(e,t,n)}isDragIn(){return this._dragIn}isDragging(){return null!=this._draggedComponent}setRootComponentId(e){this._raycastHelper.setRootComponentId(e)}cancelSelection(){this._selectionHandler.setSelectionMode("standard"),this._selectionHandler.cancelSelection()}setSelectionMode(e){this._selectionHandler.setSelectionMode(e)}getSelectionMode(){return this._selectionHandler.getSelectionMode()}getSelectedRuntimeComponentIds(){return this._selectionHandler.getSelectedRuntimeComponentIds()}setCameraMoving(e){e&&this._hoveredComponent&&this._hoverOff(this._hoveredComponent,0),this._cameraMoving=e}}return n([i],e.prototype,"_selectionHandler",void 0),e})();class De extends N{constructor(e){super(),this._uiIntersectionMask=0,this.floorEnvironment=!1,this._camera=e}updateToBounds(e,t,n){let i=new THREE.Vector3(-e.x/2,0,-e.z/2),s=new THREE.Vector3(e.x/2,e.y,e.z/2);this._boundingBox=new THREE.Box3(i,s),this._clientWidth=t,this._clientHeight=n;let o=this._boundingBox.getSize(new THREE.Vector3);this._boxVertices=[],this._boxVertices.push(this._boundingBox.min),this._boxVertices.push(this._boundingBox.min.clone().add(new THREE.Vector3(o.x,0,0))),this._boxVertices.push(this._boundingBox.max),this._boxVertices.push(this._boundingBox.max.clone().sub(new THREE.Vector3(o.x,0,0)))}set canvasOffset(e){this._offset=e,this.calculateUIIntersection()}calculateUIIntersection(){let e=[];if(null==this._boundingBox||null==this._offset)return;let t=this._checkPaddings();t.bottom=this._clientHeight-t.bottom,t.right=this._clientWidth-t.right;let n=0;this.floorEnvironment?(e=["left","right","bottom"],n=11):(this._offset.left>0&&t.left<this._offset.left*this._clientWidth&&(e.push("left"),n|=8),this._offset.right<1&&t.right<(1-this._offset.right)*this._clientWidth&&(e.push("right"),n|=2),this._offset.bottom>0&&t.bottom<this._offset.bottom*this._clientHeight&&(e.push("bottom"),n|=1)),this._offset.top<1&&t.top<(1-this._offset.top)*this._clientHeight&&(e.push("top"),n|=4),n!==this._uiIntersectionMask&&(this.dispatchEvent(0,e),this._uiIntersectionMask=n)}_checkPaddings(){let e={left:this._clientWidth/2,top:this._clientHeight/2,right:this._clientWidth/2,bottom:this._clientHeight/2};return this._boxVertices.forEach(t=>{let n=m(t,this._camera,this._clientWidth,this._clientHeight);n.x<e.left&&(e.left=n.x),n.x>e.right&&(e.right=n.x),n.y<e.top&&(e.top=n.y),n.y>e.bottom&&(e.bottom=n.y)}),e}}let xe=(()=>{class e{constructor(e,t){this._forceRender=!1,this._updateShadowsAndAO=!0,this._maxAnisotropy=1,this._clock=new THREE.Clock,this._delta=0,this._depthWriteMaterial=new THREE.MeshBasicMaterial({colorWrite:!1}),this._lastChange=Date.now(),this._running=!1,this._onAfterRender=()=>{},this._creator_=e,this._setupScene(t),this._configuratorViewModel.setListener(this),this._lifeCycleManager.addEventListener(this);const{plusInPreview:n,addOnSpots:i}=this._initData;(n||i)&&(this._addonHelper=new He(this._camera,this._scriptLoader),i&&(this._addonHelper.onAddonClick(()=>{this._configuratorUiCallbacks.onOpenAddOns()}),this._addonHelper.addOnSpotsEnabled=i),this._addonHelper.previewGhostEnabled=n),this._cameraControl=new J(this._creator_,this._configuratorInputManager,null,this._camera),this._sceneEventHandler=new Me(this._creator_,this._scene,this._camera,this._configuratorInputManager,this._addonHelper),this._sceneEventHandler.addEventListener(0,({forceRender:e})=>{this._uiIntersectionHelper.calculateUIIntersection(),this._addonHelper&&this._addonHelper.setState(0),e&&this._renderEverything()},this),this._sceneEventHandler.addEventListener(1,({component:e,type:t})=>this._onHoverOn(e,t),this),this._sceneEventHandler.addEventListener(2,({component:e,type:t})=>this._onHoverOff(e,t),this),this._sceneEventHandler.addEventListener(3,()=>{this._configuratorUiCallbacks.onClickOutside(),this._cameraControl.unlock(),this._cancelDockings(!1,null,this._configuratorViewModel.hasPreviews(),!0,!1),this.cancelSelection(!0),this._componentRaycastHelper&&this._componentRaycastHelper.checkComponentVisibility(this._sceneEventHandler,this._configuratorViewModel),this._requestRender()},this),this._sceneEventHandler.addEventListener(8,({component:e,consecutive:t})=>{this._configuratorViewModel.hasPreviews()&&this._cancelDockings(!1,null,this._configuratorViewModel.hasPreviews(),!0,!1),this._selectComponent(e,t),this._requestRender()},this),this._sceneEventHandler.addEventListener(9,({component:e,resetCamera:t})=>{this._deselectComponent(e,t),this._requestRender()},this),this._sceneEventHandler.addEventListener(4,({component:e})=>{"multiselect"===this._sceneEventHandler.getSelectionMode()&&this.cancelSelection(),this._requestDockingsPreviewWithDrag(e.roomleId),this._cameraControl.lock(),this._requestRender()},this),this._sceneEventHandler.addEventListener(5,()=>{this._renderEverything()},this),this._sceneEventHandler.addEventListener(6,({component:e,preview:t})=>{if(t){let n=t;this._configuratorViewModel.isPreviewLine(n)?this._configuratorViewModel.dockComponentWithPosition(n,e):this._configuratorViewModel.isPreview(n)&&this._dockComponent(n),this._cancelDockings(!t,e,!0,!0)}else{let t=this._sceneEventHandler.isDragIn()?e:null;this._cancelDockings(this._sceneEventHandler.isDragIn(),t,!1,!0);const n=this._configuratorViewModel.getBoundingBox();this._environment&&this._environment.needsBounds()&&this._environment.updateBounds(n.getSize(new THREE.Vector3))}this._cameraControl.unlock(),this._renderEverything()},this),this._sceneEventHandler.addEventListener(7,({preview:e})=>{this._configuratorViewModel.isPreview(e)&&(this._configuratorViewModel.isPreviewLine(e)?this._configuratorViewModel.dockComponentWithPosition(e):this._dockComponent(e),this._cancelDockings(!1,null,!this._configuratorViewModel.hasPreviews(),!1,!1),this.requestDockingsPreview(!1),this._requestRender())},this),this._cameraControl.addEventListener(0,()=>{this._configuratorUiCallbacks.onCameraPositionChanges(),this._sceneEventHandler.setCameraMoving(!0),this._addonHelper&&this._addonHelper.setState(1),this._pixotronUtil.movingCameraStarts(),this._requestRender()},this),this._cameraControl.addEventListener(1,()=>{this._componentRaycastHelper&&this._componentRaycastHelper.checkComponentAndPreviewVisibility(this._sceneEventHandler,this._configuratorViewModel),this._requestRender()},this),this._cameraControl.addEventListener(2,()=>{this._sceneEventHandler.setCameraMoving(!1),this._addonHelper&&this._addonHelper.setState(2),this._pixotronUtil.movingCameraStops(),this._updateComponentPosition(),this._requestRender()},this),this._cameraControl.addEventListener(5,({minZoom:e,maxZoom:t})=>{this._configuratorUiCallbacks.onZoomChange(e,t)},this),this._cameraControl.addEventListener(3,()=>{this._configuratorUiCallbacks.onCameraPositionChanges(),this._updateComponentPosition(),this._requestRender()},this),this._cameraControl.addEventListener(4,()=>{this._configuratorUiCallbacks.onCameraPositionChanges(),this._updateComponentPosition(),this._requestRender()},this),this._cameraControl.addEventListener(7,()=>{this._pluginSystem.moveCameraStart(this._camera.position)},this),this._cameraControl.addEventListener(8,()=>{this._pluginSystem.moveCameraEnd(this._camera.position)},this),d.isProduction||(window.__RML__DEBUG__.SceneHelper=this),this._initOptionalModules()}async _initOptionalModules(){const{transparentHighlighting:e}=this._initData;if(e){const{default:e}=await Promise.resolve().then((function(){return Le}));this._componentRaycastHelper=new e,this._componentRaycastHelper.init(this._scene,this._camera)}}_showDockings(){}cancelDockings(){this._cancelDockings(!0,null,!0,!0,!1),this._renderEverything()}_cancelDockings(e,t,n,i,s=!0){e&&(this._sceneEventHandler.setDragIn(!1),this._configuratorViewModel.removeDockingComponent(),t&&this._scene.remove(t)),this._configuratorViewModel.removePreviews(),n&&s&&this._updateCameraToBounds(),i&&n&&this._configuratorUiCallbacks.onDockingsPreviewRemoved(),this._addonHelper&&this._addonHelper.setState(3),this._componentRaycastHelper&&this._componentRaycastHelper.changeMaterialsOnSelect(this._scene,null)}stopRenderLoop(){this._running=!1}_onHoverOn(e,t){2!==t&&this._highlight(e),this._componentDimensioningHelper&&this._componentDimensioningHelper.add(e)&&this._renderEverything()}_onHoverOff(e,t){2!==t&&this._highlight(),this._componentDimensioningHelper&&this._componentDimensioningHelper.hasComponentDimensions()&&(this._componentDimensioningHelper.remove(e),this._renderEverything()),this._requestRender()}_highlight(e=null,t=[]){if(!this._shouldHighlight())return;this._pixotron&&((null==t?void 0:t.length)?this._pixotron.getHighLightPass().transparency=.8:this._pixotron.getHighLightPass().transparency=1,this._pixotron.getHighLightPass().needsUpdate=!0);const n=[],i=this._initData.meshSelection;e?i?n.push(...e.meshes):e.boundingBoxMesh&&n.push(e.boundingBoxMesh):t&&t.length||(t=this._sceneEventHandler.getSelectedRuntimeComponentIds()),this._configuratorViewModel.getComponentsForIds(t).forEach(e=>{e&&(i?n.push(...e.meshes):e.boundingBoxMesh&&n.push(e.boundingBoxMesh))}),this._pixotron?this._pixotron.highlightObjects(n):this._outlinePass.selectedObjects=n}_shouldRenderUi(){return this._pluginSystem&&this._pluginSystem.needsUiScene()}_renderUi(){const e=this._scene.background?this._scene.background.clone():null;this._scene.overrideMaterial=this._depthWriteMaterial,this._scene.background=null,this._renderer.render(this._scene,this._camera),this._scene.overrideMaterial=null;const t=this._renderer.autoClear;this._renderer.autoClear=!1,this._renderer.clearDepth(),this._renderer.render(this._uiScene,this._camera),this._renderer.autoClear=t,this._scene.background=e}_renderEverything(){this._pixotron&&(this._forceRender=!0,this._updateShadowsAndAO=!0),this._requestRender()}_renderWithoutShadowsAndAO(){this._pixotron&&(this._forceRender=!0,this._updateShadowsAndAO=!1),this._requestRender()}_requestRender(){const e=()=>{this._delta=this._clock.getDelta(),this._animateCamera(),this._camera.layers.mask=65535,this._statsHelper&&this._statsHelper.updateRenderInfo(this._renderer.info),this._pixotron?(this._pixotron.autoShadowsClear=this._updateShadowsAndAO,this._pixotron.autoSAOClear=this._updateShadowsAndAO,this._forceRender&&(this._pixotron.needsUpdate=!0),this._checkLayers(),this._pixotron.render(this._renderer,this._scene,this._camera,this._renderTarget),this._forceRender=!1,this._updateShadowsAndAO=!0,this._pixotron.blit(),this._shouldRenderUi()&&this._renderUi()):(this._renderer.clear(),this._checkLayers(),this._composer.render(),this._renderer.clearDepth(),this._renderer.render(this._uiScene,this._camera),this._renderer.clearDepth()),this._onAfterRender(),this._addonHelper&&this._addonHelper.update(),window.TWEEN&&TWEEN.update(),this._addonHelper&&this._lastChange+1500<Date.now()&&this._addonHelper.isAddOnSpotVisible()&&this._addonHelper.setState(4),this._lastChange+3e3<Date.now()?this._running=!1:(this._running=!0,requestAnimationFrame(e))};if(this._lastChange=Date.now(),!this._running){if(this._running=!0,this._addonHelper&&!this._addonHelper.isAddOnSpotVisible()){let e=this._configuratorViewModel.hasPreviews()?5:3;this._addonHelper.setState(e)}requestAnimationFrame(e)}}_checkLayers(){this._addonHelper&&this._addonHelper.isAddOnSpotVisible()?(this._camera.layers.enable(8),this._configuratorUiCallbacks.onAddonPlusShown()):(this._camera.layers.disable(8),this._configuratorUiCallbacks.onAddonPlusHidden())}_animateCamera(){this._cameraControl&&(this._cameraControl.animateCamera(this._delta)?(this._lightSetting instanceof X&&this._lightSetting.update(this._camera,this._cameraControl.getTargetPosition()),this._pixotron&&(this._pixotron.needsUpdate=!0)):!this._pixotron||this._sceneEventHandler.isDragging()||this._forceRender||(this._pixotron.autoShadowsClear=!1,this._pixotron.autoSAOClear=!1)),this._environment.needsCamera()&&this._environment.updateCamera(this._camera)}resume(){let e=this._domHelper.getClientDimensions(),t=e.x,n=e.y;if(this._renderTarget){const e=Math.floor(t*window.devicePixelRatio),i=Math.floor(n*window.devicePixelRatio);this._renderTarget.setSize(e,i)}this._renderer.domElement.classList.add(g.HSC),this._domHelper.element.appendChild(this._renderer.domElement),this._configuratorInputManager.addEvents(this._renderer.domElement),window.addEventListener("resize",this,!1),window.addEventListener("keydown",this,!1),window.addEventListener("keyup",this,!1),document.addEventListener("visibilitychange",this),this._renderEverything(),this._configuratorViewModel.materialQueue.registerCallback(()=>this._materialLoaded()),this._configuratorMeshGenerator.setMaterialLoadedListener(()=>{this._applySSR(),this._renderWithoutShadowsAndAO()})}_materialLoaded(){this._renderEverything(),this._applySSR(),this._environment instanceof Y&&this._environment.update()}_applySSR(){this._initData.ssr&&this._pixotron&&this._configuratorViewModel.getComponent(this._configuratorContext.rootComponentId).traverse(e=>{e instanceof THREE.Mesh&&!e.material.ssrPass&&this._pixotron.fixMaterial(e)})}pause(){this._configuratorInputManager.removeEvents(this._renderer.domElement),window.removeEventListener("resize",this,!1),window.removeEventListener("keydown",this,!1),window.removeEventListener("keyup",this,!1),document.removeEventListener("visibilitychange",this),this._configuratorViewModel.materialQueue.unregisterCallback(),this._configuratorMeshGenerator.removeMaterialLoadedListener()}destroy(){this.pause(),this.cleanUp()}_setupScene(e){const t=this._domHelper.getClientDimensions(),n=t.x,i=t.y;this._scene=new THREE.Scene,this._scene.background=new THREE.Color(this._initData.colors.DEFAULT_BACKGROUND),this._uiScene=new THREE.Scene,this._componentFactory=f(),this._camera=this._componentFactory.createCamera(30,n/i,.1,20,e),this._camera.position.copy(new THREE.Vector3(0,.5,5)),this._uiIntersectionHelper=new De(this._camera),this._uiIntersectionHelper.canvasOffset=e,this._uiIntersectionHelper.addEventListener(0,e=>{this._configuratorUiCallbacks.onUiIntersectionChange(e)},this),this._camera.layers.set(3),this._camera.layers.enable(1),this._camera.layers.enable(2),this._camera.layers.enable(5),this._camera.layers.enable(4);const s={format:THREE.RGBAFormat,minFilter:THREE.NearestFilter,magFilter:THREE.NearestFilter},o=THREE.sRGBEncoding,r=Math.floor(n*window.devicePixelRatio),a=Math.floor(i*window.devicePixelRatio);L()?this._renderTarget=new THREE.WebGLMultisampleRenderTarget(r,a,s):this._renderTarget=new THREE.WebGLRenderTarget(r,a,s),this._renderTarget.texture.encoding=o,this._renderer=new THREE.WebGLRenderer({antialias:!0,alpha:!0}),this._renderer.setPixelRatio(window.devicePixelRatio),this._renderer.setSize(n,i),this._renderer.outputEncoding=o,this._renderer.toneMapping=THREE.LinearToneMapping,this._renderer.autoClear=!1,this._renderer.shadowMap.enabled=!0,this._renderer.shadowMap.type=THREE.PCFSoftShadowMap,this._environmentLoader.setRendererAndScene(this._renderer,this._scene),this._environmentLoader.registerEnvironmentChangedCallback(()=>this._renderEverything()),this._maxAnisotropy=this._renderer.capabilities.getMaxAnisotropy(),this._configuratorMeshGenerator.maxAnisotropy=this._maxAnisotropy,this._configuratorMeshGenerator.maxTextures=this._renderer.capabilities.maxTextures,this._configuratorMeshGenerator.setMaterialLoadedListener(()=>{this._renderWithoutShadowsAndAO()}),this._renderer.domElement.classList.add(g.HSC),this._domHelper.element.appendChild(this._renderer.domElement),this._configuratorInputManager.addEvents(this._renderer.domElement),this._lightSetting=new ue(this._scene),this._composer=new THREE.EffectComposer(this._renderer);let l=new THREE.RenderPass(this._scene,this._camera,null,new THREE.Color(this._initData.colors.DEFAULT_BACKGROUND),0);this._composer.addPass(l),this._outlinePass=new THREE.OutlinePass(new THREE.Vector2(n,i),this._scene,this._camera),this._outlinePass.renderToScreen=!0,this._outlinePass.visibleEdgeColor=new THREE.Color(this._initData.colors.SELECTION),this._outlinePass.hiddenEdgeColor=new THREE.Color(this._initData.colors.SELECTION),this._outlinePass.edgeStrength=3,this._outlinePass.edgeThickness=1,this._outlinePass.edgeGlow=0,this._composer.addPass(this._outlinePass),this._composer.setSize(n,i),this._requestRender(),window.addEventListener("resize",this,!1),window.addEventListener("keydown",this,!1),window.addEventListener("keyup",this,!1),document.addEventListener("visibilitychange",this),this._setEnvironment(new $(this._scene,this._environment,new THREE.Color(this._initData.colors.DEFAULT_BACKGROUND))),this._pluginSystem.init(this._scene,this._uiScene,this._camera.position),this._configuratorViewModel.materialQueue.registerCallback(()=>this._materialLoaded())}_tabVisible(){this.updateSize(!1)}sceneCleared(e){this._internalClearScene(e)}display(e){this._scene.add(e),this._sceneEventHandler.setRootComponentId(e.roomleId),this._requestRender()}debugSceneGraph(e){this._configuratorViewModel.debugSceneGraph(e),this._printObjectGraph(this._scene,"")}debugScene(){return this._scene}_printObjectGraph(e,t){e.material&&e.material.opacity,e.type,e.id,e.roomleId,e.children.length>0&&e.children.forEach(e=>{let n=t+" ";this._printObjectGraph(e,n)})}clearScene(){var e;this._cameraControl.clear(),this._internalClearScene(!1),this._pixotronUtil&&this._pixotronUtil.lockAdapter(),null===(e=this._sceneEventHandler)||void 0===e||e.cancelSelection(),this._pluginSystem.clearScene(this._scene,this._uiScene)}planObjectConstructionDone(e){this._componentDimensioningHelper.reset(),this._componentDimensioningHelper.setCamera(this._camera)}_internalClearScene(e){this._scene.children.forEach(e=>{"Object3D"!==e.type&&"Mesh"!==e.type&&"Line"!==e.type||this._scene.remove(e)}),this._uiScene.children.forEach(e=>{this._uiScene.remove(e)}),this._configuratorViewModel.sceneCleared(),(e||this._memoryManager.shouldHardReset())&&(this._configuratorMeshGenerator.clear(),this._renderer.renderLists.dispose(),this._memoryManager.executedHardReset()),this._renderEverything()}async preparePerspectiveImage(e={}){await this._externalMeshesAndMaterialsReady();const{showDimensions:t=!1}=e;this._cancelDockings(!0,null,!0,!0),this._clearSelectionAndHovers();let n=this._camera.clone(),i=this._calculateBoundingBoxOfAllMeshes(0,t);this._lightSetting.removeFromScene();const s=!!this._dimensionHelper&&this._dimensionHelper.areDimensionsEnabled();s&&this._dimensionHelper.disableDimensions(),t&&(await this._initDimensions(),await this._dimensionHelper.isInitialized(),F(n,i,-20,-30),this._dimensionHelper.enableDimensions(),this._dimensionHelper.moveCameraEnd(n.position),i=this._calculateBoundingBoxOfAllMeshes(0,t)),this._componentDimensioningHelper&&this._componentDimensioningHelper.hasComponentDimensions()&&await this._componentDimensioningHelper.reset();const o=await j(this._scene,this._uiScene,n,i,e);return s?this._dimensionHelper.enableDimensions():t&&this._dimensionHelper.disableDimensions(),this._lightSetting.addToScene(),this._requestRender(),o}async renderImage(e){await this._externalMeshesAndMaterialsReady(),this._configuratorViewModel.getPreviews()&&this._cancelDockings(!0,null,!0,!0),this._clearSelectionAndHovers();let t=this._camera,n=null;e.useCurrentPerspective||(t=this._camera.clone(),n=this._calculateBoundingBoxOfAllMeshes());const i=!!this._dimensionHelper&&this._dimensionHelper.areDimensionsEnabled();i&&this._dimensionHelper.disableDimensions(),this._componentDimensioningHelper&&this._componentDimensioningHelper.hasComponentDimensions()&&await this._componentDimensioningHelper.reset();const s=await G(this._scene,t,n,this._pixotron,this._renderer);return i&&this._dimensionHelper.enableDimensions(),this._requestRender(),s}async preparePartImage(e,t){return new Promise((n,i)=>{this._configuratorViewModel.requestSubPartConstruction(e).then(async e=>{t.size||(t.size=256);let i=this._camera.clone(),s=z((new THREE.Box3).setFromObject(e));const o=new THREE.Scene;o.add(e);const r=await j(o,null,i,s,t);C(o),n(r)},i)})}_calculateBoundingBoxOfAllMeshes(e=0,t){let n=null;return n=t&&this._dimensionHelper?this._dimensionHelper.getBoundingBox():this._configuratorViewModel.getBoundingBox(),z(n,e)}async _externalMeshesAndMaterialsReady(){await this._kernelAccess.externalMeshQueue.finished(!0),await this._configuratorViewModel.materialQueue.finished(!0)}async prepareTopImage(e={}){await this._externalMeshesAndMaterialsReady();const{showDimensions:t=!1}=e;this._cancelDockings(!0,null,!0,!0),this._clearSelectionAndHovers(),t&&(await this._initDimensions(),await this._dimensionHelper.isInitialized(),this._dimensionHelper.enableTopDimensions()),this._componentDimensioningHelper&&this._componentDimensioningHelper.hasComponentDimensions()&&await this._componentDimensioningHelper.reset();let n=this._calculateBoundingBoxOfAllMeshes(.1,t);this._lightSetting.removeFromScene();let i=await q(this._scene,this._uiScene,n,e);return t&&this._dimensionHelper.disableTopDimensions(),this._lightSetting.addToScene(),this._requestRender(),i}enableDragIn(e){this._sceneEventHandler.setDragIn(!0,e),this._requestRender()}_getYRotationOfObject(e){let t=e.getWorldDirection(new THREE.Vector3).clone();t.y=0,t.lengthSq()<.01&&(t=new THREE.Vector3(0,1,0),t.applyQuaternion(e.quaternion),t.y=0),t.normalize();let n=Math.asin(t.x);return t.z<0&&(n=Math.PI-n),n<0&&(n+=2*Math.PI),n}zoomToComponent(e){this._cameraControl.saveState(!1);let t=e.boundingBox.getSize(new THREE.Vector3),n=this._getYRotationOfObject(e),i=new THREE.Euler(0,n,0),s=e.getWorldPosition(new THREE.Vector3).clone().add(e.boundingBox.getCenter(new THREE.Vector3).applyEuler(i));const o=new THREE.Vector2;this._renderer.getSize(o),this._cameraControl.zoomTo(t,o.width,o.height,i.y,v(15),s)}resetCamera(){this._cameraControl.hasSavedState()?this.resetCameraToState():this.resetCameraPositionToStart(!1)}resetCameraToState(){this._cameraControl.hasSavedState()&&this._cameraControl.resetToState()}resetCameraPositionToStart(e=!0){this._requestRender();const t=this._configuratorViewModel.getBoundingBox();t&&this._cameraControl.reset(t,void 0,void 0,void 0,e)}_clearSelectionAndHovers(){this.cancelSelection(),this._configuratorViewModel.clearRootComponent()}resetPreviews(){this._configuratorViewModel.removePreviews(),this._addonHelper&&this._addonHelper.setState(5),this._requestRender()}changeOffset(e){this._camera.offset=e,this._uiIntersectionHelper&&(this._uiIntersectionHelper.canvasOffset=e)}_onWindowResize(){this._configuratorInputManager&&this._configuratorInputManager.updateSize(),this.updateSize()}updateSize(e=!0){const{x:t,y:n}=this._domHelper.getClientDimensions();this._renderer.setSize(t,n),this._camera.aspect=t/n,this._camera.updateProjectionMatrix(),this._updateCameraToBounds(null,e);const i=this._renderer.getPixelRatio();if(this._renderTarget){const e=Math.floor(t*i),s=Math.floor(n*i);this._renderTarget.setSize(e,s)}if(this._pixotron)try{this._pixotron.setSize(t,n)}catch(e){console.warn(e)}this._renderEverything()}setCameraOffset(e){this._camera.offset&&(this._camera.offset=e,this._renderEverything())}getCameraOffset(){return JSON.parse(JSON.stringify(this._camera.offset))}_onKeyDown(e){!e.key||"Escape"!==e.key&&"Esc"!==e.key||(this.cancelSelection(),e.preventDefault()),e.key&&e.key.includes("Shift")&&(this._cameraControl.enablePanning(),e.preventDefault()),this._sceneEventHandler&&this._sceneEventHandler.hasSelection()&&e.key&&("Backspace"===e.key||"Delete"===e.key)&&(this.requestDeleteSelectedComponent(),e.preventDefault())}_onKeyUp(e){e.key&&e.key.includes("Shift")&&(this._cameraControl.disablePanning(),e.preventDefault())}cancelPreviousDockings(){this._cancelDockings(!0,null,!1,!1)}cancelSelection(e){(this._sceneEventHandler.hasSelection()||"standard"!==this._sceneEventHandler.getSelectionMode())&&this._cancelSelection(e)}_cancelSelection(e){this._sceneEventHandler.cancelSelection(),this._configuratorContext.selectionMode="standard",this._configuratorContext.selectedRuntimeComponentIds=[],this._configuratorViewModel.removePreviews(),e&&!this._initData.debug&&this.resetCameraToState(),this._kernelAccess.updatePlanObjectDependencies(this._configuratorContext.planObjectId),this._configuratorUiCallbacks.onSelectionCancel()}_selectComponent(e,t){this._configuratorContext.selectedRuntimeComponentIds=this._sceneEventHandler.getSelectedRuntimeComponentIds(),t||("standard"===this._sceneEventHandler.getSelectionMode()?this._onSelectedRuntimeComponentChange(e):this._onSelectedRuntimeComponentsChange(this._sceneEventHandler.getSelectedRuntimeComponentIds())),this._highlight(e),!this._initData.debug&&t&&this.zoomToComponent(e)}_deselectComponent(e,t){"standard"===this._sceneEventHandler.getSelectionMode()&&(this._cancelSelection(t),this._highlight()),"multiselect"===this._sceneEventHandler.getSelectionMode()&&(this._sceneEventHandler.hasSelection()?this._configuratorContext.selectedRuntimeComponentIds=this._sceneEventHandler.getSelectedRuntimeComponentIds():(this._cancelSelection(t),this._highlight())),this._componentRaycastHelper&&this._componentRaycastHelper.changeMaterialsOnSelect(this._scene,null)}getScreenXY(e){return m(e,this._camera,this._domHelper.element.clientWidth,this._domHelper.element.clientHeight)}cleanUp(){this.stopRenderLoop()}setSelectionMode(e){this._sceneEventHandler.setSelectionMode(e)}changeFloorMaterial(e){return this._environment&&this._environment instanceof Z||(this._environment=new Z(this._scene,this._environment,!0),this._uiIntersectionHelper.floorEnvironment=!0),this._pixotron&&this._environment.setPixotron(this._pixotron,this._renderer,this._cameraControl.getCamera()),new Promise((t,n)=>{this._environment.changeFloorMaterial(e,this._maxAnisotropy).then(()=>{this._requestRender(),t()},n)})}enableHD(e){this._renderer.capabilities.maxTextures>8&&(e?e&&this.loadDynamicLightSetting(e):this.loadDynamicLightSetting(y.createDynamicLightSettingSource(null,b.CAMERA))),this._environment instanceof ee&&(this._environment.removeFromScene(),this._environment.loadBackground(O()+te,new THREE.MeshStandardMaterial)),this.reEnableHD()}reEnableHD(){let e={saoparams:{intensity:.5,occlusionWorldRadius:.6,smoothTransition:!0,samplesPerFrame:4,bias:.02,numSamples:100,accumulative:!1,falloff:1.5},shadowparams:{shadowMapResolution:1024,shadowRadius:1,shadowQuality:1,smoothTransition:!0,enableAccumulation:!0,shadowBiasMultiplier:.05,nearPlane:.01,farPlane:50,fov:40,numSamples:50,side:THREE.FrontSide},outlineparams:{highlightColor:new THREE.Color(this._initData.colors.SELECTION),edgeStrength:1,transparency:1,edgeThickness:2}};this._pixotron=new window.PIXOTRON.Pixotron(e),this._pixotron.enableAA=!1,this._pixotronUtil=new ne(this._pixotron),this._initData.autoQuality&&this._enableAutoQuality(),this._environment instanceof Y&&this._environment.setPixotron(this._pixotron,this._renderer,this._cameraControl.getCamera()),this._requestRender()}_enableAutoQuality(){this._pixotronUtil.enablePixotronAutoQuality();const e=this._pixotronUtil.getAutoAdapter();this._pixotronUtil.onAutoQualityChange((t,n)=>{this._statsHelper&&this._statsHelper.updateQualityInfo(t);const i=this._pixotronUtil.getLowestQualitySetting();if(this._enableSSR(t.ssr),n&&t.getQuality()<n.getQuality()&&e.getAverageFps()<5&&e.setQualitySetting(i),this._renderer.getPixelRatio()>1&&!t.useDevicePixelRatio){this._renderer.setPixelRatio(1);const{x:e,y:t}=this._domHelper.getClientDimensions();try{this._pixotron.setSize(e,t)}catch(e){console.warn(e)}this._renderTarget&&this._renderTarget.setSize(e,t)}}),this._pixotronUtil.onManualQualityChange((e,t)=>{this._statsHelper&&this._statsHelper.updateQualityInfo(e),this._enableSSR(e.ssr)})}_enableSSR(e=!1){const t=void 0!==this._initData.ssr&&this._initData.ssr;this._pixotron.getSSRPass().enabled=!!t&&e}async loadDynamicLightSetting(e){this._lightSetting=new X(this._scene,this._lightSetting);let t=!1;if(e.url)await this._lightSetting.loadFromURL(e.url),t=!0;else if(e.json)await this._lightSetting.loadFromJSON(e.json),t=!0;else if(e.object)await this._lightSetting.loadFromObject(e.object),t=!0;else if(e.ls){const n=y.createDynamicLightSettingSource(null,e.ls);await this._lightSetting.loadFromURL(n.url),t=!0}if(!t)throw new Error("No dynamic light setting source set");this._renderEverything()}exportGLB(){this._scriptLoader.fetch(K,{id:"gltf-exporter"}).then(()=>{let e=new THREE.GLTFExporter,t=[];this._scene.children.forEach(e=>{"Object3D"!==e.type&&"Mesh"!==e.type||t.push(e)}),e.parse(t,e=>{let t=document.createElement("a");const n=new Blob([e],{type:"model/gltf-binary"});t.href=URL.createObjectURL(n),t.download="scene.glb",t.style.display="none",document.body.appendChild(t),t.click()},{binary:!0,embedImages:!0,forceIndices:!0})})}showGUI(){let e=w();e&&(this._lightSetting&&this._lightSetting.showGUI(),this._pixotron&&this._pixotronUtil.showGUI(),this._environment&&this._environment.showGUI(),this._addGUIListener(e))}_addGUIListener(e){let t=e.__folders;Object.keys(t).forEach(e=>{let n=t[e];n.__folders&&Object.keys(n.__folders).forEach(e=>{let n=t[e];this._addGUIListener(n)}),n.__controllers&&n.__controllers.forEach(e=>{e.onFinishChange(()=>{this._requestRender()})})})}zoomIn(e){this._cameraControl.zoomIn(e),this._renderEverything()}zoomOut(e){this._cameraControl.zoomOut(e),this._renderEverything()}showStats(){t.import("./stats-helper-8fd90e9a.nomodule.js").then(({default:e})=>this._statsHelper=new e)}async showDimensions(){await this._initDimensions(),this._dimensionHelper.enableDimensions(),this._dimensionHelper.onDimensionsVisibilityChanged(e=>{e&&this._renderEverything(),this._configuratorUiCallbacks.onDimensionsVisibilityChange(e)}),this._renderEverything()}async _initDimensions(){this._dimensionHelper||await t.import("./dimensioning-helper-f244b9ce.nomodule.js").then(({default:e})=>{this._dimensionHelper=new e(this._creator_),this._pluginSystem.addPlugin(this._dimensionHelper)})}hideDimensions(){this._dimensionHelper&&this._dimensionHelper.disableDimensions(),this._componentDimensioningHelper&&this._componentDimensioningHelper.hasComponentDimensions()&&this._componentDimensioningHelper.reset(),this._renderEverything()}loadSceneSettings(e){let t=new Promise(t=>{(new ie).load(this._scene,this._renderer.domElement,this._environment,e).then(e=>{e&&this._setEnvironment(e),t()})});this._lightSetting=new X(this._scene,this._lightSetting);let n=this._lightSetting.loadFromObject(e);return new Promise((e,i)=>{Promise.all([t,n]).then(()=>{this._renderEverything(),this._uiIntersectionHelper.floorEnvironment=this._environment instanceof Z,e()},i)})}setBackgroundColor(e){this._setEnvironment(new $(this._scene,this._environment,new THREE.Color(e)))}setBackgroundImage(e){this._setEnvironment(new $(this._scene,this._environment,null,this._renderer.domElement,e))}setBakedShadow(e,t){this._setEnvironment(new $(this._scene,this._environment,new THREE.Color(e),this._renderer.domElement,t))}_setEnvironment(e){this._environment=e,this._environment instanceof Y&&(this._pixotron&&this._environment.setPixotron(this._pixotron,this._renderer,this._cameraControl.getCamera()),this._environment.setLoadedCallback(()=>setTimeout(()=>this._renderEverything(),500))),this._renderEverything()}handleEvent(e){switch(e.type){case"resize":this._onWindowResize();break;case"keydown":if(e.target&&(e.target instanceof HTMLInputElement||e.target instanceof HTMLTextAreaElement))break;this._onKeyDown(e);break;case"keyup":if(e.target&&(e.target instanceof HTMLInputElement||e.target instanceof HTMLTextAreaElement))break;this._onKeyUp(e);break;case"visibilitychange":this._tabVisible()}}_updateCameraToBounds(e,t=!0){e||(e=this._configuratorViewModel.getBoundingBox()),e&&(this._cameraControl.updateToBounds(e,!1,t),this._configuratorUiCallbacks.onCameraPositionChanges(),this._updateComponentPosition())}requestDockingsPreview(e,t,n,i){i||(i=!1),e&&this.cancelPreviousDockings(),this.cancelSelection(),i&&this.enableDragIn(n),t&&(this._configuratorContext.lastPossibleChild=t),this._configuratorContext.requestPreviewsIsUserInitiated=e,this.resetPreviews(),this._kernelAccess.webGlPreviewDockings(this._configuratorContext,i),this._showDockings()}_requestDockingsPreviewWithDrag(e){this.cancelPreviousDockings(),this._configuratorContext.rootComponentId!==e&&(this.resetPreviews(),this._kernelAccess.previewDockingsWithDrag(e,this._configuratorContext.planObjectId),this._showDockings())}_dockComponent(e){const t=o.start("dock_component_"+e.childId);this._kernelAccess.dockComponent(e.parentId,e.parentDockId,e.childId,e.childDockId),this._configuratorContext.dockingRootComponentId=null,o.end(t)}_onSelectedRuntimeComponentsChange(e){this._kernelAccess.multiSelectionChange(e,this._configuratorContext.rootComponentId)}_onSelectedRuntimeComponentChange(e){let t=!1,n=null;e&&(t=e.roomleId===this._configuratorContext.rootComponentId,n=e.roomleId),this._kernelAccess.selectionChange(n,t),e&&this._kernelAccess.selectedComponent(e.roomleId)}requestDeleteSelectedComponent(){const e=this._configuratorContext.selectedRuntimeComponentIds,t=this._configuratorContext.rootComponentId;if(Array.isArray(e)&&0!==e.length&&t&&-1===e.indexOf(t)){switch(this._configuratorContext.selectionMode){case"standard":this.resetCamera(),this._kernelAccess.requestDeleteComponent(this._configuratorContext.selectedRuntimeComponentId);break;case"multiselect":this.resetCamera(),this._kernelAccess.requestDeleteComponents(this._configuratorContext.selectedRuntimeComponentIds)}this._configuratorContext.selectedRuntimeComponentIds=[]}}componentUpdated(e,t){if(e.roomleId===this._configuratorContext.rootComponentId){let t=new THREE.Vector3(e.position.x/1e3,e.position.z/1e3,e.position.y/-1e3);this._sceneEventHandler.update(null,t,null)}this._addonHelper&&e&&t.addOnSpots&&this._addonHelper.addAddOnSpots(e,t.addOnSpots),void 0===e.geometryChanged||e.geometryChanged?this._renderEverything():this._renderWithoutShadowsAndAO()}planObjectUpdated(e,t){const n=this._kernelAccess.kernelInstance.getSerializedConfiguration(this._configuratorContext.planObjectId);if(this._configuratorHistory.push(n),e.bounds){if(this._configuratorContext.planObjectId===e.id){const n=E(e.boxForMeasurement);this._updateBounds(n,t)}this._highlight(),this._requestRender()}}componentDeleted(e){this._addonHelper&&this._addonHelper.deleteAddonPointsForComponent(e.roomleId),-1===this._sceneEventHandler.getSelectedRuntimeComponentIds().indexOf(e.roomleId)&&"multiselect"!==this._sceneEventHandler.getSelectionMode()||this.cancelSelection()}previewConstructionDone(e,t){const n=this._configuratorViewModel.getBoundingBoxWithPreviews();t||(this._cancelDockings(!0,null,!1,!1,!1),this._configuratorContext.requestPreviewsIsUserInitiated&&this._configuratorUiCallbacks.onNoDockingsAvailable());let i=!0;this._componentRaycastHelper&&(i=!this._componentRaycastHelper.areAllPreviewsVisible(this._configuratorViewModel)),this._configuratorContext.requestPreviewsIsUserInitiated&&i&&this._updateCameraToBounds(n),this._lightSetting&&this._lightSetting.needsBounds()&&(this._lightSetting.updateBounds(n),this._environment&&this._environment.needsBounds()&&this._environment.updateBounds(n.getSize(new THREE.Vector3))),this._componentRaycastHelper&&this._componentRaycastHelper.checkPreviewVisibility(this._configuratorViewModel)}configurationLoaded(e,t){e&&t&&this._sceneEventHandler.isDragIn()?(e.position.copy(new THREE.Vector3(0,100,0)),this._scene.add(e),this._sceneEventHandler.addComponentDragInHandler(e),this._requestRender()):t||this._initData.debug||this.resetCamera(),this._pixotronUtil&&Promise.all([new Promise(e=>setTimeout(e,3e3)),this._configuratorViewModel.materialQueue.finished(!0)]).then(()=>{this._pixotronUtil.unLockAdapter()}),this._environment&&this._environment.reload()}addComponentHandlers(e){this._sceneEventHandler.addComponentHandlers(e)}addPreviewHandlers(e){this._sceneEventHandler.addPreviewHandlers(e)}addPreviewLineHandlers(e){this._sceneEventHandler.addPreviewLineHandlers(e)}_updateComponentPosition(){if(!this._configuratorUiCallbacks.onComponentPositionsUpdated)return;const e=[];this._configuratorViewModel.getComponents().forEach(t=>{if(!t.boundingBoxMesh)return;const n=(new THREE.Box3).setFromObject(t.boundingBoxMesh);let i=this._kernelAccess.kernelInstance.getComponent(t.roomleId);const s=i.parameters||i.possibleChildren?["edit"]:[];e.push({id:t.roomleId,position:this.getScreenXY(n.getCenter(new THREE.Vector3)),type:"component",actions:s})}),this._configuratorViewModel.getPreviews().forEach(t=>{const n=(new THREE.Box3).setFromObject(t);e.push({id:t.roomleId,position:this.getScreenXY(n.getCenter(new THREE.Vector3)),type:"preview",actions:["add"]})}),this._configuratorUiCallbacks.onComponentPositionsUpdated(e)}getScene(){return this._scene}_updateBounds(e,t=!1){let n=e.getSize(new THREE.Vector3);if(this._sceneEventHandler.hasSelection()||this._updateCameraToBounds(e,!1),this._sceneEventHandler.update(n,null,null),this._uiIntersectionHelper.updateToBounds(n,this._domHelper.element.clientWidth,this._domHelper.element.clientHeight),this._environment.needsBounds()&&this._environment.updateBounds(n,t),this._lightSetting&&this._lightSetting.needsBounds()&&this._lightSetting.updateBounds(e),this._componentDimensioningHelper&&this._componentDimensioningHelper.hasComponentDimensions()&&this._componentDimensioningHelper.reset(),this._pixotron&&this._pixotron.getShadowPass().setShadowRecieverBBox(e),this._pixotronUtil){const t=new THREE.Sphere;e.getBoundingSphere(t),this._pixotronUtil.updateBounds(t)}this._camera.updateProjectionMatrix(),this._pluginSystem.updateBounds(e)}updateScene(){const e=this._configuratorViewModel.getBoundingBox();this._updateBounds(e),this._renderEverything()}async moveCamera(e){return this._cameraControl.moveCamera(e)}selectComponent(e){if(!e)return;const t=this._configuratorViewModel.getComponents().find(({roomleId:t})=>t===e);t?this._sceneEventHandler.clickComponent(t):console.warn('Can not select "'+e+'" because it was not found')}highlightParts(e){this._highlight(null,e),this._requestRender()}_shouldHighlight(){return this._kernelAccess.kernelInstance.getPlanComponentPossibleChildren(this._configuratorContext.rootComponentId).length>0}}return n([i],e.prototype,"_domHelper",void 0),n([i],e.prototype,"_scriptLoader",void 0),n([i],e.prototype,"_configuratorInputManager",void 0),n([i],e.prototype,"_configuratorUiCallbacks",void 0),n([i],e.prototype,"_configuratorMeshGenerator",void 0),n([i],e.prototype,"_memoryManager",void 0),n([i],e.prototype,"_lifeCycleManager",void 0),n([i],e.prototype,"_configuratorContext",void 0),n([i],e.prototype,"_kernelAccess",void 0),n([i],e.prototype,"_componentDimensioningHelper",void 0),n([i],e.prototype,"_configuratorViewModel",void 0),n([i],e.prototype,"_environmentLoader",void 0),n([i],e.prototype,"_pluginSystem",void 0),n([i],e.prototype,"_initData",void 0),n([i],e.prototype,"_configuratorHistory",void 0),e})(),Ae=(()=>{class e{constructor(e){this._activeComponents=[],this._creator_=e}setCamera(e){this._camera=e}add(e){const n=this._kernelAccess.kernelInstance.getComponent(e.roomleId);if(!n)return!1;const i=n.dimensionings;if(!i||0===i.length||this._camera.position.z<0)return!1;const s=E(n.boxForMeasurement),o={x:this._camera.position.x,y:this._camera.position.z};return t.import("./component-dimensioning-90a64e1e.nomodule.js").then(t=>{Ie.loadFont("static/rubik_regular-75bd7bb699e9e39d.json").then(n=>{i.forEach(i=>{e.add(new t.default(S(i),s,n,o))})})}),this._activeComponents.push(e),!0}remove(e,n=!0){return new Promise(i=>{t.import("./component-dimensioning-90a64e1e.nomodule.js").then(t=>{let s=[];e.children.forEach(e=>{e instanceof t.default&&s.push(e)}),s.forEach(t=>{e.remove(t),C(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=[]}clear(){}}return n([i],e.prototype,"_kernelAccess",void 0),e})();e("S",class{constructor(e){this._creator_=e}setScene(e){}setUiScene(e){}updateBounds(e){}clearScene(e,t){}moveCameraEnd(e){}moveCameraStart(e){}needsUiScene(){return!1}});let Oe=(()=>{class e{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-ef10525e.nomodule.js").then(({default:e})=>this._plugins.push(new e(this._creator_))),this._plugins.forEach(e=>e.setScene(this._scene)),this._plugins.forEach(e=>e.setUiScene(this._uiScene)),this._plugins.forEach(e=>e.updateBounds(this._bounds)),this._plugins.forEach(e=>e.moveCameraEnd(this._cameraPosition))}addPlugin(e){this._plugins.push(e),e.setScene(this._scene),e.setUiScene(this._uiScene),e.updateBounds(this._bounds),e.moveCameraEnd(this._cameraPosition)}updateBounds(e){this._bounds=e,this._plugins.forEach(t=>t.updateBounds(e))}clearScene(e,t){this._plugins.forEach(n=>n.clearScene(e,t))}getActivePlugins(){return this._plugins}getPlugin(e){for(let t of this._plugins)if(t instanceof e)return t;return null}moveCameraEnd(e){this._cameraPosition=e,this._plugins.forEach(t=>t.moveCameraEnd(e))}moveCameraStart(e){this._cameraPosition=e,this._plugins.forEach(t=>t.moveCameraStart(e))}needsUiScene(){return this._plugins.map(e=>e.needsUiScene()).reduce((e,t)=>e||t,!1)}}return n([i],e.prototype,"_initData",void 0),e})();class Te{constructor(){this._nonTransparentComponent=null,this._raycaster=new THREE.Raycaster,this._raycaster.near=.1,this._raycaster.layers.enable(3)}init(e,t){this._scene=e,this._camera=t,this.checkComponentVisibility=V(this.checkComponentVisibility,100).bind(this),this.checkPreviewVisibility=V(this.checkPreviewVisibility,100).bind(this)}changeMaterialsOnSelect(e,t,n=!1){t!==this._nonTransparentComponent&&(this._nonTransparentComponent=t,this._changeMaterialsOnSelect(e,t,n))}_changeMaterialsOnSelect(e,t,n=!1){if(e.children.length>0&&e.children.forEach(i=>{const s=t&&e.id===t.id||n,o=!(i instanceof THREE.Mesh);this._changeMaterialsOnSelect(i,t,(!s||!o)&&s)}),t)e instanceof THREE.Mesh&&e.material instanceof THREE.MeshStandardMaterial&&!e.userData.oldMaterial&&(e.userData.oldMaterial=e.material,e.material=e.material.clone(),n||P(e,{opacity:.2,transparent:!0}));else if(e.userData.oldMaterial&&e instanceof THREE.Mesh&&e.material instanceof THREE.MeshStandardMaterial){const{opacity:t,transparent:n}=e.userData.oldMaterial;P(e,{opacity:t,transparent:n}),e.userData.oldMaterial=void 0}}isComponentVisible(e){const t=[];e.traverse(e=>t.push(e.uuid));const n=(new THREE.Box3).setFromObject(e).getCenter(new THREE.Vector3),i=(new THREE.Vector3).subVectors(n,this._camera.position).normalize();this._raycaster.set(this._camera.position,i),this._raycaster.far=this._camera.position.distanceTo(n);const s=[];return this._raycaster.intersectObjects(this._scene.children,!0).forEach(e=>{e.object.material.visible&&(t.includes(e.object.uuid)||e.object.userData.ignoreComponentRaycast||s.push(e))}),0===s.length}checkComponentAndPreviewVisibility(e,t){e.hasSelection()?this.checkComponentVisibility(e,t):t.hasPreviews()?this.checkPreviewVisibility(t):this.changeMaterialsOnSelect(this._scene,null)}checkComponentVisibility(e,t){if(!e.hasSelection())return;const n=t.getComponentsForIds(e.getSelectedRuntimeComponentIds());if(n.length>1)return;const i=n[0];this.isComponentVisible(i)?this.changeMaterialsOnSelect(this._scene,null):this.changeMaterialsOnSelect(this._scene,i)}areAllPreviewsVisible(e){if(!e.hasPreviews())return!0;const t=e.getPreviews();return 0===t.length||t.map(e=>this.isComponentVisible(e)).reduce((e,t)=>e&&t)}checkPreviewVisibility(e){this.areAllPreviewsVisible(e)?this.changeMaterialsOnSelect(this._scene,null):this.changeMaterialsOnSelect(this._scene,{id:-1})}}var Le=Object.freeze({__proto__:null,default:Te});let Ue=(()=>{class e{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}}return n([i],e.prototype,"_configuratorUiCallbacks",void 0),e})();const Ve=[new I("kernel-access",we),new I("logger",k),new I("rapi-access",H),new I("script-loader",se),new I("unit-formatter",ye),new I("camera-control-3d",J),new I("camera-control",oe),new I("configurator-input-manager",class extends Q{},1),new I("data-syncer",R),new I("selection-handler",class extends N{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 Ee({component:e}))})}_checkStandard(e){this._selectedComponents.has(e.roomleId)?this.dispatchEvent(0,new Ee({component:e,consecutive:!0})):(this._selectedComponents.size>0&&this._selectedComponents.forEach((e,t)=>{this._selectedComponents.delete(t),this.dispatchEvent(1,new Ee({component:e,resetCamera:!1}))}),this._selectedComponents.set(e.roomleId,e),this.dispatchEvent(0,new Ee({component:e,consecutive:!1})))}_checkMulti(e){if(this._selectedComponents.has(e.roomleId))return this._selectedComponents.delete(e.roomleId),void this.dispatchEvent(1,new Ee({component:e,resetCamera:0===this._selectedComponents.size}));this._selectedComponents.set(e.roomleId,e),this.dispatchEvent(0,new Ee({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.roomleId)),e}isSelected(e){return this._selectedComponents.has(e.roomleId)}},1),new I("configurator-mesh-generator",_e),new I("configurator-ui-callbacks",W,1),new I("scene-helper",xe,1),new I("component-dimensioning-helper",Ae,1),new I("plugin-system",Oe,1),new I("component-raycast-helper",Te,0),new I("configurator-history",Ue,1)],Be=(e,t)=>e.sort||t.sort?e.sort?t.sort?e.sort-t.sort:-1:1:0,Fe=(e,t)=>e&&!t?1:!e&&t?-1:e&&t?e.localeCompare(t):0;let je=(()=>{class e{constructor(e){this._onInitDoneCollection=[],this._isKernelReady=!1,this._isWebGlReady=!1,this._isPreloadReady=!0,this._isLoadError=!1,this._isReloading=!1,this._needsSync=!1,this._creator_=e,this._configuratorKernelAccessCallback.addListener(this);const t=this._errorHandler;t.subscribe(0,e=>this._configuratorUiCallbacks.onErrorDueToOffline(e)),t.subscribe(1,e=>this._configuratorUiCallbacks.onError(e)),t.subscribe(2,(e,t)=>this._configuratorUiCallbacks.onContentProblem({rapiPath:e,ids:t,message:"Could not load the ids"}))}_isInitDone(){return this._isKernelReady&&this._isWebGlReady&&this._isPreloadReady}_checkInitDone(){this._isInitDone()&&(this._onInitDoneCollection.forEach(e=>e()),this._onInitDoneCollection=[])}_onInitDone(e){this._isInitDone()?e():this._onInitDoneCollection.push(e)}getScene(){return this._sceneHelper.getScene()}updateScene(){this._sceneHelper.updateScene()}_loadWebGlLib(e,t){this._threeLoader.fetch().then(()=>Promise.all(re.map(e=>this._scriptLoader.fetch(e,{id:e}))).then(this._loadingWebGlSuccess(e,t).bind(this),this.loadError.bind(this)),this.loadError.bind(this))}_loadingWebGlSuccess(e,t){return()=>{t&&this._sceneHelper.changeOffset(t);const{initialFloorMaterial:e,dls:n,ls:i,stats:s}=this._initData;let o=y.createDynamicLightSettingSource(n,i);this._enableHD(o),s&&this.showStats(),this._needsSync&&(this._needsSync=!1,this._kernelAccess.requestSync(h,this._configuratorContext.planObjectId));const r=[this._scriptLoader.fetch(ae,{id:"tween-js"})];e&&r.push(this._rapiAccess.getMaterial(e).then(e=>this._sceneHelper.changeFloorMaterial(e))),Promise.all(r).then(this._webGlIsReady.bind(this),this.loadError.bind(this))}}_webGlIsReady(){this._isWebGlReady=!0,this._checkInitDone()}_initPromiseCallback(e,t){this._isInitDone()?e():this._isLoadError?t("_initPromiseCallback failed"):(this._onInitDone(()=>e()),this._rejectOnLoadError=t)}_notifyOnConfigurationReady(e){return async t=>{const n=await this._kernelAccess.addUiDataAndPriceToPartList(t.partList,t.hash);t.partList=n,e(t),this._configuratorUiCallbacks.onConfigurationReady(n,t.hash,t.rootComponentLabel)}}_notifyOnConfigurationLoadingError(e){return t=>{this._configuratorUiCallbacks.onConfigurationLoadError(),e(t)}}_loadItemOrConfigById(e,t){this._configuratorContext.lastLoadedRapiId=e,this._onLoadConfiguration(),this._preloadPackage(e),this._clearScene();const{offlineSync:n}=this._initData;if(n){const t=M(e);t&&this._dataSyncer.start(t)}return new Promise((n,i)=>{(t?this._rapiAccess.getConfiguration(e):this._rapiAccess.getItem(e)).then(t=>{t&&t.configuration?this._loadConfiguration(t.configuration).then(e=>{const i=this._notifyOnConfigurationReady(n);t.label?this._notifyUiAboutNewItem(t,e.rootComponentLabel):this._notifyUiAboutNewConfiguration(t),i(e)},this._notifyOnConfigurationLoadingError(i).bind(this)):i(new Error("Could not load item or config with id "+e))},i)})}_shouldBroadcastToUi(e){return!(0===e&&this._configuratorContext.selectedRuntimeComponentId||1===e&&!this._configuratorContext.selectedRuntimeComponentId||2===e&&!this._configuratorContext.selectedRuntimeComponentIds.length)}_isCorrectResponse(e,t){if(0===e)return t===this._configuratorContext.planObjectId;if(1===e)return t===this._configuratorContext.selectedRuntimeComponentId;const n=t.length;if(n!==this._configuratorContext.selectedRuntimeComponentIds.length)return!1;for(let e=0;e<n;e++)if(t[e]!==this._configuratorContext.selectedRuntimeComponentIds[e])return!1;return!0}_onLoadConfiguration(){this._clearScene(),this._configuratorUiCallbacks.onLoadConfiguration()}_clearScene(){this._sceneHelper&&this._sceneHelper.clearScene()}_notifyUiAboutNewItem(e,t){this._rapiAccess.getCatalog(e.catalog).then(n=>this._configuratorUiCallbacks.onConfigurationLabelChange(n.name,e.label,t))}_notifyUiAboutNewConfiguration(e){Promise.all([this._rapiAccess.getCatalog(e.catalog),this._rapiAccess.getComponent(e.rootComponentId)]).then(([e,t])=>this._configuratorUiCallbacks.onConfigurationLabelChange(e.name,null,t.label))}_getMaterialGroups(e){const t=(e,t)=>{let n=Be(e,t);return 0!==n?n:(n=Fe(e.label,t.label),0!==n?n:Fe(e.id,t.id))},n=e=>(e.sort(t),e.forEach(e=>e.materials.sort(t)),e);if(e.validGroups.length>0)return new Promise((t,i)=>this._rapiAccess.getMaterialsByGroup(e.validGroups).then(e=>t(n(e)),i));const i=[];return e.validValues.forEach(e=>i.push(e.value)),new Promise((e,t)=>{this._rapiAccess.getMaterials(i).then(t=>{this._rapiAccess.combineMaterialsToGroups(t).then(t=>{e(n(t))})},t)})}_loadConfiguration(e){return this._kernelAccess.externalMeshQueue.clear(),new Promise((t,n)=>{const i=()=>{const{x:i,y:s}=this._domHelper.getClientDimensions();if(i<=0&&s<=0){let e="Size of canvas is 0/0! When using embedding set correct size or remove id to load in idle mode!";return console.error(e),n(e)}this.resumeKernelCallbacks(),o.start("ui_load_configuration");const r=[];if(this._initData.applyCurrentGlobalParameters){const e=this._configuratorContext.planObjectId,t=this._configuratorContext.rootComponentParametersAsGlobal;r.push(this._kernelAccess.getGlobalParameters(e,t))}Promise.all(r).then(([i])=>{const s=[a.waitFor(4),a.waitFor(2)];Promise.all(s).then(([e,[n,s,o,r]])=>{const a=[];i&&this._initData.applyCurrentGlobalParameters&&i.forEach(e=>a.push(this.setParameter(e,e.value,!0)));const l=this._rapiAccess.peekComponent(r);Promise.all(a).then(()=>{const n=[];a.length&&(n.push(this._kernelAccess.getPartList()),n.push(this._kernelAccess.getConfigurationHash(this._configuratorContext))),Promise.all(n).then(async n=>{const i=n&&n[0]?n[0]:s,r=n&&n[1]?n[1]:o,a=await this._kernelAccess.addUiDataAndPriceToPartList(i,r);let h=e.errors;const c=h?_(h):[];t({partList:a,hash:r,rootComponentLabel:l?l.label:"",errors:c})})})},n),this._kernelAccess.loadConfiguration(e)},n)};this._onInitDone(()=>i())})}_preLoadItemOrConfig(e,t){return new Promise((n,i)=>{(t?this._rapiAccess.getConfiguration(e):this._rapiAccess.getItem(e)).then(n,i)})}_preloadPackage(e){this._isPreloadReady=!1;let t=null;t=D(e)?this._rapiAccess.getPreloadForItem.bind(this._rapiAccess):this._rapiAccess.getPreloadForConfiguration.bind(this._rapiAccess),o.start("rapi_preloads");const n=()=>{o.end("rapi_preloads");const t=o.getMeasure("rapi_preloads");if(Array.isArray(t)&&1===t.length){const n=t[0];this._configuratorUiCallbacks.onTrackTiming("Timing","RapiPreloads",Math.round(n.duration),{id:e})}};t(e).then(()=>{this._isPreloadReady=!0,this._checkInitDone(),n()},e=>{this._isPreloadReady=!0,this._checkInitDone(),console.error(e),n()})}_reloadConfiguration(e,t,n,i){return this._performLoadConfiguration(e).then(e=>{this._isReloading=!1,n(e)},e=>{this._isReloading=!1,i(e)})}_performLoadConfiguration(e){return this._onLoadConfiguration(),new Promise((t,n)=>{this._initData.preloadHint?this._preloadPackage(this._initData.preloadHint):console.warn("When loading a configuration string you have to supply a preloadHint to use fast loading!"),setTimeout(()=>{this._loadConfiguration(e).then(this._notifyOnConfigurationReady(t).bind(this),this._notifyOnConfigurationLoadingError(n).bind(this))},0)})}_changeHDGeometry(e){return new Promise((t,n)=>e===r.useHDGeometry?t():this._isReloading?n("Change of HD Geometry in progress"):(this._isReloading=!0,a.waitFor(3).then(([e,i])=>{this._reloadConfiguration(e,i,t,n)},n),r.useHDGeometry=e,void this._kernelAccess.changeUseOfHDGeometry(this._configuratorContext,r.useHDGeometry)))}setOverrides(e){e&&(this._initData.setOverrides(e),this._globalInitData.setOverrides(e))}init(e,t){this.setOverrides(t);const{preloadHint:n,offset:i,startTag:s}=this._initData;return this._domHelper.setDomElement(e),n?this._preloadPackage(n):console.warn("No preload hint! Therefore no preload during init!!"),s&&this.getTagById(s,{include:["items"]}).then(e=>this._configuratorUiCallbacks.onOpenTag(e),e=>console.error(e)),this._loadWebGlLib(e,i),new Promise(this._initPromiseCallback.bind(this))}cancelSelection(){this._sceneHelper.cancelSelection()}enableHDGeometry(){return this._changeHDGeometry(!0)}disableHDGeometry(){return this._changeHDGeometry(!1)}changeOffset(e){this._sceneHelper.changeOffset(e)}previewDockings(e,t,n){this._sceneHelper.requestDockingsPreview(!0,e,t,n)}cancelDockings(){this._sceneHelper.cancelDockings()}requestDeleteComponent(){this._sceneHelper.requestDeleteSelectedComponent()}renderImage(e){return this._sceneHelper.renderImage(e)}preparePerspectiveImage(e={}){return this._sceneHelper.preparePerspectiveImage(e)}preparePartImage(e,t){let n={};return"number"==typeof t?n.size=t:(t||(t={}),"number"!=typeof t.size&&(t.size=256),n=t),this._sceneHelper.preparePartImage(e,n)}saveCurrentConfiguration(){return new Promise((e,t)=>{this._kernelAccess.getConfigurationData(this._configuratorContext.planObjectId).then(n=>{this._rapiAccess.saveConfiguration(n).then(n=>{this._configuratorUiCallbacks.onConfigurationSaved(n.configurationHash),this._rapiAccess.getComponent(n.rootComponentId).then(i=>{let s=!0,o=!0,r=n.perspectiveImage,a=n.topImage;n.perspectiveImage||(s=!1,this._sceneHelper.preparePerspectiveImage().then(l=>{this._rapiAccess.savePerspectiveImage(n,l).then(t=>{s=!0,r=t.perspectiveImage,o&&(t.label=i.label,t.topImage=a,e(t))},t)})),n.topImage||(o=!1,this._sceneHelper.prepareTopImage().then(l=>{this._rapiAccess.saveTopImage(n,l).then(t=>{o=!0,a=t.topImage,s&&(t.label=i.label,t.perspectiveImage=r,e(t))},t)})),s&&o&&(n.label=i.label,e(n))},e=>{throw new Error(e)})},t)}).catch(t)})}generateImagesOfCurrentConfiguration(){return new Promise((e,t)=>this.saveCurrentConfiguration().then(t=>e({topImage:t.topImage,perspectiveImage:t.perspectiveImage,isLocally:t.isLocally}),t))}prepareTopImage(e){let t={};return"boolean"==typeof e?t.showDimensions=e:(e||(e={}),"boolean"!=typeof e.showDimensions&&(e.showDimensions=!1),t=e),this._sceneHelper.prepareTopImage(t)}resetCameraPosition(){this._sceneHelper.resetCameraPositionToStart()}showBenchmarks(e){o.showBenchmarks(e)}debugSceneGraph(e){this._sceneHelper.debugSceneGraph(e)}async loadConfiguration(e,t){this.setOverrides(t),this._configuratorContext.lastLoadedRapiId=null,this._sceneHelper&&this._sceneHelper.clearScene();const n=await this._performLoadConfiguration(e);return this._rapiAccess.trackView("configuration string"),n}async loadConfigurationById(e,t){this.setOverrides(t);const n=await this._loadItemOrConfigById(e,!0);return this._rapiAccess.trackView(e),n}syncPlanObjectToView(e,t){this.resumeKernelCallbacks(),this._kernelAccess.requestSync(e,t),this._kernelAccess.requestPlanObjectConstruction(t);const n=this._kernelAccess.getSerializedConfiguration(t),i=this._kernelAccess.getCurrentConfigurationHash(t);this._kernelAccess.planObjectConfigurationUpdated(t,n,i),this._sceneHelper.resetCameraPositionToStart(!1)}async loadConfigurableItemById(e,t){this.setOverrides(t);const n=await this._loadItemOrConfigById(e,!1);return this._rapiAccess.trackView(e),n}preLoadConfigurationById(e){return this._preLoadItemOrConfig(e,!0)}preLoadConfigurableItemById(e){return this._preLoadItemOrConfig(e,!1)}_getTag(e){return this._rapiAccess.getTag(e)}_dispatchSetParameter(e,t,n,i,s){const r=this._configuratorContext.selectedRuntimeComponentId?"local":"global",a=o.start("kernel_change_param_"+r+"_"+e);switch(this._configuratorContext.selectionMode){case"standard":if(this._configuratorContext.selectedRuntimeComponentId||this._configuratorContext.rootComponentParametersAsGlobal){let o=this._configuratorContext.selectedRuntimeComponentId?this._configuratorContext.selectedRuntimeComponentId:this._configuratorContext.rootComponentId;this._kernelAccess.changeComponentParameter(o,e,t,n,i,s)}else this._kernelAccess.changePlanObjectParameter(this._configuratorContext.planObjectId,e,t,n,i,s);break;case"multiselect":this._kernelAccess.changeCommonComponentParameter(this._configuratorContext.selectedRuntimeComponentIds,e,t,n,i,s)}o.end(a)}setParameter(e,t,n=!1){return new Promise((i,s)=>{const{key:o,type:r}=e;if(pe(e)){if(!n&&!this._unitFormatter.isParseableUnitString(t,e))return s(new SyntaxError('Value "'+t+'" is not parseable'));const i=n?t:this._unitFormatter.parseValue(t,e),{valueFrom:o,valueTo:a}=e.validRange,l=this._unitFormatter.getAllowedDelta();if(!Number.isNaN(o)&&i<o-l)return s(new RangeError('Value "'+t+'" is too small, min-val "'+o+'"'));if(!Number.isNaN(a)&&i>a+l)return s(new RangeError('Value "'+t+'" is too big, max-val "'+a+'"'));t="Integer"===r&&"number"==typeof i?i.toFixed():i.toString()}this._sceneHelper.cancelDockings(),this._dispatchSetParameter(o,r,t,i,s)})}setParameterOfPlanObject(e,t){return new Promise((n,i)=>{const{planObjectId:s,rootComponentId:o,rootComponentParametersAsGlobal:r}=this._configuratorContext,{type:a,key:l}=e;r?this._kernelAccess.changeComponentParameter(o,l,a,t,n,i):this._kernelAccess.changePlanObjectParameter(s,l,a,t,n,i)})}getParametersOfPlanObject(){const{planObjectId:e,rootComponentParametersAsGlobal:t}=this._configuratorContext;return this._kernelAccess.getGlobalParameters(e,t)}setParameterOfRootComponent(e,t){return new Promise((n,i)=>{const{rootComponentId:s}=this._configuratorContext,{type:o,key:r}=e;this._kernelAccess.changeComponentParameter(s,r,o,t,n,i)})}getParametersOfRootComponent(){const{planObjectId:e}=this._configuratorContext;return this._kernelAccess.getGlobalParameters(e,!0)}enableMultiselect(){this._sceneHelper.setSelectionMode("multiselect"),this._configuratorContext.selectionMode="multiselect"}disableMultiselect(){this._sceneHelper.setSelectionMode("standard"),this._configuratorContext.selectionMode="standard"}getCurrentConfiguration(){return a.waitFor(1,()=>this._kernelAccess.uiRequestConfiguration(this._configuratorContext.planObjectId))}loadComponentIntoKernel(e){return a.waitFor(0,()=>{let t=null;try{if(t=JSON.parse(e).id,!t)throw new Error("Component string has no ID")}catch(e){return this._configuratorUiCallbacks.onContentProblem({rapiPath:"components",ids:[t],message:"Component string is not a valid JSON or has no ID"}),void a.failOperation(0,e)}this._kernelIo.setMeta({componentId:t}),this._kernelAccess.loadComponentIntoKernel(e,t)})}getShortUrlOfCurrentConfiguration(){return new Promise((e,t)=>{this.saveCurrentConfiguration().then(n=>navigator.onLine?this._rapiAccess.getShortUrl(n.id,3).then(t=>{const n=t.shortId,i=d.APP.SHORTENER_URL+n;e(i)},t):t("Can not generate short url when offline"),t)})}formatValueToUnitString(e,t){return this._unitFormatter.formatValueToUnitString(e,t)}getTagById(e,t){return new Promise((n,i)=>{this._getTag(e).then(e=>{let s=Promise.resolve([]),o=Promise.resolve([]);t&&t.include&&t.include.forEach(t=>{"materials"===t&&(s=this._rapiAccess.getMaterialsOf(e)),"items"===t&&(o=this._rapiAccess.getItems(e.items))}),Promise.all([s,o]).then(([t,i])=>(i.sort(Be),t.sort(Be),n({...e,items:i,materials:t})),i)},i)})}requestAsset(e){return this._dataSyncer.requestAsset(e)}changeFloorMaterial(e){return this._sceneHelper.changeFloorMaterial(e)}async changeFloorMaterialById(e){const t=await this._rapiAccess.getMaterial(e);return this._sceneHelper.changeFloorMaterial(t)}openFloorMaterials(){this._configuratorUiCallbacks.onOpenFloorMaterials()}openPartList(){this._configuratorUiCallbacks.onOpenPartList()}getAdditionalContentsOf(e){return this._rapiAccess.getAdditionalContentsOfItems(e)}changeTypeChangeTag(e){navigator.onLine&&this._initData.offlineSync&&this._dataSyncer.syncTypeChangeTag(e),this._configuratorUiCallbacks.onChangeTypeChangeTag(e)}removeTypeChangeTag(e){this._configuratorUiCallbacks.onRemoveTypeChangeTag(e)}showGUI(){const e=document.createElement("style");e.innerText=".dg.ac {right:auto!important}",document.head.appendChild(e),this._scriptLoader.fetch(le,{id:"dat-gui-js"}).then(()=>this._sceneHelper.showGUI(),e=>console.error(e))}showStats(){this._sceneHelper.showStats()}showDimensions(){this._sceneHelper.showDimensions()}hideDimensions(){this._sceneHelper.hideDimensions()}syncCatalog(e){return this._dataSyncer.syncCatalog(e)}syncFloorTag(e){return this._dataSyncer.syncFloorTag(e)}syncTypeChangeTag(e){return this._dataSyncer.syncTypeChangeTag(e)}loadDynamicLightSetting(e){return this._sceneHelper.loadDynamicLightSetting(e)}setBackgroundColor(e){this._sceneHelper.setBackgroundColor(e)}setBackgroundImage(e){this._sceneHelper.setBackgroundImage(e)}setBakedShadow(e,t){this._sceneHelper.setBakedShadow(e,t)}loadSceneSetting(e){return this._sceneHelper.loadSceneSettings(e)}enableMeshSelection(e){this._initData.meshSelection=e}updateSize(){this._sceneHelper.updateSize()}setCameraOffset(e){this._sceneHelper.setCameraOffset(e)}getCameraOffset(){return this._sceneHelper.getCameraOffset()}getMain(){}cleanup(e={}){this._configuratorContext.selectedRuntimeComponentIds=[],this._kernelAccess.cleanUpCallbacks(),this._sceneHelper.sceneCleared(!!e.resetMeshCache),e.resetCoreCache&&this._kernelAccess.kernelInstance.clearAll(),e.resetApiCache&&this._rapiAccess.cleanUp()}resumeTest(e){e&&this._domHelper.setDomElement(e),this._lifeCycleManager.resume()}pauseTest(){this._lifeCycleManager.pause()}zoomIn(e){this._sceneHelper.zoomIn(e)}zoomOut(e){this._sceneHelper.zoomOut(e)}get callbacks(){return this._configuratorUiCallbacks}get globalCallbacks(){return this._globalCallback}getRuntimeComponentIdOfRootComponent(){const e=this._configuratorContext.planObjectId;return e?this._kernelAccess.getRuntimeComponentIdOfRootComponent(e):(console.warn("planObjectId not set"),0)}getCurrentConfigurationHash(){return this._kernelAccess.getConfigurationHash(this._configuratorContext)}getCurrentSelection(){let e=this._configuratorContext.selectedRuntimeComponentIds;return e&&e.length||(e=[this._configuratorContext.rootComponentId]),e.map(e=>this._kernelAccess.getRuntimeComponentId(e))}_enableHD(e){return new Promise((t,n)=>{this._scriptLoader.fetch(he,{id:"pi-js"}).then(()=>{this._sceneHelper.enableHD(e),t()},n)})}isReady(){const e=o.getMeasure("kernel_is_ready");if(Array.isArray(e)&&1===e.length){const t=e[0],n=o.getMeta("kernel_is_ready");this._configuratorUiCallbacks.onTrackTiming("Timing","KernelIsReady",Math.round(t.duration),Object.assign(n,{startTime:t.startTime}))}this._isKernelReady=!0,this._checkInitDone(),"function"==typeof this._configuratorUiCallbacks.onKernelIsReady&&this._configuratorUiCallbacks.onKernelIsReady()}updatePossibleChildren(e,t,n){const i=[],s=[];let o;const r=new Map,a=new Map;for(let e=0,n=t.length;e<n;e++){const n=t[e];if(!n.possible)continue;let l=n.itemId;n.itemId?(s.push(n.itemId),a.set(n.itemId,n)):(i.push(n.componentId),r.set(n.componentId,n),l=n.componentId),n.isDefault&&!o&&(o=l)}Promise.all([this._rapiAccess.getComponents(i),this._rapiAccess.getItems(s)]).then(e=>{const t=[],n=e[0],i=e[1];let s;for(let e=0,i=n.length;e<i;e++){const i=n[e];i.isItem=!1,i.isComponent=!0;const a=r.get(i.id);a&&(i.group=a.group),i.id===o&&(i.isDefault=!0,s=i),t.push(i)}for(let e=0,n=i.length;e<n;e++){const n=i[e];n.isItem=!0,n.isComponent=!1;const r=a.get(n.id);r&&(n.group=r.group),n.id===o&&(n.isDefault=!0,s=n),t.push(n)}return t.sort(Be),{possibleChildren:t,defaultChild:s||null}}).then(({possibleChildren:e,defaultChild:t})=>{const n=[],i=new Map,s=[];for(let t=0,o=e.length;t<o;t++){const o=e[t],r=o.tags;if(o.tags&&Array.isArray(o.tags)&&o.tags.length)for(let e=0,t=o.tags.length;e<t;e++){const t=r[e];-1===n.indexOf(t)&&n.push(t);let s=i.get(t);if(!s){const e=[];i.set(t,e),s=i.get(t)}s.push(o)}else s.push(o)}return{tagIds:n,associations:i,defaultChild:t,noTagChilds:s}}).then(({tagIds:t,associations:i,defaultChild:s,noTagChilds:o})=>{this._rapiAccess.getTags(t).then(t=>{if(this._isCorrectResponse(n,e)&&this._shouldBroadcastToUi(n)){for(let e=0,n=t.length;e<n;e++){const n=t[e];n.possibleChildren=i.get(n.id)}t.sort(Be),o.length&&t.unshift({id:"",externalIdentifier:"",global:!1,created:(new Date).toISOString(),updated:(new Date).toISOString(),language:this._globalInitData.locale,catalog:null,tags:[],parents:[],materials:[],items:[],possibleChildren:o}),this._configuratorUiCallbacks.onUpdatePossibleChildren(t,s)}},e=>{console.error("Couldnt load tags of possible children"),console.error(e)})},e=>console.error(e))}updateParameters(e,t,n,i){const s={};t||(t=[],console.warn("Kernel returned no parameter groups! Check why!")),t.forEach(e=>{s[e.key]=e}),e.sort(Be),e.forEach(e=>{e.group?e.grouping=s[e.group]:e.grouping=null,this._unitFormatter.formatParameter(e),fe(e)&&Object.defineProperty(e,"groups",{get:()=>new Promise((t,s)=>{this._getMaterialGroups(e).then(e=>{this._isCorrectResponse(i,n)&&this._shouldBroadcastToUi(i)?t(e):s("Response does not match to ids")},s)})})}),this._shouldBroadcastToUi(i)&&this._configuratorUiCallbacks.onUpdateParameters(e)}loadError(e){this._isLoadError=!0,this._rejectOnLoadError&&this._rejectOnLoadError(e)}resumeKernelCallbacks(){this._kernelAccess.muteKernelCallbacks=!1,this._kernelAccess.resume()}pauseKernelCallbacks(){this._kernelAccess.muteKernelCallbacks=!0,this._kernelAccess.pause()}setActiveGroupInView(e){this._kernelAccess.setActiveGroupInView(e)}getParameterGroups(){return this._kernelAccess.getParameterGroups()}async getConfiguratorSettings(e){return this._rapiAccess.getConfiguratorSettings(e)}async moveCamera(e){return this._sceneHelper.moveCamera(e)}selectComponent(e){return this._configuratorContext.selectedRuntimeComponentId===e?Promise.resolve():Promise.resolve(this._sceneHelper.selectComponent(e))}setComponentParameter(e,t,n){const{key:i,type:s}=t;return new Promise((t,o)=>this._kernelAccess.changeComponentParameter(e,i,s,n,t,o))}highlightParts(e){this._sceneHelper.highlightParts(e)}undo(){const e=this._configuratorHistory.undo();e&&this._kernelAccess.loadConfiguration(e)}redo(){const e=this._configuratorHistory.redo();e&&this._kernelAccess.loadConfiguration(e)}clearHistory(){this._configuratorHistory.clearHistory()}getHashOfSerializedConfiguration(e){return this._kernelAccess.kernelInstance.getHashOfSerializedConfiguration(e)}}return n([i],e.prototype,"_rapiAccess",void 0),n([i],e.prototype,"_dataSyncer",void 0),n([i],e.prototype,"_errorHandler",void 0),n([i],e.prototype,"_unitFormatter",void 0),n([i],e.prototype,"_domHelper",void 0),n([i],e.prototype,"_configuratorUiCallbacks",void 0),n([i],e.prototype,"_configuratorKernelAccessCallback",void 0),n([i],e.prototype,"_lifeCycleManager",void 0),n([i],e.prototype,"_kernelAccess",void 0),n([i],e.prototype,"_threeLoader",void 0),n([i],e.prototype,"_scriptLoader",void 0),n([i],e.prototype,"_configuratorContext",void 0),n([i],e.prototype,"_sceneHelper",void 0),n([i],e.prototype,"_initData",void 0),n([i],e.prototype,"_globalInitData",void 0),n([i],e.prototype,"_globalCallback",void 0),n([i],e.prototype,"_kernelIo",void 0),n([i],e.prototype,"_configuratorHistory",void 0),e})();class Ge extends ce{setupDependencies(){x.setup(Ve),this.lookup("kernel-access",this._context),this.lookup("rapi-access",this._context),this.lookup("script-loader",this._context),this.lookup("logger",this._context)}cleanUpGlobals(){delete window.RoomleConfigurator}cleanUpDependencies(){const e=this.lookup("script-loader"),t=this.lookup("rapi-access"),n=(this.lookup("dom-helper"),this.lookup("scene-helper"));e&&e.cleanUp(),t&&t.cleanUp(),n&&n.cleanUp()}setupGlobals(e){const{kernelInstance:t,kernelContainer:n,planObjectId:i}=e||{};r.init({kernelInstance:t,kernelContainer:n,planObjectId:i})}getApi(){return this._configurator}bootFinished(){this._configurator=new je(this._context),this._configurator.getMain=()=>this,window.RoomleConfigurator||(window.RoomleConfigurator=this._configurator)}getContextName(){return"configurator"}}e("C",Ge),e("c",Object.freeze({__proto__:null,Configurator:Ge}))}}}));
2
+ //# sourceMappingURL=configurator-b4dc0536.nomodule.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"configurator-b2187c1b.nomodule.js","sources":["../../packages/configurator-core/public/fonts/rubik_regular_sub.json","../../packages/configurator-core/public/geometry/AddButtonRound.glb","../../packages/configurator-core/public/fonts/rubik_regular.json"],"sourcesContent":["export default \"static/rubik_regular_sub-eb3f3b61078695cc.json\"","export default \"static/AddButtonRound-8004fa7dffdf7501.glb\"","export default \"static/rubik_regular-75bd7bb699e9e39d.json\""],"names":[],"mappings":"wzrBAAe,oxBCAA,+h/CCAA"}
1
+ {"version":3,"file":"configurator-b4dc0536.nomodule.js","sources":["../../packages/configurator-core/public/fonts/rubik_regular_sub.json","../../packages/configurator-core/public/geometry/AddButtonRound.glb","../../packages/configurator-core/public/fonts/rubik_regular.json"],"sourcesContent":["export default \"static/rubik_regular_sub-eb3f3b61078695cc.json\"","export default \"static/AddButtonRound-8004fa7dffdf7501.glb\"","export default \"static/rubik_regular-75bd7bb699e9e39d.json\""],"names":[],"mappings":"kzrBAAe,oxBCAA,gl/CCAA"}