@roomle/web-sdk 2.22.0 → 2.23.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (227) hide show
  1. package/lib/{banana-for-scale-2c3d2d66.nomodule.js → banana-for-scale-42de697a.nomodule.js} +2 -2
  2. package/lib/{banana-for-scale-2c3d2d66.nomodule.js.map → banana-for-scale-42de697a.nomodule.js.map} +1 -1
  3. package/lib/{banana-for-scale-b4820033.js → banana-for-scale-b84603f2.js} +2 -2
  4. package/lib/{banana-for-scale-b4820033.js.map → banana-for-scale-b84603f2.js.map} +1 -1
  5. package/lib/{budgeteer-measure-4cffd344.js → budgeteer-measure-05dc445d.js} +2 -2
  6. package/lib/{budgeteer-measure-4cffd344.js.map → budgeteer-measure-05dc445d.js.map} +1 -1
  7. package/lib/budgeteer-measure.nomodule.js +1 -1
  8. package/lib/{component-dimensioning-bf032e70.js → component-dimensioning-93634fec.js} +2 -2
  9. package/lib/component-dimensioning-93634fec.js.map +1 -0
  10. package/lib/{component-dimensioning-7d6fcd93.nomodule.js → component-dimensioning-c0ac56ff.nomodule.js} +2 -2
  11. package/lib/component-dimensioning-c0ac56ff.nomodule.js.map +1 -0
  12. package/lib/configurator-7e58ca7c.js +2 -0
  13. package/lib/{configurator-e4ba2c2c.js.map → configurator-7e58ca7c.js.map} +1 -1
  14. package/lib/configurator-c125c3c8.nomodule.js +2 -0
  15. package/lib/{configurator-202956f4.nomodule.js.map → configurator-c125c3c8.nomodule.js.map} +1 -1
  16. package/lib/configurator-main-da006b54.js +2 -0
  17. package/lib/configurator-main-da006b54.js.map +1 -0
  18. package/lib/configurator-main.nomodule.js +1 -1
  19. package/lib/{configurator-mesh-generator-6381a017.nomodule.js → configurator-mesh-generator-2f342c08.nomodule.js} +2 -2
  20. package/lib/configurator-mesh-generator-2f342c08.nomodule.js.map +1 -0
  21. package/lib/{configurator-mesh-generator-e0559b97.js → configurator-mesh-generator-b3fb022a.js} +2 -2
  22. package/lib/configurator-mesh-generator-b3fb022a.js.map +1 -0
  23. package/lib/{default-light-setting-269087a3.nomodule.js → default-light-setting-2218084f.nomodule.js} +2 -2
  24. package/lib/default-light-setting-2218084f.nomodule.js.map +1 -0
  25. package/lib/{default-light-setting-4c54f308.js → default-light-setting-dbb59ba5.js} +2 -2
  26. package/lib/default-light-setting-dbb59ba5.js.map +1 -0
  27. package/lib/definitions/common-core/__tests__/{feature-detection.d.ts → utils/rapi-utils.d.ts} +0 -0
  28. package/lib/definitions/common-core/mock/kernel-instances.d.ts +1 -0
  29. package/lib/definitions/common-core/src/common-configurator-kernel-callback.d.ts +2 -2
  30. package/lib/definitions/common-core/src/services/common-kernel-access.d.ts +2 -2
  31. package/lib/definitions/common-core/src/utils/feature-detection.d.ts +0 -1
  32. package/lib/definitions/common-core/src/utils/rapi-utils.d.ts +4 -0
  33. package/lib/definitions/common-core/src/view-model/configurator-view-model.d.ts +2 -2
  34. package/lib/definitions/common-core/src/webgl/scene-manager.d.ts +12 -1
  35. package/lib/definitions/planner-core/src/roomle-planner.d.ts +8 -0
  36. package/lib/definitions/typings/kernel.d.ts +1 -0
  37. package/lib/{dimensioning-helper-36169ebe.js → dimensioning-helper-1047e166.js} +2 -2
  38. package/lib/dimensioning-helper-1047e166.js.map +1 -0
  39. package/lib/{dimensioning-helper-e6459147.nomodule.js → dimensioning-helper-e5a1f92b.nomodule.js} +2 -2
  40. package/lib/dimensioning-helper-e5a1f92b.nomodule.js.map +1 -0
  41. package/lib/{glb-viewer-1455d26c.js → glb-viewer-58c75d10.js} +2 -2
  42. package/lib/{glb-viewer-1455d26c.js.map → glb-viewer-58c75d10.js.map} +1 -1
  43. package/lib/{glb-viewer-c1eff647.nomodule.js → glb-viewer-b176add0.nomodule.js} +2 -2
  44. package/lib/{glb-viewer-c1eff647.nomodule.js.map → glb-viewer-b176add0.nomodule.js.map} +1 -1
  45. package/lib/glb-viewer-main-fd9ff00c.js +2 -0
  46. package/lib/glb-viewer-main-fd9ff00c.js.map +1 -0
  47. package/lib/glb-viewer-main.nomodule.js +1 -1
  48. package/lib/image-renderer-7e5f1199.js +2 -0
  49. package/lib/{image-renderer-eccb80a5.js.map → image-renderer-7e5f1199.js.map} +1 -1
  50. package/lib/image-renderer-cfd9ed49.nomodule.js +2 -0
  51. package/lib/{image-renderer-dd3a3b56.nomodule.js.map → image-renderer-cfd9ed49.nomodule.js.map} +1 -1
  52. package/lib/legacy/banana-for-scale-346de2e4.legacy.js +2 -0
  53. package/lib/legacy/{banana-for-scale-d9fdb6d4.legacy.js.map → banana-for-scale-346de2e4.legacy.js.map} +1 -1
  54. package/lib/legacy/budgeteer-measure.legacy.js +1 -1
  55. package/lib/legacy/{component-dimensioning-104a6bc1.legacy.js → component-dimensioning-629f2f3a.legacy.js} +2 -2
  56. package/lib/legacy/component-dimensioning-629f2f3a.legacy.js.map +1 -0
  57. package/lib/legacy/configurator-44d35a54.legacy.js +2 -0
  58. package/lib/legacy/{configurator-6b788202.legacy.js.map → configurator-44d35a54.legacy.js.map} +1 -1
  59. package/lib/legacy/configurator-main.legacy.js +1 -1
  60. package/lib/legacy/configurator-mesh-generator-aeaab699.legacy.js +2 -0
  61. package/lib/legacy/configurator-mesh-generator-aeaab699.legacy.js.map +1 -0
  62. package/lib/legacy/{default-light-setting-78b9795d.legacy.js → default-light-setting-fbdf535e.legacy.js} +2 -2
  63. package/lib/legacy/default-light-setting-fbdf535e.legacy.js.map +1 -0
  64. package/lib/legacy/{dimensioning-helper-aa9f32c4.legacy.js → dimensioning-helper-6a7e8c77.legacy.js} +2 -2
  65. package/lib/legacy/dimensioning-helper-6a7e8c77.legacy.js.map +1 -0
  66. package/lib/legacy/{glb-viewer-47215461.legacy.js → glb-viewer-d5a57e08.legacy.js} +2 -2
  67. package/lib/legacy/{glb-viewer-47215461.legacy.js.map → glb-viewer-d5a57e08.legacy.js.map} +1 -1
  68. package/lib/legacy/glb-viewer-main.legacy.js +1 -1
  69. package/lib/legacy/image-renderer-49deaae2.legacy.js +2 -0
  70. package/lib/legacy/{image-renderer-50475591.legacy.js.map → image-renderer-49deaae2.legacy.js.map} +1 -1
  71. package/lib/legacy/{main-thread-to-worker-66323030.legacy.js → main-thread-to-worker-880d5b78.legacy.js} +2 -2
  72. package/lib/legacy/main-thread-to-worker-880d5b78.legacy.js.map +1 -0
  73. package/lib/legacy/material-viewer-2e21a4f7.legacy.js +2 -0
  74. package/lib/legacy/material-viewer-2e21a4f7.legacy.js.map +1 -0
  75. package/lib/legacy/material-viewer-main.legacy.js +1 -1
  76. package/lib/legacy/mesh-generator-a9938ee3.legacy.js +2 -0
  77. package/lib/legacy/mesh-generator-a9938ee3.legacy.js.map +1 -0
  78. package/lib/legacy/{pixotron-e22efd52.legacy.js → pixotron-0b1d662e.legacy.js} +2 -2
  79. package/lib/legacy/{pixotron-e22efd52.legacy.js.map → pixotron-0b1d662e.legacy.js.map} +1 -1
  80. package/lib/legacy/planner-e6a2af12.legacy.js +2 -0
  81. package/lib/legacy/{planner-4e739fba.legacy.js.map → planner-e6a2af12.legacy.js.map} +1 -1
  82. package/lib/legacy/planner-main.legacy.js +1 -1
  83. package/lib/legacy/rapi-access-9e79a6ed.legacy.js +16 -0
  84. package/lib/legacy/{rapi-access-41e0190e.legacy.js.map → rapi-access-9e79a6ed.legacy.js.map} +1 -1
  85. package/lib/legacy/roomle-sdk.legacy.js +1 -1
  86. package/lib/legacy/scene-manager-e16780a8.legacy.js +2 -0
  87. package/lib/legacy/scene-manager-e16780a8.legacy.js.map +1 -0
  88. package/lib/legacy/static/ConfiguratorKernel-7824c66aefcb2b41.js +137 -0
  89. package/lib/legacy/static/ConfiguratorKernel-c4705c3beab2c75c.wasm +0 -0
  90. package/lib/legacy/static/ConfiguratorKernelJs-66c44fdd795cfb97.mem +0 -0
  91. package/lib/legacy/static/ConfiguratorKernelJs-dd4ecf875e7d0682.js +185 -0
  92. package/lib/legacy/static/RoomleCore-6f789e05759fd700.wasm +0 -0
  93. package/lib/legacy/static/RoomleCore-7bc4605b421746fa.js +150 -0
  94. package/lib/legacy/static/RoomleCoreJs-208bd06646f38679.mem +0 -0
  95. package/lib/legacy/static/RoomleCoreJs-344db042f996462a.js +199 -0
  96. package/lib/legacy/static/shaders-3d797579ff9c12c0.json +1 -0
  97. package/lib/legacy/{stats-helper-5a5aa20f.legacy.js → stats-helper-b0faba70.legacy.js} +2 -2
  98. package/lib/legacy/{stats-helper-5a5aa20f.legacy.js.map → stats-helper-b0faba70.legacy.js.map} +1 -1
  99. package/lib/{main-thread-to-worker-3b2ebd37.js → main-thread-to-worker-91bf9f5e.js} +2 -2
  100. package/lib/main-thread-to-worker-91bf9f5e.js.map +1 -0
  101. package/lib/{main-thread-to-worker-35970716.nomodule.js → main-thread-to-worker-bb844d54.nomodule.js} +2 -2
  102. package/lib/main-thread-to-worker-bb844d54.nomodule.js.map +1 -0
  103. package/lib/material-viewer-4e03269a.nomodule.js +2 -0
  104. package/lib/material-viewer-4e03269a.nomodule.js.map +1 -0
  105. package/lib/material-viewer-f16c52e4.js +2 -0
  106. package/lib/material-viewer-f16c52e4.js.map +1 -0
  107. package/lib/material-viewer-main-3b415873.js +2 -0
  108. package/lib/material-viewer-main-3b415873.js.map +1 -0
  109. package/lib/material-viewer-main.nomodule.js +1 -1
  110. package/lib/mesh-generator-64203565.nomodule.js +2 -0
  111. package/lib/mesh-generator-64203565.nomodule.js.map +1 -0
  112. package/lib/mesh-generator-c4f97fdc.js +2 -0
  113. package/lib/mesh-generator-c4f97fdc.js.map +1 -0
  114. package/lib/{pixotron-17562920.nomodule.js → pixotron-358442c5.nomodule.js} +2 -2
  115. package/lib/{pixotron-17562920.nomodule.js.map → pixotron-358442c5.nomodule.js.map} +1 -1
  116. package/lib/{pixotron-75c414e7.js → pixotron-5bb3aafe.js} +2 -2
  117. package/lib/{pixotron-75c414e7.js.map → pixotron-5bb3aafe.js.map} +1 -1
  118. package/lib/planner-be62add0.js +2 -0
  119. package/lib/{planner-981b523b.js.map → planner-be62add0.js.map} +1 -1
  120. package/lib/planner-eedd4bfc.nomodule.js +2 -0
  121. package/lib/{planner-d2b5e345.nomodule.js.map → planner-eedd4bfc.nomodule.js.map} +1 -1
  122. package/lib/planner-main-5b5f72b3.js +2 -0
  123. package/lib/planner-main-5b5f72b3.js.map +1 -0
  124. package/lib/planner-main.nomodule.js +1 -1
  125. package/lib/rapi-access-74fbaf72.nomodule.js +16 -0
  126. package/lib/{rapi-access-339cccf6.nomodule.js.map → rapi-access-74fbaf72.nomodule.js.map} +1 -1
  127. package/lib/rapi-access-f8222879.js +16 -0
  128. package/lib/{rapi-access-56a3e030.js.map → rapi-access-f8222879.js.map} +1 -1
  129. package/lib/{roomle-sdk-d699b12b.js → roomle-sdk-9ba1a888.js} +2 -2
  130. package/lib/roomle-sdk-9ba1a888.js.map +1 -0
  131. package/lib/roomle-sdk.nomodule.js +1 -1
  132. package/lib/scene-manager-4637ed82.js +2 -0
  133. package/lib/scene-manager-4637ed82.js.map +1 -0
  134. package/lib/scene-manager-86fe8139.nomodule.js +2 -0
  135. package/lib/scene-manager-86fe8139.nomodule.js.map +1 -0
  136. package/lib/static/ConfiguratorKernel-7824c66aefcb2b41.js +1 -0
  137. package/lib/static/ConfiguratorKernel-7824c66aefcb2b41.js.map +1 -0
  138. package/lib/static/ConfiguratorKernel-c4705c3beab2c75c.wasm +0 -0
  139. package/lib/static/ConfiguratorKernelJs-66c44fdd795cfb97.mem +0 -0
  140. package/lib/static/ConfiguratorKernelJs-dd4ecf875e7d0682.js +185 -0
  141. package/lib/static/RoomleCore-6f789e05759fd700.wasm +0 -0
  142. package/lib/static/RoomleCore-7bc4605b421746fa.js +1 -0
  143. package/lib/static/RoomleCore-7bc4605b421746fa.js.map +1 -0
  144. package/lib/static/RoomleCoreJs-208bd06646f38679.mem +0 -0
  145. package/lib/static/RoomleCoreJs-344db042f996462a.js +199 -0
  146. package/lib/static/shaders-3d797579ff9c12c0.json +1 -0
  147. package/lib/{stats-helper-aafa9349.js → stats-helper-1547b5d7.js} +2 -2
  148. package/lib/{stats-helper-aafa9349.js.map → stats-helper-1547b5d7.js.map} +1 -1
  149. package/lib/{stats-helper-ba55aea5.nomodule.js → stats-helper-4de133a6.nomodule.js} +2 -2
  150. package/lib/{stats-helper-ba55aea5.nomodule.js.map → stats-helper-4de133a6.nomodule.js.map} +1 -1
  151. package/package.json +2 -2
  152. package/lib/component-dimensioning-7d6fcd93.nomodule.js.map +0 -1
  153. package/lib/component-dimensioning-bf032e70.js.map +0 -1
  154. package/lib/configurator-202956f4.nomodule.js +0 -2
  155. package/lib/configurator-e4ba2c2c.js +0 -2
  156. package/lib/configurator-main-fda99924.js +0 -2
  157. package/lib/configurator-main-fda99924.js.map +0 -1
  158. package/lib/configurator-mesh-generator-6381a017.nomodule.js.map +0 -1
  159. package/lib/configurator-mesh-generator-e0559b97.js.map +0 -1
  160. package/lib/default-light-setting-269087a3.nomodule.js.map +0 -1
  161. package/lib/default-light-setting-4c54f308.js.map +0 -1
  162. package/lib/dimensioning-helper-36169ebe.js.map +0 -1
  163. package/lib/dimensioning-helper-e6459147.nomodule.js.map +0 -1
  164. package/lib/glb-viewer-main-51f2e92b.js +0 -2
  165. package/lib/glb-viewer-main-51f2e92b.js.map +0 -1
  166. package/lib/image-renderer-dd3a3b56.nomodule.js +0 -2
  167. package/lib/image-renderer-eccb80a5.js +0 -2
  168. package/lib/legacy/banana-for-scale-d9fdb6d4.legacy.js +0 -2
  169. package/lib/legacy/component-dimensioning-104a6bc1.legacy.js.map +0 -1
  170. package/lib/legacy/configurator-6b788202.legacy.js +0 -2
  171. package/lib/legacy/configurator-mesh-generator-7731c94d.legacy.js +0 -2
  172. package/lib/legacy/configurator-mesh-generator-7731c94d.legacy.js.map +0 -1
  173. package/lib/legacy/default-light-setting-78b9795d.legacy.js.map +0 -1
  174. package/lib/legacy/dimensioning-helper-aa9f32c4.legacy.js.map +0 -1
  175. package/lib/legacy/image-renderer-50475591.legacy.js +0 -2
  176. package/lib/legacy/main-thread-to-worker-66323030.legacy.js.map +0 -1
  177. package/lib/legacy/material-viewer-af50b7e7.legacy.js +0 -2
  178. package/lib/legacy/material-viewer-af50b7e7.legacy.js.map +0 -1
  179. package/lib/legacy/mesh-generator-8b81c1d2.legacy.js +0 -2
  180. package/lib/legacy/mesh-generator-8b81c1d2.legacy.js.map +0 -1
  181. package/lib/legacy/planner-4e739fba.legacy.js +0 -2
  182. package/lib/legacy/rapi-access-41e0190e.legacy.js +0 -16
  183. package/lib/legacy/scene-manager-7cc3251b.legacy.js +0 -2
  184. package/lib/legacy/scene-manager-7cc3251b.legacy.js.map +0 -1
  185. package/lib/legacy/static/ConfiguratorKernel-1b88030d6265aaff.js +0 -136
  186. package/lib/legacy/static/ConfiguratorKernel-c48bba1fe04aa93a.wasm +0 -0
  187. package/lib/legacy/static/ConfiguratorKernelJs-4dd1f28084d19b35.mem +0 -0
  188. package/lib/legacy/static/ConfiguratorKernelJs-af670baec2bbb83d.js +0 -185
  189. package/lib/legacy/static/RoomleCore-88de0e9427c61a4d.js +0 -149
  190. package/lib/legacy/static/RoomleCore-ea9beee28ea41195.wasm +0 -0
  191. package/lib/legacy/static/RoomleCoreJs-d698db3fbb66f567.mem +0 -0
  192. package/lib/legacy/static/RoomleCoreJs-f7aef02e52c95b45.js +0 -199
  193. package/lib/legacy/static/shaders-4fdbe00cbb7bfae5.json +0 -1
  194. package/lib/main-thread-to-worker-35970716.nomodule.js.map +0 -1
  195. package/lib/main-thread-to-worker-3b2ebd37.js.map +0 -1
  196. package/lib/material-viewer-6f991267.nomodule.js +0 -2
  197. package/lib/material-viewer-6f991267.nomodule.js.map +0 -1
  198. package/lib/material-viewer-f802d3e5.js +0 -2
  199. package/lib/material-viewer-f802d3e5.js.map +0 -1
  200. package/lib/material-viewer-main-fca4f2f8.js +0 -2
  201. package/lib/material-viewer-main-fca4f2f8.js.map +0 -1
  202. package/lib/mesh-generator-8cab5eb7.js +0 -2
  203. package/lib/mesh-generator-8cab5eb7.js.map +0 -1
  204. package/lib/mesh-generator-a0bc20a3.nomodule.js +0 -2
  205. package/lib/mesh-generator-a0bc20a3.nomodule.js.map +0 -1
  206. package/lib/planner-981b523b.js +0 -2
  207. package/lib/planner-d2b5e345.nomodule.js +0 -2
  208. package/lib/planner-main-8a934141.js +0 -2
  209. package/lib/planner-main-8a934141.js.map +0 -1
  210. package/lib/rapi-access-339cccf6.nomodule.js +0 -16
  211. package/lib/rapi-access-56a3e030.js +0 -16
  212. package/lib/roomle-sdk-d699b12b.js.map +0 -1
  213. package/lib/scene-manager-7cd0736c.nomodule.js +0 -2
  214. package/lib/scene-manager-7cd0736c.nomodule.js.map +0 -1
  215. package/lib/scene-manager-c953c6c0.js +0 -2
  216. package/lib/scene-manager-c953c6c0.js.map +0 -1
  217. package/lib/static/ConfiguratorKernel-1b88030d6265aaff.js +0 -1
  218. package/lib/static/ConfiguratorKernel-1b88030d6265aaff.js.map +0 -1
  219. package/lib/static/ConfiguratorKernel-c48bba1fe04aa93a.wasm +0 -0
  220. package/lib/static/ConfiguratorKernelJs-4dd1f28084d19b35.mem +0 -0
  221. package/lib/static/ConfiguratorKernelJs-af670baec2bbb83d.js +0 -185
  222. package/lib/static/RoomleCore-88de0e9427c61a4d.js +0 -1
  223. package/lib/static/RoomleCore-88de0e9427c61a4d.js.map +0 -1
  224. package/lib/static/RoomleCore-ea9beee28ea41195.wasm +0 -0
  225. package/lib/static/RoomleCoreJs-d698db3fbb66f567.mem +0 -0
  226. package/lib/static/RoomleCoreJs-f7aef02e52c95b45.js +0 -199
  227. package/lib/static/shaders-4fdbe00cbb7bfae5.json +0 -1
