@roomle/web-sdk 2.63.0 → 2.64.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/{TextGeometry-d25f1fa4.js → TextGeometry-d7dcb1a8.js} +2 -2
- package/lib/{TextGeometry-d25f1fa4.js.map → TextGeometry-d7dcb1a8.js.map} +1 -1
- package/lib/{TextGeometry-f2fc57a2.nomodule.js → TextGeometry-df6eed60.nomodule.js} +2 -2
- package/lib/{TextGeometry-f2fc57a2.nomodule.js.map → TextGeometry-df6eed60.nomodule.js.map} +1 -1
- package/lib/{banana-for-scale-e7fb6c04.nomodule.js → banana-for-scale-29b25ea9.nomodule.js} +2 -2
- package/lib/{banana-for-scale-e7fb6c04.nomodule.js.map → banana-for-scale-29b25ea9.nomodule.js.map} +1 -1
- package/lib/{banana-for-scale-d5ee3dda.js → banana-for-scale-55632ac0.js} +2 -2
- package/lib/{banana-for-scale-d5ee3dda.js.map → banana-for-scale-55632ac0.js.map} +1 -1
- package/lib/{budgeteer-measure-f229f761.js → budgeteer-measure-41916468.js} +2 -2
- package/lib/{budgeteer-measure-f229f761.js.map → budgeteer-measure-41916468.js.map} +1 -1
- package/lib/budgeteer-measure.nomodule.js +1 -1
- package/lib/{component-dimensioning-63c673fb.nomodule.js → component-dimensioning-2c3f8e73.nomodule.js} +2 -2
- package/lib/component-dimensioning-2c3f8e73.nomodule.js.map +1 -0
- package/lib/{component-dimensioning-75e9fdfd.js → component-dimensioning-2cadd6d1.js} +2 -2
- package/lib/component-dimensioning-2cadd6d1.js.map +1 -0
- package/lib/{component-raycast-helper-6961b8e3.nomodule.js → component-raycast-helper-ee5ee90e.nomodule.js} +2 -2
- package/lib/component-raycast-helper-ee5ee90e.nomodule.js.map +1 -0
- package/lib/{component-raycast-helper-b637a254.js → component-raycast-helper-f43e9296.js} +2 -2
- package/lib/component-raycast-helper-f43e9296.js.map +1 -0
- package/lib/{configurator-640c722b.nomodule.js → configurator-41306664.nomodule.js} +2 -2
- package/lib/configurator-41306664.nomodule.js.map +1 -0
- package/lib/{configurator-74093f32.js → configurator-a643d14a.js} +2 -2
- package/lib/configurator-a643d14a.js.map +1 -0
- package/lib/configurator-main-2696b142.js +2 -0
- package/lib/configurator-main-2696b142.js.map +1 -0
- package/lib/configurator-main.nomodule.js +1 -1
- package/lib/{continuous-drawing-helper-bdad4f4e.nomodule.js → continuous-drawing-helper-5d3a8a98.nomodule.js} +2 -2
- package/lib/continuous-drawing-helper-5d3a8a98.nomodule.js.map +1 -0
- package/lib/{continuous-drawing-helper-38e8cce0.js → continuous-drawing-helper-c6d36132.js} +2 -2
- package/lib/continuous-drawing-helper-c6d36132.js.map +1 -0
- package/lib/{default-light-setting-8951625e.nomodule.js → default-light-setting-6ef7ed3d.nomodule.js} +2 -2
- package/lib/default-light-setting-6ef7ed3d.nomodule.js.map +1 -0
- package/lib/{default-light-setting-74881f94.js → default-light-setting-a5166832.js} +2 -2
- package/lib/default-light-setting-a5166832.js.map +1 -0
- package/lib/definitions/common-core/__tests__/image-renderer.d.ts +2 -0
- package/lib/definitions/common-core/src/utils/threejs-utils.d.ts +3 -1
- package/lib/definitions/common-core/src/webgl/image-renderer.d.ts +1 -1
- package/lib/definitions/common-core/src/webgl/renderer/environment-definition.d.ts +16 -2
- package/lib/definitions/common-core/src/webgl/renderer/light-source-detection.d.ts +2 -1
- package/lib/definitions/common-core/src/webgl/roomle-webgl-renderer.d.ts +1 -0
- package/lib/definitions/configurator-core/src/utils/test-helpers/utils.d.ts +2 -0
- package/lib/definitions/configurator-core/src/webgl/configurator-scene-manager.d.ts +2 -2
- package/lib/definitions/planner-core/src/roomle-planner.d.ts +7 -0
- package/lib/definitions/planner-core/src/webgl/planner-scene-manager.d.ts +6 -1
- package/lib/{dimensioning-helper-2614e50c.js → dimensioning-helper-57d93bbb.js} +2 -2
- package/lib/{dimensioning-helper-2614e50c.js.map → dimensioning-helper-57d93bbb.js.map} +1 -1
- package/lib/{dimensioning-helper-771563fa.nomodule.js → dimensioning-helper-f65c90f1.nomodule.js} +2 -2
- package/lib/{dimensioning-helper-771563fa.nomodule.js.map → dimensioning-helper-f65c90f1.nomodule.js.map} +1 -1
- package/lib/{glb-viewer-f11f3cb7.js → glb-viewer-5e349648.js} +2 -2
- package/lib/{glb-viewer-f11f3cb7.js.map → glb-viewer-5e349648.js.map} +1 -1
- package/lib/{glb-viewer-75d2e09c.nomodule.js → glb-viewer-b8dfe219.nomodule.js} +2 -2
- package/lib/{glb-viewer-75d2e09c.nomodule.js.map → glb-viewer-b8dfe219.nomodule.js.map} +1 -1
- package/lib/glb-viewer-main-9dcb6ebb.js +2 -0
- package/lib/glb-viewer-main-9dcb6ebb.js.map +1 -0
- package/lib/glb-viewer-main.nomodule.js +1 -1
- package/lib/legacy/{TextGeometry-6ea1a7a3.legacy.js → TextGeometry-f37411bb.legacy.js} +2 -2
- package/lib/legacy/{TextGeometry-6ea1a7a3.legacy.js.map → TextGeometry-f37411bb.legacy.js.map} +1 -1
- package/lib/legacy/{banana-for-scale-d3481724.legacy.js → banana-for-scale-eb176575.legacy.js} +2 -2
- package/lib/legacy/{banana-for-scale-d3481724.legacy.js.map → banana-for-scale-eb176575.legacy.js.map} +1 -1
- package/lib/legacy/budgeteer-measure.legacy.js +1 -1
- package/lib/legacy/{component-dimensioning-24a4c3cd.legacy.js → component-dimensioning-c0100b50.legacy.js} +2 -2
- package/lib/legacy/component-dimensioning-c0100b50.legacy.js.map +1 -0
- package/lib/legacy/{component-raycast-helper-401e69ee.legacy.js → component-raycast-helper-aa680c21.legacy.js} +2 -2
- package/lib/legacy/component-raycast-helper-aa680c21.legacy.js.map +1 -0
- package/lib/legacy/{configurator-72334374.legacy.js → configurator-7a114290.legacy.js} +2 -2
- package/lib/legacy/configurator-7a114290.legacy.js.map +1 -0
- package/lib/legacy/configurator-main.legacy.js +1 -1
- package/lib/legacy/{continuous-drawing-helper-959c9230.legacy.js → continuous-drawing-helper-25ae9853.legacy.js} +2 -2
- package/lib/legacy/continuous-drawing-helper-25ae9853.legacy.js.map +1 -0
- package/lib/legacy/{default-light-setting-5155e3b7.legacy.js → default-light-setting-7d35c4b0.legacy.js} +2 -2
- package/lib/legacy/default-light-setting-7d35c4b0.legacy.js.map +1 -0
- package/lib/legacy/{dimensioning-helper-39d0ac36.legacy.js → dimensioning-helper-9d505a2f.legacy.js} +2 -2
- package/lib/legacy/{dimensioning-helper-39d0ac36.legacy.js.map → dimensioning-helper-9d505a2f.legacy.js.map} +1 -1
- package/lib/legacy/{glb-viewer-21343679.legacy.js → glb-viewer-fcfde056.legacy.js} +2 -2
- package/lib/legacy/{glb-viewer-21343679.legacy.js.map → glb-viewer-fcfde056.legacy.js.map} +1 -1
- package/lib/legacy/glb-viewer-main.legacy.js +1 -1
- package/lib/legacy/{main-thread-to-worker-334452db.legacy.js → main-thread-to-worker-88746ef2.legacy.js} +2 -2
- package/lib/legacy/{main-thread-to-worker-334452db.legacy.js.map → main-thread-to-worker-88746ef2.legacy.js.map} +1 -1
- package/lib/legacy/{material-viewer-76e17b0e.legacy.js → material-viewer-6ecbbede.legacy.js} +2 -2
- package/lib/legacy/material-viewer-6ecbbede.legacy.js.map +1 -0
- package/lib/legacy/material-viewer-main.legacy.js +1 -1
- package/lib/legacy/planner-5417772c.legacy.js +2 -0
- package/lib/legacy/{planner-118a3c2a.legacy.js.map → planner-5417772c.legacy.js.map} +1 -1
- package/lib/legacy/planner-main.legacy.js +1 -1
- package/lib/legacy/roomle-configurator-b17ee31c.legacy.js +2 -0
- package/lib/legacy/roomle-configurator-b17ee31c.legacy.js.map +1 -0
- package/lib/legacy/{roomle-dependency-injection-39c6c926.legacy.js → roomle-dependency-injection-ef0888c0.legacy.js} +3 -3
- package/lib/legacy/{roomle-dependency-injection-39c6c926.legacy.js.map → roomle-dependency-injection-ef0888c0.legacy.js.map} +1 -1
- package/lib/legacy/roomle-sdk.legacy.js +1 -1
- package/lib/legacy/scene-manager-0f7a3505.legacy.js +2 -0
- package/lib/legacy/{scene-manager-4c49ffd2.legacy.js.map → scene-manager-0f7a3505.legacy.js.map} +1 -1
- package/lib/legacy/{script-loader-ac6bc6eb.legacy.js → script-loader-87105926.legacy.js} +2 -2
- package/lib/legacy/script-loader-87105926.legacy.js.map +1 -0
- package/lib/legacy/{stats-helper-c027c078.legacy.js → stats-helper-8c73c389.legacy.js} +2 -2
- package/lib/legacy/stats-helper-8c73c389.legacy.js.map +1 -0
- package/lib/legacy/{tools-core-5f513877.legacy.js → tools-core-1eb152d6.legacy.js} +2 -2
- package/lib/legacy/tools-core-1eb152d6.legacy.js.map +1 -0
- package/lib/{main-thread-to-worker-d5d5841d.js → main-thread-to-worker-a765ee2b.js} +2 -2
- package/lib/{main-thread-to-worker-d5d5841d.js.map → main-thread-to-worker-a765ee2b.js.map} +1 -1
- package/lib/{main-thread-to-worker-cce716d1.nomodule.js → main-thread-to-worker-e5396037.nomodule.js} +2 -2
- package/lib/{main-thread-to-worker-cce716d1.nomodule.js.map → main-thread-to-worker-e5396037.nomodule.js.map} +1 -1
- package/lib/{material-viewer-54c1dd62.js → material-viewer-1f1beabd.js} +2 -2
- package/lib/material-viewer-1f1beabd.js.map +1 -0
- package/lib/{material-viewer-d25178c4.nomodule.js → material-viewer-753a33c9.nomodule.js} +2 -2
- package/lib/material-viewer-753a33c9.nomodule.js.map +1 -0
- package/lib/material-viewer-main-42a973a6.js +2 -0
- package/lib/material-viewer-main-42a973a6.js.map +1 -0
- package/lib/material-viewer-main.nomodule.js +1 -1
- package/lib/planner-4b991932.nomodule.js +2 -0
- package/lib/{planner-3f3c77fa.nomodule.js.map → planner-4b991932.nomodule.js.map} +1 -1
- package/lib/planner-dummy-app.js +1 -1
- package/lib/planner-dummy-app.js.map +1 -1
- package/lib/planner-dummy.html +3 -0
- package/lib/planner-f2c9e2a7.js +2 -0
- package/lib/{planner-27f02e36.js.map → planner-f2c9e2a7.js.map} +1 -1
- package/lib/planner-main-5bf48972.js +2 -0
- package/lib/planner-main-5bf48972.js.map +1 -0
- package/lib/planner-main.nomodule.js +1 -1
- package/lib/roomle-configurator-1f74db84.js +2 -0
- package/lib/roomle-configurator-1f74db84.js.map +1 -0
- package/lib/roomle-configurator-73e36fea.nomodule.js +2 -0
- package/lib/roomle-configurator-73e36fea.nomodule.js.map +1 -0
- package/lib/{roomle-dependency-injection-9b7e9b99.nomodule.js → roomle-dependency-injection-a3d0213f.nomodule.js} +3 -3
- package/lib/{roomle-dependency-injection-9b7e9b99.nomodule.js.map → roomle-dependency-injection-a3d0213f.nomodule.js.map} +1 -1
- package/lib/{roomle-dependency-injection-597b90a7.js → roomle-dependency-injection-feeade2a.js} +3 -3
- package/lib/{roomle-dependency-injection-597b90a7.js.map → roomle-dependency-injection-feeade2a.js.map} +1 -1
- package/lib/{roomle-sdk-e89b8e36.js → roomle-sdk-6a954004.js} +2 -2
- package/lib/roomle-sdk-6a954004.js.map +1 -0
- package/lib/roomle-sdk.nomodule.js +1 -1
- package/lib/scene-manager-0c37a0a4.nomodule.js +2 -0
- package/lib/{scene-manager-61f9a10a.nomodule.js.map → scene-manager-0c37a0a4.nomodule.js.map} +1 -1
- package/lib/scene-manager-3569dc7c.js +2 -0
- package/lib/{scene-manager-805fb8e3.js.map → scene-manager-3569dc7c.js.map} +1 -1
- package/lib/{script-loader-94abc8b8.nomodule.js → script-loader-39fb0119.nomodule.js} +2 -2
- package/lib/script-loader-39fb0119.nomodule.js.map +1 -0
- package/lib/{script-loader-0175c371.js → script-loader-f6d3bde6.js} +2 -2
- package/lib/script-loader-f6d3bde6.js.map +1 -0
- package/lib/{stats-helper-208e0d5c.nomodule.js → stats-helper-c7e0d6e7.nomodule.js} +2 -2
- package/lib/stats-helper-c7e0d6e7.nomodule.js.map +1 -0
- package/lib/{stats-helper-b87f9b7a.js → stats-helper-dca14fc4.js} +2 -2
- package/lib/stats-helper-dca14fc4.js.map +1 -0
- package/lib/{tools-core-20199721.nomodule.js → tools-core-39a8e28d.nomodule.js} +2 -2
- package/lib/tools-core-39a8e28d.nomodule.js.map +1 -0
- package/lib/{tools-core-ef85325b.js → tools-core-cf5f452a.js} +2 -2
- package/lib/tools-core-cf5f452a.js.map +1 -0
- package/package.json +2 -2
- package/lib/component-dimensioning-63c673fb.nomodule.js.map +0 -1
- package/lib/component-dimensioning-75e9fdfd.js.map +0 -1
- package/lib/component-raycast-helper-6961b8e3.nomodule.js.map +0 -1
- package/lib/component-raycast-helper-b637a254.js.map +0 -1
- package/lib/configurator-640c722b.nomodule.js.map +0 -1
- package/lib/configurator-74093f32.js.map +0 -1
- package/lib/configurator-main-55c8e327.js +0 -2
- package/lib/configurator-main-55c8e327.js.map +0 -1
- package/lib/continuous-drawing-helper-38e8cce0.js.map +0 -1
- package/lib/continuous-drawing-helper-bdad4f4e.nomodule.js.map +0 -1
- package/lib/default-light-setting-74881f94.js.map +0 -1
- package/lib/default-light-setting-8951625e.nomodule.js.map +0 -1
- package/lib/glb-viewer-main-2dbf8c41.js +0 -2
- package/lib/glb-viewer-main-2dbf8c41.js.map +0 -1
- package/lib/legacy/component-dimensioning-24a4c3cd.legacy.js.map +0 -1
- package/lib/legacy/component-raycast-helper-401e69ee.legacy.js.map +0 -1
- package/lib/legacy/configurator-72334374.legacy.js.map +0 -1
- package/lib/legacy/continuous-drawing-helper-959c9230.legacy.js.map +0 -1
- package/lib/legacy/default-light-setting-5155e3b7.legacy.js.map +0 -1
- package/lib/legacy/material-viewer-76e17b0e.legacy.js.map +0 -1
- package/lib/legacy/planner-118a3c2a.legacy.js +0 -2
- package/lib/legacy/roomle-configurator-7291a081.legacy.js +0 -2
- package/lib/legacy/roomle-configurator-7291a081.legacy.js.map +0 -1
- package/lib/legacy/scene-manager-4c49ffd2.legacy.js +0 -2
- package/lib/legacy/script-loader-ac6bc6eb.legacy.js.map +0 -1
- package/lib/legacy/stats-helper-c027c078.legacy.js.map +0 -1
- package/lib/legacy/tools-core-5f513877.legacy.js.map +0 -1
- package/lib/material-viewer-54c1dd62.js.map +0 -1
- package/lib/material-viewer-d25178c4.nomodule.js.map +0 -1
- package/lib/material-viewer-main-65a30660.js +0 -2
- package/lib/material-viewer-main-65a30660.js.map +0 -1
- package/lib/planner-27f02e36.js +0 -2
- package/lib/planner-3f3c77fa.nomodule.js +0 -2
- package/lib/planner-main-fc563f29.js +0 -2
- package/lib/planner-main-fc563f29.js.map +0 -1
- package/lib/roomle-configurator-4d92e806.js +0 -2
- package/lib/roomle-configurator-4d92e806.js.map +0 -1
- package/lib/roomle-configurator-b3473d62.nomodule.js +0 -2
- package/lib/roomle-configurator-b3473d62.nomodule.js.map +0 -1
- package/lib/roomle-sdk-e89b8e36.js.map +0 -1
- package/lib/scene-manager-61f9a10a.nomodule.js +0 -2
- package/lib/scene-manager-805fb8e3.js +0 -2
- package/lib/script-loader-0175c371.js.map +0 -1
- package/lib/script-loader-94abc8b8.nomodule.js.map +0 -1
- package/lib/stats-helper-208e0d5c.nomodule.js.map +0 -1
- package/lib/stats-helper-b87f9b7a.js.map +0 -1
- package/lib/tools-core-20199721.nomodule.js.map +0 -1
- package/lib/tools-core-ef85325b.js.map +0 -1
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{GlbViewer}from"./glb-viewer-f11f3cb7.js";import"./script-loader-0175c371.js";import"./query-params-helper-a271f9dc.js";import"./roomle-dependency-injection-597b90a7.js";import"./main-thread-to-worker-d5d5841d.js";import"./scene-manager-805fb8e3.js";import"./default-light-setting-74881f94.js";(new GlbViewer).boot();
|
|
2
|
-
//# sourceMappingURL=glb-viewer-main-2dbf8c41.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"glb-viewer-main-2dbf8c41.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"component-dimensioning-24a4c3cd.legacy.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"component-raycast-helper-401e69ee.legacy.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"configurator-72334374.legacy.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"continuous-drawing-helper-959c9230.legacy.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"default-light-setting-5155e3b7.legacy.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"material-viewer-76e17b0e.legacy.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
System.register(["./script-loader-ac6bc6eb.legacy.js","./roomle-dependency-injection-39c6c926.legacy.js","./scene-manager-4c49ffd2.legacy.js","./main-thread-to-worker-334452db.legacy.js","./roomle-configurator-7291a081.legacy.js","./query-params-helper-8c00a872.legacy.js","./default-light-setting-5155e3b7.legacy.js"],(function(e,t){var n,a,i,s,r,o,l,c,h,d,_,g,p,m,u,v,w,C,f,b,M,E,P,S,y,I,D,O,H,L,A,k,j,V,x,T,R,B,W,F,K,z,U,G,N,Z,q,X,J,Q,Y,$,ee,te,ne,ae,ie,se,re,oe,le,ce,he,de,_e,ge,pe,me,ue,ve,we,Ce,fe,be,Me,Ee,Pe,Se,ye,Ie;return{setters:[function(e){n=e.S,a=e.M},function(e){i=e.Z,s=e.E,r=e.W,o=e.F,l=e._,c=e.i,h=e.h,d=e.N,_=e.a9,g=e.e,p=e.aa,m=e.c,u=e.S,v=e.ab,w=e.ac,C=e.j,f=e.O,b=e.ad,M=e.ae,E=e.af,P=e.ag,S=e.k,y=e.V,I=e.ah,D=e.ai,O=e.aj,H=e.d,L=e.ak,A=e.r,k=e.al,j=e.H,V=e.B,x=e.am,T=e.p,R=e.an,B=e.D,W=e.L,F=e.ao,K=e.R,z=e.b},function(e){U=e.L,G=e.B,N=e.C,Z=e.b,q=e.c,X=e.T},function(e){J=e.a,Q=e.A,Y=e.C,$=e.D,ee=e.V,te=e.ai,ne=e.bF,ae=e.au,ie=e.bf,se=e.j,re=e.G,oe=e.aM,le=e.aH,ce=e.ah,he=e.U,de=e._,_e=e.e,ge=e.f,pe=e.b2,me=e.b3,ue=e.bk,ve=e.aE,we=e.h,Ce=e.bY,fe=e.bL,be=e.aS,Me=e.bZ,Ee=e.X},function(e){Pe=e.S,Se=e.C,ye=e.P,Ie=e.R},function(){},function(){}],execute:function(){class De extends U{constructor(e,t){super(e,t),this._center=new J(0,0,0),this._params={ambientLight:{color:"#ffffff"},hemiLight:{color:"#ffffff"},mainDirLight:{direction:{x:2,y:1,z:2},color:"#ffffff"}},this._ambientLight=new Q(new Y(this._params.ambientLight.color),.4),this._ambientLight.layers.set(1),this._mainDirLight=new $(new Y(this._params.mainDirLight.color),.5),this._mainDirLight.castShadow=!0,this._mainDirLight.shadow.camera.near=.5,this._mainDirLight.shadow.camera.far=100,this._mainDirLight.shadow.mapSize=new ee(1024,1024),this._mainDirLight.visible=!0,this.addToScene()}updateSunPosition(e,t){}addToScene(){this._scene.add(this._mainDirLight),this._scene.add(this._ambientLight),this._scene.add(this._mainDirLight.target)}removeFromScene(){this._scene.remove(this._mainDirLight),this._scene.remove(this._ambientLight),this._scene.remove(this._mainDirLight.target)}reload(){this.removeFromScene(),this.addToScene()}needsBounds(){return!0}updateBounds(e){this._center.copy(e.getCenter(new J));const t=new te;e.getBoundingSphere(t);const n=t.radius,a=new J(this._params.mainDirLight.direction.x,this._params.mainDirLight.direction.y,this._params.mainDirLight.direction.z);a.normalize(),a.multiplyScalar(n),this._mainDirLight.position.copy(this._center),this._mainDirLight.position.add(a),this._mainDirLight.target.position.copy(this._center),this._mainDirLight.target.updateMatrixWorld(!0),this._mainDirLight.shadow.camera.top=n,this._mainDirLight.shadow.camera.bottom=-n,this._mainDirLight.shadow.camera.left=-n,this._mainDirLight.shadow.camera.right=n,this._mainDirLight.shadow.camera.near=.01,this._mainDirLight.shadow.camera.far=2*n,this._mainDirLight.shadow.camera.updateProjectionMatrix()}showGUI(){let e=i();if(e){if(this._ambientLight){let t=e.addFolder("Ambient Light");t.add(this._ambientLight,"visible"),t.add(this._ambientLight,"intensity").min(0).max(5).step(.1),t.addColor(this._params.ambientLight,"color").onChange(e=>this._ambientLight.color=new Y(e))}if(this._hemiLight){let t=e.addFolder("Hemi Light");t.add(this._hemiLight,"visible"),t.add(this._hemiLight,"intensity").min(0).max(5).step(.1),t.addColor(this._params.hemiLight,"color").onChange(e=>this._hemiLight.color=new Y(e))}if(this._mainDirLight){let t=e.addFolder("Main Directional Light");t.add(this._mainDirLight,"visible"),t.add(this._mainDirLight,"intensity").min(0).max(10).step(.1),t.add(this._mainDirLight,"castShadow"),t.addColor(this._params.mainDirLight,"color").onChange(e=>this._mainDirLight.color=new Y(e)),t.add(this._mainDirLight.position,"x").min(-10).max(10).step(.1).onChange(()=>this._mainDirLight.lookAt(this._center)),t.add(this._mainDirLight.position,"y").min(-10).max(50).step(.1).onChange(()=>this._mainDirLight.lookAt(this._center)),t.add(this._mainDirLight.position,"z").min(-10).max(10).step(.1).onChange(()=>this._mainDirLight.lookAt(this._center))}}}}const Oe=e=>e instanceof r||e instanceof o;class He{constructor(e){const{planElementViewModel:t,planElementViewModels:n,selectionMode:a,reason:i}=e;this.planElementViewModel=t,this.planElementViewModels=n,this.selectionMode=a,this.reason=i}}class Le{constructor(e){const{planElementViewModel:t,resetCamera:n,state:a,oldState:i,reason:s}=e;this.planElementViewModel=t,this.resetCamera=void 0===n||n,this.state=void 0===a?0:a,this.oldState=void 0===i?0:i,this.reason=s}}class Ae extends Pe{constructor(e,t,n,a){super(e,t,n,a),this._isDrawingEnabled=!1,this._isCurrentlyDrawing=!1,this._state=0,this._inputManager.addEventListener(4,()=>this._position=null,this),this._raycastHelper.setMode(0),this._raycastHelper.addEventListener(0,()=>{2!==this._state?this._plannerSelectionHandler.cancelSelection("click_outside"):this.resetState()},this),this._plannerSelectionHandler.addEventListener(0,({planElementViewModel:e})=>{this.dispatchEvent(0,new Le({planElementViewModel:e}))},this),this._plannerSelectionHandler.addEventListener(2,({planElementViewModels:e})=>{this._roomlePlannerUiCallback.onMultiSelectionChange(e)},this),this._plannerSelectionHandler.addEventListener(15,({selectionMode:e})=>{"multiselect"===e&&this._hoveredObject&&this._hoverOnMultiSelect(this._hoveredObject)},this),this._plannerSelectionHandler.addEventListener(1,({planElementViewModel:e,reason:t})=>{1!==this._state&&this.setState(0),this.dispatchEvent(1,new Le({planElementViewModel:e,reason:t}))},this),this._inputManager.addEventListener(6,e=>this._move(e),this)}disable(){const e=new ne;e.disableAll(),this._raycastHelper.setLayers(e),this._raycastHelper.disableEvents()}get planInteractionHandler(){var e;return null===(e=this._plannerKernelAccess)||void 0===e?void 0:e.planInteractionHandler}get hoveredObjectId(){var e;return(null===(e=this._hoveredObject)||void 0===e?void 0:e.getPlanElement())?this._hoveredObject.getId():null}enable(){const e=new ne;e.disableAll(),e.enable(3),e.enable(7),e.enable(6),e.enable(9),e.enable(2),this._raycastHelper.setLayers(e),this._raycastHelper.enableEvents()}enableConstructionEvents(e){e?this._raycastHelper.getLayers().enable(9):this._raycastHelper.getLayers().disable(9)}enableObjectEvents(e){e?this._raycastHelper.getLayers().enable(6):this._raycastHelper.getLayers().disable(6)}getSelectionMode(){return this._plannerSelectionHandler.getSelectionMode()}addPlanObjectHandlers(e,t){t||(t=e.getBoundingBox());const n={hasListener:!0,priority:1,roomleId:e.getId()};this._addPlanObjectHandlers(e,t,n)}addWallHandlers(e){this._addPlanElementHandlers(e,e.getObject(),{hasListener:!0,priority:1,roomleId:e.getId()})}addFloorHandlers(e){this._addFloorElementHandlers(e,e.getObject(),{hasListener:!0,priority:1,roomleId:e.getId()})}addNodeHandlers(e){this._addPlanElementHandlers(e,e.getBoundingBox(),{hasListener:!0,priority:1,roomleId:e.getId()})}_addPlanObjectHandlers(e,t,n){t.userData.hasListener||(t.userData=ae(t.userData,n),t.addEventListener("select",()=>this._clickElement(e)),t.addEventListener("drag_start",()=>this._dragStart(e)),t.addEventListener("drag",t=>this._drag(e,t.attachment.position)),t.addEventListener("drag_end",t=>this._dragEnd(e,t.attachment.position)),t.addEventListener("hover_on",()=>this._hoverOn(e)),t.addEventListener("hover_off",()=>this._hoverOff(e)),t.addEventListener("rotate",t=>this._rotate(e,t.attachment.rotation)))}_addFloorElementHandlers(e,t,n){this._addElementHandlers(e,t,n)}_addElementHandlers(e,t,n){t.userData.hasListener||(t.userData=ae(t.userData,n),t.addEventListener("select",()=>this._clickElement(e)),t.addEventListener("double_click",t=>{var n;this._doubleClickElement(e,t.attachment.type,null===(n=t.attachment.intersection)||void 0===n?void 0:n.point)}),t.addEventListener("hover_on",()=>this._hoverOn(e)),t.addEventListener("hover_off",()=>this._hoverOff(e)))}_addPlanElementHandlers(e,t,n){t.userData.hasListener||(this._addElementHandlers(e,t,n),t.addEventListener("drag_start",()=>this._dragStart(e)),t.addEventListener("drag",t=>this._drag(e,t.attachment.position)),t.addEventListener("drag_end",t=>this._dragEnd(e,t.attachment.position)))}_createFloorMeshWithHandler(){const e=new ie(1e3,1e3,8,8),t=new se;t.visible=!1;const n=new re(e,t);return n.name="2D raycaster floor mesh",n.rotation.set(-Math.PI/2,0,0),n.layers.enable(2),n.userData.ignoreElementHit=!0,n.userData=ae(n.userData,{hasListener:!0,priority:.9,roomleId:void 0}),n.addEventListener("double_click",e=>{this._doubleClickOnPlane(h(e.attachment.intersection.point),e.attachment.type)}),n.addEventListener("select",e=>{this._isCurrentlyDrawing?this._clickOnPlane(h(e.attachment.intersection.point)):this._plannerSelectionHandler.cancelSelection("select_other")}),n}_clickOnPlane(e){this._createNode(null,e)}_doubleClickOnPlane(e,t=0){this._closeToPoint(e)?this.stopDrawing():this._toggleDrawing(null,e,t)}_closeToPoint(e){let t=!1;for(const n of this._planViewModel.getNodePlanObjectViewModels())this._close(n.getPlanElement().getCenter(),e)&&(t=!0);return t}_close(e,t){return Math.abs(e.x-t.x)<500&&Math.abs(e.y-t.y)<500&&Math.abs(e.z-t.z)<500}_clickElement(e){this._isCurrentlyDrawing||(this._debug&&e.getId(),2!==this._state?(this._plannerSelectionHandler.check(e),this._roomlePlannerUiCallback.onClickElement(e),this._setCursor()):this.resetState())}_doubleClickElement(e,t=0,n){if(!this._isDrawingEnabled||!(e instanceof d||e instanceof r))return;let a;this._debug&&e.getId(),e instanceof r&&this._plannerSelectionHandler.cancelSelection("double_click_wall"),e instanceof d?a=e.getPlanElement().getCenter():n&&(a=h(new J(n.x,0,n.z))),this._isCurrentlyDrawing?this._endWallDrawing(null,a):this._startWallDrawing(null,a,t)}_hoverOn(e){this._isCurrentlyDrawing||("multiselect"===this._plannerSelectionHandler.getSelectionMode()?this._hoverOnMultiSelect(e):this._hoverOnStandard(e))}_hoverOnMultiSelect(e){Oe(this._hoveredObject)||Oe(e)?(this._hoveredObject=null,oe("default")):this._hoverOnStandard(e)}_hoverOnStandard(e){e.hoverOn(),this._hoveredObject=e,this.dispatchEvent(3,new Le({planElementViewModel:e})),this._interaction(),this._setCursor()}_hoverOff(e){e.hoverOff(),this.dispatchEvent(4,new Le({planElementViewModel:e})),this._interaction(),this._hoveredObject=null,this._setCursor()}_setCursor(){2===this._state&&this._hasSelection()?oe("ew-resize"):1===this._state?oe("grabbing"):this._plannerSelectionHandler.isSelected(this.hoveredObjectId)?oe("move"):this._hoveredObject?oe("pointer"):3===this._state?oe(_?"url('https://res.cloudinary.com/roomle/image/upload/v1664957371/pencil_j5vkhm.svg') 0 15, auto":"url('https://res.cloudinary.com/roomle/image/upload/v1664957371/pencil_j5vkhm.svg') 3 20, auto"):oe("default")}setCamera(e){this._raycastHelper.setCamera(e)}setScene(e){this._raycastHelper.setScene(e)}getSelectedIds(){return this._plannerSelectionHandler.getSelectedIds()}setSelectionMode(e){this._plannerSelectionHandler.setSelectionMode(e)}setPlanViewModel(e){this._planViewModel=e}cancelSelection(e){this._plannerSelectionHandler.cancelSelection(e)}removeSelection(){this._plannerSelectionHandler.removeSelection()}_dragStart(e){((this._plannerSelectionHandler.isSelected(e.getId())||this._dragIn)&&0===this._state||this._isDrawingEnabled)&&(this.dispatchEvent(8),le(v.DRAG).then(()=>{if(this._inputManager.isMouseUp())return this.setState(0),oe("pointer"),void this.dispatchEvent(12);this._draggedObject=e,this.setState(1),this._roomlePlannerUiCallback.onDragElementStart(),this.dispatchEvent(9,new Le({planElementViewModel:e}))}))}_drag(e,t){if(!this._draggedObject||1!==this._state)return;const n=this.planInteractionHandler;if(this._plannerSelectionHandler.getSelectedIds().length>1){const e=new this._plannerKernelAccess.kernelContainer.PlanObjectPtrList;let a=t.sub(this._draggedObject.getPosition());this._plannerSelectionHandler.getSelectedIds().forEach(t=>e.push_back(this._planViewModel.getPlanObjectForId(t).getPlanElement()));const i=h(a);this._plannerSelectionHandler.hasMultiSelection()&&(i.z=0),n.moveObjectsBy(e,i)}else(e instanceof d||e instanceof r||this._planViewModel.cameraType===g.CAMERA_2D)&&(this._plannerSelectionHandler.check(e),t.y=p(e.getPlanElement().getCenter()).y),n.moveElementTo(e.getPlanElement(),h(t));this.dispatchEvent(10,new Le({planElementViewModel:e}))}_dragEnd(e,t){this._draggedObject&&(this._draggedObject=null,this.setState(0),this.dispatchEvent(11,new Le({planElementViewModel:e})),this._dragIn&&this.setDragIn(!1),this._roomlePlannerUiCallback.onDragElementEnd(),this._setCursor())}_rotate(e,t){if(this._plannerSelectionHandler.isSelected(e.getId())){const n=this.planInteractionHandler,a=e.getPlanObject();n.setObjectRotation(e.getPlanElement(),a.rotation-t)}}setState(e){var t,n;const a=this._state;this._state=e,this._setCursor(),this.dispatchEvent(2,new Le({state:this._state,oldState:a})),this._position=null,2===this._state?null===(t=this.planInteractionHandler)||void 0===t||t.deactivateAllSnappingActivity():2===a&&(null===(n=this.planInteractionHandler)||void 0===n||n.reactivateAllSnappingActivity())}resetState(){this.setState(0)}_move(e){if(3!==this._state&&2===this._state&&this._hasSelection()){this._setCursor();let t=Math.PI/180;const{x:n,y:a}=e.positionRelative;this._position?t=1.4*e.positionRelative.x*Math.PI-1.4*this._position.x*Math.PI:this._position=new J(e.positionRelative.x,e.positionRelative.y,0);const i=new this._plannerKernelAccess.kernelContainer.PlanObjectPtrList,s=new ce;this.getSelectedIds().forEach(e=>{var t;const n=null===(t=this._planViewModel)||void 0===t?void 0:t.getPlanObjectForId(e);n&&n.getObject()&&(i.push_back(n.getPlanElement()),s.expandByObject(n.getContainer()))});const r=s.getCenter(new J);this.planInteractionHandler.rotateObjectsBy(i,t,h(r)),this._position.copy(new J(n,a,0))}}_hasSelection(){return this._plannerSelectionHandler.getSelectedIds().length>0}async selectPlanElement(e){(e instanceof m||e instanceof u)&&await e.isInitDone(),this._plannerSelectionHandler.check(e)}_interaction(e){this.dispatchEvent(13,new Le({}))}addComponentDragInHandler(e){if(!this._dragIn)return;const t=e.getBoundingBox();this._addPlanElementHandlers(e,t,{hasListener:!0,priority:1,roomleId:e.getId()}),this._raycastHelper.enableDragIn(t),this._dragStart(e)}enableSnapping(){this.planInteractionHandler.snapObjectsToWalls=!0}disableSnapping(){this.planInteractionHandler.snapObjectsToWalls=!1}enableWallDrawing(){return this._isDrawingEnabled=!0,this._drawingGroup=new he,this._drawingGroup.name="Drawing",this._drawingGroup.add(this._createFloorMeshWithHandler()),this._inputManager.addEventListener(6,this._drawWallOnMouseMove,this),this._inputManager.addEventListener(13,this._endWallDrawing,this),this._drawingGroup}cancelWallDrawing(){return this._isDrawingEnabled=!1,this._setStateAndCursor(0),this._inputManager.removeEventListener(6,this._drawWallOnMouseMove),this._inputManager.removeEventListener(13,this._endWallDrawing),this._raycastHelper.clear(),this._drawingGroup}stopDrawing(e=!0){var t;e&&this.planInteractionHandler.cancelDrawing(),this._raycastHelper.getLayers().enable(9),this._isCurrentlyDrawing=!1,this._setStateAndCursor(0),this.dispatchEvent(7),null===(t=this._continousDrawingHelper)||void 0===t||t.endDrawing()}startDrawing(){var e;this._isCurrentlyDrawing||(this._isCurrentlyDrawing=!0,this._raycastHelper.getLayers().disable(9),this.dispatchEvent(6),this._setStateAndCursor(3),null===(e=this._continousDrawingHelper)||void 0===e||e.update())}_toggleDrawing(e,t,n){this._isCurrentlyDrawing?this._endWallDrawing(e,t):this._startWallDrawing(e,t,n)}_endWallDrawing(e,t){if(this._isCurrentlyDrawing){if(this.planInteractionHandler.getContinuousDrawingManager().shouldShowCircle()&&this.planInteractionHandler.getContinuousDrawingManager().shouldShowCircle())this.planInteractionHandler.cancelDrawing();else{const{x:n,y:a}=t||this._getIntersectionPointWithScene(e);this.planInteractionHandler.endDrawing({x:n,y:a,z:0})}this.stopDrawing(!1)}}async _startWallDrawing(e,t,n){(e&&2===e.type||2===n)&&(await this._initMobileDrawing(),this._continousDrawingHelper.update());const{x:a,y:i}=t||this._getIntersectionPointWithScene(e);this.planInteractionHandler.beginDrawing({x:a,y:i,z:0}),this.startDrawing()}async _initMobileDrawing(){if(this.planInteractionHandler.setDrawingType(0),this.planInteractionHandler.setSnapFeedbackWhileDrawing(!0),!this._continousDrawingHelper){const{default:e}=await t.import("./continuous-drawing-helper-959c9230.legacy.js");this._continousDrawingHelper=new e,this._continousDrawingHelper.init(this._drawingGroup,this.planInteractionHandler.getContinuousDrawingManager(),this._kernelZoomFactor)}}_drawWallOnMouseMove(e){var t;if(!this._isCurrentlyDrawing)return;const{x:n,y:a}=this._getIntersectionPointWithScene(e);this.planInteractionHandler.currentDrawingPosition({x:n,y:a,z:0}),null===(t=this._continousDrawingHelper)||void 0===t||t.update(),this.dispatchEvent(5)}_createNode(e,t){if(!this._isCurrentlyDrawing)return;const{x:n,y:a}=t||this._getIntersectionPointWithScene(e);this.planInteractionHandler.forceNode({x:n,y:a,z:0}),this._raycastHelper.clear()}_getIntersectionPointWithScene(e){return this._raycastHelper.intersectMouseOnScene(e)}_setStateAndCursor(e){this.setState(e),this._setCursor()}setKernelZoomFactor(e){var t;this._kernelZoomFactor=e,null===(t=this._continousDrawingHelper)||void 0===t||t.setKernelZoomFactor(e)}}l([c],Ae.prototype,"_plannerSelectionHandler",void 0),l([c],Ae.prototype,"_plannerKernelAccess",void 0),l([c],Ae.prototype,"_roomlePlannerUiCallback",void 0);const ke=(e,t,n,a)=>{const i=(new ce).setFromObject(e.getContainer()).getCenter(new J);return{runtimeId:e.getId(),position2d:w(C(i,t,n,a))}};var je=function(e){de(n,e);var t=_e(n);function n(){var e;ge(this,n);var a=n.SkyShader,i=new pe({name:"SkyShader",fragmentShader:a.fragmentShader,vertexShader:a.vertexShader,uniforms:me.clone(a.uniforms),side:ue,depthWrite:!1});return(e=t.call(this,new ve(1,1,1),i)).isSky=!0,e}return we(n)}(re);je.SkyShader={uniforms:{turbidity:{value:2},rayleigh:{value:1},mieCoefficient:{value:.005},mieDirectionalG:{value:.8},sunPosition:{value:new J},up:{value:new J(0,1,0)}},vertexShader:"\n\t\tuniform vec3 sunPosition;\n\t\tuniform float rayleigh;\n\t\tuniform float turbidity;\n\t\tuniform float mieCoefficient;\n\t\tuniform vec3 up;\n\n\t\tvarying vec3 vWorldPosition;\n\t\tvarying vec3 vSunDirection;\n\t\tvarying float vSunfade;\n\t\tvarying vec3 vBetaR;\n\t\tvarying vec3 vBetaM;\n\t\tvarying float vSunE;\n\n\t\t// constants for atmospheric scattering\n\t\tconst float e = 2.71828182845904523536028747135266249775724709369995957;\n\t\tconst float pi = 3.141592653589793238462643383279502884197169;\n\n\t\t// wavelength of used primaries, according to preetham\n\t\tconst vec3 lambda = vec3( 680E-9, 550E-9, 450E-9 );\n\t\t// this pre-calcuation replaces older TotalRayleigh(vec3 lambda) function:\n\t\t// (8.0 * pow(pi, 3.0) * pow(pow(n, 2.0) - 1.0, 2.0) * (6.0 + 3.0 * pn)) / (3.0 * N * pow(lambda, vec3(4.0)) * (6.0 - 7.0 * pn))\n\t\tconst vec3 totalRayleigh = vec3( 5.804542996261093E-6, 1.3562911419845635E-5, 3.0265902468824876E-5 );\n\n\t\t// mie stuff\n\t\t// K coefficient for the primaries\n\t\tconst float v = 4.0;\n\t\tconst vec3 K = vec3( 0.686, 0.678, 0.666 );\n\t\t// MieConst = pi * pow( ( 2.0 * pi ) / lambda, vec3( v - 2.0 ) ) * K\n\t\tconst vec3 MieConst = vec3( 1.8399918514433978E14, 2.7798023919660528E14, 4.0790479543861094E14 );\n\n\t\t// earth shadow hack\n\t\t// cutoffAngle = pi / 1.95;\n\t\tconst float cutoffAngle = 1.6110731556870734;\n\t\tconst float steepness = 1.5;\n\t\tconst float EE = 1000.0;\n\n\t\tfloat sunIntensity( float zenithAngleCos ) {\n\t\t\tzenithAngleCos = clamp( zenithAngleCos, -1.0, 1.0 );\n\t\t\treturn EE * max( 0.0, 1.0 - pow( e, -( ( cutoffAngle - acos( zenithAngleCos ) ) / steepness ) ) );\n\t\t}\n\n\t\tvec3 totalMie( float T ) {\n\t\t\tfloat c = ( 0.2 * T ) * 10E-18;\n\t\t\treturn 0.434 * c * MieConst;\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvec4 worldPosition = modelMatrix * vec4( position, 1.0 );\n\t\t\tvWorldPosition = worldPosition.xyz;\n\n\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\t\t\tgl_Position.z = gl_Position.w; // set z to camera.far\n\n\t\t\tvSunDirection = normalize( sunPosition );\n\n\t\t\tvSunE = sunIntensity( dot( vSunDirection, up ) );\n\n\t\t\tvSunfade = 1.0 - clamp( 1.0 - exp( ( sunPosition.y / 450000.0 ) ), 0.0, 1.0 );\n\n\t\t\tfloat rayleighCoefficient = rayleigh - ( 1.0 * ( 1.0 - vSunfade ) );\n\n\t\t\t// extinction (absorbtion + out scattering)\n\t\t\t// rayleigh coefficients\n\t\t\tvBetaR = totalRayleigh * rayleighCoefficient;\n\n\t\t\t// mie coefficients\n\t\t\tvBetaM = totalMie( turbidity ) * mieCoefficient;\n\n\t\t}",fragmentShader:"\n\t\tvarying vec3 vWorldPosition;\n\t\tvarying vec3 vSunDirection;\n\t\tvarying float vSunfade;\n\t\tvarying vec3 vBetaR;\n\t\tvarying vec3 vBetaM;\n\t\tvarying float vSunE;\n\n\t\tuniform float mieDirectionalG;\n\t\tuniform vec3 up;\n\n\t\tconst vec3 cameraPos = vec3( 0.0, 0.0, 0.0 );\n\n\t\t// constants for atmospheric scattering\n\t\tconst float pi = 3.141592653589793238462643383279502884197169;\n\n\t\tconst float n = 1.0003; // refractive index of air\n\t\tconst float N = 2.545E25; // number of molecules per unit volume for air at 288.15K and 1013mb (sea level -45 celsius)\n\n\t\t// optical length at zenith for molecules\n\t\tconst float rayleighZenithLength = 8.4E3;\n\t\tconst float mieZenithLength = 1.25E3;\n\t\t// 66 arc seconds -> degrees, and the cosine of that\n\t\tconst float sunAngularDiameterCos = 0.999956676946448443553574619906976478926848692873900859324;\n\n\t\t// 3.0 / ( 16.0 * pi )\n\t\tconst float THREE_OVER_SIXTEENPI = 0.05968310365946075;\n\t\t// 1.0 / ( 4.0 * pi )\n\t\tconst float ONE_OVER_FOURPI = 0.07957747154594767;\n\n\t\tfloat rayleighPhase( float cosTheta ) {\n\t\t\treturn THREE_OVER_SIXTEENPI * ( 1.0 + pow( cosTheta, 2.0 ) );\n\t\t}\n\n\t\tfloat hgPhase( float cosTheta, float g ) {\n\t\t\tfloat g2 = pow( g, 2.0 );\n\t\t\tfloat inverse = 1.0 / pow( 1.0 - 2.0 * g * cosTheta + g2, 1.5 );\n\t\t\treturn ONE_OVER_FOURPI * ( ( 1.0 - g2 ) * inverse );\n\t\t}\n\n\t\tvoid main() {\n\n\t\t\tvec3 direction = normalize( vWorldPosition - cameraPos );\n\n\t\t\t// optical length\n\t\t\t// cutoff angle at 90 to avoid singularity in next formula.\n\t\t\tfloat zenithAngle = acos( max( 0.0, dot( up, direction ) ) );\n\t\t\tfloat inverse = 1.0 / ( cos( zenithAngle ) + 0.15 * pow( 93.885 - ( ( zenithAngle * 180.0 ) / pi ), -1.253 ) );\n\t\t\tfloat sR = rayleighZenithLength * inverse;\n\t\t\tfloat sM = mieZenithLength * inverse;\n\n\t\t\t// combined extinction factor\n\t\t\tvec3 Fex = exp( -( vBetaR * sR + vBetaM * sM ) );\n\n\t\t\t// in scattering\n\t\t\tfloat cosTheta = dot( direction, vSunDirection );\n\n\t\t\tfloat rPhase = rayleighPhase( cosTheta * 0.5 + 0.5 );\n\t\t\tvec3 betaRTheta = vBetaR * rPhase;\n\n\t\t\tfloat mPhase = hgPhase( cosTheta, mieDirectionalG );\n\t\t\tvec3 betaMTheta = vBetaM * mPhase;\n\n\t\t\tvec3 Lin = pow( vSunE * ( ( betaRTheta + betaMTheta ) / ( vBetaR + vBetaM ) ) * ( 1.0 - Fex ), vec3( 1.5 ) );\n\t\t\tLin *= mix( vec3( 1.0 ), pow( vSunE * ( ( betaRTheta + betaMTheta ) / ( vBetaR + vBetaM ) ) * Fex, vec3( 1.0 / 2.0 ) ), clamp( pow( 1.0 - dot( up, vSunDirection ), 5.0 ), 0.0, 1.0 ) );\n\n\t\t\t// nightsky\n\t\t\tfloat theta = acos( direction.y ); // elevation --\x3e y-axis, [-pi/2, pi/2]\n\t\t\tfloat phi = atan( direction.z, direction.x ); // azimuth --\x3e x-axis [-pi/2, pi/2]\n\t\t\tvec2 uv = vec2( phi, theta ) / vec2( 2.0 * pi, pi ) + vec2( 0.5, 0.0 );\n\t\t\tvec3 L0 = vec3( 0.1 ) * Fex;\n\n\t\t\t// composition + solar disc\n\t\t\tfloat sundisk = smoothstep( sunAngularDiameterCos, sunAngularDiameterCos + 0.00002, cosTheta );\n\t\t\tL0 += ( vSunE * 19000.0 * Fex ) * sundisk;\n\n\t\t\tvec3 texColor = ( Lin + L0 ) * 0.04 + vec3( 0.0, 0.0003, 0.00075 );\n\n\t\t\tvec3 retColor = pow( texColor, vec3( 1.0 / ( 1.2 + ( 1.2 * vSunfade ) ) ) );\n\n\t\t\tgl_FragColor = vec4( retColor, 1.0 );\n\n\t\t\t#include <tonemapping_fragment>\n\t\t\t#include <colorspace_fragment>\n\n\t\t}"};const Ve=async(e,t,n)=>{let a=[];const i=[],s=[];await Promise.all(e.map(async e=>{const n=f(e);if(n.catalogItemId?i.push(n.catalogItemId):n.configurationHash&&s.push(n.configurationHash),n.parts){const e=n.configurationHash||n.catalogItemId,a=await t.addUiDataAndPriceToPartList(n.parts,e);n.parts=a}n.data=null,a.push(n)}));const[r,o]=await Promise.all([n.getItems(i),n.getConfigurations(s)]),l=[],c=new Map;for(const e of r)c.set(e.id,e);for(const e of o)c.set(e.id,e),l.push(e.rootComponentId);const h=await n.getComponents(l),d=new Map;for(const e of h)d.set(e.id,e);for(const e of a){const t=e.catalogItemId||e.configurationHash,n=c.get(t)||null;if(n&&!n.label&&d.has(n.rootComponentId)){const e=d.get(n.rootComponentId);n.label=e.label}n&&!n.label&&(n.label=t),e.data=n}return a};class xe extends Se{constructor(e,t,n,a){super(e,t,a),this._staticItemGuard=new b,this._configurableItemGuard=new b,this._planCompletelyLoadedGuard=new b,this.currentSelection=null,this._stopRendering=!0,this._configuratorContext.baseContext="planner",this._roomlePlannerCallback=n,this._plannerMeshGenerator.maxAnisotropy=this._renderer.capabilities.getMaxAnisotropy(),this._plannerMeshGenerator.maxTextures=this._renderer.capabilities.maxTextures,this._plannerSceneEventHandler=new Ae(e,this._scene,this._cameraControl.getCamera(),this._getInputManager()),this._roomleRenderer.switchToPlanner(M.Mode3D),this._imageRenderer.switchToPlannerSettings(),this._plannerSceneEventHandler.addEventListener(2,({state:e,oldState:t})=>{2===t&&e!==t&&this._roomlePlannerUiCallback.onRotationCancel(),2===e||1===e||3===e?(this._cameraControl.lock(),this._onCameraMove()):(this._cameraControl.unlock(),this._onCameraIdle())},this),this._plannerSceneEventHandler.addEventListener(13,()=>this._renderWithoutShadowsAndAO(),this),this._plannerSceneEventHandler.addEventListener(0,({planElementViewModel:e})=>{e instanceof u&&this._initData.debug&&e.getGLBUrl(),this._highlightPlanElement(e),this._onSelectionChange(e),this._renderWithoutShadowsAndAO()},this),this._plannerSceneEventHandler.addEventListener(1,({planElementViewModel:e,reason:t})=>{this._highlightPlanElement(null),this._onSelectionCancel(e),this._roomlePlannerUiCallback.onSelectionCancel(t),this._renderWithoutShadowsAndAO()},this),this._plannerSceneEventHandler.addEventListener(8,()=>{this._cameraControl.lock()},this),this._plannerSceneEventHandler.addEventListener(9,({planElementViewModel:e})=>{this._getKernelAccess().planInteractionHandler.startInteraction(),e instanceof r&&this._sendWallDimensions(),this._requestRender(),this._dragStartBounds=this.getBounds()},this),this._plannerSceneEventHandler.addEventListener(10,({planElementViewModel:e})=>{this._cameraControl.checkNearFarDistance(e.getPosition()),this._requestRender()},this),this._plannerSceneEventHandler.addEventListener(11,async({planElementViewModel:e})=>{const t=this._getKernelAccess().planInteractionHandler;t.endInteraction(),this._cameraControl.unlock();const n=this._getDragPosition(e.getPosition());n&&t.moveElementTo(e.getPlanElement(),h(n)),this.updateEnvironment(this.getBounds(),!0),this._zoomToBounds(!1),this._renderEverything();const a=this.getPlanObject(e.getId());let i;a&&(i=await Ve([a],this._plannerKernelAccess,this._rapiAccess)),this._roomlePlannerUiCallback.onPlanElementChanged(E.CHANGED,i?i[0]:null)},this),this._plannerSceneEventHandler.addEventListener(12,()=>{this._cameraControl.unlock()},this),this._plannerSceneEventHandler.addEventListener(6,()=>{this._setKernelZoomFactor(),this._renderWithoutShadowsAndAO()},this),this._plannerSceneEventHandler.addEventListener(5,()=>this._renderWithoutShadowsAndAO(),this),this._plannerSceneEventHandler.addEventListener(7,()=>this._renderWithoutShadowsAndAO(),this),this._getKernelAccess().addPlannerListener(this),this._plannerMeshGenerator.setMaterialLoadedListener(()=>{this._configurableItemGuard.resolve(),this._requestRender()}),window.onbeforeunload=this.clearScene.bind(this),this._renderListener=()=>{this._requestRender()},this._getInputManager().addEventListener(7,this._renderListener,this),this._getInputManager().addEventListener(8,this._renderListener,this),this.disableConfiguratorEvents(),this.enablePlannerEvents()}planCleared(){}planHistoryStateChanged(){this._sendWallDimensions()}_getViewModel(){return this._viewModel||(this._viewModel=new ye(this._creator_)),this._viewModel}_getDragPosition(e){if(!this._plannerSceneEventHandler.isDragIn())return null;const t=this._dragStartBounds?this._dragStartBounds:this.getBounds(),n=t.getCenter(new J),a=e.distanceTo(n),i=t.getSize(new J),s=Math.max(i.x,i.z)+3;if(a>s){const t=(new J).subVectors(e,n).normalize();return n.clone().add(t.multiplyScalar(s))}return null}_onSelectionChange(e){const t={};if(e instanceof u&&(t.item=e.getRapiItem(),t.staticItemRuntimeId=e.getPlanElement().getId()),e instanceof m&&(t.configurationRuntimeId=e.getConfigurationRuntimeId()),e instanceof r){const n=this._cameraControl.getKernelZoomFactor();t.wall=e.getWallDimension(n)}e instanceof o&&(t.staticItemRuntimeId=e.getPlanElement().getId());let n=(e=>{if(e instanceof u){const t=e.getPlanObject().getObjectType();return"door"!==t&&"window"!==t?"static":t}return e instanceof m?"configuration":e instanceof r?"wall":e instanceof o?"floor":"unknown"})(e);const a=(async()=>{const t={};if(e instanceof u&&(t.item=e.getRapiItem(),t.staticItemRuntimeId=e.getPlanElement().getId()),e instanceof m){await e.isInitDone();const a=e.getConfigurationRuntimeId(),i=e.getPlanObject().getCatalogItemId();let s,r=i;if(r||(r=this._getKernelAccess().kernelInstance.getHashOfConfiguration(a)),this._configuratorContext.planObjectId=a,this._configuratorContext.planElementId=e.getId(),this._configuratorContext.rootComponentId=e.getRootComponentRuntimeId(),i&&j(i)){const e=await this._rapiAccess.getItem(i);t.item=e,s=e.rootComponentId?e.rootComponentId:null}else try{const e=await this._rapiAccess.getConfiguration(r);t.configuration=e,s=e.rootComponentId?e.rootComponentId:null}catch(e){console.warn("Could not get RAPI configuration for kernel hash "+r+", saving configuration...");const n=await this._getKernelAccess().getConfigurationData(a),i=await this._rapiAccess.saveConfiguration(n);t.configuration=i,s=i.rootComponentId?i.rootComponentId:null}if(s){const e=await this._rapiAccess.getComponent(s);t.component=e}t.configurationRuntimeId=a,n="configuration"}return t.planElementId=e.getId(),Ce(t)})();this.currentSelection=Ce(t),this._roomlePlannerUiCallback.onSelectionChange(Ce(this._plannerSceneEventHandler.getSelectionMode()),Ce(n),Ce(t),a,e),(e instanceof r||e instanceof d)&&(this._getViewModel().getNodePlanObjectViewModels().forEach(e=>e.show()),this._updateNodeSize()),this._renderWithoutShadowsAndAO()}_onSelectionCancel(e){this._getViewModel().getNodePlanObjectViewModels().forEach(e=>e.hide()),this._renderWithoutShadowsAndAO(),this.resetConfiguratorContext(),this.currentSelection=null}resetConfiguratorContext(){this._configuratorContext.planObjectId=0,this._configuratorContext.planElementId=0,this._configuratorContext.rootComponentId=0,this._configuratorContext.dockingRootComponentId=0}_setupScene(e,t){super._setupScene(e,t,!0),this._initData.legacyLight&&(this._lightSetting=new De(this._scene,this._lightSetting)),this._initData.moc||this._addSky(),this._setEnvironment(new G(this._scene,this._environment,fe(this._initData.colors.DEFAULT_BACKGROUND)))}onBeforeRender(){this._cameraControl instanceof N&&P(this._cameraControl.getCamera(),this._getViewModel().getWallPlanObjectViewModels())&&this._roomleRenderer.forceShadowUpdates(!0)}_getInputManager(){return this._plannerInputManager}createCameraControl(e,t){this.setMode(e)}startViewing(){this._configuratorContext.baseContext="glb-viewer";const e=this._plannerSceneEventHandler.getSelectedIds();if(1===e.length){const t=this._getViewModel().getPlanObjectForId(e[0]);this._cameraControl instanceof N&&this._cameraControl.setObjectRotation(t.getPlanElement().rotation),this._getViewModel().hideAllExcept(t.getId())}this.resetCamera(),this.disablePlannerEvents(),this.updateEnvironment(this.getBounds(),!0)}startConfiguring(){var e;this._configuratorContext.baseContext="configurator";const{planElementId:t}=this._configuratorContext,n=this._getViewModel().getPlanObjectForId(t);n&&(this.setRootComponentId(n.getRootComponentRuntimeId()),this._cameraControl instanceof N&&this._cameraControl.setObjectRotation(n.getPlanElement().rotation));const a=null==n?void 0:n.getConfigurationRuntimeId();this._configuratorContext.planObjectId!==a&&(this._configuratorContext.planObjectId=a),this._getViewModel().hideAllExcept(t),this._plannerSceneEventHandler.removeSelection(),this._highlightPlanElement(null),this.resetCamera(),this.disablePlannerEvents(),this.enableConfiguratorEvents(),this._roomleRenderer.switchToConfigurator(),this._imageRenderer.switchToConfiguratorSettings(),this.updateScene(),this._getKernelAccess().updatePlanObjectDependencies(a),this._getKernelAccess().requestPartListAndUpdatePricesOfParts(),this._getKernelAccess().planObjectUpdated(a),this.updateEnvironment(this.getBounds(),!0);const i=null===(e=this._plannerKernelAccess)||void 0===e?void 0:e.planInteractionHandler;null==i||i.startInteraction()}async selectPlanObject(e){if(this._plannerSceneEventHandler.getSelectedIds().includes(e))return;const t=this._getViewModel().getPlanObjectForId(e);await this._plannerSceneEventHandler.selectPlanElement(t),this._onSelectionChange(t)}backToPlanner(){var e;if(this._getViewModel().showAll(),"configurator"===this._configuratorContext.baseContext){const t=null===(e=this._plannerKernelAccess)||void 0===e?void 0:e.planInteractionHandler;null==t||t.endInteraction()}this._configuratorContext.baseContext="planner",this._cameraControl instanceof N&&this._cameraControl.setObjectRotation(0),this.resetCamera(),this.enablePlannerEvents(),this.disableConfiguratorEvents(),this._roomleRenderer.switchToPlanner(this._cameraControl instanceof N?M.Mode3D:M.Mode2D),this._imageRenderer.switchToPlannerSettings(),this.updateScene()}resetCamera(){this._cameraControl.hasSavedState()?this.resetCameraToState():this.resetCameraPositionToStart()}resetCameraToState(){this._cameraControl.resetToState()}_getYRotationOfObject(e){let t=e.getWorldDirection(new J).clone();t.y=0,t.lengthSq()<.01&&(t=new J(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}loadStaticPlanObjects(){let e=new Map;this._getViewModel().getStaticPlanObjectViewModels().forEach(t=>{let n=t.getPlanObject();e.has(n.getCatalogItemId())?e.get(n.getCatalogItemId()).push(t):e.set(n.getCatalogItemId(),[t])}),this._rapiAccess.getItems(Array.from(e.keys())).then(t=>{let n=[];t.forEach(t=>{this._getKernelAccess().catalogItemLoaded(t),e.get(t.id).forEach(e=>{n.push(new Promise((n,a)=>{e.setRapiItem(t).then(()=>{this._requestRender(),n()},a)}))})}),Promise.all(n).then(()=>this._staticItemsLoaded())})}_staticItemsLoaded(){this._requestRender(),this._staticItemGuard.resolve(),this._roomlePlannerUiCallback.onItemsLoaded()}preload(e){this._planId=e;let t=this._localStorageHelper.getItem(this._planId,"rml_plans");t&&this._loadGLTF(t).then(e=>{this._preloadScene=e,this._preloadScene&&this._scene.add(this._preloadScene),this._requestRender()})}planXMLLoaded(e){this.endPlanConstruction(e);const t=e.getBounds(),n=S(t);this._updateBounds(n),this.loadStaticPlanObjects()}planCompletelyLoaded(e){this._stopRendering=!1,this._renderEverything(),this.resetCamera(),setTimeout(()=>this._planCompletelyLoadedGuard.resolve(),0),this._getViewModel().getNodePlanObjectViewModels().forEach(e=>e.hide())}handlerSwitchedPlans(e,t){if(this._roomlePlannerUiCallback.onHandlerSwitchedPlans(),this._getViewModel().setReference(t),this._getKernelAccess().coupleReferences(this._getViewModel(),t),this._getViewModel().setPlannerSceneEventHandler(this._plannerSceneEventHandler),this._getViewModel().setGeometriesMergedListener(()=>{this._renderEverything()}),this._plannerSceneEventHandler.setPlanViewModel(this._getViewModel()),e&&this.clearScene(),!this._initData.moc){this._addSky();let e=new ie(1e3,1e3);e.rotateX(-Math.PI/2);let t=y.createMeshStandardMaterial({color:"#f0f0f0",roughness:1,metalness:0,depthWrite:!1}),n=new re(e,t);n.name="Ground",n.position.y=-.01,n.userData.isFloor=!0,this._scene.add(n)}this.resetCamera(),this._setCeiling(),this._staticItemGuard.reset(),this._configurableItemGuard.reset(),this._planCompletelyLoadedGuard.reset(),Promise.all([this._staticItemGuard.wait(),this._configurableItemGuard.wait(),this._planCompletelyLoadedGuard.wait()]).then(this._itemsLoaded.bind(this))}_itemsLoaded(){var e;const t=this._getViewModel().getCorePlan();if(this._roomleRenderer){const n=S(t.getBounds());null===(e=this._roomleRenderer)||void 0===e||e.updateBounds(n)}this._roomlePlannerUiCallback.onCompletelyLoaded(),this.updateEnvironment(this.getBounds(),!0),this._renderEverything()}beginPlanConstruction(e){}addPlanMesh(e,t,n,a,i,s,r){}endPlanConstruction(e){this._renderLoopFunction=()=>{var e;this._scene.add(this._getViewModel().getConstructionGroup()),this._scene.add(this._getViewModel().getCeilingGroup()),this._scene.add(this._getViewModel().getFloorGroup()),(null===(e=this._lightSetting)||void 0===e?void 0:e.needsBounds())&&this._lightSetting.updateBounds(this._getViewModel().getBoundingBox()),this._scene.remove(this._preloadScene)}}async addPlanObjectToScene(e){if(e){const t=e.getContainer();I(t),this._scene.add(t),this._plannerSceneEventHandler.isDragIn()&&(this._plannerSceneEventHandler.addComponentDragInHandler(e),this._requestRender()),this._roomlePlannerUiCallback.onPlanChanged(),await e.isInitDone(),this._zoomToBounds(!1,!1),this.updateEnvironment(this.getBounds()),this._renderEverything();const n=this.getPlanObject(e.getId());let a;n&&(a=await Ve([n],this._plannerKernelAccess,this._rapiAccess)),this._roomlePlannerUiCallback.onPlanElementChanged(E.ADDED,a?a[0]:null)}}removePlanObjectFromScene(e){(e instanceof r||e instanceof d)&&this._sendWallDimensions(),this._scene.remove(e.getContainer()),e.clear(),this.updateEnvironment(this.getBounds(),!0),this._zoomToBounds(!0),this._renderEverything()}async planElementChanged(e,t){if(this._drawingEnabled&&this._sendWallDimensions(!1),this.updateEnvironment(this.getBounds(),!0),this._renderEverything(),this._onPlanChanged(),!this._plannerSceneEventHandler.isDragIn()){const e=this.getPlanObject(t.getId());let n;e&&(n=await Ve([e],this._plannerKernelAccess,this._rapiAccess)),this._roomlePlannerUiCallback.onPlanElementChanged(E.CHANGED,n?n[0]:null)}}exportGLB(e,t){}importGLB(e){this._loadGLB(e).then(e=>this._scene.add(e))}clearScene(){this._plannerMeshGenerator.clear(),this._getViewModel().sceneCleared(),super.clearScene()}_addSky(){if(!this._sky){this._sky=new je,this._sky.name="Sky",this._sky.scale.setScalar(45e4),this._sky.frustumCulled=!1,this._scene.add(this._sky),this._sky.material.uniforms.turbidity.value=10,this._sky.material.uniforms.rayleigh.value=2,this._sky.material.uniforms.mieCoefficient.value=.005,this._sky.material.uniforms.mieDirectionalG.value=.8;let e=D(4e5,0,.6);this._sky.material.uniforms.sunPosition.value.copy(e);let t=new re(new be(2e4,16,8),new se({color:16777215}));t.name="Sunsphere",t.position.y=-7e5,t.visible=!1,t.position.set(e.x,-e.z,e.y)}this._lightSetting instanceof De&&this._lightSetting.updateSunPosition(.6,0)}switchTo2D(){var e;if(this._onCameraMove(),!(this._cameraControl instanceof Z)){for(const e of this._getViewModel().getWallPlanObjectViewModels())e.show();this._getViewModel().setCameraType(g.CAMERA_2D),null===(e=this._roomleRenderer)||void 0===e||e.switchToPlanner(M.Mode2D),this._renderEverything(),this._changeCameraControl(new Z(this._creator_,this._getInputManager(),null,this.getOrthographicOffsetCamera())),this._updateCamera(),this._addCameraControlListener(),this._setCeiling(),this._roomlePlannerUiCallback.onCameraChanged(g.CAMERA_2D),this._setCameraControlListeners(),this._setKernelZoomFactor(),this._onCameraMove()}}switchTo3D(){var e;this._onCameraMove(),this._cameraControl instanceof N||(this._getViewModel().setCameraType(g.CAMERA_3D),null===(e=this._roomleRenderer)||void 0===e||e.switchToPlanner(M.Mode3D),this._renderEverything(),this._changeCameraControl(new N(this._creator_,this._getInputManager(),new J(0,10,0),this.getPerspectiveOffsetCamera())),this._updateCamera(),this._addCameraControlListener(),this._setCeiling(),this._roomlePlannerUiCallback.onCameraChanged(g.CAMERA_3D),this._setCameraControlListeners())}_setCameraControlListeners(){this._cameraControl.addEventListener(8,()=>{this._onCameraIdle()},this),this._cameraControl.addEventListener(1,()=>{this._onCameraMove()},this),this._cameraControl.addEventListener(7,()=>{this._onCameraMove()},this),this._cameraControl.addEventListener(3,()=>{this._onCameraMove()},this),this._cameraControl.addEventListener(4,()=>{this._onCameraMove()},this),this._cameraControl.addEventListener(5,()=>{this._onCameraZoomChange()},this)}_onCameraZoomChange(){this._setKernelZoomFactor()}_setKernelZoomFactor(){var e,t;const n=this._cameraControl.getKernelZoomFactor();null===(e=this._getKernelAccess().planInteractionHandler)||void 0===e||e.setZoomFactor(n),null===(t=this._plannerSceneEventHandler)||void 0===t||t.setKernelZoomFactor(n)}_setCeiling(){this._getViewModel()&&(this._cameraControl instanceof q?this._getViewModel().getCeilingGroup().visible=!0:this._getViewModel().getCeilingGroup().visible=!1)}cameraControlChanged(){var e;super.cameraControlChanged(),null===(e=this._plannerSceneEventHandler)||void 0===e||e.setCamera(this._cameraControl.getCamera())}sceneChanged(){this._plannerSceneEventHandler&&this._plannerSceneEventHandler.setScene(this._scene)}closeHSC(){this._requestRender(),this._cameraControl instanceof N&&this._cameraControl.resetToState()}switchToFirstPerson(){if(this._cameraControl instanceof q)return;this._plannerMeshGenerator.wallMeshes.forEach(e=>O(e.material,!1,!1)),this._getViewModel().setCameraType(g.CAMERA_FP),this._renderEverything();let e=new J(0,0,0);this._getViewModel()&&(e=this._getViewModel().getBoundingBox().getCenter(new J)),this._cameraControl&&this._cameraControl.cleanUp(),this._changeCameraControl(new q(this._creator_,this._getInputManager(),e,this.getPerspectiveOffsetCamera())),this._addCameraControlListener(),this._setCeiling(),this._roomlePlannerUiCallback.onCameraChanged(g.CAMERA_FP),this._setCameraControlListeners()}_onKeyDown(e){super._onKeyDown(e),this._initData.debug&&this._checkNumKey(e),!e.key||"Meta"!==e.key&&"Control"!==e.key||(this._plannerSceneEventHandler.setSelectionMode("multiselect"),e.preventDefault()),e.key&&e.key.includes("Shift")&&this._cameraControl instanceof N&&(this._cameraControl.enablePanning(),e.preventDefault())}_checkNumKey(e){e.key&&"1"===e.key&&(this.switchTo2D(),e.preventDefault()),e.key&&"2"===e.key&&(this.switchTo3D(),e.preventDefault()),e.key&&"3"===e.key&&(this.switchToFirstPerson(),e.preventDefault())}_onKeyUp(e){super._onKeyDown(e),!e.key||"Meta"!==e.key&&"Control"!==e.key||(this._plannerSceneEventHandler.setSelectionMode("standard"),e.preventDefault()),e.key&&e.key.includes("Shift")&&this._cameraControl instanceof N&&(this._cameraControl.disablePanning(),e.preventDefault()),!e.key||"Escape"!==e.key&&"Esc"!==e.key||this._drawingEnabled&&(this.escapeDrawing(),this._roomlePlannerUiCallback.onDrawCancel())}setMode(e){switch(e){case g.CAMERA_2D:this.switchTo2D();break;case g.CAMERA_3D:this.switchTo3D();break;case g.CAMERA_FP:this.switchToFirstPerson()}}_highlightPlanElement(e){var t;let n=new Set;e instanceof H&&this._cameraControl instanceof Z&&e&&e.getTopViewContainer()?n.add(e.getTopViewContainer()):e&&e.getObject()&&e.getObject().children&&e.getObject().children.forEach(e=>n.add(e)),this._plannerSceneEventHandler.getSelectedIds().forEach(e=>{const t=this._getViewModel().getPlanObjectForId(e);t instanceof H&&this._cameraControl instanceof Z&&t&&t.getTopViewContainer()?n.add(t.getTopViewContainer()):t&&t.getObject()&&t.getObject().children&&t.getObject().children.forEach(e=>n.add(e))}),null===(t=this._roomleRenderer)||void 0===t||t.highlightObjects(Array.from(n))}destroy(){super.destroy(),this._plannerMeshGenerator.removeMaterialLoadedListener(),this._getViewModel().removeGeometriesMergedListener()}planObjectConfigurationLoaded(e,t,n){if(e&&e.extRef&&t&&t.extRef){let e=t.extRef.jsObject.getPlanObject().getConfigurationRuntimeId();e>0&&this._getViewModel().constructComponents(e)}}addMesh(e,t,n,a,i,s){}_updateBounds(e){e&&("planner"===this._configuratorContext.baseContext&&this._updateCamera(e),super._updateBounds(e))}_updateCamera(e){e||(e=this.getBounds()),e&&(this._cameraControl instanceof N&&this._cameraControl.updateToBounds(e,!1),this._cameraControl instanceof Z&&this._cameraControl.zoomToFitBounds(L(e,this._domHelper.element.clientWidth,this._domHelper.element.clientHeight,1.1),!0),this._renderEverything())}_zoomToBounds(e,t=!0){const n=this.getBounds();this._cameraControl instanceof N&&(this._getViewModel().getPlanObjectCount()<=1?this._cameraControl.zoomToFitBounds(n,t):this._cameraControl.checkBoundsAndPlaceCamera(n,t)),this._cameraControl instanceof Z&&!this._drawingEnabled&&this._cameraControl.zoomToFitBounds(n,e,t)}updateCameraOnDrawWalls(){const e=this.getBounds();this._cameraControl instanceof Z&&this._cameraControl.zoomToFitBounds(e,!1,!0),this._cameraControl instanceof N&&this._cameraControl.zoomToFitBounds(e,!0)}getBounds(){return this._getViewModel()?this._getViewModel().getBoundingBox():null}getPlanObject(e){const t=this._getKernelAccess().planInteractionHandler,n=this._plannerKernelAccess.planModelViewHelper,a=t.getPlan();return n.getPlanObject(a,e)}cancelPlanElementSelection(e){this._plannerSceneEventHandler.cancelSelection(e),this._highlightPlanElement(null),this._requestRender()}async deletePlanElementSelection(){const e=this._plannerSceneEventHandler.getSelectedIds();this.cancelPlanElementSelection("delete_object"),await this.deletePlanElementByIds(e)}async deletePlanElementByIds(e){for(const t of e){const e=this._getViewModel().getPlanObjectForId(t);if(e&&e.getObject()){const t=this.getPlanObject(e.getId());let n;t&&(n=await Ve([t],this._plannerKernelAccess,this._rapiAccess)),this._roomlePlannerUiCallback.onPlanElementChanged(E.REMOVED,n?n[0]:null),this._getKernelAccess().planInteractionHandler.removeElement(e.getKernelObject())}}}rotatePlanElementSelection(e){const t=new(this._getKernelAccess().kernelContainer.PlanObjectPtrList),n=new ce;let a={x:0,y:0,z:0};if(this._plannerSceneEventHandler.getSelectedIds().forEach(e=>{const i=this._getViewModel().getPlanObjectForId(e);i&&i.getObject()&&(a=i.getPlanElement().getCenter(),t.push_back(i.getPlanElement()),n.expandByObject(i.getContainer()))}),t.size()>1){const e=n.getCenter(new J);a=h(e)}this._getKernelAccess().planInteractionHandler.rotateObjectsBy(t,e,a)}planBoundsChanged(){this.updateEnvironment(this.getBounds()),this._requestRender()}planElementRemoved(e){this._onPlanChanged(),this._renderEverything()}_onPlanChanged(){this._roomlePlannerUiCallback.onPlanChanged()}prepareTopImage(e={}){return new Promise(t=>{this._getViewModel().materialQueue.finished(!0).then(async()=>{var n,a;let i=this._calculateBoundingBoxOfAllMeshes(.1);null===(n=this._lightSetting)||void 0===n||n.removeFromScene(),this._cameraControl instanceof N&&this._getViewModel().setCameraType(g.CAMERA_2D);let s=await this._imageRenderer.prepareTopImage(this._scene,null,i,e);this._cameraControl instanceof N&&this._getViewModel().setCameraType(g.CAMERA_3D),null===(a=this._lightSetting)||void 0===a||a.addToScene(),this._requestRender(),t(s)})})}preparePerspectiveImage(e={}){return"configurator"===this._configuratorContext.baseContext?super.preparePerspectiveImage(e):new Promise((t,n)=>{this._getViewModel().materialQueue.finished(!0).then(async()=>{var n,a;let i;this._cameraControl instanceof N?i=this._cameraControl.getCamera().clone():(i=this.getPerspectiveOffsetCamera(),this._getViewModel().setCameraType(g.CAMERA_3D)),i.resetOffset();let s=this._calculateBoundingBoxOfAllMeshes();null===(n=this._lightSetting)||void 0===n||n.removeFromScene();const r=await this._imageRenderer.preparePerspectiveImage(this._scene,null,i,s,e);this._cameraControl instanceof Z&&this._getViewModel().setCameraType(g.CAMERA_2D),null===(a=this._lightSetting)||void 0===a||a.addToScene(),this._requestRender(),t(r)},n)})}_calculateBoundingBoxOfAllMeshes(e=0){const t=this.getBounds();return A.getCameraTargetForBBox(t,e)}enableRotation(){this._plannerSceneEventHandler.setState(2)}disableRotation(){this._plannerSceneEventHandler.resetState()}enableSnapping(){this._plannerSceneEventHandler.enableSnapping()}disableSnapping(){this._plannerSceneEventHandler.disableSnapping()}dragIn(e){this._plannerSceneEventHandler.setDragIn(!0,e)}getPlannerSceneEventHandler(){return this._plannerSceneEventHandler}disablePlannerEvents(){this._plannerSceneEventHandler.disable()}enablePlannerEvents(){this._plannerSceneEventHandler.enable()}_onCameraIdle(){return super._onCameraIdle()&&(this._sendWallDimensions(),this._sendPlanObjectPositions(),this._roomlePlannerUiCallback.onCameraIdle()),!0}_onCameraMove(){return super._onCameraMove()&&(this._roomlePlannerUiCallback.disableWallDimensions(),this._roomlePlannerUiCallback.cameraStartsMoving()),this._updateNodeSize(),!0}_updateNodeSize(){if(this._cameraControl instanceof Z){const e=1/this._cameraControl.getCamera().zoom;this._getViewModel().setNodeZoom(e)}}_sendPlanObjectPositions(){if(this._cameraControl.isLocked())return;const{clientWidth:e,clientHeight:t}=this._domHelper.element,n=this._cameraControl.getCamera(),a=[],i={staticPlanObjectViewModels:this._getViewModel().getStaticPlanObjectViewModels(),configurablePlanObjectViewModels:this._getViewModel().getConfigurablePlanObjectViewModels(),constructionPlanObjectViewModels:this._getViewModel().getConstructionPlanObjectViewModels(),wallPlanObjectViewModels:this._getViewModel().getWallPlanObjectViewModels(),floorPlanObjectViewModels:this._getViewModel().getFloorPlanObjectViewModels(),nodePlanObjectViewModels:this._getViewModel().getNodePlanObjectViewModels()};for(const s of Object.values(i))for(const i of s)a.push(ke(i,n,e,t));this._roomlePlannerUiCallback.onUpdatePlanObjectPositions(a)}_sendWallDimensions(e=!0){if(this._cameraControl.isLocked()&&e)return;const t=[],{clientWidth:n,clientHeight:a}=this._domHelper.element,i=this._getViewModel().getWallPlanObjectViewModels(),s=this._cameraControl.getKernelZoomFactor();for(const e of i){const i=e.getWallDimension(s),{thickness:r,height:o}=e.getKernelObject();if(i.length>0&&r>0&&o>0){const e=this._cameraControl.getCamera();i.fromPosition2d=C(i.fromPosition3d,e,n,a),i.toPosition2d=C(i.toPosition3d,e,n,a),i.fromWithoutPadding=C(i.fromWithoutPadding,e,n,a),i.toWithoutPadding=C(i.toWithoutPadding,e,n,a),i.textPosition2d=C(i.textPosition3d,e,n,a),i.lengthFormatted=this._unitFormatter.formatMMValueToUnitString(i.length),t.push(k(i))}if(this._initData.debug){const e=new be(.1,32,16),t=new se({color:16711680}),n=new re(e,t);n.position.copy(i.fromPosition3d);const a=new re(e,t);a.position.copy(i.toPosition3d);const s=new re(e,new se({color:65280}));s.position.copy(i.textPosition3d),this._scene.add(n),this._scene.add(a),this._scene.add(s)}}this._roomlePlannerUiCallback.onUpdateWallDimensions(t)}enableWallDrawing(){if(this._cameraControl instanceof Z){const e=L(this.getBounds(),this._domHelper.element.clientWidth,this._domHelper.element.clientHeight);this._cameraControl.zoomToFitBounds(e,!0)}this._drawingEnabled||(this._drawingEnabled=!0,this._scene.add(this._plannerSceneEventHandler.enableWallDrawing()))}disableWallDrawing(){this._drawingEnabled=!1,this._cameraControl.unlock(),this._scene.remove(this._plannerSceneEventHandler.cancelWallDrawing())}escapeDrawing(){this._plannerSceneEventHandler.stopDrawing()}_changeCameraControl(e){super._changeCameraControl(e)}setSceneEvents(e){var t,n;void 0!==e.construction&&(null===(t=this._plannerSceneEventHandler)||void 0===t||t.enableConstructionEvents(e.construction)),void 0!==e.objects&&(null===(n=this._plannerSceneEventHandler)||void 0===n||n.enableObjectEvents(e.objects))}startedDrawing(){this._plannerSceneEventHandler.startDrawing()}stoppedDrawing(){this._plannerSceneEventHandler.stopDrawing()}disableEvents(){super.disableEvents(),this.disablePlannerEvents()}enableEvents(){super.enableEvents(),"planner"===this._configuratorContext.baseContext&&this.enablePlannerEvents()}resetCameraPositionToStart(e=!0){this._cameraControl instanceof N&&super.resetCameraPositionToStart(e),this._cameraControl instanceof Z&&this._updateCamera()}async moveCamera(e){return this._cameraControl instanceof N?super.moveCamera(e):Promise.reject("Camera can only be moved in 3D")}_setInteriorOrExteriorWallMaterial(e,t){const n=this._getViewModel().getWallPlanObjectViewModels();if(!n.length)return;const a=this._getKernelAccess().planInteractionHandler,i=e=>{a.setWallLeftMaterial(e,Me(e.leftMaterial,t))},s=e=>{a.setWallRightMaterial(e,Me(e.rightMaterial,t))},r=n.map(e=>e.getKernelObject()),o=this._plannerKernelAccess.kernelContainer.WallType.InnerWall,l=this._plannerKernelAccess.kernelContainer.WallType.OuterWallLeft,c=this._plannerKernelAccess.kernelContainer.WallType.OuterWallRight;for(const t of r)t.wallType===o&&"interior"===e&&(i(t),s(t)),t.wallType===l&&("interior"===e?s(t):i(t)),t.wallType===c&&("exterior"===e?s(t):i(t))}changeInteriorWallsMaterial(e){this._setInteriorOrExteriorWallMaterial("interior",e)}changeExteriorWallsMaterial(e){this._setInteriorOrExteriorWallMaterial("exterior",e)}changeFloorsMaterial(e){const t=this._getViewModel().getFloorPlanObjectViewModels();if(!t.length)return;const n=this._getKernelAccess().planInteractionHandler,a=t.map(e=>e.getKernelObject());for(const t of a)n.setFloorMaterial(t,Me(t.material,e))}getWallAngleDegrees(e){if(!(e instanceof r))return 0;const t=this._cameraControl.getCamera(),n=new ee(t.position.x,t.position.z),a=new ee(e.getPosition().x,e.getPosition().z).clone().sub(n).normalize(),i=e.getKernelObject(),s=new ee(Math.sin(i.getAngle()),Math.cos(i.getAngle())),o=a.angle()-s.angle();return Ee.radToDeg(o)}moveElementPosition(e,t){const n=this._getKernelAccess().planInteractionHandler;n.setObjectFixedZ(e.getPlanElement(),!0),n.moveElementTo(e.getPlanElement(),t),this._sendPlanObjectPositions()}}l([c],xe.prototype,"_rapiAccess",void 0),l([c],xe.prototype,"_plannerMeshGenerator",void 0),l([c],xe.prototype,"_plannerInputManager",void 0),l([c],xe.prototype,"_roomlePlannerUiCallback",void 0),l([c],xe.prototype,"_localStorageHelper",void 0),l([c],xe.prototype,"_unitFormatter",void 0);const Te={left:0,top:1,right:1,bottom:0};class Re{constructor(e){this._hscInstance=null,this._glbInstance=null,this._configurator=null,this._currentMode=1,this._creator_=e,this._kernelAccessCallback.addListener(this)}setEnvironmentMap(e){const{url:t,intensity:n,rotation:a,maxLightSources:i}=e;this._sceneManager.setEnvironmentMap(t,n,a,i)}deleteSelection(){this._sceneManager.deletePlanElementSelection()}rotateSelection(e){this._sceneManager.rotatePlanElementSelection(e)}cancelSelection(e="unknown"){this._sceneManager.cancelPlanElementSelection(e)}init(e,t,n){return V.start("loadingTime"),this._domHelper.setDomElement(e),this._sceneManager?(this._lifeCycleManager.resume(),Promise.resolve()):(this._preloadPlanId=t,this.setOverrides(n),new Promise(this._initPromiseCallback.bind(this)))}loadPlanXml(e,t){return this.setOverrides(t),new Promise(n=>{this._plan=this._planInteractionHandler.loadPlanXML(e),this._sceneManager.planXMLLoaded(this._plan),this._roomlePlannerUiCallback.onTotalFloorAreaChanged(this._planInteractionHandler.getPlan().getTotalFloorArea()),this._currentMode=1,this._initData.moc&&(t.id?this._rapiAccess.trackView(t.id):this._rapiAccess.trackView("planXML")),n()})}loadPlan(e,t){return this.setOverrides(t),new Promise((t,n)=>{const a=x(e);(a?this._rapiAccess.getPlanSnapshot(e):this._rapiAccess.getPlan(e)).then(n=>{const i=a?n.plan:n.planObjects;this._plan=this._planInteractionHandler.loadPlanXML(i),this._sceneManager.planXMLLoaded(this._plan),this._roomlePlannerUiCallback.onTotalFloorAreaChanged(this._planInteractionHandler.getPlan().getTotalFloorArea()),this._currentMode=1,this._initData.moc&&this._rapiAccess.trackView(e),t(n)},n)})}setOverrides(e){e&&(this._initData.setOverrides(e),this._globalInitData.setOverrides(e))}switch2D(){this._sceneManager.switchTo2D()}switch3D(){this._sceneManager.switchTo3D()}switchToFirstPerson(){this._sceneManager.switchToFirstPerson()}resetCameraPosition(){this._sceneManager.resetCameraPositionToStart()}exportGLB(){this._sceneManager.exportGLB()}importGLB(e){this._sceneManager.importGLB(e)}_initPromiseCallback(e,t){Promise.all([this._scriptLoader.fetch(X,{id:"tween-js"})]).then(()=>{this._kernelReadyCallback=e;const{dls:t,ls:n,mode:a,stats:i}=this._initData;this._sceneManager||(this._sceneManager=new xe(this._creator_,Te,this,a)),this._preloadPlanId&&this._sceneManager.preload(this._preloadPlanId);const s=T.createDynamicLightSettingSource(t,n);i&&this.showStats(),this._sceneManager.enableHD(s),this._planInteractionHandler&&this._kernelReadyCallback()})}isReady(){this._planInteractionHandler=this._plannerKernelAccess.planInteractionHandler,this._kernelReadyCallback&&this._kernelReadyCallback()}showBenchmarks(){V.showBenchmarks()}getConfiguratorApi(){return this._configurator||(this._configurator=new Ie(this._creator_),this._configurator.setOverrides(this._initData),this._configurator.initSceneManager(this._sceneManager)),this._configurator}startViewing(){this._sceneManager.startViewing()}startConfiguring(){var e,t;const n=this._sceneManager.currentSelection,a=(null===(e=n.item)||void 0===e?void 0:e.id)||(null===(t=n.configuration)||void 0===t?void 0:t.id);this._sceneManager.startConfiguring(),a&&this._configurator.notifyUiAboutNewLabel(a)}async selectPlanObjectById(e){return this._sceneManager.selectPlanObject(e)}backToPlanner(){this._sceneManager.backToPlanner()}showGUI(){this._sceneManager.showGUI()}async switchToConfigurator(){const e=await this._singlePromiseFactory.create(3,"startHSC",e=>{if(this._hscInstance)return e(this._hscInstance);t.import("./configurator-72334374.legacy.js").then(({Configurator:t})=>{const n=new t(this._creator_);n.boot({kernelInstance:this._planInteractionHandler.getConfiguratorKernel(),kernelContainer:this._plannerKernelAccess.kernelContainer}),n.getApi().setOverrides(this._initData),n.getApi().initSceneManager(this._sceneManager),n.getApi().init(this._domHelper.element).then(()=>{this._hscInstance=n,e(this._hscInstance)})})});return this._currentMode=0,this.cancelSelection(),e}async switchToViewer(){const e=await this._singlePromiseFactory.create(4,"startGLB",e=>{if(this._glbInstance)return e(this._glbInstance);t.import("./glb-viewer-21343679.legacy.js").then(t=>{const n=new t.GlbViewer(this._creator_);n.boot(),n.getApi().setOverrides(this._initData),n.getApi().init(this._domHelper.element).then(()=>{this._glbInstance=n,e(this._glbInstance)})})});return this._currentMode=2,this.cancelSelection(),e}switchToPlanner(e){e&&this.loadPlan(e),this._currentMode=1}updateSize(){this._sceneManager.updateCamera()}getMain(){}update(){this.updateSize(),this._glbInstance&&this._glbInstance.getApi().updateSize(),this._hscInstance&&this._hscInstance.getApi().updateSize()}get callbacks(){return this._roomlePlannerUiCallback}set callbacks(e){this._roomlePlannerUiCallback=e}showStats(){this._sceneManager.showStats()}onCloseHSC(){this._sceneManager.closeHSC(),this._hscInstance&&this._hscInstance.getApi().pauseKernelCallbacks()}back(){if(2===this._currentMode&&this._glbInstance&&this._glbInstance.getApi().clearScene(),0===this._currentMode&&this._hscInstance){const e=this._hscInstance.getApi();e.cancelSelection(),e.cancelDockings(),e.hideDimensions(),e.disableMultiselect(),this._sceneManager.updateScene()}this._currentMode=1}backTo(e){console.error("backTo in planner Needs to be implemented later")}getConfigurator(){return this._hscInstance}getCurrentSkin(){return this._rapiAccess.getCurrentSkin()}getRuntimeComponentIdOfRootComponent(e){return e?this._plannerKernelAccess.planInteractionHandler?this._plannerKernelAccess.planInteractionHandler.getConfiguratorKernel().getRootPlanComponentIdFromObjectId(e):(console.warn("Can not retrieve runtime id without planInteractionHandler"),0):(console.warn("Can not retrieve runtime id without planObjectId"),0)}resumeTest(e){this._domHelper.setDomElement(e),this._lifeCycleManager.resume()}pauseTest(){this._lifeCycleManager.pause()}syncCatalog(e){return this._dataSyncer.syncCatalog(e)}loadError(e){}getPlanInteractionHandler(){return Promise.resolve(this._planInteractionHandler)}getPlanModelViewHelper(){return Promise.resolve(this._plannerKernelAccess.planModelViewHelper)}async insertObject(e,t,n){if(!this._planInteractionHandler)throw new Error("no plan interaction handler");t&&(t=h(new J(t.x,t.y,t.z)));const a=await(j(e)?this._rapiAccess.getItem(e):this._rapiAccess.getConfiguration(e)),i=await this._plannerKernelAccess.addPlanObjectFromItem(a,t,n);return this._sceneManager.updateScene(),i}async insertItemList(e){const t=e.map(e=>j(e)?this._rapiAccess.getItem(e):this._rapiAccess.getConfiguration(e)),n=await Promise.all(t);return await this._plannerKernelAccess.insertItems(n)}async insertItems(e){return await this._plannerKernelAccess.insertItems(e)}duplicateItems(e){return this._plannerKernelAccess.duplicateItems(e)}getScene(){return this._sceneManager.getScene()}updateScene(){this._sceneManager.updateScene()}getCameraOffset(){return this._sceneManager.getCameraOffset()}setCameraOffset(e){this._sceneManager.setCameraOffset(e)}async getObjects(){const e=(await this.getPlanModelViewHelper()).getPlanOverview(this._plan),t=f(e.objects);return Ve(t,this._plannerKernelAccess,this._rapiAccess)}async getPlanOverview(){const e=(await this.getPlanModelViewHelper()).getPlanOverview(this._plan);return f(e)}prepareTopImage(e={}){return this._sceneManager.prepareTopImage(e)}preparePerspectiveImage(e={}){return this._sceneManager.preparePerspectiveImage(e)}enableRotation(){this._sceneManager.enableRotation()}disableRotation(){this._sceneManager.disableRotation()}enableMultiselect(){this._sceneManager.getPlannerSceneEventHandler().setSelectionMode("multiselect"),this._configuratorContext.selectionMode="multiselect"}async dragInObject(e,t){this._sceneManager.dragIn(t);const n=await this._rapiAccess.getItem(e),a=await this.insertItems([n]);if(1!==a.length)throw new Error("More than one object added, abort");return a[0]}enableSnapping(){this._sceneManager.enableSnapping()}disableSnapping(){this._sceneManager.disableSnapping()}async getPartlistOf(e){const t=this._plannerKernelAccess.kernelInstance.getHashOfConfiguration(e);if(!t){const e="Object has no partlist because it is not a configuration: "+t;return console.warn(e),Promise.reject(e)}const n=this._plannerKernelAccess.kernelInstance.getPartList(e);return await this._plannerKernelAccess.addUiDataAndPriceToPartList(n,t)}formatValueToUnitString(e,t){return this._unitFormatter.formatValueToUnitString(e,t)}drawWalls(e,t={}){var n,a;const i=this._planInteractionHandler;i.startInteraction();const s=[];for(const t of e){const e=i.addNode(t.from),r=i.addNode(t.to),o=i.addWall(e,r);void 0!==(null===(n=t.props)||void 0===n?void 0:n.height)&&i.setWallHeight(o,t.props.height),void 0!==(null===(a=t.props)||void 0===a?void 0:a.thickness)&&i.setWallThickness(o,t.props.thickness),s.push(o)}return t.keepInteractionOpen||i.endInteraction(),this._sceneManager.updateCameraOnDrawWalls(),this._sceneManager.updateScene(),s}async removeElements(e,t={}){this._sceneManager.lockCamera();const n=this._planInteractionHandler;for(const t of e){const e=this._sceneManager.getPlanObject(t.getId());let n;e&&(n=await Ve([e],this._plannerKernelAccess,this._rapiAccess)),this._roomlePlannerUiCallback.onPlanElementChanged(E.REMOVED,n?n[0]:null),this._planInteractionHandler.removeElement(t)}t.keepInteractionOpen||n.endInteraction(),this._sceneManager.unlockCamera()}hasWalls(){const e=this._planInteractionHandler,t=null==e?void 0:e.getPlan();return!(!t||t.getWallCount()<1)}enableWallDrawing(){this._sceneManager.enableWallDrawing()}disableWallDrawing(){this._sceneManager.disableWallDrawing()}getUnitFormatter(){return this._unitFormatter}get PlannerCoreTypes(){return this._plannerKernelAccess.kernelContainer}setSceneEvents(e){this._sceneManager.setSceneEvents(e)}async saveCurrentPlanSnapshot(e){const t=await this.getPlanModelViewHelper(),n=this._planInteractionHandler.getPlan(),a=t.getPlanOverview(n),i={parentId:e||null,planObjects:[],combinedIds:[],plan:n.getPlanXML(!1,2)},s=a.objects,r=s.size();for(let e=0;e<r;e++){const t=s.get(e),n=t.configurationHash||t.catalogItemId,{center:a,dimensions:r,rotation:o}=t,l=JSON.stringify({center:a,dimensions:r,rotation:o});i.planObjects.push({combinedId:n,location:l})}const o=await this._rapiAccess.savePlanSnapshot(i),l=new Promise((e,t)=>{Promise.allSettled([this.preparePerspectiveImage(),this.prepareTopImage()]).then(async([n,a])=>{if("rejected"!==n.status&&"rejected"!==a.status)try{const t=await this._rapiAccess.savePlanSnapshotPerspectiveImage(o,n.value),i=await this._rapiAccess.savePlanSnapshotTopImage(o,a.value);e({...t,...i})}catch(e){t(e)}else t("Could not generate images of plan snapshot")})});try{return await l}catch(e){return console.error(e),o}}getPlanXmlFrom(e){return e?x(e.id)?e.plan:e.planObjects:null}async moveCamera(e){return this._sceneManager.moveCamera(e)}async createNewSerializedConfiguration(e){return Promise.resolve(this._plannerKernelAccess.createNewSerializedConfiguration(e))}changeInteriorWallsMaterial(e){this._sceneManager.changeInteriorWallsMaterial(e)}changeExteriorWallsMaterial(e){this._sceneManager.changeExteriorWallsMaterial(e)}changeFloorsMaterial(e){this._sceneManager.changeFloorsMaterial(e)}getWallAngleDegrees(e){return this._sceneManager.getWallAngleDegrees(e)}calcPartsPriceSum(e){return this._plannerKernelAccess.calcPartsPriceSum(e)}async swapObject(e,t){const n=e.getPosition(),a=e.getRotation();return await this._sceneManager.deletePlanElementByIds([e.getPlanElement().getId()]),this.cancelSelection("swap_object"),await this.insertObject(t,n,a)}exportImageFromCamera(e="image"){this._sceneManager.exportImageFromCamera(e)}moveElementPosition(e,t){this._sceneManager.moveElementPosition(e,t)}async generateProductionServiceExport(e,t=""){try{return Promise.resolve(JSON.parse(this._plannerKernelAccess.kernelInstance.generateProductionServiceExport(e,t)))}catch(e){return console.error(e),Promise.reject("Could not create Blue Ocean MVP JSON")}}}l([c],Re.prototype,"_configuratorContext",void 0),l([c],Re.prototype,"_domHelper",void 0),l([c],Re.prototype,"_scriptLoader",void 0),l([c],Re.prototype,"_kernelAccessCallback",void 0),l([c],Re.prototype,"_plannerKernelAccess",void 0),l([c],Re.prototype,"_rapiAccess",void 0),l([c],Re.prototype,"_singlePromiseFactory",void 0),l([c],Re.prototype,"_roomlePlannerUiCallback",void 0),l([c],Re.prototype,"_lifeCycleManager",void 0),l([c],Re.prototype,"_dataSyncer",void 0),l([c],Re.prototype,"_initData",void 0),l([c],Re.prototype,"_globalInitData",void 0),l([c],Re.prototype,"_unitFormatter",void 0);const Be=[new B("script-loader",n),new B("planner-input-manager",class extends R{_canDrag(e){return!0}},1),new B("logger",W),new B("planner-mesh-generator",F),new B("rapi-access",K),new B("planner-selection-handler",class extends s{constructor(){super(...arguments),this._selectionMode="standard",this._selectedPlanElementViewModels=new Map}check(e){"standard"===this._selectionMode&&this._checkStandard(e),"multiselect"===this._selectionMode&&this._checkMulti(e)}removeSelection(){this._selectedPlanElementViewModels.clear()}cancelSelection(e){0!==this._selectedPlanElementViewModels.size&&this._selectedPlanElementViewModels.forEach((t,n)=>{this._selectedPlanElementViewModels.delete(n),t.deselect(),this.dispatchEvent(1,new He({planElementViewModel:t,reason:e}))})}_checkStandard(e){this._selectedPlanElementViewModels.has(e.getId())||(this._selectedPlanElementViewModels.size>0&&this._selectedPlanElementViewModels.forEach((e,t)=>{this._selectedPlanElementViewModels.delete(t),e.deselect(),this.dispatchEvent(1,new He({planElementViewModel:e}))}),this._selectedPlanElementViewModels.set(e.getId(),e),e.select(),this.dispatchEvent(0,new He({planElementViewModel:e})))}_checkMulti(e){if(!Oe(e)&&!this._selectedPlanElementViewModels.has(e.getId())){this._selectedPlanElementViewModels.set(e.getId(),e),e.select();const t=Array.from(this._selectedPlanElementViewModels).map(([e,t])=>t);this.dispatchEvent(2,new He({planElementViewModels:t})),this.dispatchEvent(0,new He({planElementViewModel:e}))}}_deselectWallAndFloorElements(){this._selectedPlanElementViewModels.forEach((e,t)=>{Oe(e)&&(this._selectedPlanElementViewModels.delete(t),e.deselect(),this.dispatchEvent(1,new He({planElementViewModel:e})))})}setSelectionMode(e){"multiselect"===e&&this._deselectWallAndFloorElements(),this._selectionMode=e,this.dispatchEvent(15,new He({selectionMode:e}))}getSelectionMode(){return this._selectionMode}hasSelection(){return this._selectedPlanElementViewModels.size>0}hasMultiSelection(){return this._selectedPlanElementViewModels.size>1}getSelectedIds(){let e=[];return this._selectedPlanElementViewModels.forEach(t=>e.push(t.getId())),e}isSelected(e){return!!this._selectedPlanElementViewModels.get(e)}})];e("Planner",class extends a{setupGlobals(){}setupDependencies(){z.setup(Be),this.lookup("logger",this._context),this.lookup("planner-kernel-access",this._context).init(0)}cleanUpGlobals(){throw new Error("Method not implemented.")}cleanUpDependencies(){throw new Error("Method not implemented.")}bootFinished(){this._planner=new Re(this._context),this._planner.getMain=()=>this,window.RoomlePlanner||(window.RoomlePlanner=this._planner)}getApi(){return this._planner}getContextName(){return"planner"}})}}}));
|
|
2
|
-
//# sourceMappingURL=planner-118a3c2a.legacy.js.map
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
System.register(["./roomle-dependency-injection-39c6c926.legacy.js","./scene-manager-4c49ffd2.legacy.js","./main-thread-to-worker-334452db.legacy.js","./default-light-setting-5155e3b7.legacy.js"],(function(e,t){var n,i,o,s,r,a,l,c,h,d,_,g,p,u,m,C,f,v,b,w,y,P,I,M,D,S,O,E,H,A,k,x,R,L,j,T,V,B,K,G,U,F,q,z,W,N,Q,J,Z,Y,X,$,ee,te,ne,ie,oe,se,re,ae,le,ce,he,de,_e;return{setters:[function(e){n=e._,i=e.i,o=e.C,s=e.c,r=e.d,a=e.e,l=e.S,c=e.W,h=e.F,d=e.f,_=e.N,g=e.k,p=e.P,u=e.E,m=e.v,C=e.g,f=e.h,v=e.t,b=e.j,w=e.l,y=e.m,P=e.b,I=e.n,M=e.o,D=e.p,S=e.q,O=e.r,E=e.s,H=e.u,A=e.w,k=e.B,x=e.x,R=e.y,L=e.z,j=e.G,T=e.H,V=e.A,B=e.J,K=e.K,G=e.M,U=e.O},function(e){F=e.S,q=e.B,z=e.D,W=e.C,N=e.F,Q=e.T},function(e){J=e.U,Z=e.ah,Y=e.a,X=e.bH,$=e.bI,ee=e.V,te=e.Q,ne=e.G,ie=e.bF,oe=e.au,se=e.bJ,re=e.bK,ae=e.bL,le=e.b9,ce=e.an,he=e.bM,de=e.at},function(e){_e=e.D}],execute:function(){class ge extends o{constructor(e){super(e),this._configurablePlanObjectViewModels=[],this._staticPlanObjectViewModels=[],this._constructionPlanObjectViewModels=[],this._wallPlanObjectViewModels=[],this._floorPlanObjectViewModels=[],this._nodePlanObjectViewModels=[],this._constructionGroup=new J,this._constructionGroup.name="Construction",this._ceilingGroup=new J,this._ceilingGroup.name="Ceiling",this._floorGroup=new J,this._floorGroup.name="Floor",this._getKernelAccess().addPlannerListener(this)}startedDrawing(){}stoppedDrawing(){}planBoundsChanged(){}setReference(e){this._coreReference=e.clone()}clearReference(){this._coreReference.delete(),this._coreReference=null}getCorePlan(){return this._coreReference}addPlanElementViewModel(e){if(e instanceof s)this._configurablePlanObjectViewModels.push(e);else if(e instanceof r)this._constructionPlanObjectViewModels.push(e),this._initData.edit&&this._plannerSceneEventHandler.addPlanObjectHandlers(e),e.setTopView(this._cameraType===a.CAMERA_2D);else if(e instanceof l)this._staticPlanObjectViewModels.push(e),this._initData.edit&&this._plannerSceneEventHandler.addPlanObjectHandlers(e);else if(e instanceof c)this._initData.edit&&this._plannerSceneEventHandler.addWallHandlers(e),e.setTopView(this._cameraType===a.CAMERA_2D),this._wallPlanObjectViewModels.push(e),this._constructionGroup.add(e.getContainer());else if(e instanceof h){const t=e.getContainer();t.name="Floor",this._initData.edit&&this._plannerSceneEventHandler.addFloorHandlers(e),this._floorPlanObjectViewModels.push(e),this._floorGroup.add(t)}else e instanceof d?this._ceilingGroup.add(e.getContainer()):e instanceof _&&(this._initData.edit&&this._plannerSceneEventHandler.addNodeHandlers(e),e.setTopView(this._cameraType===a.CAMERA_2D),e.getObject().scale.setScalar(this._nodeZoom),this._nodePlanObjectViewModels.push(e),this._constructionGroup.add(e.getContainer()))}_addRootComponent(e){const t=this._getPlanObjectViewModelForRuntimeId(e.parentObjectId);t&&t instanceof s&&(t.addRootComponent(e),this._initData.edit&&this._plannerSceneEventHandler.addPlanObjectHandlers(t),t.hidePreviewBox())}_getPlanObjectViewModelForRuntimeId(e){let t=null;return this._configurablePlanObjectViewModels.forEach(n=>{e===n.getConfigurationRuntimeId()&&(t=n)}),t}getConfigurablePlanObjectForId(e){for(const t of this._configurablePlanObjectViewModels)if(e===t.getId())return t;return null}getStaticPlanObjectForId(e){for(const t of this._staticPlanObjectViewModels)if(e===t.getId())return t;return null}getConstructionObjectForId(e){for(const t of this._constructionPlanObjectViewModels)if(e===t.getId())return t;return null}getStaticPlanObjectViewModelForId(e){return this.getStaticPlanObjectForId(e)||this.getConstructionObjectForId(e)}getPlanObjectForId(e){const t=this.getConfigurablePlanObjectForId(e);if(t)return t;const n=this.getStaticPlanObjectForId(e);if(n)return n;for(const t of this._nodePlanObjectViewModels)if(e===t.getId())return t;for(const t of this._wallPlanObjectViewModels)if(e===t.getId())return t;for(const t of this._floorPlanObjectViewModels)if(e===t.getId())return t;for(const t of this._constructionPlanObjectViewModels)if(e===t.getId())return t;return null}getPlanObjectViewModelsFromRapiId(){return[...this._configurablePlanObjectViewModels,...this._staticPlanObjectViewModels]}getPlanObjectCount(){return this._configurablePlanObjectViewModels.length+this._staticPlanObjectViewModels.length}getConstructionGroup(){return this._constructionGroup}getCeilingGroup(){return this._ceilingGroup}getFloorGroup(){return this._floorGroup}getBoundingBox(){if("configurator"===this._configuratorContext.baseContext){const e=this.getPlanObjectForId(this._configuratorContext.planElementId);if(e)return e.getBounds()}if("glb-viewer"===this._configuratorContext.baseContext){const e=this._plannerSceneEventHandler.getSelectedIds();if(e&&1===e.length){const t=this.getPlanObjectForId(e[0]);if(t)return t.getBounds()}}const e=this.getCorePlan();if(e)try{return g(e.getBounds())}catch(e){console.error(e)}const t=new Z;t.expandByObject(this._constructionGroup);for(const e of this._staticPlanObjectViewModels)t.expandByObject(e.getContainer());for(const e of this._configurablePlanObjectViewModels)t.expandByObject(e.getContainer());return t}setPlannerSceneEventHandler(e){this._plannerSceneEventHandler=e}getStaticPlanObjectViewModels(){return this._staticPlanObjectViewModels}getConfigurablePlanObjectViewModels(){return this._configurablePlanObjectViewModels}getConstructionPlanObjectViewModels(){return this._constructionPlanObjectViewModels}getWallPlanObjectViewModels(){return this._wallPlanObjectViewModels}getNodePlanObjectViewModels(){return this._nodePlanObjectViewModels}getFloorPlanObjectViewModels(){return this._floorPlanObjectViewModels}_generateMesh(e=0,t=null,n,i,o,s,r,a,l,c){return this._plannerMeshGenerator.generateMesh(e,t,n,i,o,s,r,a,l,c)}_setMaterial(e,t,n,i){this._plannerMeshGenerator.setMaterial(e,t,n,i)}Editor3dComponentCreated(e,t,n,i,o){super.Editor3dComponentCreated(e,t,n,i,o),this._getKernelAccess()instanceof p&&this.dockComponent(e,i,t,n)}addPlanObjectToScene(e){}handlerSwitchedPlans(e,t){this._constructionGroup.clear(),this._ceilingGroup.clear(),this._floorGroup.clear()}planCompletelyLoaded(e){}beginPlanConstruction(e){}addPlanMesh(e,t,n,i,o,s,r){}endPlanConstruction(e){}planElementChanged(e,t){}planObjectConfigurationLoaded(e,t,n){const i=this.getConfigurablePlanObjectForId(t.getId());i?n?i.finishConstruction():i.failConstruction():console.warn("planObjectConfigurationLoaded but no view model found")}addMesh(e,t,n,i,o,s){const r=e.extRef.jsObject;let a=r.getMesh(t);a?a.geometry=this._plannerMeshGenerator.generateGeometry(null,n,i,o,s):(a=this._generateMesh(0,null,t,n,i,o,s,e.getType()),r.addMesh(a))}removePlanObjectFromScene(e){const t=e.getPlanElement().getType();this._isConstructionType(t)?this._constructionGroup.remove(e.getContainer()):t===this._getKernelAccess().kernelContainer.PlanElementType.FLOOR?this._floorGroup.remove(e.getContainer()):t===this._getKernelAccess().kernelContainer.PlanElementType.CEILING&&this._ceilingGroup.remove(e.getContainer()),e.clear()}_isConstructionType(e){return e===this._getKernelAccess().kernelContainer.PlanElementType.WALL||e===this._getKernelAccess().kernelContainer.PlanElementType.NODE}planElementRemoved(e){var t;const n=null===(t=e.extRef)||void 0===t?void 0:t.jsObject;n instanceof s?this._removeObject(this._configurablePlanObjectViewModels,n):n instanceof r?this._removeObject(this._constructionPlanObjectViewModels,n):n instanceof l?this._removeObject(this._staticPlanObjectViewModels,n):n instanceof h?this._removeObject(this._floorPlanObjectViewModels,n):n instanceof c?this._removeObject(this._wallPlanObjectViewModels,n):n instanceof _&&this._removeObject(this._nodePlanObjectViewModels,n)}_removeObject(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}getMeshGenerator(){return this._plannerMeshGenerator}componentConfigurationUpdated(e,t){super.componentConfigurationUpdated(e,t)}hideAllExcept(e){this._ceilingGroup.visible=!1,this._floorGroup.visible=!1,this._constructionGroup.visible=!1,this._staticPlanObjectViewModels.forEach(t=>{t.getId()!==e&&(t.getContainer().visible=!1)}),this._configurablePlanObjectViewModels.forEach(t=>{t.getId()!==e&&(t.getContainer().visible=!1)}),this._constructionPlanObjectViewModels.forEach(t=>{t.getId()!==e&&(t.getContainer().visible=!1)})}showAll(){this._ceilingGroup.visible=this._cameraType===a.CAMERA_FP,this._floorGroup.visible=!0,this._constructionGroup.visible=!0,this._staticPlanObjectViewModels.forEach(e=>e.getContainer().visible=!0),this._configurablePlanObjectViewModels.forEach(e=>e.getContainer().visible=!0)}planHistoryStateChanged(){}setCameraType(e){this._cameraType=e,this._wallPlanObjectViewModels.forEach(e=>e.setTopView(this._cameraType===a.CAMERA_2D)),this._nodePlanObjectViewModels.forEach(e=>e.setTopView(this._cameraType===a.CAMERA_2D)),this._constructionPlanObjectViewModels.forEach(e=>e.setTopView(this._cameraType===a.CAMERA_2D))}get cameraType(){return this._cameraType}setNodeZoom(e){e=Math.min(4,e),this._nodeZoom=e;for(const t of this._nodePlanObjectViewModels)t.getObject().scale.setScalar(e)}planCleared(){this._configurablePlanObjectViewModels.forEach(e=>e.remove()),this._staticPlanObjectViewModels.forEach(e=>e.remove()),this._wallPlanObjectViewModels.forEach(e=>e.remove()),this._nodePlanObjectViewModels.forEach(e=>e.remove()),this._floorPlanObjectViewModels.forEach(e=>e.remove()),this._constructionPlanObjectViewModels.forEach(e=>e.remove())}}e("P",ge),n([i],ge.prototype,"_plannerMeshGenerator",void 0),n([i],ge.prototype,"_roomlePlannerUiCallback",void 0);const pe=v(30);class ue extends u{constructor(e,t,n,i){super(),this._offset=new Y(0,0,0),this._lastMoveCheck=0,this._mode=void 0===i?1:i,this._scene=e,this._camera=t,this._raycaster=new X,this._raycaster.layers.disableAll(),this._inputManager=n,this._addInputListeners(n),this._planeBottom=new $(new Y(0,1,0)),this._planeFront=new $(new Y(0,0,1)),this._planeSide=new $(new Y(1,0,0))}setLayers(e){this._raycaster.layers=e}getLayers(){return this._raycaster.layers}_addInputListeners(e){e.addEventListener(3,e=>{this._findCandidate(e.positionRelative)},this),e.addEventListener(5,e=>{this._findSelection(e.positionRelative)},this),e.addEventListener(12,e=>{this._findSelection(e.positionRelative,!0,e.type)},this),e.addEventListener(14,e=>{this._findSelection(e.positionRelative,!0,e.type)},this),e.addEventListener(6,e=>{Date.now()-this._lastMoveCheck>32&&(this._findHover(e.positionRelative,e.type),this._lastMoveCheck=Date.now())},this),e.addEventListener(0,e=>{this._onDragStart(e.positionRelative)},this),e.addEventListener(1,e=>{this._onDrag(e.positionRelative)},this),e.addEventListener(2,e=>{this._onDragEnd(e.positionRelative)},this),e.addEventListener(9,e=>{this._onRotate(e.positionRelative,e.rotation)},this),e.addEventListener(10,()=>{this._currentRotate=null},this)}_findCandidate(e){let t=this._intersection(e);t&&!t.object.userData.ignoreElementHit&&0===this._mode&&this._inputManager.onElementHit()}_findSelection(e,t=!1,n=0){let i=this._intersection(e);if(i){if(i){const e=t?"double_click":"select";i.object.dispatchEvent({type:e,attachment:{intersection:i,type:n}})}}else this.dispatchEvent(0)}_findHover(e,t){const n=this._intersection(e);!n&&this._currentHover?(this._currentHover.dispatchEvent({type:"hover_off",attachment:{type:t}}),this._currentHover=null):n&&(this._currentHover&&this._currentHover.id!==n.object.id&&(this._currentHover.dispatchEvent({type:"hover_off",attachment:{type:t}}),this._currentHover=null),this._currentHover?this._currentHover.dispatchEvent({type:"hover_move",attachment:{intersection:n,type:t}}):(this._currentHover=n.object,this._currentHover.dispatchEvent({type:"hover_on",attachment:{intersection:n,type:t}})))}_intersection(e){const t=this._intersect(e);if(t.length<=0)return null;let n=t[0];return t.length>1&&this._currentHover&&this._currentDrag&&this._currentDrag.id!==this._currentHover.id&&t.forEach(e=>{e.object.id===this._currentHover.id&&e.object.userData.priority===this._currentHover.userData.priority&&n.object.userData.priority<=e.object.userData.priority&&(n=e)}),n}_intersect(e){this._raycaster.setFromCamera(new ee(e.x,e.y),this._camera);const t=[];return this._raycaster.intersectObjects(this._scene.children,!0).forEach(e=>{const n=this._findObjectWithHandler(e.object);n&&(e.object=n,t.push(e))}),t.length>=0?t.sort((e,t)=>e.object.userData.priority!==t.object.userData.priority?t.object.userData.priority-e.object.userData.priority:e.distance-t.distance):[]}_findObjectWithHandler(e){return e.userData.hasListener?e:e.parent?this._findObjectWithHandler(e.parent):null}_onDragStart(e){let t=this._intersection(e);if(!t&&!this._currentDrag)return;if(t&&t.object.userData.roomleId===this._rootComponentId)return;!this._currentDrag&&t&&(this._currentDrag=t.object,this._currentDrag.dispatchEvent({type:"drag_start"}));let n=this._currentDrag.parent;n&&n.computeBoundingBox&&(n.computeBoundingBox(),this._calculateOffset(n)),this._positionPlanes(n)}_onDrag(e){if(!this._currentDrag)return;this._raycaster.setFromCamera(new ee(e.x,e.y),this._camera);let t,n=new Y(0,0,-5);if(this._raycaster.ray.intersectPlane(this._planeBottom,n),0===this._mode){const e=this._scene.children.find(({type:e,name:t})=>"Group"===e&&"Construction"===t);if(e){const t=this._raycaster.intersectObjects(e.children,!0);if(t.length){const e=t[0].point.clone();return void this._currentDrag.dispatchEvent({type:"drag",attachment:{position:e}})}}t=n.clone(),t.y=this._currentDrag.parent.position.y}else t=this._getIntersectionPosition(n),t.sub(this._offset);this._currentDrag.dispatchEvent({type:"drag",attachment:{position:t}})}_getIntersectionPosition(e){let t=this._getDistanceToCamera(e),n=this._camera.userData.yaw,i=new Y(0,0,0),o=new Y(0,0,0);this._raycaster.ray.intersectPlane(this._planeFront,i),this._raycaster.ray.intersectPlane(this._planeSide,o);let s,r=this._getDistanceToCamera(o),a=this._getDistanceToCamera(i);return n>=-pe&&n<=pe?s=t<a?e.clone():i.clone():t<a&&t<r?s=e.clone():a<t&&a<r?s=i.clone():r<t&&r<a&&(s=o.clone()),s}_getDistanceToCamera(e){let t=e.clone().sub(this._camera.position).length();return m(e)&&(t=Number.POSITIVE_INFINITY),t}_onDragEnd(e){this._currentDrag&&(this._currentDrag.dispatchEvent({type:"drag_end",attachment:{position:e}}),this._currentDrag=null)}_onRotate(e,t){if(!this._currentRotate){let t=this._intersection(e);if(!t)return;this._currentRotate=t.object}this._currentRotate.dispatchEvent({type:"rotate",attachment:{rotation:t}})}_positionPlanes(e){0===this._mode?(this._planeBottom.constant=0,this._camera.userData&&this._camera.userData.pitch&&this._camera.userData.pitch<0&&(this._planeBottom.constant=-3)):e&&e.boundingBox&&this._rootComponentPosition&&(this._planeBottom.constant=-e.boundingBox.getCenter(new Y).y-this._rootComponentPosition.y,this._planeSide.constant=2*-e.boundingBox.getSize(new Y).x+e.boundingBox.getCenter(new Y).x,this._camera.userData.yaw>0&&(this._planeSide.constant*=-1),this._bounds&&(this._planeFront.constant=this._bounds.z/2+e.boundingBox.getCenter(new Y).z))}_calculateOffset(e){e&&e.boundingBox&&(this._offset.copy(e.boundingBox.getCenter(new Y)),this._offset.applyQuaternion(e.getWorldQuaternion(new te)))}update(e,t,n){if(e&&(this._bounds=e),t&&(this._rootComponentPosition=t),n){this._backgroundScene=n;let e=this._backgroundScene.children[0];e instanceof ne&&e.geometry.computeBoundingBox()}}clear(){this._currentDrag&&C(this._currentDrag),this._currentHover&&C(this._currentHover)}enableDragIn(e){this._currentDrag=e}setRootComponentId(e){this._rootComponentId=e}setCamera(e){this._camera=e}setScene(e){this._scene=e}setMode(e){this._mode=e}intersectMouseOnScene(e){const t=new $,n=new Y;return n.copy(this._camera.position).normalize(),t.setFromNormalAndCoplanarPoint(n,this._scene.position),this._raycaster.setFromCamera(new ee(e.positionRelative.x,e.positionRelative.y),this._camera),f(this._raycaster.ray.intersectPlane(t,new Y))}}class me extends u{constructor(e,t,n,i){super(),this._debug=!1,this._dragIn=!1,this._inputManager=i,this._raycastHelper=new ue(t,n,this._inputManager),this._creator_=e}isDragIn(){return this._dragIn}setDragIn(e,t){this._dragIn=e,e?this._inputManager.enableDragIn(t):this._raycastHelper.clear(),this._interaction()}}e("S",me);class Ce{constructor(e){const{component:t,preview:n,resetCamera:i,consecutive:o,type:s,forceRender:r}=e;this.component=t,this.preview=n,this.resetCamera=void 0===i||i,this.consecutive=void 0===o||o,this.type=s||0,this.forceRender=void 0!==r&&r}}class fe extends me{constructor(e,t,n,i){super(e,t,n,i),this._cameraMoving=!1,this._raycastHelper.addEventListener(0,()=>{this._clickOutside()},this),this._selectionHandler.addEventListener(0,({component:e,consecutive:t})=>{this.dispatchEvent(8,new Ce({component:e,consecutive:t})),this._inputManager.setDragEnabled(!0)},this),this._selectionHandler.addEventListener(1,({component:e,resetCamera:t})=>{this._selectionHandler.hasSelection()||this._inputManager.setDragEnabled(!1),this.dispatchEvent(9,new Ce({component:e,resetCamera:t}))},this),this._addInputListeners(this._inputManager)}disable(){const e=new ie;e.disableAll(),this._raycastHelper.setLayers(e),this._raycastHelper.disableEvents()}enable(){const e=new ie;e.disableAll(),e.enable(4),e.enable(5),e.enable(7),e.enable(8),this._raycastHelper.setLayers(e),this._raycastHelper.enableEvents()}_addInputListeners(e){e.addEventListener(7,e=>this._interaction(),this),e.addEventListener(8,e=>this._interaction(),this)}addComponentHandlers(e){this._addComponentHandlers(e,e.boundingBoxMesh,{hasListener:!0,priority:1,roomleId:e.runtimeId}),e.meshes.forEach(t=>{this._addComponentHandlers(e,t,{hasListener:!0,priority:2,roomleId:e.runtimeId})})}addComponentDragInHandler(e){this._dragIn&&(this._addComponentHandlers(e,e.boundingBoxMesh,{hasListener:!0,priority:1,roomleId:e.runtimeId}),this._raycastHelper.enableDragIn(e.boundingBoxMesh))}_addComponentHandlers(e,t,n){t.userData.hasListener||(Object.assign(t.userData,n),t.addEventListener("select",()=>this.clickComponent(e)),t.addEventListener("hover_on",t=>this._hoverOn(e,t.attachment.type)),t.addEventListener("hover_off",t=>this._hoverOff(e,t.attachment.type)),t.addEventListener("drag_start",()=>this._dragStart(e)),t.addEventListener("drag",t=>this._drag(e,t.attachment.position)),t.addEventListener("drag_end",t=>this._dragEnd(e,t.attachment.position)))}addPreviewHandlers(e){let t=e.boundingBoxMesh;t.userData.hasListener||(t.userData=oe(t.userData,{hasListener:!0,priority:3,roomleId:e.runtimeId}),t.addEventListener("select",()=>this._clickPreview(e)),t.addEventListener("hover_on",()=>this._hoverOnPreview(e)),t.addEventListener("hover_off",()=>this._hoverOffPreview(e)))}addPreviewLineHandlers(e){let t=e.boundingLineMesh;t.userData.hasListener||(t.userData=oe(t.userData,{hasListener:!0,priority:4,roomleId:e.runtimeId}),t.addEventListener("select",()=>this._clickPreviewLine(e)),t.addEventListener("hover_on",t=>this._hoverOnPreviewLine(e,t.attachment.intersection)),t.addEventListener("hover_move",t=>this._hoverMovePreviewLine(e,t.attachment.intersection)),t.addEventListener("hover_off",()=>this._hoverOffPreviewLine(e)))}_clickPreview(e){this._dragStartPosition&&(e.position.copy(this._dragStartPosition),this._dragStartPosition=null),this.dispatchEvent(7,new Ce({preview:e}))}_clickPreviewLine(e){this._dragStartPosition&&(e.position.copy(this._dragStartPosition),this._dragStartPosition=null),this.dispatchEvent(7,new Ce({preview:e}))}clickComponent(e){this._debug&&e.runtimeId,this._selectionHandler.check(e),this._configuratorUiCallbacks.onClickComponent(e)}_clickOutside(){this._selectionHandler.cancelSelection(),this.dispatchEvent(3),this._interaction()}_hoverOn(e,t){this._cameraMoving||(this._debug&&e.runtimeId,e.hoverOn(),this._interaction(),this.dispatchEvent(1,new Ce({component:e,type:t})),this._hoveredComponent=e)}_hoverOff(e,t){this._cameraMoving||(this._debug&&e.runtimeId,e.hoverOff(),this._interaction(),this.dispatchEvent(2,new Ce({component:e,type:t})),this._hoveredComponent=null)}_hoverOnPreview(e){e.hoverOn(),this._interaction(!0),this._hoveredPreview=e}_hoverOffPreview(e){e.hoverOff(),this._interaction(!0),this._hoveredPreview=null}_hoverOnPreviewLine(e,t){this._updatePositionForPreviewLine(e,t),this._draggedComponent||e.hoverOn(),this._interaction(),this._hoveredPreview=e}_hoverMovePreviewLine(e,t){this._updatePositionForPreviewLine(e,t),this._hoveredPreview=e,this._interaction(!0)}_updatePositionForPreviewLine(e,t){let n=t.object.parent.parent.worldToLocal(t.point);this._previewLineIntersection=n,e&&(this._draggedComponent?this._draggedComponent.visible=!0:e.updatePreviewPosition(n))}_hoverOffPreviewLine(e){this._draggedComponent||e.hoverOff(),this._interaction(),this._hoveredPreview=null,this._previewLineIntersection=null}_setDragComponentShadow(e){var t;null===(t=this._draggedComponent)||void 0===t||t.traverse(t=>{if(t instanceof ne){const n=t;e&&void 0!==n.castShadowOld?(n.receiveShadow=n.receiveShadowOld,n.castShadow=n.castShadowOld):(n.receiveShadowOld=t.receiveShadow,n.castShadowOld=t.castShadow,n.receiveShadow=!1,n.castShadow=!1)}})}_dragStart(e){e&&(this._selectionHandler.isSelected(e)||this.isDragIn())&&(this._dragStartPosition=e.position.clone(),this._dragStartRotation=e.rotation.clone(),this._draggedComponent=e,this._setDragComponentShadow(!1),this.dispatchEvent(4,new Ce({component:e})),this._interaction())}_drag(e,t){if(e&&(this._selectionHandler.isSelected(e)||this.isDragIn())){if(e&&!this._draggedComponent&&(this._draggedComponent=e),this._previewLineIntersection){let e=this._hoveredPreview,t=e.getPositionForIntersectionPoint(this._previewLineIntersection),n=e.parent.localToWorld(t);this._draggedComponent.position.copy(this._draggedComponent.parent.worldToLocal(n)),this._draggedComponent.rotation.copy(e.docklineRotation),e.hideSelectionLine()}else e.parent?e.position.copy(e.parent.worldToLocal(t)):e.position.copy(t);this._hoveredPreview?e.visible=!1:e.visible=!0,this.dispatchEvent(5,new Ce({component:e})),this._interaction()}}_dragEnd(e,t){if(e&&(this._selectionHandler.isSelected(e)||this.isDragIn())){if(this._hoveredPreview)if(this._previewLineIntersection){let t=this._hoveredPreview,n=t.getPositionForIntersectionPoint(this._previewLineIntersection),i=t.parent.localToWorld(n);e.position.copy(e.parent.worldToLocal(i)),e.rotation.copy(t.docklineRotation)}else e.position.copy(t);else this._dragStartPosition&&this._dragStartRotation&&(e.position.copy(this._dragStartPosition),e.rotation.copy(this._dragStartRotation),this._dragStartPosition=null,this._dragStartRotation=null,this.addComponentHandlers(e));e.visible=!0,this._setDragComponentShadow(!0),this._draggedComponent=null,this._previewLineIntersection=null,this.dispatchEvent(6,new Ce({component:e,preview:this._hoveredPreview})),this._interaction()}}_interaction(e){this.dispatchEvent(0,new Ce({forceRender:e}))}hasSelection(){return this._selectionHandler.hasSelection()}update(e,t,n){this._raycastHelper.update(e,t,n)}isDragIn(){return this._dragIn}isDragging(){return null!=this._draggedComponent}setRootComponentId(e){this._raycastHelper.setRootComponentId(e)}cancelSelection(){this._selectionHandler.setSelectionMode("standard"),this._selectionHandler.cancelSelection()}setSelectionMode(e){this._selectionHandler.setSelectionMode(e)}getSelectionMode(){return this._selectionHandler.getSelectionMode()}getSelectedRuntimeComponentIds(){return this._selectionHandler.getSelectedRuntimeComponentIds()}setCameraMoving(e){e&&this._hoveredComponent&&this._hoverOff(this._hoveredComponent,0),this._cameraMoving=e}setCamera(e){this._raycastHelper.setCamera(e)}}n([i],fe.prototype,"_selectionHandler",void 0),n([i],fe.prototype,"_configuratorUiCallbacks",void 0);class ve extends u{constructor(e){super(),this._uiIntersectionMask=0,this.floorEnvironment=!1,this._camera=e}updateToBounds(e,t,n){let i=new Y(-e.x/2,0,-e.z/2),o=new Y(e.x/2,e.y,e.z/2);this._boundingBox=new Z(i,o),this._clientWidth=t,this._clientHeight=n;let s=this._boundingBox.getSize(new Y);this._boxVertices=[],this._boxVertices.push(this._boundingBox.min),this._boxVertices.push(this._boundingBox.min.clone().add(new Y(s.x,0,0))),this._boxVertices.push(this._boundingBox.max),this._boxVertices.push(this._boundingBox.max.clone().sub(new Y(s.x,0,0)))}set canvasOffset(e){this._offset=e,this.calculateUIIntersection()}calculateUIIntersection(){let e=[];if(null==this._boundingBox||null==this._offset)return;let t=this._checkPaddings();t.bottom=this._clientHeight-t.bottom,t.right=this._clientWidth-t.right;let n=0;this.floorEnvironment?(e=["left","right","bottom"],n=11):(this._offset.left>0&&t.left<this._offset.left*this._clientWidth&&(e.push("left"),n|=8),this._offset.right<1&&t.right<(1-this._offset.right)*this._clientWidth&&(e.push("right"),n|=2),this._offset.bottom>0&&t.bottom<this._offset.bottom*this._clientHeight&&(e.push("bottom"),n|=1)),this._offset.top<1&&t.top<(1-this._offset.top)*this._clientHeight&&(e.push("top"),n|=4),n!==this._uiIntersectionMask&&(this.dispatchEvent(0,e),this._uiIntersectionMask=n)}_checkPaddings(){let e={left:this._clientWidth/2,top:this._clientHeight/2,right:this._clientWidth/2,bottom:this._clientHeight/2};return this._boxVertices.forEach(t=>{let n=b(t,this._camera,this._clientWidth,this._clientHeight);n.x<e.left&&(e.left=n.x),n.x>e.right&&(e.right=n.x),n.y<e.top&&(e.top=n.y),n.y>e.bottom&&(e.bottom=n.y)}),e}}class be extends F{constructor(e,t,n=a.CAMERA_3D){super(e,t,w.HSC,n),this._configuratorContext.baseContext="configurator",this._getViewModel().setListener(this),this._sceneEventHandler=new fe(this._creator_,this._scene,this._getCameraControl().getCamera(),this._getInputManager()),this._sceneEventHandler.addEventListener(0,({forceRender:e})=>{this._uiIntersectionHelper.calculateUIIntersection(),e&&this._renderEverything()},this),this._sceneEventHandler.addEventListener(1,({component:e,type:t})=>this._onHoverOn(e,t),this),this._sceneEventHandler.addEventListener(2,({component:e,type:t})=>this._onHoverOff(e,t),this),this._sceneEventHandler.addEventListener(3,()=>{this._configuratorUiCallbacks.onClickOutside(),this._cameraControl.unlock(),this._cancelDockings(!1,null,this._getViewModel().hasPreviews(),!0,!1),this.cancelComponentSelection(!0),this._componentRaycastHelper&&this._componentRaycastHelper.checkComponentVisibility(this._sceneEventHandler,this._getViewModel()),this._requestRender()},this),this._sceneEventHandler.addEventListener(8,({component:e,consecutive:t})=>{this._getViewModel().hasPreviews()&&this._cancelDockings(!1,null,this._getViewModel().hasPreviews(),!0,!1),this._selectComponent(e,t),this._requestRender()},this),this._sceneEventHandler.addEventListener(9,({component:e,resetCamera:t})=>{this._deselectComponent(e,t),this._requestRender()},this),this._sceneEventHandler.addEventListener(4,({component:e})=>{var t;"multiselect"===this._sceneEventHandler.getSelectionMode()&&this.cancelComponentSelection(),this._requestDockingsPreviewWithDrag(e.runtimeId),this._cameraControl.lock(),null===(t=this._roomleRenderer)||void 0===t||t.enableUiInteractionMode(),this._requestRender()},this),this._sceneEventHandler.addEventListener(5,()=>{this._renderEverything()},this),this._sceneEventHandler.addEventListener(6,({component:e,preview:t})=>{var n;if(t){let n=t;this._getViewModel().isPreviewLine(n)?this._getViewModel().dockComponentWithPosition(n,e):this._getViewModel().isPreview(n)&&this._dockComponent(n),this._cancelDockings(!t,e,!0,!0)}else{let t=this._sceneEventHandler.isDragIn()?e:null;this._cancelDockings(this._sceneEventHandler.isDragIn(),t,!1,!0);const n=this._getViewModel().getBoundingBox();this._environment&&this._environment.needsBounds()&&this._environment.updateBounds(n.getSize(new Y))}this._cameraControl.unlock(),null===(n=this._roomleRenderer)||void 0===n||n.disableUiInteractionMode(),this._renderEverything()},this),this._sceneEventHandler.addEventListener(7,({preview:e})=>{this._getViewModel().isPreview(e)&&(this._getViewModel().isPreviewLine(e)?this._getViewModel().dockComponentWithPosition(e):this._dockComponent(e),this._cancelDockings(!1,null,!this._getViewModel().hasPreviews(),!1,!1),this.requestDockingsPreview(!1),this._requestRender())},this),this._cameraControl.addEventListener(0,()=>{this._configuratorUiCallbacks.onCameraPositionChanges(),this._sceneEventHandler.setCameraMoving(!0),this._requestRender()},this),this._cameraControl.addEventListener(1,()=>{this._componentRaycastHelper&&this._componentRaycastHelper.checkComponentAndPreviewVisibility(this._sceneEventHandler,this._getViewModel()),this._requestRender()},this),this._cameraControl.addEventListener(2,()=>{this._sceneEventHandler.setCameraMoving(!1),this._updateComponentPosition(),this._requestRender()},this),this._cameraControl.addEventListener(5,({minZoom:e,maxZoom:t})=>{this._configuratorUiCallbacks.onZoomChange(e,t)},this),this._cameraControl.addEventListener(3,()=>{this._configuratorUiCallbacks.onCameraPositionChanges(),this._updateComponentPosition(),this._requestRender()},this),this._cameraControl.addEventListener(4,()=>{this._configuratorUiCallbacks.onCameraPositionChanges(),this._updateComponentPosition(),this._requestRender()},this),this._cameraControl.addEventListener(7,()=>{this._pluginSystem.moveCameraStart(this._getCameraControl().getCamera().position)},this),this._cameraControl.addEventListener(8,()=>{this._pluginSystem.moveCameraEnd(this._getCameraControl().getCamera().position)},this),y.isProduction||(window.__RML__DEBUG__.SceneHelper=this),this.enableConfiguratorEvents(),this._initOptionalModules(),this._offsetAnimationStart=se(this._offsetAnimationStart.bind(this),250),this._offsetAnimationEnd=re(this._offsetAnimationEnd.bind(this),32)}async _initOptionalModules(){const{transparentHighlighting:e}=this._initData;if(e){const{default:e}=await t.import("./component-raycast-helper-401e69ee.legacy.js");this._componentRaycastHelper=new e,this._componentRaycastHelper.init(this._scene,this._getCameraControl().getCamera())}}disableEvents(){this.disableConfiguratorEvents()}enableEvents(){"configurator"===this._configuratorContext.baseContext&&this.enableConfiguratorEvents()}enableConfiguratorEvents(){this._sceneEventHandler.enable()}disableConfiguratorEvents(){this._sceneEventHandler.disable()}_getViewModel(){return this._viewModel||(this._viewModel=P.lookup("configurator-view-model",this._creator_),this._viewModel.setRequestRenderCallback(()=>this._renderEverything()),this._viewModel.setRequestRenderSceneUpdateCallback(()=>{var e;return null===(e=this._roomleRenderer)||void 0===e?void 0:e.clearCache()})),this._viewModel}_getKernelAccess(){return this._plannerKernelAccess}_showDockings(){var e,t,n;if(null===(e=this._roomleRenderer)||void 0===e||e.enableUiInteractionMode(),null===(n=null===(t=this._initData)||void 0===t?void 0:t.featureFlags)||void 0===n?void 0:n.pulsePreview){this._renderEverything();const e=setInterval(()=>this._renderEverything(),16);setTimeout(()=>clearInterval(e),(I+1)*M)}}cancelDockings(){this._cancelDockings(!0,null,!0,!0,!1),this._renderEverything()}_cancelDockings(e,t,n,i,o=!0){var s,r;null===(s=this._roomleRenderer)||void 0===s||s.disableUiInteractionMode(),e&&(this._sceneEventHandler.setDragIn(!1),this._getViewModel().removeDockingComponent(),t&&this._scene.remove(t)),this._getViewModel().removePreviews(),n&&o&&this._updateCameraToBounds(),i&&n&&this._configuratorUiCallbacks.onDockingsPreviewRemoved(),this._componentRaycastHelper&&this._componentRaycastHelper.changeMaterialsOnSelect(this._scene,null),n&&(null===(r=this._roomleRenderer)||void 0===r||r.forceShadowUpdates(!0))}_onHoverOn(e,t){2!==t&&this._highlightComponent(e),this._componentDimensioningHelper&&this._componentDimensioningHelper.add(e)&&this._renderEverything()}_onHoverOff(e,t){2!==t&&this._highlightComponent(),this._componentDimensioningHelper&&this._componentDimensioningHelper.hasComponentDimensions()&&(this._componentDimensioningHelper.remove(e),this._renderEverything()),this._requestRender()}_highlightComponent(e=null,t=[]){var n;if(!this._shouldHighlight())return;const i=[],o=this._initData.meshSelection;e?o?i.push(...e.meshes):e.boundingBoxMesh&&i.push(e.boundingBoxMesh):t&&t.length||(t=this._sceneEventHandler.getSelectedRuntimeComponentIds()),this._getViewModel().getComponentsForIds(t).forEach(e=>{e&&(o?i.push(...e.meshes):e.boundingBoxMesh&&i.push(e.boundingBoxMesh))}),null===(n=this._roomleRenderer)||void 0===n||n.highlightObjects(i)}shouldClearShadowsAndAO(){var e;return super.shouldClearShadowsAndAO()||!(null===(e=this._sceneEventHandler)||void 0===e?void 0:e.isDragging())}resume(){super.resume(),this._getViewModel().materialQueue.registerCallback(()=>this._materialLoaded()),this._configuratorMeshGenerator.setMaterialLoadedListener(()=>{this._renderWithoutShadowsAndAO()})}_materialLoaded(){this._renderEverything()}pause(){super.pause(),this._getViewModel().materialQueue.unregisterCallback(),this._configuratorMeshGenerator.removeMaterialLoadedListener()}_setupScene(e,t,n){super._setupScene(e,t),this._uiIntersectionHelper=new ve(this._getCameraControl().getCamera()),this._uiIntersectionHelper.canvasOffset=e,this._uiIntersectionHelper.addEventListener(0,e=>{this._configuratorUiCallbacks.onUiIntersectionChange(e)},this),this._configuratorMeshGenerator.maxAnisotropy=this._maxAnisotropy,this._configuratorMeshGenerator.maxTextures=this._renderer.capabilities.maxTextures,this._configuratorMeshGenerator.setMaterialLoadedListener(()=>{this._renderWithoutShadowsAndAO()}),this._domHelper.element.appendChild(this._renderer.domElement),n||!this._initData.legacyLight||this._initData.ls||this._initData.dls||(this._renderer.capabilities.maxTextures>8?this.loadDynamicLightSetting(D.createDynamicLightSettingSource(null,S.CAMERA)):this._lightSetting=new _e(this._scene,this._lightSetting)),this._requestRender(),this._setEnvironment(new q(this._scene,this._environment,ae(this._initData.colors.DEFAULT_BACKGROUND))),this._getViewModel().materialQueue.registerCallback(()=>this._materialLoaded())}sceneCleared(e){this._internalClearScene(e)}display(e){this._scene.add(e),this.setRootComponentId(e.runtimeId),this._requestRender()}setRootComponentId(e){this._sceneEventHandler.setRootComponentId(e)}debugSceneGraph(e){this._getViewModel().debugSceneGraph(e),this._printObjectGraph(this._scene,"")}debugScene(){return this._scene}_printObjectGraph(e,t){e.material&&e.material.opacity,e.type,e.id,e.runtimeId,e.children.length>0&&e.children.forEach(e=>{let n=t+" ";this._printObjectGraph(e,n)})}clearScene(){var e;this._getCameraControl().clear(),this._internalClearScene(!1),null===(e=this._sceneEventHandler)||void 0===e||e.cancelSelection(),this._pluginSystem.clearScene(this._scene,this._uiScene)}planObjectConstructionDone(e){this._componentDimensioningHelper.reset(),this._componentDimensioningHelper.setCamera(this._getCameraControl().getCamera())}_internalClearScene(e){var t;this._scene.children.forEach(e=>{"Object3D"!==e.type&&"Mesh"!==e.type&&"Line"!==e.type||this._scene.remove(e)}),this._uiScene.children.forEach(e=>{this._uiScene.remove(e)}),this._getViewModel().sceneCleared(),null===(t=this._componentDimensioningHelper)||void 0===t||t.invalidateDimensioningsCache(),(e||this._memoryManager.shouldHardReset())&&(this._configuratorMeshGenerator.clear(),this._renderer.renderLists.dispose(),this._memoryManager.executedHardReset()),this._renderEverything()}async preparePerspectiveImage(e={}){var t,n;await this._externalMeshesAndMaterialsReady();const{showDimensions:i=!1}=e;this._cancelDockings(!0,null,!0,!0),this._clearSelectionAndHovers();const o=this._getCameraControl().getCamera().clone();o.resetOffset();let s=this._calculateBoundingBoxOfAllMeshes(0,i);null===(t=this._lightSetting)||void 0===t||t.removeFromScene();const r=!!this._dimensionHelper&&this._dimensionHelper.areDimensionsEnabled();r&&this._dimensionHelper.disableDimensions();const a=this._getCameraControl().getObjectRotation();if(i){await this._initDimensions(),await this._dimensionHelper.isInitialized();const e=-30+R(a);O.placeCameraForPerspectiveImage(o,s,-20,e),this._dimensionHelper.enableDimensions(),this._dimensionHelper.moveCameraEnd(o.position),s=this._calculateBoundingBoxOfAllMeshes(0,i)}this._componentDimensioningHelper&&this._componentDimensioningHelper.hasComponentDimensions()&&await this._componentDimensioningHelper.reset();const l=await this._imageRenderer.preparePerspectiveImage(this._scene,this._uiScene,o,s,e,a,this._initData.e2e);return r?this._dimensionHelper.enableDimensions():i&&this._dimensionHelper.disableDimensions(),null===(n=this._lightSetting)||void 0===n||n.addToScene(),this._requestRender(),l}async renderImage(e){await this._externalMeshesAndMaterialsReady(),this._getViewModel().getPreviews()&&this._cancelDockings(!0,null,!0,!0),this._clearSelectionAndHovers();let t=this._getCameraControl().getCamera(),n=null;e.useCurrentPerspective||(t=this._getCameraControl().getCamera().clone(),t.resetOffset(),n=this._calculateBoundingBoxOfAllMeshes());const i=!!this._dimensionHelper&&this._dimensionHelper.areDimensionsEnabled();i&&this._dimensionHelper.disableDimensions(),this._componentDimensioningHelper&&this._componentDimensioningHelper.hasComponentDimensions()&&await this._componentDimensioningHelper.reset();const o=await this._imageRenderer.renderPerspectiveImage(this._scene,t,n);return i&&this._dimensionHelper.enableDimensions(),this._requestRender(),o}async preparePartImage(e,t){return new Promise((n,i)=>{this._getViewModel().requestSubPartConstruction(e).then(async e=>{t.size||(t.size=256);const i=this._getCameraControl().getCamera().clone();i.resetOffset();let o=O.getCameraTargetForBBox((new Z).setFromObject(e));const s=new le;s.add(e);const r=await this._imageRenderer.preparePerspectiveImage(s,null,i,o,t);E(s),n(r)},i)})}_calculateBoundingBoxOfAllMeshes(e=0,t){let n=null;return n=t&&this._dimensionHelper?this._dimensionHelper.getBoundingBox():this._getViewModel().getBoundingBox(),O.getCameraTargetForBBox(n,e)}async _externalMeshesAndMaterialsReady(){await this._getKernelAccess().externalMeshQueue.finished(!0),await this._getViewModel().materialQueue.finished(!0)}async prepareTopImage(e={}){var t,n;await this._externalMeshesAndMaterialsReady();const{showDimensions:i=!1}=e;this._cancelDockings(!0,null,!0,!0),this._clearSelectionAndHovers(),i&&(await this._initDimensions(),await this._dimensionHelper.isInitialized(),this._dimensionHelper.enableTopDimensions()),this._componentDimensioningHelper&&this._componentDimensioningHelper.hasComponentDimensions()&&await this._componentDimensioningHelper.reset();let o=this._calculateBoundingBoxOfAllMeshes(.1,i);null===(t=this._lightSetting)||void 0===t||t.removeFromScene();let s=await this._imageRenderer.prepareTopImage(this._scene,this._uiScene,o,e);return i&&this._dimensionHelper.disableTopDimensions(),null===(n=this._lightSetting)||void 0===n||n.addToScene(),this._requestRender(),s}enableDragIn(e){this._sceneEventHandler.setDragIn(!0,e),this._requestRender()}zoomToComponent(e){this._cameraControl.saveState(!1);let t=e.boundingBox.getSize(new Y),n=H(e),i=new ce(0,n,0),o=e.getWorldPosition(new Y).clone().add(e.boundingBox.getCenter(new Y).applyEuler(i));const s=new ee;this._renderer.getSize(s);const r={yaw:i.y,pitch:v(15),distance:A(t.x,t.y,t.z,this._getCameraControl().getCamera().fov,s.width,s.height)*z,targetX:o.x,targetY:o.y,targetZ:o.z,blockOtherTweens:!0};he(this._cameraControl.getCurrentCameraParameters(),r)||(this._configuratorUiCallbacks.onZoomToComponent(),this._getCameraControl().zoomTo(r))}resetCamera(){this._cameraControl.hasSavedState()?this.resetCameraToState():this.resetCameraPositionToStart(!1)}resetCameraToState(){this._cameraControl.hasSavedState()&&this._cameraControl.resetToState()}resetCameraPositionToStart(e=!0){this._requestRender();const t=this._getViewModel().getBoundingBox();t&&this._cameraControl instanceof W&&this._getCameraControl().reset(t,void 0,void 0,void 0,e)}_clearSelectionAndHovers(){this.cancelComponentSelection(),this._getViewModel().clearRootComponent()}resetPreviews(){this._getViewModel().removePreviews(),this._requestRender()}changeOffset(e){this._getCameraControl().getCamera().offset=e,this._uiIntersectionHelper&&(this._uiIntersectionHelper.canvasOffset=e)}updateCamera(e=!0){super.updateCamera(),this._updateCameraToBounds(null,e)}setCameraOffset(e){this._offsetAnimationStart(),this._getCameraControl().getCamera().offset&&(this._getCameraControl().getCamera().offset=e,this._renderEverything()),this._offsetAnimationEnd()}_offsetAnimationStart(){this._onCameraMove()}_offsetAnimationEnd(){this._onCameraIdle()}getCameraOffset(){var e,t;return(null===(t=null===(e=this._getCameraControl())||void 0===e?void 0:e.getCamera())||void 0===t?void 0:t.offset)?JSON.parse(JSON.stringify(this._getCameraControl().getCamera().offset)):{left:0,top:1,right:1,bottom:0}}_onKeyDown(e){super._onKeyDown(e),!e.key||"Escape"!==e.key&&"Esc"!==e.key||(this.cancelComponentSelection(),e.preventDefault()),e.key&&e.key.includes("Shift")&&this._cameraControl instanceof W&&(this._getCameraControl().enablePanning(),e.preventDefault()),this._sceneEventHandler&&this._sceneEventHandler.hasSelection()&&e.key&&("Backspace"===e.key||"Delete"===e.key)&&(this.requestDeleteSelectedComponent(),e.preventDefault())}_onKeyUp(e){super._onKeyUp(e),e.key&&e.key.includes("Shift")&&(this._getCameraControl().disablePanning(),e.preventDefault())}cancelPreviousDockings(){var e;this._cancelDockings(!0,null,!1,!1),null===(e=this._roomleRenderer)||void 0===e||e.forceShadowUpdates(!0),this._renderEverything()}cancelComponentSelection(e){(this._sceneEventHandler.hasSelection()||"standard"!==this._sceneEventHandler.getSelectionMode())&&this._cancelSelection(e)}_cancelSelection(e){this._sceneEventHandler.cancelSelection(),this._configuratorContext.selectionMode="standard",this._configuratorContext.selectedRuntimeComponentIds=[],this._getViewModel().removePreviews(),e&&!this._initData.debug&&this.resetCameraToState(),this._getKernelAccess().updatePlanObjectDependencies(this._configuratorContext.planObjectId),this._configuratorUiCallbacks.onSelectionCancel()}_selectComponent(e,t){this._configuratorContext.selectedRuntimeComponentIds=this._sceneEventHandler.getSelectedRuntimeComponentIds(),t||("standard"===this._sceneEventHandler.getSelectionMode()?this._onSelectedRuntimeComponentChange(e):this._onSelectedRuntimeComponentsChange(this._sceneEventHandler.getSelectedRuntimeComponentIds())),this._highlightComponent(e),!this._initData.debug&&t&&this.zoomToComponent(e)}_deselectComponent(e,t){"standard"===this._sceneEventHandler.getSelectionMode()&&(this._cancelSelection(t),this._highlightComponent()),"multiselect"===this._sceneEventHandler.getSelectionMode()&&(this._sceneEventHandler.hasSelection()?this._configuratorContext.selectedRuntimeComponentIds=this._sceneEventHandler.getSelectedRuntimeComponentIds():(this._cancelSelection(t),this._highlightComponent())),this._componentRaycastHelper&&this._componentRaycastHelper.changeMaterialsOnSelect(this._scene,null)}getScreenXY(e){return b(e,this._getCameraControl().getCamera(),this._domHelper.element.clientWidth,this._domHelper.element.clientHeight)}setSelectionMode(e){this._sceneEventHandler.setSelectionMode(e)}changeFloorMaterial(e){return this._environment&&this._environment instanceof N||(this._environment=new N(this._scene,this._environment,!0),this._uiIntersectionHelper.floorEnvironment=!0),new Promise((t,n)=>{this._environment.changeFloorMaterial(e,this._maxAnisotropy).then(()=>{this._requestRender(),t()},n)})}exportGLB(){}zoomIn(e){this._getCameraControl().zoomIn(e),this._renderEverything()}zoomOut(e){this._getCameraControl().zoomOut(e),this._renderEverything()}async showDimensions(){await this._initDimensions(),this._dimensionHelper.enableDimensions(),this._dimensionHelper.onDimensionsVisibilityChanged(e=>{e&&this._renderEverything(),this._configuratorUiCallbacks.onDimensionsVisibilityChange(e)}),this._configuratorUiCallbacks.onDimensionsVisibilityChange(!0),this._renderEverything()}async _initDimensions(){this._dimensionHelper||await t.import("./dimensioning-helper-39d0ac36.legacy.js").then(({default:e})=>{this._dimensionHelper=new e(this._creator_),this._pluginSystem.addPlugin(this._dimensionHelper)})}hideDimensions(){this._dimensionHelper&&this._dimensionHelper.disableDimensions(),this._componentDimensioningHelper&&this._componentDimensioningHelper.hasComponentDimensions()&&this._componentDimensioningHelper.reset(),this._renderEverything()}async loadSceneSettings(e){await super.loadSceneSettings(e),this._uiIntersectionHelper.floorEnvironment=this._environment instanceof N}_updateCameraToBounds(e,t=!0,n=!1){e||(e=this._getViewModel().getBoundingBox()),e&&this._cameraControl instanceof W&&(n?this._getCameraControl().zoomToFitBounds(e):this._getCameraControl().updateToBounds(e,!1,t),this._configuratorUiCallbacks.onCameraPositionChanges(),this._updateComponentPosition())}requestDockingsPreview(e,t,n,i){i||(i=!1),e&&this.cancelPreviousDockings(),this.cancelComponentSelection(),i&&this.enableDragIn(n),t&&(this._configuratorContext.lastPossibleChild=t),this._configuratorContext.requestPreviewsIsUserInitiated=e,this.resetPreviews(),this._getKernelAccess().webGlPreviewDockings(this._configuratorContext,i),this._showDockings()}_requestDockingsPreviewWithDrag(e){this.cancelPreviousDockings(),this._configuratorContext.rootComponentId!==e&&(this.resetPreviews(),this._getKernelAccess().previewDockingsWithDrag(e,this._configuratorContext.planObjectId),this._showDockings())}_dockComponent(e){k.start("dock_component_"+e.childId),this._getKernelAccess().dockComponent(e.parentId,e.parentDockId,e.childId,e.childDockId),this._configuratorContext.dockingRootComponentId=null}_onSelectedRuntimeComponentsChange(e){this._getKernelAccess().multiSelectionChange(e,this._configuratorContext.rootComponentId)}_onSelectedRuntimeComponentChange(e){let t=!1,n=null;e&&(t=e.runtimeId===this._configuratorContext.rootComponentId,n=e.runtimeId),this._getKernelAccess().selectionChange(n,t),e&&this._getKernelAccess().selectedComponent(e.runtimeId)}requestDeleteSelectedComponent(){const e=this._configuratorContext.selectedRuntimeComponentIds,t=this._configuratorContext.rootComponentId;if(Array.isArray(e)&&0!==e.length&&t&&-1===e.indexOf(t)){switch(this._configuratorContext.selectionMode){case"standard":this.resetCamera(),this._getKernelAccess().requestDeleteComponent(this._configuratorContext.selectedRuntimeComponentId);break;case"multiselect":this.resetCamera(),this._getKernelAccess().requestDeleteComponents(this._configuratorContext.selectedRuntimeComponentIds)}this._configuratorContext.selectedRuntimeComponentIds=[]}}componentUpdated(e,t){var n;if(e.runtimeId===this._configuratorContext.rootComponentId){let t=new Y(e.position.x/1e3,e.position.z/1e3,e.position.y/-1e3);this._sceneEventHandler.update(null,t,null)}void 0===e.geometryChanged||e.geometryChanged?this._renderEverything():this._renderWithoutShadowsAndAO(),null===(n=this._componentDimensioningHelper)||void 0===n||n.invalidateDimensioningsCache(e.runtimeId)}planObjectUpdated(e,t){const n=this._getKernelAccess().kernelInstance.getSerializedConfiguration(this._configuratorContext.planObjectId);if(this._configuratorHistory.push(n),e.bounds){if(this._configuratorContext.planObjectId===e.id){const e=this._getViewModel().getBoundingBox();this._updateBounds(e,t)}this._highlightComponent(),this._requestRender()}}componentDeleted(e){-1===this._sceneEventHandler.getSelectedRuntimeComponentIds().indexOf(e.runtimeId)&&"multiselect"!==this._sceneEventHandler.getSelectionMode()||this.cancelComponentSelection()}previewConstructionDone(e,t){const n=this._getViewModel().getBoundingBoxWithPreviews();t||(this._cancelDockings(!0,null,!1,!1,!1),this._configuratorContext.requestPreviewsIsUserInitiated&&this._configuratorUiCallbacks.onNoDockingsAvailable());let i=!0;this._componentRaycastHelper&&(i=!this._componentRaycastHelper.areAllComponentsInFrustum(this._getViewModel().getPreviews())),this._configuratorContext.requestPreviewsIsUserInitiated&&i&&this._updateCameraToBounds(n,!0,!0),this._lightSetting&&this._lightSetting.needsBounds()&&(this._lightSetting.updateBounds(n),this._environment&&this._environment.needsBounds()&&this._environment.updateBounds(n.getSize(new Y))),this._componentRaycastHelper&&this._componentRaycastHelper.checkPreviewVisibility(this._getViewModel())}configurationLoaded(e,t){e&&t&&this._sceneEventHandler.isDragIn()?(e.position.copy(new Y(0,100,0)),this._scene.add(e),this._sceneEventHandler.addComponentDragInHandler(e),this._requestRender()):t||this._initData.debug||this._initData.moc||this.resetCamera(),this._environment&&this._environment.reload()}addComponentHandlers(e){this._sceneEventHandler.addComponentHandlers(e)}addPreviewHandlers(e){this._sceneEventHandler.addPreviewHandlers(e)}addPreviewLineHandlers(e){this._sceneEventHandler.addPreviewLineHandlers(e)}_updateComponentPosition(){if(!this._configuratorUiCallbacks.onComponentPositionsUpdated)return;const e=[];this._getViewModel().getComponents().forEach(t=>{if(!t.boundingBoxMesh)return;const n=(new Z).setFromObject(t.boundingBoxMesh);let i=this._getKernelAccess().kernelInstance.getComponent(t.runtimeId);const o=i.parameters||i.possibleChildren?["edit"]:[];e.push({id:t.runtimeId,position:this.getScreenXY(n.getCenter(new Y)),type:"component",actions:o})}),this._getViewModel().getPreviews().forEach(t=>{const n=(new Z).setFromObject(t);e.push({id:t.runtimeId,position:this.getScreenXY(n.getCenter(new Y)),type:"preview",actions:["add"]})}),this._configuratorUiCallbacks.onComponentPositionsUpdated(e)}_updateBounds(e,t=!1){if(super._updateBounds(e,t),!e)return;let n=e.getSize(new Y);this._sceneEventHandler.hasSelection()||this._updateCameraToBounds(e,!1),this._sceneEventHandler.update(n,null,null),this._uiIntersectionHelper.updateToBounds(n,this._domHelper.element.clientWidth,this._domHelper.element.clientHeight),this._componentDimensioningHelper&&this._componentDimensioningHelper.hasComponentDimensions()&&this._componentDimensioningHelper.reset(),this._getCameraControl().getCamera().updateProjectionMatrix()}async moveCamera(e){return this._getCameraControl().moveCamera(e)}selectComponent(e){if(!e)return;const t=this._getViewModel().getComponents().find(t=>t.runtimeId===e);t?this._sceneEventHandler.clickComponent(t):console.warn('Can not select "'+e+'" because it was not found')}highlightParts(e){this._highlightComponent(null,e),this._requestRender()}_shouldHighlight(){return this._initData.highlighting===de.ALWAYS||this._initData.highlighting!==de.OFF&&(this._plannerKernelAccess.kernelInstance.getChildrenOfPlanComponent(this._configuratorContext.rootComponentId,!0,!1)||[]).length>1}_getInputManager(){return this._configuratorInputManager}createCameraControl(e,t){this._componentFactory=x();const n=this._domHelper.getClientDimensions(),i=n.x,o=n.y,s=this._componentFactory.createPerspectiveCamera(30,i/o,.1,20,t);s.layers.set(3),s.layers.enable(1),s.layers.enable(2),s.layers.enable(6),s.layers.enable(5),s.position.copy(new Y(0,.5,5)),this._changeCameraControl(new W(this._creator_,this._getInputManager(),null,s))}getBounds(){return this._getViewModel().getBoundingBox()}sceneChanged(){}_getCameraControl(){return this._cameraControl}_onCameraIdle(){return super._onCameraIdle()}_onCameraMove(){return super._onCameraMove()}getComponent(e){return this._plannerKernelAccess.kernelInstance.getComponent(e)}cameraControlChanged(){var e;super.cameraControlChanged(),null===(e=this._sceneEventHandler)||void 0===e||e.setCamera(this._cameraControl.getCamera())}}e("C",be),n([i],be.prototype,"_configuratorInputManager",void 0),n([i],be.prototype,"_configuratorUiCallbacks",void 0),n([i],be.prototype,"_configuratorMeshGenerator",void 0),n([i],be.prototype,"_memoryManager",void 0),n([i],be.prototype,"_configuratorContext",void 0),n([i],be.prototype,"_componentDimensioningHelper",void 0),n([i],be.prototype,"_configuratorViewModel",void 0),n([i],be.prototype,"_configuratorHistory",void 0),n([i],be.prototype,"_plannerKernelAccess",void 0);const we=(e,t)=>e.sort||t.sort?e.sort?t.sort?e.sort-t.sort:-1:1:0,ye=(e,t)=>e&&!t?1:!e&&t?-1:e&&t?e.localeCompare(t):0;class Pe{_isInitDone(){return this._isKernelReady&&this._isWebGlReady&&this._isPreloadReady}_checkInitDone(){this._isInitDone()&&(this._onInitDoneCollection.forEach(e=>e()),this._onInitDoneCollection=[])}_onInitDone(e){this._isInitDone()?e():this._onInitDoneCollection.push(e)}constructor(e){this._onInitDoneCollection=[],this._isKernelReady=!1,this._isWebGlReady=!1,this._isPreloadReady=!0,this._isLoadError=!1,this._isReloading=!1,this._needsSync=!1,this._creator_=e,this._configuratorKernelAccessCallback.addListener(this);const{dls:t,ls:n}=this._initData;(n||t)&&(this._initData.legacyLight=!0),this._initData.legacyLight&&(this._initData.envMapIntensity=.9);const i=this._errorHandler;i.subscribe(0,e=>this._configuratorUiCallbacks.onErrorDueToOffline(e)),i.subscribe(1,e=>this._configuratorUiCallbacks.onError(e)),i.subscribe(2,(e,t)=>this._configuratorUiCallbacks.onContentProblem({rapiPath:e,ids:t,message:"Could not load the ids"}))}initSceneManager(e){this._sceneManager=e||P.lookup("configurator-scene-manager",this._creator_)}getScene(){return this._sceneManager.getScene()}updateScene(){this._sceneManager.updateScene()}_loadWebGlLib(e,t){this._loadingWebGlSuccess(e,t)}_loadingWebGlSuccess(e,t){this.initSceneManager(),t&&this._sceneManager.changeOffset(t);const{initialFloorMaterial:n,dls:i,ls:o,stats:s}=this._initData,r=D.createDynamicLightSettingSource(i,o);s&&this.showStats(),this._sceneManager.enableHD(r),this._needsSync&&(this._needsSync=!1,this._plannerKernelAccess.requestSync(L,this._configuratorContext.planObjectId));const a=[this._scriptLoader.fetch(Q,{id:"tween-js"})];n&&a.push(this._rapiAccess.getMaterial(n).then(e=>this._sceneManager.changeFloorMaterial(e))),Promise.all(a).then(this._webGlIsReady.bind(this),this.loadError.bind(this))}_webGlIsReady(){this._isWebGlReady=!0,this._checkInitDone()}_initPromiseCallback(e,t){this._isInitDone()?e():this._isLoadError?t("_initPromiseCallback failed"):(this._onInitDone(()=>e()),this._rejectOnLoadError=t)}_notifyOnConfigurationReady(e){return async t=>{const n=await this._plannerKernelAccess.addUiDataAndPriceToPartList(t.partList,t.hash);t.partList=n,e(t),this._configuratorUiCallbacks.onConfigurationReady(n,t.hash,t.rootComponentLabel)}}_notifyOnConfigurationLoadingError(e){return t=>{this._configuratorUiCallbacks.onConfigurationLoadError(),e(t)}}_loadItemOrConfigById(e,t){this._configuratorContext.lastLoadedRapiId=e,this._onLoadConfiguration(),this._preloadPackage(e),this._clearScene();const{offlineSync:n}=this._initData;if(n){const t=j(e);t&&this._dataSyncer.start(t)}return new Promise((n,i)=>{(t?this._rapiAccess.getConfiguration(e):this._rapiAccess.getItem(e)).then(t=>{t&&t.configuration?this._loadConfiguration(t.configuration).then(e=>{const i=this._notifyOnConfigurationReady(n);t.label?this._notifyUiAboutNewItem(t,e.rootComponentLabel):this._notifyUiAboutNewConfiguration(t),i(e)},this._notifyOnConfigurationLoadingError(i).bind(this)):i(new Error("Could not load item or config with id "+e))},i)})}_shouldBroadcastToUi(e){return!(0===e&&this._configuratorContext.selectedRuntimeComponentId||1===e&&!this._configuratorContext.selectedRuntimeComponentId||2===e&&!this._configuratorContext.selectedRuntimeComponentIds.length)}_isCorrectResponse(e,t){if(0===e)return t===this._configuratorContext.planObjectId;if(1===e)return t===this._configuratorContext.selectedRuntimeComponentId;const n=t.length;if(n!==this._configuratorContext.selectedRuntimeComponentIds.length)return!1;for(let e=0;e<n;e++)if(t[e]!==this._configuratorContext.selectedRuntimeComponentIds[e])return!1;return!0}_onLoadConfiguration(){this._clearScene(),this._configuratorUiCallbacks.onLoadConfiguration()}_clearScene(){this._sceneManager&&this._sceneManager.clearScene()}_notifyUiAboutNewItem(e,t){this._rapiAccess.getCatalog(e.catalog).then(n=>this._configuratorUiCallbacks.onConfigurationLabelChange(n.name,e.label,t))}_notifyUiAboutNewConfiguration(e){Promise.all([this._rapiAccess.getCatalog(e.catalog),this._rapiAccess.getComponent(e.rootComponentId)]).then(([e,t])=>this._configuratorUiCallbacks.onConfigurationLabelChange(e.name,null,t.label))}notifyUiAboutNewLabel(e){if(T(e)){const t=this._rapiAccess.peekItem(e),n=this._rapiAccess.peekComponent(t.rootComponentId);this._notifyUiAboutNewItem(t,n.label)}else this._notifyUiAboutNewConfiguration(this._rapiAccess.peekConfiguration(e))}_getMaterialGroups(e){const t=(e,t)=>{let n=we(e,t);return 0!==n?n:(n=ye(e.label,t.label),0!==n?n:ye(e.id,t.id))},n=e=>(e.sort(t),e.forEach(e=>e.materials.sort(t)),e);if(e.validGroups.length>0)return new Promise((t,i)=>this._rapiAccess.getMaterialsByGroup(e.validGroups).then(e=>t(n(e)),i));const i=[];return e.validValues.forEach(e=>i.push(e.value)),new Promise((e,t)=>{this._rapiAccess.getMaterials(i).then(t=>{this._rapiAccess.combineMaterialsToGroups(t).then(t=>{e(n(t))})},t)})}_loadConfiguration(e){return this._plannerKernelAccess.externalMeshQueue.clear(),new Promise((t,n)=>{const i=()=>{const{x:i,y:o}=this._domHelper.getClientDimensions();if(i<=0&&o<=0){let e="Size of canvas is 0/0! When using embedding set correct size or remove id to load in idle mode!";return console.error(e),n(e)}this.resumeKernelCallbacks(),k.start("ui_load_configuration");const s=[];if(this._initData.applyCurrentGlobalParameters){const e=this._configuratorContext.planObjectId,t=this._configuratorContext.rootComponentParametersAsGlobal;s.push(this._plannerKernelAccess.getGlobalParameters(e,t))}Promise.all(s).then(([i])=>{const o=[B.waitFor(4),B.waitFor(2)];Promise.all(o).then(([e,[n,o,s,r]])=>{const a=[];i&&this._initData.applyCurrentGlobalParameters&&i.forEach(e=>a.push(this.setParameter(e,e.value,!0)));const l=this._rapiAccess.peekComponent(r);Promise.all(a).then(()=>{const n=[];a.length&&(n.push(this._plannerKernelAccess.getPartList()),n.push(this._plannerKernelAccess.getConfigurationHash(this._configuratorContext))),Promise.all(n).then(async n=>{const i=n&&n[0]?n[0]:o,r=n&&n[1]?n[1]:s,a=await this._plannerKernelAccess.addUiDataAndPriceToPartList(i,r);let c=e.errors;const h=c?U(c):[];this._configuratorUiCallbacks.onPartListUpdate(a,window.btoa(s)),t({partList:a,hash:r,rootComponentLabel:l?l.label:"",errors:h})})})},n),this._plannerKernelAccess.loadConfiguration(e)},n)};this._onInitDone(()=>i())})}_preLoadItemOrConfig(e,t){return new Promise((n,i)=>{(t?this._rapiAccess.getConfiguration(e):this._rapiAccess.getItem(e)).then(n,i)})}_preloadPackage(e){this._isPreloadReady=!1;let t=null;t=T(e)?this._rapiAccess.getPreloadForItem.bind(this._rapiAccess):this._rapiAccess.getPreloadForConfiguration.bind(this._rapiAccess),k.start("rapi_preloads");const n=()=>{const t=k.getMeasure("rapi_preloads");if(Array.isArray(t)&&1===t.length){const n=t[0];this._configuratorUiCallbacks.onTrackTiming("Timing","RapiPreloads",Math.round(n.duration),{id:e})}};t(e).then(()=>{this._isPreloadReady=!0,this._checkInitDone(),n()},e=>{this._isPreloadReady=!0,this._checkInitDone(),console.error(e),n()})}_reloadConfiguration(e,t,n,i){return this._performLoadConfiguration(e).then(e=>{this._isReloading=!1,n(e)},e=>{this._isReloading=!1,i(e)})}_performLoadConfiguration(e){return this._onLoadConfiguration(),new Promise((t,n)=>{this._initData.preloadHint?this._preloadPackage(this._initData.preloadHint):console.warn("When loading a configuration string you have to supply a preloadHint to use fast loading!"),setTimeout(()=>{this._loadConfiguration(e).then(this._notifyOnConfigurationReady(t).bind(this),this._notifyOnConfigurationLoadingError(n).bind(this))},0)})}_changeHDGeometry(e){return new Promise((t,n)=>e===V.useHDGeometry?t():this._isReloading?n("Change of HD Geometry in progress"):(this._isReloading=!0,B.waitFor(3).then(([e,i])=>{this._reloadConfiguration(e,i,t,n)},n),V.useHDGeometry=e,void this._plannerKernelAccess.changeUseOfHDGeometry(this._configuratorContext,V.useHDGeometry)))}async _callOnPartListUpdate(){const{hash:e}=await B.waitFor(4),t=await this._plannerKernelAccess.getPartList(),n=await this._plannerKernelAccess.getConfigurationHash(this._configuratorContext),i=await this._plannerKernelAccess.addUiDataAndPriceToPartList(t,n);this._configuratorUiCallbacks.onPartListUpdate(i,window.btoa(e))}setOverrides(e){e&&(this._initData.setOverrides(e),this._globalInitData.setOverrides(e))}init(e,t){this.setOverrides(t);const{preloadHint:n,offset:i,startTag:o}=this._initData;return this._domHelper.setDomElement(e),n?this._preloadPackage(n):console.warn("No preload hint! Therefore no preload during init!!"),o&&this.getTagById(o,{include:["items"]}).then(e=>this._configuratorUiCallbacks.onOpenTag(e),e=>console.error(e)),this._loadWebGlLib(e,i),new Promise(this._initPromiseCallback.bind(this))}cancelSelection(){this._sceneManager.cancelComponentSelection()}enableHDGeometry(){return this._changeHDGeometry(!0)}disableHDGeometry(){return this._changeHDGeometry(!1)}changeOffset(e){this._sceneManager.changeOffset(e)}previewDockings(e,t,n){this._sceneManager.requestDockingsPreview(!0,e,t,n)}cancelDockings(){this._sceneManager.cancelDockings()}requestDeleteComponent(){this._sceneManager.requestDeleteSelectedComponent()}renderImage(e){return this._sceneManager.renderImage(e)}preparePerspectiveImage(e={}){return this._sceneManager.preparePerspectiveImage(e)}preparePartImage(e,t){let n={};return"number"==typeof t?n.size=t:(t||(t={}),"number"!=typeof t.size&&(t.size=256),n=t),this._sceneManager.preparePartImage(e,n)}saveCurrentConfiguration(){return new Promise((e,t)=>{this._plannerKernelAccess.getConfigurationData(this._configuratorContext.planObjectId).then(n=>{this._rapiAccess.saveConfiguration(n).then(n=>{this._configuratorUiCallbacks.onConfigurationSaved(n.configurationHash),this._rapiAccess.getComponent(n.rootComponentId).then(i=>{let o=!0,s=!0,r=n.perspectiveImage,a=n.topImage;n.perspectiveImage||(o=!1,this._sceneManager.preparePerspectiveImage().then(l=>{this._rapiAccess.savePerspectiveImage(n,l).then(t=>{o=!0,r=t.perspectiveImage,s&&(t.label=i.label,t.topImage=a,e(t))},t)})),n.topImage||(s=!1,this._sceneManager.prepareTopImage().then(l=>{this._rapiAccess.saveTopImage(n,l).then(t=>{s=!0,a=t.topImage,o&&(t.label=i.label,t.perspectiveImage=r,e(t))},t)})),o&&s&&(n.label=i.label,e(n))},e=>{throw new Error(e)})},t)}).catch(t)})}generateImagesOfCurrentConfiguration(){return new Promise((e,t)=>this.saveCurrentConfiguration().then(t=>e({topImage:t.topImage,perspectiveImage:t.perspectiveImage,isLocally:t.isLocally}),t))}prepareTopImage(e){let t={};return"boolean"==typeof e?t.showDimensions=e:(e||(e={}),"boolean"!=typeof e.showDimensions&&(e.showDimensions=!1),t=e),this._sceneManager.prepareTopImage(t)}resetCameraPosition(){this._sceneManager.resetCameraPositionToStart()}showBenchmarks(e){k.showBenchmarks(e)}debugSceneGraph(e){this._sceneManager.debugSceneGraph(e)}async loadConfiguration(e,t){this.setOverrides(t),this._configuratorContext.lastLoadedRapiId=null,this._sceneManager&&this._sceneManager.clearScene();const n=await this._performLoadConfiguration(e);return this._rapiAccess.trackView("configuration string"),n}async loadConfigurationById(e,t){this.setOverrides(t);const n=await this._loadItemOrConfigById(e,!0);return this._rapiAccess.trackView(e),n}syncPlanObjectToView(e,t){this.resumeKernelCallbacks(),this._plannerKernelAccess.requestSync(e,t),this._plannerKernelAccess.requestPlanObjectConstruction(t);const n=this._plannerKernelAccess.getSerializedConfiguration(t),i=this._plannerKernelAccess.getCurrentConfigurationHash(t);this._plannerKernelAccess.planObjectConfigurationUpdated(t,n,i,-1,!0),this._sceneManager.resetCameraPositionToStart(!1)}async loadConfigurableItemById(e,t){this.setOverrides(t);const n=await this._loadItemOrConfigById(e,!1);return this._rapiAccess.trackView(e),n}preLoadConfigurationById(e){return this._preLoadItemOrConfig(e,!0)}preLoadConfigurableItemById(e){return this._preLoadItemOrConfig(e,!1)}_getTag(e){return this._rapiAccess.getTag(e)}_dispatchSetParameter(e,t,n,i,o){const s=this._configuratorContext.selectedRuntimeComponentId?"local":"global";switch(k.start("kernel_change_param_"+s+"_"+e),this._configuratorContext.selectionMode){case"standard":if(this._configuratorContext.selectedRuntimeComponentId||this._configuratorContext.rootComponentParametersAsGlobal){let s=this._configuratorContext.selectedRuntimeComponentId?this._configuratorContext.selectedRuntimeComponentId:this._configuratorContext.rootComponentId;this._plannerKernelAccess.changeComponentParameter(s,e,t,n,i,o)}else this._plannerKernelAccess.changePlanObjectParameter(this._configuratorContext.planObjectId,e,t,n,i,o);break;case"multiselect":this._plannerKernelAccess.changeCommonComponentParameter(this._configuratorContext.selectedRuntimeComponentIds,e,t,n,i,o)}}setParameter(e,t,n=!1){return new Promise((i,o)=>{const{key:s,type:r}=e;if(K(e)){if(!n&&!this._unitFormatter.isParseableUnitString(t,e))return o(new SyntaxError('Value "'+t+'" is not parseable'));const i=n?t:this._unitFormatter.parseValue(t,e),{valueFrom:s,valueTo:a}=e.validRange,l=this._unitFormatter.getAllowedDelta();if(!Number.isNaN(s)&&i<s-l)return o(new RangeError('Value "'+t+'" is too small, min-val "'+s+'"'));if(!Number.isNaN(a)&&i>a+l)return o(new RangeError('Value "'+t+'" is too big, max-val "'+a+'"'));t="Integer"===r&&"number"==typeof i?i.toFixed():i.toString()}this._sceneManager.cancelDockings(),this._dispatchSetParameter(s,r,t,i,o)})}setParameterOfPlanObject(e,t){return new Promise((n,i)=>{const{planObjectId:o,rootComponentId:s,rootComponentParametersAsGlobal:r}=this._configuratorContext,{type:a,key:l}=e;r?this._plannerKernelAccess.changeComponentParameter(s,l,a,t,n,i):this._plannerKernelAccess.changePlanObjectParameter(o,l,a,t,n,i)})}getParametersOfPlanObject(){const{planObjectId:e,rootComponentParametersAsGlobal:t}=this._configuratorContext;return this._plannerKernelAccess.getGlobalParameters(e,t)}setParameterOfRootComponent(e,t){return new Promise((n,i)=>{const{rootComponentId:o}=this._configuratorContext,{type:s,key:r}=e;this._plannerKernelAccess.changeComponentParameter(o,r,s,t,n,i)})}getParametersOfRootComponent(){const{planObjectId:e}=this._configuratorContext;return this._plannerKernelAccess.getGlobalParameters(e,!0)}enableMultiselect(){this._sceneManager.setSelectionMode("multiselect"),this._configuratorContext.selectionMode="multiselect"}disableMultiselect(){this._sceneManager.setSelectionMode("standard"),this._configuratorContext.selectionMode="standard"}getCurrentConfiguration(){return B.waitFor(1,()=>this._plannerKernelAccess.uiRequestConfiguration(this._configuratorContext.planObjectId))}loadComponentIntoKernel(e){return B.waitFor(0,()=>{let t=null;try{if(t=JSON.parse(e).id,!t)throw new Error("Component string has no ID")}catch(e){return this._configuratorUiCallbacks.onContentProblem({rapiPath:"components",ids:[t],message:"Component string is not a valid JSON or has no ID"}),void B.failOperation(0,e)}this._kernelIo.setMeta({componentId:t}),this._plannerKernelAccess.loadComponentIntoKernel(e,t)})}getShortUrlOfCurrentConfiguration(){return new Promise((e,t)=>{this.saveCurrentConfiguration().then(n=>navigator.onLine?this._rapiAccess.getShortUrl(n.id,3).then(t=>{const n=t.shortId,i=y.APP.SHORTENER_URL+n;e(i)},t):t("Can not generate short url when offline"),t)})}formatValueToUnitString(e,t){return this._unitFormatter.formatValueToUnitString(e,t)}getTagById(e,t){return new Promise((n,i)=>{this._getTag(e).then(e=>{let o=Promise.resolve([]),s=Promise.resolve([]);t&&t.include&&t.include.forEach(t=>{"materials"===t&&(o=this._rapiAccess.getMaterialsOf(e)),"items"===t&&(s=this._rapiAccess.getItems(e.items))}),Promise.all([o,s]).then(([t,i])=>(i.sort(we),t.sort(we),n({...e,items:i,materials:t})),i)},i)})}requestAsset(e){return this._dataSyncer.requestAsset(e)}changeFloorMaterial(e){return this._sceneManager.changeFloorMaterial(e)}async changeFloorMaterialById(e){const t=await this._rapiAccess.getMaterial(e);return this._sceneManager.changeFloorMaterial(t)}openFloorMaterials(){this._configuratorUiCallbacks.onOpenFloorMaterials()}openPartList(){this._configuratorUiCallbacks.onOpenPartList()}getAdditionalContentsOf(e){return this._rapiAccess.getAdditionalContentsOfItems(e)}changeTypeChangeTag(e){navigator.onLine&&this._initData.offlineSync&&this._dataSyncer.syncTypeChangeTag(e),this._configuratorUiCallbacks.onChangeTypeChangeTag(e)}removeTypeChangeTag(e){this._configuratorUiCallbacks.onRemoveTypeChangeTag(e)}showGUI(){this._sceneManager.showGUI()}showStats(){this._sceneManager.showStats()}showDimensions(){this._sceneManager.showDimensions()}hideDimensions(){this._sceneManager.hideDimensions()}syncCatalog(e){return this._dataSyncer.syncCatalog(e)}syncFloorTag(e){return this._dataSyncer.syncFloorTag(e)}syncTypeChangeTag(e){return this._dataSyncer.syncTypeChangeTag(e)}loadDynamicLightSetting(e){return this._sceneManager.loadDynamicLightSetting(e)}setBackgroundColor(e){this._sceneManager.setBackgroundColor(e)}setBackgroundImage(e){this._sceneManager.setBackgroundImage(e)}loadSceneSetting(e){return this._sceneManager.loadSceneSettings(e)}enableMeshSelection(e){this._initData.meshSelection=e}updateSize(){this._sceneManager.updateCamera()}setCameraOffset(e){this._sceneManager.setCameraOffset(e)}getCameraOffset(){return this._sceneManager.getCameraOffset()}getMain(){}cleanup(e={}){this._configuratorContext.selectedRuntimeComponentIds=[],this._plannerKernelAccess.cleanUpCallbacks(),this._sceneManager.sceneCleared(!!e.resetMeshCache),e.resetCoreCache&&this._plannerKernelAccess.kernelInstance.clearAll(),e.resetApiCache&&this._rapiAccess.cleanUp()}resumeTest(e){e&&this._domHelper.setDomElement(e),this._lifeCycleManager.resume()}pauseTest(){this._lifeCycleManager.pause()}zoomIn(e){this._sceneManager.zoomIn(e)}zoomOut(e){this._sceneManager.zoomOut(e)}get callbacks(){return this._configuratorUiCallbacks}get globalCallbacks(){return this._globalCallback}getRuntimeComponentIdOfRootComponent(){const e=this._configuratorContext.planObjectId;return e?this._plannerKernelAccess.getRuntimeComponentIdOfRootComponent(e):(console.warn("planObjectId not set"),0)}getCurrentConfigurationHash(){return this._plannerKernelAccess.getConfigurationHash(this._configuratorContext)}getCurrentSelection(){let e=this._configuratorContext.selectedRuntimeComponentIds;return e&&e.length||(e=[this._configuratorContext.rootComponentId]),e.map(e=>this._plannerKernelAccess.getRuntimeComponentId(e))}isReady(){const e=k.getMeasure("kernel_is_ready");if(Array.isArray(e)&&1===e.length){const t=e[0],n=k.getMeta("kernel_is_ready");this._configuratorUiCallbacks.onTrackTiming("Timing","KernelIsReady",Math.round(t.duration),Object.assign(n,{startTime:t.startTime}))}this._isKernelReady=!0,this._checkInitDone(),"function"==typeof this._configuratorUiCallbacks.onKernelIsReady&&this._configuratorUiCallbacks.onKernelIsReady()}async updatePossibleChildren(e,t,n){const i=await this._addAdditionalInfoToPossibleChildren(e,t,n);if(i){const{tags:e,defaultChild:t}=i;this._shouldBroadcastToUi(n)&&this._configuratorUiCallbacks.onUpdatePossibleChildren(e,t)}}updateParameters(e,t,n,i){this._setParameterTooltip(e,n),this._addGroupsToParameters(n,e,t,i),this._shouldBroadcastToUi(i)&&this._configuratorUiCallbacks.onUpdateParameters(e)}loadError(e){this._isLoadError=!0,this._rejectOnLoadError&&this._rejectOnLoadError(e)}resumeKernelCallbacks(){this._plannerKernelAccess.muteKernelCallbacks=!1,this._plannerKernelAccess.resume()}pauseKernelCallbacks(){this._plannerKernelAccess.muteKernelCallbacks=!0,this._plannerKernelAccess.pause()}setActiveGroupInView(e){this._plannerKernelAccess.setActiveGroupInView(e)}setActiveGroupInViewForPlanObject(e,t){this._plannerKernelAccess.setActiveGroupInViewForPlanObject(e,t)}getParameterGroups(){return this._plannerKernelAccess.getParameterGroups()}async getConfiguratorSettings(e){return this._rapiAccess.getConfiguratorSettings(e)}async moveCamera(e){return this._sceneManager.moveCamera(e)}selectComponent(e){return this._configuratorContext.selectedRuntimeComponentId===e?Promise.resolve():Promise.resolve(this._sceneManager.selectComponent(e))}setComponentParameter(e,t,n){const{key:i,type:o}=t;return new Promise((t,s)=>this._plannerKernelAccess.changeComponentParameter(e,i,o,n,t,s))}highlightParts(e){this._sceneManager.highlightParts(e)}undo(){return new Promise((e,t)=>{const n=this._configuratorHistory.undo();n&&(this._callOnPartListUpdate().then(e,t),this._plannerKernelAccess.loadConfiguration(n))})}redo(){return new Promise((e,t)=>{const n=this._configuratorHistory.redo();n&&(this._callOnPartListUpdate().then(e,t),this._plannerKernelAccess.loadConfiguration(n))})}clearHistory(){this._configuratorHistory.clearHistory()}getHashOfSerializedConfiguration(e){return this._plannerKernelAccess.kernelInstance.getHashOfSerializedConfiguration(e)}getParametersOfComponent(e){const t=this._plannerKernelAccess.kernelInstance.getComponentParameters(e),n=this.getParameterGroups();return this._mapComponentTooltipsToParamKeys(t,e),this._addGroupsToParameters(e,t,n,1,!0)}_mapComponentTooltipsToParamKeys(e,t){const n=this._plannerKernelAccess.kernelInstance.getComponentId(t),i=this._rapiAccess.peekComponent(n);if(i&&i.additionalInfos)for(const t of e){const e=i.additionalInfos.find(e=>e.key.toLocaleLowerCase()===t.key.toLocaleLowerCase()&&"parameter"===e.type);e&&(t.tooltip=e.tooltip)}}_setParameterTooltip(e,t){Array.isArray(t)?t.forEach(t=>this._mapComponentTooltipsToParamKeys(e,t)):this._mapComponentTooltipsToParamKeys(e,t)}_addGroupsToParameters(e,t,n,i,o=!1){n||(n=[],console.warn("Kernel returned no parameter groups! Check why!"));const s={};return n.forEach(e=>{s[e.key]=e}),t.sort(we),t.forEach(t=>{t.group?t.grouping=s[t.group]:t.grouping=null,this._unitFormatter.formatParameter(t),G(t)&&Object.defineProperty(t,"groups",{get:()=>new Promise((n,s)=>{this._getMaterialGroups(t).then(t=>{this._isCorrectResponse(i,e)&&this._shouldBroadcastToUi(i)||o?n(t):s("Response does not match to ids")},s)})})}),t}async _getChildrenOf(e,t,n,i){const o=i(e,t,n);return await this._addAdditionalInfoToPossibleChildren(e,o,2,!1,!0)}async getChildrenOfPlanComponent(e,t=!1,n=!1){const i=this._plannerKernelAccess.kernelInstance.getChildrenOfPlanComponent.bind(this._plannerKernelAccess.kernelInstance);return this._getChildrenOf(e,t,n,i)}async getChildrenOfPlanObject(e=!1,t=!1){const{planObjectId:n}=this._configuratorContext,i=this._plannerKernelAccess.kernelInstance.getChildrenOfPlanObject.bind(this._plannerKernelAccess.kernelInstance);return this._getChildrenOf(n,e,t,i)}async _addAdditionalInfoToPossibleChildren(e,t,n,i=!0,o=!1){const{possibleChildren:s,defaultChild:r}=await this._getPossibleChildrenForKernelPossibleChildren(t,o),a=[],l=new Map,c=[];if(s.forEach(e=>{const t=e.tags;if(e.tags&&Array.isArray(e.tags)&&e.tags.length)for(let n=0,i=e.tags.length;n<i;n++){const i=t[n];-1===a.indexOf(i)&&a.push(i);let o=l.get(i);if(!o){const e=[];l.set(i,e),o=l.get(i)}o.push(e)}else c.push(e)}),this._isCorrectResponse(n,e)||!i){let e;try{e=await this._rapiAccess.getTags(a)}catch(e){console.error("Couldnt load tags of possible children"),console.error(e)}return e.forEach(e=>{e.possibleChildren=l.get(e.id)}),e.sort(we),c.length&&e.unshift({id:"",externalIdentifier:"",global:!1,created:(new Date).toISOString(),updated:(new Date).toISOString(),language:this._globalInitData.locale,catalog:null,tags:[],parents:[],materials:[],items:[],possibleChildren:c}),{tags:e,defaultChild:r}}return null}async _getPossibleChildrenForKernelPossibleChildren(e,t=!1){const n=[],i=[];let o;const s=new Map,r=new Map;e.forEach(e=>{if(!e.possible&&!t)return;let a=e.itemId;e.itemId?(i.push(e.itemId),r.set(e.itemId,e)):(n.push(e.componentId),s.set(e.componentId,e),a=e.componentId),e.isDefault&&!o&&(o=a)});const a=await Promise.all([this._rapiAccess.getComponents(n),this._rapiAccess.getItems(i)]),l=a[0],c=a[1],h=[];let d=null;return l.forEach(e=>{e.isItem=!1,e.isComponent=!0;const t=s.get(e.id);t&&(e.group=t.group,e.possible=t.possible),e.id===o&&(e.isDefault=!0,d=e),h.push(e)}),c.forEach(e=>{e.isItem=!0,e.isComponent=!1;const t=r.get(e.id);t&&(e.group=t.group,e.possible=t.possible),e.id===o&&(e.isDefault=!0,d=e),h.push(e)}),h.sort(we),{possibleChildren:h,defaultChild:d}}getUnitFormatter(){return this._unitFormatter}getComponent(e){return this._sceneManager.getComponent(e)}async getTools(){const e=P.lookup("roomle-tools-core",this._creator_);return await e.init(),e}exportImageFromCamera(e="image"){this._sceneManager.exportImageFromCamera(e)}calcPartsPriceSum(e){return this._plannerKernelAccess.calcPartsPriceSum(e)}async generateProductionServiceExport(e=""){return this.generateExport(0,e)}async generateTCExport(e=""){return this.generateExport(0,e)}async generateIMOSiXExport(e=""){return this.generateExport(1,e)}async generateExport(e,t=""){const n=this._configuratorContext.planObjectId;try{return this._plannerKernelAccess.configurationExporter.setDefaultExportDataDefinition(t),Promise.resolve(JSON.parse(this._plannerKernelAccess.configurationExporter.generateExport(e,n,this._plannerKernelAccess.kernelInstance)))}catch(t){return console.error(t),Promise.reject("Could not create export JSON "+e)}}setEnvironmentMap(e){const{url:t,intensity:n,rotation:i,maxLightSources:o}=e;this._sceneManager.setEnvironmentMap(t,n,i,o)}}e("R",Pe),n([i],Pe.prototype,"_rapiAccess",void 0),n([i],Pe.prototype,"_dataSyncer",void 0),n([i],Pe.prototype,"_errorHandler",void 0),n([i],Pe.prototype,"_unitFormatter",void 0),n([i],Pe.prototype,"_domHelper",void 0),n([i],Pe.prototype,"_configuratorUiCallbacks",void 0),n([i],Pe.prototype,"_configuratorKernelAccessCallback",void 0),n([i],Pe.prototype,"_lifeCycleManager",void 0),n([i],Pe.prototype,"_plannerKernelAccess",void 0),n([i],Pe.prototype,"_scriptLoader",void 0),n([i],Pe.prototype,"_configuratorContext",void 0),n([i],Pe.prototype,"_initData",void 0),n([i],Pe.prototype,"_globalInitData",void 0),n([i],Pe.prototype,"_globalCallback",void 0),n([i],Pe.prototype,"_kernelIo",void 0),n([i],Pe.prototype,"_configuratorHistory",void 0)}}}));
|
|
2
|
-
//# sourceMappingURL=roomle-configurator-7291a081.legacy.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"roomle-configurator-7291a081.legacy.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
System.register(["./roomle-dependency-injection-39c6c926.legacy.js","./main-thread-to-worker-334452db.legacy.js"],(function(t,e){var i,n,s,a,o,r,h,c,_,d,l,m,u,p,g,v,f,w,y,C,P,x,b,S,M,E,L,D,k,I,z,T,R,A,B,O,F,U,H,q,G,j,Z,N,W,Y,V,K,X,Q,J,$,tt,et,it,nt,st,at,ot,rt,ht,ct,_t,dt,lt,mt,ut,pt,gt,vt,ft,wt,yt,Ct,Pt,xt,bt;return{setters:[function(t){i=t._,n=t.i,s=t.E,a=t.t,o=t.Q,r=t.T,h=t.U,c=t.w,_=t.y,d=t.V,l=t.X,m=t.Y,u=t.Z,p=t.$,g=t.a0,v=t.a1,f=t.a2,w=t.a3,y=t.a4,C=t.e,P=t.a5,x=t.a6,b=t.a7,S=t.s,M=t.p,E=t.x},function(t){L=t.a,D=t.bK,k=t.W,I=t.V,z=t.bM,T=t.ai,R=t.ah,A=t.an,B=t.Q,O=t.au,F=t.O,U=t.G,H=t.bN,q=t.bO,G=t.bP,j=t.aa,Z=t.bQ,N=t.C,W=t.t,Y=t.y,V=t.Y,K=t.X,X=t.aL,Q=t.S,J=t.A,$=t.D,tt=t.R,et=t._,it=t.e,nt=t.f,st=t.bR,at=t.b2,ot=t.h,rt=t.bf,ht=t.j,ct=t.bS,_t=t.w,dt=t.B,lt=t.H,mt=t.bT,ut=t.b1,pt=t.b4,gt=t.b9,vt=t.ao,ft=t.ad,wt=t.bU,yt=t.bL,Ct=t.bG,Pt=t.k,xt=t.bq,bt=t.bV}],execute:function(){t("T","static/Tween-d57ee5d181fce582.js");class St extends s{constructor(t,e,i){if(super(),this._tweenEnd=null,this._cameraStandingStill=!0,this._pitch=a(10),this._yaw=a(-30),this._distance=-1,this._locked=!1,this._inputListeners=[],this._lerpEnabled=!0,this._creator_=t,this._inputManager=e,this._initInputListener(),this._addInputListeners(),this._cameraPosition=new L,this._targetPosition=new L,i?this._cameraPosition.copy(i):this._cameraPosition=new L(0,.5,3),this._initData.debug){const t=this.getDebugCameraPosition();t&&this._setCurrentCameraParameters(t)}let n=this._domHelper.getClientDimensions();this._width=n.x,this._height=n.y,this._dispatchCameraIdle=D(this._dispatchCameraIdle.bind(this),32)}getCamera(){return this._getCamera()}_addInputListeners(){this._inputListeners.forEach(t=>{this._inputManager.addEventListener(t.key,t.fun,this)})}_removeInputListeners(){this._inputListeners.forEach(t=>{this._inputManager.removeEventListener(t.key,t.fun)}),this._inputListeners=[]}cleanUp(){this._removeInputListeners()}animateCamera(t){let e=this._cameraPosition;if(!e||o(e,this.getCamera().position))return this._cameraStandingStill||(this._cameraStandingStill=!0,setTimeout(()=>this._dispatchCameraIdle(),16),this._initData.debug&&this.saveDebugCameraPosition()),!1;if(this._cameraStandingStill&&this.dispatchEvent(7,3),this._cameraStandingStill=!1,this._lerpEnabled&&!this._tweenEnd){let i=this.getCamera().position.clone();const n=Math.min(10*t,1);i.lerp(e,n),this.getCamera().position.copy(i)}else this.getCamera().position.copy(e);return!0}getDebugCameraPosition(){return JSON.parse(localStorage.getItem("debug_camera_position"))}saveDebugCameraPosition(){localStorage.setItem("debug_camera_position",JSON.stringify(this.getCurrentCameraParameters()))}_dispatchCameraIdle(){this.dispatchEvent(8,3)}_tweenCameraParameter(t,e,i=!1){return new Promise(n=>{if(e.yaw-t.yaw<=-Math.PI?t.yaw-=2*Math.PI:e.yaw-t.yaw>=Math.PI&&(t.yaw+=2*Math.PI),window.TWEEN){if(null!==this._tweenEnd&&this._tweenEnd.blockOtherTweens)return;this._tweenEnd=e,new TWEEN.Tween(t).to(e,400).easing(TWEEN.Easing.Sinusoidal.In).onUpdate(()=>{this.dispatchEvent(1,3),this._yaw=t.yaw,this._pitch=t.pitch,this._distance=t.distance,this._setCameraNear(),this._update(new L(t.targetX,t.targetY,t.targetZ),i)}).onComplete(()=>{this.dispatchEvent(2,3),this._dispatchCameraIdle(),this._tweenEnd=null,n()}).start(),this.dispatchEvent(0,3)}})}_setCameraNear(){const t=this.getCamera();if(t instanceof k){const e=Math.max(.1,this._distance/6);t.near=e}}getCurrentCameraParameters(){const t=this._targetPosition.clone();return{yaw:this._yaw,pitch:this._pitch,distance:this._distance,targetX:t.x,targetY:t.y,targetZ:t.z}}_setCurrentCameraParameters(t){this._yaw=t.yaw,this._pitch=t.pitch,this._distance=t.distance,this._targetPosition.copy(new L(t.targetX,t.targetY,t.targetZ))}_rotateHorizontal(t){this._yaw-=t,this._yaw<-Math.PI?this._yaw+=2*Math.PI:this._yaw>Math.PI&&(this._yaw-=2*Math.PI)}_rotateVertical(t){this._pitch+=t,this._pitch<-Math.PI?this._pitch+=2*Math.PI:this._pitch>Math.PI&&(this._pitch-=2*Math.PI)}saveState(t){if(t||!this._stateSaved){let t=this._yaw,e=this._pitch,i=this._distance,n=this._targetPosition.clone();if(this._stateSaved={yaw:t,pitch:e,distance:i,targetX:n.x,targetY:n.y,targetZ:n.z,blockOtherTweens:!0},this._getCamera().fov){let t=this._getCamera();this._stateSaved.fov=t.fov,this._stateSaved.near=t.near,this._stateSaved.far=t.far}return this._stateSaved}return null}resetToState(){if(this._stateSaved){this._stateSaved.blockOtherTweens=!1;let t=this._targetPosition.clone();this._tweenCameraParameter({yaw:this._yaw,pitch:this._pitch,distance:this._distance,targetX:t.x,targetY:t.y,targetZ:t.z},this._stateSaved,!0)}this._stateSaved=null}setToState(t,e){this._tweenCameraParameter(t,e,!0)}hasSavedState(){return null!=this._stateSaved}lock(){this._locked=!0}unlock(){this._locked=!1}isLocked(){return this._locked}getTargetPosition(){return this._targetPosition}_saveYawAndPitch(){this._getCamera().userData.yaw=this._yaw,this._getCamera().userData.pitch=this._pitch}getInputPosition(t){const{x:e,y:i}=this._domHelper.getClientDimensions();return new L(t.x/e*2-1,-t.y/i*2+1,.5)}addLightContainer(t){t.name="lights";const e=this._getCamera(),i=e.children.find(t=>"lights"===t.name);i&&e.remove(i),e.add(t)}checkNearFarDistance(t){if(!t)return;const e=this._cameraPosition.distanceTo(t),i=this._getCamera();i instanceof k&&e>i.far&&(i.far=e+1)}setBounds(t){this._boundingBox=t}}t("a",St),i([n],St.prototype,"_domHelper",void 0),i([n],St.prototype,"_initData",void 0);class Mt{constructor(t,e){this.minZoom=!1,this.maxZoom=!1,this.minZoom=t,this.maxZoom=e}}t("D",2.725);class Et extends St{constructor(t,e,i,n){super(t,e,i),this._bounds=new L,this._scale=1,this._state=0,this._zoomSpeed=Math.pow(.95,3),this.minDistance=0,this.maxDistance=5,this.minPolarAngle=a(0),this.maxPolarAngle=a(85),this._objectRotation=0,this.minAzimuthAngle=Number.NEGATIVE_INFINITY,this.maxAzimuthAngle=Number.POSITIVE_INFINITY,this._zoomDistance=.1,this._userInteraction=!1,this._currentZoomHash="",this._maxZoomedIn=!1,this._maxZoomedOut=!1,this._panningEnabled=!1,this._targetPositionIsPanned=!1,n?this._camera=n:this._initCamera(),this._targetPosition||(this._targetPosition=new L(0,0,0),this._targetPositionIsPanned=!1);const{cameraRestriction:s,zoomDistance:o,minVerticalCameraAngle:r,maxVerticalCameraAngle:h,minHorizontalCameraAngle:c,maxHorizontalCameraAngle:_}=this._initData;if(o&&(this._zoomDistance=o/100),void 0!==r&&(this.minPolarAngle=a(r<0?r:-1*r)),void 0!==h&&(this.maxPolarAngle=a(h)),void 0!==c&&(this.minAzimuthAngle=a(c<0?c:-1*c)),void 0!==_&&(this.maxAzimuthAngle=a(_)),void 0!==s){let t=Math.abs(a(s));this.minAzimuthAngle=-t,this.maxAzimuthAngle=t,this.maxPolarAngle=Math.min(t,a(85))}this._update()}_getCamera(){return this._camera||this._initCamera(),this._camera}getCamera(){return super.getCamera()}_initCamera(){this._camera=new k,this._camera.fov=30,this._camera.aspect=this._width/this._height,this._camera.near=.1,this._camera.far=100,this._camera.updateProjectionMatrix(),this._camera.layers.set(3),this._camera.layers.enable(1),this._camera.layers.enable(2),this._camera.layers.enable(6),this._camera.layers.enable(5)}setObjectRotation(t){this._objectRotation=t}getObjectRotation(){return this._objectRotation}updateCamera(){let{x:t,y:e}=this._domHelper.getClientDimensions();this._camera.aspect=t/e,this._camera.updateProjectionMatrix()}animateCamera(t){if(!super.animateCamera(t))return!1;let e=this._targetPosition;return!!e&&(this.getCamera().lookAt(e),!0)}_initInputListener(){this._inputListeners.push({key:3,fun:()=>{this._state=1}}),this._inputListeners.push({key:6,fun:t=>{var e,i;1!==this._state||this._locked||(this._userInteraction=!0,!(void 0!==(null===(e=t.event)||void 0===e?void 0:e.shiftKey)&&(null===(i=t.event)||void 0===i?void 0:i.shiftKey))&&this._panningEnabled&&this.disablePanning(),this._move(new I(t.position.x,t.position.y),t.type))}}),this._inputListeners.push({key:11,fun:t=>{1===this._state||this._locked||(this._userInteraction=!0,this._pan(new I(t.position.x,t.position.y),t.type))}}),this._inputListeners.push({key:4,fun:t=>{1===this._state&&this.dispatchEvent(2,t.type),this._state=0,this._orbitPosition=null,this._lerpEnabled=!0}}),this._inputListeners.push({key:7,fun:({event:t})=>{this._maxZoomedIn||(t&&(t.preventDefault(),t.stopPropagation()),this.zoomIn())}}),this._inputListeners.push({key:8,fun:({event:t})=>{this._maxZoomedOut||(t&&(t.preventDefault(),t.stopPropagation()),this.zoomOut())}})}_panTargetPosition(t){const e=t.clone().sub(this._orbitPosition),i=this._domHelper.element,n=this._targetPosition.project(this._camera),s=Math.max(2,4*(1-this._distance/this.maxDistance));n.x=n.x-e.x/i.clientHeight*s,n.y=n.y+e.y/i.clientHeight*s,this._targetPositionIsPanned=!0,this._targetPosition.copy(n.unproject(this._camera))}_pan(t,e){this._lerpEnabled=!1,this._orbitPosition||(this._orbitPosition=new I(t.x,t.y),this.dispatchEvent(0,e)),this._panTargetPosition(t),r(this._orbitPosition,t)||this.dispatchEvent(1,e),this._orbitPosition.copy(t),this._update()}_move(t,e){this._orbitPosition||(this._orbitPosition=new I(t.x,t.y),this.dispatchEvent(0,e));const i=t.clone().sub(this._orbitPosition),n=this._domHelper.element;this._panningEnabled?this._panTargetPosition(t):(this._rotateHorizontal(2*Math.PI*i.x/n.clientWidth*1),this._rotateVertical(2*Math.PI*i.y/n.clientHeight*1)),r(this._orbitPosition,t)||this.dispatchEvent(1,e),this._orbitPosition.copy(t),this._update()}checkBoundsAndPlaceCamera(t,e=!0){this._boundingBox&&h(t,this._boundingBox)<=0?this.setBounds(t):this.zoomToFitBounds(t,e)}zoomToFitBounds(t,e=!0){this.setBounds(t);const i=t.getSize(new L);if(this._initData.debug||i.x+i.y+i.z===0)return;const n=this.getCurrentCameraParameters(),s=t.getCenter(new L),a=this._setDistanceAndRangesBasedOnBounds(i);this._checkZoomDistance(t,a);const o={yaw:e?this._yaw:n.yaw,pitch:e?this._pitch:n.pitch,distance:a,targetX:s.x,targetY:s.y,targetZ:s.z};z(n,o)||this._tweenCameraParameter(n,o,!1)}updateToBounds(t,e,i=!0,n){if(this.setBounds(t),this._initData.debug)return;const s=t.getCenter(new L);n?(this._targetPosition=n.clone(),this._targetPositionIsPanned=!1):this._targetPositionIsPanned||(this._targetPosition=new L(s.x,s.y,s.z));const a=this.getCurrentCameraParameters(),o=t.getSize(new L);if(i){const i=this._setDistanceAndRangesBasedOnBounds(o);this._distance=i,this._checkZoomDistance(t,i),this._userInteraction?this._tweenCameraParameter(a,{yaw:this._yaw,pitch:this._pitch,distance:this._distance,targetX:this._targetPosition.x,targetY:this._targetPosition.y,targetZ:this._targetPosition.z},e):this._update()}else this._setDistanceAndRangesBasedOnBounds(o,!1);this._update()}_checkZoomDistance(t,e){const i=t.getBoundingSphere(new T);e-i.radius<this._zoomDistance&&(console.warn("the initial camera position is closer than the zoomDistance param, zoomDistance is set to initial camera position."),this._zoomDistance=e-i.radius)}_setDistanceAndRangesBasedOnBounds(t,e=!0){const{offsetWidth:i,offsetHeight:n}=this._getOffset();this._bounds.copy(t);const{cameraSpacing:s}=this._initData;t.addScalar(s/100),this.minDistance=Math.sqrt(t.x*t.x+t.y*t.y+t.z*t.z);const a=Math.max(t.x,t.y),{x:o,y:r}=this._getMargin(i,n),h=c(t.x+o,t.y+r,t.z,this._camera.fov,i,n);return this._distance<h&&e&&(this._distance=h),this.maxDistance=h+a,this.maxDistance<2&&(this.maxDistance=2),this._camera.far=5*this.maxDistance,this._setCameraNear(),h}_getIdealDistance(){const{offsetWidth:t,offsetHeight:e}=this._getOffset(),{x:i,y:n}=this._getMargin(t,e);return c(this._bounds.x+i,this._bounds.y+n,this._bounds.z,this._camera.fov,t,e)}_getOffset(){const t=this._domHelper.getClientDimensions(),e=t.x,i=t.y;return{offsetWidth:this._camera.offset?e-e*this._camera.offset.left-e*(1-this._camera.offset.right):e,offsetHeight:this._camera.offset?i-i*this._camera.offset.bottom-i*(1-this._camera.offset.top):i}}_getMargin(t,e){let i=this._bounds.x/2,n=this._bounds.y/2;return t>1080&&(i+=this._bounds.x<.3?.2:0,i+=this._bounds.x*(t/1080-1)),e>1080&&(i+=this._bounds.y<.3?.2:0,n+=this._bounds.y*(e/1080-1)),{x:i,y:n}}reset(t,e,i,n,s=!0){const o=t.getSize(new L);if(o){if(e)this._targetPosition.copy(e);else{const e=t.getCenter(new L);this._targetPosition.copy(e)}const r=this.getCurrentCameraParameters();if(i||(i=-30),n||(n=10),i+=_(this._objectRotation),this._initData.debug)return this._distance=this._setDistanceAndRangesBasedOnBounds(o),this._update(this._targetPosition),void this._setDistanceAndRangesBasedOnBounds(o);const h=this._setDistanceAndRangesBasedOnBounds(o),c=a(n),d=a(i);let l=this._targetPosition.clone();s?this._tweenCameraParameter(r,{yaw:d,pitch:c,distance:h,targetX:l.x,targetY:l.y,targetZ:l.z},!0):(this._pitch=c,this._yaw=d,this._distance=h,this._update(this._targetPosition))}else console.warn("you cant reset without bounds!")}updateAndReset(t,e,i,n,s,o=!0){const r=new L(-t.x/2,0,-t.z/2),h=new L(t.x/2,t.y,t.z/2);if(this._boundingBox=new R(r,h),s&&t.addScalar(s),e?this._targetPosition.copy(e):(this._targetPosition=new L(0,t.y/2,0),this._targetPositionIsPanned=!1),-1===this._distance){const e=this._setDistanceAndRangesBasedOnBounds(t);this._distance=Math.max(2,e)}const c=this.getCurrentCameraParameters();i||(i=-30),n||(n=10),i+=_(this._objectRotation),this._pitch=a(n),this._yaw=a(i),this._setDistanceAndRangesBasedOnBounds(t);let d=this._targetPosition.clone();o?this._tweenCameraParameter(c,{yaw:this._yaw,pitch:this._pitch,distance:this.maxDistance,targetX:d.x,targetY:d.y,targetZ:d.z},!0):this._update(this._targetPosition)}_update(t,e){this._initData.debug?this._pitch=Math.max(a(-89),Math.min(a(89),this._pitch)):(this._yaw=Math.max(this.minAzimuthAngle,Math.min(this.maxAzimuthAngle,this._yaw)),this._pitch=Math.max(this.minPolarAngle,Math.min(this.maxPolarAngle,this._pitch))),this._saveYawAndPitch();const i=new A(-this._pitch,this._yaw,0,"ZYX"),n=(new B).setFromEuler(i),s=new L(0,0,-1);s.applyQuaternion(n),this._distance*=this._scale,this._initData.debug||(this._distance=Math.min(this.maxDistance,this._distance)),t&&this._targetPosition.copy(t);const o=this._targetPosition.clone().sub(s.multiplyScalar(this._distance));if(this._initData.debug)this._cameraPosition.copy(o),this._zoomChanged(!1,!1);else if(e)this._cameraPosition.copy(o);else{const t=this._getCameraSphere(o);null!=this._boundingBox&&this._boundingBox.intersectsSphere(t)&&this._scale>=1?this._distance+=.1:null==this._boundingBox||this._boundingBox.intersectsSphere(t)?this._zoomChanged(!1,!0):(this._cameraPosition.copy(o),this._distance===this.maxDistance?this._zoomChanged(!0,!1):this._zoomChanged(!1,!1))}this._scale=1}_zoomChanged(t,e){let i=t+""+e;0===this._currentZoomHash.length||this._currentZoomHash!==i?(this.dispatchEvent(5,new Mt(t,e)),this._currentZoomHash=i):t||e||this.dispatchEvent(5,new Mt(t,e)),this._maxZoomedIn=e,this._maxZoomedOut=t}zoomTo(t){return this._tweenCameraParameter(this.getCurrentCameraParameters(),t,!0)}_getCameraSphere(t){const e=Math.max(this._bounds.x,this._bounds.y),i=Math.max(e/10,this._zoomDistance);return new T(t,i)}zoomIn(t){this._lerpEnabled=!0,this._scale*=t?Math.pow(.95,t):this._zoomSpeed,this._setCameraNear(),this._update(),this.dispatchEvent(3)}zoomOut(t){this._lerpEnabled=!0,this._scale/=t?Math.pow(.95,t):this._zoomSpeed,this._setCameraNear(),this._update(),this.dispatchEvent(4)}clear(){this._userInteraction=!1,this._initData.debug||(this._distance=-1,this._targetPosition=new L(0,0,0),this._targetPositionIsPanned=!1)}async moveCamera(t){const{x:e,y:i,z:n}=this._boundingBox.getCenter(new L);t.targetX=t.targetX||e,t.targetY=t.targetY||i,t.targetZ=t.targetZ||n,t.distance=t.distance||this._getIdealDistance();const s=this.getCurrentCameraParameters(),a=O(JSON.parse(JSON.stringify(s)),t);return this._tweenCameraParameter(s,a,!0)}enablePanning(){this._lerpEnabled=!1,this._panningEnabled=!0}disablePanning(){this._lerpEnabled=!1,this._panningEnabled=!1}getKernelZoomFactor(){const t=this.maxDistance;return 1-this._distance/(t-2)+.2}}t("C",Et);class Lt{constructor(t,e){this._scene=t,e&&(e.removeFromScene(),e.cleanUp())}updateCamera(t){}reload(){this.removeFromScene(),this.addToScene()}updateBounds(t,e){this._bounds=t}cleanUp(){this._scene=null}}class Dt{constructor(t){this._innerSize=1,this._outerSize=100,this._plane=new F,this._plane.rotation.x=-Math.PI/2;const e=d.createMeshStandardMaterial({});this._innerPlaneMesh=new U,this._innerPlaneMesh.layers.set(2),this._innerPlaneMesh.material=e,this._innerPlaneMesh.receiveShadow=!0,this._outerPlaneMesh=new U,this._outerPlaneMesh.layers.set(2),this._outerPlaneMesh.material=e,this._outerPlaneMesh.receiveShadow=!0,this._plane.add(this._innerPlaneMesh),this._plane.add(this._outerPlaneMesh),this._innerSize=1,this._outerSize=t,this._updatePlane(this._innerSize,this._outerSize)}getRootNode(){return this._plane}getInnerPlane(){return this._innerPlaneMesh}getOuterPlane(){return this._outerPlaneMesh}updateSize(t){this._innerSize=t,this._updatePlane(this._innerSize,this._outerSize)}_updatePlane(t,e){const i=new H;i.moveTo(-t/2,-t/2),i.lineTo(-t/2,t/2),i.lineTo(t/2,t/2),i.lineTo(t/2,-t/2),i.lineTo(-t/2,-t/2);const n=new H;n.moveTo(-e/2,-e/2),n.lineTo(-e/2,e/2),n.lineTo(e/2,e/2),n.lineTo(e/2,-e/2),n.lineTo(-e/2,-e/2);const s=new q;s.moveTo(-t/2,-t/2),s.lineTo(-t/2,t/2),s.lineTo(t/2,t/2),s.lineTo(t/2,-t/2),s.lineTo(-t/2,-t/2),n.holes.push(s);const a=new G(i);this._innerPlaneMesh.geometry&&this._innerPlaneMesh.geometry.dispose(),this._innerPlaneMesh.geometry=a;const o=new G(n);this._outerPlaneMesh.geometry&&this._outerPlaneMesh.geometry.dispose(),this._outerPlaneMesh.geometry=o;const r=a.attributes.uv.clone();a.setAttribute("uv2",r);const h=a.attributes.uv2.array;for(let t=0;t<h.length;++t)h[t]+=.5}}class kt extends Lt{constructor(t,e,i){super(t,e),this._longestSide=2,this._bakedShadowPlane=new Dt(100),this._fog=i||!1,this._textureLoader=new j,this.addToScene()}needsBounds(){return!0}needsCamera(){return this._fog}needsRotation(){return!1}updateBounds(t){return super.updateBounds(t),this._longestSide=Math.max(t.x,t.z),this._update(),!0}updateCamera(t){this._cameraDistance=t.position.distanceTo(new L(0,0,0)),this._update()}_update(){this._fog&&this._updateFog()}_updateFog(){let t=this._longestSide/2;this._scene.fog=new Z(16185078,this._cameraDistance+t+3,this._cameraDistance+t+3+1),this._scene.background=new N(16185078)}_updateFloor(){if(this._floorMaterial)this._bakedShadowPlane.getOuterPlane().material=this._floorMaterial,this._bakedShadowPlane.getInnerPlane().material=this._floorMaterial;else{let t=this._width/1e3,e=this._height/1e3;this._repeatable&&(this._floorTexture.wrapS=W,this._floorTexture.wrapT=W,this._floorTexture.repeat.set(100/t,100/e));let i=d.createMeshStandardMaterial({map:this._floorTexture,side:Y});this._bakedShadowPlane.getInnerPlane().material=i,this._bakedShadowPlane.getOuterPlane().material=i}}addToScene(){this._scene&&this._scene.add(this._bakedShadowPlane.getRootNode())}removeFromScene(){this._scene.remove(this._bakedShadowPlane.getRootNode())}setFloorMaterial(t,e,i,n){return this._width=e,this._height=i,this._repeatable=n,this._floorPromise=new Promise((e,i)=>{this._textureLoader.load(t,t=>{this._floorTexture=t,e()},null,i)}),new Promise((t,e)=>{this._floorPromise.then(()=>{this._updateFloor(),this._update(),t()},e)})}changeFloorMaterial(t,e){this._floorPromise=new Promise((i,n)=>{this._floorMaterial=l(t),this._rapiAccess.getTexturesOf(t).then(t=>{if(t.length>0){let s=[];t.forEach(t=>{s.push(m(this._dataSyncer.requestAsset(t.image,!0),t,this._floorMaterial,e,1,1))}),Promise.all(s).then(()=>{setTimeout(()=>i(),0)},n)}else setTimeout(()=>i(),0)})});let i=[this._floorPromise];return new Promise((t,e)=>{Promise.all(i).then(()=>{this._updateFloor(),this._update(),t()},e)})}showGUI(){this._floorMaterial?this._addGUI():this._floorPromise&&this._floorPromise.then(()=>this._addGUI())}_addGUI(){let t=u();if(!t)return;let e=t.addFolder("Floor");e.add(this._floorMaterial,"roughness").min(0).max(1).step(.01),e.add(this._floorMaterial,"reflectivity").min(0).max(1).step(.01),e.add(this._floorMaterial,"clearCoat").min(0).max(1).step(.01),e.add(this._floorMaterial,"clearCoatRoughness").min(0).max(1).step(.01),e.add(this._floorMaterial,"opacity").min(0).max(1).step(.01),e.add(this._floorMaterial,"metalness").min(0).max(1).step(.01),e.add(this._floorMaterial,"bumpScale").min(0).max(1).step(.01)}}t("F",kt),i([n],kt.prototype,"_rapiAccess",void 0),i([n],kt.prototype,"_dataSyncer",void 0);class It extends St{constructor(t,e,i,n){super(t,e,i),this._scale=1,this._cameraZoom=1,this._state=0,this._size=5,this._lastPosition=new I,this._zoomPosition=new L,this._lastZoom=0,this._zoomSpeed=Math.pow(.95,2),n?(this._camera=n,this._cameraPosition=(new L).copy(this._camera.position)):this._initCamera(i||new L(0,10,0))}_getCamera(){return this._camera||this._initCamera(new L(0,10,0)),this._camera}_initCamera(t){let{x:e,y:i}=this._domHelper.getClientDimensions(),n=e/i*this._size,s=this._size;this._camera=new V(n/-2,n/2,s/2,s/-2,1,1e3),this._camera.position.copy(t),this._cameraPosition=t,this._camera.lookAt(new L(0,0,0))}updateCamera(){let{x:t,y:e}=this._domHelper.getClientDimensions(),i=t/e*this._size,n=this._size;this._camera.left=i/-2,this._camera.right=i/2,this._camera.top=n/2,this._camera.bottom=n/-2,this._camera.updateProjectionMatrix()}_initInputListener(){this._inputListeners.push({key:3,fun:t=>{this._locked||(this._state=1,this._lastPosition.set(t.positionRelative.x,t.positionRelative.y),this.dispatchEvent(0))}}),this._inputListeners.push({key:6,fun:t=>{1!==this._state||this._locked||(this._move(new I(t.positionRelative.x,t.positionRelative.y),t.type),this.dispatchEvent(1))}}),this._inputListeners.push({key:4,fun:t=>{1===this._state&&this.dispatchEvent(2),this._state=0}}),this._inputListeners.push({key:7,fun:t=>{t.event&&(t.event.stopPropagation(),t.event.preventDefault()),this.dispatchEvent(3),this._scale/=this._zoomSpeed,this._zoomTo(t.positionRelative),this._update()}}),this._inputListeners.push({key:8,fun:t=>{t.event&&(t.event.stopPropagation(),t.event.preventDefault()),this.dispatchEvent(4),this._scale*=this._zoomSpeed,this._zoomTo(t.positionRelative),this._update()}})}_zoomTo(t){if(Date.now()-this._lastZoom>200){let e=new L(t.x,t.y,0);e.unproject(this._camera),this._zoomPosition.copy(e)}this._lastZoom=Date.now()}_move(t,e){let i=new L,n=new L(this._lastPosition.x,this._lastPosition.y,0),s=new L(t.x,t.y,0);n.unproject(this._camera),s.unproject(this._camera),i.subVectors(s,n),this._cameraPosition.x-=i.x*(2===e?1.1:1),this._cameraPosition.z-=i.z*(2===e?1.1:1),this._lastPosition.copy(t)}zoomToFitBounds(t,e,i){if(h(t,this._boundingBox)<0&&!i)return void this.setBounds(t);this.setBounds(t);const n=t.getSize(new L),s=t.getCenter(new L),a=n.x/-2/this._camera.left,o=n.z/-2/this._camera.bottom,r=1/Math.max(a,o);(r<this._cameraZoom||e)&&(this._scale=r,this._cameraZoom=r,this._cameraPosition.x=s.x,this._cameraPosition.z=s.z)}_update(t){this._scale=Math.min(this._scale,5),this._scale=Math.max(this._scale,.1);let e=(new L).subVectors(this._zoomPosition,this._cameraPosition).multiplyScalar((this._scale-this._cameraZoom)/this._scale);this._cameraPosition.x+=e.x,this._cameraPosition.z+=e.z,this._cameraZoom!==this._scale&&this.dispatchEvent(5,new Mt(.1===this._scale,5===this._scale)),this._cameraZoom=this._scale,this._camera.updateProjectionMatrix()}animateCamera(t){if(!super.animateCamera(t)&&Math.abs(this._cameraZoom-this._camera.zoom)<=.01)return!1;const e=Math.min(10*t,1);return this._camera.zoom=K.lerp(this._camera.zoom,this._cameraZoom,e),!0}getKernelZoomFactor(){const t=1e3*(this._camera.right-this._camera.left);return this._domHelper.element.clientWidth/t*this._camera.zoom}}t("b",It);const zt=Math.PI/4;class Tt extends St{constructor(t,e,i,n){super(t,e,i),this._state=0,this._rotationSpeed=1,this._keyMap=new Map,this.minPolarAngle=a(-60),this.maxPolarAngle=a(60),this._camera=n||new k,this._camera.fov=70,this._camera.aspect=this._width/this._height,this._camera.near=.1,this._camera.far=100,this._camera.updateProjectionMatrix(),this._camera.layers.set(3),this._camera.layers.enable(1),this._camera.layers.enable(2),this._camera.layers.enable(6),this._camera.layers.enable(5),i?this._camera.position.set(i.x,1.5,i.z):this._camera.position.set(0,1.5,0),this._cameraPosition=new L,this._cameraPosition.copy(this._camera.position),this._cameraRotation=new B,this._pitch=0,this._yaw=0;let s=new A(-this._pitch,this._yaw,0,"ZYX");this._cameraRotation.setFromEuler(s),window.addEventListener("gamepadconnected",this._gamepadConnected.bind(this)),window.addEventListener("gamepaddisconnected",this._gamepadDisconnected.bind(this))}_gamepadConnected(t){this.startButtonPressListener()}_gamepadDisconnected(t){window.cancelAnimationFrame(this._listenerLoopAnimationFrame)}startButtonPressListener(){this._listenerLoopAnimationFrame=window.requestAnimationFrame(()=>{this.buttonPressListener()})}buttonPressListener(){let t=navigator.getGamepads()[0];this._checkRightStick(t),this._checkLeftStick(t),this._checkButtons(t),this._processKeyMap(this._keyMap,.001),this.startButtonPressListener()}_checkRightStick(t){let e=t.axes[2],i=t.axes[3];Math.abs(e)>.2&&(this._rotateHorizontal(.01*zt*e),this._update(),this.dispatchEvent(1)),Math.abs(i)>.2&&(this._rotateVertical(.01*zt*i),this._update(),this.dispatchEvent(1))}_checkLeftStick(t){let e=t.axes[0],i=t.axes[1];Math.abs(i)>.2?i<0?this._keyMap.set(87,!0):this._keyMap.set(83,!0):t.buttons&&t.buttons[12]&&t.buttons[12].pressed?this._keyMap.set(87,!0):t.buttons&&t.buttons[13]&&t.buttons[13].pressed?this._keyMap.set(83,!0):(this._keyMap.set(87,!1),this._keyMap.set(83,!1)),Math.abs(e)>.2?e<0?this._keyMap.set(65,!0):this._keyMap.set(68,!0):(this._keyMap.set(65,!1),this._keyMap.set(68,!1))}_checkButtons(t){t.buttons&&t.buttons[6]&&t.buttons[6].pressed?this._keyMap.set(16,!0):this._keyMap.set(16,!1),t.buttons&&t.buttons[14]&&t.buttons[14].pressed?(this._keyMap.set(37,!0),this.dispatchEvent(1)):this._keyMap.set(37,!1),t.buttons&&t.buttons[15]&&t.buttons[15].pressed?(this._keyMap.set(39,!0),this.dispatchEvent(1)):this._keyMap.set(39,!1)}animateCamera(t){let e=this._cameraPosition,i=this._cameraRotation,n=this.getCamera(),s=o(e,n.position),a=p(i,n.quaternion);if(!e||s&&a)return!1;let r=this.getCamera().position.clone(),h=Math.min(10*t,1);r.lerp(e,h),this.getCamera().position.copy(r);let c=this.getCamera().quaternion.clone(),_=Math.min(5*t,1);c.slerp(i,_),this.getCamera().setRotationFromQuaternion(c);let d=!1;return this._keyMap.forEach(t=>{t&&(d=!0)}),d&&this._processKeyMap(this._keyMap,t),!0}_getCamera(){return this._camera}_initInputListener(){window.addEventListener("keyup",this._onKeyChanged.bind(this),!1),window.addEventListener("keydown",this._onKeyChanged.bind(this),!1),this._inputListeners.push({key:3,fun:t=>{this._down(t)}}),this._inputListeners.push({key:6,fun:t=>{this._move(t)}}),this._inputListeners.push({key:4,fun:t=>{this._up(t)}})}_down(t){this._downPosition=t.position,this._position=t.position,this._state=1,2===t.type&&window.setTimeout(this._onLongDown.bind(this),350),2===t.type?this._rotationSpeed=.6:this._rotationSpeed=1}_move(t){this._position=t.position,1!==this._state||this._locked||this._orbit(new I(t.position.x,t.position.y)),2!==this._state||this._locked||(this._orbit(new I(t.position.x,t.position.y)),this._moveForward())}_up(t){1===this._state&&this.dispatchEvent(2),2===this._state&&this._keyMap.set(87,!1),this._state=0,this._orbitPosition=null}_onLongDown(){g(this._downPosition,this._position)<v&&1===this._state&&(this._state=2,this._orbit(new I(this._position.x,this._position.y)),this._moveForward())}_update(t){let e=new A(-this._pitch,this._yaw,0,"ZYX");this._cameraRotation.setFromEuler(e)}updateCamera(){let{x:t,y:e}=this._domHelper.getClientDimensions();this._camera.aspect=t/e,this._camera.updateProjectionMatrix()}_onKeyChanged(t){this._keyMap.set(t.keyCode,"keydown"===t.type),this.dispatchEvent(6),this._processKeyMap(this._keyMap,.001)&&t.preventDefault()}_processKeyMap(t,e){e=Math.min(e,.1);let i=new L(0,0,0),n=!1;return this._processUpDown(t,i,e),t.get(65)&&(i.x=-1*e),t.get(68)&&(i.x=1*e),t.get(37)&&(this._rotateHorizontal(-zt*this._rotationSpeed*e),n=!0),t.get(39)&&(this._rotateHorizontal(zt*this._rotationSpeed*e),n=!0),t.get(16)&&(i.x*=3,i.z*=3),!(0===i.x&&0===i.y&&0===i.z&&!n||(i.applyQuaternion(this.getCamera().quaternion),this._cameraPosition.add(new L(i.x,0,i.z)),this._update(),0))}_processUpDown(t,e,i){(t.get(87)||t.get(38))&&(e.z=-1*i),(t.get(83)||t.get(40))&&(e.z=1*i)}_orbit(t){this._orbitPosition||(this._orbitPosition=new I(t.x,t.y),this.dispatchEvent(0));let e=t.clone().sub(this._orbitPosition),i=this._domHelper.element instanceof Document?this._domHelper.element.body:this._domHelper.element;e.multiplyScalar(-1),this._rotateHorizontal(2*Math.PI*e.x/i.clientWidth*1),this._rotateVertical(2*Math.PI*e.y/i.clientHeight*1),r(this._orbitPosition,t)||this.dispatchEvent(1),this._orbitPosition.copy(t),this._update()}_moveForward(){this._keyMap.set(87,!0),this._processKeyMap(this._keyMap,.001)}_rotateVertical(t){let e=this._pitch+t;e>this.maxPolarAngle||e<this.minPolarAngle||(this._pitch=e,this._pitch<-Math.PI?this._pitch+=2*Math.PI:this._pitch>Math.PI&&(this._pitch-=2*Math.PI),this._saveYawAndPitch())}getKernelZoomFactor(){return this._camera.zoom}}t("c",Tt);class Rt extends Lt{constructor(t,e,i,n,s){if(super(t,e),this._color=i,this._oldBackground=t.background,n&&s){this._canvas=n,this._style=document.createElement("style");let t='background-image: url("'+s+'"); background-size: cover;';this._style.innerText=".rml-scene-background {"+t+"}",this._canvas.appendChild(this._style)}}needsBounds(){return!0}needsCamera(){return!1}needsRotation(){return!1}addToScene(){this._scene&&this._color&&(this._scene.background=this._color),this._canvas&&this._canvas.classList&&(this._scene.background=null,this._canvas.classList.add("rml-scene-background"))}removeFromScene(){this._oldBackground&&(this._scene.background=this._oldBackground),this._canvas&&this._canvas.classList.remove("rml-scene-background")}showGUI(){}}t("B",Rt);class At{parse(t,e,i,n,s){let a=JSON.parse(n);return a.environment?this.load(t,e,i,a,s):null}load(t,e,i,n,s){let a,o=n.environment;if(!o)return console.warn("No environment set in scene settings"),Promise.resolve(null);switch(o.type){case"color":a=new Promise(e=>e(new Rt(t,i,new N(o.details.color))));break;case"image":a=new Promise(n=>n(new Rt(t,i,null,e,o.details.imageUrl)));break;case"floor":a=new Promise(e=>{this._rapiAccess.getMaterial(o.details.material).then(n=>{let a=void 0===o.details.fog||o.details.fog,r=new kt(t,i,a);r.changeFloorMaterial(n,s).then(()=>{e(r)})})});break;default:console.warn("Could not load environment, return old environment"),a=new Promise(t=>t(i))}return a}}i([n],At.prototype,"_rapiAccess",void 0);class Bt{constructor(t,e){this._scene=t,e&&e.removeFromScene()}needsBounds(){return!1}updateBounds(t){}getCameraContainer(){return this._cameraContainer||(this._cameraContainer=new F),this._cameraContainer}}t("L",Bt);class Ot extends Bt{constructor(t,e){super(t,e),this._lights=[]}needsBounds(){return!0}updateBounds(t){if(this._cameraLight){const e=this._cameraLight,i=new L;t.getSize(i);const n=1.5*Math.max(Math.max(i.x,i.y),i.z);this._boundingSize=n,e.shadow.camera.top=n/2,e.shadow.camera.bottom=-n/2,e.shadow.camera.left=-n/2,e.shadow.camera.right=n/2,e.shadow.camera.updateProjectionMatrix()}}loadFromJSON(t){return new Promise(e=>{this._lights=this._dynamicLightSettingLoader.parse(t),this.addToScene(),e()})}loadFromObject(t){return new Promise(e=>{(null==t?void 0:t.lights)||e(),this._lights=this._dynamicLightSettingLoader.load(t),this._lights.forEach((t,e)=>{t.userData.movesWithCamera&&(this._cameraLight=t,this._lights.splice(e,1))}),this.addToScene(),e()})}loadFromURL(t){return new Promise((e,i)=>{fetch(new Request(t,{method:"GET"})).then(X).then(t=>this.loadFromObject(t).then(e,i))})}addToScene(){this._lights.forEach(t=>{this._scene.add(t)}),this._cameraLight&&this._scene.add(this._cameraLight)}update(t,e){if(!this._cameraLight)return;let i=new L;t.getWorldDirection(i),i.multiplyScalar(-this._boundingSize);let n=e.clone().add(i);this._cameraLight.position.copy(n)}removeFromScene(){this._lights.forEach(t=>{this._scene.remove(t)}),this._cameraLight&&this._scene.remove(this._cameraLight)}reload(){this.removeFromScene(),this.addToScene()}showGUI(){let t=u();this._cameraLight&&this._addToGUI(t,this._cameraLight),this._lights.forEach(e=>{this._addToGUI(t,e)})}_addToGUI(t,e){t&&(e instanceof Q&&this._addSpotLightToGUI(t,e),e instanceof J&&this._addAmbientLightToGUI(t,e),e instanceof $&&this._addDirectionalLightToGUI(t,e),e instanceof tt&&this._addRectAreaLightToGUI(t,e))}_addRectAreaLightToGUI(t,e){let i=t.addFolder(e.name),n={name:e.name,color:"#"+e.color.getHexString(),intensity:e.intensity*(e.width*e.height)};i.add(e,"visible"),i.add(n,"intensity").min(10).max(400).step(10).onChange(t=>{e.intensity=t/(e.width*e.height)}),i.add(e,"castShadow"),i.addColor(n,"color").onChange(t=>{e.color=new N(t)}),i.add(e.position,"x").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new L(0,0,0))}),i.add(e.position,"y").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new L(0,0,0))}),i.add(e.position,"z").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new L(0,0,0))})}_addSpotLightToGUI(t,e){let i=t.addFolder(e.name),n={name:e.name,color:"#"+e.color.getHexString(),angle:180*e.angle/Math.PI};i.add(e,"visible"),i.add(e,"intensity").min(0).max(5).step(.1),i.add(e,"penumbra").min(0).max(1).step(.1),i.addColor(n,"color").onChange(t=>{e.color=new N(t)}),i.add(n,"angle").min(10).max(180).step(1).onChange(t=>{e.angle=t*Math.PI/180}),i.add(e.position,"x").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new L(0,0,0))}),i.add(e.position,"y").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new L(0,0,0))}),i.add(e.position,"z").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new L(0,0,0))})}_addAmbientLightToGUI(t,e){let i={name:e.name,color:"#"+e.color.getHexString()},n=t.addFolder(e.name);n.add(e,"visible"),n.add(e,"intensity").min(0).max(5).step(.1),n.addColor(i,"color").onChange(t=>{e.color=new N(t)})}_addDirectionalLightToGUI(t,e){let i=t.addFolder(e.name),n={name:e.name,color:"#"+e.color.getHexString()};i.add(e,"visible"),i.add(e,"intensity").min(0).max(5).step(.1),i.addColor(n,"color").onChange(t=>{e.color=new N(t)}),i.add(e,"castShadow"),i.add(e.position,"x").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new L(0,0,0))}),i.add(e.position,"y").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new L(0,0,0))}),i.add(e.position,"z").min(-10).max(10).step(.1).onChange(()=>{e.lookAt(new L(0,0,0))})}}i([n],Ot.prototype,"_dynamicLightSettingLoader",void 0);var Ft=function(t){et(i,t);var e=it(i);function i(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};nt(this,i);var s=t.isCubeTexture,a=[s?"#define ENVMAP_TYPE_CUBE":""],o="\n\t\t\tvarying vec3 vWorldPosition;\n\n\t\t\tvoid main() {\n\n\t\t\t\tvec4 worldPosition = ( modelMatrix * vec4( position, 1.0 ) );\n\t\t\t\tvWorldPosition = worldPosition.xyz;\n\n\t\t\t\tgl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );\n\n\t\t\t}\n\t\t\t",r=a.join("\n")+"\n\n\t\t\t\tvarying vec3 vWorldPosition;\n\n\t\t\t\tuniform float radius;\n\t\t\t\tuniform float height;\n\t\t\t\tuniform float angle;\n\n\t\t\t\t#ifdef ENVMAP_TYPE_CUBE\n\n\t\t\t\t\tuniform samplerCube map;\n\n\t\t\t\t#else\n\n\t\t\t\t\tuniform sampler2D map;\n\n\t\t\t\t#endif\n\n\t\t\t\t// From: https://www.shadertoy.com/view/4tsBD7\n\t\t\t\tfloat diskIntersectWithBackFaceCulling( vec3 ro, vec3 rd, vec3 c, vec3 n, float r ) \n\t\t\t\t{\n\n\t\t\t\t\tfloat d = dot ( rd, n );\n\n\t\t\t\t\tif( d > 0.0 ) { return 1e6; }\n\n\t\t\t\t\tvec3 o = ro - c;\n\t\t\t\t\tfloat t = - dot( n, o ) / d;\n\t\t\t\t\tvec3 q = o + rd * t;\n\n\t\t\t\t\treturn ( dot( q, q ) < r * r ) ? t : 1e6;\n\n\t\t\t\t}\n\n\t\t\t\t// From: https://www.iquilezles.org/www/articles/intersectors/intersectors.htm\n\t\t\t\tfloat sphereIntersect( vec3 ro, vec3 rd, vec3 ce, float ra ) {\n\n\t\t\t\t\tvec3 oc = ro - ce;\n\t\t\t\t\tfloat b = dot( oc, rd );\n\t\t\t\t\tfloat c = dot( oc, oc ) - ra * ra;\n\t\t\t\t\tfloat h = b * b - c;\n\n\t\t\t\t\tif( h < 0.0 ) { return -1.0; }\n\n\t\t\t\t\th = sqrt( h );\n\n\t\t\t\t\treturn - b + h;\n\n\t\t\t\t}\n\n\t\t\t\tvec3 project() {\n\n\t\t\t\t\tvec3 p = normalize( vWorldPosition );\n\t\t\t\t\tvec3 camPos = cameraPosition;\n\t\t\t\t\tcamPos.y -= height;\n\n\t\t\t\t\tfloat intersection = sphereIntersect( camPos, p, vec3( 0.0 ), radius );\n\t\t\t\t\tif( intersection > 0.0 ) {\n\n\t\t\t\t\t\tvec3 h = vec3( 0.0, - height, 0.0 );\n\t\t\t\t\t\tfloat intersection2 = diskIntersectWithBackFaceCulling( camPos, p, h, vec3( 0.0, 1.0, 0.0 ), radius );\n\t\t\t\t\t\tp = ( camPos + min( intersection, intersection2 ) * p ) / radius;\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tp = vec3( 0.0, 1.0, 0.0 );\n\n\t\t\t\t\t}\n\n\t\t\t\t\treturn p;\n\n\t\t\t\t}\n\n\t\t\t\t#include <common>\n\n\t\t\t\tvoid main() {\n\n\t\t\t\t\tvec3 projectedWorldPosition = project();\n\n\t\t\t\t\t#ifdef ENVMAP_TYPE_CUBE\n\n\t\t\t\t\t\tvec3 outcolor = textureCube( map, projectedWorldPosition ).rgb;\n\n\t\t\t\t\t#else\n\n\t\t\t\t\t\tvec3 direction = normalize( projectedWorldPosition );\n\t\t\t\t\t\tvec2 uv = equirectUv( direction );\n\t\t\t\t\t\tvec3 outcolor = texture2D( map, uv ).rgb;\n\n\t\t\t\t\t#endif\n\n\t\t\t\t\tgl_FragColor = vec4( outcolor, 1.0 );\n\n\t\t\t\t\t#include <tonemapping_fragment>\n\t\t\t\t\t#include <colorspace_fragment>\n\n\t\t\t\t}\n\t\t\t\t",h={map:{value:t},height:{value:n.height||15},radius:{value:n.radius||100}},c=new st(1,16),_=new at({uniforms:h,fragmentShader:r,vertexShader:o,side:Y});return e.call(this,c,_)}return ot(i,[{key:"radius",get:function(){return this.material.uniforms.radius.value},set:function(t){this.material.uniforms.radius.value=t}},{key:"height",get:function(){return this.material.uniforms.height.value},set:function(t){this.material.uniforms.height.value=t}}]),i}(U);class Ut extends Lt{constructor(t,e,i){super(t,e),this.updateEnvironmentTexture(i)}updateEnvironmentTexture(t){t&&(this._environmentTexture=t,this._skybox=new Ft(this._environmentTexture),this._skybox.name="Ground projected skybox",this._skybox.scale.setScalar(100)),this.reload()}needsBounds(){return!1}needsCamera(){return!1}needsRotation(){return!1}addToScene(){this._scene&&this._skybox&&this._scene.add(this._skybox)}removeFromScene(){this._scene&&this._skybox&&this._scene.remove(this._skybox)}showGUI(t){let e=u();if(!e)return;let i=e.addFolder("Ground Projected Environment");i.add(this._skybox,"height").min(10).max(100).step(.1).onChange(t),i.add(this._skybox,"radius").min(20).max(200).step(.1).onChange(t)}}class Ht{constructor(t){this._lightSourceDetector=t}static createPlane(t,e){const i=new rt(2,1),n=null!=e?e:new ht({color:12632256,side:Y}),s=new U(i,n);return s.position.z=-.1,t.add(s),s}createDebugScene(t){this._scene=t,this._createLightGraphInMap(this._lightSourceDetector.sampleUVs,this._lightSourceDetector.lightSamples,this._lightSourceDetector.lightGraph)}_createLightGraphInMap(t,e,i){let n=[],s=[];for(let t=0;t<this._lightSourceDetector.lightGraph.noOfNodes;++t)0===i.adjacent[t].length?n.push(e[t]):s.push(e[t]);const a=n.map(t=>t.uv),o=s.map(t=>t.uv),r=t.filter(t=>!a.includes(t)&&!o.includes(t));this._createSamplePointsInMap(r,.005,16711680),this._createSamplePointsInMap(a,.01,255),this._createSamplePointsInMap(o,.01,65280),this._createClusterLinesInMap(this._lightSourceDetector.lightSamples,this._lightSourceDetector.lightGraph.edges,128);const h=this._lightSourceDetector.lightSources.map(t=>t.uv);this._createSamplePointsInMap(h,.015,16776960),this._createCirclesInMap(this._lightSourceDetector.lightSources,8421376)}_createSamplePointsInMap(t,e,i){const n=new ct(e,8,4),s=new ht({color:i});t.forEach(t=>{var e;const i=new U(n,s);i.position.copy(this._uvToMapPosition(t)),i.name="samplePoint",null===(e=this._scene)||void 0===e||e.add(i)})}_createCirclesInMap(t,e){const i=new ht({color:e,transparent:!0,opacity:.5});t.forEach(t=>{var e;const n=new ct(t.size,8,4),s=new U(n,i);s.position.copy(this._uvToMapPosition(t.uv)),s.name="samplePoint",null===(e=this._scene)||void 0===e||e.add(s)})}_createClusterLinesInMap(t,e,i){var n;const s=new _t({color:i}),a=[];e.forEach(e=>{for(let i=1;i<e.length;i++){const n=t[e[0]].uv,s=t[e[i]].uv;if(a.push(this._uvToMapPosition(n)),Math.abs(n.x-s.x)>.5){const t=(n.y+s.y)/2,e=n.x<s.x?0:1;a.push(this._uvToMapPosition(new I(e,t))),a.push(this._uvToMapPosition(new I(1-e,t)))}a.push(this._uvToMapPosition(s))}});const o=(new dt).setFromPoints(a),r=new lt(o,s);r.name="clusterLine",null===(n=this._scene)||void 0===n||n.add(r)}_uvToMapPosition(t){return new L(2*t.x-1,t.y-.5,0)}}class qt extends mt{constructor(t){super(t),this._extendedEquirectMaterial=this._createEquirectMaterial()}fromEquirectangularTexture(t,e){var i,n;const s=null!==(i=null==e?void 0:e.rotation)&&void 0!==i?i:0,a=null!==(n=null==e?void 0:e.intensity)&&void 0!==n?n:1;return this._extendedEquirectMaterial.uniforms.intensity.value=a,this._extendedEquirectMaterial.uniforms.rotationMatrix.value.set(Math.cos(s),0,-Math.sin(s),0,1,0,Math.sin(s),0,Math.cos(s)),super.fromEquirectangular(t)}_createEquirectMaterial(){const t=new at({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null},intensity:{value:1},rotationMatrix:{value:new ut}},vertexShader:Gt,fragmentShader:jt,blending:pt,depthTest:!1,depthWrite:!1});return this._equirectMaterial=t,t}}const Gt="\nprecision mediump float;\nprecision mediump int;\nattribute float faceIndex;\nvarying vec3 vOutputDirection;\nuniform mat3 rotationMatrix;\n\n// RH coordinate system; PMREM face-indexing convention\nvec3 getDirection( vec2 uv, float face ) {\n uv = 2.0 * uv - 1.0;\n vec3 direction = vec3( uv, 1.0 );\n if ( face == 0.0 ) {\n direction = direction.zyx; // ( 1, v, u ) pos x\n } else if ( face == 1.0 ) {\n direction = direction.xzy;\n direction.xz *= -1.0; // ( -u, 1, -v ) pos y\n } else if ( face == 2.0 ) {\n direction.x *= -1.0; // ( -u, v, 1 ) pos z\n } else if ( face == 3.0 ) {\n direction = direction.zyx;\n direction.xz *= -1.0; // ( -1, v, -u ) neg x\n } else if ( face == 4.0 ) {\n direction = direction.xzy;\n direction.xy *= -1.0; // ( -u, -1, v ) neg y\n } else if ( face == 5.0 ) {\n direction.z *= -1.0; // ( u, v, -1 ) neg z\n }\n return direction;\n}\n\nvoid main() {\n vOutputDirection = rotationMatrix * getDirection(uv, faceIndex);\n gl_Position = vec4(position, 1.0);\n}\n",jt="\nprecision mediump float;\nprecision mediump int;\nvarying vec3 vOutputDirection;\nuniform sampler2D envMap;\nuniform float intensity;\n\n#include <common>\n\nvoid main() { \n vec3 outputDirection = normalize(vOutputDirection);\n vec2 uv = equirectUv(outputDirection);\n gl_FragColor = vec4(texture2D(envMap, uv).rgb * intensity, 1.0);\n}\n";class Zt{get lightSources(){return this._lightSources}set rotation(t){this._rotation!==t&&(this._rotation=t,this.needsUpdate=!0)}set intensity(t){this._intensity!==t&&(this._intensity=t,this.needsUpdate=!0)}constructor(t,e){var i,n;this.needsUpdate=!0,this._lightSources=[],t instanceof gt?this.environmentScene=t:t instanceof vt?this.cubeTexture=t:t instanceof ft&&(this.equirectangularTexture=t),(null==e?void 0:e.textureData)&&(this.textureData=null==e?void 0:e.textureData),this._rotation=null!==(i=null==e?void 0:e.rotation)&&void 0!==i?i:0,this._intensity=null!==(n=null==e?void 0:e.intensity)&&void 0!==n?n:1}createNewEnvironment(t){const e=this._createPmremTexture(t),i=this._detectLightSources(t,e);return this._lightSources=i.lightSources,null!=e?e:null}_getTextureOffset(){const t=this._rotation/(2*Math.PI)%1;return new I(t,0)}_createPmremTexture(t){const e=new qt(t);let i;return this.equirectangularTexture?(this.equirectangularTexture.offset.copy(this._getTextureOffset()),i=e.fromEquirectangularTexture(this.equirectangularTexture,{rotation:this._rotation,intensity:this._intensity})):this.cubeTexture?i=e.fromCubemap(this.cubeTexture):this.environmentScene&&(i=e.fromScene(this.environmentScene,.04)),this._debugScene=void 0,this.needsUpdate=!1,null==i?void 0:i.texture}_detectLightSources(t,e){const i=new f;return this.equirectangularTexture&&0===this.rotation?i.detectLightSources(t,this.equirectangularTexture,this.textureData):e&&i.detectLightSources(t,e),i}createDebugScene(t,e){if(this._debugScene)return this._debugScene;this._debugScene=new gt;const i=new w(!0,!1);i.setSourceTexture(e.environment),Ht.createPlane(this._debugScene,i);const n=this._detectLightSources(t,e.environment);return new Ht(n).createDebugScene(this._debugScene),this._debugScene}}class Nt{onBeforeRender(){}constructor(t,e,i,n=C.CAMERA_3D){this._depthWriteMaterial=new ht({colorWrite:!1}),this._maxAnisotropy=1,this._clock=new wt,this._delta=0,this._renderListener=null,this._stopRendering=!1,this._forceRender=!1,this._lastChange=Date.now(),this._running=!1,this._perspectiveOffsetCamera=null,this._orthographicOffsetCamera=null,this._onAfterRender=()=>{},this._creator_=t,this._canvasID=i,this.createCameraControl(y(n),e),this._setupScene(e,!1),this._lifeCycleManager.addEventListener(this)}addEventListener(t){throw new Error("Method not implemented.")}removeEventListener(t){throw new Error("Method not implemented.")}_changeCameraControl(t){this._cameraControl&&this._cameraControl.cleanUp(),t instanceof Tt&&(this._getInputManager().removeEventListener(7,this._renderListener),this._getInputManager().removeEventListener(8,this._renderListener)),this._cameraControl instanceof Tt&&(this._getInputManager().addEventListener(7,this._renderListener,this),this._getInputManager().addEventListener(8,this._renderListener,this)),this._cameraControl=t,this.cameraControlChanged()}cameraControlChanged(){}_addCameraControlListener(){this._cameraControl.addEventListener(0,()=>{var t;null===(t=this._roomleRenderer)||void 0===t||t.movingCameraStarts(),this._requestRender()},this),this._cameraControl.addEventListener(1,this._requestRender,this),this._cameraControl.addEventListener(2,()=>{var t;null===(t=this._roomleRenderer)||void 0===t||t.movingCameraStops(),this._requestRender()},this),this._cameraControl.addEventListener(6,this._requestRender,this)}_renderEverything(){var t;this._roomleRenderer&&(this._forceRender=!0,null===(t=this._roomleRenderer)||void 0===t||t.forceShadowUpdates(!1)),this._requestRender()}_renderWithoutShadowsAndAO(){this._roomleRenderer&&(this._forceRender=!0),this._requestRender()}_requestRender(){if(!this._renderer||this._stopRendering)return;const t=()=>{var e,i;this._delta=this._clock.getDelta(),this._animateCamera(),this._cameraControl.getCamera().layers.mask=65535,this._renderLoopFunction&&(this._renderLoopFunction(),this._renderLoopFunction=null),this.onBeforeRender(),this._roomleRenderer?(null===(e=this._statsHelper)||void 0===e||e.updateRenderInfo(this._roomleRenderer.renderer.info),this._roomleRenderer.render(this._scene,this._cameraControl.getCamera()),this._forceRender=!1,this._shouldRenderUi()&&this._renderUi()):(null===(i=this._statsHelper)||void 0===i||i.updateRenderInfo(this._renderer.info),this._renderer.render(this._scene,this._cameraControl.getCamera())),this._onAfterRender(),window.TWEEN&&TWEEN.update(),this._lastChange+3e3<Date.now()||this._stopRendering?this._running=!1:(this._running=!0,requestAnimationFrame(t))};this._lastChange=Date.now(),this._running||this._stopRendering||(this._running=!0,requestAnimationFrame(t))}_shouldRenderUi(){return this._pluginSystem&&this._pluginSystem.needsUiScene()}_renderUi(){const t=this._scene.background?this._scene.background.clone():null;this._scene.overrideMaterial=this._depthWriteMaterial,this._scene.background=null,this._renderer.render(this._scene,this._cameraControl.getCamera()),this._scene.overrideMaterial=null;const e=this._renderer.autoClear;this._renderer.autoClear=!1,this._renderer.clearDepth(),this._renderer.render(this._uiScene,this._cameraControl.getCamera()),this._renderer.autoClear=e,this._scene.background=t}_animateCamera(){this._cameraControl&&(this._cameraControl.animateCamera(this._delta)||!this.shouldClearShadowsAndAO()||this._forceRender)&&this._lightSetting instanceof Ot&&this._cameraControl.getCamera()instanceof k&&this._lightSetting.update(this._cameraControl.getCamera(),this._cameraControl.getTargetPosition()),this._environment&&this._environment.needsCamera()&&this._cameraControl instanceof Et&&this._environment.updateCamera(this._cameraControl.getCamera())}shouldClearShadowsAndAO(){return!1}_setupScene(t,e){var i;const{x:n,y:s}=this._domHelper.getClientDimensions();this._scene=new gt,this._uiScene=new gt,(e=e||!1)||(this._scene.background=yt(this._initData.colors.DEFAULT_BACKGROUND)),this._renderer=new Ct({antialias:!this._initData.e2e,alpha:!0});const a=this._initData.autoQuality?Math.min(window.devicePixelRatio,1.5):window.devicePixelRatio;this._renderer.setPixelRatio(a),this._renderer.setSize(n,s),this._renderer.outputColorSpace=Pt,this._renderer.autoClear=!1,this._renderer.shadowMap.enabled=!0,this._renderer.shadowMap.type=xt,this._maxAnisotropy=this._renderer.capabilities.getMaxAnisotropy(),this._initData.e2e||(this._roomleRenderer=new P(this._renderer,n,s),this._roomleRenderer.setQualityMap(x),this._roomleRenderer.setAutoQuality(this._initData.autoQuality),null===(i=this._roomleRenderer)||void 0===i||i.setSize(n,s)),this._renderer.domElement.classList.add(this._canvasID),this._domHelper.element.appendChild(this._renderer.domElement),this._getInputManager().addEvents(this._renderer.domElement),this._hdrEnvironmentLoader.registerEnvironmentChangedCallback(t=>{this._setEnvMap(t)}),this._initData.legacyLight?this.loadEnvMap("static/legacy_env-d5810ec5057d4716.exr"):this.loadEnvMap(this._initData.envMapUrl),this._requestRender(),window.addEventListener("resize",this,!1),window.addEventListener("keydown",this,!1),window.addEventListener("keyup",this,!1),document.addEventListener("visibilitychange",this),this._pluginSystem.init(this._scene,this._uiScene,this._cameraControl.getCamera().position),this._addCameraControlListener(),this.sceneChanged()}async loadEnvMap(t){await this._hdrEnvironmentLoader.loadUrl(this._renderer,t)}_setEnvMap(t){const{url:e,environmentMap:i}=t;this._scene.environment=i,this._scene.userData.environmentDefinition=new Zt(i,{rotation:this._initData.envMapRotation,intensity:this._initData.legacyLight?.9:this._initData.envMapIntensity}),this._scene.userData.shadowFromEnvironment=!this._initData.legacyLight,this._environment instanceof Ut&&this._environment.updateEnvironmentTexture(i),e===b&&window.requestIdleCallback(this.loadEnvMap.bind(this,"static/default_1k-2aa6d42244d30fb1.exr")),this._requestRender()}_tabVisible(){this.updateCamera(!1)}updateCamera(t=!0){var e;const{x:i,y:n}=this._domHelper.getClientDimensions();null===(e=this._roomleRenderer)||void 0===e||e.setSize(i,n),this._cameraControl.updateCamera(),this._renderEverything()}_onWindowResize(){const t=this._getInputManager();t&&t.updateSize(),this.updateCamera(),this._requestRender()}_isPartOfScene(t){return"Object3D"===t.type||"Mesh"===t.type||"GLB"===t.type||"GLTF"===t.type||"Group"===t.type}cleanUp(){this._getInputManager().removeEventListener(7,this._renderListener),this._getInputManager().removeEventListener(8,this._renderListener),this._cameraControl&&this._cameraControl.cleanUp(),this._stopRendering=!0}clearScene(){let t=[];this._scene.children.forEach(e=>{this._isPartOfScene(e)&&t.push(e)}),t.forEach(t=>{S(t),this._scene.remove(t)}),this._renderer.renderLists.dispose()}enableHD(t){this._renderer.capabilities.maxTextures>8&&t&&this.loadDynamicLightSetting(t),this._requestRender()}_loadGLTF(t,e,i,n,s,a,o){return new Promise((r,h)=>{this._staticItemLoader.loadGLTF(t,e,i,n,s,a,null,o).then(t=>{this._setCamera("GLTF",t.scene),r(t.scene)},h)})}_loadGLB(t,e,i,n,s,a,o,r){return new Promise((h,c)=>{this._staticItemLoader.loadGLB(t,e,i,n,s,a,o,r).then(t=>{this._setCamera("GLB",t.scene),h(t.scene)},c)})}_setCamera(t,e){if(!e)return void console.warn("could not set camera for gltf",e);const i=new R;i.setFromObject(e),"GLB"===t?this._cameraControl instanceof Et&&this._cameraControl.updateToBounds(i,!1):"GLTF"===t&&(this._cameraControl instanceof Et&&this._cameraControl.updateAndReset(i.getSize(new L),i.getCenter(new L),-15,70,5,!1),this._cameraControl instanceof It&&this._cameraControl.zoomToFitBounds(i,!0)),this.updateCamera()}showGUI(){if(this._initData.disableDebugGUI)return;const t=document.createElement("style");t.innerText=".dg.main{position:absolute;z-index:999;top:0;left:0;}",document.head.appendChild(t);let e=u(!1);e&&(this._domHelper.element.appendChild(e.domElement),this._guiLoaded())}_guiLoaded(){let t=u();if(!t)return;const e=t.addFolder("Scene Parameter"),i={intensity:this._initData.envMapIntensity,rotation:this._initData.envMapRotation};e.add(i,"intensity",0,4,.01).name("env map intensity").onChange(t=>{this.changeEnvironmentMapIntensity(t),this._requestRender()}),e.add(i,"rotation",0,2*Math.PI,.01).name("env map rotation").onChange(t=>{this._scene.userData.environmentDefinition.rotation=t,this._requestRender()}),this._lightSetting&&this._lightSetting.showGUI(),this._roomleRenderer&&this._roomleRenderer.showGUI(()=>this._requestRender()),this._environment&&this._environment.showGUI(()=>this._requestRender()),this._addGUIListener(t)}_addGUIListener(t){let e=t.__folders;Object.keys(e).forEach(t=>{let i=e[t];i.__folders&&Object.keys(i.__folders).forEach(t=>{let e=i.__folders[t];this._addGUIListener(e)}),i.__controllers&&i.__controllers.forEach(t=>{t.onFinishChange(()=>{this._guiParamChanged()})})})}_guiParamChanged(){this._renderEverything()}showStats(){e.import("./stats-helper-c027c078.legacy.js").then(t=>this._statsHelper=new t.default)}_onKeyDown(t){}_onKeyUp(t){}pause(){this._getInputManager().removeEvents(this._renderer.domElement),window.removeEventListener("resize",this,!1),window.removeEventListener("keydown",this,!1),window.removeEventListener("keyup",this,!1),document.removeEventListener("visibilitychange",this)}resume(){this._renderer.domElement.classList.add(this._canvasID),this._domHelper.element.appendChild(this._renderer.domElement),this._getInputManager().addEvents(this._renderer.domElement),window.addEventListener("resize",this,!1),window.addEventListener("keydown",this,!1),window.addEventListener("keyup",this,!1),document.addEventListener("visibilitychange",this),this.updateCamera()}destroy(){this.pause(),this.cleanUp()}handleEvent(t){switch(t.type){case"resize":this._onWindowResize();break;case"keydown":if(t.target&&(t.target instanceof HTMLInputElement||t.target instanceof HTMLTextAreaElement))break;this._onKeyDown(t);break;case"keyup":if(t.target&&(t.target instanceof HTMLInputElement||t.target instanceof HTMLTextAreaElement))break;this._onKeyUp(t);break;case"visibilitychange":this._tabVisible()}}async loadSceneSettings(t){let e,i;return e=t.environment?new Promise(e=>{(new At).load(this._scene,this._renderer.domElement,this._environment,t,this._maxAnisotropy).then(t=>{this._setEnvironment(t),e()})}):Promise.resolve(),t.lights?(this._lightSetting=new Ot(this._scene,this._lightSetting),i=this._lightSetting.loadFromObject(t)):i=Promise.resolve(),new Promise((t,n)=>{Promise.all([e,i]).then(()=>{this._renderEverything(),t()},n)})}setBackgroundColor(t){this._setEnvironment(new Rt(this._scene,this._environment,new N(t)))}setBackgroundImage(t){this._setEnvironment(new Rt(this._scene,this._environment,null,this._renderer.domElement,t))}_setEnvironment(t){this._environment=t,this._renderEverything()}async loadDynamicLightSetting(t){this._lightSetting=new Ot(this._scene,this._lightSetting);let e=!1;if(t.url)await this._lightSetting.loadFromURL(t.url),e=!0;else if(t.json)await this._lightSetting.loadFromJSON(t.json),e=!0;else if(t.object)await this._lightSetting.loadFromObject(t.object),e=!0;else if(t.ls){const i=M.createDynamicLightSettingSource(null,t.ls);await this._lightSetting.loadFromURL(i.url),e=!0}if(!e)throw new Error("No dynamic light setting source set");this._requestRender()}getScene(){return this._scene}updateScene(){var t;this._updateBounds(this.getBounds()),null===(t=this._roomleRenderer)||void 0===t||t.forceShadowUpdates(!0),this._renderEverything()}_updateBounds(t,e=!1){var i;t&&(this.updateEnvironment(t,e),this._lightSetting&&this._lightSetting.needsBounds()&&this._lightSetting.updateBounds(t),null===(i=this._roomleRenderer)||void 0===i||i.updateBounds(t),this._requestRender(),this._pluginSystem.updateBounds(t))}setCameraOffset(t){const e=this._cameraControl.getCamera(),i=e||e;(null==i?void 0:i.offset)?(i.offset=t,this._renderEverything()):console.warn("Cannot set offset, current camera does not support it")}getCameraOffset(){const t=this._cameraControl.getCamera(),e=t||t;return(null==e?void 0:e.offset)?JSON.parse(JSON.stringify(e.offset)):{left:0,top:0,right:1,bottom:1}}getOrthographicOffsetCamera(){if(!this._orthographicOffsetCamera){const t=this.getCameraOffset(),e=this._domHelper.getClientDimensions(),i=5;let n=e.x/e.y*i,s=i;const a=E();this._orthographicOffsetCamera=a.createOrthographicCamera(n/-2,n/2,s/2,s/-2,1,1e3,t),this._orthographicOffsetCamera.position.set(0,10,0),this._orthographicOffsetCamera.lookAt(new L(0,0,0))}return this._orthographicOffsetCamera}getPerspectiveOffsetCamera(){if(!this._perspectiveOffsetCamera){const t=this.getCameraOffset(),e=this._domHelper.getClientDimensions(),i=e.x,n=e.y,s=E();this._perspectiveOffsetCamera=s.createPerspectiveCamera(30,i/n,.1,20,t)}return this._perspectiveOffsetCamera}updateEnvironment(t,e=!1){var i;if(t&&this._environment&&this._environment.needsBounds()){const i=t.getSize(new L);(i.x+i.y+i.z!==0||e)&&this._environment.updateBounds(t.getSize(new L),e)}null===(i=this._roomleRenderer)||void 0===i||i.updateEnvironment(t,e)}_onCameraIdle(){return!0}_onCameraMove(){return!0}exportImageFromCamera(t){this._onAfterRender=()=>{const e=this._renderer.domElement.toDataURL("image/jpeg",1),{left:i,right:n,top:s,bottom:a}=this.getCameraOffset(),o=n-i,r=s-a;if(1===o&&1===r)return bt(t,e),void(this._onAfterRender=()=>{});const h=new Image;h.src=e,h.onload=()=>{const{naturalWidth:e,naturalHeight:n}=h,a=document.createElement("canvas");a.width=e*o,a.height=n*r;const c=a.getContext("2d"),_=e*i*-1,d=n*(1-s)*-1;c.drawImage(h,_,d),c.save(),bt(t,a.toDataURL("image/jpeg",1)),this._onAfterRender=()=>{}}},this._requestRender()}changeEnvironmentMapIntensity(t){this._scene.userData.environmentDefinition.intensity=t}lockCamera(){this._cameraControl.lock()}unlockCamera(){this._cameraControl.unlock()}setEnvironmentMap(t,e,i,n){void 0!==t&&this._hdrEnvironmentLoader.loadUrl(this._renderer,t),void 0!==e&&(this._scene.userData.environmentDefinition.intensity=e),void 0!==i&&(this._scene.userData.environmentDefinition.rotation=i),void 0!==n&&(this._roomleRenderer.screenSpaceShadowParameters.maximumNumberOfLightSources=n,this._roomleRenderer.forceShadowUpdates(!1)),this._requestRender()}}t("S",Nt),i([n],Nt.prototype,"_domHelper",void 0),i([n],Nt.prototype,"_scriptLoader",void 0),i([n],Nt.prototype,"_lifeCycleManager",void 0),i([n],Nt.prototype,"_staticItemLoader",void 0),i([n],Nt.prototype,"_hdrEnvironmentLoader",void 0),i([n],Nt.prototype,"_initData",void 0),i([n],Nt.prototype,"_pluginSystem",void 0),i([n],Nt.prototype,"_imageRenderer",void 0)}}}));
|
|
2
|
-
//# sourceMappingURL=scene-manager-4c49ffd2.legacy.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"script-loader-ac6bc6eb.legacy.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stats-helper-c027c078.legacy.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tools-core-5f513877.legacy.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"material-viewer-54c1dd62.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"material-viewer-d25178c4.nomodule.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{MaterialViewer}from"./material-viewer-54c1dd62.js";import"./script-loader-0175c371.js";import"./query-params-helper-a271f9dc.js";import"./roomle-dependency-injection-597b90a7.js";import"./main-thread-to-worker-d5d5841d.js";import"./scene-manager-805fb8e3.js";(new MaterialViewer).boot();
|
|
2
|
-
//# sourceMappingURL=material-viewer-main-65a30660.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"material-viewer-main-65a30660.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|