@roomle/web-sdk 2.60.0-alpha.2 → 2.60.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/TextGeometry-0776cbf7.js +2 -0
- package/lib/TextGeometry-0776cbf7.js.map +1 -0
- package/lib/TextGeometry-a3187fcf.nomodule.js +2 -0
- package/lib/TextGeometry-a3187fcf.nomodule.js.map +1 -0
- package/lib/banana-for-scale-1cd9a2fc.js +2 -0
- package/lib/{banana-for-scale-42f1dc5b.js.map → banana-for-scale-1cd9a2fc.js.map} +1 -1
- package/lib/banana-for-scale-70f00b0d.nomodule.js +2 -0
- package/lib/{banana-for-scale-f49704e0.nomodule.js.map → banana-for-scale-70f00b0d.nomodule.js.map} +1 -1
- package/lib/{budgeteer-measure-21e9de2e.js → budgeteer-measure-7daaf07a.js} +2 -2
- package/lib/{budgeteer-measure-21e9de2e.js.map → budgeteer-measure-7daaf07a.js.map} +1 -1
- package/lib/budgeteer-measure.nomodule.js +1 -1
- package/lib/component-dimensioning-5fb755f6.js +2 -0
- package/lib/component-dimensioning-5fb755f6.js.map +1 -0
- package/lib/component-dimensioning-72e9b95a.nomodule.js +2 -0
- package/lib/component-dimensioning-72e9b95a.nomodule.js.map +1 -0
- package/lib/component-raycast-helper-37e29c9e.js +2 -0
- package/lib/component-raycast-helper-37e29c9e.js.map +1 -0
- package/lib/component-raycast-helper-88babaeb.nomodule.js +2 -0
- package/lib/component-raycast-helper-88babaeb.nomodule.js.map +1 -0
- package/lib/configurator-55acafcc.nomodule.js +2 -0
- package/lib/configurator-55acafcc.nomodule.js.map +1 -0
- package/lib/configurator-89ce03c4.js +2 -0
- package/lib/configurator-89ce03c4.js.map +1 -0
- package/lib/configurator-dummy-app.js +1 -1
- package/lib/configurator-dummy-app.js.map +1 -1
- package/lib/configurator-dummy.html +1 -0
- package/lib/configurator-main-07f34c9f.js +2 -0
- package/lib/configurator-main-07f34c9f.js.map +1 -0
- package/lib/configurator-main.nomodule.js +1 -1
- package/lib/continuous-drawing-helper-14c9e7da.js +2 -0
- package/lib/continuous-drawing-helper-14c9e7da.js.map +1 -0
- package/lib/continuous-drawing-helper-a59e7a93.nomodule.js +2 -0
- package/lib/continuous-drawing-helper-a59e7a93.nomodule.js.map +1 -0
- package/lib/default-light-setting-3531c5f5.js +2 -0
- package/lib/default-light-setting-3531c5f5.js.map +1 -0
- package/lib/default-light-setting-bcb1df58.nomodule.js +2 -0
- package/lib/default-light-setting-bcb1df58.nomodule.js.map +1 -0
- package/lib/definitions/common-core/__tests__/image-renderer.d.ts +13 -0
- package/lib/definitions/common-core/config/environment.d.ts +2 -1
- package/lib/definitions/common-core/mock/mock-draco-loader.d.ts +6 -0
- package/lib/definitions/common-core/mock/mock-gltf-loader.d.ts +9 -0
- package/lib/definitions/common-core/mock/mock-image-renderer.d.ts +18 -0
- package/lib/definitions/common-core/mock/mock-pixotron.d.ts +5 -5
- package/lib/definitions/common-core/mock/mock-utils.d.ts +2 -2
- package/lib/definitions/common-core/mock/three-mock.d.ts +10 -1
- package/lib/definitions/common-core/src/cameracontrol/camera-control-2d.d.ts +5 -4
- package/lib/definitions/common-core/src/cameracontrol/camera-control-3d.d.ts +11 -10
- package/lib/definitions/common-core/src/cameracontrol/camera-control.d.ts +13 -12
- package/lib/definitions/common-core/src/environment/background-environment.d.ts +4 -3
- package/lib/definitions/common-core/src/environment/dynamic-environment-setting-loader.d.ts +3 -2
- package/lib/definitions/common-core/src/environment/environment.d.ts +7 -6
- package/lib/definitions/common-core/src/environment/ground-projected-environment.d.ts +14 -0
- package/lib/definitions/common-core/src/lightsetting/dynamic-light-setting-loader.d.ts +7 -4
- package/lib/definitions/common-core/src/lightsetting/dynamic-light-setting.d.ts +4 -3
- package/lib/definitions/common-core/src/lightsetting/light-setting.d.ts +5 -4
- package/lib/definitions/common-core/src/main.d.ts +2 -1
- package/lib/definitions/common-core/src/rapi-access.d.ts +1 -1
- package/lib/definitions/common-core/src/services/cache-holder.d.ts +3 -2
- package/lib/definitions/common-core/src/services/common-kernel-access.d.ts +3 -1
- package/lib/definitions/common-core/src/services/hdr-environment-loader.d.ts +18 -0
- package/lib/definitions/common-core/src/static-files/environment-maps.d.ts +3 -0
- package/lib/definitions/common-core/src/static-files/roomle-core.d.ts +1 -0
- package/lib/definitions/common-core/src/static-files/three.d.ts +0 -13
- package/lib/definitions/common-core/src/utils/dom-helper.d.ts +2 -1
- package/lib/definitions/common-core/src/utils/fps-couter.d.ts +12 -0
- package/lib/definitions/common-core/src/utils/init-data.d.ts +3 -5
- package/lib/definitions/common-core/src/utils/kernel-utils.d.ts +8 -7
- package/lib/definitions/common-core/src/utils/material-creator.d.ts +12 -0
- package/lib/definitions/common-core/src/utils/shims.d.ts +12 -0
- package/lib/definitions/common-core/src/utils/stats-helper.d.ts +2 -4
- package/lib/definitions/common-core/src/utils/threejs-utils.d.ts +43 -40
- package/lib/definitions/common-core/src/view-model/configurator-view-model.d.ts +6 -5
- package/lib/definitions/common-core/src/view-model/plan-element-view-model.d.ts +14 -13
- package/lib/definitions/common-core/src/view-model/plan-object-view-model.d.ts +2 -1
- package/lib/definitions/common-core/src/webgl/EnvMapReader.d.ts +1 -1
- package/lib/definitions/common-core/src/webgl/baked-shadow-plane.d.ts +4 -3
- package/lib/definitions/common-core/src/webgl/hdr-env-map-reader.d.ts +18 -0
- package/lib/definitions/common-core/src/webgl/image-renderer.d.ts +16 -9
- package/lib/definitions/common-core/src/webgl/mesh-generator.d.ts +15 -15
- package/lib/definitions/common-core/src/webgl/renderer/baked-ground-contact-shadow.d.ts +59 -0
- package/lib/definitions/common-core/src/webgl/renderer/effect-pass.d.ts +108 -0
- package/lib/definitions/common-core/src/webgl/renderer/gbuffer-render-target.d.ts +43 -0
- package/lib/definitions/common-core/src/webgl/renderer/ground-reflection-pass.d.ts +72 -0
- package/lib/definitions/common-core/src/webgl/renderer/light-source-detection.d.ts +76 -0
- package/lib/definitions/common-core/src/webgl/renderer/outline-pass.d.ts +56 -0
- package/lib/definitions/common-core/src/webgl/renderer/outline-renderer.d.ts +32 -0
- package/lib/definitions/common-core/src/webgl/renderer/render-utility.d.ts +83 -0
- package/lib/definitions/common-core/src/webgl/renderer/scene-renderer-gui.d.ts +16 -0
- package/lib/definitions/common-core/src/webgl/renderer/scene-renderer.d.ts +111 -0
- package/lib/definitions/common-core/src/webgl/renderer/screen-space-shadow-map.d.ts +139 -0
- package/lib/definitions/common-core/src/webgl/renderer/shader-utility.d.ts +98 -0
- package/lib/definitions/common-core/src/webgl/renderer/shadow-and-ao-pass.d.ts +123 -0
- package/lib/definitions/common-core/src/webgl/roomle-component-factory.d.ts +24 -22
- package/lib/definitions/common-core/src/webgl/roomle-webl-renderer.d.ts +42 -0
- package/lib/definitions/common-core/src/webgl/scene-event-handler.d.ts +2 -1
- package/lib/definitions/common-core/src/webgl/scene-manager.d.ts +21 -27
- package/lib/definitions/common-core/src/webgl/static-item-loader.d.ts +5 -6
- package/lib/definitions/configurator-core/src/roomle-configurator.d.ts +7 -11
- package/lib/definitions/configurator-core/src/utils/async-dependency-loader.d.ts +2 -1
- package/lib/definitions/configurator-core/src/utils/component-dimensioning-helper.d.ts +2 -1
- package/lib/definitions/configurator-core/src/utils/component-dimensioning.d.ts +4 -2
- package/lib/definitions/configurator-core/src/utils/component-raycast-helper.d.ts +3 -2
- package/lib/definitions/configurator-core/src/utils/dimensioning-helper.d.ts +10 -9
- package/lib/definitions/configurator-core/src/utils/raycast-helper.d.ts +8 -7
- package/lib/definitions/configurator-core/src/utils/text-with-background.d.ts +5 -3
- package/lib/definitions/configurator-core/src/utils/ui-intersection-helper.d.ts +3 -2
- package/lib/definitions/configurator-core/src/webgl/banana-for-scale.d.ts +4 -3
- package/lib/definitions/configurator-core/src/webgl/configurator-mesh-generator.d.ts +5 -4
- package/lib/definitions/configurator-core/src/webgl/configurator-scene-event-handler.d.ts +3 -2
- package/lib/definitions/configurator-core/src/webgl/configurator-scene-manager.d.ts +6 -9
- package/lib/definitions/configurator-core/src/webgl/environment/floor-environment.d.ts +6 -7
- package/lib/definitions/configurator-core/src/webgl/lightsetting/default-light-setting.d.ts +3 -2
- package/lib/definitions/configurator-core/src/webgl/lightsetting/hd-light-setting.d.ts +2 -1
- package/lib/definitions/configurator-core/src/webgl/lightsetting/top-image-light-setting.d.ts +2 -1
- package/lib/definitions/configurator-core/src/webgl/plugin-system.d.ts +18 -17
- package/lib/definitions/glb-viewer-core/src/camera-control/adjustable-camera-control-3d.d.ts +3 -2
- package/lib/definitions/glb-viewer-core/src/roomle-glb-viewer.d.ts +2 -9
- package/lib/definitions/glb-viewer-core/src/webgl/glb-viewer-light-setting.d.ts +2 -1
- package/lib/definitions/glb-viewer-core/src/webgl/glb-viewer-scene-manager.d.ts +5 -7
- package/lib/definitions/material-viewer/src/roomle-material-viewer.d.ts +2 -9
- package/lib/definitions/material-viewer/src/webgl/material-viewer-scene-manager.d.ts +2 -4
- package/lib/definitions/planner-core/src/camera-control/camera-control-first-person.d.ts +4 -3
- package/lib/definitions/planner-core/src/roomle-planner.d.ts +4 -4
- package/lib/definitions/planner-core/src/utils/planner-scene-manager.d.ts +2 -1
- package/lib/definitions/planner-core/src/view-model/ceiling-plan-element-view-model.d.ts +2 -1
- package/lib/definitions/planner-core/src/view-model/construction-plan-object-view-model.d.ts +3 -2
- package/lib/definitions/planner-core/src/view-model/floor-plan-element-view-model.d.ts +2 -1
- package/lib/definitions/planner-core/src/view-model/node-plan-element-view-model.d.ts +4 -2
- package/lib/definitions/planner-core/src/view-model/plan-view-model.d.ts +7 -6
- package/lib/definitions/planner-core/src/view-model/wall-plan-element-view-model.d.ts +4 -3
- package/lib/definitions/planner-core/src/webgl/continuous-drawing-helper.d.ts +2 -1
- package/lib/definitions/planner-core/src/webgl/lightsetting/planner-light-setting.d.ts +3 -2
- package/lib/definitions/planner-core/src/webgl/planner-mesh-generator.d.ts +5 -4
- package/lib/definitions/planner-core/src/webgl/planner-scene-event-handler.d.ts +7 -6
- package/lib/definitions/planner-core/src/webgl/planner-scene-manager.d.ts +5 -7
- package/lib/definitions/typings/configurator-kernel-container.d.ts +3 -2
- package/lib/definitions/typings/kernel.d.ts +17 -4
- package/lib/definitions/typings/pixotron.d.ts +7 -28
- package/lib/definitions/typings/planner-kernel-container.d.ts +4 -3
- package/lib/definitions/typings/stats.d.ts +1 -17
- package/lib/dimensioning-helper-79e88370.nomodule.js +2 -0
- package/lib/{dimensioning-helper-e0cb55a5.nomodule.js.map → dimensioning-helper-79e88370.nomodule.js.map} +1 -1
- package/lib/dimensioning-helper-89e15d5c.js +2 -0
- package/lib/{dimensioning-helper-db71ae43.js.map → dimensioning-helper-89e15d5c.js.map} +1 -1
- package/lib/glb-viewer-220acd23.nomodule.js +2 -0
- package/lib/{glb-viewer-04fd6e23.nomodule.js.map → glb-viewer-220acd23.nomodule.js.map} +1 -1
- package/lib/glb-viewer-4f0558f5.js +2 -0
- package/lib/{glb-viewer-305d8bd7.js.map → glb-viewer-4f0558f5.js.map} +1 -1
- package/lib/glb-viewer-dummy-app.js +1 -1
- package/lib/glb-viewer-dummy-app.js.map +1 -1
- package/lib/glb-viewer-main-e4717d13.js +2 -0
- package/lib/glb-viewer-main-e4717d13.js.map +1 -0
- package/lib/glb-viewer-main.nomodule.js +1 -1
- package/lib/legacy/TextGeometry-7b0ba2a4.legacy.js +2 -0
- package/lib/legacy/TextGeometry-7b0ba2a4.legacy.js.map +1 -0
- package/lib/legacy/banana-for-scale-e04c4cff.legacy.js +2 -0
- package/lib/legacy/{banana-for-scale-7bad9610.legacy.js.map → banana-for-scale-e04c4cff.legacy.js.map} +1 -1
- package/lib/legacy/budgeteer-measure.legacy.js +1 -1
- package/lib/legacy/component-dimensioning-5060f862.legacy.js +2 -0
- package/lib/legacy/component-dimensioning-5060f862.legacy.js.map +1 -0
- package/lib/legacy/component-raycast-helper-07671bc4.legacy.js +2 -0
- package/lib/legacy/component-raycast-helper-07671bc4.legacy.js.map +1 -0
- package/lib/legacy/configurator-b4e0e93e.legacy.js +2 -0
- package/lib/legacy/configurator-b4e0e93e.legacy.js.map +1 -0
- package/lib/legacy/configurator-main.legacy.js +1 -1
- package/lib/legacy/continuous-drawing-helper-a7c2d434.legacy.js +2 -0
- package/lib/legacy/continuous-drawing-helper-a7c2d434.legacy.js.map +1 -0
- package/lib/legacy/default-light-setting-195b2ab7.legacy.js +2 -0
- package/lib/legacy/default-light-setting-195b2ab7.legacy.js.map +1 -0
- package/lib/legacy/dimensioning-helper-7d4bb1f1.legacy.js +2 -0
- package/lib/legacy/{dimensioning-helper-be8595e0.legacy.js.map → dimensioning-helper-7d4bb1f1.legacy.js.map} +1 -1
- package/lib/legacy/glb-viewer-c0216056.legacy.js +2 -0
- package/lib/legacy/{glb-viewer-1aef71c0.legacy.js.map → glb-viewer-c0216056.legacy.js.map} +1 -1
- package/lib/legacy/glb-viewer-main.legacy.js +1 -1
- package/lib/legacy/main-thread-to-worker-ebe10a2b.legacy.js +7 -0
- package/lib/legacy/main-thread-to-worker-ebe10a2b.legacy.js.map +1 -0
- package/lib/legacy/material-viewer-32a9186e.legacy.js +2 -0
- package/lib/legacy/material-viewer-32a9186e.legacy.js.map +1 -0
- package/lib/legacy/material-viewer-main.legacy.js +1 -1
- package/lib/legacy/planner-b3649aa5.legacy.js +2 -0
- package/lib/legacy/planner-b3649aa5.legacy.js.map +1 -0
- package/lib/legacy/planner-main.legacy.js +1 -1
- package/lib/legacy/roomle-configurator-9d57ec02.legacy.js +2 -0
- package/lib/legacy/roomle-configurator-9d57ec02.legacy.js.map +1 -0
- package/lib/legacy/roomle-dependency-injection-ddf49a56.legacy.js +9 -0
- package/lib/legacy/roomle-dependency-injection-ddf49a56.legacy.js.map +1 -0
- package/lib/legacy/roomle-sdk.legacy.js +1 -1
- package/lib/legacy/scene-manager-f62f275a.legacy.js +2 -0
- package/lib/legacy/scene-manager-f62f275a.legacy.js.map +1 -0
- package/lib/legacy/script-loader-0bad813a.legacy.js +2 -0
- package/lib/legacy/script-loader-0bad813a.legacy.js.map +1 -0
- package/lib/legacy/static/Tween-d57ee5d181fce582.js +767 -0
- package/lib/legacy/static/default_1k-2aa6d42244d30fb1.exr +0 -0
- package/lib/legacy/static/default_256-f1c66a2764f88cc0.exr +0 -0
- package/lib/legacy/static/draco_decoder-b048235474cbf09e.wasm +0 -0
- package/lib/legacy/static/draco_decoder-dc7f397e2a2ebac4.js +34 -0
- package/lib/legacy/static/draco_wasm_wrapper-6263f3a4b71cdf3b.js +117 -0
- package/lib/legacy/static/legacy_env-d5810ec5057d4716.exr +0 -0
- package/lib/{stats-helper-9c26a9c0.nomodule.js → legacy/stats-helper-546b9aa8.legacy.js} +2 -2
- package/lib/legacy/stats-helper-546b9aa8.legacy.js.map +1 -0
- package/lib/legacy/tools-core-2745a165.legacy.js +2 -0
- package/lib/legacy/tools-core-2745a165.legacy.js.map +1 -0
- package/lib/main-thread-to-worker-29498ad3.js +7 -0
- package/lib/main-thread-to-worker-29498ad3.js.map +1 -0
- package/lib/main-thread-to-worker-a2554a6a.nomodule.js +8 -0
- package/lib/main-thread-to-worker-a2554a6a.nomodule.js.map +1 -0
- package/lib/material-viewer-015815c1.nomodule.js +2 -0
- package/lib/material-viewer-015815c1.nomodule.js.map +1 -0
- package/lib/material-viewer-eedffa51.js +2 -0
- package/lib/material-viewer-eedffa51.js.map +1 -0
- package/lib/material-viewer-main-24ebdc40.js +2 -0
- package/lib/material-viewer-main-24ebdc40.js.map +1 -0
- package/lib/material-viewer-main.nomodule.js +1 -1
- package/lib/planner-60e8f69a.nomodule.js +2 -0
- package/lib/planner-60e8f69a.nomodule.js.map +1 -0
- package/lib/planner-dummy-app.js +1 -1
- package/lib/planner-dummy-app.js.map +1 -1
- package/lib/planner-dummy.html +1 -0
- package/lib/planner-f9aa0a27.js +2 -0
- package/lib/planner-f9aa0a27.js.map +1 -0
- package/lib/planner-main-b3dffe75.js +2 -0
- package/lib/planner-main-b3dffe75.js.map +1 -0
- package/lib/planner-main.nomodule.js +1 -1
- package/lib/roomle-configurator-0a88aea7.js +2 -0
- package/lib/roomle-configurator-0a88aea7.js.map +1 -0
- package/lib/roomle-configurator-3ab6dfeb.nomodule.js +2 -0
- package/lib/roomle-configurator-3ab6dfeb.nomodule.js.map +1 -0
- package/lib/roomle-dependency-injection-2fde2714.nomodule.js +16 -0
- package/lib/roomle-dependency-injection-2fde2714.nomodule.js.map +1 -0
- package/lib/roomle-dependency-injection-5533da82.js +16 -0
- package/lib/roomle-dependency-injection-5533da82.js.map +1 -0
- package/lib/roomle-sdk-c61e6974.js +2 -0
- package/lib/roomle-sdk-c61e6974.js.map +1 -0
- package/lib/roomle-sdk.nomodule.js +1 -1
- package/lib/scene-manager-3ee00913.js +2 -0
- package/lib/scene-manager-3ee00913.js.map +1 -0
- package/lib/scene-manager-b2128ea9.nomodule.js +2 -0
- package/lib/scene-manager-b2128ea9.nomodule.js.map +1 -0
- package/lib/script-loader-69c064c2.nomodule.js +2 -0
- package/lib/script-loader-69c064c2.nomodule.js.map +1 -0
- package/lib/script-loader-de8249e5.js +2 -0
- package/lib/script-loader-de8249e5.js.map +1 -0
- package/lib/static/Tween-d57ee5d181fce582.js.map +1 -0
- package/lib/static/default_1k-2aa6d42244d30fb1.exr +0 -0
- package/lib/static/default_256-f1c66a2764f88cc0.exr +0 -0
- package/lib/static/draco_decoder-b048235474cbf09e.wasm +0 -0
- package/lib/static/draco_decoder-dc7f397e2a2ebac4.js +34 -0
- package/lib/static/draco_wasm_wrapper-6263f3a4b71cdf3b.js +117 -0
- package/lib/static/legacy_env-d5810ec5057d4716.exr +0 -0
- package/lib/stats-helper-6a0d378d.nomodule.js +2 -0
- package/lib/stats-helper-6a0d378d.nomodule.js.map +1 -0
- package/lib/stats-helper-969d208f.js +2 -0
- package/lib/stats-helper-969d208f.js.map +1 -0
- package/lib/{tools-core-d85bfa17.js → tools-core-6284706e.js} +2 -2
- package/lib/tools-core-6284706e.js.map +1 -0
- package/lib/tools-core-94cba552.nomodule.js +2 -0
- package/lib/tools-core-94cba552.nomodule.js.map +1 -0
- package/package.json +6 -4
- package/lib/banana-for-scale-42f1dc5b.js +0 -2
- package/lib/banana-for-scale-f49704e0.nomodule.js +0 -2
- package/lib/component-dimensioning-057d1f9f.nomodule.js +0 -2
- package/lib/component-dimensioning-057d1f9f.nomodule.js.map +0 -1
- package/lib/component-dimensioning-9f8009b8.js +0 -2
- package/lib/component-dimensioning-9f8009b8.js.map +0 -1
- package/lib/component-raycast-helper-01d2984c.js +0 -2
- package/lib/component-raycast-helper-01d2984c.js.map +0 -1
- package/lib/component-raycast-helper-1db43efc.nomodule.js +0 -2
- package/lib/component-raycast-helper-1db43efc.nomodule.js.map +0 -1
- package/lib/configurator-4ecaafca.nomodule.js +0 -2
- package/lib/configurator-4ecaafca.nomodule.js.map +0 -1
- package/lib/configurator-a73acc5a.js +0 -2
- package/lib/configurator-a73acc5a.js.map +0 -1
- package/lib/configurator-main-14811ccb.js +0 -2
- package/lib/configurator-main-14811ccb.js.map +0 -1
- package/lib/continuous-drawing-helper-69c971e8.nomodule.js +0 -2
- package/lib/continuous-drawing-helper-69c971e8.nomodule.js.map +0 -1
- package/lib/continuous-drawing-helper-eb1b4a47.js +0 -2
- package/lib/continuous-drawing-helper-eb1b4a47.js.map +0 -1
- package/lib/default-light-setting-8eeeb3da.js +0 -2
- package/lib/default-light-setting-8eeeb3da.js.map +0 -1
- package/lib/default-light-setting-ef6a0979.nomodule.js +0 -2
- package/lib/default-light-setting-ef6a0979.nomodule.js.map +0 -1
- package/lib/definitions/common-core/__tests__/environment/baked-shadow-environment.d.ts +0 -1
- package/lib/definitions/common-core/__tests__/three-loader.d.ts +0 -1
- package/lib/definitions/common-core/__tests__/webgl/baked-shadow-plane.d.ts +0 -1
- package/lib/definitions/common-core/__tests__/webgl/pixotron-util.d.ts +0 -1
- package/lib/definitions/common-core/mock/mock-environment-loader.d.ts +0 -5
- package/lib/definitions/common-core/mock/mock-plane-shadow-bake-pass.d.ts +0 -8
- package/lib/definitions/common-core/mock/pixotron-mock.d.ts +0 -5
- package/lib/definitions/common-core/src/dynamic-quality-setting-loader.d.ts +0 -35
- package/lib/definitions/common-core/src/environment/baked-shadow-environment.d.ts +0 -45
- package/lib/definitions/common-core/src/services/environment-loader.d.ts +0 -27
- package/lib/definitions/common-core/src/three-loader.d.ts +0 -11
- package/lib/definitions/common-core/src/webgl/pixotron-util.d.ts +0 -39
- package/lib/definitions/configurator-core/__tests__/configurator-image-renderer.d.ts +0 -1
- package/lib/dimensioning-helper-db71ae43.js +0 -2
- package/lib/dimensioning-helper-e0cb55a5.nomodule.js +0 -2
- package/lib/glb-viewer-04fd6e23.nomodule.js +0 -2
- package/lib/glb-viewer-305d8bd7.js +0 -2
- package/lib/glb-viewer-main-64649f2c.js +0 -2
- package/lib/glb-viewer-main-64649f2c.js.map +0 -1
- package/lib/legacy/banana-for-scale-7bad9610.legacy.js +0 -2
- package/lib/legacy/component-dimensioning-cabc5380.legacy.js +0 -2
- package/lib/legacy/component-dimensioning-cabc5380.legacy.js.map +0 -1
- package/lib/legacy/component-raycast-helper-3169ff61.legacy.js +0 -2
- package/lib/legacy/component-raycast-helper-3169ff61.legacy.js.map +0 -1
- package/lib/legacy/configurator-a5c2c92c.legacy.js +0 -2
- package/lib/legacy/configurator-a5c2c92c.legacy.js.map +0 -1
- package/lib/legacy/continuous-drawing-helper-02495806.legacy.js +0 -2
- package/lib/legacy/continuous-drawing-helper-02495806.legacy.js.map +0 -1
- package/lib/legacy/default-light-setting-c6c84dbc.legacy.js +0 -2
- package/lib/legacy/default-light-setting-c6c84dbc.legacy.js.map +0 -1
- package/lib/legacy/dimensioning-helper-be8595e0.legacy.js +0 -2
- package/lib/legacy/glb-viewer-1aef71c0.legacy.js +0 -2
- package/lib/legacy/main-thread-to-worker-84353cef.legacy.js +0 -2
- package/lib/legacy/main-thread-to-worker-84353cef.legacy.js.map +0 -1
- package/lib/legacy/material-viewer-4bd2076c.legacy.js +0 -2
- package/lib/legacy/material-viewer-4bd2076c.legacy.js.map +0 -1
- package/lib/legacy/pixotron-b035ec35.legacy.js +0 -2
- package/lib/legacy/pixotron-b035ec35.legacy.js.map +0 -1
- package/lib/legacy/planner-1cd6147c.legacy.js +0 -2
- package/lib/legacy/planner-1cd6147c.legacy.js.map +0 -1
- package/lib/legacy/roomle-configurator-70bd6103.legacy.js +0 -2
- package/lib/legacy/roomle-configurator-70bd6103.legacy.js.map +0 -1
- package/lib/legacy/roomle-dependency-injection-acdca8a9.legacy.js +0 -16
- package/lib/legacy/roomle-dependency-injection-acdca8a9.legacy.js.map +0 -1
- package/lib/legacy/script-loader-53bf7b92.legacy.js +0 -2
- package/lib/legacy/script-loader-53bf7b92.legacy.js.map +0 -1
- package/lib/legacy/static/CopyShader-cde53240fcc3e06e.js +0 -46
- package/lib/legacy/static/DRACOLoader-5edeeab4a8dbc0bd.js +0 -678
- package/lib/legacy/static/DepthShadowGenerator-a3a9d85ff2c3d24c.js +0 -266
- package/lib/legacy/static/EffectComposer-1e936e5d03ff43cc.js +0 -298
- package/lib/legacy/static/GLTFExporter-86edae059df3a219.js +0 -2297
- package/lib/legacy/static/GLTFLoader-5b296b5fb14cfe1a.js +0 -3279
- package/lib/legacy/static/GammaCorrectionShader-b3b56f244f0d1e0e.js +0 -45
- package/lib/legacy/static/HDRCubeTextureLoader-8f7805ba456eca09.js +0 -131
- package/lib/legacy/static/LuminosityHighPassShader-dd5826656142421d.js +0 -64
- package/lib/legacy/static/OutlinePass-f4bcd337cdd89b8d.js +0 -592
- package/lib/legacy/static/RGBELoader-5b196b2428d96312.js +0 -526
- package/lib/legacy/static/RectAreaLightUniformsLib-4b74882185efd473.js +0 -47
- package/lib/legacy/static/RenderPass-bc5df3810a01b2c6.js +0 -79
- package/lib/legacy/static/ShaderPass-31f36160e0ea282d.js +0 -66
- package/lib/legacy/static/Sky-6621935ea8a523af.js +0 -224
- package/lib/legacy/static/Tween-5ebfb82307807fdc.js +0 -767
- package/lib/legacy/static/dat.gui.min-24a0d861d5534d62.js +0 -2447
- package/lib/legacy/static/draco_decoder-3866672a1fa2f980.js +0 -31
- package/lib/legacy/static/draco_decoder-979e668167e37c95.wasm +0 -0
- package/lib/legacy/static/draco_wasm_wrapper-d775f9f135cb30ff.js +0 -129
- package/lib/legacy/static/pi.min-0272f873b3a4380a.js +0 -1
- package/lib/legacy/static/rthree-750136f8399d9f72.js +0 -2
- package/lib/legacy/static/shaders-940522a5e460efd1.json +0 -1
- package/lib/legacy/static/stats.min-f33a6e08a8864d76.js +0 -5
- package/lib/legacy/stats-helper-c0b5d8b6.legacy.js +0 -2
- package/lib/legacy/stats-helper-c0b5d8b6.legacy.js.map +0 -1
- package/lib/legacy/tools-core-227c6513.legacy.js +0 -2
- package/lib/legacy/tools-core-227c6513.legacy.js.map +0 -1
- package/lib/main-thread-to-worker-1651b1df.js +0 -2
- package/lib/main-thread-to-worker-1651b1df.js.map +0 -1
- package/lib/main-thread-to-worker-b7956e5b.nomodule.js +0 -2
- package/lib/main-thread-to-worker-b7956e5b.nomodule.js.map +0 -1
- package/lib/material-viewer-3fd75160.nomodule.js +0 -2
- package/lib/material-viewer-3fd75160.nomodule.js.map +0 -1
- package/lib/material-viewer-5324de36.js +0 -2
- package/lib/material-viewer-5324de36.js.map +0 -1
- package/lib/material-viewer-main-a45f2d04.js +0 -2
- package/lib/material-viewer-main-a45f2d04.js.map +0 -1
- package/lib/pixotron-cd9b0143.nomodule.js +0 -2
- package/lib/pixotron-cd9b0143.nomodule.js.map +0 -1
- package/lib/pixotron-e481d9b2.js +0 -2
- package/lib/pixotron-e481d9b2.js.map +0 -1
- package/lib/planner-377d1061.nomodule.js +0 -2
- package/lib/planner-377d1061.nomodule.js.map +0 -1
- package/lib/planner-b018f99c.js +0 -2
- package/lib/planner-b018f99c.js.map +0 -1
- package/lib/planner-main-ec5a6efa.js +0 -2
- package/lib/planner-main-ec5a6efa.js.map +0 -1
- package/lib/roomle-configurator-0d5ba529.nomodule.js +0 -2
- package/lib/roomle-configurator-0d5ba529.nomodule.js.map +0 -1
- package/lib/roomle-configurator-98c3c172.js +0 -2
- package/lib/roomle-configurator-98c3c172.js.map +0 -1
- package/lib/roomle-dependency-injection-7dcab742.nomodule.js +0 -16
- package/lib/roomle-dependency-injection-7dcab742.nomodule.js.map +0 -1
- package/lib/roomle-dependency-injection-f7298e7e.js +0 -16
- package/lib/roomle-dependency-injection-f7298e7e.js.map +0 -1
- package/lib/roomle-sdk-f9cc3d20.js +0 -2
- package/lib/roomle-sdk-f9cc3d20.js.map +0 -1
- package/lib/script-loader-17506a98.nomodule.js +0 -2
- package/lib/script-loader-17506a98.nomodule.js.map +0 -1
- package/lib/script-loader-c9cba6e8.js +0 -2
- package/lib/script-loader-c9cba6e8.js.map +0 -1
- package/lib/static/CopyShader-cde53240fcc3e06e.js +0 -1
- package/lib/static/CopyShader-cde53240fcc3e06e.js.map +0 -1
- package/lib/static/DRACOLoader-5edeeab4a8dbc0bd.js +0 -1
- package/lib/static/DRACOLoader-5edeeab4a8dbc0bd.js.map +0 -1
- package/lib/static/DepthShadowGenerator-a3a9d85ff2c3d24c.js +0 -1
- package/lib/static/DepthShadowGenerator-a3a9d85ff2c3d24c.js.map +0 -1
- package/lib/static/EffectComposer-1e936e5d03ff43cc.js +0 -1
- package/lib/static/EffectComposer-1e936e5d03ff43cc.js.map +0 -1
- package/lib/static/GLTFExporter-86edae059df3a219.js +0 -1
- package/lib/static/GLTFExporter-86edae059df3a219.js.map +0 -1
- package/lib/static/GLTFLoader-5b296b5fb14cfe1a.js +0 -1
- package/lib/static/GLTFLoader-5b296b5fb14cfe1a.js.map +0 -1
- package/lib/static/GammaCorrectionShader-b3b56f244f0d1e0e.js +0 -1
- package/lib/static/GammaCorrectionShader-b3b56f244f0d1e0e.js.map +0 -1
- package/lib/static/HDRCubeTextureLoader-8f7805ba456eca09.js +0 -1
- package/lib/static/HDRCubeTextureLoader-8f7805ba456eca09.js.map +0 -1
- package/lib/static/LuminosityHighPassShader-dd5826656142421d.js +0 -1
- package/lib/static/LuminosityHighPassShader-dd5826656142421d.js.map +0 -1
- package/lib/static/OutlinePass-f4bcd337cdd89b8d.js +0 -1
- package/lib/static/OutlinePass-f4bcd337cdd89b8d.js.map +0 -1
- package/lib/static/RGBELoader-5b196b2428d96312.js +0 -1
- package/lib/static/RGBELoader-5b196b2428d96312.js.map +0 -1
- package/lib/static/RectAreaLightUniformsLib-4b74882185efd473.js +0 -1
- package/lib/static/RectAreaLightUniformsLib-4b74882185efd473.js.map +0 -1
- package/lib/static/RenderPass-bc5df3810a01b2c6.js +0 -1
- package/lib/static/RenderPass-bc5df3810a01b2c6.js.map +0 -1
- package/lib/static/ShaderPass-31f36160e0ea282d.js +0 -1
- package/lib/static/ShaderPass-31f36160e0ea282d.js.map +0 -1
- package/lib/static/Sky-6621935ea8a523af.js +0 -1
- package/lib/static/Sky-6621935ea8a523af.js.map +0 -1
- package/lib/static/Tween-5ebfb82307807fdc.js.map +0 -1
- package/lib/static/dat.gui.min-24a0d861d5534d62.js +0 -1
- package/lib/static/dat.gui.min-24a0d861d5534d62.js.map +0 -1
- package/lib/static/draco_decoder-3866672a1fa2f980.js +0 -31
- package/lib/static/draco_decoder-979e668167e37c95.wasm +0 -0
- package/lib/static/draco_wasm_wrapper-d775f9f135cb30ff.js +0 -129
- package/lib/static/pi.min-0272f873b3a4380a.js +0 -1
- package/lib/static/pi.min-0272f873b3a4380a.js.map +0 -1
- package/lib/static/rthree-750136f8399d9f72.js +0 -1
- package/lib/static/rthree-750136f8399d9f72.js.map +0 -1
- package/lib/static/shaders-940522a5e460efd1.json +0 -1
- package/lib/static/stats.min-f33a6e08a8864d76.js +0 -1
- package/lib/static/stats.min-f33a6e08a8864d76.js.map +0 -1
- package/lib/stats-helper-9c26a9c0.nomodule.js.map +0 -1
- package/lib/stats-helper-bccf87d4.js +0 -2
- package/lib/stats-helper-bccf87d4.js.map +0 -1
- package/lib/tools-core-15d100e4.nomodule.js +0 -2
- package/lib/tools-core-15d100e4.nomodule.js.map +0 -1
- package/lib/tools-core-d85bfa17.js.map +0 -1
- /package/lib/definitions/{common-core/__tests__/dynamic-quality-setting-loader.d.ts → test-helpers/unit/global-setup.d.ts} +0 -0
- /package/lib/definitions/{common-core/__tests__/environment-loader.d.ts → test-helpers/unit/modules-setup.d.ts} +0 -0
- /package/lib/static/{Tween-5ebfb82307807fdc.js → Tween-d57ee5d181fce582.js} +0 -0
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import{a as getValue,g as getAssetPath,M as MainThreadToWorker,h as handleJsonResponse,R as ROOMLE_COLORS,d as deepMerge,s as setWriteable,b as setDescriptor,c as createBenchmarkMaterial,e as createBenchmarkTexture,r as removeItem,f as getGlbUrl,t as transformRange,w as wait,o as objectArrayToMap,i as roundWithPrecision,u as uuid,j as setCursor,k as isString}from"./main-thread-to-worker-1651b1df.js";class Container{constructor(){this._context=new Map,this._lookups=new Map,this._singletons=new Map}getContext(e){if(this._context.has(e)){const t=this._context.get(e);return this._context.set(e,t+1),e+t}return this._context.set(e,1),e+0}addDependencyInjectionAssignments(e){e.forEach(e=>{this._lookups.set(e.className,e)})}lookup(e,t){if(!this._lookups.has(e))return null;const n=this._lookups.get(e);if(1===n.type&&void 0===t){const t="Dependency "+e+" has definition context but no context was defined!";return console.trace(t),console.error(t),null}let i=t&&1===n.type?t:"global";if(i+="_"+e,2===n.type)return new n.classDefinition;if(this._singletons.has(i))return this._singletons.get(i);const s=new n.classDefinition(t);return this._singletons.set(i,s),s}cleanUp(e){if(e){let t=[];this._singletons.forEach((n,i)=>{i.startsWith(e)&&t.push(i)}),t.forEach(e=>{this._singletons.delete(e)})}else this._singletons.clear(),this._singletons=new Map}}class DependencyInjectionAssignment{constructor(e,t,n){this.className=e,this.classDefinition=t,this.type=void 0===n?0:n}}const IMAGE_FORMATS={JPG:".jpg",JPEG:".jpeg",PNG:".png",GIF:".gif"};class FormDataUtil{_base64toBlob(e,t){t=t||"";const n=atob(e),i=n.length,s=Math.ceil(i/1024),o=new Array(s);for(let e=0;e<s;++e){let t=1024*e,s=Math.min(t+1024,i);const r=new Array(s-t);for(let e=t,i=0;e<s;++i,++e)r[i]=n[e].charCodeAt(0);o[e]=new Uint8Array(r)}return new Blob(o,{type:t})}_createFormData(e,t,n,i){const s=new FormData;-1!==e.indexOf(",")&&(e=e.substr(e.indexOf(",")+1));const o=-1===Object.keys(IMAGE_FORMATS).map(e=>IMAGE_FORMATS[e]).indexOf(n)?"application":"image",r=this._base64toBlob(e,o+"/"+n.substr(1));return s.append(i,r,t+n),s}create(e,t,n,i){return this._createFormData(e,t,n,i)}}
|
|
2
|
-
/*! *****************************************************************************
|
|
3
|
-
Copyright (c) Microsoft Corporation.
|
|
4
|
-
|
|
5
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
-
purpose with or without fee is hereby granted.
|
|
7
|
-
|
|
8
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
9
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
10
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
11
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
12
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
-
***************************************************************************** */function __decorate(e,t,n,i){var s,o=arguments.length,r=o<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(e,t,n,i);else for(var a=e.length-1;a>=0;a--)(s=e[a])&&(r=(o<3?s(r):o>3?s(t,n,r):s(t,n))||r);return o>3&&r&&Object.defineProperty(t,n,r),r}class EnvMapReader{constructor(){this._size=256,this._maxLod=0,this._encoding=THREE.LinearEncoding,this._type=THREE.UnsignedByteType,this._format=THREE.RGBAFormat,this._cubeTextures=[],this._lightDirection=new THREE.Vector3,this._path=""}setPath(e){this._path=e}load(e){return new Promise(t=>{(new THREE.FileLoader).setResponseType("arraybuffer").load(this._path+e,e=>{this.parseData_(e),t(this._cubeTexture)})})}parseHeader_(e){let t=new DataView(e,0,30);this._size=t.getUint16(0),this._maxLod=t.getUint8(2),this._encoding=t.getUint16(3),this._type=t.getUint16(5),this._format=t.getUint16(7),this._lightDirection.x=t.getFloat32(9),this._lightDirection.y=t.getFloat32(13),this._lightDirection.z=t.getFloat32(17)}parseBufferData_(e,t){let n=this._size;const i=Math.log2(this._size)+1;this._cubeTextures=[];for(let s=0;s<i;s++){let i=new THREE.CubeTexture;this._cubeTextures.push(i),i.format=THREE.RGBAFormat,i.encoding=this._encoding,i.type=this._type,i.minFilter=THREE.LinearMipMapLinearFilter,i.magFilter=THREE.LinearFilter,i.generateMipmaps=!1;for(let s=0;s<6;s++){let o=new Uint8Array(e,t,4*n*n),r=new THREE.DataTexture(o,n,n);r.format=i.format,r.encoding=i.encoding,r.type=i.type,r.generateMipmaps=!1,t+=4*n*n,i.images[s]=r,r.needsUpdate=!0}i.needsUpdate=!0,n/=2}this._cubeTexture=new THREE.CubeTexture,this._cubeTexture.format=THREE.RGBAFormat,this._cubeTexture.encoding=this._encoding,this._cubeTexture.type=this._type,this._cubeTexture.minFilter=THREE.LinearMipMapLinearFilter,this._cubeTexture.magFilter=THREE.LinearFilter,this._cubeTexture.generateMipmaps=!1;for(let e=0;e<6;e++){this._cubeTexture.image[e]=this._cubeTextures[0].images[e];for(let e=1;e<i;e++)this._cubeTexture.mipmaps[e-1]=this._cubeTextures[e],this._cubeTextures[e].needsUpdate=!0}this._cubeTexture.needsUpdate=!0,this._cubeTexture.maxLod=this._maxLod-1}convertToRGBABuffer(e){let t=new Uint8Array(e,30,e.byteLength-30),n=4;this._format===THREE.RGBFormat&&(n=3);const i=4*t.length/n;let s=new ArrayBuffer(i),o=new DataView(s),r=0,a=t.length/n;if(3===n)for(let e=0;e<a;e++)o.setUint8(r++,t[e]),o.setUint8(r++,t[e+a]),o.setUint8(r++,t[e+2*a]),o.setUint8(r++,255);else for(let e=0;e<a;e++)o.setUint8(r++,t[e]),o.setUint8(r++,t[e+a]),o.setUint8(r++,t[e+2*a]),o.setUint8(r++,t[e+3*a]);return s}parseData_(e){this.parseHeader_(e);let t=30;t=0;let n=this.convertToRGBABuffer(e);this.parseBufferData_(n,0)}}const toRadiant=function(e){return e*(Math.PI/180)},toDegrees=function(e){return e*(180/Math.PI)},getIdealDistance=function(e,t,n,i,s,o){e=Math.sqrt(e*e+n*n);const r=s/o,a=2*Math.atan(Math.tan(i*Math.PI/180/2)*r)*180/Math.PI,l=toRadiant(i),c=t/2/Math.tan(l/2),h=e/(2*Math.atan(Math.PI*a/360));return Math.max(c,h)},round=function(e){return Math.round(1e3*e)/1e3},getDelta=function(e,t){return Math.abs(e.y-t.y)+Math.abs(e.x-t.x)},convertToTHREE=e=>new THREE.Vector3(e.x/1e3,e.z/1e3,e.y/-1e3),convertToThreeDimensions=e=>new THREE.Vector3(e.x/1e3,e.z/1e3,e.y/1e3),convertToKernel=e=>({x:Math.round(1e3*e.x),y:Math.round(-1e3*e.z),z:Math.round(1e3*e.y)}),utilityStringToUTF16=e=>decodeURIComponent(encodeURIComponent(e)),convertCObject=e=>{if(!e){const t=typeof e;return"number"===t||"boolean"===t?e:null}if(!e.hasOwnProperty("size")&&e.size&&"function"==typeof e.size){let t=utilityToArray(e);for(let e=0;e<t.length;e++)t[e]=convertCObject(t[e]);return"string"==typeof t?utilityStringToUTF16(t):t}if("object"==typeof e)for(let t in e)e.hasOwnProperty(t)&&(e[t]=convertCObject(e[t]));return"string"==typeof e?utilityStringToUTF16(e):e},utilityToArray=e=>{let t=[];if(e){let n=e.size();for(let i=0;i<n;i++)t.push(e.get(i))}return t},convertToThreeMatrix=e=>{let t=new THREE.Matrix4,n=convertCObject(e);return t.fromArray(n),t.transpose(),(e=>{let t=new THREE.Matrix4;t.set(1,0,0,0,0,0,1,0,0,-1,0,0,0,0,0,1),t.scale(new THREE.Vector3(.001,.001,.001));let n=new THREE.Matrix4;return n.set(1,0,0,0,0,0,-1,0,0,1,0,0,0,0,0,1),n.scale(new THREE.Vector3(1e3,1e3,1e3)),t.multiply(e).multiply(n)})(t)},getScreenXY=(e,t,n,i)=>{if(!e||!t||0===n||0===i)return new THREE.Vector3;let s=e.clone(),o=n/2,r=i/2;return s.project(t),s.x=Math.floor(s.x*o+o),s.y=Math.floor(-s.y*r+r),s.z=e.distanceTo(t.position),s},kernelBoxToThreeBox=(e,t)=>{t||(t=new THREE.Vector3(0,0,0));let n=new THREE.Vector3(e.size.x/1e3,e.size.z/1e3,e.size.y/1e3),i=new THREE.Vector3(e.origin.x/1e3,e.origin.z/1e3,e.origin.y/-1e3),s=new THREE.Vector3(0,0,-n.z).add(i).sub(t),o=new THREE.Vector3(n.x,n.y,0).add(i).add(t);return new THREE.Box3(s,o)},position3VectorsAreEqual=(e,t)=>{let n=round(e.x),i=round(e.y),s=round(e.z),o=round(t.x),r=round(t.y),a=round(t.z);return n===o&&i===r&&s===a},rotationQuaternionsAreEqual=(e,t)=>{let n=round(e.w),i=round(e.x),s=round(e.y),o=round(e.z),r=round(t.w),a=round(t.x),l=round(t.y),c=round(t.z);return n===r&&i===a&&s===l&&o===c},position2VectorsAreEqual=(e,t)=>{let n=round(e.x),i=round(e.y),s=round(t.x),o=round(t.y);return n===s&&i===o};let whiteTexture=null;const getWhiteTexture=()=>{if(whiteTexture)return whiteTexture;const e=new Uint8Array(4);for(let t=0;t<1;t++){const n=4*t;e[n]=255,e[n+1]=255,e[n+2]=255,e[n+3]=255}const t=new THREE.DataTexture(e,1,1,THREE.RGBAFormat);return t.needsUpdate=!0,t},createColorTexture=(e,t,n,i)=>{const s=new Uint8Array(4),o=Math.floor(255*e),r=Math.floor(255*t),a=Math.floor(255*n),l=Math.floor(255*i);for(let e=0;e<4;e++){const t=4*e;s[t]=o,s[t+1]=r,s[t+2]=a,s[t+3]=l}const c=new THREE.DataTexture(s,1,1,THREE.RGBAFormat);return c.needsUpdate=!0,c},createMaterial=(e,t)=>setMaterial(null,e,t),setMaterial=(e,t,n)=>{if(e||(e=createMeshPhysicalMaterial()),e.name=t.id?t.id.toString():"",void 0!==t.shading.metallic&&(e.metalness=1===t.shading.metallic?1:.5,e.reflectivity=getValue(t.shading.metallic,.5)),t.shading.transmission&&t.shading.transmission>0?(e.transmission=t.shading.transmission,e.opacity=1,e.transparent=!0,e.depthWrite=!1,e.metalness=0):void 0!==t.shading.alpha&&t.shading.alpha<1&&(e.transparent=t.shading.alpha<1,e.opacity=t.shading.alpha,e.depthWrite=t.shading.alpha>=1),e.aoMapIntensity=getValue(t.shading.occlusion,1),e.roughness=getValue(t.shading.roughness,.5),e.alphaTest=getValue(t.shading.alphaCutoff,0),void 0!==t.shading.basecolor){const n=new THREE.Color(t.shading.basecolor.r,t.shading.basecolor.g,t.shading.basecolor.b);e.color.copy(n.convertSRGBToLinear())}return null==n||n.setEnvMap(e),t.shading.doubleSided?e.side=THREE.DoubleSide:e.side=THREE.FrontSide,e.map||(whiteTexture||(whiteTexture=getWhiteTexture()),e.map=whiteTexture),e},createMeshPhysicalMaterial=()=>new THREE.MeshPhysicalMaterial({}),getMaterialShading=e=>{let t=e.color.clone().convertLinearToSRGB(),n={alpha:e.opacity,metallic:e.reflectivity,basecolor:{r:t.r,g:t.g,b:t.b},roughness:e.roughness,doubleSided:e.side===THREE.DoubleSide,alphaCutoff:e.alphaTest,transmission:e.transmission};return 1===e.metalness?n.metallic=1:n.metallic=e.reflectivity,n};let textureLoader=null;const addTexture=(e,t,n,i,s,o,r=16)=>(textureLoader||(textureLoader=new THREE.TextureLoader,textureLoader.crossOrigin=""),new Promise((a,l)=>{if(!e)return console.warn("trying to add a texture without image",t),void a();textureLoader.load(e,e=>{addExistingTexture(e,t,n,i,s,o,r),a()},l)})),addExistingTexture=(e,t,n,i,s,o,r=16)=>{e.anisotropy=i,e.wrapS=THREE.RepeatWrapping,e.wrapT=THREE.RepeatWrapping,"ORM"===t.mapping&&r<=8?console.warn("ORM maps are not supported on devices with only "+r+" texture units"):(e.repeat.set(s,o),"XYZ"===t.mapping?(n.normalMap=e,n.map===getWhiteTexture()&&(n.map=null)):"ORM"===t.mapping?(n.aoMap=e,n.roughnessMap=e,n.metalnessMap=e):(e.encoding=THREE.sRGBEncoding,n.map=e),"RGBA"===t.mapping&&(n.transparent=!0),n.needsUpdate=!0)},getGUI=(e=!0)=>window.dat&&window.dat.GUI?(window.__RML_GUI__||(window.__RML_GUI__=new dat.GUI({autoPlace:e})),window.__RML_GUI__):null,hideWallsBasedOnCamera=(e,t)=>{for(const n of t){const t=n.getKernelObject();let i;if(2===t.wallType.value&&(i=convertToTHREE(t.rightNormal)),1===t.wallType.value&&(i=convertToTHREE(t.leftNormal)),!i)continue;let s=convertToTHREE(n.getPlanElement().getCenter());s=s.applyMatrix4(e.matrixWorldInverse),i=i.transformDirection(e.matrixWorldInverse),s.dot(i)>=0?n.show():n.isSelected||n.hide()}},setWallTransparency=(e,t,n=!0)=>{if(!e.userData.tween)if(t)if(e.transparent=!0,n){let t={opacity:1};e.userData.tween=!0,new TWEEN.Tween(t).to({opacity:.2},400).easing(TWEEN.Easing.Sinusoidal.In).onUpdate(()=>{e.opacity=t.opacity}).onComplete(()=>{e.userData.tween=!1}).start()}else e.opacity=.2;else if(n){let t={opacity:.2};e.userData.tween=!0,new TWEEN.Tween(t).to({opacity:1},400).easing(TWEEN.Easing.Sinusoidal.In).onUpdate(()=>{e.opacity=t.opacity}).onComplete(()=>{e.transparent=!1,e.userData.tween=!1}).start()}else e.opacity=1,e.transparent=!1},transitionTransparencyOfMaterial=(e,t)=>{e.traverse(e=>{if(e instanceof THREE.Mesh&&TWEEN){const n=e.material;e.userData.tween&&e.userData.tween.stop();const i={opacity:n.opacity};t.transparent&&(n.transparent=t.transparent),e.userData.tween=new TWEEN.Tween(i).to(t,250).easing(TWEEN.Easing.Linear.None).onUpdate(()=>{n.opacity=i.opacity}).onStop(()=>{t.transparent||(n.transparent=t.transparent),n.opacity=t.opacity,n.needsUpdate=!0,e.userData.tween=void 0}).onComplete(()=>{t.transparent||(n.transparent=t.transparent),n.needsUpdate=!0,e.userData.tween=void 0}).start()}})},fadeIn=e=>{e.traverse(e=>{if(e instanceof THREE.Mesh&&TWEEN){let t=e.material;if(0===t.opacity)return;let n={opacity:0,transparent:!0},i={opacity:t.opacity,transparent:t.transparent};t.transparent=n.transparent,t.opacity=n.opacity,new TWEEN.Tween(n).to(i,500).easing(TWEEN.Easing.Linear.None).onUpdate(()=>{t.opacity=n.opacity}).onComplete(()=>{t.transparent=i.transparent}).start()}})},dispose=e=>{"Mesh"===e.type?disposeMesh(e):disposeObject(e)},disposeObject=e=>{e&&e.children&&0!==e.children.length&&e.children.forEach(e=>{disposeMesh(e)})},disposeMesh=e=>{e&&(e.material&&disposeMaterial(e.material),e.geometry&&disposeGeometry(e.geometry),e.children&&e.children.length>0&&disposeObject(e))},disposeGeometry=e=>{e&&e.dispose()},disposeMaterial=e=>{e&&(e.map&&e.map.dispose(),e.normalMap&&e.normalMap.dispose(),e.dispose())};let boundingBoxMaterial;const vectorIsZero=e=>0===e.x&&0===e.y&&0===e.z,getMaterialId=(e,t)=>{let n="";return e||""===e?(e.materialId&&""!==e.materialId?n=e.materialId:e.catalogItemId&&""!==e.catalogItemId?n=e.catalogItemId:e.rgbValue>0?n="rgb"+JSON.stringify(e.rgbValue):e.length>0?n=e:t&&1===t.value?n="default_wall_material_"+e.getSourceType().value:t&&7===t.value&&(n="default_ceiling_material_"+e.getSourceType().value),n):null},vectorIsEqual=(e,t,n=.01)=>!(!e||!t)&&Math.abs(e.x-t.x)<=n&&Math.abs(e.y-t.y)<=n&&Math.abs(e.z-t.z)<=n,getYRotationOfObject=e=>{let t=e.getWorldDirection(new THREE.Vector3).clone();t.y=0,t.lengthSq()<.01&&(t=new THREE.Vector3(0,1,0),t.applyQuaternion(e.quaternion),t.y=0),t.normalize();let n=Math.asin(t.x);return t.z<0&&(n=Math.PI-n),n<0&&(n+=2*Math.PI),n},compareBox3Size=(e,t)=>{if(!e||!t)return 0;const n=e.clone().expandByScalar(.001).containsBox(t),i=t.clone().expandByScalar(.001).containsBox(e);return i&&n||!i&&!n?0:!0===n?1:-1},getDrawingMinBounds=(e,t,n,i=1)=>{const s=t>n,o=s?15:0,r=s?0:10,a=e.getSize(new THREE.Vector3),l=e.getCenter(new THREE.Vector3);let c=a.x>2*o?a.x/2:o,h=a.z>2*r?a.z/2:r;return c*=i,h*=i,new THREE.Box3(new THREE.Vector3(l.x-c,l.y,l.z-h),new THREE.Vector3(l.x+c,l.y,l.z+h))},threeVectorToTransferableXY=e=>{const{x:t,y:n}=e;return{x:t,y:n}},threeVectorToTransferableXYZ=e=>{const{x:t,y:n,z:i}=e;return{x:t,y:n,z:i}},dashCase=function(e){return e.startsWith("_")&&(e=e.substr(1)),e.replace(/[A-Z](?:(?=[^A-Z])|[A-Z]*(?=[A-Z][^A-Z]|$))/g,(function(e,t){return(t>0?"-":"")+e.toLowerCase()}))};function inject(e,t){const n=Symbol("property-cache");Object.defineProperty(e,t,{get(){if(!this[n]){const e=window.__RML__DI__.lookup(dashCase(t),this._creator_);e?this[n]=e:console.error("Dependency "+dashCase(t)+" not found! Add dependency to /utils/injectables.ts")}return this[n]}})}class EnvironmentLoader{static setEnvironmentMap(e,t){e&&t&&(e.envMap=t,e.envMapIntensity=1,e.needsUpdate=!0)}constructor(e){this._hdrCubeUrl="static/roomle-91862a5e7f3f46e5.envmap",this._hdrCubeUrlLowres="static/roomle64-adb0f447a54b5143.envmap",this._envMapReader=new EnvMapReader,this._onEnvMapUpdate=[],this._creator_=e;const t=new THREE.Color("#DDDDDD");this._environmentMap=((e,t,n,i)=>{const s=new THREE.CubeTexture;s.format=THREE.RGBAFormat,s.generateMipmaps=!1;for(let i=0;i<6;++i){const o=createColorTexture(e,t,n,1);o.format=s.format,o.type=s.type,o.minFilter=s.minFilter,o.magFilter=s.magFilter,o.generateMipmaps=s.generateMipmaps,o.needsUpdate=!0,s.images[i]=o}return s.needsUpdate=!0,s})(t.r,t.g,t.b),this._envMapReader.setPath(getAssetPath()),this._loadHDREnvMap(this._hdrCubeUrlLowres)}getEnvironmentMap(){return this._environmentMap}_processPMREM(e){const t=new THREE.PMREMGenerator(this._renderer);let n=t.fromCubemap(e);return e.magFilter=THREE.LinearFilter,e.needsUpdate=!0,t.dispose(),n.texture}_loadHDREnvMap(e){return this._initData.disableEnvMap?Promise.resolve():new Promise(t=>{this._envMapReader.load(e).then(n=>{n.encoding=THREE.sRGBEncoding;const i=this._renderer.extensions.get("EXT_shader_texture_lod");this._environmentMap=i?this._processPMREM(n):n,e!==this._hdrCubeUrl&&(this._environmentMap.encoding=THREE.sRGBEncoding,window.requestIdleCallback(this._loadHDREnvMap.bind(this,this._hdrCubeUrl))),this._updateEnvironmentMap(),t(),this._envChangedCallback&&this._envChangedCallback()})})}setRendererAndScene(e,t){this._renderer=e,this._scene=t}registerEnvironmentChangedCallback(e){this._envChangedCallback=e}_updateEnvironmentMap(){this._initData.disableEnvMap||(this._scene.traverse(e=>{e instanceof THREE.Mesh&&(e.material instanceof THREE.MeshStandardMaterial||"MeshPhysicalMaterial"===e.material.type)&&EnvironmentLoader.setEnvironmentMap(e.material,this._environmentMap)}),this._onEnvMapUpdate.forEach(e=>e()),this._onEnvMapUpdate=[])}onEnvMapUpdate(e){this._onEnvMapUpdate.push(e)}setEnvMap(e){this._initData.disableEnvMap||EnvironmentLoader.setEnvironmentMap(e,this.getEnvironmentMap())}}__decorate([inject],EnvironmentLoader.prototype,"_initData",void 0);const PREDEFINED_LIGHTSETTING={SOFA:"sofa",SHELF:"shelf",SHELF_FRONT:"shelf_front",BAKED:"baked",CAMERA:"camera",EQUAL:"equal"};class DynamicLightSettingLoader{static createDynamicLightSettingSource(e,t){let n={};if(e)n.url=e;else if(t)switch(t){case PREDEFINED_LIGHTSETTING.SHELF:n.url=getAssetPath()+"static/shelf-2975dd3f2fa9c763.json";break;case PREDEFINED_LIGHTSETTING.SHELF_FRONT:n.url=getAssetPath()+"static/shelf_front-8c9566a4512f0de8.json";break;case PREDEFINED_LIGHTSETTING.SOFA:n.url=getAssetPath()+"static/sofa-997b116bc5f2e92e.json";break;case PREDEFINED_LIGHTSETTING.BAKED:n.url=getAssetPath()+"static/baked-6485a2b1daeb69e8.json";break;case PREDEFINED_LIGHTSETTING.CAMERA:n.url=getAssetPath()+"static/camera-05824b47cdb951e4.json";break;case PREDEFINED_LIGHTSETTING.EQUAL:n.url=getAssetPath()+"static/equal-319f6b83c827913f.json";break;default:n.url=getAssetPath()+"static/camera-05824b47cdb951e4.json"}else n=null;return n}parse(e){let t=JSON.parse(e);return t.lights?this.load(t):[]}load(e){let t=[];return e.lights?(e.lights.forEach(e=>{let n;switch(e.type){case"ambient":n=this._parseAmbientLight(e);break;case"rectarea":n=this._parseRectAreaLight(e);break;case"spot":n=this._parseSpotLight(e);break;case"directional":n=this._parseDirectionalLight(e)}n&&t.push(n)}),t):[]}_parseAmbientLight(e){let t=new THREE.AmbientLight;return this._parseCommon(t,e),t}_parseRectAreaLight(e){let t=new THREE.RectAreaLight;this._parseCommon(t,e);let{intensity:n,castShadow:i,target:s,width:o,height:r}=e;return t.width=o||.8,t.height=r||.8,t.castShadow=i||!1,t.matrixAutoUpdate=!0,t.intensity=(n||240)/((o||.8)*(r||.8)),t.lookAt(s?new THREE.Vector3(s.x,s.y,s.z):new THREE.Vector3(0,0,0)),t}_parseSpotLight(e){let t=new THREE.SpotLight;this._parseCommon(t,e);let{angle:n,penumbra:i,target:s,castShadow:o}=e;return t.angle=(n||100)*Math.PI/180,t.penumbra=i||.5,t.lookAt(s?new THREE.Vector3(s.x,s.y,s.z):new THREE.Vector3(0,0,0)),t.shadow.camera.near=.1,t.shadow.camera.far=10,t.shadow.mapSize=new THREE.Vector2(1024,1024),t.castShadow=o||!1,t}_parseDirectionalLight(e){let t=new THREE.DirectionalLight;this._parseCommon(t,e);let{target:n,castShadow:i}=e;return t.castShadow=i||!1,t.shadow.camera.near=.1,t.shadow.camera.far=100,t.shadow.mapSize=new THREE.Vector2(1024,1024),t.shadow.bias=-5e-5,t.lookAt(n?new THREE.Vector3(n.x,n.y,n.z):new THREE.Vector3(0,0,0)),t}_parseCommon(e,t){let{name:n,intensity:i,color:s,position:o,movesWithCamera:r}=t;e.name=n||"",e.intensity=i||1,e.color=new THREE.Color(s||"#ffffff"),e.position.copy(o?new THREE.Vector3(o.x,o.y,o.z):new THREE.Vector3(0,0,0)),e.visible=!0,e.layers.set(1),e.userData.movesWithCamera=r}}const NAMES_FOR_LOCALHOST=["127.0.0.1","localhost","0.0.0.0"],isIdItemId=function(e){return!(!e||"string"!=typeof e||e.split(":").length>2)},getCatalogIdFromItemOrConfigurationId=e=>{if(!e||"string"!=typeof e)return null;const t=e.split(":");return t.length<2?null:t[0]},kernelPartToPriceId=({articleNr:e,componentId:t})=>e&&""!==e?t.split(":")[0]+":"+e:null,wasRequestSuccess=(e,t)=>null!=e?"string"==typeof e?"true"===e:!0===e:("string"==typeof t&&(t=parseInt(t,10)),t>=200&&t<300);class NetworkLayer{constructor(){this._queue=[],this._pendingRequests=0}_nextSlot(){if(this._pendingRequests-=1,!this._queue.length)return;const{request:e,resolve:t,reject:n}=this._queue.shift();this._fetch(e).then(t,n)}_fetch(e,t={},n={}){return this._pendingRequests+=1,new Promise((i,s)=>{self.fetch(e,t).then(async function(e){this._nextSlot();const t=!n.checkResponse||!1!==await n.checkResponse(e);if(wasRequestSuccess(e.ok,e.status)&&t)i(...arguments);else{const t=(null==e?void 0:e.url)||"URL unknown";s(new Error(e.statusText||'Http error "'+(e&&e.status?e.status:"unknown")+'", for "'+t+'"'))}}.bind(this),e=>{this._nextSlot(),s(e)})})}fetch(e,t={},n={}){return this._pendingRequests>=40?new Promise((t,n)=>this._queue.push({request:e,resolve:t,reject:n})):this._fetch(e,t,n)}}class Logger{info(...e){console}log(...e){console}warn(...e){console.warn.apply(console,e)}error(...e){console.warn.apply(console,e)}}class KernelIo extends Logger{constructor(e){super(),this._creator_=e}setMeta(e){this._meta=e}get meta(){return this._meta?this._meta:{}}throw(e){const t="[Kernel Exception]: "+e;this._globalCallback.onKernelMsg("exception",e,this.meta),this.error(t)}error(e){this._globalCallback.onKernelMsg("error",e,this.meta),super.error(e)}warn(e){this._globalCallback.onKernelMsg("warning",e,this.meta),super.warn(e)}}__decorate([inject],KernelIo.prototype,"_globalCallback",void 0);const ASSET_CACHE=new Map,SYNCED_CATALOGS=new Map,SYNCED_FLOORS_TAGS=new Map,SYNCED_TYPE_CHANGE_TAGS=new Map;class DataSyncer{constructor(e){this._bootCallbacks=[],this._isStarted=!1,this._isStarting=!1,this._alwaysUseCache=!1,this._creator_=e}start(e){return this._configuratorUiCallbacks.onSyncStarted(),this._startWorker().then(()=>this._handleCatalog(e)).then(()=>{const{typeChangeTag:e,floorMaterialsTag:t}=this._initData;Promise.all([this._syncFloorTag(t),this._syncTypeChangeTag(e)]).then(()=>{SYNCED_TYPE_CHANGE_TAGS.set(e,!0),this._configuratorUiCallbacks.onSyncDone()})})}syncCatalog(e){return this._startWorker().then(()=>this._handleCatalog(e))}syncFloorTag(e){return this._startWorker().then(()=>this._syncFloorTag(e))}syncTypeChangeTag(e){return this._startWorker().then(()=>this._syncTypeChangeTag(e))}_syncFloorTag(e){const t=[];return e&&!SYNCED_FLOORS_TAGS.get(e)?(t.push(this._handleTags([e])),this._rapiAccess.getTag(e).then(e=>{t.push(this._handleMaterialsAndTextures(e))}),this._singlePromiseFactory.create(1,e,n=>{Promise.all(t).then(()=>{SYNCED_FLOORS_TAGS.set(e,!0),n()},e=>this._softReject(n,'_syncFloorTag error: "'+e+'"'))})):Promise.resolve()}_syncTypeChangeTag(e){const t=[];return e&&!SYNCED_TYPE_CHANGE_TAGS.get(e)?(t.push(this._handleTags([e])),this._rapiAccess.getTag(e).then(e=>{this._rapiAccess.getItems(e.items).then(e=>{e.forEach(e=>{this.getIsCatalogSynced(e.catalog)&&t.push(this._handleCatalog(e.catalog))})})}),this._singlePromiseFactory.create(2,e,n=>{Promise.all(t).then(()=>{SYNCED_FLOORS_TAGS.set(e,!0),n()},e=>this._softReject(n,'_syncTypeChangeTag error: "'+e+'"'))})):Promise.resolve()}getIsCatalogSynced(e){return!!SYNCED_CATALOGS.get(e)}_startWorker(){return new Promise((e,t)=>{if(this._isStarted)return e();this._bootCallbacks.push({resolve:e,reject:t}),this._isStarting||(this._worker=new Worker(getAssetPath()+"static/asset-loader.worker-d8f85c01953acd85.js"),this._mainThreadToWorker=new MainThreadToWorker(this,this._worker),this._isStarting=!0,this._mainThreadToWorker.sendToWorker(1))})}onCommand(e,t,n){switch(e){case 4:this._isStarted=!0,this._bootCallbacks.forEach(({resolve:e})=>e());break;case 3:this._mainThreadToWorker.resolvePromises(t,n)}}_handleCatalog(e){return this._singlePromiseFactory.create(0,e,t=>this.getIsCatalogSynced(e)?t():this._rapiAccess.getCatalog(e).then(e=>Promise.all([this._handleContentWithAssets(this._rapiAccess.getComponentsOf(e),["perspectiveImage"]),this._handleItemsAndAdditionalContents(e),this._handleMaterialsAndTextures(e),this._handleExternalMeshes(e),this._handleTags(e.tags)])).then(()=>{SYNCED_CATALOGS.set(e,!0),t()},e=>this._softReject(t,'Catalog sync error: "'+e+'"')))}_handleTags(e){return this._handleContentWithAssets(this._rapiAccess.getTags(e),["pngIcon","svgIcon"])}_handleExternalMeshes(e){return new Promise(t=>{this._rapiAccess.getMeshesOfCatalog(e.id).then(e=>{const n=[];e.forEach(e=>{n.push(this._handleContentWithAssets(Promise.all([this._rapiAccess.getMesh(e.id)]),["url"]))}),Promise.all(n).then(t,e=>this._softReject(t,'Sync crt files error: "'+e+'"'))},e=>this._softReject(t,'getMeshesOfCatalog error: "'+e+'"'))})}_handleItemsAndAdditionalContents(e){return new Promise(t=>{this._rapiAccess.getItemsOf(e).then(e=>{const n=[];n.push(this._handleContentWithAssets(Promise.resolve(e),["perspectiveImage"])),this._rapiAccess.getAdditionalContentsOfItems(e).then(e=>{const t=e.filter(e=>-1!==[5,6,4].indexOf(e.type));n.push(this._handleContentWithAssets(Promise.resolve(t),["content"]))},e=>this._softReject(t,'getAdditionalContentsOfItems error: "'+e+'"')),Promise.all(n).then(t,e=>this._softReject(t,'AdditionalContent image sync error:"'+e+'"'))})})}_handleMaterialsAndTextures(e){return new Promise(t=>{this._rapiAccess.getMaterialsOf(e).then(e=>{const n=[];n.push(this._handleContentWithAssets(Promise.resolve(e),["thumbnail"])),e.forEach(e=>{n.push(this._handleContentWithAssets(this._rapiAccess.getTexturesOf(e),["image"]))}),Promise.all(n).then(t,e=>this._softReject(t,'getTexturesOf error: "'+e+'"'))},e=>this._softReject(t,'getMaterialsOf error: "'+e+'"'))})}_handleContentWithAssets(e,t){return new Promise(n=>e.then(e=>this._fetchAssets(e,t).then(n,e=>this._softReject(n,'_handleContentWithAssets error: "'+e+'"')),e=>this._softReject(n,'_handleContentWithAssets promise error: "'+e+'"')))}_fetchAssets(e,t){const n=[];e||(e=[]);for(let i=0,s=e.length;i<s;i++){const s=e[i];t.forEach(e=>{const t=s[e];t&&n.push(this._preCacheAsset(t))})}return Promise.all(n)}_preCacheAsset(e){return new Promise(t=>{if(ASSET_CACHE.get(e))return t();this._assetUrlToBase64(e).then(n=>{ASSET_CACHE.set(e,n),t()},e=>this._softReject(t,'_preCacheAsset error: "'+e+'"'))})}_assetUrlToBase64(e){return new Promise(t=>{this._mainThreadToWorker.sendToWorker(5,e,t,e=>this._softReject(t,'_assetUrlToBase64 error: "'+e+'"'))})}_softReject(e,t){this._errorHandler.softReject(e,t,2)}requestAsset(e,t=!1){return navigator.onLine&&!this._alwaysUseCache?e:ASSET_CACHE.get(e)||(t?e:null)}setAlwaysUseCache(e){this._alwaysUseCache=e}preFillAssetCache(e,t){ASSET_CACHE.set(e,t)}}__decorate([inject],DataSyncer.prototype,"_rapiAccess",void 0),__decorate([inject],DataSyncer.prototype,"_singlePromiseFactory",void 0),__decorate([inject],DataSyncer.prototype,"_errorHandler",void 0),__decorate([inject],DataSyncer.prototype,"_configuratorUiCallbacks",void 0),__decorate([inject],DataSyncer.prototype,"_initData",void 0);class AsyncGuard{constructor(e){this.info=e,this._init()}_init(){this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}resolve(e){e&&this._resolve(e),this._resolve()}reject(e){this._reject(e)}wait(){return this._promise}reset(){this._init()}}var GLTF_LOADER_FILE_NAME="static/GLTFLoader-5b296b5fb14cfe1a.js",DRACO_LOADER_FILE_NAME="static/DRACOLoader-5edeeab4a8dbc0bd.js";const DRACO_LIB_FILES={"draco_wasm_wrapper.js":"static/draco_wasm_wrapper-d775f9f135cb30ff.js","draco_decoder.wasm":"static/draco_decoder-979e668167e37c95.wasm","draco_decoder.js":"static/draco_decoder-3866672a1fa2f980.js"};class StaticItemLoader{constructor(e){if(this._gltfLoaderGuard=new AsyncGuard,this._creator_=e,THREE.GLTFLoader&&THREE.DRACOLoader)this._initLoaders();else{let e=this._scriptLoader.fetch("static/GLTFLoader-5b296b5fb14cfe1a.js",{id:"gltf-loader"}),t=this._scriptLoader.fetch("static/DRACOLoader-5edeeab4a8dbc0bd.js",{id:"draco-loader"});Promise.all([e,t]).then(()=>this._initLoaders())}}_initLoaders(){this._gltfLoader=new THREE.GLTFLoader;const e=new THREE.DRACOLoader;if("function"!=typeof e._loadLibrary)throw new Error("Can not patch draco loader! Did three.js update the DracoLoader example?");const t=e._loadLibrary.bind(e._loadLibrary);e._loadLibrary=(e,n)=>{const i=DRACO_LIB_FILES[e];if(!i)throw new Error('Can not load draco dependency "'+e+'" did three.js update DracoLoader lib? Available files'+JSON.stringify(DRACO_LIB_FILES));return t(getAssetPath()+i,n)},this._gltfLoader.setDRACOLoader(e),this._gltfLoaderGuard.resolve(this._gltfLoader)}async loadGLB(e,t,n,i,s,o,r,a){return await this._gltfLoaderGuard.wait(),new Promise((l,c)=>{this._gltfLoader.load(e,e=>{l(this._handleGLTFScene("GLB",e,t,n,i,s,o,r))},e=>{a&&a(e.loaded/e.total)},e=>{c(e)})})}async loadGLTF(e,t,n,i,s,o,r,a){return await this._gltfLoaderGuard.wait(),new Promise((l,c)=>{this._gltfLoader.parse(e,null,e=>{l(this._handleGLTFScene("GLTF",e,t,n,i,s,o,r))},e=>{a&&a(e.loaded/e.total)},e=>{c(e)})})}_handleGLTFScene(e,t,n,i,s,o,r,a){if(!t||!t.scene||!t.scene.children||0===t.scene.children.length)return null;n&&t.scene.position.copy(n),i&&(t.scene.rotation.y=i);const l=new THREE.Box3;if(l.setFromObject(t.scene),s){const{x:e,y:n,z:i}=l.getSize(new THREE.Vector3);let o=new THREE.Vector3(s.x/e,s.y/n,s.z/i);t.scene.scale.copy(o)}return o&&t.scene.scale.multiply(o),t.scene.type=e,t.scene.traverse(e=>{if(e instanceof THREE.Mesh){if(e.layers.set(3),e.material instanceof THREE.MeshStandardMaterial){const t=e.material;if(this._environmentLoader.setEnvMap(t),a&&r&&r>0){let e=new THREE.Color(r);t.color=e.copyGammaToLinear(e),t.roughness=.5,t.metalness=.1}t.needsUpdate=!0}e.castShadow=!0,e.receiveShadow=!0}}),{boundingBox:l,scene:t.scene}}}__decorate([inject],StaticItemLoader.prototype,"_environmentLoader",void 0),__decorate([inject],StaticItemLoader.prototype,"_scriptLoader",void 0);class ThreeLoader{constructor(e){this._jsonLoaded=!1,this._creator_=e}_loadShaders(){return new Promise((e,t)=>{if(this._jsonLoaded)return e();this._networkLayer.fetch(getAssetPath()+"static/shaders-940522a5e460efd1.json",{credentials:"same-origin"}).then(handleJsonResponse,t).then(t=>{window._rsl=t,this._jsonLoaded=!0,e()},t)})}fetch(){return window._rsl||(window._rsl={}),new Promise((e,t)=>this._loadShaders().then(()=>{this._scriptLoader.fetch("static/rthree-750136f8399d9f72.js",{id:"three-lib"}).then(e,t)},t))}}__decorate([inject],ThreeLoader.prototype,"_scriptLoader",void 0),__decorate([inject],ThreeLoader.prototype,"_networkLayer",void 0);class LocalStorageHelper{constructor(e){this._context_=e}getStore(e="rml_default"){return this._localStorage.getItem(e)||{entries:[]}}saveStore(e,t){this._localStorage.setItem(e,t)}addItem(e,t,n="rml_default",i=5){const s=this.getStore(n),o=s.entries.find(t=>t.id===e);if(o?(o.payload=t,o.date=Date.now()):s.entries.push({id:e,date:Date.now(),payload:t}),s.entries.length>i)for(s.entries.sort((e,t)=>t.date-e.date);s.entries.length>i;)s.entries.pop();this.saveStore(n,s)}getItem(e,t="rml_default"){const n=this.getStore(t).entries.find(t=>t.id===e);return n?n.payload:null}}__decorate([inject],LocalStorageHelper.prototype,"_localStorage",void 0);class DynamicQualitySettingLoader{set(e,t){t&&(void 0!==t.enableAA&&(e.enableAA=t.enableAA),this._setSAOPass(e,t),this._setShadowPass(e,t),this._setGroundShadow(e,t))}_setSAOPass(e,t){if(t.SAOPass){const n=t.SAOPass;void 0!==n.enabled&&(e.getSAOPass().enabled=n.enabled),void 0!==n.smoothTransition&&(e.getSAOPass().smoothTransition=n.smoothTransition),n.occlusionWorldRadius&&(e.getSAOPass().occlusionWorldRadius=n.occlusionWorldRadius),n.intensity&&(e.getSAOPass().intensity=n.intensity),n.bias&&(e.getSAOPass().bias=n.bias),n.numSamples&&(e.getSAOPass().numSamples=n.numSamples)}}_setShadowPass(e,t){if(t.shadowPass){const n=t.shadowPass;void 0!==n.enabled&&(e.getShadowPass().enabled=n.enabled),void 0!==n.smoothTransition&&(e.getShadowPass().smoothTransition=n.smoothTransition),void 0!==n.enableAccumulation&&(e.getShadowPass().enableAccumulation=n.enableAccumulation),n.shadowRadius&&(e.getShadowPass().shadowRadius=n.shadowRadius),n.shadowBiasMultiplier&&(e.getShadowPass().shadowBiasMultiplier=n.shadowBiasMultiplier),n.numSamples&&(e.getShadowPass().numSamples=n.numSamples)}}_setGroundShadow(e,t){if(t.groundShadow){const n=t.groundShadow;void 0!==n.enable&&(e.getShadowPlanePass().enable=n.enable),void 0!==n.smoothTransition&&(e.getShadowPlanePass().smoothTransition=n.smoothTransition),n.numSamples&&(e.getShadowPlanePass().numSamples=n.numSamples),n.numSamplesPerFrame&&(e.getShadowPlanePass().numSamplesPerFrame=n.numSamplesPerFrame)}}}const CAMERA_TYPE={CAMERA_2D:"2D",CAMERA_3D:"3D",CAMERA_FP:"FP"},sanitizedCameraMode=e=>{if(!e)return CAMERA_TYPE.CAMERA_3D;let t=e.toUpperCase();return-1===Object.values(CAMERA_TYPE).indexOf(t)&&(t=CAMERA_TYPE.CAMERA_3D),t};class InitData{constructor(e){this.autoQuality=!0,this.colors=ROOMLE_COLORS,this.unit=null,this.unitStringType=null,this.meshSelection=!0,this.stats=!1,this._measureTraffic=!1,this.gammaOutput=!0,this.disableDebugGUI=!1,this.disableEnvMap=!1,this.restrictionLevel=0,this.dls=null,this.ls=null,this.cameraSpacing=0,this.transparentHighlighting=!0,this.featureFlags={pulsePreview:!1,reDock:!1},this.mode=CAMERA_TYPE.CAMERA_3D,this.edit=!1,this.moc=!1,this._creator_=e}setOverrides(e){deepMerge(this,e)}}const BROWSER_LANGUAGE_PROPERTY_KEYS_KNOWN=["language","browserLanguage","userLanguage","systemLanguage"],isSafari=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);class GlobalInitData{constructor(e){this.locale=((e=null)=>{const t=window.navigator;if(e)return e.substr(0,2);if(Array.isArray(t.languages)&&t.languages.length>0)return t.languages[0].substr(0,2);for(let e=0,n=BROWSER_LANGUAGE_PROPERTY_KEYS_KNOWN.length;e<n;e++){const n=t[BROWSER_LANGUAGE_PROPERTY_KEYS_KNOWN[e]];if(n)return n.substr(0,2)}return"en"})()||"en",this.overrideCountry=null,this._creator_=e}setOverrides(e){deepMerge(this,e)}}class UiCallback{_setMute(e){setWriteable(this,"_isMute",!0),this._isMute=e,setWriteable(this,"_isMute",!1)}mute(){this._setMute(!0)}unmute(){this._setMute(!1)}constructor(e){return this._isMute=!1,this.cameraStartsMoving=()=>{},this._creator_=e,setDescriptor(this,"_isMute",{enumerable:!1,writable:!1}),setDescriptor(UiCallback.prototype,"_setMute",{enumerable:!1,writable:!1}),setDescriptor(UiCallback.prototype,"mute",{enumerable:!1,writable:!1}),setDescriptor(UiCallback.prototype,"unmute",{enumerable:!1,writable:!1}),new Proxy(this,this)}get(e,t){return this._isMute&&"function"==typeof this[t]&&"on"===t.substr(0,2)?()=>{}:this[t]}}class GlobalCallback extends UiCallback{constructor(){super(...arguments),this.onNetworkRequest=(e,t,n)=>{},this.onKernelMsg=(e,t,n={})=>{},this.onCheckExternalCache=async(e,t)=>Promise.resolve(null),this.onValidateNetworkResponse=(e,t)=>Promise.resolve(!0)}}const CANVAS_ID={HSC:"rml-configurator",HSP:"rml-hsp",GLB:"rml-glb",RMV:"rml-mv"};class DomHelper{get element(){return this._container}constructor(e){this._creator_=e,this._lifeCycleManager.addEventListener(this)}setDomElement(e){if(!this._container){this._container=document.createElement("div"),this._container.classList.add("rml-threejs-canvas-container"),this._container.setAttribute("ondragover","return false"),this._container.style.position="relative",this._container.style.width="100%",this._container.style.height="100%";const t=document.createElement("style");t.innerText=".rml-threejs-canvas-container canvas{position:absolute;top:0;left:0;right:0;bottom:0;z-index:100; opacity:1;}",this._container.appendChild(t),e.appendChild(this._container)}this._element=e}getClientDimensions(){return new THREE.Vector2(this._element.clientWidth,this._element.clientHeight)}_removeDomElement(e){if(!e)return;const t=e.parentElement;t&&t.removeChild(e)}reset(){this._element=null,this._removeDomElement(this._container),this._container=null}pause(){this.reset()}resume(){}destroy(){}}__decorate([inject],DomHelper.prototype,"_lifeCycleManager",void 0);class ScenePluginDefaultImplementation{constructor(e){this._creator_=e}setScene(e){}setUiScene(e){}updateBounds(e){}clearScene(e,t){}moveCameraEnd(e){}moveCameraStart(e){}needsUiScene(){return!1}}class PluginSystem{constructor(e){this._plugins=[],this._creator_=e}async init(e,t,n){this._scene=e,this._uiScene=t,this._cameraPosition=n;const{bananaForScale:i}=this._initData;i&&await import("./banana-for-scale-42f1dc5b.js").then(({default:e})=>this._plugins.push(new e(this._creator_))),this._plugins.forEach(e=>e.setScene(this._scene)),this._plugins.forEach(e=>e.setUiScene(this._uiScene)),this._plugins.forEach(e=>e.updateBounds(this._bounds)),this._plugins.forEach(e=>e.moveCameraEnd(this._cameraPosition))}addPlugin(e){this._plugins.push(e),e.setScene(this._scene),e.setUiScene(this._uiScene),e.updateBounds(this._bounds),e.moveCameraEnd(this._cameraPosition)}updateBounds(e){this._bounds=e,this._plugins.forEach(t=>t.updateBounds(e))}clearScene(e,t){this._plugins.forEach(n=>n.clearScene(e,t))}getActivePlugins(){return this._plugins}getPlugin(e){for(let t of this._plugins)if(t instanceof e)return t;return null}moveCameraEnd(e){this._cameraPosition=e,this._plugins.forEach(t=>t.moveCameraEnd(e))}moveCameraStart(e){this._cameraPosition=e,this._plugins.forEach(t=>t.moveCameraStart(e))}needsUiScene(){return this._plugins.map(e=>e.needsUiScene()).reduce((e,t)=>e||t,!1)}}__decorate([inject],PluginSystem.prototype,"_initData",void 0);class PromiseQueue{constructor(e,t){this._waitingPromises=[],this._finishPromiseExecutor=[],this._errorCallback=()=>{},Promise.allSettled=Promise.allSettled||(e=>Promise.all(e.map(e=>e.then(e=>({status:"fulfilled",value:e})).catch(e=>({status:"rejected",reason:e}))))),e&&this.registerCallback(e),t&&(this._errorCallback=t)}push(e){this._waitingPromises.push(e),Promise.all(this._waitingPromises).then(e=>{e.length===this._waitingPromises.length&&(this._callback&&this._callback(e),this._waitingPromises=[])},this._errorCallback)}finished(e=!1){return new Promise((t,n)=>{this._finishPromiseExecutor.push({resolve:t,reject:n});const i=e?"allSettled":"all";Promise[i](this._waitingPromises).then(e=>{if("allSettled"===i){const t=[];e.forEach(({value:e,status:n})=>{"fulfilled"===n&&t.push(e)}),this._resolveAllExecutors(t)}else this._resolveAllExecutors(e)},e=>{this._rejectAllExecutors(e)})})}registerCallback(e){this._callback=e}unregisterCallback(){this._callback=null}_resolveAllExecutors(e){this._finishPromiseExecutor.forEach(({resolve:t})=>t(e)),this._finishPromiseExecutor=[]}_rejectAllExecutors(e){this._finishPromiseExecutor.forEach(({reject:t})=>t(e)),this._finishPromiseExecutor=[]}clear(){const e=this._waitingPromises.length>0;this._waitingPromises=[],e?this._rejectAllExecutors(new Error("Promise queue has been cleared")):this._resolveAllExecutors([])}get length(){return this._waitingPromises.length}}class MeshGenerator{constructor(e){this.materialQueue=new PromiseQueue,this._geometryComponentMaterialCache=new Map,this._maxAnisotropy=1,this._maxTextures=16,this._textureLoader=new THREE.TextureLoader,this._configuratorPreviewMaterial=new THREE.MeshStandardMaterial({color:"#DDDDDD",transparent:!0,opacity:1,roughness:1,envMap:null}),this._creator_=e,this._previewMaterial=new THREE.MeshStandardMaterial({color:"#DDDDDD",roughness:1,metalness:0}),this._environmentLoader.setEnvMap(this._previewMaterial)}getGeometry(e){return e&&this._cacheHolder.geometryCache.has(e)?this._cacheHolder.geometryCache.get(e):null}_generateGeometry(e,t,n,i,s){let o;return e&&this._cacheHolder.geometryCache.has(e)?o=this._cacheHolder.geometryCache.get(e):(o=new THREE.BufferGeometry,o.setIndex(new THREE.Uint32BufferAttribute(n,1)),o.setAttribute("position",new THREE.Float32BufferAttribute(t,3)),o.setAttribute("normal",new THREE.Float32BufferAttribute(s,3)),o.setAttribute("uv",new THREE.Float32BufferAttribute(i,2)),o.scale(.001,.001,.001),o.rotateX(-Math.PI/2),e&&this._cacheHolder.geometryCache.set(e,o)),o}changeMaterialOfMesh(e,t,n){e&&t?(e.material=t,e.material.transparent||0===e.material.opacity||e.material.transmission>0?(e.castShadow=!1,e.receiveShadow=!1):(e.castShadow=!0,e.receiveShadow=!0),e.material.needsUpdate=!0,this._materialLoaded&&this._materialLoaded(t),this._updateMaterialProperties(e,n)):console.warn("could not assign material to mesh",{mesh:e},{material:t})}_updateMaterialProperties(e,t){var n;if(t&&Object.keys(t).length>0&&e.material instanceof THREE.MeshStandardMaterial){const i=e.material.clone();i.userData.materialAttributes=t,t.color&&(i.color=new THREE.Color(t.color).convertSRGBToLinear()),t.alpha&&(i.opacity=parseFloat(t.alpha)),t.roughness&&(i.roughness=parseFloat(t.roughness)),t.metallic&&(i.metalness=parseFloat(t.metallic)),i instanceof THREE.MeshPhysicalMaterial&&t.transmission&&(i.transmission=parseFloat(t.transmission)),i.transparent=i.opacity<1;const s=e.material;e.material=i,(null===(n=s.userData)||void 0===n?void 0:n.materialAttributes)&&s.dispose()}}_createMaterial(e,t,n,i,s){if(this._cacheHolder.materialCache.has(e))t();else if(e.startsWith("benchmarkMaterial")){let o=createBenchmarkMaterial(e),r=createMaterial(o,this._environmentLoader);this._loadBenchmarkTextures(o,r,i,s).then(t,n)}else this._rapiAccess.getMaterial(e).then(e=>{let o=createMaterial(e,this._environmentLoader);this._loadTextures(e,o,i,s).then(t,n)},n)}_loadBenchmarkTextures(e,t,n=1,i=1){return new Promise((s,o)=>{const r=createBenchmarkTexture(e.id);addTexture(this._dataSyncer.requestAsset(r.image,!0),r,t,this._maxAnisotropy,n/(0===r.mmWidth?1:r.mmWidth),i/(0===r.mmHeight?1:r.mmHeight),this._maxTextures).then(()=>{this._cacheHolder.materialCache.set(e.id,t),s()},o)})}_loadTextures(e,t,n=1,i=1){return new Promise((s,o)=>{if(!e.textures||e.textures&&0===e.textures.length)return this._cacheHolder.materialCache.set(e.id,t),s();this._rapiAccess.getTexturesOf(e).then(r=>{let a=[];r.forEach(e=>{a.push(addTexture(this._dataSyncer.requestAsset(e.image,!0),e,t,this._maxAnisotropy,n/(0===e.mmWidth?1:e.mmWidth),i/(0===e.mmHeight?1:e.mmHeight),this._maxTextures))}),Promise.all(a).then(()=>{this._cacheHolder.materialCache.set(e.id,t),s()},o)})})}_loadMaterial(e,t,n){return new Promise((i,s)=>{this._singlePromiseFactory.create(6,e,(i,s)=>this._createMaterial(e,i,s,t,n)).then(()=>{setTimeout(()=>i(this._cacheHolder.materialCache.get(e)),0)},s)})}_assignMaterial(e,t,n){return this._cacheHolder.materialCache.has(t)?(this.changeMaterialOfMesh(e,this._cacheHolder.materialCache.get(t),n),Promise.resolve()):new Promise((i,s)=>{this._loadMaterial(t).then(s=>{e.userData.materialId===t&&this.changeMaterialOfMesh(e,s,n),i()},s)})}get maxAnisotropy(){return this._maxAnisotropy}set maxAnisotropy(e){this._maxAnisotropy=e}get maxTextures(){return this._maxTextures}set maxTextures(e){this._maxTextures=e}clear(){this._cacheHolder.clear()}_assignRGB(e,t){return new Promise(n=>{let i,s="rgb"+JSON.stringify(t);this._cacheHolder.materialCache.has(s)?i=this._cacheHolder.materialCache.get(s):(i=new THREE.MeshStandardMaterial({color:t}),this._environmentLoader.setEnvMap(i),this._cacheHolder.materialCache.set(s,i)),this.changeMaterialOfMesh(e,i),setTimeout(()=>n(),0)})}_assignItem(e,t){return new Promise((n,i)=>{if(this._cacheHolder.materialCache.has(t))return this.changeMaterialOfMesh(e,this._cacheHolder.materialCache.get(t)),void n();this._rapiAccess.getItem(t).then(s=>{if(s.topImage)this._textureLoader.load(s.topImage,i=>{i.anisotropy=this._maxAnisotropy,i.wrapS=THREE.RepeatWrapping,i.wrapT=THREE.RepeatWrapping;let o=new THREE.Vector2(1,1);s.width>0&&(o.x=1/s.width),s.depth>0&&(o.y=1/s.depth),i.repeat.set(o.x,o.y);const r=new THREE.MeshPhysicalMaterial({map:i,roughness:.5,metalness:.1});this._environmentLoader.setEnvMap(r),this._cacheHolder.materialCache.set(t,r),this.changeMaterialOfMesh(e,r),setTimeout(()=>n(),0)});else{const e="can not set material, catalog item top image is not set";console.warn(e),i(e)}},i)})}setMaterialLoadedListener(e){this._materialLoaded=e}removeMaterialLoadedListener(){this._materialLoaded=void 0}_createMesh(e,t,n){if(e&&t){const i=this._getComponentMeshId(e,t);if(this._geometryComponentMaterialCache.has(i)){const e=this._geometryComponentMaterialCache.get(i);if(this._cacheHolder.materialCache.has(e)){const t=this._cacheHolder.materialCache.get(e);return new THREE.Mesh(n,t)}}}return new THREE.Mesh(n,this._configuratorPreviewMaterial.clone())}_getComponentMeshId(e,t){return e+"_"+t}}__decorate([inject],MeshGenerator.prototype,"_rapiAccess",void 0),__decorate([inject],MeshGenerator.prototype,"_environmentLoader",void 0),__decorate([inject],MeshGenerator.prototype,"_dataSyncer",void 0),__decorate([inject],MeshGenerator.prototype,"_singlePromiseFactory",void 0),__decorate([inject],MeshGenerator.prototype,"_cacheHolder",void 0),__decorate([inject],MeshGenerator.prototype,"_plannerMeshGenerator",void 0);class ConfiguratorMeshGenerator extends MeshGenerator{constructor(e){super(e),this._environmentLoader.setEnvMap(this._configuratorPreviewMaterial)}generateMesh(e=0,t=null,n,i,s,o,r,a=!1,l){let c;c=a?this._generateGeometry(t,i,s,o,r).clone():this._generateGeometry(t,i,s,o,r);const h=this._createMesh(e,t,c);return h.userData.materialId=n,h.layers.set(4),n&&this.materialQueue.push(this._assignMaterial(h,n,l).then(()=>{e&&t&&this._geometryComponentMaterialCache.set(this._getComponentMeshId(e,t),n)})),h}setMaterial(e,t,n,i){return this._assignMaterial(e,t,i)}loadMaterial(e,t,n){return super._loadMaterial(e,t,n)}loadTextures(e,t,n,i){return super._loadTextures(e,t,n,i)}}class EventDispatcher{constructor(){this._listeners={},this._disabled=!1}_addEventListener(e,t,n){this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push({callback:t,scope:n})}addEventListener(e,t,n){this._addEventListener(e,t,n)}dispatchEvent(e,t){if(!this._listeners[e]||this._disabled)return;const n=this._listeners[e];let i=n.length;for(let e=0;e<i;e++){const i=n[e];t?i.callback.apply(i.scope,[t]):i.callback.call(i.scope)}}removeEventListener(e,t){const n=this._listeners[e];if(n)for(let e=0,i=n.length;e<i;e++)if(n[e].callback===t)return void n.splice(e,1)}enableEvents(){this._disabled=!1}disableEvents(){this._disabled=!0}}const BROWSER_EVENTS={SCROLL:"scroll",MOUSE_MOVE:"mousemove",MOUSE_DOWN:"mousedown",MOUSE_UP:"mouseup",MOUSE_LEAVE:"mouseleave",MOUSE_ENTER:"mouseenter",MOUSE_WHEEL:"wheel",TOUCH_MOVE:"touchmove",TOUCH_START:"touchstart",TOUCH_END:"touchend",CONTEXT_MENU:"contextmenu",DOUBLE_CLICK:"dblclick"};class InputEvent{constructor(e,t,n,i,s){this.position=e,this.positionRelative=t,this.type=n,this.rotation=i,this.event=s}}const MIN_MOVE_DISTANCE=5*window.devicePixelRatio,MIN_DOLLY_DISTANCE=3*window.devicePixelRatio;class InputManager extends EventDispatcher{constructor(e){super(),this._elementHit=!1,this._delta=-1,this._state=0,this._pinchDistance=-1,this._rotationAngle=-1,this._lastMouseWheelEvent=null,this._lastTouchEvent=null,this._events=Object.keys(BROWSER_EVENTS).map(e=>BROWSER_EVENTS[e]),this._boundingClientRectInvalid=!0,this._creator_=e,this._downPosition={x:0,y:0},this._downPositionRelative={x:0,y:0},this._boundingClientRect=this._getBoundingClientRect()}enableDragIn(e){this._setState(1),this._dragEnabled=!0,e&&(this._dragMV=this._dragM.bind(this),this._dragEV=this._dragE.bind(this),this._dragTarget=e.currentTarget||e.target,this._delta=-1,this._dragMVName="drag",this._dragEVName="dragend",window.TouchEvent&&e instanceof TouchEvent?(this._dragMVName="touchmove",this._dragEVName="touchend"):e.dataTransfer&&e.dataTransfer.setData&&e.dataTransfer.setData("text/plain"," "),this._firefoxDragPosition={x:0,y:0},document.ondragover=e=>{e=e||window.event,this._firefoxDragPosition.x=e.pageX,this._firefoxDragPosition.y=e.pageY},this._dragTarget.addEventListener(this._dragMVName,this._dragMV,!1),this._dragTarget.addEventListener(this._dragEVName,this._dragEV,!1))}_dragM(e){let t=e,n=null,i=null;window.TouchEvent&&e instanceof TouchEvent?(n=this._getTouchPosition(t),i=this._getTouchPositionRelative(t)):(n=this._getMousePosition(t),i=this._getMousePositionRelative(t)),n.x>0&&n.y>0&&this._move(n,i)}_dragE(e){let t=e;document.ondragover=null,this._firefoxDragPosition=null,this._dragTarget.removeEventListener(this._dragMVName,this._dragMV),this._dragTarget.removeEventListener(this._dragEVName,this._dragEV),window.TouchEvent&&e instanceof TouchEvent?this._onUp(this._getTouchPosition(t),this._getTouchPositionRelative(t),2):this._onUp(this._getMousePosition(t),this._getMousePositionRelative(t),1)}addEvents(e){this._events.forEach(t=>e.addEventListener(t,this,!1)),null===window||void 0===window||window.addEventListener("scroll",this,!1)}removeEvents(e){this._events.forEach(t=>e.removeEventListener(t,this,!1)),null===window||void 0===window||window.removeEventListener("scroll",this,!1)}_move2(e){if(this._lastTouchEvent&&e.timeStamp-this._lastTouchEvent.timeStamp<16)return;const t=e.touches[0],n=e.touches[1],i=t.pageX-n.pageX,s=t.pageY-n.pageY,o=Math.abs(i)+Math.abs(s);this._pinchDistance>-1&&(o>this._pinchDistance+MIN_DOLLY_DISTANCE?(this._setState(3),this.dispatchEvent(7,new InputEvent(this._getTouchPosition(e),this._getTouchPositionRelative(e)))):o<this._pinchDistance-MIN_DOLLY_DISTANCE?(this._setState(3),this.dispatchEvent(8,new InputEvent(this._getTouchPosition(e),this._getTouchPositionRelative(e)))):o<=this._pinchDistance+MIN_DOLLY_DISTANCE&&o>=this._pinchDistance-MIN_DOLLY_DISTANCE&&(this._setState(5),this.dispatchEvent(11,new InputEvent(this._getTouchPosition(e),this._getTouchPositionRelative(e))))),this._pinchDistance=o,this._lastTouchEvent=e}_setState(e){this._state=e}_move(e,t,n,i){void 0===n&&(n=0),void 0===this._dragEnabled&&(this._dragEnabled=!1),1===this._state&&this._canDrag(n)&&(this._delta=this._getDelta(e),(this._delta>MIN_MOVE_DISTANCE||this._elementHit)&&(this._setState(2),this._longClickTimer&&clearTimeout(this._longClickTimer),this.dispatchEvent(0,new InputEvent(this._downPosition,this._downPositionRelative)))),2===this._state&&this.dispatchEvent(1,new InputEvent(e,t)),this.dispatchEvent(6,new InputEvent(e,t,n,null,i))}_longClick(e){2!==e&&(this._setState(2),this._longClickTimer&&clearTimeout(this._longClickTimer),this.dispatchEvent(0,new InputEvent(this._downPosition,this._downPositionRelative)),this.dispatchEvent(1,new InputEvent(this._downPosition,this._downPositionRelative))),this.dispatchEvent(14,new InputEvent(this._downPosition,this._downPositionRelative,2))}_onUp(e,t,n){this.dispatchEvent(4,new InputEvent(e,t,n)),this._getDelta(e)<=MIN_MOVE_DISTANCE&&this.dispatchEvent(5,new InputEvent(e,t)),2===this._state&&this.dispatchEvent(2,new InputEvent(e,t)),4===this._state&&(this.dispatchEvent(10,new InputEvent(e,t)),this._rotationAngle=-1),3===this._state&&(this._pinchDistance=-1),this._lastTouchEvent=null,this._setState(0),this._dragTarget=null,this._elementHit=!1,this._longClickTimer&&clearTimeout(this._longClickTimer)}_getTouchPosition(e){if(e.touches.length){let{clientX:t,clientY:n}=e.touches[0];if(e.touches.length>1){const i=e.touches[1],s=i.clientX,o=i.clientY;t=(t+s)/2,n=(n+o)/2}return{x:t,y:n}}const t=e.changedTouches[0];return{x:t.clientX,y:t.clientY}}_getTouchPositionRelative(e){const t=this._getBoundingClientRect(),{clientWidth:n,clientHeight:i}=this._domHelper.element;if(e.touches.length){const{clientX:s,clientY:o}=e.touches[0];return{x:(s-t.left)/n*2-1,y:-(o-t.top)/i*2+1}}const s=e.changedTouches[0];return{x:(s.clientX-t.left)/n*2-1,y:-(s.clientY-t.top)/i*2+1}}_getMousePosition(e){if(0!==e.clientX&&0!==e.clientY)return{x:e.clientX,y:e.clientY};{let{x:t,y:n}=this._getFireFoxMousePosition(e);return{x:t,y:n}}}_getFireFoxMousePosition(e){let{x:t,y:n}=this._domHelper.getClientDimensions();return{x:t-(t+e.offsetX),y:n-(n+e.offsetY)}}_getMousePositionRelative(e){const t=this._getBoundingClientRect();return 0!==e.clientX&&0!==e.clientY?{x:(e.clientX-t.left)/this._domHelper.element.clientWidth*2-1,y:-(e.clientY-t.top)/this._domHelper.element.clientHeight*2+1}:this._firefoxDragPosition&&0!==this._firefoxDragPosition.x&&0!==this._firefoxDragPosition.y?{x:(this._firefoxDragPosition.x-t.left)/this._domHelper.element.clientWidth*2-1,y:-(this._firefoxDragPosition.y-t.top)/this._domHelper.element.clientHeight*2+1}:{x:0,y:0}}_getDelta(e){return Math.abs(this._downPosition.y-e.y)+Math.abs(this._downPosition.x-e.x)}setDragEnabled(e){this._dragEnabled=e}handleEvent(e){switch(e.type){case BROWSER_EVENTS.SCROLL:this._boundingClientRectInvalid=!0;break;case BROWSER_EVENTS.MOUSE_MOVE:this._onMouseMove(e);break;case BROWSER_EVENTS.DOUBLE_CLICK:this._onDoubleClick(e);break;case BROWSER_EVENTS.MOUSE_DOWN:this._onMouseDown(e);break;case BROWSER_EVENTS.MOUSE_UP:this._onMouseUp(e);break;case BROWSER_EVENTS.MOUSE_LEAVE:this._onMouseLeave(e);break;case BROWSER_EVENTS.MOUSE_ENTER:this._onMouseEnter(e);break;case BROWSER_EVENTS.MOUSE_WHEEL:this._onMouseWheel(e);break;case BROWSER_EVENTS.TOUCH_MOVE:this._onTouchMove(e);break;case BROWSER_EVENTS.TOUCH_START:this._onTouchStart(e);break;case BROWSER_EVENTS.TOUCH_END:this._onTouchEnd(e);break;case BROWSER_EVENTS.CONTEXT_MENU:this._onContextMenu(e)}}_onMouseDown(e){if(e.preventDefault(),2===e.detail)return;let{x:t,y:n}=this._getMousePosition(e);this._downPosition={x:t,y:n},this._downPositionRelative=this._getMousePositionRelative(e),this.dispatchEvent(3,new InputEvent({x:t,y:n},this._downPositionRelative,1)),this._setState(1)}_onMouseUp(e){e.preventDefault(),2!==e.detail&&this._onUp(this._getMousePosition(e),this._getMousePositionRelative(e),1)}_onMouseMove(e){e.preventDefault(),this._move(this._getMousePosition(e),this._getMousePositionRelative(e),1,e)}_onDoubleClick(e){e.preventDefault(),this.dispatchEvent(12,new InputEvent(this._getMousePosition(e),this._getMousePositionRelative(e),1))}_onMouseLeave(e){var t;this._delta=-1,(null===(t=e.relatedTarget)||void 0===t?void 0:t.closest('[data-rml-sdk="ignore-mouse-leave"]'))||this._onMouseUp(e)}_onMouseEnter(e){e.preventDefault()}_onMouseWheel(e){if(this._lastMouseWheelEvent&&e.timeStamp-this._lastMouseWheelEvent.timeStamp<40)return e.preventDefault(),void e.stopPropagation();e.deltaY<0?this.dispatchEvent(7,new InputEvent(this._getMousePosition(e),this._getMousePositionRelative(e),1,0,e)):this.dispatchEvent(8,new InputEvent(this._getMousePosition(e),this._getMousePositionRelative(e),1,0,e)),this._lastMouseWheelEvent=e}_onTouchMove(e){if(e.preventDefault(),!this._dragTarget)if(1===e.touches.length)this._move(this._getTouchPosition(e),this._getTouchPositionRelative(e),2);else if(2===e.touches.length)if(this._elementHit||4===this._state){const i=e.touches[0],s=e.touches[1],o=function(e){let t=toDegrees(e);return t<0&&(t=180+(180+t)),t}((t={x:i.pageX,y:i.pageY},n={x:s.pageX,y:s.pageY},Math.atan2(n.y-t.y,n.x-t.x)));this._rotationAngle<0&&(this._rotationAngle=o);const r=o-this._rotationAngle;this._rotationAngle=o,this.dispatchEvent(9,new InputEvent(this._getTouchPosition(e),this._getTouchPositionRelative(e),2,toRadiant(r))),this._setState(4)}else this._move2(e);var t,n}_onTouchStart(e){if(e.preventDefault(),1===e.touches.length){let{x:t,y:n}=this._getTouchPosition(e);this._downPosition={x:t,y:n},this._downPositionRelative=this._getTouchPositionRelative(e),this.dispatchEvent(3,new InputEvent({x:t,y:n},this._downPositionRelative,2)),this._setState(1),this._longClickTimer=window.setTimeout(this._longClick.bind(this,2),350)}else 2===e.touches.length&&(1!==this._state&&2!==this._state||this._onUp(this._getTouchPosition(e),this._getTouchPositionRelative(e),2),this._setState(3))}_onTouchEnd(e){e.preventDefault(),e.touches.length>1&&5===this._state||3===this._state||(this.dispatchEvent(13,new InputEvent(this._getTouchPosition(e),this._getTouchPositionRelative(e),2)),this._onUp(this._getTouchPosition(e),this._getTouchPositionRelative(e),2))}_onContextMenu(e){e.preventDefault()}_canDrag(e){return this._dragEnabled}onElementHit(){this._elementHit=!0}_getBoundingClientRect(){return this._boundingClientRectInvalid&&(this._boundingClientRect=this._domHelper.element.getBoundingClientRect(),this._boundingClientRectInvalid=!1),this._boundingClientRect}updateSize(){this._boundingClientRectInvalid=!0}}__decorate([inject],InputManager.prototype,"_domHelper",void 0);class SelectionHandlerEvent{constructor(e){const{component:t,resetCamera:n,consecutive:i}=e;this.component=t,this.resetCamera=void 0===n||n,this.consecutive=void 0===i||i}}const PROMISE_CALLBACKS=new Map,RESOURCES=new Map;class AsyncDependencyLoader{static loadFont(e){if(RESOURCES.has(e))return new Promise(t=>{t(RESOURCES.get(e))});if(PROMISE_CALLBACKS.has(e))return new Promise((t,n)=>{PROMISE_CALLBACKS.get(e).push({resolve:t,reject:n})});let t=new THREE.FontLoader;return new Promise((n,i)=>{PROMISE_CALLBACKS.set(e,[{resolve:n,reject:i}]),t.load(getAssetPath()+e,t=>{RESOURCES.set(e,t),AsyncDependencyLoader._resolveAll(e,t)})})}static _resolveAll(e,t){PROMISE_CALLBACKS.has(e)&&PROMISE_CALLBACKS.get(e).forEach(e=>e.resolve(t)),PROMISE_CALLBACKS.delete(e)}}class ComponentDimensioningHelper{constructor(e){this._activeComponents=[],this._componentDimensioningsExist=new Map,this._creator_=e}setCamera(e){this._camera=e}add(e){if(this._componentDimensioningsExist.has(e.runtimeId)&&!this._componentDimensioningsExist.get(e.runtimeId))return!1;const t=this._plannerKernelAccess.kernelInstance.getComponent(e.runtimeId),n=t.dimensionings;if(this._componentDimensioningsExist.set(e.runtimeId,n.length>0),!n||0===n.length||this._camera.position.z<0)return!1;const i=kernelBoxToThreeBox(t.boxForMeasurement),s={x:this._camera.position.x,y:this._camera.position.z};return import("./component-dimensioning-9f8009b8.js").then(t=>{AsyncDependencyLoader.loadFont("static/rubik_regular-bc008a7de2daee79.json").then(o=>{n.forEach(n=>{var r;e.add(new t.default(((r=n).from=r.from/1e3,r.to=r.to/1e3,1===r.type.value?(r.type={value:2},r.from*=-1,r.to*=-1):2===r.type.value&&(r.type={value:1}),r),i,o,s))})})}),this._activeComponents.push(e),!0}remove(e,t=!0){return new Promise(n=>{import("./component-dimensioning-9f8009b8.js").then(i=>{let s=[];e.children.forEach(e=>{e instanceof i.default&&s.push(e)}),s.forEach(t=>{e.remove(t),dispose(t)}),t&&removeItem(this._activeComponents,e),n()})})}hasComponentDimensions(){return this._activeComponents.length>0}async reset(){for(const e of this._activeComponents)await this.remove(e);this._activeComponents=[]}invalidateDimensioningsCache(e){e?this._componentDimensioningsExist.delete(e):this._componentDimensioningsExist.clear()}}__decorate([inject],ComponentDimensioningHelper.prototype,"_plannerKernelAccess",void 0);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,this._topView=!1;const t=convertToTHREE(e.getCenter());this._container=new THREE.Object3D,this._container.position.copy(t),this._boundingBox=this._generateBoundingBox(),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().getMeshCenter())),this._boundingBox&&this._updateBoundingBox()}_updateBoundingBox(){const e=this.getSize();this._boundingBox.geometry=new THREE.BoxGeometry(e.x,e.y,e.z),this._boundingBox.position.y=e.y/2}getPosition(){return this._container.position}getRotation(){return this._container.rotation.y}getBounds(){let e;return this.getPlanElement().boxForMeasurement?(e=kernelBoxToThreeBox(this.getPlanElement().boxForMeasurement),e.applyMatrix4(this.getContainer().matrix)):(e=new THREE.Box3,e.setFromObject(this._container)),e}getBoundingBox(){return this._boundingBox}getPlanElement(){return this._coreReference}setObject(e){this._object=e,this._objectWaiter.resolve(e)}getObject(){return this._object}async getObjectAsync(){return this._object?Promise.resolve(this._object):this._objectWaiter.create()}addMesh(e){this._object.add(e),this.hidePreviewBox()}getMesh(e){if(!this._object||0===this._object.children.length)return null;const t=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)}remove(){var e;null===(e=this._container.parent)||void 0===e||e.remove(this._container),this.clear()}hidePreviewBox(){this._container&&this._boundingBox&&(this._boundingBox.material=(boundingBoxMaterial||(boundingBoxMaterial=new THREE.MeshBasicMaterial,boundingBoxMaterial.visible=!1),boundingBoxMaterial))}_generateBoundingBox(){const e=this.getSize(),t=new THREE.BoxGeometry(e.x,e.y,e.z);let n=new THREE.Color("#DDDDDD");const i=this.getPlanElement().customColor;i>0&&(n=(e=>{let t=new THREE.Color;return t.setRGB((e>>16)/255,(e>>8&255)/255,(e>>0&255)/255),t})(i));let s=new THREE.MeshStandardMaterial({color:n,opacity:1,transparent:!0}),o=new THREE.Mesh(t,s);return o.name="bounding box",o.position.y=e.y/2,o.castShadow=!1,o.receiveShadow=!1,o.layers.set(6),o}select(){this._isSelected=!0,this._selectionMesh&&this._container.add(this._selectionMesh)}deselect(){this._isSelected=!1,this._selectionMesh&&this._container.remove(this._selectionMesh)}hoverOn(){}hoverOff(){}setPrimaryColor(e){this._primaryColor=e}setTopView(e){this._topView=e}}class PlanObjectViewModel extends PlanElementViewModel{constructor(e){super(e),this._initDone=!1,this._initFailed=null,this._initWaiter=new Waiter,this._container.rotation.y=e.rotation}finishInit(){return this._initDone=!0,this._initFailed=null,this._initWaiter.resolve()}failInit(e){return this._initFailed=e,this._initDone=!1,this._initWaiter.reject(this._initFailed)}isInitDone(){return this._initDone?Promise.resolve():this._initFailed?Promise.reject(this._initFailed):this._initWaiter.create()}getPlanObject(){return this.getPlanElement()}getSize(){return 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._rootComponentId=e.id,this._rootComponentRuntimeId=e.runtimeId,this._container.add(this.getObject())}getConfigurationRuntimeId(){return this.getPlanObject().getConfigurationRuntimeId()}getRootComponentId(){return this._rootComponentId}getRootComponentRuntimeId(){return this._rootComponentRuntimeId}finishConstruction(){return this.finishInit()}failConstruction(){return this.failInit(new Error("Construction of configuration failed"))}}var defaultSettings={isProduction:!0,isUnitTesting:!1,environment:"production",detailEnvironment:"development",features:{},APP:{RAPI:{server:"/api/v2",localReverseProxy:"https://www.roomle.com/api/v2",liveServer:"https://www.roomle.com/api/v2",testServer:"https://www.test.roomle.com/api/v2",headers:{apiKey:"roomle_portal_v2",currentTenant:9,locale:"en",language:"en",device:1,token:"anonymous",platform:"web"},itemHeaders:{assetRevision:"glb",assetFileFormat:"glb"}},SHORTENER_URL:"http://rml.co/"},environments:{PRODUCTION:"production",DEVELOPMENT:"development",TEST:"test",TEST_SERVER:"test_server",ALPHA:"alpha"}};"undefined"!=typeof module&&module.exports||(window.IS_DEBUG=!0),function(e=!1){if(e){let e=JSON.parse(JSON.stringify(defaultSettings));e.APP,e.features}}();var Env=JSON.parse(JSON.stringify(defaultSettings));class StaticPlanObjectViewModel extends PlanObjectViewModel{constructor(e){super(e),this._originalSize=new THREE.Vector3,this._container.name="Static "+this._container.name}setRapiItem(e){return this._rapiItem?Promise.resolve():this._addStaticItem(e)}async _addStaticItem(e){this._rapiItem=e;let t=this.getPlanObject();if(this._glbUrl=getGlbUrl(e),!this._glbUrl)return Promise.reject("No glb url found");let n=e.scaleable?convertToThreeDimensions(t.size):void 0,i=new THREE.Vector3(1,1,1);t.flipX&&(i.x*=-1),t.flipY&&(i.z*=-1);try{const s=await this._staticItemLoader.loadGLB(this._glbUrl,void 0,void 0,n,i,t.customColor,e.colorable);this._originalSize.copy(s.boundingBox.getSize(new THREE.Vector3)),s.scene.name=e.label,this.setObject(s.scene),((e,t)=>{let n=(new THREE.Box3).setFromObject(e),i=n.getSize(new THREE.Vector3),s=Math.min(i.x,i.y,i.z),o=!0;s>5&&(console.warn("GLB seems to be too big ("+s+")",t),o=!1),n.min.y<-.01&&(console.warn("GLB seems to be under the floor ("+n.min.y+"): ",t),o=!1)})(s.scene,this._glbUrl),fadeIn(s.scene),this._container.add(this.getObject()),this.hidePreviewBox(),await this.finishInit()}catch(e){await this.failInit(e)}}getRapiItem(){return this._rapiItem}needsRapiItem(){return!this._glbUrl}getGLBUrl(){return this._glbUrl}update(){const e=convertToThreeDimensions(this.getPlanElement().size),t=this.getObject();if(!t)return;if(e){const{x:n,y:i,z:s}=this._originalSize;let o=new THREE.Vector3(e.x/n,e.y/i,e.z/s);t.scale.copy(o)}this.getPlanElement().flipX&&(t.scale.x*=-1),this.getPlanElement().flipY&&(t.scale.z*=-1);const n=this.getPlanElement().customColor;t.traverse(e=>{if(e instanceof THREE.Mesh&&e.material instanceof THREE.MeshStandardMaterial){const t=e.material;if(this._rapiItem.colorable&&n&&n>0){let e=new THREE.Color(n);t.color=e.copyGammaToLinear(e)}t.needsUpdate=!0}}),super.update()}}__decorate([inject],StaticPlanObjectViewModel.prototype,"_staticItemLoader",void 0);const wallDimensionToTransferable=e=>{const{id:t,textRotation:n,length:i,lengthFormatted:s}=e;return{id:t,fromPosition3d:threeVectorToTransferableXYZ(e.fromPosition3d),toPosition3d:threeVectorToTransferableXYZ(e.toPosition3d),textPosition3d:threeVectorToTransferableXYZ(e.textPosition3d),fromPosition2d:threeVectorToTransferableXY(e.fromPosition2d),toPosition2d:threeVectorToTransferableXY(e.toPosition2d),textPosition2d:threeVectorToTransferableXY(e.textPosition2d),textDirection:threeVectorToTransferableXYZ(e.textDirection),textRotation:n,length:i,lengthFormatted:s}};let WALL_TOP_VIEW_MATERIAL;const getTopViewMaterial=()=>(WALL_TOP_VIEW_MATERIAL||(WALL_TOP_VIEW_MATERIAL=new THREE.MeshPhysicalMaterial({color:0})),WALL_TOP_VIEW_MATERIAL);class WallPlanElementViewModel extends PlanElementViewModel{constructor(e){super(e),this._container.name="Wall Plan Element"}get isSelected(){return this._isSelected}getWallDimension(e){const t=this.getPlanElement(),n=convertToTHREE(t.getCenter()),i=t.getPreferredSide();let s,o;0===i.value?(s=convertToTHREE(t.getCornerFromLeft()),o=convertToTHREE(t.getCornerToLeft())):1===i.value&&(s=convertToTHREE(t.getCornerFromRight()),o=convertToTHREE(t.getCornerToRight()));const r=s.clone().add(o).divideScalar(2),a=s.clone().sub(o),l=a.clone().cross(new THREE.Vector3(0,1,0)).normalize();l.clone().dot(r.clone().sub(n))<0&&l.multiplyScalar(-1);const c=transformRange(e,.5,0,.17,.2),h=l.multiplyScalar(c),d=s.add(h),u=o.add(h),_=a.clone();a.dot(new THREE.Vector3(1,0,0))<0&&_.multiplyScalar(-1);const p=Math.atan2(_.z,_.x),m=d.clone().add(u).divideScalar(2);return{id:t.getId(),fromPosition3d:d,toPosition3d:u,textPosition3d:m,textDirection:_,textRotation:p,length:t.getLength(i.value)}}addMesh(e){e.traverse(e=>{this._setMaterial(e)}),e.layers.set(9),super.addMesh(e);const t=(new THREE.Box3).setFromObject(this.getObject()).getSize(new THREE.Vector3);this._boundingBox.geometry=new THREE.BoxGeometry(t.x,t.y,t.z),this._boundingBox.position.y=t.y/2}show(){var e,t;this.getContainer().visible=!0,null===(e=this.getObject())||void 0===e||e.traverse(e=>{e.layers.set(9)}),null===(t=this.getBoundingBox())||void 0===t||t.layers.set(6)}hide(){var e,t;this.getContainer().visible=!1,null===(e=this.getObject())||void 0===e||e.traverse(e=>{e.layers.disableAll()}),null===(t=this.getBoundingBox())||void 0===t||t.layers.disableAll()}_enableTopView(){this._container.traverse(e=>{this._setTopMaterial(e)})}_setTopMaterial(e){e instanceof THREE.Mesh&&!e.userData.originalMaterial&&e.material&&e!==this._boundingBox&&(e.userData.originalMaterial=e.material,e.material=getTopViewMaterial())}_disableTopView(){this._container.traverse(e=>{e instanceof THREE.Mesh&&e.userData.originalMaterial&&(e.material=e.userData.originalMaterial,delete e.userData.originalMaterial)})}setTopView(e){super.setTopView(e),e?this._enableTopView():this._disableTopView()}getKernelObject(){return super.getKernelObject()}_setMaterial(e){e instanceof THREE.Mesh&&e.material&&e!==this._boundingBox&&(e.userData.originalMaterial||(e.userData.originalMaterial=e.material),this._topView&&this._isSelected?e.material=new THREE.MeshBasicMaterial({color:10526880,side:THREE.DoubleSide}):this._topView&&!this._isSelected?e.material=getTopViewMaterial():(e.material=e.userData.originalMaterial,delete e.userData.originalMaterial))}select(){super.select(),this._container.traverse(e=>{this._setMaterial(e)})}deselect(){super.deselect(),this._container.traverse(e=>{this._setMaterial(e)})}}class FloorPlanElementViewModel extends PlanElementViewModel{constructor(e){super(e),this._container.name="Floor Plan Element"}addMesh(e){this.getObject().clear(),super.addMesh(e),e.layers.set(9),e.castShadow=!1}}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)}}const META_INFO=new Map;class Benchmark{static start(e){if(!window.performance||!window.performance.getEntriesByName)return"";let t=window.performance.getEntriesByName(e).length++,n="";t<100&&(n="0"),t<10&&(n="0"+n);const i=t>0?e+"_"+n+t:e,s=i+"_start";return window.performance.mark(s),i}static addMeta(e,t){const n=Benchmark.getMeta(e);META_INFO.set(e,Object.assign(n,t))}static getMeta(e){return META_INFO.get(e)||{}}static end(e){}static getMeasure(e){return[]}static showBenchmarks(e){const t=window.performance.getEntriesByType("measure");t.sort((function(e,t){return e.startTime-t.startTime}));const n=[];for(let i=0,s=t.length;i<s;i++){const s=t[i];e&&-1===s.name.indexOf(e)||n.push({Start:parseFloat(s.startTime.toFixed(2)),Name:s.name,Duration:parseFloat(s.duration.toFixed(2))})}console.table(n)}}class AppContext{static init(e={}){const{kernelInstance:t,kernelContainer:n,planObjectId:i}=e;AppContext.kernelInstance=t,AppContext.kernelContainer=n,AppContext.planObjectId=i}static cleanUp(){AppContext.useHDGeometry=!1,AppContext.kernelInstance=null,AppContext.kernelContainer=null,AppContext.planObjectId=null}}AppContext.useHDGeometry=!1,AppContext.kernelInstance=null,AppContext.kernelContainer=null,AppContext.planObjectId=null;const WAITERS=new Map,_endOperation=function(e,t,n){let i=WAITERS.get(e);if(i){const s=n?[n]:void 0;i.forEach(({resolve:e,reject:n})=>t?e.apply(e,s):n.apply(n,s)),WAITERS.delete(e)}};class AsyncHelper{static finishOperation(e,t){_endOperation(e,!0,t)}static failOperation(e,t){_endOperation(e,!1,t)}static waitFor(e,t){return new Promise((n,i)=>{let s=WAITERS.get(e);s||(WAITERS.set(e,[]),s=WAITERS.get(e)),s.push({resolve:n,reject:i}),"function"==typeof t&&t.apply(t)})}}const isRange=function(e){return e.validRange&&"string"==typeof e.validRange.type},isOptions=function(e){return e.validValues&&e.validValues.length>0},isMaterial=function(e){return"Material"===e.type};let MEM_URL,WASM_URL,WASM_LOADER,ASM_LOADER,CACHE_COMPILATION;const KERNEL_PATHS={WASM:{CONFIGURATOR:{URL:"static/ConfiguratorKernel-310ba00d200a8545.wasm",LOADER:"static/ConfiguratorKernel-7096080bf4b9000d.js"},PLANNER:{URL:"static/RoomleCore-4786ec5282f5b33e.wasm",LOADER:"static/RoomleCore-5d974f97607414ba.js"}},ASM:{CONFIGURATOR:{MEM_URL:"static/ConfiguratorKernelJs-5b42a6fd73f68a93.mem",LOADER:"static/ConfiguratorKernelJs-a8b57304eef356ee.js"},PLANNER:{MEM_URL:"static/RoomleCoreJs-e3c865faff71cf27.mem",LOADER:"static/RoomleCoreJs-76b8a01b07b0a763.js"}}},USE_WASM=!!window.WebAssembly;class CommonKernelAccess{_utilityToLongArray(e){const t=new this._kernelContainer.LongArray;return e.forEach(e=>t.push_back(e)),t}constructor(e){this._requestedItemIds=[],this._requestedMaterialIds=[],this._configuratorKernelCallbackListener=new Set,this._cachedGroupIds=[],this._waitingForGroups=!1,this._subComponentsWaiters=new Map,this._shouldWait=!0,this._creator_=e,window.KernelCallback={isReady:this.isReady.bind(this)},this._lifeCycleManager.addEventListener(this)}init(e){this._kernelType=e,this._setupKernelPaths(e),this._setupEmsModule(e),this._useWASM=USE_WASM,this._kernelPath=USE_WASM?WASM_LOADER:ASM_LOADER}_initKernel(){const{restrictionLevel:e}=this._initData;this._kernelInstance.setLevel(e),this._unitFormatter.init(this._kernelContainer),this._kernelInstance.setEnvironmentVariable("unit",this._unitFormatter._actualUnitString||"cm"),this._kernelInstance.setEnvironmentVariable("unitString","short"),this._kernelInstance.useEnvironmentGeometry(1===this._kernelType);const{overrideCountry:t,locale:n}=this._globalInitData;t&&(this._kernelInstance.resetPriceListIds(),this._kernelInstance.addPriceList(t)),this._kernelInstance.setEnvironmentVariable("language",n)}get kernelContainer(){return this._kernelContainer}get kernelInstance(){return this._kernelInstance}_setupKernelPaths(e){const t=0===e?"PLANNER":"CONFIGURATOR";MEM_URL=KERNEL_PATHS.ASM[t].MEM_URL,WASM_URL=KERNEL_PATHS.WASM[t].URL,WASM_LOADER=KERNEL_PATHS.WASM[t].LOADER,ASM_LOADER=KERNEL_PATHS.ASM[t].LOADER,CACHE_COMPILATION=!0}_setupEmsModule(e){const t=this;this._kernelContainer={locateFile(t){const n=0===e?/RoomleCoreJs[\-a-z0-9]*\.js\.mem/:/ConfiguratorKernelJs[\-a-z0-9]*\.js\.mem/;return t.match(n)?getAssetPath()+MEM_URL:t},wasmBinaryFile:getAssetPath()+WASM_URL,preRun:[],postRun:[],setStatus:null,print(e){t._kernelIo.log(e)},printErr(e){t._kernelIo.error(e)},quit(e){0!==e&&t._kernelIo.throw(e&&e.toString?e.toString():"Unknown error while C/C++ main executes")}},CACHE_COMPILATION&&USE_WASM&&(this._kernelContainer.instantiateWasm=function(e,t){return((e,t,n)=>{const i="function"==typeof WebAssembly.instantiateStreaming;Benchmark.addMeta("kernel_is_ready",{cachedInIndexedDB:!1});let s=null;i?(Benchmark.start("kernel_stream_compile"),s=WebAssembly.instantiateStreaming(fetch(getAssetPath()+e),t),Benchmark.end("kernel_stream_compile")):(Benchmark.start("kernel_legacy_compile"),s=fetch(getAssetPath()+e).then(e=>e.arrayBuffer()).then(e=>WebAssembly.instantiate(e,t))),Benchmark.addMeta("kernel_is_ready",{instantiateStreaming:i}),s.then(e=>{Benchmark.end(i?"kernel_stream_compile":"kernel_legacy_compile"),n(e.instance)},e=>console.error(e))})(WASM_URL,e,t),{}})}_passSubComponentsToKernel(e,t){const n=e.id,i=t.get(n);if(i)for(let t=0,s=i.length;t<s;t++){const{parentId:s,partId:o}=i[t];this._kernelIo.setMeta({componentId:n}),this._kernelInstance.loadedSubComponent(s,o,n,e.configuration)}}_fetchSubComponents(e){let t=[...e.keys()];t.length&&this._rapiAccess.getComponents(t).then(t=>{for(let n=0,i=t.length;n<i;n++)this._passSubComponentsToKernel(t[n],e);this._flushSubComponentsWaiters()})}_flushSubComponentsWaiters(){this._fetchSubComponents(this._subComponentsWaiters),this._subComponentsWaiters=new Map,this._shouldWait=!1}isReady(){this._kernelContainer.setExternalHelpers(this._kernelIo,{convertCObject}),Env.isProduction||Env.isUnitTesting||this.addDebugInfo(),window.KernelCallback&&(window.KernelCallback=null,delete window.KernelCallback)}addDebugInfo(){const e=function(t,n=[]){const i=Object.getPrototypeOf(t),s=i?Object.getOwnPropertyNames(i):[],o=t?Object.getOwnPropertyNames(t):[];return i?e(i,[...n,...o,...s]):[...o,...s,...n]},t=e(this),n=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toString","valueOf"];[...new Set(t)].forEach(e=>{if(!e.startsWith("_")&&"function"==typeof this[e]&&-1===n.indexOf(e))try{const t=this[e].bind(this);this[e]=function(...n){return this._kernelIo.log("[ KernelCommunication ]: "+e),t(...n)}}catch(e){}})}getConfigurationData(e){return new Promise(t=>{var n;const i=this.kernelInstance.getPlanObject(e),s=(new Date).toISOString(),o=this.kernelInstance.getComponentId(e),r=getCatalogIdFromItemOrConfigurationId(o),a=(null===(n=i.boxForMeasurement)||void 0===n?void 0:n.size)||i.bounds;t({created:s,lastAccess:s,configuration:this.kernelInstance.getSerializedConfiguration(e),configurationHash:this.kernelInstance.getHashOfConfiguration(e),parts:JSON.stringify(this.kernelInstance.getPartList(e)),rootComponentId:o,width:a.x,height:a.z,depth:a.y,catalog:r,orderable:!1,requestable:!1})})}loadComponent(e,t,n){this._rapiAccess.getComponent(t.componentId).then(i=>{var s;let o=i.configuration;o||(o="error",null===(s=this._configuratorUiCallbacks)||void 0===s||s.onContentProblem({rapiPath:"components",ids:[t.componentId],message:t.componentId+" has no configuration"})),this._kernelIo.setMeta({componentId:t.componentId}),this._kernelInstance.loadComponent(e,o,t,n),this._flushSubComponentsWaiters()},i=>{var s;this._kernelInstance.loadComponent(e,"error",t,n),this.onLoadComponentError(i,t.componentId),null===(s=this._configuratorUiCallbacks)||void 0===s||s.onError(new Error(`Component with id "${t.componentId}" can not be loaded. "${i}"`)),this._flushSubComponentsWaiters()})}loadSubComponent(e,t,n){if(this._shouldWait){let i=this._subComponentsWaiters.get(n);i||this._subComponentsWaiters.set(n,[]),i=this._subComponentsWaiters.get(n),i.push({parentId:e,partId:t}),this._subComponentsWaiters.set(n,i)}else this._rapiAccess.getComponent(n).then(i=>{var s;let o=i.configuration;o||(o="error",null===(s=this._configuratorUiCallbacks)||void 0===s||s.onContentProblem({rapiPath:"components",ids:[n],message:"SubComponent "+n+" has no configuration"})),this._kernelIo.setMeta({componentId:n,parentId:e}),this._kernelInstance.loadedSubComponent(e,t,n,o)})}async loadItemConfigurations(e,t){let n=Array.isArray(t)?t:[t];if(this._requestedItemIds.push(...n),await wait(0),!this._requestedItemIds.length)return;const i=[...this._requestedItemIds];this._requestedItemIds=[],(await this._rapiAccess.getItems(i)).forEach(t=>{this._kernelInstance.loadedItemConfiguration(e,t.id,t.configuration)})}requestDeleteComponent(e){var t,n;e&&((null===(n=null===(t=this._initData)||void 0===t?void 0:t.featureFlags)||void 0===n?void 0:n.reDock)?this._kernelInstance.deletePlanComponent(e):this._kernelInstance.deleteComponent(e))}dockComponentWithPosition(e,t,n,i,s){var o;this._kernelInstance.dockComponentWithPosition(n,i,e,t,s);const r=this._kernelInstance.getComponentId(n),a=this._kernelInstance.getComponentId(e);null===(o=this._configuratorUiCallbacks)||void 0===o||o.onUserInitiatedDockDone(r,i,a,t,s)}Editor3dAddBakedMesh(e,t,n,i,s,o,r,a){this._configuratorKernelCallbackListener.forEach(l=>l.Editor3dAddBakedMesh(e,t,n,i,s,o,r,a))}Editor3dAddNamedMesh(e,t,n,i,s,o,r,a,l,c,h,d){this._configuratorKernelCallbackListener.forEach(u=>u.Editor3dAddNamedMesh(e,t,n,i,s,o,r,a,l,c,h,d))}Editor3ChangedNamedMesh(e,t,n,i,s,o,r){this._configuratorKernelCallbackListener.forEach(a=>a.Editor3ChangedNamedMesh(e,t,n,i,s,o,r))}Editor3dRemoveNamedMesh(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.Editor3dRemoveNamedMesh(e,t))}Editor3dBeginConstruction(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.Editor3dBeginConstruction(e,t))}Editor3dEndConstruction(e){this._configuratorKernelCallbackListener.forEach(t=>t.Editor3dEndConstruction(e))}Editor3dComponentCreated(e,t,n,i){this._configuratorKernelCallbackListener.forEach(s=>s.Editor3dComponentCreated(e,t,n,i,!1))}Editor3dComponentDocked(e,t,n,i){this._configuratorKernelCallbackListener.forEach(s=>s.Editor3dComponentDocked(e,t,n,i))}Editor3dGeometryReady(e){this._configuratorKernelCallbackListener.forEach(t=>t.Editor3dGeometryReady(e)),this.requestPlanComponentConstruction(e)}Editor3dGeometryNotReady(e){this._configuratorKernelCallbackListener.forEach(t=>t.Editor3dGeometryNotReady(e))}componentDeleted(e){this._configuratorKernelCallbackListener.forEach(t=>t.componentDeleted(e))}componentMetaUpdated(e){let t=this._kernelInstance.getComponent(e);this._configuratorKernelCallbackListener.forEach(e=>e.componentMetaUpdated(t))}sceneCleared(){this._configuratorKernelCallbackListener.forEach(e=>e.sceneCleared())}requestMaterialsInGroup(e){(Array.isArray(e)?e:[e]).forEach(e=>{-1===this._cachedGroupIds.indexOf(e)&&this._cachedGroupIds.push(e)}),this._waitingForGroups||(this._waitingForGroups=!0,AsyncHelper.waitFor(4).then(()=>{this._rapiAccess.getMaterialsByGroup(this._cachedGroupIds).then(e=>{let t=[];e.forEach(e=>{const n=[];e.materials.forEach(e=>n.push(e.id));const i=e.legacyId||e.id;e.legacyId||console.warn("Material group has no legacy id, please check content why this is the case"),t.push({group:i,materials:n})}),t.length&&this._kernelInstance.setMaterialsInGroup(t),this._cachedGroupIds=[]},e=>{var t;console.error(e),null===(t=this._configuratorUiCallbacks)||void 0===t||t.onError(new Error(`Material group with ids "${this._cachedGroupIds.join(",")}" can not be loaded. "${e}"`)),this._cachedGroupIds=[]})}))}requestPlanComponentConstruction(e,t=!0){t?this._kernelInstance.requestDeltaPlanComponentConstruction(e):this._kernelInstance.requestPlanComponentConstruction(e)}addConfiguratorListener(e){this._configuratorKernelCallbackListener.add(e)}removeConfiguratorListener(e){this._configuratorKernelCallbackListener.delete(e)}cleanUpCallbacks(){"function"==typeof this._kernelContainer.unregisterConfiguratorCallback&&this._kernelContainer.unregisterConfiguratorCallback(this)}async requestMaterialProperties(e){let t=Array.isArray(e)?e:[e];if(this._requestedMaterialIds.push(...t),await wait(0),!this._requestedMaterialIds.length)return;const n=[...this._requestedMaterialIds];this._requestedMaterialIds=[];const i=await this._rapiAccess.getMaterials(n);let s=[];i.forEach(e=>{const t=new this._kernelContainer.StringStringMap,n=e.properties||{};for(let e in n)n.hasOwnProperty(e)&&t.set(e,n[e]);t.size()&&s.push({id:e.id,properties:t})}),s.length&&this._kernelInstance.setMaterialProperties(s)}registerCallbacks(){this._kernelContainer.registerConfiguratorCallback(this)}pause(){this.cleanUpCallbacks()}resume(){this.cleanUpCallbacks(),this.registerCallbacks()}destroy(){}_handleCortoMesh(e,t,n){var i;try{this._kernelInstance.addMeshCorto(t,n,new Uint8Array(e))}catch(e){console.error(e),null===(i=this._configuratorUiCallbacks)||void 0===i||i.onMemoryCorruption()}}calcPartsPriceSum(e){return this._calcPrice(e)}_calcPrice(e){const t=new Map;e||(e=this._kernelInstance.getFullPartList());const n=!!e&&!!e.fullList&&!!e.fullList.length;if(this._initData.useRoomlePrice&&n){const n=e.fullList[0].currencySymbol,i=e.fullList.reduce((e,t)=>e+(t.count?t.count:0)*(t.price?t.price:0),0),s=roundWithPrecision(i,2);return this._configuratorUiCallbacks.onUpdatePrice(n,s),Promise.resolve({totalSum:s,partMap:t})}if(this._initData.usePriceService&&n){const n=e.fullList.reduce((e,n)=>{const i=kernelPartToPriceId(n);return i&&(t.set(i,n),e.push(i)),e},[]);return new Promise((i,s)=>{this._rapiAccess.getPrices(n).then(n=>{if(!n.length)return s(new Error("prices are empty"));let o=0;const r=objectArrayToMap(n,"priceId");for(const t of e.fullList){const e=kernelPartToPriceId(t);if(!r.has(e)){console.warn("PriceId: "+e+" has no corresponding kernel-part");continue}const{price:n,currencySymbol:i}=r.get(e);t.price=n,t.currencySymbol=i,o+=n*t.count}return o=roundWithPrecision(o,2),this._configuratorUiCallbacks.onUpdatePrice(n[0].currencySymbol,o),i({totalSum:o,partMap:t})},e=>{console.error(e),s(e)})})}return Promise.resolve({totalSum:0,partMap:t})}async addUiDataAndPriceToPartList(e,t){const{fullList:n,originPart:i}=e,s=e.perMainComponent;let o;this.addUiDataToPartList(n,t);try{const t=await this._calcPrice(e);o=t.partMap}catch(e){console.error(e),o=new Map}const r=this._initData.usePriceService||this._initData.useRoomlePrice,a=e=>{r||(e.price=null,e.currencySymbol=null);const t=kernelPartToPriceId(e);if(!t)return;if(!o.has(t))return;const{price:n,currencySymbol:i}=o.get(t);"number"==typeof n&&(e.price=n,e.currencySymbol=i)};return n.forEach(a),s.forEach(({fullList:e,perMainComponent:n})=>{n.length>0&&console.error("Not implemented! perMainComponent is deeper than one level"),this.addUiDataToPartList(e,t),e.forEach(a)}),{fullList:n,perMainComponent:s,originPart:i}}addUiDataToPartList(e,t){const n=[];return e.forEach(e=>{const t=this._rapiAccess.peekComponent(e.componentId);!t||e.labelIsCalculated&&e.label||(e.label=t.label),e.parameters.forEach(e=>{if(this._unitFormatter.formatPartListParameter(e),isMaterial(e)){const t=this._rapiAccess.peekMaterial(e.value);t?e.valueLabel=t.label||t.name||e.value:-1===n.indexOf(e.value)&&n.push(e.value)}})}),n.length&&this._rapiAccess.getMaterials(n).then(e=>{const n=this._lastPartListHash!==t;Array.isArray(e)&&e.length&&n&&(this._lastPartListHash=t,this.requestPartListAndUpdatePricesOfParts())}),e}async requestPartListAndUpdatePricesOfParts(e,t){let n=this._kernelInstance.getFullPartList();e||(e=this._kernelInstance.getHashOfConfiguration(this._configuratorContext.planObjectId));const i=await this.addUiDataAndPriceToPartList(n,e);this._configuratorUiCallbacks.onPartListUpdate(i,btoa(e))}}__decorate([inject],CommonKernelAccess.prototype,"_rapiAccess",void 0),__decorate([inject],CommonKernelAccess.prototype,"_scriptLoader",void 0),__decorate([inject],CommonKernelAccess.prototype,"_kernelIo",void 0),__decorate([inject],CommonKernelAccess.prototype,"_dataSyncer",void 0),__decorate([inject],CommonKernelAccess.prototype,"_lifeCycleManager",void 0),__decorate([inject],CommonKernelAccess.prototype,"_configuratorUiCallbacks",void 0),__decorate([inject],CommonKernelAccess.prototype,"_globalCallback",void 0),__decorate([inject],CommonKernelAccess.prototype,"_initData",void 0),__decorate([inject],CommonKernelAccess.prototype,"_unitFormatter",void 0),__decorate([inject],CommonKernelAccess.prototype,"_configuratorContext",void 0),__decorate([inject],CommonKernelAccess.prototype,"_globalInitData",void 0);const{APP:APP$1}=Env,{RAPI}=APP$1,headers=RAPI.headers,itemHeaders=RAPI.itemHeaders,TOKEN_IDENTIFIER=headers.token,isPlanSnapshotId=e=>e.startsWith("ps_"),LEGACY_GROUP_INDICATOR=uuid();let RAPI_MATERIAL_GROUP_CACHE=new Map,ITEM_ADDITIONAL_CONTENT_CACHE=new Map,RAPI_RELATIONS_CACHE=new Map,RAPI_CACHE=new Map,MESHES_TO_CATALOG_CACHE=new Map,RAPI_PACKAGE_CACHE=new Map,RAPI_PRELOAD_CACHE=new Map,WAITERS_FOR_URL=new Map,RAPI_ERROR_CACHE=new Map;const getCachedMaterialGroup=e=>RAPI_MATERIAL_GROUP_CACHE.get(e)||RAPI_MATERIAL_GROUP_CACHE.get(LEGACY_GROUP_INDICATOR+e),hasMaterialTags=e=>e&&e.tags&&e.tags.length,materialHasNoTagsButGroup=e=>!hasMaterialTags(e)&&e.group;class RapiAccess{constructor(e){this._itemLoaded=!1,this._currentToken=null,this._creator_=e,window.addEventListener("online",this._flushOfflineQueue.bind(this))}getPreloadForItem(e){return this._getPreload(e,!0)}getPreloadForConfiguration(e){return this._getPreload(e,!1)}_getPreload(e,t){return new Promise((n,i)=>{if(!navigator.onLine)return n();if(this._dataSyncer.getIsCatalogSynced(getCatalogIdFromItemOrConfigurationId(e)))return n();if(RAPI_PRELOAD_CACHE.get(e))return n();const s=t?"?itemId=":"?configurationId=";this._get("/preloads/components/"+s+e,"preloads/components").then(t=>{if(RAPI_PRELOAD_CACHE.get(e))return n();t.forEach(e=>{this._prepareData(e,"components")}),RAPI_PRELOAD_CACHE.set(e,!0),n()},i)})}changeUseOfHDGeometry(){const e=RAPI_CACHE.get("components");RAPI_PRELOAD_CACHE.clear(),RAPI_PACKAGE_CACHE.clear(),e&&RAPI_CACHE.delete("components")}getHSCPackage(e){return new Promise((t,n)=>{if(RAPI_PACKAGE_CACHE.get(e))return t();this._get("/catalogs/"+e+"/package","package").then(n=>{if(RAPI_PACKAGE_CACHE.get(e))return t(n);n.components.forEach(e=>{this._prepareData(e,"components")}),n.materials.forEach(e=>{this._prepareData(e,"materials"),this._prepareGroups(e)}),n.textures.forEach(e=>{this._prepareData(e,"textures")}),RAPI_PACKAGE_CACHE.set(e,!0),t(n)},n)})}getComponent(e){return this._getById(e,"components")}getConfiguration(e){return this._getById(e,"configurations")}getConfigurations(e){return this._getByIds(e,"configurations")}getItem(e){return this._getById(e,"items",{additionalHeaders:itemHeaders})}getComponents(e){return this._getByIds(e,"components")}getItems(e){return this._getByIds(e,"items",{additionalHeaders:itemHeaders})}getTag(e){return this._getById(e,"tags")}getTags(e){return this._getByIds(e,"tags")}getTexture(e){return this._getById(e,"textures")}getCatalog(e){return this._getById(e,"catalogs")}getMesh(e,t="crt",n=50){return this._getById(e,"meshes",{pathSuffix:"/data?format="+t+"&targetQuality="+n.toString()})}getMeshesOfCatalog(e){return new Promise((t,n)=>{const i=MESHES_TO_CATALOG_CACHE.get(e);i?t(i):this._get("/meshes?catalog="+e,"catalogMeshes").then(n=>{MESHES_TO_CATALOG_CACHE.set(e,n),t(n)},n)})}getTexturesOf(e){return this._getRelationData(e,{rapiPath:"textures"})}getItemsOf(e){return this._getRelationData(e,{rapiPath:"items"})}async getMaterialsOf(e){return(await this._getRelationData(e,{rapiPath:"materials"},{embed:["textures"]})).filter(e=>e.active)}getComponentsOf(e){return this._getRelationData(e,{rapiPath:"components"})}getAdditionalContentsOfItems(e){const t=[],n=[];return e.forEach(e=>{const i=ITEM_ADDITIONAL_CONTENT_CACHE.get(e.id.toString());i?n.push(...i):t.push(e.id.toString())}),new Promise((e,i)=>{0!==t.length?this._getByIdsPackets(t,"itemAdditionalContents",{filterKey:"itemIds"}).then(t=>{t.forEach(e=>{let t=ITEM_ADDITIONAL_CONTENT_CACHE.get(e.itemId);t||(t=[]);for(let n=0,i=t.length;n<i;n++)if(t[n].id===e.id)return;t.push(e),ITEM_ADDITIONAL_CONTENT_CACHE.set(e.itemId,t)}),e([...t,...n])},i):e(n)})}getMaterial(e){return this._getById(e,"materials",{embed:["textures"]})}peekMaterial(e){return this._peekData(e,"materials")}peekComponent(e){return this._peekData(e,"components")}peekItem(e){return this._peekData(e,"items")}peekConfiguration(e){return this._peekData(e,"configurations")}async getMaterials(e){return(await this._getByIds(e,"materials",{embed:["textures"]})).filter(e=>e.active)}getPlan(e){return this._getById(e,"plans")}getPlanSnapshot(e){return this._getById(e,"planSnapshots")}static clearCaches(){RAPI_MATERIAL_GROUP_CACHE=new Map,RAPI_RELATIONS_CACHE=new Map,RAPI_CACHE=new Map,RAPI_PACKAGE_CACHE=new Map,RAPI_PRELOAD_CACHE=new Map,WAITERS_FOR_URL=new Map,ITEM_ADDITIONAL_CONTENT_CACHE=new Map}cleanUp(){RapiAccess.clearCaches()}getMaterialsByGroup(e){const t=e.slice(),n=[];let i=t.length;for(let e=0;e<i;e++){const s=getCachedMaterialGroup(t[e]);if(s){const o=s.length;for(let e=0;e<o;e++){const t=this._getCache("materials").get(s[e]);n.push(t)}t.splice(e,1),i--,e--}}return new Promise((e,i)=>{0!==t.length&&navigator.onLine?this._getByIdsPackets(t,"materials",{filterKey:"groups",embed:["textures"]}).then(t=>{e(this.combineMaterialsToGroups([...t,...n]))},i):e(this.combineMaterialsToGroups(n))})}_flushOfflineQueue(){return new Promise((e,t)=>{const n=this._localStorage.getItem("hsc_configurations_offline_queue_v1"),i=[];for(let e in n)if(n.hasOwnProperty(e)){const t=n[e];i.push(new Promise((e,n)=>{this.saveConfiguration(t.data).then(i=>{const s=[];t.perspectiveImage&&!i.perspectiveImage&&s.push(this.savePerspectiveImage(i,t.perspectiveImage)),t.topImage&&!i.topImage&&s.push(this.savePerspectiveImage(i,t.topImage)),Promise.all(s).then(e,n)},n)}))}Promise.all(i).then(()=>{this._localStorage.setItem("hsc_configurations_offline_queue_v1",{}),e()},t)})}_setQueuedConfiguration(e,t={}){const n=e.configurationHash,{perspectiveImage:i,topImage:s}=t;let o=this._localStorage.getItem("hsc_configurations_offline_queue_v1")||{},r=o[n]||{};r.data=e,r.perspectiveImage=i,r.topImage=s,o[n]=r,this._localStorage.setItem("hsc_configurations_offline_queue_v1",o)}async saveConfiguration(e){return navigator.onLine?await this._save("/configurations",{configuration:e},"configurations",{accept:"application/json",contentType:"application/json; charset=UTF-8"}):(e.perspectiveImage=null,e.topImage=null,this._setQueuedConfiguration(e),this._markConfigurationAsLocally(e),Promise.resolve(e))}saveTopImage(e,t){return this._saveConfigurationImage(e,t,"topImage")}savePerspectiveImage(e,t){return this._saveConfigurationImage(e,t,"perspectiveImage")}savePlanSnapshotTopImage(e,t){return this._savePlanSnapshotImage(e,t,"topImage")}savePlanSnapshotPerspectiveImage(e,t){return this._savePlanSnapshotImage(e,t,"perspectiveImage")}getShortUrl(e,t){return new Promise((n,i)=>this._fetchJson("/shortIds","shortIds",{method:"POST",resolve:n,reject:i,data:JSON.stringify({shortId:{type:t,referencedId:e}}),accept:"application/json",contentType:"application/json; charset=UTF-8"}))}_peekData(e,t){const n=RAPI_CACHE.get(t);return n&&n.get(e)||null}_saveConfigurationImage(e,t,n){if(!navigator.onLine){const i={};return i[n]=t,this._setQueuedConfiguration(e,i),this._markConfigurationAsLocally(e),e[n]=t.image,Promise.resolve(e)}const i=this._formDataUtil.create(t.image,e.configurationHash,IMAGE_FORMATS.PNG,n);return this._save("/configurations/"+e.id+"/"+n,i,"configurations",{accept:"application/json"})}_savePlanSnapshotImage(e,t,n){const i=this._formDataUtil.create(t.image,e.id,IMAGE_FORMATS.PNG,"file");return i.append("type",n),this._save("/planSnapshots/"+e.id,i,"planSnapshots",{accept:"application/json",method:"PUT"})}_markConfigurationAsLocally(e){e.isLocally=!0,e.id=e.configurationHash}_save(e,t,n,i={}){const s=t instanceof FormData?t:JSON.stringify(t);return new Promise((t,o)=>{const r={method:i.method||"POST",data:s,resolve:t,reject:o};i.contentType&&(r.contentType=i.contentType),i.accept&&(r.accept=i.accept),this._fetchJson(e,n,r)})}combineMaterialsToGroups(e){return new Promise((t,n)=>{const i=new Map,s={id:null,label:null,materials:[]},o=[];for(let t=0,n=e.length;t<n;t++){const n=e[t],r=n.tags&&n.tags.length?n.tags.map(e=>({isTag:!0,id:e})):[];n.group&&r.push({isTag:!1,id:LEGACY_GROUP_INDICATOR+n.group,legacyId:n.group}),r.length||r.push({isTag:!1,id:null}),n.tags&&n.tags.length&&n.tags.forEach(e=>-1===o.indexOf(e)?o.push(e):null),r.forEach(({isTag:e,id:t,legacyId:o})=>{const r=n.id;let a=t?getCachedMaterialGroup(t):[];a||(RAPI_MATERIAL_GROUP_CACHE.set(t,[]),a=getCachedMaterialGroup(t)),-1===a.indexOf(r.toString())&&a.push(r.toString());const l=hasMaterialTags(n),c=l&&e,h=materialHasNoTagsButGroup(n);if(c||h&&!e||!l&&!h&&!t){let e=t?i.get(t):s;e||(i.set(t,{id:t,label:n.groupLabel,legacyId:o,materials:[]}),e=i.get(t)),e.materials.push(n)}})}const r=s.materials.length?[s]:[];this.getTags(o).then(e=>{const n=e.reduce((e,t)=>(e[t.id]=t,e),{});return i.forEach((e,t)=>{r.push({id:t,label:n[t]?n[t].label:e.label,materials:e.materials,legacyId:e.legacyId,sort:n[t]?n[t].sort:void 0})}),t(r)},n)})}_getByIds(e,t,n={}){const i=this._getCache(t),s=this._getErrorCache(t),o=[],r=[...new Set(e)];let a=r.length;if(i&&i.size){const e=(new Date).getTime();for(let t=0;t<a;t++){const n=r[t],l=i.get(n),c=s.get(n);let h=!1;null!=l?(o.push(l),h=!0):h=void 0!==c&&(e-c.timestamp<6e4||!1===navigator.onLine),h&&(r.splice(t,1),a--,t--)}}return new Promise((e,i)=>{0!==r.length&&navigator.onLine?this._getByIdsPackets(r,t,n).then(t=>{e([...t,...o])},i):e(o)})}_getByIdsPackets(e,t,n={}){const i=n.filterKey||"ids";let s,o="/"+t+"/",r="?",a=[];const l=e.length;if(!l)return new Promise(e=>e([]));let c=!0,h=[];for(s=0;s<l;s++){c=!1;const n=e[s],l=r+i+"[]="+n,d=l.length+o.length;h.push(n),r="&",d<=1500?o+=l:(d>1500&&(h.pop(),s--),a.push({url:o,ids:h}),c=!0,o="/"+t+"/",r="?",h=[])}c||a.push({url:o,ids:h});const d=[];return a.forEach(e=>d.push(this._getByIdsSingle(e.ids,e.url,t,n))),new Promise((e,t)=>{Promise.all(d).then(t=>{const n=[];t.length&&t.forEach(e=>n.push(...e)),e(n)},t)})}_getByIdsSingle(e,t,n,i={}){return new Promise((s,o)=>{this._get(t,n,i).then(t=>{for(let n=0,s=t.length;n<s;n++){const s=i&&i.cacheKey?t[n][i.cacheKey]:t[n].id,o=e.indexOf(s.toString());-1!==o&&e.splice(o,1)}const o=e.length;if(o){const t=this._getCache(n),i=this._getErrorCache(n),s=(new Date).getTime();for(let n=0;n<o;n++)i.set(e[n],{code:0,timestamp:s}),t.delete(e[n]);this._errorHandler.dispatch(2,[n,e.map(e=>'"'+e+'"').join(",")])}s(t)},o)})}_getById(e,t,n={}){if(!e||""===e||"string"!=typeof e)return console.error("no id passed to _getById"),Promise.reject(new Error("no id passed to _getById"));const i=this._getCache(t).get(e);if(i)return new Promise(e=>e(i));if(!navigator.onLine)return Promise.reject("Nothing cached but tried to fetch in offline mode");const s={...n,id:e},o=n.pathSuffix||"";return this._get("/"+t+"/"+e+o,t,s)}_get(e,t,n={}){const i=AppContext.useHDGeometry?"includeGeometryHD=true":"";let s=-1===e.indexOf("?")?"?":"&";return""!==i&&(e+=s+i),n.embed&&Array.isArray(n.embed)&&n.embed.forEach(t=>{e+=s+"embed"+(t[0].toUpperCase()+t.substr(1))+"=true",s="&"}),new Promise((i,s)=>{const o=WAITERS_FOR_URL.get(e);Array.isArray(o)&&o.length>0?o.push({resolve:i,reject:s}):(WAITERS_FOR_URL.set(e,[{resolve:i,reject:s}]),this._fetchJson(e,t,n))})}_fetchJson(e,t,n={}){this._fetch(e,n).then(handleJsonResponse.bind(this)).then(this._handleJson(e,t,n).bind(this)).catch(this._handleError(e,n).bind(this))}async _fetch(e,t){const n={method:t.method?t.method:"GET",headers:this._createHeaders(t),mode:"cors",cache:"default"};t.data&&(n.body=t.data);let i=RAPI.server;const s=this._globalInitData.overrideRapi;s&&(i="live"===s?RAPI.liveServer:RAPI.testServer),(this._globalInitData.customApiUrl||""===this._globalInitData.customApiUrl)&&(i=this._globalInitData.customApiUrl);const o=new Request(i+e,n);this._globalCallback.onNetworkRequest(e,n,t);const r=await this._globalCallback.onCheckExternalCache(e,n);return r?{headers:{get:()=>"application/json"},json:()=>Promise.resolve(r)}:this._networkLayer.fetch(o,{},{checkResponse:e=>this._globalCallback.onValidateNetworkResponse("rapi-access",e)})}_createHeaders(e={}){const t={...headers};this._globalInitData.overrideTenant&&(t.currentTenant=this._globalInitData.overrideTenant),this._globalInitData.overrideCountry&&(t.country=this._globalInitData.overrideCountry);const n=this._globalInitData.locale||"en";t.language=n,t.locale=n;const{contentType:i,accept:s,additionalHeaders:o,data:r}=e;if(i&&(t["content-type"]=e.contentType),s&&(t.accept=e.accept),o)for(let e in o)o.hasOwnProperty(e)&&(t[e]=o[e]);this._globalInitData.configuratorId&&(t.configurator=this._globalInitData.configuratorId);const a=this._currentToken||TOKEN_IDENTIFIER;t.token="03-"+window.btoa((new Date).toISOString()+";"+a+";"+headers.apiKey);const l=new Headers(t);return r instanceof FormData&&l.delete("content-type"),l}_handleJson(e,t,n={}){return i=>{let s=null,o=null;"number"==typeof i&&(s=i);for(let e in i)"meta"!==e&&i.hasOwnProperty(e)&&(s=i[e],o=e);if("error"===o)return this._handleError(e,n)(new Error(JSON.stringify(s)));if(!s)throw new TypeError("RAPI returned empty JSON");if(Array.isArray(s))for(let e=0,i=s.length;e<i;e++)this._prepareData(s[e],t,n),this._prepareEmbeddedData(s[e],t,n);else this._prepareData(s,t,n),this._prepareEmbeddedData(s,t,n);n.resolve?n.resolve(s):this._notifyWaiters(e,null,s)}}_prepareEmbeddedData(e,t,n={}){n.embed&&Array.isArray(n.embed)&&n.embed.forEach(i=>{const s=e[i.slice(0,-1)+"Objects"];if(Array.isArray(s)){for(let e=0,t=s.length;e<t;e++)this._prepareData(s[e],i,n);this._prepareRelationalData(t,i,e.id,s)}else s&&(this._prepareData(s,i,n),this._prepareRelationalData(t,i,e.id,[s]))})}_getCache(e){return this._getCacheFrom(e,RAPI_CACHE)}_getErrorCache(e){return this._getCacheFrom(e,RAPI_ERROR_CACHE)}_getCacheFrom(e,t){let n=t.get(e);return n||(t.set(e,new Map),n=t.get(e)),n}_setCache(e,t,n){n.set(e.toString(),t)}_prepareData(e,t,n=null){let i=this._getCache(t);const s=n&&n.cacheKey?e[n.cacheKey]:e.id;if(s||n&&n.id||"tenants/me"===t)if("tenants/me"!==t){{const t=s||n.id;this._setCache(t,e,i)}e.__rapi_path__=t}else this._setCache("0",e,i);else"shortIds"!==t&&console.error("Can not cache because there is no ID!")}_getRelationsCacheFor(e,t,n){let i=RAPI_RELATIONS_CACHE.get(t);if(!i){const s=new Map,o=new Map;o.set(n,void 0),s.set(e,o),RAPI_RELATIONS_CACHE.set(t,s),i=RAPI_RELATIONS_CACHE.get(t)}let s=i.get(e);if(!s){const t=new Map;t.set(n,void 0),i.set(e,t),s=i.get(e)}return s.get(n)}_prepareGroups(e){const t=e.group,n=e.id;let i=getCachedMaterialGroup(t);i||(RAPI_MATERIAL_GROUP_CACHE.set(t,[]),i=getCachedMaterialGroup(t)),-1===i.indexOf(n.toString())&&i.push(n.toString())}_handleError(e,t={}){return n=>{navigator.onLine?(n.rmlErrorCode=1,n.message='Failed to load "'+e+'" because of "'+n.message+'"',this._errorHandler.dispatch(1,[n])):(n.rmlErrorCode=0,n.message='Failed to load "'+e+'" because of "'+n.message+'"',this._errorHandler.dispatch(0,[n])),t.reject?t.reject(n):this._notifyWaiters(e,n,null)}}_getRelationData(e,t,n={}){const i=e.id;if(!i)return Promise.resolve([]);const s=e.__rapi_path__,o=t.rapiPath;let r=this._getCache(o),a=this._getRelationsCacheFor(i.toString(),s,o),l=[];return a?(a.forEach(e=>l.push(r.get(e))),new Promise(e=>e(l))):navigator.onLine?new Promise((e,t)=>{this._get("/"+s+"/"+i+"/"+o,o,n).then(t=>{this._prepareRelationalData(s,o,i,t),e(t)},t)}):Promise.resolve([])}_prepareRelationalData(e,t,n,i){RAPI_RELATIONS_CACHE.has(e)||RAPI_RELATIONS_CACHE.set(e,new Map);let s=RAPI_RELATIONS_CACHE.get(e);const o=n.toString();s.has(o)||s.set(o,new Map);let r=s.get(o),a=this._getCache(t),l=[];for(let e=0,t=i.length;e<t;e++){const t=i[e],n=t.id.toString();l.push(n),a.set(n,t)}r.set(t,l)}_notifyWaiters(e,t,n){const i=WAITERS_FOR_URL.get(e);if(i&&i.length){for(let e=0,s=i.length;e<s;e++)t?i[e].reject(t):i[e].resolve(n);WAITERS_FOR_URL.delete(e)}}_tenantMe(){return new Promise((e,t)=>{const n=this._getCache("tenants/me"),i=this._globalInitData.overrideTenant?this._globalInitData.overrideTenant:n.get("0");if(i)return e(i);this._fetchJson("/tenants/me","tenants/me",{resolve:t=>e(t),reject:t})})}async getTenant(e){return e||(e=await this._tenantMe()),this._getById(e.toString(),"tenants")}getCurrentSkin(){return this._tenantMe().then(e=>this._getById(e.toString(),"tenants").then(e=>this._getById(e.skin.toString(),"skins")))}getPrices(e){return this._getByIds(e,"prices",{filterKey:"priceIds",cacheKey:"priceId"})}async getConfiguratorSettings(e){const t=await this._getById(e,"configurators");return t.allowedHosts||(t.allowedHosts=[]),t.allowedHosts&&!Array.isArray(t.allowedHosts)&&(t.allowedHosts=t.allowedHosts.split(" ")),t}sendUserAction(e){return this._save("/userActions",{userAction:e},"userActions",{accept:"application/json",contentType:"application/json; charset=UTF-8"})}_share(e,t,n,i){const s="/"+i+"/"+e+"/shares",o=new FormData;return o.append("email",t),o.append("type",n.toString()),new Promise((e,t)=>{const n={method:"POST",data:o,resolve:e,reject:t,accept:"application/json",contentType:"application/json; charset=UTF-8"};this._fetch(s,n).then(n.resolve,n.reject)})}shareConfiguration(e,t,n){return this._share(e,t,n,"configurations")}sharePlanSnapshot(e,t,n){return this._share(e,t,n,"planSnapshots")}export3D(e,t,n,i={}){const s="/"+(isPlanSnapshotId(e)?"planSnapshots":"configurations")+"/"+e+"/3d-exports",o={formats:[{file_format:n,pack_external_data:!0,...i}]},r=JSON.stringify(o),a=new FormData;return a.append("email",t),a.append("settings",r),new Promise((e,t)=>{const n={method:"POST",data:a,resolve:e,reject:t};this._fetch(s,n).then(n.resolve,n.reject)})}async trackView(e){if(this._itemLoaded||(t=(()=>{var e;const t=(()=>{if(window.__RML__ENV__&&window.__RML__ENV__.skipIframeCheck)return!1;try{return window.self!==window.top}catch(e){return!0}})();let n=null===(e=null===window||void 0===window?void 0:window.location)||void 0===e?void 0:e.href;if(!n)return null;if(t){if(!document.referrer)return null;n=document.referrer}const{hostname:i}=new URL(n);return i})())&&(NAMES_FOR_LOCALHOST.includes(t)||t.endsWith("gitlab.io")||t.endsWith("gitlab.com")||t.endsWith("codesandbox.io")||t.endsWith("stackblitz.com")||/^(admin.*.roomle.com)$/.test(t)))return;var t;const{configuratorId:n}=this._globalInitData,i={module:3,action:1,actionId:e,actionLabel:n};await this.sendUserAction(i),this._itemLoaded=!0}signinUser(e,t){return new Promise((n,i)=>{const s={method:"POST",accept:"application/json",contentType:"application/json; charset=UTF-8",data:JSON.stringify({identification:e,passwordMD5:t}),cacheKey:"token",resolve:n,reject:i};this._fetchJson("/auth/signin","auth",s)})}async signoutUser(e){const t=this._currentToken;t!==e&&this.setCurrentToken(e),await this._fetch("/auth/signout",{}),t&&t!==e?this.setCurrentToken(t):this.removeCurrentToken()}async savePlan(e){const t=e.id?"/plans/"+e.id:"/plans";return this._save(t,{plan:e},"plans",{method:e.id?"PUT":"POST",accept:"application/json",contentType:"application/json; charset=UTF-8"})}async savePlanSnapshot(e){return this._save("/planSnapshots",{planSnapshot:e},"planSnapshots",{accept:"application/json",contentType:"application/json; charset=UTF-8"})}setCurrentToken(e){this._currentToken=e}removeCurrentToken(){this._currentToken=null}createNewPlan(){return{name:"",description:"",changeDate:(new Date).toISOString(),created:(new Date).toISOString(),draftId:null,thumbnail:"data:image/png;base64,missing",planObjects:null,active:!0,open:0,planDirectory:0,changed:0,version:2,floorLevel:0,visibility:9,user:null,tenant:null,assets:[],parent:null,setting:null}}}__decorate([inject],RapiAccess.prototype,"_formDataUtil",void 0),__decorate([inject],RapiAccess.prototype,"_errorHandler",void 0),__decorate([inject],RapiAccess.prototype,"_dataSyncer",void 0),__decorate([inject],RapiAccess.prototype,"_networkLayer",void 0),__decorate([inject],RapiAccess.prototype,"_localStorage",void 0),__decorate([inject],RapiAccess.prototype,"_globalInitData",void 0),__decorate([inject],RapiAccess.prototype,"_globalCallback",void 0);const PULSE_DURATION=1500,PULSE_LOOPS=5;function RoomleComponentFactoryInitializer(){class e extends THREE.Object3D{static _generateOutline(e,t){let n=new THREE.LineSegments(new THREE.EdgesGeometry(e),new THREE.LineDashedMaterial({color:"#000000",dashSize:.03,gapSize:.01,linewidth:1}));return n.translateOnAxis(t,1),n.userData.ignoreComponentRaycast=!0,n}static cloneDockLine(e,t){let n=new THREE.LineSegments(e.geometry,e.material);return n.translateOnAxis(t.getCenter(new THREE.Vector3),1),n.name="dockline",n.layers.set(5),n.userData.ignoreComponentRaycast=!0,n}_setValues(e,t,n,i){e&&(this.runtimeId=e,this.name=e.toString()),t&&(this.roomlePosition=Object.assign({},t)),n&&(this.roomleRotation=Object.assign({},n)),i&&(this.parentObjectId=i)}constructor(e,t,n,i){super(),this._selected=!1,this.geometryChanged=!0,this.meshes=[],this.castShadow=!1,this.receiveShadow=!0,this._setValues(e,t,n,i)}get loadingMesh(){return this._loadingMesh}get boundingBoxMesh(){return this._boundingBoxMesh}get boundingBox(){return this._boundingBox}set roomlePosition(e){this._roomlePosition=e,e&&this.position.set(e.x/1e3,e.z/1e3,e.y/-1e3)}get roomlePosition(){return this._roomlePosition}set roomleRotation(e){this._roomleRotation=e,e&&this.rotation.set(e.x,e.z,-e.y)}get roomleRotation(){return this._roomleRotation}replaceMeshes(e){this.removeAllMeshes(),e.forEach(e=>{this.addMesh(new THREE.Mesh(e.geometry,e.material))})}addMesh(e,t){e.renderOrder=2,e.userData.meshType=0,t&&e.applyMatrix4(convertToThreeMatrix(t)),this.add(e),this.meshes.push(e)}getMeshById(e){return this.meshes.find(t=>t.userData.meshId===e)}removeMeshById(e){const t=this.getMeshById(e);t?this.removeMesh(t):console.warn("Could not remove mesh with id "+e,this.runtimeId,this.meshes)}removeMesh(e){const t=this.meshes.indexOf(e);this.remove(e),disposeMesh(e),t<0||this.meshes.splice(t,1)}removeAllMeshes(e=!0){this.meshes.forEach(t=>{this.remove(t),e&&disposeMesh(t)}),this.meshes=[],this._removeLoadingMesh(),this.remove(this._boundingBoxMesh),disposeMesh(this._boundingBoxMesh),this._boundingBoxMesh=null}_hideAllMeshes(){this.meshes.forEach(e=>e.visible=!1)}_showAllMeshes(){this.meshes.forEach(e=>e.visible=!0)}select(){this._selected=!0}loading(){if(!this._kernelBoundingBox)return void console.warn("Bounding box (box for measurements) for component "+this.runtimeId+" not set, can not show external mesh loading box!");this._removeLoadingMesh(),this._hideAllMeshes();const{x:e,y:t,z:n}=this._kernelBoundingBox.getSize(new THREE.Vector3);let i=new THREE.BoxGeometry(e,t,n);this._loadingMesh=new THREE.Mesh(i,new THREE.MeshStandardMaterial({transparent:!0,opacity:1,color:new THREE.Color("#DDDDDD")})),this._loadingMesh.name="loading mesh",this._loadingMesh.receiveShadow=!1,this._loadingMesh.castShadow=!1,this._loadingMesh.layers.set(5),this._loadingMesh.translateOnAxis(this._kernelBoundingBox.getCenter(new THREE.Vector3),1),this._loadingMesh.renderOrder=3,this.add(this._loadingMesh)}_removeLoadingMesh(){this._loadingMesh&&(this.remove(this._loadingMesh),disposeMesh(this._loadingMesh),this._loadingMesh=null)}loadingFinished(){this._removeLoadingMesh(),this._showAllMeshes()}deselect(){this._selected=!1}hoverOn(){setCursor("pointer")}hoverOff(){setCursor("default")}removeFromParent(){this.parent&&(this.parent.remove(this),this.removeAllMeshes())}computeBoundingBox(t,n=!1){if(this._boundingBoxMesh&&this.remove(this._boundingBoxMesh),!n&&t&&0===t.size.x&&0===t.size.y&&0===t.size.z)return;let i;if(!t||n){this._boundingBox=new THREE.Box3;let e=new THREE.Vector3;this.meshes.forEach(t=>{if(t.geometry instanceof THREE.Geometry){let n=t.geometry.vertices;for(let i=0,s=n.length;i<s;i++)e.copy(n[i]),e.applyMatrix4(t.matrix),this._boundingBox.expandByPoint(e)}else if(t.geometry instanceof THREE.BufferGeometry){let n=t.geometry.attributes.position;if(void 0!==n)for(let i=0,s=n.count;i<s;i++)e.fromBufferAttribute(n,i).applyMatrix4(t.matrix),this._boundingBox.expandByPoint(e)}}),this._kernelBoundingBox=this._boundingBox.clone();let t=this._boundingBox.max.x-this._boundingBox.min.x,n=this._boundingBox.max.y-this._boundingBox.min.y,s=this._boundingBox.max.z-this._boundingBox.min.z;i=new THREE.BoxGeometry(t,n,s)}else{this._kernelBoundingBox=kernelBoxToThreeBox(t),this._boundingBox=this._kernelBoundingBox.clone();let{x:e,y:n,z:s}=this._boundingBox.getSize(new THREE.Vector3);i=new THREE.BoxGeometry(e,n,s)}this._boundingBoxMesh=new THREE.Mesh(i,new THREE.MeshStandardMaterial({color:"#FFFFFF",transparent:!0,opacity:0,polygonOffset:!0,polygonOffsetFactor:-1,visible:!1})),this._boundingBoxMesh.name="bounding box mesh";let s=this._boundingBox.getCenter(new THREE.Vector3);this._boundingBoxMesh.position.add(s),this._boundingBoxMesh.layers.set(5),this._boundingBoxMesh.renderOrder=3,this._boundingBoxMesh.castShadow=!1,this._boundingBoxMesh.receiveShadow=!1,this.add(this._boundingBoxMesh),this._dockline=e._generateOutline(i,s),this._dockline.name="bounding box outline",this._dockline.layers.set(5),this._selected&&this.add(this._dockline)}recursiveMeshes(){let t=this.meshes.slice();return this.children.forEach(n=>{n instanceof e&&t.push(...n.recursiveMeshes())}),t}isChild(t){let n=!1;return this.children.forEach(i=>{i instanceof e&&!n&&(n=i.runtimeId===t||i.isChild(t))}),n}getKernelPosition(e){let t=this.parent.localToWorld(this.position);return convertToKernel(e.worldToLocal(t))}}class t extends e{constructor(e,t){super(e,null,null,null),this.glbUrl=t}}class n extends e{constructor(e,t,n,i,s){super(t,n,i,s),this._stringId=null,this.receivedPointAssociation=!1,this.castShadow=!1,this.receiveShadow=!1,this._creator_=e}get stringId(){return this._stringId?this._stringId:this.runtimeId.toString()}addMesh(e,t){super.addMesh(e,t),e.material instanceof THREE.MeshStandardMaterial&&(e.material.opacity=.8,e.material.roughness=1,e.material.metalness=0,e.material.color=new THREE.Color(this._initData.colors.PREVIEW_DOCKING_COLOR)),e.renderOrder=1,e.castShadow=!1,e.receiveShadow=!1}startPulsating(){var e,t;if(null===(t=null===(e=this._initData)||void 0===e?void 0:e.featureFlags)||void 0===t?void 0:t.pulsePreview)for(const e of this.meshes){const t={opacity:.8},n={opacity:.3};new TWEEN.Tween(t).to(n,1500).easing(TWEEN.Easing.Sinusoidal.In).onUpdate(()=>{e.material.opacity=t.opacity}).yoyo(!0).repeat(5).start()}}hoverOn(){this.remove(this._dockline),this.meshes.forEach(({material:e})=>{e.opacity=.9,e.roughness=1,e.metalness=0,e.color=new THREE.Color(this._initData.colors.PREVIEW_DOCKING_COLOR)}),setCursor("pointer")}hoverOff(){this.add(this._dockline),this.meshes.forEach(({material:e})=>{e.opacity=.8,e.roughness=1,e.metalness=0,e.color=new THREE.Color(this._initData.colors.PREVIEW_DOCKING_COLOR)}),setCursor("default")}clonePreview(t){const i=new n(this._creator_,this.runtimeId,this.roomlePosition,this.roomleRotation,this.parentObjectId);return i._stringId=this.runtimeId+"_"+t,this.children.forEach(e=>{e instanceof THREE.Mesh&&0===e.userData.meshType&&i.meshes.push(e.clone(!0))}),i.meshes.forEach(e=>{e.material=e.material.clone(),e.geometry=e.geometry.clone(),i.add(e)}),this._dockline&&(i._dockline=e.cloneDockLine(this._dockline,this._boundingBox)),this._boundingBoxMesh&&(i._boundingBoxMesh=this._boundingBoxMesh.clone(!0)),this._boundingBox&&(i._boundingBox=this._boundingBox.clone()),i}preparePreview(){this.add(this._dockline),this.add(this._boundingBoxMesh)}}__decorate([inject],n.prototype,"_initData",void 0);class i extends n{constructor(e,t,n,i,s,o){super(e,t,n,i,s),o&&(this._stringId=this.runtimeId+"_has_additional_dock_point_copy")}set roomleLineFrom(e){this._roomleLineFrom=e,this.lineFrom=convertToTHREE(e)}get roomleLineFrom(){return this._roomleLineFrom}set roomleLineTo(e){this._roomleLineTo=e;let t=convertToTHREE(e);t.equals(this.lineFrom)&&(console.warn("lineFrom and lineTo are equal!"),t.add(new THREE.Vector3(0,.01,0))),this.lineTo=t}get roomleLineTo(){return this._roomleLineTo}set roomlePositionFrom(e){this._roomlePositionFrom=e,this.positionFrom=convertToTHREE(e)}get roomlePositionFrom(){return this._roomlePositionFrom}set roomlePositionTo(e){this._roomlePositionTo=e;let t=convertToTHREE(e);t.equals(this.positionFrom)&&(console.warn("positionFrom and positionTo are equal!"),t.add(new THREE.Vector3(0,.01,0))),this.positionTo=t}get roomlePositionTo(){return this._roomlePositionTo}addMesh(e,t){super.addMesh(e,t),e.visible=!1,e.renderOrder=3}hoverOn(){this._dockline.visible=!0,setCursor("pointer")}hoverOff(){this._dockline.visible=!1,setCursor("default")}preparePreview(){super.preparePreview(),this._dockline.visible=!1;let e=this.lineTo.clone(),t=this.lineFrom.clone();const n=(new THREE.Vector3).subVectors(e,t);let i=n.length(),s=n.normalize(),o=new THREE.ArrowHelper(s,t),r=new THREE.CylinderGeometry(.01,.01,i,16,1);this.lineMesh=new THREE.Mesh(r,new THREE.MeshStandardMaterial({color:"#DDDDDD",transparent:!0,opacity:.4})),this.lineMesh.name="line mesh";const a=(new THREE.Quaternion).setFromEuler(o.rotation);this.lineMesh.quaternion.multiply(a),this.lineMesh.renderOrder=1;let l=(new THREE.Vector3).addVectors(e,t).multiplyScalar(.5);this.lineMesh.position.copy((new THREE.Vector3).subVectors(l,this.position.clone())),this.add(this.lineMesh);let c=this._boundingBox.getCenter(new THREE.Vector3).applyEuler(this.docklineRotation),h=null,d=0,u=Math.abs(s.x),_=Math.abs(s.y),p=Math.abs(s.z);u>=_&&u>=p?(h=new THREE.Vector3(c.x,0,0),d=Math.sqrt(c.y*c.y+c.z*c.z)):_>=u&&_>=p?(h=new THREE.Vector3(0,c.y,0),d=Math.sqrt(c.x*c.x+c.z*c.z)):p>=_&&p>=u&&(h=new THREE.Vector3(0,0,c.z),d=Math.sqrt(c.y*c.y+c.x*c.x)),d=d>0?d:.01;let m=(new THREE.Vector3).subVectors(this.positionTo.clone(),this.positionFrom.clone()).length()+h.length(),g=new THREE.CylinderGeometry(1.1*d,1.1*d,m,32,1);this.boundingLineMesh=new THREE.Mesh(g,new THREE.MeshStandardMaterial({color:"#ffffff",transparent:!0,opacity:0})),this.boundingLineMesh.name="bounding line mesh",this.boundingLineMesh.userData.ignoreComponentRaycast=!0,this.boundingLineMesh.layers.set(5);let E=this.positionTo.clone(),f=this.positionFrom.clone(),C=(new THREE.Vector3).subVectors(E,f).normalize(),y=new THREE.ArrowHelper(C,f);const w=(new THREE.Quaternion).setFromEuler(y.rotation);this.boundingLineMesh.quaternion.multiply(w),this.boundingLineMesh.renderOrder=3;let M=(new THREE.Vector3).addVectors(this.positionTo.clone(),this.positionFrom.clone()).multiplyScalar(.5).add(c);this.boundingLineMesh.position.copy((new THREE.Vector3).subVectors(M,this.position.clone())),this.add(this.boundingLineMesh)}clonePreviewLine(t){let n=new i(this._creator_,this.runtimeId,this.roomlePosition,this.roomleRotation,this.parentObjectId,this.receivedPointAssociation);return n._stringId=this.runtimeId+"_"+t,this.children.forEach(e=>{e instanceof THREE.Mesh&&0===e.userData.meshType&&n.meshes.push(e.clone(!0))}),n.meshes.forEach(e=>{e.material=e.material.clone(),e.geometry=e.geometry.clone(),n.add(e)}),this._dockline&&(n._dockline=e.cloneDockLine(this._dockline,this._boundingBox)),this._boundingBoxMesh&&(n._boundingBoxMesh=this._boundingBoxMesh.clone(!0)),this._boundingBox&&(n._boundingBox=this._boundingBox.clone()),n}getPositionForIntersectionPoint(e){let t=this._boundingBox.getCenter(new THREE.Vector3).applyEuler(this.docklineRotation),n=this.positionTo.clone().add(t),i=this.positionFrom.clone().add(t),s=new THREE.Line3(i,n).closestPointToPoint(e,!0,new THREE.Vector3);return(isNaN(s.x)||isNaN(s.y)||isNaN(s.z))&&s.copy(e),s.sub(t)}updatePreviewPosition(e){let t=this.getPositionForIntersectionPoint(e),n=this.parent.localToWorld(t);this._newPosition=this.worldToLocal(n);let i=this._boundingBox.getCenter(new THREE.Vector3).applyEuler(this.docklineRotation);this._dockline.position.copy((new THREE.Vector3).addVectors(this._newPosition,i)),this._dockline.rotation.copy(this.docklineRotation)}hideSelectionLine(){this._dockline.visible=!1}getKernelPosition(e){if(this._newPosition){let t=this.localToWorld(this._newPosition);return convertToKernel(e.worldToLocal(t))}return super.getKernelPosition(e)}}class s extends THREE.OrthographicCamera{constructor(e,t,n,i,s,o,r){super(e,t,n,i,s,o),r||(r={left:0,top:1,right:1,bottom:0}),this.offset=r}set offset(e){this._offset=e,this.updateProjectionMatrix()}get offset(){return this._offset}updateProjectionMatrix(){this._offset?(this.projectionMatrix=this._calculateProjectionMatrix(),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()):super.updateProjectionMatrix()}_calculateProjectionMatrix(){const e=this._calculate2DPlanes();if(this._offset.left>=this._offset.right||this._offset.bottom>this._offset.top)return(new THREE.Matrix4).makeOrthographic(e.left,e.right,e.top,e.bottom,this.near,this.far);const t=this._scaleRange(e.left,e.right,this._offset.left,this._offset.right);let n=t.from,i=t.to;const s=this._scaleRange(e.bottom,e.top,this._offset.bottom,this._offset.top);let o=s.from,r=s.to;const a=(e.right-e.left)/(e.top-e.bottom),l=(i-n)/(r-o);if(l>a){const e=(o+r)/2,t=(r-o)*l/a;o=e-t/2,r=e+t/2}else{const e=(n+i)/2,t=(i-n)*a/l;n=e-t/2,i=e+t/2}return(new THREE.Matrix4).makeOrthographic(n,i,r,o,this.near,this.far)}_scaleRange(e,t,n,i){const s=(t-e)/(i-n);return{from:e-s*n,to:t+s*(1-i)}}_calculate2DPlanes(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,i=(this.top+this.bottom)/2;let s=n-e,o=n+e,r=i+t,a=i-t;if(null!==this.view&&this.view.enabled){const e=(this.right-this.left)/this.view.fullWidth/this.zoom,t=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=e*this.view.offsetX,o=s+e*this.view.width,r-=t*this.view.offsetY,a=r-t*this.view.height}return{left:s,right:o,top:r,bottom:a}}}class o extends THREE.PerspectiveCamera{constructor(e,t,n,i,s){super(e,t,n,i),s||(s={left:0,top:1,right:1,bottom:0}),this.offset=s}set offset(e){this._offset=e,this.updateProjectionMatrix()}get offset(){return this._offset}_calculateProjectionMatrix(){let e,t,n,i,s=this.fov*(2*Math.PI/360)/2;n=Math.tan(s),i=-n;let o=Math.atan(this.aspect*Math.tan(s));t=Math.tan(o),e=-t;let r=this._offset.left,a=this._offset.right,l=this._offset.top,c=this._offset.bottom,h=new THREE.Vector2(a-r,l-c),d=new THREE.Vector2(r+h.x/2,c+h.y/2);if(h.x<h.y){let s=(1-d.x)/(h.x/2),o=d.x/(h.x/2);t*=s,e*=o;let r=(s+o)/2;n*=r,i*=r}else{let s=(1-d.y)/(h.y/2),o=d.y/(h.y/2);n*=s,i*=o;let r=(o+s)/2;e*=r,t*=r}e*=this.near,t*=this.near,n*=this.near,i*=this.near;let u=this.near*Math.tan(Math.PI/180*.5*this.fov)/this.zoom*2,_=this.aspect*u;return this.view&&this.view.enabled&&(e+=this.view.offsetX*_/this.view.fullWidth,n-=this.view.offsetY*u/this.view.fullHeight,t+=this.view.offsetX*_/this.view.fullWidth,i-=this.view.offsetY*u/this.view.fullHeight),(new THREE.Matrix4).makePerspective(e,t,n,i,this.near,this.far)}clearViewOffset(){null!==this.view&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){this._offset?(this.projectionMatrix=this._calculateProjectionMatrix(),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()):super.updateProjectionMatrix()}}return{create:function(t,n,i,s){return new e(t,n,i,s)},createPreview:function(e,t,i){return new n(i,e,{x:0,y:0,z:0},{x:0,y:0,z:0},t)},createStatic:function(e,n){return new t(e,n)},createPreviewLine:function(e,t){let n=new i(t,e.id,e.roomlePosition,e.roomleRotation,e.parentObjectId,e.receivedPointAssociation);return e.meshes.forEach(e=>{let t=e.clone();t.material=e.material.clone(),t.geometry=e.geometry.clone(),n.addMesh(t)}),n.computeBoundingBox(),n},isPreview:function(e){return e instanceof n},isPreviewLine:function(e){return e instanceof i},createPerspectiveCamera:function(e,t,n,i,s){return new o(e,t,n,i,s)},createOrthographicCamera:function(e,t,n,i,o,r,a){return new s(e,t,n,i,o,r,a)}}}const DEFAULT_CONVERSATION_ID=9;class ConfiguratorViewModel{constructor(e){this._mergeThreshold=3,this._componentsToMerge=new OccurrenceMap,this._mergeInProgress=!1,this._components=new Map,this._previews=new Map,this._componentNumberOfPossibleChildren=new Map,this._creator_=e,this._getKernelAccess().addConfiguratorListener(this),this._componentFactory=RoomleComponentFactoryInitializer()}get materialQueue(){return this.getMeshGenerator().materialQueue}_getKernelAccess(){return RoomleDependencyInjection.lookup("planner-kernel-access",this._creator_)}_applyMeshTransform(e,t,n,i,s){if(n){const i=e.userData.transform=convertToThreeMatrix(n);t&&(e.userData.transform=i),e.applyMatrix4(i)}this._applyMeshUVTransform(e,t,i,s)}_applyMeshUVTransform(e,t,n,i){if(6!==(null==n?void 0:n.length)||(e=>1===e[0]&&0===e[1]&&0===e[2]&&1===e[3]&&0===e[4]&&0===e[5])(n))t&&(t.uvTransform=void 0),i&&(e.geometry=i);else{const s=(e=>{const t=new THREE.Matrix4;return t.set(e[0],e[2],0,e[4],e[1],e[3],0,e[5],0,0,1,0,0,0,0,1),t})(n);t&&(t.uvTransform=s);const o=null!=i?i:e.geometry;if(o&&o.attributes.uv){const t=o.clone();t.attributes.uv.applyMatrix4(s),e.geometry=t}}}_addMeshToSubPart(e,t,n,i,s,o,r,a,l,c){const h=this._generateMesh(e,t,n,o,r,a,l,void 0,void 0,c);this._applyMeshTransform(h,null,i,s),this._subPartObject.add(h)}_addMeshToComponent(e,t,n,i,s,o,r,a,l,c,h,d){if(this._subPartGuard&&this._subPartGuard.info===e)return void this._addMeshToSubPart(e,null,i,null,null,r,a,l,c,d);const u=this.getComponent(e);if(!u)return;const _=this._componentFactory.isPreview(u),p=this._generateMesh(e,n,_?null:i,r,a,l,c,void 0,void 0,d);p.userData.meshId=t,p.userData.geometryId=n,p.userData.materialId=i,this._applyMeshTransform(p,p.userData,s,o),_&&p.layers.set(5),u&&u.addMesh(p),u.meshes.length>this._mergeThreshold&&this._componentsToMerge.set(e,u.meshes.length)}_changeMeshOfComponent(e,t,n,i,s,o,r){const a=this.getComponent(e);if(!a)return;const l=a.getMeshById(t);if(l){l.userData.geometryId!==n&&console.warn("Geometry of mesh has changed!"),l.userData.materialId=i,l.userData.materialAttributes=r;const e=l.material.clone();this._configuratorMeshGenerator.setMaterial(l,i,void 0,r),e.opacity!==l.material.opacity&&this._requestRenderCallback&&this._requestRenderCallback(),s&&(l.position.set(0,0,0),l.scale.set(1,1,1),l.rotation.set(0,0,0));const t=this._configuratorMeshGenerator.getGeometry(n);this._applyMeshTransform(l,l.userData,s,o,t)}}_removeMeshFromComponent(e,t){const n=this.getComponent(e);n&&n.removeMeshById(t)}getComponent(e){let t=this._components.get(e);return t||(t=this._previews.get(e.toString()),t)?t:(console.warn("component not found!",e),null)}getNumberOfPossibleChildrenForComponent(e){if(this._componentNumberOfPossibleChildren.has(e))return this._componentNumberOfPossibleChildren.get(e);const t=this._getKernelAccess().kernelInstance.getPlanComponentPossibleChildren(e).length;return this._componentNumberOfPossibleChildren.set(e,t),t}tryToMergeComponents(){this._initData.moc||this._mergeInProgress||(this._mergeInProgress=!0,this._componentsToMerge.size,this._requestMergeComponents())}_requestMergeComponents(){window.requestIdleCallback(this._mergeNextComponent.bind(this))}_mergeNextComponent(){if(this._componentsToMerge.size>0){const e=this._componentsToMerge.largestValue();this._componentsToMerge.delete(e),this._mergeComponent(e),this._requestMergeComponents()}else this._mergeInProgress=!1,this._geometriesMerged&&this._geometriesMerged(),this._components.forEach(e=>{e.loadingMesh&&console.warn("component still has loading mesh: ",e.hash)})}_mergeComponent(e){const t=this._components.get(e);if(t&&!(t.meshes.length<=this._mergeThreshold))if(this._cacheHolder.componentCache.has(t.hash)){const e=this._cacheHolder.componentCache.get(t.hash).meshes;t.replaceMeshes(e)}else{const e=new Map,n=[],i=[];t.meshes.forEach(t=>{const s=t.userData.materialId;if(!s)return void console.warn("mesh has no material id set");if(!e.has(s)){const i=new THREE.Mesh(new THREE.Geometry,t.material);i.userData.materialId=s,i.receiveShadow=!0,i.castShadow=!0,i.layers.set(3),this._setMaterial(i,s),n.push(i),e.set(s,i)}const o=e.get(s).geometry;t.userData.transform?o.merge(t.geometry,t.userData.transform):o.merge(t.geometry),i.push(t)}),n.forEach(e=>t.addMesh(e)),i.forEach(e=>t.removeMesh(e)),this._cacheHolder.componentCache.set(t.hash,t)}}_addRootComponent(e){this._listener&&this._listener.display(e)}removeDockingComponent(){this._getKernelAccess().requestDeleteComponent(this._configuratorContext.dockingRootComponentId),this._configuratorContext.dockingRootComponentId=null}dockComponent(e,t,n,i){let s=this._components.get(t),o=this._components.get(e);o&&(o.roomlePosition=n,o.roomleRotation=i,s&&s.add(o))}dockComponentWithPosition(e,t){let n,i=this._components.get(e.parentId);n=t?t.getKernelPosition(i):e.getKernelPosition(i);const s=Benchmark.start("dock_component_with_position_"+e.childId);this._getKernelAccess().dockComponentWithPosition(e.parentId,e.parentDockId,e.childId,e.childDockId,n),this._configuratorContext.dockingRootComponentId=null,Benchmark.end(s)}removePreviews(){this._previews.size>0&&(this._previews.forEach(e=>{e.removeFromParent(),e.removeAllMeshes()}),this._previews.clear())}_updatePlanObject(e){const t=this._components.get(e.rootPlanComponentId);let n=!0;t&&(n=t.geometryChanged),this._listener&&this._listener.planObjectUpdated(e,n)}Editor3dAddBakedMesh(e,t,n,i,s,o,r,a){this._addMeshToComponent(e,null,null,t,null,null,n,i,s,o,r,a)}Editor3dAddDockPreview(e,t){const n=this._componentFactory.createPreview(t,e,this._creator_);this._previews.set(t.toString(),n)}Editor3dAddNamedMesh(e,t,n,i,s,o,r,a,l,c,h,d){this._addMeshToComponent(e,t,n,i,s,h,o,r,a,l,c,d)}Editor3ChangedNamedMesh(e,t,n,i,s,o,r){this._changeMeshOfComponent(e,t,n,i,s,o,r)}Editor3dRemoveNamedMesh(e,t){this._removeMeshFromComponent(e,t)}Editor3dBeginConstruction(e,t){if(!t){const t=this._components.get(e);t&&t.removeAllMeshes()}this._subPartGuard&&e===this._subPartGuard.info&&(this._subPartObject=new THREE.Object3D)}Editor3dComponentCreated(e,t,n,i,s){s&&(this._configuratorContext.rootComponentId=e);let o=null;this._components.has(e)?(o=this._components.get(e),o.removeAllMeshes()):(o=this._componentFactory.create(e,t,n,i),o.layers.set(3)),this._components.set(e,o),s&&this._addRootComponent(o)}Editor3dComponentDocked(e,t,n,i){this.dockComponent(e,t,n,i)}Editor3dEndConstruction(e){if(this._subPartGuard&&this._subPartGuard.info===e)return void this._subPartGuard.resolve(this._subPartObject);const t=this._getKernelAccess().kernelInstance.getComponent(e),n=this._components.get(e);n&&(n.computeBoundingBox(t.boxForMeasurement),n.boundingBoxMesh&&this._listener&&this._listener.addComponentHandlers(n));let i=this._previews.get(e.toString());i&&i.computeBoundingBox(t.boxForMeasurement,!0)}Editor3dGeometryReady(e){const t=this._components.get(e);t&&t.loadingFinished()}Editor3dGeometryNotReady(e){const t=this._components.get(e);t&&t.loading()}Editor3dPlanObjectConstructionDone(e){const t=this._getKernelAccess().kernelInstance.getPlanObject(e),n=[t,this._getKernelAccess().kernelInstance.getFullPartList(),this._getKernelAccess().kernelInstance.getHashOfConfiguration(e),this._getKernelAccess().kernelInstance.getComponentId(t.rootPlanComponentId)];AsyncHelper.finishOperation(2,n),this._updatePlanObject(t),this._listener&&this._listener.planObjectConstructionDone(t)}Editor3dPreviewConstructionDone(e,t){let n=!1;this._previews.forEach(e=>{null!==e.parent&&(this._listener&&(this._componentFactory.isPreviewLine(e)?this._listener.addPreviewLineHandlers(e):this._listener.addPreviewHandlers(e)),n=!0)}),this._listener&&this._listener.previewConstructionDone(this._components.get(e),n)}Editor3dSetPreviewLineAssociations(e,t){let n=this._previews.get(t.toString());if(n.clear(),!n)return;let i=this._componentFactory.createPreviewLine(n,this._creator_),s=this._components.get(this._configuratorContext.rootComponentId);for(let t=0;t<e.length;t++){let n;n=0===t?i:i.clonePreviewLine(t),n.name="Preview Line",n.parentDockId=e[t].parentDockId,n.parentId=e[t].parentId,n.childDockId=e[t].childDockId,n.childId=e[t].childId,n.docklineRotation=(o=e[t].rotation,new THREE.Euler(o.x,o.z,-o.y)),n.roomlePosition=e[t].position,e[t].lineFrom.x>e[t].lineTo.x||e[t].lineFrom.y>e[t].lineTo.y||e[t].lineFrom.z>e[t].lineTo.z?(n.roomleLineFrom=e[t].lineTo,n.roomleLineTo=e[t].lineFrom):(n.roomleLineFrom=e[t].lineFrom,n.roomleLineTo=e[t].lineTo),e[t].positionFrom.x>e[t].positionTo.x||e[t].positionFrom.y>e[t].positionTo.y||e[t].positionFrom.z>e[t].positionTo.z?(n.roomlePositionFrom=e[t].positionTo,n.roomlePositionTo=e[t].positionFrom):(n.roomlePositionFrom=e[t].positionFrom,n.roomlePositionTo=e[t].positionTo),s.add(n),n.preparePreview(),this._previews.set(n.stringId,n)}var o}Editor3dSetPreviewPointAssociations(e,t){let n=this._previews.get(t.toString());if(!n)return;let i=this._components.get(this._configuratorContext.rootComponentId);for(let t=0;t<e.length;t++){let s;0===t?s=n:(s=n.clonePreview(t),this._previews.set(s.stringId,s)),s.name="Preview Point",s.parentDockId=e[t].parentDockId,s.parentId=e[t].parentId,s.childDockId=e[t].childDockId,s.childId=e[t].childId,s.preparePreview(),s.receivedPointAssociation=!0,s.userData.ignoreComponentRaycast=!0,i.add(s),s.roomlePosition=e[t].position,s.roomleRotation=e[t].rotation,s.startPulsating()}}componentDeleted(e){const t=this._components.get(e);t&&(this._listener&&this._listener.componentDeleted(t),t.removeFromParent(),t.removeAllMeshes(),this._components.delete(e))}componentMetaUpdated(e){const t=this._getRuntimeComponent(e.id);t&&(t.hash=e.hash,t.roomlePosition=e.position,t.roomleRotation=e.rotation,e.boxForMeasurement&&t.computeBoundingBox(e.boxForMeasurement),this._listener&&this._listener.componentUpdated(t,e))}componentConfigurationUpdated(e,t){const n=this._getRuntimeComponent(e);n&&(n.geometryChanged=t)}_getRuntimeComponent(e){let t=this._components.get(e);return t||(t=this._previews.get(e.toString()),t)?t:null}configurationLoaded(e,t,n,i,s){10===e&&(this._configuratorContext.dockingRootComponentId=n);let o=0===t;o?this._getKernelAccess().kernelInstance.requestPlanComponentConstructionRecursive(n):this._getKernelAccess().kernelInstance.requestPlanObjectConstruction(t);let r=this._getKernelAccess().kernelInstance.getComponent(n),a=this._components.get(n);a&&(a.computeBoundingBox(r.boxForMeasurement),a.hash=r.hash),this._listener&&this._listener.configurationLoaded(a,o&&void 0!==a.boundingBoxMesh)}finishParameterChange(e,t){this.materialQueue.registerCallback(e)}planObjectConfigurationUpdated(e,t,n){let i=this._getKernelAccess().kernelInstance.getPlanObject(e);this._updatePlanObject(i)}planObjectCreated(e,t){this._configuratorContext.planObjectId=t,this._listener&&this._listener.clearScene()}planObjectUpdated(e){this._updatePlanObject(e)}sceneCleared(){this._components.forEach((function(e){e.removeFromParent(),e.removeAllMeshes()})),this._components.clear(),this._componentNumberOfPossibleChildren.clear(),this._previews.forEach(e=>{e.removeFromParent(),e.removeAllMeshes()}),this._previews.clear()}setListener(e){this._listener=e}getBoundingBox(){if(this._configuratorContext.planObjectId){const e=this._getKernelAccess().kernelInstance.getPlanObject(this._configuratorContext.planObjectId);if(e&&e.boxForMeasurement)return kernelBoxToThreeBox(e.boxForMeasurement)}else if(this._configuratorContext.rootComponentId){const e=this._components.get(this._configuratorContext.rootComponentId);return(new THREE.Box3).setFromObject(e)}return null}getBoundingBoxWithPreviews(){const e=this._components.get(this._configuratorContext.rootComponentId);return e?(new THREE.Box3).setFromObject(e):null}hasPreviews(){return this._previews.size>0}clearRootComponent(){var e;null===(e=this._components.get(this._configuratorContext.rootComponentId))||void 0===e||e.hoverOff()}debugSceneGraph(e){e?this._components.has(e)?this._components.get(e):this._previews.has(e.toString())&&this._previews.get(e.toString()):this._configuratorContext}getComponentsForIds(e){let t=[];return e.forEach(e=>{const n=this._components.get(e);n&&t.push(n)}),t}getComponents(){return Array.from(this._components.values())}getPreviews(){return Array.from(this._previews.values())}hasPreviewLines(){for(const e of this._previews.values())if(this._componentFactory.isPreviewLine(e))return!0;return!1}isPreviewLine(e){return this._componentFactory.isPreviewLine(e)}isPreview(e){return this._componentFactory.isPreview(e)}setGeometriesMergedListener(e){this._geometriesMerged=e}removeGeometriesMergedListener(){this._geometriesMerged=void 0}setMergeThreshold(e){this._mergeThreshold=e}_generateMesh(e=0,t=null,n,i,s,o,r,a,l,c){return this._configuratorMeshGenerator.generateMesh(e,t,n,i,s,o,r,!1,c)}_setMaterial(e,t,n){this._configuratorMeshGenerator.setMaterial(e,t)}constructComponents(e){this._getKernelAccess().kernelInstance.requestPlanObjectConstruction(e)}requestSubPartConstruction(e){return this._subPartGuard=new AsyncGuard(e),this._getKernelAccess().requestPlanComponentConstruction(e,!1),this._subPartGuard.wait()}getMeshGenerator(){return this._configuratorMeshGenerator}setRequestRenderCallback(e){this._requestRenderCallback=e}}__decorate([inject],ConfiguratorViewModel.prototype,"_configuratorMeshGenerator",void 0),__decorate([inject],ConfiguratorViewModel.prototype,"_configuratorContext",void 0),__decorate([inject],ConfiguratorViewModel.prototype,"_cacheHolder",void 0),__decorate([inject],ConfiguratorViewModel.prototype,"_initData",void 0);class OccurrenceMap extends Map{largestValue(){let e=this.entries().next().value[0],t=0;return this.forEach((n,i)=>{n>t&&(e=i,t=n)}),e}}const ASYNC_PARAMTER_CHANGES=["material"];class ConfiguratorKernelAccess extends CommonKernelAccess{constructor(e){super(e),this.externalMeshQueue=new PromiseQueue,this.muteKernelCallbacks=!1,this.listOfVariants=(e,t)=>{}}init(e){super.init(e),Benchmark.addMeta("kernel_is_ready",{isWasm:this._useWASM}),AppContext.kernelInstance?(this._kernelContainer=AppContext.kernelContainer,setTimeout(()=>this._loadSuccess(),0)):this._scriptLoader.fetch(this._kernelPath,{id:"kernel"}).then(this._loadSuccess.bind(this),this._loadError.bind(this))}_loadSuccess(){Benchmark.start("kernel_is_ready"),window.ConfiguratorKernel&&(AppContext.kernelInstance?setTimeout(()=>this.isReady(),0):(window.ConfiguratorKernel(this._kernelContainer),window.ConfiguratorKernel=null))}_loadError(){this._configuratorKernelAccessCallback.loadError()}selectedComponent(e){this._updateComponentDependencies(e)}uiRequestConfiguration(e){const t=this._kernelInstance.getSerializedConfiguration(e);AsyncHelper.finishOperation(1,t)}_updateComponentParameters(e){let t=this._kernelInstance.getComponentParameters(e);const n=this._kernelInstance.getComponent(e);this._configuratorKernelAccessCallback.updateParameters(t,n.parameterGroups,e,1)}selectionChange(e,t){let n=!1,i=[];if(e){let t=this._kernelInstance.getComponent(e);t.componentId=this._kernelInstance.getComponentId(e),t&&t.childIds&&t.childIds.length>0&&(n=!0),i.push(t)}this._configuratorUiCallbacks.onSelectionChange("standard",t,n,i)}multiSelectionChange(e,t){this._updateCommonComponentDependencies(e);let n=!1,i=!1,s=[];e&&e.forEach(e=>{let o=this._kernelInstance.getComponent(e);o.componentId=this._kernelInstance.getComponentId(e),o&&o.childIds&&o.childIds.length>0&&(n=!0),o.id===t&&(i=!0),s.push(o)}),this._configuratorUiCallbacks.onSelectionChange("multiselect",i,n,s)}_updateCommonComponentDependencies(e){const{parameters:t,parameterGroups:n}=this._kernelInstance.getCommonPlanComponentParameters(this._utilityToLongArray(e));this._configuratorKernelAccessCallback.updateParameters(t,n,e,2)}_updateComponentChildren(e){const t=this._kernelInstance.getPlanComponentPossibleChildren(e);this._configuratorKernelAccessCallback.updatePossibleChildren(e,t,1)}_updateComponentDependencies(e){this._updateComponentParameters(e),this._updateComponentChildren(e)}_updatePlanObjectParameters(e){let t,n=this._kernelInstance.getPlanObjectParameters(e);if(0===n.length){let i=this._kernelInstance.getRootPlanComponentIdFromObjectId(e);n=this._kernelInstance.getComponentParameters(i),this._enableRootComponentParametersAsGlobal(),t=this._kernelInstance.getComponent(i)}else this._configuratorContext.rootComponentParametersAsGlobal=!1,t=this._kernelInstance.getPlanObject(e);this._configuratorKernelAccessCallback.updateParameters(n,t.parameterGroups,e,0)}_enableRootComponentParametersAsGlobal(){this._configuratorContext.selectedRuntimeComponentId||(this._configuratorContext.rootComponentParametersAsGlobal=!0)}_updatePlanObjectChildren(e){const t=this._kernelInstance.getPlanObjectPossibleChildren(e);this._configuratorKernelAccessCallback.updatePossibleChildren(e,t,0)}updatePlanObjectDependencies(e){this._updatePlanObjectParameters(e),this._updatePlanObjectChildren(e)}_updateConfigurationHasChildren(e,t=null){t||(t=this._kernelInstance.getComponent(this._kernelInstance.getRootPlanComponentIdFromObjectId(e)));const n=t.childIds.size?t.childIds.size():t.childIds.length;this._configuratorUiCallbacks.onConfigurationHasChildren(n>0)}dockComponent(e,t,n,i){const s=this._kernelInstance.getComponentId(n),o=this._kernelInstance.getComponentId(e);this._kernelInstance.dockComponent(n,i,e,t),this._configuratorUiCallbacks.onUserInitiatedDockDone(s,i,o,t,null)}changeUseOfHDGeometry(e,t){this._rapiAccess.changeUseOfHDGeometry();const n=e.planObjectId,i=e.lastLoadedRapiId?e.lastLoadedRapiId:this._kernelInstance.getComponentId(n),s=this._kernelInstance.getSerializedConfiguration(n);this._kernelInstance.clearAll(),this._kernelInstance.useHDGeometry(t),AsyncHelper.finishOperation(3,[s,i])}webGlPreviewDockings(e,t){AsyncHelper.waitFor(4).then(({componentId:n})=>{t&&this.requestPlanComponentConstruction(n),this._kernelInstance.requestPreviewGeometry(n,e.planObjectId)}),e.lastPossibleChild&&e.lastPossibleChild.isComponent&&(this._kernelIo.setMeta({componentId:e.lastPossibleChild.id}),this._kernelInstance.loadPlainComponent(10,e.lastPossibleChild.id,e.lastPossibleChild.configuration)),e.lastPossibleChild&&e.lastPossibleChild.isItem&&this._kernelInstance.loadFreeFlyingConfiguration(10,e.lastPossibleChild.configuration)}previewDockingsWithDrag(e,t){this._kernelInstance.requestPreviewGeometry(e,t)}loadConfiguration(e){this._initData.id?this._memoryManager.loadingConfiguration(this._initData.id):this._memoryManager.loadingConfigurationString(),this._memoryManager.shouldHardReset()?this._kernelInstance.clearAll():this._kernelInstance.clearScene(),this._kernelInstance.loadConfiguration(9,e,{x:0,y:0,z:0})}changeCommonComponentParameter(e,t,n,i,s,o){"string"==typeof i?this._kernelInstance.setPlanComponentParameters(this._utilityToLongArray(e),t,i):console.warn("tried to set a parameter to a none string value!",i,t,n),this._finishParameterChange(n,s,o),this._updateCommonComponentDependencies(e)}changeComponentParameter(e,t,n,i,s,o){"string"==typeof i?this._kernelInstance.setComponentParameter(e,t,i):console.warn("tried to set a parameter to a none string value!",i,t,n),this._finishParameterChange(n,s,o),this._updateComponentDependencies(e)}changePlanObjectParameter(e,t,n,i,s,o){"string"==typeof i?this._kernelInstance.setPlanObjectParameter(e,t,i):console.warn("tried to set a parameter to a none string value!",i,t,n),this._finishParameterChange(n,s,o)}_finishParameterChange(e,t,n){-1===ASYNC_PARAMTER_CHANGES.indexOf(e)?setTimeout(()=>t(),0):this._configuratorKernelCallbackListener.forEach(e=>e.finishParameterChange(t,n))}requestDeleteComponents(e){e&&this._kernelInstance.deletePlanComponents(this._utilityToLongArray(e))}requestDeletePlanComponent(e){var t,n;e&&(null===(n=null===(t=this._initData)||void 0===t?void 0:t.featureFlags)||void 0===n?void 0:n.reDock)&&this._kernelInstance.deletePlanComponent(e)}loadComponentIntoKernel(e,t){this._kernelIo.setMeta({componentId:t}),this._kernelInstance.loadComponentDefinition(10,e)}async requestPartListAndUpdatePricesOfParts(e,t){let n=this._kernelInstance.getFullPartList();e||(e=this._kernelInstance.getHashOfConfiguration(this._configuratorContext.planObjectId));const i=await this.addUiDataAndPriceToPartList(n,e);this._configuratorUiCallbacks.onPartListUpdate(i,btoa(e))}requestSync(e,t){this.planObjectCreated(e,t),this._kernelInstance.syncPlanObjectToView(e,t)}getGlobalParameters(e,t){return new Promise(n=>{let i=this._kernelInstance.getPlanObjectParameters,s=e;t&&(i=this._kernelInstance.getComponentParameters,s=this._kernelInstance.getRootPlanComponentIdFromObjectId(e)),n(i.apply(this._kernelInstance,[s]))})}getPartList(){return new Promise(e=>{e(this._kernelInstance.getFullPartList())})}getConfigurationHash(e){return new Promise(t=>t(this._kernelInstance.getHashOfConfiguration(e.planObjectId)))}requestPlanObjectConstruction(e){this._kernelInstance.requestPlanObjectConstruction(e)}isReady(){super.isReady(),Benchmark.end("kernel_is_ready"),this._setupKernel(),Env.isProduction||(window.__RML__DEBUG__.Kernel=this._kernelInstance,window.__RML__DEBUG__.KernelContainer=this._kernelContainer,window.__RML__DEBUG__.Helper={convertCObject}),this._configuratorKernelAccessCallback.isReady(),this._configuratorUiCallbacks.onConfiguratorKernelIsReady(this._kernelContainer,this._kernelInstance),AppContext.planObjectId&&this.planObjectCreated(-1,AppContext.planObjectId)}_setupKernel(){1===this._kernelType&&(Benchmark.start("kernel_create_instance"),AppContext.kernelInstance?this._kernelInstance=AppContext.kernelInstance:this._kernelInstance=new this._kernelContainer.Kernel,Benchmark.end("kernel_create_instance")),this._initKernel()}onLoadComponentError(e,t){this._configuratorUiCallbacks.onComponentLoadError(e,t)}configurationLoaded(e,t,n,i,s,o){AsyncHelper.finishOperation(4,{conversationId:e,objectId:t,componentId:n,hash:i,errors:convertCObject(s)}),this._configuratorKernelCallbackListener.forEach(o=>o.configurationLoaded(e,t,n,i,s))}componentDefinitionLoaded(e,t){AsyncHelper.finishOperation(0,t)}componentDefinitionLoadingError(e,t){this._kernelIo.error(t),AsyncHelper.failOperation(0,new Error(t))}configurationLoadingError(e,t){let n="Configuration loading error";if(t){const e=convertCObject(t);Array.isArray(e)&&(n=e.join("\n"),e.forEach(e=>this._kernelIo.error(e)))}AsyncHelper.failOperation(4,new Error(n)),AsyncHelper.failOperation(2,new Error(n))}componentConfigurationUpdated(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.componentConfigurationUpdated(e,t)),this._kernelInstance.requestDeltaPlanComponentConstruction(e)}setActiveGroupInView(e){this._kernelInstance.setActiveGroupInView(e)}setActiveGroupInViewForPlanObject(e,t){this._kernelInstance.setActiveGroupInViewForPlanObject(e,t||this._configuratorContext.planObjectId)}componentParameters(){}requestComponentDimensions(){}planObjectCreated(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.planObjectCreated(e,t))}planObjectUpdated(e){const t=this._kernelInstance.getPlanObject(e);this._onBoundsUpdate(t),this._configuratorKernelCallbackListener.forEach(e=>e.planObjectUpdated(t))}planObjectConfigurationUpdated(e,t,n,i,s){this.updatePlanObjectDependencies(e);let o=this._kernelInstance.getComponent(this._kernelInstance.getRootPlanComponentIdFromObjectId(e));this._configuratorKernelCallbackListener.forEach(i=>i.planObjectConfigurationUpdated(e,t,n));const r=this._kernelInstance.getPlanObject(e);return this._onBoundsUpdate(r),this._configuratorHistory.push(t),this._updateConfigurationHasChildren(e,o),this.requestPartListAndUpdatePricesOfParts(n)}_onBoundsUpdate(e){if(!e.boxForMeasurement)return;const t={width:this._unitFormatter.formatMMValueToUnitString(e.boxForMeasurement.size.x),height:this._unitFormatter.formatMMValueToUnitString(e.boxForMeasurement.size.z),depth:this._unitFormatter.formatMMValueToUnitString(e.boxForMeasurement.size.y),kernelBounds:e.boxForMeasurement};this._configuratorUiCallbacks.onBoundsUpdate(t)}planObjectDeleted(){}requestPlanObjectDimensions(){}async requestExternalMesh(e,t){let n=()=>{};const i=new Promise((e,t)=>{n=e});let s;this.externalMeshQueue.push(i);try{s=await this._rapiAccess.getMesh(e,"crt",t)}catch(t){throw this._configuratorUiCallbacks.onError(new Error(`Mesh with id "${e}" can not be loaded. "${t}"`)),console.error(t),t}try{const i=await fetch(new Request(this._dataSyncer.requestAsset(s.url,!0))),o=await i.arrayBuffer();this._handleCortoMesh(o,e,t),n()}catch(t){throw this._configuratorUiCallbacks.onError(new Error(`Mesh with id "${e}" breaks. "${t}"`)),console.error(t),t}}Editor3dComponentCreated(e,t,n,i){this._configuratorKernelCallbackListener.forEach(s=>s.Editor3dComponentCreated(e,t,n,i,!1)),i&&i>0&&this._configuratorKernelCallbackListener.forEach(s=>s.Editor3dComponentDocked(e,i,t,n))}Editor3dRootComponentCreated(e,t,n,i){this._configuratorKernelCallbackListener.forEach(s=>s.Editor3dComponentCreated(e,t,n,i,!0))}Editor3dPlanObjectConstructionDone(e){this._configuratorKernelCallbackListener.forEach(t=>t.Editor3dPlanObjectConstructionDone(e)),this.updatePlanObjectDependencies(e),this._updateConfigurationHasChildren(e),Benchmark.end("ui_load_configuration"),this._initData.moc||this._calcPrice()}Editor3dBeginGroup(){}Editor3dEndGroup(){}Editor3dSetMaterial(){}Editor3dLoadMaterial(){}Editor3dAddDockPreview(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.Editor3dAddDockPreview(e,t))}Editor3dSetPreviewPointAssociations(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.Editor3dSetPreviewPointAssociations(e,t))}Editor3dSetPreviewLineAssociations(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.Editor3dSetPreviewLineAssociations(e,t))}Editor3dPreviewConstructionDone(e,t){this._configuratorKernelCallbackListener.forEach(n=>n.Editor3dPreviewConstructionDone(e,t))}Editor3dTranslateBy(){}Editor3dRotateBy(){}Editor3dRotateAround(){}Editor3dAddCube(){}Editor3dAddCubeUVMod(){}Editor3dAddSphere(){}Editor3dAddSphereUVMod(){}Editor3dAddRectangle(){}Editor3dAddRectangleUVMod(){}Editor3dAddMesh(){}Editor3dAddMeshUVMod(){}Editor3dAddMeshUVCoord(){}Editor3dAddCylinder(){}Editor3dAddCylinderUVMod(){}Editor3dAddPrism(){}Editor3dAddPrismUVMod(){}Editor3dAddFittingPoint(){}Editor3dAddFittingLine(){}Editor3dSelectObject(){}Editor3dCopy(){}Editor3dUpdatePlanObjectPosition(){}Editor3dUpdatePlanObjectRotation(){}Editor3dUpdatePlanObjectTransform(){}Editor3dUpdatePlanComponentPosition(){}Editor3dUpdatePlanComponentRotation(){}Editor3dUpdatePlanComponentTransform(){}getRuntimeComponentIdOfRootComponent(e){return this._kernelInstance?this._kernelInstance.getRootPlanComponentIdFromObjectId(e):(console.warn("this._kernelInstance not ready now"),0)}getRuntimeComponentId(e){return this._kernelInstance.getComponentId(e)}getParameterGroups(){if(!this._configuratorContext.planObjectId)return[];const e=this._kernelInstance.getRootPlanComponentIdFromObjectId(this._configuratorContext.planObjectId);return this._kernelInstance.getComponent(e).parameterGroups}resume(){this.muteKernelCallbacks||super.resume()}getSerializedConfiguration(e){return this._kernelInstance.getSerializedConfiguration(e)}createNewSerializedConfiguration(e){return this._kernelInstance.createNewSerializedConfiguration(e)}getCurrentConfigurationHash(e){return this._kernelInstance.getHashOfConfiguration(e)}listOfVariantsError(e,t){this._kernelIo.setMeta({rapiId:e}),this._kernelIo.error(t)}}__decorate([inject],ConfiguratorKernelAccess.prototype,"_memoryManager",void 0),__decorate([inject],ConfiguratorKernelAccess.prototype,"_configuratorKernelAccessCallback",void 0),__decorate([inject],ConfiguratorKernelAccess.prototype,"_initData",void 0),__decorate([inject],ConfiguratorKernelAccess.prototype,"_configuratorHistory",void 0);class NodePlanElementViewModel extends PlanElementViewModel{constructor(e){super(e);const t=this.getPlanElement().getMaxWallHeight();this._container.position.y=(t<0?2800:t)/1e3+.01,this._container.name="Node Plan Element",this.addMesh(this._nodeUiMesh)}update(){super.update(),this._container.position.y=this.getPlanElement().getMaxWallHeight()/1e3+.01}_initNodeMesh(){if(this._nodeUiMesh)return;const e=new THREE.SphereGeometry(.05,32),t=new THREE.MeshBasicMaterial({color:16777215});this._sphere=new THREE.Mesh(e,t);const n=new THREE.RingGeometry(.05,.07,32),i=new THREE.MeshBasicMaterial({color:0,side:THREE.DoubleSide});this._innerRingMesh=new THREE.Mesh(n,i),this._innerRingMesh.rotation.set(Math.PI/2,0,0);const s=new THREE.RingGeometry(.07,.08,32),o=new THREE.MeshBasicMaterial({color:16777215,side:THREE.DoubleSide});this._outerRingMesh=new THREE.Mesh(s,o),this._outerRingMesh.rotation.set(Math.PI/2,0,0),this._nodeUiMesh=new THREE.Mesh,this._nodeUiMesh.add(this._sphere),this._nodeUiMesh.add(this._innerRingMesh),this._nodeUiMesh.add(this._outerRingMesh)}setTopView(e){super.setTopView(e),e||(this._nodeUiMesh.visible=!1)}getSize(){return this._initNodeMesh(),(new THREE.Box3).setFromObject(this._nodeUiMesh).getSize(new THREE.Vector3)}show(){this._nodeUiMesh.visible=this._topView}hide(){this._nodeUiMesh.visible=!1}select(){this._innerRingMesh.material=new THREE.MeshBasicMaterial({color:10526880,side:THREE.DoubleSide}),super.select()}deselect(){this._innerRingMesh.material=new THREE.MeshBasicMaterial({color:0,side:THREE.DoubleSide}),super.deselect()}hoverOn(){this._sphere.geometry=new THREE.SphereGeometry(.07,32),this._innerRingMesh.geometry=new THREE.RingGeometry(.07,.07+.02,32),this._outerRingMesh.geometry=new THREE.RingGeometry(.07+.02,.1,32),super.hoverOn()}hoverOff(){this._sphere.geometry=new THREE.SphereGeometry(.05,32),this._innerRingMesh.geometry=new THREE.RingGeometry(.05,.07,32),this._outerRingMesh.geometry=new THREE.RingGeometry(.07,.08,32),super.hoverOff()}_generateBoundingBox(){const e=super._generateBoundingBox();return e.layers.set(9),e}}class ConstructionPlanObjectViewModel extends StaticPlanObjectViewModel{constructor(e){super(e),this._container.name="Construction "+this._container.name}setTopView(e){super.setTopView(e),e?this._enableTopView():this._disableTopView(),this._updateBoundingBox()}_enableTopView(){if(!this._topViewContainer){this._topViewContainer=new THREE.Group;const e=this.getPlanElement(),{x:t,z:n}=convertToThreeDimensions(e.size),i=new THREE.BoxGeometry(t,.01,n);if(this._topGreyMesh=new THREE.Mesh(i,new THREE.MeshStandardMaterial({transparent:!0,opacity:1,color:11645361})),this._topViewContainer.add(this._topGreyMesh),"window"===e.getObjectType()){const e=new THREE.BoxGeometry(t,.02,.05);this._topBlackMesh=new THREE.Mesh(e,new THREE.MeshStandardMaterial({transparent:!0,opacity:1,color:0})),this._topViewContainer.add(this._topBlackMesh)}this._topViewContainer.position.y=5,this._container.add(this._topViewContainer)}this._topViewContainer.visible=!0}_disableTopView(){this._topViewContainer&&(this._topViewContainer.visible=!1)}getPlanElement(){return super.getPlanElement()}_generateBoundingBox(){const e=super._generateBoundingBox(),t=this.getSize();return e.geometry=new THREE.BoxGeometry(t.x,this._topView?5:t.y,t.z),e}_updateBoundingBox(){super._updateBoundingBox();const e=this.getSize();this._boundingBox.geometry=new THREE.BoxGeometry(e.x,this._topView?5:e.y,e.z)}getTopViewContainer(){return this._topViewContainer}update(){if(super.update(),!this._topGreyMesh)return;const{x:e,z:t}=convertToThreeDimensions(this.getPlanElement().size);this._topGreyMesh.geometry=new THREE.BoxGeometry(e,.01,t),this._topBlackMesh&&(this._topBlackMesh.geometry=new THREE.BoxGeometry(e,.02,.05))}}class PlannerKernelAccess extends ConfiguratorKernelAccess{get kernelContainer(){return this._kernelContainer}constructor(e){super(e),this._plannerKernelCallbackListener=new Set}_loadSuccess(){super._loadSuccess(),window.RoomleCore&&window.RoomleCore(this._kernelContainer)}_loadError(){super._loadError(),console.error("kernel load error")}_createPlanInteractionHandler(){this._planInteractionHandler=new this._kernelContainer.PlanInteractionHandler,this._planInteractionHandler.init(this._planInteractionHandler,1,50,!!this._initData.snappingEnabled,!0,this._kernelContainer.DrawingType.CLICK_PER_CLICK),this._roomlePlannerUiCallback.onPlanInteractionHandlerCreated(this._planInteractionHandler)}addPlannerListener(e){this._plannerKernelCallbackListener.add(e)}removePlannerListener(e){this._plannerKernelCallbackListener.delete(e)}isReady(){super.isReady(),this.registerCallbacks(),this._roomlePlannerUiCallback.onPlannerKernelIsReady(this._kernelContainer),this._roomlePlannerUiCallback.onConfiguratorKernelIsReady(this._kernelContainer,this._kernelInstance),Env.isProduction||(window.__RML__DEBUG__.ConfiguratorKernel=this._kernelInstance,window.__RML__DEBUG__.PlannerKernelContainer=this._kernelContainer),this._kernelAccessCallback.isReady()}_setupKernel(){0===this._kernelType&&(this._createPlanInteractionHandler(),AppContext.kernelInstance?this._kernelInstance=AppContext.kernelInstance:this._kernelInstance=this._planInteractionHandler.getConfiguratorKernel()),super._setupKernel()}get callbacks(){return this._roomlePlannerUiCallback}get planInteractionHandler(){return this._planInteractionHandler}get planModelViewHelper(){return this._kernelContainer.PlanModelViewHelper}catalogItemLoaded(e){const t=this._rapiItemToKernelItem(e);this._kernelContainer.catalogItemLoaded(t)}async insertItems(e){this.planInteractionHandler.startInteraction();let t=new this._kernelContainer.CatalogItemPtrList;e.forEach(e=>{let n=e.count||1;for(let i=0;i<n;i++)e.count||(e.count=0),t.push_back(this._rapiItemToKernelItem(e))});const n=this.planInteractionHandler.getPlan().extRef.jsObject,i=n.getPlanObjectViewModelsFromRapiId().reduce((e,t)=>(e[t.getId()]=!0,e),{});this.planInteractionHandler.addPlanObjects(t,!0),await Promise.allSettled([Promise.allSettled(n.getStaticPlanObjectViewModels().map(async e=>{if(e.needsRapiItem()){const t=await this._rapiAccess.getItem(e.getPlanObject().getCatalogItemId());e.setRapiItem(t)}})),Promise.allSettled(n.getConfigurablePlanObjectViewModels().map(e=>e.isInitDone()))]);const s=n.getPlanObjectViewModelsFromRapiId().map(e=>e.getId()).filter(e=>!i[e]);return this.planInteractionHandler.endInteraction(),s}_rapiItemToKernelItem(e){let t=new this._kernelContainer.CatalogItem(e.id),n=t.size;return n.x=e.width||0,n.y=e.depth||0,n.z=e.height||0,t.size=n,t.flipable=e.flipable,e.layer&&(t.layer=e.layer),t.orderable=e.orderable,t.scaleable=e.scaleable,t.type=e.type||"other",t.detailType=e.detailType||t.type||"other",t.configuration=e.configuration||"",t}planObjectDeleted(){}requestPlanObjectDimensions(){}cleanUpCallbacks(){var e;super.cleanUpCallbacks(),(null===(e=this._kernelContainer)||void 0===e?void 0:e.unregisterPlannerCallback)&&this._kernelContainer.unregisterPlannerCallback(this)}registerCallbacks(){var e;super.registerCallbacks(),(null===(e=this._kernelContainer)||void 0===e?void 0:e.registerPlannerCallback)&&this._kernelContainer.registerPlannerCallback(this)}planElementRemoved(e){this._plannerKernelCallbackListener.forEach(t=>t.planElementRemoved(e)),this._plannerKernelCallbackListener.forEach(t=>t.removePlanObjectFromScene(e.extRef.jsObject)),this._decoupleReferences(e)}handlerSwitchedPlans(e,t){this._decoupleReferences(e),t&&this._plannerKernelCallbackListener.forEach(n=>n.handlerSwitchedPlans(e,t))}planBoundsChanged(){this._plannerKernelCallbackListener.forEach(e=>e.planBoundsChanged())}planCleared(){this._plannerKernelCallbackListener.forEach(e=>e.planCleared())}planCompletelyLoaded(e){this._plannerKernelCallbackListener.forEach(t=>t.planCompletelyLoaded(e))}planElement3dMeshChanged(e,t){if(t.extRef){const e=t.extRef.jsObject;for(let t=e.getObject().children.length-1;t>=0;t--)e.getObject().remove(e.getObject().children[t])}this.planModelViewHelper.requestMesh3d(t)}async _onStaticItemAdded(e,t){let n;n=this.isConstructionPlanElement(t)?new ConstructionPlanObjectViewModel(t):new StaticPlanObjectViewModel(t),this.coupleReferences(n,t),e.extRef.jsObject.addPlanElementViewModel(n);const i=t.getCatalogItemId();if(i){const e=await this._rapiAccess.getItem(i);n.setRapiItem(e),this._plannerKernelCallbackListener.forEach(e=>e.addPlanObjectToScene(n))}}_onConfigurableItemAdded(e,t){const n=new ConfiguratorPlanObjectViewModel(t);this.coupleReferences(n,t),e.extRef.jsObject.addPlanElementViewModel(n),this._plannerKernelCallbackListener.forEach(e=>e.addPlanObjectToScene(n))}async planElementAdded(e,t){if(e&&e.extRef)if(t.getType()===this._kernelContainer.PlanElementType.OBJECT)t.hasConfiguration()?this._onConfigurableItemAdded(e,t):await this._onStaticItemAdded(e,t);else{const n=t;let i;if(t.getType()===this._kernelContainer.PlanElementType.WALL?i=new WallPlanElementViewModel(n):t.getType()===this._kernelContainer.PlanElementType.FLOOR?i=new FloorPlanElementViewModel(n):t.getType()===this._kernelContainer.PlanElementType.CEILING?i=new CeilingPlanElementViewModel(n):t.getType()===this._kernelContainer.PlanElementType.NODE&&(i=new NodePlanElementViewModel(n)),!i)return;this.coupleReferences(i,n),e.extRef.jsObject.addPlanElementViewModel(i),i.setPrimaryColor(this._initData.colors.PRIMARY),this.planModelViewHelper.requestMesh3d(t),this._plannerKernelCallbackListener.forEach(e=>e.addPlanObjectToScene(null))}}planElementChanged(e,t){if(t.extRef){let n=t.extRef.jsObject;n.update(),this._plannerKernelCallbackListener.forEach(t=>t.planElementChanged(e,n))}}planHistoryStateChanged(){this.planInteractionHandler&&(this._plannerKernelCallbackListener.forEach(e=>e.planHistoryStateChanged()),this._roomlePlannerUiCallback.onHistoryChange(this.planInteractionHandler.isUndoPossible(),this.planInteractionHandler.isRedoPossible()))}planObjectConfigurationCreated(e,t){}planObjectConfigurationLoaded(e,t,n){e&&e.extRef&&t&&t.extRef&&t.extRef.jsObject.getPlanObject().getConfigurationRuntimeId()>0&&this._plannerKernelCallbackListener.forEach(i=>i.planObjectConfigurationLoaded(e,t,n))}requestCatalogItem(e){}startedDrawing(){this._plannerKernelCallbackListener.forEach(e=>e.startedDrawing())}stoppedDrawing(){this._plannerKernelCallbackListener.forEach(e=>e.stoppedDrawing())}updateMesh2d(){}beginConstruction(){}addMesh(e,t,n,i,s,o){this._plannerKernelCallbackListener.forEach(r=>r.addMesh(e,t,n,i,s,o))}endConstruction(){}beginPlanConstruction(e){this._plannerKernelCallbackListener.forEach(t=>t.beginPlanConstruction(e))}addPlanMesh(e,t,n,i,s,o,r){this._plannerKernelCallbackListener.forEach(a=>a.addPlanMesh(e,t,n,i,s,o,r))}endPlanConstruction(e){this._plannerKernelCallbackListener.forEach(t=>t.endPlanConstruction(e))}async addPlanObjectFromItem(e,t,n){if(!t&&!n){const t=await this.insertItems([e]);if(1!==t.length)throw new Error("It was expected that 1 element is added but"+t.length+"were added");return t[0]}n=n||0===n?n:0,t=t||{x:0,y:0,z:0};const i=this._planInteractionHandler.addPlanObjectFromItem(this._rapiItemToKernelItem(e),t,n,!1),s=this._planInteractionHandler.getPlan().extRef.jsObject;let o;return i.hasConfiguration()?(o=s.getConfigurablePlanObjectForId(i.getId()),o||console.warn("Could not find configuration")):(o=s.getStaticPlanObjectViewModelForId(i.getId()),o?await o.setRapiItem(e):console.warn("Could not find static item")),await o.isInitDone(),o.getId()}coupleReferences(e,t){let n=new this._kernelContainer.EMSReference;n.jsObject=e,t.extRef=n}_decoupleReferences(e){e&&e.extRef&&(e.extRef.jsObject.clearReference(),e.extRef.jsObject=null,e.extRef.delete(),e.extRef=null)}isConstructionPlanElement(e){return e instanceof this.kernelContainer.ConstructionObject}}__decorate([inject],PlannerKernelAccess.prototype,"_kernelAccessCallback",void 0),__decorate([inject],PlannerKernelAccess.prototype,"_roomlePlannerUiCallback",void 0);class PlannerMeshGenerator extends MeshGenerator{constructor(e){super(e),this._wallMeshes=[],this._defaultMaterial=new THREE.MeshPhysicalMaterial({color:"#ffffff",side:THREE.DoubleSide}),this._environmentLoader.setEnvMap(this._defaultMaterial),this._defaultMaterialFloor=new THREE.MeshPhysicalMaterial({color:"#ffffff"}),this._environmentLoader.setEnvMap(this._defaultMaterialFloor),this._environmentLoader.onEnvMapUpdate(()=>{this._environmentLoader.setEnvMap(this._defaultMaterial),this._environmentLoader.setEnvMap(this._defaultMaterialFloor)})}generateGeometry(e=null,t,n,i,s,o=!1){let r;return r=o?this._generateGeometry(e,t,n,i,s).clone():this._generateGeometry(e,t,n,i,s),r}generateMesh(e=0,t=null,n,i,s,o,r,a,l=!1,c){let h;h=l?this._generateGeometry(t,i,s,o,r).clone():this._generateGeometry(t,i,s,o,r);const d=this._createMesh(e,t,h);return d.userData.materialId=n,d.layers.set(4),n&&this.setMaterial(d,n,a,c).then(()=>{e&&t&&n&&this._geometryComponentMaterialCache.set(this._getComponentMeshId(e,t),n);const i=a&&3===a.value,s=a&&1===a.value;d.castShadow=!i&&!s}),this._checkWallMaterial(d,a),d}async setMaterial(e,t,n,i){if(e.userData.materialId=getMaterialId(t,n),isString(t))t?await this._assignMaterial(e,t,i):(console.warn("Used default material because material is empty"),this.changeMaterialOfMesh(e,this._getDefaultMaterial(n)));else{if(!t)return void this.changeMaterialOfMesh(e,this._configuratorPreviewMaterial);2===(t=t).getSourceType().value?await this._assignMaterial(e,t.materialId,i):1===t.getSourceType().value?await this._assignItem(e,t.catalogItemId):3===t.getSourceType().value?await this._assignRGB(e,t.rgbValue):0===t.getSourceType().value?this.changeMaterialOfMesh(e,this._getDefaultMaterial(n)):(this.changeMaterialOfMesh(e,this._getDefaultMaterial(n)),1!==n.value&&7!==n.value&&3!==n.value&&console.warn("Used default material because material is not supported",t))}}_getDefaultMaterial(e){return 3===(null==e?void 0:e.value)?this._defaultMaterialFloor:this._defaultMaterial}set maxAnisotropy(e){this._maxAnisotropy=e}_checkWallMaterial(e,t){t&&1===t.value&&(e.renderOrder=5,this._wallMeshes.push(e))}clear(){super.clear(),this.clearWallMeshes()}clearWallMeshes(){this._wallMeshes.forEach(e=>{disposeMesh(e)}),this._wallMeshes=[]}get wallMeshes(){return this._wallMeshes}}let KERNEL_UNIT={InchFeet:null,Feet:null,MM:null,CM:null,Inch:null},KERNEL_UNIT_STRING_TYPE={NoUnitString:null,LongUnitString:null,ShortUnitString:null};const METRIC_UNIT_TYPES=["mm","cm","feet"],IMPERIAL_UNIT_TYPES=["inch","inchfeet"];class UnitFormatter{constructor(e){this._formatter=null,this._precision=0,this._creator_=e}init(e){const t=new e.UnitMeasureFormatter;KERNEL_UNIT=e.Unit,KERNEL_UNIT_STRING_TYPE=e.UnitStringType,this._initActualUnit(),this._initMeasurementSystemType(),this._initActualUnitStringType();const{precisionCm:n,precisionInch:i}=this._initData;this._actualUnit===KERNEL_UNIT.InchFeet?this._precision=void 0!==i?parseInt(i,10):2:this._actualUnit===KERNEL_UNIT.CM&&(this._precision=void 0!==n?parseInt(n,10):1),t.init("mm","cm","'","ft",'"',"inch","m²","sqft",!0,this._precision,!0),this._formatter=t}_initMeasurementSystemType(){let{measurementSystem:e,unit:t}=this._initData;if(this._actualMeasurementString=e,e||!t){if("metric"===e){t||(t="cm");const e=METRIC_UNIT_TYPES.find(e=>e===t);e?(this._actualUnit=this._getKernelUnitEnum(t),this._actualUnitString=e):(console.warn("Unit is not a metric unit, using CM"),this._actualUnit=KERNEL_UNIT.CM,this._actualUnitString="cm")}if("imperial"===e){t||(t="inch");const e=IMPERIAL_UNIT_TYPES.find(e=>e===t);e?(this._actualUnit=this._getKernelUnitEnum(t),this._actualUnitString=e):(console.warn("Unit is not an imperial unit, using Inches"),this._actualUnit=KERNEL_UNIT.Inch,this._actualUnitString="inch")}}else{this._actualUnitString=t;const e=METRIC_UNIT_TYPES.find(e=>e===t);this._actualMeasurementString=e?"metric":"imperial"}}_initActualUnit(){const{unit:e}=this._initData;this._actualUnit=this._getKernelUnitEnum(e)}_getKernelUnitEnum(e){switch(e){case"cm":return KERNEL_UNIT.CM;case"mm":return KERNEL_UNIT.MM;case"inchfeet":return KERNEL_UNIT.InchFeet;case"feet":return KERNEL_UNIT.Feet;case"inch":return KERNEL_UNIT.Inch;default:return KERNEL_UNIT.CM}}_initActualUnitStringType(){const{unitStringType:e}=this._initData;e&&"short"!==e&&console.warn("Only short unit strings is supported at the moment"),this._actualUnitStringType=KERNEL_UNIT_STRING_TYPE.ShortUnitString}_isFormatterReady(){return!!this._formatter||(console.warn("Formatter is not ready..."),!1)}formatAngleValueToUnitString(e,t){const n="Integer"===t.type?0:2;return e.toFixed(n)+"°"}parseAngleValueFromUnitString(e){return e.replace("°","").replace(/\s/g,"")}parseValue(e,t){return null===t.unitType||"unknown"===t.unitType||"count"===t.unitType?e:"length"===t.unitType?this.parseMMValueFromUnitString(e,t.unitType):"angle"===t.unitType||"area"===t.unitType?this.parseAngleValueFromUnitString(e):e}formatValueToUnitString(e,t){return null===t.unitType||"unknown"===t.unitType||"count"===t.unitType?"Integer"===t.type?e.toString():parseFloat(e.toString()).toFixed(2):"length"===t.unitType?this.formatMMValueToUnitString(e,t.unitType):"angle"===t.unitType?this.formatAngleValueToUnitString(e,t):"area"===t.unitType?this.formatSquareMMValueToUnitString(e):e}isParseableNumber(e){return this._isFormatterReady()?this._formatter.isParseableNumber(e):null}isParseableUnitString(e,t){return this._isFormatterReady()?"angle"===t.unitType?this._formatter.isParseableUnitString(this.parseAngleValueFromUnitString(e),this._actualUnit):this._formatter.isParseableUnitString(e,this._actualUnit):null}parseMMValueFromUnitString(e,t){return this._isFormatterReady()?"count"===t?parseFloat(e):this._formatter.parseMMValueFromUnitString(e,this._actualUnit):null}parseNumber(e){return this._isFormatterReady()?this._formatter.parseNumber(e):null}formatNumber(e,t=0){return this._isFormatterReady()?this._formatter.formatNumber(e,t):null}formatSquareMMValueToUnitString(e){return this._isFormatterReady()?this._formatter.formatSquareMMValueToUnitString(e,this._actualUnit):null}formatMMValueToUnitString(e,t){return this._isFormatterReady()?"count"===t?e.toString():this._formatter.formatMMValueToUnitString(e,this._actualUnit,this._actualUnitStringType):null}formatMMValueWithReqMaxLength(e,t){return this._isFormatterReady()?this._formatter.formatMMValueWithReqMaxLength(e,this._actualUnit,t):null}_formatParameterValue(e,t){return"length"===t?this.formatMMValueToUnitString(parseFloat(e)):"area"===t?this.formatSquareMMValueToUnitString(parseFloat(e)):e}formatPartListParameter(e){(function(e){return"length"===e.unitType||"area"===e.unitType})(e)&&(e.valueLabel=this._formatParameterValue(e.value,e.unitType))}formatParameter(e){if(e.valueLabel=this._formatParameterValue(e.value,e.unitType),isMaterial(e))e.uiType="Material";else if(function(e){return"Boolean"===e.type}(e))e.uiType="Boolean";else if(isRange(e)){e.uiType="Range";const t=null!==e.validRange.valueFrom?e.validRange.valueFrom:Number.MIN_SAFE_INTEGER,n=null!==e.validRange.valueTo?e.validRange.valueTo:Number.MAX_SAFE_INTEGER;e.validRangeLabels={valueFrom:this._formatParameterValue(t.toString(),e.unitType),valueTo:this._formatParameterValue(n.toString(),e.unitType),type:e.validRange.type}}else isOptions(e)?(e.uiType="Options",function(e){return!!isOptions(e)&&Array.isArray(e.validValues)&&e.validValues.length>0&&"string"==typeof e.validValues[0].thumbnail}(e)&&(e.uiType="Thumbnails")):(console.error("Could not detect uiType of param"),e.uiType=null)}isInch(){return this._actualUnit===KERNEL_UNIT.InchFeet}getActualUnitString(){return this._actualUnitString}getActualMeasurementString(){return this._actualMeasurementString}getUnitStringType(){return this._initData.unitStringType}getPrecision(){return this._precision}getAllowedDelta(){const e=1/Math.pow(10,this._precision);return this.isInch()?25.4*e:e}setUnitInitData(e,t=""){this._initData.unit=e,this._initData.measurementSystem=t,this._initActualUnit(),this._initMeasurementSystemType(),this._initActualUnitStringType(),this._plannerKernelAccess.kernelInstance.setEnvironmentVariable("unit",this._actualUnitString)}}__decorate([inject],UnitFormatter.prototype,"_initData",void 0),__decorate([inject],UnitFormatter.prototype,"_plannerKernelAccess",void 0);class ConfiguratorHistory{constructor(e){this._history=[],this._index=0,this._creator_=e}undo(){if(!this.canUndo())return null;this._index++;const[e]=this._history.slice(this._index);return this._index===this._history.length-1?this._configuratorUiCallbacks.onHistoryChange(!1,!0):this._configuratorUiCallbacks.onHistoryChange(!0,!0),e}redo(){if(!this.canRedo())return null;this._index--;const[e]=this._history.slice(this._index);return 0===this._index?this._configuratorUiCallbacks.onHistoryChange(!0,!1):this._configuratorUiCallbacks.onHistoryChange(!0,!0),e}push(e){const[t]=this._history.slice(this._index);t!==e&&(this._history=this._history.slice(this._index),this._history.unshift(e),this._index=0,1===this._history.length?this._configuratorUiCallbacks.onHistoryChange(!1,!1):this._configuratorUiCallbacks.onHistoryChange(!0,!1))}canUndo(){return this._index!==this._history.length-1}canRedo(){return 0!==this._index}getHistory(){return this._history}clearHistory(){this._history=[],this._index=0}}__decorate([inject],ConfiguratorHistory.prototype,"_configuratorUiCallbacks",void 0);const PLAN_ELEMENT_CHANGE_TYPES={ADDED:"added",CHANGED:"changed",REMOVED:"removed"};class RoomleToolsCore{constructor(e){this._kernelCallbacks={isReady:()=>{},throw:e=>console.error("Kernel exception",e),log:e=>{},error:(e,t,n,i)=>{},message:e=>{this._analyzeComponentCallback&&this._analyzeComponentCallback(e)}},this._creator_=e}async init(){if(this._toolsCoreInstance)return Promise.resolve();const e=this,t={locateFile:e=>"RoomleToolsCore.wasm"===e?getAssetPath()+"static/RoomleToolsCore-8e01533d158e3291.wasm":e,wasmBinaryFile:getAssetPath()+"static/RoomleToolsCore-8e01533d158e3291.wasm",preRun:[],postRun:[],setStatus:null,print(t){e._kernelIo.log(t)},printErr(t){e._kernelIo.error(t)},quit(t){0!==t&&e._kernelIo.throw(t&&t.toString?t.toString():"Unknown error while C/C++ main executes")}};await this._scriptLoader.fetch("static/RoomleToolsCore-67c60f1f969b4be1.js",{id:"core-tool"});const n=await window.RoomleToolsCore(t);n.setContext(this._kernelCallbacks),this._toolsCoreInstance=new n.ToolsCore}analyzeComponent(e,t){const n=[];return this._analyzeComponentCallback=e=>{n.push(e)},this._toolsCoreInstance.analyzeComponent(e,t),this._analyzeComponentCallback=null,Promise.resolve(n)}}__decorate([inject],RoomleToolsCore.prototype,"_scriptLoader",void 0),__decorate([inject],RoomleToolsCore.prototype,"_kernelIo",void 0);const INJECTABLES=[new DependencyInjectionAssignment("error-handler",class{constructor(){this._listeners={}}_subscribe(e,t){this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(t)}subscribe(e,t){this._subscribe(e,t)}dispatch(e,t){if(!this._listeners[e])return;const n=this._listeners[e];let i=n.length;for(let e=0;e<i;e++){const i=n[e];i.apply(i,t)}}unsubscribe(e,t){if(!this._listeners[e])return;const n=this._listeners[e];let i=n.length;for(let e=0;e<i;e++)if(n[e]===t)return n.splice(e,1),i--,void e--}softReject(e,t,n){return this.dispatch(n,[t]),e()}}),new DependencyInjectionAssignment("form-data-util",FormDataUtil),new DependencyInjectionAssignment("environment-loader",EnvironmentLoader),new DependencyInjectionAssignment("static-item-loader",StaticItemLoader,0),new DependencyInjectionAssignment("form-data-util",FormDataUtil),new DependencyInjectionAssignment("single-promise-factory",class{constructor(e){this._promises=new Map,this._creator_=e}create(e,t,n){return new Promise((i,s)=>{let o=this._promises.get(e),r=!0;if(!o){const t=new Map;this._promises.set(e,t),o=this._promises.get(e),r=!1}o.get(t)||(o.set(t,[]),r=!1);const a=o.get(t);a.push({resolve:i,reject:s}),o.set(t,a);const l=()=>{o.delete(t),0===o.size&&this._promises.delete(e)};r||new Promise(n).then(e=>{o.get(t).forEach(({resolve:t})=>t(e)),l()},e=>{o.get(t).forEach(({reject:t})=>t(e)),l()})})}},1),new DependencyInjectionAssignment("dynamic-light-setting-loader",DynamicLightSettingLoader),new DependencyInjectionAssignment("dynamic-quality-setting-loader",DynamicQualitySettingLoader),new DependencyInjectionAssignment("network-layer",NetworkLayer),new DependencyInjectionAssignment("local-storage",class{constructor(e){this._context_=e}get _localStorage(){let e=null;try{e=window.localStorage}catch(e){console.error(e)}return e}getItem(e){if(!this._localStorage)return null;const t=this._localStorage.getItem(e);try{return JSON.parse(t)}catch(e){return t}}setItem(e,t){if(this._localStorage)try{const n=JSON.stringify(t);this._localStorage.setItem(e,n)}catch(e){console.error(e)}}}),new DependencyInjectionAssignment("network-layer",NetworkLayer),new DependencyInjectionAssignment("kernel-io",KernelIo,0),new DependencyInjectionAssignment("data-syncer",DataSyncer),new DependencyInjectionAssignment("memory-manager",class{constructor(){this._configurationStringSet=new Set,this._singleLoadCounter=0}loadingConfigurationString(){this._singleLoadCounter+=1}loadingConfiguration(e){this._configurationStringSet.add(e),this._singleLoadCounter+=1}shouldHardReset(){return this._configurationStringSet.size>=15||this._singleLoadCounter>=30}executedHardReset(){this._configurationStringSet.clear(),this._singleLoadCounter=0}}),new DependencyInjectionAssignment("life-cycle-manager",class{constructor(){this._listeners=[]}addEventListener(e){this._listeners.push(e)}removeEventListener(e){const t=this._listeners;let n=t.length;if(n)for(let i=0;i<n;i++)t[i]===e&&(t.splice(i,1),i--,n--)}pause(){this._listeners.forEach(e=>e.pause())}resume(){this._listeners.forEach(e=>e.resume())}destroy(){this._listeners.forEach(e=>e.destroy())}},1),new DependencyInjectionAssignment("three-loader",ThreeLoader),new DependencyInjectionAssignment("local-storage-helper",LocalStorageHelper),new DependencyInjectionAssignment("cache-holder",class{constructor(){this._componentCache=new Map,this._geometryCache=new Map,this._materialCache=new Map}get componentCache(){return this._componentCache}get geometryCache(){return this._geometryCache}get materialCache(){return this._materialCache}clear(){for(const e of this._componentCache.values())disposeObject(e);for(const e of this._materialCache.values())disposeMaterial(e);for(const e of this._geometryCache.values())disposeGeometry(e);this._componentCache.clear(),this._geometryCache.clear(),this._materialCache.clear()}},0),new DependencyInjectionAssignment("kernel-access-callback",class{constructor(e){this._callbackListener=new Set,this._creator_=e}addListener(e){this._callbackListener.add(e)}removeListener(e){this._callbackListener.delete(e)}isReady(){this._callbackListener.forEach(e=>e.isReady())}loadError(e){this._callbackListener.forEach(t=>t.loadError(e))}},1),new DependencyInjectionAssignment("configurator-kernel-access-callback",class{constructor(e){this._callbackListener=new Set,this._creator_=e}addListener(e){this._callbackListener.add(e)}removeListener(e){this._callbackListener.delete(e)}isReady(){this._callbackListener.forEach(e=>e.isReady())}updatePossibleChildren(e,t,n){this._callbackListener.forEach(i=>i.updatePossibleChildren(e,t,n))}updateParameters(e,t,n,i){this._callbackListener.forEach(s=>s.updateParameters(e,t,n,i))}loadError(e){this._callbackListener.forEach(t=>t.loadError(e))}},1),new DependencyInjectionAssignment("configurator-context",class{constructor(){this.planObjectId=0,this.planElementId=0,this.rootComponentId=0,this.dockingRootComponentId=0,this.baseContext=null,this.rootComponentParametersAsGlobal=!1,this.lastLoadedRapiId=null,this.selectedRuntimeComponentIds=[],this.selectionMode="standard"}get selectedRuntimeComponentId(){return this.selectedRuntimeComponentIds.length>0?this.selectedRuntimeComponentIds[0]:null}},1),new DependencyInjectionAssignment("init-data",InitData,1),new DependencyInjectionAssignment("global-init-data",GlobalInitData,0),new DependencyInjectionAssignment("global-callback",GlobalCallback,0),new DependencyInjectionAssignment("dom-helper",DomHelper,1),new DependencyInjectionAssignment("unit-formatter",UnitFormatter,0),new DependencyInjectionAssignment("plugin-system",PluginSystem,1),new DependencyInjectionAssignment("configurator-mesh-generator",ConfiguratorMeshGenerator),new DependencyInjectionAssignment("configurator-input-manager",class extends InputManager{},1),new DependencyInjectionAssignment("selection-handler",class extends EventDispatcher{constructor(){super(...arguments),this._selectionMode="standard",this._selectedComponents=new Map}check(e){"standard"===this._selectionMode&&this._checkStandard(e),"multiselect"===this._selectionMode&&this._checkMulti(e)}cancelSelection(){0!==this._selectedComponents.size&&this._selectedComponents.forEach((e,t)=>{e.deselect(),this._selectedComponents.delete(t),this.dispatchEvent(1,new SelectionHandlerEvent({component:e}))})}_checkStandard(e){this._selectedComponents.has(e.runtimeId)?this.dispatchEvent(0,new SelectionHandlerEvent({component:e,consecutive:!0})):(this._selectedComponents.size>0&&this._selectedComponents.forEach((e,t)=>{this._selectedComponents.delete(t),this.dispatchEvent(1,new SelectionHandlerEvent({component:e,resetCamera:!1}))}),this._selectedComponents.set(e.runtimeId,e),this.dispatchEvent(0,new SelectionHandlerEvent({component:e,consecutive:!1})))}_checkMulti(e){if(this._selectedComponents.has(e.runtimeId))return this._selectedComponents.delete(e.runtimeId),void this.dispatchEvent(1,new SelectionHandlerEvent({component:e,resetCamera:0===this._selectedComponents.size}));this._selectedComponents.set(e.runtimeId,e),this.dispatchEvent(0,new SelectionHandlerEvent({component:e}))}setSelectionMode(e){this._selectionMode=e}getSelectionMode(){return this._selectionMode}hasSelection(){return this._selectedComponents.size>0}getSelectedRuntimeComponentIds(){let e=[];return this._selectedComponents.forEach(t=>e.push(t.runtimeId)),e}isSelected(e){return this._selectedComponents.has(e.runtimeId)}},1),new DependencyInjectionAssignment("component-dimensioning-helper",ComponentDimensioningHelper,1),new DependencyInjectionAssignment("component-dimensioning-helper",ComponentDimensioningHelper,1),new DependencyInjectionAssignment("planner-kernel-access",PlannerKernelAccess),new DependencyInjectionAssignment("planner-mesh-generator",PlannerMeshGenerator,1),new DependencyInjectionAssignment("unit-formatter",UnitFormatter),new DependencyInjectionAssignment("configurator-history",ConfiguratorHistory,1),new DependencyInjectionAssignment("roomle-planner-ui-callback",class extends UiCallback{constructor(e){super(e),this.onItemsLoaded=()=>{},this.onCameraChanged=e=>{},this.onCameraIdle=()=>{},this.onTotalFloorAreaChanged=e=>{},this.onPlanInteractionHandlerCreated=e=>{},this.onPlannerKernelIsReady=e=>{},this.onConfiguratorKernelIsReady=(e,t)=>{},this.onSelectionChange=(e,t,n,i,s)=>{},this.onSelectionCancel=e=>{},this.onPlanChanged=()=>{},this.onPlanElementChanged=(e,t)=>{},this.onCompletelyLoaded=()=>{},this.onRotationCancel=()=>{},this.onHistoryChange=(e,t)=>{},this.onUpdateWallDimensions=e=>{},this.disableWallDimensions=()=>{},this.onUpdatePlanObjectPositions=e=>{},this.onDrawCancel=()=>{},this.onHandlerSwitchedPlans=()=>{},this.onDragElementStart=()=>{},this.onDragElementEnd=()=>{},this.onClickElement=e=>{},this.onMultiSelectionChange=e=>{}}}),new DependencyInjectionAssignment("configurator-ui-callbacks",class 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,i)=>{},this.onSelectionCancel=()=>{},this.onPartListUpdate=(e,t)=>{},this.onBoundsUpdate=e=>{},this.onLoadConfiguration=()=>{},this.onConfigurationReady=(e,t,n)=>{},this.onOpenTag=e=>{},this.onOpenAddOns=()=>{},this.onClickOutside=()=>{},this.onNoDockingsAvailable=()=>{},this.onUiIntersectionChange=e=>{},this.onZoomChange=(e,t)=>{},this.onZoomToComponent=()=>{},this.onDimensionsVisibilityChange=e=>{},this.onErrorDueToOffline=e=>{},this.onError=e=>{},this.onDockingsPreviewRemoved=()=>{},this.onConfigurationHasChildren=e=>{},this.onTrackTiming=(e,t,n,i)=>{},this.onUserInitiatedDockDone=(e,t,n,i,s)=>{},this.onAddonPlusHover=()=>{},this.onAddonPlusHoverOff=()=>{},this.onAddonPlusShown=()=>{},this.onAddonPlusHidden=()=>{},this.onContentProblem=e=>{},this.onSyncStarted=()=>{},this.onSyncDone=()=>{},this.onOpenFloorMaterials=()=>{},this.onOpenPartList=()=>{},this.onComponentLoadError=(e,t)=>{},this.onConfigurationLoadError=()=>{},this.onChangeTypeChangeTag=e=>{},this.onRemoveTypeChangeTag=e=>{},this.onConfigurationLabelChange=(e,t,n)=>{},this.onMemoryCorruption=()=>{},this.onConfiguratorKernelIsReady=(e,t)=>{},this.onConfigurationSaved=e=>{},this.onCameraPositionChanges=()=>{},this.onHistoryChange=(e,t)=>{},this.onClickComponent=e=>{}}},1),new DependencyInjectionAssignment("roomle-tools-core",RoomleToolsCore,0)];class RoomleDependencyInjection{static _ensureContainer(){window.__RML__DI__||(window.__RML__DI__=new Container,window.__RML__DI__.addDependencyInjectionAssignments(INJECTABLES))}static setup(e){RoomleDependencyInjection.addToContainer(e)}static lookup(e,t){return window.__RML__DI__?window.__RML__DI__.lookup(e,t):null}static getContext(e){return RoomleDependencyInjection._ensureContainer(),window.__RML__DI__.getContext(e)}static cleanUp(e){return window.__RML__DI__?window.__RML__DI__.cleanUp(e):null}static addToContainer(e){RoomleDependencyInjection._ensureContainer(),window.__RML__DI__.addDependencyInjectionAssignments(e)}}export{addTexture as $,AppContext as A,Benchmark as B,ConfiguratorViewModel as C,DependencyInjectionAssignment as D,EventDispatcher as E,FloorPlanElementViewModel as F,getCatalogIdFromItemOrConfigurationId as G,isIdItemId as H,INJECTABLES as I,AsyncHelper as J,isRange as K,Logger as L,isMaterial as M,NodePlanElementViewModel as N,convertCObject as O,PlannerKernelAccess as P,position3VectorsAreEqual as Q,RapiAccess as R,StaticPlanObjectViewModel as S,position2VectorsAreEqual as T,compareBox3Size as U,AsyncGuard as V,WallPlanElementViewModel as W,vectorIsEqual as X,fadeIn as Y,createMaterial as Z,__decorate as _,DataSyncer as a,rotationQuaternionsAreEqual as a0,getDelta as a1,MIN_MOVE_DISTANCE as a2,sanitizedCameraMode as a3,DynamicQualitySettingLoader as a4,transitionTransparencyOfMaterial as a5,isSafari as a6,convertToTHREE as a7,threeVectorToTransferableXY as a8,PLAN_ELEMENT_CHANGE_TYPES as a9,hideWallsBasedOnCamera as aa,setWallTransparency as ab,getDrawingMinBounds as ac,wallDimensionToTransferable as ad,isPlanSnapshotId as ae,GLTF_LOADER_FILE_NAME as af,DRACO_LOADER_FILE_NAME as ag,InputManager as ah,PlannerMeshGenerator as ai,setMaterial as aj,getMaterialShading as ak,addExistingTexture as al,UiCallback as am,EnvironmentLoader as an,ConfiguratorMeshGenerator as ao,GlobalCallback as ap,GlobalInitData as aq,InitData as ar,AsyncDependencyLoader as as,ScenePluginDefaultImplementation as at,RoomleDependencyInjection as b,ConfiguratorPlanObjectViewModel as c,ConstructionPlanObjectViewModel as d,CAMERA_TYPE as e,CeilingPlanElementViewModel as f,disposeMesh as g,convertToKernel as h,inject as i,getScreenXY as j,kernelBoxToThreeBox as k,getGUI as l,toDegrees as m,CANVAS_ID as n,Env as o,PULSE_LOOPS as p,PULSE_DURATION as q,DynamicLightSettingLoader as r,PREDEFINED_LIGHTSETTING as s,toRadiant as t,dispose as u,vectorIsZero as v,getYRotationOfObject as w,getIdealDistance as x,RoomleComponentFactoryInitializer as y,DEFAULT_CONVERSATION_ID as z};
|
|
16
|
-
//# sourceMappingURL=roomle-dependency-injection-f7298e7e.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"roomle-dependency-injection-f7298e7e.js","sources":["../../packages/common-core/public/textures/env/roomle.envmap","../../packages/common-core/public/textures/env/roomle64.envmap","../../packages/common-core/public/predefined_lightsettings/shelf.json","../../packages/common-core/public/predefined_lightsettings/shelf_front.json","../../packages/common-core/public/predefined_lightsettings/sofa.json","../../packages/common-core/public/predefined_lightsettings/baked.json","../../packages/common-core/public/predefined_lightsettings/camera.json","../../packages/common-core/public/predefined_lightsettings/equal.json","../../packages/workers/generated/asset-loader.worker.js","../../node_modules/three/examples/js/loaders/GLTFLoader.js","../../node_modules/three/examples/js/loaders/DRACOLoader.js","../../node_modules/three/examples/js/libs/draco/draco_wasm_wrapper.js","../../node_modules/three/examples/js/libs/draco/draco_decoder.wasm","../../node_modules/three/examples/js/libs/draco/draco_decoder.js","../../packages/common-core/generated/shaders.json","../../packages/common-core/generated/rthree.js","../../packages/configurator-core/public/fonts/rubik_regular.json","../../node_modules/roomle-core-hsc/wasm/ConfiguratorKernel.wasm","../../node_modules/roomle-core-hsc/wasm/ConfiguratorKernel.js","../../node_modules/roomle-core-hsc/wasm/RoomleCore.wasm","../../node_modules/roomle-core-hsc/wasm/RoomleCore.js","../../node_modules/roomle-core-hsc/ConfiguratorKernelJs.mem","../../node_modules/roomle-core-hsc/ConfiguratorKernelJs.js","../../node_modules/roomle-core-hsc/RoomleCoreJs.mem","../../node_modules/roomle-core-hsc/RoomleCoreJs.js","../../node_modules/roomle-core-hsc/wasm/RoomleToolsCore.wasm","../../node_modules/roomle-core-hsc/wasm/RoomleToolsCore.js"],"sourcesContent":["export default \"static/roomle-91862a5e7f3f46e5.envmap\"","export default \"static/roomle64-adb0f447a54b5143.envmap\"","export default \"static/shelf-2975dd3f2fa9c763.json\"","export default \"static/shelf_front-8c9566a4512f0de8.json\"","export default \"static/sofa-997b116bc5f2e92e.json\"","export default \"static/baked-6485a2b1daeb69e8.json\"","export default \"static/camera-05824b47cdb951e4.json\"","export default \"static/equal-319f6b83c827913f.json\"","export default \"static/asset-loader.worker-d8f85c01953acd85.js\"","export default \"static/GLTFLoader-5b296b5fb14cfe1a.js\"","export default \"static/DRACOLoader-5edeeab4a8dbc0bd.js\"","export default \"static/draco_wasm_wrapper-d775f9f135cb30ff.js\"","export default \"static/draco_decoder-979e668167e37c95.wasm\"","export default \"static/draco_decoder-3866672a1fa2f980.js\"","export default \"static/shaders-940522a5e460efd1.json\"","export default \"static/rthree-750136f8399d9f72.js\"","export default \"static/rubik_regular-bc008a7de2daee79.json\"","export default \"static/ConfiguratorKernel-310ba00d200a8545.wasm\"","export default \"static/ConfiguratorKernel-7096080bf4b9000d.js\"","export default \"static/RoomleCore-4786ec5282f5b33e.wasm\"","export default \"static/RoomleCore-5d974f97607414ba.js\"","export default \"static/ConfiguratorKernelJs-5b42a6fd73f68a93.mem\"","export default \"static/ConfiguratorKernelJs-a8b57304eef356ee.js\"","export default \"static/RoomleCoreJs-e3c865faff71cf27.mem\"","export default \"static/RoomleCoreJs-76b8a01b07b0a763.js\"","export default \"static/RoomleToolsCore-8e01533d158e3291.wasm\"","export default \"static/RoomleToolsCore-67c60f1f969b4be1.js\""],"names":[],"mappings":";;;;;;;;;;;;;;yvYAAe,+DCAA,qvECAA,yGCAA,wGCAA,kGCAA,oGCAA,oGCAA,wEDAA,w4KEAA,6tHCAf,0BAAe,+DCAA,wFCAA,qECAA,gECAA,uOJAA,uFCAA,ioEIAA,2QCAA,kq1BCAA,6mcCAA,yDCAA,8DCAA,iDCAA,qECAA,0DCAA,oECAA,kDCAA,ouhGCAA,+EAAA,0RCAA"}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{b as RoomleDependencyInjection,D as DependencyInjectionAssignment,R as RapiAccess,ap as GlobalCallback,aq as GlobalInitData,ar as InitData}from"./roomle-dependency-injection-f7298e7e.js";import"./main-thread-to-worker-1651b1df.js";export default class{static getConfigurator(e,n){return n=this._setupDI("configurator",e,n),new Promise((e,t)=>import("./configurator-a73acc5a.js").then(({Configurator:t})=>e(new t(n)),t))}static getPlanner(e,n){return n=this._setupDI("planner",e,n),new Promise((e,t)=>import("./planner-b018f99c.js").then(({Planner:t})=>e(new t(n)),t))}static async getGlbViewer(e,n){return n=this._setupDI("glb-viewer",e,n),new Promise((e,t)=>import("./glb-viewer-305d8bd7.js").then(({GlbViewer:t})=>e(new t(n)),t))}static getMaterialViewer(e,n){return n=this._setupDI("configurator",e,n),new Promise((e,t)=>import("./material-viewer-5324de36.js").then(({MaterialViewer:t})=>e(new t(n)),t))}static getCoreTools(e,n){return n=this._setupDI("tools-core",e,n),new Promise((e,t)=>import("./tools-core-d85bfa17.js").then(({ToolsCore:t})=>{const o=new t(n);o.boot(),e(o)},t))}static getRapiAccess(){return RoomleDependencyInjection.addToContainer([new DependencyInjectionAssignment("rapi-access",RapiAccess,0),new DependencyInjectionAssignment("global-callback",GlobalCallback,0)]),Promise.resolve(RoomleDependencyInjection.lookup("rapi-access"))}static get callbacks(){return RoomleDependencyInjection.addToContainer([new DependencyInjectionAssignment("global-callback",GlobalCallback,0)]),Promise.resolve(RoomleDependencyInjection.lookup("global-callback"))}static setGlobalInitData(e){e&&(RoomleDependencyInjection.addToContainer([new DependencyInjectionAssignment("global-init-data",GlobalInitData,0)]),RoomleDependencyInjection.lookup("global-init-data").setOverrides(e))}static getContext(e){return RoomleDependencyInjection.getContext(e)}static _setupDI(e,n,t){return n&&(RoomleDependencyInjection.addToContainer([new DependencyInjectionAssignment("init-data",InitData,1)]),t||(t=RoomleDependencyInjection.getContext(e)),RoomleDependencyInjection.lookup("init-data",t).setOverrides(n)),t}}
|
|
2
|
-
//# sourceMappingURL=roomle-sdk-f9cc3d20.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"roomle-sdk-f9cc3d20.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
System.register(["./query-params-helper-c231e1b8.nomodule.js","./roomle-dependency-injection-7dcab742.nomodule.js","./main-thread-to-worker-b7956e5b.nomodule.js"],(function(e){var t,o,n,i,_,s,r;return{setters:[function(e){t=e.g},function(e){o=e.b,n=e.B,i=e.I,_=e._,s=e.i},function(e){r=e.g}],execute:function(){e("M",class{constructor(e){this._context=e||o.getContext(this.getContextName()),n.start("loadingTime")}_setupCommonGlobals(){window.__RML__DEBUG__||(window.__RML__DEBUG__={}),window.__RML__ENV__||(window.__RML__ENV__={},window.__RML__ENV__.assetPath||(window.__RML__ENV__.assetPath=""))}_setupCommonDependencies(){o.setup(i);const e=t();this.lookup("global-init-data").setOverrides(e),this.lookup("init-data",this._context).setOverrides(e)}_cleanUpCommonGlobals(){window.__RML__DEBUG__&&(window.__RML__DEBUG__.Kernel&&window.__RML__DEBUG__.Kernel.clearAll&&window.__RML__DEBUG__.Kernel.clearAll(),delete window.__RML__DEBUG__),delete window.__RML__ENV__;for(const e in window.THREE)if(window.THREE.hasOwnProperty(e))try{delete window.THREE[e]}catch(e){console.error(e)}window.THREE=void 0}_cleanUpCommonDependencies(){}boot(e){this._setupCommonGlobals(),this._setupCommonDependencies(),this.setupGlobals(e),this.setupDependencies(),this.bootFinished()}lookup(e,t){return window.__RML__DI__.lookup(e,t)}teardown(){this.cleanUpDependencies(),this._cleanUpCommonDependencies(),this.cleanUpGlobals(),this._cleanUpCommonGlobals(),window.__RML__DI__&&delete window.__RML__DI__}pause(){this.lookup("life-cycle-manager",this._context).pause(),window.TWEEN&&TWEEN.removeAll()}resume(e){e&&this.lookup("dom-helper",this._context).setDomElement(e),this.lookup("life-cycle-manager",this._context).resume()}destroy(){this.pause(),this.lookup("life-cycle-manager",this._context).destroy(),o.cleanUp(this._context)}getRapiAccess(){return this.lookup("rapi-access",this._context)}});let l={},c={};class d{constructor(e){this._creator_=e}fetch(e,t){return this._singlePromiseFactory.create(5,e,(o,i)=>{!function(e,t,o,i){if(-1===e.indexOf("http")&&(e=r()+e),l[e])return o();if(t.id&&c[t.id])return i(new Error('There is already a script with ID "'+t.id+'"'));const _=n.start("load_"+t.id.replace(/-/g,"_")),s=document.createElement("script");s.async=!1,s.src=e,s.id=t.id,s.onload=()=>{l[e]=!0,c[t.id]=!0,n.end(_),Object.defineProperty(o,"name",{value:"resolve-"+t.id}),o()},s.onerror=e=>{i(e)},document.body.appendChild(s)}(e,t,o,i)})}loadScripts(e){const t=[];return e.forEach(e=>{let o=this.fetch(e.name,{id:e.id});t.push(o)}),Promise.all(t)}cleanUp(){for(let e in c)if(c.hasOwnProperty(e)){const t=document.getElementById(e);t&&t.parentElement.removeChild(t)}l={},c={}}}e("S",d),_([s],d.prototype,"_singlePromiseFactory",void 0)}}}));
|
|
2
|
-
//# sourceMappingURL=script-loader-17506a98.nomodule.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"script-loader-17506a98.nomodule.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{g as getAllParameters}from"./query-params-helper-a271f9dc.js";import{b as RoomleDependencyInjection,B as Benchmark,I as INJECTABLES,_ as __decorate,i as inject}from"./roomle-dependency-injection-f7298e7e.js";import{g as getAssetPath}from"./main-thread-to-worker-1651b1df.js";class Main{constructor(e){this._context=e||RoomleDependencyInjection.getContext(this.getContextName()),Benchmark.start("loadingTime")}_setupCommonGlobals(){window.__RML__DEBUG__||(window.__RML__DEBUG__={}),window.__RML__ENV__||(window.__RML__ENV__={},window.__RML__ENV__.assetPath||(window.__RML__ENV__.assetPath=""))}_setupCommonDependencies(){RoomleDependencyInjection.setup(INJECTABLES);const e=getAllParameters();this.lookup("global-init-data").setOverrides(e),this.lookup("init-data",this._context).setOverrides(e)}_cleanUpCommonGlobals(){window.__RML__DEBUG__&&(window.__RML__DEBUG__.Kernel&&window.__RML__DEBUG__.Kernel.clearAll&&window.__RML__DEBUG__.Kernel.clearAll(),delete window.__RML__DEBUG__),delete window.__RML__ENV__;for(const e in window.THREE)if(window.THREE.hasOwnProperty(e))try{delete window.THREE[e]}catch(e){console.error(e)}window.THREE=void 0}_cleanUpCommonDependencies(){}boot(e){this._setupCommonGlobals(),this._setupCommonDependencies(),this.setupGlobals(e),this.setupDependencies(),this.bootFinished()}lookup(e,t){return window.__RML__DI__.lookup(e,t)}teardown(){this.cleanUpDependencies(),this._cleanUpCommonDependencies(),this.cleanUpGlobals(),this._cleanUpCommonGlobals(),window.__RML__DI__&&delete window.__RML__DI__}pause(){this.lookup("life-cycle-manager",this._context).pause(),window.TWEEN&&TWEEN.removeAll()}resume(e){e&&this.lookup("dom-helper",this._context).setDomElement(e),this.lookup("life-cycle-manager",this._context).resume()}destroy(){this.pause(),this.lookup("life-cycle-manager",this._context).destroy(),RoomleDependencyInjection.cleanUp(this._context)}getRapiAccess(){return this.lookup("rapi-access",this._context)}}let _scriptCache={},_idCache={};class ScriptLoader{constructor(e){this._creator_=e}fetch(e,t){return this._singlePromiseFactory.create(5,e,(o,n)=>{!function(e,t,o,n){if(-1===e.indexOf("http")&&(e=getAssetPath()+e),_scriptCache[e])return o();if(t.id&&_idCache[t.id])return n(new Error('There is already a script with ID "'+t.id+'"'));const i=Benchmark.start("load_"+t.id.replace(/-/g,"_")),_=document.createElement("script");_.async=!1,_.src=e,_.id=t.id,_.onload=()=>{_scriptCache[e]=!0,_idCache[t.id]=!0,Benchmark.end(i),Object.defineProperty(o,"name",{value:"resolve-"+t.id}),o()},_.onerror=e=>{n(e)},document.body.appendChild(_)}(e,t,o,n)})}loadScripts(e){const t=[];return e.forEach(e=>{let o=this.fetch(e.name,{id:e.id});t.push(o)}),Promise.all(t)}cleanUp(){for(let e in _idCache)if(_idCache.hasOwnProperty(e)){const t=document.getElementById(e);t&&t.parentElement.removeChild(t)}_scriptCache={},_idCache={}}}__decorate([inject],ScriptLoader.prototype,"_singlePromiseFactory",void 0);export{Main as M,ScriptLoader as S};
|
|
2
|
-
//# sourceMappingURL=script-loader-c9cba6e8.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"script-loader-c9cba6e8.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
THREE.CopyShader={uniforms:{tDiffuse:{value:null},opacity:{value:1}},vertexShader:["varying vec2 vUv;","void main() {","\tvUv = uv;","\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );","}"].join("\n"),fragmentShader:["uniform float opacity;","uniform sampler2D tDiffuse;","varying vec2 vUv;","void main() {","\tvec4 texel = texture2D( tDiffuse, vUv );","\tgl_FragColor = opacity * texel;","}"].join("\n")};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["0"],"names":["THREE","CopyShader","uniforms","tDiffuse","value","opacity","vertexShader","join","fragmentShader"],"mappings":"AAMAA,MAAMC,WAAa,CAElBC,SAAU,CAETC,SAAY,CAAEC,MAAO,MACrBC,QAAW,CAAED,MAAO,IAIrBE,aAAc,CAEb,oBAEA,gBAEA,cACA,8EAEA,KAECC,KAAM,MAERC,eAAgB,CAEf,yBAEA,8BAEA,oBAEA,gBAEA,6CACA,oCAEA,KAECD,KAAM"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
THREE.DRACOLoader=function(e){THREE.Loader.call(this,e),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}},THREE.DRACOLoader.prototype=Object.assign(Object.create(THREE.Loader.prototype),{constructor:THREE.DRACOLoader,setDecoderPath:function(e){return this.decoderPath=e,this},setDecoderConfig:function(e){return this.decoderConfig=e,this},setWorkerLimit:function(e){return this.workerLimit=e,this},setVerbosity:function(){console.warn("THREE.DRACOLoader: The .setVerbosity() method has been removed.")},setDrawMode:function(){console.warn("THREE.DRACOLoader: The .setDrawMode() method has been removed.")},setSkipDequantization:function(){console.warn("THREE.DRACOLoader: The .setSkipDequantization() method has been removed.")},load:function(e,t,r,o){var a=new THREE.FileLoader(this.manager);a.setPath(this.path),a.setResponseType("arraybuffer"),"use-credentials"===this.crossOrigin&&a.setWithCredentials(!0),a.load(e,e=>{var r={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(e,r).then(t).catch(o)},r,o)},decodeDracoFile:function(e,t,r,o){var a={attributeIDs:r||this.defaultAttributeIDs,attributeTypes:o||this.defaultAttributeTypes,useUniqueIDs:!!r};this.decodeGeometry(e,a).then(t)},decodeGeometry:function(e,t){for(var r in t.attributeTypes){var o=t.attributeTypes[r];void 0!==o.BYTES_PER_ELEMENT&&(t.attributeTypes[r]=o.name)}var a,n=JSON.stringify(t);if(THREE.DRACOLoader.taskCache.has(e)){var s=THREE.DRACOLoader.taskCache.get(e);if(s.key===n)return s.promise;if(0===e.byteLength)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}var i=this.workerNextTaskID++,d=e.byteLength,c=this._getWorker(i,d).then(r=>(a=r,new Promise((r,o)=>{a._callbacks[i]={resolve:r,reject:o},a.postMessage({type:"decode",id:i,taskConfig:t,buffer:e},[e])}))).then(e=>this._createGeometry(e.geometry));return c.finally(()=>{a&&i&&this._releaseTask(a,i)}),THREE.DRACOLoader.taskCache.set(e,{key:n,promise:c}),c},_createGeometry:function(e){var t=new THREE.BufferGeometry;e.index&&t.setIndex(new THREE.BufferAttribute(e.index.array,1));for(var r=0;r<e.attributes.length;r++){var o=e.attributes[r],a=o.name,n=o.array,s=o.itemSize;t.setAttribute(a,new THREE.BufferAttribute(n,s))}return t},_loadLibrary:function(e,t){var r=new THREE.FileLoader(this.manager);return r.setPath(this.decoderPath),r.setResponseType(t),new Promise((t,o)=>{r.load(e,t,void 0,o)})},preload:function(){return this._initDecoder(),this},_initDecoder:function(){if(this.decoderPending)return this.decoderPending;var e="object"!=typeof WebAssembly||"js"===this.decoderConfig.type,t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then(t=>{var r=t[0];e||(this.decoderConfig.wasmBinary=t[1]);var o=THREE.DRACOLoader.DRACOWorker.toString(),a=["/* draco decoder */",r,"","/* worker */",o.substring(o.indexOf("{")+1,o.lastIndexOf("}"))].join("\n");this.workerSourceURL=URL.createObjectURL(new Blob([a]))}),this.decoderPending},_getWorker:function(e,t){return this._initDecoder().then(()=>{var r;return this.workerPool.length<this.workerLimit?((r=new Worker(this.workerSourceURL))._callbacks={},r._taskCosts={},r._taskLoad=0,r.postMessage({type:"init",decoderConfig:this.decoderConfig}),r.onmessage=function(e){var t=e.data;switch(t.type){case"decode":r._callbacks[t.id].resolve(t);break;case"error":r._callbacks[t.id].reject(t);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+t.type+'"')}},this.workerPool.push(r)):this.workerPool.sort((function(e,t){return e._taskLoad>t._taskLoad?-1:1})),(r=this.workerPool[this.workerPool.length-1])._taskCosts[e]=t,r._taskLoad+=t,r})},_releaseTask:function(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]},debug:function(){this.workerPool.map(e=>e._taskLoad)},dispose:function(){for(var e=0;e<this.workerPool.length;++e)this.workerPool[e].terminate();return this.workerPool.length=0,this}}),THREE.DRACOLoader.DRACOWorker=function(){var e,t;function r(e,t,r,o,a,n){var s,i,d=n.num_components(),c=r.num_points()*d;switch(a){case Float32Array:s=new e.DracoFloat32Array,t.GetAttributeFloatForAllPoints(r,n,s),i=new Float32Array(c);break;case Int8Array:s=new e.DracoInt8Array,t.GetAttributeInt8ForAllPoints(r,n,s),i=new Int8Array(c);break;case Int16Array:s=new e.DracoInt16Array,t.GetAttributeInt16ForAllPoints(r,n,s),i=new Int16Array(c);break;case Int32Array:s=new e.DracoInt32Array,t.GetAttributeInt32ForAllPoints(r,n,s),i=new Int32Array(c);break;case Uint8Array:s=new e.DracoUInt8Array,t.GetAttributeUInt8ForAllPoints(r,n,s),i=new Uint8Array(c);break;case Uint16Array:s=new e.DracoUInt16Array,t.GetAttributeUInt16ForAllPoints(r,n,s),i=new Uint16Array(c);break;case Uint32Array:s=new e.DracoUInt32Array,t.GetAttributeUInt32ForAllPoints(r,n,s),i=new Uint32Array(c);break;default:throw new Error("THREE.DRACOLoader: Unexpected attribute type.")}for(var u=0;u<c;u++)i[u]=s.GetValue(u);return e.destroy(s),{name:o,array:i,itemSize:d}}onmessage=function(o){var a=o.data;switch(a.type){case"init":e=a.decoderConfig,t=new Promise((function(t){e.onModuleLoaded=function(e){t({draco:e})},DracoDecoderModule(e)}));break;case"decode":var n=a.buffer,s=a.taskConfig;t.then(e=>{var t=e.draco,o=new t.Decoder,i=new t.DecoderBuffer;i.Init(new Int8Array(n),n.byteLength);try{var d=function(e,t,o,a){var n,s,i=a.attributeIDs,d=a.attributeTypes,c=t.GetEncodedGeometryType(o);if(c===e.TRIANGULAR_MESH)n=new e.Mesh,s=t.DecodeBufferToMesh(o,n);else{if(c!==e.POINT_CLOUD)throw new Error("THREE.DRACOLoader: Unexpected geometry type.");n=new e.PointCloud,s=t.DecodeBufferToPointCloud(o,n)}if(!s.ok()||0===n.ptr)throw new Error("THREE.DRACOLoader: Decoding failed: "+s.error_msg());var u={index:null,attributes:[]};for(var h in i){var l,f,y=self[d[h]];if(a.useUniqueIDs)f=i[h],l=t.GetAttributeByUniqueId(n,f);else{if(-1===(f=t.GetAttributeId(n,e[i[h]])))continue;l=t.GetAttribute(n,f)}u.attributes.push(r(e,t,n,h,y,l))}if(c===e.TRIANGULAR_MESH){for(var A=n.num_faces(),b=new Uint32Array(3*A),E=new e.DracoInt32Array,w=0;w<A;++w){t.GetFaceFromMesh(n,w,E);for(var R=0;R<3;++R)b[3*w+R]=E.GetValue(R)}u.index={array:b,itemSize:1},e.destroy(E)}return e.destroy(n),u}(t,o,i,s),c=d.attributes.map(e=>e.array.buffer);d.index&&c.push(d.index.array.buffer),self.postMessage({type:"decode",id:a.id,geometry:d},c)}catch(e){console.error(e),self.postMessage({type:"error",id:a.id,error:e.message})}finally{t.destroy(i),t.destroy(o)}})}}},THREE.DRACOLoader.taskCache=new WeakMap,THREE.DRACOLoader.setDecoderPath=function(){console.warn("THREE.DRACOLoader: The .setDecoderPath() method has been removed. Use instance methods.")},THREE.DRACOLoader.setDecoderConfig=function(){console.warn("THREE.DRACOLoader: The .setDecoderConfig() method has been removed. Use instance methods.")},THREE.DRACOLoader.releaseDecoderModule=function(){console.warn("THREE.DRACOLoader: The .releaseDecoderModule() method has been removed. Use instance methods.")},THREE.DRACOLoader.getDecoderModule=function(){console.warn("THREE.DRACOLoader: The .getDecoderModule() method has been removed. Use instance methods.")};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["0"],"names":["THREE","DRACOLoader","manager","Loader","call","this","decoderPath","decoderConfig","decoderBinary","decoderPending","workerLimit","workerPool","workerNextTaskID","workerSourceURL","defaultAttributeIDs","position","normal","color","uv","defaultAttributeTypes","prototype","Object","assign","create","constructor","setDecoderPath","path","setDecoderConfig","config","setWorkerLimit","setVerbosity","console","warn","setDrawMode","setSkipDequantization","load","url","onLoad","onProgress","onError","loader","FileLoader","setPath","setResponseType","crossOrigin","setWithCredentials","buffer","taskConfig","attributeIDs","attributeTypes","useUniqueIDs","decodeGeometry","then","catch","decodeDracoFile","callback","attribute","type","undefined","BYTES_PER_ELEMENT","name","worker","taskKey","JSON","stringify","taskCache","has","cachedTask","get","key","promise","byteLength","Error","taskID","taskCost","geometryPending","_getWorker","_worker","Promise","resolve","reject","_callbacks","postMessage","id","message","_createGeometry","geometry","finally","_releaseTask","set","geometryData","BufferGeometry","index","setIndex","BufferAttribute","array","i","attributes","length","itemSize","setAttribute","_loadLibrary","responseType","preload","_initDecoder","useJS","WebAssembly","librariesPending","push","all","libraries","jsContent","wasmBinary","fn","DRACOWorker","toString","body","substring","indexOf","lastIndexOf","join","URL","createObjectURL","Blob","Worker","_taskCosts","_taskLoad","onmessage","e","data","error","sort","a","b","debug","map","dispose","terminate","decodeAttribute","draco","decoder","dracoGeometry","attributeName","attributeType","dracoArray","numComponents","num_components","numValues","num_points","Float32Array","DracoFloat32Array","GetAttributeFloatForAllPoints","Int8Array","DracoInt8Array","GetAttributeInt8ForAllPoints","Int16Array","DracoInt16Array","GetAttributeInt16ForAllPoints","Int32Array","DracoInt32Array","GetAttributeInt32ForAllPoints","Uint8Array","DracoUInt8Array","GetAttributeUInt8ForAllPoints","Uint16Array","DracoUInt16Array","GetAttributeUInt16ForAllPoints","Uint32Array","DracoUInt32Array","GetAttributeUInt32ForAllPoints","GetValue","destroy","onModuleLoaded","DracoDecoderModule","module","Decoder","decoderBuffer","DecoderBuffer","Init","decodingStatus","geometryType","GetEncodedGeometryType","TRIANGULAR_MESH","Mesh","DecodeBufferToMesh","POINT_CLOUD","PointCloud","DecodeBufferToPointCloud","ok","ptr","error_msg","attributeID","self","GetAttributeByUniqueId","GetAttributeId","GetAttribute","numFaces","num_faces","indexArray","GetFaceFromMesh","j","buffers","attr","WeakMap","releaseDecoderModule","getDecoderModule"],"mappings":"AAIAA,MAAMC,YAAc,SAAWC,GAE9BF,MAAMG,OAAOC,KAAMC,KAAMH,GAEzBG,KAAKC,YAAc,GACnBD,KAAKE,cAAgB,GACrBF,KAAKG,cAAgB,KACrBH,KAAKI,eAAiB,KAEtBJ,KAAKK,YAAc,EACnBL,KAAKM,WAAa,GAClBN,KAAKO,iBAAmB,EACxBP,KAAKQ,gBAAkB,GAEvBR,KAAKS,oBAAsB,CAC1BC,SAAU,WACVC,OAAQ,SACRC,MAAO,QACPC,GAAI,aAELb,KAAKc,sBAAwB,CAC5BJ,SAAU,eACVC,OAAQ,eACRC,MAAO,eACPC,GAAI,iBAKNlB,MAAMC,YAAYmB,UAAYC,OAAOC,OAAQD,OAAOE,OAAQvB,MAAMG,OAAOiB,WAAa,CAErFI,YAAaxB,MAAMC,YAEnBwB,eAAgB,SAAWC,GAI1B,OAFArB,KAAKC,YAAcoB,EAEZrB,MAIRsB,iBAAkB,SAAWC,GAI5B,OAFAvB,KAAKE,cAAgBqB,EAEdvB,MAIRwB,eAAgB,SAAWnB,GAI1B,OAFAL,KAAKK,YAAcA,EAEZL,MAKRyB,aAAc,WAEbC,QAAQC,KAAM,oEAKfC,YAAa,WAEZF,QAAQC,KAAM,mEAKfE,sBAAuB,WAEtBH,QAAQC,KAAM,6EAIfG,KAAM,SAAWC,EAAKC,EAAQC,EAAYC,GAEzC,IAAIC,EAAS,IAAIxC,MAAMyC,WAAYpC,KAAKH,SAExCsC,EAAOE,QAASrC,KAAKqB,MACrBc,EAAOG,gBAAiB,eAEE,oBAArBtC,KAAKuC,aAETJ,EAAOK,oBAAoB,GAI5BL,EAAOL,KAAMC,EAAOU,IAEnB,IAAIC,EAAa,CAChBC,aAAc3C,KAAKS,oBACnBmC,eAAgB5C,KAAKc,sBACrB+B,cAAc,GAGf7C,KAAK8C,eAAgBL,EAAQC,GAC3BK,KAAMf,GACNgB,MAAOd,IAEPD,EAAYC,IAKhBe,gBAAiB,SAAWR,EAAQS,EAAUP,EAAcC,GAE3D,IAAIF,EAAa,CAChBC,aAAcA,GAAgB3C,KAAKS,oBACnCmC,eAAgBA,GAAkB5C,KAAKc,sBACvC+B,eAAiBF,GAGlB3C,KAAK8C,eAAgBL,EAAQC,GAAaK,KAAMG,IAIjDJ,eAAgB,SAAWL,EAAQC,GAKlC,IAAM,IAAIS,KAAaT,EAAWE,eAAiB,CAElD,IAAIQ,EAAOV,EAAWE,eAAgBO,QAENE,IAA3BD,EAAKE,oBAETZ,EAAWE,eAAgBO,GAAcC,EAAKG,MAQhD,IA+BIC,EA/BAC,EAAUC,KAAKC,UAAWjB,GAI9B,GAAK/C,MAAMC,YAAYgE,UAAUC,IAAKpB,GAAW,CAEhD,IAAIqB,EAAanE,MAAMC,YAAYgE,UAAUG,IAAKtB,GAElD,GAAKqB,EAAWE,MAAQP,EAEvB,OAAOK,EAAWG,QAEZ,GAA2B,IAAtBxB,EAAOyB,WAMlB,MAAM,IAAIC,MAET,iHAYH,IAAIC,EAASpE,KAAKO,mBACd8D,EAAW5B,EAAOyB,WAIlBI,EAAkBtE,KAAKuE,WAAYH,EAAQC,GAC7CtB,KAAQyB,IAERhB,EAASgB,EAEF,IAAIC,QAAS,CAAEC,EAASC,KAE9BnB,EAAOoB,WAAYR,GAAW,CAAEM,QAAAA,EAASC,OAAAA,GAEzCnB,EAAOqB,YAAa,CAAEzB,KAAM,SAAU0B,GAAIV,EAAQ1B,WAAAA,EAAYD,OAAAA,GAAU,CAAEA,QAO3EM,KAAQgC,GAAa/E,KAAKgF,gBAAiBD,EAAQE,WAwBrD,OArBAX,EACEY,QAAS,KAEJ1B,GAAUY,GAEdpE,KAAKmF,aAAc3B,EAAQY,KAS9BzE,MAAMC,YAAYgE,UAAUwB,IAAK3C,EAAQ,CAExCuB,IAAKP,EACLQ,QAASK,IAIHA,GAIRU,gBAAiB,SAAWK,GAE3B,IAAIJ,EAAW,IAAItF,MAAM2F,eAEpBD,EAAaE,OAEjBN,EAASO,SAAU,IAAI7F,MAAM8F,gBAAiBJ,EAAaE,MAAMG,MAAO,IAIzE,IAAM,IAAIC,EAAI,EAAGA,EAAIN,EAAaO,WAAWC,OAAQF,IAAO,CAE3D,IAAIxC,EAAYkC,EAAaO,WAAYD,GACrCpC,EAAOJ,EAAUI,KACjBmC,EAAQvC,EAAUuC,MAClBI,EAAW3C,EAAU2C,SAEzBb,EAASc,aAAcxC,EAAM,IAAI5D,MAAM8F,gBAAiBC,EAAOI,IAIhE,OAAOb,GAIRe,aAAc,SAAWjE,EAAKkE,GAE7B,IAAI9D,EAAS,IAAIxC,MAAMyC,WAAYpC,KAAKH,SAIxC,OAHAsC,EAAOE,QAASrC,KAAKC,aACrBkC,EAAOG,gBAAiB2D,GAEjB,IAAIxB,QAAS,CAAEC,EAASC,KAE9BxC,EAAOL,KAAMC,EAAK2C,OAASrB,EAAWsB,MAMxCuB,QAAS,WAIR,OAFAlG,KAAKmG,eAEEnG,MAIRmG,aAAc,WAEb,GAAKnG,KAAKI,eAAiB,OAAOJ,KAAKI,eAEvC,IAAIgG,EAA+B,iBAAhBC,aAAwD,OAA5BrG,KAAKE,cAAckD,KAC9DkD,EAAmB,GAsCvB,OApCKF,EAEJE,EAAiBC,KAAMvG,KAAKgG,aAAc,mBAAoB,UAI9DM,EAAiBC,KAAMvG,KAAKgG,aAAc,wBAAyB,SACnEM,EAAiBC,KAAMvG,KAAKgG,aAAc,qBAAsB,iBAIjEhG,KAAKI,eAAiBqE,QAAQ+B,IAAKF,GACjCvD,KAAQ0D,IAER,IAAIC,EAAYD,EAAW,GAEpBL,IAENpG,KAAKE,cAAcyG,WAAaF,EAAW,IAI5C,IAAIG,EAAKjH,MAAMC,YAAYiH,YAAYC,WAEnCC,EAAO,CACV,sBACAL,EACA,GACA,eACAE,EAAGI,UAAWJ,EAAGK,QAAS,KAAQ,EAAGL,EAAGM,YAAa,OACpDC,KAAM,MAERnH,KAAKQ,gBAAkB4G,IAAIC,gBAAiB,IAAIC,KAAM,CAAEP,OAInD/G,KAAKI,gBAIbmE,WAAY,SAAWH,EAAQC,GAE9B,OAAOrE,KAAKmG,eAAepD,KAAM,KAI/B,IAyCGS,EAGJ,OA9CKxD,KAAKM,WAAWuF,OAAS7F,KAAKK,cAE9BmD,EAAS,IAAI+D,OAAQvH,KAAKQ,kBAEvBoE,WAAa,GACpBpB,EAAOgE,WAAa,GACpBhE,EAAOiE,UAAY,EAEnBjE,EAAOqB,YAAa,CAAEzB,KAAM,OAAQlD,cAAeF,KAAKE,gBAExDsD,EAAOkE,UAAY,SAAWC,GAE7B,IAAI5C,EAAU4C,EAAEC,KAEhB,OAAS7C,EAAQ3B,MAEhB,IAAK,SACJI,EAAOoB,WAAYG,EAAQD,IAAKJ,QAASK,GACzC,MAED,IAAK,QACJvB,EAAOoB,WAAYG,EAAQD,IAAKH,OAAQI,GACxC,MAED,QACCrD,QAAQmG,MAAO,2CAA6C9C,EAAQ3B,KAAO,OAM9EpD,KAAKM,WAAWiG,KAAM/C,IAItBxD,KAAKM,WAAWwH,MAAM,SAAWC,EAAGC,GAEnC,OAAOD,EAAEN,UAAYO,EAAEP,WAAc,EAAI,MAMvCjE,EAASxD,KAAKM,WAAYN,KAAKM,WAAWuF,OAAS,IAChD2B,WAAYpD,GAAWC,EAC9Bb,EAAOiE,WAAapD,EACbb,KAMT2B,aAAc,SAAW3B,EAAQY,GAEhCZ,EAAOiE,WAAajE,EAAOgE,WAAYpD,UAChCZ,EAAOoB,WAAYR,UACnBZ,EAAOgE,WAAYpD,IAI3B6D,MAAO,WAEsBjI,KAAKM,WAAW4H,IAAO1E,GAAYA,EAAOiE,YAIvEU,QAAS,WAER,IAAM,IAAIxC,EAAI,EAAGA,EAAI3F,KAAKM,WAAWuF,SAAWF,EAE/C3F,KAAKM,WAAYqF,GAAIyC,YAMtB,OAFApI,KAAKM,WAAWuF,OAAS,EAElB7F,QAQTL,MAAMC,YAAYiH,YAAc,WAE/B,IAAI3G,EACAE,EAkKJ,SAASiI,EAAiBC,EAAOC,EAASC,EAAeC,EAAeC,EAAevF,GAEtF,IAGIwF,EAEAjD,EALAkD,EAAgBzF,EAAU0F,iBAE1BC,EADYN,EAAcO,aACFH,EAK5B,OAASF,GAER,KAAKM,aACJL,EAAa,IAAIL,EAAMW,kBACvBV,EAAQW,8BAA+BV,EAAerF,EAAWwF,GACjEjD,EAAQ,IAAIsD,aAAcF,GAC1B,MAED,KAAKK,UACJR,EAAa,IAAIL,EAAMc,eACvBb,EAAQc,6BAA8Bb,EAAerF,EAAWwF,GAChEjD,EAAQ,IAAIyD,UAAWL,GACvB,MAED,KAAKQ,WACJX,EAAa,IAAIL,EAAMiB,gBACvBhB,EAAQiB,8BAA+BhB,EAAerF,EAAWwF,GACjEjD,EAAQ,IAAI4D,WAAYR,GACxB,MAED,KAAKW,WACJd,EAAa,IAAIL,EAAMoB,gBACvBnB,EAAQoB,8BAA+BnB,EAAerF,EAAWwF,GACjEjD,EAAQ,IAAI+D,WAAYX,GACxB,MAED,KAAKc,WACJjB,EAAa,IAAIL,EAAMuB,gBACvBtB,EAAQuB,8BAA+BtB,EAAerF,EAAWwF,GACjEjD,EAAQ,IAAIkE,WAAYd,GACxB,MAED,KAAKiB,YACJpB,EAAa,IAAIL,EAAM0B,iBACvBzB,EAAQ0B,+BAAgCzB,EAAerF,EAAWwF,GAClEjD,EAAQ,IAAIqE,YAAajB,GACzB,MAED,KAAKoB,YACJvB,EAAa,IAAIL,EAAM6B,iBACvB5B,EAAQ6B,+BAAgC5B,EAAerF,EAAWwF,GAClEjD,EAAQ,IAAIwE,YAAapB,GACzB,MAED,QACC,MAAM,IAAI3E,MAAO,iDAInB,IAAM,IAAIwB,EAAI,EAAGA,EAAImD,EAAWnD,IAE/BD,EAAOC,GAAMgD,EAAW0B,SAAU1E,GAMnC,OAFA2C,EAAMgC,QAAS3B,GAER,CACNpF,KAAMkF,EACN/C,MAAOA,EACPI,SAAU8C,GArOZlB,UAAY,SAAWC,GAEtB,IAAI5C,EAAU4C,EAAEC,KAEhB,OAAS7C,EAAQ3B,MAEhB,IAAK,OACJlD,EAAgB6E,EAAQ7E,cACxBE,EAAiB,IAAIqE,SAAS,SAAWC,GAExCxE,EAAcqK,eAAiB,SAAWjC,GAGzC5D,EAAS,CAAE4D,MAAOA,KAInBkC,mBAAoBtK,MAGrB,MAED,IAAK,SACJ,IAAIuC,EAASsC,EAAQtC,OACjBC,EAAaqC,EAAQrC,WACzBtC,EAAe2C,KAAQ0H,IAEtB,IAAInC,EAAQmC,EAAOnC,MACfC,EAAU,IAAID,EAAMoC,QACpBC,EAAgB,IAAIrC,EAAMsC,cAC9BD,EAAcE,KAAM,IAAI1B,UAAW1G,GAAUA,EAAOyB,YAEpD,IAEC,IAAIe,EA4BT,SAAyBqD,EAAOC,EAASoC,EAAejI,GAEvD,IAGI8F,EACAsC,EAJAnI,EAAeD,EAAWC,aAC1BC,EAAiBF,EAAWE,eAK5BmI,EAAexC,EAAQyC,uBAAwBL,GAEnD,GAAKI,IAAiBzC,EAAM2C,gBAE3BzC,EAAgB,IAAIF,EAAM4C,KAC1BJ,EAAiBvC,EAAQ4C,mBAAoBR,EAAenC,OAEtD,CAAA,GAAKuC,IAAiBzC,EAAM8C,YAOlC,MAAM,IAAIjH,MAAO,gDALjBqE,EAAgB,IAAIF,EAAM+C,WAC1BP,EAAiBvC,EAAQ+C,yBAA0BX,EAAenC,GAQnE,IAAOsC,EAAeS,MAA8B,IAAtB/C,EAAcgD,IAE3C,MAAM,IAAIrH,MAAO,uCAAyC2G,EAAeW,aAI1E,IAAIxG,EAAW,CAAEM,MAAO,KAAMK,WAAY,IAG1C,IAAM,IAAI6C,KAAiB9F,EAAe,CAEzC,IAEIQ,EACAuI,EAHAhD,EAAgBiD,KAAM/I,EAAgB6F,IAS1C,GAAK/F,EAAWG,aAEf6I,EAAc/I,EAAc8F,GAC5BtF,EAAYoF,EAAQqD,uBAAwBpD,EAAekD,OAErD,CAIN,IAAuB,KAFvBA,EAAcnD,EAAQsD,eAAgBrD,EAAeF,EAAO3F,EAAc8F,MAE/C,SAE3BtF,EAAYoF,EAAQuD,aAActD,EAAekD,GAIlDzG,EAASW,WAAWW,KAAM8B,EAAiBC,EAAOC,EAASC,EAAeC,EAAeC,EAAevF,IAKzG,GAAK4H,IAAiBzC,EAAM2C,gBAAkB,CAQ7C,IALA,IAAIc,EAAWvD,EAAcwD,YAEzBzG,EAAQ,IAAI2E,YADY,EAAX6B,GAEbE,EAAa,IAAI3D,EAAMoB,gBAEjB/D,EAAI,EAAGA,EAAIoG,IAAapG,EAAI,CAErC4C,EAAQ2D,gBAAiB1D,EAAe7C,EAAGsG,GAE3C,IAAM,IAAIE,EAAI,EAAGA,EAAI,IAAMA,EAE1B5G,EAAW,EAAJI,EAAQwG,GAAMF,EAAW5B,SAAU8B,GAM5ClH,EAASM,MAAQ,CAAEG,MAAOH,EAAOO,SAAU,GAE3CwC,EAAMgC,QAAS2B,GAMhB,OAFA3D,EAAMgC,QAAS9B,GAERvD,EA1HYnC,CAAgBwF,EAAOC,EAASoC,EAAejI,GAE1D0J,EAAUnH,EAASW,WAAWsC,IAAOmE,GAAUA,EAAK3G,MAAMjD,QAEzDwC,EAASM,OAAQ6G,EAAQ7F,KAAMtB,EAASM,MAAMG,MAAMjD,QAEzDkJ,KAAK9G,YAAa,CAAEzB,KAAM,SAAU0B,GAAIC,EAAQD,GAAIG,SAAAA,GAAYmH,GAE/D,MAAQvE,GAETnG,QAAQmG,MAAOA,GAEf8D,KAAK9G,YAAa,CAAEzB,KAAM,QAAS0B,GAAIC,EAAQD,GAAI+C,MAAOA,EAAM9C,UAE/D,QAEDuD,EAAMgC,QAASK,GACfrC,EAAMgC,QAAS/B,SAyLrB5I,MAAMC,YAAYgE,UAAY,IAAI0I,QAKlC3M,MAAMC,YAAYwB,eAAiB,WAElCM,QAAQC,KAAM,4FAKfhC,MAAMC,YAAY0B,iBAAmB,WAEpCI,QAAQC,KAAM,8FAKfhC,MAAMC,YAAY2M,qBAAuB,WAExC7K,QAAQC,KAAM,kGAKfhC,MAAMC,YAAY4M,iBAAmB,WAEpC9K,QAAQC,KAAM"}
|