@roomle/web-sdk 2.29.1 → 2.30.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/{banana-for-scale-381d58e8.nomodule.js → banana-for-scale-3b1ae3ac.nomodule.js} +2 -2
- package/lib/{banana-for-scale-381d58e8.nomodule.js.map → banana-for-scale-3b1ae3ac.nomodule.js.map} +1 -1
- package/lib/{banana-for-scale-f45e866a.js → banana-for-scale-b124d14a.js} +2 -2
- package/lib/{banana-for-scale-f45e866a.js.map → banana-for-scale-b124d14a.js.map} +1 -1
- package/lib/{component-dimensioning-c8c82bac.js → component-dimensioning-13a3bf18.js} +2 -2
- package/lib/component-dimensioning-13a3bf18.js.map +1 -0
- package/lib/{component-dimensioning-4d04c85d.nomodule.js → component-dimensioning-7f2300fe.nomodule.js} +2 -2
- package/lib/component-dimensioning-7f2300fe.nomodule.js.map +1 -0
- package/lib/configurator-294f1ad0.js +2 -0
- package/lib/{configurator-c8caac15.js.map → configurator-294f1ad0.js.map} +1 -1
- package/lib/configurator-54c1e68f.nomodule.js +2 -0
- package/lib/{configurator-b2187c1b.nomodule.js.map → configurator-54c1e68f.nomodule.js.map} +1 -1
- package/lib/configurator-main-93e4e5cc.js +2 -0
- package/lib/configurator-main-93e4e5cc.js.map +1 -0
- package/lib/configurator-main.nomodule.js +1 -1
- package/lib/{configurator-mesh-generator-24cf50c3.js → configurator-mesh-generator-2991a7aa.js} +2 -2
- package/lib/configurator-mesh-generator-2991a7aa.js.map +1 -0
- package/lib/{configurator-mesh-generator-398ec1fd.nomodule.js → configurator-mesh-generator-b35b9c5b.nomodule.js} +2 -2
- package/lib/configurator-mesh-generator-b35b9c5b.nomodule.js.map +1 -0
- package/lib/{default-light-setting-00a36539.nomodule.js → default-light-setting-0194df56.nomodule.js} +2 -2
- package/lib/default-light-setting-0194df56.nomodule.js.map +1 -0
- package/lib/{default-light-setting-f73fb1f7.js → default-light-setting-4de0cc9d.js} +2 -2
- package/lib/default-light-setting-4de0cc9d.js.map +1 -0
- package/lib/definitions/common-core/src/services/common-kernel-access.d.ts +1 -1
- package/lib/definitions/common-core/src/static-files/roomle-core.d.ts +0 -1
- package/lib/{dimensioning-helper-37d6d07c.nomodule.js → dimensioning-helper-9e31862c.nomodule.js} +2 -2
- package/lib/dimensioning-helper-9e31862c.nomodule.js.map +1 -0
- package/lib/{dimensioning-helper-8d17a6cf.js → dimensioning-helper-fe522ba9.js} +2 -2
- package/lib/dimensioning-helper-fe522ba9.js.map +1 -0
- package/lib/{glb-viewer-dcffd36a.js → glb-viewer-1f6451d3.js} +2 -2
- package/lib/{glb-viewer-dcffd36a.js.map → glb-viewer-1f6451d3.js.map} +1 -1
- package/lib/{glb-viewer-06b94aaf.nomodule.js → glb-viewer-49d5bd60.nomodule.js} +2 -2
- package/lib/{glb-viewer-06b94aaf.nomodule.js.map → glb-viewer-49d5bd60.nomodule.js.map} +1 -1
- package/lib/glb-viewer-main-8eb0bb45.js +2 -0
- package/lib/glb-viewer-main-8eb0bb45.js.map +1 -0
- package/lib/glb-viewer-main.nomodule.js +1 -1
- package/lib/image-renderer-cd9f96f9.nomodule.js +2 -0
- package/lib/{image-renderer-ba606104.nomodule.js.map → image-renderer-cd9f96f9.nomodule.js.map} +1 -1
- package/lib/image-renderer-d9eb3999.js +2 -0
- package/lib/{image-renderer-f53d72f9.js.map → image-renderer-d9eb3999.js.map} +1 -1
- package/lib/legacy/{banana-for-scale-93eb1daf.legacy.js → banana-for-scale-b1910b38.legacy.js} +2 -2
- package/lib/legacy/{banana-for-scale-93eb1daf.legacy.js.map → banana-for-scale-b1910b38.legacy.js.map} +1 -1
- package/lib/legacy/{component-dimensioning-eee5e237.legacy.js → component-dimensioning-599cba54.legacy.js} +2 -2
- package/lib/legacy/component-dimensioning-599cba54.legacy.js.map +1 -0
- package/lib/legacy/configurator-b5e2bc69.legacy.js +2 -0
- package/lib/legacy/{configurator-7cc4cf7f.legacy.js.map → configurator-b5e2bc69.legacy.js.map} +1 -1
- package/lib/legacy/configurator-main.legacy.js +1 -1
- package/lib/legacy/{configurator-mesh-generator-6c22760b.legacy.js → configurator-mesh-generator-09788453.legacy.js} +2 -2
- package/lib/legacy/configurator-mesh-generator-09788453.legacy.js.map +1 -0
- package/lib/legacy/{default-light-setting-50c5540b.legacy.js → default-light-setting-0ba0698d.legacy.js} +2 -2
- package/lib/legacy/default-light-setting-0ba0698d.legacy.js.map +1 -0
- package/lib/legacy/{dimensioning-helper-382c662b.legacy.js → dimensioning-helper-a8fa9367.legacy.js} +2 -2
- package/lib/legacy/dimensioning-helper-a8fa9367.legacy.js.map +1 -0
- package/lib/legacy/{glb-viewer-cdd65763.legacy.js → glb-viewer-47f740ca.legacy.js} +2 -2
- package/lib/legacy/{glb-viewer-cdd65763.legacy.js.map → glb-viewer-47f740ca.legacy.js.map} +1 -1
- package/lib/legacy/glb-viewer-main.legacy.js +1 -1
- package/lib/legacy/image-renderer-907fb916.legacy.js +2 -0
- package/lib/legacy/{image-renderer-d0fd5c55.legacy.js.map → image-renderer-907fb916.legacy.js.map} +1 -1
- package/lib/legacy/{material-viewer-0bd75634.legacy.js → material-viewer-c2777261.legacy.js} +2 -2
- package/lib/legacy/material-viewer-c2777261.legacy.js.map +1 -0
- package/lib/legacy/material-viewer-main.legacy.js +1 -1
- package/lib/legacy/{mesh-generator-e621aff0.legacy.js → mesh-generator-b47c0a4d.legacy.js} +2 -2
- package/lib/legacy/mesh-generator-b47c0a4d.legacy.js.map +1 -0
- package/lib/legacy/{pixotron-af54e7f4.legacy.js → pixotron-c75893da.legacy.js} +2 -2
- package/lib/legacy/{pixotron-af54e7f4.legacy.js.map → pixotron-c75893da.legacy.js.map} +1 -1
- package/lib/legacy/{planner-9105e629.legacy.js → planner-c68fe69e.legacy.js} +2 -2
- package/lib/legacy/{planner-9105e629.legacy.js.map → planner-c68fe69e.legacy.js.map} +1 -1
- package/lib/legacy/planner-main.legacy.js +1 -1
- package/lib/legacy/{rapi-access-eac1edaa.legacy.js → rapi-access-7f99dddf.legacy.js} +2 -2
- package/lib/legacy/rapi-access-7f99dddf.legacy.js.map +1 -0
- package/lib/legacy/roomle-sdk.legacy.js +1 -1
- package/lib/legacy/{scene-manager-444a090a.legacy.js → scene-manager-7bf571a5.legacy.js} +2 -2
- package/lib/legacy/scene-manager-7bf571a5.legacy.js.map +1 -0
- package/lib/legacy/static/{ConfiguratorKernel-7379813e2cd03c0d.js → ConfiguratorKernel-4ca6a302619d4901.js} +19 -19
- package/lib/legacy/static/ConfiguratorKernel-933afa523280b0ab.wasm +0 -0
- package/lib/legacy/static/ConfiguratorKernelJs-0016814fcacc7307.js +143 -0
- package/lib/legacy/static/ConfiguratorKernelJs-31fee77c9ae6a97e.mem +0 -0
- package/lib/legacy/static/{RoomleCore-4da5951bbc66db16.js → RoomleCore-0b27042fad1c1d39.js} +20 -20
- package/lib/legacy/static/RoomleCore-8795f006e66c4965.wasm +0 -0
- package/lib/legacy/static/RoomleCoreJs-1a2c86a7fe3c5984.js +151 -0
- package/lib/legacy/static/RoomleCoreJs-58a542851dd7847d.mem +0 -0
- package/lib/legacy/static/shaders-18f972327c1ef865.json +1 -0
- package/lib/legacy/{stats-helper-9b3de7cb.legacy.js → stats-helper-c3b279dc.legacy.js} +2 -2
- package/lib/legacy/{stats-helper-9b3de7cb.legacy.js.map → stats-helper-c3b279dc.legacy.js.map} +1 -1
- package/lib/{material-viewer-6a7e9aae.js → material-viewer-262e59f2.js} +2 -2
- package/lib/material-viewer-262e59f2.js.map +1 -0
- package/lib/{material-viewer-f5945d4d.nomodule.js → material-viewer-8469df71.nomodule.js} +2 -2
- package/lib/material-viewer-8469df71.nomodule.js.map +1 -0
- package/lib/material-viewer-main-572dba52.js +2 -0
- package/lib/material-viewer-main-572dba52.js.map +1 -0
- package/lib/material-viewer-main.nomodule.js +1 -1
- package/lib/{mesh-generator-e06e41c5.js → mesh-generator-50042c56.js} +2 -2
- package/lib/mesh-generator-50042c56.js.map +1 -0
- package/lib/{mesh-generator-bd71e198.nomodule.js → mesh-generator-f36de341.nomodule.js} +2 -2
- package/lib/mesh-generator-f36de341.nomodule.js.map +1 -0
- package/lib/{pixotron-aa387978.nomodule.js → pixotron-637b5b31.nomodule.js} +2 -2
- package/lib/{pixotron-aa387978.nomodule.js.map → pixotron-637b5b31.nomodule.js.map} +1 -1
- package/lib/{pixotron-27b4f029.js → pixotron-9b93dc57.js} +2 -2
- package/lib/{pixotron-27b4f029.js.map → pixotron-9b93dc57.js.map} +1 -1
- package/lib/{planner-7a62b637.js → planner-1d0fbc9f.js} +2 -2
- package/lib/{planner-7a62b637.js.map → planner-1d0fbc9f.js.map} +1 -1
- package/lib/{planner-07855a5f.nomodule.js → planner-b9254d01.nomodule.js} +2 -2
- package/lib/{planner-07855a5f.nomodule.js.map → planner-b9254d01.nomodule.js.map} +1 -1
- package/lib/planner-main-5255100f.js +2 -0
- package/lib/planner-main-5255100f.js.map +1 -0
- package/lib/planner-main.nomodule.js +1 -1
- package/lib/{rapi-access-f2371d51.nomodule.js → rapi-access-a81e13ca.nomodule.js} +2 -2
- package/lib/rapi-access-a81e13ca.nomodule.js.map +1 -0
- package/lib/{rapi-access-589f9e14.js → rapi-access-cfbedd27.js} +2 -2
- package/lib/rapi-access-cfbedd27.js.map +1 -0
- package/lib/{roomle-sdk-3f00a33b.js → roomle-sdk-2e764824.js} +2 -2
- package/lib/roomle-sdk-2e764824.js.map +1 -0
- package/lib/roomle-sdk.nomodule.js +1 -1
- package/lib/{scene-manager-a81831fa.nomodule.js → scene-manager-05f53318.nomodule.js} +2 -2
- package/lib/scene-manager-05f53318.nomodule.js.map +1 -0
- package/lib/{scene-manager-42f2cb7d.js → scene-manager-827c6f28.js} +2 -2
- package/lib/scene-manager-827c6f28.js.map +1 -0
- package/lib/static/{ConfiguratorKernel-7379813e2cd03c0d.js → ConfiguratorKernel-4ca6a302619d4901.js} +1 -1
- package/lib/static/{ConfiguratorKernel-7379813e2cd03c0d.js.map → ConfiguratorKernel-4ca6a302619d4901.js.map} +1 -1
- package/lib/static/ConfiguratorKernel-933afa523280b0ab.wasm +0 -0
- package/lib/static/ConfiguratorKernelJs-0016814fcacc7307.js +143 -0
- package/lib/static/ConfiguratorKernelJs-31fee77c9ae6a97e.mem +0 -0
- package/lib/static/{RoomleCore-4da5951bbc66db16.js → RoomleCore-0b27042fad1c1d39.js} +1 -1
- package/lib/static/{RoomleCore-4da5951bbc66db16.js.map → RoomleCore-0b27042fad1c1d39.js.map} +1 -1
- package/lib/static/RoomleCore-8795f006e66c4965.wasm +0 -0
- package/lib/static/RoomleCoreJs-1a2c86a7fe3c5984.js +151 -0
- package/lib/static/RoomleCoreJs-58a542851dd7847d.mem +0 -0
- package/lib/static/shaders-18f972327c1ef865.json +1 -0
- package/lib/{stats-helper-e5e90e31.nomodule.js → stats-helper-2a5a8533.nomodule.js} +2 -2
- package/lib/{stats-helper-e5e90e31.nomodule.js.map → stats-helper-2a5a8533.nomodule.js.map} +1 -1
- package/lib/{stats-helper-b45d08c5.js → stats-helper-7471cb85.js} +2 -2
- package/lib/{stats-helper-b45d08c5.js.map → stats-helper-7471cb85.js.map} +1 -1
- package/package.json +2 -2
- package/lib/component-dimensioning-4d04c85d.nomodule.js.map +0 -1
- package/lib/component-dimensioning-c8c82bac.js.map +0 -1
- package/lib/configurator-b2187c1b.nomodule.js +0 -2
- package/lib/configurator-c8caac15.js +0 -2
- package/lib/configurator-main-1a0355ad.js +0 -2
- package/lib/configurator-main-1a0355ad.js.map +0 -1
- package/lib/configurator-mesh-generator-24cf50c3.js.map +0 -1
- package/lib/configurator-mesh-generator-398ec1fd.nomodule.js.map +0 -1
- package/lib/default-light-setting-00a36539.nomodule.js.map +0 -1
- package/lib/default-light-setting-f73fb1f7.js.map +0 -1
- package/lib/dimensioning-helper-37d6d07c.nomodule.js.map +0 -1
- package/lib/dimensioning-helper-8d17a6cf.js.map +0 -1
- package/lib/glb-viewer-main-7c5e7d38.js +0 -2
- package/lib/glb-viewer-main-7c5e7d38.js.map +0 -1
- package/lib/image-renderer-ba606104.nomodule.js +0 -2
- package/lib/image-renderer-f53d72f9.js +0 -2
- package/lib/legacy/component-dimensioning-eee5e237.legacy.js.map +0 -1
- package/lib/legacy/configurator-7cc4cf7f.legacy.js +0 -2
- package/lib/legacy/configurator-mesh-generator-6c22760b.legacy.js.map +0 -1
- package/lib/legacy/default-light-setting-50c5540b.legacy.js.map +0 -1
- package/lib/legacy/dimensioning-helper-382c662b.legacy.js.map +0 -1
- package/lib/legacy/image-renderer-d0fd5c55.legacy.js +0 -2
- package/lib/legacy/material-viewer-0bd75634.legacy.js.map +0 -1
- package/lib/legacy/mesh-generator-e621aff0.legacy.js.map +0 -1
- package/lib/legacy/rapi-access-eac1edaa.legacy.js.map +0 -1
- package/lib/legacy/scene-manager-444a090a.legacy.js.map +0 -1
- package/lib/legacy/static/ConfiguratorKernel-4c09558b00e81ba8.wasm +0 -0
- package/lib/legacy/static/ConfiguratorKernelJs-3789a15227520de1.js +0 -143
- package/lib/legacy/static/ConfiguratorKernelJs-dd075c23d87b4733.mem +0 -0
- package/lib/legacy/static/RoomleCore-43a1c9de57277471.wasm +0 -0
- package/lib/legacy/static/RoomleCoreJs-86806817a5b958c9.js +0 -151
- package/lib/legacy/static/RoomleCoreJs-cfff2977254b7f93.mem +0 -0
- package/lib/legacy/static/corto.em.roomle-05666d318bd656c3.js +0 -182
- package/lib/legacy/static/shaders-51665a583ff75bb6.json +0 -1
- package/lib/material-viewer-6a7e9aae.js.map +0 -1
- package/lib/material-viewer-f5945d4d.nomodule.js.map +0 -1
- package/lib/material-viewer-main-ef944983.js +0 -2
- package/lib/material-viewer-main-ef944983.js.map +0 -1
- package/lib/mesh-generator-bd71e198.nomodule.js.map +0 -1
- package/lib/mesh-generator-e06e41c5.js.map +0 -1
- package/lib/planner-main-3ce584f3.js +0 -2
- package/lib/planner-main-3ce584f3.js.map +0 -1
- package/lib/rapi-access-589f9e14.js.map +0 -1
- package/lib/rapi-access-f2371d51.nomodule.js.map +0 -1
- package/lib/roomle-sdk-3f00a33b.js.map +0 -1
- package/lib/scene-manager-42f2cb7d.js.map +0 -1
- package/lib/scene-manager-a81831fa.nomodule.js.map +0 -1
- package/lib/static/ConfiguratorKernel-4c09558b00e81ba8.wasm +0 -0
- package/lib/static/ConfiguratorKernelJs-3789a15227520de1.js +0 -143
- package/lib/static/ConfiguratorKernelJs-dd075c23d87b4733.mem +0 -0
- package/lib/static/RoomleCore-43a1c9de57277471.wasm +0 -0
- package/lib/static/RoomleCoreJs-86806817a5b958c9.js +0 -151
- package/lib/static/RoomleCoreJs-cfff2977254b7f93.mem +0 -0
- package/lib/static/corto.em.roomle-05666d318bd656c3.js +0 -1
- package/lib/static/corto.em.roomle-05666d318bd656c3.js.map +0 -1
- package/lib/static/shaders-51665a583ff75bb6.json +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
System.register(["./rapi-access-f2371d51.nomodule.js","./main-thread-to-worker-4fc95d50.nomodule.js","./pixotron-aa387978.nomodule.js"],(function(t,e){var i,s,n,r,o,a,h,_,d,c,p,m,l,u,g,E,w,y,C,v,R;return{setters:[function(t){i=t.t,s=t.u,n=t.a8,r=t.a9,o=t.v,a=t._,h=t.i,_=t.e,d=t.h,c=t.f,p=t.R,m=t.aa},function(t){l=t.i},function(t){u=t.d,g=t.i,E=t.D,w=t.C,y=t.b,C=t.B,v=t.f,R=t.c}],execute:function(){class f extends u{constructor(t,e,i){super(t,e,i),this._scale=1,this._state=0,this._size=20,this._center=new THREE.Vector3,this._raycaster=new THREE.Raycaster,this._lastPosition=new THREE.Vector2,this._zoomPosition=new THREE.Vector3,this._lastZoom=0,this._zoomSpeed=Math.pow(.95,2),this._cameraZoom=1,this._initCamera(i||new THREE.Vector3(0,10,0));let s=new THREE.PlaneGeometry(1e3,1e3);s.rotateX(-Math.PI/2),this._plane=new THREE.Mesh(s,new THREE.MeshStandardMaterial)}_getCamera(){return this._camera||this._initCamera(new THREE.Vector3(0,10,0)),this._camera}_initCamera(t){let{x:e,y:i}=this._domHelper.getClientDimensions(),s=e/i*this._size,n=this._size;this._camera=new THREE.OrthographicCamera(s/-2,s/2,n/2,n/-2,1,1e3),this._camera.position.copy(t),this._cameraPosition=t,this._camera.lookAt(new THREE.Vector3(0,0,0))}updateCamera(){let{x:t,y:e}=this._domHelper.getClientDimensions(),i=t/e*this._size,s=this._size;this._camera.left=i/-2,this._camera.right=i/2,this._camera.top=s/2,this._camera.bottom=s/-2,this._camera.updateProjectionMatrix()}_initInputListener(){this._inputListeners.push({key:3,fun:t=>{this._locked||(this._state=1,this._lastPosition.set(t.position.x,t.position.y),this.dispatchEvent(0))}}),this._inputListeners.push({key:6,fun:t=>{1!==this._state||this._locked||(this._move(new THREE.Vector2(t.position.x,t.position.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._scale/=this._zoomSpeed,this._zoomTo(t.position,1),this._update()}}),this._inputListeners.push({key:8,fun:t=>{t.event&&(t.event.stopPropagation(),t.event.preventDefault()),this._scale*=this._zoomSpeed,this._zoomTo(t.position,-1),this._update()}})}_zoomTo(t,e){if(Date.now()-this._lastZoom>200){if(e>0||this._cameraZoom>=1){const e=this.getInputPosition(t);this._raycaster.setFromCamera(e,this._camera);const i=this._raycaster.intersectObject(this._plane);if(i.length<=0)return;const s=i.pop().point;this._zoomPosition.copy(s)}else this._zoomPosition.copy(this._center);this._cameraPosition.x=this._zoomPosition.x,this._cameraPosition.z=this._zoomPosition.z}this._lastZoom=Date.now()}_move(t,e){let i=new THREE.Vector2;i.subVectors(this._lastPosition,t),i.divideScalar(100),this._cameraPosition.x+=i.x*(2===e?1.1:1),this._cameraPosition.z+=i.y*(2===e?1.1:1),this._lastPosition.copy(t)}updateToBounds(t,e){let{x:i,y:s}=this._domHelper.getClientDimensions(),n=i/s;this._size=Math.max(t.x,t.z);let r=this._size,o=this._size;n>1?r=this._size*n:o=this._size*(s/i),this._center.copy(e),this._camera.left=r/-2,this._camera.right=r/2,this._camera.top=o/2,this._camera.bottom=o/-2,this._camera.zoom=1,this._camera.position.set(this._center.x,10,this._center.z),this._cameraPosition.copy(this._camera.position)}_update(t){this._scale=Math.min(this._scale,5),this._scale=Math.max(this._scale,.8),this._cameraZoom=this._scale,this._camera.updateProjectionMatrix()}animateCamera(t){return!(!super.animateCamera(t)&&Math.abs(this._cameraZoom-this._camera.zoom)<=.01||(this._camera.zoom=THREE.MathUtils.lerp(this._camera.zoom,this._cameraZoom,10*t),0))}}t("C",f);const L=Math.PI/4;class x extends u{constructor(t,e,s,n){super(t,e,s),this._state=0,this._rotationSpeed=1,this._keyMap=new Map,this.minPolarAngle=i(-60),this.maxPolarAngle=i(60),this._camera=n||new THREE.PerspectiveCamera,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(5),this._camera.layers.enable(4),s?this._camera.position.set(s.x,1.5,s.z):this._camera.position.set(0,1.5,0),this._cameraPosition=new THREE.Vector3,this._cameraPosition.copy(this._camera.position),this._cameraRotation=new THREE.Quaternion,this._pitch=0,this._yaw=0;let r=new THREE.Euler(-this._pitch,this._yaw,0,"ZYX");this._cameraRotation.setFromEuler(r),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*L*e),this._update(),this.dispatchEvent(1)),Math.abs(i)>.2&&(this._rotateVertical(.01*L*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,r=this.getCamera(),o=s(e,r.position),a=n(i,r.quaternion);if(!e||o&&a)return!1;let h=this.getCamera().position.clone(),_=Math.min(10*t,1);h.lerp(e,_),this.getCamera().position.copy(h);let d=this.getCamera().quaternion.clone(),c=Math.min(5*t,1);d.slerp(i,c),this.getCamera().setRotationFromQuaternion(d);let p=!1;return this._keyMap.forEach(t=>{t&&(p=!0)}),p&&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 THREE.Vector2(t.position.x,t.position.y)),2!==this._state||this._locked||(this._orbit(new THREE.Vector2(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(){r(this._downPosition,this._position)<g&&1===this._state&&(this._state=2,this._orbit(new THREE.Vector2(this._position.x,this._position.y)),this._moveForward())}_update(t){let e=new THREE.Euler(-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 THREE.Vector3(0,0,0),s=!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(-L*this._rotationSpeed*e),s=!0),t.get(39)&&(this._rotateHorizontal(L*this._rotationSpeed*e),s=!0),t.get(16)&&(i.x*=3,i.z*=3),!(0===i.x&&0===i.y&&0===i.z&&!s||(i.applyQuaternion(this.getCamera().quaternion),this._cameraPosition.add(new THREE.Vector3(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 THREE.Vector2(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),o(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())}}t("a",x),t("S",(()=>{class t{constructor(t,e,i,s,n){this._maxAnisotropy=1,this._clock=new THREE.Clock,this._delta=0,this._renderListener=null,this._stopRendering=!1,this._forceRender=!1,this._updateShadowsAndAO=!0,this._lastChange=Date.now(),this._running=!1,this._onAfterRender=()=>{},this._creator_=t,this._canvasID=i,this.createCameraControl(s),this._addCameraControlListener(),this._setupScene(e,n),document.addEventListener("visibilitychange",this._tabVisible.bind(this)),this._renderListener=()=>{this._requestRender()},this._getInputManager().addEventListener(7,this._renderListener,this),this._getInputManager().addEventListener(8,this._renderListener,this),this._lifeCycleManager.addEventListener(this)}onBeforeRender(){}_changeCameraControl(t){this._cameraControl&&this._cameraControl.cleanUp(),t instanceof x&&(this._getInputManager().removeEventListener(7,this._renderListener),this._getInputManager().removeEventListener(8,this._renderListener)),this._cameraControl instanceof x&&(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,this._requestRender,this),this._cameraControl.addEventListener(1,this._requestRender,this),this._cameraControl.addEventListener(2,this._requestRender,this),this._cameraControl.addEventListener(6,this._requestRender,this)}_renderEverything(){this._pixotron&&(this._forceRender=!0,this._updateShadowsAndAO=!0),this._requestRender()}_renderWithoutShadowsAndAO(){this._pixotron&&(this._forceRender=!0,this._updateShadowsAndAO=!1),this._requestRender()}_requestRender(){if(!this._renderer)return;const t=()=>{this._delta=this._clock.getDelta(),this._animateCamera(),this._cameraControl.getCamera().layers.mask=65535,this._renderLoopFunction&&(this._renderLoopFunction(),this._renderLoopFunction=null),this.onBeforeRender(),this._statsHelper&&this._statsHelper.updateRenderInfo(this._renderer.info),this._pixotron?(this._pixotron.autoShadowsClear=this._updateShadowsAndAO,this._pixotron.autoSAOClear=this._updateShadowsAndAO,this._forceRender&&(this._pixotron.needsUpdate=!0),this._pixotron.render(this._renderer,this._scene,this._cameraControl.getCamera(),this._renderTarget),this._forceRender=!1,this._updateShadowsAndAO=!0,this._pixotron.blit()):(this._renderer.clear(),this._renderer.render(this._scene,this._cameraControl.getCamera()),this._renderer.clearDepth()),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))}_animateCamera(){this._cameraControl&&(this._cameraControl.animateCamera(this._delta)||!this._pixotron||this._forceRender?(this._lightSetting instanceof E&&this._cameraControl.getCamera()instanceof THREE.PerspectiveCamera&&this._lightSetting.update(this._cameraControl.getCamera(),this._cameraControl.getTargetPosition()),this._pixotron&&(this._pixotron.needsUpdate=!0)):(this._pixotron.autoShadowsClear=!1,this._pixotron.autoSAOClear=!1)),this._environment&&this._environment.needsCamera()&&this._cameraControl instanceof w&&this._environment.updateCamera(this._cameraControl.getCamera())}_setupScene(t,e){const{x:i,y:s}=this._domHelper.getClientDimensions();this._scene=new THREE.Scene,(e=e||!1)||(this._scene.background=new THREE.Color(this._initData.colors.DEFAULT_BACKGROUND)),THREE.Math={DEG2RAD:THREE.MathUtils.DEG2RAD};const n={format:THREE.RGBAFormat,minFilter:THREE.NearestFilter,magFilter:THREE.NearestFilter},r=THREE.sRGBEncoding,o=Math.floor(i*window.devicePixelRatio),a=Math.floor(s*window.devicePixelRatio);l()?this._renderTarget=new THREE.WebGLMultisampleRenderTarget(o,a,n):this._renderTarget=new THREE.WebGLRenderTarget(o,a,n),this._renderTarget.texture.encoding=r,this._renderer=new THREE.WebGLRenderer({antialias:!0,alpha:!0}),this._renderer.setPixelRatio(window.devicePixelRatio),this._renderer.setSize(i,s),this._renderer.outputEncoding=THREE.sRGBEncoding,this._renderer.gammaFactor=2.2,this._renderer.autoClear=!1,this._renderer.shadowMap.enabled=!0,this._renderer.shadowMap.type=THREE.PCFSoftShadowMap,this._maxAnisotropy=this._renderer.capabilities.getMaxAnisotropy(),this._renderer.domElement.classList.add(this._canvasID),this._domHelper.element.appendChild(this._renderer.domElement),this._getInputManager().addEvents(this._renderer.domElement),this._environmentLoader.setRendererAndScene(this._renderer,this._scene),this._environmentLoader.registerEnvironmentChangedCallback(()=>this._requestRender()),this._requestRender(),window.addEventListener("resize",this,!1),window.addEventListener("keydown",this,!1),window.addEventListener("keyup",this,!1),this.sceneChanged()}_tabVisible(t){this.updateCamera(),this._renderEverything()}setupScene(t,e){this._setupScene(t,e)}updateCamera(){const{x:t,y:e}=this._domHelper.getClientDimensions();this._renderer.setSize(t,e);const i=this._renderer.getPixelRatio();if(this._renderTarget){const s=Math.floor(t*i),n=Math.floor(e*i);this._renderTarget.setSize(s,n)}if(this._pixotron){this._pixotron.autoShadowsClear=!0,this._pixotron.autoSAOClear=!0,this._forceRender=!0;try{this._pixotron.setSize(t,e)}catch(t){console.warn(t)}}this._cameraControl.updateCamera(),this._requestRender()}_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()}clearScene(){let t=[];this._scene.children.forEach(e=>{this._isPartOfScene(e)&&t.push(e)}),t.forEach(t=>{_(t),this._scene.remove(t)}),this._renderer.renderLists.dispose()}enableHD(){this._pixotron=new window.PIXOTRON.Pixotron(this.getPixotronParams()),this._pixotronUtil=new y(this._pixotron),this._environment instanceof C&&(this._environment.setPixotron(this._pixotron,this._renderer,this._cameraControl.getCamera(),this.getBakedShadowParams()),this._environment.setLoadedCallback(()=>setTimeout(()=>this._requestRender(),500))),this._requestRender()}_loadGLTF(t,e,i,s,n,r,o){return new Promise((a,h)=>{this._staticItemLoader.loadGLTF(t,e,i,s,n,r,null,o).then(t=>{this._setCamera("GLTF",t),a(t)},h)})}_loadGLB(t,e,i,s,n,r,o,a){return new Promise((h,_)=>{this._staticItemLoader.loadGLB(t,e,i,s,n,r,o,a).then(t=>{this._setCamera("GLB",t),h(t)},_)})}_setCamera(t,e){if(!e)return void console.warn("could not set camera for gltf",e);const i=new THREE.Box3;i.setFromObject(e),"GLB"===t?this._cameraControl instanceof w&&this._cameraControl.updateToBounds(i,!1):"GLTF"===t&&(this._cameraControl instanceof w&&this._cameraControl.updateAndReset(i.getSize(new THREE.Vector3),i.getCenter(new THREE.Vector3),-15,70,5,!1),this._cameraControl instanceof f&&this._cameraControl.updateToBounds(i.getSize(new THREE.Vector3),i.getCenter(new THREE.Vector3))),this.updateCamera()}showGUI(){if(this._initData.disableDebugGUI)return;const t=document.createElement("style");t.innerText=".dg.main{position:absolute;z-index:100;top:0;left:0;}",document.head.appendChild(t),this._scriptLoader.fetch(v,{id:"dat-gui-js"}).then(()=>{let t=d(!1);t&&(this._domHelper.element.appendChild(t.domElement),this._guiLoaded())},t=>console.error(t))}_guiLoaded(){let t=d();t&&(this._lightSetting&&this._lightSetting.showGUI(),this._pixotron&&this._pixotronUtil.showGUI(),this._environment&&this._environment.showGUI(),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 i=e[t];this._addGUIListener(i)}),i.__controllers&&i.__controllers.forEach(t=>{t.onFinishChange(()=>{this._guiParamChanged()})})})}_guiParamChanged(){this._requestRender()}showStats(){e.import("./stats-helper-e5e90e31.nomodule.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)}resume(){this.updateCamera(),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),this._renderEverything()}destroy(){this.pause(),this.cleanUp()}handleEvent(t){switch(t.type){case"resize":this._onWindowResize();break;case"keydown":this._onKeyDown(t);break;case"keyup":this._onKeyUp(t)}}loadSceneSettings(t){let e,i;return e=t.environment?new Promise(e=>{(new R).load(this._scene,this._renderer.domElement,this._environment,t).then(t=>{this._setEnvironment(t),e()})}):Promise.resolve(),t.lights?(this._lightSetting=new E(this._scene,this._lightSetting),i=this._lightSetting.loadFromObject(t)):i=Promise.resolve(),new Promise((t,s)=>{Promise.all([e,i]).then(()=>{this._requestRender(),t()},s)})}_setEnvironment(t){this._environment=t,this._pixotron&&this._environment instanceof C&&(this._environment.setPixotron(this._pixotron,this._renderer,this._cameraControl.getCamera(),this.getBakedShadowParams()),this._environment.setLoadedCallback(()=>setTimeout(()=>this._requestRender(),500)))}loadQualitySetting(t){this._pixotron&&(new m).set(this._pixotron,t)}async loadDynamicLightSetting(t){this._lightSetting=new E(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=c.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(){this._updateBounds(this.getBounds()),this._renderEverything()}_updateBounds(t){if(t){if(this.updateEnvironment(t),this._lightSetting&&this._lightSetting.needsBounds()&&this._lightSetting.updateBounds(t),this._pixotronUtil){const e=new THREE.Sphere;t.getBoundingSphere(e),this._pixotronUtil.updateBounds(e)}this._requestRender()}}setCameraOffset(t){const e=this._cameraControl.getCamera();e.offset?(e.offset=t,this._requestRender()):console.warn("Cannot set offset, current camera does not support it")}getCameraOffset(){const t=this._cameraControl.getCamera();return t.offset?JSON.parse(JSON.stringify(t.offset)):{left:0,top:0,right:1,bottom:1}}getPerspectiveOffsetCamera(){const t=this._domHelper.getClientDimensions(),e=t.x,i=t.y;return p().createCamera(30,e/i,.1,20)}updateEnvironment(t,e=!1){if(t&&this._environment&&this._environment.needsBounds()){const i=t.getSize(new THREE.Vector3);i.x+i.y+i.z!==0&&this._environment.updateBounds(t.getSize(new THREE.Vector3),e)}this._environment instanceof C&&this._environment.update()}}return a([h],t.prototype,"_domHelper",void 0),a([h],t.prototype,"_scriptLoader",void 0),a([h],t.prototype,"_lifeCycleManager",void 0),a([h],t.prototype,"_staticItemLoader",void 0),a([h],t.prototype,"_environmentLoader",void 0),a([h],t.prototype,"_initData",void 0),t})())}}}));
|
|
2
|
-
//# sourceMappingURL=scene-manager-
|
|
1
|
+
System.register(["./rapi-access-a81e13ca.nomodule.js","./main-thread-to-worker-4fc95d50.nomodule.js","./pixotron-637b5b31.nomodule.js"],(function(t,e){var i,s,n,r,o,a,h,_,d,c,p,m,l,u,g,E,w,y,C,v,R;return{setters:[function(t){i=t.t,s=t.u,n=t.a8,r=t.a9,o=t.v,a=t._,h=t.i,_=t.e,d=t.h,c=t.f,p=t.R,m=t.aa},function(t){l=t.i},function(t){u=t.d,g=t.i,E=t.D,w=t.C,y=t.b,C=t.B,v=t.f,R=t.c}],execute:function(){class f extends u{constructor(t,e,i){super(t,e,i),this._scale=1,this._state=0,this._size=20,this._center=new THREE.Vector3,this._raycaster=new THREE.Raycaster,this._lastPosition=new THREE.Vector2,this._zoomPosition=new THREE.Vector3,this._lastZoom=0,this._zoomSpeed=Math.pow(.95,2),this._cameraZoom=1,this._initCamera(i||new THREE.Vector3(0,10,0));let s=new THREE.PlaneGeometry(1e3,1e3);s.rotateX(-Math.PI/2),this._plane=new THREE.Mesh(s,new THREE.MeshStandardMaterial)}_getCamera(){return this._camera||this._initCamera(new THREE.Vector3(0,10,0)),this._camera}_initCamera(t){let{x:e,y:i}=this._domHelper.getClientDimensions(),s=e/i*this._size,n=this._size;this._camera=new THREE.OrthographicCamera(s/-2,s/2,n/2,n/-2,1,1e3),this._camera.position.copy(t),this._cameraPosition=t,this._camera.lookAt(new THREE.Vector3(0,0,0))}updateCamera(){let{x:t,y:e}=this._domHelper.getClientDimensions(),i=t/e*this._size,s=this._size;this._camera.left=i/-2,this._camera.right=i/2,this._camera.top=s/2,this._camera.bottom=s/-2,this._camera.updateProjectionMatrix()}_initInputListener(){this._inputListeners.push({key:3,fun:t=>{this._locked||(this._state=1,this._lastPosition.set(t.position.x,t.position.y),this.dispatchEvent(0))}}),this._inputListeners.push({key:6,fun:t=>{1!==this._state||this._locked||(this._move(new THREE.Vector2(t.position.x,t.position.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._scale/=this._zoomSpeed,this._zoomTo(t.position,1),this._update()}}),this._inputListeners.push({key:8,fun:t=>{t.event&&(t.event.stopPropagation(),t.event.preventDefault()),this._scale*=this._zoomSpeed,this._zoomTo(t.position,-1),this._update()}})}_zoomTo(t,e){if(Date.now()-this._lastZoom>200){if(e>0||this._cameraZoom>=1){const e=this.getInputPosition(t);this._raycaster.setFromCamera(e,this._camera);const i=this._raycaster.intersectObject(this._plane);if(i.length<=0)return;const s=i.pop().point;this._zoomPosition.copy(s)}else this._zoomPosition.copy(this._center);this._cameraPosition.x=this._zoomPosition.x,this._cameraPosition.z=this._zoomPosition.z}this._lastZoom=Date.now()}_move(t,e){let i=new THREE.Vector2;i.subVectors(this._lastPosition,t),i.divideScalar(100),this._cameraPosition.x+=i.x*(2===e?1.1:1),this._cameraPosition.z+=i.y*(2===e?1.1:1),this._lastPosition.copy(t)}updateToBounds(t,e){let{x:i,y:s}=this._domHelper.getClientDimensions(),n=i/s;this._size=Math.max(t.x,t.z);let r=this._size,o=this._size;n>1?r=this._size*n:o=this._size*(s/i),this._center.copy(e),this._camera.left=r/-2,this._camera.right=r/2,this._camera.top=o/2,this._camera.bottom=o/-2,this._camera.zoom=1,this._camera.position.set(this._center.x,10,this._center.z),this._cameraPosition.copy(this._camera.position)}_update(t){this._scale=Math.min(this._scale,5),this._scale=Math.max(this._scale,.8),this._cameraZoom=this._scale,this._camera.updateProjectionMatrix()}animateCamera(t){return!(!super.animateCamera(t)&&Math.abs(this._cameraZoom-this._camera.zoom)<=.01||(this._camera.zoom=THREE.MathUtils.lerp(this._camera.zoom,this._cameraZoom,10*t),0))}}t("C",f);const L=Math.PI/4;class x extends u{constructor(t,e,s,n){super(t,e,s),this._state=0,this._rotationSpeed=1,this._keyMap=new Map,this.minPolarAngle=i(-60),this.maxPolarAngle=i(60),this._camera=n||new THREE.PerspectiveCamera,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(5),this._camera.layers.enable(4),s?this._camera.position.set(s.x,1.5,s.z):this._camera.position.set(0,1.5,0),this._cameraPosition=new THREE.Vector3,this._cameraPosition.copy(this._camera.position),this._cameraRotation=new THREE.Quaternion,this._pitch=0,this._yaw=0;let r=new THREE.Euler(-this._pitch,this._yaw,0,"ZYX");this._cameraRotation.setFromEuler(r),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*L*e),this._update(),this.dispatchEvent(1)),Math.abs(i)>.2&&(this._rotateVertical(.01*L*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,r=this.getCamera(),o=s(e,r.position),a=n(i,r.quaternion);if(!e||o&&a)return!1;let h=this.getCamera().position.clone(),_=Math.min(10*t,1);h.lerp(e,_),this.getCamera().position.copy(h);let d=this.getCamera().quaternion.clone(),c=Math.min(5*t,1);d.slerp(i,c),this.getCamera().setRotationFromQuaternion(d);let p=!1;return this._keyMap.forEach(t=>{t&&(p=!0)}),p&&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 THREE.Vector2(t.position.x,t.position.y)),2!==this._state||this._locked||(this._orbit(new THREE.Vector2(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(){r(this._downPosition,this._position)<g&&1===this._state&&(this._state=2,this._orbit(new THREE.Vector2(this._position.x,this._position.y)),this._moveForward())}_update(t){let e=new THREE.Euler(-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 THREE.Vector3(0,0,0),s=!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(-L*this._rotationSpeed*e),s=!0),t.get(39)&&(this._rotateHorizontal(L*this._rotationSpeed*e),s=!0),t.get(16)&&(i.x*=3,i.z*=3),!(0===i.x&&0===i.y&&0===i.z&&!s||(i.applyQuaternion(this.getCamera().quaternion),this._cameraPosition.add(new THREE.Vector3(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 THREE.Vector2(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),o(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())}}t("a",x),t("S",(()=>{class t{constructor(t,e,i,s,n){this._maxAnisotropy=1,this._clock=new THREE.Clock,this._delta=0,this._renderListener=null,this._stopRendering=!1,this._forceRender=!1,this._updateShadowsAndAO=!0,this._lastChange=Date.now(),this._running=!1,this._onAfterRender=()=>{},this._creator_=t,this._canvasID=i,this.createCameraControl(s),this._addCameraControlListener(),this._setupScene(e,n),document.addEventListener("visibilitychange",this._tabVisible.bind(this)),this._renderListener=()=>{this._requestRender()},this._getInputManager().addEventListener(7,this._renderListener,this),this._getInputManager().addEventListener(8,this._renderListener,this),this._lifeCycleManager.addEventListener(this)}onBeforeRender(){}_changeCameraControl(t){this._cameraControl&&this._cameraControl.cleanUp(),t instanceof x&&(this._getInputManager().removeEventListener(7,this._renderListener),this._getInputManager().removeEventListener(8,this._renderListener)),this._cameraControl instanceof x&&(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,this._requestRender,this),this._cameraControl.addEventListener(1,this._requestRender,this),this._cameraControl.addEventListener(2,this._requestRender,this),this._cameraControl.addEventListener(6,this._requestRender,this)}_renderEverything(){this._pixotron&&(this._forceRender=!0,this._updateShadowsAndAO=!0),this._requestRender()}_renderWithoutShadowsAndAO(){this._pixotron&&(this._forceRender=!0,this._updateShadowsAndAO=!1),this._requestRender()}_requestRender(){if(!this._renderer)return;const t=()=>{this._delta=this._clock.getDelta(),this._animateCamera(),this._cameraControl.getCamera().layers.mask=65535,this._renderLoopFunction&&(this._renderLoopFunction(),this._renderLoopFunction=null),this.onBeforeRender(),this._statsHelper&&this._statsHelper.updateRenderInfo(this._renderer.info),this._pixotron?(this._pixotron.autoShadowsClear=this._updateShadowsAndAO,this._pixotron.autoSAOClear=this._updateShadowsAndAO,this._forceRender&&(this._pixotron.needsUpdate=!0),this._pixotron.render(this._renderer,this._scene,this._cameraControl.getCamera(),this._renderTarget),this._forceRender=!1,this._updateShadowsAndAO=!0,this._pixotron.blit()):(this._renderer.clear(),this._renderer.render(this._scene,this._cameraControl.getCamera()),this._renderer.clearDepth()),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))}_animateCamera(){this._cameraControl&&(this._cameraControl.animateCamera(this._delta)||!this._pixotron||this._forceRender?(this._lightSetting instanceof E&&this._cameraControl.getCamera()instanceof THREE.PerspectiveCamera&&this._lightSetting.update(this._cameraControl.getCamera(),this._cameraControl.getTargetPosition()),this._pixotron&&(this._pixotron.needsUpdate=!0)):(this._pixotron.autoShadowsClear=!1,this._pixotron.autoSAOClear=!1)),this._environment&&this._environment.needsCamera()&&this._cameraControl instanceof w&&this._environment.updateCamera(this._cameraControl.getCamera())}_setupScene(t,e){const{x:i,y:s}=this._domHelper.getClientDimensions();this._scene=new THREE.Scene,(e=e||!1)||(this._scene.background=new THREE.Color(this._initData.colors.DEFAULT_BACKGROUND)),THREE.Math={DEG2RAD:THREE.MathUtils.DEG2RAD};const n={format:THREE.RGBAFormat,minFilter:THREE.NearestFilter,magFilter:THREE.NearestFilter},r=THREE.sRGBEncoding,o=Math.floor(i*window.devicePixelRatio),a=Math.floor(s*window.devicePixelRatio);l()?this._renderTarget=new THREE.WebGLMultisampleRenderTarget(o,a,n):this._renderTarget=new THREE.WebGLRenderTarget(o,a,n),this._renderTarget.texture.encoding=r,this._renderer=new THREE.WebGLRenderer({antialias:!0,alpha:!0}),this._renderer.setPixelRatio(window.devicePixelRatio),this._renderer.setSize(i,s),this._renderer.outputEncoding=THREE.sRGBEncoding,this._renderer.gammaFactor=2.2,this._renderer.autoClear=!1,this._renderer.shadowMap.enabled=!0,this._renderer.shadowMap.type=THREE.PCFSoftShadowMap,this._maxAnisotropy=this._renderer.capabilities.getMaxAnisotropy(),this._renderer.domElement.classList.add(this._canvasID),this._domHelper.element.appendChild(this._renderer.domElement),this._getInputManager().addEvents(this._renderer.domElement),this._environmentLoader.setRendererAndScene(this._renderer,this._scene),this._environmentLoader.registerEnvironmentChangedCallback(()=>this._requestRender()),this._requestRender(),window.addEventListener("resize",this,!1),window.addEventListener("keydown",this,!1),window.addEventListener("keyup",this,!1),this.sceneChanged()}_tabVisible(t){this.updateCamera(),this._renderEverything()}setupScene(t,e){this._setupScene(t,e)}updateCamera(){const{x:t,y:e}=this._domHelper.getClientDimensions();this._renderer.setSize(t,e);const i=this._renderer.getPixelRatio();if(this._renderTarget){const s=Math.floor(t*i),n=Math.floor(e*i);this._renderTarget.setSize(s,n)}if(this._pixotron){this._pixotron.autoShadowsClear=!0,this._pixotron.autoSAOClear=!0,this._forceRender=!0;try{this._pixotron.setSize(t,e)}catch(t){console.warn(t)}}this._cameraControl.updateCamera(),this._requestRender()}_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()}clearScene(){let t=[];this._scene.children.forEach(e=>{this._isPartOfScene(e)&&t.push(e)}),t.forEach(t=>{_(t),this._scene.remove(t)}),this._renderer.renderLists.dispose()}enableHD(){this._pixotron=new window.PIXOTRON.Pixotron(this.getPixotronParams()),this._pixotronUtil=new y(this._pixotron),this._environment instanceof C&&(this._environment.setPixotron(this._pixotron,this._renderer,this._cameraControl.getCamera(),this.getBakedShadowParams()),this._environment.setLoadedCallback(()=>setTimeout(()=>this._requestRender(),500))),this._requestRender()}_loadGLTF(t,e,i,s,n,r,o){return new Promise((a,h)=>{this._staticItemLoader.loadGLTF(t,e,i,s,n,r,null,o).then(t=>{this._setCamera("GLTF",t),a(t)},h)})}_loadGLB(t,e,i,s,n,r,o,a){return new Promise((h,_)=>{this._staticItemLoader.loadGLB(t,e,i,s,n,r,o,a).then(t=>{this._setCamera("GLB",t),h(t)},_)})}_setCamera(t,e){if(!e)return void console.warn("could not set camera for gltf",e);const i=new THREE.Box3;i.setFromObject(e),"GLB"===t?this._cameraControl instanceof w&&this._cameraControl.updateToBounds(i,!1):"GLTF"===t&&(this._cameraControl instanceof w&&this._cameraControl.updateAndReset(i.getSize(new THREE.Vector3),i.getCenter(new THREE.Vector3),-15,70,5,!1),this._cameraControl instanceof f&&this._cameraControl.updateToBounds(i.getSize(new THREE.Vector3),i.getCenter(new THREE.Vector3))),this.updateCamera()}showGUI(){if(this._initData.disableDebugGUI)return;const t=document.createElement("style");t.innerText=".dg.main{position:absolute;z-index:100;top:0;left:0;}",document.head.appendChild(t),this._scriptLoader.fetch(v,{id:"dat-gui-js"}).then(()=>{let t=d(!1);t&&(this._domHelper.element.appendChild(t.domElement),this._guiLoaded())},t=>console.error(t))}_guiLoaded(){let t=d();t&&(this._lightSetting&&this._lightSetting.showGUI(),this._pixotron&&this._pixotronUtil.showGUI(),this._environment&&this._environment.showGUI(),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 i=e[t];this._addGUIListener(i)}),i.__controllers&&i.__controllers.forEach(t=>{t.onFinishChange(()=>{this._guiParamChanged()})})})}_guiParamChanged(){this._requestRender()}showStats(){e.import("./stats-helper-2a5a8533.nomodule.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)}resume(){this.updateCamera(),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),this._renderEverything()}destroy(){this.pause(),this.cleanUp()}handleEvent(t){switch(t.type){case"resize":this._onWindowResize();break;case"keydown":this._onKeyDown(t);break;case"keyup":this._onKeyUp(t)}}loadSceneSettings(t){let e,i;return e=t.environment?new Promise(e=>{(new R).load(this._scene,this._renderer.domElement,this._environment,t).then(t=>{this._setEnvironment(t),e()})}):Promise.resolve(),t.lights?(this._lightSetting=new E(this._scene,this._lightSetting),i=this._lightSetting.loadFromObject(t)):i=Promise.resolve(),new Promise((t,s)=>{Promise.all([e,i]).then(()=>{this._requestRender(),t()},s)})}_setEnvironment(t){this._environment=t,this._pixotron&&this._environment instanceof C&&(this._environment.setPixotron(this._pixotron,this._renderer,this._cameraControl.getCamera(),this.getBakedShadowParams()),this._environment.setLoadedCallback(()=>setTimeout(()=>this._requestRender(),500)))}loadQualitySetting(t){this._pixotron&&(new m).set(this._pixotron,t)}async loadDynamicLightSetting(t){this._lightSetting=new E(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=c.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(){this._updateBounds(this.getBounds()),this._renderEverything()}_updateBounds(t){if(t){if(this.updateEnvironment(t),this._lightSetting&&this._lightSetting.needsBounds()&&this._lightSetting.updateBounds(t),this._pixotronUtil){const e=new THREE.Sphere;t.getBoundingSphere(e),this._pixotronUtil.updateBounds(e)}this._requestRender()}}setCameraOffset(t){const e=this._cameraControl.getCamera();e.offset?(e.offset=t,this._requestRender()):console.warn("Cannot set offset, current camera does not support it")}getCameraOffset(){const t=this._cameraControl.getCamera();return t.offset?JSON.parse(JSON.stringify(t.offset)):{left:0,top:0,right:1,bottom:1}}getPerspectiveOffsetCamera(){const t=this._domHelper.getClientDimensions(),e=t.x,i=t.y;return p().createCamera(30,e/i,.1,20)}updateEnvironment(t,e=!1){if(t&&this._environment&&this._environment.needsBounds()){const i=t.getSize(new THREE.Vector3);i.x+i.y+i.z!==0&&this._environment.updateBounds(t.getSize(new THREE.Vector3),e)}this._environment instanceof C&&this._environment.update()}}return a([h],t.prototype,"_domHelper",void 0),a([h],t.prototype,"_scriptLoader",void 0),a([h],t.prototype,"_lifeCycleManager",void 0),a([h],t.prototype,"_staticItemLoader",void 0),a([h],t.prototype,"_environmentLoader",void 0),a([h],t.prototype,"_initData",void 0),t})())}}}));
|
|
2
|
+
//# sourceMappingURL=scene-manager-05f53318.nomodule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scene-manager-05f53318.nomodule.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{t as toRadiant,u as position3VectorsAreEqual,a8 as rotationQuaternionsAreEqual,a9 as getDelta,v as position2VectorsAreEqual,_ as __decorate,i as inject,e as dispose,h as getGUI,f as DynamicLightSettingLoader,R as RoomleComponentFactoryInitializer,aa as DynamicQualitySettingLoader}from"./rapi-access-589f9e14.js";import{i as isWebGl2}from"./main-thread-to-worker-5447c1c5.js";import{d as CameraControl,i as MIN_MOVE_DISTANCE,D as DynamicLightSetting,C as CameraControl3D,b as PixotronUtil,B as BakedShadowEnvironment,f as DAT_GUI_FILE_NAME,c as DynamicEnvironmentSettingLoader}from"./pixotron-27b4f029.js";class CameraControl2D extends CameraControl{constructor(t,e,i){super(t,e,i),this._scale=1,this._state=0,this._size=20,this._center=new THREE.Vector3,this._raycaster=new THREE.Raycaster,this._lastPosition=new THREE.Vector2,this._zoomPosition=new THREE.Vector3,this._lastZoom=0,this._zoomSpeed=Math.pow(.95,2),this._cameraZoom=1,this._initCamera(i||new THREE.Vector3(0,10,0));let s=new THREE.PlaneGeometry(1e3,1e3);s.rotateX(-Math.PI/2),this._plane=new THREE.Mesh(s,new THREE.MeshStandardMaterial)}_getCamera(){return this._camera||this._initCamera(new THREE.Vector3(0,10,0)),this._camera}_initCamera(t){let{x:e,y:i}=this._domHelper.getClientDimensions(),s=e/i*this._size,n=this._size;this._camera=new THREE.OrthographicCamera(s/-2,s/2,n/2,n/-2,1,1e3),this._camera.position.copy(t),this._cameraPosition=t,this._camera.lookAt(new THREE.Vector3(0,0,0))}updateCamera(){let{x:t,y:e}=this._domHelper.getClientDimensions(),i=t/e*this._size,s=this._size;this._camera.left=i/-2,this._camera.right=i/2,this._camera.top=s/2,this._camera.bottom=s/-2,this._camera.updateProjectionMatrix()}_initInputListener(){this._inputListeners.push({key:3,fun:t=>{this._locked||(this._state=1,this._lastPosition.set(t.position.x,t.position.y),this.dispatchEvent(0))}}),this._inputListeners.push({key:6,fun:t=>{1!==this._state||this._locked||(this._move(new THREE.Vector2(t.position.x,t.position.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._scale/=this._zoomSpeed,this._zoomTo(t.position,1),this._update()}}),this._inputListeners.push({key:8,fun:t=>{t.event&&(t.event.stopPropagation(),t.event.preventDefault()),this._scale*=this._zoomSpeed,this._zoomTo(t.position,-1),this._update()}})}_zoomTo(t,e){if(Date.now()-this._lastZoom>200){if(e>0||this._cameraZoom>=1){const e=this.getInputPosition(t);this._raycaster.setFromCamera(e,this._camera);const i=this._raycaster.intersectObject(this._plane);if(i.length<=0)return;const s=i.pop().point;this._zoomPosition.copy(s)}else this._zoomPosition.copy(this._center);this._cameraPosition.x=this._zoomPosition.x,this._cameraPosition.z=this._zoomPosition.z}this._lastZoom=Date.now()}_move(t,e){let i=new THREE.Vector2;i.subVectors(this._lastPosition,t),i.divideScalar(100),this._cameraPosition.x+=i.x*(2===e?1.1:1),this._cameraPosition.z+=i.y*(2===e?1.1:1),this._lastPosition.copy(t)}updateToBounds(t,e){let{x:i,y:s}=this._domHelper.getClientDimensions(),n=i/s;this._size=Math.max(t.x,t.z);let a=this._size,r=this._size;n>1?a=this._size*n:r=this._size*(s/i),this._center.copy(e),this._camera.left=a/-2,this._camera.right=a/2,this._camera.top=r/2,this._camera.bottom=r/-2,this._camera.zoom=1,this._camera.position.set(this._center.x,10,this._center.z),this._cameraPosition.copy(this._camera.position)}_update(t){this._scale=Math.min(this._scale,5),this._scale=Math.max(this._scale,.8),this._cameraZoom=this._scale,this._camera.updateProjectionMatrix()}animateCamera(t){return!(!super.animateCamera(t)&&Math.abs(this._cameraZoom-this._camera.zoom)<=.01||(this._camera.zoom=THREE.MathUtils.lerp(this._camera.zoom,this._cameraZoom,10*t),0))}}const KEYBOARD_ROTATION_ANGLE=Math.PI/4;class CameraControlFirstPerson extends CameraControl{constructor(t,e,i,s){super(t,e,i),this._state=0,this._rotationSpeed=1,this._keyMap=new Map,this.minPolarAngle=toRadiant(-60),this.maxPolarAngle=toRadiant(60),this._camera=s||new THREE.PerspectiveCamera,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(5),this._camera.layers.enable(4),i?this._camera.position.set(i.x,1.5,i.z):this._camera.position.set(0,1.5,0),this._cameraPosition=new THREE.Vector3,this._cameraPosition.copy(this._camera.position),this._cameraRotation=new THREE.Quaternion,this._pitch=0,this._yaw=0;let n=new THREE.Euler(-this._pitch,this._yaw,0,"ZYX");this._cameraRotation.setFromEuler(n),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*KEYBOARD_ROTATION_ANGLE*e),this._update(),this.dispatchEvent(1)),Math.abs(i)>.2&&(this._rotateVertical(.01*KEYBOARD_ROTATION_ANGLE*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,s=this.getCamera(),n=position3VectorsAreEqual(e,s.position),a=rotationQuaternionsAreEqual(i,s.quaternion);if(!e||n&&a)return!1;let r=this.getCamera().position.clone(),o=Math.min(10*t,1);r.lerp(e,o),this.getCamera().position.copy(r);let h=this.getCamera().quaternion.clone(),_=Math.min(5*t,1);h.slerp(i,_),this.getCamera().setRotationFromQuaternion(h);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 THREE.Vector2(t.position.x,t.position.y)),2!==this._state||this._locked||(this._orbit(new THREE.Vector2(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(){getDelta(this._downPosition,this._position)<MIN_MOVE_DISTANCE&&1===this._state&&(this._state=2,this._orbit(new THREE.Vector2(this._position.x,this._position.y)),this._moveForward())}_update(t){let e=new THREE.Euler(-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 THREE.Vector3(0,0,0),s=!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(-KEYBOARD_ROTATION_ANGLE*this._rotationSpeed*e),s=!0),t.get(39)&&(this._rotateHorizontal(KEYBOARD_ROTATION_ANGLE*this._rotationSpeed*e),s=!0),t.get(16)&&(i.x*=3,i.z*=3),!(0===i.x&&0===i.y&&0===i.z&&!s||(i.applyQuaternion(this.getCamera().quaternion),this._cameraPosition.add(new THREE.Vector3(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 THREE.Vector2(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),position2VectorsAreEqual(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())}}let SceneManager=(()=>{class t{constructor(t,e,i,s,n){this._maxAnisotropy=1,this._clock=new THREE.Clock,this._delta=0,this._renderListener=null,this._stopRendering=!1,this._forceRender=!1,this._updateShadowsAndAO=!0,this._lastChange=Date.now(),this._running=!1,this._onAfterRender=()=>{},this._creator_=t,this._canvasID=i,this.createCameraControl(s),this._addCameraControlListener(),this._setupScene(e,n),document.addEventListener("visibilitychange",this._tabVisible.bind(this)),this._renderListener=()=>{this._requestRender()},this._getInputManager().addEventListener(7,this._renderListener,this),this._getInputManager().addEventListener(8,this._renderListener,this),this._lifeCycleManager.addEventListener(this)}onBeforeRender(){}_changeCameraControl(t){this._cameraControl&&this._cameraControl.cleanUp(),t instanceof CameraControlFirstPerson&&(this._getInputManager().removeEventListener(7,this._renderListener),this._getInputManager().removeEventListener(8,this._renderListener)),this._cameraControl instanceof CameraControlFirstPerson&&(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,this._requestRender,this),this._cameraControl.addEventListener(1,this._requestRender,this),this._cameraControl.addEventListener(2,this._requestRender,this),this._cameraControl.addEventListener(6,this._requestRender,this)}_renderEverything(){this._pixotron&&(this._forceRender=!0,this._updateShadowsAndAO=!0),this._requestRender()}_renderWithoutShadowsAndAO(){this._pixotron&&(this._forceRender=!0,this._updateShadowsAndAO=!1),this._requestRender()}_requestRender(){if(!this._renderer)return;const t=()=>{this._delta=this._clock.getDelta(),this._animateCamera(),this._cameraControl.getCamera().layers.mask=65535,this._renderLoopFunction&&(this._renderLoopFunction(),this._renderLoopFunction=null),this.onBeforeRender(),this._statsHelper&&this._statsHelper.updateRenderInfo(this._renderer.info),this._pixotron?(this._pixotron.autoShadowsClear=this._updateShadowsAndAO,this._pixotron.autoSAOClear=this._updateShadowsAndAO,this._forceRender&&(this._pixotron.needsUpdate=!0),this._pixotron.render(this._renderer,this._scene,this._cameraControl.getCamera(),this._renderTarget),this._forceRender=!1,this._updateShadowsAndAO=!0,this._pixotron.blit()):(this._renderer.clear(),this._renderer.render(this._scene,this._cameraControl.getCamera()),this._renderer.clearDepth()),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))}_animateCamera(){this._cameraControl&&(this._cameraControl.animateCamera(this._delta)||!this._pixotron||this._forceRender?(this._lightSetting instanceof DynamicLightSetting&&this._cameraControl.getCamera()instanceof THREE.PerspectiveCamera&&this._lightSetting.update(this._cameraControl.getCamera(),this._cameraControl.getTargetPosition()),this._pixotron&&(this._pixotron.needsUpdate=!0)):(this._pixotron.autoShadowsClear=!1,this._pixotron.autoSAOClear=!1)),this._environment&&this._environment.needsCamera()&&this._cameraControl instanceof CameraControl3D&&this._environment.updateCamera(this._cameraControl.getCamera())}_setupScene(t,e){const{x:i,y:s}=this._domHelper.getClientDimensions();this._scene=new THREE.Scene,(e=e||!1)||(this._scene.background=new THREE.Color(this._initData.colors.DEFAULT_BACKGROUND)),THREE.Math={DEG2RAD:THREE.MathUtils.DEG2RAD};const n={format:THREE.RGBAFormat,minFilter:THREE.NearestFilter,magFilter:THREE.NearestFilter},a=THREE.sRGBEncoding,r=Math.floor(i*window.devicePixelRatio),o=Math.floor(s*window.devicePixelRatio);isWebGl2()?this._renderTarget=new THREE.WebGLMultisampleRenderTarget(r,o,n):this._renderTarget=new THREE.WebGLRenderTarget(r,o,n),this._renderTarget.texture.encoding=a,this._renderer=new THREE.WebGLRenderer({antialias:!0,alpha:!0}),this._renderer.setPixelRatio(window.devicePixelRatio),this._renderer.setSize(i,s),this._renderer.outputEncoding=THREE.sRGBEncoding,this._renderer.gammaFactor=2.2,this._renderer.autoClear=!1,this._renderer.shadowMap.enabled=!0,this._renderer.shadowMap.type=THREE.PCFSoftShadowMap,this._maxAnisotropy=this._renderer.capabilities.getMaxAnisotropy(),this._renderer.domElement.classList.add(this._canvasID),this._domHelper.element.appendChild(this._renderer.domElement),this._getInputManager().addEvents(this._renderer.domElement),this._environmentLoader.setRendererAndScene(this._renderer,this._scene),this._environmentLoader.registerEnvironmentChangedCallback(()=>this._requestRender()),this._requestRender(),window.addEventListener("resize",this,!1),window.addEventListener("keydown",this,!1),window.addEventListener("keyup",this,!1),this.sceneChanged()}_tabVisible(t){this.updateCamera(),this._renderEverything()}setupScene(t,e){this._setupScene(t,e)}updateCamera(){const{x:t,y:e}=this._domHelper.getClientDimensions();this._renderer.setSize(t,e);const i=this._renderer.getPixelRatio();if(this._renderTarget){const s=Math.floor(t*i),n=Math.floor(e*i);this._renderTarget.setSize(s,n)}if(this._pixotron){this._pixotron.autoShadowsClear=!0,this._pixotron.autoSAOClear=!0,this._forceRender=!0;try{this._pixotron.setSize(t,e)}catch(t){console.warn(t)}}this._cameraControl.updateCamera(),this._requestRender()}_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()}clearScene(){let t=[];this._scene.children.forEach(e=>{this._isPartOfScene(e)&&t.push(e)}),t.forEach(t=>{dispose(t),this._scene.remove(t)}),this._renderer.renderLists.dispose()}enableHD(){this._pixotron=new window.PIXOTRON.Pixotron(this.getPixotronParams()),this._pixotronUtil=new PixotronUtil(this._pixotron),this._environment instanceof BakedShadowEnvironment&&(this._environment.setPixotron(this._pixotron,this._renderer,this._cameraControl.getCamera(),this.getBakedShadowParams()),this._environment.setLoadedCallback(()=>setTimeout(()=>this._requestRender(),500))),this._requestRender()}_loadGLTF(t,e,i,s,n,a,r){return new Promise((o,h)=>{this._staticItemLoader.loadGLTF(t,e,i,s,n,a,null,r).then(t=>{this._setCamera("GLTF",t),o(t)},h)})}_loadGLB(t,e,i,s,n,a,r,o){return new Promise((h,_)=>{this._staticItemLoader.loadGLB(t,e,i,s,n,a,r,o).then(t=>{this._setCamera("GLB",t),h(t)},_)})}_setCamera(t,e){if(!e)return void console.warn("could not set camera for gltf",e);const i=new THREE.Box3;i.setFromObject(e),"GLB"===t?this._cameraControl instanceof CameraControl3D&&this._cameraControl.updateToBounds(i,!1):"GLTF"===t&&(this._cameraControl instanceof CameraControl3D&&this._cameraControl.updateAndReset(i.getSize(new THREE.Vector3),i.getCenter(new THREE.Vector3),-15,70,5,!1),this._cameraControl instanceof CameraControl2D&&this._cameraControl.updateToBounds(i.getSize(new THREE.Vector3),i.getCenter(new THREE.Vector3))),this.updateCamera()}showGUI(){if(this._initData.disableDebugGUI)return;const t=document.createElement("style");t.innerText=".dg.main{position:absolute;z-index:100;top:0;left:0;}",document.head.appendChild(t),this._scriptLoader.fetch(DAT_GUI_FILE_NAME,{id:"dat-gui-js"}).then(()=>{let t=getGUI(!1);t&&(this._domHelper.element.appendChild(t.domElement),this._guiLoaded())},t=>console.error(t))}_guiLoaded(){let t=getGUI();t&&(this._lightSetting&&this._lightSetting.showGUI(),this._pixotron&&this._pixotronUtil.showGUI(),this._environment&&this._environment.showGUI(),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 i=e[t];this._addGUIListener(i)}),i.__controllers&&i.__controllers.forEach(t=>{t.onFinishChange(()=>{this._guiParamChanged()})})})}_guiParamChanged(){this._requestRender()}showStats(){import("./stats-helper-b45d08c5.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)}resume(){this.updateCamera(),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),this._renderEverything()}destroy(){this.pause(),this.cleanUp()}handleEvent(t){switch(t.type){case"resize":this._onWindowResize();break;case"keydown":this._onKeyDown(t);break;case"keyup":this._onKeyUp(t)}}loadSceneSettings(t){let e,i;return e=t.environment?new Promise(e=>{(new DynamicEnvironmentSettingLoader).load(this._scene,this._renderer.domElement,this._environment,t).then(t=>{this._setEnvironment(t),e()})}):Promise.resolve(),t.lights?(this._lightSetting=new DynamicLightSetting(this._scene,this._lightSetting),i=this._lightSetting.loadFromObject(t)):i=Promise.resolve(),new Promise((t,s)=>{Promise.all([e,i]).then(()=>{this._requestRender(),t()},s)})}_setEnvironment(t){this._environment=t,this._pixotron&&this._environment instanceof BakedShadowEnvironment&&(this._environment.setPixotron(this._pixotron,this._renderer,this._cameraControl.getCamera(),this.getBakedShadowParams()),this._environment.setLoadedCallback(()=>setTimeout(()=>this._requestRender(),500)))}loadQualitySetting(t){this._pixotron&&(new DynamicQualitySettingLoader).set(this._pixotron,t)}async loadDynamicLightSetting(t){this._lightSetting=new DynamicLightSetting(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=DynamicLightSettingLoader.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(){this._updateBounds(this.getBounds()),this._renderEverything()}_updateBounds(t){if(t){if(this.updateEnvironment(t),this._lightSetting&&this._lightSetting.needsBounds()&&this._lightSetting.updateBounds(t),this._pixotronUtil){const e=new THREE.Sphere;t.getBoundingSphere(e),this._pixotronUtil.updateBounds(e)}this._requestRender()}}setCameraOffset(t){const e=this._cameraControl.getCamera();e.offset?(e.offset=t,this._requestRender()):console.warn("Cannot set offset, current camera does not support it")}getCameraOffset(){const t=this._cameraControl.getCamera();return t.offset?JSON.parse(JSON.stringify(t.offset)):{left:0,top:0,right:1,bottom:1}}getPerspectiveOffsetCamera(){const t=this._domHelper.getClientDimensions(),e=t.x,i=t.y;return RoomleComponentFactoryInitializer().createCamera(30,e/i,.1,20)}updateEnvironment(t,e=!1){if(t&&this._environment&&this._environment.needsBounds()){const i=t.getSize(new THREE.Vector3);i.x+i.y+i.z!==0&&this._environment.updateBounds(t.getSize(new THREE.Vector3),e)}this._environment instanceof BakedShadowEnvironment&&this._environment.update()}}return __decorate([inject],t.prototype,"_domHelper",void 0),__decorate([inject],t.prototype,"_scriptLoader",void 0),__decorate([inject],t.prototype,"_lifeCycleManager",void 0),__decorate([inject],t.prototype,"_staticItemLoader",void 0),__decorate([inject],t.prototype,"_environmentLoader",void 0),__decorate([inject],t.prototype,"_initData",void 0),t})();export{CameraControl2D as C,SceneManager as S,CameraControlFirstPerson as a};
|
|
2
|
-
//# sourceMappingURL=scene-manager-
|
|
1
|
+
import{t as toRadiant,u as position3VectorsAreEqual,a8 as rotationQuaternionsAreEqual,a9 as getDelta,v as position2VectorsAreEqual,_ as __decorate,i as inject,e as dispose,h as getGUI,f as DynamicLightSettingLoader,R as RoomleComponentFactoryInitializer,aa as DynamicQualitySettingLoader}from"./rapi-access-cfbedd27.js";import{i as isWebGl2}from"./main-thread-to-worker-5447c1c5.js";import{d as CameraControl,i as MIN_MOVE_DISTANCE,D as DynamicLightSetting,C as CameraControl3D,b as PixotronUtil,B as BakedShadowEnvironment,f as DAT_GUI_FILE_NAME,c as DynamicEnvironmentSettingLoader}from"./pixotron-9b93dc57.js";class CameraControl2D extends CameraControl{constructor(t,e,i){super(t,e,i),this._scale=1,this._state=0,this._size=20,this._center=new THREE.Vector3,this._raycaster=new THREE.Raycaster,this._lastPosition=new THREE.Vector2,this._zoomPosition=new THREE.Vector3,this._lastZoom=0,this._zoomSpeed=Math.pow(.95,2),this._cameraZoom=1,this._initCamera(i||new THREE.Vector3(0,10,0));let s=new THREE.PlaneGeometry(1e3,1e3);s.rotateX(-Math.PI/2),this._plane=new THREE.Mesh(s,new THREE.MeshStandardMaterial)}_getCamera(){return this._camera||this._initCamera(new THREE.Vector3(0,10,0)),this._camera}_initCamera(t){let{x:e,y:i}=this._domHelper.getClientDimensions(),s=e/i*this._size,n=this._size;this._camera=new THREE.OrthographicCamera(s/-2,s/2,n/2,n/-2,1,1e3),this._camera.position.copy(t),this._cameraPosition=t,this._camera.lookAt(new THREE.Vector3(0,0,0))}updateCamera(){let{x:t,y:e}=this._domHelper.getClientDimensions(),i=t/e*this._size,s=this._size;this._camera.left=i/-2,this._camera.right=i/2,this._camera.top=s/2,this._camera.bottom=s/-2,this._camera.updateProjectionMatrix()}_initInputListener(){this._inputListeners.push({key:3,fun:t=>{this._locked||(this._state=1,this._lastPosition.set(t.position.x,t.position.y),this.dispatchEvent(0))}}),this._inputListeners.push({key:6,fun:t=>{1!==this._state||this._locked||(this._move(new THREE.Vector2(t.position.x,t.position.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._scale/=this._zoomSpeed,this._zoomTo(t.position,1),this._update()}}),this._inputListeners.push({key:8,fun:t=>{t.event&&(t.event.stopPropagation(),t.event.preventDefault()),this._scale*=this._zoomSpeed,this._zoomTo(t.position,-1),this._update()}})}_zoomTo(t,e){if(Date.now()-this._lastZoom>200){if(e>0||this._cameraZoom>=1){const e=this.getInputPosition(t);this._raycaster.setFromCamera(e,this._camera);const i=this._raycaster.intersectObject(this._plane);if(i.length<=0)return;const s=i.pop().point;this._zoomPosition.copy(s)}else this._zoomPosition.copy(this._center);this._cameraPosition.x=this._zoomPosition.x,this._cameraPosition.z=this._zoomPosition.z}this._lastZoom=Date.now()}_move(t,e){let i=new THREE.Vector2;i.subVectors(this._lastPosition,t),i.divideScalar(100),this._cameraPosition.x+=i.x*(2===e?1.1:1),this._cameraPosition.z+=i.y*(2===e?1.1:1),this._lastPosition.copy(t)}updateToBounds(t,e){let{x:i,y:s}=this._domHelper.getClientDimensions(),n=i/s;this._size=Math.max(t.x,t.z);let a=this._size,r=this._size;n>1?a=this._size*n:r=this._size*(s/i),this._center.copy(e),this._camera.left=a/-2,this._camera.right=a/2,this._camera.top=r/2,this._camera.bottom=r/-2,this._camera.zoom=1,this._camera.position.set(this._center.x,10,this._center.z),this._cameraPosition.copy(this._camera.position)}_update(t){this._scale=Math.min(this._scale,5),this._scale=Math.max(this._scale,.8),this._cameraZoom=this._scale,this._camera.updateProjectionMatrix()}animateCamera(t){return!(!super.animateCamera(t)&&Math.abs(this._cameraZoom-this._camera.zoom)<=.01||(this._camera.zoom=THREE.MathUtils.lerp(this._camera.zoom,this._cameraZoom,10*t),0))}}const KEYBOARD_ROTATION_ANGLE=Math.PI/4;class CameraControlFirstPerson extends CameraControl{constructor(t,e,i,s){super(t,e,i),this._state=0,this._rotationSpeed=1,this._keyMap=new Map,this.minPolarAngle=toRadiant(-60),this.maxPolarAngle=toRadiant(60),this._camera=s||new THREE.PerspectiveCamera,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(5),this._camera.layers.enable(4),i?this._camera.position.set(i.x,1.5,i.z):this._camera.position.set(0,1.5,0),this._cameraPosition=new THREE.Vector3,this._cameraPosition.copy(this._camera.position),this._cameraRotation=new THREE.Quaternion,this._pitch=0,this._yaw=0;let n=new THREE.Euler(-this._pitch,this._yaw,0,"ZYX");this._cameraRotation.setFromEuler(n),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*KEYBOARD_ROTATION_ANGLE*e),this._update(),this.dispatchEvent(1)),Math.abs(i)>.2&&(this._rotateVertical(.01*KEYBOARD_ROTATION_ANGLE*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,s=this.getCamera(),n=position3VectorsAreEqual(e,s.position),a=rotationQuaternionsAreEqual(i,s.quaternion);if(!e||n&&a)return!1;let r=this.getCamera().position.clone(),o=Math.min(10*t,1);r.lerp(e,o),this.getCamera().position.copy(r);let h=this.getCamera().quaternion.clone(),_=Math.min(5*t,1);h.slerp(i,_),this.getCamera().setRotationFromQuaternion(h);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 THREE.Vector2(t.position.x,t.position.y)),2!==this._state||this._locked||(this._orbit(new THREE.Vector2(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(){getDelta(this._downPosition,this._position)<MIN_MOVE_DISTANCE&&1===this._state&&(this._state=2,this._orbit(new THREE.Vector2(this._position.x,this._position.y)),this._moveForward())}_update(t){let e=new THREE.Euler(-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 THREE.Vector3(0,0,0),s=!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(-KEYBOARD_ROTATION_ANGLE*this._rotationSpeed*e),s=!0),t.get(39)&&(this._rotateHorizontal(KEYBOARD_ROTATION_ANGLE*this._rotationSpeed*e),s=!0),t.get(16)&&(i.x*=3,i.z*=3),!(0===i.x&&0===i.y&&0===i.z&&!s||(i.applyQuaternion(this.getCamera().quaternion),this._cameraPosition.add(new THREE.Vector3(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 THREE.Vector2(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),position2VectorsAreEqual(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())}}let SceneManager=(()=>{class t{constructor(t,e,i,s,n){this._maxAnisotropy=1,this._clock=new THREE.Clock,this._delta=0,this._renderListener=null,this._stopRendering=!1,this._forceRender=!1,this._updateShadowsAndAO=!0,this._lastChange=Date.now(),this._running=!1,this._onAfterRender=()=>{},this._creator_=t,this._canvasID=i,this.createCameraControl(s),this._addCameraControlListener(),this._setupScene(e,n),document.addEventListener("visibilitychange",this._tabVisible.bind(this)),this._renderListener=()=>{this._requestRender()},this._getInputManager().addEventListener(7,this._renderListener,this),this._getInputManager().addEventListener(8,this._renderListener,this),this._lifeCycleManager.addEventListener(this)}onBeforeRender(){}_changeCameraControl(t){this._cameraControl&&this._cameraControl.cleanUp(),t instanceof CameraControlFirstPerson&&(this._getInputManager().removeEventListener(7,this._renderListener),this._getInputManager().removeEventListener(8,this._renderListener)),this._cameraControl instanceof CameraControlFirstPerson&&(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,this._requestRender,this),this._cameraControl.addEventListener(1,this._requestRender,this),this._cameraControl.addEventListener(2,this._requestRender,this),this._cameraControl.addEventListener(6,this._requestRender,this)}_renderEverything(){this._pixotron&&(this._forceRender=!0,this._updateShadowsAndAO=!0),this._requestRender()}_renderWithoutShadowsAndAO(){this._pixotron&&(this._forceRender=!0,this._updateShadowsAndAO=!1),this._requestRender()}_requestRender(){if(!this._renderer)return;const t=()=>{this._delta=this._clock.getDelta(),this._animateCamera(),this._cameraControl.getCamera().layers.mask=65535,this._renderLoopFunction&&(this._renderLoopFunction(),this._renderLoopFunction=null),this.onBeforeRender(),this._statsHelper&&this._statsHelper.updateRenderInfo(this._renderer.info),this._pixotron?(this._pixotron.autoShadowsClear=this._updateShadowsAndAO,this._pixotron.autoSAOClear=this._updateShadowsAndAO,this._forceRender&&(this._pixotron.needsUpdate=!0),this._pixotron.render(this._renderer,this._scene,this._cameraControl.getCamera(),this._renderTarget),this._forceRender=!1,this._updateShadowsAndAO=!0,this._pixotron.blit()):(this._renderer.clear(),this._renderer.render(this._scene,this._cameraControl.getCamera()),this._renderer.clearDepth()),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))}_animateCamera(){this._cameraControl&&(this._cameraControl.animateCamera(this._delta)||!this._pixotron||this._forceRender?(this._lightSetting instanceof DynamicLightSetting&&this._cameraControl.getCamera()instanceof THREE.PerspectiveCamera&&this._lightSetting.update(this._cameraControl.getCamera(),this._cameraControl.getTargetPosition()),this._pixotron&&(this._pixotron.needsUpdate=!0)):(this._pixotron.autoShadowsClear=!1,this._pixotron.autoSAOClear=!1)),this._environment&&this._environment.needsCamera()&&this._cameraControl instanceof CameraControl3D&&this._environment.updateCamera(this._cameraControl.getCamera())}_setupScene(t,e){const{x:i,y:s}=this._domHelper.getClientDimensions();this._scene=new THREE.Scene,(e=e||!1)||(this._scene.background=new THREE.Color(this._initData.colors.DEFAULT_BACKGROUND)),THREE.Math={DEG2RAD:THREE.MathUtils.DEG2RAD};const n={format:THREE.RGBAFormat,minFilter:THREE.NearestFilter,magFilter:THREE.NearestFilter},a=THREE.sRGBEncoding,r=Math.floor(i*window.devicePixelRatio),o=Math.floor(s*window.devicePixelRatio);isWebGl2()?this._renderTarget=new THREE.WebGLMultisampleRenderTarget(r,o,n):this._renderTarget=new THREE.WebGLRenderTarget(r,o,n),this._renderTarget.texture.encoding=a,this._renderer=new THREE.WebGLRenderer({antialias:!0,alpha:!0}),this._renderer.setPixelRatio(window.devicePixelRatio),this._renderer.setSize(i,s),this._renderer.outputEncoding=THREE.sRGBEncoding,this._renderer.gammaFactor=2.2,this._renderer.autoClear=!1,this._renderer.shadowMap.enabled=!0,this._renderer.shadowMap.type=THREE.PCFSoftShadowMap,this._maxAnisotropy=this._renderer.capabilities.getMaxAnisotropy(),this._renderer.domElement.classList.add(this._canvasID),this._domHelper.element.appendChild(this._renderer.domElement),this._getInputManager().addEvents(this._renderer.domElement),this._environmentLoader.setRendererAndScene(this._renderer,this._scene),this._environmentLoader.registerEnvironmentChangedCallback(()=>this._requestRender()),this._requestRender(),window.addEventListener("resize",this,!1),window.addEventListener("keydown",this,!1),window.addEventListener("keyup",this,!1),this.sceneChanged()}_tabVisible(t){this.updateCamera(),this._renderEverything()}setupScene(t,e){this._setupScene(t,e)}updateCamera(){const{x:t,y:e}=this._domHelper.getClientDimensions();this._renderer.setSize(t,e);const i=this._renderer.getPixelRatio();if(this._renderTarget){const s=Math.floor(t*i),n=Math.floor(e*i);this._renderTarget.setSize(s,n)}if(this._pixotron){this._pixotron.autoShadowsClear=!0,this._pixotron.autoSAOClear=!0,this._forceRender=!0;try{this._pixotron.setSize(t,e)}catch(t){console.warn(t)}}this._cameraControl.updateCamera(),this._requestRender()}_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()}clearScene(){let t=[];this._scene.children.forEach(e=>{this._isPartOfScene(e)&&t.push(e)}),t.forEach(t=>{dispose(t),this._scene.remove(t)}),this._renderer.renderLists.dispose()}enableHD(){this._pixotron=new window.PIXOTRON.Pixotron(this.getPixotronParams()),this._pixotronUtil=new PixotronUtil(this._pixotron),this._environment instanceof BakedShadowEnvironment&&(this._environment.setPixotron(this._pixotron,this._renderer,this._cameraControl.getCamera(),this.getBakedShadowParams()),this._environment.setLoadedCallback(()=>setTimeout(()=>this._requestRender(),500))),this._requestRender()}_loadGLTF(t,e,i,s,n,a,r){return new Promise((o,h)=>{this._staticItemLoader.loadGLTF(t,e,i,s,n,a,null,r).then(t=>{this._setCamera("GLTF",t),o(t)},h)})}_loadGLB(t,e,i,s,n,a,r,o){return new Promise((h,_)=>{this._staticItemLoader.loadGLB(t,e,i,s,n,a,r,o).then(t=>{this._setCamera("GLB",t),h(t)},_)})}_setCamera(t,e){if(!e)return void console.warn("could not set camera for gltf",e);const i=new THREE.Box3;i.setFromObject(e),"GLB"===t?this._cameraControl instanceof CameraControl3D&&this._cameraControl.updateToBounds(i,!1):"GLTF"===t&&(this._cameraControl instanceof CameraControl3D&&this._cameraControl.updateAndReset(i.getSize(new THREE.Vector3),i.getCenter(new THREE.Vector3),-15,70,5,!1),this._cameraControl instanceof CameraControl2D&&this._cameraControl.updateToBounds(i.getSize(new THREE.Vector3),i.getCenter(new THREE.Vector3))),this.updateCamera()}showGUI(){if(this._initData.disableDebugGUI)return;const t=document.createElement("style");t.innerText=".dg.main{position:absolute;z-index:100;top:0;left:0;}",document.head.appendChild(t),this._scriptLoader.fetch(DAT_GUI_FILE_NAME,{id:"dat-gui-js"}).then(()=>{let t=getGUI(!1);t&&(this._domHelper.element.appendChild(t.domElement),this._guiLoaded())},t=>console.error(t))}_guiLoaded(){let t=getGUI();t&&(this._lightSetting&&this._lightSetting.showGUI(),this._pixotron&&this._pixotronUtil.showGUI(),this._environment&&this._environment.showGUI(),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 i=e[t];this._addGUIListener(i)}),i.__controllers&&i.__controllers.forEach(t=>{t.onFinishChange(()=>{this._guiParamChanged()})})})}_guiParamChanged(){this._requestRender()}showStats(){import("./stats-helper-7471cb85.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)}resume(){this.updateCamera(),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),this._renderEverything()}destroy(){this.pause(),this.cleanUp()}handleEvent(t){switch(t.type){case"resize":this._onWindowResize();break;case"keydown":this._onKeyDown(t);break;case"keyup":this._onKeyUp(t)}}loadSceneSettings(t){let e,i;return e=t.environment?new Promise(e=>{(new DynamicEnvironmentSettingLoader).load(this._scene,this._renderer.domElement,this._environment,t).then(t=>{this._setEnvironment(t),e()})}):Promise.resolve(),t.lights?(this._lightSetting=new DynamicLightSetting(this._scene,this._lightSetting),i=this._lightSetting.loadFromObject(t)):i=Promise.resolve(),new Promise((t,s)=>{Promise.all([e,i]).then(()=>{this._requestRender(),t()},s)})}_setEnvironment(t){this._environment=t,this._pixotron&&this._environment instanceof BakedShadowEnvironment&&(this._environment.setPixotron(this._pixotron,this._renderer,this._cameraControl.getCamera(),this.getBakedShadowParams()),this._environment.setLoadedCallback(()=>setTimeout(()=>this._requestRender(),500)))}loadQualitySetting(t){this._pixotron&&(new DynamicQualitySettingLoader).set(this._pixotron,t)}async loadDynamicLightSetting(t){this._lightSetting=new DynamicLightSetting(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=DynamicLightSettingLoader.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(){this._updateBounds(this.getBounds()),this._renderEverything()}_updateBounds(t){if(t){if(this.updateEnvironment(t),this._lightSetting&&this._lightSetting.needsBounds()&&this._lightSetting.updateBounds(t),this._pixotronUtil){const e=new THREE.Sphere;t.getBoundingSphere(e),this._pixotronUtil.updateBounds(e)}this._requestRender()}}setCameraOffset(t){const e=this._cameraControl.getCamera();e.offset?(e.offset=t,this._requestRender()):console.warn("Cannot set offset, current camera does not support it")}getCameraOffset(){const t=this._cameraControl.getCamera();return t.offset?JSON.parse(JSON.stringify(t.offset)):{left:0,top:0,right:1,bottom:1}}getPerspectiveOffsetCamera(){const t=this._domHelper.getClientDimensions(),e=t.x,i=t.y;return RoomleComponentFactoryInitializer().createCamera(30,e/i,.1,20)}updateEnvironment(t,e=!1){if(t&&this._environment&&this._environment.needsBounds()){const i=t.getSize(new THREE.Vector3);i.x+i.y+i.z!==0&&this._environment.updateBounds(t.getSize(new THREE.Vector3),e)}this._environment instanceof BakedShadowEnvironment&&this._environment.update()}}return __decorate([inject],t.prototype,"_domHelper",void 0),__decorate([inject],t.prototype,"_scriptLoader",void 0),__decorate([inject],t.prototype,"_lifeCycleManager",void 0),__decorate([inject],t.prototype,"_staticItemLoader",void 0),__decorate([inject],t.prototype,"_environmentLoader",void 0),__decorate([inject],t.prototype,"_initData",void 0),t})();export{CameraControl2D as C,SceneManager as S,CameraControlFirstPerson as a};
|
|
2
|
+
//# sourceMappingURL=scene-manager-827c6f28.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scene-manager-827c6f28.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
package/lib/static/{ConfiguratorKernel-7379813e2cd03c0d.js → ConfiguratorKernel-4ca6a302619d4901.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
var _scriptDir,ConfiguratorKernel=(_scriptDir="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,function(t){var n,r,e;t=t||{},n||(n=void 0!==t?t:{}),n.ready=new Promise((function(t,n){r=t,e=n}));var i=Object.assign({},n),a="./this.program",o=(t,n)=>{throw n},c="";"undefined"!=typeof document&&document.currentScript&&(c=document.currentScript.src),_scriptDir&&(c=_scriptDir),c=0!==c.indexOf("blob:")?c.substr(0,c.replace(/[?#].*/,"").lastIndexOf("/")+1):"";var u=n.print||console.log.bind(console),f=n.printErr||console.warn.bind(console);Object.assign(n,i),i=null,n.thisProgram&&(a=n.thisProgram),n.quit&&(o=n.quit);var s,l=0;n.wasmBinary&&(s=n.wasmBinary);var h=n.noExitRuntime||!0;"object"!=typeof WebAssembly&&z("no native wasm support detected");var v,b=!1,p="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function y(t,n,r){var e=n+r;for(r=n;t[r]&&!(r>=e);)++r;if(16<r-n&&t.subarray&&p)return p.decode(t.subarray(n,r));for(e="";n<r;){var i=t[n++];if(128&i){var a=63&t[n++];if(192==(224&i))e+=String.fromCharCode((31&i)<<6|a);else{var o=63&t[n++];65536>(i=224==(240&i)?(15&i)<<12|a<<6|o:(7&i)<<18|a<<12|o<<6|63&t[n++])?e+=String.fromCharCode(i):(i-=65536,e+=String.fromCharCode(55296|i>>10,56320|1023&i))}}else e+=String.fromCharCode(i)}return e}function d(t,n,r,e){if(0<e){e=r+e-1;for(var i=0;i<t.length;++i){var a=t.charCodeAt(i);if(55296<=a&&57343>=a&&(a=65536+((1023&a)<<10)|1023&t.charCodeAt(++i)),127>=a){if(r>=e)break;n[r++]=a}else{if(2047>=a){if(r+1>=e)break;n[r++]=192|a>>6}else{if(65535>=a){if(r+2>=e)break;n[r++]=224|a>>12}else{if(r+3>=e)break;n[r++]=240|a>>18,n[r++]=128|a>>12&63}n[r++]=128|a>>6&63}n[r++]=128|63&a}}n[r]=0}}function g(t){for(var n=0,r=0;r<t.length;++r){var e=t.charCodeAt(r);55296<=e&&57343>=e&&(e=65536+((1023&e)<<10)|1023&t.charCodeAt(++r)),127>=e?++n:n=2047>=e?n+2:65535>=e?n+3:n+4}return n}var m,w,T,_,S,R,A,C,W,j="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0;function k(t,n){for(var r=t>>1,e=r+n/2;!(r>=e)&&S[r];)++r;if(32<(r<<=1)-t&&j)return j.decode(T.subarray(t,r));for(r="",e=0;!(e>=n/2);++e){var i=_[t+2*e>>1];if(0==i)break;r+=String.fromCharCode(i)}return r}function P(t,n,r){if(void 0===r&&(r=2147483647),2>r)return 0;var e=n;r=(r-=2)<2*t.length?r/2:t.length;for(var i=0;i<r;++i)_[n>>1]=t.charCodeAt(i),n+=2;return _[n>>1]=0,n-e}function D(t){return 2*t.length}function F(t,n){for(var r=0,e="";!(r>=n/4);){var i=R[t+4*r>>2];if(0==i)break;++r,65536<=i?(i-=65536,e+=String.fromCharCode(55296|i>>10,56320|1023&i)):e+=String.fromCharCode(i)}return e}function E(t,n,r){if(void 0===r&&(r=2147483647),4>r)return 0;var e=n;r=e+r-4;for(var i=0;i<t.length;++i){var a=t.charCodeAt(i);if(55296<=a&&57343>=a&&(a=65536+((1023&a)<<10)|1023&t.charCodeAt(++i)),R[n>>2]=a,(n+=4)+4>r)break}return R[n>>2]=0,n-e}function O(t){for(var n=0,r=0;r<t.length;++r){var e=t.charCodeAt(r);55296<=e&&57343>=e&&++r,n+=4}return n}function U(){var t=v.buffer;m=t,n.HEAP8=w=new Int8Array(t),n.HEAP16=_=new Int16Array(t),n.HEAP32=R=new Int32Array(t),n.HEAPU8=T=new Uint8Array(t),n.HEAPU16=S=new Uint16Array(t),n.HEAPU32=A=new Uint32Array(t),n.HEAPF32=C=new Float32Array(t),n.HEAPF64=W=new Float64Array(t)}var M,x=[],Y=[],I=[],V=[];function H(){var t=n.preRun.shift();x.unshift(t)}var X,B=0,Z=null,$=null;function z(t){throw n.onAbort&&n.onAbort(t),f(t="Aborted("+t+")"),b=!0,t=new WebAssembly.RuntimeError(t+". Build with -s ASSERTIONS=1 for more info."),e(t),t}function q(){return X.startsWith("data:application/octet-stream;base64,")}if(n.preloadedImages={},n.preloadedAudios={},X="ConfiguratorKernel.wasm",!q()){var N=X;X=n.locateFile?n.locateFile(N,c):c+N}function K(){var t=X;try{if(t==X&&s)return new Uint8Array(s);throw"both async and sync fetching of the wasm failed"}catch(t){z(t)}}function L(t){for(;0<t.length;){var r=t.shift();if("function"==typeof r)r(n);else{var e=r.jd;"number"==typeof e?void 0===r.yc?G(e)():G(e)(r.yc):e(void 0===r.yc?null:r.yc)}}}function G(t){return M.get(t)}function J(t){this.Fc=t,this.Sb=t-16,this.wc=function(t){R[this.Sb+4>>2]=t},this.lc=function(){return R[this.Sb+4>>2]},this.cc=function(t){R[this.Sb+8>>2]=t},this.Qc=function(){return R[this.Sb+8>>2]},this.ec=function(){R[this.Sb>>2]=0},this.Dc=function(t){w[this.Sb+12>>0]=t?1:0},this.Pc=function(){return 0!=w[this.Sb+12>>0]},this.sc=function(t){w[this.Sb+13>>0]=t?1:0},this.Hc=function(){return 0!=w[this.Sb+13>>0]},this.bc=function(t,n){this.wc(t),this.cc(n),this.ec(),this.Dc(!1),this.sc(!1)},this.xc=function(){R[this.Sb>>2]+=1},this.Zc=function(){var t=R[this.Sb>>2];return R[this.Sb>>2]=t-1,1===t}}function Q(t){this.zc=function(){kn(this.Sb),this.Sb=0},this.cc=function(t){R[this.Sb>>2]=t},this.hc=function(){return R[this.Sb>>2]},this.bc=function(t){R[this.Sb+4>>2]=t},this.ec=function(){return this.Sb+4},this.wc=function(){return R[this.Sb+4>>2]},this.Jc=function(){if(xn(this.ic().lc()))return R[this.hc()>>2];var t=this.wc();return 0!==t?t:this.hc()},this.ic=function(){return new J(this.hc())},void 0===t?(this.Sb=Pn(8),this.bc(0)):this.Sb=t}var tt=[],nt=0;function rt(t){return kn(new J(t).Sb)}function et(t){if(t.Zc()&&!t.Hc()){var n=t.Qc();n&&G(n)(t.Fc),rt(t.Fc)}}var it=0;function at(){var t=tt.pop();t||z("no exception to throw");var n=t.ic(),r=t.hc();throw n.Hc()?t.zc():(tt.push(t),n.sc(!0),n.Dc(!1),nt++),it=r,r}var ot={};function ct(t){for(;t.length;){var n=t.pop();t.pop()(n)}}function ut(t){return this.fromWireType(A[t>>2])}var ft={},st={},lt={};function ht(t){if(void 0===t)return"_unknown";var n=(t=t.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return 48<=n&&57>=n?"_"+t:t}function vt(t,n){return t=ht(t),new Function("body","return function "+t+'() {\n "use strict"; return body.apply(this, arguments);\n};\n')(n)}function bt(t){var n=Error,r=vt(t,(function(n){this.name=t,this.message=n,void 0!==(n=Error(n).stack)&&(this.stack=this.toString()+"\n"+n.replace(/^Error(:[^\n]*)?\n/,""))}));return r.prototype=Object.create(n.prototype),r.prototype.constructor=r,r.prototype.toString=function(){return void 0===this.message?this.name:this.name+": "+this.message},r}var pt=void 0;function yt(t){throw new pt(t)}function dt(t,n,r){function e(n){(n=r(n)).length!==t.length&&yt("Mismatched type converter count");for(var e=0;e<t.length;++e)St(t[e],n[e])}t.forEach((function(t){lt[t]=n}));var i=Array(n.length),a=[],o=0;n.forEach((function(t,n){st.hasOwnProperty(t)?i[n]=st[t]:(a.push(t),ft.hasOwnProperty(t)||(ft[t]=[]),ft[t].push((function(){i[n]=st[t],++o===a.length&&e(i)})))})),0===a.length&&e(i)}function gt(t){switch(t){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+t)}}var mt=void 0;function wt(t){for(var n="";T[t];)n+=mt[T[t++]];return n}var Tt=void 0;function _t(t){throw new Tt(t)}function St(t,n,r={}){if(!("argPackAdvance"in n))throw new TypeError("registerType registeredInstance requires argPackAdvance");var e=n.name;if(t||_t('type "'+e+'" must have a positive integer typeid pointer'),st.hasOwnProperty(t)){if(r.Uc)return;_t("Cannot register type '"+e+"' twice")}st[t]=n,delete lt[t],ft.hasOwnProperty(t)&&(n=ft[t],delete ft[t],n.forEach((function(t){t()})))}function Rt(t){_t(t.Rb.Ub.Tb.name+" instance already deleted")}var At=!1;function Ct(){}function Wt(t){--t.count.value,0===t.count.value&&(t.Wb?t.Zb.ac(t.Wb):t.Ub.Tb.ac(t.Sb))}var jt={},kt=[];function Pt(){for(;kt.length;){var t=kt.pop();t.Rb.fc=!1,t.delete()}}var Dt=void 0,Ft={};function Et(t,n){return n.Ub&&n.Sb||yt("makeClassHandle requires ptr and ptrType"),!!n.Zb!=!!n.Wb&&yt("Both smartPtrType and smartPtr must be specified"),n.count={value:1},Ot(Object.create(t,{Rb:{value:n}}))}function Ot(t){return"undefined"==typeof FinalizationRegistry?(Ot=t=>t,t):(At=new FinalizationRegistry(t=>{Wt(t.Rb)}),Ct=t=>{At.unregister(t)},(Ot=t=>{var n=t.Rb;return n.Wb&&At.register(t,{Rb:n},t),t})(t))}function Ut(){}function Mt(t,n,r){if(void 0===t[n].Vb){var e=t[n];t[n]=function(){return t[n].Vb.hasOwnProperty(arguments.length)||_t("Function '"+r+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+t[n].Vb+")!"),t[n].Vb[arguments.length].apply(this,arguments)},t[n].Vb=[],t[n].Vb[e.pc]=e}}function xt(t,r,e){n.hasOwnProperty(t)?((void 0===e||void 0!==n[t].Vb&&void 0!==n[t].Vb[e])&&_t("Cannot register public name '"+t+"' twice"),Mt(n,t,t),n.hasOwnProperty(e)&&_t("Cannot register multiple overloads of a function with the same number of arguments ("+e+")!"),n[t].Vb[e]=r):(n[t]=r,void 0!==e&&(n[t].ld=e))}function Yt(t,n,r,e,i,a,o,c){this.name=t,this.constructor=n,this.jc=r,this.ac=e,this.$b=i,this.Nc=a,this.oc=o,this.Lc=c,this.Xc=[]}function It(t,n,r){for(;n!==r;)n.oc||_t("Expected null or instance of "+r.name+", got an instance of "+n.name),t=n.oc(t),n=n.$b;return t}function Vt(t,n){return null===n?(this.Ac&&_t("null is not a valid "+this.name),0):(n.Rb||_t('Cannot pass "'+on(n)+'" as a '+this.name),n.Rb.Sb||_t("Cannot pass deleted object as a pointer of type "+this.name),It(n.Rb.Sb,n.Rb.Ub.Tb,this.Tb))}function Ht(t,n){if(null===n){if(this.Ac&&_t("null is not a valid "+this.name),this.rc){var r=this.Bc();return null!==t&&t.push(this.ac,r),r}return 0}if(n.Rb||_t('Cannot pass "'+on(n)+'" as a '+this.name),n.Rb.Sb||_t("Cannot pass deleted object as a pointer of type "+this.name),!this.qc&&n.Rb.Ub.qc&&_t("Cannot convert argument of type "+(n.Rb.Zb?n.Rb.Zb.name:n.Rb.Ub.name)+" to parameter type "+this.name),r=It(n.Rb.Sb,n.Rb.Ub.Tb,this.Tb),this.rc)switch(void 0===n.Rb.Wb&&_t("Passing raw pointer to smart pointer is illegal"),this.cd){case 0:n.Rb.Zb===this?r=n.Rb.Wb:_t("Cannot convert argument of type "+(n.Rb.Zb?n.Rb.Zb.name:n.Rb.Ub.name)+" to parameter type "+this.name);break;case 1:r=n.Rb.Wb;break;case 2:if(n.Rb.Zb===this)r=n.Rb.Wb;else{var e=n.clone();r=this.Yc(r,rn((function(){e.delete()}))),null!==t&&t.push(this.ac,r)}break;default:_t("Unsupporting sharing policy")}return r}function Xt(t,n){return null===n?(this.Ac&&_t("null is not a valid "+this.name),0):(n.Rb||_t('Cannot pass "'+on(n)+'" as a '+this.name),n.Rb.Sb||_t("Cannot pass deleted object as a pointer of type "+this.name),n.Rb.Ub.qc&&_t("Cannot convert argument of type "+n.Rb.Ub.name+" to parameter type "+this.name),It(n.Rb.Sb,n.Rb.Ub.Tb,this.Tb))}function Bt(t,n,r,e,i,a,o,c,u,f,s){this.name=t,this.Tb=n,this.Ac=r,this.qc=e,this.rc=i,this.Wc=a,this.cd=o,this.Ic=c,this.Bc=u,this.Yc=f,this.ac=s,i||void 0!==n.$b?this.toWireType=Ht:(this.toWireType=e?Vt:Xt,this.Yb=null)}function Zt(t,r,e){n.hasOwnProperty(t)||yt("Replacing nonexistant public symbol"),void 0!==n[t].Vb&&void 0!==e?n[t].Vb[e]=r:(n[t]=r,n[t].pc=e)}function $t(t,r){var e=(t=wt(t)).includes("j")?function(t,r){var e=[];return function(){if(e.length=0,Object.assign(e,arguments),t.includes("j")){var i=n["dynCall_"+t];i=e&&e.length?i.apply(null,[r].concat(e)):i.call(null,r)}else i=G(r).apply(null,e);return i}}(t,r):G(r);return"function"!=typeof e&&_t("unknown function pointer with signature "+t+": "+r),e}var zt=void 0;function qt(t){var n=wt(t=Dn(t));return kn(t),n}function Nt(t,n){var r=[],e={};throw n.forEach((function t(n){e[n]||st[n]||(lt[n]?lt[n].forEach(t):(r.push(n),e[n]=!0))})),new zt(t+": "+r.map(qt).join([", "]))}function Kt(t,n){for(var r=[],e=0;e<t;e++)r.push(R[(n>>2)+e]);return r}function Lt(t){var n=Function;if(!(n instanceof Function))throw new TypeError("new_ called with constructor type "+typeof n+" which is not a function");var r=vt(n.name||"unknownFunctionName",(function(){}));return r.prototype=n.prototype,r=new r,(t=n.apply(r,t))instanceof Object?t:r}function Gt(t,n,r,e,i){var a=n.length;2>a&&_t("argTypes array size mismatch! Must at least get return value and 'this' types!");var o=null!==n[1]&&null!==r,c=!1;for(r=1;r<n.length;++r)if(null!==n[r]&&void 0===n[r].Yb){c=!0;break}var u="void"!==n[0].name,f="",s="";for(r=0;r<a-2;++r)f+=(0!==r?", ":"")+"arg"+r,s+=(0!==r?", ":"")+"arg"+r+"Wired";t="return function "+ht(t)+"("+f+") {\nif (arguments.length !== "+(a-2)+") {\nthrowBindingError('function "+t+" called with ' + arguments.length + ' arguments, expected "+(a-2)+" args!');\n}\n",c&&(t+="var destructors = [];\n");var l=c?"destructors":"null";for(f="throwBindingError invoker fn runDestructors retType classParam".split(" "),e=[_t,e,i,ct,n[0],n[1]],o&&(t+="var thisWired = classParam.toWireType("+l+", this);\n"),r=0;r<a-2;++r)t+="var arg"+r+"Wired = argType"+r+".toWireType("+l+", arg"+r+"); // "+n[r+2].name+"\n",f.push("argType"+r),e.push(n[r+2]);if(o&&(s="thisWired"+(0<s.length?", ":"")+s),t+=(u?"var rv = ":"")+"invoker(fn"+(0<s.length?", ":"")+s+");\n",c)t+="runDestructors(destructors);\n";else for(r=o?1:2;r<n.length;++r)a=1===r?"thisWired":"arg"+(r-2)+"Wired",null!==n[r].Yb&&(t+=a+"_dtor("+a+"); // "+n[r].name+"\n",f.push(a+"_dtor"),e.push(n[r].Yb));return u&&(t+="var ret = retType.fromWireType(rv);\nreturn ret;\n"),f.push(t+"}\n"),Lt(f).apply(null,e)}var Jt=[],Qt=[{},{value:void 0},{value:null},{value:!0},{value:!1}];function tn(t){4<t&&0==--Qt[t].Cc&&(Qt[t]=void 0,Jt.push(t))}function nn(t){return t||_t("Cannot use deleted val. handle = "+t),Qt[t].value}function rn(t){switch(t){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:var n=Jt.length?Jt.pop():Qt.length;return Qt[n]={Cc:1,value:t},n}}function en(t,n,r){switch(n){case 0:return function(t){return this.fromWireType((r?w:T)[t])};case 1:return function(t){return this.fromWireType((r?_:S)[t>>1])};case 2:return function(t){return this.fromWireType((r?R:A)[t>>2])};default:throw new TypeError("Unknown integer type: "+t)}}function an(t,n){var r=st[t];return void 0===r&&_t(n+" has unknown type "+qt(t)),r}function on(t){if(null===t)return"null";var n=typeof t;return"object"===n||"array"===n||"function"===n?t.toString():""+t}function cn(t,n){switch(n){case 2:return function(t){return this.fromWireType(C[t>>2])};case 3:return function(t){return this.fromWireType(W[t>>3])};default:throw new TypeError("Unknown float type: "+t)}}function un(t,n,r){switch(n){case 0:return r?function(t){return w[t]}:function(t){return T[t]};case 1:return r?function(t){return _[t>>1]}:function(t){return S[t>>1]};case 2:return r?function(t){return R[t>>2]}:function(t){return A[t>>2]};default:throw new TypeError("Unknown integer type: "+t)}}function fn(t,n){for(var r=Array(t),e=0;e<t;++e)r[e]=an(R[(n>>2)+e],"parameter "+e);return r}var sn={};function ln(t){var n=sn[t];return void 0===n?wt(t):n}var hn=[];function vn(){return"object"==typeof globalThis?globalThis:Function("return this")()}var bn=[],pn={},yn={};function dn(){if(!gn){var t,n={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:a||"./this.program"};for(t in yn)void 0===yn[t]?delete n[t]:n[t]=yn[t];var r=[];for(t in n)r.push(t+"="+n[t]);gn=r}return gn}var gn,mn=[null,[],[]],wn={};function Tn(t){return 0==t%4&&(0!=t%100||0==t%400)}function _n(t,n){for(var r=0,e=0;e<=n;r+=t[e++]);return r}var Sn=[31,29,31,30,31,30,31,31,30,31,30,31],Rn=[31,28,31,30,31,30,31,31,30,31,30,31];function An(t,n){for(t=new Date(t.getTime());0<n;){var r=t.getMonth(),e=(Tn(t.getFullYear())?Sn:Rn)[r];if(!(n>e-t.getDate())){t.setDate(t.getDate()+n);break}n-=e-t.getDate()+1,t.setDate(1),11>r?t.setMonth(r+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return t}pt=n.InternalError=bt("InternalError");for(var Cn=Array(256),Wn=0;256>Wn;++Wn)Cn[Wn]=String.fromCharCode(Wn);mt=Cn,Tt=n.BindingError=bt("BindingError"),Ut.prototype.isAliasOf=function(t){if(!(this instanceof Ut&&t instanceof Ut))return!1;var n=this.Rb.Ub.Tb,r=this.Rb.Sb,e=t.Rb.Ub.Tb;for(t=t.Rb.Sb;n.$b;)r=n.oc(r),n=n.$b;for(;e.$b;)t=e.oc(t),e=e.$b;return n===e&&r===t},Ut.prototype.clone=function(){if(this.Rb.Sb||Rt(this),this.Rb.mc)return this.Rb.count.value+=1,this;var t=Ot,n=Object,r=n.create,e=Object.getPrototypeOf(this),i=this.Rb;return(t=t(r.call(n,e,{Rb:{value:{count:i.count,fc:i.fc,mc:i.mc,Sb:i.Sb,Ub:i.Ub,Wb:i.Wb,Zb:i.Zb}}}))).Rb.count.value+=1,t.Rb.fc=!1,t},Ut.prototype.delete=function(){this.Rb.Sb||Rt(this),this.Rb.fc&&!this.Rb.mc&&_t("Object already scheduled for deletion"),Ct(this),Wt(this.Rb),this.Rb.mc||(this.Rb.Wb=void 0,this.Rb.Sb=void 0)},Ut.prototype.isDeleted=function(){return!this.Rb.Sb},Ut.prototype.deleteLater=function(){return this.Rb.Sb||Rt(this),this.Rb.fc&&!this.Rb.mc&&_t("Object already scheduled for deletion"),kt.push(this),1===kt.length&&Dt&&Dt(Pt),this.Rb.fc=!0,this},n.getInheritedInstanceCount=function(){return Object.keys(Ft).length},n.getLiveInheritedInstances=function(){var t,n=[];for(t in Ft)Ft.hasOwnProperty(t)&&n.push(Ft[t]);return n},n.flushPendingDeletes=Pt,n.setDelayFunction=function(t){Dt=t,kt.length&&Dt&&Dt(Pt)},Bt.prototype.Oc=function(t){return this.Ic&&(t=this.Ic(t)),t},Bt.prototype.Ec=function(t){this.ac&&this.ac(t)},Bt.prototype.argPackAdvance=8,Bt.prototype.readValueFromPointer=ut,Bt.prototype.deleteObject=function(t){null!==t&&t.delete()},Bt.prototype.fromWireType=function(t){function n(){return this.rc?Et(this.Tb.jc,{Ub:this.Wc,Sb:r,Zb:this,Wb:t}):Et(this.Tb.jc,{Ub:this,Sb:t})}var r=this.Oc(t);if(!r)return this.Ec(t),null;var e=function(t,n){for(void 0===n&&_t("ptr should not be undefined");t.$b;)n=t.oc(n),t=t.$b;return Ft[n]}(this.Tb,r);if(void 0!==e)return 0===e.Rb.count.value?(e.Rb.Sb=r,e.Rb.Wb=t,e.clone()):(e=e.clone(),this.Ec(t),e);if(e=this.Tb.Nc(r),!(e=jt[e]))return n.call(this);e=this.qc?e.Kc:e.pointerType;var i=function t(n,r,e){return r===e?n:void 0===e.$b||null===(n=t(n,r,e.$b))?null:e.Lc(n)}(r,this.Tb,e.Tb);return null===i?n.call(this):this.rc?Et(e.Tb.jc,{Ub:e,Sb:i,Zb:this,Wb:t}):Et(e.Tb.jc,{Ub:e,Sb:i})},zt=n.UnboundTypeError=bt("UnboundTypeError"),n.count_emval_handles=function(){for(var t=0,n=5;n<Qt.length;++n)void 0!==Qt[n]&&++t;return t},n.get_first_emval=function(){for(var t=5;t<Qt.length;++t)if(void 0!==Qt[t])return Qt[t];return null};var jn={n:function(t){return Pn(t+16)+16},p:function(t){var n=(t=new Q(t)).ic();return n.Pc()||(n.Dc(!0),nt--),n.sc(!1),tt.push(t),n.xc(),t.Jc()},Oa:function(t){throw f("Unexpected exception thrown, this is not properly supported - aborting"),b=!0,t},Ua:function(){if(!tt.length)return 0;var t=tt[tt.length-1];return t.ic().xc(),t.hc()},ta:function(t){t&&et(new J(t))},u:function(){En(0);var t=tt.pop();et(t.ic()),t.zc(),it=0},b:function(){var t=it;if(!t)return l=0;var n=new J(t).lc(),r=new Q;if(r.cc(t),r.bc(t),!n)return l=0,0|r.Sb;t=Array.prototype.slice.call(arguments);for(var e=0;e<t.length;e++){var i=t[e];if(0===i||i===n)break;if(Mn(i,n,r.ec()))return l=i,0|r.Sb}return l=n,0|r.Sb},h:function(){var t=it;if(!t)return l=0;var n=new J(t).lc(),r=new Q;if(r.cc(t),r.bc(t),!n)return l=0,0|r.Sb;t=Array.prototype.slice.call(arguments);for(var e=0;e<t.length;e++){var i=t[e];if(0===i||i===n)break;if(Mn(i,n,r.ec()))return l=i,0|r.Sb}return l=n,0|r.Sb},H:function(){var t=it;if(!t)return l=0;var n=new J(t).lc(),r=new Q;if(r.cc(t),r.bc(t),!n)return l=0,0|r.Sb;t=Array.prototype.slice.call(arguments);for(var e=0;e<t.length;e++){var i=t[e];if(0===i||i===n)break;if(Mn(i,n,r.ec()))return l=i,0|r.Sb}return l=n,0|r.Sb},za:function(){var t=it;if(!t)return l=0;var n=new J(t).lc(),r=new Q;if(r.cc(t),r.bc(t),!n)return l=0,0|r.Sb;t=Array.prototype.slice.call(arguments);for(var e=0;e<t.length;e++){var i=t[e];if(0===i||i===n)break;if(Mn(i,n,r.ec()))return l=i,0|r.Sb}return l=n,0|r.Sb},o:rt,sa:function(t){t&&new J(t).xc()},ra:at,Ta:function(t){if(t){var n=new Q;n.cc(t),t=n.ic(),tt.push(n),t.sc(!0),at()}},G:function(t,n,r){throw new J(t).bc(n,r),it=t,nt++,t},Va:function(){return nt},e:function(t){var n=(t=new Q(t)).hc();throw it||(it=n),t.zc(),n},bb:function(t){var n=ot[t];delete ot[t];var r=n.Bc,e=n.ac,i=n.Gc;dt([t],i.map((function(t){return t.Tc})).concat(i.map((function(t){return t.ad}))),(function(t){var a={};return i.forEach((function(n,r){var e=t[r],o=n.Rc,c=n.Sc,u=t[r+i.length],f=n.$c,s=n.bd;a[n.Mc]={read:function(t){return e.fromWireType(o(c,t))},write:function(t,n){var r=[];f(s,t,u.toWireType(r,n)),ct(r)}}})),[{name:n.name,fromWireType:function(t){var n,r={};for(n in a)r[n]=a[n].read(t);return e(t),r},toWireType:function(t,n){for(var i in a)if(!(i in n))throw new TypeError('Missing field: "'+i+'"');var o=r();for(i in a)a[i].write(o,n[i]);return null!==t&&t.push(e,o),o},argPackAdvance:8,readValueFromPointer:ut,Yb:e}]}))},lb:function(){},Za:function(t,n,r,e,i){var a=gt(r);St(t,{name:n=wt(n),fromWireType:function(t){return!!t},toWireType:function(t,n){return n?e:i},argPackAdvance:8,readValueFromPointer:function(t){if(1===r)var e=w;else if(2===r)e=_;else{if(4!==r)throw new TypeError("Unknown boolean type size: "+n);e=R}return this.fromWireType(e[t>>a])},Yb:null})},y:function(t,n,r,e,i,a,o,c,u,f,s,l,h){s=wt(s),a=$t(i,a),c&&(c=$t(o,c)),f&&(f=$t(u,f)),h=$t(l,h);var v=ht(s);xt(v,(function(){Nt("Cannot construct "+s+" due to unbound types",[e])})),dt([t,n,r],e?[e]:[],(function(n){if(n=n[0],e)var r=n.Tb,i=r.jc;else i=Ut.prototype;n=vt(v,(function(){if(Object.getPrototypeOf(this)!==o)throw new Tt("Use 'new' to construct "+s);if(void 0===u.dc)throw new Tt(s+" has no accessible constructor");var t=u.dc[arguments.length];if(void 0===t)throw new Tt("Tried to invoke ctor of "+s+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(u.dc).toString()+") parameters instead!");return t.apply(this,arguments)}));var o=Object.create(i,{constructor:{value:n}});n.prototype=o;var u=new Yt(s,n,o,h,r,a,c,f);r=new Bt(s,u,!0,!1,!1),i=new Bt(s+"*",u,!1,!1,!1);var l=new Bt(s+" const*",u,!1,!0,!1);return jt[t]={pointerType:i,Kc:l},Zt(v,n),[r,i,l]}))},x:function(t,n,r,e,i,a){0<n||z(void 0);var o=Kt(n,r);i=$t(e,i),dt([],[t],(function(t){var r="constructor "+(t=t[0]).name;if(void 0===t.Tb.dc&&(t.Tb.dc=[]),void 0!==t.Tb.dc[n-1])throw new Tt("Cannot register multiple constructors with identical number of parameters ("+(n-1)+") for class '"+t.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!");return t.Tb.dc[n-1]=()=>{Nt("Cannot construct "+t.name+" due to unbound types",o)},dt([],o,(function(e){return e.splice(1,0,null),t.Tb.dc[n-1]=Gt(r,e,null,i,a),[]})),[]}))},m:function(t,n,r,e,i,a,o,c){var u=Kt(r,e);n=wt(n),a=$t(i,a),dt([],[t],(function(t){function e(){Nt("Cannot call "+i+" due to unbound types",u)}var i=(t=t[0]).name+"."+n;n.startsWith("@@")&&(n=Symbol[n.substring(2)]),c&&t.Tb.Xc.push(n);var f=t.Tb.jc,s=f[n];return void 0===s||void 0===s.Vb&&s.className!==t.name&&s.pc===r-2?(e.pc=r-2,e.className=t.name,f[n]=e):(Mt(f,n,i),f[n].Vb[r-2]=e),dt([],u,(function(e){return e=Gt(i,e,t,a,o),void 0===f[n].Vb?(e.pc=r-2,f[n]=e):f[n].Vb[r-2]=e,[]})),[]}))},Ya:function(t,n){St(t,{name:n=wt(n),fromWireType:function(t){var n=nn(t);return tn(t),n},toWireType:function(t,n){return rn(n)},argPackAdvance:8,readValueFromPointer:ut,Yb:null})},Z:function(t,n,r,e){function i(){}r=gt(r),n=wt(n),i.values={},St(t,{name:n,constructor:i,fromWireType:function(t){return this.constructor.values[t]},toWireType:function(t,n){return n.value},argPackAdvance:8,readValueFromPointer:en(n,r,e),Yb:null}),xt(n,i)},Y:function(t,n,r){var e=an(t,"enum");n=wt(n),t=e.constructor,e=Object.create(e.constructor.prototype,{value:{value:r},constructor:{value:vt(e.name+"_"+n,(function(){}))}}),t.values[r]=e,t[n]=e},ua:function(t,n,r){r=gt(r),St(t,{name:n=wt(n),fromWireType:function(t){return t},toWireType:function(t,n){return n},argPackAdvance:8,readValueFromPointer:cn(n,r),Yb:null})},X:function(t,n,r,e,i,a){var o=Kt(n,r);t=wt(t),i=$t(e,i),xt(t,(function(){Nt("Cannot call "+t+" due to unbound types",o)}),n-1),dt([],o,(function(r){return Zt(t,Gt(t,[r[0],null].concat(r.slice(1)),null,i,a),n-1),[]}))},L:function(t,n,r,e,i){n=wt(n),-1===i&&(i=4294967295),i=gt(r);var a=t=>t;if(0===e){var o=32-8*r;a=t=>t<<o>>>o}r=n.includes("unsigned")?function(t,n){return n>>>0}:function(t,n){return n},St(t,{name:n,fromWireType:a,toWireType:r,argPackAdvance:8,readValueFromPointer:un(n,i,0!==e),Yb:null})},I:function(t,n,r){function e(t){var n=A;return new i(m,n[1+(t>>=2)],n[t])}var i=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][n];St(t,{name:r=wt(r),fromWireType:e,argPackAdvance:8,readValueFromPointer:e},{Uc:!0})},wa:function(t,n,r,e,i,a,o,c,u,f,s,l){r=wt(r),a=$t(i,a),c=$t(o,c),f=$t(u,f),l=$t(s,l),dt([t],[n],(function(t){return t=t[0],[new Bt(r,t.Tb,!1,!1,!0,t,e,a,c,f,l)]}))},va:function(t,n){var r="std::string"===(n=wt(n));St(t,{name:n,fromWireType:function(t){var n=A[t>>2];if(r)for(var e=t+4,i=0;i<=n;++i){var a=t+4+i;if(i==n||0==T[a]){if(e=e?y(T,e,a-e):"",void 0===o)var o=e;else o+=String.fromCharCode(0),o+=e;e=a+1}}else{for(o=Array(n),i=0;i<n;++i)o[i]=String.fromCharCode(T[t+4+i]);o=o.join("")}return kn(t),o},toWireType:function(t,n){n instanceof ArrayBuffer&&(n=new Uint8Array(n));var e="string"==typeof n;e||n instanceof Uint8Array||n instanceof Uint8ClampedArray||n instanceof Int8Array||_t("Cannot pass non-string to std::string");var i=(r&&e?()=>g(n):()=>n.length)(),a=Pn(4+i+1);if(A[a>>2]=i,r&&e)d(n,T,a+4,i+1);else if(e)for(e=0;e<i;++e){var o=n.charCodeAt(e);255<o&&(kn(a),_t("String has UTF-16 code units that do not fit in 8 bits")),T[a+4+e]=o}else for(e=0;e<i;++e)T[a+4+e]=n[e];return null!==t&&t.push(kn,a),a},argPackAdvance:8,readValueFromPointer:ut,Yb:function(t){kn(t)}})},ia:function(t,n,r){if(r=wt(r),2===n)var e=k,i=P,a=D,o=()=>S,c=1;else 4===n&&(e=F,i=E,a=O,o=()=>A,c=2);St(t,{name:r,fromWireType:function(t){for(var r,i=A[t>>2],a=o(),u=t+4,f=0;f<=i;++f){var s=t+4+f*n;f!=i&&0!=a[s>>c]||(u=e(u,s-u),void 0===r?r=u:(r+=String.fromCharCode(0),r+=u),u=s+n)}return kn(t),r},toWireType:function(t,e){"string"!=typeof e&&_t("Cannot pass non-string to C++ string type "+r);var o=a(e),u=Pn(4+o+n);return A[u>>2]=o>>c,i(e,u+4,o+n),null!==t&&t.push(kn,u),u},argPackAdvance:8,readValueFromPointer:ut,Yb:function(t){kn(t)}})},z:function(t,n,r,e,i,a){ot[t]={name:wt(n),Bc:$t(r,e),ac:$t(i,a),Gc:[]}},s:function(t,n,r,e,i,a,o,c,u,f){ot[t].Gc.push({Mc:wt(n),Tc:r,Rc:$t(e,i),Sc:a,ad:o,$c:$t(c,u),bd:f})},_a:function(t,n){St(t,{Vc:!0,name:n=wt(n),argPackAdvance:0,fromWireType:function(){},toWireType:function(){}})},eb:function(t,n,r){t=nn(t),n=an(n,"emval::as");var e=[],i=rn(e);return R[r>>2]=i,n.toWireType(e,t)},ab:function(t,n,r,e){t=nn(t),r=fn(n,r);for(var i=Array(n),a=0;a<n;++a){var o=r[a];i[a]=o.readValueFromPointer(e),e+=o.argPackAdvance}return rn(t=t.apply(void 0,i))},Q:function(t,n,r,e,i){t=hn[t],n=nn(n),r=ln(r);var a=[];return R[e>>2]=rn(a),t(n,r,a,i)},F:function(t,n,r,e){(t=hn[t])(n=nn(n),r=ln(r),null,e)},ja:tn,Ia:function(t){return 0===t?rn(vn()):(t=ln(t),rn(vn()[t]))},w:function(t,n){var r=fn(t,n),e=r[0];n=e.name+"_$"+r.slice(1).map((function(t){return t.name})).join("_")+"$";var i=bn[n];if(void 0!==i)return i;i=["retType"];for(var a=[e],o="",c=0;c<t-1;++c)o+=(0!==c?", ":"")+"arg"+c,i.push("argType"+c),a.push(r[1+c]);var u="return function "+ht("methodCaller_"+n)+"(handle, name, destructors, args) {\n",f=0;for(c=0;c<t-1;++c)u+=" var arg"+c+" = argType"+c+".readValueFromPointer(args"+(f?"+"+f:"")+");\n",f+=r[c+1].argPackAdvance;for(u+=" var rv = handle[name]("+o+");\n",c=0;c<t-1;++c)r[c+1].deleteObject&&(u+=" argType"+c+".deleteObject(arg"+c+");\n");return e.Vc||(u+=" return retType.toWireType(destructors, rv);\n"),i.push(u+"};\n"),i=function(t){var n=hn.length;return hn.push(t),n}(t=Lt(i).apply(null,a)),bn[n]=i},fb:function(t){return t=ln(t),rn(n[t])},qb:function(t,n){return rn((t=nn(t))[n=nn(n)])},Da:function(t){4<t&&(Qt[t].Cc+=1)},db:function(t,r,e,i){t=nn(t);var a=pn[r];if(!a){a="";for(var o=0;o<r;++o)a+=(0!==o?", ":"")+"arg"+o;var c="return function emval_allocator_"+r+"(constructor, argTypes, args) {\n";for(o=0;o<r;++o)c+="var argType"+o+" = requireRegisteredType(Module['HEAP32'][(argTypes >>> 2) + "+o+'], "parameter '+o+'");\nvar arg'+o+" = argType"+o+".readValueFromPointer(args);\nargs += argType"+o+"['argPackAdvance'];\n";a=new Function("requireRegisteredType","Module","valueToHandle",c+"var obj = new constructor("+a+");\nreturn valueToHandle(obj);\n}\n")(an,n,rn),pn[r]=a}return a(t,e,i)},$a:function(){return rn([])},mb:function(t){return rn(ln(t))},Ma:function(t){ct(nn(t)),tn(t)},cb:function(t,n){return(t=nn(t))===nn(n)},A:function(t,n){return rn(t=(t=an(t,"_emval_take_value")).readValueFromPointer(n))},ga:function(){z("")},ha:function(t){var n=T.length;if(2147483648<(t>>>=0))return!1;for(var r=1;4>=r;r*=2){var e=n*(1+.2/r);e=Math.min(e,t+100663296);var i=Math;e=Math.max(t,e),i=i.min.call(i,2147483648,e+(65536-e%65536)%65536);t:{try{v.grow(i-m.byteLength+65535>>>16),U();var a=1;break t}catch(t){}a=void 0}if(a)return!0}return!1},Wa:function(t,n){var r=0;return dn().forEach((function(e,i){var a=n+r;for(i=R[t+4*i>>2]=a,a=0;a<e.length;++a)w[i++>>0]=e.charCodeAt(a);w[i>>0]=0,r+=e.length+1})),0},Xa:function(t,n){var r=dn();R[t>>2]=r.length;var e=0;return r.forEach((function(t){e+=t.length+1})),R[n>>2]=e,0},Qa:function(){return 0},Sa:function(t,n,r,e){return t=wn.kd(t),n=wn.hd(t,n,r),R[e>>2]=n,0},kb:function(){},Ra:function(t,n,r,e){for(var i=0,a=0;a<r;a++){var o=R[n>>2],c=R[n+4>>2];n+=8;for(var s=0;s<c;s++){var l=T[o+s],h=mn[t];0===l||10===l?((1===t?u:f)(y(h,0)),h.length=0):h.push(l)}i+=c}return R[e>>2]=i,0},a:function(){return l},Na:function(t,n){var r=On();try{return G(t)(n)}catch(t){if(Un(r),t!==t+0)throw t;En(1,0)}},ma:function(t,n,r){var e=On();try{return G(t)(n,r)}catch(t){if(Un(e),t!==t+0)throw t;En(1,0)}},nb:function(t,n,r,e){var i=On();try{return G(t)(n,r,e)}catch(t){if(Un(i),t!==t+0)throw t;En(1,0)}},E:function(t,n){var r=On();try{return G(t)(n)}catch(t){if(Un(r),t!==t+0)throw t;En(1,0)}},pb:function(t,n,r){var e=On();try{return G(t)(n,r)}catch(t){if(Un(e),t!==t+0)throw t;En(1,0)}},tb:function(t,n,r,e){var i=On();try{return G(t)(n,r,e)}catch(t){if(Un(i),t!==t+0)throw t;En(1,0)}},R:function(t,n,r){var e=On();try{return G(t)(n,r)}catch(t){if(Un(e),t!==t+0)throw t;En(1,0)}},P:function(t,n,r,e,i){var a=On();try{return G(t)(n,r,e,i)}catch(t){if(Un(a),t!==t+0)throw t;En(1,0)}},$:function(t,n,r,e){var i=On();try{return G(t)(n,r,e)}catch(t){if(Un(i),t!==t+0)throw t;En(1,0)}},W:function(t){var n=On();try{return G(t)()}catch(t){if(Un(n),t!==t+0)throw t;En(1,0)}},S:function(t,n){var r=On();try{return G(t)(n)}catch(t){if(Un(r),t!==t+0)throw t;En(1,0)}},Ka:function(t,n,r,e){var i=On();try{return G(t)(n,r,e)}catch(t){if(Un(i),t!==t+0)throw t;En(1,0)}},g:function(t,n){var r=On();try{return G(t)(n)}catch(t){if(Un(r),t!==t+0)throw t;En(1,0)}},fa:function(t,n,r){var e=On();try{return G(t)(n,r)}catch(t){if(Un(e),t!==t+0)throw t;En(1,0)}},N:function(t,n,r){var e=On();try{return G(t)(n,r)}catch(t){if(Un(e),t!==t+0)throw t;En(1,0)}},sb:function(t,n,r,e){var i=On();try{return G(t)(n,r,e)}catch(t){if(Un(i),t!==t+0)throw t;En(1,0)}},c:function(t,n,r){var e=On();try{return G(t)(n,r)}catch(t){if(Un(e),t!==t+0)throw t;En(1,0)}},rb:function(t,n,r,e){var i=On();try{return G(t)(n,r,e)}catch(t){if(Un(i),t!==t+0)throw t;En(1,0)}},oa:function(t,n,r,e,i,a,o){var c=On();try{return G(t)(n,r,e,i,a,o)}catch(t){if(Un(c),t!==t+0)throw t;En(1,0)}},i:function(t,n,r,e){var i=On();try{return G(t)(n,r,e)}catch(t){if(Un(i),t!==t+0)throw t;En(1,0)}},Ha:function(t,n,r,e,i,a,o,c,u,f,s,l,h,v){var b=On();try{return G(t)(n,r,e,i,a,o,c,u,f,s,l,h,v)}catch(t){if(Un(b),t!==t+0)throw t;En(1,0)}},r:function(t,n,r,e,i){var a=On();try{return G(t)(n,r,e,i)}catch(t){if(Un(a),t!==t+0)throw t;En(1,0)}},ya:function(t,n,r,e,i,a){var o=On();try{return G(t)(n,r,e,i,a)}catch(t){if(Un(o),t!==t+0)throw t;En(1,0)}},v:function(t,n,r,e,i,a){var o=On();try{return G(t)(n,r,e,i,a)}catch(t){if(Un(o),t!==t+0)throw t;En(1,0)}},D:function(t,n,r,e,i,a,o){var c=On();try{return G(t)(n,r,e,i,a,o)}catch(t){if(Un(c),t!==t+0)throw t;En(1,0)}},K:function(t,n,r,e,i,a,o,c){var u=On();try{return G(t)(n,r,e,i,a,o,c)}catch(t){if(Un(u),t!==t+0)throw t;En(1,0)}},ca:function(t,n,r,e,i,a,o,c,u){var f=On();try{return G(t)(n,r,e,i,a,o,c,u)}catch(t){if(Un(f),t!==t+0)throw t;En(1,0)}},_:function(t,n,r,e,i,a,o,c,u,f){var s=On();try{return G(t)(n,r,e,i,a,o,c,u,f)}catch(t){if(Un(s),t!==t+0)throw t;En(1,0)}},ba:function(t,n,r,e,i,a,o,c,u,f,s,l){var h=On();try{return G(t)(n,r,e,i,a,o,c,u,f,s,l)}catch(t){if(Un(h),t!==t+0)throw t;En(1,0)}},gb:function(t,n,r,e){var i=On();try{return Vn(t,n,r,e)}catch(t){if(Un(i),t!==t+0)throw t;En(1,0)}},jb:function(t,n,r){var e=On();try{return Yn(t,n,r)}catch(t){if(Un(e),t!==t+0)throw t;En(1,0)}},k:function(t){var n=On();try{G(t)()}catch(t){if(Un(n),t!==t+0)throw t;En(1,0)}},l:function(t,n){var r=On();try{G(t)(n)}catch(t){if(Un(r),t!==t+0)throw t;En(1,0)}},ub:function(t,n,r){var e=On();try{G(t)(n,r)}catch(t){if(Un(e),t!==t+0)throw t;En(1,0)}},pa:function(t,n,r,e){var i=On();try{G(t)(n,r,e)}catch(t){if(Un(i),t!==t+0)throw t;En(1,0)}},ka:function(t,n,r){var e=On();try{G(t)(n,r)}catch(t){if(Un(e),t!==t+0)throw t;En(1,0)}},qa:function(t,n,r,e,i,a,o,c,u,f){var s=On();try{G(t)(n,r,e,i,a,o,c,u,f)}catch(t){if(Un(s),t!==t+0)throw t;En(1,0)}},Fa:function(t,n,r,e){var i=On();try{G(t)(n,r,e)}catch(t){if(Un(i),t!==t+0)throw t;En(1,0)}},Ea:function(t,n,r,e,i,a,o,c){var u=On();try{G(t)(n,r,e,i,a,o,c)}catch(t){if(Un(u),t!==t+0)throw t;En(1,0)}},Ca:function(t,n,r,e,i,a,o){var c=On();try{G(t)(n,r,e,i,a,o)}catch(t){if(Un(c),t!==t+0)throw t;En(1,0)}},d:function(t,n,r){var e=On();try{G(t)(n,r)}catch(t){if(Un(e),t!==t+0)throw t;En(1,0)}},na:function(t,n,r,e){var i=On();try{G(t)(n,r,e)}catch(t){if(Un(i),t!==t+0)throw t;En(1,0)}},U:function(t,n,r,e,i){var a=On();try{G(t)(n,r,e,i)}catch(t){if(Un(a),t!==t+0)throw t;En(1,0)}},T:function(t,n,r,e,i,a){var o=On();try{G(t)(n,r,e,i,a)}catch(t){if(Un(o),t!==t+0)throw t;En(1,0)}},Ba:function(t,n,r,e){var i=On();try{G(t)(n,r,e)}catch(t){if(Un(i),t!==t+0)throw t;En(1,0)}},La:function(t,n,r,e,i,a){var o=On();try{G(t)(n,r,e,i,a)}catch(t){if(Un(o),t!==t+0)throw t;En(1,0)}},ea:function(t,n,r,e,i){var a=On();try{G(t)(n,r,e,i)}catch(t){if(Un(a),t!==t+0)throw t;En(1,0)}},Ja:function(t,n,r,e,i,a,o){var c=On();try{G(t)(n,r,e,i,a,o)}catch(t){if(Un(c),t!==t+0)throw t;En(1,0)}},f:function(t,n,r,e){var i=On();try{G(t)(n,r,e)}catch(t){if(Un(i),t!==t+0)throw t;En(1,0)}},ob:function(t,n,r,e,i){var a=On();try{G(t)(n,r,e,i)}catch(t){if(Un(a),t!==t+0)throw t;En(1,0)}},J:function(t,n,r,e,i,a,o){var c=On();try{G(t)(n,r,e,i,a,o)}catch(t){if(Un(c),t!==t+0)throw t;En(1,0)}},Ga:function(t,n,r,e,i,a){var o=On();try{G(t)(n,r,e,i,a)}catch(t){if(Un(o),t!==t+0)throw t;En(1,0)}},j:function(t,n,r,e,i){var a=On();try{G(t)(n,r,e,i)}catch(t){if(Un(a),t!==t+0)throw t;En(1,0)}},da:function(t,n,r,e,i,a){var o=On();try{G(t)(n,r,e,i,a)}catch(t){if(Un(o),t!==t+0)throw t;En(1,0)}},la:function(t,n,r,e,i,a,o){var c=On();try{G(t)(n,r,e,i,a,o)}catch(t){if(Un(c),t!==t+0)throw t;En(1,0)}},t:function(t,n,r,e,i,a){var o=On();try{G(t)(n,r,e,i,a)}catch(t){if(Un(o),t!==t+0)throw t;En(1,0)}},B:function(t,n,r,e,i,a,o){var c=On();try{G(t)(n,r,e,i,a,o)}catch(t){if(Un(c),t!==t+0)throw t;En(1,0)}},C:function(t,n,r,e,i,a,o,c){var u=On();try{G(t)(n,r,e,i,a,o,c)}catch(t){if(Un(u),t!==t+0)throw t;En(1,0)}},O:function(t,n,r,e,i,a,o,c,u){var f=On();try{G(t)(n,r,e,i,a,o,c,u)}catch(t){if(Un(f),t!==t+0)throw t;En(1,0)}},V:function(t,n,r,e,i,a,o,c,u,f){var s=On();try{G(t)(n,r,e,i,a,o,c,u,f)}catch(t){if(Un(s),t!==t+0)throw t;En(1,0)}},M:function(t,n,r,e,i,a,o,c,u,f,s){var l=On();try{G(t)(n,r,e,i,a,o,c,u,f,s)}catch(t){if(Un(l),t!==t+0)throw t;En(1,0)}},Aa:function(t,n,r,e,i,a,o,c,u,f,s,l){var h=On();try{G(t)(n,r,e,i,a,o,c,u,f,s,l)}catch(t){if(Un(h),t!==t+0)throw t;En(1,0)}},aa:function(t,n,r,e,i,a,o,c,u,f,s,l,h,v,b,p){var y=On();try{G(t)(n,r,e,i,a,o,c,u,f,s,l,h,v,b,p)}catch(t){if(Un(y),t!==t+0)throw t;En(1,0)}},hb:function(t,n,r,e,i,a){var o=On();try{In(t,n,r,e,i,a)}catch(t){if(Un(o),t!==t+0)throw t;En(1,0)}},ib:function(t,n,r,e){var i=On();try{Hn(t,n,r,e)}catch(t){if(Un(i),t!==t+0)throw t;En(1,0)}},q:function(t){return t},xa:function(t){l=t},Pa:function(t,n,r,e){return function(t,n,r,e){function i(t,n,r){for(t="number"==typeof t?t.toString():t||"";t.length<n;)t=r[0]+t;return t}function a(t,n){return i(t,n,"0")}function o(t,n){function r(t){return 0>t?-1:0<t?1:0}var e;return 0===(e=r(t.getFullYear()-n.getFullYear()))&&0===(e=r(t.getMonth()-n.getMonth()))&&(e=r(t.getDate()-n.getDate())),e}function c(t){switch(t.getDay()){case 0:return new Date(t.getFullYear()-1,11,29);case 1:return t;case 2:return new Date(t.getFullYear(),0,3);case 3:return new Date(t.getFullYear(),0,2);case 4:return new Date(t.getFullYear(),0,1);case 5:return new Date(t.getFullYear()-1,11,31);case 6:return new Date(t.getFullYear()-1,11,30)}}function u(t){t=An(new Date(t.Xb+1900,0,1),t.vc);var n=new Date(t.getFullYear()+1,0,4),r=c(new Date(t.getFullYear(),0,4));return n=c(n),0>=o(r,t)?0>=o(n,t)?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var f=R[e+40>>2];for(var s in e={fd:R[e>>2],ed:R[e+4>>2],tc:R[e+8>>2],nc:R[e+12>>2],kc:R[e+16>>2],Xb:R[e+20>>2],uc:R[e+24>>2],vc:R[e+28>>2],md:R[e+32>>2],dd:R[e+36>>2],gd:f&&f?y(T,f,void 0):""},r=r?y(T,r,void 0):"",f={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})r=r.replace(new RegExp(s,"g"),f[s]);var l="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),h="January February March April May June July August September October November December".split(" ");for(s in f={"%a":function(t){return l[t.uc].substring(0,3)},"%A":function(t){return l[t.uc]},"%b":function(t){return h[t.kc].substring(0,3)},"%B":function(t){return h[t.kc]},"%C":function(t){return a((t.Xb+1900)/100|0,2)},"%d":function(t){return a(t.nc,2)},"%e":function(t){return i(t.nc,2," ")},"%g":function(t){return u(t).toString().substring(2)},"%G":function(t){return u(t)},"%H":function(t){return a(t.tc,2)},"%I":function(t){return 0==(t=t.tc)?t=12:12<t&&(t-=12),a(t,2)},"%j":function(t){return a(t.nc+_n(Tn(t.Xb+1900)?Sn:Rn,t.kc-1),3)},"%m":function(t){return a(t.kc+1,2)},"%M":function(t){return a(t.ed,2)},"%n":function(){return"\n"},"%p":function(t){return 0<=t.tc&&12>t.tc?"AM":"PM"},"%S":function(t){return a(t.fd,2)},"%t":function(){return"\t"},"%u":function(t){return t.uc||7},"%U":function(t){var n=new Date(t.Xb+1900,0,1),r=0===n.getDay()?n:An(n,7-n.getDay());return 0>o(r,t=new Date(t.Xb+1900,t.kc,t.nc))?a(Math.ceil((31-r.getDate()+(_n(Tn(t.getFullYear())?Sn:Rn,t.getMonth()-1)-31)+t.getDate())/7),2):0===o(r,n)?"01":"00"},"%V":function(t){var n=new Date(t.Xb+1901,0,4),r=c(new Date(t.Xb+1900,0,4));n=c(n);var e=An(new Date(t.Xb+1900,0,1),t.vc);return 0>o(e,r)?"53":0>=o(n,e)?"01":a(Math.ceil((r.getFullYear()<t.Xb+1900?t.vc+32-r.getDate():t.vc+1-r.getDate())/7),2)},"%w":function(t){return t.uc},"%W":function(t){var n=new Date(t.Xb,0,1),r=1===n.getDay()?n:An(n,0===n.getDay()?1:7-n.getDay()+1);return 0>o(r,t=new Date(t.Xb+1900,t.kc,t.nc))?a(Math.ceil((31-r.getDate()+(_n(Tn(t.getFullYear())?Sn:Rn,t.getMonth()-1)-31)+t.getDate())/7),2):0===o(r,n)?"01":"00"},"%y":function(t){return(t.Xb+1900).toString().substring(2)},"%Y":function(t){return t.Xb+1900},"%z":function(t){var n=0<=(t=t.dd);return t=Math.abs(t)/60,(n?"+":"-")+String("0000"+(t/60*100+t%60)).slice(-4)},"%Z":function(t){return t.gd},"%%":function(){return"%"}},r=r.replace(/%%/g,"\0\0"),f)r.includes(s)&&(r=r.replace(new RegExp(s,"g"),f[s](e)));return(s=function(t){var n=Array(g(t)+1);return d(t,n,0,n.length),n}(r=r.replace(/\0\0/g,"%"))).length>n?0:(w.set(s,t),s.length-1)}(t,n,r,e)}};!function(){function t(t){n.asm=t.exports,v=n.asm.vb,U(),M=n.asm.Cb,Y.unshift(n.asm.wb),B--,n.monitorRunDependencies&&n.monitorRunDependencies(B),0==B&&(null!==Z&&(clearInterval(Z),Z=null),$&&(t=$,$=null,t()))}function r(n){t(n.instance)}function i(t){return(s||"function"!=typeof fetch?Promise.resolve().then((function(){return K()})):fetch(X,{credentials:"same-origin"}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+X+"'";return t.arrayBuffer()})).catch((function(){return K()}))).then((function(t){return WebAssembly.instantiate(t,a)})).then((function(t){return t})).then(t,(function(t){f("failed to asynchronously prepare wasm: "+t),z(t)}))}var a={a:jn};if(B++,n.monitorRunDependencies&&n.monitorRunDependencies(B),n.instantiateWasm)try{return n.instantiateWasm(a,t)}catch(t){return f("Module.instantiateWasm callback failed with error: "+t),!1}(s||"function"!=typeof WebAssembly.instantiateStreaming||q()||"function"!=typeof fetch?i(r):fetch(X,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,a).then(r,(function(t){return f("wasm streaming compile failed: "+t),f("falling back to ArrayBuffer instantiation"),i(r)}))}))).catch(e)}(),n.___wasm_call_ctors=function(){return(n.___wasm_call_ctors=n.asm.wb).apply(null,arguments)};var kn=n._free=function(){return(kn=n._free=n.asm.xb).apply(null,arguments)},Pn=n._malloc=function(){return(Pn=n._malloc=n.asm.yb).apply(null,arguments)};n._main=function(){return(n._main=n.asm.zb).apply(null,arguments)};var Dn=n.___getTypeName=function(){return(Dn=n.___getTypeName=n.asm.Ab).apply(null,arguments)};n.___embind_register_native_and_builtin_types=function(){return(n.___embind_register_native_and_builtin_types=n.asm.Bb).apply(null,arguments)};var Fn,En=n._setThrew=function(){return(En=n._setThrew=n.asm.Db).apply(null,arguments)},On=n.stackSave=function(){return(On=n.stackSave=n.asm.Eb).apply(null,arguments)},Un=n.stackRestore=function(){return(Un=n.stackRestore=n.asm.Fb).apply(null,arguments)},Mn=n.___cxa_can_catch=function(){return(Mn=n.___cxa_can_catch=n.asm.Gb).apply(null,arguments)},xn=n.___cxa_is_pointer_type=function(){return(xn=n.___cxa_is_pointer_type=n.asm.Hb).apply(null,arguments)},Yn=n.dynCall_jii=function(){return(Yn=n.dynCall_jii=n.asm.Ib).apply(null,arguments)},In=n.dynCall_viiji=function(){return(In=n.dynCall_viiji=n.asm.Jb).apply(null,arguments)},Vn=n.dynCall_iij=function(){return(Vn=n.dynCall_iij=n.asm.Kb).apply(null,arguments)},Hn=n.dynCall_vij=function(){return(Hn=n.dynCall_vij=n.asm.Lb).apply(null,arguments)};function Xn(t){this.name="ExitStatus",this.message="Program terminated with exit("+t+")",this.status=t}function Bn(){function t(){if(!Fn&&(Fn=!0,n.calledRun=!0,!b)){if(L(Y),L(I),r(n),n.onRuntimeInitialized&&n.onRuntimeInitialized(),Zn){var t=n._main;try{var e=t(0,0);h||(n.onExit&&n.onExit(e),b=!0),o(e,new Xn(e))}catch(t){t instanceof Xn||"unwind"==t||o(1,t)}}if(n.postRun)for("function"==typeof n.postRun&&(n.postRun=[n.postRun]);n.postRun.length;)t=n.postRun.shift(),V.unshift(t);L(V)}}if(!(0<B)){if(n.preRun)for("function"==typeof n.preRun&&(n.preRun=[n.preRun]);n.preRun.length;)H();L(x),0<B||(n.setStatus?(n.setStatus("Running..."),setTimeout((function(){setTimeout((function(){n.setStatus("")}),1),t()}),1)):t())}}if(n.dynCall_viijii=function(){return(n.dynCall_viijii=n.asm.Mb).apply(null,arguments)},n.dynCall_jiji=function(){return(n.dynCall_jiji=n.asm.Nb).apply(null,arguments)},n.dynCall_iiiiij=function(){return(n.dynCall_iiiiij=n.asm.Ob).apply(null,arguments)},n.dynCall_iiiiijj=function(){return(n.dynCall_iiiiijj=n.asm.Pb).apply(null,arguments)},n.dynCall_iiiiiijj=function(){return(n.dynCall_iiiiiijj=n.asm.Qb).apply(null,arguments)},$=function t(){Fn||Bn(),Fn||($=t)},n.run=Bn,n.preInit)for("function"==typeof n.preInit&&(n.preInit=[n.preInit]);0<n.preInit.length;)n.preInit.pop()();var Zn=!0;return n.noInitialRun&&(Zn=!1),Bn(),t.ready});"object"==typeof exports&&"object"==typeof module?module.exports=ConfiguratorKernel:"function"==typeof define&&define.amd?define([],(function(){return ConfiguratorKernel})):"object"==typeof exports&&(exports.ConfiguratorKernel=ConfiguratorKernel);
|
|
1
|
+
var _scriptDir,ConfiguratorKernel=(_scriptDir="undefined"!=typeof document&&document.currentScript?document.currentScript.src:void 0,function(t){var n,r,e;t=t||{},n||(n=void 0!==t?t:{}),n.ready=new Promise((function(t,n){r=t,e=n}));var i=Object.assign({},n),a="./this.program",o=(t,n)=>{throw n},c="";"undefined"!=typeof document&&document.currentScript&&(c=document.currentScript.src),_scriptDir&&(c=_scriptDir),c=0!==c.indexOf("blob:")?c.substr(0,c.replace(/[?#].*/,"").lastIndexOf("/")+1):"";var u=n.print||console.log.bind(console),f=n.printErr||console.warn.bind(console);Object.assign(n,i),i=null,n.thisProgram&&(a=n.thisProgram),n.quit&&(o=n.quit);var s,l=0;n.wasmBinary&&(s=n.wasmBinary);var h=n.noExitRuntime||!0;"object"!=typeof WebAssembly&&z("no native wasm support detected");var v,b=!1,p="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function y(t,n,r){var e=n+r;for(r=n;t[r]&&!(r>=e);)++r;if(16<r-n&&t.subarray&&p)return p.decode(t.subarray(n,r));for(e="";n<r;){var i=t[n++];if(128&i){var a=63&t[n++];if(192==(224&i))e+=String.fromCharCode((31&i)<<6|a);else{var o=63&t[n++];65536>(i=224==(240&i)?(15&i)<<12|a<<6|o:(7&i)<<18|a<<12|o<<6|63&t[n++])?e+=String.fromCharCode(i):(i-=65536,e+=String.fromCharCode(55296|i>>10,56320|1023&i))}}else e+=String.fromCharCode(i)}return e}function d(t,n,r,e){if(0<e){e=r+e-1;for(var i=0;i<t.length;++i){var a=t.charCodeAt(i);if(55296<=a&&57343>=a&&(a=65536+((1023&a)<<10)|1023&t.charCodeAt(++i)),127>=a){if(r>=e)break;n[r++]=a}else{if(2047>=a){if(r+1>=e)break;n[r++]=192|a>>6}else{if(65535>=a){if(r+2>=e)break;n[r++]=224|a>>12}else{if(r+3>=e)break;n[r++]=240|a>>18,n[r++]=128|a>>12&63}n[r++]=128|a>>6&63}n[r++]=128|63&a}}n[r]=0}}function g(t){for(var n=0,r=0;r<t.length;++r){var e=t.charCodeAt(r);55296<=e&&57343>=e&&(e=65536+((1023&e)<<10)|1023&t.charCodeAt(++r)),127>=e?++n:n=2047>=e?n+2:65535>=e?n+3:n+4}return n}var m,w,T,_,S,R,A,C,W,j="undefined"!=typeof TextDecoder?new TextDecoder("utf-16le"):void 0;function k(t,n){for(var r=t>>1,e=r+n/2;!(r>=e)&&S[r];)++r;if(32<(r<<=1)-t&&j)return j.decode(T.subarray(t,r));for(r="",e=0;!(e>=n/2);++e){var i=_[t+2*e>>1];if(0==i)break;r+=String.fromCharCode(i)}return r}function P(t,n,r){if(void 0===r&&(r=2147483647),2>r)return 0;var e=n;r=(r-=2)<2*t.length?r/2:t.length;for(var i=0;i<r;++i)_[n>>1]=t.charCodeAt(i),n+=2;return _[n>>1]=0,n-e}function D(t){return 2*t.length}function F(t,n){for(var r=0,e="";!(r>=n/4);){var i=R[t+4*r>>2];if(0==i)break;++r,65536<=i?(i-=65536,e+=String.fromCharCode(55296|i>>10,56320|1023&i)):e+=String.fromCharCode(i)}return e}function E(t,n,r){if(void 0===r&&(r=2147483647),4>r)return 0;var e=n;r=e+r-4;for(var i=0;i<t.length;++i){var a=t.charCodeAt(i);if(55296<=a&&57343>=a&&(a=65536+((1023&a)<<10)|1023&t.charCodeAt(++i)),R[n>>2]=a,(n+=4)+4>r)break}return R[n>>2]=0,n-e}function O(t){for(var n=0,r=0;r<t.length;++r){var e=t.charCodeAt(r);55296<=e&&57343>=e&&++r,n+=4}return n}function U(){var t=v.buffer;m=t,n.HEAP8=w=new Int8Array(t),n.HEAP16=_=new Int16Array(t),n.HEAP32=R=new Int32Array(t),n.HEAPU8=T=new Uint8Array(t),n.HEAPU16=S=new Uint16Array(t),n.HEAPU32=A=new Uint32Array(t),n.HEAPF32=C=new Float32Array(t),n.HEAPF64=W=new Float64Array(t)}var M,x=[],Y=[],I=[],V=[];function H(){var t=n.preRun.shift();x.unshift(t)}var X,B=0,Z=null,$=null;function z(t){throw n.onAbort&&n.onAbort(t),f(t="Aborted("+t+")"),b=!0,t=new WebAssembly.RuntimeError(t+". Build with -s ASSERTIONS=1 for more info."),e(t),t}function q(){return X.startsWith("data:application/octet-stream;base64,")}if(n.preloadedImages={},n.preloadedAudios={},X="ConfiguratorKernel.wasm",!q()){var N=X;X=n.locateFile?n.locateFile(N,c):c+N}function K(){var t=X;try{if(t==X&&s)return new Uint8Array(s);throw"both async and sync fetching of the wasm failed"}catch(t){z(t)}}function L(t){for(;0<t.length;){var r=t.shift();if("function"==typeof r)r(n);else{var e=r.jd;"number"==typeof e?void 0===r.yc?G(e)():G(e)(r.yc):e(void 0===r.yc?null:r.yc)}}}function G(t){return M.get(t)}function J(t){this.Fc=t,this.Sb=t-16,this.wc=function(t){R[this.Sb+4>>2]=t},this.lc=function(){return R[this.Sb+4>>2]},this.cc=function(t){R[this.Sb+8>>2]=t},this.Qc=function(){return R[this.Sb+8>>2]},this.ec=function(){R[this.Sb>>2]=0},this.Dc=function(t){w[this.Sb+12>>0]=t?1:0},this.Pc=function(){return 0!=w[this.Sb+12>>0]},this.sc=function(t){w[this.Sb+13>>0]=t?1:0},this.Hc=function(){return 0!=w[this.Sb+13>>0]},this.bc=function(t,n){this.wc(t),this.cc(n),this.ec(),this.Dc(!1),this.sc(!1)},this.xc=function(){R[this.Sb>>2]+=1},this.Zc=function(){var t=R[this.Sb>>2];return R[this.Sb>>2]=t-1,1===t}}function Q(t){this.zc=function(){kn(this.Sb),this.Sb=0},this.cc=function(t){R[this.Sb>>2]=t},this.hc=function(){return R[this.Sb>>2]},this.bc=function(t){R[this.Sb+4>>2]=t},this.ec=function(){return this.Sb+4},this.wc=function(){return R[this.Sb+4>>2]},this.Jc=function(){if(xn(this.ic().lc()))return R[this.hc()>>2];var t=this.wc();return 0!==t?t:this.hc()},this.ic=function(){return new J(this.hc())},void 0===t?(this.Sb=Pn(8),this.bc(0)):this.Sb=t}var tt=[],nt=0;function rt(t){return kn(new J(t).Sb)}function et(t){if(t.Zc()&&!t.Hc()){var n=t.Qc();n&&G(n)(t.Fc),rt(t.Fc)}}var it=0;function at(){var t=tt.pop();t||z("no exception to throw");var n=t.ic(),r=t.hc();throw n.Hc()?t.zc():(tt.push(t),n.sc(!0),n.Dc(!1),nt++),it=r,r}var ot={};function ct(t){for(;t.length;){var n=t.pop();t.pop()(n)}}function ut(t){return this.fromWireType(A[t>>2])}var ft={},st={},lt={};function ht(t){if(void 0===t)return"_unknown";var n=(t=t.replace(/[^a-zA-Z0-9_]/g,"$")).charCodeAt(0);return 48<=n&&57>=n?"_"+t:t}function vt(t,n){return t=ht(t),new Function("body","return function "+t+'() {\n "use strict"; return body.apply(this, arguments);\n};\n')(n)}function bt(t){var n=Error,r=vt(t,(function(n){this.name=t,this.message=n,void 0!==(n=Error(n).stack)&&(this.stack=this.toString()+"\n"+n.replace(/^Error(:[^\n]*)?\n/,""))}));return r.prototype=Object.create(n.prototype),r.prototype.constructor=r,r.prototype.toString=function(){return void 0===this.message?this.name:this.name+": "+this.message},r}var pt=void 0;function yt(t){throw new pt(t)}function dt(t,n,r){function e(n){(n=r(n)).length!==t.length&&yt("Mismatched type converter count");for(var e=0;e<t.length;++e)St(t[e],n[e])}t.forEach((function(t){lt[t]=n}));var i=Array(n.length),a=[],o=0;n.forEach((function(t,n){st.hasOwnProperty(t)?i[n]=st[t]:(a.push(t),ft.hasOwnProperty(t)||(ft[t]=[]),ft[t].push((function(){i[n]=st[t],++o===a.length&&e(i)})))})),0===a.length&&e(i)}function gt(t){switch(t){case 1:return 0;case 2:return 1;case 4:return 2;case 8:return 3;default:throw new TypeError("Unknown type size: "+t)}}var mt=void 0;function wt(t){for(var n="";T[t];)n+=mt[T[t++]];return n}var Tt=void 0;function _t(t){throw new Tt(t)}function St(t,n,r={}){if(!("argPackAdvance"in n))throw new TypeError("registerType registeredInstance requires argPackAdvance");var e=n.name;if(t||_t('type "'+e+'" must have a positive integer typeid pointer'),st.hasOwnProperty(t)){if(r.Uc)return;_t("Cannot register type '"+e+"' twice")}st[t]=n,delete lt[t],ft.hasOwnProperty(t)&&(n=ft[t],delete ft[t],n.forEach((function(t){t()})))}function Rt(t){_t(t.Rb.Ub.Tb.name+" instance already deleted")}var At=!1;function Ct(){}function Wt(t){--t.count.value,0===t.count.value&&(t.Wb?t.Zb.ac(t.Wb):t.Ub.Tb.ac(t.Sb))}var jt={},kt=[];function Pt(){for(;kt.length;){var t=kt.pop();t.Rb.fc=!1,t.delete()}}var Dt=void 0,Ft={};function Et(t,n){return n.Ub&&n.Sb||yt("makeClassHandle requires ptr and ptrType"),!!n.Zb!=!!n.Wb&&yt("Both smartPtrType and smartPtr must be specified"),n.count={value:1},Ot(Object.create(t,{Rb:{value:n}}))}function Ot(t){return"undefined"==typeof FinalizationRegistry?(Ot=t=>t,t):(At=new FinalizationRegistry(t=>{Wt(t.Rb)}),Ct=t=>{At.unregister(t)},(Ot=t=>{var n=t.Rb;return n.Wb&&At.register(t,{Rb:n},t),t})(t))}function Ut(){}function Mt(t,n,r){if(void 0===t[n].Vb){var e=t[n];t[n]=function(){return t[n].Vb.hasOwnProperty(arguments.length)||_t("Function '"+r+"' called with an invalid number of arguments ("+arguments.length+") - expects one of ("+t[n].Vb+")!"),t[n].Vb[arguments.length].apply(this,arguments)},t[n].Vb=[],t[n].Vb[e.pc]=e}}function xt(t,r,e){n.hasOwnProperty(t)?((void 0===e||void 0!==n[t].Vb&&void 0!==n[t].Vb[e])&&_t("Cannot register public name '"+t+"' twice"),Mt(n,t,t),n.hasOwnProperty(e)&&_t("Cannot register multiple overloads of a function with the same number of arguments ("+e+")!"),n[t].Vb[e]=r):(n[t]=r,void 0!==e&&(n[t].ld=e))}function Yt(t,n,r,e,i,a,o,c){this.name=t,this.constructor=n,this.jc=r,this.ac=e,this.$b=i,this.Nc=a,this.oc=o,this.Lc=c,this.Xc=[]}function It(t,n,r){for(;n!==r;)n.oc||_t("Expected null or instance of "+r.name+", got an instance of "+n.name),t=n.oc(t),n=n.$b;return t}function Vt(t,n){return null===n?(this.Ac&&_t("null is not a valid "+this.name),0):(n.Rb||_t('Cannot pass "'+on(n)+'" as a '+this.name),n.Rb.Sb||_t("Cannot pass deleted object as a pointer of type "+this.name),It(n.Rb.Sb,n.Rb.Ub.Tb,this.Tb))}function Ht(t,n){if(null===n){if(this.Ac&&_t("null is not a valid "+this.name),this.rc){var r=this.Bc();return null!==t&&t.push(this.ac,r),r}return 0}if(n.Rb||_t('Cannot pass "'+on(n)+'" as a '+this.name),n.Rb.Sb||_t("Cannot pass deleted object as a pointer of type "+this.name),!this.qc&&n.Rb.Ub.qc&&_t("Cannot convert argument of type "+(n.Rb.Zb?n.Rb.Zb.name:n.Rb.Ub.name)+" to parameter type "+this.name),r=It(n.Rb.Sb,n.Rb.Ub.Tb,this.Tb),this.rc)switch(void 0===n.Rb.Wb&&_t("Passing raw pointer to smart pointer is illegal"),this.cd){case 0:n.Rb.Zb===this?r=n.Rb.Wb:_t("Cannot convert argument of type "+(n.Rb.Zb?n.Rb.Zb.name:n.Rb.Ub.name)+" to parameter type "+this.name);break;case 1:r=n.Rb.Wb;break;case 2:if(n.Rb.Zb===this)r=n.Rb.Wb;else{var e=n.clone();r=this.Yc(r,rn((function(){e.delete()}))),null!==t&&t.push(this.ac,r)}break;default:_t("Unsupporting sharing policy")}return r}function Xt(t,n){return null===n?(this.Ac&&_t("null is not a valid "+this.name),0):(n.Rb||_t('Cannot pass "'+on(n)+'" as a '+this.name),n.Rb.Sb||_t("Cannot pass deleted object as a pointer of type "+this.name),n.Rb.Ub.qc&&_t("Cannot convert argument of type "+n.Rb.Ub.name+" to parameter type "+this.name),It(n.Rb.Sb,n.Rb.Ub.Tb,this.Tb))}function Bt(t,n,r,e,i,a,o,c,u,f,s){this.name=t,this.Tb=n,this.Ac=r,this.qc=e,this.rc=i,this.Wc=a,this.cd=o,this.Ic=c,this.Bc=u,this.Yc=f,this.ac=s,i||void 0!==n.$b?this.toWireType=Ht:(this.toWireType=e?Vt:Xt,this.Yb=null)}function Zt(t,r,e){n.hasOwnProperty(t)||yt("Replacing nonexistant public symbol"),void 0!==n[t].Vb&&void 0!==e?n[t].Vb[e]=r:(n[t]=r,n[t].pc=e)}function $t(t,r){var e=(t=wt(t)).includes("j")?function(t,r){var e=[];return function(){if(e.length=0,Object.assign(e,arguments),t.includes("j")){var i=n["dynCall_"+t];i=e&&e.length?i.apply(null,[r].concat(e)):i.call(null,r)}else i=G(r).apply(null,e);return i}}(t,r):G(r);return"function"!=typeof e&&_t("unknown function pointer with signature "+t+": "+r),e}var zt=void 0;function qt(t){var n=wt(t=Dn(t));return kn(t),n}function Nt(t,n){var r=[],e={};throw n.forEach((function t(n){e[n]||st[n]||(lt[n]?lt[n].forEach(t):(r.push(n),e[n]=!0))})),new zt(t+": "+r.map(qt).join([", "]))}function Kt(t,n){for(var r=[],e=0;e<t;e++)r.push(R[(n>>2)+e]);return r}function Lt(t){var n=Function;if(!(n instanceof Function))throw new TypeError("new_ called with constructor type "+typeof n+" which is not a function");var r=vt(n.name||"unknownFunctionName",(function(){}));return r.prototype=n.prototype,r=new r,(t=n.apply(r,t))instanceof Object?t:r}function Gt(t,n,r,e,i){var a=n.length;2>a&&_t("argTypes array size mismatch! Must at least get return value and 'this' types!");var o=null!==n[1]&&null!==r,c=!1;for(r=1;r<n.length;++r)if(null!==n[r]&&void 0===n[r].Yb){c=!0;break}var u="void"!==n[0].name,f="",s="";for(r=0;r<a-2;++r)f+=(0!==r?", ":"")+"arg"+r,s+=(0!==r?", ":"")+"arg"+r+"Wired";t="return function "+ht(t)+"("+f+") {\nif (arguments.length !== "+(a-2)+") {\nthrowBindingError('function "+t+" called with ' + arguments.length + ' arguments, expected "+(a-2)+" args!');\n}\n",c&&(t+="var destructors = [];\n");var l=c?"destructors":"null";for(f="throwBindingError invoker fn runDestructors retType classParam".split(" "),e=[_t,e,i,ct,n[0],n[1]],o&&(t+="var thisWired = classParam.toWireType("+l+", this);\n"),r=0;r<a-2;++r)t+="var arg"+r+"Wired = argType"+r+".toWireType("+l+", arg"+r+"); // "+n[r+2].name+"\n",f.push("argType"+r),e.push(n[r+2]);if(o&&(s="thisWired"+(0<s.length?", ":"")+s),t+=(u?"var rv = ":"")+"invoker(fn"+(0<s.length?", ":"")+s+");\n",c)t+="runDestructors(destructors);\n";else for(r=o?1:2;r<n.length;++r)a=1===r?"thisWired":"arg"+(r-2)+"Wired",null!==n[r].Yb&&(t+=a+"_dtor("+a+"); // "+n[r].name+"\n",f.push(a+"_dtor"),e.push(n[r].Yb));return u&&(t+="var ret = retType.fromWireType(rv);\nreturn ret;\n"),f.push(t+"}\n"),Lt(f).apply(null,e)}var Jt=[],Qt=[{},{value:void 0},{value:null},{value:!0},{value:!1}];function tn(t){4<t&&0==--Qt[t].Cc&&(Qt[t]=void 0,Jt.push(t))}function nn(t){return t||_t("Cannot use deleted val. handle = "+t),Qt[t].value}function rn(t){switch(t){case void 0:return 1;case null:return 2;case!0:return 3;case!1:return 4;default:var n=Jt.length?Jt.pop():Qt.length;return Qt[n]={Cc:1,value:t},n}}function en(t,n,r){switch(n){case 0:return function(t){return this.fromWireType((r?w:T)[t])};case 1:return function(t){return this.fromWireType((r?_:S)[t>>1])};case 2:return function(t){return this.fromWireType((r?R:A)[t>>2])};default:throw new TypeError("Unknown integer type: "+t)}}function an(t,n){var r=st[t];return void 0===r&&_t(n+" has unknown type "+qt(t)),r}function on(t){if(null===t)return"null";var n=typeof t;return"object"===n||"array"===n||"function"===n?t.toString():""+t}function cn(t,n){switch(n){case 2:return function(t){return this.fromWireType(C[t>>2])};case 3:return function(t){return this.fromWireType(W[t>>3])};default:throw new TypeError("Unknown float type: "+t)}}function un(t,n,r){switch(n){case 0:return r?function(t){return w[t]}:function(t){return T[t]};case 1:return r?function(t){return _[t>>1]}:function(t){return S[t>>1]};case 2:return r?function(t){return R[t>>2]}:function(t){return A[t>>2]};default:throw new TypeError("Unknown integer type: "+t)}}function fn(t,n){for(var r=Array(t),e=0;e<t;++e)r[e]=an(R[(n>>2)+e],"parameter "+e);return r}var sn={};function ln(t){var n=sn[t];return void 0===n?wt(t):n}var hn=[];function vn(){return"object"==typeof globalThis?globalThis:Function("return this")()}var bn=[],pn={},yn={};function dn(){if(!gn){var t,n={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"==typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:a||"./this.program"};for(t in yn)void 0===yn[t]?delete n[t]:n[t]=yn[t];var r=[];for(t in n)r.push(t+"="+n[t]);gn=r}return gn}var gn,mn=[null,[],[]],wn={};function Tn(t){return 0==t%4&&(0!=t%100||0==t%400)}function _n(t,n){for(var r=0,e=0;e<=n;r+=t[e++]);return r}var Sn=[31,29,31,30,31,30,31,31,30,31,30,31],Rn=[31,28,31,30,31,30,31,31,30,31,30,31];function An(t,n){for(t=new Date(t.getTime());0<n;){var r=t.getMonth(),e=(Tn(t.getFullYear())?Sn:Rn)[r];if(!(n>e-t.getDate())){t.setDate(t.getDate()+n);break}n-=e-t.getDate()+1,t.setDate(1),11>r?t.setMonth(r+1):(t.setMonth(0),t.setFullYear(t.getFullYear()+1))}return t}pt=n.InternalError=bt("InternalError");for(var Cn=Array(256),Wn=0;256>Wn;++Wn)Cn[Wn]=String.fromCharCode(Wn);mt=Cn,Tt=n.BindingError=bt("BindingError"),Ut.prototype.isAliasOf=function(t){if(!(this instanceof Ut&&t instanceof Ut))return!1;var n=this.Rb.Ub.Tb,r=this.Rb.Sb,e=t.Rb.Ub.Tb;for(t=t.Rb.Sb;n.$b;)r=n.oc(r),n=n.$b;for(;e.$b;)t=e.oc(t),e=e.$b;return n===e&&r===t},Ut.prototype.clone=function(){if(this.Rb.Sb||Rt(this),this.Rb.mc)return this.Rb.count.value+=1,this;var t=Ot,n=Object,r=n.create,e=Object.getPrototypeOf(this),i=this.Rb;return(t=t(r.call(n,e,{Rb:{value:{count:i.count,fc:i.fc,mc:i.mc,Sb:i.Sb,Ub:i.Ub,Wb:i.Wb,Zb:i.Zb}}}))).Rb.count.value+=1,t.Rb.fc=!1,t},Ut.prototype.delete=function(){this.Rb.Sb||Rt(this),this.Rb.fc&&!this.Rb.mc&&_t("Object already scheduled for deletion"),Ct(this),Wt(this.Rb),this.Rb.mc||(this.Rb.Wb=void 0,this.Rb.Sb=void 0)},Ut.prototype.isDeleted=function(){return!this.Rb.Sb},Ut.prototype.deleteLater=function(){return this.Rb.Sb||Rt(this),this.Rb.fc&&!this.Rb.mc&&_t("Object already scheduled for deletion"),kt.push(this),1===kt.length&&Dt&&Dt(Pt),this.Rb.fc=!0,this},n.getInheritedInstanceCount=function(){return Object.keys(Ft).length},n.getLiveInheritedInstances=function(){var t,n=[];for(t in Ft)Ft.hasOwnProperty(t)&&n.push(Ft[t]);return n},n.flushPendingDeletes=Pt,n.setDelayFunction=function(t){Dt=t,kt.length&&Dt&&Dt(Pt)},Bt.prototype.Oc=function(t){return this.Ic&&(t=this.Ic(t)),t},Bt.prototype.Ec=function(t){this.ac&&this.ac(t)},Bt.prototype.argPackAdvance=8,Bt.prototype.readValueFromPointer=ut,Bt.prototype.deleteObject=function(t){null!==t&&t.delete()},Bt.prototype.fromWireType=function(t){function n(){return this.rc?Et(this.Tb.jc,{Ub:this.Wc,Sb:r,Zb:this,Wb:t}):Et(this.Tb.jc,{Ub:this,Sb:t})}var r=this.Oc(t);if(!r)return this.Ec(t),null;var e=function(t,n){for(void 0===n&&_t("ptr should not be undefined");t.$b;)n=t.oc(n),t=t.$b;return Ft[n]}(this.Tb,r);if(void 0!==e)return 0===e.Rb.count.value?(e.Rb.Sb=r,e.Rb.Wb=t,e.clone()):(e=e.clone(),this.Ec(t),e);if(e=this.Tb.Nc(r),!(e=jt[e]))return n.call(this);e=this.qc?e.Kc:e.pointerType;var i=function t(n,r,e){return r===e?n:void 0===e.$b||null===(n=t(n,r,e.$b))?null:e.Lc(n)}(r,this.Tb,e.Tb);return null===i?n.call(this):this.rc?Et(e.Tb.jc,{Ub:e,Sb:i,Zb:this,Wb:t}):Et(e.Tb.jc,{Ub:e,Sb:i})},zt=n.UnboundTypeError=bt("UnboundTypeError"),n.count_emval_handles=function(){for(var t=0,n=5;n<Qt.length;++n)void 0!==Qt[n]&&++t;return t},n.get_first_emval=function(){for(var t=5;t<Qt.length;++t)if(void 0!==Qt[t])return Qt[t];return null};var jn={n:function(t){return Pn(t+16)+16},p:function(t){var n=(t=new Q(t)).ic();return n.Pc()||(n.Dc(!0),nt--),n.sc(!1),tt.push(t),n.xc(),t.Jc()},Oa:function(t){throw f("Unexpected exception thrown, this is not properly supported - aborting"),b=!0,t},Ua:function(){if(!tt.length)return 0;var t=tt[tt.length-1];return t.ic().xc(),t.hc()},ta:function(t){t&&et(new J(t))},u:function(){En(0);var t=tt.pop();et(t.ic()),t.zc(),it=0},b:function(){var t=it;if(!t)return l=0;var n=new J(t).lc(),r=new Q;if(r.cc(t),r.bc(t),!n)return l=0,0|r.Sb;t=Array.prototype.slice.call(arguments);for(var e=0;e<t.length;e++){var i=t[e];if(0===i||i===n)break;if(Mn(i,n,r.ec()))return l=i,0|r.Sb}return l=n,0|r.Sb},h:function(){var t=it;if(!t)return l=0;var n=new J(t).lc(),r=new Q;if(r.cc(t),r.bc(t),!n)return l=0,0|r.Sb;t=Array.prototype.slice.call(arguments);for(var e=0;e<t.length;e++){var i=t[e];if(0===i||i===n)break;if(Mn(i,n,r.ec()))return l=i,0|r.Sb}return l=n,0|r.Sb},H:function(){var t=it;if(!t)return l=0;var n=new J(t).lc(),r=new Q;if(r.cc(t),r.bc(t),!n)return l=0,0|r.Sb;t=Array.prototype.slice.call(arguments);for(var e=0;e<t.length;e++){var i=t[e];if(0===i||i===n)break;if(Mn(i,n,r.ec()))return l=i,0|r.Sb}return l=n,0|r.Sb},Aa:function(){var t=it;if(!t)return l=0;var n=new J(t).lc(),r=new Q;if(r.cc(t),r.bc(t),!n)return l=0,0|r.Sb;t=Array.prototype.slice.call(arguments);for(var e=0;e<t.length;e++){var i=t[e];if(0===i||i===n)break;if(Mn(i,n,r.ec()))return l=i,0|r.Sb}return l=n,0|r.Sb},o:rt,sa:function(t){t&&new J(t).xc()},ra:at,Ta:function(t){if(t){var n=new Q;n.cc(t),t=n.ic(),tt.push(n),t.sc(!0),at()}},G:function(t,n,r){throw new J(t).bc(n,r),it=t,nt++,t},Va:function(){return nt},e:function(t){var n=(t=new Q(t)).hc();throw it||(it=n),t.zc(),n},cb:function(t){var n=ot[t];delete ot[t];var r=n.Bc,e=n.ac,i=n.Gc;dt([t],i.map((function(t){return t.Tc})).concat(i.map((function(t){return t.ad}))),(function(t){var a={};return i.forEach((function(n,r){var e=t[r],o=n.Rc,c=n.Sc,u=t[r+i.length],f=n.$c,s=n.bd;a[n.Mc]={read:function(t){return e.fromWireType(o(c,t))},write:function(t,n){var r=[];f(s,t,u.toWireType(r,n)),ct(r)}}})),[{name:n.name,fromWireType:function(t){var n,r={};for(n in a)r[n]=a[n].read(t);return e(t),r},toWireType:function(t,n){for(var i in a)if(!(i in n))throw new TypeError('Missing field: "'+i+'"');var o=r();for(i in a)a[i].write(o,n[i]);return null!==t&&t.push(e,o),o},argPackAdvance:8,readValueFromPointer:ut,Yb:e}]}))},lb:function(){},Za:function(t,n,r,e,i){var a=gt(r);St(t,{name:n=wt(n),fromWireType:function(t){return!!t},toWireType:function(t,n){return n?e:i},argPackAdvance:8,readValueFromPointer:function(t){if(1===r)var e=w;else if(2===r)e=_;else{if(4!==r)throw new TypeError("Unknown boolean type size: "+n);e=R}return this.fromWireType(e[t>>a])},Yb:null})},z:function(t,n,r,e,i,a,o,c,u,f,s,l,h){s=wt(s),a=$t(i,a),c&&(c=$t(o,c)),f&&(f=$t(u,f)),h=$t(l,h);var v=ht(s);xt(v,(function(){Nt("Cannot construct "+s+" due to unbound types",[e])})),dt([t,n,r],e?[e]:[],(function(n){if(n=n[0],e)var r=n.Tb,i=r.jc;else i=Ut.prototype;n=vt(v,(function(){if(Object.getPrototypeOf(this)!==o)throw new Tt("Use 'new' to construct "+s);if(void 0===u.dc)throw new Tt(s+" has no accessible constructor");var t=u.dc[arguments.length];if(void 0===t)throw new Tt("Tried to invoke ctor of "+s+" with invalid number of parameters ("+arguments.length+") - expected ("+Object.keys(u.dc).toString()+") parameters instead!");return t.apply(this,arguments)}));var o=Object.create(i,{constructor:{value:n}});n.prototype=o;var u=new Yt(s,n,o,h,r,a,c,f);r=new Bt(s,u,!0,!1,!1),i=new Bt(s+"*",u,!1,!1,!1);var l=new Bt(s+" const*",u,!1,!0,!1);return jt[t]={pointerType:i,Kc:l},Zt(v,n),[r,i,l]}))},y:function(t,n,r,e,i,a){0<n||z(void 0);var o=Kt(n,r);i=$t(e,i),dt([],[t],(function(t){var r="constructor "+(t=t[0]).name;if(void 0===t.Tb.dc&&(t.Tb.dc=[]),void 0!==t.Tb.dc[n-1])throw new Tt("Cannot register multiple constructors with identical number of parameters ("+(n-1)+") for class '"+t.name+"'! Overload resolution is currently only performed using the parameter count, not actual type info!");return t.Tb.dc[n-1]=()=>{Nt("Cannot construct "+t.name+" due to unbound types",o)},dt([],o,(function(e){return e.splice(1,0,null),t.Tb.dc[n-1]=Gt(r,e,null,i,a),[]})),[]}))},m:function(t,n,r,e,i,a,o,c){var u=Kt(r,e);n=wt(n),a=$t(i,a),dt([],[t],(function(t){function e(){Nt("Cannot call "+i+" due to unbound types",u)}var i=(t=t[0]).name+"."+n;n.startsWith("@@")&&(n=Symbol[n.substring(2)]),c&&t.Tb.Xc.push(n);var f=t.Tb.jc,s=f[n];return void 0===s||void 0===s.Vb&&s.className!==t.name&&s.pc===r-2?(e.pc=r-2,e.className=t.name,f[n]=e):(Mt(f,n,i),f[n].Vb[r-2]=e),dt([],u,(function(e){return e=Gt(i,e,t,a,o),void 0===f[n].Vb?(e.pc=r-2,f[n]=e):f[n].Vb[r-2]=e,[]})),[]}))},Ya:function(t,n){St(t,{name:n=wt(n),fromWireType:function(t){var n=nn(t);return tn(t),n},toWireType:function(t,n){return rn(n)},argPackAdvance:8,readValueFromPointer:ut,Yb:null})},Z:function(t,n,r,e){function i(){}r=gt(r),n=wt(n),i.values={},St(t,{name:n,constructor:i,fromWireType:function(t){return this.constructor.values[t]},toWireType:function(t,n){return n.value},argPackAdvance:8,readValueFromPointer:en(n,r,e),Yb:null}),xt(n,i)},Y:function(t,n,r){var e=an(t,"enum");n=wt(n),t=e.constructor,e=Object.create(e.constructor.prototype,{value:{value:r},constructor:{value:vt(e.name+"_"+n,(function(){}))}}),t.values[r]=e,t[n]=e},ua:function(t,n,r){r=gt(r),St(t,{name:n=wt(n),fromWireType:function(t){return t},toWireType:function(t,n){return n},argPackAdvance:8,readValueFromPointer:cn(n,r),Yb:null})},X:function(t,n,r,e,i,a){var o=Kt(n,r);t=wt(t),i=$t(e,i),xt(t,(function(){Nt("Cannot call "+t+" due to unbound types",o)}),n-1),dt([],o,(function(r){return Zt(t,Gt(t,[r[0],null].concat(r.slice(1)),null,i,a),n-1),[]}))},L:function(t,n,r,e,i){n=wt(n),-1===i&&(i=4294967295),i=gt(r);var a=t=>t;if(0===e){var o=32-8*r;a=t=>t<<o>>>o}r=n.includes("unsigned")?function(t,n){return n>>>0}:function(t,n){return n},St(t,{name:n,fromWireType:a,toWireType:r,argPackAdvance:8,readValueFromPointer:un(n,i,0!==e),Yb:null})},I:function(t,n,r){function e(t){var n=A;return new i(m,n[1+(t>>=2)],n[t])}var i=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array][n];St(t,{name:r=wt(r),fromWireType:e,argPackAdvance:8,readValueFromPointer:e},{Uc:!0})},wa:function(t,n,r,e,i,a,o,c,u,f,s,l){r=wt(r),a=$t(i,a),c=$t(o,c),f=$t(u,f),l=$t(s,l),dt([t],[n],(function(t){return t=t[0],[new Bt(r,t.Tb,!1,!1,!0,t,e,a,c,f,l)]}))},va:function(t,n){var r="std::string"===(n=wt(n));St(t,{name:n,fromWireType:function(t){var n=A[t>>2];if(r)for(var e=t+4,i=0;i<=n;++i){var a=t+4+i;if(i==n||0==T[a]){if(e=e?y(T,e,a-e):"",void 0===o)var o=e;else o+=String.fromCharCode(0),o+=e;e=a+1}}else{for(o=Array(n),i=0;i<n;++i)o[i]=String.fromCharCode(T[t+4+i]);o=o.join("")}return kn(t),o},toWireType:function(t,n){n instanceof ArrayBuffer&&(n=new Uint8Array(n));var e="string"==typeof n;e||n instanceof Uint8Array||n instanceof Uint8ClampedArray||n instanceof Int8Array||_t("Cannot pass non-string to std::string");var i=(r&&e?()=>g(n):()=>n.length)(),a=Pn(4+i+1);if(A[a>>2]=i,r&&e)d(n,T,a+4,i+1);else if(e)for(e=0;e<i;++e){var o=n.charCodeAt(e);255<o&&(kn(a),_t("String has UTF-16 code units that do not fit in 8 bits")),T[a+4+e]=o}else for(e=0;e<i;++e)T[a+4+e]=n[e];return null!==t&&t.push(kn,a),a},argPackAdvance:8,readValueFromPointer:ut,Yb:function(t){kn(t)}})},ia:function(t,n,r){if(r=wt(r),2===n)var e=k,i=P,a=D,o=()=>S,c=1;else 4===n&&(e=F,i=E,a=O,o=()=>A,c=2);St(t,{name:r,fromWireType:function(t){for(var r,i=A[t>>2],a=o(),u=t+4,f=0;f<=i;++f){var s=t+4+f*n;f!=i&&0!=a[s>>c]||(u=e(u,s-u),void 0===r?r=u:(r+=String.fromCharCode(0),r+=u),u=s+n)}return kn(t),r},toWireType:function(t,e){"string"!=typeof e&&_t("Cannot pass non-string to C++ string type "+r);var o=a(e),u=Pn(4+o+n);return A[u>>2]=o>>c,i(e,u+4,o+n),null!==t&&t.push(kn,u),u},argPackAdvance:8,readValueFromPointer:ut,Yb:function(t){kn(t)}})},A:function(t,n,r,e,i,a){ot[t]={name:wt(n),Bc:$t(r,e),ac:$t(i,a),Gc:[]}},s:function(t,n,r,e,i,a,o,c,u,f){ot[t].Gc.push({Mc:wt(n),Tc:r,Rc:$t(e,i),Sc:a,ad:o,$c:$t(c,u),bd:f})},_a:function(t,n){St(t,{Vc:!0,name:n=wt(n),argPackAdvance:0,fromWireType:function(){},toWireType:function(){}})},pb:function(t,n,r){t=nn(t),n=an(n,"emval::as");var e=[],i=rn(e);return R[r>>2]=i,n.toWireType(e,t)},bb:function(t,n,r,e){t=nn(t),r=fn(n,r);for(var i=Array(n),a=0;a<n;++a){var o=r[a];i[a]=o.readValueFromPointer(e),e+=o.argPackAdvance}return rn(t=t.apply(void 0,i))},T:function(t,n,r,e,i){t=hn[t],n=nn(n),r=ln(r);var a=[];return R[e>>2]=rn(a),t(n,r,a,i)},E:function(t,n,r,e){(t=hn[t])(n=nn(n),r=ln(r),null,e)},ja:tn,$a:function(t){return 0===t?rn(vn()):(t=ln(t),rn(vn()[t]))},x:function(t,n){var r=fn(t,n),e=r[0];n=e.name+"_$"+r.slice(1).map((function(t){return t.name})).join("_")+"$";var i=bn[n];if(void 0!==i)return i;i=["retType"];for(var a=[e],o="",c=0;c<t-1;++c)o+=(0!==c?", ":"")+"arg"+c,i.push("argType"+c),a.push(r[1+c]);var u="return function "+ht("methodCaller_"+n)+"(handle, name, destructors, args) {\n",f=0;for(c=0;c<t-1;++c)u+=" var arg"+c+" = argType"+c+".readValueFromPointer(args"+(f?"+"+f:"")+");\n",f+=r[c+1].argPackAdvance;for(u+=" var rv = handle[name]("+o+");\n",c=0;c<t-1;++c)r[c+1].deleteObject&&(u+=" argType"+c+".deleteObject(arg"+c+");\n");return e.Vc||(u+=" return retType.toWireType(destructors, rv);\n"),i.push(u+"};\n"),i=function(t){var n=hn.length;return hn.push(t),n}(t=Lt(i).apply(null,a)),bn[n]=i},fb:function(t){return t=ln(t),rn(n[t])},Ia:function(t,n){return rn((t=nn(t))[n=nn(n)])},xa:function(t){4<t&&(Qt[t].Cc+=1)},eb:function(t,r,e,i){t=nn(t);var a=pn[r];if(!a){a="";for(var o=0;o<r;++o)a+=(0!==o?", ":"")+"arg"+o;var c="return function emval_allocator_"+r+"(constructor, argTypes, args) {\n";for(o=0;o<r;++o)c+="var argType"+o+" = requireRegisteredType(Module['HEAP32'][(argTypes >>> 2) + "+o+'], "parameter '+o+'");\nvar arg'+o+" = argType"+o+".readValueFromPointer(args);\nargs += argType"+o+"['argPackAdvance'];\n";a=new Function("requireRegisteredType","Module","valueToHandle",c+"var obj = new constructor("+a+");\nreturn valueToHandle(obj);\n}\n")(an,n,rn),pn[r]=a}return a(t,e,i)},ab:function(){return rn([])},ub:function(t){return rn(ln(t))},Ma:function(t){ct(nn(t)),tn(t)},db:function(t,n){return(t=nn(t))===nn(n)},B:function(t,n){return rn(t=(t=an(t,"_emval_take_value")).readValueFromPointer(n))},ga:function(){z("")},ha:function(t){var n=T.length;if(2147483648<(t>>>=0))return!1;for(var r=1;4>=r;r*=2){var e=n*(1+.2/r);e=Math.min(e,t+100663296);var i=Math;e=Math.max(t,e),i=i.min.call(i,2147483648,e+(65536-e%65536)%65536);t:{try{v.grow(i-m.byteLength+65535>>>16),U();var a=1;break t}catch(t){}a=void 0}if(a)return!0}return!1},Wa:function(t,n){var r=0;return dn().forEach((function(e,i){var a=n+r;for(i=R[t+4*i>>2]=a,a=0;a<e.length;++a)w[i++>>0]=e.charCodeAt(a);w[i>>0]=0,r+=e.length+1})),0},Xa:function(t,n){var r=dn();R[t>>2]=r.length;var e=0;return r.forEach((function(t){e+=t.length+1})),R[n>>2]=e,0},Qa:function(){return 0},Sa:function(t,n,r,e){return t=wn.kd(t),n=wn.hd(t,n,r),R[e>>2]=n,0},kb:function(){},Ra:function(t,n,r,e){for(var i=0,a=0;a<r;a++){var o=R[n>>2],c=R[n+4>>2];n+=8;for(var s=0;s<c;s++){var l=T[o+s],h=mn[t];0===l||10===l?((1===t?u:f)(y(h,0)),h.length=0):h.push(l)}i+=c}return R[e>>2]=i,0},a:function(){return l},Na:function(t,n){var r=On();try{return G(t)(n)}catch(t){if(Un(r),t!==t+0)throw t;En(1,0)}},ma:function(t,n,r){var e=On();try{return G(t)(n,r)}catch(t){if(Un(e),t!==t+0)throw t;En(1,0)}},mb:function(t,n,r,e){var i=On();try{return G(t)(n,r,e)}catch(t){if(Un(i),t!==t+0)throw t;En(1,0)}},F:function(t,n){var r=On();try{return G(t)(n)}catch(t){if(Un(r),t!==t+0)throw t;En(1,0)}},ob:function(t,n,r){var e=On();try{return G(t)(n,r)}catch(t){if(Un(e),t!==t+0)throw t;En(1,0)}},sb:function(t,n,r,e){var i=On();try{return G(t)(n,r,e)}catch(t){if(Un(i),t!==t+0)throw t;En(1,0)}},Q:function(t,n,r){var e=On();try{return G(t)(n,r)}catch(t){if(Un(e),t!==t+0)throw t;En(1,0)}},P:function(t,n,r,e,i){var a=On();try{return G(t)(n,r,e,i)}catch(t){if(Un(a),t!==t+0)throw t;En(1,0)}},$:function(t,n,r,e){var i=On();try{return G(t)(n,r,e)}catch(t){if(Un(i),t!==t+0)throw t;En(1,0)}},W:function(t){var n=On();try{return G(t)()}catch(t){if(Un(n),t!==t+0)throw t;En(1,0)}},V:function(t,n){var r=On();try{return G(t)(n)}catch(t){if(Un(r),t!==t+0)throw t;En(1,0)}},Ka:function(t,n,r,e){var i=On();try{return G(t)(n,r,e)}catch(t){if(Un(i),t!==t+0)throw t;En(1,0)}},g:function(t,n){var r=On();try{return G(t)(n)}catch(t){if(Un(r),t!==t+0)throw t;En(1,0)}},fa:function(t,n,r){var e=On();try{return G(t)(n,r)}catch(t){if(Un(e),t!==t+0)throw t;En(1,0)}},N:function(t,n,r){var e=On();try{return G(t)(n,r)}catch(t){if(Un(e),t!==t+0)throw t;En(1,0)}},rb:function(t,n,r,e){var i=On();try{return G(t)(n,r,e)}catch(t){if(Un(i),t!==t+0)throw t;En(1,0)}},c:function(t,n,r){var e=On();try{return G(t)(n,r)}catch(t){if(Un(e),t!==t+0)throw t;En(1,0)}},qb:function(t,n,r,e){var i=On();try{return G(t)(n,r,e)}catch(t){if(Un(i),t!==t+0)throw t;En(1,0)}},oa:function(t,n,r,e,i,a,o){var c=On();try{return G(t)(n,r,e,i,a,o)}catch(t){if(Un(c),t!==t+0)throw t;En(1,0)}},i:function(t,n,r,e){var i=On();try{return G(t)(n,r,e)}catch(t){if(Un(i),t!==t+0)throw t;En(1,0)}},Ha:function(t,n,r,e,i,a,o,c,u,f,s,l,h,v){var b=On();try{return G(t)(n,r,e,i,a,o,c,u,f,s,l,h,v)}catch(t){if(Un(b),t!==t+0)throw t;En(1,0)}},r:function(t,n,r,e,i){var a=On();try{return G(t)(n,r,e,i)}catch(t){if(Un(a),t!==t+0)throw t;En(1,0)}},za:function(t,n,r,e,i,a){var o=On();try{return G(t)(n,r,e,i,a)}catch(t){if(Un(o),t!==t+0)throw t;En(1,0)}},w:function(t,n,r,e,i,a){var o=On();try{return G(t)(n,r,e,i,a)}catch(t){if(Un(o),t!==t+0)throw t;En(1,0)}},D:function(t,n,r,e,i,a,o){var c=On();try{return G(t)(n,r,e,i,a,o)}catch(t){if(Un(c),t!==t+0)throw t;En(1,0)}},K:function(t,n,r,e,i,a,o,c){var u=On();try{return G(t)(n,r,e,i,a,o,c)}catch(t){if(Un(u),t!==t+0)throw t;En(1,0)}},ca:function(t,n,r,e,i,a,o,c,u){var f=On();try{return G(t)(n,r,e,i,a,o,c,u)}catch(t){if(Un(f),t!==t+0)throw t;En(1,0)}},_:function(t,n,r,e,i,a,o,c,u,f){var s=On();try{return G(t)(n,r,e,i,a,o,c,u,f)}catch(t){if(Un(s),t!==t+0)throw t;En(1,0)}},ba:function(t,n,r,e,i,a,o,c,u,f,s,l){var h=On();try{return G(t)(n,r,e,i,a,o,c,u,f,s,l)}catch(t){if(Un(h),t!==t+0)throw t;En(1,0)}},gb:function(t,n,r,e){var i=On();try{return Vn(t,n,r,e)}catch(t){if(Un(i),t!==t+0)throw t;En(1,0)}},jb:function(t,n,r){var e=On();try{return Yn(t,n,r)}catch(t){if(Un(e),t!==t+0)throw t;En(1,0)}},k:function(t){var n=On();try{G(t)()}catch(t){if(Un(n),t!==t+0)throw t;En(1,0)}},l:function(t,n){var r=On();try{G(t)(n)}catch(t){if(Un(r),t!==t+0)throw t;En(1,0)}},tb:function(t,n,r){var e=On();try{G(t)(n,r)}catch(t){if(Un(e),t!==t+0)throw t;En(1,0)}},pa:function(t,n,r,e){var i=On();try{G(t)(n,r,e)}catch(t){if(Un(i),t!==t+0)throw t;En(1,0)}},ka:function(t,n,r){var e=On();try{G(t)(n,r)}catch(t){if(Un(e),t!==t+0)throw t;En(1,0)}},qa:function(t,n,r,e,i,a,o,c,u,f){var s=On();try{G(t)(n,r,e,i,a,o,c,u,f)}catch(t){if(Un(s),t!==t+0)throw t;En(1,0)}},Fa:function(t,n,r,e){var i=On();try{G(t)(n,r,e)}catch(t){if(Un(i),t!==t+0)throw t;En(1,0)}},Ea:function(t,n,r,e,i,a,o,c){var u=On();try{G(t)(n,r,e,i,a,o,c)}catch(t){if(Un(u),t!==t+0)throw t;En(1,0)}},Da:function(t,n,r,e,i,a,o){var c=On();try{G(t)(n,r,e,i,a,o)}catch(t){if(Un(c),t!==t+0)throw t;En(1,0)}},d:function(t,n,r){var e=On();try{G(t)(n,r)}catch(t){if(Un(e),t!==t+0)throw t;En(1,0)}},na:function(t,n,r,e){var i=On();try{G(t)(n,r,e)}catch(t){if(Un(i),t!==t+0)throw t;En(1,0)}},S:function(t,n,r,e,i){var a=On();try{G(t)(n,r,e,i)}catch(t){if(Un(a),t!==t+0)throw t;En(1,0)}},R:function(t,n,r,e,i,a){var o=On();try{G(t)(n,r,e,i,a)}catch(t){if(Un(o),t!==t+0)throw t;En(1,0)}},Ca:function(t,n,r,e){var i=On();try{G(t)(n,r,e)}catch(t){if(Un(i),t!==t+0)throw t;En(1,0)}},La:function(t,n,r,e,i,a){var o=On();try{G(t)(n,r,e,i,a)}catch(t){if(Un(o),t!==t+0)throw t;En(1,0)}},ea:function(t,n,r,e,i){var a=On();try{G(t)(n,r,e,i)}catch(t){if(Un(a),t!==t+0)throw t;En(1,0)}},Ja:function(t,n,r,e,i,a,o){var c=On();try{G(t)(n,r,e,i,a,o)}catch(t){if(Un(c),t!==t+0)throw t;En(1,0)}},f:function(t,n,r,e){var i=On();try{G(t)(n,r,e)}catch(t){if(Un(i),t!==t+0)throw t;En(1,0)}},nb:function(t,n,r,e,i){var a=On();try{G(t)(n,r,e,i)}catch(t){if(Un(a),t!==t+0)throw t;En(1,0)}},J:function(t,n,r,e,i,a,o){var c=On();try{G(t)(n,r,e,i,a,o)}catch(t){if(Un(c),t!==t+0)throw t;En(1,0)}},Ga:function(t,n,r,e,i,a){var o=On();try{G(t)(n,r,e,i,a)}catch(t){if(Un(o),t!==t+0)throw t;En(1,0)}},j:function(t,n,r,e,i){var a=On();try{G(t)(n,r,e,i)}catch(t){if(Un(a),t!==t+0)throw t;En(1,0)}},da:function(t,n,r,e,i,a){var o=On();try{G(t)(n,r,e,i,a)}catch(t){if(Un(o),t!==t+0)throw t;En(1,0)}},la:function(t,n,r,e,i,a,o){var c=On();try{G(t)(n,r,e,i,a,o)}catch(t){if(Un(c),t!==t+0)throw t;En(1,0)}},t:function(t,n,r,e,i,a){var o=On();try{G(t)(n,r,e,i,a)}catch(t){if(Un(o),t!==t+0)throw t;En(1,0)}},v:function(t,n,r,e,i,a,o){var c=On();try{G(t)(n,r,e,i,a,o)}catch(t){if(Un(c),t!==t+0)throw t;En(1,0)}},C:function(t,n,r,e,i,a,o,c){var u=On();try{G(t)(n,r,e,i,a,o,c)}catch(t){if(Un(u),t!==t+0)throw t;En(1,0)}},O:function(t,n,r,e,i,a,o,c,u){var f=On();try{G(t)(n,r,e,i,a,o,c,u)}catch(t){if(Un(f),t!==t+0)throw t;En(1,0)}},U:function(t,n,r,e,i,a,o,c,u,f){var s=On();try{G(t)(n,r,e,i,a,o,c,u,f)}catch(t){if(Un(s),t!==t+0)throw t;En(1,0)}},M:function(t,n,r,e,i,a,o,c,u,f,s){var l=On();try{G(t)(n,r,e,i,a,o,c,u,f,s)}catch(t){if(Un(l),t!==t+0)throw t;En(1,0)}},Ba:function(t,n,r,e,i,a,o,c,u,f,s,l){var h=On();try{G(t)(n,r,e,i,a,o,c,u,f,s,l)}catch(t){if(Un(h),t!==t+0)throw t;En(1,0)}},aa:function(t,n,r,e,i,a,o,c,u,f,s,l,h,v,b,p){var y=On();try{G(t)(n,r,e,i,a,o,c,u,f,s,l,h,v,b,p)}catch(t){if(Un(y),t!==t+0)throw t;En(1,0)}},hb:function(t,n,r,e,i,a){var o=On();try{In(t,n,r,e,i,a)}catch(t){if(Un(o),t!==t+0)throw t;En(1,0)}},ib:function(t,n,r,e){var i=On();try{Hn(t,n,r,e)}catch(t){if(Un(i),t!==t+0)throw t;En(1,0)}},q:function(t){return t},ya:function(t){l=t},Pa:function(t,n,r,e){return function(t,n,r,e){function i(t,n,r){for(t="number"==typeof t?t.toString():t||"";t.length<n;)t=r[0]+t;return t}function a(t,n){return i(t,n,"0")}function o(t,n){function r(t){return 0>t?-1:0<t?1:0}var e;return 0===(e=r(t.getFullYear()-n.getFullYear()))&&0===(e=r(t.getMonth()-n.getMonth()))&&(e=r(t.getDate()-n.getDate())),e}function c(t){switch(t.getDay()){case 0:return new Date(t.getFullYear()-1,11,29);case 1:return t;case 2:return new Date(t.getFullYear(),0,3);case 3:return new Date(t.getFullYear(),0,2);case 4:return new Date(t.getFullYear(),0,1);case 5:return new Date(t.getFullYear()-1,11,31);case 6:return new Date(t.getFullYear()-1,11,30)}}function u(t){t=An(new Date(t.Xb+1900,0,1),t.vc);var n=new Date(t.getFullYear()+1,0,4),r=c(new Date(t.getFullYear(),0,4));return n=c(n),0>=o(r,t)?0>=o(n,t)?t.getFullYear()+1:t.getFullYear():t.getFullYear()-1}var f=R[e+40>>2];for(var s in e={fd:R[e>>2],ed:R[e+4>>2],tc:R[e+8>>2],nc:R[e+12>>2],kc:R[e+16>>2],Xb:R[e+20>>2],uc:R[e+24>>2],vc:R[e+28>>2],md:R[e+32>>2],dd:R[e+36>>2],gd:f&&f?y(T,f,void 0):""},r=r?y(T,r,void 0):"",f={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"})r=r.replace(new RegExp(s,"g"),f[s]);var l="Sunday Monday Tuesday Wednesday Thursday Friday Saturday".split(" "),h="January February March April May June July August September October November December".split(" ");for(s in f={"%a":function(t){return l[t.uc].substring(0,3)},"%A":function(t){return l[t.uc]},"%b":function(t){return h[t.kc].substring(0,3)},"%B":function(t){return h[t.kc]},"%C":function(t){return a((t.Xb+1900)/100|0,2)},"%d":function(t){return a(t.nc,2)},"%e":function(t){return i(t.nc,2," ")},"%g":function(t){return u(t).toString().substring(2)},"%G":function(t){return u(t)},"%H":function(t){return a(t.tc,2)},"%I":function(t){return 0==(t=t.tc)?t=12:12<t&&(t-=12),a(t,2)},"%j":function(t){return a(t.nc+_n(Tn(t.Xb+1900)?Sn:Rn,t.kc-1),3)},"%m":function(t){return a(t.kc+1,2)},"%M":function(t){return a(t.ed,2)},"%n":function(){return"\n"},"%p":function(t){return 0<=t.tc&&12>t.tc?"AM":"PM"},"%S":function(t){return a(t.fd,2)},"%t":function(){return"\t"},"%u":function(t){return t.uc||7},"%U":function(t){var n=new Date(t.Xb+1900,0,1),r=0===n.getDay()?n:An(n,7-n.getDay());return 0>o(r,t=new Date(t.Xb+1900,t.kc,t.nc))?a(Math.ceil((31-r.getDate()+(_n(Tn(t.getFullYear())?Sn:Rn,t.getMonth()-1)-31)+t.getDate())/7),2):0===o(r,n)?"01":"00"},"%V":function(t){var n=new Date(t.Xb+1901,0,4),r=c(new Date(t.Xb+1900,0,4));n=c(n);var e=An(new Date(t.Xb+1900,0,1),t.vc);return 0>o(e,r)?"53":0>=o(n,e)?"01":a(Math.ceil((r.getFullYear()<t.Xb+1900?t.vc+32-r.getDate():t.vc+1-r.getDate())/7),2)},"%w":function(t){return t.uc},"%W":function(t){var n=new Date(t.Xb,0,1),r=1===n.getDay()?n:An(n,0===n.getDay()?1:7-n.getDay()+1);return 0>o(r,t=new Date(t.Xb+1900,t.kc,t.nc))?a(Math.ceil((31-r.getDate()+(_n(Tn(t.getFullYear())?Sn:Rn,t.getMonth()-1)-31)+t.getDate())/7),2):0===o(r,n)?"01":"00"},"%y":function(t){return(t.Xb+1900).toString().substring(2)},"%Y":function(t){return t.Xb+1900},"%z":function(t){var n=0<=(t=t.dd);return t=Math.abs(t)/60,(n?"+":"-")+String("0000"+(t/60*100+t%60)).slice(-4)},"%Z":function(t){return t.gd},"%%":function(){return"%"}},r=r.replace(/%%/g,"\0\0"),f)r.includes(s)&&(r=r.replace(new RegExp(s,"g"),f[s](e)));return(s=function(t){var n=Array(g(t)+1);return d(t,n,0,n.length),n}(r=r.replace(/\0\0/g,"%"))).length>n?0:(w.set(s,t),s.length-1)}(t,n,r,e)}};!function(){function t(t){n.asm=t.exports,v=n.asm.vb,U(),M=n.asm.Cb,Y.unshift(n.asm.wb),B--,n.monitorRunDependencies&&n.monitorRunDependencies(B),0==B&&(null!==Z&&(clearInterval(Z),Z=null),$&&(t=$,$=null,t()))}function r(n){t(n.instance)}function i(t){return(s||"function"!=typeof fetch?Promise.resolve().then((function(){return K()})):fetch(X,{credentials:"same-origin"}).then((function(t){if(!t.ok)throw"failed to load wasm binary file at '"+X+"'";return t.arrayBuffer()})).catch((function(){return K()}))).then((function(t){return WebAssembly.instantiate(t,a)})).then((function(t){return t})).then(t,(function(t){f("failed to asynchronously prepare wasm: "+t),z(t)}))}var a={a:jn};if(B++,n.monitorRunDependencies&&n.monitorRunDependencies(B),n.instantiateWasm)try{return n.instantiateWasm(a,t)}catch(t){return f("Module.instantiateWasm callback failed with error: "+t),!1}(s||"function"!=typeof WebAssembly.instantiateStreaming||q()||"function"!=typeof fetch?i(r):fetch(X,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,a).then(r,(function(t){return f("wasm streaming compile failed: "+t),f("falling back to ArrayBuffer instantiation"),i(r)}))}))).catch(e)}(),n.___wasm_call_ctors=function(){return(n.___wasm_call_ctors=n.asm.wb).apply(null,arguments)};var kn=n._free=function(){return(kn=n._free=n.asm.xb).apply(null,arguments)},Pn=n._malloc=function(){return(Pn=n._malloc=n.asm.yb).apply(null,arguments)};n._main=function(){return(n._main=n.asm.zb).apply(null,arguments)};var Dn=n.___getTypeName=function(){return(Dn=n.___getTypeName=n.asm.Ab).apply(null,arguments)};n.___embind_register_native_and_builtin_types=function(){return(n.___embind_register_native_and_builtin_types=n.asm.Bb).apply(null,arguments)};var Fn,En=n._setThrew=function(){return(En=n._setThrew=n.asm.Db).apply(null,arguments)},On=n.stackSave=function(){return(On=n.stackSave=n.asm.Eb).apply(null,arguments)},Un=n.stackRestore=function(){return(Un=n.stackRestore=n.asm.Fb).apply(null,arguments)},Mn=n.___cxa_can_catch=function(){return(Mn=n.___cxa_can_catch=n.asm.Gb).apply(null,arguments)},xn=n.___cxa_is_pointer_type=function(){return(xn=n.___cxa_is_pointer_type=n.asm.Hb).apply(null,arguments)},Yn=n.dynCall_jii=function(){return(Yn=n.dynCall_jii=n.asm.Ib).apply(null,arguments)},In=n.dynCall_viiji=function(){return(In=n.dynCall_viiji=n.asm.Jb).apply(null,arguments)},Vn=n.dynCall_iij=function(){return(Vn=n.dynCall_iij=n.asm.Kb).apply(null,arguments)},Hn=n.dynCall_vij=function(){return(Hn=n.dynCall_vij=n.asm.Lb).apply(null,arguments)};function Xn(t){this.name="ExitStatus",this.message="Program terminated with exit("+t+")",this.status=t}function Bn(){function t(){if(!Fn&&(Fn=!0,n.calledRun=!0,!b)){if(L(Y),L(I),r(n),n.onRuntimeInitialized&&n.onRuntimeInitialized(),Zn){var t=n._main;try{var e=t(0,0);h||(n.onExit&&n.onExit(e),b=!0),o(e,new Xn(e))}catch(t){t instanceof Xn||"unwind"==t||o(1,t)}}if(n.postRun)for("function"==typeof n.postRun&&(n.postRun=[n.postRun]);n.postRun.length;)t=n.postRun.shift(),V.unshift(t);L(V)}}if(!(0<B)){if(n.preRun)for("function"==typeof n.preRun&&(n.preRun=[n.preRun]);n.preRun.length;)H();L(x),0<B||(n.setStatus?(n.setStatus("Running..."),setTimeout((function(){setTimeout((function(){n.setStatus("")}),1),t()}),1)):t())}}if(n.dynCall_viijii=function(){return(n.dynCall_viijii=n.asm.Mb).apply(null,arguments)},n.dynCall_jiji=function(){return(n.dynCall_jiji=n.asm.Nb).apply(null,arguments)},n.dynCall_iiiiij=function(){return(n.dynCall_iiiiij=n.asm.Ob).apply(null,arguments)},n.dynCall_iiiiijj=function(){return(n.dynCall_iiiiijj=n.asm.Pb).apply(null,arguments)},n.dynCall_iiiiiijj=function(){return(n.dynCall_iiiiiijj=n.asm.Qb).apply(null,arguments)},$=function t(){Fn||Bn(),Fn||($=t)},n.run=Bn,n.preInit)for("function"==typeof n.preInit&&(n.preInit=[n.preInit]);0<n.preInit.length;)n.preInit.pop()();var Zn=!0;return n.noInitialRun&&(Zn=!1),Bn(),t.ready});"object"==typeof exports&&"object"==typeof module?module.exports=ConfiguratorKernel:"function"==typeof define&&define.amd?define([],(function(){return ConfiguratorKernel})):"object"==typeof exports&&(exports.ConfiguratorKernel=ConfiguratorKernel);
|