@@ -1,2 +1,2 @@
1
- System.register(["./query-params-helper-c231e1b8.nomodule.js","./rapi-access-339cccf6.nomodule.js","./main-thread-to-worker-35970716.nomodule.js","./image-renderer-dd3a3b56.nomodule.js","./pixotron-17562920.nomodule.js","./configurator-202956f4.nomodule.js","./mesh-generator-a0bc20a3.nomodule.js","./configurator-mesh-generator-6381a017.nomodule.js","./default-light-setting-269087a3.nomodule.js"],(function(e){var t,i,s,n,h,o;return{setters:[function(){},function(e){t=e.e,i=e._,s=e.i,n=e.F},function(){},function(){},function(){},function(e){h=e.A,o=e.R},function(){},function(){},function(){}],execute:function(){const a="component_dimensioning_plane_material",_="component_dimensioning_text_material";let d=(()=>{class e extends THREE.Object3D{constructor(e){super(),this._label="",this._parameters={font:null,size:.1,height:.001,curveSegments:2,bevelEnabled:!0,bevelThickness:.001,bevelSize:.001},this.topDown=!1,this._parameters.font=e,this._position=new THREE.Vector3,this._initMaterials(),this._init(),this._update()}_initMaterials(){this._cacheHolder.materialCache.has(a)?this._planeMaterial=this._cacheHolder.materialCache.get(a):(this._planeMaterial=new THREE.MeshBasicMaterial({color:16777215,side:THREE.DoubleSide,opacity:.8,transparent:!0}),this._cacheHolder.materialCache.set(a,this._planeMaterial)),this._cacheHolder.materialCache.has(_)?this._textMaterial=this._cacheHolder.materialCache.get(_):(this._textMaterial=new THREE.MeshPhongMaterial({color:3618615}),this._cacheHolder.materialCache.set(_,this._textMaterial))}_init(){let e=new THREE.Geometry;this._text=new THREE.Mesh(e,this._textMaterial),this._text.name="text with background text "+this._label,this._plane=new THREE.Mesh(e,this._planeMaterial),this._plane.name="text with background plane "+this._label,this._textGeometry=new THREE.TextGeometry(this._label,this._parameters),this._textGeometry.computeBoundingBox(),this._text.geometry=this._textGeometry,this.add(this._text),this.add(this._plane)}update(e,t,i,s){this._position.copy(e),this._dimensioningType=t,this._cameraPosition=s,this._label=i;const n=this._cameraPosition.distanceTo(this._text.position),h=Math.max(.01,n/100),o=Math.max(5e-4,n/5e3);this._parameters.bevelThickness=o,this._parameters.bevelSize=o,this._parameters.size=h,this._textGeometry=new THREE.TextGeometry(this._label,this._parameters),this._textGeometry.computeBoundingBox(),this._text.geometry=this._textGeometry,this._update()}_update(){if(this.topDown){let e=new THREE.Quaternion;e.setFromAxisAngle(new THREE.Vector3(-1,0,0),Math.PI/2),this._updateText(this._textGeometry,e,new THREE.Vector3)}else if(this._updateText(this._textGeometry,new THREE.Quaternion,new THREE.Vector3),this._cameraPosition){const e=Math.atan2(this._cameraPosition.x-this._position.x,this._cameraPosition.z-this._position.z);this._text.rotation.y=e,this._plane.rotation.y=e}}_updateText(e,t,i){let s=new THREE.Vector3;s.copy(this._position),i.x*=this._getXSign(),s.add(i);let n=e.boundingBox.getSize(new THREE.Vector3);e.center(),this._text.position.copy(s),this._text.quaternion.copy(t);let h=new THREE.PlaneGeometry(n.x+.02,n.y+.02,32);h.center(),this._plane.geometry=h,this._plane.position.copy(s),this._plane.quaternion.copy(t)}_getXSign(){return!this._cameraPosition||this._cameraPosition.x>=0?1:-1}dispose(){t(this)}}return i([s],e.prototype,"_cacheHolder",void 0),e})();e("default",(()=>{class e{constructor(e){this._cameraPosition=new THREE.Vector3,this._textUpdated=!1,this._topDimensions=!1,this._initialized=new n,this._enabled=!1,this._dimensionsVisible=!1,this._creator_=e,this._lineMaterial=new THREE.LineBasicMaterial({color:3618615,linewidth:2});let t=new THREE.Geometry;this._widthLine=new THREE.Line(t,this._lineMaterial),this._widthLine.name="dimension width line",this._heightLine=new THREE.Line(t,this._lineMaterial),this._heightLine.name="dimension height line",this._depthLine=new THREE.Line(t,this._lineMaterial),this._depthLine.name="dimension depth line",this._planeMaterial=new THREE.MeshBasicMaterial({color:16777215,side:THREE.DoubleSide,opacity:.8,transparent:!0}),h.loadFont(o).then(e=>{this._font=e,this._loaded()})}_loaded(){this.update(!1),this.addToScene(this._scene,this._uiScene),this._initialized.resolve()}_performUpdate(e){this._enabled&&(this._lineBounds||e)&&this._font&&(this._updateHeight(),this._updateWidth(),this._updateDepth())}_updateWidth(){let e=new THREE.Geometry,t=this._getWidthEdge();e.vertices.push(t.start,t.end),this._widthLine.geometry.dispose(),this._widthLine.geometry=e;let i=t.getCenter(new THREE.Vector3);this._widthText||(this._widthText=new d(this._font)),this._widthText.topDown=this._topDimensions;const s=this._unitFormatter.formatMMValueToUnitString(1e3*this._dimensions.x);this._widthText.update(i,0,s,this._cameraPosition)}_updateHeight(){let e=new THREE.Geometry,t=this._getHeightEdge();e.vertices.push(t.start,t.end),this._heightLine.geometry.dispose(),this._heightLine.geometry=e;let i=t.getCenter(new THREE.Vector3);this._heightText||(this._heightText=new d(this._font)),this._heightText.topDown=this._topDimensions;const s=this._unitFormatter.formatMMValueToUnitString(1e3*this._dimensions.y);this._heightText.update(i,1,s,this._cameraPosition)}_updateDepth(){let e=new THREE.Geometry,t=this._getDepthEdge();e.vertices.push(t.start,t.end),this._depthLine.geometry.dispose(),this._depthLine.geometry=e;let i=t.getCenter(new THREE.Vector3);this._depthText||(this._depthText=new d(this._font)),this._depthText.topDown=this._topDimensions;const s=this._unitFormatter.formatMMValueToUnitString(1e3*this._dimensions.z);this._depthText.update(i,2,s,this._cameraPosition)}updateBounds(e){this._dimensions=e.getSize(new THREE.Vector3),this._lineBounds=e.clone();let t=this._lineBounds.min.y<0?this._lineBounds.min.y:0;t-=.01,this._lineBounds.expandByVector(new THREE.Vector3(.05,t,.05)),this._textUpdated=!1,this.update()}update(e=!1){this._enabled&&!this._dimensionsVisible&&(this._dimensionsVisible=!0,this._visibilityChangedCallback()),this._performUpdate(e)}addToScene(e,t){this._widthText&&this._widthLine&&this._heightText&&this._heightLine&&this._heightText&&this._heightLine&&(e.add(this._widthLine),t.add(this._widthText),e.add(this._heightLine),t.add(this._heightText),e.add(this._depthLine),t.add(this._depthText))}removeFromScene(e,t){e.remove(this._widthLine),t.remove(this._widthText),e.remove(this._heightLine),t.remove(this._heightText),e.remove(this._depthLine),t.remove(this._depthText)}_getWidthEdge(){return this._cameraPosition.z>=0?new THREE.Line3(new THREE.Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.max.z),new THREE.Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.max.z)):new THREE.Line3(new THREE.Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.min.z),new THREE.Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.min.z))}_getDepthEdge(){return this._cameraPosition.x>=0?new THREE.Line3(new THREE.Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.min.z),new THREE.Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.max.z)):new THREE.Line3(new THREE.Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.min.z),new THREE.Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.max.z))}_getHeightEdge(){return this._cameraPosition.x>=0&&this._cameraPosition.z>=0?new THREE.Line3(new THREE.Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.max.z),new THREE.Vector3(this._lineBounds.max.x,this._lineBounds.max.y,this._lineBounds.max.z)):this._cameraPosition.x<0&&this._cameraPosition.z>=0?new THREE.Line3(new THREE.Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.max.z),new THREE.Vector3(this._lineBounds.min.x,this._lineBounds.max.y,this._lineBounds.max.z)):this._cameraPosition.x>=0&&this._cameraPosition.z<0?new THREE.Line3(new THREE.Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.min.z),new THREE.Vector3(this._lineBounds.max.x,this._lineBounds.max.y,this._lineBounds.min.z)):new THREE.Line3(new THREE.Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.min.z),new THREE.Vector3(this._lineBounds.min.x,this._lineBounds.max.y,this._lineBounds.min.z))}onDimensionsVisibilityChanged(e){this._onChange=e}enableTopDimensions(){this.enableDimensions(),this._topDimensions=!0,this._heightLine.visible=!1,this._heightText.visible=!1,this.update(!0)}disableTopDimensions(){this._topDimensions=!1,this._heightLine.visible=!0,this._heightText.visible=!0,this.disableDimensions()}enableDimensions(){this._enabled=!0,this.update(!0),this.addToScene(this._scene,this._uiScene)}disableDimensions(){this._enabled=!1,this._dimensionsVisible&&(this._dimensionsVisible=!1,this._visibilityChangedCallback()),this.removeFromScene(this._scene,this._uiScene)}_visibilityChangedCallback(){this._onChange&&this._onChange(this._dimensionsVisible)}_clear(){this._lineMaterial.dispose(),this._planeMaterial.dispose(),this._widthLine.geometry.dispose(),this._heightLine.geometry.dispose(),this._depthLine.geometry.dispose(),this._heightText.dispose(),this._heightText.dispose(),this._depthText.dispose()}getBoundingBox(){const e=new THREE.Box3;return e.expandByObject(this._widthLine),e.expandByObject(this._widthText),e.expandByObject(this._heightLine),e.expandByObject(this._heightText),e.expandByObject(this._depthLine),e.expandByObject(this._depthText),e}setVisibility(e){this._heightLine&&this._widthLine&&this._depthLine&&this._heightText&&this._widthText&&this._depthText&&(this._heightLine.visible=e,this._heightText.visible=e,this._widthLine.visible=e,this._widthText.visible=e,this._depthLine.visible=e,this._depthText.visible=e)}moveCameraStart(e){this.setVisibility(!1),this._cameraPosition=e,this.update()}moveCameraEnd(e){this.setVisibility(!0),this._cameraPosition=e,this.update()}clearScene(e){this._clear()}setScene(e){this._scene=e}setUiScene(e){this._uiScene=e}needsUiScene(){return!0}isInitialized(){return this._initialized.wait()}areDimensionsEnabled(){return this._enabled}}return i([s],e.prototype,"_unitFormatter",void 0),e})())}}}));
2
- //# sourceMappingURL=dimensioning-helper-e6459147.nomodule.js.map
1
+ System.register(["./query-params-helper-c231e1b8.nomodule.js","./rapi-access-74fbaf72.nomodule.js","./main-thread-to-worker-bb844d54.nomodule.js","./image-renderer-cfd9ed49.nomodule.js","./pixotron-358442c5.nomodule.js","./configurator-c125c3c8.nomodule.js","./mesh-generator-64203565.nomodule.js","./configurator-mesh-generator-2f342c08.nomodule.js","./default-light-setting-2218084f.nomodule.js"],(function(e){var t,i,s,n,h,o;return{setters:[function(){},function(e){t=e.e,i=e._,s=e.i,n=e.F},function(){},function(){},function(){},function(e){h=e.A,o=e.R},function(){},function(){},function(){}],execute:function(){const a="component_dimensioning_plane_material",_="component_dimensioning_text_material";let d=(()=>{class e extends THREE.Object3D{constructor(e){super(),this._label="",this._parameters={font:null,size:.1,height:.001,curveSegments:2,bevelEnabled:!0,bevelThickness:.001,bevelSize:.001},this.topDown=!1,this._parameters.font=e,this._position=new THREE.Vector3,this._initMaterials(),this._init(),this._update()}_initMaterials(){this._cacheHolder.materialCache.has(a)?this._planeMaterial=this._cacheHolder.materialCache.get(a):(this._planeMaterial=new THREE.MeshBasicMaterial({color:16777215,side:THREE.DoubleSide,opacity:.8,transparent:!0}),this._cacheHolder.materialCache.set(a,this._planeMaterial)),this._cacheHolder.materialCache.has(_)?this._textMaterial=this._cacheHolder.materialCache.get(_):(this._textMaterial=new THREE.MeshPhongMaterial({color:3618615}),this._cacheHolder.materialCache.set(_,this._textMaterial))}_init(){let e=new THREE.Geometry;this._text=new THREE.Mesh(e,this._textMaterial),this._text.name="text with background text "+this._label,this._plane=new THREE.Mesh(e,this._planeMaterial),this._plane.name="text with background plane "+this._label,this._textGeometry=new THREE.TextGeometry(this._label,this._parameters),this._textGeometry.computeBoundingBox(),this._text.geometry=this._textGeometry,this.add(this._text),this.add(this._plane)}update(e,t,i,s){this._position.copy(e),this._dimensioningType=t,this._cameraPosition=s,this._label=i;const n=this._cameraPosition.distanceTo(this._text.position),h=Math.max(.01,n/100),o=Math.max(5e-4,n/5e3);this._parameters.bevelThickness=o,this._parameters.bevelSize=o,this._parameters.size=h,this._textGeometry=new THREE.TextGeometry(this._label,this._parameters),this._textGeometry.computeBoundingBox(),this._text.geometry=this._textGeometry,this._update()}_update(){if(this.topDown){let e=new THREE.Quaternion;e.setFromAxisAngle(new THREE.Vector3(-1,0,0),Math.PI/2),this._updateText(this._textGeometry,e,new THREE.Vector3)}else if(this._updateText(this._textGeometry,new THREE.Quaternion,new THREE.Vector3),this._cameraPosition){const e=Math.atan2(this._cameraPosition.x-this._position.x,this._cameraPosition.z-this._position.z);this._text.rotation.y=e,this._plane.rotation.y=e}}_updateText(e,t,i){let s=new THREE.Vector3;s.copy(this._position),i.x*=this._getXSign(),s.add(i);let n=e.boundingBox.getSize(new THREE.Vector3);e.center(),this._text.position.copy(s),this._text.quaternion.copy(t);let h=new THREE.PlaneGeometry(n.x+.02,n.y+.02,32);h.center(),this._plane.geometry=h,this._plane.position.copy(s),this._plane.quaternion.copy(t)}_getXSign(){return!this._cameraPosition||this._cameraPosition.x>=0?1:-1}dispose(){t(this)}}return i([s],e.prototype,"_cacheHolder",void 0),e})();e("default",(()=>{class e{constructor(e){this._cameraPosition=new THREE.Vector3,this._textUpdated=!1,this._topDimensions=!1,this._initialized=new n,this._enabled=!1,this._dimensionsVisible=!1,this._creator_=e,this._lineMaterial=new THREE.LineBasicMaterial({color:3618615,linewidth:2});let t=new THREE.Geometry;this._widthLine=new THREE.Line(t,this._lineMaterial),this._widthLine.name="dimension width line",this._heightLine=new THREE.Line(t,this._lineMaterial),this._heightLine.name="dimension height line",this._depthLine=new THREE.Line(t,this._lineMaterial),this._depthLine.name="dimension depth line",this._planeMaterial=new THREE.MeshBasicMaterial({color:16777215,side:THREE.DoubleSide,opacity:.8,transparent:!0}),h.loadFont(o).then(e=>{this._font=e,this._loaded()})}_loaded(){this.update(!1),this.addToScene(this._scene,this._uiScene),this._initialized.resolve()}_performUpdate(e){this._enabled&&(this._lineBounds||e)&&this._font&&(this._updateHeight(),this._updateWidth(),this._updateDepth())}_updateWidth(){let e=new THREE.Geometry,t=this._getWidthEdge();e.vertices.push(t.start,t.end),this._widthLine.geometry.dispose(),this._widthLine.geometry=e;let i=t.getCenter(new THREE.Vector3);this._widthText||(this._widthText=new d(this._font)),this._widthText.topDown=this._topDimensions;const s=this._unitFormatter.formatMMValueToUnitString(1e3*this._dimensions.x);this._widthText.update(i,0,s,this._cameraPosition)}_updateHeight(){let e=new THREE.Geometry,t=this._getHeightEdge();e.vertices.push(t.start,t.end),this._heightLine.geometry.dispose(),this._heightLine.geometry=e;let i=t.getCenter(new THREE.Vector3);this._heightText||(this._heightText=new d(this._font)),this._heightText.topDown=this._topDimensions;const s=this._unitFormatter.formatMMValueToUnitString(1e3*this._dimensions.y);this._heightText.update(i,1,s,this._cameraPosition)}_updateDepth(){let e=new THREE.Geometry,t=this._getDepthEdge();e.vertices.push(t.start,t.end),this._depthLine.geometry.dispose(),this._depthLine.geometry=e;let i=t.getCenter(new THREE.Vector3);this._depthText||(this._depthText=new d(this._font)),this._depthText.topDown=this._topDimensions;const s=this._unitFormatter.formatMMValueToUnitString(1e3*this._dimensions.z);this._depthText.update(i,2,s,this._cameraPosition)}updateBounds(e){this._dimensions=e.getSize(new THREE.Vector3),this._lineBounds=e.clone();let t=this._lineBounds.min.y<0?this._lineBounds.min.y:0;t-=.01,this._lineBounds.expandByVector(new THREE.Vector3(.05,t,.05)),this._textUpdated=!1,this.update()}update(e=!1){this._enabled&&!this._dimensionsVisible&&(this._dimensionsVisible=!0,this._visibilityChangedCallback()),this._performUpdate(e)}addToScene(e,t){this._widthText&&this._widthLine&&this._heightText&&this._heightLine&&this._heightText&&this._heightLine&&(e.add(this._widthLine),t.add(this._widthText),e.add(this._heightLine),t.add(this._heightText),e.add(this._depthLine),t.add(this._depthText))}removeFromScene(e,t){e.remove(this._widthLine),t.remove(this._widthText),e.remove(this._heightLine),t.remove(this._heightText),e.remove(this._depthLine),t.remove(this._depthText)}_getWidthEdge(){return this._cameraPosition.z>=0?new THREE.Line3(new THREE.Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.max.z),new THREE.Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.max.z)):new THREE.Line3(new THREE.Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.min.z),new THREE.Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.min.z))}_getDepthEdge(){return this._cameraPosition.x>=0?new THREE.Line3(new THREE.Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.min.z),new THREE.Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.max.z)):new THREE.Line3(new THREE.Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.min.z),new THREE.Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.max.z))}_getHeightEdge(){return this._cameraPosition.x>=0&&this._cameraPosition.z>=0?new THREE.Line3(new THREE.Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.max.z),new THREE.Vector3(this._lineBounds.max.x,this._lineBounds.max.y,this._lineBounds.max.z)):this._cameraPosition.x<0&&this._cameraPosition.z>=0?new THREE.Line3(new THREE.Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.max.z),new THREE.Vector3(this._lineBounds.min.x,this._lineBounds.max.y,this._lineBounds.max.z)):this._cameraPosition.x>=0&&this._cameraPosition.z<0?new THREE.Line3(new THREE.Vector3(this._lineBounds.max.x,this._lineBounds.min.y,this._lineBounds.min.z),new THREE.Vector3(this._lineBounds.max.x,this._lineBounds.max.y,this._lineBounds.min.z)):new THREE.Line3(new THREE.Vector3(this._lineBounds.min.x,this._lineBounds.min.y,this._lineBounds.min.z),new THREE.Vector3(this._lineBounds.min.x,this._lineBounds.max.y,this._lineBounds.min.z))}onDimensionsVisibilityChanged(e){this._onChange=e}enableTopDimensions(){this.enableDimensions(),this._topDimensions=!0,this._heightLine.visible=!1,this._heightText.visible=!1,this.update(!0)}disableTopDimensions(){this._topDimensions=!1,this._heightLine.visible=!0,this._heightText.visible=!0,this.disableDimensions()}enableDimensions(){this._enabled=!0,this.update(!0),this.addToScene(this._scene,this._uiScene)}disableDimensions(){this._enabled=!1,this._dimensionsVisible&&(this._dimensionsVisible=!1,this._visibilityChangedCallback()),this.removeFromScene(this._scene,this._uiScene)}_visibilityChangedCallback(){this._onChange&&this._onChange(this._dimensionsVisible)}_clear(){this._lineMaterial.dispose(),this._planeMaterial.dispose(),this._widthLine.geometry.dispose(),this._heightLine.geometry.dispose(),this._depthLine.geometry.dispose(),this._heightText.dispose(),this._heightText.dispose(),this._depthText.dispose()}getBoundingBox(){const e=new THREE.Box3;return e.expandByObject(this._widthLine),e.expandByObject(this._widthText),e.expandByObject(this._heightLine),e.expandByObject(this._heightText),e.expandByObject(this._depthLine),e.expandByObject(this._depthText),e}setVisibility(e){this._heightLine&&this._widthLine&&this._depthLine&&this._heightText&&this._widthText&&this._depthText&&(this._heightLine.visible=e,this._heightText.visible=e,this._widthLine.visible=e,this._widthText.visible=e,this._depthLine.visible=e,this._depthText.visible=e)}moveCameraStart(e){this.setVisibility(!1),this._cameraPosition=e,this.update()}moveCameraEnd(e){this.setVisibility(!0),this._cameraPosition=e,this.update()}clearScene(e){this._clear()}setScene(e){this._scene=e}setUiScene(e){this._uiScene=e}needsUiScene(){return!0}isInitialized(){return this._initialized.wait()}areDimensionsEnabled(){return this._enabled}}return i([s],e.prototype,"_unitFormatter",void 0),e})())}}}));
2
+ //# sourceMappingURL=dimensioning-helper-e5a1f92b.nomodule.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dimensioning-helper-e5a1f92b.nomodule.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +1,2 @@
1
- import"./query-params-helper-a271f9dc.js";import{n as DependencyInjectionAssignment,L as Logger,o as RapiAccess,h as getGUI,_ as __decorate,i as inject,d as CANVAS_ID,f as DynamicLightSettingLoader,P as PREDEFINED_LIGHTSETTING,e as dispose,G as GLTF_LOADER_FILE_NAME,a7 as DRACO_LOADER_FILE_NAME,s as RoomleDependencyInjection}from"./rapi-access-56a3e030.js";import{k as getGlbUrl}from"./main-thread-to-worker-3b2ebd37.js";import{I as InputManager,S as ScriptLoader,C as CameraControl3D,L as LightSetting,B as BakedShadowEnvironment,T as TWEEN_FILE_NAME,e as PIXOTRON_EFFETCS,g as PIXOTRON_FILE_NAME,M as Main}from"./pixotron-75c414e7.js";import{D as DefaultLightSetting}from"./default-light-setting-4c54f308.js";import{S as SceneManager}from"./scene-manager-c953c6c0.js";const INJECTABLES=[new DependencyInjectionAssignment("script-loader",ScriptLoader),new DependencyInjectionAssignment("glb-input-manager",class extends InputManager{},1),new DependencyInjectionAssignment("logger",Logger),new DependencyInjectionAssignment("rapi-access",RapiAccess)];class AdjustableCameraControl3D extends CameraControl3D{constructor(){super(...arguments),this.shouldIgnoreStandardBehavior=!1}adjust(e,t,n,i,r){let s=new THREE.Vector3(-e.x/2,0,-e.z/2),a=new THREE.Vector3(e.x/2,e.y,e.z/2);this._boundingBox=new THREE.Box3(s,a);let o=new THREE.Euler(-Math.PI/2+i,n,0,"ZYX"),c=(new THREE.Quaternion).setFromEuler(o);this._camera.updateProjectionMatrix(),this._camera.quaternion.copy(c),this._camera.position.copy(t)}_update(e){this.shouldIgnoreStandardBehavior?this._saveYawAndPitch():super._update(e)}animateCamera(e){return!!this.shouldIgnoreStandardBehavior||super.animateCamera(e)}}class GLBViewerLightSetting extends LightSetting{constructor(e,t){super(e,t),this._params={ambientLight:{color:"#ffffff"}},this._ambientLight=new THREE.AmbientLight(new THREE.Color(this._params.ambientLight.color),.5),this.addToScene()}addToScene(){this._scene.add(this._ambientLight)}removeFromScene(){this._scene.remove(this._ambientLight)}reload(){this.removeFromScene(),this.addToScene()}showGUI(){let e=getGUI();if(e&&this._ambientLight){let t=e.addFolder("Ambient Light");t.add(this._ambientLight,"visible"),t.add(this._ambientLight,"intensity").min(0).max(5).step(.1),t.addColor(this._params.ambientLight,"color").onChange(e=>{this._ambientLight.color=new THREE.Color(e)})}}}let GLBViewerSceneManager=(()=>{class e extends SceneManager{constructor(e,t){super(e,t,CANVAS_ID.GLB,"3D"),this._itemsCount=0,this._standardSceneBackgroundColor=this._scene.background,this._renderer.capabilities.maxTextures>8?this.loadDynamicLightSetting(DynamicLightSettingLoader.createDynamicLightSettingSource(null,PREDEFINED_LIGHTSETTING.CAMERA)):(console.warn("this device has a maximum of 8 texture units thus we are using a simpler light setting"),this._lightSetting=new GLBViewerLightSetting(this._scene)),this._setEnvironment(new BakedShadowEnvironment(this._scene,this._environment))}createCameraControl(e){this._cameraControl=new AdjustableCameraControl3D(this._creator_,this._getInputManager(),new THREE.Vector3(-1,1,1))}_getInputManager(){return this._glbInputManager}async loadStaticItem(e,t){const n=await this._rapiAccess.getItem(e);return n.configuration?Promise.reject():this.loadGLB(getGlbUrl(n),!0,void 0,t)}loadGLB(e,t=!0,n=new THREE.Vector3(1,1,1),i){return this.clearScene(),new Promise((r,s)=>{this._loadGLB(e,new THREE.Vector3(0,0,0),0,void 0,n,void 0,void 0,i).then(e=>{this._currentGLB=e,this._scene.add(this._currentGLB);let n=(new THREE.Box3).setFromObject(this._currentGLB);if(t){let e=n.getCenter(new THREE.Vector3);this._cameraControl instanceof AdjustableCameraControl3D&&(this._cameraControl.updateToBounds(n,!1,!0,e),this._cameraControl.reset(n,e,-15,0))}this._updateBounds(n),r()},s)})}preparePerspectiveImage(e,t,n){return new Promise(i=>{t||(t=1e3),n||(n=1e3),e||((e=new THREE.WebGLRenderer({antialias:!0})).setSize(t,n),e.outputEncoding=THREE.sRGBEncoding,e.autoClear=!1,e.shadowMap.enabled=!0,e.shadowMap.type=THREE.BasicShadowMap);let r=this._cameraControl.getCamera().clone();r instanceof THREE.PerspectiveCamera&&(r.aspect=t/n,r.updateProjectionMatrix()),this._lightSetting.removeFromScene();let s=new DefaultLightSetting(this._scene);e.render(this._scene,r);let a=e.domElement.toDataURL();e.domElement.toBlob(e=>{i({image:a,width:t,height:n,blob:e})},"image/png"),s.removeFromScene(),this._lightSetting.addToScene()})}adjustCamera(e,t,n,i){if(this._cameraControl instanceof AdjustableCameraControl3D){let r=(new THREE.Box3).setFromObject(this._scene).getSize(new THREE.Vector3);this._cameraControl.adjust(r,e,t,n,i),this._requestRender()}}onStart(e){this._itemsCount=e,this._scene.background=null,this._cameraControl instanceof AdjustableCameraControl3D&&(this._cameraControl.shouldIgnoreStandardBehavior=!0)}onElementFinished(e){this._itemsCount,Math.round(100/this._itemsCount*e)}onFinished(e){this._scene.background=this._standardSceneBackgroundColor,this._cameraControl instanceof AdjustableCameraControl3D&&(this._cameraControl.shouldIgnoreStandardBehavior=!1)}clearScene(){this._currentGLB&&(this._scene.remove(this._currentGLB),dispose(this._currentGLB),this._currentGLB=null),super.clearScene()}enableHD(){super.enableHD(),this._pixotron.enableAA=!1,this._pixotron.getSAOPass().enabled=!0}sceneChanged(){}getPixotronParams(){return{saoparams:{intensity:.25,occlusionWorldRadius:.4,smoothTransition:!0,samplesPerFrame:4,bias:.016,numSamples:200,accumulative:!1,falloff:1.5},shadowparams:{shadowMapResolution:1024,shadowRadius:3,shadowQuality:1,smoothTransition:!0,enableAccumulation:!0,shadowBiasMultiplier:.6,nearPlane:.01,farPlane:50,fov:110,side:THREE.FrontSide,numSamples:100}}}getBakedShadowParams(){return{enable:!0,shadowMapResolution:512,smoothTransition:!0,numSamples:500,numSamplesPerFrame:4,bShadowMaterial:!0,falloff:1.5,darkness:.2,size:1.6,lightDirection:new THREE.Vector3(0,1,.5),lightSolidAngle:40}}getBounds(){return this._currentGLB?(new THREE.Box3).setFromObject(this._currentGLB):null}}return __decorate([inject],e.prototype,"_glbInputManager",void 0),__decorate([inject],e.prototype,"_rapiAccess",void 0),e})();class GLBRenderWorker{constructor(e,t,n){this._prefix="https://furniture.roomle.com/3d/glb/",this._listeners=new Set,this._finishedItems=0,this._sceneManager=e,this._renderer=new THREE.WebGLRenderer({antialias:!0,alpha:!0}),this._width=t,this._height=n,this._renderer.setSize(t,n),this._renderer.setClearColor(16777215,0),this._renderer.outputEncoding=THREE.sRGBEncoding}addListener(e){this._listeners.add(e)}removeListener(e){this._listeners.delete(e)}start(e){return this._entries=[],e.forEach(e=>{this._entries.push(this._transform(e))}),this._finishedItems=0,this._listeners.forEach(e=>e.onStart(this._entries.length)),this._zip=new window.JSZip,this._doNextEntry(),new Promise(e=>{this._resolve=e})}_transform(e){return{name:e.path.replace(".glb",".png"),url:this._prefix+e.path,position:new THREE.Vector3(e.camera.position.x,e.camera.position.z,-e.camera.position.y),fov:2*e.camera.fieldOfView,yaw:e.camera.rotation.z,pitch:e.camera.rotation.x}}_doNextEntry(){0===this._entries.length?(this._listeners.forEach(e=>e.onFinished(this._zip)),this._resolve(this._zip)):this._processEntry(this._entries[0])}_processEntry(e){this._sceneManager.loadGLB(e.url,!1,void 0).then(()=>{this._sceneManager.adjustCamera(e.position,e.yaw,e.pitch,e.fov),this._sceneManager.preparePerspectiveImage(this._renderer,this._width,this._height).then(t=>{this._entryFinished(e,t)})})}_entryFinished(e,t){let n=this._entries.indexOf(e);n>-1&&this._entries.splice(n,1),this._finishedItems++,this._listeners.forEach(e=>e.onElementFinished(this._finishedItems)),this._zip.file(e.name,t.blob),this._doNextEntry()}}let RoomleGLBViewer=(()=>{class e{constructor(e){this._currentIdOrUrl=null,this._creator_=e}setCameraOffset(e){this._sceneManager.setCameraOffset(e)}getCameraOffset(){return this._sceneManager.getCameraOffset()}init(e,t){return this.setOverrides(t),this._domHelper.setDomElement(e),this._sceneManager?(this._lifeCycleManager.resume(),Promise.resolve()):new Promise(this._initPromiseCallback.bind(this))}_initPromiseCallback(e,t){this._threeLoader.fetch().then(()=>{let t=this._scriptLoader.fetch(GLTF_LOADER_FILE_NAME,{id:"gltf-loader"}),n=this._scriptLoader.fetch(DRACO_LOADER_FILE_NAME,{id:"draco-loader"}),i=this._scriptLoader.fetch(TWEEN_FILE_NAME,{id:"tween-js"});Promise.all([t,n,i]).then(()=>{this._sceneManager=new GLBViewerSceneManager(this._creator_,{left:0,top:1,right:1,bottom:0}),this.enableHD(),e()})})}enableHD(){return new Promise((e,t)=>{const n=()=>{this._sceneManager.enableHD(),e()};Promise.all(PIXOTRON_EFFETCS.map(e=>this._scriptLoader.fetch(e,{id:e}))).then(()=>{this._scriptLoader.fetch(PIXOTRON_FILE_NAME,{id:"pi-js"}).then(n,t)},t)})}clearScene(){this._sceneManager.clearScene()}loadGLB(e,t=1,n){return this._currentIdOrUrl=e,this._rapiAccess.trackView(e),this._sceneManager.loadGLB(e,!0,new THREE.Vector3(t,t,t),n)}loadStaticItem(e,t){return this._currentIdOrUrl=e,this._rapiAccess.trackView(e),this._sceneManager.loadStaticItem(e,t)}getCurrentId(){return this._currentIdOrUrl}loadSceneSetting(e){return this._sceneManager.loadSceneSettings(e)}loadQualitySetting(e){this._sceneManager.loadQualitySetting(e)}preparePerspectiveImage(){return this._sceneManager.preparePerspectiveImage()}processRenderList(e,t=320,n=320){let i=JSON.parse(e);this._scriptLoader.fetch("static/jszip.min-dd6c9829408677a1.js",{id:"jszip-js"}).then(()=>{let e=new GLBRenderWorker(this._sceneManager,t,n);e.addListener(this._sceneManager),e.start(i.items).then(t=>{t.generateAsync({type:"blob"}).then(t=>{let n=document.createElement("a");n.href=URL.createObjectURL(t),n.download="content.zip",n.style.display="none",document.body.appendChild(n),n.click(),document.body.removeChild(n),e.removeListener(this._sceneManager)})})})}setOverrides(e){e&&(this._initData.setOverrides(e),this._globalInitData.setOverrides(e))}updateSize(){this._sceneManager.updateCamera()}getMain(){}resumeTest(e){this._domHelper.setDomElement(e),this._lifeCycleManager.resume()}pauseTest(){this._lifeCycleManager.pause()}showGUI(){this._sceneManager.showGUI()}get callbacks(){return{}}getScene(){return this._sceneManager.getScene()}updateScene(){this._sceneManager.updateScene()}}return __decorate([inject],e.prototype,"_rapiAccess",void 0),__decorate([inject],e.prototype,"_domHelper",void 0),__decorate([inject],e.prototype,"_scriptLoader",void 0),__decorate([inject],e.prototype,"_lifeCycleManager",void 0),__decorate([inject],e.prototype,"_threeLoader",void 0),__decorate([inject],e.prototype,"_initData",void 0),__decorate([inject],e.prototype,"_globalInitData",void 0),e})();class GlbViewer extends Main{setupGlobals(){}setupDependencies(){RoomleDependencyInjection.setup(INJECTABLES),this.lookup("logger",this._context)}cleanUpGlobals(){throw new Error("Method not implemented.")}cleanUpDependencies(){throw new Error("Method not implemented.")}bootFinished(){this._viewer=new RoomleGLBViewer(this._context),window.RoomleGLBViewer||(window.RoomleGLBViewer=this._viewer)}getApi(){return this._viewer}getContextName(){return"glb-viewer"}}export{GlbViewer};
2
- //# sourceMappingURL=glb-viewer-1455d26c.js.map
1
+ import"./query-params-helper-a271f9dc.js";import{n as DependencyInjectionAssignment,L as Logger,o as RapiAccess,h as getGUI,_ as __decorate,i as inject,d as CANVAS_ID,f as DynamicLightSettingLoader,P as PREDEFINED_LIGHTSETTING,e as dispose,G as GLTF_LOADER_FILE_NAME,a7 as DRACO_LOADER_FILE_NAME,s as RoomleDependencyInjection}from"./rapi-access-f8222879.js";import{f as getGlbUrl}from"./main-thread-to-worker-91bf9f5e.js";import{I as InputManager,S as ScriptLoader,C as CameraControl3D,L as LightSetting,B as BakedShadowEnvironment,T as TWEEN_FILE_NAME,e as PIXOTRON_EFFETCS,g as PIXOTRON_FILE_NAME,M as Main}from"./pixotron-5bb3aafe.js";import{D as DefaultLightSetting}from"./default-light-setting-dbb59ba5.js";import{S as SceneManager}from"./scene-manager-4637ed82.js";const INJECTABLES=[new DependencyInjectionAssignment("script-loader",ScriptLoader),new DependencyInjectionAssignment("glb-input-manager",class extends InputManager{},1),new DependencyInjectionAssignment("logger",Logger),new DependencyInjectionAssignment("rapi-access",RapiAccess)];class AdjustableCameraControl3D extends CameraControl3D{constructor(){super(...arguments),this.shouldIgnoreStandardBehavior=!1}adjust(e,t,n,i,r){let s=new THREE.Vector3(-e.x/2,0,-e.z/2),a=new THREE.Vector3(e.x/2,e.y,e.z/2);this._boundingBox=new THREE.Box3(s,a);let o=new THREE.Euler(-Math.PI/2+i,n,0,"ZYX"),c=(new THREE.Quaternion).setFromEuler(o);this._camera.updateProjectionMatrix(),this._camera.quaternion.copy(c),this._camera.position.copy(t)}_update(e){this.shouldIgnoreStandardBehavior?this._saveYawAndPitch():super._update(e)}animateCamera(e){return!!this.shouldIgnoreStandardBehavior||super.animateCamera(e)}}class GLBViewerLightSetting extends LightSetting{constructor(e,t){super(e,t),this._params={ambientLight:{color:"#ffffff"}},this._ambientLight=new THREE.AmbientLight(new THREE.Color(this._params.ambientLight.color),.5),this.addToScene()}addToScene(){this._scene.add(this._ambientLight)}removeFromScene(){this._scene.remove(this._ambientLight)}reload(){this.removeFromScene(),this.addToScene()}showGUI(){let e=getGUI();if(e&&this._ambientLight){let t=e.addFolder("Ambient Light");t.add(this._ambientLight,"visible"),t.add(this._ambientLight,"intensity").min(0).max(5).step(.1),t.addColor(this._params.ambientLight,"color").onChange(e=>{this._ambientLight.color=new THREE.Color(e)})}}}let GLBViewerSceneManager=(()=>{class e extends SceneManager{constructor(e,t){super(e,t,CANVAS_ID.GLB,"3D"),this._itemsCount=0,this._standardSceneBackgroundColor=this._scene.background,this._renderer.capabilities.maxTextures>8?this.loadDynamicLightSetting(DynamicLightSettingLoader.createDynamicLightSettingSource(null,PREDEFINED_LIGHTSETTING.CAMERA)):(console.warn("this device has a maximum of 8 texture units thus we are using a simpler light setting"),this._lightSetting=new GLBViewerLightSetting(this._scene)),this._setEnvironment(new BakedShadowEnvironment(this._scene,this._environment))}createCameraControl(e){this._cameraControl=new AdjustableCameraControl3D(this._creator_,this._getInputManager(),new THREE.Vector3(-1,1,1))}_getInputManager(){return this._glbInputManager}async loadStaticItem(e,t){const n=await this._rapiAccess.getItem(e);return n.configuration?Promise.reject():this.loadGLB(getGlbUrl(n),!0,void 0,t)}loadGLB(e,t=!0,n=new THREE.Vector3(1,1,1),i){return this.clearScene(),new Promise((r,s)=>{this._loadGLB(e,new THREE.Vector3(0,0,0),0,void 0,n,void 0,void 0,i).then(e=>{this._currentGLB=e,this._scene.add(this._currentGLB);let n=(new THREE.Box3).setFromObject(this._currentGLB);if(t){let e=n.getCenter(new THREE.Vector3);this._cameraControl instanceof AdjustableCameraControl3D&&(this._cameraControl.updateToBounds(n,!1,!0,e),this._cameraControl.reset(n,e,-15,0))}this._updateBounds(n),r()},s)})}preparePerspectiveImage(e,t,n){return new Promise(i=>{t||(t=1e3),n||(n=1e3),e||((e=new THREE.WebGLRenderer({antialias:!0})).setSize(t,n),e.outputEncoding=THREE.sRGBEncoding,e.autoClear=!1,e.shadowMap.enabled=!0,e.shadowMap.type=THREE.BasicShadowMap);let r=this._cameraControl.getCamera().clone();r instanceof THREE.PerspectiveCamera&&(r.aspect=t/n,r.updateProjectionMatrix()),this._lightSetting.removeFromScene();let s=new DefaultLightSetting(this._scene);e.render(this._scene,r);let a=e.domElement.toDataURL();e.domElement.toBlob(e=>{i({image:a,width:t,height:n,blob:e})},"image/png"),s.removeFromScene(),this._lightSetting.addToScene()})}adjustCamera(e,t,n,i){if(this._cameraControl instanceof AdjustableCameraControl3D){let r=(new THREE.Box3).setFromObject(this._scene).getSize(new THREE.Vector3);this._cameraControl.adjust(r,e,t,n,i),this._requestRender()}}onStart(e){this._itemsCount=e,this._scene.background=null,this._cameraControl instanceof AdjustableCameraControl3D&&(this._cameraControl.shouldIgnoreStandardBehavior=!0)}onElementFinished(e){this._itemsCount,Math.round(100/this._itemsCount*e)}onFinished(e){this._scene.background=this._standardSceneBackgroundColor,this._cameraControl instanceof AdjustableCameraControl3D&&(this._cameraControl.shouldIgnoreStandardBehavior=!1)}clearScene(){this._currentGLB&&(this._scene.remove(this._currentGLB),dispose(this._currentGLB),this._currentGLB=null),super.clearScene()}enableHD(){super.enableHD(),this._pixotron.enableAA=!1,this._pixotron.getSAOPass().enabled=!0}sceneChanged(){}getPixotronParams(){return{saoparams:{intensity:.25,occlusionWorldRadius:.4,smoothTransition:!0,samplesPerFrame:4,bias:.016,numSamples:200,accumulative:!1,falloff:1.5},shadowparams:{shadowMapResolution:1024,shadowRadius:3,shadowQuality:1,smoothTransition:!0,enableAccumulation:!0,shadowBiasMultiplier:.6,nearPlane:.01,farPlane:50,fov:110,side:THREE.FrontSide,numSamples:100}}}getBakedShadowParams(){return{enable:!0,shadowMapResolution:512,smoothTransition:!0,numSamples:500,numSamplesPerFrame:4,bShadowMaterial:!0,falloff:1.5,darkness:.2,size:1.6,lightDirection:new THREE.Vector3(0,1,.5),lightSolidAngle:40}}getBounds(){return this._currentGLB?(new THREE.Box3).setFromObject(this._currentGLB):null}}return __decorate([inject],e.prototype,"_glbInputManager",void 0),__decorate([inject],e.prototype,"_rapiAccess",void 0),e})();class GLBRenderWorker{constructor(e,t,n){this._prefix="https://furniture.roomle.com/3d/glb/",this._listeners=new Set,this._finishedItems=0,this._sceneManager=e,this._renderer=new THREE.WebGLRenderer({antialias:!0,alpha:!0}),this._width=t,this._height=n,this._renderer.setSize(t,n),this._renderer.setClearColor(16777215,0),this._renderer.outputEncoding=THREE.sRGBEncoding}addListener(e){this._listeners.add(e)}removeListener(e){this._listeners.delete(e)}start(e){return this._entries=[],e.forEach(e=>{this._entries.push(this._transform(e))}),this._finishedItems=0,this._listeners.forEach(e=>e.onStart(this._entries.length)),this._zip=new window.JSZip,this._doNextEntry(),new Promise(e=>{this._resolve=e})}_transform(e){return{name:e.path.replace(".glb",".png"),url:this._prefix+e.path,position:new THREE.Vector3(e.camera.position.x,e.camera.position.z,-e.camera.position.y),fov:2*e.camera.fieldOfView,yaw:e.camera.rotation.z,pitch:e.camera.rotation.x}}_doNextEntry(){0===this._entries.length?(this._listeners.forEach(e=>e.onFinished(this._zip)),this._resolve(this._zip)):this._processEntry(this._entries[0])}_processEntry(e){this._sceneManager.loadGLB(e.url,!1,void 0).then(()=>{this._sceneManager.adjustCamera(e.position,e.yaw,e.pitch,e.fov),this._sceneManager.preparePerspectiveImage(this._renderer,this._width,this._height).then(t=>{this._entryFinished(e,t)})})}_entryFinished(e,t){let n=this._entries.indexOf(e);n>-1&&this._entries.splice(n,1),this._finishedItems++,this._listeners.forEach(e=>e.onElementFinished(this._finishedItems)),this._zip.file(e.name,t.blob),this._doNextEntry()}}let RoomleGLBViewer=(()=>{class e{constructor(e){this._currentIdOrUrl=null,this._creator_=e}setCameraOffset(e){this._sceneManager.setCameraOffset(e)}getCameraOffset(){return this._sceneManager.getCameraOffset()}init(e,t){return this.setOverrides(t),this._domHelper.setDomElement(e),this._sceneManager?(this._lifeCycleManager.resume(),Promise.resolve()):new Promise(this._initPromiseCallback.bind(this))}_initPromiseCallback(e,t){this._threeLoader.fetch().then(()=>{let t=this._scriptLoader.fetch(GLTF_LOADER_FILE_NAME,{id:"gltf-loader"}),n=this._scriptLoader.fetch(DRACO_LOADER_FILE_NAME,{id:"draco-loader"}),i=this._scriptLoader.fetch(TWEEN_FILE_NAME,{id:"tween-js"});Promise.all([t,n,i]).then(()=>{this._sceneManager=new GLBViewerSceneManager(this._creator_,{left:0,top:1,right:1,bottom:0}),this.enableHD(),e()})})}enableHD(){return new Promise((e,t)=>{const n=()=>{this._sceneManager.enableHD(),e()};Promise.all(PIXOTRON_EFFETCS.map(e=>this._scriptLoader.fetch(e,{id:e}))).then(()=>{this._scriptLoader.fetch(PIXOTRON_FILE_NAME,{id:"pi-js"}).then(n,t)},t)})}clearScene(){this._sceneManager.clearScene()}loadGLB(e,t=1,n){return this._currentIdOrUrl=e,this._rapiAccess.trackView(e),this._sceneManager.loadGLB(e,!0,new THREE.Vector3(t,t,t),n)}loadStaticItem(e,t){return this._currentIdOrUrl=e,this._rapiAccess.trackView(e),this._sceneManager.loadStaticItem(e,t)}getCurrentId(){return this._currentIdOrUrl}loadSceneSetting(e){return this._sceneManager.loadSceneSettings(e)}loadQualitySetting(e){this._sceneManager.loadQualitySetting(e)}preparePerspectiveImage(){return this._sceneManager.preparePerspectiveImage()}processRenderList(e,t=320,n=320){let i=JSON.parse(e);this._scriptLoader.fetch("static/jszip.min-dd6c9829408677a1.js",{id:"jszip-js"}).then(()=>{let e=new GLBRenderWorker(this._sceneManager,t,n);e.addListener(this._sceneManager),e.start(i.items).then(t=>{t.generateAsync({type:"blob"}).then(t=>{let n=document.createElement("a");n.href=URL.createObjectURL(t),n.download="content.zip",n.style.display="none",document.body.appendChild(n),n.click(),document.body.removeChild(n),e.removeListener(this._sceneManager)})})})}setOverrides(e){e&&(this._initData.setOverrides(e),this._globalInitData.setOverrides(e))}updateSize(){this._sceneManager.updateCamera()}getMain(){}resumeTest(e){this._domHelper.setDomElement(e),this._lifeCycleManager.resume()}pauseTest(){this._lifeCycleManager.pause()}showGUI(){this._sceneManager.showGUI()}get callbacks(){return{}}getScene(){return this._sceneManager.getScene()}updateScene(){this._sceneManager.updateScene()}}return __decorate([inject],e.prototype,"_rapiAccess",void 0),__decorate([inject],e.prototype,"_domHelper",void 0),__decorate([inject],e.prototype,"_scriptLoader",void 0),__decorate([inject],e.prototype,"_lifeCycleManager",void 0),__decorate([inject],e.prototype,"_threeLoader",void 0),__decorate([inject],e.prototype,"_initData",void 0),__decorate([inject],e.prototype,"_globalInitData",void 0),e})();class GlbViewer extends Main{setupGlobals(){}setupDependencies(){RoomleDependencyInjection.setup(INJECTABLES),this.lookup("logger",this._context)}cleanUpGlobals(){throw new Error("Method not implemented.")}cleanUpDependencies(){throw new Error("Method not implemented.")}bootFinished(){this._viewer=new RoomleGLBViewer(this._context),window.RoomleGLBViewer||(window.RoomleGLBViewer=this._viewer)}getApi(){return this._viewer}getContextName(){return"glb-viewer"}}export{GlbViewer};
2
+ //# sourceMappingURL=glb-viewer-58c75d10.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"glb-viewer-1455d26c.js","sources":["../../node_modules/jszip/dist/jszip.min.js"],"sourcesContent":["export default \"static/jszip.min-dd6c9829408677a1.js\""],"names":[],"mappings":"wsSAAe"}
1
+ {"version":3,"file":"glb-viewer-58c75d10.js","sources":["../../node_modules/jszip/dist/jszip.min.js"],"sourcesContent":["export default \"static/jszip.min-dd6c9829408677a1.js\""],"names":[],"mappings":"wsSAAe"}
@@ -1,2 +1,2 @@
1
- System.register(["./query-params-helper-c231e1b8.nomodule.js","./rapi-access-339cccf6.nomodule.js","./main-thread-to-worker-35970716.nomodule.js","./pixotron-17562920.nomodule.js","./default-light-setting-269087a3.nomodule.js","./scene-manager-7cd0736c.nomodule.js"],(function(e){var t,i,s,r,n,a,o,h,c,l,d,_,m,u,p,g,w,E,f,b,S,v,L,C,M;return{setters:[function(){},function(e){t=e.n,i=e.L,s=e.o,r=e.h,n=e._,a=e.i,o=e.d,h=e.f,c=e.P,l=e.e,d=e.G,_=e.a7,m=e.s},function(e){u=e.k},function(e){p=e.I,g=e.S,w=e.C,E=e.L,f=e.B,b=e.T,S=e.e,v=e.g,L=e.M},function(e){C=e.D},function(e){M=e.S}],execute:function(){const y=[new t("script-loader",g),new t("glb-input-manager",class extends p{},1),new t("logger",i),new t("rapi-access",s)];class R extends w{constructor(){super(...arguments),this.shouldIgnoreStandardBehavior=!1}adjust(e,t,i,s,r){let n=new THREE.Vector3(-e.x/2,0,-e.z/2),a=new THREE.Vector3(e.x/2,e.y,e.z/2);this._boundingBox=new THREE.Box3(n,a);let o=new THREE.Euler(-Math.PI/2+s,i,0,"ZYX"),h=(new THREE.Quaternion).setFromEuler(o);this._camera.updateProjectionMatrix(),this._camera.quaternion.copy(h),this._camera.position.copy(t)}_update(e){this.shouldIgnoreStandardBehavior?this._saveYawAndPitch():super._update(e)}animateCamera(e){return!!this.shouldIgnoreStandardBehavior||super.animateCamera(e)}}class B extends E{constructor(e,t){super(e,t),this._params={ambientLight:{color:"#ffffff"}},this._ambientLight=new THREE.AmbientLight(new THREE.Color(this._params.ambientLight.color),.5),this.addToScene()}addToScene(){this._scene.add(this._ambientLight)}removeFromScene(){this._scene.remove(this._ambientLight)}reload(){this.removeFromScene(),this.addToScene()}showGUI(){let e=r();if(e&&this._ambientLight){let t=e.addFolder("Ambient Light");t.add(this._ambientLight,"visible"),t.add(this._ambientLight,"intensity").min(0).max(5).step(.1),t.addColor(this._params.ambientLight,"color").onChange(e=>{this._ambientLight.color=new THREE.Color(e)})}}}let T=(()=>{class e extends M{constructor(e,t){super(e,t,o.GLB,"3D"),this._itemsCount=0,this._standardSceneBackgroundColor=this._scene.background,this._renderer.capabilities.maxTextures>8?this.loadDynamicLightSetting(h.createDynamicLightSettingSource(null,c.CAMERA)):(console.warn("this device has a maximum of 8 texture units thus we are using a simpler light setting"),this._lightSetting=new B(this._scene)),this._setEnvironment(new f(this._scene,this._environment))}createCameraControl(e){this._cameraControl=new R(this._creator_,this._getInputManager(),new THREE.Vector3(-1,1,1))}_getInputManager(){return this._glbInputManager}async loadStaticItem(e,t){const i=await this._rapiAccess.getItem(e);return i.configuration?Promise.reject():this.loadGLB(u(i),!0,void 0,t)}loadGLB(e,t=!0,i=new THREE.Vector3(1,1,1),s){return this.clearScene(),new Promise((r,n)=>{this._loadGLB(e,new THREE.Vector3(0,0,0),0,void 0,i,void 0,void 0,s).then(e=>{this._currentGLB=e,this._scene.add(this._currentGLB);let i=(new THREE.Box3).setFromObject(this._currentGLB);if(t){let e=i.getCenter(new THREE.Vector3);this._cameraControl instanceof R&&(this._cameraControl.updateToBounds(i,!1,!0,e),this._cameraControl.reset(i,e,-15,0))}this._updateBounds(i),r()},n)})}preparePerspectiveImage(e,t,i){return new Promise(s=>{t||(t=1e3),i||(i=1e3),e||((e=new THREE.WebGLRenderer({antialias:!0})).setSize(t,i),e.outputEncoding=THREE.sRGBEncoding,e.autoClear=!1,e.shadowMap.enabled=!0,e.shadowMap.type=THREE.BasicShadowMap);let r=this._cameraControl.getCamera().clone();r instanceof THREE.PerspectiveCamera&&(r.aspect=t/i,r.updateProjectionMatrix()),this._lightSetting.removeFromScene();let n=new C(this._scene);e.render(this._scene,r);let a=e.domElement.toDataURL();e.domElement.toBlob(e=>{s({image:a,width:t,height:i,blob:e})},"image/png"),n.removeFromScene(),this._lightSetting.addToScene()})}adjustCamera(e,t,i,s){if(this._cameraControl instanceof R){let r=(new THREE.Box3).setFromObject(this._scene).getSize(new THREE.Vector3);this._cameraControl.adjust(r,e,t,i,s),this._requestRender()}}onStart(e){this._itemsCount=e,this._scene.background=null,this._cameraControl instanceof R&&(this._cameraControl.shouldIgnoreStandardBehavior=!0)}onElementFinished(e){this._itemsCount,Math.round(100/this._itemsCount*e)}onFinished(e){this._scene.background=this._standardSceneBackgroundColor,this._cameraControl instanceof R&&(this._cameraControl.shouldIgnoreStandardBehavior=!1)}clearScene(){this._currentGLB&&(this._scene.remove(this._currentGLB),l(this._currentGLB),this._currentGLB=null),super.clearScene()}enableHD(){super.enableHD(),this._pixotron.enableAA=!1,this._pixotron.getSAOPass().enabled=!0}sceneChanged(){}getPixotronParams(){return{saoparams:{intensity:.25,occlusionWorldRadius:.4,smoothTransition:!0,samplesPerFrame:4,bias:.016,numSamples:200,accumulative:!1,falloff:1.5},shadowparams:{shadowMapResolution:1024,shadowRadius:3,shadowQuality:1,smoothTransition:!0,enableAccumulation:!0,shadowBiasMultiplier:.6,nearPlane:.01,farPlane:50,fov:110,side:THREE.FrontSide,numSamples:100}}}getBakedShadowParams(){return{enable:!0,shadowMapResolution:512,smoothTransition:!0,numSamples:500,numSamplesPerFrame:4,bShadowMaterial:!0,falloff:1.5,darkness:.2,size:1.6,lightDirection:new THREE.Vector3(0,1,.5),lightSolidAngle:40}}getBounds(){return this._currentGLB?(new THREE.Box3).setFromObject(this._currentGLB):null}}return n([a],e.prototype,"_glbInputManager",void 0),n([a],e.prototype,"_rapiAccess",void 0),e})();class x{constructor(e,t,i){this._prefix="https://furniture.roomle.com/3d/glb/",this._listeners=new Set,this._finishedItems=0,this._sceneManager=e,this._renderer=new THREE.WebGLRenderer({antialias:!0,alpha:!0}),this._width=t,this._height=i,this._renderer.setSize(t,i),this._renderer.setClearColor(16777215,0),this._renderer.outputEncoding=THREE.sRGBEncoding}addListener(e){this._listeners.add(e)}removeListener(e){this._listeners.delete(e)}start(e){return this._entries=[],e.forEach(e=>{this._entries.push(this._transform(e))}),this._finishedItems=0,this._listeners.forEach(e=>e.onStart(this._entries.length)),this._zip=new window.JSZip,this._doNextEntry(),new Promise(e=>{this._resolve=e})}_transform(e){return{name:e.path.replace(".glb",".png"),url:this._prefix+e.path,position:new THREE.Vector3(e.camera.position.x,e.camera.position.z,-e.camera.position.y),fov:2*e.camera.fieldOfView,yaw:e.camera.rotation.z,pitch:e.camera.rotation.x}}_doNextEntry(){0===this._entries.length?(this._listeners.forEach(e=>e.onFinished(this._zip)),this._resolve(this._zip)):this._processEntry(this._entries[0])}_processEntry(e){this._sceneManager.loadGLB(e.url,!1,void 0).then(()=>{this._sceneManager.adjustCamera(e.position,e.yaw,e.pitch,e.fov),this._sceneManager.preparePerspectiveImage(this._renderer,this._width,this._height).then(t=>{this._entryFinished(e,t)})})}_entryFinished(e,t){let i=this._entries.indexOf(e);i>-1&&this._entries.splice(i,1),this._finishedItems++,this._listeners.forEach(e=>e.onElementFinished(this._finishedItems)),this._zip.file(e.name,t.blob),this._doNextEntry()}}let H=(()=>{class e{constructor(e){this._currentIdOrUrl=null,this._creator_=e}setCameraOffset(e){this._sceneManager.setCameraOffset(e)}getCameraOffset(){return this._sceneManager.getCameraOffset()}init(e,t){return this.setOverrides(t),this._domHelper.setDomElement(e),this._sceneManager?(this._lifeCycleManager.resume(),Promise.resolve()):new Promise(this._initPromiseCallback.bind(this))}_initPromiseCallback(e,t){this._threeLoader.fetch().then(()=>{let t=this._scriptLoader.fetch(d,{id:"gltf-loader"}),i=this._scriptLoader.fetch(_,{id:"draco-loader"}),s=this._scriptLoader.fetch(b,{id:"tween-js"});Promise.all([t,i,s]).then(()=>{this._sceneManager=new T(this._creator_,{left:0,top:1,right:1,bottom:0}),this.enableHD(),e()})})}enableHD(){return new Promise((e,t)=>{const i=()=>{this._sceneManager.enableHD(),e()};Promise.all(S.map(e=>this._scriptLoader.fetch(e,{id:e}))).then(()=>{this._scriptLoader.fetch(v,{id:"pi-js"}).then(i,t)},t)})}clearScene(){this._sceneManager.clearScene()}loadGLB(e,t=1,i){return this._currentIdOrUrl=e,this._rapiAccess.trackView(e),this._sceneManager.loadGLB(e,!0,new THREE.Vector3(t,t,t),i)}loadStaticItem(e,t){return this._currentIdOrUrl=e,this._rapiAccess.trackView(e),this._sceneManager.loadStaticItem(e,t)}getCurrentId(){return this._currentIdOrUrl}loadSceneSetting(e){return this._sceneManager.loadSceneSettings(e)}loadQualitySetting(e){this._sceneManager.loadQualitySetting(e)}preparePerspectiveImage(){return this._sceneManager.preparePerspectiveImage()}processRenderList(e,t=320,i=320){let s=JSON.parse(e);this._scriptLoader.fetch("static/jszip.min-dd6c9829408677a1.js",{id:"jszip-js"}).then(()=>{let e=new x(this._sceneManager,t,i);e.addListener(this._sceneManager),e.start(s.items).then(t=>{t.generateAsync({type:"blob"}).then(t=>{let i=document.createElement("a");i.href=URL.createObjectURL(t),i.download="content.zip",i.style.display="none",document.body.appendChild(i),i.click(),document.body.removeChild(i),e.removeListener(this._sceneManager)})})})}setOverrides(e){e&&(this._initData.setOverrides(e),this._globalInitData.setOverrides(e))}updateSize(){this._sceneManager.updateCamera()}getMain(){}resumeTest(e){this._domHelper.setDomElement(e),this._lifeCycleManager.resume()}pauseTest(){this._lifeCycleManager.pause()}showGUI(){this._sceneManager.showGUI()}get callbacks(){return{}}getScene(){return this._sceneManager.getScene()}updateScene(){this._sceneManager.updateScene()}}return n([a],e.prototype,"_rapiAccess",void 0),n([a],e.prototype,"_domHelper",void 0),n([a],e.prototype,"_scriptLoader",void 0),n([a],e.prototype,"_lifeCycleManager",void 0),n([a],e.prototype,"_threeLoader",void 0),n([a],e.prototype,"_initData",void 0),n([a],e.prototype,"_globalInitData",void 0),e})();e("GlbViewer",class extends L{setupGlobals(){}setupDependencies(){m.setup(y),this.lookup("logger",this._context)}cleanUpGlobals(){throw new Error("Method not implemented.")}cleanUpDependencies(){throw new Error("Method not implemented.")}bootFinished(){this._viewer=new H(this._context),window.RoomleGLBViewer||(window.RoomleGLBViewer=this._viewer)}getApi(){return this._viewer}getContextName(){return"glb-viewer"}})}}}));
2
- //# sourceMappingURL=glb-viewer-c1eff647.nomodule.js.map
1
+ System.register(["./query-params-helper-c231e1b8.nomodule.js","./rapi-access-74fbaf72.nomodule.js","./main-thread-to-worker-bb844d54.nomodule.js","./pixotron-358442c5.nomodule.js","./default-light-setting-2218084f.nomodule.js","./scene-manager-86fe8139.nomodule.js"],(function(e){var t,i,s,r,n,a,o,h,c,l,d,_,m,u,p,g,w,f,E,b,S,v,L,C,M;return{setters:[function(){},function(e){t=e.n,i=e.L,s=e.o,r=e.h,n=e._,a=e.i,o=e.d,h=e.f,c=e.P,l=e.e,d=e.G,_=e.a7,m=e.s},function(e){u=e.f},function(e){p=e.I,g=e.S,w=e.C,f=e.L,E=e.B,b=e.T,S=e.e,v=e.g,L=e.M},function(e){C=e.D},function(e){M=e.S}],execute:function(){const y=[new t("script-loader",g),new t("glb-input-manager",class extends p{},1),new t("logger",i),new t("rapi-access",s)];class R extends w{constructor(){super(...arguments),this.shouldIgnoreStandardBehavior=!1}adjust(e,t,i,s,r){let n=new THREE.Vector3(-e.x/2,0,-e.z/2),a=new THREE.Vector3(e.x/2,e.y,e.z/2);this._boundingBox=new THREE.Box3(n,a);let o=new THREE.Euler(-Math.PI/2+s,i,0,"ZYX"),h=(new THREE.Quaternion).setFromEuler(o);this._camera.updateProjectionMatrix(),this._camera.quaternion.copy(h),this._camera.position.copy(t)}_update(e){this.shouldIgnoreStandardBehavior?this._saveYawAndPitch():super._update(e)}animateCamera(e){return!!this.shouldIgnoreStandardBehavior||super.animateCamera(e)}}class B extends f{constructor(e,t){super(e,t),this._params={ambientLight:{color:"#ffffff"}},this._ambientLight=new THREE.AmbientLight(new THREE.Color(this._params.ambientLight.color),.5),this.addToScene()}addToScene(){this._scene.add(this._ambientLight)}removeFromScene(){this._scene.remove(this._ambientLight)}reload(){this.removeFromScene(),this.addToScene()}showGUI(){let e=r();if(e&&this._ambientLight){let t=e.addFolder("Ambient Light");t.add(this._ambientLight,"visible"),t.add(this._ambientLight,"intensity").min(0).max(5).step(.1),t.addColor(this._params.ambientLight,"color").onChange(e=>{this._ambientLight.color=new THREE.Color(e)})}}}let T=(()=>{class e extends M{constructor(e,t){super(e,t,o.GLB,"3D"),this._itemsCount=0,this._standardSceneBackgroundColor=this._scene.background,this._renderer.capabilities.maxTextures>8?this.loadDynamicLightSetting(h.createDynamicLightSettingSource(null,c.CAMERA)):(console.warn("this device has a maximum of 8 texture units thus we are using a simpler light setting"),this._lightSetting=new B(this._scene)),this._setEnvironment(new E(this._scene,this._environment))}createCameraControl(e){this._cameraControl=new R(this._creator_,this._getInputManager(),new THREE.Vector3(-1,1,1))}_getInputManager(){return this._glbInputManager}async loadStaticItem(e,t){const i=await this._rapiAccess.getItem(e);return i.configuration?Promise.reject():this.loadGLB(u(i),!0,void 0,t)}loadGLB(e,t=!0,i=new THREE.Vector3(1,1,1),s){return this.clearScene(),new Promise((r,n)=>{this._loadGLB(e,new THREE.Vector3(0,0,0),0,void 0,i,void 0,void 0,s).then(e=>{this._currentGLB=e,this._scene.add(this._currentGLB);let i=(new THREE.Box3).setFromObject(this._currentGLB);if(t){let e=i.getCenter(new THREE.Vector3);this._cameraControl instanceof R&&(this._cameraControl.updateToBounds(i,!1,!0,e),this._cameraControl.reset(i,e,-15,0))}this._updateBounds(i),r()},n)})}preparePerspectiveImage(e,t,i){return new Promise(s=>{t||(t=1e3),i||(i=1e3),e||((e=new THREE.WebGLRenderer({antialias:!0})).setSize(t,i),e.outputEncoding=THREE.sRGBEncoding,e.autoClear=!1,e.shadowMap.enabled=!0,e.shadowMap.type=THREE.BasicShadowMap);let r=this._cameraControl.getCamera().clone();r instanceof THREE.PerspectiveCamera&&(r.aspect=t/i,r.updateProjectionMatrix()),this._lightSetting.removeFromScene();let n=new C(this._scene);e.render(this._scene,r);let a=e.domElement.toDataURL();e.domElement.toBlob(e=>{s({image:a,width:t,height:i,blob:e})},"image/png"),n.removeFromScene(),this._lightSetting.addToScene()})}adjustCamera(e,t,i,s){if(this._cameraControl instanceof R){let r=(new THREE.Box3).setFromObject(this._scene).getSize(new THREE.Vector3);this._cameraControl.adjust(r,e,t,i,s),this._requestRender()}}onStart(e){this._itemsCount=e,this._scene.background=null,this._cameraControl instanceof R&&(this._cameraControl.shouldIgnoreStandardBehavior=!0)}onElementFinished(e){this._itemsCount,Math.round(100/this._itemsCount*e)}onFinished(e){this._scene.background=this._standardSceneBackgroundColor,this._cameraControl instanceof R&&(this._cameraControl.shouldIgnoreStandardBehavior=!1)}clearScene(){this._currentGLB&&(this._scene.remove(this._currentGLB),l(this._currentGLB),this._currentGLB=null),super.clearScene()}enableHD(){super.enableHD(),this._pixotron.enableAA=!1,this._pixotron.getSAOPass().enabled=!0}sceneChanged(){}getPixotronParams(){return{saoparams:{intensity:.25,occlusionWorldRadius:.4,smoothTransition:!0,samplesPerFrame:4,bias:.016,numSamples:200,accumulative:!1,falloff:1.5},shadowparams:{shadowMapResolution:1024,shadowRadius:3,shadowQuality:1,smoothTransition:!0,enableAccumulation:!0,shadowBiasMultiplier:.6,nearPlane:.01,farPlane:50,fov:110,side:THREE.FrontSide,numSamples:100}}}getBakedShadowParams(){return{enable:!0,shadowMapResolution:512,smoothTransition:!0,numSamples:500,numSamplesPerFrame:4,bShadowMaterial:!0,falloff:1.5,darkness:.2,size:1.6,lightDirection:new THREE.Vector3(0,1,.5),lightSolidAngle:40}}getBounds(){return this._currentGLB?(new THREE.Box3).setFromObject(this._currentGLB):null}}return n([a],e.prototype,"_glbInputManager",void 0),n([a],e.prototype,"_rapiAccess",void 0),e})();class x{constructor(e,t,i){this._prefix="https://furniture.roomle.com/3d/glb/",this._listeners=new Set,this._finishedItems=0,this._sceneManager=e,this._renderer=new THREE.WebGLRenderer({antialias:!0,alpha:!0}),this._width=t,this._height=i,this._renderer.setSize(t,i),this._renderer.setClearColor(16777215,0),this._renderer.outputEncoding=THREE.sRGBEncoding}addListener(e){this._listeners.add(e)}removeListener(e){this._listeners.delete(e)}start(e){return this._entries=[],e.forEach(e=>{this._entries.push(this._transform(e))}),this._finishedItems=0,this._listeners.forEach(e=>e.onStart(this._entries.length)),this._zip=new window.JSZip,this._doNextEntry(),new Promise(e=>{this._resolve=e})}_transform(e){return{name:e.path.replace(".glb",".png"),url:this._prefix+e.path,position:new THREE.Vector3(e.camera.position.x,e.camera.position.z,-e.camera.position.y),fov:2*e.camera.fieldOfView,yaw:e.camera.rotation.z,pitch:e.camera.rotation.x}}_doNextEntry(){0===this._entries.length?(this._listeners.forEach(e=>e.onFinished(this._zip)),this._resolve(this._zip)):this._processEntry(this._entries[0])}_processEntry(e){this._sceneManager.loadGLB(e.url,!1,void 0).then(()=>{this._sceneManager.adjustCamera(e.position,e.yaw,e.pitch,e.fov),this._sceneManager.preparePerspectiveImage(this._renderer,this._width,this._height).then(t=>{this._entryFinished(e,t)})})}_entryFinished(e,t){let i=this._entries.indexOf(e);i>-1&&this._entries.splice(i,1),this._finishedItems++,this._listeners.forEach(e=>e.onElementFinished(this._finishedItems)),this._zip.file(e.name,t.blob),this._doNextEntry()}}let H=(()=>{class e{constructor(e){this._currentIdOrUrl=null,this._creator_=e}setCameraOffset(e){this._sceneManager.setCameraOffset(e)}getCameraOffset(){return this._sceneManager.getCameraOffset()}init(e,t){return this.setOverrides(t),this._domHelper.setDomElement(e),this._sceneManager?(this._lifeCycleManager.resume(),Promise.resolve()):new Promise(this._initPromiseCallback.bind(this))}_initPromiseCallback(e,t){this._threeLoader.fetch().then(()=>{let t=this._scriptLoader.fetch(d,{id:"gltf-loader"}),i=this._scriptLoader.fetch(_,{id:"draco-loader"}),s=this._scriptLoader.fetch(b,{id:"tween-js"});Promise.all([t,i,s]).then(()=>{this._sceneManager=new T(this._creator_,{left:0,top:1,right:1,bottom:0}),this.enableHD(),e()})})}enableHD(){return new Promise((e,t)=>{const i=()=>{this._sceneManager.enableHD(),e()};Promise.all(S.map(e=>this._scriptLoader.fetch(e,{id:e}))).then(()=>{this._scriptLoader.fetch(v,{id:"pi-js"}).then(i,t)},t)})}clearScene(){this._sceneManager.clearScene()}loadGLB(e,t=1,i){return this._currentIdOrUrl=e,this._rapiAccess.trackView(e),this._sceneManager.loadGLB(e,!0,new THREE.Vector3(t,t,t),i)}loadStaticItem(e,t){return this._currentIdOrUrl=e,this._rapiAccess.trackView(e),this._sceneManager.loadStaticItem(e,t)}getCurrentId(){return this._currentIdOrUrl}loadSceneSetting(e){return this._sceneManager.loadSceneSettings(e)}loadQualitySetting(e){this._sceneManager.loadQualitySetting(e)}preparePerspectiveImage(){return this._sceneManager.preparePerspectiveImage()}processRenderList(e,t=320,i=320){let s=JSON.parse(e);this._scriptLoader.fetch("static/jszip.min-dd6c9829408677a1.js",{id:"jszip-js"}).then(()=>{let e=new x(this._sceneManager,t,i);e.addListener(this._sceneManager),e.start(s.items).then(t=>{t.generateAsync({type:"blob"}).then(t=>{let i=document.createElement("a");i.href=URL.createObjectURL(t),i.download="content.zip",i.style.display="none",document.body.appendChild(i),i.click(),document.body.removeChild(i),e.removeListener(this._sceneManager)})})})}setOverrides(e){e&&(this._initData.setOverrides(e),this._globalInitData.setOverrides(e))}updateSize(){this._sceneManager.updateCamera()}getMain(){}resumeTest(e){this._domHelper.setDomElement(e),this._lifeCycleManager.resume()}pauseTest(){this._lifeCycleManager.pause()}showGUI(){this._sceneManager.showGUI()}get callbacks(){return{}}getScene(){return this._sceneManager.getScene()}updateScene(){this._sceneManager.updateScene()}}return n([a],e.prototype,"_rapiAccess",void 0),n([a],e.prototype,"_domHelper",void 0),n([a],e.prototype,"_scriptLoader",void 0),n([a],e.prototype,"_lifeCycleManager",void 0),n([a],e.prototype,"_threeLoader",void 0),n([a],e.prototype,"_initData",void 0),n([a],e.prototype,"_globalInitData",void 0),e})();e("GlbViewer",class extends L{setupGlobals(){}setupDependencies(){m.setup(y),this.lookup("logger",this._context)}cleanUpGlobals(){throw new Error("Method not implemented.")}cleanUpDependencies(){throw new Error("Method not implemented.")}bootFinished(){this._viewer=new H(this._context),window.RoomleGLBViewer||(window.RoomleGLBViewer=this._viewer)}getApi(){return this._viewer}getContextName(){return"glb-viewer"}})}}}));
2
+ //# sourceMappingURL=glb-viewer-b176add0.nomodule.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"glb-viewer-c1eff647.nomodule.js","sources":["../../node_modules/jszip/dist/jszip.min.js"],"sourcesContent":["export default \"static/jszip.min-dd6c9829408677a1.js\""],"names":[],"mappings":"03QAAe"}
1
+ {"version":3,"file":"glb-viewer-b176add0.nomodule.js","sources":["../../node_modules/jszip/dist/jszip.min.js"],"sourcesContent":["export default \"static/jszip.min-dd6c9829408677a1.js\""],"names":[],"mappings":"03QAAe"}
@@ -0,0 +1,2 @@
1
+ import"./query-params-helper-a271f9dc.js";import"./rapi-access-f8222879.js";import"./main-thread-to-worker-91bf9f5e.js";import"./pixotron-5bb3aafe.js";import"./default-light-setting-dbb59ba5.js";import"./scene-manager-4637ed82.js";import{GlbViewer}from"./glb-viewer-58c75d10.js";(new GlbViewer).boot();
2
+ //# sourceMappingURL=glb-viewer-main-fd9ff00c.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"glb-viewer-main-fd9ff00c.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,2 +1,2 @@
1
- System.register(["./query-params-helper-c231e1b8.nomodule.js","./rapi-access-339cccf6.nomodule.js","./main-thread-to-worker-35970716.nomodule.js","./pixotron-17562920.nomodule.js","./default-light-setting-269087a3.nomodule.js","./scene-manager-7cd0736c.nomodule.js","./glb-viewer-c1eff647.nomodule.js"],(function(){var e;return{setters:[function(){},function(){},function(){},function(){},function(){},function(){},function(n){e=n.GlbViewer}],execute:function(){(new e).boot()}}}));
1
+ System.register(["./query-params-helper-c231e1b8.nomodule.js","./rapi-access-74fbaf72.nomodule.js","./main-thread-to-worker-bb844d54.nomodule.js","./pixotron-358442c5.nomodule.js","./default-light-setting-2218084f.nomodule.js","./scene-manager-86fe8139.nomodule.js","./glb-viewer-b176add0.nomodule.js"],(function(){var e;return{setters:[function(){},function(){},function(){},function(){},function(){},function(){},function(n){e=n.GlbViewer}],execute:function(){(new e).boot()}}}));
2
2
  //# sourceMappingURL=glb-viewer-main.nomodule.js.map
@@ -0,0 +1,2 @@
1
+ import{U as UiCallback,T as convertToTHREE,J as fadeIn,V as getMaterialId,e as dispose,W as getBoundingBoxMaterial,O as PREVIEW_MATERIAL_COLOR,X as getColorFromInt,Q as PREVIEW_MATERIAL_OPACITY,Y as getSelectionGeometry,Z as convertToThreeDimensions,_ as __decorate,i as inject,$ as checkGLB,C as CommonKernelAccess,B as Benchmark,E as Env,M as MESH_DEFAULT_FORMAT,a0 as ConfiguratorViewModel,s as RoomleDependencyInjection,j as kernelBoxToThreeBox,a1 as vectorIsZero,a2 as disposeMesh,t as toRadiant,h as getGUI}from"./rapi-access-f8222879.js";import{f as getGlbUrl}from"./main-thread-to-worker-91bf9f5e.js";import{E as EventDispatcher,L as LightSetting}from"./pixotron-5bb3aafe.js";import{D as DefaultLightSetting}from"./default-light-setting-dbb59ba5.js";var GLTF_EXPORTER_FILE_NAME="static/GLTFExporter-86edae059df3a219.js";class ConfiguratorUiCallbacks extends UiCallback{constructor(e){super(e),this.onKernelIsReady=null,this.onComponentPositionsUpdated=null,this.onUpdateParameters=e=>{},this.onUpdatePossibleChildren=(e,t)=>{},this.onUpdatePrice=(e,t)=>{},this.onSelectionChange=(e,t,n,r)=>{},this.onSelectionCancel=()=>{},this.onPartListUpdate=(e,t)=>{},this.onBoundsUpdate=e=>{},this.onLoadConfiguration=()=>{},this.onConfigurationReady=(e,t,n)=>{},this.onOpenTag=e=>{},this.onOpenAddOns=()=>{},this.onClickOutside=()=>{},this.onNoDockingsAvailable=()=>{},this.onUiIntersectionChange=e=>{},this.onZoomChange=(e,t)=>{},this.onDimensionsVisibilityChange=e=>{},this.onErrorDueToOffline=e=>{},this.onError=e=>{},this.onDockingsPreviewRemoved=()=>{},this.onConfigurationHasChildren=e=>{},this.onTrackTiming=(e,t,n,r)=>{},this.onUserInitiatedDockDone=(e,t,n,r,o)=>{},this.onAddonPlusHover=()=>{},this.onAddonPlusHoverOff=()=>{},this.onAddonPlusShown=()=>{},this.onAddonPlusHidden=()=>{},this.onContentProblem=e=>{},this.onSyncStarted=()=>{},this.onSyncDone=()=>{},this.onOpenFloorMaterials=()=>{},this.onOpenPartList=()=>{},this.onComponentLoadError=(e,t)=>{},this.onConfigurationLoadError=()=>{},this.onChangeTypeChangeTag=e=>{},this.onRemoveTypeChangeTag=e=>{},this.onConfigurationLabelChange=(e,t,n)=>{},this.onMemoryCorruption=()=>{},this.onConfiguratorKernelIsReady=(e,t)=>{},this.onConfigurationSaved=e=>{},this.onCameraPositionChanges=()=>{}}}class Waiter{constructor(){this._promiseExecutors=[]}create(){return new Promise((e,t)=>{this._promiseExecutors.push({resolve:e,reject:t})})}resolve(e){return new Promise(t=>{this._promiseExecutors.forEach(t=>t.resolve(e)),this._promiseExecutors=[],t(e)})}reject(e){return new Promise((t,n)=>{this._promiseExecutors.forEach(t=>t.reject(e)),this._promiseExecutors=[],n(e)})}}class PlanElementViewModel extends class{constructor(e){this._coreReference=e.clone()}clearReference(){this._coreReference.delete(),this._coreReference=null}getKernelObject(){return this._coreReference}}{constructor(e){super(e),this._objectWaiter=new Waiter;const t=convertToTHREE(e.getCenter());this._container=new THREE.Object3D,this._container.position.copy(t),this._boundingBox=this._generateBoundingBox(this.getSize(),e.customColor),fadeIn(this._boundingBox),this._container.add(this._boundingBox),2!==this.getPlanElement().getType().value&&(this._object=new THREE.Object3D,this._container.add(this._object))}getSize(){return this._object?(new THREE.Box3).setFromObject(this._object).getSize(new THREE.Vector3):new THREE.Vector3}update(){this._container.position.copy(convertToTHREE(this.getPlanElement().getCenter()))}getPosition(){return this._container.position}getRotation(){return this._container.rotation.y}getBounds(){let e=new THREE.Box3;return e.setFromObject(this._container),e}getBoundingBox(){return this._boundingBox}getPlanElement(){return this._coreReference}setObject(e){this._object=e,this._objectWaiter.resolve(e)}getObject(){return this._object}async getObjectAsync(){return this._object?Promise.resolve(this._object):this._objectWaiter.create()}addMesh(e){this._object.add(e),this.hidePreviewBox()}getMesh(e){if(!this._object||0===this._object.children.length)return null;const t=getMaterialId(e,this.getPlanElement().getType());return this._object.children.find(e=>e.userData.material===t)}getContainer(){return this._container}getId(){return this.getPlanElement().getId()}clear(){dispose(this._container),this._selectionMesh&&dispose(this._selectionMesh)}hidePreviewBox(){this._container&&this._boundingBox&&(this._boundingBox.material=getBoundingBoxMaterial())}_generateBoundingBox(e,t){e.addScalar(.01);let n=new THREE.BoxGeometry(e.x,e.y,e.z),r=new THREE.Color(PREVIEW_MATERIAL_COLOR);t>0&&(r=getColorFromInt(t));let o=new THREE.MeshStandardMaterial({color:r,opacity:PREVIEW_MATERIAL_OPACITY,transparent:!0}),i=new THREE.Mesh(n,o);return i.name="bounding box",i.position.y=e.y/2,i.castShadow=!1,i.receiveShadow=!1,i.layers.set(5),i}select(){if(!this._selectionMesh){let e=new THREE.MeshStandardMaterial({color:this._primaryColor,opacity:PREVIEW_MATERIAL_OPACITY,transparent:!0});const t=convertToTHREE(this.getPlanElement().getCenter());this._selectionMesh=new THREE.Mesh(getSelectionGeometry(t,this.getSize()),e)}this._container.add(this._selectionMesh)}deselect(){this._selectionMesh&&this._container.remove(this._selectionMesh)}setPrimaryColor(e){this._primaryColor=e}}class PlanObjectViewModel extends PlanElementViewModel{constructor(e){super(e),this._container.rotation.y=e.rotation}getPlanObject(){return this.getPlanElement()}getSize(){return convertToThreeDimensions(this.getPlanObject().size)}update(){super.update(),this._container.rotation.y=this.getPlanObject().rotation}}class ConfiguratorPlanObjectViewModel extends PlanObjectViewModel{constructor(e){super(e),this._container.name="Configurable "+this._container.name}addRootComponent(e){this.setObject(e),this._container.add(this.getObject())}getConfigurationRuntimeId(){return this.getPlanObject().getConfigurationRuntimeId()}}let StaticPlanObjectViewModel=(()=>{class e extends PlanObjectViewModel{constructor(e){super(e),this._container.name="Static "+this._container.name}setRapiItem(e){return this._addStaticItem(e)}_addStaticItem(e){this._rapiItem=e;let t=this.getPlanObject();this._glbUrl=getGlbUrl(e);let n=e.scaleable?convertToThreeDimensions(t.size):void 0,r=new THREE.Vector3(1,1,1);return t.flipX&&(r.x*=-1),t.flipY&&(r.z*=-1),new Promise(o=>{this._staticItemLoader.loadGLB(this._glbUrl,void 0,void 0,n,r,t.customColor,e.colorable).then(t=>{t.name=e.label,this.setObject(t),checkGLB(t,this._glbUrl),fadeIn(t),this._container.add(this.getObject()),this.hidePreviewBox(),o()})})}getRapiItem(){return this._rapiItem}needsRapiItem(){return!this._glbUrl}getGLBUrl(){return this._glbUrl}}return __decorate([inject],e.prototype,"_staticItemLoader",void 0),e})();class WallPlanElementViewModel extends PlanElementViewModel{constructor(e){super(e),this._container.name="Wall Plan Element"}addMesh(e){super.addMesh(e);const t=(new THREE.Box3).setFromObject(this.getObject()).getSize(new THREE.Vector3);this._boundingBox.geometry=new THREE.BoxGeometry(t.x,t.y,t.z),this._boundingBox.position.y=t.y/2}}class FloorPlanElementViewModel extends PlanElementViewModel{constructor(e){super(e),this._container.name="Floor Plan Element"}addMesh(e){super.addMesh(e),e.castShadow=!1;const t=(new THREE.Box3).setFromObject(this.getObject()).getSize(new THREE.Vector3);this._boundingBox.geometry=new THREE.BoxGeometry(t.x,.01,t.z)}}class CeilingPlanElementViewModel extends PlanElementViewModel{constructor(e){super(e),this._container.name="Ceiling Plan Element"}addMesh(e){super.addMesh(e),e.castShadow=!1;const t=(new THREE.Box3).setFromObject(this.getObject()).getSize(new THREE.Vector3);this._boundingBox.geometry=new THREE.BoxGeometry(t.x,.01,t.z)}}let PlannerKernelAccess=(()=>{class e extends CommonKernelAccess{constructor(e){super(e,0),this._plannerKernelCallbackListener=new Set,Benchmark.addMeta("kernel_is_ready",{isWasm:this._useWASM}),this._scriptLoader.fetch(this._kernelPath,{id:"kernel"}).then(this._loadSuccess.bind(this),this._loadError.bind(this))}get kernelContainer(){return this._kernelContainer}_loadSuccess(){window.RoomleCore(this._kernelContainer)}_loadError(){console.error("kernel load error")}_createPlanInteractionHandler(){const e=this._kernelContainer;this._planInteractionHandler=new e.PlanInteractionHandler,this._planInteractionHandler.init(this._planInteractionHandler,1,100,!0,!0,e.DrawingType.CLICK_PER_CLICK),this._roomlePlannerUiCallback.onPlanInteractionHandlerCreated(this._planInteractionHandler)}addPlannerListener(e){this._plannerKernelCallbackListener.add(e)}removePlannerListener(e){this._plannerKernelCallbackListener.delete(e)}isReady(){super.isReady(),this.registerCallbacks(),this._roomlePlannerUiCallback.onPlannerKernelIsReady(this._kernelContainer),this._createPlanInteractionHandler();const e=this._planInteractionHandler.getConfiguratorKernel();this._kernelInstance=e,this._roomlePlannerUiCallback.onConfiguratorKernelIsReady(this._kernelContainer,e),Env.isProduction||(window.__RML__DEBUG__.ConfiguratorKernel=this._kernelInstance,window.__RML__DEBUG__.PlannerKernelContainer=this._kernelContainer),this._kernelAccessCallback.isReady(),this._kernelInstance.useEnvironmentGeometry(!1)}get callbacks(){return this._roomlePlannerUiCallback}get planInteractionHandler(){return this._planInteractionHandler}get planModelViewHelper(){return this._kernelContainer.PlanModelViewHelper}catalogItemLoaded(e){const t=this._rapiItemToKernelItem(e);this._kernelContainer.catalogItemLoaded(t)}async insertItems(e){let t=new this._kernelContainer.CatalogItemPtrList;e.forEach(e=>{let n=e.count||1;for(let r=0;r<n;r++)e.count||(e.count=0),t.push_back(this._rapiItemToKernelItem(e))}),this._planInteractionHandler.addPlanObjects(t);const n=this._planInteractionHandler.getPlan().extRef.jsObject;await Promise.all(n.getStaticPlanObjectViewModels().map(async e=>{if(e.needsRapiItem()){const t=await this._rapiAccess.getItem(e.getPlanObject().getCatalogItemId());e.setRapiItem(t)}}))}_rapiItemToKernelItem(e){let t=new this._kernelContainer.CatalogItem(e.id),n=t.size;return n.x=e.width||0,n.y=e.depth||0,n.z=e.height||0,t.size=n,t.flipable=e.flipable,e.layer&&(t.layer=e.layer),t.orderable=e.orderable,t.scaleable=e.scaleable,t.type=e.type||"other",t.detailType=e.detailType||t.type||"other",t.configuration=e.configuration||"",t}onLoadComponentError(e,t){}configurationLoaded(e,t,n,r,o){}componentDefinitionLoaded(e,t){}componentDefinitionLoadingError(e,t){}configurationLoadingError(){}componentConfigurationUpdated(e){}componentParameters(){}requestComponentDimensions(){}planObjectCreated(e,t){}planObjectUpdated(e){}planObjectConfigurationUpdated(e,t,n){}planObjectDeleted(){}requestPlanObjectDimensions(){}cleanUpCallbacks(){super.cleanUpCallbacks(),this._kernelContainer.unregisterPlannerCallback(this)}registerCallbacks(){super.registerCallbacks(),this._kernelContainer.registerPlannerCallback(this)}async requestExternalMesh(e,t){let n;try{n=await this._rapiAccess.getMesh(e,MESH_DEFAULT_FORMAT,t)}catch(e){throw console.error(e),e}try{const r=await fetch(new Request(this._dataSyncer.requestAsset(n.url,!0))),o=await r.arrayBuffer();await this._handleCortoMesh(o,e,t)}catch(e){throw console.error(e),e}}Editor3dRootComponentCreated(e,t,n,r){this._configuratorKernelCallbackListener.forEach(o=>o.Editor3dComponentCreated(e,t,n,r,!0))}Editor3dPlanObjectConstructionDone(e){}Editor3dBeginGroup(){}Editor3dEndGroup(){}Editor3dSetMaterial(){}Editor3dLoadMaterial(){}Editor3dAddDockPreview(e,t){}Editor3dSetPreviewPointAssociations(e,t){}Editor3dSetPreviewLineAssociations(e,t){}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(){}planElementRemoved(e){this._plannerKernelCallbackListener.forEach(t=>t.planElementRemoved(e)),this._plannerKernelCallbackListener.forEach(t=>t.removePlanObjectFromScene(e.extRef.jsObject)),this._decoupleReferences(e)}handlerSwitchedPlans(e,t){if(this._decoupleReferences(e),t){let e=new PlanViewModel(this._creator_);e.setReference(t),this._coupleReferences(e,t),this._plannerKernelCallbackListener.forEach(t=>t.handlerSwitchedPlans(e))}}planBoundsChanged(){this._plannerKernelCallbackListener.forEach(e=>e.planBoundsChanged())}planCleared(){}planCompletelyLoaded(e){this._plannerKernelCallbackListener.forEach(t=>t.planCompletelyLoaded(e))}planElement3dMeshChanged(e,t){if(t.extRef){const e=t.extRef.jsObject;for(let t=e.getObject().children.length-1;t>=0;t--)e.getObject().remove(e.getObject().children[t])}this.planModelViewHelper.requestMesh3d(t)}planElementAdded(e,t){if(e&&e.extRef)if(t.getType()===this._kernelContainer.PlanElementType.OBJECT){let n,r=t;r.hasConfiguration()?(n=new ConfiguratorPlanObjectViewModel(r),this._coupleReferences(n,r),e.extRef.jsObject.addPlanElementViewModel(n)):(n=new StaticPlanObjectViewModel(r),this._coupleReferences(n,r),e.extRef.jsObject.addPlanElementViewModel(n)),this._plannerKernelCallbackListener.forEach(e=>e.addPlanObjectToScene(n))}else{let n,r=t;if(t.getType()===this._kernelContainer.PlanElementType.WALL?n=new WallPlanElementViewModel(r):t.getType()===this._kernelContainer.PlanElementType.FLOOR?n=new FloorPlanElementViewModel(r):t.getType()===this._kernelContainer.PlanElementType.CEILING&&(n=new CeilingPlanElementViewModel(r)),!n)return;n.setPrimaryColor(this._initData.colors.PRIMARY),this._coupleReferences(n,r),e.extRef.jsObject.addPlanElementViewModel(n),this.planModelViewHelper.requestMesh3d(t)}}planElementChanged(e,t){if(t.extRef){let n=t.extRef.jsObject;n.update(),this._plannerKernelCallbackListener.forEach(t=>t.planElementChanged(e,n))}}planHistoryStateChanged(){}planObjectConfigurationCreated(e,t){}planObjectConfigurationLoaded(e,t,n){e&&e.extRef&&t&&t.extRef&&t.extRef.jsObject.getPlanObject().getConfigurationRuntimeId()>0&&this._plannerKernelCallbackListener.forEach(r=>r.planObjectConfigurationLoaded(e,t,n))}requestCatalogItem(e){}startedDrawing(){}stoppedDrawing(){}updateMesh2d(){}beginConstruction(){}addMesh(e,t,n,r,o,i){this._plannerKernelCallbackListener.forEach(a=>a.addMesh(e,t,n,r,o,i))}endConstruction(){}beginPlanConstruction(e){this._plannerKernelCallbackListener.forEach(t=>t.beginPlanConstruction(e))}addPlanMesh(e,t,n,r,o,i,a){this._plannerKernelCallbackListener.forEach(s=>s.addPlanMesh(e,t,n,r,o,i,a))}endPlanConstruction(e){this._plannerKernelCallbackListener.forEach(t=>t.endPlanConstruction(e))}addPlanObjectFromItem(e,t,n){if(!t&&!n)return this.insertItems([e]);n=n||0===n?n:0,t=t||{x:0,y:0,z:0};const r=this._rapiItemToKernelItem(e);return this._planInteractionHandler.addPlanObjectFromItem(r,t,n)}_coupleReferences(e,t){let n=new this._kernelContainer.EMSReference;n.jsObject=e,t.extRef=n}_decoupleReferences(e){e&&e.extRef&&(e.extRef.jsObject.clearReference(),e.extRef.jsObject=null,e.extRef.delete(),e.extRef=null)}}return __decorate([inject],e.prototype,"_kernelAccessCallback",void 0),__decorate([inject],e.prototype,"_roomlePlannerUiCallback",void 0),__decorate([inject],e.prototype,"_initData",void 0),e})(),PlanViewModel=(()=>{class e extends ConfiguratorViewModel{constructor(e){super(e),this._configurablePlanObjectViewModels=[],this._staticPlanObjectViewModels=[],this._constructionGroup=new THREE.Group,this._constructionGroup.name="Construction",this._ceilingGroup=new THREE.Group,this._getKernelAccess().addPlannerListener(this)}planBoundsChanged(){}_getKernelAccess(){return RoomleDependencyInjection.lookup("planner-kernel-access",this._creator_)}setReference(e){this._coreReference=e.clone()}clearReference(){this._coreReference.delete(),this._coreReference=null,super.clearReference()}getCorePlan(){return this._coreReference}addPlanElementViewModel(e){e instanceof ConfiguratorPlanObjectViewModel?this._configurablePlanObjectViewModels.push(e):e instanceof StaticPlanObjectViewModel?(this._staticPlanObjectViewModels.push(e),"door"!==e.getPlanObject().getObjectType()&&"window"!==e.getPlanObject().getObjectType()&&this._initData.edit&&this._plannerSceneEventHandler.addPlanObjectHandlers(e)):e instanceof WallPlanElementViewModel?(this._initData.edit&&this._plannerSceneEventHandler.addWallHandlers(e),this._constructionGroup.add(e.getContainer())):(e instanceof FloorPlanElementViewModel||e instanceof CeilingPlanElementViewModel)&&this._constructionGroup.add(e.getContainer())}_addRootComponent(e){const t=this._getPlanObjectViewModelForRuntimeId(e.parentObjectId);t&&t instanceof ConfiguratorPlanObjectViewModel&&(t.addRootComponent(e),this._initData.edit&&this._plannerSceneEventHandler.addPlanObjectHandlers(t),t.hidePreviewBox())}_getPlanObjectViewModelForRuntimeId(e){let t=null;return this._configurablePlanObjectViewModels.forEach(n=>{e===n.getConfigurationRuntimeId()&&(t=n)}),t}getPlanObjectForId(e){let t=null;return this._configurablePlanObjectViewModels.forEach(n=>{e===n.getId()&&(t=n)}),this._staticPlanObjectViewModels.forEach(n=>{e===n.getId()&&(t=n)}),t}getConstructionGroup(){return this._constructionGroup}getCeilingGroup(){return this._ceilingGroup}getBoundingBox(){const e=this.getCorePlan();return e?kernelBoxToThreeBox(e.getBounds()):(new THREE.Box3).setFromObject(this._constructionGroup)}setPlannerSceneEventHandler(e){this._plannerSceneEventHandler=e}sceneCleared(){this._configurablePlanObjectViewModels.forEach(e=>{e.clear()}),this._staticPlanObjectViewModels.forEach(e=>{e.clear()}),super.sceneCleared()}getStaticPlanObjectViewModels(){return this._staticPlanObjectViewModels}getComponent(e){return this._components.get(e)}_generateMesh(e=0,t=null,n,r,o,i,a,s,l){return this._plannerMeshGenerator.generateMesh(t,n,r,o,i,a,s,l)}_setMaterial(e,t,n){this._plannerMeshGenerator.setMaterial(e,t)}Editor3dComponentCreated(e,t,n,r,o){super.Editor3dComponentCreated(e,t,n,r,o),this._getKernelAccess()instanceof PlannerKernelAccess&&this.dockComponent(e,r,t,n)}addPlanObjectToScene(e){}handlerSwitchedPlans(e){this._constructionGroup.clear(),this._ceilingGroup.clear()}planCompletelyLoaded(e){}beginPlanConstruction(e){}addPlanMesh(e,t,n,r,o,i,a){}endPlanConstruction(e){}planElementChanged(e,t){}planObjectConfigurationLoaded(e,t,n){}addMesh(e,t,n,r,o,i){const a=e.extRef.jsObject;let s=a.getMesh(t);s?s.geometry=this._plannerMeshGenerator.generateGeometry(null,n,r,o,i):(s=this._generateMesh(0,null,t,n,r,o,i,e.getType()),a.addMesh(s))}removePlanObjectFromScene(e){}planElementRemoved(e){if(e.getType()===this._getKernelAccess().kernelContainer.PlanElementType.OBJECT){let t=e;if(t.hasConfiguration()){const e=t.extRef.jsObject,n=this._configurablePlanObjectViewModels.indexOf(e);n>-1&&this._configurablePlanObjectViewModels.splice(n,1)}else{const e=t.extRef.jsObject,n=this._staticPlanObjectViewModels.indexOf(e);n>-1&&this._staticPlanObjectViewModels.splice(n,1)}}}getMeshGenerator(){return this._plannerMeshGenerator}}return __decorate([inject],e.prototype,"_plannerMeshGenerator",void 0),e})();const ROTATION_TO_DETECT_SIDE=toRadiant(30);class RaycastHelper extends EventDispatcher{constructor(e,t,n,r){super(),this._offset=new THREE.Vector3(0,0,0),this._mode=void 0===r?1:r,this._scene=e,this._camera=t,this._raycaster=new THREE.Raycaster,this._raycaster.layers.enableAll(),this._inputManager=n,this._addInputListeners(n),this._planeBottom=new THREE.Plane(new THREE.Vector3(0,1,0)),this._planeFront=new THREE.Plane(new THREE.Vector3(0,0,1)),this._planeSide=new THREE.Plane(new THREE.Vector3(1,0,0))}setLayers(e){this._raycaster.layers=e}_addInputListeners(e){e.addEventListener(3,e=>{this._findCandidate(e.positionRelative)},this),e.addEventListener(5,e=>{this._findSelection(e.positionRelative)},this),e.addEventListener(6,e=>{this._findHover(e.positionRelative,e.type)},this),e.addEventListener(0,e=>{this._onDragStart(e.positionRelative)},this),e.addEventListener(1,e=>{this._onDrag(e.positionRelative)},this),e.addEventListener(2,e=>{this._onDragEnd(e.positionRelative)},this),e.addEventListener(9,e=>{this._onRotate(e.positionRelative,e.rotation)},this),e.addEventListener(10,()=>{this._currentRotate=null},this)}_findCandidate(e){this._intersection(e)&&this._inputManager.onElementHit()}_findSelection(e){let t=this._intersection(e);t?t&&t.object.dispatchEvent({type:"select"}):this.dispatchEvent(3)}_findHover(e,t){const n=this._intersection(e);!n&&this._currentHover?(this._currentHover.dispatchEvent({type:"hover_off",attachment:{type:t}}),this._currentHover=null):n&&(this._currentHover&&this._currentHover.id!==n.object.id&&(this._currentHover.dispatchEvent({type:"hover_off",attachment:{type:t}}),this._currentHover=null),this._currentHover?this._currentHover.dispatchEvent({type:"hover_move",attachment:{intersection:n,type:t}}):(this._currentHover=n.object,this._currentHover.dispatchEvent({type:"hover_on",attachment:{intersection:n,type:t}})))}_intersection(e){const t=this._intersect(e);if(t.length<=0)return null;let n=t[0];return t.length>1&&this._currentHover&&this._currentDrag&&this._currentDrag.id!==this._currentHover.id&&t.forEach(e=>{e.object.id===this._currentHover.id&&e.object.userData.priority===this._currentHover.userData.priority&&n.object.userData.priority<=e.object.userData.priority&&(n=e)}),n}_intersect(e){this._raycaster.setFromCamera(e,this._camera);const t=[];return this._raycaster.intersectObjects(this._scene.children,!0).forEach(e=>{const n=this._findObjectWithHandler(e.object);n&&(e.object=n,t.push(e))}),t.length>=0?t.sort((e,t)=>e.object.userData.priority!==t.object.userData.priority?t.object.userData.priority-e.object.userData.priority:e.distance-t.distance):[]}_findObjectWithHandler(e){return e.userData.hasListener?e:e.parent?this._findObjectWithHandler(e.parent):null}_onDragStart(e){let t=this._intersection(e);if(!t&&!this._currentDrag)return;if(t&&t.object.userData.roomleId===this._rootComponentId)return;!this._currentDrag&&t&&(this._currentDrag=t.object,this._currentDrag.dispatchEvent({type:"drag_start"}));let n=this._currentDrag.parent;n&&n.computeBoundingBox&&(n.computeBoundingBox(),this._calculateOffset(n)),this._positionPlanes(n)}_onDrag(e){if(!this._currentDrag)return;this._raycaster.setFromCamera(e,this._camera);let t,n=new THREE.Vector3(0,0,-5);if(this._raycaster.ray.intersectPlane(this._planeBottom,n),0===this._mode){const e=this._scene.children.find(({type:e,name:t})=>"Group"===e&&"Construction"===t);if(e){const t=this._raycaster.intersectObjects(e.children,!0);if(t.length){const e=t[0].point.clone();return void this._currentDrag.dispatchEvent({type:"drag",attachment:{position:e}})}}t=n.clone(),t.y=this._currentDrag.parent.position.y}else t=this._getIntersectionPosition(n),t.sub(this._offset);this._currentDrag.dispatchEvent({type:"drag",attachment:{position:t}})}_getIntersectionPosition(e){let t=this._getDistanceToCamera(e),n=this._camera.userData.yaw,r=new THREE.Vector3(0,0,0),o=new THREE.Vector3(0,0,0);this._raycaster.ray.intersectPlane(this._planeFront,r),this._raycaster.ray.intersectPlane(this._planeSide,o);let i,a=this._getDistanceToCamera(o),s=this._getDistanceToCamera(r);return n>=-ROTATION_TO_DETECT_SIDE&&n<=ROTATION_TO_DETECT_SIDE?i=t<s?e.clone():r.clone():t<s&&t<a?i=e.clone():s<t&&s<a?i=r.clone():a<t&&a<s&&(i=o.clone()),i}_getDistanceToCamera(e){let t=e.clone().sub(this._camera.position).length();return vectorIsZero(e)&&(t=Number.POSITIVE_INFINITY),t}_onDragEnd(e){this._currentDrag&&(this._currentDrag.dispatchEvent({type:"drag_end",attachment:{position:e}}),this._currentDrag=null)}_onRotate(e,t){if(!this._currentRotate){let t=this._intersection(e);if(!t)return;this._currentRotate=t.object}this._currentRotate.dispatchEvent({type:"rotate",attachment:{rotation:t}})}_positionPlanes(e){0===this._mode?(this._planeBottom.constant=0,this._camera.userData&&this._camera.userData.pitch&&this._camera.userData.pitch<0&&(this._planeBottom.constant=-3)):e&&e.boundingBox&&this._rootComponentPosition&&(this._planeBottom.constant=-e.boundingBox.getCenter(new THREE.Vector3).y-this._rootComponentPosition.y,this._planeSide.constant=2*-e.boundingBox.getSize(new THREE.Vector3).x+e.boundingBox.getCenter(new THREE.Vector3).x,this._camera.userData.yaw>0&&(this._planeSide.constant*=-1),this._bounds&&(this._planeFront.constant=this._bounds.z/2+e.boundingBox.getCenter(new THREE.Vector3).z))}_calculateOffset(e){e&&e.boundingBox&&(this._offset.copy(e.boundingBox.getCenter(new THREE.Vector3)),this._offset.applyQuaternion(e.getWorldQuaternion(new THREE.Quaternion)))}update(e,t,n){if(e&&(this._bounds=e),t&&(this._rootComponentPosition=t),n){this._backgroundScene=n;let e=this._backgroundScene.children[0];e instanceof THREE.Mesh&&e.geometry.computeBoundingBox()}}clear(){this._currentDrag&&disposeMesh(this._currentDrag),this._currentHover&&disposeMesh(this._currentHover)}enableDragIn(e){this._currentDrag=e}setRootComponentId(e){this._rootComponentId=e}setCamera(e){this._camera=e}setScene(e){this._scene=e}setMode(e){this._mode=e}}class SceneEventHandler extends EventDispatcher{constructor(e,t,n,r){super(),this._debug=!1,this._dragIn=!1,this._inputManager=r,this._raycastHelper=new RaycastHelper(t,n,this._inputManager),this._creator_=e}isDragIn(){return this._dragIn}setDragIn(e,t){this._dragIn=e,e?this._inputManager.enableDragIn(t):this._raycastHelper.clear(),this._interaction()}}class TopImageLightSetting extends LightSetting{constructor(e,t){super(e,t),this._params={ambientLight:{color:"#ffffff"}},this._ambientLight=new THREE.AmbientLight(new THREE.Color(this._params.ambientLight.color),1.2),this._ambientLight.layers.set(1),this.addToScene()}needsBounds(){return!1}addToScene(){this._scene.add(this._ambientLight)}removeFromScene(){this._scene.remove(this._ambientLight)}reload(){this.removeFromScene(),this.addToScene()}showGUI(){let e=getGUI();if(e&&this._ambientLight){let t=e.addFolder("Ambient Light");t.add(this._ambientLight,"visible"),t.add(this._ambientLight,"intensity").min(0).max(5).step(.1),t.addColor(this._params.ambientLight,"color").onChange(e=>this._ambientLight.color=new THREE.Color(e))}}}let imageRenderer=null;const getImageRenderer=()=>(imageRenderer||(imageRenderer=new THREE.WebGLRenderer({antialias:!0,alpha:!0}),imageRenderer.outputEncoding=THREE.sRGBEncoding,imageRenderer.gammaFactor=2.2),imageRenderer),getCameraTargetForBBox=(e,t=0)=>{if(!e){const e=new THREE.Vector3;return{center:e,bounds:e,diagonal:0}}const n=e.getSize(new THREE.Vector3);return n.addScalar(t),{center:e.getCenter(new THREE.Vector3),bounds:n,diagonal:Math.sqrt(Math.pow(n.x,2)+Math.pow(n.y,2)+Math.pow(n.z,2))}},preparePerspectiveImage=(e,t,n,r={})=>new Promise(o=>{const{size:i=1024}=r,a=getImageRenderer();a.setSize(i,i);const s=e.fog?e.fog.clone():null,l=e.background?e.background.clone():null;e.background=null,e.fog=null;let c=new DefaultLightSetting(e);t.layers.disable(2),t.layers.disable(5),_placeCameraForPerspectiveImage(t,n,-20,-30),a.render(e,t);const d=a.domElement.toDataURL();t.layers.enable(2),e.background=l,e.fog=s,c.removeFromScene(),o({image:d,width:i,height:i,blob:null})}),renderPerspectiveImage=(e,t,n,r,o,i)=>new Promise(r=>{i||(i=1024);const o=getImageRenderer();o.setSize(i,i);const a=e.fog?e.fog.clone():null,s=e.background?e.background.clone():null;e.background=null,e.fog=null,t.layers.disable(2),t.layers.disable(5),n?_placeCameraForPerspectiveImage(t,n,-20,-30):(t.aspect=1,t.updateProjectionMatrix()),o.render(e,t);const l=o.domElement.toDataURL();t.layers.enable(2),e.background=s,e.fog=a,r({image:l,width:i,height:i,blob:null})}),_placeCameraForPerspectiveImage=(e,t,n,r)=>{e.far=1e3,e.fov=15,e.aspect=1,e.position.copy(t.center),e.rotation.set(0,0,0),e.rotateY(toRadiant(r)),e.rotateX(toRadiant(n)),e.translateZ(3.8*t.diagonal),e.updateProjectionMatrix()},prepareTopImage=(e,t,n,r={})=>{const{showDimensions:o=!1}=r;return new Promise(r=>{const i=getImageRenderer();i.autoClear=!1;let a=new THREE.OrthographicCamera(-n.bounds.x/2,n.bounds.x/2,n.bounds.z/2,-n.bounds.z/2,.5);a.position.copy(n.center),a.rotateX(toRadiant(-90)),a.translateZ(n.bounds.y+1),a.far=a.position.y+.5,a.layers.mask=65535;let s=200*n.bounds.x,l=200*n.bounds.z;if(s>4096||l>4096){let e=0;s>4096?e=s/4096:l>4096&&(e=l/4096),s/=e,l/=e}i.setSize(s,l);let c=e.fog?e.fog.clone():null,d=e.background?e.background.clone():null;e.background=null,e.fog=null;let h=o?new TopImageLightSetting(e):new DefaultLightSetting(e);a.layers.disable(2),a.layers.disable(5),o?a.layers.enable(7):a.layers.disable(7),i.render(e,a),t&&(i.clearDepth(),i.render(t,a));let _=i.domElement.toDataURL();a.layers.enable(2),a.layers.enable(5),e.background=d,e.fog=c,h.removeFromScene(),r({image:_,width:s,height:l,blob:null})})};export{ConfiguratorUiCallbacks as C,GLTF_EXPORTER_FILE_NAME as G,PlannerKernelAccess as P,SceneEventHandler as S,prepareTopImage as a,StaticPlanObjectViewModel as b,ConfiguratorPlanObjectViewModel as c,getCameraTargetForBBox as g,preparePerspectiveImage as p,renderPerspectiveImage as r};
2
+ //# sourceMappingURL=image-renderer-7e5f1199.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"image-renderer-eccb80a5.js","sources":["../../node_modules/three/examples/js/exporters/GLTFExporter.js"],"sourcesContent":["export default \"static/GLTFExporter-86edae059df3a219.js\""],"names":[],"mappings":"uuBAAA,4BAAe"}
1
+ {"version":3,"file":"image-renderer-7e5f1199.js","sources":["../../node_modules/three/examples/js/exporters/GLTFExporter.js"],"sourcesContent":["export default \"static/GLTFExporter-86edae059df3a219.js\""],"names":[],"mappings":"svBAAA,4BAAe"}
@@ -0,0 +1,2 @@
1
+ System.register(["./rapi-access-74fbaf72.nomodule.js","./main-thread-to-worker-bb844d54.nomodule.js","./pixotron-358442c5.nomodule.js","./default-light-setting-2218084f.nomodule.js"],(function(e){var t,n,r,i,o,a,s,l,c,d,h,u,_,p,g,b,m,E,f,C,y,R,P,j,w,O,H,M,v;return{setters:[function(e){t=e.U,n=e.T,r=e.J,i=e.V,o=e.e,a=e.W,s=e.O,l=e.X,c=e.Q,d=e.Y,h=e.Z,u=e._,_=e.i,p=e.$,g=e.C,b=e.B,m=e.E,E=e.M,f=e.a0,C=e.s,y=e.j,R=e.a1,P=e.a2,j=e.t,w=e.h},function(e){O=e.f},function(e){H=e.E,M=e.L},function(e){v=e.D}],execute:function(){e("G","static/GLTFExporter-86edae059df3a219.js"),e("C",class extends t{constructor(e){super(e),this.onKernelIsReady=null,this.onComponentPositionsUpdated=null,this.onUpdateParameters=e=>{},this.onUpdatePossibleChildren=(e,t)=>{},this.onUpdatePrice=(e,t)=>{},this.onSelectionChange=(e,t,n,r)=>{},this.onSelectionCancel=()=>{},this.onPartListUpdate=(e,t)=>{},this.onBoundsUpdate=e=>{},this.onLoadConfiguration=()=>{},this.onConfigurationReady=(e,t,n)=>{},this.onOpenTag=e=>{},this.onOpenAddOns=()=>{},this.onClickOutside=()=>{},this.onNoDockingsAvailable=()=>{},this.onUiIntersectionChange=e=>{},this.onZoomChange=(e,t)=>{},this.onDimensionsVisibilityChange=e=>{},this.onErrorDueToOffline=e=>{},this.onError=e=>{},this.onDockingsPreviewRemoved=()=>{},this.onConfigurationHasChildren=e=>{},this.onTrackTiming=(e,t,n,r)=>{},this.onUserInitiatedDockDone=(e,t,n,r,i)=>{},this.onAddonPlusHover=()=>{},this.onAddonPlusHoverOff=()=>{},this.onAddonPlusShown=()=>{},this.onAddonPlusHidden=()=>{},this.onContentProblem=e=>{},this.onSyncStarted=()=>{},this.onSyncDone=()=>{},this.onOpenFloorMaterials=()=>{},this.onOpenPartList=()=>{},this.onComponentLoadError=(e,t)=>{},this.onConfigurationLoadError=()=>{},this.onChangeTypeChangeTag=e=>{},this.onRemoveTypeChangeTag=e=>{},this.onConfigurationLabelChange=(e,t,n)=>{},this.onMemoryCorruption=()=>{},this.onConfiguratorKernelIsReady=(e,t)=>{},this.onConfigurationSaved=e=>{},this.onCameraPositionChanges=()=>{}}});class x{constructor(){this._promiseExecutors=[]}create(){return new Promise((e,t)=>{this._promiseExecutors.push({resolve:e,reject:t})})}resolve(e){return new Promise(t=>{this._promiseExecutors.forEach(t=>t.resolve(e)),this._promiseExecutors=[],t(e)})}reject(e){return new Promise((t,n)=>{this._promiseExecutors.forEach(t=>t.reject(e)),this._promiseExecutors=[],n(e)})}}class T extends class{constructor(e){this._coreReference=e.clone()}clearReference(){this._coreReference.delete(),this._coreReference=null}getKernelObject(){return this._coreReference}}{constructor(e){super(e),this._objectWaiter=new x;const t=n(e.getCenter());this._container=new THREE.Object3D,this._container.position.copy(t),this._boundingBox=this._generateBoundingBox(this.getSize(),e.customColor),r(this._boundingBox),this._container.add(this._boundingBox),2!==this.getPlanElement().getType().value&&(this._object=new THREE.Object3D,this._container.add(this._object))}getSize(){return this._object?(new THREE.Box3).setFromObject(this._object).getSize(new THREE.Vector3):new THREE.Vector3}update(){this._container.position.copy(n(this.getPlanElement().getCenter()))}getPosition(){return this._container.position}getRotation(){return this._container.rotation.y}getBounds(){let e=new THREE.Box3;return e.setFromObject(this._container),e}getBoundingBox(){return this._boundingBox}getPlanElement(){return this._coreReference}setObject(e){this._object=e,this._objectWaiter.resolve(e)}getObject(){return this._object}async getObjectAsync(){return this._object?Promise.resolve(this._object):this._objectWaiter.create()}addMesh(e){this._object.add(e),this.hidePreviewBox()}getMesh(e){if(!this._object||0===this._object.children.length)return null;const t=i(e,this.getPlanElement().getType());return this._object.children.find(e=>e.userData.material===t)}getContainer(){return this._container}getId(){return this.getPlanElement().getId()}clear(){o(this._container),this._selectionMesh&&o(this._selectionMesh)}hidePreviewBox(){this._container&&this._boundingBox&&(this._boundingBox.material=a())}_generateBoundingBox(e,t){e.addScalar(.01);let n=new THREE.BoxGeometry(e.x,e.y,e.z),r=new THREE.Color(s);t>0&&(r=l(t));let i=new THREE.MeshStandardMaterial({color:r,opacity:c,transparent:!0}),o=new THREE.Mesh(n,i);return o.name="bounding box",o.position.y=e.y/2,o.castShadow=!1,o.receiveShadow=!1,o.layers.set(5),o}select(){if(!this._selectionMesh){let e=new THREE.MeshStandardMaterial({color:this._primaryColor,opacity:c,transparent:!0});const t=n(this.getPlanElement().getCenter());this._selectionMesh=new THREE.Mesh(d(t,this.getSize()),e)}this._container.add(this._selectionMesh)}deselect(){this._selectionMesh&&this._container.remove(this._selectionMesh)}setPrimaryColor(e){this._primaryColor=e}}class I extends T{constructor(e){super(e),this._container.rotation.y=e.rotation}getPlanObject(){return this.getPlanElement()}getSize(){return h(this.getPlanObject().size)}update(){super.update(),this._container.rotation.y=this.getPlanObject().rotation}}class L extends I{constructor(e){super(e),this._container.name="Configurable "+this._container.name}addRootComponent(e){this.setObject(e),this._container.add(this.getObject())}getConfigurationRuntimeId(){return this.getPlanObject().getConfigurationRuntimeId()}}e("c",L);let k=e("b",(()=>{class e extends I{constructor(e){super(e),this._container.name="Static "+this._container.name}setRapiItem(e){return this._addStaticItem(e)}_addStaticItem(e){this._rapiItem=e;let t=this.getPlanObject();this._glbUrl=O(e);let n=e.scaleable?h(t.size):void 0,i=new THREE.Vector3(1,1,1);return t.flipX&&(i.x*=-1),t.flipY&&(i.z*=-1),new Promise(o=>{this._staticItemLoader.loadGLB(this._glbUrl,void 0,void 0,n,i,t.customColor,e.colorable).then(t=>{t.name=e.label,this.setObject(t),p(t,this._glbUrl),r(t),this._container.add(this.getObject()),this.hidePreviewBox(),o()})})}getRapiItem(){return this._rapiItem}needsRapiItem(){return!this._glbUrl}getGLBUrl(){return this._glbUrl}}return u([_],e.prototype,"_staticItemLoader",void 0),e})());class D extends T{constructor(e){super(e),this._container.name="Wall Plan Element"}addMesh(e){super.addMesh(e);const t=(new THREE.Box3).setFromObject(this.getObject()).getSize(new THREE.Vector3);this._boundingBox.geometry=new THREE.BoxGeometry(t.x,t.y,t.z),this._boundingBox.position.y=t.y/2}}class S extends T{constructor(e){super(e),this._container.name="Floor Plan Element"}addMesh(e){super.addMesh(e),e.castShadow=!1;const t=(new THREE.Box3).setFromObject(this.getObject()).getSize(new THREE.Vector3);this._boundingBox.geometry=new THREE.BoxGeometry(t.x,.01,t.z)}}class B extends T{constructor(e){super(e),this._container.name="Ceiling Plan Element"}addMesh(e){super.addMesh(e),e.castShadow=!1;const t=(new THREE.Box3).setFromObject(this.getObject()).getSize(new THREE.Vector3);this._boundingBox.geometry=new THREE.BoxGeometry(t.x,.01,t.z)}}let V=e("P",(()=>{class e extends g{constructor(e){super(e,0),this._plannerKernelCallbackListener=new Set,b.addMeta("kernel_is_ready",{isWasm:this._useWASM}),this._scriptLoader.fetch(this._kernelPath,{id:"kernel"}).then(this._loadSuccess.bind(this),this._loadError.bind(this))}get kernelContainer(){return this._kernelContainer}_loadSuccess(){window.RoomleCore(this._kernelContainer)}_loadError(){console.error("kernel load error")}_createPlanInteractionHandler(){const e=this._kernelContainer;this._planInteractionHandler=new e.PlanInteractionHandler,this._planInteractionHandler.init(this._planInteractionHandler,1,100,!0,!0,e.DrawingType.CLICK_PER_CLICK),this._roomlePlannerUiCallback.onPlanInteractionHandlerCreated(this._planInteractionHandler)}addPlannerListener(e){this._plannerKernelCallbackListener.add(e)}removePlannerListener(e){this._plannerKernelCallbackListener.delete(e)}isReady(){super.isReady(),this.registerCallbacks(),this._roomlePlannerUiCallback.onPlannerKernelIsReady(this._kernelContainer),this._createPlanInteractionHandler();const e=this._planInteractionHandler.getConfiguratorKernel();this._kernelInstance=e,this._roomlePlannerUiCallback.onConfiguratorKernelIsReady(this._kernelContainer,e),m.isProduction||(window.__RML__DEBUG__.ConfiguratorKernel=this._kernelInstance,window.__RML__DEBUG__.PlannerKernelContainer=this._kernelContainer),this._kernelAccessCallback.isReady(),this._kernelInstance.useEnvironmentGeometry(!1)}get callbacks(){return this._roomlePlannerUiCallback}get planInteractionHandler(){return this._planInteractionHandler}get planModelViewHelper(){return this._kernelContainer.PlanModelViewHelper}catalogItemLoaded(e){const t=this._rapiItemToKernelItem(e);this._kernelContainer.catalogItemLoaded(t)}async insertItems(e){let t=new this._kernelContainer.CatalogItemPtrList;e.forEach(e=>{let n=e.count||1;for(let r=0;r<n;r++)e.count||(e.count=0),t.push_back(this._rapiItemToKernelItem(e))}),this._planInteractionHandler.addPlanObjects(t);const n=this._planInteractionHandler.getPlan().extRef.jsObject;await Promise.all(n.getStaticPlanObjectViewModels().map(async e=>{if(e.needsRapiItem()){const t=await this._rapiAccess.getItem(e.getPlanObject().getCatalogItemId());e.setRapiItem(t)}}))}_rapiItemToKernelItem(e){let t=new this._kernelContainer.CatalogItem(e.id),n=t.size;return n.x=e.width||0,n.y=e.depth||0,n.z=e.height||0,t.size=n,t.flipable=e.flipable,e.layer&&(t.layer=e.layer),t.orderable=e.orderable,t.scaleable=e.scaleable,t.type=e.type||"other",t.detailType=e.detailType||t.type||"other",t.configuration=e.configuration||"",t}onLoadComponentError(e,t){}configurationLoaded(e,t,n,r,i){}componentDefinitionLoaded(e,t){}componentDefinitionLoadingError(e,t){}configurationLoadingError(){}componentConfigurationUpdated(e){}componentParameters(){}requestComponentDimensions(){}planObjectCreated(e,t){}planObjectUpdated(e){}planObjectConfigurationUpdated(e,t,n){}planObjectDeleted(){}requestPlanObjectDimensions(){}cleanUpCallbacks(){super.cleanUpCallbacks(),this._kernelContainer.unregisterPlannerCallback(this)}registerCallbacks(){super.registerCallbacks(),this._kernelContainer.registerPlannerCallback(this)}async requestExternalMesh(e,t){let n;try{n=await this._rapiAccess.getMesh(e,E,t)}catch(e){throw console.error(e),e}try{const r=await fetch(new Request(this._dataSyncer.requestAsset(n.url,!0))),i=await r.arrayBuffer();await this._handleCortoMesh(i,e,t)}catch(e){throw console.error(e),e}}Editor3dRootComponentCreated(e,t,n,r){this._configuratorKernelCallbackListener.forEach(i=>i.Editor3dComponentCreated(e,t,n,r,!0))}Editor3dPlanObjectConstructionDone(e){}Editor3dBeginGroup(){}Editor3dEndGroup(){}Editor3dSetMaterial(){}Editor3dLoadMaterial(){}Editor3dAddDockPreview(e,t){}Editor3dSetPreviewPointAssociations(e,t){}Editor3dSetPreviewLineAssociations(e,t){}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(){}planElementRemoved(e){this._plannerKernelCallbackListener.forEach(t=>t.planElementRemoved(e)),this._plannerKernelCallbackListener.forEach(t=>t.removePlanObjectFromScene(e.extRef.jsObject)),this._decoupleReferences(e)}handlerSwitchedPlans(e,t){if(this._decoupleReferences(e),t){let e=new U(this._creator_);e.setReference(t),this._coupleReferences(e,t),this._plannerKernelCallbackListener.forEach(t=>t.handlerSwitchedPlans(e))}}planBoundsChanged(){this._plannerKernelCallbackListener.forEach(e=>e.planBoundsChanged())}planCleared(){}planCompletelyLoaded(e){this._plannerKernelCallbackListener.forEach(t=>t.planCompletelyLoaded(e))}planElement3dMeshChanged(e,t){if(t.extRef){const e=t.extRef.jsObject;for(let t=e.getObject().children.length-1;t>=0;t--)e.getObject().remove(e.getObject().children[t])}this.planModelViewHelper.requestMesh3d(t)}planElementAdded(e,t){if(e&&e.extRef)if(t.getType()===this._kernelContainer.PlanElementType.OBJECT){let n,r=t;r.hasConfiguration()?(n=new L(r),this._coupleReferences(n,r),e.extRef.jsObject.addPlanElementViewModel(n)):(n=new k(r),this._coupleReferences(n,r),e.extRef.jsObject.addPlanElementViewModel(n)),this._plannerKernelCallbackListener.forEach(e=>e.addPlanObjectToScene(n))}else{let n,r=t;if(t.getType()===this._kernelContainer.PlanElementType.WALL?n=new D(r):t.getType()===this._kernelContainer.PlanElementType.FLOOR?n=new S(r):t.getType()===this._kernelContainer.PlanElementType.CEILING&&(n=new B(r)),!n)return;n.setPrimaryColor(this._initData.colors.PRIMARY),this._coupleReferences(n,r),e.extRef.jsObject.addPlanElementViewModel(n),this.planModelViewHelper.requestMesh3d(t)}}planElementChanged(e,t){if(t.extRef){let n=t.extRef.jsObject;n.update(),this._plannerKernelCallbackListener.forEach(t=>t.planElementChanged(e,n))}}planHistoryStateChanged(){}planObjectConfigurationCreated(e,t){}planObjectConfigurationLoaded(e,t,n){e&&e.extRef&&t&&t.extRef&&t.extRef.jsObject.getPlanObject().getConfigurationRuntimeId()>0&&this._plannerKernelCallbackListener.forEach(r=>r.planObjectConfigurationLoaded(e,t,n))}requestCatalogItem(e){}startedDrawing(){}stoppedDrawing(){}updateMesh2d(){}beginConstruction(){}addMesh(e,t,n,r,i,o){this._plannerKernelCallbackListener.forEach(a=>a.addMesh(e,t,n,r,i,o))}endConstruction(){}beginPlanConstruction(e){this._plannerKernelCallbackListener.forEach(t=>t.beginPlanConstruction(e))}addPlanMesh(e,t,n,r,i,o,a){this._plannerKernelCallbackListener.forEach(s=>s.addPlanMesh(e,t,n,r,i,o,a))}endPlanConstruction(e){this._plannerKernelCallbackListener.forEach(t=>t.endPlanConstruction(e))}addPlanObjectFromItem(e,t,n){if(!t&&!n)return this.insertItems([e]);n=n||0===n?n:0,t=t||{x:0,y:0,z:0};const r=this._rapiItemToKernelItem(e);return this._planInteractionHandler.addPlanObjectFromItem(r,t,n)}_coupleReferences(e,t){let n=new this._kernelContainer.EMSReference;n.jsObject=e,t.extRef=n}_decoupleReferences(e){e&&e.extRef&&(e.extRef.jsObject.clearReference(),e.extRef.jsObject=null,e.extRef.delete(),e.extRef=null)}}return u([_],e.prototype,"_kernelAccessCallback",void 0),u([_],e.prototype,"_roomlePlannerUiCallback",void 0),u([_],e.prototype,"_initData",void 0),e})()),U=(()=>{class e extends f{constructor(e){super(e),this._configurablePlanObjectViewModels=[],this._staticPlanObjectViewModels=[],this._constructionGroup=new THREE.Group,this._constructionGroup.name="Construction",this._ceilingGroup=new THREE.Group,this._getKernelAccess().addPlannerListener(this)}planBoundsChanged(){}_getKernelAccess(){return C.lookup("planner-kernel-access",this._creator_)}setReference(e){this._coreReference=e.clone()}clearReference(){this._coreReference.delete(),this._coreReference=null,super.clearReference()}getCorePlan(){return this._coreReference}addPlanElementViewModel(e){e instanceof L?this._configurablePlanObjectViewModels.push(e):e instanceof k?(this._staticPlanObjectViewModels.push(e),"door"!==e.getPlanObject().getObjectType()&&"window"!==e.getPlanObject().getObjectType()&&this._initData.edit&&this._plannerSceneEventHandler.addPlanObjectHandlers(e)):e instanceof D?(this._initData.edit&&this._plannerSceneEventHandler.addWallHandlers(e),this._constructionGroup.add(e.getContainer())):(e instanceof S||e instanceof B)&&this._constructionGroup.add(e.getContainer())}_addRootComponent(e){const t=this._getPlanObjectViewModelForRuntimeId(e.parentObjectId);t&&t instanceof L&&(t.addRootComponent(e),this._initData.edit&&this._plannerSceneEventHandler.addPlanObjectHandlers(t),t.hidePreviewBox())}_getPlanObjectViewModelForRuntimeId(e){let t=null;return this._configurablePlanObjectViewModels.forEach(n=>{e===n.getConfigurationRuntimeId()&&(t=n)}),t}getPlanObjectForId(e){let t=null;return this._configurablePlanObjectViewModels.forEach(n=>{e===n.getId()&&(t=n)}),this._staticPlanObjectViewModels.forEach(n=>{e===n.getId()&&(t=n)}),t}getConstructionGroup(){return this._constructionGroup}getCeilingGroup(){return this._ceilingGroup}getBoundingBox(){const e=this.getCorePlan();return e?y(e.getBounds()):(new THREE.Box3).setFromObject(this._constructionGroup)}setPlannerSceneEventHandler(e){this._plannerSceneEventHandler=e}sceneCleared(){this._configurablePlanObjectViewModels.forEach(e=>{e.clear()}),this._staticPlanObjectViewModels.forEach(e=>{e.clear()}),super.sceneCleared()}getStaticPlanObjectViewModels(){return this._staticPlanObjectViewModels}getComponent(e){return this._components.get(e)}_generateMesh(e=0,t=null,n,r,i,o,a,s,l){return this._plannerMeshGenerator.generateMesh(t,n,r,i,o,a,s,l)}_setMaterial(e,t,n){this._plannerMeshGenerator.setMaterial(e,t)}Editor3dComponentCreated(e,t,n,r,i){super.Editor3dComponentCreated(e,t,n,r,i),this._getKernelAccess()instanceof V&&this.dockComponent(e,r,t,n)}addPlanObjectToScene(e){}handlerSwitchedPlans(e){this._constructionGroup.clear(),this._ceilingGroup.clear()}planCompletelyLoaded(e){}beginPlanConstruction(e){}addPlanMesh(e,t,n,r,i,o,a){}endPlanConstruction(e){}planElementChanged(e,t){}planObjectConfigurationLoaded(e,t,n){}addMesh(e,t,n,r,i,o){const a=e.extRef.jsObject;let s=a.getMesh(t);s?s.geometry=this._plannerMeshGenerator.generateGeometry(null,n,r,i,o):(s=this._generateMesh(0,null,t,n,r,i,o,e.getType()),a.addMesh(s))}removePlanObjectFromScene(e){}planElementRemoved(e){if(e.getType()===this._getKernelAccess().kernelContainer.PlanElementType.OBJECT){let t=e;if(t.hasConfiguration()){const e=t.extRef.jsObject,n=this._configurablePlanObjectViewModels.indexOf(e);n>-1&&this._configurablePlanObjectViewModels.splice(n,1)}else{const e=t.extRef.jsObject,n=this._staticPlanObjectViewModels.indexOf(e);n>-1&&this._staticPlanObjectViewModels.splice(n,1)}}}getMeshGenerator(){return this._plannerMeshGenerator}}return u([_],e.prototype,"_plannerMeshGenerator",void 0),e})();const A=j(30);class G extends H{constructor(e,t,n,r){super(),this._offset=new THREE.Vector3(0,0,0),this._mode=void 0===r?1:r,this._scene=e,this._camera=t,this._raycaster=new THREE.Raycaster,this._raycaster.layers.enableAll(),this._inputManager=n,this._addInputListeners(n),this._planeBottom=new THREE.Plane(new THREE.Vector3(0,1,0)),this._planeFront=new THREE.Plane(new THREE.Vector3(0,0,1)),this._planeSide=new THREE.Plane(new THREE.Vector3(1,0,0))}setLayers(e){this._raycaster.layers=e}_addInputListeners(e){e.addEventListener(3,e=>{this._findCandidate(e.positionRelative)},this),e.addEventListener(5,e=>{this._findSelection(e.positionRelative)},this),e.addEventListener(6,e=>{this._findHover(e.positionRelative,e.type)},this),e.addEventListener(0,e=>{this._onDragStart(e.positionRelative)},this),e.addEventListener(1,e=>{this._onDrag(e.positionRelative)},this),e.addEventListener(2,e=>{this._onDragEnd(e.positionRelative)},this),e.addEventListener(9,e=>{this._onRotate(e.positionRelative,e.rotation)},this),e.addEventListener(10,()=>{this._currentRotate=null},this)}_findCandidate(e){this._intersection(e)&&this._inputManager.onElementHit()}_findSelection(e){let t=this._intersection(e);t?t&&t.object.dispatchEvent({type:"select"}):this.dispatchEvent(3)}_findHover(e,t){const n=this._intersection(e);!n&&this._currentHover?(this._currentHover.dispatchEvent({type:"hover_off",attachment:{type:t}}),this._currentHover=null):n&&(this._currentHover&&this._currentHover.id!==n.object.id&&(this._currentHover.dispatchEvent({type:"hover_off",attachment:{type:t}}),this._currentHover=null),this._currentHover?this._currentHover.dispatchEvent({type:"hover_move",attachment:{intersection:n,type:t}}):(this._currentHover=n.object,this._currentHover.dispatchEvent({type:"hover_on",attachment:{intersection:n,type:t}})))}_intersection(e){const t=this._intersect(e);if(t.length<=0)return null;let n=t[0];return t.length>1&&this._currentHover&&this._currentDrag&&this._currentDrag.id!==this._currentHover.id&&t.forEach(e=>{e.object.id===this._currentHover.id&&e.object.userData.priority===this._currentHover.userData.priority&&n.object.userData.priority<=e.object.userData.priority&&(n=e)}),n}_intersect(e){this._raycaster.setFromCamera(e,this._camera);const t=[];return this._raycaster.intersectObjects(this._scene.children,!0).forEach(e=>{const n=this._findObjectWithHandler(e.object);n&&(e.object=n,t.push(e))}),t.length>=0?t.sort((e,t)=>e.object.userData.priority!==t.object.userData.priority?t.object.userData.priority-e.object.userData.priority:e.distance-t.distance):[]}_findObjectWithHandler(e){return e.userData.hasListener?e:e.parent?this._findObjectWithHandler(e.parent):null}_onDragStart(e){let t=this._intersection(e);if(!t&&!this._currentDrag)return;if(t&&t.object.userData.roomleId===this._rootComponentId)return;!this._currentDrag&&t&&(this._currentDrag=t.object,this._currentDrag.dispatchEvent({type:"drag_start"}));let n=this._currentDrag.parent;n&&n.computeBoundingBox&&(n.computeBoundingBox(),this._calculateOffset(n)),this._positionPlanes(n)}_onDrag(e){if(!this._currentDrag)return;this._raycaster.setFromCamera(e,this._camera);let t,n=new THREE.Vector3(0,0,-5);if(this._raycaster.ray.intersectPlane(this._planeBottom,n),0===this._mode){const e=this._scene.children.find(({type:e,name:t})=>"Group"===e&&"Construction"===t);if(e){const t=this._raycaster.intersectObjects(e.children,!0);if(t.length){const e=t[0].point.clone();return void this._currentDrag.dispatchEvent({type:"drag",attachment:{position:e}})}}t=n.clone(),t.y=this._currentDrag.parent.position.y}else t=this._getIntersectionPosition(n),t.sub(this._offset);this._currentDrag.dispatchEvent({type:"drag",attachment:{position:t}})}_getIntersectionPosition(e){let t=this._getDistanceToCamera(e),n=this._camera.userData.yaw,r=new THREE.Vector3(0,0,0),i=new THREE.Vector3(0,0,0);this._raycaster.ray.intersectPlane(this._planeFront,r),this._raycaster.ray.intersectPlane(this._planeSide,i);let o,a=this._getDistanceToCamera(i),s=this._getDistanceToCamera(r);return n>=-A&&n<=A?o=t<s?e.clone():r.clone():t<s&&t<a?o=e.clone():s<t&&s<a?o=r.clone():a<t&&a<s&&(o=i.clone()),o}_getDistanceToCamera(e){let t=e.clone().sub(this._camera.position).length();return R(e)&&(t=Number.POSITIVE_INFINITY),t}_onDragEnd(e){this._currentDrag&&(this._currentDrag.dispatchEvent({type:"drag_end",attachment:{position:e}}),this._currentDrag=null)}_onRotate(e,t){if(!this._currentRotate){let t=this._intersection(e);if(!t)return;this._currentRotate=t.object}this._currentRotate.dispatchEvent({type:"rotate",attachment:{rotation:t}})}_positionPlanes(e){0===this._mode?(this._planeBottom.constant=0,this._camera.userData&&this._camera.userData.pitch&&this._camera.userData.pitch<0&&(this._planeBottom.constant=-3)):e&&e.boundingBox&&this._rootComponentPosition&&(this._planeBottom.constant=-e.boundingBox.getCenter(new THREE.Vector3).y-this._rootComponentPosition.y,this._planeSide.constant=2*-e.boundingBox.getSize(new THREE.Vector3).x+e.boundingBox.getCenter(new THREE.Vector3).x,this._camera.userData.yaw>0&&(this._planeSide.constant*=-1),this._bounds&&(this._planeFront.constant=this._bounds.z/2+e.boundingBox.getCenter(new THREE.Vector3).z))}_calculateOffset(e){e&&e.boundingBox&&(this._offset.copy(e.boundingBox.getCenter(new THREE.Vector3)),this._offset.applyQuaternion(e.getWorldQuaternion(new THREE.Quaternion)))}update(e,t,n){if(e&&(this._bounds=e),t&&(this._rootComponentPosition=t),n){this._backgroundScene=n;let e=this._backgroundScene.children[0];e instanceof THREE.Mesh&&e.geometry.computeBoundingBox()}}clear(){this._currentDrag&&P(this._currentDrag),this._currentHover&&P(this._currentHover)}enableDragIn(e){this._currentDrag=e}setRootComponentId(e){this._rootComponentId=e}setCamera(e){this._camera=e}setScene(e){this._scene=e}setMode(e){this._mode=e}}e("S",class extends H{constructor(e,t,n,r){super(),this._debug=!1,this._dragIn=!1,this._inputManager=r,this._raycastHelper=new G(t,n,this._inputManager),this._creator_=e}isDragIn(){return this._dragIn}setDragIn(e,t){this._dragIn=e,e?this._inputManager.enableDragIn(t):this._raycastHelper.clear(),this._interaction()}});class K extends M{constructor(e,t){super(e,t),this._params={ambientLight:{color:"#ffffff"}},this._ambientLight=new THREE.AmbientLight(new THREE.Color(this._params.ambientLight.color),1.2),this._ambientLight.layers.set(1),this.addToScene()}needsBounds(){return!1}addToScene(){this._scene.add(this._ambientLight)}removeFromScene(){this._scene.remove(this._ambientLight)}reload(){this.removeFromScene(),this.addToScene()}showGUI(){let e=w();if(e&&this._ambientLight){let t=e.addFolder("Ambient Light");t.add(this._ambientLight,"visible"),t.add(this._ambientLight,"intensity").min(0).max(5).step(.1),t.addColor(this._params.ambientLight,"color").onChange(e=>this._ambientLight.color=new THREE.Color(e))}}}let z=null;const F=()=>(z||(z=new THREE.WebGLRenderer({antialias:!0,alpha:!0}),z.outputEncoding=THREE.sRGBEncoding,z.gammaFactor=2.2),z),W=(e("g",(e,t=0)=>{if(!e){const e=new THREE.Vector3;return{center:e,bounds:e,diagonal:0}}const n=e.getSize(new THREE.Vector3);return n.addScalar(t),{center:e.getCenter(new THREE.Vector3),bounds:n,diagonal:Math.sqrt(Math.pow(n.x,2)+Math.pow(n.y,2)+Math.pow(n.z,2))}}),e("p",(e,t,n,r={})=>new Promise(i=>{const{size:o=1024}=r,a=F();a.setSize(o,o);const s=e.fog?e.fog.clone():null,l=e.background?e.background.clone():null;e.background=null,e.fog=null;let c=new v(e);t.layers.disable(2),t.layers.disable(5),W(t,n,-20,-30),a.render(e,t);const d=a.domElement.toDataURL();t.layers.enable(2),e.background=l,e.fog=s,c.removeFromScene(),i({image:d,width:o,height:o,blob:null})})),e("r",(e,t,n,r,i,o)=>new Promise(r=>{o||(o=1024);const i=F();i.setSize(o,o);const a=e.fog?e.fog.clone():null,s=e.background?e.background.clone():null;e.background=null,e.fog=null,t.layers.disable(2),t.layers.disable(5),n?W(t,n,-20,-30):(t.aspect=1,t.updateProjectionMatrix()),i.render(e,t);const l=i.domElement.toDataURL();t.layers.enable(2),e.background=s,e.fog=a,r({image:l,width:o,height:o,blob:null})})),(e,t,n,r)=>{e.far=1e3,e.fov=15,e.aspect=1,e.position.copy(t.center),e.rotation.set(0,0,0),e.rotateY(j(r)),e.rotateX(j(n)),e.translateZ(3.8*t.diagonal),e.updateProjectionMatrix()});e("a",(e,t,n,r={})=>{const{showDimensions:i=!1}=r;return new Promise(r=>{const o=F();o.autoClear=!1;let a=new THREE.OrthographicCamera(-n.bounds.x/2,n.bounds.x/2,n.bounds.z/2,-n.bounds.z/2,.5);a.position.copy(n.center),a.rotateX(j(-90)),a.translateZ(n.bounds.y+1),a.far=a.position.y+.5,a.layers.mask=65535;let s=200*n.bounds.x,l=200*n.bounds.z;if(s>4096||l>4096){let e=0;s>4096?e=s/4096:l>4096&&(e=l/4096),s/=e,l/=e}o.setSize(s,l);let c=e.fog?e.fog.clone():null,d=e.background?e.background.clone():null;e.background=null,e.fog=null;let h=i?new K(e):new v(e);a.layers.disable(2),a.layers.disable(5),i?a.layers.enable(7):a.layers.disable(7),o.render(e,a),t&&(o.clearDepth(),o.render(t,a));let u=o.domElement.toDataURL();a.layers.enable(2),a.layers.enable(5),e.background=d,e.fog=c,h.removeFromScene(),r({image:u,width:s,height:l,blob:null})})})}}}));
2
+ //# sourceMappingURL=image-renderer-cfd9ed49.nomodule.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"image-renderer-dd3a3b56.nomodule.js","sources":["../../node_modules/three/examples/js/exporters/GLTFExporter.js"],"sourcesContent":["export default \"static/GLTFExporter-86edae059df3a219.js\""],"names":[],"mappings":"0gBAAe"}
1
+ {"version":3,"file":"image-renderer-cfd9ed49.nomodule.js","sources":["../../node_modules/three/examples/js/exporters/GLTFExporter.js"],"sourcesContent":["export default \"static/GLTFExporter-86edae059df3a219.js\""],"names":[],"mappings":"ihBAAe"}
@@ -0,0 +1,2 @@
1
+ System.register(["./query-params-helper-8c00a872.legacy.js","./rapi-access-9e79a6ed.legacy.js","./main-thread-to-worker-880d5b78.legacy.js","./image-renderer-49deaae2.legacy.js","./pixotron-0b1d662e.legacy.js","./configurator-44d35a54.legacy.js","./mesh-generator-a9938ee3.legacy.js","./configurator-mesh-generator-aeaab699.legacy.js","./default-light-setting-fbdf535e.legacy.js"],(function(e){var n,a,t,s;return{setters:[function(){},function(e){n=e._,a=e.i},function(e){t=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(t()+"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 a=.03;this._banana.scale.copy(new THREE.Vector3(a,a,a)),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([a],e.prototype,"_staticItemLoader",void 0),e})())}}}));
2
+ //# sourceMappingURL=banana-for-scale-346de2e4.legacy.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"banana-for-scale-d9fdb6d4.legacy.js","sources":["../../../packages/configurator-core/public/geometry/banana_div2.glb"],"sourcesContent":["export default \"static/banana_div2-1351c98ec2986be1.glb\""],"names":[],"mappings":"wqBAAe"}
1
+ {"version":3,"file":"banana-for-scale-346de2e4.legacy.js","sources":["../../../packages/configurator-core/public/geometry/banana_div2.glb"],"sourcesContent":["export default \"static/banana_div2-1351c98ec2986be1.glb\""],"names":[],"mappings":"wqBAAe"}
@@ -1,2 +1,2 @@
1
- System.register(["./query-params-helper-8c00a872.legacy.js","./main-thread-to-worker-66323030.legacy.js"],(function(){var e,r,t;return{setters:[function(r){e=r.g},function(e){r=e.M,t=e.g}],execute:function(){new class{constructor(){this._inLimbo=!1,this._alreadyAdded=!1,window.addEventListener("beforeunload",()=>this._inLimbo=!0),this._mainThreadToWorker=new r(this,navigator.serviceWorker),this._isAlreadyActive()?this._handleActiveSw():navigator.serviceWorker.register(t()+"static/budgeteer.sw-e7566da86237bca8.js",{scope:"../../"}).then(e=>{this._isAlreadyActive()&&this._handleActiveSw()},e=>console.error("Budgeteer registration failed: ",e)),navigator.serviceWorker.addEventListener("controllerchange",()=>this._mainThreadToWorker.setEventPoster(navigator.serviceWorker.controller)),window.BudgeteerMeasure={encodeUrl:this.encodeUrl}}_addIframe(){const r="website-to-measure";if(document.getElementById(r))return void console.error("Iframe already added! Check how this can happen");const t=e();if(!t.checkUrl)return void console.error("CAN NOT MEASURE WITHOUT A URL, add checkUrl queryParam. To encode call BudgeteerMeasure.encodeUrl(url: string)");let o=this.decodeUrl(t.checkUrl);const i=window.location.origin;if(!o.startsWith(i))return void console.error("CAN ONLY MEASURE SAME ORIGIN PLEASE CHECK",{origin:i,src:o});const n=e(o),a=Object.keys(n).length?"&":"?";n._measureTraffic||(o+=a+"_measureTraffic=true");const s=document.createElement("iframe");s.id=r,s.src=o,document.body.appendChild(s)}_isAlreadyActive(){return navigator.serviceWorker.controller&&-1!==navigator.serviceWorker.controller.scriptURL.indexOf("budgeteer.sw")&&"activated"===navigator.serviceWorker.controller.state}_handleActiveSw(){this._mainThreadToWorker.setEventPoster(navigator.serviceWorker.controller),this._addIframe(),this._alreadyAdded=!0}encodeUrl(e){return encodeURIComponent(e)}decodeUrl(e){return decodeURIComponent(e)}onCommand(e){if(!this._inLimbo)switch(e){case 6:this._alreadyAdded||this._addIframe()}}}}}}));
1
+ System.register(["./query-params-helper-8c00a872.legacy.js","./main-thread-to-worker-880d5b78.legacy.js"],(function(){var e,r,t;return{setters:[function(r){e=r.g},function(e){r=e.M,t=e.g}],execute:function(){new class{constructor(){this._inLimbo=!1,this._alreadyAdded=!1,window.addEventListener("beforeunload",()=>this._inLimbo=!0),this._mainThreadToWorker=new r(this,navigator.serviceWorker),this._isAlreadyActive()?this._handleActiveSw():navigator.serviceWorker.register(t()+"static/budgeteer.sw-e7566da86237bca8.js",{scope:"../../"}).then(e=>{this._isAlreadyActive()&&this._handleActiveSw()},e=>console.error("Budgeteer registration failed: ",e)),navigator.serviceWorker.addEventListener("controllerchange",()=>this._mainThreadToWorker.setEventPoster(navigator.serviceWorker.controller)),window.BudgeteerMeasure={encodeUrl:this.encodeUrl}}_addIframe(){const r="website-to-measure";if(document.getElementById(r))return void console.error("Iframe already added! Check how this can happen");const t=e();if(!t.checkUrl)return void console.error("CAN NOT MEASURE WITHOUT A URL, add checkUrl queryParam. To encode call BudgeteerMeasure.encodeUrl(url: string)");let o=this.decodeUrl(t.checkUrl);const i=window.location.origin;if(!o.startsWith(i))return void console.error("CAN ONLY MEASURE SAME ORIGIN PLEASE CHECK",{origin:i,src:o});const n=e(o),a=Object.keys(n).length?"&":"?";n._measureTraffic||(o+=a+"_measureTraffic=true");const s=document.createElement("iframe");s.id=r,s.src=o,document.body.appendChild(s)}_isAlreadyActive(){return navigator.serviceWorker.controller&&-1!==navigator.serviceWorker.controller.scriptURL.indexOf("budgeteer.sw")&&"activated"===navigator.serviceWorker.controller.state}_handleActiveSw(){this._mainThreadToWorker.setEventPoster(navigator.serviceWorker.controller),this._addIframe(),this._alreadyAdded=!0}encodeUrl(e){return encodeURIComponent(e)}decodeUrl(e){return decodeURIComponent(e)}onCommand(e){if(!this._inLimbo)switch(e){case 6:this._alreadyAdded||this._addIframe()}}}}}}));
2
2
  //# sourceMappingURL=budgeteer-measure.legacy.js.map
@@ -1,2 +1,2 @@
1
- System.register(["./rapi-access-41e0190e.legacy.js","./main-thread-to-worker-66323030.legacy.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 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 i([t],e.prototype,"_cacheHolder",void 0),i([t],e.prototype,"_unitFormatter",void 0),e})())}}}));
2
- //# sourceMappingURL=component-dimensioning-104a6bc1.legacy.js.map
1
+ System.register(["./rapi-access-9e79a6ed.legacy.js","./main-thread-to-worker-880d5b78.legacy.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 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 i([t],e.prototype,"_cacheHolder",void 0),i([t],e.prototype,"_unitFormatter",void 0),e})())}}}));
2
+ //# sourceMappingURL=component-dimensioning-629f2f3a.legacy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"component-dimensioning-629f2f3a.legacy.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}